hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0d49d101c9456ddb2008b0462c6eb78ae8399c | 11,858 | py | Python | src/fava/application.py | prafullat/fava | 27b1cc7368922696841b130b6efb419db691e95f | [
"MIT"
] | null | null | null | src/fava/application.py | prafullat/fava | 27b1cc7368922696841b130b6efb419db691e95f | [
"MIT"
] | null | null | null | src/fava/application.py | prafullat/fava | 27b1cc7368922696841b130b6efb419db691e95f | [
"MIT"
] | null | null | null | """Fava's main WSGI application.
when using Fava's WSGI app, make sure to set ``app.config['BEANCOUNT_FILES']``.
To start a simple server::
from fava.application import app
app.config['BEANCOUNT_FILES'] = ['/path/to/file.beancount']
app.run('localhost', 5000)
Attributes:
app: An instance of :class:`f... | 29.869018 | 79 | 0.679541 | import datetime
import functools
import threading
from io import BytesIO
from typing import Any
from typing import Dict
from typing import Optional
import flask
import markdown2 import werkzeug.urls
from beancount.core.account import ACCOUNT_RE
from beancount.utils.text_utils import replace_numbers from flask import... | true | true |
1c0d4a19469f7da19828290b350c8d83d5f58c5a | 709 | py | Python | FUNDAMENTALS_MODULE/Text_Processing/EXERCISE/10_Winning_Ticket.py | sleepychild/ProgramingBasicsPython | d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16 | [
"MIT"
] | null | null | null | FUNDAMENTALS_MODULE/Text_Processing/EXERCISE/10_Winning_Ticket.py | sleepychild/ProgramingBasicsPython | d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16 | [
"MIT"
] | 1 | 2022-01-15T10:33:56.000Z | 2022-01-15T10:33:56.000Z | FUNDAMENTALS_MODULE/Text_Processing/EXERCISE/10_Winning_Ticket.py | sleepychild/ProgramingBasicsPython | d96dc4662adc1c8329b731b9c9b7fa4ecf69ec16 | [
"MIT"
] | null | null | null | from typing import List, Tuple
WINNING: Tuple[str] = ('@', '#', '$', '^',)
l: List[str] = [t.strip() for t in input().split(', ')]
for t in l:
if len(t) != 20:
print(f'invalid ticket')
continue
if (t[0] in WINNING) and (t == t[0] * 20):
print(f'ticket "{t}" - 10{t[0]} Jackpot!')
... | 23.633333 | 55 | 0.438646 | from typing import List, Tuple
WINNING: Tuple[str] = ('@', '#', '$', '^',)
l: List[str] = [t.strip() for t in input().split(', ')]
for t in l:
if len(t) != 20:
print(f'invalid ticket')
continue
if (t[0] in WINNING) and (t == t[0] * 20):
print(f'ticket "{t}" - 10{t[0]} Jackpot!')
... | true | true |
1c0d4bd7753a447eb6aadcd7e3e04106663e82d0 | 632 | py | Python | p120m/triangle.py | l33tdaima/l33tdaima | 0a7a9573dc6b79e22dcb54357493ebaaf5e0aa90 | [
"MIT"
] | 1 | 2020-02-20T12:04:46.000Z | 2020-02-20T12:04:46.000Z | p120m/triangle.py | l33tdaima/l33tdaima | 0a7a9573dc6b79e22dcb54357493ebaaf5e0aa90 | [
"MIT"
] | null | null | null | p120m/triangle.py | l33tdaima/l33tdaima | 0a7a9573dc6b79e22dcb54357493ebaaf5e0aa90 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def minimumTotal(self, triangle: List[List[int]]) -> int:
n = len(triangle)
dp = list(triangle[-1])
for i in range(n - 2, -1, -1):
for j in range(len(triangle[i])):
dp[j] = min(dp[j], dp[j + 1]) + triangle[i][j]
r... | 24.307692 | 62 | 0.496835 | from typing import List
class Solution:
def minimumTotal(self, triangle: List[List[int]]) -> int:
n = len(triangle)
dp = list(triangle[-1])
for i in range(n - 2, -1, -1):
for j in range(len(triangle[i])):
dp[j] = min(dp[j], dp[j + 1]) + triangle[i][j]
r... | true | true |
1c0d4d735c9228a524f113a2c6d741051a3ba26d | 9,698 | py | Python | dipy/denoise/tests/test_lpca.py | nasimanousheh/dipy | d737a6af80a184322e30de4760e8c205291dbed0 | [
"MIT"
] | 2 | 2018-07-25T14:04:20.000Z | 2021-02-10T07:10:10.000Z | dipy/denoise/tests/test_lpca.py | nasimanousheh/dipy | d737a6af80a184322e30de4760e8c205291dbed0 | [
"MIT"
] | null | null | null | dipy/denoise/tests/test_lpca.py | nasimanousheh/dipy | d737a6af80a184322e30de4760e8c205291dbed0 | [
"MIT"
] | 2 | 2018-07-24T21:20:54.000Z | 2018-08-27T04:08:24.000Z | import numpy as np
import scipy as sp
import scipy.special as sps
from numpy.testing import (run_module_suite,
assert_,
assert_equal,
assert_raises,
assert_array_almost_equal)
from dipy.denoise.localpca import lo... | 36.596226 | 79 | 0.61456 | import numpy as np
import scipy as sp
import scipy.special as sps
from numpy.testing import (run_module_suite,
assert_,
assert_equal,
assert_raises,
assert_array_almost_equal)
from dipy.denoise.localpca import lo... | true | true |
1c0d4ef519684cf470fe8a9481ea9e1aa72de69c | 1,319 | py | Python | var/spack/repos/builtin/packages/py-importlib-metadata/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-11-28T10:14:14.000Z | 2019-11-28T10:14:14.000Z | var/spack/repos/builtin/packages/py-importlib-metadata/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-importlib-metadata/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyImportlibMetadata(PythonPackage):
"""Read metadata from Python packages."""
homepag... | 47.107143 | 101 | 0.711145 |
from spack import *
class PyImportlibMetadata(PythonPackage):
homepage = "https://importlib-metadata.readthedocs.io/"
url = "https://pypi.io/packages/source/i/importlib_metadata/importlib_metadata-1.2.0.tar.gz"
version('1.2.0', sha256='41e688146d000891f32b1669e8573c57e39e5060e7f5f647aa617cd9a95682... | true | true |
1c0d4f2ef392d50a28c2252a24b8f939b2db8b68 | 8,870 | py | Python | tests/data/minkowski_data.py | chicken-biryani/geomstats | 414b6832c63df60788eda934c694d68fc939708f | [
"MIT"
] | null | null | null | tests/data/minkowski_data.py | chicken-biryani/geomstats | 414b6832c63df60788eda934c694d68fc939708f | [
"MIT"
] | null | null | null | tests/data/minkowski_data.py | chicken-biryani/geomstats | 414b6832c63df60788eda934c694d68fc939708f | [
"MIT"
] | null | null | null | import math
import random
import geomstats.backend as gs
from geomstats.geometry.minkowski import Minkowski
from tests.data_generation import _RiemannianMetricTestData, _VectorSpaceTestData
class MinkowskiTestData(_VectorSpaceTestData):
n_list = random.sample(range(2, 5), 2)
space_args_list = [(n,) for n in ... | 31.565836 | 81 | 0.599211 | import math
import random
import geomstats.backend as gs
from geomstats.geometry.minkowski import Minkowski
from tests.data_generation import _RiemannianMetricTestData, _VectorSpaceTestData
class MinkowskiTestData(_VectorSpaceTestData):
n_list = random.sample(range(2, 5), 2)
space_args_list = [(n,) for n in ... | true | true |
1c0d4f503094684f886c06db1f3930cdbffe3aab | 3,630 | py | Python | dbca/sample_set.py | aypan17/dbca-splitter | faccfa5a17c4222a8214781f01669c91f2cfb56a | [
"MIT"
] | 10 | 2020-10-20T15:35:27.000Z | 2022-01-24T09:51:55.000Z | dbca/sample_set.py | aypan17/dbca-splitter | faccfa5a17c4222a8214781f01669c91f2cfb56a | [
"MIT"
] | null | null | null | dbca/sample_set.py | aypan17/dbca-splitter | faccfa5a17c4222a8214781f01669c91f2cfb56a | [
"MIT"
] | 2 | 2020-10-22T23:13:36.000Z | 2021-02-12T05:53:21.000Z | from typing import List
from functools import partial
from collections import Counter, defaultdict
import logging
from dbca.freq_distribution import FrequencyDistribution
logger = logging.getLogger(__name__)
class SampleSet:
"""
Represents common properties and operations for a collection of samples.
"""... | 29.04 | 85 | 0.636364 | from typing import List
from functools import partial
from collections import Counter, defaultdict
import logging
from dbca.freq_distribution import FrequencyDistribution
logger = logging.getLogger(__name__)
class SampleSet:
def __init__(self):
self.atom_weights_by_sample = defaultdict(C... | true | true |
1c0d4fa1f223a55a23d8a1dbb7a60d00b2422668 | 983 | py | Python | integration-tests/monkeyrunnerTestSuite.py | kincjf/smartnoti | c72434ae0bceb22bce01ab36c655afea15e2ffa0 | [
"Apache-2.0"
] | null | null | null | integration-tests/monkeyrunnerTestSuite.py | kincjf/smartnoti | c72434ae0bceb22bce01ab36c655afea15e2ffa0 | [
"Apache-2.0"
] | null | null | null | integration-tests/monkeyrunnerTestSuite.py | kincjf/smartnoti | c72434ae0bceb22bce01ab36c655afea15e2ffa0 | [
"Apache-2.0"
] | null | null | null | # Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
# Connects to the current device, returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
# Installs the Android package. Notice that this method returns a boolean, so you can test... | 30.71875 | 90 | 0.787386 | from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
device.installPackage('../app/target/com-mobilitylab-smartnoti-1.0.apk')
package = 'com.mobilitylab.smartnoti'
# sets a variable with the name of an Activity in the package
activity = 'com.mobilitylab.smartnoti... | true | true |
1c0d50ac74d207cdd10de5f64a8bf94053b84be1 | 292 | py | Python | tests/test_briefcase_views.py | Murtrag/AutoResume | 20a4874904454a19ff6edba412429c543451642b | [
"MIT"
] | null | null | null | tests/test_briefcase_views.py | Murtrag/AutoResume | 20a4874904454a19ff6edba412429c543451642b | [
"MIT"
] | 47 | 2020-12-07T18:25:02.000Z | 2022-03-30T08:01:32.000Z | tests/test_briefcase_views.py | Murtrag/AutoResume | 20a4874904454a19ff6edba412429c543451642b | [
"MIT"
] | null | null | null | import pytest
from django.urls import reverse
from mixer.backend.django import mixer
def test_display_resume(client):
basic_info = mixer.blend("resume.BasicInfo")
request = client.get(reverse("resume", kwargs={"info_id": basic_info.info_id}))
assert request.status_code == 200
| 26.545455 | 83 | 0.756849 | import pytest
from django.urls import reverse
from mixer.backend.django import mixer
def test_display_resume(client):
basic_info = mixer.blend("resume.BasicInfo")
request = client.get(reverse("resume", kwargs={"info_id": basic_info.info_id}))
assert request.status_code == 200
| true | true |
1c0d51858d1193a1c63ea2f39377b3c9dfa46138 | 4,466 | py | Python | pncAccess.py | tylertjburns/ledgerkeeper | cd69e9f48f35a973d08e450dfffdfea46bdc3802 | [
"MIT"
] | null | null | null | pncAccess.py | tylertjburns/ledgerkeeper | cd69e9f48f35a973d08e450dfffdfea46bdc3802 | [
"MIT"
] | null | null | null | pncAccess.py | tylertjburns/ledgerkeeper | cd69e9f48f35a973d08e450dfffdfea46bdc3802 | [
"MIT"
] | null | null | null | # !/usr/bin/python2
import requests
from datetime import datetime
# import urlparse
import urllib
import urllib.parse as urlparse
# import dropbox
import csv
from bs4 import BeautifulSoup
USERNAME = ""
PASSWORD = ""
pin = [1, 2, 3, 4]
FILENAME = "bank.csv"
# start_date = urllib.quote_plus(datetime(2017, 5, 15).strftim... | 32.362319 | 153 | 0.632333 | import requests
from datetime import datetime
import urllib
import urllib.parse as urlparse
import csv
from bs4 import BeautifulSoup
USERNAME = ""
PASSWORD = ""
pin = [1, 2, 3, 4]
FILENAME = "bank.csv"
ROOT_URL = "https://www.open24.ie/online"
LOGIN_URL = "https://www.pnc.com/en/personal-banking.html"
FORM_ENDPOINT_U... | true | true |
1c0d51ede07965ed01cc5db5fe8b16fa85f5f61c | 552 | py | Python | integrate/stochastic/monte_carlo.py | Jsunseri/integrate | 900354a1107a0e0170bf64d1560963e3bc8df1a1 | [
"BSD-3-Clause"
] | null | null | null | integrate/stochastic/monte_carlo.py | Jsunseri/integrate | 900354a1107a0e0170bf64d1560963e3bc8df1a1 | [
"BSD-3-Clause"
] | null | null | null | integrate/stochastic/monte_carlo.py | Jsunseri/integrate | 900354a1107a0e0170bf64d1560963e3bc8df1a1 | [
"BSD-3-Clause"
] | null | null | null | """
This module implements 1d and 2d Monte Carlo integration
"""
import numpy as np
def monte_1d(x, f, trials):
a = x[0]
b = x[1]
d = (b - a) * np.random.rand(1, trials) + a
y = f(d)
return (b - a) * np.sum(y) / float(trials)
def monte_2d(f, v, domain, trials):
area = np.prod(domain[1] - do... | 23 | 71 | 0.592391 |
import numpy as np
def monte_1d(x, f, trials):
a = x[0]
b = x[1]
d = (b - a) * np.random.rand(1, trials) + a
y = f(d)
return (b - a) * np.sum(y) / float(trials)
def monte_2d(f, v, domain, trials):
area = np.prod(domain[1] - domain[0])
matrix = np.sqrt(area) * np.random.rand(trials, 2) +... | true | true |
1c0d5222034f6babce5d1905b4b8a1e595dec0fb | 4,347 | py | Python | contrib/seeds/generate-seeds.py | mangacoinproject/mangacoin | 7d9bc9ddc0ba324cb415d267972b5acf6c87d650 | [
"MIT"
] | 5 | 2018-08-12T21:08:13.000Z | 2018-10-03T07:28:52.000Z | contrib/seeds/generate-seeds.py | mangacoinproject/mangacoin | 7d9bc9ddc0ba324cb415d267972b5acf6c87d650 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | mangacoinproject/mangacoin | 7d9bc9ddc0ba324cb415d267972b5acf6c87d650 | [
"MIT"
] | 7 | 2018-08-12T04:58:16.000Z | 2019-02-05T06:06:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.273381 | 98 | 0.57994 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:-6], T... | true | true |
1c0d53c1e86078cf5af4871c7115c70084be5a2f | 714 | py | Python | py/number-guessing-game.py | Jesse-Tingle/code-challenges | cf2f150aa9decd5f92cc2b6fb4f42a18aa022e1b | [
"MIT"
] | null | null | null | py/number-guessing-game.py | Jesse-Tingle/code-challenges | cf2f150aa9decd5f92cc2b6fb4f42a18aa022e1b | [
"MIT"
] | null | null | null | py/number-guessing-game.py | Jesse-Tingle/code-challenges | cf2f150aa9decd5f92cc2b6fb4f42a18aa022e1b | [
"MIT"
] | null | null | null | import random
# Computer generates a random number for the user to guess.
randomNumber = random.randint(1, 20)
num = int
# for testing
# print("randomNumber: ", randomNumber)
min = 1
max = 0
num = int(input("Guess a number between 1-20: "))
if num == randomNumber:
print("Wooohooo! You guessed it!")
while (n... | 23.8 | 59 | 0.607843 | import random
randomNumber = random.randint(1, 20)
num = int
min = 1
max = 0
num = int(input("Guess a number between 1-20: "))
if num == randomNumber:
print("Wooohooo! You guessed it!")
while (num != randomNumber ):
if num == randomNumber:
print("Wooohooo! You guessed it!")
elif num < randomN... | true | true |
1c0d541cc1771c7b126f600b563674893cf65bc7 | 1,074 | py | Python | test/test_compat.py | niconoe/pyinaturalist | 981d0a2f350c86e3b6d89e8927f0a1919aaa2b7b | [
"MIT"
] | 47 | 2019-07-23T08:18:02.000Z | 2022-03-17T16:32:17.000Z | test/test_compat.py | niconoe/pyinaturalist | 981d0a2f350c86e3b6d89e8927f0a1919aaa2b7b | [
"MIT"
] | 219 | 2019-08-22T14:45:20.000Z | 2022-03-30T02:39:35.000Z | test/test_compat.py | JWCook/pyinaturalist | 981d0a2f350c86e3b6d89e8927f0a1919aaa2b7b | [
"MIT"
] | 9 | 2020-02-28T04:29:13.000Z | 2022-02-23T03:02:32.000Z | """Tests for backwards-compatible (but deprecated) imports"""
# flake8: noqa: F401
def test_v0_imports():
from pyinaturalist.rest_api import (
add_photo_to_observation,
create_observation,
delete_observation,
get_all_observation_fields,
get_observation_fields,
get_... | 24.976744 | 61 | 0.665736 |
def test_v0_imports():
from pyinaturalist.rest_api import (
add_photo_to_observation,
create_observation,
delete_observation,
get_all_observation_fields,
get_observation_fields,
get_observations,
put_observation_field_values,
update_observation,
... | true | true |
1c0d5501c8a5ef9678bd6f3ee30908d2f090f762 | 785 | py | Python | chapter4/requests/testing_api_rest_post_method.py | testor321/Mastering-Python-for-Networking-and-Security-Second-Edition | 06b97e6e59bba5b346a0500cab2e1ba378a1995b | [
"MIT"
] | 74 | 2020-05-19T01:08:03.000Z | 2022-03-31T14:00:41.000Z | chapter4/requests/testing_api_rest_post_method.py | dec03/Mastering-Python-for-Networking-and-Security-Second-Edition | 144197e0dafc17454f977ba1efae382f133ec402 | [
"MIT"
] | 1 | 2021-06-04T06:08:21.000Z | 2021-06-04T06:08:21.000Z | chapter4/requests/testing_api_rest_post_method.py | dec03/Mastering-Python-for-Networking-and-Security-Second-Edition | 144197e0dafc17454f977ba1efae382f133ec402 | [
"MIT"
] | 47 | 2020-05-05T12:06:31.000Z | 2022-03-10T04:45:01.000Z | #!/usr/bin/env python3
import requests,json
data_dictionary = {"id": "0123456789"}
headers = {"Content-Type" : "application/json","Accept":"application/json"}
response = requests.post("http://httpbin.org/post",data=data_dictionary,headers=headers,json=data_dictionary)
print("HTTP Status Code: " + str(response.status_c... | 28.035714 | 109 | 0.717197 |
import requests,json
data_dictionary = {"id": "0123456789"}
headers = {"Content-Type" : "application/json","Accept":"application/json"}
response = requests.post("http://httpbin.org/post",data=data_dictionary,headers=headers,json=data_dictionary)
print("HTTP Status Code: " + str(response.status_code))
print(response.h... | true | true |
1c0d554e1ddef6ead35ea1c73ecdc11b34fa83f4 | 6,161 | py | Python | python_modules/libraries/dagster-gcp/dagster_gcp/gcs/compute_log_manager.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/libraries/dagster-gcp/dagster_gcp/gcs/compute_log_manager.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-gcp/dagster_gcp/gcs/compute_log_manager.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | import os
from contextlib import contextmanager
from dagster import Field, StringSource, check, seven
from dagster.core.storage.compute_log_manager import (
MAX_BYTES_FILE_READ,
ComputeIOType,
ComputeLogFileData,
ComputeLogManager,
)
from dagster.core.storage.local_compute_log_manager import IO_TYPE_EX... | 38.267081 | 100 | 0.677812 | import os
from contextlib import contextmanager
from dagster import Field, StringSource, check, seven
from dagster.core.storage.compute_log_manager import (
MAX_BYTES_FILE_READ,
ComputeIOType,
ComputeLogFileData,
ComputeLogManager,
)
from dagster.core.storage.local_compute_log_manager import IO_TYPE_EX... | true | true |
1c0d5732af63abdac7ecc8194d80f4e814431f22 | 15,986 | py | Python | hw2/pg2.py | tpvt99/rl-course | 993db19c2c25ed1c51a4f4fbfff2fa170da27562 | [
"MIT"
] | 1 | 2019-05-26T12:08:34.000Z | 2019-05-26T12:08:34.000Z | hw2/pg2.py | tpvt99/rl-course | 993db19c2c25ed1c51a4f4fbfff2fa170da27562 | [
"MIT"
] | 12 | 2019-12-16T21:45:31.000Z | 2022-02-10T00:12:54.000Z | hw2/pg2.py | tpvt99/rl-course | 993db19c2c25ed1c51a4f4fbfff2fa170da27562 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import gym
import logz
import os
import time
import inspect
from multiprocessing import Process
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense
class MLP(Model):
def __init__(self, output_size, scope, n_layers, size, activation = tf.nn.tanh, ... | 38.707022 | 120 | 0.556549 | import tensorflow as tf
import numpy as np
import gym
import logz
import os
import time
import inspect
from multiprocessing import Process
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense
class MLP(Model):
def __init__(self, output_size, scope, n_layers, size, activation = tf.nn.tanh, ... | true | true |
1c0d578c03682a74cd3bcde4937deff28fc2d723 | 3,801 | py | Python | purity_fb/purity_fb_1dot12/models/_snmp_v2c.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot12/models/_snmp_v2c.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot12/models/_snmp_v2c.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.12 Python SDK
Pure Storage FlashBlade REST 1.12 Python SDK. Compatible with REST API versions 1.0 - 1.12. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/... | 30.408 | 251 | 0.586688 |
import pprint
import re
import six
class SnmpV2c(object):
__test__ = False
swagger_types = {
'community': 'str'
}
attribute_map = {
'community': 'community'
}
def __init__(self, community=None):
self._community = None
self.discriminator = None
... | true | true |
1c0d57af1495dca4bd711b0a668eb815e10d3d38 | 261 | py | Python | openff/qcsubmit/__init__.py | Yoshanuikabundi/openff-qcsubmit | c39233d1ad845e7cdcb264a1be8e21b0bd5fcd2b | [
"MIT"
] | 5 | 2019-09-09T07:28:52.000Z | 2020-10-20T00:43:16.000Z | openff/qcsubmit/__init__.py | Yoshanuikabundi/openff-qcsubmit | c39233d1ad845e7cdcb264a1be8e21b0bd5fcd2b | [
"MIT"
] | 82 | 2020-03-20T10:35:45.000Z | 2021-01-18T12:29:37.000Z | openff/qcsubmit/__init__.py | Yoshanuikabundi/openff-qcsubmit | c39233d1ad845e7cdcb264a1be8e21b0bd5fcd2b | [
"MIT"
] | 2 | 2020-02-19T18:08:33.000Z | 2020-12-15T03:50:39.000Z | """
qcsubmit
Automated tools for submitting molecules to QCFractal
"""
# Handle versioneer
from ._version import get_versions
versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
| 21.75 | 53 | 0.796935 | from ._version import get_versions
versions = get_versions()
__version__ = versions["version"]
__git_revision__ = versions["full-revisionid"]
del get_versions, versions
| true | true |
1c0d58386c08a1f9d7cb92f541a5cd68a32d1792 | 596 | py | Python | common.py | dima7a14/personal_tasks_bot | 0a3733c9babba0ad959648df95469d803d882fc3 | [
"MIT"
] | null | null | null | common.py | dima7a14/personal_tasks_bot | 0a3733c9babba0ad959648df95469d803d882fc3 | [
"MIT"
] | null | null | null | common.py | dima7a14/personal_tasks_bot | 0a3733c9babba0ad959648df95469d803d882fc3 | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger("Personal tasks")
conversations = {
"add_list": {
"name": "00",
},
"remove_list": {
"choose_list": "10",
},
"add_tasks": {
"choo... | 19.866667 | 102 | 0.496644 | import logging
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger("Personal tasks")
conversations = {
"add_list": {
"name": "00",
},
"remove_list": {
"choose_list": "10",
},
"add_tasks": {
"choo... | true | true |
1c0d588d507adc752f7d9d93bb8b3bf3277bcd23 | 23,569 | py | Python | slowfast/utils/meters.py | bqhuyy/SlowFast-clean | 3dc000dc9fe1951ab70cb835bfb91b71a07d8f63 | [
"Apache-2.0"
] | null | null | null | slowfast/utils/meters.py | bqhuyy/SlowFast-clean | 3dc000dc9fe1951ab70cb835bfb91b71a07d8f63 | [
"Apache-2.0"
] | null | null | null | slowfast/utils/meters.py | bqhuyy/SlowFast-clean | 3dc000dc9fe1951ab70cb835bfb91b71a07d8f63 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Meters."""
import datetime
import numpy as np
import os
from collections import defaultdict, deque
import torch
from fvcore.common.timer import Timer
from sklearn.metrics import average_precision_score
import slowfast.d... | 32.871688 | 80 | 0.551148 |
import datetime
import numpy as np
import os
from collections import defaultdict, deque
import torch
from fvcore.common.timer import Timer
from sklearn.metrics import average_precision_score
import slowfast.datasets.ava_helper as ava_helper
import slowfast.utils.logging as logging
import slowfast.utils.metrics as me... | true | true |
1c0d5965b98f92404bdcb368781389f12bce8864 | 1,219 | py | Python | recommender/machine.py | Spring-CC/restaurant-native-app | e3ec732a5d9afce1b15d77e799ccbd7e0de90244 | [
"BSD-3-Clause"
] | 2 | 2020-09-21T08:15:09.000Z | 2020-09-24T08:50:37.000Z | recommender/machine.py | Spring-CC/restaurant-native-app | e3ec732a5d9afce1b15d77e799ccbd7e0de90244 | [
"BSD-3-Clause"
] | 1 | 2020-09-20T23:47:00.000Z | 2020-09-20T23:47:00.000Z | recommender/machine.py | Spring-CC/restaurant-native-app | e3ec732a5d9afce1b15d77e799ccbd7e0de90244 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
from pathlib import Path
from ast import literal_eval
from scipy.sparse import csr_matrix
from sklearn.neighbors import NearestNeighbors
import scipy
# sparse matrix
swipeddata_df = pd.read_csv(
'data/testuser.csv', usecols=[0, 1, 2], index_col=1)
swipeddata_df.swiped_right ... | 29.02381 | 75 | 0.748154 | import numpy as np
import pandas as pd
from pathlib import Path
from ast import literal_eval
from scipy.sparse import csr_matrix
from sklearn.neighbors import NearestNeighbors
import scipy
swipeddata_df = pd.read_csv(
'data/testuser.csv', usecols=[0, 1, 2], index_col=1)
swipeddata_df.swiped_right = swipeddata_df.... | true | true |
1c0d5af7973bb3a85bc69b8c6f9c0bd7c72318af | 476 | py | Python | src/hardening_importer/models/common.py | fandigunawan/hardening-importer | 188f0e3b570c5cb4e87c84ff2011c00a58ebf45a | [
"BSD-2-Clause"
] | null | null | null | src/hardening_importer/models/common.py | fandigunawan/hardening-importer | 188f0e3b570c5cb4e87c84ff2011c00a58ebf45a | [
"BSD-2-Clause"
] | null | null | null | src/hardening_importer/models/common.py | fandigunawan/hardening-importer | 188f0e3b570c5cb4e87c84ff2011c00a58ebf45a | [
"BSD-2-Clause"
] | null | null | null | """Hardening Importer - Import IronBank Hardening Manifests for builds.
This module is for encapsulating common model resources.
"""
from enum import Enum
class StrEnum(str, Enum):
"""Represent a choice between a fixed set of strings.
A mix-in of string and enum, representing itself as the string value.
... | 23.8 | 73 | 0.684874 |
from enum import Enum
class StrEnum(str, Enum):
@classmethod
def list(cls) -> list:
return [e.value for e in cls]
| true | true |
1c0d5b44177e0351eaac9ec662fea8ac37ebbebd | 1,102 | py | Python | hazelcast/protocol/codec/replicated_map_get_codec.py | buraksezer/hazelcast-python-client | 4cc593ef7de994bd84fdac8331b81b309cce30a0 | [
"Apache-2.0"
] | 3 | 2020-05-01T15:01:54.000Z | 2021-01-27T14:51:45.000Z | hazelcast/protocol/codec/replicated_map_get_codec.py | buraksezer/hazelcast-python-client | 4cc593ef7de994bd84fdac8331b81b309cce30a0 | [
"Apache-2.0"
] | null | null | null | hazelcast/protocol/codec/replicated_map_get_codec.py | buraksezer/hazelcast-python-client | 4cc593ef7de994bd84fdac8331b81b309cce30a0 | [
"Apache-2.0"
] | 1 | 2020-12-01T20:00:35.000Z | 2020-12-01T20:00:35.000Z | from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.codec.replicated_map_message_type import *
REQUEST_TYPE = REPLICATEDMAP_GET
RESPONSE_TYPE = 105
RETRYABLE = True
def calculate_size(name, key):
""" Calculates the request payload size"""... | 31.485714 | 74 | 0.768603 | from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.codec.replicated_map_message_type import *
REQUEST_TYPE = REPLICATEDMAP_GET
RESPONSE_TYPE = 105
RETRYABLE = True
def calculate_size(name, key):
data_size = 0
data_size += calculate_s... | true | true |
1c0d5ba1302338579be2a7b8803084ee26b1de3d | 47,067 | py | Python | virtualenv/Lib/platform.py | DPNT-Sourcecode/CHK-hbjk01 | 270d6dc5433845352a27ab5caa8bc1d5ecf1236c | [
"Apache-2.0"
] | 3 | 2015-04-09T03:57:26.000Z | 2016-07-25T10:00:34.000Z | virtualenv/Lib/platform.py | DPNT-Sourcecode/CHK-hbjk01 | 270d6dc5433845352a27ab5caa8bc1d5ecf1236c | [
"Apache-2.0"
] | 11 | 2020-01-28T22:49:05.000Z | 2022-03-11T23:50:27.000Z | virtualenv/Lib/platform.py | DPNT-Sourcecode/CHK-hbjk01 | 270d6dc5433845352a27ab5caa8bc1d5ecf1236c | [
"Apache-2.0"
] | 1 | 2020-07-30T10:53:19.000Z | 2020-07-30T10:53:19.000Z | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | 32.868017 | 88 | 0.59462 |
# (e.g. Mac) or fail on socket.gethostname(); fixed libc
# detection RE
# 0.5.0 - changed the API names referring to system commands to *syscmd*;
# added java_ver(); made syscmd_ver() a private
# API (was system_ver() in previous versions) -- use uname()
# inst... | true | true |
1c0d5c27b3c3f5bec686664fbc651737e14c77dc | 1,260 | py | Python | raven/projects/Scripts/SaltDensityCalc.py | arfc/2019-12-bigdata-npps | ebf03664c1d96541956d317f3a305323cf76c23d | [
"CC-BY-4.0"
] | null | null | null | raven/projects/Scripts/SaltDensityCalc.py | arfc/2019-12-bigdata-npps | ebf03664c1d96541956d317f3a305323cf76c23d | [
"CC-BY-4.0"
] | 2 | 2019-10-26T14:32:13.000Z | 2019-12-17T17:48:05.000Z | raven/projects/Scripts/SaltDensityCalc.py | arfc/2019-12-bigdata-npps | ebf03664c1d96541956d317f3a305323cf76c23d | [
"CC-BY-4.0"
] | 3 | 2019-10-25T18:50:31.000Z | 2020-06-23T04:17:28.000Z | import numpy as np
def evaluate(self):
# salt_density = 13.652 - 7.943e-3*self.Tave_fuel # UCl3
# salt_density = 7.784 - 9.92e-4*self.Tave_fuel # UCl3
# salt_density = 4.823 - 1.4e-3*self.Tave_fuel # ThCl4
# salt_density = 7.108 - 7.59e-4*self.Tave_fuel # ThF4
if self.salt_type == 1: ... | 60 | 98 | 0.6 | import numpy as np
def evaluate(self):
if self.salt_type == 1: salt_density = 3.628 - 6.6e-4*(self.Tave_fuel-273) elif self.salt_type == 2: salt_density = 5.52- 1.964e-3*self.Tave_fuel else: salt_density ... | true | true |
1c0d5d828962ce1d89c3207c8f1e20c292686d99 | 859 | py | Python | examples/docs_snippets/docs_snippets_tests/integrations_tests/test_airflow.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2021-01-31T19:16:29.000Z | 2021-01-31T19:16:29.000Z | examples/docs_snippets/docs_snippets_tests/integrations_tests/test_airflow.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets_tests/integrations_tests/test_airflow.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2021-12-08T18:13:19.000Z | 2021-12-08T18:13:19.000Z | from docs_snippets.integrations.airflow.hello_cereal import hello_cereal_job
def test_hello_cereal():
assert hello_cereal_job.execute_in_process().success
# https://github.com/dagster-io/dagster/issues/5534
# def test_hello_cereal_dag():
# from docs_snippets.integrations.airflow.hello_cereal_dag import dag,... | 31.814815 | 81 | 0.771828 | from docs_snippets.integrations.airflow.hello_cereal import hello_cereal_job
def test_hello_cereal():
assert hello_cereal_job.execute_in_process().success
| true | true |
1c0d5dad8ae170554cdea39616012af9199d300a | 1,197 | py | Python | plugins/modules/pxgrid_user_group_by_username_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/modules/pxgrid_user_group_by_username_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/modules/pxgrid_user_group_by_username_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: pxgrid_user_group_by_username_info
short_description: Information module for Pxgrid User Group By Username Info
de... | 27.204545 | 92 | 0.7335 |
DOCUMENTATION = r"""
---
module: pxgrid_user_group_by_username_info
short_description: Information module for Pxgrid User Group By Username Info
description:
- Get Pxgrid User Group By Username Info.
version_added: '1.0.0'
author: Rafael Campos (@racampos)
options: {}
requirements:
- ciscoisesdk
seealso:
# Reference ... | true | true |
1c0d5db3a2e0a2154f402ac69538da72a042d94b | 132 | py | Python | prototype/back-end/adminapi/apps.py | nWo-deHack/CNAP | f4ece37bdf148627d686cda5134f6a0991ae4cfe | [
"Unlicense"
] | null | null | null | prototype/back-end/adminapi/apps.py | nWo-deHack/CNAP | f4ece37bdf148627d686cda5134f6a0991ae4cfe | [
"Unlicense"
] | null | null | null | prototype/back-end/adminapi/apps.py | nWo-deHack/CNAP | f4ece37bdf148627d686cda5134f6a0991ae4cfe | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class AdminapiConfig(AppConfig):
name = 'adminapi'
| 16.5 | 39 | 0.795455 | from __future__ import unicode_literals
from django.apps import AppConfig
class AdminapiConfig(AppConfig):
name = 'adminapi'
| true | true |
1c0d5de9dd98768606198f943f936cb053d1d04a | 1,619 | py | Python | unit_tests/test_all_agents.py | arenarium/battleground | dc58bd4898451e6498b291dcc2a671ed2e726297 | [
"MIT"
] | 1 | 2018-01-20T10:10:50.000Z | 2018-01-20T10:10:50.000Z | unit_tests/test_all_agents.py | vincentropy/battleground | dc58bd4898451e6498b291dcc2a671ed2e726297 | [
"MIT"
] | 109 | 2017-07-01T17:36:27.000Z | 2017-12-21T22:57:24.000Z | unit_tests/test_all_agents.py | arenarium/battleground | dc58bd4898451e6498b291dcc2a671ed2e726297 | [
"MIT"
] | 4 | 2017-12-03T16:31:29.000Z | 2017-12-23T17:56:25.000Z | import pytest
from battleground.dynamic_agent import DynamicAgent
from battleground.site_runner import start_session
import glob
import json
import os.path
import os
@pytest.fixture(scope="module")
def state_to_test():
config_file = 'unit_tests/test_configurations/arena_pos_test_config.json'
agents, engine =... | 29.981481 | 83 | 0.662137 | import pytest
from battleground.dynamic_agent import DynamicAgent
from battleground.site_runner import start_session
import glob
import json
import os.path
import os
@pytest.fixture(scope="module")
def state_to_test():
config_file = 'unit_tests/test_configurations/arena_pos_test_config.json'
agents, engine =... | true | true |
1c0d5e9964c55794bd85ce871cced98f6965a1b0 | 1,735 | py | Python | freeze.py | erihsu/vgg16_quantization | 677c3c2cabcef68e89149bd74d17f44c0f496749 | [
"MIT"
] | 2 | 2020-08-10T06:17:58.000Z | 2020-08-10T06:26:13.000Z | freeze.py | xuzhenyu69/vgg16_quantization | 677c3c2cabcef68e89149bd74d17f44c0f496749 | [
"MIT"
] | 2 | 2020-08-10T05:53:52.000Z | 2020-08-10T06:02:49.000Z | freeze.py | erihsu/vgg16_quantization | 677c3c2cabcef68e89149bd74d17f44c0f496749 | [
"MIT"
] | null | null | null | import os
import argparse
import tensorflow as tf
def freeze_graph(model_ckpt, output_nodes, rename_nodes=None):
meta_file = model_ckpt + '.meta'
if not tf.gfile.Exists(meta_file):
raise FileNotFoundError('file not found: %s' % meta_file)
model_dir = "/".join(os.path.abspath(model_ckpt).split('/')... | 36.914894 | 100 | 0.669741 | import os
import argparse
import tensorflow as tf
def freeze_graph(model_ckpt, output_nodes, rename_nodes=None):
meta_file = model_ckpt + '.meta'
if not tf.gfile.Exists(meta_file):
raise FileNotFoundError('file not found: %s' % meta_file)
model_dir = "/".join(os.path.abspath(model_ckpt).split('/')... | true | true |
1c0d5edb827a93132ecddce7a7e4bda7c86dd0de | 26,041 | py | Python | thelper/data/geo/ogc.py | crim-ca/thelper | 1415144cf70e4492c2ef00f834e2b9a988064a76 | [
"Apache-2.0"
] | null | null | null | thelper/data/geo/ogc.py | crim-ca/thelper | 1415144cf70e4492c2ef00f834e2b9a988064a76 | [
"Apache-2.0"
] | null | null | null | thelper/data/geo/ogc.py | crim-ca/thelper | 1415144cf70e4492c2ef00f834e2b9a988064a76 | [
"Apache-2.0"
] | 1 | 2020-02-17T14:14:46.000Z | 2020-02-17T14:14:46.000Z | """Data parsers & utilities module for OGC-related projects."""
import copy
import functools
import logging
import cv2 as cv
import numpy as np
import tqdm
import thelper.data
import thelper.data.geo as geo
import thelper.train.utils
logger = logging.getLogger(__name__)
class TB15D104:
"""Wrapper class for OG... | 55.17161 | 126 | 0.595446 |
import copy
import functools
import logging
import cv2 as cv
import numpy as np
import tqdm
import thelper.data
import thelper.data.geo as geo
import thelper.train.utils
logger = logging.getLogger(__name__)
class TB15D104:
TYPECE_RIVER = "10"
TYPECE_LAKE = "21"
BACKGROUND_ID = 0
LAKE_ID = 1
cl... | true | true |
1c0d5fa0ac57596646e81ed65681848227c1925a | 178 | py | Python | machina/core/markdown.py | danielmcquillen/django-machina | 08aa3a58a7889b0d5a5bcd6c24965c524762c7a6 | [
"BSD-3-Clause"
] | null | null | null | machina/core/markdown.py | danielmcquillen/django-machina | 08aa3a58a7889b0d5a5bcd6c24965c524762c7a6 | [
"BSD-3-Clause"
] | 2 | 2021-06-02T00:29:11.000Z | 2021-09-01T23:02:30.000Z | machina/core/markdown.py | danielmcquillen/django-machina | 08aa3a58a7889b0d5a5bcd6c24965c524762c7a6 | [
"BSD-3-Clause"
] | null | null | null | from django.utils.encoding import smart_text
from markdown2 import markdown as _markdown
def markdown(text, **kwargs):
return smart_text(_markdown(text, **kwargs).strip())
| 25.428571 | 56 | 0.775281 | from django.utils.encoding import smart_text
from markdown2 import markdown as _markdown
def markdown(text, **kwargs):
return smart_text(_markdown(text, **kwargs).strip())
| true | true |
1c0d60689c8f6c00082c33e38f11ffa854e0a391 | 9,044 | py | Python | fastclass/fc_clean.py | DandyWei/gui_final | 863f41e488ad6eff411df0f57ae19c979ae2a6da | [
"Apache-2.0"
] | null | null | null | fastclass/fc_clean.py | DandyWei/gui_final | 863f41e488ad6eff411df0f57ae19c979ae2a6da | [
"Apache-2.0"
] | null | null | null | fastclass/fc_clean.py | DandyWei/gui_final | 863f41e488ad6eff411df0f57ae19c979ae2a6da | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# fastclass - fc_clean.py
#
# Christian Werner, 2018-10-23
import click
from collections import deque
from functools import partial
import itertools as it
import os
from pathlib import Path
from PIL import ImageTk, Image
import tkinter as tk
from tkinter import ttk
import shutil
from imageproc... | 30.247492 | 448 | 0.596528 |
import click
from collections import deque
from functools import partial
import itertools as it
import os
from pathlib import Path
from PIL import ImageTk, Image
import tkinter as tk
from tkinter import ttk
import shutil
from imageprocessing import image_pad
EPILOG = """::: FastClass fcc :::\r
...a fast way to clean... | true | true |
1c0d607410e08d51ac06a3024c4816fa024bc009 | 26,348 | py | Python | discord/threads.py | NextChai/discord.py | 1bb8ea97db38594cd2f1bbc727b81e0bba81efc3 | [
"MIT"
] | 8 | 2021-08-28T03:10:57.000Z | 2021-10-31T07:49:18.000Z | discord/threads.py | NextChai/discord.py | 1bb8ea97db38594cd2f1bbc727b81e0bba81efc3 | [
"MIT"
] | null | null | null | discord/threads.py | NextChai/discord.py | 1bb8ea97db38594cd2f1bbc727b81e0bba81efc3 | [
"MIT"
] | 1 | 2021-09-30T13:49:45.000Z | 2021-09-30T13:49:45.000Z | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | 32.771144 | 114 | 0.605435 |
from __future__ import annotations
from typing import Awaitable, Callable, Dict, Iterable, List, Optional, Union, TYPE_CHECKING
import time
import asyncio
from .mixins import Hashable
from .abc import Messageable
from .enums import ChannelType, try_enum
from .errors import ClientException
from .utils import MISSING,... | true | true |
1c0d618b784ffa1d3b79d9b5043f5a0c7dc898bb | 7,360 | py | Python | LegTrajectory.py | Y-miura-ta/Nyanko | 4a6216c68fb727908fa8d296f01dbbb2cbcc2775 | [
"MIT"
] | null | null | null | LegTrajectory.py | Y-miura-ta/Nyanko | 4a6216c68fb727908fa8d296f01dbbb2cbcc2775 | [
"MIT"
] | null | null | null | LegTrajectory.py | Y-miura-ta/Nyanko | 4a6216c68fb727908fa8d296f01dbbb2cbcc2775 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
g = 9800 # 単位は [mm/s^2]
# 5次スプラインを求めるための行列は時間軸を正規化するので固定可能
S_RATE = 1.0
Cmat = np.array([
[0, 0, 0, 0, 0, 1],
[S_RATE**5, S_RATE**4, S_RATE**3, S_RATE**2, S_RATE, 1],
[0, 0, 0, 0, 1, 0],
[5*S_RATE**4, 4*S_RATE**3, 3*S_RATE**2,... | 35.728155 | 129 | 0.565353 |
import numpy as np
import matplotlib.pyplot as plt
g = 9800
S_RATE = 1.0
Cmat = np.array([
[0, 0, 0, 0, 0, 1],
[S_RATE**5, S_RATE**4, S_RATE**3, S_RATE**2, S_RATE, 1],
[0, 0, 0, 0, 1, 0],
[5*S_RATE**4, 4*S_RATE**3, 3*S_RATE**2, 2*S_RATE, 1, 0],
[0, 0, 0, 2, 0, 0],
[20*S_RATE**3, 12*S_RATE**2,... | true | true |
1c0d61a32959bce7586873565a282796752bb4ba | 7,012 | py | Python | tensorflow_datasets/image/cifar.py | Ir1d/datasets | 2a04ce5208e53bcf9b5acacf690bb7446285176e | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/cifar.py | Ir1d/datasets | 2a04ce5208e53bcf9b5acacf690bb7446285176e | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/cifar.py | Ir1d/datasets | 2a04ce5208e53bcf9b5acacf690bb7446285176e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets 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 appl... | 33.711538 | 79 | 0.648888 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import numpy as np
import tensorflow.compat.v2 as tf
import tensorflow_datasets.public_api as tfds
_CIFAR_IMAGE_SIZE = 32
_CIFAR_IMAGE_SHAPE = (_CIFAR_IMAGE_SIZE, _CIFAR_IMAGE_S... | true | true |
1c0d63e9e4c844eb2168fe4c16d2f8c0c077f6a8 | 2,918 | py | Python | src/config/settings.py | lvg-alex/python-django-base-template | 8dbc27762f3800ea8442867236bc71b3c0cffe68 | [
"MIT"
] | 1 | 2021-04-07T06:31:56.000Z | 2021-04-07T06:31:56.000Z | src/config/settings.py | lvg-alex/python-django-base-template | 8dbc27762f3800ea8442867236bc71b3c0cffe68 | [
"MIT"
] | null | null | null | src/config/settings.py | lvg-alex/python-django-base-template | 8dbc27762f3800ea8442867236bc71b3c0cffe68 | [
"MIT"
] | null | null | null | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the... | 25.596491 | 91 | 0.681289 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'pw+*a^45y7s_f(im29%4ot2222m1h7zed4w+$03_trf4)0)!l!'
DEBUG = True
ALLOWED_HOSTS = ['dbms_template_domain']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django... | true | true |
1c0d657798353ec64f74c6e2e1dc3af24a07fdf2 | 13,212 | py | Python | tests/test_metrics/test_losses.py | rlleshi/mmaction2 | 6993693f178b1a59e5eb07f1a3db484d5e5de61a | [
"Apache-2.0"
] | 1,870 | 2020-07-11T09:33:46.000Z | 2022-03-31T13:21:36.000Z | tests/test_metrics/test_losses.py | rlleshi/mmaction2 | 6993693f178b1a59e5eb07f1a3db484d5e5de61a | [
"Apache-2.0"
] | 1,285 | 2020-07-11T11:18:57.000Z | 2022-03-31T08:41:17.000Z | tests/test_metrics/test_losses.py | rlleshi/mmaction2 | 6993693f178b1a59e5eb07f1a3db484d5e5de61a | [
"Apache-2.0"
] | 557 | 2020-07-11T09:51:57.000Z | 2022-03-31T13:21:35.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv import ConfigDict
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from torch.autograd import Variable
from mmaction.models import (BCELo... | 39.675676 | 98 | 0.650167 | import numpy as np
import pytest
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv import ConfigDict
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from torch.autograd import Variable
from mmaction.models import (BCELossWithLogits, BinaryLogisticRegressionLoss,
... | true | true |
1c0d65a5c4743d4a3a076597eafe4afcb865da53 | 689 | py | Python | rev_app/jinja_funcs.py | RevFramework/rev-core-modules | 62c3e25e910197b694ecdb7a0553e9ef510af9bf | [
"MIT"
] | null | null | null | rev_app/jinja_funcs.py | RevFramework/rev-core-modules | 62c3e25e910197b694ecdb7a0553e9ef510af9bf | [
"MIT"
] | null | null | null | rev_app/jinja_funcs.py | RevFramework/rev-core-modules | 62c3e25e910197b694ecdb7a0553e9ef510af9bf | [
"MIT"
] | null | null | null |
from flask import current_app
from jinja2.utils import Markup
def rev_view(view_id):
"""
rev_view() function for jinja2 that inserts a rendered rev-view
view_id should be in the format <module>.<view_id>
"""
view_id_str = str(view_id)
view_id = view_id_str.split('.')
if len(view_id) != 2:
... | 32.809524 | 112 | 0.69521 |
from flask import current_app
from jinja2.utils import Markup
def rev_view(view_id):
view_id_str = str(view_id)
view_id = view_id_str.split('.')
if len(view_id) != 2:
raise Exception("Invalid view_id specified for rev_view(). Should be in the format <module>.<view_id>.")
rendered_html = curre... | true | true |
1c0d6688ba1b45b454c72ccf6d98fd0f2923abcb | 645 | py | Python | tbx/core/migrations/0059_auto_20160831_1243.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 103 | 2015-02-24T17:58:21.000Z | 2022-03-23T08:08:58.000Z | tbx/core/migrations/0059_auto_20160831_1243.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 145 | 2015-01-13T17:13:43.000Z | 2022-03-29T12:56:20.000Z | tbx/core/migrations/0059_auto_20160831_1243.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 57 | 2015-01-03T12:00:37.000Z | 2022-02-09T13:11:30.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-08-31 11:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("torchbox", "0058_auto_20160831_1239"),
]
operations = [
migrations.AlterField(
model_name="blogpage",
... | 24.807692 | 85 | 0.537984 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("torchbox", "0058_auto_20160831_1239"),
]
operations = [
migrations.AlterField(
model_name="blogpage",
name="colour",
field=models.CharField(
... | true | true |
1c0d671c2acfc5d78b1410aecce035581a4bca30 | 12,538 | py | Python | saleor/graphql/checkout/dataloaders.py | altankhuyagrio/saleor | cd91227c1580c17ab0ccf86eb5fa9545158f193c | [
"CC-BY-4.0"
] | 15,337 | 2015-01-12T02:11:52.000Z | 2021-10-05T19:19:29.000Z | saleor/graphql/checkout/dataloaders.py | altankhuyagrio/saleor | cd91227c1580c17ab0ccf86eb5fa9545158f193c | [
"CC-BY-4.0"
] | 7,486 | 2015-02-11T10:52:13.000Z | 2021-10-06T09:37:15.000Z | saleor/graphql/checkout/dataloaders.py | abenezerBelachew/saleor | 31b68b106991cf4834e3e0f6ae23a043159acf00 | [
"CC-BY-4.0"
] | 5,864 | 2015-01-16T14:52:54.000Z | 2021-10-05T23:01:15.000Z | from collections import defaultdict
from django.db.models import F
from promise import Promise
from ...checkout.fetch import CheckoutInfo, CheckoutLineInfo, get_delivery_method_info
from ...checkout.models import Checkout, CheckoutLine
from ...shipping.utils import convert_to_shipping_method_data
from ..account.datal... | 41.243421 | 87 | 0.559738 | from collections import defaultdict
from django.db.models import F
from promise import Promise
from ...checkout.fetch import CheckoutInfo, CheckoutLineInfo, get_delivery_method_info
from ...checkout.models import Checkout, CheckoutLine
from ...shipping.utils import convert_to_shipping_method_data
from ..account.datal... | true | true |
1c0d696ca0330254f2e9187c364831b1e006e297 | 7,121 | py | Python | dbt/redshift/redshift_etl.py | Parsely/parsely_raw_data | e2db3f97e8845526312e671f6324785865be1c7e | [
"Apache-2.0"
] | 10 | 2016-07-19T22:29:11.000Z | 2021-09-16T19:52:37.000Z | dbt/redshift/redshift_etl.py | Parsely/parsely_raw_data | e2db3f97e8845526312e671f6324785865be1c7e | [
"Apache-2.0"
] | 91 | 2016-04-19T18:26:31.000Z | 2022-03-09T08:04:08.000Z | dbt/redshift/redshift_etl.py | Parsely/parsely_raw_data | e2db3f97e8845526312e671f6324785865be1c7e | [
"Apache-2.0"
] | 4 | 2016-11-20T22:34:19.000Z | 2021-12-02T12:27:02.000Z | from __future__ import absolute_import
import logging
import os
import psycopg2
import subprocess
from dateutil import rrule
from parsely_raw_data import redshift as parsely_redshift
from parsely_raw_data import utils as parsely_utils
from dbt.redshift.settings.default import (
DBT_PROFILE_LOCATION,
DBT_PROFIL... | 48.442177 | 122 | 0.688667 | from __future__ import absolute_import
import logging
import os
import psycopg2
import subprocess
from dateutil import rrule
from parsely_raw_data import redshift as parsely_redshift
from parsely_raw_data import utils as parsely_utils
from dbt.redshift.settings.default import (
DBT_PROFILE_LOCATION,
DBT_PROFIL... | true | true |
1c0d69b0c03c7126ad1410fb7a7a38cc2e6e2079 | 23,604 | py | Python | ppdet/modeling/anchor_heads/yolo_head.py | stidk/GAM-SSD | 4a74ecc6b39d7202f0ca400ec33da1cce1a8c2a0 | [
"Apache-2.0"
] | null | null | null | ppdet/modeling/anchor_heads/yolo_head.py | stidk/GAM-SSD | 4a74ecc6b39d7202f0ca400ec33da1cce1a8c2a0 | [
"Apache-2.0"
] | null | null | null | ppdet/modeling/anchor_heads/yolo_head.py | stidk/GAM-SSD | 4a74ecc6b39d7202f0ca400ec33da1cce1a8c2a0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle 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 appli... | 36.88125 | 80 | 0.526733 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from paddle import fluid
from paddle.fluid.param_attr import ParamAttr
from paddle.fluid.regularizer import L2Decay
from ppdet.modeling.ops import MultiClassNMS, MultiClassSoftNMS, MatrixN... | true | true |
1c0d6b028cd3c3b14b490c91e079c85d72ae5f4f | 256 | py | Python | learn-to-code-with-python/18-Dictionaries-Iteration/dictionary-comprehensions-I.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/18-Dictionaries-Iteration/dictionary-comprehensions-I.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/18-Dictionaries-Iteration/dictionary-comprehensions-I.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | languages = ["Python", "Java Script", "Ruby"]
lenghts = {language: len(language) for language in languages}
print(lenghts)
word = "supercalifragilisticexpialidocious"
letter_counts = {letter: word.count(letter) for letter in word}
print(letter_counts)
| 23.272727 | 63 | 0.757813 | languages = ["Python", "Java Script", "Ruby"]
lenghts = {language: len(language) for language in languages}
print(lenghts)
word = "supercalifragilisticexpialidocious"
letter_counts = {letter: word.count(letter) for letter in word}
print(letter_counts)
| true | true |
1c0d6b24844d45d0a498318e16bb15e6be9421f8 | 42,936 | py | Python | tests/app/main/views/test_uploads.py | LouisStAmour/notifications-admin | 0ef076f59ed109ef280859438523fc3084e6ac41 | [
"MIT"
] | null | null | null | tests/app/main/views/test_uploads.py | LouisStAmour/notifications-admin | 0ef076f59ed109ef280859438523fc3084e6ac41 | [
"MIT"
] | 3 | 2021-03-31T19:52:53.000Z | 2021-12-13T20:39:53.000Z | tests/app/main/views/test_uploads.py | LouisStAmour/notifications-admin | 0ef076f59ed109ef280859438523fc3084e6ac41 | [
"MIT"
] | null | null | null | import re
import urllib
import uuid
from io import BytesIO
from unittest.mock import ANY, Mock
import pytest
from flask import make_response, url_for
from freezegun import freeze_time
from requests import RequestException
from app.main.views.uploads import format_recipient
from app.utils import normalize_spaces
from ... | 32.750572 | 120 | 0.644285 | import re
import urllib
import uuid
from io import BytesIO
from unittest.mock import ANY, Mock
import pytest
from flask import make_response, url_for
from freezegun import freeze_time
from requests import RequestException
from app.main.views.uploads import format_recipient
from app.utils import normalize_spaces
from ... | true | true |
1c0d6b4c6bcd8f1f9834d6e6becc421f9bbd7784 | 580 | py | Python | app/utils/create_admin.py | Ziemnior/engineering-thesis | 20f2b3d77d2532598c5f159748b8243bdc36e9cc | [
"MIT"
] | null | null | null | app/utils/create_admin.py | Ziemnior/engineering-thesis | 20f2b3d77d2532598c5f159748b8243bdc36e9cc | [
"MIT"
] | null | null | null | app/utils/create_admin.py | Ziemnior/engineering-thesis | 20f2b3d77d2532598c5f159748b8243bdc36e9cc | [
"MIT"
] | 1 | 2022-02-03T18:28:50.000Z | 2022-02-03T18:28:50.000Z | from werkzeug.security import generate_password_hash
from database import create_session
from models import User
def create_admin_account():
with create_session() as session:
email = session.query(User).filter_by(email="test@test.pl").one_or_none()
if email is None:
admin = User(email=... | 30.526316 | 93 | 0.655172 | from werkzeug.security import generate_password_hash
from database import create_session
from models import User
def create_admin_account():
with create_session() as session:
email = session.query(User).filter_by(email="test@test.pl").one_or_none()
if email is None:
admin = User(email=... | true | true |
1c0d6c8ac5cc0fc073eba0624caf43a6a73cff56 | 7,013 | py | Python | openpyxl2/workbook/tests/test_workbook.py | j5int/openpyxl2 | 3c82567c33d6cad5b0b26eea97da7bb39ba7f4c8 | [
"MIT"
] | null | null | null | openpyxl2/workbook/tests/test_workbook.py | j5int/openpyxl2 | 3c82567c33d6cad5b0b26eea97da7bb39ba7f4c8 | [
"MIT"
] | null | null | null | openpyxl2/workbook/tests/test_workbook.py | j5int/openpyxl2 | 3c82567c33d6cad5b0b26eea97da7bb39ba7f4c8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
# coding: utf-8
# Copyright (c) 2010-2018 openpyxl
# package imports
from openpyxl2.workbook import Workbook
from openpyxl2.workbook.defined_name import DefinedName
from openpyxl2.utils.exceptions import ReadOnlyWorkbookException
from openpyxl2.xml.constants import (
XLSM,
... | 24.266436 | 74 | 0.620704 | from __future__ import absolute_import
from openpyxl2.workbook import Workbook
from openpyxl2.workbook.defined_name import DefinedName
from openpyxl2.utils.exceptions import ReadOnlyWorkbookException
from openpyxl2.xml.constants import (
XLSM,
XLSX,
XLTM,
XLTX
)
import pytest
class TestWorkbook:
... | true | true |
1c0d6deea47d7ccb01e38193c8fc35cda472576e | 1,005 | py | Python | matplotlib/ex20.py | jonaslindemann/compute-course-public | b8f55595ebbd790d79b525efdff17b8517154796 | [
"MIT"
] | 4 | 2021-09-12T12:07:01.000Z | 2021-09-29T17:38:34.000Z | matplotlib/ex20.py | jonaslindemann/compute-course-public | b8f55595ebbd790d79b525efdff17b8517154796 | [
"MIT"
] | null | null | null | matplotlib/ex20.py | jonaslindemann/compute-course-public | b8f55595ebbd790d79b525efdff17b8517154796 | [
"MIT"
] | 5 | 2020-10-24T16:02:31.000Z | 2021-09-28T20:57:46.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 7 14:19:31 2017
@author: Jonas Lindemann
"""
"""
Demo of the `streamplot` function.
A streamplot, or streamline plot, is used to display 2D vector fields. This
example shows a few features of the stream plot function:
* Varying the color along a streamline.
* ... | 25.125 | 75 | 0.662687 |
import numpy as np
import matplotlib.pyplot as plt
Y, X = np.mgrid[-3:3:100j, -3:3:100j]
U = -1 - X**2 + Y
V = 1 + X - Y**2
speed = np.sqrt(U*U + V*V)
fig0, ax0 = plt.subplots()
strm = ax0.streamplot(X, Y, U, V, color=U, linewidth=2, cmap=plt.cm.autumn)
fig0.colorbar(strm.lines)
fig1, (ax1, ax2) = plt.subplots(ncol... | true | true |
1c0d6fa358fdc15f5e76b8e7d60556f179b24025 | 3,403 | py | Python | descqa/base.py | adam-broussard/descqa | d9681bd393553c31882ec7e28e6c1c7b6e482dd3 | [
"BSD-3-Clause"
] | 4 | 2017-11-14T03:33:57.000Z | 2021-06-05T16:35:40.000Z | descqa/base.py | adam-broussard/descqa | d9681bd393553c31882ec7e28e6c1c7b6e482dd3 | [
"BSD-3-Clause"
] | 136 | 2017-11-06T16:02:58.000Z | 2021-11-11T18:20:23.000Z | descqa/base.py | adam-broussard/descqa | d9681bd393553c31882ec7e28e6c1c7b6e482dd3 | [
"BSD-3-Clause"
] | 31 | 2017-11-06T19:55:35.000Z | 2020-12-15T13:53:53.000Z | from __future__ import division, unicode_literals, absolute_import
import os
__all__ = ['BaseValidationTest', 'TestResult']
class TestResult(object):
"""
class for passing back test result
"""
def __init__(self, score=None, summary=None, passed=False, skipped=False, inspect_only=False):
"""
... | 28.358333 | 105 | 0.595357 | from __future__ import division, unicode_literals, absolute_import
import os
__all__ = ['BaseValidationTest', 'TestResult']
class TestResult(object):
def __init__(self, score=None, summary=None, passed=False, skipped=False, inspect_only=False):
self.passed = bool(passed)
self.skipped = bool(skipp... | true | true |
1c0d70c16ee254868874225d028ab4f38cbaa475 | 15,211 | py | Python | trax/backend.py | vkataev/trax | 648f02bb5e064209fa08af5f048dfc2cfdc0ddca | [
"Apache-2.0"
] | null | null | null | trax/backend.py | vkataev/trax | 648f02bb5e064209fa08af5f048dfc2cfdc0ddca | [
"Apache-2.0"
] | null | null | null | trax/backend.py | vkataev/trax | 648f02bb5e064209fa08af5f048dfc2cfdc0ddca | [
"Apache-2.0"
] | 1 | 2021-07-08T16:35:30.000Z | 2021-07-08T16:35:30.000Z | # coding=utf-8
# Copyright 2019 The Trax 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 law or a... | 30.180556 | 94 | 0.687595 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import gin
import jax
from jax import lax
from jax import random as jax_random
import jax.numpy as jnp
import jax.scipy.special as jax_special
import numpy as onp
import tensorflow.compat.v... | true | true |
1c0d714d241430dfc7590084f721ce92b3d2c7a5 | 1,115 | py | Python | module_06/tests/sauce_lab/test_cart.py | IvanJL/2021_python_selenium | 52ad0afa43664308437658966ec5d989a2db9c02 | [
"Unlicense"
] | null | null | null | module_06/tests/sauce_lab/test_cart.py | IvanJL/2021_python_selenium | 52ad0afa43664308437658966ec5d989a2db9c02 | [
"Unlicense"
] | null | null | null | module_06/tests/sauce_lab/test_cart.py | IvanJL/2021_python_selenium | 52ad0afa43664308437658966ec5d989a2db9c02 | [
"Unlicense"
] | null | null | null | """Test Cases from Cart"""
from module_06.src.pages.login import LoginPage
from module_06.tests.common.test_base import TestBase
_DEF_USER = 'standard_user'
_DEF_PASSWORD = 'secret_sauce'
class TestCart(TestBase):
# Ivan Test: Go to cart and Back
def test_cart(self):
login = LoginPage(self.driver)
... | 29.342105 | 93 | 0.664574 | from module_06.src.pages.login import LoginPage
from module_06.tests.common.test_base import TestBase
_DEF_USER = 'standard_user'
_DEF_PASSWORD = 'secret_sauce'
class TestCart(TestBase):
def test_cart(self):
login = LoginPage(self.driver)
login.open()
inventory = login.login(_DEF_USE... | true | true |
1c0d715fb971779e3a23719e78ea186d71a3c76f | 4,517 | py | Python | emulator.py | itay1996/SmartHome | 4adc6dc3ad2da17b030068774bcb8a58e1f995a2 | [
"MIT"
] | null | null | null | emulator.py | itay1996/SmartHome | 4adc6dc3ad2da17b030068774bcb8a58e1f995a2 | [
"MIT"
] | null | null | null | emulator.py | itay1996/SmartHome | 4adc6dc3ad2da17b030068774bcb8a58e1f995a2 | [
"MIT"
] | null | null | null | # Class of home IOT devices (emulators) like: DHT, Elec meter, water meter and etc.
#import os
import sys
#import PyQt5
import random
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import paho.mqtt.client as mqtt
#import time
#import dateti... | 31.587413 | 83 | 0.647111 |
import sys
import random
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import paho.mqtt.client as mqtt
from init import *
from agent import Mqtt_client
global clientname, CONNECTED
CONNECTED = False
r=random.randrange(1,10000000)
client... | true | true |
1c0d725e493773d2e38842013e024387e9c18745 | 2,847 | py | Python | qiskit/optimization/converters/ising_to_quadratic_program.py | pat-phattharaporn/qiskit-aqua | fb7f24d45769ed5152e589b0f9d84ea90618d052 | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | qiskit/optimization/converters/ising_to_quadratic_program.py | pat-phattharaporn/qiskit-aqua | fb7f24d45769ed5152e589b0f9d84ea90618d052 | [
"Apache-2.0"
] | 4 | 2020-11-27T09:34:13.000Z | 2021-04-30T21:13:41.000Z | qiskit/optimization/converters/ising_to_quadratic_program.py | pat-phattharaporn/qiskit-aqua | fb7f24d45769ed5152e589b0f9d84ea90618d052 | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# 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... | 41.26087 | 94 | 0.653319 |
from typing import Optional, Union
import copy
import warnings
import numpy as np
from qiskit.aqua.operators import OperatorBase, WeightedPauliOperator
from ..problems.quadratic_program import QuadraticProgram
class IsingToQuadraticProgram:
def __init__(self, linear: bool = False) -> None:
self._qub... | true | true |
1c0d730922b720775e423872524ed82cbd8f4780 | 4,159 | py | Python | recipes/gtest/all/conanfile.py | memsharded/conan-center-index | ed521baa4c008c0446934d90bf4c071034a94207 | [
"MIT"
] | null | null | null | recipes/gtest/all/conanfile.py | memsharded/conan-center-index | ed521baa4c008c0446934d90bf4c071034a94207 | [
"MIT"
] | 1 | 2019-11-19T01:14:37.000Z | 2019-11-19T06:07:20.000Z | recipes/gtest/all/conanfile.py | memsharded/conan-center-index | ed521baa4c008c0446934d90bf4c071034a94207 | [
"MIT"
] | null | null | null | import glob
import os
from conans import ConanFile, CMake, tools
from conans.model.version import Version
from conans.errors import ConanInvalidConfiguration
class GTestConan(ConanFile):
name = "gtest"
description = "Google's C++ test framework"
url = "https://github.com/conan-io/conan-center-index"
h... | 45.703297 | 173 | 0.648954 | import glob
import os
from conans import ConanFile, CMake, tools
from conans.model.version import Version
from conans.errors import ConanInvalidConfiguration
class GTestConan(ConanFile):
name = "gtest"
description = "Google's C++ test framework"
url = "https://github.com/conan-io/conan-center-index"
h... | true | true |
1c0d739b4dc7e4dced4c0ed36e1481446e933cf2 | 229 | py | Python | data_structures/array/right_place.py | Inquis1t0r/python-ds | d7395e6e25a2085bb8d201b77153e4af6720291e | [
"MIT"
] | 1,723 | 2019-07-30T07:06:22.000Z | 2022-03-31T15:22:22.000Z | data_structures/array/right_place.py | Inquis1t0r/python-ds | d7395e6e25a2085bb8d201b77153e4af6720291e | [
"MIT"
] | 213 | 2019-10-06T08:07:47.000Z | 2021-10-04T15:38:36.000Z | data_structures/array/right_place.py | Inquis1t0r/python-ds | d7395e6e25a2085bb8d201b77153e4af6720291e | [
"MIT"
] | 628 | 2019-10-06T10:26:25.000Z | 2022-03-31T01:41:00.000Z | def place(arr):
for i in range(len(arr)):
if arr[i] >= 0 and arr[i] != i:
arr[arr[i]], arr[i] = arr[i], arr[arr[i]]
else:
i += 1
arr = [-1,-1, 6,1,9,3,2,-1,4,-1]
place(arr)
print(arr)
| 20.818182 | 53 | 0.436681 | def place(arr):
for i in range(len(arr)):
if arr[i] >= 0 and arr[i] != i:
arr[arr[i]], arr[i] = arr[i], arr[arr[i]]
else:
i += 1
arr = [-1,-1, 6,1,9,3,2,-1,4,-1]
place(arr)
print(arr)
| true | true |
1c0d739fd505d23e9e3e32668ff97a9c7b4fbfaf | 31,615 | py | Python | astropy/visualization/wcsaxes/core.py | emirkmo/astropy | d96cd45b25ae55117d1bcc9c40e83a82037fc815 | [
"BSD-3-Clause"
] | null | null | null | astropy/visualization/wcsaxes/core.py | emirkmo/astropy | d96cd45b25ae55117d1bcc9c40e83a82037fc815 | [
"BSD-3-Clause"
] | null | null | null | astropy/visualization/wcsaxes/core.py | emirkmo/astropy | d96cd45b25ae55117d1bcc9c40e83a82037fc815 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from functools import partial
from collections import defaultdict
import numpy as np
from matplotlib import rcParams
from matplotlib.artist import Artist
from matplotlib.axes import Axes, subplot_class_factory
from matplotlib.transforms import Affine2D,... | 41.005188 | 110 | 0.617365 |
from functools import partial
from collections import defaultdict
import numpy as np
from matplotlib import rcParams
from matplotlib.artist import Artist
from matplotlib.axes import Axes, subplot_class_factory
from matplotlib.transforms import Affine2D, Bbox, Transform
import astropy.units as u
from astropy.coordin... | true | true |
1c0d73deb655fdae1361f6f5c9653e629a39345d | 1,731 | py | Python | examples/ad_manager/v201805/contact_service/get_all_contacts.py | khanhnhk/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | 1 | 2021-12-30T15:21:42.000Z | 2021-12-30T15:21:42.000Z | examples/ad_manager/v201805/contact_service/get_all_contacts.py | benlistyg/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201805/contact_service/get_all_contacts.py | benlistyg/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 34.62 | 78 | 0.729058 | """This example gets all contacts.
"""
from googleads import ad_manager
def main(client):
contact_service = client.GetService('ContactService', version='v201805')
statement = ad_manager.StatementBuilder()
while True:
response = contact_service.getContactsByStatement(statement.ToStatement())
i... | false | true |
1c0d743633f031577d3d2e1f55f4a8be500f4f84 | 11,751 | py | Python | venv/lib/python3.6/site-packages/nlp/utils/py_utils.py | MachineLearningBCAM/minimax-risk-classifier | 82586c632268c103de269bcbffa5f7849b174a29 | [
"MIT"
] | 2 | 2021-09-28T01:36:21.000Z | 2021-12-22T08:24:17.000Z | src/nlp/utils/py_utils.py | neubig/nlp | 38eb2413de54ee804b0be81781bd65ac4a748ced | [
"Apache-2.0"
] | null | null | null | src/nlp/utils/py_utils.py | neubig/nlp | 38eb2413de54ee804b0be81781bd65ac4a748ced | [
"Apache-2.0"
] | 1 | 2020-12-08T10:36:30.000Z | 2020-12-08T10:36:30.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace NLP Authors and the TensorFlow Datasets 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... | 32.106557 | 114 | 0.630244 |
import contextlib
import functools
import itertools
import os
import types
from io import BytesIO as StringIO
from shutil import disk_usage
from types import CodeType
import dill
import numpy as np
memoize = functools.lru_cache
def map_all_sequences_to_lists(data_struct):
def sequences_to_list(seq):
... | true | true |
1c0d74627df4c0945814dad9e38f96a8d3c7b837 | 18,439 | py | Python | codes/model/imagination_model/learning_to_query_with_imitation_learning.py | shagunsodhani/consistent-dynamics | cc1527f2468cdcebea9a57387254278eb5547fe3 | [
"MIT"
] | 8 | 2019-05-06T13:30:57.000Z | 2020-05-25T20:32:47.000Z | codes/model/imagination_model/learning_to_query_with_imitation_learning.py | shagunsodhani/consistent-dynamics | cc1527f2468cdcebea9a57387254278eb5547fe3 | [
"MIT"
] | null | null | null | codes/model/imagination_model/learning_to_query_with_imitation_learning.py | shagunsodhani/consistent-dynamics | cc1527f2468cdcebea9a57387254278eb5547fe3 | [
"MIT"
] | 2 | 2019-05-06T15:11:42.000Z | 2020-03-06T12:36:16.000Z | import time
from itertools import chain
import torch
from addict import Dict
from torch import nn
from codes.model.base_model import BaseModel
from codes.model.imagination_model.util import get_component, merge_first_and_second_dim, \
unmerge_first_and_second_dim, sample_zt_from_distribution, clamp_mu_logsigma
fr... | 45.304668 | 137 | 0.676067 | import time
from itertools import chain
import torch
from addict import Dict
from torch import nn
from codes.model.base_model import BaseModel
from codes.model.imagination_model.util import get_component, merge_first_and_second_dim, \
unmerge_first_and_second_dim, sample_zt_from_distribution, clamp_mu_logsigma
fr... | true | true |
1c0d74f245eca952c48e7c2765c30fa7d06738cf | 5,319 | py | Python | scripts/position_control_on_off.py | s-bl/robot_fingers | 11c0c5e1e5bf97fac58707c85276fc929b7259d1 | [
"BSD-3-Clause"
] | 32 | 2020-06-20T15:23:16.000Z | 2022-01-02T00:21:40.000Z | scripts/position_control_on_off.py | s-bl/robot_fingers | 11c0c5e1e5bf97fac58707c85276fc929b7259d1 | [
"BSD-3-Clause"
] | 13 | 2020-03-02T10:54:19.000Z | 2021-03-30T14:15:29.000Z | scripts/position_control_on_off.py | s-bl/robot_fingers | 11c0c5e1e5bf97fac58707c85276fc929b7259d1 | [
"BSD-3-Clause"
] | 9 | 2020-08-12T09:29:17.000Z | 2021-11-27T13:04:16.000Z | #!/usr/bin/python3
"""Print joint positions. Toggle between position- and zero-torque-control.
Runs a simple curses GUI that shows the current joint positions. By pressing
"p" the user can toggle between position control to the current position and
zero-torque control. So it can be used to manually move the joints t... | 29.715084 | 79 | 0.56928 | import argparse
import curses
import robot_interfaces
import robot_fingers
class CursesGUI:
def __init__(self, win):
self.win = win
self.win.nodelay(True)
def update(self, observation, position_control_enabled):
self.win.erase()
try:
status_line = ... | true | true |
1c0d74f9a8bde5ec68165f1b36f2f7ac25d9ea3f | 4,396 | py | Python | atmosphere/celery_router.py | benlazarine/atmosphere | 38fad8e4002e510e8b4294f2bb5bc75e8e1817fa | [
"BSD-3-Clause"
] | null | null | null | atmosphere/celery_router.py | benlazarine/atmosphere | 38fad8e4002e510e8b4294f2bb5bc75e8e1817fa | [
"BSD-3-Clause"
] | 91 | 2019-12-02T19:06:58.000Z | 2022-03-20T01:06:29.000Z | atmosphere/celery_router.py | benlazarine/atmosphere | 38fad8e4002e510e8b4294f2bb5bc75e8e1817fa | [
"BSD-3-Clause"
] | null | null | null | from threepio import logger
from atmosphere.celery_init import app as current_app
# Ripped from asksol answer --See
# http://stackoverflow.com/questions/10707287/django-celery-routing-problems
class PredeclareRouter(object):
setup = False
def route_for_task(self, *args, **kwargs):
if self.setup:
... | 33.815385 | 79 | 0.654686 | from threepio import logger
from atmosphere.celery_init import app as current_app
class PredeclareRouter(object):
setup = False
def route_for_task(self, *args, **kwargs):
if self.setup:
return
self.setup = True
with current_app.broker_connection() ... | false | true |
1c0d76383bdb31d30bb6fa0acd2aebbb5bbfe760 | 6,323 | py | Python | badges/views/badges_admin_badges_view.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | badges/views/badges_admin_badges_view.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | badges/views/badges_admin_badges_view.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z |
from django.contrib import messages
from django.db.models import Q
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import require_http_methods, require_safe
from core.batches_v... | 41.326797 | 149 | 0.644314 |
from django.contrib import messages
from django.db.models import Q
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import require_http_methods, require_safe
from core.batches_v... | true | true |
1c0d764a30e983792ee6915a77e06f58c222b56b | 308 | py | Python | tests/test_skeleton.py | bjtho08/mmciad | e41e44a64b6dcacf63f7372db1bb50f805948e0b | [
"MIT"
] | null | null | null | tests/test_skeleton.py | bjtho08/mmciad | e41e44a64b6dcacf63f7372db1bb50f805948e0b | [
"MIT"
] | null | null | null | tests/test_skeleton.py | bjtho08/mmciad | e41e44a64b6dcacf63f7372db1bb50f805948e0b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from mmciad.skeleton import fib
__author__ = "bjarnet"
__copyright__ = "bjarnet"
__license__ = "mit"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
| 17.111111 | 39 | 0.633117 |
import pytest
from mmciad.skeleton import fib
__author__ = "bjarnet"
__copyright__ = "bjarnet"
__license__ = "mit"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
| true | true |
1c0d7666391219bf1b4a3897d0cc9af59b5c9df9 | 6,311 | py | Python | test/functional/feature_nulldummy.py | bitcoin-global/bitcoin-global | 8f8783245ec209ba1ae4b2c0717f9d8f2d5658ea | [
"MIT"
] | 3 | 2020-09-23T23:55:28.000Z | 2021-07-10T03:21:46.000Z | test/functional/feature_nulldummy.py | Penny-Admixture/bitcoin-global | 8f8783245ec209ba1ae4b2c0717f9d8f2d5658ea | [
"MIT"
] | 2 | 2020-07-28T08:55:30.000Z | 2021-04-22T10:57:10.000Z | test/functional/feature_nulldummy.py | Penny-Admixture/bitcoin-global | 8f8783245ec209ba1ae4b2c0717f9d8f2d5658ea | [
"MIT"
] | 1 | 2021-06-12T07:04:55.000Z | 2021-06-12T07:04:55.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Copyright (c) 2020 The Bitcoin Global developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test NULLDUMMY softfork.
Connect to a single node.
... | 50.895161 | 144 | 0.701632 | import time
from test_framework.blocktools import create_coinbase, create_block, create_transaction, add_witness_commitment
from test_framework.messages import CTransaction
from test_framework.script import CScript
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_eq... | true | true |
1c0d76ba2e47a36e95ea2cd58e1abaa40224d41f | 34,385 | py | Python | Lib/test/test_cmd_line.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | 1 | 2020-10-25T16:33:22.000Z | 2020-10-25T16:33:22.000Z | Lib/test/test_cmd_line.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | Lib/test/test_cmd_line.py | Krrishdhaneja/cpython | 9ae9ad8ba35cdcece7ded73cd2207e4f8cb85578 | [
"0BSD"
] | null | null | null | # Tests invocation of the interpreter with various command line arguments
# Most tests are executed with environment variables ignored
# See test_cmd_line_script.py for testing of script execution
import os
import subprocess
import sys
import tempfile
import textwrap
import unittest
from test import support
... | 42.035452 | 100 | 0.548989 |
import os
import subprocess
import sys
import tempfile
import textwrap
import unittest
from test import support
from test.support import os_helper
from test.support.script_helper import (
spawn_python, kill_python, assert_python_ok, assert_python_failure,
interpreter_requires_environment
)
Py_... | true | true |
1c0d76e3987062c0970846c52d7f2fde42466cfb | 24,276 | py | Python | integration_test/load_generator.py | cl9200/nbase-arc | 47c124b11b0bb2e8a8428c6d628ce82dc24c1ade | [
"Apache-2.0"
] | null | null | null | integration_test/load_generator.py | cl9200/nbase-arc | 47c124b11b0bb2e8a8428c6d628ce82dc24c1ade | [
"Apache-2.0"
] | null | null | null | integration_test/load_generator.py | cl9200/nbase-arc | 47c124b11b0bb2e8a8428c6d628ce82dc24c1ade | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Naver 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... | 35.080925 | 159 | 0.535096 |
import traceback
import threading
import telnet
import crc16
import util
import sys
import random
from arcci.arcci import *
class LoadGenerator(threading.Thread):
quit = False
def __init__( self, id, telnet_ip, telnet_port, timeout=3 ):
threading.Thread.__init__( self )
self.timeout = timeo... | false | true |
1c0d78bc356fcf1c5c4b500b72e1c7c557ecd4ab | 3,510 | py | Python | tests/PFEM_Metafor/waterColoumnFallWithFlexibleObstacle_obstacle_Mtf_E_1_2e7.py | tobadavid/CUPyDO | ad4712d5bd84c964f49ea0c05d6e5ad4fb1e9e88 | [
"Apache-2.0"
] | 1 | 2018-07-16T00:30:37.000Z | 2018-07-16T00:30:37.000Z | tests/PFEM_Metafor/waterColoumnFallWithFlexibleObstacle_obstacle_Mtf_E_1_2e7.py | Mopolino8/CUPyDO | 0720e436b393c1bcc1501606c85deb049d6526db | [
"Apache-2.0"
] | null | null | null | tests/PFEM_Metafor/waterColoumnFallWithFlexibleObstacle_obstacle_Mtf_E_1_2e7.py | Mopolino8/CUPyDO | 0720e436b393c1bcc1501606c85deb049d6526db | [
"Apache-2.0"
] | 1 | 2019-11-24T17:25:00.000Z | 2019-11-24T17:25:00.000Z | '''
Copyright 2018 University of Liège
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, s... | 28.306452 | 100 | 0.64359 |
from wrap import *
metafor = None
def params(q={}):
p={}
p['tolNR'] = 1.0e-7 p['tend'] = 2. p['dtmax'] = 0.005 p['bndno'] = 17
p['bctype'] = 'pydeadloads'
p.u... | true | true |
1c0d797975b289fcdf96f488874f790c8ad613a1 | 406 | py | Python | laboratorios/quiz3.py | ncenteno31/uip-prog3 | 90fc05cd7ef1c89fbadb54dc68c917f40a8cae14 | [
"MIT"
] | null | null | null | laboratorios/quiz3.py | ncenteno31/uip-prog3 | 90fc05cd7ef1c89fbadb54dc68c917f40a8cae14 | [
"MIT"
] | null | null | null | laboratorios/quiz3.py | ncenteno31/uip-prog3 | 90fc05cd7ef1c89fbadb54dc68c917f40a8cae14 | [
"MIT"
] | null | null | null | # quiz 3
# Nombre: Noel Centeno
#
# Dado un intervalo de tiempo en segundos, calcular los segundos restantes
# que corresponden para convertirse exactamente en minutos.
# Este programa debe funcionar para 5 oportunidades
for i in range(5):
seg= int(input(" Introduzca un Numero para Calcular "))
cont= 60
while seg ... | 21.368421 | 74 | 0.719212 |
for i in range(5):
seg= int(input(" Introduzca un Numero para Calcular "))
cont= 60
while seg > cont:
cont=cont+60
min= cont-seg
print(" Faltan " + str(min) + " segundos ")
| true | true |
1c0d7a07fd3deb71eb875385c7ed21228952df80 | 515 | py | Python | emporium/main/forms.py | atmay/Emporium | 1672d2cc9ed00593fbe735f88fa1092f31c86638 | [
"CC0-1.0"
] | null | null | null | emporium/main/forms.py | atmay/Emporium | 1672d2cc9ed00593fbe735f88fa1092f31c86638 | [
"CC0-1.0"
] | null | null | null | emporium/main/forms.py | atmay/Emporium | 1672d2cc9ed00593fbe735f88fa1092f31c86638 | [
"CC0-1.0"
] | null | null | null | from django import forms
from .models import Order
class OrderForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['order_date'].label = 'Preferable delivery date'
order_date = forms.DateField(widget=forms.TextInput(attrs={'type': 'date'}... | 24.52381 | 80 | 0.598058 | from django import forms
from .models import Order
class OrderForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['order_date'].label = 'Preferable delivery date'
order_date = forms.DateField(widget=forms.TextInput(attrs={'type': 'date'}... | true | true |
1c0d7c9508d30002e377d1fa858becc3da3dd790 | 517 | py | Python | neureign/activations.py | AkashBhave/neureign | 1297ab261906c2a166b258a29bcd5dd556cefd65 | [
"MIT"
] | null | null | null | neureign/activations.py | AkashBhave/neureign | 1297ab261906c2a166b258a29bcd5dd556cefd65 | [
"MIT"
] | null | null | null | neureign/activations.py | AkashBhave/neureign | 1297ab261906c2a166b258a29bcd5dd556cefd65 | [
"MIT"
] | null | null | null | import numpy as np
def linear(x):
return x
def sigmoid(x):
return np.divide(1, np.add(1, np.exp(np.multiply(-1, x))))
def tanh(x):
return np.tanh(x)
def relu(x):
return np.maximum(x, 0)
def lrelu(x):
if x >= 0:
return x
else:
return np.multiply(0.01, x)
def prelu(x, a... | 13.25641 | 62 | 0.528046 | import numpy as np
def linear(x):
return x
def sigmoid(x):
return np.divide(1, np.add(1, np.exp(np.multiply(-1, x))))
def tanh(x):
return np.tanh(x)
def relu(x):
return np.maximum(x, 0)
def lrelu(x):
if x >= 0:
return x
else:
return np.multiply(0.01, x)
def prelu(x, a... | true | true |
1c0d7cc2def33719c98e1a6db35a1b6dafc4fc46 | 770 | py | Python | search_engine/search_engine/urls.py | someshkar/xino19-open-source-marathon | fb9727cd374d31e45f9eb7db1402bd0f2ff545af | [
"MIT"
] | 5 | 2019-07-14T00:28:39.000Z | 2019-10-03T10:24:36.000Z | search_engine/search_engine/urls.py | Vansh983/open-source-marathon | fb9727cd374d31e45f9eb7db1402bd0f2ff545af | [
"MIT"
] | 52 | 2019-07-14T04:12:00.000Z | 2019-07-18T11:12:28.000Z | search_engine/search_engine/urls.py | Vansh983/open-source-marathon | fb9727cd374d31e45f9eb7db1402bd0f2ff545af | [
"MIT"
] | 25 | 2019-07-13T21:05:54.000Z | 2019-07-16T15:04:12.000Z | """search_engine URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | 35 | 79 | 0.706494 | from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
| true | true |
1c0d7cfcc70b87f9e5a44d0cb832a4ebf29a163c | 514 | py | Python | third_party/onnx/onnx/test/schema_test.py | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 1 | 2019-01-22T13:07:52.000Z | 2019-01-22T13:07:52.000Z | third_party/onnx/onnx/test/schema_test.py | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | null | null | null | third_party/onnx/onnx/test/schema_test.py | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | null | null | null | import unittest
from onnx import defs, AttributeProto
class TestSchema(unittest.TestCase):
def test_get_schema(self):
defs.get_schema("Relu")
def test_typecheck(self):
defs.get_schema("Conv")
def test_attr_default_value(self):
v = defs.get_schema(
"BatchNormalizatio... | 22.347826 | 69 | 0.684825 | import unittest
from onnx import defs, AttributeProto
class TestSchema(unittest.TestCase):
def test_get_schema(self):
defs.get_schema("Relu")
def test_typecheck(self):
defs.get_schema("Conv")
def test_attr_default_value(self):
v = defs.get_schema(
"BatchNormalizatio... | true | true |
1c0d7f9f8adf05e7b0c18597f63d5d102bfce202 | 2,630 | py | Python | paras3/s3_util.py | Ashton-Sidhu/boto3-parallel | 9af8d7a3299596918b4d343019427eb57c6329c3 | [
"Apache-2.0"
] | null | null | null | paras3/s3_util.py | Ashton-Sidhu/boto3-parallel | 9af8d7a3299596918b4d343019427eb57c6329c3 | [
"Apache-2.0"
] | null | null | null | paras3/s3_util.py | Ashton-Sidhu/boto3-parallel | 9af8d7a3299596918b4d343019427eb57c6329c3 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from datetime import datetime
import random
import time
import sys
import os
import boto3
from paras3.config import S3_RETRY_COUNT
from paras3.exception import MetaflowException
TEST_S3_RETRY = "TEST_S3_RETRY" in os.environ
def get_s3_client():
return boto3.client("s3")
... | 32.469136 | 76 | 0.585551 | from __future__ import print_function
from datetime import datetime
import random
import time
import sys
import os
import boto3
from paras3.config import S3_RETRY_COUNT
from paras3.exception import MetaflowException
TEST_S3_RETRY = "TEST_S3_RETRY" in os.environ
def get_s3_client():
return boto3.client("s3")
... | true | true |
1c0d806c062374a6557169858156dfcd947ce495 | 10,201 | py | Python | nets/DenseNet56.py | InvokerLiu/DenseNet-Tensorflow | 8e171eb3f14a46cc68cdebd3d4db92b1376af698 | [
"Apache-2.0"
] | 2 | 2019-05-07T03:34:27.000Z | 2019-05-07T03:37:43.000Z | nets/DenseNet56.py | InvokerLiu/DenseNet-Tensorflow | 8e171eb3f14a46cc68cdebd3d4db92b1376af698 | [
"Apache-2.0"
] | null | null | null | nets/DenseNet56.py | InvokerLiu/DenseNet-Tensorflow | 8e171eb3f14a46cc68cdebd3d4db92b1376af698 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# coding=utf-8
# ================================================================
#
# Editor : PyCharm
# File name : DenseNet56.py
# Author : LiuBo
# Created date: 2019-05-08 19:37
# Description :
#
# =============================================================... | 42.152893 | 119 | 0.525635 |
from core.layers import conv2d, avg_pool, fc_connect
from core.blocks import dense_block, transition_block
import tensorflow as tf
class DenseNet56(object):
def __init__(self, dense_block_num=3, growth_rate=12, filter_num=32, reduction=0.0,
class_num=6, input_size=56, channels=3, train... | true | true |
1c0d81116a49d737f6df00488dced0d3a3904b71 | 2,040 | py | Python | src/better_factory/views/model.py | ramp-eu/Process_Optimization | a2e3f0110df503e2dfcc570f2803aef1163a085a | [
"MIT"
] | null | null | null | src/better_factory/views/model.py | ramp-eu/Process_Optimization | a2e3f0110df503e2dfcc570f2803aef1163a085a | [
"MIT"
] | null | null | null | src/better_factory/views/model.py | ramp-eu/Process_Optimization | a2e3f0110df503e2dfcc570f2803aef1163a085a | [
"MIT"
] | null | null | null | import logging
from pyramid.view import view_config
from sqlalchemy.orm import joinedload
from pathlib import Path
import pandas as pd
import aiya_seqmod
from aiya_seqmod.data.preprocess import IdentityPreprocessor
from aiya_seqmod.interface import ModelManager
# from .. import models
from ..schemas.predict import... | 28.333333 | 94 | 0.655882 | import logging
from pyramid.view import view_config
from sqlalchemy.orm import joinedload
from pathlib import Path
import pandas as pd
import aiya_seqmod
from aiya_seqmod.data.preprocess import IdentityPreprocessor
from aiya_seqmod.interface import ModelManager
from ..schemas.predict import (
PredictInputSchem... | true | true |
1c0d81d353b4464083b17a1f0419e2b69afa3783 | 971 | py | Python | env/lib/python3.5/site-packages/notebook/tree/tests/test_tree_handler.py | riordan/who-owns-what | 62538fdb6d40ed1e0cdafb0df388be95fb388907 | [
"Apache-2.0"
] | null | null | null | env/lib/python3.5/site-packages/notebook/tree/tests/test_tree_handler.py | riordan/who-owns-what | 62538fdb6d40ed1e0cdafb0df388be95fb388907 | [
"Apache-2.0"
] | 3 | 2020-03-24T15:38:23.000Z | 2021-02-02T21:44:18.000Z | env/lib/python3.5/site-packages/notebook/tree/tests/test_tree_handler.py | riordan/who-owns-what | 62538fdb6d40ed1e0cdafb0df388be95fb388907 | [
"Apache-2.0"
] | 1 | 2017-03-16T22:39:47.000Z | 2017-03-16T22:39:47.000Z | """Test the /tree handlers"""
import os
import io
from notebook.utils import url_path_join
from nbformat import write
from nbformat.v4 import new_notebook
import requests
from notebook.tests.launchnotebook import NotebookTestBase
class TreeTest(NotebookTestBase):
def setUp(self):
nbdir = self.notebook_di... | 29.424242 | 84 | 0.636457 | import os
import io
from notebook.utils import url_path_join
from nbformat import write
from nbformat.v4 import new_notebook
import requests
from notebook.tests.launchnotebook import NotebookTestBase
class TreeTest(NotebookTestBase):
def setUp(self):
nbdir = self.notebook_dir.name
d = os.path.joi... | true | true |
1c0d8298428ddccd368a847531789985d3870e47 | 6,161 | py | Python | tests/molecular/molecules/building_block/fixtures/init_from_file.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | tests/molecular/molecules/building_block/fixtures/init_from_file.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | tests/molecular/molecules/building_block/fixtures/init_from_file.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | import pytest
import stk
from ..case_data import CaseData
@pytest.fixture(
params=[
'building_block.mol',
'building_block.pdb',
],
)
def path(tmpdir, request):
return str(tmpdir / request.param)
class InitFromFileData:
"""
Stores data for the :meth:`.BuildingBlock.init_from_fil... | 31.274112 | 71 | 0.573608 | import pytest
import stk
from ..case_data import CaseData
@pytest.fixture(
params=[
'building_block.mol',
'building_block.pdb',
],
)
def path(tmpdir, request):
return str(tmpdir / request.param)
class InitFromFileData:
def __init__(
self,
building_block,
in... | true | true |
1c0d842faa0b2818286e68228711a75a5ccc24fb | 736 | py | Python | tests/django_hstore_tests/models.py | Wordbank/django-hstore | 0adb27ab49d19cab8b6f90f621d1b636a2ca8fa1 | [
"MIT"
] | null | null | null | tests/django_hstore_tests/models.py | Wordbank/django-hstore | 0adb27ab49d19cab8b6f90f621d1b636a2ca8fa1 | [
"MIT"
] | null | null | null | tests/django_hstore_tests/models.py | Wordbank/django-hstore | 0adb27ab49d19cab8b6f90f621d1b636a2ca8fa1 | [
"MIT"
] | null | null | null | from django.db import models
from django_hstore import hstore
class Ref(models.Model):
name = models.CharField(max_length=32)
class HStoreModel(models.Model):
objects = hstore.HStoreManager()
class Meta:
abstract = True
class DataBag(HStoreModel):
name = models.CharField(max_length=32)
... | 21.028571 | 55 | 0.720109 | from django.db import models
from django_hstore import hstore
class Ref(models.Model):
name = models.CharField(max_length=32)
class HStoreModel(models.Model):
objects = hstore.HStoreManager()
class Meta:
abstract = True
class DataBag(HStoreModel):
name = models.CharField(max_length=32)
... | true | true |
1c0d843e3ed2dee63e3d150ffbbf1155c28cc3e8 | 777 | py | Python | oscar/lib/python2.7/site-packages/django/conf/locale/sq/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/sq/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/conf/locale/sq/formats.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i... | 31.08 | 78 | 0.736165 | from __future__ import unicode_literals
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i.A'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'Y-m-d'
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
| true | true |
1c0d844ca650294ef41f50e4e7c7eca00566dd98 | 1,319 | py | Python | openstack/metric/v1/archive_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | null | null | null | openstack/metric/v1/archive_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | null | null | null | openstack/metric/v1/archive_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | null | null | null | # 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 t... | 36.638889 | 78 | 0.742987 |
from openstack.metric import metric_service
from openstack import resource2 as resource
class ArchivePolicy(resource.Resource):
base_path = '/archive_policy'
service = metric_service.MetricService()
allow_create = True
allow_get = True
allow_delete = True
allow_list = True
n... | true | true |
1c0d84bcbba615f3de88dee95166a6ec58a9caf4 | 257 | py | Python | app/main/errors.py | omololevy/TreNews | e1c3861495457d30fbf0377f989bf59f13927d62 | [
"MIT"
] | 5 | 2021-10-31T22:04:03.000Z | 2022-01-08T17:42:07.000Z | app/main/errors.py | omololevy/TreNews | e1c3861495457d30fbf0377f989bf59f13927d62 | [
"MIT"
] | 1 | 2022-02-13T10:18:47.000Z | 2022-02-13T10:18:47.000Z | app/main/errors.py | omololevy/codit | 2e88029289444b668613b39b8207ad82ff71af2a | [
"MIT"
] | null | null | null | from flask import render_template
from . import main
@main.app_errorhandler(404)
def four_Ow_four(error):
'''
Function that handles the 404 file not found error
Args:
error
'''
return render_template('fourOwfour.html'),404
| 19.769231 | 54 | 0.684825 | from flask import render_template
from . import main
@main.app_errorhandler(404)
def four_Ow_four(error):
return render_template('fourOwfour.html'),404
| true | true |
1c0d85771c143a46e4864a3d72934e53400fdc04 | 243 | py | Python | ina219_cacti.py | weidnerm/solar_data_monitor | 48bcf9b45ab911bdb7af3dff17d28c8f16d2c925 | [
"MIT"
] | 16 | 2015-06-11T17:11:42.000Z | 2021-01-31T02:29:20.000Z | ina219_cacti.py | weidnerm/solar_data_monitor | 48bcf9b45ab911bdb7af3dff17d28c8f16d2c925 | [
"MIT"
] | 3 | 2016-07-19T12:23:42.000Z | 2017-09-02T06:28:23.000Z | ina219_cacti.py | weidnerm/solar_data_monitor | 48bcf9b45ab911bdb7af3dff17d28c8f16d2c925 | [
"MIT"
] | 15 | 2015-04-07T05:33:49.000Z | 2020-05-02T20:55:27.000Z | #!/usr/bin/python
from Subfact_ina219 import INA219
ina = INA219()
result = ina.getBusVoltage_V()
print "shunt:%.3f bus:%.3f current:%d power:%d" % ( ina.getShuntVoltage_mV(), ina.getBusVoltage_V(), ina.getCurrent_mA(), ina.getPower_mW() )
| 27 | 141 | 0.720165 |
from Subfact_ina219 import INA219
ina = INA219()
result = ina.getBusVoltage_V()
print "shunt:%.3f bus:%.3f current:%d power:%d" % ( ina.getShuntVoltage_mV(), ina.getBusVoltage_V(), ina.getCurrent_mA(), ina.getPower_mW() )
| false | true |
1c0d85c6b1b109b5831bf9bd049b5be56bb632c4 | 402 | py | Python | Estrutura de Repetição/Soma e media de cinco.py | abraaogleiber/Python-Estruturado | 0900dc31da2d8939a416a0e1a80dc8ff18c859d5 | [
"MIT"
] | null | null | null | Estrutura de Repetição/Soma e media de cinco.py | abraaogleiber/Python-Estruturado | 0900dc31da2d8939a416a0e1a80dc8ff18c859d5 | [
"MIT"
] | null | null | null | Estrutura de Repetição/Soma e media de cinco.py | abraaogleiber/Python-Estruturado | 0900dc31da2d8939a416a0e1a80dc8ff18c859d5 | [
"MIT"
] | null | null | null | """
Programa 053
Área de estudos.
data 24.11.2020 (Indefinida) Hs
@Autor: Abraão A. Silva
"""
soma = int()
cont = int()
# Repetição definida com variavel de controle.
for n in range(1, 6):
numero = int(input(f'{n}º Número.: '))
# Processamneto dos dados.
soma += numero
cont += 1
media = soma / co... | 20.1 | 78 | 0.639303 |
soma = int()
cont = int()
for n in range(1, 6):
numero = int(input(f'{n}º Número.: '))
soma += numero
cont += 1
media = soma / cont
print(f'A soma dos números digitados é {soma} e sua média é {media}.') | true | true |
1c0d860ae08eb268144629278ae041757a7f58ea | 14,255 | py | Python | misc/FirstClassify.py | sethr07/surveys | da8e940de8e0ab361e25b268dfcd4cfda55e68fa | [
"MIT"
] | 2 | 2018-06-12T16:33:40.000Z | 2019-03-25T11:23:13.000Z | misc/FirstClassify.py | sethr07/surveys | da8e940de8e0ab361e25b268dfcd4cfda55e68fa | [
"MIT"
] | null | null | null | misc/FirstClassify.py | sethr07/surveys | da8e940de8e0ab361e25b268dfcd4cfda55e68fa | [
"MIT"
] | 2 | 2022-01-29T23:37:16.000Z | 2022-02-14T00:39:29.000Z | #!/usr/bin/python
# a version with some abandoned code
# this starts to classify the output file we got back from
# CensysIESMTP.py
import sys
import json
import socket
import datetime
from dateutil import parser # for parsing time from comand line and certs
import pytz # for adding back TZ info to allow comparisons... | 35.197531 | 122 | 0.58134 |
import sys
import json
import socket
import datetime
from dateutil import parser import pytz
# Pity we still use 'em though.
def dn2cn(dn):
try:
start_needle="CN="
start_pos=dn.find(start_needle)
if start_pos==-1:
return ''
start_pos += len(start_needle)
... | false | true |
1c0d86eab7ddeb9c5e493e389b5884822124b1c8 | 12,237 | py | Python | model/detection_model/PSENet/.ipynb_checkpoints/train_ic15-checkpoint.py | JinGyeSetBirdsFree/FudanOCR | e6b18b0eefaf832b2eb7198f5df79e00bd4cee36 | [
"MIT"
] | 25 | 2020-02-29T12:14:10.000Z | 2020-04-24T07:56:06.000Z | model/detection_model/PSENet/.ipynb_checkpoints/train_ic15-checkpoint.py | dun933/FudanOCR | fd79b679044ea23fd9eb30691453ed0805d2e98b | [
"MIT"
] | 33 | 2020-12-10T19:15:39.000Z | 2022-03-12T00:17:30.000Z | model/detection_model/PSENet/.ipynb_checkpoints/train_ic15-checkpoint.py | dun933/FudanOCR | fd79b679044ea23fd9eb30691453ed0805d2e98b | [
"MIT"
] | 4 | 2020-02-29T12:14:18.000Z | 2020-04-12T12:26:50.000Z | import sys
import torch
import argparse
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import shutil
from torch.autograd import Variable
from torch.utils import data
import os
from dataset import IC15Loader
from metrics import runningScore
import models
from util import Logger, AverageMeter
... | 40.519868 | 196 | 0.639618 | import sys
import torch
import argparse
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import shutil
from torch.autograd import Variable
from torch.utils import data
import os
from dataset import IC15Loader
from metrics import runningScore
import models
from util import Logger, AverageMeter
... | true | true |
1c0d86f6d915a34807a1f2f0f24c754351a31c87 | 5,232 | py | Python | tools/voc_annotation.py | bnMikheili/keras-YOLOv3-model-set | 7583d791a97a82c7ebfdb2e09877e812df0a602c | [
"MIT"
] | null | null | null | tools/voc_annotation.py | bnMikheili/keras-YOLOv3-model-set | 7583d791a97a82c7ebfdb2e09877e812df0a602c | [
"MIT"
] | null | null | null | tools/voc_annotation.py | bnMikheili/keras-YOLOv3-model-set | 7583d791a97a82c7ebfdb2e09877e812df0a602c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, argparse
import numpy as np
import xml.etree.ElementTree as ET
from collections import OrderedDict
sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test'), ('2012', 'train'), ('2012', 'val')]
classes = ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus"... | 41.19685 | 205 | 0.654625 | import os, argparse
import numpy as np
import xml.etree.ElementTree as ET
from collections import OrderedDict
sets=[('2007', 'train'), ('2007', 'val'), ('2007', 'test'), ('2012', 'train'), ('2012', 'val')]
classes = ["aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", ... | true | true |
1c0d874d2fde57b667137a3ff875b316f501fbdb | 9,972 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200501/private_endpoint.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20200501/private_endpoint.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20200501/private_endpoint.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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... | 49.61194 | 1,034 | 0.683714 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['PrivateEndpoint']
class PrivateEndpoint(pulumi.CustomResource):
def __init__(__self__,... | true | true |
1c0d875881cdb2bb262575d294362ec1698060b7 | 276 | py | Python | apps/logs/migrations/0062_merge_20220325_1628.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | 1 | 2019-12-12T15:38:42.000Z | 2019-12-12T15:38:42.000Z | apps/logs/migrations/0062_merge_20220325_1628.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | apps/logs/migrations/0062_merge_20220325_1628.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-03-25 15:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logs', '0057_verbose_names'),
('logs', '0061_remove_manualdataupload_is_processed'),
]
operations = []
| 19.714286 | 62 | 0.67029 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logs', '0057_verbose_names'),
('logs', '0061_remove_manualdataupload_is_processed'),
]
operations = []
| true | true |
1c0d877626a712c66885868aaeb33be3dcae7eb6 | 6,747 | py | Python | baselines/word2number.py | benradford/few-shot-upsampling-for-protest-size-detection | bf4b82126620fe8b0b050e85c19096e198b75064 | [
"MIT"
] | 1 | 2022-02-10T16:01:08.000Z | 2022-02-10T16:01:08.000Z | baselines/word2number.py | benradford/few-shot-upsampling-for-protest-size-detection | bf4b82126620fe8b0b050e85c19096e198b75064 | [
"MIT"
] | null | null | null | baselines/word2number.py | benradford/few-shot-upsampling-for-protest-size-detection | bf4b82126620fe8b0b050e85c19096e198b75064 | [
"MIT"
] | null | null | null | # https://github.com/frootbirb/w2n/blob/master/word2number/w2n.py
num_names = {
'zero': 0,
'naught': 0,
'nil': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9,
'niner': 9,
'ten': 10,
'eleven': 11,
'twel... | 32.4375 | 148 | 0.56262 |
num_names = {
'zero': 0,
'naught': 0,
'nil': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9,
'niner': 9,
'ten': 10,
'eleven': 11,
'twelve': 12,
'thirteen': 13,
'fourteen': 14,
'fifteen': 15... | true | true |
1c0d8a9ccf84c07efdc6fccf1398119678f05528 | 903 | py | Python | res_mods/mods/packages/xvm_main/python/vehinfo_xtdb.py | peterbartha/ImmunoMod | cbf8cd49893d7082a347c1f72c0e39480869318a | [
"MIT"
] | null | null | null | res_mods/mods/packages/xvm_main/python/vehinfo_xtdb.py | peterbartha/ImmunoMod | cbf8cd49893d7082a347c1f72c0e39480869318a | [
"MIT"
] | 1 | 2016-04-03T13:31:39.000Z | 2016-04-03T16:48:26.000Z | res_mods/mods/packages/xvm_main/python/vehinfo_xtdb.py | peterbartha/ImmunoMod | cbf8cd49893d7082a347c1f72c0e39480869318a | [
"MIT"
] | null | null | null | """ XVM (c) www.modxvm.com 2013-2017 """
# TODO: load data from server
import vehinfo
from logger import *
# PUBLIC
def calculateXTDB(vehCD, dmg_per_battle):
data = _getData(vehCD)
if data is None:
return -1
# calculate XVM Scale
return next((i for i,v in enumerate(data['x']) if v > dmg_pe... | 15.842105 | 79 | 0.654485 |
import vehinfo
from logger import *
def calculateXTDB(vehCD, dmg_per_battle):
data = _getData(vehCD)
if data is None:
return -1
return next((i for i,v in enumerate(data['x']) if v > dmg_per_battle), 100)
def vehArrayXTDB(vehCD):
data = _getData(vehCD)
if data is None:
retu... | true | true |
1c0d8b8393d8081962db8dd0a304eddc5e1d3d75 | 191 | py | Python | 05/to_ssa.py | mdmoeller/6120_tasks | 8e64bb2008c7c46336ea08e211407a44b1ae64f0 | [
"MIT"
] | null | null | null | 05/to_ssa.py | mdmoeller/6120_tasks | 8e64bb2008c7c46336ea08e211407a44b1ae64f0 | [
"MIT"
] | null | null | null | 05/to_ssa.py | mdmoeller/6120_tasks | 8e64bb2008c7c46336ea08e211407a44b1ae64f0 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import json
from ssa import to_ssa
def main():
prog = json.load(sys.stdin)
json.dump(to_ssa(prog), sys.stdout)
if __name__ == '__main__':
main()
| 13.642857 | 39 | 0.664921 | import sys
import json
from ssa import to_ssa
def main():
prog = json.load(sys.stdin)
json.dump(to_ssa(prog), sys.stdout)
if __name__ == '__main__':
main()
| true | true |
1c0d8be39881486cd7866d8cb8d2af8eb1b12b25 | 4,209 | py | Python | src/super_gradients/training/models/classification_models/senet.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 308 | 2021-12-30T10:14:30.000Z | 2022-03-30T19:05:31.000Z | src/super_gradients/training/models/classification_models/senet.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | 24 | 2022-01-10T08:05:37.000Z | 2022-03-30T18:49:06.000Z | src/super_gradients/training/models/classification_models/senet.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | 26 | 2021-12-31T06:04:07.000Z | 2022-03-21T09:51:44.000Z | '''SENet in PyTorch.
SENet is the winner of ImageNet-2017. The paper is not released yet.
Code adapted from https://github.com/fastai/imagenet-fast/blob/master/cifar10/models/cifar10/senet.py
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from super_gradients.training.models.sg_module import S... | 33.672 | 103 | 0.60632 | import torch
import torch.nn as nn
import torch.nn.functional as F
from super_gradients.training.models.sg_module import SgModule
class BasicBlock(nn.Module):
def __init__(self, in_planes, planes, stride=1):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=3... | true | true |
1c0d8d6c3c8323cc4929c4da5780b9e1f436e9af | 2,556 | py | Python | src/main/python/tools/files.py | boom-roasted/ImageWAO | 944505dab1a7c97b8eae2bf9fb30006d0f471f89 | [
"MIT"
] | 1 | 2020-03-22T01:52:52.000Z | 2020-03-22T01:52:52.000Z | src/main/python/tools/files.py | leftaltkey/ImageWAO | 944505dab1a7c97b8eae2bf9fb30006d0f471f89 | [
"MIT"
] | 2 | 2021-06-08T21:12:47.000Z | 2021-06-08T21:30:32.000Z | src/main/python/tools/files.py | leftaltkey/ImageWAO | 944505dab1a7c97b8eae2bf9fb30006d0f471f89 | [
"MIT"
] | null | null | null | """
Functions for dealing with files and folders.
"""
import os
import sys
from pathlib import Path
from PySide2 import QtCore, QtGui
from base import config
def showInFolder(path, select=True):
"""
Show a file or folder with explorer/finder.
Source: https://stackoverflow.com/a/46019091/3388962
If... | 28.719101 | 85 | 0.622457 |
import os
import sys
from pathlib import Path
from PySide2 import QtCore, QtGui
from base import config
def showInFolder(path, select=True):
path = os.path.abspath(path)
dirPath = path if os.path.isdir(path) else os.path.dirname(path)
if sys.platform == "win32":
args = []
if select:
... | true | true |
1c0d8e059bdb20ed411c9b787c46daf111d14372 | 66,951 | py | Python | pint_xarray/tests/test_accessors.py | TomNicholas/pint-xarray | 6ee1bf9aff0c6bef51bde2ecf6a62660a9ed6f39 | [
"Apache-2.0"
] | 7 | 2020-04-08T13:50:22.000Z | 2020-06-13T03:58:06.000Z | pint_xarray/tests/test_accessors.py | TomNicholas/pint-xarray | 6ee1bf9aff0c6bef51bde2ecf6a62660a9ed6f39 | [
"Apache-2.0"
] | 11 | 2020-04-08T14:10:49.000Z | 2020-07-08T16:09:22.000Z | pint_xarray/tests/test_accessors.py | TomNicholas/pint-xarray | 6ee1bf9aff0c6bef51bde2ecf6a62660a9ed6f39 | [
"Apache-2.0"
] | 2 | 2020-04-08T13:50:29.000Z | 2020-04-08T14:08:20.000Z | import numpy as np
import pint
import pytest
import xarray as xr
from numpy.testing import assert_array_equal
from pint import Unit, UnitRegistry
from .. import accessors, conversion
from .utils import (
assert_equal,
assert_identical,
assert_units_equal,
raises_regex,
requires_bottleneck,
requ... | 34.123853 | 88 | 0.381966 | import numpy as np
import pint
import pytest
import xarray as xr
from numpy.testing import assert_array_equal
from pint import Unit, UnitRegistry
from .. import accessors, conversion
from .utils import (
assert_equal,
assert_identical,
assert_units_equal,
raises_regex,
requires_bottleneck,
requ... | true | true |
1c0d8ebd0e62473a870e46bb5692468e2ad8ed2e | 777 | py | Python | wavescache/config.py | djpnewton/xchwallet | 5d41489fc75a8f97a7619161559df968193fb45b | [
"MIT"
] | 1 | 2018-01-31T00:40:43.000Z | 2018-01-31T00:40:43.000Z | wavescache/config.py | djpnewton/xchwallet | 5d41489fc75a8f97a7619161559df968193fb45b | [
"MIT"
] | 2 | 2018-01-21T23:53:56.000Z | 2019-06-06T03:10:43.000Z | wavescache/config.py | djpnewton/xchwallet | 5d41489fc75a8f97a7619161559df968193fb45b | [
"MIT"
] | 3 | 2018-01-21T23:34:23.000Z | 2020-06-21T01:27:28.000Z | import os
import configparser
def get_filename():
return os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.cfg")
def read_cfg():
cp = configparser.ConfigParser()
cp.read(get_filename())
cfg = type("cfg", (object,), {})()
cfg.testnet = cp.getboolean("network", "testnet")
cfg.n... | 25.9 | 82 | 0.635779 | import os
import configparser
def get_filename():
return os.path.join(os.path.dirname(os.path.realpath(__file__)), "config.cfg")
def read_cfg():
cp = configparser.ConfigParser()
cp.read(get_filename())
cfg = type("cfg", (object,), {})()
cfg.testnet = cp.getboolean("network", "testnet")
cfg.n... | true | true |
1c0d902920c2e4fe3871897ab5267ea514c85f18 | 6,972 | py | Python | sdks/python/apache_beam/runners/interactive/display/display_manager.py | rodrigob/beam | e2ce4037f85619f946b3d6a3a90955cdf1c19b4a | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/apache_beam/runners/interactive/display/display_manager.py | rodrigob/beam | e2ce4037f85619f946b3d6a3a90955cdf1c19b4a | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | sdks/python/apache_beam/runners/interactive/display/display_manager.py | rodrigob/beam | e2ce4037f85619f946b3d6a3a90955cdf1c19b4a | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-23T08:45:00.000Z | 2019-09-23T08:45:00.000Z | #
# 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 us... | 38.949721 | 104 | 0.712851 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import threading
import time
from apache_beam.runners.interactive.display import interactive_pipeline_graph
try:
import IPython _display_progress = IPython.display.display
def _... | true | true |
1c0d906c73df333a759e577788204112201d4e4a | 1,159 | py | Python | Chapter_04/chap04_prog_04_writingTest_no.py | rojassergio/Prealgebra-via-Python-Programming | 8d1cdf103af2a39f6ae7bba76e9a6a0182eb39d3 | [
"MIT"
] | 1 | 2018-06-19T11:54:15.000Z | 2018-06-19T11:54:15.000Z | Chapter_04/chap04_prog_04_writingTest_no.py | rojassergio/Prealgebra-via-Python-Programming | 8d1cdf103af2a39f6ae7bba76e9a6a0182eb39d3 | [
"MIT"
] | null | null | null | Chapter_04/chap04_prog_04_writingTest_no.py | rojassergio/Prealgebra-via-Python-Programming | 8d1cdf103af2a39f6ae7bba76e9a6a0182eb39d3 | [
"MIT"
] | 3 | 2020-03-02T22:31:18.000Z | 2021-04-05T05:06:39.000Z |
"""
Content under Creative Commons Attribution license CC-BY 4.0,
code under MIT license (c)2018 Sergio Rojas (srojas@usb.ve)
http://en.wikipedia.org/wiki/MIT_License
http://creativecommons.org/licenses/by/4.0/
Created on april, 2018
Last Modified on: may 15, 2018
This program illustrates how to write data to ... | 32.194444 | 74 | 0.650561 |
thefile = 'chap04_write_test_file.txt'
colsLabel = ['x', 'x*x', 'x*x*x']
values = [ [1, 1, 1], [2, 4, 8]]
with open(thefile, 'wt') as openedFile:
try:
for cols in colsLabel:
openedFile.write('{0} '.format(cols))
openedFile.write('\n')
for cols in values:
for rows in co... | true | true |
1c0d909ae919f3318c98f7023830af3a509e7472 | 2,419 | py | Python | twoCharges.py | makutaga/vtksample | 4eaea97547355ea87a12f7f1a3283940cda3d2da | [
"CC0-1.0"
] | null | null | null | twoCharges.py | makutaga/vtksample | 4eaea97547355ea87a12f7f1a3283940cda3d2da | [
"CC0-1.0"
] | null | null | null | twoCharges.py | makutaga/vtksample | 4eaea97547355ea87a12f7f1a3283940cda3d2da | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
"""EVTK sample script
空間に正負の電荷を置いたときの周辺の電位,電界分布を計算し,
vtkファイルで出力する.
"""
import numpy as np
import scipy.constants as const
import scipy
import pyevtk
def main(vtktype='vts'):
""" メイン
Args:
vtktype : vtk ファイルの種類を指定する.(vts | vtr)
"""
calc_range = 1.0 # 計算範囲 -calc_rang... | 26.582418 | 64 | 0.5031 |
import numpy as np
import scipy.constants as const
import scipy
import pyevtk
def main(vtktype='vts'):
calc_range = 1.0 nsamples = 200 k = 1/(4 * const.pi * const.epsilon_0)
charge = [
{'q': -1.0, 'px': -0.2, 'py': 0.0, 'pz': 0.0},
{'q': 1.0, 'px': 0.2, 'py': 0.0, 'p... | true | true |
1c0d90af183f6603ca70f91610ba50e1222a5e2c | 2,656 | py | Python | gym/spaces/dict_space.py | xquyvu/gym | 687a65f7123889e980b8b6593b7692095a812604 | [
"Python-2.0",
"OLDAP-2.7"
] | 1 | 2019-08-08T08:43:07.000Z | 2019-08-08T08:43:07.000Z | gym/spaces/dict_space.py | xquyvu/gym | 687a65f7123889e980b8b6593b7692095a812604 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/spaces/dict_space.py | xquyvu/gym | 687a65f7123889e980b8b6593b7692095a812604 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | import gym
from collections import OrderedDict
class Dict(gym.Space):
"""
A dictionary of simpler spaces.
Example usage:
self.observation_space = spaces.Dict({"position": spaces.Discrete(2), "velocity": spaces.Discrete(3)})
Example usage [nested]:
self.nested_observation_space = spaces.Dict({... | 36.383562 | 109 | 0.551205 | import gym
from collections import OrderedDict
class Dict(gym.Space):
def __init__(self, spaces):
if isinstance(spaces, dict):
spaces = OrderedDict(sorted(list(spaces.items())))
if isinstance(spaces, list):
spaces = OrderedDict(spaces)
self.spaces = spaces
gy... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.