hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
248186eea5d85664bcce2c65329a8c8278e60093 | 344 | py | Python | Python/arrays/sum_2_arrays.py | mdoprog/Warehouse | 4afb88a32fc20b613d008b86371d505ddeb07e5a | [
"MIT"
] | null | null | null | Python/arrays/sum_2_arrays.py | mdoprog/Warehouse | 4afb88a32fc20b613d008b86371d505ddeb07e5a | [
"MIT"
] | null | null | null | Python/arrays/sum_2_arrays.py | mdoprog/Warehouse | 4afb88a32fc20b613d008b86371d505ddeb07e5a | [
"MIT"
] | null | null | null | # coding=utf8
# Declarao
vetor1 = []
vetor2 = []
soma = []
#Entrada
for i in range (0, 10):
num1 = int (input("Digite um nmero para o primeiro vetor: "))
vetor1.append(num1)
num2 = int (input("Digite um nmero para o segundo vetor: "))
vetor2.append(num2)
soma.append(num1 + num2)
#Sada
for i in... | 20.235294 | 66 | 0.625 | # coding=utf8
# Declaração
vetor1 = []
vetor2 = []
soma = []
#Entrada
for i in range (0, 10):
num1 = int (input("Digite um número para o primeiro vetor: "))
vetor1.append(num1)
num2 = int (input("Digite um número para o segundo vetor: "))
vetor2.append(num2)
soma.append(num1 + num2)
#Saída
for... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e81a0a007194de02c712828e07860270a0ca403a | 3,543 | py | Python | snaql/tests/test_usage.py | rmuslimov/snaql | dacd6ef5e22dce9e2716d2368236fee2154415c3 | [
"MIT"
] | 160 | 2015-09-09T16:31:25.000Z | 2022-01-21T02:32:24.000Z | snaql/tests/test_usage.py | rmuslimov/snaql | dacd6ef5e22dce9e2716d2368236fee2154415c3 | [
"MIT"
] | 15 | 2015-09-10T17:40:01.000Z | 2022-01-06T20:20:39.000Z | snaql/tests/test_usage.py | rmuslimov/snaql | dacd6ef5e22dce9e2716d2368236fee2154415c3 | [
"MIT"
] | 21 | 2015-09-09T16:33:01.000Z | 2022-02-28T21:26:26.000Z | # coding: utf-8
try:
import unittest2 as unittest
except ImportError:
| 29.280992 | 67 | 0.529213 | # coding: utf-8
import os
import datetime
from snaql.factory import Snaql
try:
import unittest2 as unittest
except ImportError:
import unittest
class TestUseCases(unittest.TestCase):
def setUp(self):
self.sql_root = os.path.abspath(os.path.dirname(__file__))
self.snaql = Snaql(self.sql_ro... | 0 | 0 | 0 | 3,367 | 0 | 0 | 0 | -14 | 115 |
db09a983947143e9e4404d5e08e4a0b77479643b | 1,343 | py | Python | ml_src/one_get_api.py | li0926/ThorDroid | 1250241181cce2db76877df56a9acceae34461c6 | [
"MIT"
] | 2 | 2022-01-21T01:47:03.000Z | 2022-01-22T14:43:40.000Z | ml_src/one_get_api.py | li0926/ThorDroid | 1250241181cce2db76877df56a9acceae34461c6 | [
"MIT"
] | null | null | null | ml_src/one_get_api.py | li0926/ThorDroid | 1250241181cce2db76877df56a9acceae34461c6 | [
"MIT"
] | null | null | null | import argparse
from reader import read_constant
from tools import folders_set
def ParseArgs(TYPE_list,apk_path,apis_path): #
'''
,
'''
Args = argparse.ArgumentParser("ThorDroid")
Args.add_argument("--MalDir", default=apk_path + '/' + TYPE_list[1]) #
Args.add_argument("--GoodDir", def... | 31.232558 | 88 | 0.711095 | import argparse
import os
from extract_feature import process_extract_feature
from reader import read_constant
from tools import folders_set
def main(Args):
# 将路径都转换为绝对路径
MalDir = os.path.abspath(Args.MalDir)
GoodDir = os.path.abspath(Args.GoodDir)
GoodFeatureDir = os.path.abspath(Args.GoodFeatureDir)... | 258 | 0 | 0 | 0 | 0 | 455 | 0 | 18 | 90 |
ff56d9f13d67adfd05ebebb77056d6acc5d26d4c | 238 | py | Python | test_definition_template/sequences/example_sequence/test_case_parameters.py | jotautomation/iris | a189e8e390731aed54f489c5789ec23cf8e6cdc0 | [
"MIT"
] | null | null | null | test_definition_template/sequences/example_sequence/test_case_parameters.py | jotautomation/iris | a189e8e390731aed54f489c5789ec23cf8e6cdc0 | [
"MIT"
] | null | null | null | test_definition_template/sequences/example_sequence/test_case_parameters.py | jotautomation/iris | a189e8e390731aed54f489c5789ec23cf8e6cdc0 | [
"MIT"
] | null | null | null | """Store any additional test parameters to PARAMETERS dictionary.
When pool of test cases is used, PARAMETERS can be used to store
DUT type specific parameters"""
PARAMETERS = {"param1": "this is param1", "param2": "and this is param2"}
| 39.666667 | 73 | 0.752101 | """Store any additional test parameters to PARAMETERS dictionary.
When pool of test cases is used, PARAMETERS can be used to store
DUT type specific parameters"""
PARAMETERS = {"param1": "this is param1", "param2": "and this is param2"}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
464b6c7183867878584421421fb8dd194a70b0d8 | 1,048 | py | Python | utility/hash_util.py | jdacode/Blockchain_voting_system | 7a1217fcc3634139cbb8fdc132dd8fd5211bb3d1 | [
"MIT"
] | 2 | 2021-06-23T22:31:55.000Z | 2021-11-02T11:51:25.000Z | utility/hash_util.py | jdacode/Blockchain_voting_system | 7a1217fcc3634139cbb8fdc132dd8fd5211bb3d1 | [
"MIT"
] | null | null | null | utility/hash_util.py | jdacode/Blockchain_voting_system | 7a1217fcc3634139cbb8fdc132dd8fd5211bb3d1 | [
"MIT"
] | null | null | null | #blockchain_6 and upwards
import json
# __all__ = ['hash_string_256', 'hash_block']
def hash_block(block):
''' hashlib.sha256(value) where value is a string, so we cannot pass the block value directly, because it's a dictionary
json.dumps converts the dictionary type to string because the sha256 functi... | 45.565217 | 125 | 0.740458 | #blockchain_6 and upwards
import hashlib as hl
import json
# __all__ = ['hash_string_256', 'hash_block']
def hash_string_256(string):
return hl.sha256(string).hexdigest()
def hash_block(block):
''' hashlib.sha256(value) where value is a string, so we cannot pass the block value directly, because it's a di... | 0 | 0 | 0 | 0 | 0 | 48 | 0 | -1 | 46 |
9a3cd1f201dee53bbe98d499731451f324e92729 | 847 | py | Python | setup.py | xiangpin/BioFtParse | 08a7bf06db500e6e825fe5b95ae98b0c2cfae51e | [
"Apache-2.0"
] | null | null | null | setup.py | xiangpin/BioFtParse | 08a7bf06db500e6e825fe5b95ae98b0c2cfae51e | [
"Apache-2.0"
] | null | null | null | setup.py | xiangpin/BioFtParse | 08a7bf06db500e6e825fe5b95ae98b0c2cfae51e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
from BioFtParse import __version__
requirements = ["Bio", "pandas", "argparse"]
setup(
name='BioFtParse',
author='xu shuangbin',
author_email='xshuangbin@163.com',
version=__version__,
url='http://github.com/xiangpin/',
descrip... | 26.46875 | 70 | 0.652893 | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
from BioFtParse import __version__
requirements = ["Bio", "pandas", "argparse"]
setup(
name='BioFtParse',
author='xu shuangbin',
author_email='xshuangbin@163.com',
version=__version__,
url='http://github.com/xiangpin/',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
550bda071fe984cd39b5b2ed534f09bc50aed171 | 103 | py | Python | bookmanager/book/urls.py | TheTwinsNB/first | 0bb6ecf01736da17141189ba271e820290c2ed34 | [
"MIT"
] | null | null | null | bookmanager/book/urls.py | TheTwinsNB/first | 0bb6ecf01736da17141189ba271e820290c2ed34 | [
"MIT"
] | null | null | null | bookmanager/book/urls.py | TheTwinsNB/first | 0bb6ecf01736da17141189ba271e820290c2ed34 | [
"MIT"
] | null | null | null | from django.urls import path
from book.views import index
urlpatterns = [
path('home/', index)
]
| 12.875 | 28 | 0.699029 | from django.urls import path
from book.views import index
urlpatterns = [
path('home/', index)
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a360d73808eb3be21ae22a0cfee8e04ea8363a1 | 3,172 | py | Python | src/automation_video_maker.py | philipedls/Flow-Video | 801cef672d39fd71e147a45eed426eab6f03685b | [
"MIT"
] | null | null | null | src/automation_video_maker.py | philipedls/Flow-Video | 801cef672d39fd71e147a45eed426eab6f03685b | [
"MIT"
] | null | null | null | src/automation_video_maker.py | philipedls/Flow-Video | 801cef672d39fd71e147a45eed426eab6f03685b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import sys
from imagerobot import ImageRobot
from searchrobot import SearchRobot
from videorobot import VideoRobot
from uploadrobot import UploadRobot
from urllib.error import HTTPError
if __name__ == "__main__":
search_term = input("Wikipedia search term:... | 31.405941 | 94 | 0.651009 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
import sys
from imagerobot import ImageRobot
from searchrobot import SearchRobot
from videorobot import VideoRobot
from uploadrobot import UploadRobot
from urllib.error import HTTPError
def make_project_directory(search_term):
try:
search... | 0 | 0 | 0 | 0 | 0 | 320 | 0 | -12 | 45 |
f382556300cce743a598d6cea23c0aabdc3a3d05 | 2,356 | py | Python | holidays/countries/mozambique.py | m-ganko/python-holidays | f0d5a91f8bee8661ef3440bde2302332a364877e | [
"MIT"
] | 654 | 2018-01-19T06:48:53.000Z | 2022-03-26T07:44:58.000Z | holidays/countries/mozambique.py | m-ganko/python-holidays | f0d5a91f8bee8661ef3440bde2302332a364877e | [
"MIT"
] | 525 | 2018-01-16T20:16:43.000Z | 2022-03-31T13:19:02.000Z | holidays/countries/mozambique.py | m-ganko/python-holidays | f0d5a91f8bee8661ef3440bde2302332a364877e | [
"MIT"
] | 320 | 2017-11-20T16:06:22.000Z | 2022-03-18T12:55:13.000Z | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | 34.647059 | 78 | 0.601443 | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | 18 | 0 | 0 | 1,493 | 0 | 0 | 0 | 145 | 204 |
72de0088fc6be0690ba25a6a9b0e2870e5cbad4b | 4,214 | py | Python | IPython/parallel/controller/mongodb.py | breisfeld/ipython | 70e2c414014f3323d8a52fbcc94ee9e3a92d5d5f | [
"BSD-3-Clause-Clear"
] | 1 | 2022-03-13T23:06:43.000Z | 2022-03-13T23:06:43.000Z | IPython/parallel/controller/mongodb.py | breisfeld/ipython | 70e2c414014f3323d8a52fbcc94ee9e3a92d5d5f | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/parallel/controller/mongodb.py | breisfeld/ipython | 70e2c414014f3323d8a52fbcc94ee9e3a92d5d5f | [
"BSD-3-Clause-Clear"
] | 1 | 2020-05-03T10:25:12.000Z | 2020-05-03T10:25:12.000Z | """A TaskRecord backend using mongodb
Authors:
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of t... | 35.711864 | 100 | 0.57831 | """A TaskRecord backend using mongodb
Authors:
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of t... | 0 | 0 | 0 | 3,450 | 0 | 0 | 0 | 60 | 114 |
f01bad50713a5b7a95790421507e7f13d393df3a | 4,522 | py | Python | quadpy/triangle/williams_shunn_jameson.py | gdmcbain/quadpy | c083d500027d7c1b2187ae06ff2b7fbdd360ccc7 | [
"MIT"
] | 1 | 2019-01-02T19:04:42.000Z | 2019-01-02T19:04:42.000Z | quadpy/triangle/williams_shunn_jameson.py | gdmcbain/quadpy | c083d500027d7c1b2187ae06ff2b7fbdd360ccc7 | [
"MIT"
] | null | null | null | quadpy/triangle/williams_shunn_jameson.py | gdmcbain/quadpy | c083d500027d7c1b2187ae06ff2b7fbdd360ccc7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
from __future__ import division
| 38.649573 | 82 | 0.522335 | # -*- coding: utf-8 -*-
#
from __future__ import division
import sympy
from .helpers import untangle2
class WilliamsShunnJameson(object):
"""
D.M. Williams, L. Shunn, A. Jameson,
Symmetric quadrature rules for simplexes based on sphere close packed
lattice arrangements,
Journal of Computational ... | 3 | 0 | 0 | 4,393 | 0 | 0 | 0 | 0 | 69 |
91b127468907d14a2d9b702ca620c8270b1b9c8e | 5,141 | py | Python | src/unicon/plugins/tests/test_plugin_asa.py | leoanez/unicon.plugins | cdd693286a6f85d5ce1c7ed13929f6ec2f127153 | [
"Apache-2.0"
] | null | null | null | src/unicon/plugins/tests/test_plugin_asa.py | leoanez/unicon.plugins | cdd693286a6f85d5ce1c7ed13929f6ec2f127153 | [
"Apache-2.0"
] | null | null | null | src/unicon/plugins/tests/test_plugin_asa.py | leoanez/unicon.plugins | cdd693286a6f85d5ce1c7ed13929f6ec2f127153 | [
"Apache-2.0"
] | null | null | null | """
Unittests for asa plugin
Uses the mock_device.py script to test the plugin.
"""
__author__ = "Dave Wapstra <dwapstra@cisco.com>"
import os
import yaml
import unittest
from unicon.mock.mock_device import mockdata_path
with open(os.path.join(mockdata_path, 'asa/asa_mock_data.yaml'), 'rb') as data:
mock_dat... | 38.365672 | 124 | 0.564482 | """
Unittests for asa plugin
Uses the mock_device.py script to test the plugin.
"""
__author__ = "Dave Wapstra <dwapstra@cisco.com>"
import os
import yaml
import unittest
import unicon
from unicon import Connection
from unicon.core.errors import SubCommandFailure
from unicon.mock.mock_device import mockdata_path... | 0 | 409 | 0 | 4,144 | 0 | 0 | 0 | 27 | 159 |
9d65b3122b95e85a1995ee3a5e78f4c7021103f4 | 2,598 | py | Python | ands/algorithms/recursion/hanoi.py | bssrdf/ands | 504d91abfe12d316119424ddcb0ad3df3207ee73 | [
"MIT"
] | 50 | 2016-12-14T15:10:39.000Z | 2022-03-05T23:32:19.000Z | ands/algorithms/recursion/hanoi.py | bssrdf/ands | 504d91abfe12d316119424ddcb0ad3df3207ee73 | [
"MIT"
] | 58 | 2016-11-17T23:27:52.000Z | 2020-12-30T13:55:46.000Z | ands/algorithms/recursion/hanoi.py | bssrdf/ands | 504d91abfe12d316119424ddcb0ad3df3207ee73 | [
"MIT"
] | 15 | 2016-12-11T12:43:18.000Z | 2020-12-17T12:44:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# Meta-info
Author: Nelson Brochado
Created: 27/02/2016
Updated: 19/09/2017
# Description
Towers of Hanoi is a mathematical game. It consists of 3 rods, and a number of
disks of different sizes, which can slide onto any rod. The game starts with the
disks in a ne... | 30.928571 | 80 | 0.677829 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# Meta-info
Author: Nelson Brochado
Created: 27/02/2016
Updated: 19/09/2017
# Description
Towers of Hanoi is a mathematical game. It consists of 3 rods, and a number of
disks of different sizes, which can slide onto any rod. The game starts with the
disks in a ne... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
87fd8b7bb9e63f71f97bb89c436277346774cbce | 115 | py | Python | modules/TrieDS/__init__.py | Ganzaki/Trie-Based-Inverted-Index-for-Search-Engine | 18957402e5f811c1da7f243a5585020e9b085376 | [
"MIT"
] | null | null | null | modules/TrieDS/__init__.py | Ganzaki/Trie-Based-Inverted-Index-for-Search-Engine | 18957402e5f811c1da7f243a5585020e9b085376 | [
"MIT"
] | null | null | null | modules/TrieDS/__init__.py | Ganzaki/Trie-Based-Inverted-Index-for-Search-Engine | 18957402e5f811c1da7f243a5585020e9b085376 | [
"MIT"
] | null | null | null | # from .trie import Trie
# from .trie import merge | 28.75 | 32 | 0.8 | # from .trie import Trie
# from .trie import merge
from .trie_advanced import Trie
from .trie_advanced import merge | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 44 |
be43f306804f39fffc152c94cfb8856e028fc073 | 1,382 | py | Python | spark_scripts/category_counts.py | bmmidei/ReportingTrends | 346681a739a7e113cf0a01aa46a3f29e72461362 | [
"MIT"
] | null | null | null | spark_scripts/category_counts.py | bmmidei/ReportingTrends | 346681a739a7e113cf0a01aa46a3f29e72461362 | [
"MIT"
] | null | null | null | spark_scripts/category_counts.py | bmmidei/ReportingTrends | 346681a739a7e113cf0a01aa46a3f29e72461362 | [
"MIT"
] | null | null | null | from pyspark import SparkContext
import json
SAVE_DIR = 'categories'
GCP_BUCKET = 'gs://big_data_econ'
sc = SparkContext.getOrCreate()
# Read in all json files into an RDD
# Use 'wholeTextFiles' to prevent fragmenting of json objects
months = sc.wholeTextFiles(GCP_BUCKET + '/articles_subset/*.json')
# Jsonnify each ... | 34.55 | 82 | 0.719247 | from pyspark import SparkConf, SparkContext
from google.cloud import storage
import json
from datetime import datetime
SAVE_DIR = 'categories'
GCP_BUCKET = 'gs://big_data_econ'
sc = SparkContext.getOrCreate()
# Read in all json files into an RDD
# Use 'wholeTextFiles' to prevent fragmenting of json objects
months = s... | 0 | 0 | 0 | 0 | 0 | 323 | 0 | 30 | 90 |
d9e56fe7cf1358babad34fac047044b3fba9b752 | 348 | py | Python | instagram/posts/urls.py | djangojeng-e/revision | b01ccb459c4bb29211ba96a825e5b37a66e81a9f | [
"MIT"
] | null | null | null | instagram/posts/urls.py | djangojeng-e/revision | b01ccb459c4bb29211ba96a825e5b37a66e81a9f | [
"MIT"
] | null | null | null | instagram/posts/urls.py | djangojeng-e/revision | b01ccb459c4bb29211ba96a825e5b37a66e81a9f | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'posts'
urlpatterns = [
path('', views.post_list, name='post-list'),
path('<int:pk>/like/', views.post_like, name='post-like'),
path('create/', views.post_create, name='post-create'),
path('<int:post_pk>/comments/create/', views.comment_creat... | 31.636364 | 88 | 0.678161 | from django.urls import path
from . import views
app_name = 'posts'
urlpatterns = [
path('', views.post_list, name='post-list'),
path('<int:pk>/like/', views.post_like, name='post-like'),
path('create/', views.post_create, name='post-create'),
path('<int:post_pk>/comments/create/', views.comment_creat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d37b1baffea1a6d60c8eff1a3c124e9ad74b1b7 | 934 | py | Python | zero_waste_app/admin.py | a-jonak/zero_waste_app | 152cc96fc4955e96a90ca4eda73ecd58ab21488a | [
"MIT"
] | null | null | null | zero_waste_app/admin.py | a-jonak/zero_waste_app | 152cc96fc4955e96a90ca4eda73ecd58ab21488a | [
"MIT"
] | null | null | null | zero_waste_app/admin.py | a-jonak/zero_waste_app | 152cc96fc4955e96a90ca4eda73ecd58ab21488a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Product, UserProduct, Recipe, RecipeIngredient, UserShoppingList
admin.site.register(Recipe, RecipeAdmin)
admin.site.register(UserProduct, UserProductAdmin)
admin.site.register(Product, ProductAdmin)
admin.site.register(RecipeIngredient, RecipeIngredientAdmin... | 28.30303 | 84 | 0.754818 | from django.contrib import admin
from .models import Product, UserProduct, Recipe, RecipeIngredient, UserShoppingList
class RecipeAdmin(admin.ModelAdmin):
list_display = ('id', 'name')
class UserProductAdmin(admin.ModelAdmin):
list_display = ('id', 'product', 'expiration_date', 'number', 'user')
list_f... | 0 | 0 | 0 | 436 | 0 | 0 | 0 | 0 | 115 |
2f30b8d768b8e467aed01657e047da14ef95ddd0 | 718 | py | Python | ingest_data.py | jingyuyao/elitetraderoutes | a5b9ac9fba89b594843e527962b0b8539157cfd2 | [
"MIT"
] | null | null | null | ingest_data.py | jingyuyao/elitetraderoutes | a5b9ac9fba89b594843e527962b0b8539157cfd2 | [
"MIT"
] | 1 | 2018-06-07T18:43:47.000Z | 2018-06-07T18:43:47.000Z | ingest_data.py | jingyuyao/elitetraderoutes | a5b9ac9fba89b594843e527962b0b8539157cfd2 | [
"MIT"
] | null | null | null |
__author__ = 'Jingyu_Yao'
# eddb.io data locations
commodities = "http://eddb.io/archive/v3/commodities.json"
systems = "http://eddb.io/archive/v3/systems.json"
stations_lite = "http://eddb.io/archive/v3/stations_lite.json"
fixture_directory = "elitedata/fixtures/"
if __name__ == "__main__":
ingest() | 23.933333 | 62 | 0.708914 | import requests
from elitedata.fixtures.fixture_fixer import fix_all
__author__ = 'Jingyu_Yao'
# eddb.io data locations
commodities = "http://eddb.io/archive/v3/commodities.json"
systems = "http://eddb.io/archive/v3/systems.json"
stations_lite = "http://eddb.io/archive/v3/stations_lite.json"
fixture_directory = "el... | 0 | 0 | 0 | 0 | 0 | 292 | 0 | 25 | 91 |
677e3143a1f13ac2787ffa466f1ef218bf585d42 | 18,242 | py | Python | figures/figure3/figure3 5subfig.py | pdnooteboom/PO_res_error | 2c0e1f12203585e2ca3f9a5e686b4e8004052884 | [
"MIT"
] | 1 | 2021-04-12T16:07:42.000Z | 2021-04-12T16:07:42.000Z | figures/figure3/figure3 5subfig.py | pdnooteboom/PO_res_error | 2c0e1f12203585e2ca3f9a5e686b4e8004052884 | [
"MIT"
] | null | null | null | figures/figure3/figure3 5subfig.py | pdnooteboom/PO_res_error | 2c0e1f12203585e2ca3f9a5e686b4e8004052884 | [
"MIT"
] | 1 | 2021-04-12T16:07:45.000Z | 2021-04-12T16:07:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 15:41:33 2019
@author: nooteboom
"""
import numpy as np
import matplotlib.pylab as plt
import matplotlib
import cartopy.crs as ccrs
import seaborn as sns
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import matplotlib... | 39.829694 | 190 | 0.666758 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 15:41:33 2019
@author: nooteboom
"""
import numpy as np
import matplotlib.pylab as plt
from netCDF4 import Dataset
import matplotlib
import cartopy.crs as ccrs
import seaborn as sns
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE... | 0 | 1,876 | 0 | 0 | 0 | 831 | 0 | -4 | 203 |
c4308ffea33160de461eb9827db1db5149c4d041 | 4,144 | py | Python | pyclip/xclip_clip.py | aleasto/pyclip | 665c6aafc6a7494fee71a176e915dd1b8b4f90e6 | [
"Apache-2.0"
] | 12 | 2021-02-11T08:12:22.000Z | 2022-03-31T15:38:40.000Z | pyclip/xclip_clip.py | aleasto/pyclip | 665c6aafc6a7494fee71a176e915dd1b8b4f90e6 | [
"Apache-2.0"
] | 8 | 2021-02-02T16:00:55.000Z | 2022-03-24T16:24:46.000Z | pyclip/xclip_clip.py | aleasto/pyclip | 665c6aafc6a7494fee71a176e915dd1b8b4f90e6 | [
"Apache-2.0"
] | 2 | 2022-03-08T22:50:14.000Z | 2022-03-16T13:12:06.000Z | # Copyright 2021 Spencer Phillip Young
#
# 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 applicabl... | 35.724138 | 100 | 0.569981 | # Copyright 2021 Spencer Phillip Young
#
# 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 applicabl... | 0 | 0 | 0 | 3,278 | 0 | 0 | 0 | 40 | 134 |
c1997d5d6a9106b1b84fb448d653401aa522a8d2 | 1,001 | py | Python | 5/further/figs/fig3/orca_2d.py | t-young31/thesis | 2dea31ef64f4b7d55b8bdfc2094bab6579a529e0 | [
"MIT"
] | null | null | null | 5/further/figs/fig3/orca_2d.py | t-young31/thesis | 2dea31ef64f4b7d55b8bdfc2094bab6579a529e0 | [
"MIT"
] | null | null | null | 5/further/figs/fig3/orca_2d.py | t-young31/thesis | 2dea31ef64f4b7d55b8bdfc2094bab6579a529e0 | [
"MIT"
] | null | null | null | import autode as ade
import numpy as np
from autode.methods import ORCA
from autode.mol_graphs import make_graph
from autode.pes.pes_2d import PES2d
ade.Config.n_cores = 24
n_points = 10
if __name__ == '__main__':
reac = ade.Reactant('sn2_init.xyz', charge=-1)
make_graph(reac)
prod = ade.Product('sn2_fin... | 31.28125 | 80 | 0.576424 | import autode as ade
import numpy as np
from autode.methods import ORCA
from autode.mol_graphs import make_graph
from autode.pes.pes_2d import PES2d
ade.Config.n_cores = 24
n_points = 10
if __name__ == '__main__':
reac = ade.Reactant('sn2_init.xyz', charge=-1)
make_graph(reac)
prod = ade.Product('sn2_fin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ce22099411802314051253129d0f341e865d4b8 | 2,358 | py | Python | reviewboard/accounts/views.py | znick/reviewboard | f32320b267efcdf2feff1661eabe57f99ef490a7 | [
"MIT"
] | null | null | null | reviewboard/accounts/views.py | znick/reviewboard | f32320b267efcdf2feff1661eabe57f99ef490a7 | [
"MIT"
] | null | null | null | reviewboard/accounts/views.py | znick/reviewboard | f32320b267efcdf2feff1661eabe57f99ef490a7 | [
"MIT"
] | 1 | 2021-11-23T15:25:44.000Z | 2021-11-23T15:25:44.000Z | from __future__ import unicode_literals
| 31.864865 | 74 | 0.74894 | from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.utils.functional import cached_property
from django.utils.translat... | 0 | 911 | 0 | 595 | 0 | 0 | 0 | 454 | 356 |
4a325ec8eaad0922b41050d315dbd39270706a55 | 4,264 | py | Python | yarndevtools/commands/zip_latest_command_data.py | szilard-nemeth/yarn-dev-tools | 920d3e09ac69c9af3264a57dbd70a7a624a5066f | [
"BSD-2-Clause"
] | 1 | 2022-03-27T02:33:26.000Z | 2022-03-27T02:33:26.000Z | yarndevtools/commands/zip_latest_command_data.py | szilard-nemeth/yarn-dev-tools | 920d3e09ac69c9af3264a57dbd70a7a624a5066f | [
"BSD-2-Clause"
] | 1 | 2021-04-18T22:30:32.000Z | 2021-04-18T22:30:32.000Z | yarndevtools/commands/zip_latest_command_data.py | szilard-nemeth/yarn-dev-tools | 920d3e09ac69c9af3264a57dbd70a7a624a5066f | [
"BSD-2-Clause"
] | null | null | null | import logging
LOG = logging.getLogger(__name__)
| 43.070707 | 120 | 0.679878 | import logging
from typing import List
from pythoncommons.file_utils import FileUtils
from pythoncommons.zip_utils import ZipFileUtils
from yarndevtools.common.shared_command_utils import CommandType
from yarndevtools.constants import (
LATEST_DATA_ZIP_LINK_NAME,
)
LOG = logging.getLogger(__name__)
class Config... | 0 | 376 | 0 | 3,534 | 0 | 0 | 0 | 145 | 157 |
fdb8907ebcffbf17678646e78649cedf922f9a4c | 20,114 | py | Python | negar/negar.py | sys113/negar | ae76bcac876376a97a5c58042716b1e65596666c | [
"MIT"
] | 23 | 2019-11-30T14:27:31.000Z | 2022-03-17T13:05:02.000Z | negar/negar.py | sys113/negar | ae76bcac876376a97a5c58042716b1e65596666c | [
"MIT"
] | 1 | 2020-05-05T10:23:23.000Z | 2020-11-27T18:09:18.000Z | negar/negar.py | sys113/negar | ae76bcac876376a97a5c58042716b1e65596666c | [
"MIT"
] | 5 | 2019-12-01T07:10:42.000Z | 2020-02-11T21:31:38.000Z | # Copyright SYS113 2019. MIT license , see README.md file.
# import libraries
# helper function for country capital
# helper function for negar module errors printing
# helper function for justify text center with fixed length
# helper function for create header row
# helper function for create each log row... | 38.905222 | 201 | 0.613752 | # Copyright SYS113 2019. MIT license , see README.md file.
# import libraries
from re import search
from traceback import format_exc
from tzlocal import get_localzone
from datetime import datetime
from platform import system, release, machine
from getpass import getuser
from os.path import isfile
from inspect import ... | 12 | 0 | 0 | 0 | 0 | 19,254 | 0 | 116 | 352 |
2ce05d29565c53852164893c2a6e24ec380cd272 | 879 | py | Python | apps/data_taking_scripts/old_scripts/temperature_steps_140825_0813f8.py | danielflanigan/kid_readout | 07202090d468669200cab78297122880c1c03e87 | [
"BSD-2-Clause"
] | null | null | null | apps/data_taking_scripts/old_scripts/temperature_steps_140825_0813f8.py | danielflanigan/kid_readout | 07202090d468669200cab78297122880c1c03e87 | [
"BSD-2-Clause"
] | null | null | null | apps/data_taking_scripts/old_scripts/temperature_steps_140825_0813f8.py | danielflanigan/kid_readout | 07202090d468669200cab78297122880c1c03e87 | [
"BSD-2-Clause"
] | null | null | null | import sys
import getopt
import numpy as np
from kid_readout.utils import acquire
if __name__ == '__main__':
# Defaults
f_initial = np.load('/data/readout/resonances/current.npy')
shift_ppm = 0
suffix = "temperature"
# Add option?
attenuation_list = [41, 38, 35, 32, 29, 26, 23]
try:
... | 25.114286 | 97 | 0.575654 | import sys
import getopt
import numpy as np
from kid_readout.utils import acquire
if __name__ == '__main__':
def usage():
print("Usage!")
# Defaults
f_initial = np.load('/data/readout/resonances/current.npy')
shift_ppm = 0
suffix = "temperature"
# Add option?
attenuation_list = [4... | 0 | 0 | 0 | 0 | 0 | 15 | 0 | 0 | 26 |
6b3b8402d2057ddcc19c2641f0228a503027d528 | 296 | py | Python | data/studio21_generated/interview/1823/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/1823/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/1823/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | # Definition for singly-linked list.
| 26.909091 | 61 | 0.611486 | # Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def reorderList(self, head: ListNode) -> None:
"""
Do not return anything, modify head in-place instead.
"""
| 0 | 0 | 0 | 207 | 0 | 0 | 0 | 0 | 44 |
516e2368118db592aeae4e7465f206aa91b347fc | 12,372 | py | Python | ABC_ROM_angler_bot.py | giaccone/ABC_ROM_angler_bot | 4492b02392773aaf38fa6d55bd0b09d3b4cde458 | [
"MIT"
] | null | null | null | ABC_ROM_angler_bot.py | giaccone/ABC_ROM_angler_bot | 4492b02392773aaf38fa6d55bd0b09d3b4cde458 | [
"MIT"
] | null | null | null | ABC_ROM_angler_bot.py | giaccone/ABC_ROM_angler_bot | 4492b02392773aaf38fa6d55bd0b09d3b4cde458 | [
"MIT"
] | null | null | null | # ==========================
# general python modules
# ==========================
import os
# ==========================
# python-temegam-bot modules
# ==========================
import telegram as telegram
# ===============================
# create necessary folders
# ===============================
if not os.path... | 35.757225 | 111 | 0.585516 | # ==========================
# general python modules
# ==========================
import feedparser
import os
import numpy as np
from functools import wraps
from threading import Thread
import sys
# ==========================
# python-temegam-bot modules
# ==========================
from telegram.ext import Updater,... | 0 | 3,795 | 0 | 0 | 0 | 6,194 | 0 | 22 | 330 |
816fd81f5faddc2059b4fcd4c94e79802470f011 | 1,715 | py | Python | demo_continuous_mc.py | zholland/CMPUT690Project | 28063b396d14942d98bf11eb597a10dd09f2c9e8 | [
"MIT"
] | 1 | 2019-03-29T19:26:02.000Z | 2019-03-29T19:26:02.000Z | demo_continuous_mc.py | zholland/CMPUT690Project | 28063b396d14942d98bf11eb597a10dd09f2c9e8 | [
"MIT"
] | null | null | null | demo_continuous_mc.py | zholland/CMPUT690Project | 28063b396d14942d98bf11eb597a10dd09f2c9e8 | [
"MIT"
] | null | null | null |
NUM_TILINGS = 8
if __name__ == "__main__":
do_demo()
| 43.974359 | 116 | 0.506122 | import gym
import numpy as np
from actor_critic_traces import ActorCriticEligibilityTraces
from continuous_actor_critic_tile_coding import ContinuousActorCriticTileCoding
NUM_TILINGS = 8
def do_demo():
env = gym.make("MountainCarContinuous-v0")
dim_ranges = [env.observation_space.high[i] - env.observation_sp... | 0 | 0 | 0 | 0 | 0 | 1,460 | 0 | 83 | 112 |
4f44af0f9e10537a5a0a0cc8c62e5e6d33dff3dd | 12,427 | py | Python | model/utils.py | Gofinge/HF | 71baee1632cd0bf3562eed1e315b6a605699dbe9 | [
"MIT"
] | 7 | 2019-03-13T15:09:06.000Z | 2022-02-15T20:01:22.000Z | model/utils.py | Gofinge/HF | 71baee1632cd0bf3562eed1e315b6a605699dbe9 | [
"MIT"
] | null | null | null | model/utils.py | Gofinge/HF | 71baee1632cd0bf3562eed1e315b6a605699dbe9 | [
"MIT"
] | 5 | 2019-03-23T05:31:52.000Z | 2020-11-09T03:01:17.000Z |
# acc: p=1(MSE): 0.74 p=2: 0.80,0.74,0.78 p=3: 0.75,0.78,0.78,0.75 p=4: 0.76 p=5: 0.75 p=10: 0.69
| 30.162621 | 108 | 0.641345 | import numpy as np
from keras import backend as K
from sklearn.preprocessing import MinMaxScaler
import tensorflow as tf
import csv
from sklearn.neighbors import KDTree
import matplotlib.pyplot as plt
from model.config import *
from tensorflow.python.ops import *
import seaborn as sns
import pandas as pd
def data_tra... | 30 | 0 | 0 | 0 | 0 | 11,241 | 0 | 64 | 977 |
72f9a68b189a265d06d938f387577731ca995584 | 4,289 | py | Python | tests/test_BNP.py | masterdoors/kernel_trees | afea8e3171a21ddec64b0e97509e19ee08a94da9 | [
"MIT"
] | 1 | 2021-11-12T12:38:02.000Z | 2021-11-12T12:38:02.000Z | tests/test_BNP.py | masterdoors/kernel_trees | afea8e3171a21ddec64b0e97509e19ee08a94da9 | [
"MIT"
] | null | null | null | tests/test_BNP.py | masterdoors/kernel_trees | afea8e3171a21ddec64b0e97509e19ee08a94da9 | [
"MIT"
] | null | null | null | # coding: utf-8
'''
Created on 14 . 2018 .
@author: keen
'''
from sklearn.model_selection import KFold
kf = KFold(n_splits=5)
#from memory_profiler import profile
#@profile
#tbl=pandas.read_csv("BNP/train.csv",sep=',')
#mtx = tbl.as_matrix()
#x_mtx = mtx[:,2:]
#y_mtx = mtx[:,1]
#y = numpy.asarray(y_mtx,dtype=i... | 32.492424 | 228 | 0.544649 | # coding: utf-8
'''
Created on 14 февр. 2018 г.
@author: keen
'''
import pandas
import numpy
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import LabelEncoder
import math
from scipy import sparse
from sklearn.preprocessing import normalize
from sklearn.impute import SimpleImputer
import ... | 10 | 0 | 0 | 0 | 0 | 3,199 | 0 | 97 | 332 |
77db49689d6c5e42e52410f27c22134745c1bc7f | 725 | py | Python | graph/loss/loss.py | KMU-AELAB/LayoutNet_pytorch | a3a325c41ee10b556c8d258b2d3a1909d913a507 | [
"MIT"
] | null | null | null | graph/loss/loss.py | KMU-AELAB/LayoutNet_pytorch | a3a325c41ee10b556c8d258b2d3a1909d913a507 | [
"MIT"
] | null | null | null | graph/loss/loss.py | KMU-AELAB/LayoutNet_pytorch | a3a325c41ee10b556c8d258b2d3a1909d913a507 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 21.323529 | 93 | 0.593103 | import torch
import numpy as np
import torch.nn as nn
class TotalLoss(nn.Module):
def __init__(self):
super().__init__()
self.bce = nn.BCELoss(reduction='none')
self.mse = nn.MSELoss()
def forward(self, out, tg1, tg2, gt3):
return self.bce(out[0], tg1) + self.bce(out[1], tg2)... | 0 | 0 | 0 | 600 | 0 | 0 | 0 | -12 | 113 |
0f06dd43ad4456b29ae8fbb209b4919767f8f4e9 | 1,590 | py | Python | synthetic/migrations/0001_initial.py | zecollokaris/Photo-Synthetic--django- | eaee71e386371de280e9cebdaab3797fd9733113 | [
"MIT"
] | null | null | null | synthetic/migrations/0001_initial.py | zecollokaris/Photo-Synthetic--django- | eaee71e386371de280e9cebdaab3797fd9733113 | [
"MIT"
] | null | null | null | synthetic/migrations/0001_initial.py | zecollokaris/Photo-Synthetic--django- | eaee71e386371de280e9cebdaab3797fd9733113 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-07-14 12:01
| 35.333333 | 143 | 0.571069 | # Generated by Django 2.0.7 on 2018-07-14 12:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 0 | 0 | 0 | 1,443 | 0 | 0 | 0 | 30 | 68 |
64880ae9841dce3ea4f91c6adb5fede08d9e45e1 | 986 | py | Python | app.py | t-ketchem/meep-backend | 9163a7d4c6c6f0761a8bd54da00a267fd7b18afc | [
"MIT"
] | null | null | null | app.py | t-ketchem/meep-backend | 9163a7d4c6c6f0761a8bd54da00a267fd7b18afc | [
"MIT"
] | null | null | null | app.py | t-ketchem/meep-backend | 9163a7d4c6c6f0761a8bd54da00a267fd7b18afc | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
# base class shared by all models. Needed to instantiate SQLAlchemy object.
#TODO: make this a property instead of a getter method
# globally accessible database connection
db = SQLAlchemy(model_class=BaseModel)
| 27.388889 | 78 | 0.72211 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy, Model
from config import config
# base class shared by all models. Needed to instantiate SQLAlchemy object.
class BaseModel(Model):
@property
def json(self):
return {c.name: getattr(self, c.name) for c in self.__table__.columns}
#TO... | 0 | 161 | 0 | 2 | 0 | 344 | 0 | 53 | 165 |
9a52d94380687453e5855c56e0de0ab245a5c20c | 87 | py | Python | functions/Demos/import_example2.py | WebucatorTraining/classfiles-actionable-python | 930c154a6dbfa6c54768557a998b4dbafb43df38 | [
"MIT"
] | 2 | 2022-01-04T22:25:01.000Z | 2022-01-16T16:50:23.000Z | functions/Demos/import_example2.py | WebucatorTraining/classfiles-actionable-python | 930c154a6dbfa6c54768557a998b4dbafb43df38 | [
"MIT"
] | null | null | null | functions/Demos/import_example2.py | WebucatorTraining/classfiles-actionable-python | 930c154a6dbfa6c54768557a998b4dbafb43df38 | [
"MIT"
] | null | null | null | from add_nums_with_return import add_nums
total = add_nums(1, 2, 3, 4, 5)
print(total) | 21.75 | 41 | 0.758621 | from add_nums_with_return import add_nums
total = add_nums(1, 2, 3, 4, 5)
print(total) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a711119f0cc05c5de1a5e0cbd3d4357816d6857 | 257 | py | Python | biu/siam_unet/helpers/cuda_test.py | danihae/bio-image-unet | 6cc74ec45ea5f03430920ae880e1e413db70e4fc | [
"MIT"
] | 1 | 2021-10-04T15:58:47.000Z | 2021-10-04T15:58:47.000Z | biu/siam_unet/helpers/cuda_test.py | danihae/bio-image-unet | 6cc74ec45ea5f03430920ae880e1e413db70e4fc | [
"MIT"
] | null | null | null | biu/siam_unet/helpers/cuda_test.py | danihae/bio-image-unet | 6cc74ec45ea5f03430920ae880e1e413db70e4fc | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
print(get_all_gpu_names()) | 19.769231 | 43 | 0.735409 | import torch
def get_gpu_name():
return torch.cuda.get_device_name(0)
def get_all_gpu_names():
d = []
for i in range(torch.cuda.device_count()):
d.append(torch.cuda.get_device_name(i))
return d
if __name__ == '__main__':
print(get_all_gpu_names()) | 0 | 0 | 0 | 0 | 0 | 143 | 0 | -9 | 68 |
b90bf4693966745367f899abde2b9076528b4c48 | 6,959 | py | Python | gammapy/modeling/tests/test_parameter.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 1 | 2017-11-22T17:07:56.000Z | 2017-11-22T17:07:56.000Z | gammapy/modeling/tests/test_parameter.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | null | null | null | gammapy/modeling/tests/test_parameter.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 1 | 2019-09-04T14:03:33.000Z | 2019-09-04T14:03:33.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
| 25.966418 | 82 | 0.610145 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from gammapy.modeling import Parameter, Parameters
def test_parameter_init():
par = Parameter("spam", 42, "deg")
assert par.name == "spam"
assert par.factor == 42
... | 0 | 884 | 0 | 0 | 0 | 5,453 | 0 | 38 | 502 |
b1142ab8c6d53e4fb3b7b69131fc199972803e03 | 3,570 | py | Python | tests/content_types.py | msftsettiy/CCF | a99253dfb2b0e15ded3a34e504177ae54c2a538e | [
"Apache-2.0"
] | null | null | null | tests/content_types.py | msftsettiy/CCF | a99253dfb2b0e15ded3a34e504177ae54c2a538e | [
"Apache-2.0"
] | null | null | null | tests/content_types.py | msftsettiy/CCF | a99253dfb2b0e15ded3a34e504177ae54c2a538e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.network
import infra.path
import infra.proc
import infra.net
import infra.e2e_args
APP_SCRIPT = """
return {
["POST text"] = [[
export default function(request)
{
if (request.headers['conte... | 32.454545 | 87 | 0.614286 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import tempfile
import http
import infra.network
import infra.path
import infra.proc
import infra.net
import infra.e2e_args
import suite.test_requirements as reqs
APP_SCRIPT = """
return {
["POST text"] = [[
expo... | 0 | 1,261 | 0 | 0 | 0 | 280 | 0 | 1 | 112 |
13c50af16e9367baed395b9be1fa4aa64704cd3c | 11,862 | py | Python | tests/test_indeterminatebeam.py | daradib/IndeterminateBeam | 6ce5def2d96c20d825ec9584f6543d8bfe2ef80e | [
"MIT"
] | null | null | null | tests/test_indeterminatebeam.py | daradib/IndeterminateBeam | 6ce5def2d96c20d825ec9584f6543d8bfe2ef80e | [
"MIT"
] | null | null | null | tests/test_indeterminatebeam.py | daradib/IndeterminateBeam | 6ce5def2d96c20d825ec9584f6543d8bfe2ef80e | [
"MIT"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath('../'))
import unittest
##The unit testing refers to example 1 as described in the full documentation.
##In future more complex indeterminate beams should be added to ensure the validity of the program.
##In future more attention should be paid to raising error ... | 39.148515 | 153 | 0.617265 | import os
import sys
sys.path.insert(0, os.path.abspath('../'))
from sympy import oo
from indeterminatebeam.indeterminatebeam import (
Support,
Beam,
PointTorque,
PointLoad,
PointLoadV,
PointLoadH,
DistributedLoad,
DistributedLoadV,
DistributedLoadH,
TrapezoidalLoad,
Tr... | 0 | 0 | 0 | 11,095 | 0 | 0 | 0 | 251 | 91 |
c2ad2ce5e851f8b3af5ffcb6f95480aad1c190b2 | 1,527 | py | Python | src/clf_svr.py | shnhs/2jo_Final_Python | 86b7891b99b2f5282d839140b626a80417ad1c15 | [
"MIT"
] | 1 | 2022-03-04T11:30:30.000Z | 2022-03-04T11:30:30.000Z | src/clf_svr.py | shnhs/2jo_Final_Python | 86b7891b99b2f5282d839140b626a80417ad1c15 | [
"MIT"
] | null | null | null | src/clf_svr.py | shnhs/2jo_Final_Python | 86b7891b99b2f5282d839140b626a80417ad1c15 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from fastapi import FastAPI
import uvicorn
import sys
import nest_asyncio
nest_asyncio.apply()
SRC_PATH = './src'
sys.path.insert(0, SRC_PATH)
app = FastAPI()
from hugging_classifier import HuggingClassifier, model_param_bert_pt, NEWS_OM_MODEL, logger
clf = HuggingClassifier(modelParam=model_pa... | 36.357143 | 127 | 0.711853 | #!/usr/bin/env python
from typing import Optional
from fastapi import FastAPI, HTTPException
import uvicorn
import sys
from os import path
import nest_asyncio
nest_asyncio.apply()
SRC_PATH = './src'
sys.path.insert(0, SRC_PATH)
app = FastAPI()
from hugging_classifier import HuggingClassifier, model_param_bert_pt, NE... | 0 | 748 | 0 | 0 | 0 | 0 | 0 | 19 | 90 |
03ede795435fa4a190ebc7c3a2b1579abf73b183 | 12,939 | py | Python | src/pong_vision/scripts/updated_cup_detection.py | kekraft/golden_eye | a857d9c31645451b09f68a148e996dfa213322ec | [
"BSD-2-Clause"
] | null | null | null | src/pong_vision/scripts/updated_cup_detection.py | kekraft/golden_eye | a857d9c31645451b09f68a148e996dfa213322ec | [
"BSD-2-Clause"
] | null | null | null | src/pong_vision/scripts/updated_cup_detection.py | kekraft/golden_eye | a857d9c31645451b09f68a148e996dfa213322ec | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#import freenect
# calibrate kinect to world
# https://github.com/amiller/libfreenect-goodies/blob/master/calibkinect.py
# also check out mouse_and_match
if __name__ == "__main__":
# cv2.VideoCapture.grab()
# cv2.VideoCapture.retrieve()
#
# cv2.VideoCapture.read()
... | 33.176923 | 130 | 0.566891 | #!/usr/bin/env python
#import freenect
import rospy
from cv_bridge import CvBridge, CvBridgeError
import numpy as np
import cv2
import time
from matplotlib import pyplot as plt
import copy
from sensor_msgs.msg import Image
from sensor_msgs.msg import CameraInfo
# calibrate kinect to world
# https://github.com/amill... | 0 | 0 | 0 | 12,342 | 0 | 0 | 0 | 25 | 221 |
f35a591735129097674575246204136655e9ba65 | 28,119 | py | Python | calico/felix/test/test_devices.py | caseydavenport/felix | 0eda394fc5512424922495704d2633798c0753a4 | [
"Apache-2.0"
] | 6 | 2016-10-18T04:04:25.000Z | 2016-10-18T04:06:49.000Z | calico/felix/test/test_devices.py | caseydavenport/felix | 0eda394fc5512424922495704d2633798c0753a4 | [
"Apache-2.0"
] | 1 | 2021-06-01T21:45:37.000Z | 2021-06-01T21:45:37.000Z | calico/felix/test/test_devices.py | caseydavenport/felix | 0eda394fc5512424922495704d2633798c0753a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 45.353226 | 117 | 0.552011 | # -*- coding: utf-8 -*-
# Copyright (c) 2014-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 0 | 4,983 | 0 | 21,868 | 0 | 0 | 0 | 0 | 116 |
2d1b36b3237315b2dd7e1ea1d0bff9276741e1a2 | 2,324 | py | Python | python/pillow/image_converter_test.py | gdsglgf/tutorials | bacb2b901cca778e8d4439a363bca25981074fed | [
"MIT"
] | null | null | null | python/pillow/image_converter_test.py | gdsglgf/tutorials | bacb2b901cca778e8d4439a363bca25981074fed | [
"MIT"
] | null | null | null | python/pillow/image_converter_test.py | gdsglgf/tutorials | bacb2b901cca778e8d4439a363bca25981074fed | [
"MIT"
] | null | null | null | import numpy as np
rgb1 = np.array(np.arange(8 * 8 * 3).reshape((8, 8, 3)), dtype='uint8')
toGray(rgb1)
rgb2 = np.array(
[[[ 0, 0, 2],
[ 2, 3, 5],
[ 6, 7, 9],
[ 9, 10, 12],
[ 11, 12, 14],
[ 14, 15, 17],
[ 17, 18, 20],
[ 20, 21, 23]],
[[ 23, 24, 26],
[ 26, 27, 29],
[ ... | 19.694915 | 71 | 0.42685 | import numpy as np
def toGray(rgb):
row, column, pipe = rgb.shape
for i in range(row):
for j in range(column):
pix = rgb[i, j]
r = pix[0]
g = pix[1]
b = pix[2]
gray = (r * 299 + g * 587 + b * 114) / 1000
print '%4d' %(gray),
print
rgb1 = np.array(np.arange(8 * 8 * 3)... | 0 | 0 | 0 | 0 | 0 | 240 | 0 | 0 | 23 |
77817d59dc7ee8385be5e20bca27e695c9e842f7 | 2,420 | py | Python | networking_bagpipe/bagpipe_bgp/common/exceptions.py | daespinel/networking-bagpipe-1 | 7e96cc651394813c1dc80747186b6cfcaa173f14 | [
"Apache-2.0"
] | 29 | 2015-11-09T21:47:52.000Z | 2022-01-25T16:03:17.000Z | networking_bagpipe/bagpipe_bgp/common/exceptions.py | openstack/networking-bagpipe-l2 | d472fb7b5d05b70f9f4e12288eee1a9a01fdc9fd | [
"Apache-2.0"
] | null | null | null | networking_bagpipe/bagpipe_bgp/common/exceptions.py | openstack/networking-bagpipe-l2 | d472fb7b5d05b70f9f4e12288eee1a9a01fdc9fd | [
"Apache-2.0"
] | 9 | 2015-11-17T08:24:32.000Z | 2020-10-25T18:59:48.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... | 29.876543 | 79 | 0.700413 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... | 0 | 0 | 0 | 1,548 | 0 | 0 | 0 | 0 | 230 |
a465887a55d3b99213bb025e1bda2fcfd3cd5315 | 3,607 | py | Python | tui.py | Blucknote/ThermoTwitter | f0ae664230b427098adac5a84c33fb4c0830e3ff | [
"MIT"
] | null | null | null | tui.py | Blucknote/ThermoTwitter | f0ae664230b427098adac5a84c33fb4c0830e3ff | [
"MIT"
] | null | null | null | tui.py | Blucknote/ThermoTwitter | f0ae664230b427098adac5a84c33fb4c0830e3ff | [
"MIT"
] | null | null | null | from asciimatics.screen import Screen
from asciimatics.exceptions import ResizeScreenError
import sys
last_scene = None
while True:
try:
Screen.wrapper(demo, catch_interrupt=True, arguments=[last_scene])
sys.exit(0)
except ResizeScreenError as e:
last_scene = e.scene | 36.434343 | 80 | 0.531744 | from asciimatics.widgets import Frame, ListBox, Layout, Divider, Text, \
Button, TextBox, Widget
from asciimatics.scene import Scene
from asciimatics.screen import Screen
from asciimatics.exceptions import ResizeScreenError, NextScene, StopApplication
import data
import sys
import sqlite3
class SettingsView(Frame)... | 0 | 60 | 0 | 2,782 | 0 | 196 | 0 | 104 | 165 |
76975e7c9fdc8a63bdd4999d0b094c8c93968be8 | 40,071 | py | Python | test/test_conformance.py | homersoft/oadr2-ven-python | a24cbf890331b56f92835eb1c1a4de1db181fb79 | [
"Apache-2.0"
] | 1 | 2019-10-28T13:09:59.000Z | 2019-10-28T13:09:59.000Z | test/test_conformance.py | homersoft/oadr2-ven-python | a24cbf890331b56f92835eb1c1a4de1db181fb79 | [
"Apache-2.0"
] | 1 | 2019-11-18T13:28:44.000Z | 2019-11-18T13:41:30.000Z | test/test_conformance.py | homersoft/oadr2-ven-python | a24cbf890331b56f92835eb1c1a4de1db181fb79 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
from test.adr_event_generator import AdrEvent, AdrEventStatus, generate_payload
from unittest import mock
import pytest
from freezegun import freeze_time
from oadr2 import controller, event
from oadr2.poll import OpenADR2
from oadr2.schemas import NS_A
TEST_DB_ADDR = "%s/test... | 39.323847 | 127 | 0.706696 | from datetime import datetime, timedelta
from test.adr_event_generator import AdrEvent, AdrEventStatus, generate_payload
from unittest import mock
import pytest
from freezegun import freeze_time
from oadr2 import controller, event
from oadr2.poll import OpenADR2
from oadr2.schemas import NS_A
TEST_DB_ADDR = "%s/test... | 36 | 16,663 | 0 | 0 | 0 | 789 | 0 | 0 | 575 |
d0979d5ef864730439ab01e7e5ae8ed8e0f1762e | 772 | py | Python | week2/fibonacci_again.py | zarat0xz/algorythms-coursera | a6f873fa3f42b610a40f1f023fc0a4b4f1934957 | [
"MIT"
] | null | null | null | week2/fibonacci_again.py | zarat0xz/algorythms-coursera | a6f873fa3f42b610a40f1f023fc0a4b4f1934957 | [
"MIT"
] | null | null | null | week2/fibonacci_again.py | zarat0xz/algorythms-coursera | a6f873fa3f42b610a40f1f023fc0a4b4f1934957 | [
"MIT"
] | 1 | 2020-10-13T06:18:58.000Z | 2020-10-13T06:18:58.000Z | # Uses python3
import sys
if __name__ == '__main__':
input = sys.stdin.read();
n, m = map(int, input.split())
print(get_fibonacci_huge_naive(n, m)) | 22.057143 | 41 | 0.551813 | # Uses python3
import sys
def get_fibonacci_huge_naive(n, m):
if n < 2:
return n
num1 = 1
num2 = 2
counter = 1
while num1 != 1 or num2 != 1:
temp = num1 + num2
num1 = num2
num2 = temp % m
counter += 1
desired_index = n % counter
if desired_index < 2:
... | 0 | 0 | 0 | 0 | 0 | 588 | 0 | 0 | 23 |
7500a1a4505b9abb60f56a9ad2f76ea4235d46a5 | 1,272 | py | Python | research/deeplab/utils/png2Video.py | TurtleInMelon/SemanticSegmentationByDeeplabv3plusAndPyQt5 | a925d89b9b936dc75b667ba6264cc16d05c272ca | [
"Apache-2.0"
] | 1 | 2020-05-13T11:38:10.000Z | 2020-05-13T11:38:10.000Z | research/deeplab/utils/png2Video.py | TurtleInMelon/SemanticSegmentationByDeeplabv3plusAndPyQt5 | a925d89b9b936dc75b667ba6264cc16d05c272ca | [
"Apache-2.0"
] | null | null | null | research/deeplab/utils/png2Video.py | TurtleInMelon/SemanticSegmentationByDeeplabv3plusAndPyQt5 | a925d89b9b936dc75b667ba6264cc16d05c272ca | [
"Apache-2.0"
] | null | null | null | import cv2
import os
# png_file_path = r'E:\leftImg8bit_demoVideo\leftImg8bit\demoVideo\stuttgart_01\stuttgart_01_000000_000001_leftImg8bit.png'
output_video_path = '/media/xzq/DA18EBFA09C1B27D/exp/train_on_train_set/video/stuttgart_01.mp4'
files = os.listdir('/media/xzq/DA18EBFA09C1B27D/exp/train_on_train_set/test'... | 34.378378 | 123 | 0.761792 | import cv2
import os
import random
from deeplab.utils.picture_utils import *
# png_file_path = r'E:\leftImg8bit_demoVideo\leftImg8bit\demoVideo\stuttgart_01\stuttgart_01_000000_000001_leftImg8bit.png'
output_video_path = '/media/xzq/DA18EBFA09C1B27D/exp/train_on_train_set/video/stuttgart_01.mp4'
files = os.listdir('... | 258 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 44 |
c809d07c4df66158e17244184525733abcc4da56 | 698 | py | Python | backend/TODO_list/apps/todo/urls.py | Bernardoow/TODO-list | ac13c0167c08ba0d6417a4d909a0a2e7d367ca45 | [
"MIT"
] | null | null | null | backend/TODO_list/apps/todo/urls.py | Bernardoow/TODO-list | ac13c0167c08ba0d6417a4d909a0a2e7d367ca45 | [
"MIT"
] | null | null | null | backend/TODO_list/apps/todo/urls.py | Bernardoow/TODO-list | ac13c0167c08ba0d6417a4d909a0a2e7d367ca45 | [
"MIT"
] | null | null | null | # urls.py
from django.conf.urls import url
from apps.todo.views import TaskCreate
from apps.todo.views import TaskList
from apps.todo.views import TaskRetrieve
from apps.todo.views import TaskUpdate
from apps.todo.views import TaskDestroy
from apps.todo.views import TaskIndex
urlpatterns = [
url(r'new-task/$', Ta... | 34.9 | 77 | 0.67765 | # urls.py
from django.conf.urls import url
from apps.todo.views import TaskCreate
from apps.todo.views import TaskList
from apps.todo.views import TaskRetrieve
from apps.todo.views import TaskUpdate
from apps.todo.views import TaskDestroy
from apps.todo.views import TaskIndex
urlpatterns = [
url(r'new-task/$', Ta... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
674df5ba152ce84f159b87e0dace1818d983c3e9 | 863 | py | Python | MissingInteger.py | Cynthyah/Exercises | 4c458cb518d8e77f2c51a9dd8d36eb4e4c73364c | [
"MIT"
] | null | null | null | MissingInteger.py | Cynthyah/Exercises | 4c458cb518d8e77f2c51a9dd8d36eb4e4c73364c | [
"MIT"
] | null | null | null | MissingInteger.py | Cynthyah/Exercises | 4c458cb518d8e77f2c51a9dd8d36eb4e4c73364c | [
"MIT"
] | null | null | null | # MissingInteger - Find the smallest positive integer that does not occur in a given sequence.
# Given an array A of N integers, returns the smallest positive integer (greater than 0)
# that does not occur in A.
# For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
# A = [1, 2... | 30.821429 | 95 | 0.590962 | # MissingInteger - Find the smallest positive integer that does not occur in a given sequence.
# Given an array A of N integers, returns the smallest positive integer (greater than 0)
# that does not occur in A.
# For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5.
# A = [1, 2... | 9 | 0 | 0 | 0 | 0 | 165 | 0 | 0 | 23 |
b4592c22f052333b93660ab9a4620773407fc475 | 718 | py | Python | queueos/expressions/StringExpression.py | ecmwf/queueos | aa6b4f2e683194c2b2955b47337120d594e374db | [
"Apache-2.0"
] | null | null | null | queueos/expressions/StringExpression.py | ecmwf/queueos | aa6b4f2e683194c2b2955b47337120d594e374db | [
"Apache-2.0"
] | null | null | null | queueos/expressions/StringExpression.py | ecmwf/queueos | aa6b4f2e683194c2b2955b47337120d594e374db | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2021 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... | 31.217391 | 82 | 0.707521 | # (C) Copyright 2021 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... | 0 | 0 | 0 | 315 | 0 | 0 | 0 | 0 | 23 |
96928cf3b168de617bcf84d10a9eadd9645e8f22 | 2,597 | py | Python | pierre/site_search/postgresql_backend/model.py | krismeister/django-pierre | 4914b2322bbaf21ff40b754d114749b498570701 | [
"Apache-2.0"
] | null | null | null | pierre/site_search/postgresql_backend/model.py | krismeister/django-pierre | 4914b2322bbaf21ff40b754d114749b498570701 | [
"Apache-2.0"
] | null | null | null | pierre/site_search/postgresql_backend/model.py | krismeister/django-pierre | 4914b2322bbaf21ff40b754d114749b498570701 | [
"Apache-2.0"
] | null | null | null |
# Adapted from http://www.djangosnippets.org/snippets/1328/
| 38.761194 | 92 | 0.681171 | from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db import connection
from pierre.site_search.settings import SORT_MAPPINGS
# Adapted from http://www.djangosnippets.org/snippets/1328/
class IndexField (models.Field):
"""
Field type used by Postgres for full-t... | 0 | 0 | 0 | 493 | 0 | 1,799 | 0 | 87 | 157 |
5114f8de21a4b6c525f9273cdcf56a4e7bf8fef8 | 4,557 | py | Python | rethinkdb_sessions/main.py | tdidechkin/rethinkdb-sessions | d7f01bd4ac65016fd547d10f53d052464a8359f1 | [
"MIT"
] | 5 | 2015-05-05T21:53:16.000Z | 2021-03-16T03:23:16.000Z | rethinkdb_sessions/main.py | tdidechkin/rethinkdb-sessions | d7f01bd4ac65016fd547d10f53d052464a8359f1 | [
"MIT"
] | null | null | null | rethinkdb_sessions/main.py | tdidechkin/rethinkdb-sessions | d7f01bd4ac65016fd547d10f53d052464a8359f1 | [
"MIT"
] | null | null | null | from django.conf import settings
##push defaults
SESSION_RETHINK_HOST = getattr(settings, 'SESSION_RETHINK_HOST', 'localhost')
SESSION_RETHINK_PORT = getattr(settings, 'SESSION_RETHINK_PORT', '28015')
SESSION_RETHINK_DB = getattr(settings, 'SESSION_RETHINK_DB', 'test')
SESSION_RETHINK_TABLE = getattr(settings, 'S... | 32.55 | 117 | 0.708141 | import rethinkdb
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase,CreateError
from django.utils import timezone
import time
##push defaults
SESSION_RETHINK_HOST = getattr(settings, 'SESSION_RETHINK_HOST', 'localhost')
SESSION_RETHINK_PORT = getattr(settings, 'SESSION_RET... | 0 | 1,129 | 0 | 2,831 | 0 | 0 | 0 | 49 | 111 |
fc208e91aad6b394a58046dc8ed81e3e3522a2bb | 3,472 | py | Python | saleor/order/migrations/0040_auto_20180210_0422.py | TysonRV/saleor | 83d3ca5ae163fa853ab311d0ebcdbc22f4788166 | [
"BSD-3-Clause"
] | 9 | 2021-08-08T22:42:18.000Z | 2021-11-23T06:50:14.000Z | saleor/order/migrations/0040_auto_20180210_0422.py | TysonRV/saleor | 83d3ca5ae163fa853ab311d0ebcdbc22f4788166 | [
"BSD-3-Clause"
] | 64 | 2019-02-11T17:02:05.000Z | 2021-06-25T15:16:57.000Z | saleor/order/migrations/0040_auto_20180210_0422.py | TysonRV/saleor | 83d3ca5ae163fa853ab311d0ebcdbc22f4788166 | [
"BSD-3-Clause"
] | 2 | 2019-01-08T02:32:42.000Z | 2021-07-05T14:05:55.000Z | # Generated by Django 2.0.2 on 2018-02-10 10:22
import django.core.validators
import django.db.models.deletion
| 48.901408 | 217 | 0.621832 | # Generated by Django 2.0.2 on 2018-02-10 10:22
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('order', '0039_auto_20180312_1203'),
]
operations = [
... | 0 | 0 | 0 | 3,266 | 0 | 0 | 0 | 26 | 67 |
15888765ba79b317cce37cc5d737528823260bfa | 1,212 | py | Python | demos/python_demos/accuracy_checker/accuracy_checker/launcher/__init__.py | asmorkalov/open_model_zoo | 633b84eafee670c97d0da6985fbc76c2143fc7ae | [
"Apache-2.0"
] | 2 | 2019-05-21T06:31:41.000Z | 2019-06-12T07:47:18.000Z | demos/python_demos/accuracy_checker/accuracy_checker/launcher/__init__.py | asmorkalov/open_model_zoo | 633b84eafee670c97d0da6985fbc76c2143fc7ae | [
"Apache-2.0"
] | 1 | 2021-03-19T12:30:19.000Z | 2021-03-22T12:14:31.000Z | demos/python_demos/accuracy_checker/accuracy_checker/launcher/__init__.py | asmorkalov/open_model_zoo | 633b84eafee670c97d0da6985fbc76c2143fc7ae | [
"Apache-2.0"
] | 2 | 2019-06-12T10:28:32.000Z | 2019-06-17T21:47:54.000Z | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | 37.875 | 108 | 0.74835 | """
Copyright (c) 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
efbe0bb4c44043b6f5b679977093371d1edd806d | 10,335 | py | Python | genTask/generator.py | shawnwun/woz | e9147620137c7958ee7583f0bcb5000bf5871aef | [
"Apache-2.0"
] | 13 | 2018-01-10T11:45:47.000Z | 2020-02-13T11:44:26.000Z | genTask/generator.py | shawnwun/woz | e9147620137c7958ee7583f0bcb5000bf5871aef | [
"Apache-2.0"
] | 1 | 2018-11-06T03:08:18.000Z | 2020-01-10T06:23:08.000Z | genTask/generator.py | shawnwun/woz | e9147620137c7958ee7583f0bcb5000bf5871aef | [
"Apache-2.0"
] | 5 | 2018-01-10T02:34:24.000Z | 2019-07-31T08:26:08.000Z | ######################################################################
######################################################################
# Copyright Tsung-Hsien Wen, Cambridge Dialogue Systems Group, 2017 #
######################################################################
####################################... | 50.414634 | 226 | 0.572037 | ######################################################################
######################################################################
# Copyright Tsung-Hsien Wen, Cambridge Dialogue Systems Group, 2017 #
######################################################################
####################################... | 0 | 0 | 0 | 0 | 0 | 9,590 | 0 | -47 | 340 |
aa075ef4b1cd16488eb49c35394faa0f9a0cda56 | 5,618 | py | Python | GANs/AC_GAN/train.py | sushant097/Deep-Learning-Paper-Scratch-Implementation | e1e5cbd0f1f10dd9ed0673e8a0506f33c94f6725 | [
"MIT"
] | 4 | 2022-01-07T14:48:13.000Z | 2022-02-24T10:10:24.000Z | GANs/AC_GAN/train.py | sushant097/Deep-Learning-Paper-Scratch-Implementation | e1e5cbd0f1f10dd9ed0673e8a0506f33c94f6725 | [
"MIT"
] | null | null | null | GANs/AC_GAN/train.py | sushant097/Deep-Learning-Paper-Scratch-Implementation | e1e5cbd0f1f10dd9ed0673e8a0506f33c94f6725 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torchvision.datasets import CIFAR10
import torchvision.transforms as transforms
import os
from tqdm import tqdm
from discriminator import Discriminator
from generator import Generator
from utils import custom_init, compute_a... | 43.215385 | 138 | 0.628337 | import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from torchvision.datasets import CIFAR10
import torchvision.transforms as transforms
import torchvision.utils as vutils
import os
from tqdm import tqdm
from discriminator import Discriminator
from generator import Generator
from ... | 0 | 0 | 0 | 0 | 0 | 251 | 0 | 33 | 67 |
faa9b3b21cab29bfccdb9bb39bf6454c146ea84b | 3,837 | py | Python | lib/googlesearch.py | moe-cmd/phonia | 96485a1e3c05f0848fdec8ccdd7e7093ba537e1f | [
"MIT"
] | 2 | 2020-10-07T20:59:27.000Z | 2021-05-30T07:20:26.000Z | lib/googlesearch.py | moe-cmd/phonia | 96485a1e3c05f0848fdec8ccdd7e7093ba537e1f | [
"MIT"
] | null | null | null | lib/googlesearch.py | moe-cmd/phonia | 96485a1e3c05f0848fdec8ccdd7e7093ba537e1f | [
"MIT"
] | 2 | 2020-12-27T15:56:36.000Z | 2021-03-02T20:22:49.000Z | #!/usr/bin/env python3
# MIT License
#
# Copyright (C) 2019-2020, Entynetproject. All Rights Reserved.
#
# 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 withou... | 33.077586 | 119 | 0.632786 | #!/usr/bin/env python3
# MIT License
#
# Copyright (C) 2019-2020, Entynetproject. All Rights Reserved.
#
# 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 withou... | 0 | 0 | 0 | 0 | 0 | 2,385 | 0 | 5 | 269 |
77226f0379a67e086a1cdcff92750947a5e7362f | 332 | py | Python | python/pyqt/pyqt_designer_example/first_steps_with_qt_designer/ui_loading.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/pyqt_designer_example/first_steps_with_qt_designer/ui_loading.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pyqt/pyqt_designer_example/first_steps_with_qt_designer/ui_loading.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from PyQt5 import QtWidgets
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec_() | 22.133333 | 42 | 0.707831 | import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import uic
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
uic.loadUi('mainwindow.ui', self)
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()... | 0 | 0 | 0 | 144 | 0 | 0 | 0 | 15 | 45 |
ae6726f85e42bcc71006320fec05f6b8e9abde7e | 3,025 | py | Python | openmdao/core/fileref.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 17 | 2018-01-11T20:13:59.000Z | 2022-03-22T03:46:05.000Z | openmdao/core/fileref.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 6 | 2017-10-19T23:14:14.000Z | 2020-11-22T17:30:57.000Z | openmdao/core/fileref.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 10 | 2018-04-12T22:13:33.000Z | 2020-05-07T10:02:59.000Z | """
Support for file variables.
"""
#Public Symbols
__all__ = ['FileRef']
_file_meta = {
'binary': bool,
}
| 32.180851 | 88 | 0.584463 | """
Support for file variables.
"""
import sys
import copy
import os
import shutil
from six import iteritems
#Public Symbols
__all__ = ['FileRef']
_file_meta = {
'binary': bool,
}
class FileRef(object):
"""
A reference to a file on disk. As well as containing metadata information,
it supports :meth:... | 0 | 0 | 0 | 2,815 | 0 | 0 | 0 | -37 | 134 |
ffcc76d8ee887071a0dd71d403291da6be350d47 | 11,674 | py | Python | simulator/src/producer.py | sebMathieu/dsima | 9e4284cf2dd1927e17c3663734440450a4d92bc8 | [
"BSD-3-Clause"
] | 2 | 2016-09-09T13:14:33.000Z | 2017-01-09T11:40:59.000Z | simulator/src/producer.py | sebMathieu/dsima | 9e4284cf2dd1927e17c3663734440450a4d92bc8 | [
"BSD-3-Clause"
] | null | null | null | simulator/src/producer.py | sebMathieu/dsima | 9e4284cf2dd1927e17c3663734440450a4d92bc8 | [
"BSD-3-Clause"
] | null | null | null | ##@package producer
#@author Sebastien MATHIEU
## Producer agent.
| 35.162651 | 146 | 0.675176 | ##@package producer
#@author Sebastien MATHIEU
import os,shutil, csv
from .agent.stateAgent import StateAgent
from .fsu import FSU
from .fsp import FSP
from .brp import BRP
from . import options,tools
from .spbid import SPBid, SPObligationBid
## Producer agent.
class Producer(StateAgent,FSU,FSP,BRP):
... | 0 | 0 | 0 | 11,373 | 0 | 0 | 0 | 42 | 187 |
73a55c64b61b4f2ad033253b74800bdbfea805e8 | 481 | py | Python | api/rooms/migrations/0002_auto_20190716_1858.py | todaatsushi/chatroom | dc35b57c040f63e560968ea6d1771e9d6a5bce80 | [
"MIT"
] | null | null | null | api/rooms/migrations/0002_auto_20190716_1858.py | todaatsushi/chatroom | dc35b57c040f63e560968ea6d1771e9d6a5bce80 | [
"MIT"
] | 14 | 2020-02-12T01:01:06.000Z | 2022-02-10T09:15:01.000Z | api/rooms/migrations/0002_auto_20190716_1858.py | todaatsushi/chatroom | dc35b57c040f63e560968ea6d1771e9d6a5bce80 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-16 18:58
| 24.05 | 138 | 0.642412 | # Generated by Django 2.2.3 on 2019-07-16 18:58
from django.db import migrations, models
import rooms.models
class Migration(migrations.Migration):
dependencies = [
('rooms', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='chatroom',
name='ha... | 0 | 0 | 0 | 347 | 0 | 0 | 0 | 17 | 68 |
f8f0800f14ea1fff8b48fa74969a80a7b7c312f1 | 587 | py | Python | safe_transaction_service/contracts/migrations/0003_auto_20210122_1352.py | byteflyfunny/safe-transaction-service | 2a1a855d9881181a57692057aeb91c9fd8ae3de5 | [
"MIT"
] | 67 | 2019-08-16T16:26:42.000Z | 2022-03-21T20:32:43.000Z | safe_transaction_service/contracts/migrations/0003_auto_20210122_1352.py | byteflyfunny/safe-transaction-service | 2a1a855d9881181a57692057aeb91c9fd8ae3de5 | [
"MIT"
] | 550 | 2019-07-11T12:09:06.000Z | 2022-03-31T16:32:00.000Z | safe_transaction_service/contracts/migrations/0003_auto_20210122_1352.py | byteflyfunny/safe-transaction-service | 2a1a855d9881181a57692057aeb91c9fd8ae3de5 | [
"MIT"
] | 83 | 2019-12-06T11:22:32.000Z | 2022-03-30T10:09:22.000Z | # Generated by Django 3.1.5 on 2021-01-22 13:52
| 23.48 | 91 | 0.601363 | # Generated by Django 3.1.5 on 2021-01-22 13:52
from django.db import migrations, models
import safe_transaction_service.contracts.models
class Migration(migrations.Migration):
dependencies = [
("contracts", "0002_auto_20210119_1136"),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 423 | 0 | 0 | 0 | 46 | 69 |
02240a0fbc42a49dca11c47d692b657264d79253 | 17,972 | py | Python | icekat/continuous_kinetics.py | colsen-bu/icekat | 8adf43d719d49fca91e5786bb22a7275b143fd4e | [
"MIT"
] | 9 | 2020-05-05T06:38:20.000Z | 2021-04-25T16:48:29.000Z | icekat/continuous_kinetics.py | colsen-bu/icekat | 8adf43d719d49fca91e5786bb22a7275b143fd4e | [
"MIT"
] | null | null | null | icekat/continuous_kinetics.py | colsen-bu/icekat | 8adf43d719d49fca91e5786bb22a7275b143fd4e | [
"MIT"
] | 5 | 2021-01-26T08:47:10.000Z | 2021-12-10T15:03:26.000Z | import numpy as np
from scipy.special import lambertw
def logWithZeros(x):
'''
return log10 of array that may contain zeros
'''
out = []
if len(x) > 0:
for xi in x:
if xi == 0.:
out.append(0.)
else:
out.append(np.log10(xi))
return ... | 37.915612 | 132 | 0.456154 | import re
from decimal import Decimal
import math
import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
from scipy.interpolate import UnivariateSpline
from scipy.special import lambertw
from lmfit import Model, Parameters
from uncertainties import ufloat
def subsetDf(df, start, end):
result ... | 0 | 0 | 0 | 14,315 | 0 | 2,052 | 0 | 47 | 337 |
b36e5076807ea97b6af1529f77e7445d1e6df4ad | 10,976 | py | Python | bilean/engine/clients/os/nova.py | lvdongbing/bilean | 592f5fb53e3bceee35a01d0171905b282bc9a3db | [
"Apache-2.0"
] | 2 | 2016-01-03T11:20:42.000Z | 2016-01-06T06:41:51.000Z | bilean/engine/clients/os/nova.py | lvdongbing/bilean | 592f5fb53e3bceee35a01d0171905b282bc9a3db | [
"Apache-2.0"
] | null | null | null | bilean/engine/clients/os/nova.py | lvdongbing/bilean | 592f5fb53e3bceee35a01d0171905b282bc9a3db | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 37.20678 | 79 | 0.559676 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 0 | 0 | 0 | 9,997 | 0 | 0 | 0 | 86 | 246 |
52ded18e40f12a9f0fdd9c12188b86a7c45de480 | 20,501 | py | Python | src/ga_attack_gibss.py | masoudhashemi/PermuteAttack | 95155ad10c213be6984c7f1f3d6d76a9f5368a05 | [
"MIT"
] | 3 | 2021-12-20T22:09:14.000Z | 2022-02-12T19:06:19.000Z | src/ga_attack_gibss.py | masoudhashemi/PermuteAttack | 95155ad10c213be6984c7f1f3d6d76a9f5368a05 | [
"MIT"
] | null | null | null | src/ga_attack_gibss.py | masoudhashemi/PermuteAttack | 95155ad10c213be6984c7f1f3d6d76a9f5368a05 | [
"MIT"
] | 1 | 2022-03-24T03:36:41.000Z | 2022-03-24T03:36:41.000Z | import numpy
import numpy as np
np.random.seed(555)
| 30.237463 | 125 | 0.560607 | import copy
import matplotlib.pyplot as plt
import numpy
import numpy as np
import pandas as pd
from tqdm import tqdm
from .utils import _find_cols, _update_feature_name
from .utils import ohe_to_ord as alibi_ohe_to_ord
from .utils import ord_to_ohe as alibi_ord_to_ohe
np.random.seed(555)
def find_samples(data_df,... | 0 | 0 | 0 | 2,884 | 0 | 16,940 | 0 | 84 | 524 |
9cba6d405bee3c82237ecd1e85a13810a3539546 | 254 | py | Python | Codechef/MAY21B/MODEQ.py | mrsayan/competitive-programming | 9260253700b89f42bbcbd5fc91eac4d607abc46b | [
"MIT"
] | 2 | 2021-07-10T10:38:04.000Z | 2021-07-11T17:20:41.000Z | Codechef/MAY21B/MODEQ.py | mrsayan/competitive-programming | 9260253700b89f42bbcbd5fc91eac4d607abc46b | [
"MIT"
] | null | null | null | Codechef/MAY21B/MODEQ.py | mrsayan/competitive-programming | 9260253700b89f42bbcbd5fc91eac4d607abc46b | [
"MIT"
] | null | null | null | //Problem - https://www.codechef.com/MAY21B/problems/MODEQ
for _ in range(int(input())):
n,m = list(map(int,input().split()))
count = 0
mod = [1]*(n+1)
for i in range(2,n+1):
x = m % i
count += mod[x]
for j in range(x,n+1,i):
mod[j] += 1
print(count) | 21.166667 | 58 | 0.606299 | //Problem - https://www.codechef.com/MAY21B/problems/MODEQ
for _ in range(int(input())):
n,m = list(map(int,input().split()))
count = 0
mod = [1]*(n+1)
for i in range(2,n+1):
x = m % i
count += mod[x]
for j in range(x,n+1,i):
mod[j] += 1
print(count) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c67a0fb0d729db33a7a77cb55235f2eaae49fe6e | 2,619 | py | Python | manage.py | TravellerXi/SimpleDrive | ae7f7e3d81247e5c000b15661e9f1b7934f242e9 | [
"MIT"
] | 1 | 2021-05-12T09:53:18.000Z | 2021-05-12T09:53:18.000Z | manage.py | TravellerXi/SimpleDrive | ae7f7e3d81247e5c000b15661e9f1b7934f242e9 | [
"MIT"
] | 1 | 2020-04-15T10:17:52.000Z | 2020-04-15T10:22:42.000Z | manage.py | TravellerXi/SimpleDrive | ae7f7e3d81247e5c000b15661e9f1b7934f242e9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding:utf-8
sqlservername='localhost'
sqluser='simpledrive'
sqlpasswd='simpledrive'
sqldatabase='simpledrive'
| 35.391892 | 196 | 0.58572 | #!/usr/bin/python
# coding:utf-8
import pymysql
from managehtml import *
from md5 import *
import os
sqlservername='localhost'
sqluser='simpledrive'
sqlpasswd='simpledrive'
sqldatabase='simpledrive'
def manageUserandServer(username):
isadmin=''
signupstate = ''
invitecode = ''
with o... | 48 | 0 | 0 | 0 | 0 | 2,317 | 0 | -20 | 168 |
66390a891d9788dd9cacebe606c58c07c34916a7 | 1,274 | py | Python | krysztalki/workDir/tests/test matrices/test_matrices_like_2_x00.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | krysztalki/workDir/tests/test matrices/test_matrices_like_2_x00.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | krysztalki/workDir/tests/test matrices/test_matrices_like_2_x00.py | woblob/Crystal_Symmetry | be2984b4487d6075986ef60822a347d0b0e6b885 | [
"MIT"
] | null | null | null | import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
| 31.073171 | 61 | 0.649922 | import matrices_new_extended as mne
import numpy as np
import sympy as sp
from equality_check import Point
x, y, z = sp.symbols("x y z")
Point.base_point = np.array([x, y, z, 1])
class Test_Axis_2_x00:
def test_matrix_2_x00(self):
expected = Point([ x, -y, -z, 1])
calculated = Point.calculate(mn... | 0 | 0 | 0 | 1,070 | 0 | 0 | 0 | 14 | 45 |
7a341c1f81929e8d7781e6d4103852225beaa2ef | 216 | py | Python | apps/phedex-site-mon/webapp/plotting.py | uobdic/wlcg_site_helpers | 4be0a7beca16f2a3139954a8366bd8f42ad30c74 | [
"Apache-2.0"
] | null | null | null | apps/phedex-site-mon/webapp/plotting.py | uobdic/wlcg_site_helpers | 4be0a7beca16f2a3139954a8366bd8f42ad30c74 | [
"Apache-2.0"
] | null | null | null | apps/phedex-site-mon/webapp/plotting.py | uobdic/wlcg_site_helpers | 4be0a7beca16f2a3139954a8366bd8f42ad30c74 | [
"Apache-2.0"
] | null | null | null | """
Wrap plotting functionality
"""
| 21.6 | 41 | 0.805556 | """
Wrap plotting functionality
"""
from bokeh.embed import components
from bokeh.plotting import figure
from bokeh.resources import INLINE
from bokeh.util.string import encode_utf8
from bokeh.charts import Bar
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 65 | 111 |
1c94d6b56d4b98a1fa0a02b187411ab23ef6a1cc | 34,776 | py | Python | analysis/helper_dyn.py | JannisBush/xs-leaks-browser-web | 15ed76a87c1c30e15cd7d0b070e2853d17d322bc | [
"MIT"
] | null | null | null | analysis/helper_dyn.py | JannisBush/xs-leaks-browser-web | 15ed76a87c1c30e15cd7d0b070e2853d17d322bc | [
"MIT"
] | null | null | null | analysis/helper_dyn.py | JannisBush/xs-leaks-browser-web | 15ed76a87c1c30e15cd7d0b070e2853d17d322bc | [
"MIT"
] | null | null | null | from database_connector import connect, postgresql_to_dataframe
import pandas as pd
from pandas.api.types import CategoricalDtype
import datetime
import textdistance
import difflib
import hashlib
import pickle
from dil_preprocess import get_url_data, basic_pruning
from dil_predict import init, predict_trees, reduce_le... | 50.473149 | 975 | 0.641793 | from database_connector import connect, postgresql_to_dataframe
import pandas as pd
from pandas.api.types import CategoricalDtype
import datetime
import textdistance
import difflib
import hashlib
import pickle
from dil_preprocess import get_url_data, basic_pruning
from dil_predict import init, predict_trees, reduce_le... | 0 | 0 | 0 | 0 | 0 | 4,253 | 0 | 0 | 97 |
eca662788cd559f801e7769e3875702ec68375c3 | 2,874 | py | Python | config_adafruit_dc_sm_hat.py | pootle/pimotors | 8bcf125fdcf7f034537967dad47a4349bf23f504 | [
"Unlicense"
] | 12 | 2018-06-10T15:52:46.000Z | 2020-06-06T21:47:42.000Z | config_adafruit_dc_sm_hat.py | pootle/pimotors | 8bcf125fdcf7f034537967dad47a4349bf23f504 | [
"Unlicense"
] | null | null | null | config_adafruit_dc_sm_hat.py | pootle/pimotors | 8bcf125fdcf7f034537967dad47a4349bf23f504 | [
"Unlicense"
] | 2 | 2019-08-07T05:57:41.000Z | 2020-03-14T12:32:28.000Z | #!/usr/bin/python3
"""
definition file for 2 dc motors on an adafruit DC and stepper motor HAT, 'left' and 'right'.
The motors can have rotary encoders and can use a speed mapping table to provide something approaching a linear response.
The configuration is defined by a list of motors. Each entry in the list define... | 52.254545 | 153 | 0.686152 | #!/usr/bin/python3
"""
definition file for 2 dc motors on an adafruit DC and stepper motor HAT, 'left' and 'right'.
The motors can have rotary encoders and can use a speed mapping table to provide something approaching a linear response.
The configuration is defined by a list of motors. Each entry in the list define... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7871b589ea6d6801224077293817c1fd71bcd75 | 4,461 | py | Python | sniffsniff.py | OldDirty/Snoof | 6dd8e2140409f4586bda30f9c1b713221dd6067f | [
"MIT"
] | 2 | 2017-05-03T12:26:41.000Z | 2022-02-01T09:44:50.000Z | sniffsniff.py | OldDirty/Snoof | 6dd8e2140409f4586bda30f9c1b713221dd6067f | [
"MIT"
] | null | null | null | sniffsniff.py | OldDirty/Snoof | 6dd8e2140409f4586bda30f9c1b713221dd6067f | [
"MIT"
] | null | null | null | import struct
TAB_1 = '\t - '
TAB_2 = '\t\t - '
TAB_3 = '\t\t\t - '
TAB_4 = '\t\t\t\t - '
DATA_TAB_1 = '\t - '
DATA_TAB_2 = '\t\t - '
DATA_TAB_3 = '\t\t\t - '
DATA_TAB_4 = '\t\t\t\t - '
# unpack ethernet frame
# Translate MAC address
# unpack IPv4 packet
# Translate IPv4 address
... | 35.975806 | 147 | 0.619368 | import socket
import struct
import textwrap
TAB_1 = '\t - '
TAB_2 = '\t\t - '
TAB_3 = '\t\t\t - '
TAB_4 = '\t\t\t\t - '
DATA_TAB_1 = '\t - '
DATA_TAB_2 = '\t\t - '
DATA_TAB_3 = '\t\t\t - '
DATA_TAB_4 = '\t\t\t\t - '
def main():
conn = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.ntohs(3... | 0 | 0 | 0 | 0 | 0 | 3,703 | 0 | -14 | 209 |
6cc21d84a60b0eb6466ebf930c01dd7b9aae1f7d | 4,168 | py | Python | scripts/eval_joint_baseline.py | tmills/uda | c9843dc5d955a6ea124f99caa2d3517d91b3d6a7 | [
"Apache-2.0"
] | null | null | null | scripts/eval_joint_baseline.py | tmills/uda | c9843dc5d955a6ea124f99caa2d3517d91b3d6a7 | [
"Apache-2.0"
] | null | null | null | scripts/eval_joint_baseline.py | tmills/uda | c9843dc5d955a6ea124f99caa2d3517d91b3d6a7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
## This script gets a baseline for domain adaptation based on a combined training
## set containing source and target training data. This is a better ceiling for
## adaptation performance than source-source or target-target evaluations.
## This way, if guidelines are different, the discrim... | 45.802198 | 187 | 0.682102 | #!/usr/bin/python
from os.path import join,exists,dirname
import numpy as np
import pickle
from sklearn.datasets import load_svmlight_file, dump_svmlight_file
from sklearn.metrics import f1_score
from uda_common import zero_pivot_columns, zero_nonpivot_columns, read_pivots, evaluate_and_print_scores, align_test_X_train... | 0 | 0 | 0 | 0 | 0 | 2,872 | 0 | 243 | 242 |
1900a9b6fbec1ec0ed7c321dce3564800cb32a78 | 11,676 | py | Python | text_braille_l18n.py | mondeja/inkscape-braille-l18n-ext | 32a3e4c313b0b0dede2066e9757ecd9f028e1f83 | [
"BSD-3-Clause"
] | 2 | 2021-10-09T08:44:51.000Z | 2022-02-04T04:20:54.000Z | text_braille_l18n.py | mondeja/inkscape-braille-l18n-ext | 32a3e4c313b0b0dede2066e9757ecd9f028e1f83 | [
"BSD-3-Clause"
] | 5 | 2021-09-01T09:55:45.000Z | 2021-09-04T00:13:09.000Z | text_braille_l18n.py | mondeja/inkscape-braille-l18n-ext | 32a3e4c313b0b0dede2066e9757ecd9f028e1f83 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# ---------------------------------
# UTILITIES
# Common standards
UPPERCASE_PREFIXES = {
chr(15): 0x2828, # uppercase prefix: https://codepoints.net/U+000F
}
LOUIS_BRAILLE_NUMBERS_PREFIX = 0x283c # Louis Braille's numbers prefix
LOUIS_BRAILLE_NUMBERS = { # Louis Braill... | 23.075099 | 83 | 0.531089 | #!/usr/bin/env python
# coding=utf-8
import inkex
# ---------------------------------
# UTILITIES
# Common standards
UPPERCASE_PREFIXES = {
chr(15): 0x2828, # uppercase prefix: https://codepoints.net/U+000F
}
LOUIS_BRAILLE_NUMBERS_PREFIX = 0x283c # Louis Braille's numbers prefix
LOUIS_BRAILLE_NUMBERS = { ... | 242 | 0 | 0 | 829 | 0 | 627 | 0 | -9 | 72 |
54e0c5d86ec30e4d193c72804913f284cb433cd7 | 23,324 | py | Python | hnn_core/network_builder.py | chenghuzi/hnn-core | b974fed4317b9b03ec732850829d9c17841c6ee2 | [
"BSD-3-Clause"
] | null | null | null | hnn_core/network_builder.py | chenghuzi/hnn-core | b974fed4317b9b03ec732850829d9c17841c6ee2 | [
"BSD-3-Clause"
] | null | null | null | hnn_core/network_builder.py | chenghuzi/hnn-core | b974fed4317b9b03ec732850829d9c17841c6ee2 | [
"BSD-3-Clause"
] | null | null | null | """Neuron simulation functions and NetworkBuilder class."""
# Authors: Mainak Jas <mjas@mgh.harvard.edu>
# Sam Neymotin <samnemo@gmail.com>
# Blake Caldwell <blake_caldwell@brown.edu>
import numpy as np
from neuron import h
# This is due to: https://github.com/neuronsimulator/nrn/pull/746
from neur... | 36.330218 | 91 | 0.592008 | """Neuron simulation functions and NetworkBuilder class."""
# Authors: Mainak Jas <mjas@mgh.harvard.edu>
# Sam Neymotin <samnemo@gmail.com>
# Blake Caldwell <blake_caldwell@brown.edu>
from copy import deepcopy
import numpy as np
from neuron import h
# This is due to: https://github.com/neuronsimul... | 0 | 0 | 0 | 16,983 | 0 | 1,107 | 0 | 85 | 208 |
08698150dd4c0d31ae984574dc2eb2d108201474 | 752 | py | Python | work/2021/ne201076/src/cpu_notify.py | tora01/SkillLab | 61ebfaf45c503b9e6f4a3d05a7edd4de2fcad93e | [
"CC0-1.0"
] | 2 | 2020-09-09T02:40:23.000Z | 2021-09-12T18:08:15.000Z | work/2021/ne201076/src/cpu_notify.py | tora01/SkillLab | 61ebfaf45c503b9e6f4a3d05a7edd4de2fcad93e | [
"CC0-1.0"
] | 1 | 2021-09-14T09:36:38.000Z | 2021-09-14T09:36:38.000Z | work/2021/ne201076/src/cpu_notify.py | tora01/SkillLab | 61ebfaf45c503b9e6f4a3d05a7edd4de2fcad93e | [
"CC0-1.0"
] | 19 | 2021-09-07T06:11:29.000Z | 2021-09-07T07:45:08.000Z | import requests
url = 'https://notify-api.line.me/api/notify'#LINE NotifyAPIURL
token = '2RNdAKwlaj69HK0KlEdMX1y575gDWNKrPpggFcLnh82' #
ms = ""#
while True:
now=dt.('cpu_temps')
dt = getCpuTempFromFile(data_file) #CPU
print(cpu_temps)
if print(cpu_temp) == "print >= 80":#CPU80
line(postdate=me... | 31.333333 | 73 | 0.670213 | import requests
url = 'https://notify-api.line.me/api/notify'#LINE NotifyのAPIのURL
token = '2RNdAKwlaj69HK0KlEdMX1y575gDWNKrPpggFcLnh82' #自分のアクセストークン
ms = "新たなソフトを開くと負担が過剰にかかってしまいます。"#送信する通知内容
def line(message,url,token):
post_data = {'message': message}
headers = {'Authorization': 'Bearer ' + token}
#送信する... | 303 | 0 | 0 | 0 | 0 | 232 | 0 | 0 | 23 |
55ab9601d84308d22c25654e2ba8f67c17be1525 | 375 | py | Python | 27flask/07.ip.py | KEVINYZY/python-tutorial | ae43536908eb8af56c34865f52a6e8644edc4fa3 | [
"Apache-2.0"
] | 2 | 2021-01-04T10:44:44.000Z | 2022-02-13T07:53:41.000Z | 27flask/07.ip.py | zm79287/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | null | null | null | 27flask/07.ip.py | zm79287/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | 2 | 2020-11-23T08:58:51.000Z | 2022-02-13T07:53:42.000Z | # -*- coding: utf-8 -*-
"""
@author:XuMingxuming624@qq.com)
@description:
"""
from flask import Flask
# Initialize the Flask application
app = Flask(__name__)
# Default route, print user's IP
if __name__ == '__main__':
app.run()
| 17.045455 | 49 | 0.677333 | # -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
from flask import Flask, render_template, request
# Initialize the Flask application
app = Flask(__name__)
# Default route, print user's IP
@app.route('/')
def index():
ip = request.remote_addr
return render_template('ip.html', ... | 3 | 86 | 0 | 0 | 0 | 0 | 0 | 26 | 22 |
8eae2f84cdf77d6da63c638758cb38c80b37dc8d | 87 | py | Python | June/app/june/response/response/fetchrandom.py | prafull-pandey/June-Bot | 2a9ed6ed6fb1da15fbeed0c4d84a81cbcb008584 | [
"MIT"
] | null | null | null | June/app/june/response/response/fetchrandom.py | prafull-pandey/June-Bot | 2a9ed6ed6fb1da15fbeed0c4d84a81cbcb008584 | [
"MIT"
] | 3 | 2021-05-21T14:40:09.000Z | 2022-02-10T02:14:46.000Z | June/app/june/response/response/fetchrandom.py | prafull-pandey/June-Bot | 2a9ed6ed6fb1da15fbeed0c4d84a81cbcb008584 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 22:01:45 2020
@author: PRAFULL
"""
| 10.875 | 35 | 0.563218 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 22:01:45 2020
@author: PRAFULL
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6576cbf10335146aa15f4e15987a271d62b2229e | 2,132 | py | Python | acme_test.py | RecursiveOuroboros/DS-Unit-3-Sprint-1-Software-Engineering | 44ac93648d9e7be43006912e18357848ce9e4287 | [
"MIT"
] | null | null | null | acme_test.py | RecursiveOuroboros/DS-Unit-3-Sprint-1-Software-Engineering | 44ac93648d9e7be43006912e18357848ce9e4287 | [
"MIT"
] | null | null | null | acme_test.py | RecursiveOuroboros/DS-Unit-3-Sprint-1-Software-Engineering | 44ac93648d9e7be43006912e18357848ce9e4287 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Part 5: Measure Twice, Test Once
# Jason Meil Attempt 2 DS3 Unit 3 Sprint 1 060219
import unittest
if __name__ == '__main__':
unittest.main()
| 35.533333 | 75 | 0.620075 | #!/usr/bin/env python
# Part 5: Measure Twice, Test Once
# Jason Meil Attempt 2 DS3 Unit 3 Sprint 1 060219
import unittest
from acme_JM import Product
from acme_report import generate_products, ADJECTIVES, NOUNS
class AcmeProductTests(unittest.TestCase):
"""Making sure Acme products are the tops!"""
... | 0 | 0 | 0 | 1,803 | 0 | 0 | 0 | 45 | 96 |
5d2310194e8ed8b707261b949ca20b6736398cf9 | 3,094 | py | Python | igmpwatch/docker/igmpwatch-start.py | GrumpyOldTroll/mnat | bb1c7834fa139ed15f22fc40d9f716c9f7a386c1 | [
"MIT"
] | 3 | 2021-03-11T13:25:39.000Z | 2021-03-13T18:34:33.000Z | igmpwatch/docker/igmpwatch-start.py | GrumpyOldTroll/mnat | bb1c7834fa139ed15f22fc40d9f716c9f7a386c1 | [
"MIT"
] | null | null | null | igmpwatch/docker/igmpwatch-start.py | GrumpyOldTroll/mnat | bb1c7834fa139ed15f22fc40d9f716c9f7a386c1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
stopping=False
if __name__=="__main__":
ret = main(sys.argv)
sys.exit(ret)
| 31.571429 | 115 | 0.659664 | #!/usr/bin/env python3
import argparse
import subprocess
from os.path import isfile
import os
import sys
import time
import signal
from datetime import datetime
stopping=False
def stop_handler(signum, frame):
global stopping
print(f'{datetime.now()}: stopping mnat-ingress wrapper ({os.getpid()})')
stoppin... | 0 | 0 | 0 | 0 | 0 | 2,801 | 0 | -27 | 200 |
e1f3de04be170e888ea397ea19b28cc88f86a6a1 | 7,416 | py | Python | backend/models.py | findyourtune/findyourtune | d27d608e003728ee16f1f09d9233ab9cf1c7a4c3 | [
"MIT"
] | 2 | 2021-01-13T02:32:45.000Z | 2021-01-14T20:55:51.000Z | backend/models.py | findyourtune/findyourtune | d27d608e003728ee16f1f09d9233ab9cf1c7a4c3 | [
"MIT"
] | 3 | 2021-01-29T16:14:49.000Z | 2021-03-19T04:22:20.000Z | backend/models.py | findyourtune/findyourtune | d27d608e003728ee16f1f09d9233ab9cf1c7a4c3 | [
"MIT"
] | null | null | null |
# TODO: Implement Schema for each of our tables
# Marshmallow is used for serialization/deserialization of Python data types for API calls
| 34.816901 | 107 | 0.701996 | from datetime import datetime
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
from backend import db, ma
class Users(db.Model):
__tablename__ = 'users'
user_id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20), unique=True, nu... | 0 | 225 | 0 | 6,512 | 0 | 0 | 0 | 70 | 455 |
6b4290dfc21d95fb0e6010075ab673f3d322260c | 4,081 | py | Python | jarviscli/plugins/file_organise.py | akhil-dh1/Jarvis | dc8ef7b278500575a31bad2f645bbed7cd601022 | [
"MIT"
] | 1 | 2021-08-28T17:00:56.000Z | 2021-08-28T17:00:56.000Z | jarviscli/plugins/file_organise.py | akhil-dh1/Jarvis | dc8ef7b278500575a31bad2f645bbed7cd601022 | [
"MIT"
] | 4 | 2019-09-25T14:20:32.000Z | 2019-09-25T19:04:50.000Z | jarviscli/plugins/file_organise.py | akhil-dh1/Jarvis | dc8ef7b278500575a31bad2f645bbed7cd601022 | [
"MIT"
] | 48 | 2019-09-25T09:08:38.000Z | 2019-10-04T17:35:46.000Z | from __future__ import print_function
| 32.648 | 82 | 0.532222 | from __future__ import print_function
from colorama import Fore
import os
import sys
from plugin import plugin
@plugin('file organise')
class File_Organise():
"""
Type file_organise and follow instructions
It organises selected folder based on extension
"""
def __call__(self, jarvis, s):
... | 0 | 3,946 | 0 | 0 | 0 | 0 | 0 | -15 | 111 |
f5c049e7a2af644b4717c013f09904d229b8a667 | 344 | py | Python | reign_of_grelok.py | adrianrocamora/github_game_off_2018 | a9d452d1d586f215c05ae9559bf02c3b921753ec | [
"MIT"
] | null | null | null | reign_of_grelok.py | adrianrocamora/github_game_off_2018 | a9d452d1d586f215c05ae9559bf02c3b921753ec | [
"MIT"
] | null | null | null | reign_of_grelok.py | adrianrocamora/github_game_off_2018 | a9d452d1d586f215c05ae9559bf02c3b921753ec | [
"MIT"
] | null | null | null | import grelok_subroutines as gs
# TODO: FSM seems like the best approach for this RPG
# TODO: Use JSON format for storing text and FSM
gs.routine_010()
key = gs.routine_100()
gs_100_mapped = gs.routine_100_map(key)
if isinstance(gs_100_mapped, str):
print(gs_100_mapped)
else:
if gs_100_mapped == 17:
... | 21.5 | 53 | 0.729651 | import grelok_subroutines as gs
# TODO: FSM seems like the best approach for this RPG
# TODO: Use JSON format for storing text and FSM
gs.routine_010()
key = gs.routine_100()
gs_100_mapped = gs.routine_100_map(key)
if isinstance(gs_100_mapped, str):
print(gs_100_mapped)
else:
if gs_100_mapped == 17:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62683707f260805bc6ccb8aaaba9ac8053797eaa | 3,534 | py | Python | masonite/providers/AppProvider.py | Kush22/core | fa35675b31f9f24b8233f08e297475ab9a3c0c1d | [
"MIT"
] | null | null | null | masonite/providers/AppProvider.py | Kush22/core | fa35675b31f9f24b8233f08e297475ab9a3c0c1d | [
"MIT"
] | null | null | null | masonite/providers/AppProvider.py | Kush22/core | fa35675b31f9f24b8233f08e297475ab9a3c0c1d | [
"MIT"
] | null | null | null | """ An AppProvider Service Provider """
| 48.410959 | 99 | 0.684493 | """ An AppProvider Service Provider """
from config import application, middleware, storage
from masonite.autoload import Autoload
from masonite.commands import (AuthCommand, CommandCommand, ControllerCommand,
InfoCommand, InstallCommand, JobCommand,
KeyCo... | 0 | 0 | 0 | 2,462 | 0 | 0 | 0 | 785 | 246 |
2d9927fb9998a60c0ba25441861e548aefe38075 | 4,062 | py | Python | dataqs/aqicn/tests.py | OpenGeoscience/data_queues | 305ddbafca9fa02288a1e7788c72e70bc5485320 | [
"Apache-2.0"
] | 9 | 2015-10-02T21:19:08.000Z | 2020-03-18T08:00:22.000Z | dataqs/aqicn/tests.py | OpenGeoscience/data_queues | 305ddbafca9fa02288a1e7788c72e70bc5485320 | [
"Apache-2.0"
] | 45 | 2015-09-28T17:09:39.000Z | 2018-09-05T04:51:21.000Z | dataqs/aqicn/tests.py | OpenGeoscience/data_queues | 305ddbafca9fa02288a1e7788c72e70bc5485320 | [
"Apache-2.0"
] | 10 | 2015-10-10T03:41:00.000Z | 2020-04-02T21:02:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Epidemico Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You ma... | 33.85 | 79 | 0.621615 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Epidemico Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You ma... | 0 | 990 | 0 | 1,250 | 0 | 136 | 0 | 23 | 156 |
367a3a634ac8427273ca4a5fdba3439fbcaa5dd2 | 475 | py | Python | plot_creation_scripts/set_visualise_sd/visualise_sd_change_rate.py | andrewjh9/CenBench | afd960b77ade05be2d2368bed3b47d54f7e229b6 | [
"MIT"
] | null | null | null | plot_creation_scripts/set_visualise_sd/visualise_sd_change_rate.py | andrewjh9/CenBench | afd960b77ade05be2d2368bed3b47d54f7e229b6 | [
"MIT"
] | null | null | null | plot_creation_scripts/set_visualise_sd/visualise_sd_change_rate.py | andrewjh9/CenBench | afd960b77ade05be2d2368bed3b47d54f7e229b6 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
read_dataset_Set_sd = np.genfromtxt('results/set_epochs_200_recording_dis_sd/SET__fashion_mnist_for_200_epochs_20210603-164315_num_sd_None_sd_lap__sd_dis_.csv',delimiter='')
perc_change_sd = np.diff(read_dataset_Set_sd) / read_dataset_Set_sd[:-1] * 100
plt.plot(per... | 29.6875 | 173 | 0.802105 | import matplotlib.pyplot as plt
import numpy as np
import tikzplotlib
read_dataset_Set_sd = np.genfromtxt('results/set_epochs_200_recording_dis_sd/SET__fashion_mnist_for_200_epochs_20210603-164315_num_sd_None_sd_lap__sd_dis_.csv',delimiter='')
perc_change_sd = np.diff(read_dataset_Set_sd) / read_dataset_Set_sd[:-1] *... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
e1d20d610d6814f62bc26d68c9b6ef7421391474 | 1,650 | py | Python | driver/pyutil/caseleds.py | vmedea/hifive1-argb-fx | 7fca657a7b4da9e875e9e7929b3f02f30119e663 | [
"MIT"
] | 1 | 2021-11-17T05:38:28.000Z | 2021-11-17T05:38:28.000Z | driver/pyutil/caseleds.py | vmedea/hifive1-argb-fx | 7fca657a7b4da9e875e9e7929b3f02f30119e663 | [
"MIT"
] | null | null | null | driver/pyutil/caseleds.py | vmedea/hifive1-argb-fx | 7fca657a7b4da9e875e9e7929b3f02f30119e663 | [
"MIT"
] | 1 | 2021-11-17T05:38:32.000Z | 2021-11-17T05:38:32.000Z | '''
Set caseleds led strip through 'f' (frame) command.
A hifive1 running hifive1-argb-fxl must be connected through USB.
'''
UART='/dev/serial/by-id/usb-FTDI_Dual_RS232-HS-if01-port0'
baudrate = 115200
| 33 | 114 | 0.608485 | '''
Set caseleds led strip through 'f' (frame) command.
A hifive1 running hifive1-argb-fxl must be connected through USB.
'''
import math
import serial
from pyutil.delayedkeyboardinterrupt import DelayedKeyboardInterrupt
UART='/dev/serial/by-id/usb-FTDI_Dual_RS232-HS-if01-port0'
baudrate = 115200
def _toint(p):
... | 0 | 0 | 0 | 1,241 | 0 | 40 | 0 | 29 | 136 |
02441c8532531cb36f04cc0f542bdb01b0ed7cc8 | 643 | py | Python | plugins/hippocampe/icon_hippocampe/actions/sched_report/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/hippocampe/icon_hippocampe/actions/sched_report/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/hippocampe/icon_hippocampe/actions/sched_report/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z |
# Custom imports below
| 33.842105 | 162 | 0.690513 | import komand
from .schema import SchedReportInput, SchedReportOutput
# Custom imports below
class SchedReport(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="sched_report",
description="Check if an indexation has been launched within threshold (by ... | 0 | 0 | 0 | 525 | 0 | 0 | 0 | 26 | 67 |
d99be01d29699c8c977a450b35bae920ee763e51 | 799 | py | Python | src/0029两数相加/index.py | zzh2036/OneDayOneLeetcode | 1198692e68f8f0dbf15555e45969122e1a92840a | [
"MIT"
] | null | null | null | src/0029两数相加/index.py | zzh2036/OneDayOneLeetcode | 1198692e68f8f0dbf15555e45969122e1a92840a | [
"MIT"
] | null | null | null | src/0029两数相加/index.py | zzh2036/OneDayOneLeetcode | 1198692e68f8f0dbf15555e45969122e1a92840a | [
"MIT"
] | null | null | null | '''
0 0
(2 -> 4 -> 3) + (5 -> 6 -> 4)
7 -> 0 -> 8
342 + 465 = 807
'''
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
| 25.774194 | 68 | 0.543179 | '''
给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。
如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。
您可以假设除了数字 0 之外,这两个数都不会以 0 开头。
示例:
输入:(2 -> 4 -> 3) + (5 -> 6 -> 4)
输出:7 -> 0 -> 8
原因:342 + 465 = 807
'''
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
#... | 450 | 0 | 0 | 412 | 0 | 0 | 0 | 0 | 23 |
fd2f32cad3d6535ea832c76e9067a5bf9aa4c8f3 | 852 | py | Python | Python/2021/Class 1/Student Code/Shaurya Gupta/assignment2.py | aravg12/summer-of-qode | bd9d11cd6ca41e4b19f25a0248ba25a7582b20e6 | [
"MIT"
] | 14 | 2021-05-30T08:18:59.000Z | 2021-06-08T14:28:18.000Z | Python/2021/Class 1/Student Code/Shaurya Gupta/assignment2.py | aravg12/summer-of-qode | bd9d11cd6ca41e4b19f25a0248ba25a7582b20e6 | [
"MIT"
] | 3 | 2021-06-02T15:26:16.000Z | 2021-06-06T10:17:39.000Z | Python/2021/Class 1/Student Code/Shaurya Gupta/assignment2.py | aravg12/summer-of-qode | bd9d11cd6ca41e4b19f25a0248ba25a7582b20e6 | [
"MIT"
] | 47 | 2021-05-26T14:59:12.000Z | 2021-06-12T12:01:57.000Z | # 2 tea shops sell tea at the price of 15 and 30 rupees per cup. Input the number of cups a person buys from the first shop, then input the number of cups a person buys from the second shop and tell the customer the total bill.
price_first_shop = 15
price_second_shop = 30
items_first_shop = int(input("How many tea cup... | 47.333333 | 227 | 0.694836 | # 2 tea shops sell tea at the price of 15 and 30 rupees per cup. Input the number of cups a person buys from the first shop, then input the number of cups a person buys from the second shop and tell the customer the total bill.
price_first_shop = 15
price_second_shop = 30
items_first_shop = int(input("How many tea cup... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f623724d488f736dc1a7469ca38795406789185d | 15,814 | py | Python | src/vocoder_and_synthesize_for_merlin.py | shartoo/merlin-tf-slim | 4c7d48d5f634273dd51d2e29562d3ed1195d9151 | [
"Apache-2.0"
] | null | null | null | src/vocoder_and_synthesize_for_merlin.py | shartoo/merlin-tf-slim | 4c7d48d5f634273dd51d2e29562d3ed1195d9151 | [
"Apache-2.0"
] | null | null | null | src/vocoder_and_synthesize_for_merlin.py | shartoo/merlin-tf-slim | 4c7d48d5f634273dd51d2e29562d3ed1195d9151 | [
"Apache-2.0"
] | null | null | null | import multiprocessing as mp
import os
import shutil
import sys
import time
import numpy as np
# from tool_packages.magphase import libutils as lu
# from tool_packages.magphase import magphase as mp
from util import file_util, log_util, system_cmd_util
log = log_util.get_logger("extract vocoder features")
fs_nFFT_d... | 40.548718 | 124 | 0.646769 | import multiprocessing as mp
import os
import shutil
import sys
import time
import numpy as np
# from tool_packages.magphase import libutils as lu
# from tool_packages.magphase import magphase as mp
from util import file_util, log_util, system_cmd_util
log = log_util.get_logger("extract vocoder features")
fs_nFFT_d... | 0 | 0 | 0 | 0 | 0 | 307 | 0 | 0 | 27 |
ad15ae8d70610adc409407248f5dde878afa9d43 | 3,125 | py | Python | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/torch_op_attr.py | Carles-Figuerola/Vitis-AI | fc043ea4aca1f9fe4e18962e6a6ae397812bb34b | [
"Apache-2.0"
] | 1 | 2020-12-18T14:49:19.000Z | 2020-12-18T14:49:19.000Z | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/torch_op_attr.py | cy333/Vitis-AI | 611b82cfc32ea2fe04491432bf8feed1f378c9de | [
"Apache-2.0"
] | null | null | null | tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/torch_op_attr.py | cy333/Vitis-AI | 611b82cfc32ea2fe04491432bf8feed1f378c9de | [
"Apache-2.0"
] | null | null | null |
#
# Copyright 2019 Xilinx Inc.
#
# 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 writi... | 32.894737 | 93 | 0.70656 |
#
# Copyright 2019 Xilinx Inc.
#
# 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 writi... | 0 | 0 | 0 | 1,607 | 0 | 692 | 0 | 10 | 183 |
98c7955f0aa71330093f68c76d93f51f67058010 | 3,619 | py | Python | plato/datasources/registry.py | cuiboyuan/plato | 260b785cbbf8588c92331d6343211ff72321f90e | [
"Apache-2.0"
] | 135 | 2021-04-14T09:06:08.000Z | 2022-03-31T03:38:42.000Z | plato/datasources/registry.py | cuiboyuan/plato | 260b785cbbf8588c92331d6343211ff72321f90e | [
"Apache-2.0"
] | 39 | 2021-05-16T00:34:08.000Z | 2022-03-10T22:03:57.000Z | plato/datasources/registry.py | cuiboyuan/plato | 260b785cbbf8588c92331d6343211ff72321f90e | [
"Apache-2.0"
] | 41 | 2021-04-14T10:40:07.000Z | 2022-03-28T10:24:20.000Z | """
Having a registry of all available classes is convenient for retrieving an instance
based on a configuration at run-time.
"""
import logging
from collections import OrderedDict
from plato.config import Config
if hasattr(Config().trainer, 'use_mindspore'):
from plato.datasources.mindspore import (mnist as mni... | 34.141509 | 91 | 0.626416 | """
Having a registry of all available classes is convenient for retrieving an instance
based on a configuration at run-time.
"""
import logging
from collections import OrderedDict
from plato.config import Config
if hasattr(Config().trainer, 'use_mindspore'):
from plato.datasources.mindspore import (
mni... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 113 | 0 |
9175a174ec15b6d4399ccea3237c4583129e9d8e | 4,486 | py | Python | Preprocess.py | ecstayalive/Degenerate-capsule-neural-network | 8817a5d20832f018759d27343678c9cbb1ede893 | [
"MIT"
] | 2 | 2021-05-15T02:18:05.000Z | 2022-03-14T12:18:19.000Z | Preprocess.py | ecstayalive/Degenerate-capsule-neural-network | 8817a5d20832f018759d27343678c9cbb1ede893 | [
"MIT"
] | null | null | null | Preprocess.py | ecstayalive/Degenerate-capsule-neural-network | 8817a5d20832f018759d27343678c9cbb1ede893 | [
"MIT"
] | null | null | null | '''
This project is derived from the course work
and is an extension of the course work. Due
to the source of the dataset itself, the
dataset needs to be pre-processed before it
can be called.
Author: Bruce Hou, Email: ecstayalive@163.com
'''
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main_... | 29.708609 | 93 | 0.552162 | '''
This project is derived from the course work
and is an extension of the course work. Due
to the source of the dataset itself, the
dataset needs to be pre-processed before it
can be called.
Author: Bruce Hou, Email: ecstayalive@163.com
'''
import scipy.io as scio
import matplotlib.pyplot as plt
import numpy as np
... | 555 | 0 | 0 | 3,359 | 0 | 0 | 0 | -10 | 68 |
103b4cb5988fee4863c7d3c66d5d661c846093fe | 4,231 | py | Python | tests/test_operator_validator.py | venairus/pynairus | 76227072aa0f0f98a36a3a04eb6a436473cfd9a6 | [
"MIT"
] | 2 | 2018-02-15T12:16:10.000Z | 2018-09-11T12:05:12.000Z | tests/test_operator_validator.py | venairus/pynairus | 76227072aa0f0f98a36a3a04eb6a436473cfd9a6 | [
"MIT"
] | null | null | null | tests/test_operator_validator.py | venairus/pynairus | 76227072aa0f0f98a36a3a04eb6a436473cfd9a6 | [
"MIT"
] | 1 | 2019-10-30T09:40:28.000Z | 2019-10-30T09:40:28.000Z | # coding: utf-8
"""Unit tests for operator validator."""
| 39.175926 | 77 | 0.658237 | # coding: utf-8
"""Unit tests for operator validator."""
import unittest
import pynairus.validators.operator_validator as ov
from pynairus.errors.app_error import ValidateError
from pynairus.errors.app_error import BadArgumentError
class ValidatorsTest(unittest.TestCase):
"""Unit tests for all Validator classes... | 0 | 0 | 0 | 3,973 | 0 | 0 | 0 | 87 | 112 |
a5d84daebe018951997d4c759b010b9e2f019fb7 | 4,734 | py | Python | src/visionScripts/computerVision.py | dtmotr123/CubeStack | b4410b3ab0c0e2a94165c9ed9a905d47ffadb41d | [
"MIT"
] | null | null | null | src/visionScripts/computerVision.py | dtmotr123/CubeStack | b4410b3ab0c0e2a94165c9ed9a905d47ffadb41d | [
"MIT"
] | null | null | null | src/visionScripts/computerVision.py | dtmotr123/CubeStack | b4410b3ab0c0e2a94165c9ed9a905d47ffadb41d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#Thanks to https://github.com/kyle-elsalhi/opencv-examples
import numpy as np
#Computer Vision Imports
import cv2
import cv2.aruco as aruco
import os
import pickle
#ROS imports
import rospy
from rospy_tutorials.msg import Floats
from rospy.numpy_msg import numpy_msg
import roslib; roslib.load_ma... | 34.304348 | 114 | 0.651669 | #!/usr/bin/env python
#Thanks to https://github.com/kyle-elsalhi/opencv-examples
import numpy as np
#Computer Vision Imports
import cv2
import cv2.aruco as aruco
import os
import pickle
import time
import sys
#ROS imports
import rospy
from std_msgs.msg import String
from rospy_tutorials.msg import Floats
from rospy.n... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 132 |
a1f3b1a10e3e0e5b3367df03b1dd56c166890fa1 | 30,912 | py | Python | pyspedas/utilities/cotrans_lib.py | supervised/pyspedas-1 | f408d1fb5390c0a64c163dc85dd14dffc5b1ab51 | [
"MIT"
] | null | null | null | pyspedas/utilities/cotrans_lib.py | supervised/pyspedas-1 | f408d1fb5390c0a64c163dc85dd14dffc5b1ab51 | [
"MIT"
] | null | null | null | pyspedas/utilities/cotrans_lib.py | supervised/pyspedas-1 | f408d1fb5390c0a64c163dc85dd14dffc5b1ab51 | [
"MIT"
] | null | null | null | """
Functions for coordinate transformations.
Contains trasformations from/to the following coordinate systems:
GSE, GSM, SM, GEI, GEO, MAG, J2000
Times are in Unix seconds for consistency.
Notes
-----
These functions are in cotrans_lib.pro of IDL SPEDAS.
For a comparison to IDL, see: http://spedas.org/wiki/index.ph... | 23.8151 | 77 | 0.55066 | """
Functions for coordinate transformations.
Contains trasformations from/to the following coordinate systems:
GSE, GSM, SM, GEI, GEO, MAG, J2000
Times are in Unix seconds for consistency.
Notes
-----
These functions are in cotrans_lib.pro of IDL SPEDAS.
For a comparison to IDL, see: http://spedas.org/wiki/index.ph... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4cfa0475513474da4453888c362608959447c58a | 5,031 | py | Python | samples/incident.py | jkinred/opsgenie-python-sdk | 69bbd671d2257c6c3ab2f3f113cb62bd1a941c02 | [
"Apache-2.0"
] | null | null | null | samples/incident.py | jkinred/opsgenie-python-sdk | 69bbd671d2257c6c3ab2f3f113cb62bd1a941c02 | [
"Apache-2.0"
] | null | null | null | samples/incident.py | jkinred/opsgenie-python-sdk | 69bbd671d2257c6c3ab2f3f113cb62bd1a941c02 | [
"Apache-2.0"
] | null | null | null | import sys
if __name__ == '__main__':
main(sys.argv[1:])
| 32.25 | 103 | 0.6613 | import getopt
import json
import sys
import opsgenie_sdk
from opsgenie_sdk.metrics.observer import Observer
from opsgenie_sdk.rest import ApiException
class MetricObserver(Observer):
def notify(self, publisher):
print("{}: '{}' has now metric data = {}".format(type(self).__name__,
... | 0 | 0 | 0 | 3,025 | 0 | 1,730 | 0 | 30 | 180 |
d99fab406d030f9afa9f9f70922bbdb0de001eb5 | 8,646 | py | Python | containers/Heap.py | mjotsuka/conts | 1b96908256c4cb92f82fdadc9dc1dfccd9bc857d | [
"MIT"
] | null | null | null | containers/Heap.py | mjotsuka/conts | 1b96908256c4cb92f82fdadc9dc1dfccd9bc857d | [
"MIT"
] | null | null | null | containers/Heap.py | mjotsuka/conts | 1b96908256c4cb92f82fdadc9dc1dfccd9bc857d | [
"MIT"
] | null | null | null | '''
This file implements the Heap data structure as a subclass
of the BinaryTree.
The book implements Heaps using an *implicit* tree with an
*explicit* vector implementation,
so the code in the book is likely to be less helpful than the
code for the other data structures.
The book's implementation is the traditional im... | 32.503759 | 77 | 0.583969 | '''
This file implements the Heap data structure as a subclass
of the BinaryTree.
The book implements Heaps using an *implicit* tree with an
*explicit* vector implementation,
so the code in the book is likely to be less helpful than the
code for the other data structures.
The book's implementation is the traditional im... | 0 | 3,331 | 0 | 4,709 | 0 | 0 | 0 | 29 | 46 |
ce65b2e4a4e7c2e46a9bdf8a166d553082dd3deb | 2,993 | py | Python | pythonscript/generate_cffi_bindings.py | ktksgit/godot-python | d50a29203d0744754e59eb9cb13263e907ba7ee3 | [
"CC-BY-3.0"
] | null | null | null | pythonscript/generate_cffi_bindings.py | ktksgit/godot-python | d50a29203d0744754e59eb9cb13263e907ba7ee3 | [
"CC-BY-3.0"
] | null | null | null | pythonscript/generate_cffi_bindings.py | ktksgit/godot-python | d50a29203d0744754e59eb9cb13263e907ba7ee3 | [
"CC-BY-3.0"
] | null | null | null | #! /usr/bin/env python3
try:
except ImportError:
raise SystemExit("Module cffi is missing, install it with `pip install cffi`")
import os
import argparse
BASEDIR = os.path.dirname(os.path.abspath(__file__))
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate CFFI binding .c... | 30.540816 | 84 | 0.665219 | #! /usr/bin/env python3
try:
import cffi
except ImportError:
raise SystemExit("Module cffi is missing, install it with `pip install cffi`")
import os
import argparse
BASEDIR = os.path.dirname(os.path.abspath(__file__))
def strip_hashed_src(src):
return "\n".join([l for l in src.split("\n") if not l.st... | 0 | 0 | 0 | 0 | 0 | 2,361 | 0 | -10 | 72 |