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
1c314be71dc8f37a5d141751c30c55aed4361499
6,174
py
Python
tests/testshop/settings.py
2000-ion/TIDPP-Lab3
3fc97e6214b6e51f40df39f1692d4deec4bb0cc2
[ "BSD-3-Clause" ]
2,160
2016-01-24T05:08:59.000Z
2022-03-31T12:15:30.000Z
tests/testshop/settings.py
2000-ion/TIDPP-Lab3
3fc97e6214b6e51f40df39f1692d4deec4bb0cc2
[ "BSD-3-Clause" ]
455
2016-01-29T22:41:33.000Z
2022-03-23T08:28:01.000Z
tests/testshop/settings.py
2000-ion/TIDPP-Lab3
3fc97e6214b6e51f40df39f1692d4deec4bb0cc2
[ "BSD-3-Clause" ]
818
2016-02-01T15:09:07.000Z
2022-03-28T19:52:26.000Z
from django.urls import reverse_lazy from django.utils.text import format_lazy DEBUG = True ROOT_URLCONF = 'testshop.urls' SECRET_KEY = 'test' SITE_ID = 1 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } STATIC_URL = '/static/' MEDIA_URL = '/media...
27.5625
119
0.671526
from django.urls import reverse_lazy from django.utils.text import format_lazy DEBUG = True ROOT_URLCONF = 'testshop.urls' SECRET_KEY = 'test' SITE_ID = 1 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } STATIC_URL = '/static/' MEDIA_URL = '/media...
true
true
1c314c09b523262c1d016eb7b0d051d3bc9ce51c
735
py
Python
image_downloader.py
art-litv/Space-Instagram
98fd162cc7795bf66ca28fa2b112dc0c837914fa
[ "MIT" ]
null
null
null
image_downloader.py
art-litv/Space-Instagram
98fd162cc7795bf66ca28fa2b112dc0c837914fa
[ "MIT" ]
null
null
null
image_downloader.py
art-litv/Space-Instagram
98fd162cc7795bf66ca28fa2b112dc0c837914fa
[ "MIT" ]
null
null
null
import requests import os import urllib3 from pathlib import PurePath def download_image(url: str, path: str, verify=True): ''' Downloads an image into "images" directory ''' ''' Required for fetch_spacex.py and fetch_hubble.py ''' urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) r...
27.222222
71
0.678912
import requests import os import urllib3 from pathlib import PurePath def download_image(url: str, path: str, verify=True): urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) response = requests.get(url, verify=verify) response.raise_for_status() filename = path.split(os.sep)[-1] ...
true
true
1c314d4280a04da568ad4442058981508effe981
2,057
py
Python
test/test_validators.py
srobo/python-dbus-next
934df62b29651cfbf513d244ad7ed138faab6fe4
[ "MIT" ]
1
2021-02-28T15:51:52.000Z
2021-02-28T15:51:52.000Z
test/test_validators.py
srobo/python-dbus-next
934df62b29651cfbf513d244ad7ed138faab6fe4
[ "MIT" ]
null
null
null
test/test_validators.py
srobo/python-dbus-next
934df62b29651cfbf513d244ad7ed138faab6fe4
[ "MIT" ]
1
2021-03-08T14:22:27.000Z
2021-03-08T14:22:27.000Z
from dbus_next import (is_bus_name_valid, is_object_path_valid, is_interface_name_valid, is_member_name_valid) def test_object_path_validator(): valid_paths = ['/', '/foo', '/foo/bar', '/foo/bar/bat'] invalid_paths = [ None, {}, '', 'foo', 'foo/bar', '/foo/bar/', '/$/foo/bar', '...
38.811321
95
0.635391
from dbus_next import (is_bus_name_valid, is_object_path_valid, is_interface_name_valid, is_member_name_valid) def test_object_path_validator(): valid_paths = ['/', '/foo', '/foo/bar', '/foo/bar/bat'] invalid_paths = [ None, {}, '', 'foo', 'foo/bar', '/foo/bar/', '/$/foo/bar', '...
true
true
1c314dfe0048db5f295b09c35b1e27c582e5f4bb
78
py
Python
run.py
TianxiaoHu/GomokuAgent
8cb05025059945692846cbb0541a834e9f985ce2
[ "MIT" ]
15
2017-06-29T07:47:12.000Z
2021-11-09T05:33:59.000Z
run.py
TianxiaoHu/GomokuAgent
8cb05025059945692846cbb0541a834e9f985ce2
[ "MIT" ]
null
null
null
run.py
TianxiaoHu/GomokuAgent
8cb05025059945692846cbb0541a834e9f985ce2
[ "MIT" ]
1
2019-12-01T07:53:48.000Z
2019-12-01T07:53:48.000Z
#!/usr/bin/env python from app import app app.run(debug=True, threaded=True)
15.6
34
0.74359
from app import app app.run(debug=True, threaded=True)
true
true
1c314fdde8f8337ef25ea5bbed6c290af6543d97
5,429
py
Python
lib/web/ui.py
Juniper/YAPT
b1a54998867c70352001415d5e4b70408480dab9
[ "BSD-3-Clause" ]
33
2018-05-17T04:16:56.000Z
2021-11-25T21:21:02.000Z
lib/web/ui.py
Juniper/YAPT
b1a54998867c70352001415d5e4b70408480dab9
[ "BSD-3-Clause" ]
4
2021-01-10T20:45:31.000Z
2021-09-23T23:21:16.000Z
lib/web/ui.py
Juniper/YAPT
b1a54998867c70352001415d5e4b70408480dab9
[ "BSD-3-Clause" ]
8
2018-09-19T12:18:54.000Z
2021-01-10T03:49:10.000Z
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER # Copyright (c) 2018 Juniper Networks, Inc. # All rights reserved. # Use is subject to license terms. # # Author: cklewar import socket import jsonpickle import lib.constants as c from lib.amqp.amqpadapter import AMQPBlockingServerAdapter from lib.amqp.am...
47.208696
117
0.640081
import socket import jsonpickle import lib.constants as c from lib.amqp.amqpadapter import AMQPBlockingServerAdapter from lib.amqp.amqpmessage import AMQPMessage from lib.web.logviewer import LogViewer from lib.logmsg import LogCommon from lib.logmsg import LogUiProcessor as logmsg from lib.processor import Bac...
true
true
1c3150901e20732eec2c6bd14f28487bfc0b51c5
1,684
py
Python
freezing/model/migrations/versions/f620a24f5f7e_least_variance.py
freezingsaddles/freezing-model
3bb03739d5bdff418bcf17707a52c9994c45e52f
[ "Apache-2.0" ]
2
2020-01-02T01:23:00.000Z
2022-01-03T20:57:39.000Z
freezing/model/migrations/versions/f620a24f5f7e_least_variance.py
freezingsaddles/freezing-model
3bb03739d5bdff418bcf17707a52c9994c45e52f
[ "Apache-2.0" ]
8
2018-01-19T14:36:05.000Z
2021-11-24T19:22:19.000Z
freezing/model/migrations/versions/f620a24f5f7e_least_variance.py
freezingsaddles/freezing-model
3bb03739d5bdff418bcf17707a52c9994c45e52f
[ "Apache-2.0" ]
1
2018-10-28T16:09:51.000Z
2018-10-28T16:09:51.000Z
from alembic import op import sqlalchemy as sa """least-variance Revision ID: f620a24f5f7e Revises: b4d003c71167 Create Date: 2020-01-03 23:06:50.491509 """ # revision identifiers, used by Alembic. revision = "f620a24f5f7e" down_revision = "b4d003c71167" def upgrade(): op.execute( """ cre...
31.773585
78
0.515439
from alembic import op import sqlalchemy as sa revision = "f620a24f5f7e" down_revision = "b4d003c71167" def upgrade(): op.execute( """ create or replace view variance_by_day as select ds.athlete_id, sum(case when ds.distance >= 1 then 1 e...
true
true
1c3151b117c57733e4706a03477864f921dcaa83
724
py
Python
Demo/tkinter/matt/00-HELLO-WORLD.py
arvindm95/unladen-swallow
8175e37eaea7ca66ed03283b46bc1d2db0d3f9c3
[ "PSF-2.0" ]
2,293
2015-01-02T12:46:10.000Z
2022-03-29T09:45:43.000Z
python/src/Demo/tkinter/matt/00-HELLO-WORLD.py
weiqiangzheng/sl4a
d3c17dca978cbeee545e12ea240a9dbf2a6999e9
[ "Apache-2.0" ]
315
2015-05-31T11:55:46.000Z
2022-01-12T08:36:37.000Z
python/src/Demo/tkinter/matt/00-HELLO-WORLD.py
weiqiangzheng/sl4a
d3c17dca978cbeee545e12ea240a9dbf2a6999e9
[ "Apache-2.0" ]
1,033
2015-01-04T07:48:40.000Z
2022-03-24T09:34:37.000Z
from Tkinter import * # note that there is no explicit call to start Tk. # Tkinter is smart enough to start the system if it's not already going. class Test(Frame): def printit(self): print "hi" def createWidgets(self): self.QUIT = Button(self, text='QUIT', foreground='red', ...
25.857143
72
0.596685
from Tkinter import * class Test(Frame): def printit(self): print "hi" def createWidgets(self): self.QUIT = Button(self, text='QUIT', foreground='red', command=self.quit) self.QUIT.pack(side=LEFT, fill=BOTH) # a hello button self.hi_there...
false
true
1c3151b5319a6b48830c7ba8f9a693be51342a4a
98
py
Python
config.py
boada/microblog
84f2d1a71327da3f6283b74a3b3d722e034b2f5f
[ "MIT" ]
1
2020-02-21T16:13:45.000Z
2020-02-21T16:13:45.000Z
config.py
boada/microblog
84f2d1a71327da3f6283b74a3b3d722e034b2f5f
[ "MIT" ]
null
null
null
config.py
boada/microblog
84f2d1a71327da3f6283b74a3b3d722e034b2f5f
[ "MIT" ]
null
null
null
import os class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'my-secret-key'
19.6
64
0.714286
import os class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'my-secret-key'
true
true
1c3152ca4581bd3fdb80edd4e4c01537da05cec5
1,256
py
Python
qcloudsdkmonitor/GetMonitorDataRequest.py
f3n9/qcloudcli
b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19
[ "Apache-2.0" ]
null
null
null
qcloudsdkmonitor/GetMonitorDataRequest.py
f3n9/qcloudcli
b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19
[ "Apache-2.0" ]
null
null
null
qcloudsdkmonitor/GetMonitorDataRequest.py
f3n9/qcloudcli
b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from qcloudsdkcore.request import Request class GetMonitorDataRequest(Request): def __init__(self): super(GetMonitorDataRequest, self).__init__( 'monitor', 'qcloudcliV1', 'GetMonitorData', 'monitor.api.qcloud.com') def get_dimensions(self): return self.get...
27.304348
81
0.667197
from qcloudsdkcore.request import Request class GetMonitorDataRequest(Request): def __init__(self): super(GetMonitorDataRequest, self).__init__( 'monitor', 'qcloudcliV1', 'GetMonitorData', 'monitor.api.qcloud.com') def get_dimensions(self): return self.get_params().get('dimensio...
true
true
1c3153c25f4173c0d69cf19c9085eee9f382434a
2,768
py
Python
plenum/test/txn_author_agreement/test_get_empty_txn_author_agreement.py
andkononykhin/plenum
28dc1719f4b7e80d31dafbadb38cfec4da949886
[ "Apache-2.0" ]
null
null
null
plenum/test/txn_author_agreement/test_get_empty_txn_author_agreement.py
andkononykhin/plenum
28dc1719f4b7e80d31dafbadb38cfec4da949886
[ "Apache-2.0" ]
1
2019-03-20T14:57:22.000Z
2019-03-20T15:01:55.000Z
plenum/test/txn_author_agreement/test_get_empty_txn_author_agreement.py
andkononykhin/plenum
28dc1719f4b7e80d31dafbadb38cfec4da949886
[ "Apache-2.0" ]
null
null
null
import pytest from plenum.common.constants import REPLY, CONFIG_LEDGER_ID from plenum.common.exceptions import RequestNackedException from plenum.common.util import get_utc_epoch from plenum.test.delayers import req_delay from plenum.test.stasher import delay_rules from plenum.test.txn_author_agreement.helper import s...
41.939394
106
0.725072
import pytest from plenum.common.constants import REPLY, CONFIG_LEDGER_ID from plenum.common.exceptions import RequestNackedException from plenum.common.util import get_utc_epoch from plenum.test.delayers import req_delay from plenum.test.stasher import delay_rules from plenum.test.txn_author_agreement.helper import s...
true
true
1c31541017e2e3db5152ae18abbb5211d1ab50d4
6,481
py
Python
analyze_tls.py
khushhallchandra/CN-project
405ce86e4e65e116531aa19287b8d05c959b1441
[ "MIT" ]
null
null
null
analyze_tls.py
khushhallchandra/CN-project
405ce86e4e65e116531aa19287b8d05c959b1441
[ "MIT" ]
null
null
null
analyze_tls.py
khushhallchandra/CN-project
405ce86e4e65e116531aa19287b8d05c959b1441
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import matplotlib.pyplot as plt def main(filename): data = pd.read_csv(filename, header=None) means = data.mean(axis = 0) stds = data.std(axis = 0) return means[0], means[1], stds[0], stds[1] if __name__ == '__main__': files_http1 = ['./results/benchmark_siz...
54.923729
257
0.738158
import numpy as np import pandas as pd import matplotlib.pyplot as plt def main(filename): data = pd.read_csv(filename, header=None) means = data.mean(axis = 0) stds = data.std(axis = 0) return means[0], means[1], stds[0], stds[1] if __name__ == '__main__': files_http1 = ['./results/benchmark_siz...
true
true
1c31542daa5de4d6fed71faf3355aaeb443d153b
63,918
py
Python
pandas/core/internals/managers.py
LauraCollard/pandas
b1c3a9031569334cafc4e8d45d35408421f7dea4
[ "BSD-3-Clause" ]
2
2019-12-02T11:24:30.000Z
2021-02-28T12:13:54.000Z
pandas/core/internals/managers.py
LauraCollard/pandas
b1c3a9031569334cafc4e8d45d35408421f7dea4
[ "BSD-3-Clause" ]
1
2019-08-18T16:00:45.000Z
2019-08-18T16:00:45.000Z
pandas/core/internals/managers.py
LauraCollard/pandas
b1c3a9031569334cafc4e8d45d35408421f7dea4
[ "BSD-3-Clause" ]
4
2019-10-09T07:52:08.000Z
2021-07-12T02:37:59.000Z
from collections import defaultdict from functools import partial import itertools import operator import re from typing import List, Optional, Sequence, Tuple, Union import numpy as np from pandas._libs import Timedelta, Timestamp, internals as libinternals, lib from pandas.util._validators import validate_bool_kwar...
31.13395
88
0.571216
from collections import defaultdict from functools import partial import itertools import operator import re from typing import List, Optional, Sequence, Tuple, Union import numpy as np from pandas._libs import Timedelta, Timestamp, internals as libinternals, lib from pandas.util._validators import validate_bool_kwar...
true
true
1c3154da6b77f5e2da043f184d552568ae99cd97
388
py
Python
tests/swig/python/family/driver.py
bragaigor/souffle
c39cc5cdb73d23d9af0d48976077c4c0a7943cf2
[ "UPL-1.0" ]
570
2016-03-15T15:17:18.000Z
2022-03-27T09:47:45.000Z
tests/swig/python/family/driver.py
bragaigor/souffle
c39cc5cdb73d23d9af0d48976077c4c0a7943cf2
[ "UPL-1.0" ]
1,744
2016-03-16T19:19:19.000Z
2022-03-31T21:28:28.000Z
tests/swig/python/family/driver.py
bragaigor/souffle
c39cc5cdb73d23d9af0d48976077c4c0a7943cf2
[ "UPL-1.0" ]
183
2016-03-12T17:51:20.000Z
2022-03-24T12:03:47.000Z
""" Souffle - A Datalog Compiler Copyright (c) 2019, The Souffle Developers. All rights reserved Licensed under the Universal Permissive License v 1.0 as shown at: - https://opensource.org/licenses/UPL - <souffle root>/licenses/SOUFFLE-UPL.txt """ import SwigInterface import sys p = SwigInterface.newInstance('family')...
22.823529
66
0.747423
import SwigInterface import sys p = SwigInterface.newInstance('family') p.loadAll(sys.argv[1]) p.run() p.printAll('.') p.thisown = 1 del p
true
true
1c3155289db24c45371df69cb5782cb0502ebb2a
2,038
py
Python
forum2/urls.py
boxed/forum
abb3699d310bf3a404f031a3cb0e4bdbf403da5a
[ "BSD-3-Clause" ]
2
2019-06-28T16:30:44.000Z
2020-12-28T01:46:52.000Z
forum2/urls.py
boxed/forum
abb3699d310bf3a404f031a3cb0e4bdbf403da5a
[ "BSD-3-Clause" ]
14
2019-02-26T17:25:54.000Z
2019-04-03T18:11:24.000Z
forum2/urls.py
boxed/forum
abb3699d310bf3a404f031a3cb0e4bdbf403da5a
[ "BSD-3-Clause" ]
1
2019-06-14T14:21:47.000Z
2019-06-14T14:21:47.000Z
"""forum2 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based ...
32.870968
79
0.68842
from django.urls import path, include from iommi.admin import Admin import forum.views as views import forum2.views import forum2.views as f2views import unread.views import unread.views as unread_views import issues class MyAdmin(Admin): class Meta: iommi_style = 'bootstrap' urlpatterns = [ path('...
true
true
1c31562ad79eb4b6493ac8daf61affd73e900676
2,989
py
Python
ast.py
xXGeistmeisterXx/ast-tools
b55598cb2eb67627036e4e619a9cb26b9f50093f
[ "MIT" ]
null
null
null
ast.py
xXGeistmeisterXx/ast-tools
b55598cb2eb67627036e4e619a9cb26b9f50093f
[ "MIT" ]
null
null
null
ast.py
xXGeistmeisterXx/ast-tools
b55598cb2eb67627036e4e619a9cb26b9f50093f
[ "MIT" ]
null
null
null
import json import re default = [0.0, 0.0, 0.0] rounding = 5 def setValue(dict, obj, pose, pose_name): if(pose in dict): obj[pose_name] = [float(dict[pose][0][:len(dict[pose][0])-1]), float(dict[pose][1][:len(dict[pose][1])-1]), float(dict[pose][2][:len(dict[pose][2])-1])] else: obj[pose_name] = defau...
37.835443
205
0.611576
import json import re default = [0.0, 0.0, 0.0] rounding = 5 def setValue(dict, obj, pose, pose_name): if(pose in dict): obj[pose_name] = [float(dict[pose][0][:len(dict[pose][0])-1]), float(dict[pose][1][:len(dict[pose][1])-1]), float(dict[pose][2][:len(dict[pose][2])-1])] else: obj[pose_name] = defau...
true
true
1c31564e9f41bef1f7beef9e9f4cb58fe1f9d57c
23,221
py
Python
ploy_ezjail/__init__.py
ployground/ploy_ezjail
d55eb49a9a9163117c3b44b5308ca3424f8e2def
[ "BSD-3-Clause" ]
2
2016-04-22T09:12:00.000Z
2021-07-27T08:58:06.000Z
ploy_ezjail/__init__.py
ployground/ploy_ezjail
d55eb49a9a9163117c3b44b5308ca3424f8e2def
[ "BSD-3-Clause" ]
7
2015-01-30T23:43:01.000Z
2017-03-31T19:53:28.000Z
ploy_ezjail/__init__.py
ployground/ploy_ezjail
d55eb49a9a9163117c3b44b5308ca3424f8e2def
[ "BSD-3-Clause" ]
4
2015-10-16T10:58:50.000Z
2018-02-22T18:05:11.000Z
from fnmatch import fnmatch from lazy import lazy from ploy.common import BaseMaster, Executor, StartupScriptMixin from ploy.common import parse_ssh_keygen from ploy.config import BaseMassager, value_asbool from ploy.plain import Instance as PlainInstance from ploy.proxy import ProxyInstance import logging import re im...
36.282813
151
0.526248
from fnmatch import fnmatch from lazy import lazy from ploy.common import BaseMaster, Executor, StartupScriptMixin from ploy.common import parse_ssh_keygen from ploy.config import BaseMassager, value_asbool from ploy.plain import Instance as PlainInstance from ploy.proxy import ProxyInstance import logging import re im...
true
true
1c3156b5704c9bf5279b31e089a46032268f65f0
703
py
Python
label_import/label.py
jscheytt/endo-loc
e425716e434087157ada3e35c309281dda3eca62
[ "Apache-2.0" ]
null
null
null
label_import/label.py
jscheytt/endo-loc
e425716e434087157ada3e35c309281dda3eca62
[ "Apache-2.0" ]
null
null
null
label_import/label.py
jscheytt/endo-loc
e425716e434087157ada3e35c309281dda3eca62
[ "Apache-2.0" ]
null
null
null
from enum import Enum class ILabelValue(Enum): """ Possible values for an ILabel. """ IN, OUT, MOVING_IN, MOVING_OUT, IN_BETWEEN, EXIT = range(6) ADS = -1 class ILabel: """ Label denoting location of the endoscope. """ def __init__(self, start, end, value): """ B...
21.96875
73
0.601707
from enum import Enum class ILabelValue(Enum): IN, OUT, MOVING_IN, MOVING_OUT, IN_BETWEEN, EXIT = range(6) ADS = -1 class ILabel: def __init__(self, start, end, value): self.start = start self.end = end self.value = value def __len__(self): return len(self.start) + ...
true
true
1c31575817c8b5a655612d6e64bbefc782dac315
46,634
py
Python
qa/rpc-tests/test_framework/mininode.py
arthurgarcia/cruzado
f6457019c17a166e12433f61bcfd217616509405
[ "MIT" ]
null
null
null
qa/rpc-tests/test_framework/mininode.py
arthurgarcia/cruzado
f6457019c17a166e12433f61bcfd217616509405
[ "MIT" ]
null
null
null
qa/rpc-tests/test_framework/mininode.py
arthurgarcia/cruzado
f6457019c17a166e12433f61bcfd217616509405
[ "MIT" ]
null
null
null
# mininode.py - Bitcoin P2P network half-a-node # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # This python code was modified from ArtForz' public domain half-a-node, as # found in the mini-node branch of http://github.c...
29.422082
184
0.565832
# found in the mini-node branch of http://github.com/jgarzik/pynode. # # NodeConn: an object which manages p2p connectivity to a bitcoin node # NodeConnCB: a base class that describes the interface for receiving # callbacks with network messages from a NodeConn # CBlock, CTransaction, CBlockHeader, CT...
false
true
1c3157ffaa98687e0d1d3da9cbb7888ecc676368
2,145
py
Python
JarekG/2_python_controlflow/file_read_d.py
Khayn/2021-12-elearning-pythonana
a54e407adc8fb8c3a5fd2522735ae09cdef6540a
[ "MIT" ]
null
null
null
JarekG/2_python_controlflow/file_read_d.py
Khayn/2021-12-elearning-pythonana
a54e407adc8fb8c3a5fd2522735ae09cdef6540a
[ "MIT" ]
null
null
null
JarekG/2_python_controlflow/file_read_d.py
Khayn/2021-12-elearning-pythonana
a54e407adc8fb8c3a5fd2522735ae09cdef6540a
[ "MIT" ]
null
null
null
""" * Assignment: File Read CleanFile * Required: no * Complexity: medium * Lines of code: 10 lines * Time: 8 min English: 1. Read `FILE` and for each line: a. Remove leading and trailing whitespaces b. Skip line if it is empty c. Split line by whitespace d. Separate IP address and ...
28.6
91
0.61352
FILE = '_temporary.txt' DATA = """127.0.0.1 localhost 10.13.37.1 nasa.gov esa.int roscosmos.ru 255.255.255.255 broadcasthost ::1 localhost """ with open(FILE, mode='w') as file: file.write(DATA) result = {} with open(FILE, mode='r') as f: lines = f.readlines() for line in lines: ...
true
true
1c3158a78f65cde7e262ec2d3dac6a9d0a56e74d
35,011
py
Python
rr_graph/channel.py
mithro/symbiflow-rr-graph
33c7d952b72d03bd40265df13900526846abc7d5
[ "0BSD" ]
2
2020-11-25T03:00:33.000Z
2021-12-21T07:29:44.000Z
rr_graph/channel.py
mithro/symbiflow-rr-graph
33c7d952b72d03bd40265df13900526846abc7d5
[ "0BSD" ]
10
2020-07-24T17:09:35.000Z
2022-02-07T17:55:49.000Z
rr_graph/channel.py
mithro/symbiflow-rr-graph
33c7d952b72d03bd40265df13900526846abc7d5
[ "0BSD" ]
4
2020-11-06T09:07:14.000Z
2021-09-17T16:38:19.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020-2021 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ This file for packing tracks into c...
29.273411
92
0.464797
import pprint import enum import io from collections import namedtuple import lxml.etree as ET from . import Position from . import Size from . import node_pos, single_element from .utils.asserts import assert_eq from .utils.asserts import assert_len_eq from .utils.asserts import assert_type from .utils....
true
true
1c3158f023b98bdbd790861d7edf522138fed93f
4,974
py
Python
contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_task.py
anthonyjpratti/pants
d98e53af6ddd877861231bce8343f8204da0a9d1
[ "Apache-2.0" ]
null
null
null
contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_task.py
anthonyjpratti/pants
d98e53af6ddd877861231bce8343f8204da0a9d1
[ "Apache-2.0" ]
null
null
null
contrib/node/tests/python/pants_test/contrib/node/tasks/test_node_task.py
anthonyjpratti/pants
d98e53af6ddd877861231bce8343f8204da0a9d1
[ "Apache-2.0" ]
null
null
null
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import json import os import string from textwrap import dedent from pants.build_graph.target import Target from pants.testutil.task_test_base import TaskTestBase from pants.util.contextu...
33.608108
97
0.664254
import json import os import string from textwrap import dedent from pants.build_graph.target import Target from pants.testutil.task_test_base import TaskTestBase from pants.util.contextutil import pushd, temporary_dir from pants.contrib.node.targets.node_module import NodeModule from pants.contrib.node.targets.no...
true
true
1c31596f5d270636d8249982d87c2af04c309ec7
146
py
Python
answers/x_3_3.py
ofl/kuku2
7247fb1862d917d23258ebe7a93dca5939433225
[ "MIT" ]
null
null
null
answers/x_3_3.py
ofl/kuku2
7247fb1862d917d23258ebe7a93dca5939433225
[ "MIT" ]
1
2021-11-13T08:03:04.000Z
2021-11-13T08:03:04.000Z
answers/x_3_3.py
ofl/kuku2
7247fb1862d917d23258ebe7a93dca5939433225
[ "MIT" ]
null
null
null
# x_3_3 # # statistics.meanで計算した平均の値の小数低下を切り捨ててください import statistics import math data = [7, 4, 3, 9] print(math.floor(statistics.mean(data)))
13.272727
41
0.746575
import statistics import math data = [7, 4, 3, 9] print(math.floor(statistics.mean(data)))
true
true
1c315a78f08f3eb22cdbe8649826051b76d55dc4
886
py
Python
mysite/polls/models.py
sssunda/django-test
c262dcbf4599dd222ceeb0256e1005a1802ea997
[ "MIT" ]
1
2019-06-06T07:56:38.000Z
2019-06-06T07:56:38.000Z
mysite/polls/models.py
sssunda/django-test
c262dcbf4599dd222ceeb0256e1005a1802ea997
[ "MIT" ]
null
null
null
mysite/polls/models.py
sssunda/django-test
c262dcbf4599dd222ceeb0256e1005a1802ea997
[ "MIT" ]
null
null
null
import datetime from django.db import models from django.utils import timezone # Create your models here. class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): return self.question_text def was_...
28.580645
70
0.716704
import datetime from django.db import models from django.utils import timezone class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): return self.question_text def was_published_recently(self): ...
true
true
1c315b71a2c81781e8dda407026d012b61f1f9c8
4,020
py
Python
python/tools/metrics.py
bearsroom/mxnet-augmented
af4843b249e312014d54ce38545fcb4fa546d7db
[ "Apache-2.0" ]
1
2019-01-16T03:57:53.000Z
2019-01-16T03:57:53.000Z
python/tools/metrics.py
bearsroom/mxnet-augmented
af4843b249e312014d54ce38545fcb4fa546d7db
[ "Apache-2.0" ]
null
null
null
python/tools/metrics.py
bearsroom/mxnet-augmented
af4843b249e312014d54ce38545fcb4fa546d7db
[ "Apache-2.0" ]
null
null
null
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np class Metrics: def __init__(self, num_classes): self.num_classes = num_classes self.reset() def reset(self): self.tp = np.zeros((self.num_classes, ), dtype=np.float32) self.fp = np.zeros...
37.570093
105
0.575871
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np class Metrics: def __init__(self, num_classes): self.num_classes = num_classes self.reset() def reset(self): self.tp = np.zeros((self.num_classes, ), dtype=np.float32) self.fp = np.zeros...
true
true
1c315d2b105e29664405e2585fb0f7c0c8048c8b
894
py
Python
python_code/vnev/Lib/site-packages/jdcloud_sdk/services/mps/models/ThumbnailTaskSource.py
Ureimu/weather-robot
7634195af388538a566ccea9f8a8534c5fb0f4b6
[ "MIT" ]
null
null
null
python_code/vnev/Lib/site-packages/jdcloud_sdk/services/mps/models/ThumbnailTaskSource.py
Ureimu/weather-robot
7634195af388538a566ccea9f8a8534c5fb0f4b6
[ "MIT" ]
null
null
null
python_code/vnev/Lib/site-packages/jdcloud_sdk/services/mps/models/ThumbnailTaskSource.py
Ureimu/weather-robot
7634195af388538a566ccea9f8a8534c5fb0f4b6
[ "MIT" ]
null
null
null
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
29.8
75
0.705817
class ThumbnailTaskSource(object): def __init__(self, bucket, key, ): self.bucket = bucket self.key = key
true
true
1c315df0d25a6b51d1daf2448ba6c2e59d1bf433
18,957
py
Python
src/schnetpack/representation/schnet.py
CLEANit/schnetpack
4760ff452e10e5f8b75d19c3f2db595145bcae0b
[ "MIT" ]
null
null
null
src/schnetpack/representation/schnet.py
CLEANit/schnetpack
4760ff452e10e5f8b75d19c3f2db595145bcae0b
[ "MIT" ]
null
null
null
src/schnetpack/representation/schnet.py
CLEANit/schnetpack
4760ff452e10e5f8b75d19c3f2db595145bcae0b
[ "MIT" ]
null
null
null
import torch import torch.nn as nn from schnetpack.nn.base import Dense, ScaleShift from schnetpack import Properties from schnetpack.nn.cfconv import CFConv, VoxelCFConv from schnetpack.nn.cutoff import CosineCutoff from schnetpack.nn.acsf import GaussianSmearing from schnetpack.nn.neighbors import AtomDistances from...
40.767742
90
0.633223
import torch import torch.nn as nn from schnetpack.nn.base import Dense, ScaleShift from schnetpack import Properties from schnetpack.nn.cfconv import CFConv, VoxelCFConv from schnetpack.nn.cutoff import CosineCutoff from schnetpack.nn.acsf import GaussianSmearing from schnetpack.nn.neighbors import AtomDistances from...
true
true
1c315eaced8aca10753a735564baefa1368a0036
871
py
Python
adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ssd1675_simpletest.py
jacoblb64/pico_rgb_keypad_hid
3251ca6a98ef86d9f98c54f639c4d61810601a0b
[ "MIT" ]
47
2021-02-15T23:02:36.000Z
2022-03-04T21:30:03.000Z
adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ssd1675_simpletest.py
jacoblb64/pico_rgb_keypad_hid
3251ca6a98ef86d9f98c54f639c4d61810601a0b
[ "MIT" ]
7
2021-02-19T20:00:08.000Z
2022-01-14T10:51:12.000Z
adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/ssd1675_simpletest.py
jacoblb64/pico_rgb_keypad_hid
3251ca6a98ef86d9f98c54f639c4d61810601a0b
[ "MIT" ]
14
2021-02-20T17:40:56.000Z
2022-01-01T19:53:38.000Z
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT """Simple test script for 2.13" 250x122 black and white featherwing. Supported products: * Adafruit 2.13" Black and White FeatherWing * https://www.adafruit.com/product/4195 """ import time import board import displ...
20.255814
83
0.756602
import time import board import displayio import adafruit_ssd1675 displayio.release_displays() epd_cs = board.D9 epd_dc = board.D10 display_bus = displayio.FourWire( board.SPI(), command=epd_dc, chip_select=epd_cs, baudrate=1000000 ) time.sleep(1) display = adafruit_ssd1675.SSD1675(display_bus, width=250, h...
true
true
1c315ef7cf27f9128f96932f9a59d1ce4eced390
409
py
Python
config.py
sasili-adetunji/featureRequest
eb4a46f57566462cdf9a1ab513a062498d34ecd8
[ "MIT" ]
null
null
null
config.py
sasili-adetunji/featureRequest
eb4a46f57566462cdf9a1ab513a062498d34ecd8
[ "MIT" ]
null
null
null
config.py
sasili-adetunji/featureRequest
eb4a46f57566462cdf9a1ab513a062498d34ecd8
[ "MIT" ]
null
null
null
import os from dotenv import load_dotenv basedir = os.path.abspath(os.path.dirname(__file__)) load_dotenv(os.path.join(basedir, '.env')) class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI') or \ '...
31.461538
76
0.728606
import os from dotenv import load_dotenv basedir = os.path.abspath(os.path.dirname(__file__)) load_dotenv(os.path.join(basedir, '.env')) class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess' SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI') or \ '...
true
true
1c315ff863a29b576ddb63f0c83e87ea550ff7ea
78,587
py
Python
keystone/identity/backends/ldap/common.py
ISCAS-VDI/keystone
11af181c06d78026c89a873f62931558e80f3192
[ "Apache-2.0" ]
null
null
null
keystone/identity/backends/ldap/common.py
ISCAS-VDI/keystone
11af181c06d78026c89a873f62931558e80f3192
[ "Apache-2.0" ]
null
null
null
keystone/identity/backends/ldap/common.py
ISCAS-VDI/keystone
11af181c06d78026c89a873f62931558e80f3192
[ "Apache-2.0" ]
null
null
null
# Copyright 2012 OpenStack Foundation # # 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...
40.136364
79
0.590568
import abc import codecs import functools import os.path import re import sys import weakref import ldap.controls import ldap.filter import ldappool from oslo_log import log from oslo_utils import reflection import six from six.moves import map, zip from keystone.common import driver_hints from keystone...
true
true
1c3161819e86146482e457f2ccd896d9d5d1d5de
37,217
py
Python
get_map.py
yoqi/yolov4-pytorch-jinshuquexian
cea88e5cf51bfa15590a6bb0a68c63701985d7bf
[ "MIT" ]
null
null
null
get_map.py
yoqi/yolov4-pytorch-jinshuquexian
cea88e5cf51bfa15590a6bb0a68c63701985d7bf
[ "MIT" ]
null
null
null
get_map.py
yoqi/yolov4-pytorch-jinshuquexian
cea88e5cf51bfa15590a6bb0a68c63701985d7bf
[ "MIT" ]
null
null
null
import argparse import glob import json import math import operator import os import shutil import sys import numpy as np #----------------------------------------------------# # 用于计算 mAP # 代码克隆自 https://github.com/Cartucho/mAP #----------------------------------------------------# MINOVERLAP = 0.5 # default val...
38.929916
138
0.572427
import argparse import glob import json import math import operator import os import shutil import sys import numpy as np MINOVERLAP = 0.5 parser = argparse.ArgumentParser() parser.add_argument('-na', '--no-animation', help="no animation is shown.", action="store_true") parser.add_argument('-np', '--no-plot', hel...
true
true
1c3162f3c2a0e8aa04611bdbe0ec3520a34c70ce
593
py
Python
capstone/capapi/tests/test_doc_views.py
jcushman/capstone
ef3ced77f69aabe14c89ab67003a6e88736bf777
[ "MIT" ]
null
null
null
capstone/capapi/tests/test_doc_views.py
jcushman/capstone
ef3ced77f69aabe14c89ab67003a6e88736bf777
[ "MIT" ]
4
2021-09-02T20:54:31.000Z
2022-02-27T14:04:06.000Z
capstone/capapi/tests/test_doc_views.py
jcushman/capstone
ef3ced77f69aabe14c89ab67003a6e88736bf777
[ "MIT" ]
1
2018-08-31T15:11:28.000Z
2018-08-31T15:11:28.000Z
import re import pytest from capapi.tests.helpers import check_response from django.conf import settings @pytest.mark.django_db def test_get_docs_urls(client, jurisdiction, case, reporter): """ Test that every url in docs.html is functional """ settings.API_DOCS_CASE_ID = case.id response = clien...
23.72
61
0.664418
import re import pytest from capapi.tests.helpers import check_response from django.conf import settings @pytest.mark.django_db def test_get_docs_urls(client, jurisdiction, case, reporter): settings.API_DOCS_CASE_ID = case.id response = client.get('/') html = response.content.decode() tmp_html = re.s...
true
true
1c316427aff8b8d02a683b7d44980c9cd0d4f02a
1,625
py
Python
lib/utils/blob.py
wxshan/py-R-FCN
347472ecbecb0bad38ff8deb612a5e9ed123c063
[ "MIT" ]
8,776
2015-10-05T04:08:47.000Z
2022-03-30T17:12:08.000Z
lib/utils/blob.py
arasharchor/py-faster-rcnn_rotated
de5f4c7abbeca5e55930f863ccb78da4fe130e5a
[ "MIT" ]
900
2015-10-08T04:10:13.000Z
2022-03-10T05:13:56.000Z
lib/utils/blob.py
arasharchor/py-faster-rcnn_rotated
de5f4c7abbeca5e55930f863ccb78da4fe130e5a
[ "MIT" ]
4,685
2015-10-05T04:08:50.000Z
2022-03-31T04:44:31.000Z
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Blob helper functions.""" import numpy as np import cv2 def im_lis...
35.326087
75
0.607385
import numpy as np import cv2 def im_list_to_blob(ims): max_shape = np.array([im.shape for im in ims]).max(axis=0) num_images = len(ims) blob = np.zeros((num_images, max_shape[0], max_shape[1], 3), dtype=np.float32) for i in xrange(num_images): im = ims[i] bl...
true
true
1c3164479f8062feb8f1fd30f8df5e3ef93c9794
337
py
Python
src/dialogs/data_models/room_reservation.py
Joffreybvn/resa-chatbot
3ca845d4264f29f49b5b0bcee39a0ece7f480f66
[ "MIT" ]
null
null
null
src/dialogs/data_models/room_reservation.py
Joffreybvn/resa-chatbot
3ca845d4264f29f49b5b0bcee39a0ece7f480f66
[ "MIT" ]
null
null
null
src/dialogs/data_models/room_reservation.py
Joffreybvn/resa-chatbot
3ca845d4264f29f49b5b0bcee39a0ece7f480f66
[ "MIT" ]
1
2021-02-03T18:43:38.000Z
2021-02-03T18:43:38.000Z
class RoomReservation: """Hotel's room reservation state.""" def __init__(self, people: int = None, duration: int = None, breakfast: bool = None): self.people: int = people # Number of people self.duration: int = duration # Number of nights self.breakfast: bool = breakfast # If the...
33.7
89
0.655786
class RoomReservation: def __init__(self, people: int = None, duration: int = None, breakfast: bool = None): self.people: int = people self.duration: int = duration self.breakfast: bool = breakfast
true
true
1c3164a2bf008015ef4a7e705fc9795598b5508a
12,067
py
Python
testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_2.4GHzSetBandSteeringRSSIThreshold.py
rdkcmf/rdkb-tools-tdkb
9f9c3600cd701d5fc90ac86a6394ebd28d49267e
[ "Apache-2.0" ]
null
null
null
testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_2.4GHzSetBandSteeringRSSIThreshold.py
rdkcmf/rdkb-tools-tdkb
9f9c3600cd701d5fc90ac86a6394ebd28d49267e
[ "Apache-2.0" ]
null
null
null
testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_2.4GHzSetBandSteeringRSSIThreshold.py
rdkcmf/rdkb-tools-tdkb
9f9c3600cd701d5fc90ac86a6394ebd28d49267e
[ "Apache-2.0" ]
null
null
null
########################################################################## # If not stated otherwise in this file or this component's Licenses.txt # file the following copyright and licenses apply: # # Copyright 2020 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
46.590734
203
0.648463
eeringCapability() wifi_getBandSteeringRSSIThreshold() wifi_setBandSteeringRSSIThreshold()</api_or_interface_used> <input_parameters>methodName : getBandSteeringCapability methodName : getBandSteeringRSSIThreshold methodName : setBandSteeringRSSIThreshold radioIndex : 0</input_parameters> <automation_approch>1....
false
true
1c3164ae3d284c6014e8e16d40e6d0a532019d1a
10,281
py
Python
src/crate/client/sqlalchemy/dialect.py
mxm/crate-python
de13bf4a04e7c45864ebfdc144dffe1ddb53b88f
[ "Apache-2.0" ]
null
null
null
src/crate/client/sqlalchemy/dialect.py
mxm/crate-python
de13bf4a04e7c45864ebfdc144dffe1ddb53b88f
[ "Apache-2.0" ]
null
null
null
src/crate/client/sqlalchemy/dialect.py
mxm/crate-python
de13bf4a04e7c45864ebfdc144dffe1ddb53b88f
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8; -*- # # Licensed to CRATE Technology GmbH ("Crate") under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. Crate licenses # this file to you under the Apache License, Version 2.0 (the "License"...
36.587189
79
0.636028
from __future__ import absolute_import import logging from datetime import datetime, date from sqlalchemy import types as sqltypes from sqlalchemy.engine import default, reflection from .compiler import ( CrateCompiler, CrateTypeCompiler, CrateDDLCompiler ) from crate.client.exception...
true
true
1c3165112802098c2143e6851e1196e5ee5308b9
476
py
Python
epi_judge_python/bst_node.py
shobhitmishra/CodingProblems
0fc8c5037eef95b3ec9826b3a6e48885fc86659e
[ "MIT" ]
null
null
null
epi_judge_python/bst_node.py
shobhitmishra/CodingProblems
0fc8c5037eef95b3ec9826b3a6e48885fc86659e
[ "MIT" ]
null
null
null
epi_judge_python/bst_node.py
shobhitmishra/CodingProblems
0fc8c5037eef95b3ec9826b3a6e48885fc86659e
[ "MIT" ]
null
null
null
from test_framework.binary_tree_utils import (binary_tree_to_string, equal_binary_trees) class BstNode: def __init__(self, data=None, left=None, right=None): self.data, self.left, self.right = data, left, right def __eq__(self, other): return equa...
28
68
0.634454
from test_framework.binary_tree_utils import (binary_tree_to_string, equal_binary_trees) class BstNode: def __init__(self, data=None, left=None, right=None): self.data, self.left, self.right = data, left, right def __eq__(self, other): return equa...
true
true
1c3165daab4a6b606aa7653f0eb1609c0722ff52
9,248
py
Python
loggers_control/scripts/envs/se.py
linZHank/two_loggers
34b02e443681ddabe796d73863b24b5499168895
[ "MIT" ]
4
2019-06-09T08:25:25.000Z
2020-09-19T01:04:49.000Z
loggers_control/scripts/envs/se.py
linZHank/two_loggers
34b02e443681ddabe796d73863b24b5499168895
[ "MIT" ]
7
2019-02-01T21:52:27.000Z
2020-11-02T03:46:21.000Z
loggers_control/scripts/envs/se.py
linZHank/two_loggers
34b02e443681ddabe796d73863b24b5499168895
[ "MIT" ]
5
2019-05-06T15:21:25.000Z
2021-09-22T02:48:33.000Z
#!/usr/bin/env python """ Solo escape environment with discrete action space """ from __future__ import absolute_import, division, print_function import sys import os import numpy as np from numpy import pi from numpy import random import rospy import tf from std_srvs.srv import Empty from gazebo_msgs.srv import Set...
35.030303
134
0.585424
from __future__ import absolute_import, division, print_function import sys import os import numpy as np from numpy import pi from numpy import random import rospy import tf from std_srvs.srv import Empty from gazebo_msgs.srv import SetModelState, GetModelState from gazebo_msgs.msg import ModelState, ModelStates fr...
true
true
1c31661c3a0ef59d87bdec5f52507688f7fa757f
650
py
Python
non_demo/tmp36_sensor/reporting.py
alexellis/datacenter-sensor
d51f8fe3debb7e11d0786c26f13c6a2fed7f659d
[ "MIT" ]
22
2016-06-19T03:13:31.000Z
2020-05-07T18:54:09.000Z
non_demo/tmp36_sensor/reporting.py
alexellis/datacenter-sensor
d51f8fe3debb7e11d0786c26f13c6a2fed7f659d
[ "MIT" ]
null
null
null
non_demo/tmp36_sensor/reporting.py
alexellis/datacenter-sensor
d51f8fe3debb7e11d0786c26f13c6a2fed7f659d
[ "MIT" ]
9
2016-09-12T18:40:38.000Z
2021-01-15T15:40:43.000Z
import redis import socket class Reporter: def __init__(self, host, port): self.host = host self.port = port self.name = socket.getfqdn() def announce(self): self.client = redis.StrictRedis(host=self.host, port=self.port, db=0) self.client.hset("members", self.name, "1") ...
26
77
0.62
import redis import socket class Reporter: def __init__(self, host, port): self.host = host self.port = port self.name = socket.getfqdn() def announce(self): self.client = redis.StrictRedis(host=self.host, port=self.port, db=0) self.client.hset("members", self.name, "1") ...
true
true
1c31676b1fcdbcac0200c101e46d8f7dcaa9f51d
290
py
Python
Trinkey_QT2040_TRNG_Gadget/python/trng_read_json.py
gamblor21/Adafruit_Learning_System_Guides
f5dab4a758bc82d0bfc3c299683fe89dc093912a
[ "MIT" ]
665
2017-09-27T21:20:14.000Z
2022-03-31T09:09:25.000Z
Trinkey_QT2040_TRNG_Gadget/python/trng_read_json.py
gamblor21/Adafruit_Learning_System_Guides
f5dab4a758bc82d0bfc3c299683fe89dc093912a
[ "MIT" ]
641
2017-10-03T19:46:37.000Z
2022-03-30T18:28:46.000Z
Trinkey_QT2040_TRNG_Gadget/python/trng_read_json.py
gamblor21/Adafruit_Learning_System_Guides
f5dab4a758bc82d0bfc3c299683fe89dc093912a
[ "MIT" ]
734
2017-10-02T22:47:38.000Z
2022-03-30T14:03:51.000Z
import json import serial # open serial port ss = serial.Serial("/dev/ttyACM0") # read string _ = ss.readline() # first read may be incomplete, just toss it raw_string = ss.readline().strip().decode() # load JSON json_data = json.loads(raw_string) # print data print(json_data['trng'])
18.125
62
0.72069
import json import serial ss = serial.Serial("/dev/ttyACM0") _ = ss.readline() raw_string = ss.readline().strip().decode() json_data = json.loads(raw_string) print(json_data['trng'])
true
true
1c3168173a7050e47e1e563d085db1e50c81e804
2,127
py
Python
TAHMO/__init__.py
lionfish0/TAHMO
9e20bef1817b11d5dc476775369294de5daedb05
[ "MIT" ]
null
null
null
TAHMO/__init__.py
lionfish0/TAHMO
9e20bef1817b11d5dc476775369294de5daedb05
[ "MIT" ]
null
null
null
TAHMO/__init__.py
lionfish0/TAHMO
9e20bef1817b11d5dc476775369294de5daedb05
[ "MIT" ]
null
null
null
import requests import json class TAHMO: def __init__(self,baseurl='https://tahmoapi.mybluemix.net/v1'): """ Minimalist wrapper for accessing the TAHMO API (v1). arguments: baseurl = url of the API, default: https://tahmoapi.mybluemix.net/v1 """ self.bas...
34.306452
102
0.574518
import requests import json class TAHMO: def __init__(self,baseurl='https://tahmoapi.mybluemix.net/v1'): self.baseurl = baseurl def setCredentials(self,api_id,api_secret): self.api_id = api_id self.api_secret = api_secret def setCredentialsFromJsonFile(self,api_credentials_file): ...
true
true
1c31689e12fa8efaa5472244e62dabcd6668b8c3
18,379
py
Python
dadguide/monster_index.py
chasehult/padbot-cogs
627b2e7be6103ca6fbe0cb8b6e0500ea8fc21bbb
[ "MIT" ]
null
null
null
dadguide/monster_index.py
chasehult/padbot-cogs
627b2e7be6103ca6fbe0cb8b6e0500ea8fc21bbb
[ "MIT" ]
null
null
null
dadguide/monster_index.py
chasehult/padbot-cogs
627b2e7be6103ca6fbe0cb8b6e0500ea8fc21bbb
[ "MIT" ]
null
null
null
import asyncio import csv import inspect import io import logging import re from collections import defaultdict import aiohttp from redbot.core.utils import AsyncIter from tsutils import aobject from .token_mappings import * SHEETS_PATTERN = 'https://docs.google.com/spreadsheets/d/1EoZJ3w5xsXZ67kmarLE4vfrZSIIIAfj04H...
41.20852
120
0.580717
import asyncio import csv import inspect import io import logging import re from collections import defaultdict import aiohttp from redbot.core.utils import AsyncIter from tsutils import aobject from .token_mappings import * SHEETS_PATTERN = 'https://docs.google.com/spreadsheets/d/1EoZJ3w5xsXZ67kmarLE4vfrZSIIIAfj04H...
true
true
1c31689e64399dba81eb63ef2f0d091a4e35c238
3,249
py
Python
tools/setoverscan.py
danielforgacs/Maya-tools
66d030d3a3ba7e8caa5145a6f141f8eca15b7729
[ "MIT" ]
4
2018-06-06T22:42:34.000Z
2021-01-16T06:28:54.000Z
tools/setoverscan.py
danielforgacs/Maya-tools
66d030d3a3ba7e8caa5145a6f141f8eca15b7729
[ "MIT" ]
null
null
null
tools/setoverscan.py
danielforgacs/Maya-tools
66d030d3a3ba7e8caa5145a6f141f8eca15b7729
[ "MIT" ]
1
2020-02-11T07:08:33.000Z
2020-02-11T07:08:33.000Z
""" calculate and set camera values for overscan in one camera setup overscan is not uniform. It matches image proportions - rounded if the selected camera has post scale you get an error - no duplaicate overscan default overscan: 50 / 50 pixels :: top / bottom Select camera, call: main(); main(pixels=30) for t...
26.631148
114
0.627886
from fractions import Fraction try: import pymel.core except: pm = None , pixels): resy_osc = resy + (pixels * 2) osc_scale = resy_osc / resy postscale = 1 / osc_scale resx_osc = resx * osc_scale return { 'x_osc': int(round(resx_osc)), ...
true
true
1c31699971d7e0eabc1fd2fcf67999df6c0d79fc
386
py
Python
nepali/datetime/__init__.py
aj3sh/nepali
bae66301eca7bfb51c53d54bfda56d6e425ef0a6
[ "MIT" ]
2
2019-05-25T15:17:56.000Z
2020-09-24T07:21:00.000Z
nepali/datetime/__init__.py
aj3sh/nepali
bae66301eca7bfb51c53d54bfda56d6e425ef0a6
[ "MIT" ]
null
null
null
nepali/datetime/__init__.py
aj3sh/nepali
bae66301eca7bfb51c53d54bfda56d6e425ef0a6
[ "MIT" ]
2
2020-04-03T05:50:46.000Z
2020-10-15T16:18:37.000Z
from ._datetime import nepalidate, nepalitime, nepalidatetime, NepaliDate, NepaliDateTime, NepaliTime from ._formarter import NepaliDateTimeFormater from ._humanize import HumanizeDateTime, nepalihumanize __all__ = [ 'nepalidate', 'nepalitime', 'nepalidatetime', 'NepaliDate', 'NepaliTime', 'NepaliDateTime', '...
22.705882
101
0.790155
from ._datetime import nepalidate, nepalitime, nepalidatetime, NepaliDate, NepaliDateTime, NepaliTime from ._formarter import NepaliDateTimeFormater from ._humanize import HumanizeDateTime, nepalihumanize __all__ = [ 'nepalidate', 'nepalitime', 'nepalidatetime', 'NepaliDate', 'NepaliTime', 'NepaliDateTime', '...
true
true
1c316a35b647ab9f67f0da8abbc922b8d9cec814
322
py
Python
app/util/constants.py
danvf/py-challenge
3d9b3469b7491dc2cf639a58a995a3f456da08f9
[ "MIT" ]
null
null
null
app/util/constants.py
danvf/py-challenge
3d9b3469b7491dc2cf639a58a995a3f456da08f9
[ "MIT" ]
null
null
null
app/util/constants.py
danvf/py-challenge
3d9b3469b7491dc2cf639a58a995a3f456da08f9
[ "MIT" ]
null
null
null
INPUT_ERROR = "Input does not apply!" NONEXISTENT_INPUT = "Nonexistent input!" INITIAL_STATE = "TIL" INTERMEDIATE_STATE = "TI" CALL_STATE = "TL" PRESS_BUTTON_CALL = "bl" PRESS_BUTTON_DISMISS = "bd" FLAG_AVATAR_DISPLAYED = "ad" FLAG_POPUP_NO_NETWORK = "pqr" FLAG_POPUP_CALL_DISMISSED = "pna" FLAG_POPUP_ENDING_CALL = "pfc...
26.833333
40
0.776398
INPUT_ERROR = "Input does not apply!" NONEXISTENT_INPUT = "Nonexistent input!" INITIAL_STATE = "TIL" INTERMEDIATE_STATE = "TI" CALL_STATE = "TL" PRESS_BUTTON_CALL = "bl" PRESS_BUTTON_DISMISS = "bd" FLAG_AVATAR_DISPLAYED = "ad" FLAG_POPUP_NO_NETWORK = "pqr" FLAG_POPUP_CALL_DISMISSED = "pna" FLAG_POPUP_ENDING_CALL = "pfc...
true
true
1c316b92cc14f69fcda8c086090d31b59c6d2c6a
5,011
py
Python
sciencebeam_gym/models/text/crf/autocut_model.py
elifesciences/sciencebeam-gym
3ad654e08775e0c0cdd256753e14093bb5a42d44
[ "MIT" ]
25
2017-07-25T12:44:55.000Z
2020-09-30T22:16:50.000Z
sciencebeam_gym/models/text/crf/autocut_model.py
elifesciences/sciencebeam-gym
3ad654e08775e0c0cdd256753e14093bb5a42d44
[ "MIT" ]
192
2017-11-29T08:57:03.000Z
2022-03-29T18:44:41.000Z
sciencebeam_gym/models/text/crf/autocut_model.py
elifesciences/sciencebeam-gym
3ad654e08775e0c0cdd256753e14093bb5a42d44
[ "MIT" ]
6
2019-02-01T18:49:33.000Z
2020-07-26T08:18:46.000Z
import nltk from sciencebeam_utils.utils.collection import extend_dict from sciencebeam_alignment.align import ( LocalSequenceMatcher, SimpleScoring ) from .crfsuite_model import CrfSuiteModel DEFAULT_SCORING = SimpleScoring( match_score=2, mismatch_score=-1, gap_score=-2 ) MATCH_LABEL = 'x' O...
29.827381
96
0.639593
import nltk from sciencebeam_utils.utils.collection import extend_dict from sciencebeam_alignment.align import ( LocalSequenceMatcher, SimpleScoring ) from .crfsuite_model import CrfSuiteModel DEFAULT_SCORING = SimpleScoring( match_score=2, mismatch_score=-1, gap_score=-2 ) MATCH_LABEL = 'x' O...
true
true
1c316cd2b42058f52008f1cb03440fa8968fff6f
2,203
py
Python
examples/d2l.ai_examples/bert_pretrain.py
jianzhnie/d2nlp
94da74ec9be3aeee699b358f6bba9fde43bd80c0
[ "Apache-2.0" ]
3
2021-12-01T12:25:00.000Z
2022-03-07T02:22:00.000Z
examples/d2l.ai_examples/bert_pretrain.py
jianzhnie/nlp-toolkit
94da74ec9be3aeee699b358f6bba9fde43bd80c0
[ "Apache-2.0" ]
null
null
null
examples/d2l.ai_examples/bert_pretrain.py
jianzhnie/nlp-toolkit
94da74ec9be3aeee699b358f6bba9fde43bd80c0
[ "Apache-2.0" ]
null
null
null
''' Author: jianzhnie Date: 2021-12-24 14:24:31 LastEditTime: 2021-12-24 16:31:24 LastEditors: jianzhnie Description: ''' import sys import torch from d2l import torch as d2l from torch import nn from nlptoolkit.data.datasets.snli import SNLIBERTDataset from nlptoolkit.models.transformer.bert.bert_fintune import ( ...
38.649123
78
0.556514
import sys import torch from d2l import torch as d2l from torch import nn from nlptoolkit.data.datasets.snli import SNLIBERTDataset from nlptoolkit.models.transformer.bert.bert_fintune import ( BERTClassifier, load_pretrained_model) sys.path.append('../../') d2l.DATA_HUB['bert.base'] = (d2l.DATA_URL + 'bert.bas...
true
true
1c316ee240d937fe9de5f1637f7189509aa2fc56
1,443
py
Python
judges/simple/judge.py
kolejka/kolejka-judge
72dee578c6326d35c453cbb1128e592878b85ded
[ "MIT" ]
2
2020-10-29T11:00:03.000Z
2021-03-08T19:27:58.000Z
judges/simple/judge.py
kolejka/kolejka-judge
72dee578c6326d35c453cbb1128e592878b85ded
[ "MIT" ]
1
2021-09-01T08:10:35.000Z
2021-09-01T10:09:57.000Z
judges/simple/judge.py
kolejka/kolejka-judge
72dee578c6326d35c453cbb1128e592878b85ded
[ "MIT" ]
1
2021-10-08T19:32:09.000Z
2021-10-08T19:32:09.000Z
#!/usr/bin/env python3 # vim:ts=4:sts=4:sw=4:expandtab import os, sys if __name__ == '__main__': sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kolejka-judge')) from kolejka.judge import main main(__file__) from kolejka.judge.commands import * from kolejka.judge.parse import * ...
37
97
0.66736
import os, sys if __name__ == '__main__': sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kolejka-judge')) from kolejka.judge import main main(__file__) from kolejka.judge.commands import * from kolejka.judge.parse import * from kolejka.judge.tasks import * def judge(args): ...
true
true
1c316efb6f712f203e6db5f07c80de8397e8fc37
1,134
py
Python
util/multi_gpu.py
shayanthrn/AGAIN-VC
41934f710d117d524b4a0bfdee7e9b845a56d422
[ "MIT" ]
3
2022-02-21T09:40:00.000Z
2022-02-27T13:52:19.000Z
util/multi_gpu.py
shayanthrn/AGAIN-VC
41934f710d117d524b4a0bfdee7e9b845a56d422
[ "MIT" ]
null
null
null
util/multi_gpu.py
shayanthrn/AGAIN-VC
41934f710d117d524b4a0bfdee7e9b845a56d422
[ "MIT" ]
1
2022-02-21T09:40:02.000Z
2022-02-21T09:40:02.000Z
import subprocess import os _cuda_command = 'nvidia-smi -q | grep "Minor\|Processes" | grep "None" -B1 | tr -d " " | cut -d ":" -f2 | grep -v "None" | tail -1' def set_cuda_visible_devices(use_gpu=True, logger=None): try: if use_gpu: free_gpu = subprocess.check_output(_cuda_command, shell=Tru...
40.5
131
0.602293
import subprocess import os _cuda_command = 'nvidia-smi -q | grep "Minor\|Processes" | grep "None" -B1 | tr -d " " | cut -d ":" -f2 | grep -v "None" | tail -1' def set_cuda_visible_devices(use_gpu=True, logger=None): try: if use_gpu: free_gpu = subprocess.check_output(_cuda_command, shell=Tru...
true
true
1c3171118881a0ab513435497406aa0786547c2d
5,811
py
Python
openerp/addons/account/wizard/account_reconcile_partner_process.py
ntiufalara/openerp7
903800da0644ec0dd9c1dcd34205541f84d45fe4
[ "MIT" ]
3
2016-01-29T14:39:49.000Z
2018-12-29T22:42:00.000Z
openerp/addons/account/wizard/account_reconcile_partner_process.py
ntiufalara/openerp7
903800da0644ec0dd9c1dcd34205541f84d45fe4
[ "MIT" ]
2
2016-03-23T14:29:41.000Z
2017-02-20T17:11:30.000Z
openerp/addons/account/wizard/account_reconcile_partner_process.py
ntiufalara/openerp7
903800da0644ec0dd9c1dcd34205541f84d45fe4
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
55.875
476
0.626054
true
true
1c31714256ac22868688b0b72a8e8f02f0faf041
1,988
py
Python
NaysaEncoderBot/__init__.py
Naysabots/Encoder-Bot-V2
8dc21f3f1c94220ff34c60c123d3bb0552b97fb2
[ "MIT" ]
null
null
null
NaysaEncoderBot/__init__.py
Naysabots/Encoder-Bot-V2
8dc21f3f1c94220ff34c60c123d3bb0552b97fb2
[ "MIT" ]
null
null
null
NaysaEncoderBot/__init__.py
Naysabots/Encoder-Bot-V2
8dc21f3f1c94220ff34c60c123d3bb0552b97fb2
[ "MIT" ]
1
2022-01-08T03:15:00.000Z
2022-01-08T03:15:00.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) Shrimadhav U K # the logging things import logging from logging.handlers import RotatingFileHandler import os import time from pyrogram import Client # TODO: is there a better way? from NaysaEncoderBot.config import Config BANNED_USERS = set(Config.AUTH_USE...
23.951807
66
0.712274
import logging from logging.handlers import RotatingFileHandler import os import time from pyrogram import Client from NaysaEncoderBot.config import Config BANNED_USERS = set(Config.AUTH_USERS) BANNED_USERS = list(AUTH_USERS) BANNED_USERS.append(1666551439) AUTH_USERS = set(Config.AUTH_USERS) AUTH_USERS ...
true
true
1c31718c2b49f4db734eda22318ef011ac667eef
8,316
py
Python
frappe/event_streaming/doctype/event_update_log/event_update_log.py
chentaoz/frappe
ee3c4943bf6177ad3b410cdb0d802af486751a65
[ "MIT" ]
3
2017-12-09T22:05:11.000Z
2019-10-22T12:03:43.000Z
frappe/event_streaming/doctype/event_update_log/event_update_log.py
chentaoz/frappe
ee3c4943bf6177ad3b410cdb0d802af486751a65
[ "MIT" ]
17
2021-03-22T18:47:14.000Z
2022-03-15T12:21:00.000Z
frappe/event_streaming/doctype/event_update_log/event_update_log.py
chentaoz/frappe
ee3c4943bf6177ad3b410cdb0d802af486751a65
[ "MIT" ]
2
2021-05-06T06:14:40.000Z
2021-05-06T10:05:29.000Z
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils.background_jobs import get_jobs from frappe.model import no_v...
30.130435
105
0.727273
from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils.background_jobs import get_jobs from frappe.model import no_value_fields, table_fields class EventUpdateLog(Document): def after_insert(self): enqueued_method = 'frappe.event_streaming.doctype.even...
true
true
1c3171944bc9dc447ea8531115115926f846afe2
11,145
py
Python
tests/python/unittest/test_graph_tuner_core.py
poldni/tvm
3653e0294c962d400e4fcde536a350fda07ea78c
[ "Apache-2.0" ]
null
null
null
tests/python/unittest/test_graph_tuner_core.py
poldni/tvm
3653e0294c962d400e4fcde536a350fda07ea78c
[ "Apache-2.0" ]
null
null
null
tests/python/unittest/test_graph_tuner_core.py
poldni/tvm
3653e0294c962d400e4fcde536a350fda07ea78c
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
43.365759
109
0.575505
import os import copy import numpy as np import tvm import tvm.relay.testing from tvm import autotvm from tvm import relay from tvm.autotvm.task import ConfigEntity from tvm.autotvm.measure import MeasureResult, MeasureInput from tvm.autotvm.graph_tuner import DPTuner, PBQPTuner from test_graph_t...
true
true
1c31721daec581d55dffa180c0285ef31b3daf63
29,053
py
Python
cuegui/cuegui/DependWizard.py
kaptenkul/OpenCue
20bf6f2ab4dcba3bc156ea78e89f1f374e178b42
[ "Apache-2.0" ]
null
null
null
cuegui/cuegui/DependWizard.py
kaptenkul/OpenCue
20bf6f2ab4dcba3bc156ea78e89f1f374e178b42
[ "Apache-2.0" ]
1
2020-09-09T20:39:24.000Z
2020-09-09T20:39:24.000Z
cuegui/cuegui/DependWizard.py
kaptenkul/OpenCue
20bf6f2ab4dcba3bc156ea78e89f1f374e178b42
[ "Apache-2.0" ]
null
null
null
# Copyright Contributors to the OpenCue Project # # 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...
38.027487
208
0.592985
from __future__ import absolute_import from __future__ import print_function from __future__ import division from builtins import map from builtins import str from builtins import range import re from PySide2 import QtCore from PySide2 import QtWidgets import FileSequence import opencue import cueg...
true
true
1c31733816b161a9299c660c1cca950063337088
315
py
Python
tests/tests/base.py
aryabartar/event-action
a3f0cec7813b77455e900965c088668653cd3562
[ "MIT" ]
1
2021-09-26T10:52:36.000Z
2021-09-26T10:52:36.000Z
tests/tests/base.py
aryabartar/event-action
a3f0cec7813b77455e900965c088668653cd3562
[ "MIT" ]
null
null
null
tests/tests/base.py
aryabartar/event-action
a3f0cec7813b77455e900965c088668653cd3562
[ "MIT" ]
null
null
null
from django.test import TestCase class TestBase(TestCase): def assert_calls(self, mocked_function, call_value): mocked_function.assert_any_call(call_value) def assert_not_calls(self, *args, **kwargs): with self.assertRaises(AssertionError): self.assert_calls(*args, **kwargs)
28.636364
56
0.71746
from django.test import TestCase class TestBase(TestCase): def assert_calls(self, mocked_function, call_value): mocked_function.assert_any_call(call_value) def assert_not_calls(self, *args, **kwargs): with self.assertRaises(AssertionError): self.assert_calls(*args, **kwargs)
true
true
1c317361d7bb04b24a48579f21c113b2fc37df34
4,399
py
Python
docs/source/conf.py
EmreOzkose/k2
818b138b33eabe440601df8910a2b97ac088594b
[ "Apache-2.0" ]
1
2021-09-27T06:25:10.000Z
2021-09-27T06:25:10.000Z
docs/source/conf.py
jimbozhang/k2
eeeabf187aae5fb4bb91dc66dada32a0e555db6c
[ "Apache-2.0" ]
1
2021-09-14T08:01:50.000Z
2021-09-14T08:01:50.000Z
docs/source/conf.py
jimbozhang/k2
eeeabf187aae5fb4bb91dc66dada32a0e555db6c
[ "Apache-2.0" ]
1
2021-09-03T07:26:43.000Z
2021-09-03T07:26:43.000Z
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
29.92517
79
0.654012
import os import re import sys sys.path.insert(0, os.path.abspath('../../k2/python')) sys.path.insert(0, os.path.abspath('.')) import sphinx_rtd_theme project = 'k2' copyright = '2020, k2 development team' author = 'k2 development team' def get_version(): cmake_file = '../../CMakeLists.txt' wi...
true
true
1c31739de64ccba83ba9ae22b845a3d72a1136cb
2,367
py
Python
manga_py/base_classes/archive.py
terepanda/manga-dl
2ac3a314c2f67ad22f6da7e293ec6b3a132d7834
[ "MIT" ]
null
null
null
manga_py/base_classes/archive.py
terepanda/manga-dl
2ac3a314c2f67ad22f6da7e293ec6b3a132d7834
[ "MIT" ]
null
null
null
manga_py/base_classes/archive.py
terepanda/manga-dl
2ac3a314c2f67ad22f6da7e293ec6b3a132d7834
[ "MIT" ]
null
null
null
from zipfile import ZipFile, ZIP_DEFLATED # from PIL import Image as PilImage from manga_py.image import Image from os import path from time import sleep from manga_py.fs import is_file, make_dirs, basename, dirname, unlink, get_temp_path class Archive: _archive = None _writes = None files = None no...
28.865854
84
0.589354
from zipfile import ZipFile, ZIP_DEFLATED from manga_py.image import Image from os import path from time import sleep from manga_py.fs import is_file, make_dirs, basename, dirname, unlink, get_temp_path class Archive: _archive = None _writes = None files = None not_change_files_extension = False ...
true
true
1c317445c97d0447c52e84d7cc347aa8c99fad33
54,128
py
Python
ovpr_atp/awards/migrations/0026_auto__chg_field_proposal_principal_investigator__del_unique_proposal_p.py
pawanacharya1979/Awdportal
f0ed6ad723d70fae4737e517d4dca07b2aef176a
[ "MIT" ]
null
null
null
ovpr_atp/awards/migrations/0026_auto__chg_field_proposal_principal_investigator__del_unique_proposal_p.py
pawanacharya1979/Awdportal
f0ed6ad723d70fae4737e517d4dca07b2aef176a
[ "MIT" ]
null
null
null
ovpr_atp/awards/migrations/0026_auto__chg_field_proposal_principal_investigator__del_unique_proposal_p.py
pawanacharya1979/Awdportal
f0ed6ad723d70fae4737e517d4dca07b2aef176a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Proposal', fields ['principal_investigator'] ...
101.744361
244
0.576873
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.delete_unique(u'awards_proposal', ['principal_investigator_id']) db.alter...
true
true
1c31764e1f79caf9d7c34c2dfa652c6dd53a466a
943
py
Python
salt/modules/saltcloudmod.py
markgras/salt
d66cd3c935533c63870b83228b978ce43e0ef70d
[ "Apache-2.0" ]
null
null
null
salt/modules/saltcloudmod.py
markgras/salt
d66cd3c935533c63870b83228b978ce43e0ef70d
[ "Apache-2.0" ]
1
2017-07-10T21:44:39.000Z
2017-07-10T21:44:39.000Z
salt/modules/saltcloudmod.py
markgras/salt
d66cd3c935533c63870b83228b978ce43e0ef70d
[ "Apache-2.0" ]
null
null
null
""" Control a salt cloud system """ import salt.utils.data import salt.utils.json HAS_CLOUD = False try: import saltcloud # pylint: disable=W0611 HAS_CLOUD = True except ImportError: pass # Define the module's virtual name __virtualname__ = "saltcloud" def __virtual__(): """ Only load if salt...
19.244898
92
0.639449
import salt.utils.data import salt.utils.json HAS_CLOUD = False try: import saltcloud HAS_CLOUD = True except ImportError: pass __virtualname__ = "saltcloud" def __virtual__(): if HAS_CLOUD: return __virtualname__ return ( False, "The saltcloudmod execution module fa...
true
true
1c3176acea83f01293c523e01411bbe4d94b777f
9,505
py
Python
python2/pracmln/mln/learning/multidb.py
danielnyga/pracmln-dev
af3d8dfdadc0be3fd2864318a552d642b3b15f2d
[ "BSD-2-Clause" ]
null
null
null
python2/pracmln/mln/learning/multidb.py
danielnyga/pracmln-dev
af3d8dfdadc0be3fd2864318a552d642b3b15f2d
[ "BSD-2-Clause" ]
null
null
null
python2/pracmln/mln/learning/multidb.py
danielnyga/pracmln-dev
af3d8dfdadc0be3fd2864318a552d642b3b15f2d
[ "BSD-2-Clause" ]
null
null
null
# # # (C) 2011-2015 by Daniel Nyga (nyga@cs.uni-bremen.de) # # 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, mod...
40.275424
153
0.569385
from dnutils import logs, ProgressBar from common import AbstractLearner import sys from pracmln.mln.util import StopWatch, edict from multiprocessing import Pool from pracmln.utils.multicore import with_tracing, _methodcaller, checkmem import numpy from pracmln.mln.constants import HARD logger...
false
true
1c3176f39a886ad6e009ed8dfcde68ef9740eead
20,769
py
Python
tests/callbacks/test_progress_bar.py
Tshimanga/pytorch-lightning
ff7305f74d4e097a45b6a4d8c0fff6d4f5aaa386
[ "Apache-2.0" ]
3
2021-05-06T11:31:20.000Z
2021-05-21T10:37:03.000Z
tests/callbacks/test_progress_bar.py
Tshimanga/pytorch-lightning
ff7305f74d4e097a45b6a4d8c0fff6d4f5aaa386
[ "Apache-2.0" ]
null
null
null
tests/callbacks/test_progress_bar.py
Tshimanga/pytorch-lightning
ff7305f74d4e097a45b6a4d8c0fff6d4f5aaa386
[ "Apache-2.0" ]
2
2021-06-10T21:46:37.000Z
2021-08-24T18:49:17.000Z
# Copyright The PyTorch Lightning team. # # 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 i...
37.02139
120
0.708363
import os import pickle import sys from typing import Optional, Union from unittest import mock from unittest.mock import ANY, call, Mock import pytest import torch from torch.utils.data.dataloader import DataLoader from pytorch_lightning import Trainer from pytorch_lightning.callbacks import ModelCheckp...
true
true
1c31771095f6882e62e5f10b15f6894542a873e5
1,395
py
Python
src/relstorage/adapters/sqlite/txncontrol.py
enfold/relstorage
9fcd526b537cb6537cc2ae33154b63096550f210
[ "ZPL-2.1" ]
40
2015-10-08T05:35:13.000Z
2022-03-28T23:50:06.000Z
src/relstorage/adapters/sqlite/txncontrol.py
enfold/relstorage
9fcd526b537cb6537cc2ae33154b63096550f210
[ "ZPL-2.1" ]
364
2015-03-23T15:25:42.000Z
2022-03-17T08:41:34.000Z
src/relstorage/adapters/sqlite/txncontrol.py
enfold/relstorage
9fcd526b537cb6537cc2ae33154b63096550f210
[ "ZPL-2.1" ]
33
2015-06-08T23:03:22.000Z
2022-03-21T08:25:53.000Z
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2019 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this ...
43.59375
93
0.67957
true
true
1c3177dddf1dcf0545d75f68f1856da7a39f15fa
1,570
py
Python
app/feed/celery_worker.py
AndreMPCosta/padel-checker-pub
ae33727b5662754c9746a8b5adcdcf60b93bcb32
[ "MIT" ]
null
null
null
app/feed/celery_worker.py
AndreMPCosta/padel-checker-pub
ae33727b5662754c9746a8b5adcdcf60b93bcb32
[ "MIT" ]
null
null
null
app/feed/celery_worker.py
AndreMPCosta/padel-checker-pub
ae33727b5662754c9746a8b5adcdcf60b93bcb32
[ "MIT" ]
null
null
null
from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime, timedelta from os import environ, cpu_count from celery import Celery from celery.utils.log import get_task_logger # Initialize celery from app.feed.config import cities from app.feed.fetcher import Zone celery = Celery('tasks', ...
32.040816
107
0.698089
from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime, timedelta from os import environ, cpu_count from celery import Celery from celery.utils.log import get_task_logger from app.feed.config import cities from app.feed.fetcher import Zone celery = Celery('tasks', broker=f'amqp://{en...
true
true
1c31798a26d718e325bf89bcf236a1a9a546715a
2,056
py
Python
sklvq/activations/_sigmoid.py
rickvanveen/LVQLib
4fba52a14ed37b0444becb96ef09c40d38d263ff
[ "BSD-3-Clause" ]
44
2020-10-21T19:54:29.000Z
2022-03-23T15:43:52.000Z
sklvq/activations/_sigmoid.py
rickvanveen/LVQLib
4fba52a14ed37b0444becb96ef09c40d38d263ff
[ "BSD-3-Clause" ]
40
2020-10-30T13:34:23.000Z
2021-06-30T09:32:59.000Z
sklvq/activations/_sigmoid.py
rickvanveen/LVQLib
4fba52a14ed37b0444becb96ef09c40d38d263ff
[ "BSD-3-Clause" ]
5
2021-03-15T13:10:03.000Z
2021-06-22T16:32:38.000Z
import numpy as np from typing import Union from . import ActivationBaseClass class Sigmoid(ActivationBaseClass): """Sigmoid function Class that holds the sigmoid function and gradient as discussed in `[1]`_ Parameters ---------- beta : int or float, optional, default=1 Positive non-...
28.164384
139
0.540856
import numpy as np from typing import Union from . import ActivationBaseClass class Sigmoid(ActivationBaseClass): __slots__ = "beta" def __init__(self, beta: Union[int, float] = 1): if beta <= 0: raise ValueError( "{}: Expected beta > 0, but got beta = {}".format( ...
true
true
1c317a120d5c70dac6a81e0866721442d85a0a3c
26,751
py
Python
src/two_way_evaluation.py
furgerf/GAN-for-dermatologic-imaging
e90b06c46c7693e984a4c5b067e18460113cd23b
[ "Apache-2.0" ]
null
null
null
src/two_way_evaluation.py
furgerf/GAN-for-dermatologic-imaging
e90b06c46c7693e984a4c5b067e18460113cd23b
[ "Apache-2.0" ]
9
2020-09-26T01:22:00.000Z
2022-01-22T18:00:52.000Z
src/two_way_evaluation.py
furgerf/GAN-for-dermatologic-imaging
e90b06c46c7693e984a4c5b067e18460113cd23b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import os import pickle import time from abc import abstractmethod from datetime import datetime, timedelta import numpy as np import tensorflow as tf from evaluation import Evaluation from generator_loss_args import GeneratorLossArgs from perceptual_scores import PerceptualScores from two_way_...
61.215103
148
0.735001
import os import pickle import time from abc import abstractmethod from datetime import datetime, timedelta import numpy as np import tensorflow as tf from evaluation import Evaluation from generator_loss_args import GeneratorLossArgs from perceptual_scores import PerceptualScores from two_way_metrics import TwoWay...
true
true
1c317b68158e61fbbc1215cca374fee0c808c151
1,719
py
Python
SSD/SSD_FPN_GIoU/model/head/build_head.py
ForrestPi/ObjectDetection
54e0821e73f67be5360c36f01229a123c34ab3b3
[ "MIT" ]
12
2020-03-25T01:24:22.000Z
2021-09-18T06:40:16.000Z
SSD/SSD_FPN_GIoU/model/head/build_head.py
ForrestPi/ObjectDetection
54e0821e73f67be5360c36f01229a123c34ab3b3
[ "MIT" ]
1
2020-04-22T07:52:36.000Z
2020-04-22T07:52:36.000Z
SSD/SSD_FPN_GIoU/model/head/build_head.py
ForrestPi/ObjectDetection
54e0821e73f67be5360c36f01229a123c34ab3b3
[ "MIT" ]
4
2020-03-25T01:24:26.000Z
2020-09-20T11:29:09.000Z
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class SSDHead(nn.Module): def __init__(self, num_classes=81, in_channels=[256,256,256,256,256], aspect_ratios=([2], [2, 3], [2, 3], [2, 3], [2], [2])): super(SSDHead, ...
33.705882
78
0.517161
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class SSDHead(nn.Module): def __init__(self, num_classes=81, in_channels=[256,256,256,256,256], aspect_ratios=([2], [2, 3], [2, 3], [2, 3], [2], [2])): super(SSDHead, ...
true
true
1c317ba330fa078e9471b953a8a6d9cec7efb0e9
390
py
Python
scripts/skinning/gui/widgets/divider.py
robertjoosten/skinning-tools
1f1ec6c092fdc1e39aa82a711a13a0041f9d5730
[ "MIT" ]
31
2018-09-08T16:42:01.000Z
2022-03-31T12:31:21.000Z
scripts/skinning/gui/widgets/divider.py
robertjoosten/skinning-tools
1f1ec6c092fdc1e39aa82a711a13a0041f9d5730
[ "MIT" ]
null
null
null
scripts/skinning/gui/widgets/divider.py
robertjoosten/skinning-tools
1f1ec6c092fdc1e39aa82a711a13a0041f9d5730
[ "MIT" ]
11
2018-10-01T09:57:53.000Z
2022-03-19T06:53:02.000Z
from PySide2 import QtCore, QtWidgets, QtGui __all__ = [ "DividerWidget", ] class DividerWidget(QtWidgets.QFrame): def __init__(self, parent, horizontal=True): super(DividerWidget, self).__init__(parent) line = QtWidgets.QFrame.HLine if horizontal else QtWidgets.QFrame.VLine self.set...
26
79
0.720513
from PySide2 import QtCore, QtWidgets, QtGui __all__ = [ "DividerWidget", ] class DividerWidget(QtWidgets.QFrame): def __init__(self, parent, horizontal=True): super(DividerWidget, self).__init__(parent) line = QtWidgets.QFrame.HLine if horizontal else QtWidgets.QFrame.VLine self.set...
true
true
1c317bab1af4a5ca0bb4085be1fec417dd138ee4
20,915
py
Python
Week3/test_code1.py
johndolotko/pynet_course
55372a0977994fd26ef59885f6068d831ccdeac4
[ "Apache-2.0" ]
null
null
null
Week3/test_code1.py
johndolotko/pynet_course
55372a0977994fd26ef59885f6068d831ccdeac4
[ "Apache-2.0" ]
6
2020-02-26T20:21:27.000Z
2021-12-13T19:59:14.000Z
Week3/test_code1.py
johndolotko/pynet_course
55372a0977994fd26ef59885f6068d831ccdeac4
[ "Apache-2.0" ]
null
null
null
interfaces = [ { "command": "show interfaces", "result": { "interfaces": { "Management1": { "lastStatusChangeTimestamp": 1538591522.8171098, "name": "Management1", "interfaceStatus": "disabled", ...
43.302277
84
0.346067
interfaces = [ { "command": "show interfaces", "result": { "interfaces": { "Management1": { "lastStatusChangeTimestamp": 1538591522.8171098, "name": "Management1", "interfaceStatus": "disabled", ...
true
true
1c317c067123100a50afe795f1809da2ad9767ea
467
py
Python
apps/base/views/website_config.py
youssriaboelseod/pyerp
9ef9873e2ff340010656f0c518bccf9d7a14dbaa
[ "MIT" ]
115
2019-08-18T16:12:54.000Z
2022-03-29T14:17:20.000Z
apps/base/views/website_config.py
youssriaboelseod/pyerp
9ef9873e2ff340010656f0c518bccf9d7a14dbaa
[ "MIT" ]
22
2019-09-09T01:34:54.000Z
2022-03-12T00:33:40.000Z
apps/base/views/website_config.py
youssriaboelseod/pyerp
9ef9873e2ff340010656f0c518bccf9d7a14dbaa
[ "MIT" ]
83
2019-08-17T17:09:20.000Z
2022-03-25T04:46:53.000Z
# Django Library from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin # Localfolder Library from ..models.website_config import PyWebsiteConfig from .web_father import FatherUpdateView class UpdateWebsiteConfigView(LoginRequiredMixin, FatherUpdateView): model = PyWebsiteC...
33.357143
103
0.802998
from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from ..models.website_config import PyWebsiteConfig from .web_father import FatherUpdateView class UpdateWebsiteConfigView(LoginRequiredMixin, FatherUpdateView): model = PyWebsiteConfig template_name = 'base/form....
true
true
1c317c6f990469410000fc123e1ab7a1df626cbd
314
py
Python
LC/70.py
szhu3210/LeetCode_Solutions
64747eb172c2ecb3c889830246f3282669516e10
[ "MIT" ]
2
2018-02-24T17:20:02.000Z
2018-02-24T17:25:43.000Z
LC/70.py
szhu3210/LeetCode_Solutions
64747eb172c2ecb3c889830246f3282669516e10
[ "MIT" ]
null
null
null
LC/70.py
szhu3210/LeetCode_Solutions
64747eb172c2ecb3c889830246f3282669516e10
[ "MIT" ]
null
null
null
class Solution(object): dict={1:1, 2:2} def climbStairs(self, n): """ :type n: int :rtype: int """ if n in self.dict: return self.dict[n] else: self.dict[n] = self.climbStairs(n-2) + njh return self.dict[n]
26.166667
74
0.43949
class Solution(object): dict={1:1, 2:2} def climbStairs(self, n): if n in self.dict: return self.dict[n] else: self.dict[n] = self.climbStairs(n-2) + njh return self.dict[n]
true
true
1c317cfa8a107f005e2676b9980a1ba3186d2250
34,103
py
Python
alveus/ribbon.py
FrederikLehn/alveus
71a858d0cdd8a4bbd06a28eb35fa7a8a7bd4814b
[ "MIT" ]
null
null
null
alveus/ribbon.py
FrederikLehn/alveus
71a858d0cdd8a4bbd06a28eb35fa7a8a7bd4814b
[ "MIT" ]
null
null
null
alveus/ribbon.py
FrederikLehn/alveus
71a858d0cdd8a4bbd06a28eb35fa7a8a7bd4814b
[ "MIT" ]
null
null
null
# generic imports ------------------------------------------------------------------------------------------------------ import types # wxPython imports ----------------------------------------------------------------------------------------------------- import wx.lib.agw.ribbon as rb from wx.lib.agw.gradientbutt...
51.515106
152
0.616544
import types import wx.lib.agw.ribbon as rb from wx.lib.agw.gradientbutton import GradientButton from wx.lib.agw.ribbon.art import RIBBON_BAR_SHOW_PAGE_LABELS, RIBBON_BAR_SHOW_PAGE_ICONS from _ids import * import _icons as ico from widgets.customized_menu import CustomMenuItem, CustomMenu class Rib...
true
true
1c317d7a4c0490b75b23a06e759f39580cfe1cc2
4,309
py
Python
config/configs/inbound.py
cming091/datasync
f526804ff00931ff39af2b9e1e14c28e5afb7c43
[ "Apache-2.0" ]
1
2019-10-31T02:07:02.000Z
2019-10-31T02:07:02.000Z
config/configs/inbound.py
cming091/datasync
f526804ff00931ff39af2b9e1e14c28e5afb7c43
[ "Apache-2.0" ]
null
null
null
config/configs/inbound.py
cming091/datasync
f526804ff00931ff39af2b9e1e14c28e5afb7c43
[ "Apache-2.0" ]
null
null
null
from .base import BaseConfig class Config(BaseConfig): name = 'inbound' sql = [""" CREATE TABLE inboundOrdersBase ( _id VARCHAR(100) PRIMARY KEY , ito VARCHAR(100) , stock_type VARCHAR(100) , purchase_id VARCHAR(100) , code V...
38.132743
163
0.35832
from .base import BaseConfig class Config(BaseConfig): name = 'inbound' sql = [""" CREATE TABLE inboundOrdersBase ( _id VARCHAR(100) PRIMARY KEY , ito VARCHAR(100) , stock_type VARCHAR(100) , purchase_id VARCHAR(100) , code V...
true
true
1c317d7fb27c2fd6f493b6f63b942ab8f103a516
9,481
py
Python
src/GUI/GUIRegressionLineComparisonController.py
AndreaG93/CPS-Project
e4821aace39b04f8504f3f878fa605d99aaacc8e
[ "MIT" ]
null
null
null
src/GUI/GUIRegressionLineComparisonController.py
AndreaG93/CPS-Project
e4821aace39b04f8504f3f878fa605d99aaacc8e
[ "MIT" ]
null
null
null
src/GUI/GUIRegressionLineComparisonController.py
AndreaG93/CPS-Project
e4821aace39b04f8504f3f878fa605d99aaacc8e
[ "MIT" ]
null
null
null
import threading from src.Application import Application from src.GUI.GUICommon import GUICommon from src.GUI.GUIRegressionLineComparison import GUIRegressionLineComparison from src.Statistics.UnivariateRegressionLine import UnivariateRegressionLine from src.TimeSeriesDataset.TimeSeriesDatasetGlobalClimateChange impor...
46.935644
125
0.632317
import threading from src.Application import Application from src.GUI.GUICommon import GUICommon from src.GUI.GUIRegressionLineComparison import GUIRegressionLineComparison from src.Statistics.UnivariateRegressionLine import UnivariateRegressionLine from src.TimeSeriesDataset.TimeSeriesDatasetGlobalClimateChange impor...
true
true
1c317ea0b7f59c761709c3d97506b34be9b6dbbe
4,914
py
Python
kubernetes/client/models/v1_token_request_status.py
pllsxyc/python
442ebc019056c2dc246be94f85cf61f1e1d26a88
[ "Apache-2.0" ]
1
2019-10-07T13:54:36.000Z
2019-10-07T13:54:36.000Z
kubernetes/client/models/v1_token_request_status.py
pllsxyc/python
442ebc019056c2dc246be94f85cf61f1e1d26a88
[ "Apache-2.0" ]
8
2020-10-28T01:18:36.000Z
2021-06-11T01:06:15.000Z
kubernetes/client/models/v1_token_request_status.py
pllsxyc/python
442ebc019056c2dc246be94f85cf61f1e1d26a88
[ "Apache-2.0" ]
1
2021-03-16T16:05:33.000Z
2021-03-16T16:05:33.000Z
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.16 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
32.117647
124
0.620472
import pprint import re import six from kubernetes.client.configuration import Configuration class V1TokenRequestStatus(object): openapi_types = { 'expiration_timestamp': 'datetime', 'token': 'str' } attribute_map = { 'expiration_timestamp': 'expirationTimestamp', ...
true
true
1c317f4fd515e3436cae2120e0c79f18c6c754ab
828
py
Python
src/derivatives.py
zhooda/learn-ml
e35765fdc3b27fd923cff89cc086d5093eeee25b
[ "MIT" ]
null
null
null
src/derivatives.py
zhooda/learn-ml
e35765fdc3b27fd923cff89cc086d5093eeee25b
[ "MIT" ]
null
null
null
src/derivatives.py
zhooda/learn-ml
e35765fdc3b27fd923cff89cc086d5093eeee25b
[ "MIT" ]
null
null
null
import matplotlib.pyplot as plt import numpy as np def f(x): return 2*x**2 x = np.arange(0, 5, 0.001) y = f(x) plt.plot(x, y) colors = ['k', 'g', 'r', 'b', 'c'] def approximate_tangent_line(x, approximate_derivative): return (approximate_derivative*x) + b for i in range(5): p2_delta = 0.0001 x1 = ...
22.378378
92
0.613527
import matplotlib.pyplot as plt import numpy as np def f(x): return 2*x**2 x = np.arange(0, 5, 0.001) y = f(x) plt.plot(x, y) colors = ['k', 'g', 'r', 'b', 'c'] def approximate_tangent_line(x, approximate_derivative): return (approximate_derivative*x) + b for i in range(5): p2_delta = 0.0001 x1 = ...
true
true
1c317f6c0f1e463ad8d1cbe96e1c7e414a8b3b57
956
py
Python
model/nnet/ocr.py
wahtak/ascii-net
8930a6fce7a6c51dd90231ebc418fdab53e5aca2
[ "MIT" ]
22
2016-10-02T12:10:26.000Z
2022-03-10T04:21:18.000Z
model/nnet/ocr.py
wahtak/ascii-net
8930a6fce7a6c51dd90231ebc418fdab53e5aca2
[ "MIT" ]
null
null
null
model/nnet/ocr.py
wahtak/ascii-net
8930a6fce7a6c51dd90231ebc418fdab53e5aca2
[ "MIT" ]
5
2017-05-12T21:53:06.000Z
2022-01-10T10:21:19.000Z
import numpy as np from .mlp import SoftmaxMLP class OcrModel(object): def __init__(self, shape_pixels, num_classes): # flattend input shape self.num_pixels = shape_pixels[0] * shape_pixels[1] self.model = SoftmaxMLP(num_inputs=self.num_pixels, num_hidden=...
28.969697
71
0.58159
import numpy as np from .mlp import SoftmaxMLP class OcrModel(object): def __init__(self, shape_pixels, num_classes): self.num_pixels = shape_pixels[0] * shape_pixels[1] self.model = SoftmaxMLP(num_inputs=self.num_pixels, num_hidden=self.num_pixels, ...
true
true
1c317fcf19c952a9da772cb9807e81b8d1b5a974
2,878
py
Python
tests_python/tests/test_proto_demo_counter.py
Piotr170687/tezos
c7e84dfae2837096a4188e835fb780ad514ec2d3
[ "MIT" ]
1
2021-11-03T08:21:08.000Z
2021-11-03T08:21:08.000Z
tests_python/tests/test_proto_demo_counter.py
Piotr170687/tezos
c7e84dfae2837096a4188e835fb780ad514ec2d3
[ "MIT" ]
null
null
null
tests_python/tests/test_proto_demo_counter.py
Piotr170687/tezos
c7e84dfae2837096a4188e835fb780ad514ec2d3
[ "MIT" ]
4
2021-04-27T15:00:34.000Z
2021-09-26T21:50:01.000Z
import time import pytest from client.client import Client PROTO = 'ProtoDemoCounterDemoCounterDemoCounterDemoCou4LSpdT' PROTO_GENESIS = 'ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im' PARAMS = ['-p', PROTO_GENESIS] @pytest.fixture(scope="class") def client(sandbox): """One node with genesis.""" sandbo...
32.704545
79
0.648019
import time import pytest from client.client import Client PROTO = 'ProtoDemoCounterDemoCounterDemoCounterDemoCou4LSpdT' PROTO_GENESIS = 'ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im' PARAMS = ['-p', PROTO_GENESIS] @pytest.fixture(scope="class") def client(sandbox): sandbox.add_node(0) client = sandbo...
true
true
1c318164acf7e698b7f26a2cd24daddb4ab19760
9,488
py
Python
src/lslidar_ws/devel/lib/python2.7/dist-packages/lslidar_c16_msgs/msg/_LslidarC16ScanUnified.py
Louis-AD-git/racecar_ws
3c5cb561d1aee11d80a7f3847e0334e93f345513
[ "MIT" ]
null
null
null
src/lslidar_ws/devel/lib/python2.7/dist-packages/lslidar_c16_msgs/msg/_LslidarC16ScanUnified.py
Louis-AD-git/racecar_ws
3c5cb561d1aee11d80a7f3847e0334e93f345513
[ "MIT" ]
null
null
null
src/lslidar_ws/devel/lib/python2.7/dist-packages/lslidar_c16_msgs/msg/_LslidarC16ScanUnified.py
Louis-AD-git/racecar_ws
3c5cb561d1aee11d80a7f3847e0334e93f345513
[ "MIT" ]
null
null
null
# This Python file uses the following encoding: utf-8 """autogenerated by genpy from lslidar_c16_msgs/LslidarC16ScanUnified.msg. Do not edit.""" import codecs import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import genpy import lslidar_c16_msgs.msg import std_msgs.msg cla...
34.007168
145
0.629743
import codecs import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import genpy import lslidar_c16_msgs.msg import std_msgs.msg class LslidarC16ScanUnified(genpy.Message): _md5sum = "a02f26cda99b9e0189aac08ed1065a71" _type = "lslidar_c16_msgs/LslidarC16ScanUnified" _ha...
true
true
1c3181f5924e91bcd8113ea946b0f4722b4a7ea0
155
py
Python
image_loader/image/apps.py
PiochU19/image-loader
7abec95f5d41e859fe65607ab7bd442a855bc2a0
[ "MIT" ]
null
null
null
image_loader/image/apps.py
PiochU19/image-loader
7abec95f5d41e859fe65607ab7bd442a855bc2a0
[ "MIT" ]
null
null
null
image_loader/image/apps.py
PiochU19/image-loader
7abec95f5d41e859fe65607ab7bd442a855bc2a0
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ImageConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'image_loader.image'
22.142857
56
0.767742
from django.apps import AppConfig class ImageConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'image_loader.image'
true
true
1c31827d24f797c5008773831971619ab8d237c6
385
py
Python
src/tram/wsgi.py
f0r3ns1cat0r/tram
e7ddfe083aa2fab9657f012303043409462964f8
[ "Apache-2.0" ]
109
2021-09-29T00:08:14.000Z
2022-03-31T03:00:29.000Z
src/tram/wsgi.py
f0r3ns1cat0r/tram
e7ddfe083aa2fab9657f012303043409462964f8
[ "Apache-2.0" ]
86
2021-09-28T11:50:38.000Z
2022-03-31T17:42:47.000Z
src/tram/wsgi.py
f0r3ns1cat0r/tram
e7ddfe083aa2fab9657f012303043409462964f8
[ "Apache-2.0" ]
35
2021-09-29T11:09:00.000Z
2022-03-24T06:32:33.000Z
""" WSGI config for tram project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS...
22.647059
78
0.781818
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tram.settings") application = get_wsgi_application()
true
true
1c3183ae548981102c364d1214f07478edbf2cc8
14,762
py
Python
test/functional/rpc_addressindex.py
cryptomiles/cryptomiles
d3815eaf7716fbca9459f4162ae7ba4714298d27
[ "MIT" ]
null
null
null
test/functional/rpc_addressindex.py
cryptomiles/cryptomiles
d3815eaf7716fbca9459f4162ae7ba4714298d27
[ "MIT" ]
null
null
null
test/functional/rpc_addressindex.py
cryptomiles/cryptomiles
d3815eaf7716fbca9459f4162ae7ba4714298d27
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2017-2018 The Cryptomiles Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test addressindex generation and fetching #...
41.818697
144
0.64517
import time from test_framework.test_framework import CryptomilesTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * import binascii class AddressIndexTest(CryptomilesTestFramework): def set_test_params(self): self.setup_clean...
true
true
1c31847789cdbd9673e0edd99ec6129f42564a02
605
py
Python
MLTest/Test.py
Detailscool/YHDBStock
da6bcb205ef37aa35806959ef168d3ac26d60e75
[ "MIT" ]
null
null
null
MLTest/Test.py
Detailscool/YHDBStock
da6bcb205ef37aa35806959ef168d3ac26d60e75
[ "MIT" ]
null
null
null
MLTest/Test.py
Detailscool/YHDBStock
da6bcb205ef37aa35806959ef168d3ac26d60e75
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding:utf-8 -*- # Test.py # Created by HenryLee on 2017/9/10. # Copyright © 2017年. All rights reserved. # Description : import numpy as np close_list = [[1, 2, 2], [2, 1, 1], [1, 1, 1]] jsfl = np.sum(close_list, axis=0) fa = np.sum(close_list, axis=1) closes = np.array(close_list, dtype...
22.407407
50
0.676033
import numpy as np close_list = [[1, 2, 2], [2, 1, 1], [1, 1, 1]] jsfl = np.sum(close_list, axis=0) fa = np.sum(close_list, axis=1) closes = np.array(close_list, dtype=np.float) closes = np.log(closes) log_returns = np.diff(closes) print log_returns.shape log_returns_norms = np.sum(log_returns**2, axis=1) a ...
false
true
1c3185b532d5551d010b0dacf8bc60176e707d0c
701
py
Python
python3/tests/test_remove_duplicates_from_sorted_list.py
qianbinbin/leetcode
915cecab0c940cd13847683ec55b17b77eb0f39b
[ "MIT" ]
4
2018-03-05T02:27:16.000Z
2021-03-15T14:19:44.000Z
python3/tests/test_remove_duplicates_from_sorted_list.py
qianbinbin/leetcode
915cecab0c940cd13847683ec55b17b77eb0f39b
[ "MIT" ]
null
null
null
python3/tests/test_remove_duplicates_from_sorted_list.py
qianbinbin/leetcode
915cecab0c940cd13847683ec55b17b77eb0f39b
[ "MIT" ]
2
2018-07-22T10:32:10.000Z
2018-10-20T03:14:28.000Z
from unittest import TestCase from leetcodepy.remove_duplicates_from_sorted_list import * from leetcodepy.utils import linked_lists solution1 = Solution1() values1 = (1, 1, 2) expected1 = linked_lists.from_values(1, 2) values2 = (1, 1, 2, 3, 3) expected2 = linked_lists.from_values(1, 2, 3) class TestRemoveDupli...
26.961538
62
0.737518
from unittest import TestCase from leetcodepy.remove_duplicates_from_sorted_list import * from leetcodepy.utils import linked_lists solution1 = Solution1() values1 = (1, 1, 2) expected1 = linked_lists.from_values(1, 2) values2 = (1, 1, 2, 3, 3) expected2 = linked_lists.from_values(1, 2, 3) class TestRemoveDupli...
true
true
1c3185d883f9f4a37acb3aba2aa7ffd0a3a76f3c
80,900
py
Python
cartography/classification/run_glue.py
dumpmemory/Uneven_training_data
63350037744b761619d4d8bc7d2122d2bffa2c95
[ "Apache-2.0" ]
7
2021-09-13T08:53:28.000Z
2022-03-15T16:18:22.000Z
cartography/classification/run_glue.py
dumpmemory/Uneven_training_data
63350037744b761619d4d8bc7d2122d2bffa2c95
[ "Apache-2.0" ]
null
null
null
cartography/classification/run_glue.py
dumpmemory/Uneven_training_data
63350037744b761619d4d8bc7d2122d2bffa2c95
[ "Apache-2.0" ]
2
2021-11-09T00:51:11.000Z
2021-11-09T04:57:20.000Z
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
42.668776
207
0.601854
import _jsonnet import argparse import glob import json import logging import numpy as np import os import random import shutil import torch from scipy.spatial import distance from scipy.stats import entropy from itertools import cycle import torch.nn as nn import word_level_augment import torch.nn.fu...
true
true
1c31864e1fda5523fc1d8ea926d23ac00da9b6a5
41
py
Python
main.py
ddlucad96/IconBasedMalwareClassifier
608f7c26741c7d5dec63dc0dde7e4bc7f844b73f
[ "MIT" ]
2
2021-04-13T13:38:49.000Z
2021-04-16T19:26:26.000Z
main.py
ddlucad96/IconBasedMalwareClassifier
608f7c26741c7d5dec63dc0dde7e4bc7f844b73f
[ "MIT" ]
null
null
null
main.py
ddlucad96/IconBasedMalwareClassifier
608f7c26741c7d5dec63dc0dde7e4bc7f844b73f
[ "MIT" ]
null
null
null
# TODO: IMPLEMENT HERE THE NOTEBOOK LOGIC
41
41
0.804878
true
true
1c3186c7b159ededf6e79f43559b38aeacdec58e
11,339
py
Python
pioreactor/background_jobs/leader/mqtt_to_db_streaming.py
Pioreactor/pioreactor
63288a2b7ef90b663ff19b85f19586ac0b42bc1b
[ "MIT" ]
32
2021-01-01T01:56:04.000Z
2022-03-31T21:23:22.000Z
pioreactor/background_jobs/leader/mqtt_to_db_streaming.py
Pioreactor/pioreactor
63288a2b7ef90b663ff19b85f19586ac0b42bc1b
[ "MIT" ]
222
2020-11-28T18:21:56.000Z
2022-03-30T19:23:32.000Z
pioreactor/background_jobs/leader/mqtt_to_db_streaming.py
Pioreactor/pioreactor
63288a2b7ef90b663ff19b85f19586ac0b42bc1b
[ "MIT" ]
3
2021-02-12T17:50:22.000Z
2022-02-18T18:53:21.000Z
# -*- coding: utf-8 -*- """ This job runs on the leader, and is a replacement for the NodeRed database streaming job. """ from __future__ import annotations from json import dumps, loads from typing import Callable, Any from dataclasses import dataclass import click from pioreactor.pubsub import QOS from pioreactor.b...
33.547337
128
0.612752
from __future__ import annotations from json import dumps, loads from typing import Callable, Any from dataclasses import dataclass import click from pioreactor.pubsub import QOS from pioreactor.background_jobs.base import BackgroundJob, NiceMixin from pioreactor.whoami import get_unit_name, UNIVERSAL_EXPERIMENT fro...
true
true
1c31881c2d3be33410dd8fb4917bf88aab4b437b
23,500
py
Python
shap/explainers/kernel.py
ajd98/shap
922fa0fe9f198011edd875289fc68b906ff9f2b8
[ "MIT" ]
1
2019-05-02T02:53:34.000Z
2019-05-02T02:53:34.000Z
shap/explainers/kernel.py
ajd98/shap
922fa0fe9f198011edd875289fc68b906ff9f2b8
[ "MIT" ]
null
null
null
shap/explainers/kernel.py
ajd98/shap
922fa0fe9f198011edd875289fc68b906ff9f2b8
[ "MIT" ]
null
null
null
from iml.common import convert_to_instance, convert_to_model, match_instance_to_data, match_model_to_data, convert_to_instance_with_index from iml.explanations import AdditiveExplanation from iml.links import convert_to_link, IdentityLink from iml.datatypes import convert_to_data, DenseData from scipy.special import bi...
47.188755
137
0.595064
from iml.common import convert_to_instance, convert_to_model, match_instance_to_data, match_model_to_data, convert_to_instance_with_index from iml.explanations import AdditiveExplanation from iml.links import convert_to_link, IdentityLink from iml.datatypes import convert_to_data, DenseData from scipy.special import bi...
true
true
1c3189741bb21fc15cd9663b6fdad2475ea85267
4,214
py
Python
UpdateStubs.py
HelpMeIAmLost/IFTestSuite37
9c854d6d2f4b6d5604ff2aa12e1fee21365da350
[ "MIT" ]
null
null
null
UpdateStubs.py
HelpMeIAmLost/IFTestSuite37
9c854d6d2f4b6d5604ff2aa12e1fee21365da350
[ "MIT" ]
null
null
null
UpdateStubs.py
HelpMeIAmLost/IFTestSuite37
9c854d6d2f4b6d5604ff2aa12e1fee21365da350
[ "MIT" ]
null
null
null
# coding: utf-8 from common_util import * from pathlib import Path import os import argparse import sys MIN_PYTHON = (3, 7) data_handler = {'declarations': ['GlobalDeclarationsList.xlsx', 'Global Declarations', 'A:B', OFF], 'functions': ['RTEFunctionCalls.xlsx', 'RTE Function Calls', 'A:...
47.348315
119
0.565733
from common_util import * from pathlib import Path import os import argparse import sys MIN_PYTHON = (3, 7) data_handler = {'declarations': ['GlobalDeclarationsList.xlsx', 'Global Declarations', 'A:B', OFF], 'functions': ['RTEFunctionCalls.xlsx', 'RTE Function Calls', 'A:B', OFF]} d...
true
true
1c318a018feb3440fc3041c83da4f95cb4284397
2,208
py
Python
setup.py
trhoden/ceph-deploy
29224648961bdcb3a240a0e5f748a675940d9931
[ "MIT" ]
null
null
null
setup.py
trhoden/ceph-deploy
29224648961bdcb3a240a0e5f748a675940d9931
[ "MIT" ]
null
null
null
setup.py
trhoden/ceph-deploy
29224648961bdcb3a240a0e5f748a675940d9931
[ "MIT" ]
null
null
null
from setuptools import setup, find_packages import os import sys import ceph_deploy from vendor import vendorize, clean_vendor def read(fname): path = os.path.join(os.path.dirname(__file__), fname) f = open(path) return f.read() install_requires = [] pyversion = sys.version_info[:2] if pyversion < (2, 7)...
27.259259
75
0.602808
from setuptools import setup, find_packages import os import sys import ceph_deploy from vendor import vendorize, clean_vendor def read(fname): path = os.path.join(os.path.dirname(__file__), fname) f = open(path) return f.read() install_requires = [] pyversion = sys.version_info[:2] if pyversion < (2, 7)...
true
true
1c318b13dcceed8ba7497aee78a7f1008cef9e08
863
py
Python
Data_Pipelines_with_Apache_Airflow/plugins/operators/load_fact.py
bayatim/udacityDataEngineeringProjects
d3533eaec27c3b6af4d1f4b3e7bf385b3106121f
[ "MIT" ]
1
2021-02-05T10:45:22.000Z
2021-02-05T10:45:22.000Z
Data_Pipelines_with_Apache_Airflow/plugins/operators/load_fact.py
bayatim/udacityDataEngineeringProjects
d3533eaec27c3b6af4d1f4b3e7bf385b3106121f
[ "MIT" ]
6
2020-12-27T21:30:34.000Z
2021-02-05T09:10:33.000Z
Data_Pipelines_with_Apache_Airflow/plugins/operators/load_fact.py
bayatim/udacityDataEngineeringProjects
d3533eaec27c3b6af4d1f4b3e7bf385b3106121f
[ "MIT" ]
null
null
null
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class LoadFactOperator(BaseOperator): ui_color = '#F98866' @apply_defaults def __init__(self, redshift_conn_id="", sql_query="...
33.192308
76
0.665122
from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class LoadFactOperator(BaseOperator): ui_color = '#F98866' @apply_defaults def __init__(self, redshift_conn_id="", sql_query="...
true
true
1c318b428f1f698dfb5fb04d289d7a56df932024
2,082
py
Python
src/pyams_file/generations/evolve1.py
Py-AMS/pyams-file
a5155791787ba38e221896e9ce7d33177ae8a05b
[ "ZPL-2.1" ]
null
null
null
src/pyams_file/generations/evolve1.py
Py-AMS/pyams-file
a5155791787ba38e221896e9ce7d33177ae8a05b
[ "ZPL-2.1" ]
null
null
null
src/pyams_file/generations/evolve1.py
Py-AMS/pyams-file
a5155791787ba38e221896e9ce7d33177ae8a05b
[ "ZPL-2.1" ]
null
null
null
# # Copyright (c) 2008-2019 Thierry Florac <tflorac AT ulthar.net> # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRAN...
37.854545
96
0.70317
import logging from zope.intid import IIntIds from pyams_file.interfaces import IMediaFile from pyams_file.interfaces.thumbnail import IThumbnails from pyams_utils.registry import get_local_registry, get_utility, set_local_registry __docformat__ = 'restructuredtext' LOGGER = logging.getLogger('PyAMS (...
true
true
1c318de5ca5090d21826dd36782e53089996028d
640
py
Python
klimaat_helpdesk/core/models.py
JoselineHouwman/helpdesk_klimaat
0b55fefb2fe7bd7ba4f3c042963f3b72dc2e8597
[ "MIT" ]
null
null
null
klimaat_helpdesk/core/models.py
JoselineHouwman/helpdesk_klimaat
0b55fefb2fe7bd7ba4f3c042963f3b72dc2e8597
[ "MIT" ]
null
null
null
klimaat_helpdesk/core/models.py
JoselineHouwman/helpdesk_klimaat
0b55fefb2fe7bd7ba4f3c042963f3b72dc2e8597
[ "MIT" ]
null
null
null
from django.db import models from django.utils.translation import ugettext_lazy as _ class Question(models.Model): """Main element to drive the flow of the website. Questions are what the user can ask and which will trigger the rest of the actions on the website """ question = models.TextField(verbose...
42.666667
116
0.757813
from django.db import models from django.utils.translation import ugettext_lazy as _ class Question(models.Model): question = models.TextField(verbose_name=_('Your Question'), blank=False, null=False) user_email = models.EmailField(verbose_name=_('User Email'), blank=True, null=True) asked_by_ip = models....
true
true
1c318df7405891dc0ced0fe09975883ce3151a01
1,665
py
Python
tests/service/test_files.py
mralext20/avwx-engine
4eabc2a4a08cd931d6f0fab7590ea09390af43e2
[ "MIT" ]
null
null
null
tests/service/test_files.py
mralext20/avwx-engine
4eabc2a4a08cd931d6f0fab7590ea09390af43e2
[ "MIT" ]
null
null
null
tests/service/test_files.py
mralext20/avwx-engine
4eabc2a4a08cd931d6f0fab7590ea09390af43e2
[ "MIT" ]
null
null
null
""" FileService API Tests """ # pylint: disable=protected-access,missing-class-docstring,unidiomatic-typecheck # library import pytest # module from avwx import exceptions, service # tests from .test_base import BaseTestService class TestScrapeService(BaseTestService): service_class = service.files.FileServi...
26.854839
80
0.663664
import pytest from avwx import exceptions, service from .test_base import BaseTestService class TestScrapeService(BaseTestService): service_class = service.files.FileService required_attrs = ( "update_interval", "_updating", "last_updated", "is_outdated", "upda...
true
true
1c318ed0111d99108964e61ea8f66ed8c3a925c2
8,521
py
Python
salt/payload.py
grischa/salt
e7d95eed5a5d3762c96b89b9a9c685d793881912
[ "Apache-2.0" ]
1
2015-05-20T16:55:50.000Z
2015-05-20T16:55:50.000Z
salt/payload.py
grischa/salt
e7d95eed5a5d3762c96b89b9a9c685d793881912
[ "Apache-2.0" ]
null
null
null
salt/payload.py
grischa/salt
e7d95eed5a5d3762c96b89b9a9c685d793881912
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- ''' Many aspects of the salt payload need to be managed, from the return of encrypted keys to general payload dynamics and packaging, these happen in here ''' # Import python libs from __future__ import absolute_import import logging # Import salt libs import salt.log import salt.ext.six as si...
33.155642
106
0.566013
from __future__ import absolute_import import logging import salt.log import salt.ext.six as six from salt.exceptions import SaltReqTimeoutError try: import zmq except ImportError: pass log = logging.getLogger(__name__) try: import msgpack if msgpack.loads(msgpack.dumps([1,...
true
true
1c3190611d1d696efa23bd959e37084e1e83566d
686
py
Python
HackerRank/CountingValleys.py
me1007mea/hacktoberfest2020
7d29e18f4486e392ed3d7653536d4883004e1a2b
[ "MIT" ]
11
2020-10-14T05:43:12.000Z
2021-10-02T02:29:52.000Z
HackerRank/CountingValleys.py
me1007mea/hacktoberfest2020
7d29e18f4486e392ed3d7653536d4883004e1a2b
[ "MIT" ]
10
2020-10-14T15:15:41.000Z
2020-10-31T17:13:33.000Z
HackerRank/CountingValleys.py
me1007mea/hacktoberfest2020
7d29e18f4486e392ed3d7653536d4883004e1a2b
[ "MIT" ]
91
2020-10-13T15:38:28.000Z
2021-10-02T02:29:55.000Z
import math import os import random import re import sys # Complete the countingValleys function below. def countingValleys(n, s): valley = 0 level = 0 flag = 0 for i in s: if (i =="U" and flag == 0): level+=1 elif(i=="D"): level-=1 if(level<0): ...
18.052632
47
0.48688
import math import os import random import re import sys def countingValleys(n, s): valley = 0 level = 0 flag = 0 for i in s: if (i =="U" and flag == 0): level+=1 elif(i=="D"): level-=1 if(level<0): flag=1 elif(i=="U" and flag...
true
true
1c319219a636729dc3c8f675b3628b06661c71fe
368
py
Python
django/forms/__init__.py
jpmallarino/django
659d2421c7adbbcd205604002d521d82d6b0b465
[ "BSD-3-Clause", "0BSD" ]
61,676
2015-01-01T00:05:13.000Z
2022-03-31T20:37:54.000Z
checkerista/.env/Lib/site-packages/django/forms/__init__.py
LybaFatimaNasir/CS311S20PID02
bc29a8c4c9ee508c74d231c015a57b1ca4dfcb39
[ "MIT" ]
8,884
2015-01-01T00:12:05.000Z
2022-03-31T19:53:11.000Z
checkerista/.env/Lib/site-packages/django/forms/__init__.py
LybaFatimaNasir/CS311S20PID02
bc29a8c4c9ee508c74d231c015a57b1ca4dfcb39
[ "MIT" ]
33,143
2015-01-01T02:04:52.000Z
2022-03-31T19:42:46.000Z
""" Django validation and HTML form handling. """ from django.core.exceptions import ValidationError # NOQA from django.forms.boundfield import * # NOQA from django.forms.fields import * # NOQA from django.forms.forms import * # NOQA from django.forms.formsets import * # NOQA from django.forms.models import * # ...
30.666667
58
0.75
from django.core.exceptions import ValidationError from django.forms.boundfield import * from django.forms.fields import * from django.forms.forms import * from django.forms.formsets import * from django.forms.models import * from django.forms.widgets import *
true
true
1c31923846bf8a7dea51228bfd3af59166e5308e
3,351
py
Python
airflow/contrib/sensors/gcs_sensor.py
jkugiya/airflow
1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
3
2021-07-30T16:46:46.000Z
2021-10-19T07:18:47.000Z
airflow/contrib/sensors/gcs_sensor.py
jkugiya/airflow
1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
6
2019-03-16T02:09:30.000Z
2019-06-27T03:27:34.000Z
airflow/contrib/sensors/gcs_sensor.py
jkugiya/airflow
1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSD-3-Clause" ]
1
2020-10-03T10:59:50.000Z
2020-10-03T10:59:50.000Z
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
34.193878
108
0.698001
import warnings from airflow.providers.google.cloud.sensors.gcs import ( GCSObjectExistenceSensor, GCSObjectsWithPrefixExistenceSensor, GCSObjectUpdateSensor, GCSUploadSessionCompleteSensor, ) warnings.warn( "This module is deprecated. Please use `airflow.providers.google.cloud.s...
true
true
1c3192961af85632a1f3e4f3011c0ea12b0a3ab4
2,811
py
Python
homeassistant/components/velux/cover.py
shanbs/home-assistant
818776d2b4f11e4f51992dc88bc0a6f9055833b2
[ "Apache-2.0" ]
1
2019-02-18T03:16:32.000Z
2019-02-18T03:16:32.000Z
homeassistant/components/velux/cover.py
shanbs/home-assistant
818776d2b4f11e4f51992dc88bc0a6f9055833b2
[ "Apache-2.0" ]
3
2021-09-08T03:29:36.000Z
2022-03-12T00:59:48.000Z
homeassistant/components/velux/cover.py
shanbs/home-assistant
818776d2b4f11e4f51992dc88bc0a6f9055833b2
[ "Apache-2.0" ]
1
2019-09-28T07:06:08.000Z
2019-09-28T07:06:08.000Z
"""Support for Velux covers.""" from homeassistant.components.cover import ( ATTR_POSITION, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_STOP, CoverDevice) from homeassistant.components.velux import DATA_VELUX from homeassistant.core import callback DEPENDENCIES = ['velux'] async def async_setu...
30.89011
73
0.652793
from homeassistant.components.cover import ( ATTR_POSITION, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_STOP, CoverDevice) from homeassistant.components.velux import DATA_VELUX from homeassistant.core import callback DEPENDENCIES = ['velux'] async def async_setup_platform( hass, config...
true
true
1c3192dece33069100e20887af8fa0eccd6f7cd5
310
py
Python
src/main/python/code_style/rules/RuleResult.py
Judge-Girl/Code-Quality-Inspection
6d0d455fb1c47eba17157a99db5e09fbc61484b8
[ "Apache-2.0" ]
1
2021-04-22T08:29:03.000Z
2021-04-22T08:29:03.000Z
src/main/python/code_style/rules/RuleResult.py
Judge-Girl/Code-Quality-Inspection
6d0d455fb1c47eba17157a99db5e09fbc61484b8
[ "Apache-2.0" ]
12
2020-11-20T10:05:15.000Z
2021-01-19T11:10:59.000Z
src/main/python/code_style/rules/RuleResult.py
Judge-Girl/Code-Quality-Inspection
6d0d455fb1c47eba17157a99db5e09fbc61484b8
[ "Apache-2.0" ]
null
null
null
class RuleResult: def __init__(self, rule_name: str): self.rule_name = rule_name def serialize(self): raise Exception('Abstract method \'serialize\' not implemented') def collect_from_child(self): raise Exception('Abstract method \'collect_from_child\' not implemented')
28.181818
81
0.696774
class RuleResult: def __init__(self, rule_name: str): self.rule_name = rule_name def serialize(self): raise Exception('Abstract method \'serialize\' not implemented') def collect_from_child(self): raise Exception('Abstract method \'collect_from_child\' not implemented')
true
true
1c31940648d4407e8f868d7f5002b96df0b3b0c8
260
py
Python
protocol_controller/plugins/cbsd_sas/validators/grant_request.py
magma/domain-proxy
e6567740e1780d011b0b3ebd366e134d77f434b3
[ "BSD-3-Clause" ]
null
null
null
protocol_controller/plugins/cbsd_sas/validators/grant_request.py
magma/domain-proxy
e6567740e1780d011b0b3ebd366e134d77f434b3
[ "BSD-3-Clause" ]
298
2021-03-31T19:29:45.000Z
2022-03-31T11:30:44.000Z
protocol_controller/plugins/cbsd_sas/validators/grant_request.py
openEPC/domain-proxy
e6567740e1780d011b0b3ebd366e134d77f434b3
[ "BSD-3-Clause" ]
5
2021-03-31T09:26:37.000Z
2021-03-31T21:34:16.000Z
from marshmallow import Schema, fields class GrantRequestObjectSchema(Schema): cbsdId = fields.String(required=True) class GrantRequestSchema(Schema): grantRequest = fields.Nested(GrantRequestObjectSchema, required=True, many=True, unknown='true')
26
100
0.792308
from marshmallow import Schema, fields class GrantRequestObjectSchema(Schema): cbsdId = fields.String(required=True) class GrantRequestSchema(Schema): grantRequest = fields.Nested(GrantRequestObjectSchema, required=True, many=True, unknown='true')
true
true
1c3194817682c594752efe933b950c482dfc3caf
1,325
py
Python
crawlino/modules/sources_module/models.py
BBVA/crawlino
685f57e6b3e9356484ead2681bb178f651d2f371
[ "Apache-2.0" ]
1
2018-11-11T21:07:54.000Z
2018-11-11T21:07:54.000Z
crawlino/modules/sources_module/models.py
BBVA/crawlino
685f57e6b3e9356484ead2681bb178f651d2f371
[ "Apache-2.0" ]
null
null
null
crawlino/modules/sources_module/models.py
BBVA/crawlino
685f57e6b3e9356484ead2681bb178f651d2f371
[ "Apache-2.0" ]
null
null
null
from typing import Dict from crawlino.crawlino_flow import STEP_SOURCES from crawlino.exceptions import CrawlinoValueError from crawlino.models import CModelBase, CModelBaseLoader from crawlino.modules_stores import CrawlinoModulesStore class CMSource(CModelBase, metaclass=CModelBaseLoader): __slots__ = ("type"...
29.444444
77
0.583396
from typing import Dict from crawlino.crawlino_flow import STEP_SOURCES from crawlino.exceptions import CrawlinoValueError from crawlino.models import CModelBase, CModelBaseLoader from crawlino.modules_stores import CrawlinoModulesStore class CMSource(CModelBase, metaclass=CModelBaseLoader): __slots__ = ("type"...
true
true