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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2f6ed365f1583d7cb3505faa954aa708e16799 | 3,114 | py | Python | tests/releases/test_cancel_release.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 3 | 2019-05-04T02:07:28.000Z | 2020-10-16T17:47:44.000Z | tests/releases/test_cancel_release.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | 604 | 2019-02-21T18:14:51.000Z | 2022-02-10T08:13:54.000Z | tests/releases/test_cancel_release.py | kids-first/kf-api-study-creator | 93a79b108b6474f9b4135ace06c89ddcf63dd257 | [
"Apache-2.0"
] | null | null | null | import pytest
from graphql_relay import to_global_id
from creator.releases.models import Release
from creator.releases.factories import ReleaseFactory
CANCEL_RELEASE = """
mutation ($release: ID!) {
cancelRelease(release: $release) {
release {
id
state
}
}
}
"""
@pyt... | 25.112903 | 78 | 0.569685 | import pytest
from graphql_relay import to_global_id
from creator.releases.models import Release
from creator.releases.factories import ReleaseFactory
CANCEL_RELEASE = """
mutation ($release: ID!) {
cancelRelease(release: $release) {
release {
id
state
}
}
}
"""
@pyt... | true | true |
1c2f7158c00e6dd0245bf303c5fa068571a21cd0 | 7,507 | py | Python | hummingbot/wallet/ethereum/watcher/websocket_watcher.py | csdenboer/hummingbot | 8a799675a325ebdbb74d76b2a44472cdbf74d691 | [
"Apache-2.0"
] | 37 | 2020-07-08T03:44:26.000Z | 2022-01-16T12:35:26.000Z | hummingbot/wallet/ethereum/watcher/websocket_watcher.py | csdenboer/hummingbot | 8a799675a325ebdbb74d76b2a44472cdbf74d691 | [
"Apache-2.0"
] | 13 | 2021-02-16T01:57:23.000Z | 2021-02-16T03:50:03.000Z | hummingbot/wallet/ethereum/watcher/websocket_watcher.py | csdenboer/hummingbot | 8a799675a325ebdbb74d76b2a44472cdbf74d691 | [
"Apache-2.0"
] | 17 | 2021-04-07T21:29:46.000Z | 2022-02-03T02:01:04.000Z | import websockets
from web3 import Web3
from web3.exceptions import BlockNotFound
from websockets.exceptions import ConnectionClosed
import logging
import ujson
import asyncio
from hexbytes import HexBytes
from web3.datastructures import AttributeDict
from cachetools import TTLCache
from typing import Optional, Dict,... | 41.705556 | 114 | 0.582257 | import websockets
from web3 import Web3
from web3.exceptions import BlockNotFound
from websockets.exceptions import ConnectionClosed
import logging
import ujson
import asyncio
from hexbytes import HexBytes
from web3.datastructures import AttributeDict
from cachetools import TTLCache
from typing import Optional, Dict,... | true | true |
1c2f7270fe582a03985d45be13dfa2f5b03ec50e | 3,445 | py | Python | utils/measure/light_controller/hue.py | KrzysztofHajdamowicz/homeassistant-powercalc | 374312e21d1c21b28984990442ec56fc52177f4e | [
"MIT"
] | 219 | 2021-06-12T20:55:57.000Z | 2022-03-30T07:56:43.000Z | utils/measure/light_controller/hue.py | KrzysztofHajdamowicz/homeassistant-powercalc | 374312e21d1c21b28984990442ec56fc52177f4e | [
"MIT"
] | 420 | 2021-06-09T20:22:03.000Z | 2022-03-31T15:35:45.000Z | utils/measure/light_controller/hue.py | KrzysztofHajdamowicz/homeassistant-powercalc | 374312e21d1c21b28984990442ec56fc52177f4e | [
"MIT"
] | 84 | 2021-06-09T18:18:03.000Z | 2022-03-29T09:28:06.000Z | from __future__ import annotations
import os
from phue import Bridge, PhueRegistrationException
from PyInquirer import Separator
from .controller import LightController, LightInfo
from .errors import LightControllerError, ModelNotDiscoveredError
NAME = "hue"
TYPE_LIGHT = "light"
TYPE_GROUP = "group"
class HueLight... | 33.77451 | 113 | 0.593033 | from __future__ import annotations
import os
from phue import Bridge, PhueRegistrationException
from PyInquirer import Separator
from .controller import LightController, LightInfo
from .errors import LightControllerError, ModelNotDiscoveredError
NAME = "hue"
TYPE_LIGHT = "light"
TYPE_GROUP = "group"
class HueLight... | true | true |
1c2f73592f4593515d1f7796a421c2402e8aaa17 | 176 | py | Python | src/setup.py | mountain/self | 189e00e810d4d719fa6b37b400eef17d2521a64c | [
"MIT"
] | 5 | 2019-12-30T16:18:06.000Z | 2022-03-22T17:36:09.000Z | src/setup.py | mountain/self | 189e00e810d4d719fa6b37b400eef17d2521a64c | [
"MIT"
] | 2 | 2019-12-30T10:09:15.000Z | 2020-01-03T02:48:18.000Z | src/setup.py | mountain/self | 189e00e810d4d719fa6b37b400eef17d2521a64c | [
"MIT"
] | 3 | 2019-12-30T06:10:04.000Z | 2021-04-23T09:37:48.000Z | # -*- coding: utf-8 -*-
from setuptools import setup
setup(name='gym_selfx',
version='0.0.1',
install_requires=['gym'] # And any other dependencies foo needs
)
| 17.6 | 70 | 0.642045 |
from setuptools import setup
setup(name='gym_selfx',
version='0.0.1',
install_requires=['gym']
)
| true | true |
1c2f736dee638ce5325945c68f2abacc6aa6182c | 2,036 | py | Python | haystack/utils/geo.py | cbows/django-haystack | 80c154b7b11fdcf99dd2ef0e82342ed13e26053a | [
"BSD-3-Clause"
] | 2,021 | 2015-02-06T07:45:08.000Z | 2022-03-30T12:26:39.000Z | haystack/utils/geo.py | cbows/django-haystack | 80c154b7b11fdcf99dd2ef0e82342ed13e26053a | [
"BSD-3-Clause"
] | 787 | 2015-02-03T20:06:04.000Z | 2022-03-30T09:00:38.000Z | haystack/utils/geo.py | cbows/django-haystack | 80c154b7b11fdcf99dd2ef0e82342ed13e26053a | [
"BSD-3-Clause"
] | 878 | 2015-02-04T15:29:50.000Z | 2022-03-28T16:51:44.000Z | from haystack.constants import WGS_84_SRID
from haystack.exceptions import SpatialError
def ensure_geometry(geom):
"""
Makes sure the parameter passed in looks like a GEOS ``GEOSGeometry``.
"""
if not hasattr(geom, "geom_type"):
raise SpatialError("Point '%s' doesn't appear to be a GEOS geomet... | 28.277778 | 85 | 0.655697 | from haystack.constants import WGS_84_SRID
from haystack.exceptions import SpatialError
def ensure_geometry(geom):
if not hasattr(geom, "geom_type"):
raise SpatialError("Point '%s' doesn't appear to be a GEOS geometry." % geom)
return geom
def ensure_point(geom):
ensure_geometry(geom)
if g... | true | true |
1c2f75d353f6511ae9439906228dcaac9f661c2c | 316 | py | Python | catkin_ws/src/ominibot_car/setup.py | CIRCUSPi/ROSKY | d0328e19cb65416b9353a1faabc725c1ac01c9f6 | [
"MIT"
] | 3 | 2021-08-03T07:08:24.000Z | 2021-09-12T14:33:41.000Z | catkin_ws/src/ominibot_car/setup.py | kjoelovelife/ROSKY | d0328e19cb65416b9353a1faabc725c1ac01c9f6 | [
"MIT"
] | 1 | 2021-09-03T13:27:33.000Z | 2021-09-06T03:28:16.000Z | catkin_ws/src/ominibot_car/setup.py | kjoelovelife/ROSKY | d0328e19cb65416b9353a1faabc725c1ac01c9f6 | [
"MIT"
] | 4 | 2020-12-28T08:20:07.000Z | 2021-08-10T06:55:30.000Z | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['ominibot_car'],
package_dir={'': 'include'},
)
setup(**setup_args)
| 24.307692 | 61 | 0.765823 | tup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['ominibot_car'],
package_dir={'': 'include'},
)
setup(**setup_args)
| true | true |
1c2f760f7cf4ccd458cfcf6a6dae6d4d18c5a94f | 24,454 | py | Python | pysph/tools/geometry.py | suhasjains/pysph | df4e882ac790b2790ccd23fb1aaa66a049c2f7b1 | [
"BSD-3-Clause"
] | 3 | 2021-01-06T03:01:18.000Z | 2022-03-21T03:02:55.000Z | docker/water/sph/tags/pysph/pysph/tools/geometry.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | 1 | 2018-11-17T15:39:11.000Z | 2018-11-17T15:39:11.000Z | docker/water/sph/tags/pysph/pysph/tools/geometry.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | 1 | 2020-06-21T08:42:07.000Z | 2020-06-21T08:42:07.000Z | from __future__ import division
import numpy as np
import copy
from pysph.base.nnps import LinkedListNNPS
from pysph.base.utils import get_particle_array, get_particle_array_wcsph
from pyzoltan.core.carray import UIntArray
from numpy.linalg import norm
def distance(point1, point2=np.array([0.0, 0.0, 0.0])):
retur... | 32.692513 | 79 | 0.567637 | from __future__ import division
import numpy as np
import copy
from pysph.base.nnps import LinkedListNNPS
from pysph.base.utils import get_particle_array, get_particle_array_wcsph
from pyzoltan.core.carray import UIntArray
from numpy.linalg import norm
def distance(point1, point2=np.array([0.0, 0.0, 0.0])):
retur... | true | true |
1c2f763199c907a4bd8ad18f5c4993d0bb39d63b | 367 | py | Python | lib/config_helper.py | ebeuerle/server_count | de701e8868ce7374a52ba6a5bd9bdcd5b1d1aa69 | [
"Unlicense"
] | null | null | null | lib/config_helper.py | ebeuerle/server_count | de701e8868ce7374a52ba6a5bd9bdcd5b1d1aa69 | [
"Unlicense"
] | null | null | null | lib/config_helper.py | ebeuerle/server_count | de701e8868ce7374a52ba6a5bd9bdcd5b1d1aa69 | [
"Unlicense"
] | null | null | null | import os
import yaml
PORTAL_CONFIG = os.path.join(os.path.dirname(__file__), '../configs/configs.yml')
CONFIG = yaml.load(file(PORTAL_CONFIG, 'r'))
class ConfigHelper(object):
def __init__(self):
self.halo_key = CONFIG["halo"]["api_key"]
self.halo_secret = CONFIG["halo"]["api_secret_key"]
... | 30.583333 | 81 | 0.659401 | import os
import yaml
PORTAL_CONFIG = os.path.join(os.path.dirname(__file__), '../configs/configs.yml')
CONFIG = yaml.load(file(PORTAL_CONFIG, 'r'))
class ConfigHelper(object):
def __init__(self):
self.halo_key = CONFIG["halo"]["api_key"]
self.halo_secret = CONFIG["halo"]["api_secret_key"]
... | true | true |
1c2f76a2e472d9aec97545d33462dff9f8433f07 | 7,401 | py | Python | imcls/datasets/ssdg_pacs.py | KaiyangZhou/mixstyle-release | 2a6bfe8016ab0f33d751f585b810bc27310096aa | [
"MIT"
] | 160 | 2021-01-13T07:17:27.000Z | 2022-03-30T14:43:54.000Z | DomainGeneralization/imcls/datasets/ssdg_pacs.py | YBZh/EFDM | 0baf35e26d22d0ab7d68a5f6cd7ed2541bdf8e4a | [
"MIT"
] | 15 | 2021-03-23T22:30:20.000Z | 2022-03-29T03:04:33.000Z | imcls/datasets/ssdg_pacs.py | KaiyangZhou/mixstyle-release | 2a6bfe8016ab0f33d751f585b810bc27310096aa | [
"MIT"
] | 22 | 2021-01-18T06:37:45.000Z | 2022-03-16T07:37:15.000Z | import os.path as osp
import random
from collections import defaultdict
from dassl.data.datasets import DATASET_REGISTRY, Datum, DatasetBase
from dassl.utils import mkdir_if_missing, read_json, write_json
@DATASET_REGISTRY.register()
class SSDGPACS(DatasetBase):
"""PACS.
Statistics:
- 4 domains: Pho... | 37.005 | 106 | 0.576409 | import os.path as osp
import random
from collections import defaultdict
from dassl.data.datasets import DATASET_REGISTRY, Datum, DatasetBase
from dassl.utils import mkdir_if_missing, read_json, write_json
@DATASET_REGISTRY.register()
class SSDGPACS(DatasetBase):
dataset_dir = 'pacs'
domains = ['art_painting'... | true | true |
1c2f77808aaa6541d49b4da9726f01bf5798e7fe | 2,874 | py | Python | EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py | Hemida93/cmssw | 75a37059fc69b625a5e985f4f2e684cdebeeb8b5 | [
"Apache-2.0"
] | 1 | 2020-05-27T10:52:33.000Z | 2020-05-27T10:52:33.000Z | EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py | Hemida93/cmssw | 75a37059fc69b625a5e985f4f2e684cdebeeb8b5 | [
"Apache-2.0"
] | 28 | 2019-08-15T15:21:11.000Z | 2021-12-29T14:13:18.000Z | EventFilter/SiPixelRawToDigi/test/runRawToDigi_cfg.py | Hemida93/cmssw | 75a37059fc69b625a5e985f4f2e684cdebeeb8b5 | [
"Apache-2.0"
] | 1 | 2020-08-18T10:29:49.000Z | 2020-08-18T10:29:49.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("MyRawToDigi")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
#process.load("Configuration.StandardSequences.MagneticField_38T_cff")
process.load('Configuration.StandardSequences.M... | 42.264706 | 123 | 0.787404 | import FWCore.ParameterSet.Config as cms
process = cms.Process("MyRawToDigi")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
process.load('Configuration.StandardSequences.MagneticField_cff')
process.load("Configuration.StandardSequences.Front... | true | true |
1c2f77956e5fa37d1365479ad014e939c953bc44 | 376 | py | Python | app-flask/app-flask/app.py | benfab/mesos-demo-apps | e8da8cca8a1f916ea482ce21a6a3155d0ce56243 | [
"Apache-2.0"
] | null | null | null | app-flask/app-flask/app.py | benfab/mesos-demo-apps | e8da8cca8a1f916ea482ce21a6a3155d0ce56243 | [
"Apache-2.0"
] | null | null | null | app-flask/app-flask/app.py | benfab/mesos-demo-apps | e8da8cca8a1f916ea482ce21a6a3155d0ce56243 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template
import socket
app = Flask(__name__)
ip_address = socket.gethostbyname(socket.gethostname())
docker_hostname = socket.gethostname()
@app.route('/')
def hello_world():
return render_template('index.html', hostname=docker_hostname,myip=ip_address)
if __name__ == "__main__":
... | 26.857143 | 82 | 0.75 | from flask import Flask, render_template
import socket
app = Flask(__name__)
ip_address = socket.gethostbyname(socket.gethostname())
docker_hostname = socket.gethostname()
@app.route('/')
def hello_world():
return render_template('index.html', hostname=docker_hostname,myip=ip_address)
if __name__ == "__main__":
... | true | true |
1c2f77e32e620dacd00397ce78b7c62f84f3f36d | 6,947 | py | Python | build/scripts-3.7/startproject.py | lixiaopi1985/agrimet_scraper | eb566d2bbb6f1882656a1bc5319e9f35ad7dc5df | [
"MIT"
] | null | null | null | build/scripts-3.7/startproject.py | lixiaopi1985/agrimet_scraper | eb566d2bbb6f1882656a1bc5319e9f35ad7dc5df | [
"MIT"
] | null | null | null | build/scripts-3.7/startproject.py | lixiaopi1985/agrimet_scraper | eb566d2bbb6f1882656a1bc5319e9f35ad7dc5df | [
"MIT"
] | null | null | null | #!python
"""This module is used to run at command line to initialize project
myproject
| | | |_ db
| | |___ config
| |_____ log
|_______ station info
"""
import argparse
import os
import sys
import sqlite3
from configparser import RawConfigParser
import shutil
from agrimetscraper.utils.configurations import basic_c... | 35.085859 | 182 | 0.690226 |
import argparse
import os
import sys
import sqlite3
from configparser import RawConfigParser
import shutil
from agrimetscraper.utils.configurations import basic_configs
from agrimetscraper.utils.configreader import Configtuner
from agrimetscraper.utils.stationinfo import Stationinfo
from agrimetscraper.utils.mylogge... | true | true |
1c2f7840f420a76ee14e7ae813ac5048f0aeb1fa | 11,631 | py | Python | gym_trading/envs/Testing_Env.py | Deion14/mlp3 | cab1a18b36114f49622e3a5fc8650efda5205e01 | [
"MIT"
] | null | null | null | gym_trading/envs/Testing_Env.py | Deion14/mlp3 | cab1a18b36114f49622e3a5fc8650efda5205e01 | [
"MIT"
] | 1 | 2018-03-04T13:43:10.000Z | 2018-03-04T13:43:10.000Z | gym_trading/envs/Testing_Env.py | Deion14/mlp3 | cab1a18b36114f49622e3a5fc8650efda5205e01 | [
"MIT"
] | null | null | null |
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from collections import Counter
import quandl
import numpy as np
from numpy import random
import pandas as pd
import logging
import pdb
from sklearn import preprocessing
import tempfile
log = logging.getLogger(__name__)
log.info('%s logger... | 33.326648 | 182 | 0.590491 |
import gym
from gym import error, spaces, utils
from gym.utils import seeding
from collections import Counter
import quandl
import numpy as np
from numpy import random
import pandas as pd
import logging
import pdb
from sklearn import preprocessing
import tempfile
log = logging.getLogger(__name__)
log.info('%s logger... | true | true |
1c2f787ce2eac863bb77dd9a5d921cb975743311 | 428 | py | Python | array/0283_move_zeroes/0283_move_zeroes.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 6 | 2019-09-16T01:50:44.000Z | 2020-09-17T08:52:25.000Z | array/0283_move_zeroes/0283_move_zeroes.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | null | null | null | array/0283_move_zeroes/0283_move_zeroes.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 4 | 2020-02-07T12:43:16.000Z | 2021-04-11T06:38:55.000Z | # -*- coding: utf-8 -*-
class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: None Do not return anything, modify nums in-place instead.
"""
pos = 0
for i in range(len(nums)):
if nums[i]:
nums[i], nums[pos]... | 22.526316 | 74 | 0.502336 |
class Solution(object):
def moveZeroes(self, nums):
pos = 0
for i in range(len(nums)):
if nums[i]:
nums[i], nums[pos] = nums[pos], nums[i]
pos += 1
nums = [0,1,0,3,12]
Solution().moveZeroes(nums)
print(nums) | true | true |
1c2f7a621aca507291ac0ddb3de1ae98acabf9a0 | 4,878 | py | Python | tests/integration/states/test_nsxt_manager.py | jain-prerna/salt-ext-modules-vmware-old | 89ea6dd77c6d5a35dc55c23adbdc361949a63057 | [
"Apache-2.0"
] | 1 | 2021-11-02T20:24:19.000Z | 2021-11-02T20:24:19.000Z | tests/integration/states/test_nsxt_manager.py | cmcmarrow/salt-ext-modules-vmware | c546a9f9ae121b7399dabae82f714117d0ab558d | [
"Apache-2.0"
] | null | null | null | tests/integration/states/test_nsxt_manager.py | cmcmarrow/salt-ext-modules-vmware | c546a9f9ae121b7399dabae82f714117d0ab558d | [
"Apache-2.0"
] | 1 | 2021-12-15T02:46:59.000Z | 2021-12-15T02:46:59.000Z | """
Integration Tests for nsxt_manager state module
"""
import logging
import pytest
import requests
from requests.auth import HTTPBasicAuth
log = logging.getLogger(__name__)
BASE_URL = "https://{}/api/v1/configs/management"
def _get_manager_config_from_nsxt(nsxt_config):
hostname = nsxt_config["hostname"]... | 35.093525 | 91 | 0.708282 | import logging
import pytest
import requests
from requests.auth import HTTPBasicAuth
log = logging.getLogger(__name__)
BASE_URL = "https://{}/api/v1/configs/management"
def _get_manager_config_from_nsxt(nsxt_config):
hostname = nsxt_config["hostname"]
username = nsxt_config["username"]
password = nsxt_... | true | true |
1c2f7a87173d99f850ebdd8cc9bb86dfe639a434 | 130,630 | py | Python | cvat/apps/engine/tests/test_rest_api.py | eegml/cvat | e7808cfb0322c1adcf61e7955b8b4a8c2badd0d2 | [
"MIT"
] | null | null | null | cvat/apps/engine/tests/test_rest_api.py | eegml/cvat | e7808cfb0322c1adcf61e7955b8b4a8c2badd0d2 | [
"MIT"
] | null | null | null | cvat/apps/engine/tests/test_rest_api.py | eegml/cvat | e7808cfb0322c1adcf61e7955b8b4a8c2badd0d2 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
import os
import shutil
from PIL import Image
from io import BytesIO
from enum import Enum
import random
from rest_framework.test import APITestCase, APIClient
from rest_framework import status
from django.conf import settings
from django.contrib.... | 38.443202 | 157 | 0.544194 |
import os
import shutil
from PIL import Image
from io import BytesIO
from enum import Enum
import random
from rest_framework.test import APITestCase, APIClient
from rest_framework import status
from django.conf import settings
from django.contrib.auth.models import User, Group
from cvat.apps.engine.models import (T... | true | true |
1c2f7ce2cbbf216deda2ff16d6295d70fd720a2c | 1,589 | py | Python | nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..classify import BRAINSPosteriorToContinuousClass
def test_BRAINSPosteriorToContinuousClass_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ign... | 30.557692 | 67 | 0.684078 |
from __future__ import unicode_literals
from ..classify import BRAINSPosteriorToContinuousClass
def test_BRAINSPosteriorToContinuousClass_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(deprecated='1.0.0',
nohash=Tru... | true | true |
1c2f7e3777a18d0dc93765a0705a860de8b9f484 | 2,818 | py | Python | tests/unit/test_checker_manager.py | AnarchyCrew/flake9 | ee2920d775df18481d638c2da084d229d56f95b9 | [
"MIT"
] | null | null | null | tests/unit/test_checker_manager.py | AnarchyCrew/flake9 | ee2920d775df18481d638c2da084d229d56f95b9 | [
"MIT"
] | null | null | null | tests/unit/test_checker_manager.py | AnarchyCrew/flake9 | ee2920d775df18481d638c2da084d229d56f95b9 | [
"MIT"
] | null | null | null | """Tests for the Manager object for FileCheckers."""
import errno
import mock
import pytest
from flake8 import checker
def style_guide_mock(**kwargs):
"""Create a mock StyleGuide object."""
kwargs.setdefault('diff', False)
kwargs.setdefault('jobs', '4')
style_guide = mock.Mock()
style_guide.opti... | 35.670886 | 76 | 0.689496 | import errno
import mock
import pytest
from flake8 import checker
def style_guide_mock(**kwargs):
kwargs.setdefault('diff', False)
kwargs.setdefault('jobs', '4')
style_guide = mock.Mock()
style_guide.options = mock.Mock(**kwargs)
return style_guide
def _parallel_checker_manager():
style_gu... | true | true |
1c2f7e74de4507242df96dc94fae80731d17c36f | 996 | py | Python | segs/deeplabv3_detection_common.py | Mooonside/SEGS | 93bb66d9979d9beefab9cfd1a146d6e7369f5d86 | [
"MIT"
] | 5 | 2018-10-22T06:56:22.000Z | 2018-10-29T13:03:39.000Z | segs/deeplabv3_detection_common.py | Mooonside/SEGS | 93bb66d9979d9beefab9cfd1a146d6e7369f5d86 | [
"MIT"
] | null | null | null | segs/deeplabv3_detection_common.py | Mooonside/SEGS | 93bb66d9979d9beefab9cfd1a146d6e7369f5d86 | [
"MIT"
] | 2 | 2018-03-17T06:55:35.000Z | 2018-04-13T12:12:44.000Z | """
IN YOLOV3, uses 3 layers, respectively downsample 32, downsample 16 and downsample 8
IN DEEOLABV3+, the nwetwork output layers if stride 16, so need to add more layer to generate downsample 32!
"""
import numpy as np
detection_feature_layers = [
# downsample 8
'xception_65/entry_flow/block2/unit_1/xception... | 25.538462 | 112 | 0.653614 | import numpy as np
detection_feature_layers = [
'xception_65/entry_flow/block2/unit_1/xception_module/add:0',
'xception_65/middle_flow/block1/unit_16/xception_module/add:0',
'xception_65/detection_branch/exit_flow/block3/unit_1/xception_module/separable_conv3/pointwise_conv/Relu:0'
]
detect... | true | true |
1c2f800b44d6020a3330de2d51454b6d74ce0244 | 13,786 | py | Python | birdy/client/base.py | generic-ci-org/birdy | 63c2d0aacad67569d8d8fc25c9a702d80c69fcd0 | [
"Apache-2.0"
] | null | null | null | birdy/client/base.py | generic-ci-org/birdy | 63c2d0aacad67569d8d8fc25c9a702d80c69fcd0 | [
"Apache-2.0"
] | null | null | null | birdy/client/base.py | generic-ci-org/birdy | 63c2d0aacad67569d8d8fc25c9a702d80c69fcd0 | [
"Apache-2.0"
] | null | null | null | import types
from collections import OrderedDict
from textwrap import dedent
from boltons.funcutils import FunctionBuilder
import requests
import requests.auth
import owslib
from owslib.util import ServiceException
from owslib.wps import WPS_DEFAULT_VERSION, WebProcessingService, SYNC, ASYNC, ComplexData
from birdy.e... | 35.07888 | 111 | 0.592268 | import types
from collections import OrderedDict
from textwrap import dedent
from boltons.funcutils import FunctionBuilder
import requests
import requests.auth
import owslib
from owslib.util import ServiceException
from owslib.wps import WPS_DEFAULT_VERSION, WebProcessingService, SYNC, ASYNC, ComplexData
from birdy.e... | true | true |
1c2f8026b9f6d2175d9d4b63b9ddda989b227350 | 1,070 | py | Python | bff/__init__.py | rudolfhohn/bff | 0d5a8da62f2250bef78dffe0aee8bab2475014c2 | [
"MIT"
] | null | null | null | bff/__init__.py | rudolfhohn/bff | 0d5a8da62f2250bef78dffe0aee8bab2475014c2 | [
"MIT"
] | null | null | null | bff/__init__.py | rudolfhohn/bff | 0d5a8da62f2250bef78dffe0aee8bab2475014c2 | [
"MIT"
] | null | null | null | """All of bff' functions."""
import logging
from ._version import get_versions
# Import submodules.
from . import plot
from .fancy import (
avg_dicts,
cast_to_category_pd,
concat_with_categories,
get_peaks,
idict,
kwargs_2_list,
log_df,
mem_usage_pd,
normalization_pd,
parse_da... | 18.77193 | 62 | 0.680374 | import logging
from ._version import get_versions
from . import plot
from .fancy import (
avg_dicts,
cast_to_category_pd,
concat_with_categories,
get_peaks,
idict,
kwargs_2_list,
log_df,
mem_usage_pd,
normalization_pd,
parse_date,
pipe_multiprocessing_pd,
read_sql_by_... | true | true |
1c2f80cffbc9bb996fcf769dd532a8c769b4d15f | 1,837 | py | Python | ImageProcessing/make_makefile.py | Datamuseum-DK/R1000.HwDoc | cb0841540a4ac184a08957daac1a470b6916a663 | [
"BSD-2-Clause"
] | null | null | null | ImageProcessing/make_makefile.py | Datamuseum-DK/R1000.HwDoc | cb0841540a4ac184a08957daac1a470b6916a663 | [
"BSD-2-Clause"
] | null | null | null | ImageProcessing/make_makefile.py | Datamuseum-DK/R1000.HwDoc | cb0841540a4ac184a08957daac1a470b6916a663 | [
"BSD-2-Clause"
] | null | null | null |
import glob
import os
def gen_makefile():
fo = open("Makefile", "w")
fo.write("default: all\n")
for img in sorted(glob.glob("../[A-Z]*/rawimg/*.pgm")):
fo.write("\n")
brd = img.split('/')[1]
try:
os.mkdir(brd)
except FileExistsError:
pass
... | 30.114754 | 84 | 0.408819 |
import glob
import os
def gen_makefile():
fo = open("Makefile", "w")
fo.write("default: all\n")
for img in sorted(glob.glob("../[A-Z]*/rawimg/*.pgm")):
fo.write("\n")
brd = img.split('/')[1]
try:
os.mkdir(brd)
except FileExistsError:
pass
... | true | true |
1c2f816ad4038bf454b58b4c571eeeb66838c133 | 6,999 | py | Python | homeassistant/components/discovery/__init__.py | SAABoholic/core | 25b093e69e9939c131f4dc83566a9571929803df | [
"Apache-2.0"
] | 4 | 2020-07-29T17:47:10.000Z | 2020-09-16T13:39:13.000Z | homeassistant/components/discovery/__init__.py | SAABoholic/core | 25b093e69e9939c131f4dc83566a9571929803df | [
"Apache-2.0"
] | 6 | 2020-11-08T19:40:10.000Z | 2022-03-01T11:11:07.000Z | homeassistant/components/discovery/__init__.py | SAABoholic/core | 25b093e69e9939c131f4dc83566a9571929803df | [
"Apache-2.0"
] | 3 | 2016-10-03T20:14:06.000Z | 2019-04-19T15:56:56.000Z | """
Starts a service to scan in intervals for new devices.
Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered.
Knows which components handle certain types, will make sure they are
loaded before the EVENT_PLATFORM_DISCOVERED is fired.
"""
from datetime import timedelta
import json
import lo... | 30.298701 | 84 | 0.667667 | from datetime import timedelta
import json
import logging
from netdisco.discovery import NetworkDiscovery
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_START
from homeassistant.core import callback
import homeassistant.helpers.config_validation a... | true | true |
1c2f81a36eb04fce59a539821083dbe39c1341bd | 18,007 | py | Python | anti_sybil/utils.py | BrightID/BrightID-Anti-Sybil | 8f31a73bae05a61b66ef0fd8a68bfb255127a943 | [
"0BSD"
] | 32 | 2019-01-10T17:44:54.000Z | 2022-03-17T21:15:07.000Z | anti_sybil/utils.py | BrightID/BrightID-Anti-Sybil | 8f31a73bae05a61b66ef0fd8a68bfb255127a943 | [
"0BSD"
] | 2 | 2019-01-25T07:54:21.000Z | 2021-02-06T09:01:24.000Z | anti_sybil/utils.py | BrightID/BrightID-Anti-Sybil | 8f31a73bae05a61b66ef0fd8a68bfb255127a943 | [
"0BSD"
] | 7 | 2019-11-04T01:55:35.000Z | 2022-01-22T17:03:59.000Z | from arango import ArangoClient
from bisect import bisect
import networkx as nx
import numpy as np
import zipfile
import tarfile
import requests
import json
import csv
import os
GRAPH_TEMPLATE = GRAPH_3D_TEMPLATE = COMPARE_GRAPH_TEMPLATE = None
BACKUP_URL = 'https://storage.googleapis.com/brightid-backups/brightid.tar... | 37.592902 | 126 | 0.596935 | from arango import ArangoClient
from bisect import bisect
import networkx as nx
import numpy as np
import zipfile
import tarfile
import requests
import json
import csv
import os
GRAPH_TEMPLATE = GRAPH_3D_TEMPLATE = COMPARE_GRAPH_TEMPLATE = None
BACKUP_URL = 'https://storage.googleapis.com/brightid-backups/brightid.tar... | true | true |
1c2f81b03678af7869adfd7799bca16693d3ecce | 1,317 | py | Python | keystone/common/policies/token_revocation.py | rajivmucheli/keystone | d55099d4a17e3672d478aae8c367bcdf9af15fb9 | [
"Apache-2.0"
] | null | null | null | keystone/common/policies/token_revocation.py | rajivmucheli/keystone | d55099d4a17e3672d478aae8c367bcdf9af15fb9 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | keystone/common/policies/token_revocation.py | rajivmucheli/keystone | d55099d4a17e3672d478aae8c367bcdf9af15fb9 | [
"Apache-2.0"
] | 5 | 2019-06-06T15:11:37.000Z | 2021-06-07T08:23:23.000Z | # 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... | 38.735294 | 79 | 0.714503 |
from oslo_policy import policy
from keystone.common.policies import base
token_revocation_policies = [
policy.DocumentedRuleDefault(
name=base.IDENTITY % 'revocation_list',
check_str=base.RULE_SERVICE_OR_ADMIN,
# difference since this API is going to return an empty li... | true | true |
1c2f82336bf13e363d3cfc4c3ec671a414e336c0 | 1,570 | py | Python | sagemaker-dash/tutorials/app2.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 13 | 2021-05-23T15:47:24.000Z | 2022-03-24T16:22:14.000Z | sagemaker-dash/tutorials/app2.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 4 | 2021-11-16T20:44:55.000Z | 2022-01-13T19:13:38.000Z | sagemaker-dash/tutorials/app2.py | philippe-heitzmann/python-apps | 1cc6e5e9b9ac81c81a3d4f0e420ff488fe6b2f0a | [
"MIT"
] | 11 | 2021-01-31T06:18:10.000Z | 2021-11-21T00:02:05.000Z | # -*- coding: utf-8 -*-
# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
... | 31.4 | 78 | 0.590446 |
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
colors = {'background': '#111111', 'text':... | true | true |
1c2f82d07a90ad4af67c057f3f46e0d05ad12446 | 1,777 | py | Python | machine_learning_service/asgi.py | clemencegoh/machine_learning_service | 49ccb65dd8cca544bed801559b920cd7bea2d120 | [
"MIT"
] | null | null | null | machine_learning_service/asgi.py | clemencegoh/machine_learning_service | 49ccb65dd8cca544bed801559b920cd7bea2d120 | [
"MIT"
] | null | null | null | machine_learning_service/asgi.py | clemencegoh/machine_learning_service | 49ccb65dd8cca544bed801559b920cd7bea2d120 | [
"MIT"
] | null | null | null | """
ASGI config for machine_learning_service project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
from chatapp.middle... | 29.616667 | 84 | 0.615644 |
import os
from django.core.asgi import get_asgi_application
from chatapp.middleware import websockets
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'machine_learning_service.settings')
django_application = get_asgi_application()
application = get_asgi_application()
application = websockets(application)
... | true | true |
1c2f850bf574fe5662363a54d5b21bfabd524c82 | 9,553 | py | Python | gen.py | pengfei2017/lstm_and_ctc_ocr | 23c746ce806d44795b7f1557afad03f6dc88084e | [
"MIT"
] | 2 | 2018-11-18T02:40:25.000Z | 2020-03-17T14:41:51.000Z | gen.py | pengfei2017/lstm_and_ctc_ocr | 23c746ce806d44795b7f1557afad03f6dc88084e | [
"MIT"
] | null | null | null | gen.py | pengfei2017/lstm_and_ctc_ocr | 23c746ce806d44795b7f1557afad03f6dc88084e | [
"MIT"
] | 3 | 2018-07-06T11:38:08.000Z | 2020-03-17T14:45:38.000Z | #!/usr/bin/env python
#
# Copyright (c) 2016 Matthew Earl
#
# 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, modif... | 32.828179 | 88 | 0.611745 |
__all__ = (
'generate_ims',
)
import math
import os
import random
import sys
import cv2
import numpy
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import common
from common import OUTPUT_SHAPE
fonts = ["fonts/华文细黑.ttf"]
FONT_HEIGHT = 32
CHARS = common.C... | true | true |
1c2f8511726841e7d4acc41ea149bb001473f4e0 | 3,218 | py | Python | autotrader_1/autotrader_1/settings.py | msamunetogetoge/ta-lib_with_bitflyer | 021cb88bd764d42c054e4f0a8f3ed330dc8a79ae | [
"MIT"
] | null | null | null | autotrader_1/autotrader_1/settings.py | msamunetogetoge/ta-lib_with_bitflyer | 021cb88bd764d42c054e4f0a8f3ed330dc8a79ae | [
"MIT"
] | null | null | null | autotrader_1/autotrader_1/settings.py | msamunetogetoge/ta-lib_with_bitflyer | 021cb88bd764d42c054e4f0a8f3ed330dc8a79ae | [
"MIT"
] | null | null | null | """
Django settings for autotrader_1 project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
""... | 26.377049 | 92 | 0.671224 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '0qw(@t+8bbmv14#k2_5v!#jx&ei_ee%_&a!fxl*htynys4s9f4'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'technical',
'django.contrib.admin',
'django.contrib.auth... | true | true |
1c2f868be044541af4d2d26dbb6612c5b00cce43 | 679 | py | Python | Configuration/Generator/python/DoubleElectronPt10Extended_pythia8_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Generator/python/DoubleElectronPt10Extended_pythia8_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Generator/python/DoubleElectronPt10Extended_pythia8_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
generator = cms.EDFilter("Pythia8PtGun",
PGunParameters = cms.PSet(
MaxPt = cms.double(10.01),
MinPt = cms.double(9.99),
ParticleID = cms.vint32(11),
AddAntiParticle = cms.bool(True),
MaxEta = cms.double(4.0),
MaxPhi = cms.dou... | 32.333333 | 79 | 0.631811 | import FWCore.ParameterSet.Config as cms
generator = cms.EDFilter("Pythia8PtGun",
PGunParameters = cms.PSet(
MaxPt = cms.double(10.01),
MinPt = cms.double(9.99),
ParticleID = cms.vint32(11),
AddAntiParticle = cms.bool(True),
MaxEta = cms.double(4.0),
MaxPhi = cms.dou... | true | true |
1c2f86efffda03a5811f1554bd9b4781fba665a5 | 3,729 | py | Python | tests/unit/core/providers/aws/test_response.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | 134 | 2018-02-26T21:35:23.000Z | 2022-03-03T00:30:27.000Z | tests/unit/core/providers/aws/test_response.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 937 | 2018-03-08T22:04:35.000Z | 2022-03-30T12:21:47.000Z | tests/unit/core/providers/aws/test_response.py | asksmruti/runway | 8aca76df9372e3d13eb35e12f81758f618e89e74 | [
"Apache-2.0"
] | 70 | 2018-02-26T23:48:11.000Z | 2022-03-02T18:44:30.000Z | """Test runway.core.providers.aws._response."""
# pylint: disable=no-self-use
# pyright: basic
from __future__ import annotations
from typing import TYPE_CHECKING
from runway.core.providers.aws import BaseResponse, ResponseError, ResponseMetadata
if TYPE_CHECKING:
from pytest_mock import MockerFixture
MODULE = ... | 36.920792 | 85 | 0.665326 |
from __future__ import annotations
from typing import TYPE_CHECKING
from runway.core.providers.aws import BaseResponse, ResponseError, ResponseMetadata
if TYPE_CHECKING:
from pytest_mock import MockerFixture
MODULE = "runway.core.providers.aws._response"
class TestBaseResponse:
def test_init(self, mock... | true | true |
1c2f87ddb47c9dc701136acf203c663f95516839 | 3,580 | py | Python | students/linden/firstgame.py | sleepinghungry/wwtag | 8ffa886f28281e3acef2465953d26db85a81a045 | [
"MIT"
] | null | null | null | students/linden/firstgame.py | sleepinghungry/wwtag | 8ffa886f28281e3acef2465953d26db85a81a045 | [
"MIT"
] | null | null | null | students/linden/firstgame.py | sleepinghungry/wwtag | 8ffa886f28281e3acef2465953d26db85a81a045 | [
"MIT"
] | null | null | null | from basic_context import BasicGameWorld
from basic_context import BasicGameEngine
from basic_context import NORTH, SOUTH, EAST, WEST, UP, DOWN, RIGHT, LEFT, IN, OUT, FORWARD, BACK, NORTH_WEST, NORTH_EAST, SOUTH_WEST, SOUTH_EAST, NOT_DIRECTION
from basic_context import Die
import random
import time
world = BasicGameWo... | 42.117647 | 230 | 0.738268 | from basic_context import BasicGameWorld
from basic_context import BasicGameEngine
from basic_context import NORTH, SOUTH, EAST, WEST, UP, DOWN, RIGHT, LEFT, IN, OUT, FORWARD, BACK, NORTH_WEST, NORTH_EAST, SOUTH_WEST, SOUTH_EAST, NOT_DIRECTION
from basic_context import Die
import random
import time
world = BasicGameWo... | true | true |
1c2f8852d45aed7abebdf9ca4460bae1586b80b7 | 3,832 | py | Python | deepchem/models/tests/test_megnet.py | Chahalprincy/deepchem | 9d1a6a879cc74b065694b3ddb763d52151d57b7a | [
"MIT"
] | null | null | null | deepchem/models/tests/test_megnet.py | Chahalprincy/deepchem | 9d1a6a879cc74b065694b3ddb763d52151d57b7a | [
"MIT"
] | null | null | null | deepchem/models/tests/test_megnet.py | Chahalprincy/deepchem | 9d1a6a879cc74b065694b3ddb763d52151d57b7a | [
"MIT"
] | null | null | null | """
Test for MEGNetModel
"""
import pytest
import tempfile
import numpy as np
import deepchem as dc
from deepchem.utils.fake_data_generator import FakeGraphGenerator as FGG
try:
from deepchem.models.torch_models import MEGNetModel
# When pytest runs without pytorch in the environment (ex: as in tensorflow workflow... | 32.474576 | 88 | 0.575678 | import pytest
import tempfile
import numpy as np
import deepchem as dc
from deepchem.utils.fake_data_generator import FakeGraphGenerator as FGG
try:
from deepchem.models.torch_models import MEGNetModel
except ModuleNotFoundError:
pass
@pytest.mark.torch
def test_megnet_overfit():
fgg = FGG(avg_n_nodes... | true | true |
1c2f888b68a0b40bc943e04a36c78682cd388704 | 183 | py | Python | python-curso/scripts python/Desafio 02.py | JohnnyPessoli/Cursos | ea80ed21469d0807c54c9091adea9ec0116b8ba7 | [
"MIT"
] | null | null | null | python-curso/scripts python/Desafio 02.py | JohnnyPessoli/Cursos | ea80ed21469d0807c54c9091adea9ec0116b8ba7 | [
"MIT"
] | null | null | null | python-curso/scripts python/Desafio 02.py | JohnnyPessoli/Cursos | ea80ed21469d0807c54c9091adea9ec0116b8ba7 | [
"MIT"
] | null | null | null | Dia=input('Digite o dia de nascimento:')
Mês=input('Digite o mês de nascimento:')
Ano=input('Digite o ano de nascimento:')
print('Você nasceu no dia',Dia,'/',Mês,'/', Ano,'Correto?')
| 36.6 | 59 | 0.688525 | Dia=input('Digite o dia de nascimento:')
Mês=input('Digite o mês de nascimento:')
Ano=input('Digite o ano de nascimento:')
print('Você nasceu no dia',Dia,'/',Mês,'/', Ano,'Correto?')
| true | true |
1c2f891aed25a0ef2145170175c635d35a56e4ef | 1,968 | py | Python | myuw/dao/hx_toolkit_dao.py | timtim17/myuw | d59702a8095daf049d7e57cbb1f7f2a5bebc69af | [
"Apache-2.0"
] | null | null | null | myuw/dao/hx_toolkit_dao.py | timtim17/myuw | d59702a8095daf049d7e57cbb1f7f2a5bebc69af | [
"Apache-2.0"
] | null | null | null | myuw/dao/hx_toolkit_dao.py | timtim17/myuw | d59702a8095daf049d7e57cbb1f7f2a5bebc69af | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import math
import datetime
from myuw.dao.term import get_current_quarter, get_comparison_date
from hx_toolkit.file_dao import get_rendered_article_by_id, \
get_article_by_phase_quarter_week, get_article_links_by_category
def ... | 25.230769 | 78 | 0.694106 |
import math
import datetime
from myuw.dao.term import get_current_quarter, get_comparison_date
from hx_toolkit.file_dao import get_rendered_article_by_id, \
get_article_by_phase_quarter_week, get_article_links_by_category
def get_article_of_week_by_request(request):
term = get_current_quarter(request)
... | true | true |
1c2f89404ac573ff16e678a54fdb6435926de604 | 1,312 | py | Python | sensor/light_sensor.py | stefanmoosbrugger/GardenPi | f42f18ae60e17fdfc747df9d89dbb9ae9d673e04 | [
"MIT"
] | 1 | 2019-10-10T14:08:19.000Z | 2019-10-10T14:08:19.000Z | sensor/light_sensor.py | stefanmoosbrugger/GardenPi | f42f18ae60e17fdfc747df9d89dbb9ae9d673e04 | [
"MIT"
] | null | null | null | sensor/light_sensor.py | stefanmoosbrugger/GardenPi | f42f18ae60e17fdfc747df9d89dbb9ae9d673e04 | [
"MIT"
] | null | null | null | # This file implements the light sensor class.
import sensor_base
import random
import __builtin__
if not __builtin__.testmode:
import grovepi
import collections
import logging, sys
import time
class LightSensor(sensor_base.SensorBase):
def __init__(self,port_number):
self.port_num = port_number
... | 32.8 | 100 | 0.627287 |
import sensor_base
import random
import __builtin__
if not __builtin__.testmode:
import grovepi
import collections
import logging, sys
import time
class LightSensor(sensor_base.SensorBase):
def __init__(self,port_number):
self.port_num = port_number
if not __builtin__.testmode:
gro... | true | true |
1c2f894d8743dd717dedfc20b4581dac0260ce4b | 8,602 | py | Python | thunder_board/clients.py | ZW7436/ThunderBoard | b122d7fb75208da43df86213fb32901caa6c2e41 | [
"MIT"
] | 7 | 2020-04-10T09:05:45.000Z | 2021-08-30T07:26:49.000Z | thunder_board/clients.py | ZW7436/ThunderBoard | b122d7fb75208da43df86213fb32901caa6c2e41 | [
"MIT"
] | 2 | 2021-09-08T01:52:52.000Z | 2022-03-12T00:23:47.000Z | thunder_board/clients.py | ZW7436/ThunderBoard | b122d7fb75208da43df86213fb32901caa6c2e41 | [
"MIT"
] | 4 | 2021-03-31T14:27:21.000Z | 2021-08-30T07:26:52.000Z | import io
import socket
import struct
import time
import threading
import json
import logging
class BaseClient:
def __init__(self, name, board="", id="", server_host="localhost", server_port=2333):
self.type = 'base'
self.name = name
self.board = board if board else "Default"
self.... | 31.859259 | 116 | 0.556382 | import io
import socket
import struct
import time
import threading
import json
import logging
class BaseClient:
def __init__(self, name, board="", id="", server_host="localhost", server_port=2333):
self.type = 'base'
self.name = name
self.board = board if board else "Default"
self.... | true | true |
1c2f8d1e8cc409f422ac97a4f683e3a6d48df847 | 2,804 | py | Python | gen_config/certTools/getLumiLoss.py | gnomeosaurus/machinelearning4dc | fe5e4e5aa03d770b62377b0b8f16a8aa538dc7c9 | [
"MIT"
] | 2 | 2018-02-12T10:28:37.000Z | 2018-03-07T16:33:47.000Z | gen_config/certTools/getLumiLoss.py | gnomeosaurus/machinelearning4dc | fe5e4e5aa03d770b62377b0b8f16a8aa538dc7c9 | [
"MIT"
] | null | null | null | gen_config/certTools/getLumiLoss.py | gnomeosaurus/machinelearning4dc | fe5e4e5aa03d770b62377b0b8f16a8aa538dc7c9 | [
"MIT"
] | 5 | 2018-02-06T16:05:50.000Z | 2020-05-28T14:10:47.000Z | #!/bin/bash
period=$1
cd $1
kind=lossdcs
dqm=none
rm ${kind}.ascii
for i in `cat ${period}.runlist`; do
for dcs in all_on Csc_on Dt_on Ecal_on Es_on HCAL_on Rpc_on Strip_on Pix_on; do
awk '{if ($1=="'"$i"'" && $2>=0.001) {print $1, $2, "'"${dcs}"'"}}' lumiloss_DQM\:_${dqm}\,_DCS\:_${dcs}.txt >> ${kind}.ascii
do... | 27.762376 | 126 | 0.548146 |
period=$1
cd $1
kind=lossdcs
dqm=none
rm ${kind}.ascii
for i in `cat ${period}.runlist`; do
for dcs in all_on Csc_on Dt_on Ecal_on Es_on HCAL_on Rpc_on Strip_on Pix_on; do
awk '{if ($1=="'"$i"'" && $2>=0.001) {print $1, $2, "'"${dcs}"'"}}' lumiloss_DQM\:_${dqm}\,_DCS\:_${dcs}.txt >> ${kind}.ascii
done
done
... | false | true |
1c2f8d526733ecd583c146f33f07be78e77d81fa | 78,089 | py | Python | tccli/services/iotcloud/iotcloud_client.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | null | null | null | tccli/services/iotcloud/iotcloud_client.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | null | null | null | tccli/services/iotcloud/iotcloud_client.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.ht... | 43.698377 | 105 | 0.729258 |
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.http_profile import HttpP... | true | true |
1c2f8df33b72a6b914682b38fc69d3e05ea4f7c3 | 529 | py | Python | src/pandas/read_files.py | lalitmcb/python | 057b5750f7e2e46b5057d15badec756373d8ed79 | [
"MIT"
] | null | null | null | src/pandas/read_files.py | lalitmcb/python | 057b5750f7e2e46b5057d15badec756373d8ed79 | [
"MIT"
] | null | null | null | src/pandas/read_files.py | lalitmcb/python | 057b5750f7e2e46b5057d15badec756373d8ed79 | [
"MIT"
] | null | null | null | import pandas as pd
#install xlrd module to support excel.
#In python 3 use: pip3 install xlrd
#read the excel file by giving name and sheet
excel_df = pd.read_excel('titanic.xls',sheetname=0)
print(excel_df.head())
#Writing the csv file out
#By default index also goes in csv. It can be ignored
#sep is optional. By d... | 27.842105 | 53 | 0.754253 | import pandas as pd
excel_df = pd.read_excel('titanic.xls',sheetname=0)
print(excel_df.head())
excel_df.to_csv('titanic.csv',index=False,sep=',')
#Reading the csv file is similar
#Let's read the same csv file that we generated
csv_df = pd.read_csv('titanic.csv')
print(csv_df.head())
| true | true |
1c2f8e3cd64718a8fb3b5a388f58e845a5c21132 | 1,057 | py | Python | tests/python/pants_test/java/jar/test_manifest.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/java/jar/test_manifest.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/java/jar/test_manifest.py | ghthor/pants | 450de702414f87f563081ddefaefd8a554de07a3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from pants.java.jar.manifest import Manifest
class TestManifest(unitte... | 28.567568 | 82 | 0.729423 |
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from pants.java.jar.manifest import Manifest
class TestManifest(unittest.TestCase):
def test_isempty(self):
manifest = Manifest()
self.assertTrue(manifest.is_empty())
manifest.addentry('Header', 'va... | true | true |
1c2f909e4a10b17008aee2c2f5ae00bf1e355e95 | 4,779 | py | Python | posts/AirQuality/AQmap.py | capecchi/capecchi.github.io | 4262ae782693e1ce1755cc6a28ff1aeb59d4f021 | [
"MIT"
] | null | null | null | posts/AirQuality/AQmap.py | capecchi/capecchi.github.io | 4262ae782693e1ce1755cc6a28ff1aeb59d4f021 | [
"MIT"
] | 4 | 2020-02-19T13:35:29.000Z | 2022-01-15T16:32:26.000Z | posts/AirQuality/AQmap.py | capecchi/capecchi.github.io | 4262ae782693e1ce1755cc6a28ff1aeb59d4f021 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.35.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3... | 25.832432 | 121 | 0.521448 | <!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.35.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3... | false | true |
1c2f90cd0923c4977c7f832f2a779490ef9a9be4 | 1,435 | py | Python | setup.py | JackStC/empiricalutilities | 9d6878594b562cb5f8bb75e8a61ccbc07c8b5cce | [
"MIT"
] | null | null | null | setup.py | JackStC/empiricalutilities | 9d6878594b562cb5f8bb75e8a61ccbc07c8b5cce | [
"MIT"
] | null | null | null | setup.py | JackStC/empiricalutilities | 9d6878594b562cb5f8bb75e8a61ccbc07c8b5cce | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst')) as f:
long_description = f.read()
setup(
name='empiricalutilities',
version='0.1.8',... | 28.7 | 91 | 0.607666 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst')) as f:
long_description = f.read()
setup(
name='empiricalutilities',
version='0.1.8',
description='A Python project for empirica... | true | true |
1c2f91023ac824e07d1e9f4a6d023ff56fb8e3c7 | 540 | py | Python | modules/shared/domain/value_objects/string/value_string.py | eduardolujan/hexagonal_architecture_django | 8055927cb460bc40f3a2651c01a9d1da696177e8 | [
"BSD-3-Clause"
] | 6 | 2020-08-09T23:41:08.000Z | 2021-03-16T22:05:40.000Z | modules/shared/domain/value_objects/string/value_string.py | eduardolujan/hexagonal_architecture_django | 8055927cb460bc40f3a2651c01a9d1da696177e8 | [
"BSD-3-Clause"
] | 1 | 2020-10-02T02:59:38.000Z | 2020-10-02T02:59:38.000Z | modules/shared/domain/value_objects/string/value_string.py | eduardolujan/hexagonal_architecture_django | 8055927cb460bc40f3a2651c01a9d1da696177e8 | [
"BSD-3-Clause"
] | 2 | 2021-03-16T22:05:43.000Z | 2021-04-30T06:35:25.000Z | # -*- utf-8 -*-
class String:
def __init__(self, value):
if type(value) is not str:
raise ValueError(f"Is not string value:{value} type:{type(value)}")
self.__value = value
def __deepcopy__(self, memodict={}):
return self.__value
def __repr__(self):
return ... | 19.285714 | 79 | 0.592593 |
class String:
def __init__(self, value):
if type(value) is not str:
raise ValueError(f"Is not string value:{value} type:{type(value)}")
self.__value = value
def __deepcopy__(self, memodict={}):
return self.__value
def __repr__(self):
return self.__value
... | true | true |
1c2f9311d987db97536687b13ca66399f98e171a | 6,794 | py | Python | python/topology/go.py | rayhaanj/scion | 1242ea4f6ce0d7f0a9ae13c09ba62e5b7e6a3ce3 | [
"Apache-2.0"
] | null | null | null | python/topology/go.py | rayhaanj/scion | 1242ea4f6ce0d7f0a9ae13c09ba62e5b7e6a3ce3 | [
"Apache-2.0"
] | null | null | null | python/topology/go.py | rayhaanj/scion | 1242ea4f6ce0d7f0a9ae13c09ba62e5b7e6a3ce3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 ETH Zurich
# Copyright 2018 ETH Zurich, Anapaya Systems
#
# 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 b... | 35.570681 | 95 | 0.530321 |
import os
import toml
from lib.app.sciond import get_default_sciond_path
from lib.defines import SCIOND_API_SOCKDIR
from lib.util import write_file
from topology.common import (
ArgsTopoDicts,
BR_CONFIG_NAME,
COMMON_DIR,
CS_CONFIG_NAME,
sciond_name,
SD_CONFIG_NAME,
prom_addr... | true | true |
1c2f94c8d12445c85d2c0543340c870acc09cc29 | 6,731 | py | Python | tests/automated/helpers.py | iambluefred/panda | db4a43f8ceb422baa25264a7c053e2aa15665aa9 | [
"MIT"
] | 1 | 2021-08-23T16:27:39.000Z | 2021-08-23T16:27:39.000Z | tests/automated/helpers.py | iambluefred/panda | db4a43f8ceb422baa25264a7c053e2aa15665aa9 | [
"MIT"
] | 1 | 2021-05-06T18:39:54.000Z | 2021-05-26T13:38:12.000Z | tests/automated/helpers.py | iambluefred/panda | db4a43f8ceb422baa25264a7c053e2aa15665aa9 | [
"MIT"
] | 10 | 2020-05-13T19:37:38.000Z | 2021-05-19T20:03:58.000Z | import os
import time
import random
import _thread
import faulthandler
from functools import wraps
from panda import Panda
from panda_jungle import PandaJungle # pylint: disable=import-error
from nose.tools import assert_equal
from parameterized import parameterized, param
from .timeout import run_with_timeout
SPEED_... | 30.595455 | 102 | 0.696033 | import os
import time
import random
import _thread
import faulthandler
from functools import wraps
from panda import Panda
from panda_jungle import PandaJungle
from nose.tools import assert_equal
from parameterized import parameterized, param
from .timeout import run_with_timeout
SPEED_NORMAL = 500
SPEED_GMLAN = 33.... | true | true |
1c2f95489d4b1945231c9e67928cbaf1ef6c9453 | 1,269 | py | Python | programmers/KAKAO Tests/Constructing Columns and Beams.py | will-data/Self-Study-WIL | 69d627c65130fcfa23f27f97948a20107bb33394 | [
"MIT"
] | 1 | 2020-04-11T09:51:54.000Z | 2020-04-11T09:51:54.000Z | programmers/KAKAO Tests/Constructing Columns and Beams.py | will-data/Self-Study-WIL | 69d627c65130fcfa23f27f97948a20107bb33394 | [
"MIT"
] | null | null | null | programmers/KAKAO Tests/Constructing Columns and Beams.py | will-data/Self-Study-WIL | 69d627c65130fcfa23f27f97948a20107bb33394 | [
"MIT"
] | null | null | null | from operator import itemgetter
def solution(n, buildFrames):
struc = set()
def check(struc):
for x, y, a in struc:
if a == 0:
if not (y == 0 or not {(x, y - 1, 0), (x, y, 1), (x - 1, y, 1)}.isdisjoint(struc)):
return False
else:
... | 37.323529 | 120 | 0.381403 | from operator import itemgetter
def solution(n, buildFrames):
struc = set()
def check(struc):
for x, y, a in struc:
if a == 0:
if not (y == 0 or not {(x, y - 1, 0), (x, y, 1), (x - 1, y, 1)}.isdisjoint(struc)):
return False
else:
... | true | true |
1c2f968603b43bbc0a6b5a27db3d2ef2d84cade7 | 28 | py | Python | tests/unit/providers/utils/__init__.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/utils/__init__.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | tests/unit/providers/utils/__init__.py | YelloFam/python-dependency-injector | 541131e33858ee1b8b5a7590d2bb9f929740ea1e | [
"BSD-3-Clause"
] | null | null | null | """Provider utils tests."""
| 14 | 27 | 0.642857 | true | true | |
1c2f96c90fc6ca21256b6ac8e0cbd8441af6eca9 | 55,885 | py | Python | nematus/config.py | lovodkin93/nematus | 06d53fdb20e72f694daa4ca1d526b99b6dbdde12 | [
"BSD-3-Clause"
] | null | null | null | nematus/config.py | lovodkin93/nematus | 06d53fdb20e72f694daa4ca1d526b99b6dbdde12 | [
"BSD-3-Clause"
] | null | null | null | nematus/config.py | lovodkin93/nematus | 06d53fdb20e72f694daa4ca1d526b99b6dbdde12 | [
"BSD-3-Clause"
] | 2 | 2020-12-14T14:27:16.000Z | 2020-12-16T06:03:45.000Z | import argparse
import collections
import json
import logging
import pickle
import sys
import util
class ParameterSpecification:
"""Describes a Nematus configuration parameter.
For many parameters, a ParameterSpecification simply gets mapped to an
argparse.add_argument() call when reading parameters fro... | 42.273071 | 104 | 0.620471 | import argparse
import collections
import json
import logging
import pickle
import sys
import util
class ParameterSpecification:
def __init__(self, name, default, legacy_names=[], visible_arg_names=[],
hidden_arg_names=[], derivation_func=None, **argparse_args):
self.name = name
... | true | true |
1c2f97a5470279e0328929549407453c7ff957e3 | 1,115 | py | Python | python/py-collections-deque/main.py | shollingsworth/HackerRank | 2f0e048044e643d6aa9d07c1898f3b00adf489b0 | [
"Apache-2.0"
] | null | null | null | python/py-collections-deque/main.py | shollingsworth/HackerRank | 2f0e048044e643d6aa9d07c1898f3b00adf489b0 | [
"Apache-2.0"
] | null | null | null | python/py-collections-deque/main.py | shollingsworth/HackerRank | 2f0e048044e643d6aa9d07c1898f3b00adf489b0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import __future__
import sys
import json
def banner():
ban = '====' * 30
print("{}\nSAMPLE INP:\n{}\n{}".format(ban,ban,open(ip, 'r').read()))
print("{}\nSAMPLE OUT:\n{}\n{}".format(ban,ban,open(op, 'r').read()))
print("{}\nSTART:\n{}".format(ban,ban))
... | 24.23913 | 109 | 0.589238 |
import __future__
import sys
import json
def banner():
ban = '====' * 30
print("{}\nSAMPLE INP:\n{}\n{}".format(ban,ban,open(ip, 'r').read()))
print("{}\nSAMPLE OUT:\n{}\n{}".format(ban,ban,open(op, 'r').read()))
print("{}\nSTART:\n{}".format(ban,ban))
sys.stdin = open(ip, 'r')
cnt = -1
def comp... | true | true |
1c2f982c7eb9f52ecf729babd04a09ac77352ab2 | 1,413 | py | Python | images/tests.py | JeremyKimotho/gallery | ea90263a8b54f13b932b6cddf8bdac19f3b308a2 | [
"MIT"
] | null | null | null | images/tests.py | JeremyKimotho/gallery | ea90263a8b54f13b932b6cddf8bdac19f3b308a2 | [
"MIT"
] | null | null | null | images/tests.py | JeremyKimotho/gallery | ea90263a8b54f13b932b6cddf8bdac19f3b308a2 | [
"MIT"
] | null | null | null | from django.test import TestCase
from .models import Category, Location, Image
import datetime as dt
class ImageTestClass(TestCase):
def setUp(self):
self.jeremy = Image(image_name='Jeremy', image_description='Jeremy is a Beast')
def test_instance(self):
self.assertTrue(isinstance(self.jeremy, Image))
... | 25.690909 | 83 | 0.709837 | from django.test import TestCase
from .models import Category, Location, Image
import datetime as dt
class ImageTestClass(TestCase):
def setUp(self):
self.jeremy = Image(image_name='Jeremy', image_description='Jeremy is a Beast')
def test_instance(self):
self.assertTrue(isinstance(self.jeremy, Image))
... | true | true |
1c2f9886c30209c8f8c18348757a2729fc8d5b30 | 1,832 | py | Python | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 17.960784 | 76 | 0.600437 |
from enum import Enum
class ApplicationType(str, Enum):
web = "web"
other = "other"
class FlowType(str, Enum):
bluefield = "Bluefield"
class RequestSource(str, Enum):
rest = "rest"
class PurgeState(str, Enum):
pending = "pending"
completed = "completed"
class FavoriteTyp... | true | true |
1c2f98d2bb8b898807a6dbecf9de37ee18febfab | 350 | py | Python | app/users/apps.py | guilloulouis/stage_medecine | 7ec9067402e510d812a375bbfe46f2ab545587f9 | [
"MIT"
] | null | null | null | app/users/apps.py | guilloulouis/stage_medecine | 7ec9067402e510d812a375bbfe46f2ab545587f9 | [
"MIT"
] | null | null | null | app/users/apps.py | guilloulouis/stage_medecine | 7ec9067402e510d812a375bbfe46f2ab545587f9 | [
"MIT"
] | 1 | 2021-04-30T16:38:19.000Z | 2021-04-30T16:38:19.000Z | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
from django.db.models.signals import m2m_changed
from users.models import Student
from users.signals import stage_added_to_student
m2m_changed.connect(stage_added_to_student, sender... | 29.166667 | 87 | 0.742857 | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
def ready(self):
from django.db.models.signals import m2m_changed
from users.models import Student
from users.signals import stage_added_to_student
m2m_changed.connect(stage_added_to_student, sender... | true | true |
1c2f98f9a5e0784aa2e43010aa4f0ee77764a093 | 41,857 | py | Python | ansys/mapdl/core/_commands/apdl/parameter_definition.py | JourneyG/pymapdl | 23fdc008c151c0546504e4ef8257a64f5f169100 | [
"MIT"
] | 1 | 2021-07-28T00:42:53.000Z | 2021-07-28T00:42:53.000Z | ansys/mapdl/core/_commands/apdl/parameter_definition.py | JourneyG/pymapdl | 23fdc008c151c0546504e4ef8257a64f5f169100 | [
"MIT"
] | null | null | null | ansys/mapdl/core/_commands/apdl/parameter_definition.py | JourneyG/pymapdl | 23fdc008c151c0546504e4ef8257a64f5f169100 | [
"MIT"
] | null | null | null | import os
class ParameterDefinition:
def afun(self, lab="", **kwargs):
"""Specifies units for angular functions in parameter expressions.
APDL Command: *AFUN
Parameters
----------
lab
Specifies the units to be used:
Use radians for input and outp... | 45.695415 | 614 | 0.630241 | import os
class ParameterDefinition:
def afun(self, lab="", **kwargs):
command = f"*AFUN,{lab}"
return self.run(command, **kwargs)
def dim(self, par="", type_="", imax="", jmax="", kmax="", var1="", var2="",
var3="", csysid="", **kwargs):
command = f"*DIM,{par},{type_},{i... | true | true |
1c2f9a7a20d5abc765e5ecede822365f427f6daf | 2,273 | py | Python | sdbuild/packages/xrfdc/package/setup.py | michalkouril/PYNQ | c72febc2decc83816f40b91a7f60e11fe707c248 | [
"BSD-3-Clause"
] | 1 | 2021-12-18T09:54:09.000Z | 2021-12-18T09:54:09.000Z | sdbuild/packages/xrfdc/package/setup.py | michalkouril/PYNQ | c72febc2decc83816f40b91a7f60e11fe707c248 | [
"BSD-3-Clause"
] | null | null | null | sdbuild/packages/xrfdc/package/setup.py | michalkouril/PYNQ | c72febc2decc83816f40b91a7f60e11fe707c248 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | 39.877193 | 79 | 0.720634 |
from setuptools import setup
with open("README.md", encoding='utf-8') as fh:
readme_lines = fh.readlines()[:]
long_description = (''.join(readme_lines))
setup(
name="xrfdc",
version='1.0',
description="Driver for the RFSoC RF Data Converter IP",
long_description=lon... | true | true |
1c2f9ba902803ac26a5da1ca5b8b26ae271ffd27 | 25,420 | py | Python | HLACERServer/Pipeline/FeatureExtractor_GATE.py | CDCgov/DCPC | c3fadef1bd6345e01a58afef051491d8ef6a7f93 | [
"Apache-2.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | HLACERServer/Pipeline/FeatureExtractor_GATE.py | CDCgov/DCPC | c3fadef1bd6345e01a58afef051491d8ef6a7f93 | [
"Apache-2.0"
] | 2 | 2019-04-08T03:42:59.000Z | 2019-10-28T13:42:59.000Z | HLACERServer/Pipeline/FeatureExtractor_GATE.py | CDCgov/DCPC | c3fadef1bd6345e01a58afef051491d8ef6a7f93 | [
"Apache-2.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | from Pipeline.LifFileParser import LifFileParser
import sys
from collections import defaultdict,OrderedDict
from Pipeline.Authentication import Authentication
import requests
import json
import copy
from Pipeline.MetaMap import find_snomed
'''
This file implements a feature extractor tool for GATE which allows users t... | 42.155887 | 149 | 0.530606 | from Pipeline.LifFileParser import LifFileParser
import sys
from collections import defaultdict,OrderedDict
from Pipeline.Authentication import Authentication
import requests
import json
import copy
from Pipeline.MetaMap import find_snomed
class FeatureExtractor:
def __init__(self, filename="", lif_string=""):
... | true | true |
1c2f9be739ba817cd997258c805e95fee7d7ef05 | 5,365 | py | Python | exopy_hqc_legacy/tasks/tasks/instr/apply_mag_field_task.py | Exopy/ecpy_hqc_legacy | 3e31a8865d130907a82005e6cd78d99c6da7a951 | [
"BSD-3-Clause"
] | null | null | null | exopy_hqc_legacy/tasks/tasks/instr/apply_mag_field_task.py | Exopy/ecpy_hqc_legacy | 3e31a8865d130907a82005e6cd78d99c6da7a951 | [
"BSD-3-Clause"
] | 34 | 2015-12-14T22:06:57.000Z | 2018-02-07T08:40:47.000Z | exopy_hqc_legacy/tasks/tasks/instr/apply_mag_field_task.py | Exopy/ecpy_hqc_legacy | 3e31a8865d130907a82005e6cd78d99c6da7a951 | [
"BSD-3-Clause"
] | 6 | 2018-04-20T14:48:54.000Z | 2021-06-23T22:25:17.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by ExopyHqcLegacy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ------... | 35.766667 | 84 | 0.592917 |
from time import sleep
import numbers
from inspect import cleandoc
from atom.api import (Str, Float, Bool, set_default)
from exopy.tasks.api import InstrumentTask, validators
from exopy_hqc_legacy.instruments.drivers.driver_tools import InstrTimeoutError
class ApplyMagFieldTask(InstrumentTask):
fie... | true | true |
1c2f9cb0f0f6ad3b0ba9caddb0ca01340165cd8f | 6,290 | py | Python | neutron/agent/metadata/namespace_proxy.py | armando-migliaccio/neutron-1 | e31861c15bc73e65a7c22212df2a56f9e45aa0e4 | [
"Apache-2.0"
] | null | null | null | neutron/agent/metadata/namespace_proxy.py | armando-migliaccio/neutron-1 | e31861c15bc73e65a7c22212df2a56f9e45aa0e4 | [
"Apache-2.0"
] | null | null | null | neutron/agent/metadata/namespace_proxy.py | armando-migliaccio/neutron-1 | e31861c15bc73e65a7c22212df2a56f9e45aa0e4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | 34.751381 | 79 | 0.595548 |
import httplib
import socket
import eventlet
eventlet.monkey_patch()
import httplib2
from oslo.config import cfg
import six.moves.urllib.parse as urlparse
import webob
from neutron.agent.linux import daemon
from neutron.common import config
from neutron.common import utils
from neutron.openstack.common... | true | true |
1c2f9d0764cf97e8baaa01bd411ffddb6120b77e | 994 | py | Python | plugins/wigle/komand_wigle/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/wigle/komand_wigle/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/wigle/komand_wigle/actions/__init__.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from .add_comment.action import AddComment
from .get_country_statistics.action import GetCountryStatistics
from .get_files_status.action import GetFilesStatus
from .get_general_statistics.action import GetGeneralStatistics
from .get_group_statistics.action import GetGroupStatisti... | 49.7 | 63 | 0.880282 |
from .add_comment.action import AddComment
from .get_country_statistics.action import GetCountryStatistics
from .get_files_status.action import GetFilesStatus
from .get_general_statistics.action import GetGeneralStatistics
from .get_group_statistics.action import GetGroupStatistics
from .get_kml.action import GetKml
f... | true | true |
1c2f9d0fc489ea0d1d13f99334354b6620938490 | 15,993 | py | Python | models/lstm_model.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | 40 | 2019-04-29T09:17:48.000Z | 2021-11-19T06:32:02.000Z | models/lstm_model.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | null | null | null | models/lstm_model.py | HLTCHKUST/emotion-dialogue | 0d58b339134dd9a2f386948ae474b270a77370f9 | [
"MIT"
] | 4 | 2019-09-01T10:00:56.000Z | 2020-03-08T16:00:22.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as I
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.autograd import Variable
import numpy as np
import math
from models.common_layer import Attention
from utils import constant
from models.comm... | 52.264706 | 179 | 0.667792 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as I
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.autograd import Variable
import numpy as np
import math
from models.common_layer import Attention
from utils import constant
from models.comm... | true | true |
1c2f9d11fb3cb06f9f3a510b0c9d7f611974d2a1 | 925 | py | Python | extended_choices/__init__.py | art1415926535/django-extended-choices | bb310c5da4d53685c69173541172e4b813a6afb2 | [
"BSD-3-Clause"
] | 60 | 2015-05-24T10:38:13.000Z | 2022-03-13T12:16:16.000Z | extended_choices/__init__.py | art1415926535/django-extended-choices | bb310c5da4d53685c69173541172e4b813a6afb2 | [
"BSD-3-Clause"
] | 28 | 2015-04-02T22:19:44.000Z | 2021-03-03T08:58:33.000Z | extended_choices/__init__.py | art1415926535/django-extended-choices | bb310c5da4d53685c69173541172e4b813a6afb2 | [
"BSD-3-Clause"
] | 12 | 2015-08-25T06:21:44.000Z | 2019-12-10T01:39:48.000Z | """Little helper application to improve django choices (for fields)"""
from __future__ import unicode_literals
import pkg_resources
import six
from os import path
from setuptools.config import read_configuration
from .choices import Choices, OrderedChoices, AutoDisplayChoices, AutoChoices # noqa: F401
def _extract_... | 34.259259 | 91 | 0.731892 | from __future__ import unicode_literals
import pkg_resources
import six
from os import path
from setuptools.config import read_configuration
from .choices import Choices, OrderedChoices, AutoDisplayChoices, AutoChoices
def _extract_version(package_name):
try:
version = pkg_resources.get_distri... | true | true |
1c2f9da7852255d3e70fae5b76533c9de142e975 | 245 | py | Python | 5.py | ayeshaIman/assignment | 331e7bdc553bd13a159b51d920cd0c208a8cff96 | [
"MIT"
] | null | null | null | 5.py | ayeshaIman/assignment | 331e7bdc553bd13a159b51d920cd0c208a8cff96 | [
"MIT"
] | null | null | null | 5.py | ayeshaIman/assignment | 331e7bdc553bd13a159b51d920cd0c208a8cff96 | [
"MIT"
] | null | null | null | >>>print ("Hello World")
>>>print ("You must be the legendary God that comes from the sky")
>>>print ("We have been waiting for you for a long time")
>>> x=6
>>>print (x)
>>>y=x*7
>>>print (y)
$cat hello.py
print ("hello world")
$python hello.py | 24.5 | 66 | 0.644898 | >>>print ("Hello World")
>>>print ("You must be the legendary God that comes from the sky")
>>>print ("We have been waiting for you for a long time")
>>> x=6
>>>print (x)
>>>y=x*7
>>>print (y)
$cat hello.py
print ("hello world")
$python hello.py | false | true |
1c2fa0ff5b9381182b654ca980c8c114ee61e659 | 5,888 | py | Python | frappe-bench/env/lib/python2.7/site-packages/num2words/lang_DE.py | ibrahmm22/library-management | b88a2129a5a2e96ce1f945ec8ba99a0b63b8c506 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/num2words/lang_DE.py | ibrahmm22/library-management | b88a2129a5a2e96ce1f945ec8ba99a0b63b8c506 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/num2words/lang_DE.py | ibrahmm22/library-management | b88a2129a5a2e96ce1f945ec8ba99a0b63b8c506 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2003, Taro Ogawa. All Rights Reserved.
# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Fo... | 40.888889 | 148 | 0.544158 |
from __future__ import unicode_literals, print_function
from .lang_EU import Num2Word_EU
class Num2Word_DE(Num2Word_EU):
def set_high_numwords(self, high):
max = 3 + 6*len(high)
for word, n in zip(high, range(max, 3, -6)):
self.cards[10**n] = word + "illiarde"
... | true | true |
1c2fa18af3497416319f5f949b16e202eafbf06f | 4,971 | py | Python | operators/azure-service-operator/python/pulumi_pulumi_kubernetes_crds_operators_azure_service_operator/azure/v1alpha1/PostgreSQLDatabase.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | operators/azure-service-operator/python/pulumi_pulumi_kubernetes_crds_operators_azure_service_operator/azure/v1alpha1/PostgreSQLDatabase.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | 2 | 2020-09-18T17:12:23.000Z | 2020-12-30T19:40:56.000Z | operators/azure-service-operator/python/pulumi_pulumi_kubernetes_crds_operators_azure_service_operator/azure/v1alpha1/PostgreSQLDatabase.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** 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 . import outp... | 41.425 | 172 | 0.661436 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ... import meta_v1 as _meta_v1
from ._inputs import *
__all__ = ['PostgreSQLDatabase']
class PostgreSQLDatabase(pulumi.CustomResource):
... | true | true |
1c2fa1b28d4236ecd86c3cc30dc15d65ac8ab769 | 10,886 | py | Python | nemo/collections/asr/parts/features.py | borisdayma/NeMo | 88f6c5b93574adb219185d5ded14b6393c485ea0 | [
"Apache-2.0"
] | 10 | 2020-03-17T08:32:06.000Z | 2021-04-19T19:03:50.000Z | nemo/collections/asr/parts/features.py | dcmartin/NeMo | d2120a40bf23d3e38ff5677c2685c712f297e6b1 | [
"Apache-2.0"
] | 1 | 2020-06-11T00:54:42.000Z | 2020-06-11T00:54:42.000Z | nemo/collections/asr/parts/features.py | dcmartin/NeMo | d2120a40bf23d3e38ff5677c2685c712f297e6b1 | [
"Apache-2.0"
] | 3 | 2020-03-10T05:10:07.000Z | 2020-12-08T01:33:35.000Z | # Taken straight from Patter https://github.com/ryanleary/patter
# TODO: review, and copyright and fix/add comments
import math
import librosa
import torch
import torch.nn as nn
from torch_stft import STFT
from nemo import logging
from nemo.collections.asr.parts.perturb import AudioAugmentor
from nemo.collections.asr... | 36.653199 | 119 | 0.60215 |
import math
import librosa
import torch
import torch.nn as nn
from torch_stft import STFT
from nemo import logging
from nemo.collections.asr.parts.perturb import AudioAugmentor
from nemo.collections.asr.parts.segment import AudioSegment
CONSTANT = 1e-5
def normalize_batch(x, seq_len, normalize_type):
if norm... | true | true |
1c2fa4607fad66cd68a24ce8e5744d69da3257bb | 650 | py | Python | mlxtend/docs/make_userguide.py | WhiteWolf21/fp-growth | 01e1d853b09f244f14e66d7d0c87f139a0f67c81 | [
"MIT"
] | null | null | null | mlxtend/docs/make_userguide.py | WhiteWolf21/fp-growth | 01e1d853b09f244f14e66d7d0c87f139a0f67c81 | [
"MIT"
] | null | null | null | mlxtend/docs/make_userguide.py | WhiteWolf21/fp-growth | 01e1d853b09f244f14e66d7d0c87f139a0f67c81 | [
"MIT"
] | null | null | null | # API generator script
#
# Sebastian Raschka 2014-2020
# mlxtend Machine Learning Library Extensions
#
# Author: Sebastian Raschka <sebastianraschka.com>
#
# License: BSD 3 clause
import yaml
import os.path
s = "# User Guide Index"
yml_cont = open('mkdocs.yml', 'r')
usr_gd = yaml.load(yml_cont)['pages'][1]['User Gu... | 22.413793 | 60 | 0.633846 |
import yaml
import os.path
s = "# User Guide Index"
yml_cont = open('mkdocs.yml', 'r')
usr_gd = yaml.load(yml_cont)['pages'][1]['User Guide']
for dct in usr_gd[1:]:
subpk = list(dct.keys())[0]
s += '\n\n## `%s`' % subpk
for obj in dct[subpk]:
bsname = os.path.basename(obj).split('.md')[0... | true | true |
1c2fa478453f7b0416d6189af5154d347cc6e565 | 6,317 | py | Python | rasa/core/channels/botframework.py | anoop2503/rasa | 990bab95954a2f6605f039ce9fb1317b39858651 | [
"Apache-2.0"
] | 1 | 2021-07-06T20:49:07.000Z | 2021-07-06T20:49:07.000Z | rasa/core/channels/botframework.py | anoop2503/rasa | 990bab95954a2f6605f039ce9fb1317b39858651 | [
"Apache-2.0"
] | null | null | null | rasa/core/channels/botframework.py | anoop2503/rasa | 990bab95954a2f6605f039ce9fb1317b39858651 | [
"Apache-2.0"
] | 1 | 2020-01-13T14:54:22.000Z | 2020-01-13T14:54:22.000Z | # -*- coding: utf-8 -*-
import datetime
import json
import logging
import requests
from sanic import Blueprint, response
from sanic.request import Request
from typing import Text, Dict, Any
from rasa.core.channels.channel import UserMessage, OutputChannel, InputChannel
logger = logging.getLogger(__name__)
MICROSOFT... | 32.394872 | 98 | 0.576698 |
import datetime
import json
import logging
import requests
from sanic import Blueprint, response
from sanic.request import Request
from typing import Text, Dict, Any
from rasa.core.channels.channel import UserMessage, OutputChannel, InputChannel
logger = logging.getLogger(__name__)
MICROSOFT_OAUTH2_URL = "https://... | true | true |
1c2fa48e6922a25e39c7a2a1af51ab9a9bf4482e | 14,086 | py | Python | pygsti/modelmembers/operations/lpdenseop.py | pyGSTi-Developers/pyGSTi | bfedc1de4d604f14b0f958615776fb80ddb59e33 | [
"Apache-2.0"
] | 73 | 2016-01-28T05:02:05.000Z | 2022-03-30T07:46:33.000Z | pygsti/modelmembers/operations/lpdenseop.py | pyGSTi-Developers/pyGSTi | bfedc1de4d604f14b0f958615776fb80ddb59e33 | [
"Apache-2.0"
] | 113 | 2016-02-25T15:32:18.000Z | 2022-03-31T13:18:13.000Z | pygsti/modelmembers/operations/lpdenseop.py | pyGSTi-Developers/pyGSTi | bfedc1de4d604f14b0f958615776fb80ddb59e33 | [
"Apache-2.0"
] | 41 | 2016-03-15T19:32:07.000Z | 2022-02-16T10:22:05.000Z | """
The LinearlyParamArbitraryOp class and supporting functionality.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, ... | 42.555891 | 118 | 0.639216 |
import numpy as _np
from pygsti.modelmembers.operations.denseop import DenseOperator as _DenseOperator
from pygsti.modelmembers.operations.linearop import LinearOperator as _LinearOperator
from pygsti.baseobjs.statespace import StateSpace as _StateSpace
from pygsti.tools import matrixtools as _mt
IMAG_TOL = ... | true | true |
1c2fa5b2a808191a18d71c60db9fe0df1548d91f | 1,987 | py | Python | catacomb/utils/formatter.py | mitchjeitani/safe | 9b710319a769d532902cb1f7bfecd94155c4e2bf | [
"MIT"
] | 30 | 2017-11-09T09:38:04.000Z | 2021-04-15T16:04:18.000Z | catacomb/utils/formatter.py | mitchjeitani/safe | 9b710319a769d532902cb1f7bfecd94155c4e2bf | [
"MIT"
] | 14 | 2017-11-22T12:47:17.000Z | 2018-06-18T04:47:48.000Z | catacomb/utils/formatter.py | mitchjeitani/safe | 9b710319a769d532902cb1f7bfecd94155c4e2bf | [
"MIT"
] | 3 | 2018-04-04T10:40:20.000Z | 2019-05-25T07:17:04.000Z | import click
import sys
import textwrap
from catacomb.common import constants, errors
from terminaltables import AsciiTable
def color_text(text, color):
"""Adds color to the provided text.
Arguments:
text (str): The text to color.
color (str): The color as a string, e.g. 'red', 'green' and ... | 24.530864 | 76 | 0.653749 | import click
import sys
import textwrap
from catacomb.common import constants, errors
from terminaltables import AsciiTable
def color_text(text, color):
try:
text = click.style(text, fg=color)
except TypeError:
print_warning(errors.INVALID_COLOR.format(color))
return text
def to_table(... | true | true |
1c2fa7114a080c54a55dcd81f2300d640e401a1f | 294 | py | Python | doc/sphinx/conf.py | ReverentEngineer/ber | 7942c0b10a42873d3507cac095a14b6aa9a73cdc | [
"MIT"
] | null | null | null | doc/sphinx/conf.py | ReverentEngineer/ber | 7942c0b10a42873d3507cac095a14b6aa9a73cdc | [
"MIT"
] | null | null | null | doc/sphinx/conf.py | ReverentEngineer/ber | 7942c0b10a42873d3507cac095a14b6aa9a73cdc | [
"MIT"
] | null | null | null | project = 'BER'
copyright = '2020, Jeff Caffrey-Hill'
author = 'Jeff Caffrey-Hill'
extensions = []
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'alabaster'
html_static_path = ['_static']
html_css_files = ['css/style.css']
html_theme_options = {
'nosidebar': True,
}
| 21 | 37 | 0.704082 | project = 'BER'
copyright = '2020, Jeff Caffrey-Hill'
author = 'Jeff Caffrey-Hill'
extensions = []
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'alabaster'
html_static_path = ['_static']
html_css_files = ['css/style.css']
html_theme_options = {
'nosidebar': True,
}
| true | true |
1c2fa7b4e689efac207e1e801a3d543f5d85fce7 | 772 | py | Python | preprocess/anonymize_wordpiece.py | mounicam/neural_splitter | 143346775d03667225bccb9455369a9b08352a67 | [
"BSD-3-Clause"
] | null | null | null | preprocess/anonymize_wordpiece.py | mounicam/neural_splitter | 143346775d03667225bccb9455369a9b08352a67 | [
"BSD-3-Clause"
] | null | null | null | preprocess/anonymize_wordpiece.py | mounicam/neural_splitter | 143346775d03667225bccb9455369a9b08352a67 | [
"BSD-3-Clause"
] | null | null | null | import argparse
from wordpiece import FullTokenizer
def main(args):
tokenizer = FullTokenizer(args.vocab, do_lower_case=False)
fp = open(args.output, "w")
for line in open(args.input):
line = line.strip()
tokens = tokenizer.tokenize(line)
tokens.append("[SEP]")
tokens = ["... | 27.571429 | 70 | 0.623057 | import argparse
from wordpiece import FullTokenizer
def main(args):
tokenizer = FullTokenizer(args.vocab, do_lower_case=False)
fp = open(args.output, "w")
for line in open(args.input):
line = line.strip()
tokens = tokenizer.tokenize(line)
tokens.append("[SEP]")
tokens = ["... | true | true |
1c2fa82082af0f0a89575f7ee8afb28ae0c8e46b | 965 | py | Python | sim_spawner/setup.py | 09ubberboy90/lvl4-ros2-sim-comp | c197c76b29a9d864a800b81332bc3a549ecaa7c3 | [
"BSD-3-Clause"
] | 1 | 2021-05-03T09:16:11.000Z | 2021-05-03T09:16:11.000Z | sim_spawner/setup.py | 09ubberboy90/lvl4-ros2-sim-comp | c197c76b29a9d864a800b81332bc3a549ecaa7c3 | [
"BSD-3-Clause"
] | 1 | 2021-05-03T20:39:31.000Z | 2021-11-24T14:57:55.000Z | sim_spawner/setup.py | 09ubberboy90/lvl4-ros2-sim-comp | c197c76b29a9d864a800b81332bc3a549ecaa7c3 | [
"BSD-3-Clause"
] | 1 | 2021-05-03T09:16:21.000Z | 2021-05-03T09:16:21.000Z | from setuptools import setup
package_name = 'sim_spawner'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
ins... | 31.129032 | 94 | 0.658031 | from setuptools import setup
package_name = 'sim_spawner'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
ins... | true | true |
1c2fa9eca07cb2778eed074247670b3c0203e92f | 6,944 | py | Python | components/aws/sagemaker/tests/unit_tests/tests/test_batch_transform.py | kamalmemon/pipelines | 7e68991a2a7bfa767f893facfe58190690ca89ed | [
"Apache-2.0"
] | null | null | null | components/aws/sagemaker/tests/unit_tests/tests/test_batch_transform.py | kamalmemon/pipelines | 7e68991a2a7bfa767f893facfe58190690ca89ed | [
"Apache-2.0"
] | 4 | 2022-02-14T21:39:59.000Z | 2022-03-08T23:38:00.000Z | components/aws/sagemaker/tests/unit_tests/tests/test_batch_transform.py | kamalmemon/pipelines | 7e68991a2a7bfa767f893facfe58190690ca89ed | [
"Apache-2.0"
] | 2 | 2019-10-15T03:06:15.000Z | 2019-10-15T03:10:39.000Z | import unittest
import os
import signal
from unittest.mock import patch, call, Mock, MagicMock, mock_open, ANY
from botocore.exceptions import ClientError
from batch_transform.src import batch_transform
from common import _utils
# TODO : Errors out if model_name doesn't contain '-'
# fix model_name '-' bug
require... | 35.979275 | 117 | 0.671947 | import unittest
import os
import signal
from unittest.mock import patch, call, Mock, MagicMock, mock_open, ANY
from botocore.exceptions import ClientError
from batch_transform.src import batch_transform
from common import _utils
# fix model_name '-' bug
required_args = [
'--region', 'us-west-2',
'--model_name... | true | true |
1c2faa4b61cd56eb36cb503b7db5d29f59826ba6 | 35,062 | py | Python | zerver/lib/push_notifications.py | apexlabs-ai/zulip | 316a87c03736f2ef3503b3417ee3d16cae1b913d | [
"Apache-2.0"
] | null | null | null | zerver/lib/push_notifications.py | apexlabs-ai/zulip | 316a87c03736f2ef3503b3417ee3d16cae1b913d | [
"Apache-2.0"
] | null | null | null | zerver/lib/push_notifications.py | apexlabs-ai/zulip | 316a87c03736f2ef3503b3417ee3d16cae1b913d | [
"Apache-2.0"
] | null | null | null | import base64
import binascii
import logging
import re
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union
import gcm
import lxml.html
import orjson
from django.conf import settings
from django.db import IntegrityError, transaction
from django.db.models import F
from django.... | 41.990419 | 113 | 0.650048 | import base64
import binascii
import logging
import re
import time
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union
import gcm
import lxml.html
import orjson
from django.conf import settings
from django.db import IntegrityError, transaction
from django.db.models import F
from django.... | true | true |
1c2fab0514f311db6469ee743995314e21162298 | 2,010 | py | Python | custom_components/netdaemon/switch.py | skotl/netdaemon-integration | 71fb6036330cddbd4629d942652b93b31c204eec | [
"MIT"
] | 1 | 2021-08-24T18:47:10.000Z | 2021-08-24T18:47:10.000Z | custom_components/netdaemon/switch.py | skotl/netdaemon-integration | 71fb6036330cddbd4629d942652b93b31c204eec | [
"MIT"
] | 32 | 2021-01-01T17:41:41.000Z | 2022-02-05T18:42:32.000Z | custom_components/netdaemon/switch.py | skotl/netdaemon-integration | 71fb6036330cddbd4629d942652b93b31c204eec | [
"MIT"
] | 8 | 2021-04-23T09:58:02.000Z | 2022-01-03T10:30:48.000Z | """Switch platform for NetDaemon."""
from typing import TYPE_CHECKING
from homeassistant.components.switch import SwitchEntity
from .const import (
ATTR_CLIENT,
ATTR_COORDINATOR,
ATTR_ENTITY_ID,
ATTR_STATE,
DOMAIN,
LOGGER,
PLATFORM_SWITCH,
STATE_ON_VALUES,
)
from .entity import NetDaem... | 30 | 79 | 0.69005 | from typing import TYPE_CHECKING
from homeassistant.components.switch import SwitchEntity
from .const import (
ATTR_CLIENT,
ATTR_COORDINATOR,
ATTR_ENTITY_ID,
ATTR_STATE,
DOMAIN,
LOGGER,
PLATFORM_SWITCH,
STATE_ON_VALUES,
)
from .entity import NetDaemonEntity
if TYPE_CHECKING:
from ... | true | true |
1c2fab7d0bbcc372a971bf0468a371a8d711930d | 1,298 | py | Python | data_structures/stack/stack.py | papudova/programming-for-linguists | 2349b5d2787eb0f9e57f281647fcc7f20e900688 | [
"Apache-2.0"
] | null | null | null | data_structures/stack/stack.py | papudova/programming-for-linguists | 2349b5d2787eb0f9e57f281647fcc7f20e900688 | [
"Apache-2.0"
] | null | null | null | data_structures/stack/stack.py | papudova/programming-for-linguists | 2349b5d2787eb0f9e57f281647fcc7f20e900688 | [
"Apache-2.0"
] | null | null | null | """
Programming for linguists
Implementation of the data structure "Stack"
"""
from typing import Iterable
class Stack:
"""
Stack Data Structure
"""
# pylint: disable=missing-module-docstring
def __init__(self, maximum, data: Iterable = None):
self.data = list(data) if data else []
... | 24.037037 | 60 | 0.564715 |
from typing import Iterable
class Stack:
def __init__(self, maximum, data: Iterable = None):
self.data = list(data) if data else []
self.maximum = maximum
def push(self, element):
if self.maximum <= len(self.data):
self.data.append(element)
def pop(self):
... | true | true |
1c2fab9eb0e822b4f94ee06c94a0274429e18786 | 4,279 | py | Python | main.py | SzymonZos/Fuzzy-Data-Analysis | 20b27ac183e8d65c41b7f3e3e491c8fb08b9696f | [
"MIT"
] | 1 | 2020-06-11T19:47:42.000Z | 2020-06-11T19:47:42.000Z | main.py | SzymonZos/Fuzzy-Data-Analysis | 20b27ac183e8d65c41b7f3e3e491c8fb08b9696f | [
"MIT"
] | 1 | 2020-07-30T08:41:13.000Z | 2020-08-14T19:00:27.000Z | main.py | SzymonZos/Fuzzy-Data-Analysis | 20b27ac183e8d65c41b7f3e3e491c8fb08b9696f | [
"MIT"
] | 1 | 2020-06-25T22:08:34.000Z | 2020-06-25T22:08:34.000Z | import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from functools import partial
from contextlib import ExitStack
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from skfuzzy.cluster import cmeans, cmeans_predict
raw_datasets = ["models/" + name for name in ["pim... | 38.205357 | 84 | 0.618836 | import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from functools import partial
from contextlib import ExitStack
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from skfuzzy.cluster import cmeans, cmeans_predict
raw_datasets = ["models/" + name for name in ["pim... | true | true |
1c2fac40028ca062d59b1485bffb107324efca43 | 2,884 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/lib/python2.5/site-packages/Pmw/Pmw_1_3/demos/MessageInfo.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 3 | 2017-09-26T03:09:14.000Z | 2022-03-20T11:12:34.000Z | resources/mgltools_x86_64Linux2_1.5.6/lib/python2.5/site-packages/Pmw/Pmw_1_3/demos/MessageInfo.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/lib/python2.5/site-packages/Pmw/Pmw_1_3/demos/MessageInfo.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 2 | 2019-10-05T23:02:41.000Z | 2020-06-25T20:21:02.000Z | title = 'Pmw toplevel megawidget demonstration'
# Import Pmw from this directory tree.
import sys
sys.path[:0] = ['../../..']
import Tkinter
import Pmw
class MessageInfo(Pmw.MegaToplevel):
# Demo Pmw toplevel megawidget.
def __init__(self, parent=None, **kw):
# Define the megawidget options.
optiondefs ... | 26.458716 | 76 | 0.661234 | title = 'Pmw toplevel megawidget demonstration'
import sys
sys.path[:0] = ['../../..']
import Tkinter
import Pmw
class MessageInfo(Pmw.MegaToplevel):
def __init__(self, parent=None, **kw):
optiondefs = ()
self.defineoptions(kw, optiondefs)
Pmw.MegaToplevel.__init__(self, parent)
interior = s... | false | true |
1c2fac94405577726546c0175556f60c71cf410e | 49,500 | py | Python | beets/library.py | stragu/beets | da46a62772ab7a88c5799c84841f744dfc0f0a20 | [
"MIT"
] | null | null | null | beets/library.py | stragu/beets | da46a62772ab7a88c5799c84841f744dfc0f0a20 | [
"MIT"
] | null | null | null | beets/library.py | stragu/beets | da46a62772ab7a88c5799c84841f744dfc0f0a20 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | 33.627717 | 79 | 0.589475 |
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import os
import sys
import unicodedata
import time
import re
from unidecode import unidecode
from beets import logging
from beets.mediafile import MediaFile, MutagenError, UnreadableFileError
f... | true | true |
1c2fad5561db6a64f83057a8feee7bb3000d869a | 2,138 | py | Python | grr/server/grr_response_server/serialize.py | nkrios/grr | 399e078ed522bf0555a2666fb086aa7809d54971 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/serialize.py | nkrios/grr | 399e078ed522bf0555a2666fb086aa7809d54971 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/serialize.py | nkrios/grr | 399e078ed522bf0555a2666fb086aa7809d54971 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""This module serializes AFF4 objects in various ways."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future.utils import iteritems
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.util import compatib... | 31.441176 | 80 | 0.724509 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future.utils import iteritems
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.util import compatibility
from grr_response_core.lib.util.compat import yaml
from grr_response_serve... | true | true |
1c2fae7920b9bc1d34e0a50572315bd565c0af92 | 613 | py | Python | aoc_helper/data.py | Starwort/aoc_helper | 7ad39770e91d0f537b90baa4e3d65fa0e152e0f7 | [
"MIT"
] | 5 | 2020-12-06T17:14:17.000Z | 2021-12-09T19:54:44.000Z | aoc_helper/data.py | Starwort/aoc_helper | 7ad39770e91d0f537b90baa4e3d65fa0e152e0f7 | [
"MIT"
] | 8 | 2020-12-06T08:39:44.000Z | 2021-12-10T04:27:10.000Z | aoc_helper/data.py | Starwort/aoc_helper | 7ad39770e91d0f537b90baa4e3d65fa0e152e0f7 | [
"MIT"
] | 8 | 2021-12-02T04:00:50.000Z | 2022-01-26T20:07:55.000Z | import datetime
import pathlib
import re
DATA_DIR = pathlib.Path.home() / ".config" / "aoc_helper"
if not DATA_DIR.exists():
DATA_DIR.mkdir(parents=True)
DEFAULT_YEAR = datetime.datetime.today().year
URL = "https://adventofcode.com/{year}/day/{day}"
WAIT_TIME = re.compile(r"You have (?:(\d+)m )?(\d+)s left to wai... | 29.190476 | 85 | 0.683524 | import datetime
import pathlib
import re
DATA_DIR = pathlib.Path.home() / ".config" / "aoc_helper"
if not DATA_DIR.exists():
DATA_DIR.mkdir(parents=True)
DEFAULT_YEAR = datetime.datetime.today().year
URL = "https://adventofcode.com/{year}/day/{day}"
WAIT_TIME = re.compile(r"You have (?:(\d+)m )?(\d+)s left to wai... | true | true |
1c2faf958ad3017ae6f9fa4391d3e37c36bec1cd | 11,445 | py | Python | pol/pol_stack_II_load_POL03.py | mlares/CMB_polarization | 936d17d0be81564dbae96d8aae0cb9f824f8a94d | [
"MIT"
] | null | null | null | pol/pol_stack_II_load_POL03.py | mlares/CMB_polarization | 936d17d0be81564dbae96d8aae0cb9f824f8a94d | [
"MIT"
] | null | null | null | pol/pol_stack_II_load_POL03.py | mlares/CMB_polarization | 936d17d0be81564dbae96d8aae0cb9f824f8a94d | [
"MIT"
] | null | null | null | import pickle
import numpy as np
import cmfg
from Parser import Parser
from math import pi
from astropy import units as u
import itertools
from sklearn.neighbors import NearestNeighbors
from matplotlib import pyplot as plt
from random import random
from matplotlib import colors, ticker, rc
class MidpointNormalize(c... | 24.455128 | 88 | 0.584797 | import pickle
import numpy as np
import cmfg
from Parser import Parser
from math import pi
from astropy import units as u
import itertools
from sklearn.neighbors import NearestNeighbors
from matplotlib import pyplot as plt
from random import random
from matplotlib import colors, ticker, rc
class MidpointNormalize(c... | true | true |
1c2fb00c0438f657aa01efb9065b538cc0f0773c | 5,784 | py | Python | venv/Lib/site-packages/sqlalchemy/connectors/mxodbc.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 5,383 | 2018-11-27T07:34:03.000Z | 2022-03-31T19:40:59.000Z | venv/Lib/site-packages/sqlalchemy/connectors/mxodbc.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 2,719 | 2018-11-27T07:55:01.000Z | 2022-03-31T22:09:44.000Z | venv/Lib/site-packages/sqlalchemy/connectors/mxodbc.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 998 | 2018-11-28T09:34:38.000Z | 2022-03-30T19:04:11.000Z | # connectors/mxodbc.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""
Provide a SQLALchemy connector for the eGenix mxODBC commercial
Python ada... | 34.634731 | 79 | 0.648513 |
import re
import sys
import warnings
from . import Connector
from ..util import warn_deprecated
class MxODBCConnector(Connector):
driver = "mxodbc"
supports_sane_multi_rowcount = False
supports_unicode_statements = True
supports_unicode_binds = True
supports_native_decimal = True
@... | true | true |
1c2fb0f86f4a3e69043e5a1a430d789099947416 | 28,918 | py | Python | src/train_model.py | aaronbuhendwa/twophasePINN | 77bdcb2a07ab31dc9ab43623cf6b776a97c0b5c8 | [
"MIT"
] | 5 | 2021-06-09T07:03:40.000Z | 2021-12-27T08:43:52.000Z | src/train_model.py | aaronbuhendwa/twophasePINN | 77bdcb2a07ab31dc9ab43623cf6b776a97c0b5c8 | [
"MIT"
] | null | null | null | src/train_model.py | aaronbuhendwa/twophasePINN | 77bdcb2a07ab31dc9ab43623cf6b776a97c0b5c8 | [
"MIT"
] | 3 | 2021-02-04T15:21:32.000Z | 2021-12-14T14:34:28.000Z | import sys
sys.path.append("../utilities")
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
GPU_ID = "0"
os.environ["CUDA_VISIBLE_DEVICES"]= GPU_ID
import tensorflow as tf
tf.compat.v1.lo... | 51.639286 | 255 | 0.635694 | import sys
sys.path.append("../utilities")
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
GPU_ID = "0"
os.environ["CUDA_VISIBLE_DEVICES"]= GPU_ID
import tensorflow as tf
tf.compat.v1.lo... | true | true |
1c2fb1a603f08b5ab90357ffe685fd73b30386e3 | 13,860 | py | Python | tests/functional/test_sphinx_ext_autodoc.py | lipro/publishing-withsphinx | 80d1f5d190e7123b73f1e1917f72ee80ad45221b | [
"MIT"
] | null | null | null | tests/functional/test_sphinx_ext_autodoc.py | lipro/publishing-withsphinx | 80d1f5d190e7123b73f1e1917f72ee80ad45221b | [
"MIT"
] | 28 | 2016-11-13T10:40:37.000Z | 2019-02-28T17:24:15.000Z | tests/functional/test_sphinx_ext_autodoc.py | lipro/publishing-withsphinx | 80d1f5d190e7123b73f1e1917f72ee80ad45221b | [
"MIT"
] | 1 | 2016-11-15T19:34:56.000Z | 2016-11-15T19:34:56.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Stephan Linz
#
# 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, modi... | 56.803279 | 118 | 0.581457 |
from __future__ import absolute_import
from tests.functional import fixtures
import re
class TestCaseSphinxExtAutoDoc(fixtures.TestCaseFunctionalPublishingSphinx):
@fixtures.with_html_app(
testroot='ext-autodoc',
)
def test_build_html(self, app, status, warning):
... | true | true |
1c2fb3146c4ad81957fc32a3a4da2d4c4935acf1 | 39,525 | py | Python | astropy/io/fits/tests/test_hdulist.py | reidarkind/astropy | 0d8e7dea86d39b9faad025708b852814c8d5d41a | [
"BSD-3-Clause"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | Library/lib/python3.7/site-packages/astropy-4.0-py3.7-macosx-10.9-x86_64.egg/astropy/io/fits/tests/test_hdulist.py | gengyong/Carnets | 8930a14f69360d4db115a85ff9e0f6efa80fa2e7 | [
"BSD-3-Clause"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | Library/lib/python3.7/site-packages/astropy-4.0-py3.7-macosx-10.9-x86_64.egg/astropy/io/fits/tests/test_hdulist.py | gengyong/Carnets | 8930a14f69360d4db115a85ff9e0f6efa80fa2e7 | [
"BSD-3-Clause"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import glob
import io
import os
import sys
import copy
import subprocess
import pytest
import numpy as np
from astropy.io.fits.verify import VerifyError
from astropy.io import fits
from astropy.tests.helper import raises, catch_warnings, ignore_warnings
... | 37.287736 | 85 | 0.57141 |
import glob
import io
import os
import sys
import copy
import subprocess
import pytest
import numpy as np
from astropy.io.fits.verify import VerifyError
from astropy.io import fits
from astropy.tests.helper import raises, catch_warnings, ignore_warnings
from astropy.utils.exceptions import AstropyUserWarning, Astro... | true | true |
1c2fb3bd371d853ef0b2d0d8fca7b77602f5083b | 284 | py | Python | metadata_service/entity/description.py | jacobhjkim/amundsenmetadatalibrary | 19b5c7bf0ac496a357648b1a1b28f28f4d6a9ffb | [
"Apache-2.0"
] | null | null | null | metadata_service/entity/description.py | jacobhjkim/amundsenmetadatalibrary | 19b5c7bf0ac496a357648b1a1b28f28f4d6a9ffb | [
"Apache-2.0"
] | 1 | 2020-09-24T17:05:39.000Z | 2020-09-24T17:05:39.000Z | metadata_service/entity/description.py | jacobhjkim/amundsenmetadatalibrary | 19b5c7bf0ac496a357648b1a1b28f28f4d6a9ffb | [
"Apache-2.0"
] | null | null | null | import attr
from marshmallow_annotations.ext.attrs import AttrsSchema
@attr.s(auto_attribs=True, kw_only=True)
class Description:
description: str = attr.ib()
class DescriptionSchema(AttrsSchema):
class Meta:
target = Description
register_as_scheme = True
| 20.285714 | 57 | 0.742958 | import attr
from marshmallow_annotations.ext.attrs import AttrsSchema
@attr.s(auto_attribs=True, kw_only=True)
class Description:
description: str = attr.ib()
class DescriptionSchema(AttrsSchema):
class Meta:
target = Description
register_as_scheme = True
| true | true |
1c2fb3e1ff5c2206cf4863d4a3992cc8e52cf425 | 1,640 | py | Python | setup.py | robertopreste/HmtNote | 0f2c0f684a45c0087cabc3cb15f61803fac7daf1 | [
"MIT"
] | 11 | 2019-04-11T07:06:41.000Z | 2021-03-22T09:13:40.000Z | setup.py | robertopreste/HmtNote | 0f2c0f684a45c0087cabc3cb15f61803fac7daf1 | [
"MIT"
] | 64 | 2019-03-04T11:18:25.000Z | 2022-03-31T23:03:01.000Z | setup.py | robertopreste/HmtNote | 0f2c0f684a45c0087cabc3cb15f61803fac7daf1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Created by Roberto Preste
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ["Click==7.0", "requests==2.22.0", "... | 30.943396 | 72 | 0.632927 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ["Click==7.0", "requests==2.22.0", "numpy==1.16.4",
"pandas==0.24.2", "aiohttp==3.5.4", "ai... | true | true |
1c2fb49649471ec4b964ba521bb4466ad02558f5 | 1,475 | py | Python | ponyexpress/migrations/versions/334aefbc10df_.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | ponyexpress/migrations/versions/334aefbc10df_.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | ponyexpress/migrations/versions/334aefbc10df_.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | """empty message
Revision ID: 334aefbc10df
Revises: 36b5aaa11324
Create Date: 2014-04-01 16:37:00.017980
"""
# revision identifiers, used by Alembic.
revision = '334aefbc10df'
down_revision = '36b5aaa11324'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 32.065217 | 65 | 0.677288 |
revision = '334aefbc10df'
down_revision = '36b5aaa11324'
from alembic import op
import sqlalchemy as sa
def upgrade():
ength=255), nullable=True),
sa.Column('uri', sa.String(length=255), nullable=True),
sa.Column('label', sa.String(length=255), nullable=True),
sa.Column('provider', sa.String(length... | true | true |
1c2fb4d2c2ee899687cfffb6413569efa4eb69d4 | 2,264 | py | Python | test/upbit_test.py | BbChip0103/kimchi_premium_notice | e812fda7bae7cd01c4ca82892e9466831ff96698 | [
"Apache-2.0"
] | null | null | null | test/upbit_test.py | BbChip0103/kimchi_premium_notice | e812fda7bae7cd01c4ca82892e9466831ff96698 | [
"Apache-2.0"
] | null | null | null | test/upbit_test.py | BbChip0103/kimchi_premium_notice | e812fda7bae7cd01c4ca82892e9466831ff96698 | [
"Apache-2.0"
] | null | null | null | import asyncio
import websockets
import json
import ccxt
async def upbit_ws_client(coin_list, callback):
uri = 'wss://api.upbit.com/websocket/v1'
async with websockets.connect(uri) as websocket:
subscribe_fmt = [
{'ticket': 'bbchip13'},
{'format': 'SIMPLE'}
]
su... | 27.277108 | 77 | 0.616166 | import asyncio
import websockets
import json
import ccxt
async def upbit_ws_client(coin_list, callback):
uri = 'wss://api.upbit.com/websocket/v1'
async with websockets.connect(uri) as websocket:
subscribe_fmt = [
{'ticket': 'bbchip13'},
{'format': 'SIMPLE'}
]
su... | true | true |
1c2fb4f74a9d9b8bbf553cbbcff20b7de2e4e7ec | 30,576 | py | Python | src/utils/imagenet_labels.py | u-shiori/DLtemplate2021 | 10d266b450a6505255c44a570c04cbc0d99a2568 | [
"MIT"
] | null | null | null | src/utils/imagenet_labels.py | u-shiori/DLtemplate2021 | 10d266b450a6505255c44a570c04cbc0d99a2568 | [
"MIT"
] | null | null | null | src/utils/imagenet_labels.py | u-shiori/DLtemplate2021 | 10d266b450a6505255c44a570c04cbc0d99a2568 | [
"MIT"
] | null | null | null | idx2label = {0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8:... | 30.576 | 130 | 0.680534 | idx2label = {0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8:... | true | true |
1c2fb54378459ed8b7825cffc34fee728bda2df1 | 378 | py | Python | lib/datasets/_init_paths.py | liuqiang3/faster-rcnn | b665b46223d8623222f4d67299c232e39b242299 | [
"MIT"
] | null | null | null | lib/datasets/_init_paths.py | liuqiang3/faster-rcnn | b665b46223d8623222f4d67299c232e39b242299 | [
"MIT"
] | null | null | null | lib/datasets/_init_paths.py | liuqiang3/faster-rcnn | b665b46223d8623222f4d67299c232e39b242299 | [
"MIT"
] | null | null | null | import os.path as osp
import sys
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
this_dir = osp.dirname(__file__)
# Add lib to PYTHONPATH
lib_path = osp.join(this_dir, '..', 'lib')
add_path(lib_path)
coco_path = osp.join(this_dir, '..', 'data', 'coco', 'PythonAPI')
add_path(coco_path... | 22.235294 | 65 | 0.687831 | import os.path as osp
import sys
def add_path(path):
if path not in sys.path:
sys.path.insert(0, path)
this_dir = osp.dirname(__file__)
lib_path = osp.join(this_dir, '..', 'lib')
add_path(lib_path)
coco_path = osp.join(this_dir, '..', 'data', 'coco', 'PythonAPI')
add_path(coco_path)
lib_path = osp.join(t... | true | true |
1c2fb5e395071cbfd684013207b19f4d5adecb86 | 18,724 | py | Python | train.py | tsis-mobile-technology/deep-text-recognition-benchmark | d742dee8b13958437ec8565e70121732669fd704 | [
"Apache-2.0"
] | null | null | null | train.py | tsis-mobile-technology/deep-text-recognition-benchmark | d742dee8b13958437ec8565e70121732669fd704 | [
"Apache-2.0"
] | null | null | null | train.py | tsis-mobile-technology/deep-text-recognition-benchmark | d742dee8b13958437ec8565e70121732669fd704 | [
"Apache-2.0"
] | null | null | null | #-*-coding:utf-8-*-
import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, ... | 55.233038 | 1,105 | 0.677152 |
import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter,... | true | true |
1c2fb5fc10089bbacaa7a1f8c73535da8b2e736c | 1,229 | py | Python | Python3/0505-The-Maze-II/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0505-The-Maze-II/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0505-The-Maze-II/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def shortestDistance(self, maze, start, destination):
"""
:type maze: List[List[int]]
:type start: List[int]
:type destination: List[int]
:rtype: int
"""
m, n = len(maze), len(maze[0])
start, dest = tuple(start), tuple(destination)
... | 40.966667 | 90 | 0.441009 | class Solution:
def shortestDistance(self, maze, start, destination):
m, n = len(maze), len(maze[0])
start, dest = tuple(start), tuple(destination)
heap = []
heapq.heappush(heap, [0, start])
visited = {start : 0}
while heap:
dis, (i, j), = heapq.heappop(he... | true | true |
1c2fb67571f8019d9cbbd8c5dfe8c8c59589de44 | 3,442 | py | Python | network/wifiWidget.py | dailing/drcm | b692818ae5074611c27bff124dd41b34f0d7e64b | [
"MIT"
] | null | null | null | network/wifiWidget.py | dailing/drcm | b692818ae5074611c27bff124dd41b34f0d7e64b | [
"MIT"
] | null | null | null | network/wifiWidget.py | dailing/drcm | b692818ae5074611c27bff124dd41b34f0d7e64b | [
"MIT"
] | null | null | null | import sys
import logging
import subprocess
from PyQt4 import QtGui, QtCore
from wifiManager import wifiManager
try:
from sql.RunnableFunc import RunnableFunc
from sql.PoolWrapper import PoolWrapper
except Exception as e:
pass
from widget.LineEditDialog import LineEditDialog
def showKeyBoard():
try:
subproce... | 23.902778 | 80 | 0.705113 | import sys
import logging
import subprocess
from PyQt4 import QtGui, QtCore
from wifiManager import wifiManager
try:
from sql.RunnableFunc import RunnableFunc
from sql.PoolWrapper import PoolWrapper
except Exception as e:
pass
from widget.LineEditDialog import LineEditDialog
def showKeyBoard():
try:
subproce... | true | true |
1c2fb6a640426644549f001ce958942cb7912536 | 3,403 | py | Python | src/models/utils.py | caixhstrive/Mini_Xception | 0cf7ce88d9cbe56f0dc20b0ef2850a499c033ce3 | [
"MIT"
] | 3 | 2018-11-21T06:51:57.000Z | 2018-11-21T08:20:53.000Z | src/models/utils.py | caixhstrive/Mini_Xception | 0cf7ce88d9cbe56f0dc20b0ef2850a499c033ce3 | [
"MIT"
] | null | null | null | src/models/utils.py | caixhstrive/Mini_Xception | 0cf7ce88d9cbe56f0dc20b0ef2850a499c033ce3 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
import os
from keras import backend as K
from keras.models import Model
from keras.engine.topology import get_source_inputs
from keras.layers import Activation, Add, Concatenate, Conv2D, GlobalMaxPooling2D
from keras.layers import GlobalAveragePooling2D,Input, Dense
from keras.layers import MaxP... | 44.776316 | 125 | 0.675287 |
import os
from keras import backend as K
from keras.models import Model
from keras.engine.topology import get_source_inputs
from keras.layers import Activation, Add, Concatenate, Conv2D, GlobalMaxPooling2D
from keras.layers import GlobalAveragePooling2D,Input, Dense
from keras.layers import MaxPool2D,AveragePooling2... | true | true |
1c2fb6f8527c2cfd6460c6bf389b0be925aaae4c | 1,906 | py | Python | scripts/checkpointer/full-checkpoints.py | ones006/divcoin | 9ab87da2579395b4e1ee9d02a9bab1bdae710b51 | [
"BSD-3-Clause"
] | 2 | 2018-11-03T04:00:08.000Z | 2019-10-08T13:23:18.000Z | scripts/checkpointer/full-checkpoints.py | ones006/divcoin | 9ab87da2579395b4e1ee9d02a9bab1bdae710b51 | [
"BSD-3-Clause"
] | null | null | null | scripts/checkpointer/full-checkpoints.py | ones006/divcoin | 9ab87da2579395b4e1ee9d02a9bab1bdae710b51 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import json
import requests
topbuffer = 1
def lastknownblock():
try:
with open(sys.argv[1], 'r') as cp:
(block, hash) = list(cp)[-1].split(',')
cp.close()
return int(block)
except:
return 0
def height(... | 23.530864 | 95 | 0.574502 |
import sys
import json
import requests
topbuffer = 1
def lastknownblock():
try:
with open(sys.argv[1], 'r') as cp:
(block, hash) = list(cp)[-1].split(',')
cp.close()
return int(block)
except:
return 0
def height():
base_url = 'http://localhost:1189... | false | true |
1c2fb781ddcd4218fd8a81658d8b1820f7658753 | 425 | py | Python | setup.py | dhruvdcoder/allennlp-wandb | 160dceb1f4cec8e893b856d333bc302748afdd74 | [
"MIT"
] | null | null | null | setup.py | dhruvdcoder/allennlp-wandb | 160dceb1f4cec8e893b856d333bc302748afdd74 | [
"MIT"
] | null | null | null | setup.py | dhruvdcoder/allennlp-wandb | 160dceb1f4cec8e893b856d333bc302748afdd74 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
install_requires = [
"allennlp>=0.9.0",
"wandb==0.8.15",
]
setup(
name='allennlp_wandb',
version='0.0.1',
description='Utilities to use allennlp with wandb',
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
p... | 25 | 62 | 0.647059 | from setuptools import setup, find_packages
install_requires = [
"allennlp>=0.9.0",
"wandb==0.8.15",
]
setup(
name='allennlp_wandb',
version='0.0.1',
description='Utilities to use allennlp with wandb',
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
p... | true | true |
1c2fb7ce59e423e59b7589b3cf8fd6d6bac8e56f | 10,685 | py | Python | gateware/butterstick-bitstream.py | butterstick-fpga/test-fixture-sw | 6ab19faaeaaf3368fd9cd308fa94f913fe3e54be | [
"BSD-2-Clause"
] | null | null | null | gateware/butterstick-bitstream.py | butterstick-fpga/test-fixture-sw | 6ab19faaeaaf3368fd9cd308fa94f913fe3e54be | [
"BSD-2-Clause"
] | null | null | null | gateware/butterstick-bitstream.py | butterstick-fpga/test-fixture-sw | 6ab19faaeaaf3368fd9cd308fa94f913fe3e54be | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# This file is Copyright (c) Greg Davill <greg.davill@gmail.com>
# License: BSD
# This variable defines all the external programs that this module
# relies on. lxbuildenv reads this variable in order to ensure
# the build will finish without exiting due to missing third-party
# programs.
LX_D... | 37.756184 | 172 | 0.563594 |
LX_DEPENDENCIES = ["riscv", "nextpnr-ecp5", "yosys"]
import lxbuildenv
import os
import shutil
import argparse
import subprocess
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.lattice.trellis import trellis_args, trellis_argdict
from litex.soc.integrat... | true | true |
1c2fb937fada7a62b8037f0529f48779b7d7d22b | 6,028 | py | Python | PyForge/ForgeUsers.py | sgthakare20/Pyforge | e3ce15586ccc07f39e0faf18885b472baa60ff5d | [
"MIT"
] | 1 | 2020-04-13T13:02:43.000Z | 2020-04-13T13:02:43.000Z | PyForge/ForgeUsers.py | sgthakare20/Pyforge | e3ce15586ccc07f39e0faf18885b472baa60ff5d | [
"MIT"
] | null | null | null | PyForge/ForgeUsers.py | sgthakare20/Pyforge | e3ce15586ccc07f39e0faf18885b472baa60ff5d | [
"MIT"
] | 2 | 2021-06-22T14:39:53.000Z | 2021-06-22T15:28:21.000Z | # -*- coding: utf-8 -*-
"""Module containing classes related to users on the Autodesk Forge BIM360 platform."""
from PyForge.ForgeApi import ForgeApi
class UsersApi(ForgeApi):
"""This class provides the base API calls for Autodesk BIM360 users."""
def __init__(self, token,
base_url=r'https:/... | 42.751773 | 158 | 0.547279 |
from PyForge.ForgeApi import ForgeApi
class UsersApi(ForgeApi):
def __init__(self, token,
base_url=r'https://developer.api.autodesk.com/bim360/admin/v1/',
timeout=1):
self.token = token
def get_project_users(self, project_id=None, region='US', accept_language="de",... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.