hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6974d6a83f6a227925d8831fb50dc2fdc12872cc | 725 | py | Python | src/PyMud/Systems/system_set.py | NichCritic/pymud | 583ec16f5a75dc7b45146564b39851291dc07b6c | [
"MIT"
] | null | null | null | src/PyMud/Systems/system_set.py | NichCritic/pymud | 583ec16f5a75dc7b45146564b39851291dc07b6c | [
"MIT"
] | null | null | null | src/PyMud/Systems/system_set.py | NichCritic/pymud | 583ec16f5a75dc7b45146564b39851291dc07b6c | [
"MIT"
] | null | null | null | '''
Created on 2014-03-23
@author: Nich
'''
class SystemSet(object):
'''
classdocs
'''
| 20.714286 | 56 | 0.56 | '''
Created on 2014-03-23
@author: Nich
'''
class SystemSet(object):
'''
classdocs
'''
def __init__(self):
self.systems = []
def register(self, system):
self.systems.append(system)
def process(self):
for sys in self.systems:
sys.process()... | 396 | 8 | 189 |
a5bd55cc5f2207fad855a078dc75c8ec3a69d072 | 2,940 | py | Python | Coverage and Robustness VS. Training Datasets/retrain_robustness.py | jiekeshi/CovTesting_Replication | fd647f4f4a455857476366571af6c7afb50ddab0 | [
"MIT"
] | 1 | 2022-01-18T06:56:10.000Z | 2022-01-18T06:56:10.000Z | Coverage and Robustness VS. Training Datasets/retrain_robustness.py | jiekeshi/CovTesting_Replication | fd647f4f4a455857476366571af6c7afb50ddab0 | [
"MIT"
] | 1 | 2022-03-14T09:21:07.000Z | 2022-03-14T09:32:03.000Z | Coverage and Robustness VS. Training Datasets/retrain_robustness.py | jiekeshi/CovTesting_Replication | fd647f4f4a455857476366571af6c7afb50ddab0 | [
"MIT"
] | 4 | 2022-01-16T05:14:50.000Z | 2022-02-13T16:00:10.000Z | import argparse
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import tensorflow as tf
import os
from helper import AttackEvaluate
from helper import load_data, retrain
####for solving some specific problems, don't care
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
... | 36.75 | 101 | 0.639796 | import argparse
import warnings
warnings.filterwarnings("ignore")
import numpy as np
import tensorflow as tf
import os
from helper import AttackEvaluate
from helper import load_data, retrain
####for solving some specific problems, don't care
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
... | 0 | 0 | 0 |
ff877471efd0f367627c1eeb79f89e4b8f210970 | 318 | py | Python | checklist/migrations/0017_remove_item_priority.py | cagandhi/Checklist-Django | c8edf1d8f821900a71f36abd34a76663d8d8f7da | [
"Apache-2.0"
] | 3 | 2021-07-02T07:35:19.000Z | 2022-01-14T11:14:14.000Z | checklist/migrations/0017_remove_item_priority.py | cagandhi/Checklist-Django | c8edf1d8f821900a71f36abd34a76663d8d8f7da | [
"Apache-2.0"
] | 57 | 2021-01-31T23:39:57.000Z | 2022-03-12T00:47:23.000Z | checklist/migrations/0017_remove_item_priority.py | cagandhi/Checklist-Django | c8edf1d8f821900a71f36abd34a76663d8d8f7da | [
"Apache-2.0"
] | 3 | 2021-08-29T21:46:54.000Z | 2022-03-24T13:10:00.000Z | # Generated by Django 3.0.4 on 2020-06-10 22:56
from django.db import migrations
| 17.666667 | 47 | 0.578616 | # Generated by Django 3.0.4 on 2020-06-10 22:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("checklist", "0016_follow"),
]
operations = [
migrations.RemoveField(
model_name="item",
name="priority",
),
]
| 0 | 212 | 23 |
5961069052dd0dd1806ed16f88856d4914292264 | 4,948 | py | Python | Source/NBAAnalysis.py | evangelos-zafeiratos/NBADataAnalysis | 11e8e0016c856d23b83b945f1a5fba4f12e459f6 | [
"MIT"
] | null | null | null | Source/NBAAnalysis.py | evangelos-zafeiratos/NBADataAnalysis | 11e8e0016c856d23b83b945f1a5fba4f12e459f6 | [
"MIT"
] | null | null | null | Source/NBAAnalysis.py | evangelos-zafeiratos/NBADataAnalysis | 11e8e0016c856d23b83b945f1a5fba4f12e459f6 | [
"MIT"
] | null | null | null | import pandas as pd
import os
path = r'C:\Users\Vangelis\Desktop\Courses & Projects\Data Analysis Projects\NBA Datasets Analysis\Data'
os.chdir(path)
#seasonList1 = ['1996_1997']
seasonList = ['1996_1997',
'1997_1998',
'1998_1999',
'1999_2000',
'2000_... | 44.178571 | 165 | 0.600647 | import pandas as pd
import os
path = r'C:\Users\Vangelis\Desktop\Courses & Projects\Data Analysis Projects\NBA Datasets Analysis\Data'
os.chdir(path)
#seasonList1 = ['1996_1997']
seasonList = ['1996_1997',
'1997_1998',
'1998_1999',
'1999_2000',
'2000_... | 3,777 | 0 | 25 |
218a5bf812161a6e6be4a850c04fcd64e1237f6e | 421 | py | Python | chess/try_chess.py | nivm/learningchess | e22e019af7a85c91a27cd10ae2759be0d00bcda3 | [
"Apache-2.0"
] | null | null | null | chess/try_chess.py | nivm/learningchess | e22e019af7a85c91a27cd10ae2759be0d00bcda3 | [
"Apache-2.0"
] | 1 | 2016-03-22T10:39:44.000Z | 2016-03-22T10:39:57.000Z | chess/try_chess.py | nivm/learningchess | e22e019af7a85c91a27cd10ae2759be0d00bcda3 | [
"Apache-2.0"
] | null | null | null | import chess
board = chess.Bitboard()
board.push_san("e4")
board.push_san("e5")
board.push_san("Qh5")
board.push_san("Nc6")
board.push_san("Bc4")
board.push_san("Nf6")
board.push_san("Qxf7")
print "is_checkmate: " +str(board.is_checkmate())
print "is_stalemate: " +str(board.is_stalemate())
print "is_insufficient_materi... | 32.384615 | 73 | 0.752969 | import chess
board = chess.Bitboard()
board.push_san("e4")
board.push_san("e5")
board.push_san("Qh5")
board.push_san("Nc6")
board.push_san("Bc4")
board.push_san("Nf6")
board.push_san("Qxf7")
print "is_checkmate: " +str(board.is_checkmate())
print "is_stalemate: " +str(board.is_stalemate())
print "is_insufficient_materi... | 0 | 0 | 0 |
b169f82d5dd9d6eaa6899d1747708c18d34f2b19 | 1,007 | py | Python | Longest Substring Without Repeating Characters.py | H-isaac23/Data-Structures | 2a860549ebc87155cdcf98ca951f1e345dd40499 | [
"MIT"
] | null | null | null | Longest Substring Without Repeating Characters.py | H-isaac23/Data-Structures | 2a860549ebc87155cdcf98ca951f1e345dd40499 | [
"MIT"
] | null | null | null | Longest Substring Without Repeating Characters.py | H-isaac23/Data-Structures | 2a860549ebc87155cdcf98ca951f1e345dd40499 | [
"MIT"
] | null | null | null | """Given a string s, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Example 3:
Input: s = "pwwkew"
O... | 22.886364 | 91 | 0.590864 | """Given a string s, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
Example 3:
Input: s = "pwwkew"
O... | 347 | -6 | 49 |
e2d8c4a198ef6dfc64fe8d7c70606f3455944daa | 2,838 | py | Python | 05/1_string.py | Saeedmoeen/ArcaPython | 1ab529224e51252220ee376dd88e9dff02427685 | [
"Apache-2.0"
] | null | null | null | 05/1_string.py | Saeedmoeen/ArcaPython | 1ab529224e51252220ee376dd88e9dff02427685 | [
"Apache-2.0"
] | 3 | 2021-12-23T14:05:38.000Z | 2021-12-24T07:09:02.000Z | 05/1_string.py | Saeedmoeen/ArcaPython | 1ab529224e51252220ee376dd88e9dff02427685 | [
"Apache-2.0"
] | 1 | 2021-12-23T13:59:43.000Z | 2021-12-23T13:59:43.000Z | # define string
# - method 1
first_name = 'kaveh'
# - method 2
last_name = "mehrbanian"
# - method 3(multi-line)
bio = '''this is
about me
'''
# - method 4(multi-line)
description = """some description
about kaveh mehrbanian
"""
# access characters in string
first_name[1] # 'a'
first_name[3] # 'e'
bio[-2] ... | 24.465517 | 74 | 0.536646 | # define string
# - method 1
first_name = 'kaveh'
# - method 2
last_name = "mehrbanian"
# - method 3(multi-line)
bio = '''this is
about me
'''
# - method 4(multi-line)
description = """some description
about kaveh mehrbanian
"""
# access characters in string
first_name[1] # 'a'
first_name[3] # 'e'
bio[-2] ... | 0 | 0 | 0 |
d9220938425bab243063ef3c7462642788623fd1 | 511 | py | Python | kubernetes_typed/client/models/v1_node_system_info.py | nikhiljha/kubernetes-typed | 4f4b969aa400c88306f92560e56bda6d19b2a895 | [
"Apache-2.0"
] | 22 | 2020-12-10T13:06:02.000Z | 2022-02-13T21:58:15.000Z | kubernetes_typed/client/models/v1_node_system_info.py | nikhiljha/kubernetes-typed | 4f4b969aa400c88306f92560e56bda6d19b2a895 | [
"Apache-2.0"
] | 4 | 2021-03-08T07:06:12.000Z | 2022-03-29T23:41:45.000Z | kubernetes_typed/client/models/v1_node_system_info.py | nikhiljha/kubernetes-typed | 4f4b969aa400c88306f92560e56bda6d19b2a895 | [
"Apache-2.0"
] | 2 | 2021-09-05T19:18:28.000Z | 2022-03-14T02:56:17.000Z | # Code generated by `typeddictgen`. DO NOT EDIT.
"""V1NodeSystemInfoDict generated type."""
from typing import TypedDict
V1NodeSystemInfoDict = TypedDict(
"V1NodeSystemInfoDict",
{
"architecture": str,
"bootID": str,
"containerRuntimeVersion": str,
"kernelVersion": str,
... | 24.333333 | 48 | 0.60274 | # Code generated by `typeddictgen`. DO NOT EDIT.
"""V1NodeSystemInfoDict generated type."""
from typing import TypedDict
V1NodeSystemInfoDict = TypedDict(
"V1NodeSystemInfoDict",
{
"architecture": str,
"bootID": str,
"containerRuntimeVersion": str,
"kernelVersion": str,
... | 0 | 0 | 0 |
7e7469b0a9eb83cec04780d4611d15a284750e89 | 5,189 | py | Python | tests/models/test_organization_model.py | KVGarg/openhub-django | b782ae38e110ba1259abb305a9ec870d55b2456b | [
"MIT"
] | 5 | 2018-08-13T20:42:48.000Z | 2021-01-19T15:55:56.000Z | tests/models/test_organization_model.py | KVGarg/openhub-django | b782ae38e110ba1259abb305a9ec870d55b2456b | [
"MIT"
] | 5 | 2018-08-21T11:08:42.000Z | 2021-01-19T15:55:52.000Z | tests/models/test_organization_model.py | KVGarg/openhub-django | b782ae38e110ba1259abb305a9ec870d55b2456b | [
"MIT"
] | 1 | 2019-06-16T13:18:54.000Z | 2019-06-16T13:18:54.000Z | from django.test import TestCase
from openhub_django.models import (
InfographicDetail,
Organization)
| 37.875912 | 79 | 0.68915 | from django.test import TestCase
from openhub_django.models import (
InfographicDetail,
Organization)
class OrganizationModelTest(TestCase):
@classmethod
def setUpTestData(cls):
# Set up non-modified objects used by all methods
infographic_details = InfographicDetail.objects.create(
... | 4,912 | 142 | 23 |
2c419e822094f494d43915d9b744776da8be576a | 7,662 | py | Python | server/fb_folder/fb_module.py | dundarahmet/plc_firebase_server | 0ebf1093468174c4079c8faa4651181e1298f5f6 | [
"Apache-2.0"
] | null | null | null | server/fb_folder/fb_module.py | dundarahmet/plc_firebase_server | 0ebf1093468174c4079c8faa4651181e1298f5f6 | [
"Apache-2.0"
] | null | null | null | server/fb_folder/fb_module.py | dundarahmet/plc_firebase_server | 0ebf1093468174c4079c8faa4651181e1298f5f6 | [
"Apache-2.0"
] | null | null | null | import firebase_admin as fb
from firebase_admin import db
from json import load
from requests import get
from fb_folder import fb_exception
import logging
class Firebase(db.Reference):
"""Firebase object"""
def __init__(self, key_path, options=None):
"""a main contructor of firebase objects"""
... | 31.020243 | 108 | 0.548943 | import firebase_admin as fb
from firebase_admin import db
from json import load
from requests import get
from fb_folder import fb_exception
import logging
class Firebase(db.Reference):
"""Firebase object"""
def __init__(self, key_path, options=None):
"""a main contructor of firebase objects"""
... | 155 | 0 | 26 |
045899c42059567ffd733f794f0bc0325d6a6a73 | 645 | py | Python | visual_dynamics/envs/__init__.py | alexlee-gk/visual_dynamics | 90227bb0d0aebb1989117b5c25ca311655ca7cc7 | [
"MIT"
] | 30 | 2017-04-05T12:55:09.000Z | 2022-03-14T14:31:31.000Z | visual_dynamics/envs/__init__.py | alexlee-gk/visual_dynamics | 90227bb0d0aebb1989117b5c25ca311655ca7cc7 | [
"MIT"
] | 1 | 2017-06-19T02:39:03.000Z | 2017-06-19T02:39:03.000Z | visual_dynamics/envs/__init__.py | alexlee-gk/visual_dynamics | 90227bb0d0aebb1989117b5c25ca311655ca7cc7 | [
"MIT"
] | 13 | 2017-04-05T12:55:09.000Z | 2021-03-16T01:59:12.000Z | from .base import Env
from .env_spec import EnvSpec
try:
from .servoing_env import ServoingEnv
from .panda3d_env import Panda3dEnv
from .car_panda3d_env import CarPanda3dEnv, StraightCarPanda3dEnv, SimpleGeometricCarPanda3dEnv, GeometricCarPanda3dEnv
from .quad_panda3d_env import SimpleQuadPanda3dEnv, P... | 30.714286 | 123 | 0.8 | from .base import Env
from .env_spec import EnvSpec
try:
from .servoing_env import ServoingEnv
from .panda3d_env import Panda3dEnv
from .car_panda3d_env import CarPanda3dEnv, StraightCarPanda3dEnv, SimpleGeometricCarPanda3dEnv, GeometricCarPanda3dEnv
from .quad_panda3d_env import SimpleQuadPanda3dEnv, P... | 0 | 0 | 0 |
a9e8fa558c0c0d39889a5e51080e0cc6c57bcca8 | 78 | py | Python | run.py | raytroop/cnn_handwritten_chinese_recognition | 6177600f393c8dc778f61fd5c3c1815e669cd04c | [
"MIT"
] | null | null | null | run.py | raytroop/cnn_handwritten_chinese_recognition | 6177600f393c8dc778f61fd5c3c1815e669cd04c | [
"MIT"
] | null | null | null | run.py | raytroop/cnn_handwritten_chinese_recognition | 6177600f393c8dc778f61fd5c3c1815e669cd04c | [
"MIT"
] | null | null | null | from app import launch_server
if __name__ == '__main__':
launch_server()
| 15.6 | 29 | 0.730769 | from app import launch_server
if __name__ == '__main__':
launch_server()
| 0 | 0 | 0 |
22701551847c02607d67f8d99f47a352ff368dc1 | 1,248 | py | Python | libraries/permutations.py | yoratoni/Euler-Python | 8272eed12162a9bdc33302554bb1af30e56a3e8b | [
"MIT"
] | null | null | null | libraries/permutations.py | yoratoni/Euler-Python | 8272eed12162a9bdc33302554bb1af30e56a3e8b | [
"MIT"
] | null | null | null | libraries/permutations.py | yoratoni/Euler-Python | 8272eed12162a9bdc33302554bb1af30e56a3e8b | [
"MIT"
] | null | null | null | from collections import Counter
from libraries import Digits
from math import factorial
| 26 | 77 | 0.552885 | from collections import Counter
from libraries import Digits
from math import factorial
class Permutations:
@staticmethod
def is_permutation(n0: int, n1: int) -> bool:
'''Check if a number is a permutation of another.
Args:
n0 (int): The first number to check.
n1 (int)... | 0 | 1,132 | 23 |
b15b181017a1f34dc107590d32565e8265aa2e5c | 1,731 | py | Python | stograde/specs/download_specs.py | babatana/stograde | c1c447e99c44c23cef9dd857e669861f3708ae77 | [
"MIT"
] | 7 | 2016-08-05T00:41:11.000Z | 2019-08-22T11:12:10.000Z | stograde/specs/download_specs.py | babatana/stograde | c1c447e99c44c23cef9dd857e669861f3708ae77 | [
"MIT"
] | 145 | 2016-08-04T01:07:11.000Z | 2019-09-09T22:07:13.000Z | stograde/specs/download_specs.py | babatana/stograde | c1c447e99c44c23cef9dd857e669861f3708ae77 | [
"MIT"
] | 3 | 2017-02-06T21:52:46.000Z | 2019-02-18T10:35:01.000Z | import sys
from ..common import chdir, run
from ..common.run_status import RunStatus
from ..specs.spec_repos import get_spec_download_url, format_supported_course_list
from ..toolkit import global_vars
| 35.326531 | 102 | 0.574812 | import sys
from ..common import chdir, run
from ..common.run_status import RunStatus
from ..specs.spec_repos import get_spec_download_url, format_supported_course_list
from ..toolkit import global_vars
def download_specs(course: str, basedir: str):
course = course.split("/")[0].upper()
url = get_spec_downloa... | 1,480 | 0 | 46 |
73fc4932899e49dcaf50e5162185537c57b07f80 | 2,124 | py | Python | camping_server1/app/main/service/congestion.py | HyunjinKIM-Chloe/Crawling_project | da7d24a33c5b5f8696075b7f9a7313dc7cd42949 | [
"MIT"
] | 2 | 2021-05-28T12:12:56.000Z | 2021-05-30T12:15:06.000Z | camping_server1/app/main/service/congestion.py | HyunjinKIM-Chloe/Crawling_project | da7d24a33c5b5f8696075b7f9a7313dc7cd42949 | [
"MIT"
] | 35 | 2021-06-25T09:54:12.000Z | 2021-10-18T00:09:37.000Z | camping_server1/app/main/service/congestion.py | HyunjinKIM-Chloe/Crawling_project | da7d24a33c5b5f8696075b7f9a7313dc7cd42949 | [
"MIT"
] | 4 | 2021-05-28T12:10:37.000Z | 2021-05-31T11:37:17.000Z | import pandas as pd
import datetime
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))))
from ..model.connect import Query as sc
| 40.075472 | 110 | 0.625706 | import pandas as pd
import datetime
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))))
from ..model.connect import Query as sc
class Visitor(sc):
def __init... | 1,658 | -3 | 184 |
694c8ceb12d65038b7ee4f717fd0be6033f77075 | 88 | py | Python | gym/envs/__init__.py | LucienShui/SnakeAI | 9636d881f5d9647bf8f8a3f60ec890ccf7a6e245 | [
"Apache-2.0"
] | 1 | 2020-08-12T07:10:43.000Z | 2020-08-12T07:10:43.000Z | gym/envs/__init__.py | LucienShui/SnakeAI | 9636d881f5d9647bf8f8a3f60ec890ccf7a6e245 | [
"Apache-2.0"
] | 1 | 2020-08-19T07:38:38.000Z | 2020-08-19T07:38:38.000Z | gym/envs/__init__.py | LucienShui/SnakeAI | 9636d881f5d9647bf8f8a3f60ec890ccf7a6e245 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, print_function
from .snake_env import SnakeEnv
| 22 | 54 | 0.863636 | from __future__ import absolute_import, print_function
from .snake_env import SnakeEnv
| 0 | 0 | 0 |
d2722f266bd7877770de2915d47afbb8f6bbf0e2 | 3,800 | py | Python | src/inform_mapper/inform_text.py | attilathedud/inform_mapper | 6d04eae896b9e36124099251877bd3a75e485f96 | [
"Apache-2.0"
] | 9 | 2017-10-27T14:06:20.000Z | 2022-03-30T06:42:50.000Z | src/inform_mapper/inform_text.py | attilathedud/inform_mapper | 6d04eae896b9e36124099251877bd3a75e485f96 | [
"Apache-2.0"
] | null | null | null | src/inform_mapper/inform_text.py | attilathedud/inform_mapper | 6d04eae896b9e36124099251877bd3a75e485f96 | [
"Apache-2.0"
] | null | null | null | """
Contains all the logic for decoding inform text strings.
http://inform-fiction.org/zmachine/standards/z1point0/sect03.html describes the text
encoding scheme.
This package does not handle custom dictionaries, abbrevations, and v1 files as I
have not been able to find any while testing.
"""
"""
The base (a1 and a... | 35.514019 | 100 | 0.554474 | """
Contains all the logic for decoding inform text strings.
http://inform-fiction.org/zmachine/standards/z1point0/sect03.html describes the text
encoding scheme.
This package does not handle custom dictionaries, abbrevations, and v1 files as I
have not been able to find any while testing.
"""
"""
The base (a1 and a... | 0 | 0 | 0 |
028af7611ac600820a17fdee2f0ee653c8b69fae | 4,115 | py | Python | examples.py | martinlackner/frege | 903b7c497dafa1f136f72293797cb0b5543e8cf2 | [
"MIT"
] | 2 | 2019-09-09T16:18:04.000Z | 2019-09-11T16:52:01.000Z | examples.py | martinlackner/frege | 903b7c497dafa1f136f72293797cb0b5543e8cf2 | [
"MIT"
] | null | null | null | examples.py | martinlackner/frege | 903b7c497dafa1f136f72293797cb0b5543e8cf2 | [
"MIT"
] | null | null | null | """ Examples from
Paul Harrenstein, Marie-Louise Lackner, and Martin Lackner.
*A Mathematical Analysis of an Election System Proposed by
Gottlob Frege*. To appear in Erkenntnis. 2020.
Preprint: https://arxiv.org/abs/1907.03643
"""
from __future__ import print_function
from frege import frege, modfrege
import apportion... | 33.729508 | 74 | 0.59271 | """ Examples from
Paul Harrenstein, Marie-Louise Lackner, and Martin Lackner.
*A Mathematical Analysis of an Election System Proposed by
Gottlob Frege*. To appear in Erkenntnis. 2020.
Preprint: https://arxiv.org/abs/1907.03643
"""
from __future__ import print_function
from frege import frege, modfrege
import apportion... | 0 | 0 | 0 |
7c18980702bc6f67812858049a194a49d4ae919f | 98 | py | Python | job_position/apps.py | My-Garage/resourceideaapi | b872a6f15277989870572ba6e523c9dc378b7a24 | [
"MIT"
] | 1 | 2021-01-20T14:40:06.000Z | 2021-01-20T14:40:06.000Z | job_position/apps.py | My-Garage/resourceideaapi | b872a6f15277989870572ba6e523c9dc378b7a24 | [
"MIT"
] | null | null | null | job_position/apps.py | My-Garage/resourceideaapi | b872a6f15277989870572ba6e523c9dc378b7a24 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 16.333333 | 35 | 0.77551 | from django.apps import AppConfig
class JobPositionConfig(AppConfig):
name = 'job_position'
| 0 | 40 | 23 |
38154b89e8d05c2805dae7e98c2467c6eb562087 | 1,072 | py | Python | anaf/core/search/dbsearch.py | tovmeod/anaf | 80e4a00532ce6f4ce76c5ffc858ff90c759a9879 | [
"BSD-3-Clause"
] | 2 | 2016-03-15T13:17:26.000Z | 2017-03-22T15:39:01.000Z | anaf/core/search/dbsearch.py | tovmeod/anaf | 80e4a00532ce6f4ce76c5ffc858ff90c759a9879 | [
"BSD-3-Clause"
] | 4 | 2021-03-19T21:42:58.000Z | 2022-03-11T23:13:07.000Z | anaf/core/search/dbsearch.py | tovmeod/anaf | 80e4a00532ce6f4ce76c5ffc858ff90c759a9879 | [
"BSD-3-Clause"
] | 4 | 2016-08-31T16:55:41.000Z | 2020-04-22T18:48:54.000Z | from django.db.models import Q, CharField, TextField
from django.apps import apps
from anaf.core.models import Object
params = []
for model in apps.get_models():
if issubclass(model, Object) and getattr(model, 'searcheable', True):
for field in model._meta.fields:
if isinstance(field, (CharFi... | 31.529412 | 97 | 0.610075 | from django.db.models import Q, CharField, TextField
from django.apps import apps
from anaf.core.models import Object
params = []
for model in apps.get_models():
if issubclass(model, Object) and getattr(model, 'searcheable', True):
for field in model._meta.fields:
if isinstance(field, (CharFi... | 0 | 0 | 0 |
970b6611806d74ccb208050d4e68057cf8ccd2c7 | 923 | py | Python | graphdatascience/tests/integration/conftest.py | soerenreichardt/graph-data-science-client | 845c79cabdb21d57b590d51e4ddad0fa7a1caeab | [
"Apache-2.0"
] | null | null | null | graphdatascience/tests/integration/conftest.py | soerenreichardt/graph-data-science-client | 845c79cabdb21d57b590d51e4ddad0fa7a1caeab | [
"Apache-2.0"
] | null | null | null | graphdatascience/tests/integration/conftest.py | soerenreichardt/graph-data-science-client | 845c79cabdb21d57b590d51e4ddad0fa7a1caeab | [
"Apache-2.0"
] | null | null | null | import os
from typing import Generator
import pytest
from neo4j import Driver, GraphDatabase
from graphdatascience.graph_data_science import GraphDataScience
from graphdatascience.query_runner.neo4j_query_runner import Neo4jQueryRunner
URI = os.environ.get("NEO4J_URI", "bolt://localhost:7687")
AUTH = None
if os.env... | 24.945946 | 77 | 0.752979 | import os
from typing import Generator
import pytest
from neo4j import Driver, GraphDatabase
from graphdatascience.graph_data_science import GraphDataScience
from graphdatascience.query_runner.neo4j_query_runner import Neo4jQueryRunner
URI = os.environ.get("NEO4J_URI", "bolt://localhost:7687")
AUTH = None
if os.env... | 288 | 0 | 66 |
25422b7409004176f5c9d69940af32004565b284 | 290 | py | Python | api/__init__.py | jessebmiller/bevy | f3478a49740c029d871304bfa9b42b2fbb2c16f0 | [
"Apache-2.0"
] | null | null | null | api/__init__.py | jessebmiller/bevy | f3478a49740c029d871304bfa9b42b2fbb2c16f0 | [
"Apache-2.0"
] | 2 | 2017-12-03T06:40:11.000Z | 2017-12-07T04:15:34.000Z | api/__init__.py | jessebmiller/bevy | f3478a49740c029d871304bfa9b42b2fbb2c16f0 | [
"Apache-2.0"
] | null | null | null | from api.manager import (
deploy_manager_contract,
get_proposals,
accept_proposal,
)
from api.contributor import (
propose_iteration,
)
from api.common import (
check_share_value,
check_balance,
check_total_supply,
check_total_value,
redeem_shares,
)
| 15.263158 | 29 | 0.72069 | from api.manager import (
deploy_manager_contract,
get_proposals,
accept_proposal,
)
from api.contributor import (
propose_iteration,
)
from api.common import (
check_share_value,
check_balance,
check_total_supply,
check_total_value,
redeem_shares,
)
| 0 | 0 | 0 |
833966532eb18cba3335dcac9605ff4f9ab3dc74 | 1,068 | py | Python | uteis/tests/test_numero_de_permutacoes_caoticas.py | vsantsal/matematica-combinatoria-ence | 23ba8f771f18ad89827082971118c1a35f0a7ddb | [
"MIT"
] | null | null | null | uteis/tests/test_numero_de_permutacoes_caoticas.py | vsantsal/matematica-combinatoria-ence | 23ba8f771f18ad89827082971118c1a35f0a7ddb | [
"MIT"
] | 4 | 2021-10-30T14:50:15.000Z | 2021-10-30T19:35:27.000Z | uteis/tests/test_numero_de_permutacoes_caoticas.py | vsantsal/matematica-combinatoria-ence | 23ba8f771f18ad89827082971118c1a35f0a7ddb | [
"MIT"
] | null | null | null | import pytest
from uteis.permutacoes import (
numero_de_permutacoes_caoticas,
numero_de_permutacoes_caoticas_com_elementos_fixos,
)
@pytest.mark.parametrize('inteiro, perms_esperadas',
[(6, 265),
(8, 14833),
(15, 481066515734)])
@p... | 42.72 | 99 | 0.586142 | import pytest
from uteis.permutacoes import (
numero_de_permutacoes_caoticas,
numero_de_permutacoes_caoticas_com_elementos_fixos,
)
@pytest.mark.parametrize('inteiro, perms_esperadas',
[(6, 265),
(8, 14833),
(15, 481066515734)])
def ... | 562 | 0 | 44 |
2d8765c1cce7eed8f8a08948cb15a4e2769a7bb7 | 5,270 | bzl | Python | bazel/platform_configs.bzl | v8App/v8App | 96c5278ae9078d508537f2e801b9ba0272ab1168 | [
"MIT"
] | null | null | null | bazel/platform_configs.bzl | v8App/v8App | 96c5278ae9078d508537f2e801b9ba0272ab1168 | [
"MIT"
] | null | null | null | bazel/platform_configs.bzl | v8App/v8App | 96c5278ae9078d508537f2e801b9ba0272ab1168 | [
"MIT"
] | null | null | null | # Copyright 2020 the v8App authors. All right reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.
| 27.305699 | 56 | 0.493359 | # Copyright 2020 the v8App authors. All right reserved.
# Use of this source code is governed by the MIT license
# that can be found in the LICENSE file.
def define_platform_config_settings():
native.config_setting(
name = "debug",
values = {
"compilation_mode": "dbg",
},
... | 5,093 | 0 | 23 |
9b1e65ed615a761668a4989de6f8cb37d70f8303 | 315 | py | Python | setup.py | iAnomaly/sceptre-resolver-aws-secrets-manager | 58a0c120e86a4a71b3b01e2d5159366f17d32629 | [
"Apache-2.0"
] | 1 | 2020-05-28T07:18:23.000Z | 2020-05-28T07:18:23.000Z | setup.py | iAnomaly/sceptre-resolver-aws-secrets-manager | 58a0c120e86a4a71b3b01e2d5159366f17d32629 | [
"Apache-2.0"
] | 2 | 2019-05-08T16:45:40.000Z | 2021-09-01T22:43:51.000Z | setup.py | iAnomaly/sceptre-resolver-aws-secrets-manager | 58a0c120e86a4a71b3b01e2d5159366f17d32629 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='sceptre-resolver-aws-secrets-manager',
version="1.0.0",
py_modules=['aws_secrets_manager'],
entry_points={
'sceptre.resolvers': [
'aws_secrets_manager = aws_secrets_manager:AwsSecretsManager',
],
}
)
| 22.5 | 74 | 0.628571 | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='sceptre-resolver-aws-secrets-manager',
version="1.0.0",
py_modules=['aws_secrets_manager'],
entry_points={
'sceptre.resolvers': [
'aws_secrets_manager = aws_secrets_manager:AwsSecretsManager',
],
}
)
| 0 | 0 | 0 |
ee63c4422902ad5df4676a9fa35dd87be4ff0ad3 | 1,359 | py | Python | goldsrc/mdl_v4/structs/mesh.py | tltneon/SourceIO | 418224918c2b062a4c78a41d4d65329ba2decb22 | [
"MIT"
] | 1 | 2021-07-12T12:55:27.000Z | 2021-07-12T12:55:27.000Z | goldsrc/mdl_v4/structs/mesh.py | syborg64/SourceIO | e4ba86d801f518e192260af08ef533759c2e1cc3 | [
"MIT"
] | null | null | null | goldsrc/mdl_v4/structs/mesh.py | syborg64/SourceIO | e4ba86d801f518e192260af08ef533759c2e1cc3 | [
"MIT"
] | null | null | null | from typing import List, Tuple
from .texture import StudioTexture
from ....source_shared.base import Base
from ....utilities.byte_io_mdl import ByteIO
| 29.543478 | 74 | 0.618102 | from typing import List, Tuple
from .texture import StudioTexture
from ....source_shared.base import Base
from ....utilities.byte_io_mdl import ByteIO
class StudioTrivert(Base):
def __init__(self):
self.vertex_index = 0
self.normal_index = 0
self.uv = []
def read(self, reader: ByteIO... | 1,046 | 7 | 152 |
ae81bc98da637a98fe61d219df77bddc23f53e66 | 13,841 | py | Python | dashboard/dashboard.py | MrDionesalvi/APU | a992cffca3332bcc7ba1e3ed5d42f3f4789d0b8b | [
"MIT"
] | null | null | null | dashboard/dashboard.py | MrDionesalvi/APU | a992cffca3332bcc7ba1e3ed5d42f3f4789d0b8b | [
"MIT"
] | null | null | null | dashboard/dashboard.py | MrDionesalvi/APU | a992cffca3332bcc7ba1e3ed5d42f3f4789d0b8b | [
"MIT"
] | null | null | null | import json
import html
import string
import random
import requests
from utils import *
from create_invoicePDF import create_invoice
from flask import *
from sqlalchemy.sql.elements import *
from database import Database
from datetime import date
from dateutil.relativedelta import relativedelta
dashbo... | 36.909333 | 291 | 0.555885 | import json
import html
import string
import random
import requests
from utils import *
from create_invoicePDF import create_invoice
from flask import *
from sqlalchemy.sql.elements import *
from database import Database
from datetime import date
from dateutil.relativedelta import relativedelta
dashbo... | 12,236 | 0 | 304 |
785e4a59d4d841294dbc822c3421a6e71a51a8a9 | 17,499 | py | Python | tools/utils.py | URUSCG-LLC/fletch | 35967b56cecce8fd5ae96a0d85ca318272ee69a0 | [
"BSD-3-Clause"
] | null | null | null | tools/utils.py | URUSCG-LLC/fletch | 35967b56cecce8fd5ae96a0d85ca318272ee69a0 | [
"BSD-3-Clause"
] | null | null | null | tools/utils.py | URUSCG-LLC/fletch | 35967b56cecce8fd5ae96a0d85ca318272ee69a0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# This file contains a set of utilities functions used by other Python-based
# scripts.
import commands
i... | 28.876238 | 122 | 0.65838 | # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# This file contains a set of utilities functions used by other Python-based
# scripts.
import commands
i... | 13,337 | 28 | 1,134 |
7966caafd70219d09093d5440fc7f9e2b7aaf0bd | 6,368 | py | Python | Exploration Strategy/distancemin.py | salamenthe/STA-Robot-autonome | fb55cb0de0a23c05d049ae7d3859f2b6cdbb9b54 | [
"MIT"
] | null | null | null | Exploration Strategy/distancemin.py | salamenthe/STA-Robot-autonome | fb55cb0de0a23c05d049ae7d3859f2b6cdbb9b54 | [
"MIT"
] | 1 | 2021-11-12T09:48:09.000Z | 2021-11-12T09:48:09.000Z | Exploration Strategy/distancemin.py | salamenthe/STA-Robot-autonome | fb55cb0de0a23c05d049ae7d3859f2b6cdbb9b54 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 8 14:48:20 2021
@author: utilisateur
"""
import numpy as np
import heapq
import matplotlib.pyplot as plt
from PIL import Image
# Trouver la zone inexplorée la plus proche du robot
M = np.array([[0,0,1,1],
[0,1,0.5,1],
[0,0,1,1],
[1,... | 27.5671 | 100 | 0.482569 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 8 14:48:20 2021
@author: utilisateur
"""
import numpy as np
import heapq
import matplotlib.pyplot as plt
from PIL import Image
# Trouver la zone inexplorée la plus proche du robot
M = np.array([[0,0,1,1],
[0,1,0.5,1],
[0,0,1,1],
[1,... | 5,612 | 0 | 223 |
c4c6a67d84ccc8192e9503470ecf31f7e869fa68 | 1,700 | py | Python | runapp/run_clock.py | bryvogel/cgm-clock | 62ace6ee312e6232282eeaaa69c01d261cfa3a52 | [
"Apache-2.0"
] | null | null | null | runapp/run_clock.py | bryvogel/cgm-clock | 62ace6ee312e6232282eeaaa69c01d261cfa3a52 | [
"Apache-2.0"
] | null | null | null | runapp/run_clock.py | bryvogel/cgm-clock | 62ace6ee312e6232282eeaaa69c01d261cfa3a52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import time
import datetime
from Libs.Clock import Clock
from Libs.PiTFT import Display
from Libs.Weather import Weather
from Libs.Input import Button
from Libs.GStreamer import Speaker
from config import configuration
# The weather station
station_name = configuration.get('weather_stati... | 24.285714 | 68 | 0.714118 | #!/usr/bin/python
import time
import datetime
from Libs.Clock import Clock
from Libs.PiTFT import Display
from Libs.Weather import Weather
from Libs.Input import Button
from Libs.GStreamer import Speaker
from config import configuration
# The weather station
station_name = configuration.get('weather_stati... | 708 | 0 | 69 |
1b043b1db127881fdfa052191eb3da3f81e7153b | 7,411 | py | Python | test/programytest/dynamic/test_dynamics.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/dynamic/test_dynamics.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/dynamic/test_dynamics.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import unittest
from programy.clients.events.console.config import ConsoleConfiguration
from programy.config.brain.dynamic import BrainDynamicsConfiguration
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.dynamic.dynamics import DynamicsCollection
from programy.dynamic.sets.numeric impor... | 38.201031 | 96 | 0.727297 | import unittest
from programy.clients.events.console.config import ConsoleConfiguration
from programy.config.brain.dynamic import BrainDynamicsConfiguration
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.dynamic.dynamics import DynamicsCollection
from programy.dynamic.sets.numeric impor... | 6,239 | 94 | 447 |
fa9a4a7ff23b2927d64c59d68153b8e741bd8772 | 438 | py | Python | code/test/duc_data.py | lavizhao/insummer | 16520a6c3114e2d6360dca469221bed00a570785 | [
"MIT"
] | 7 | 2017-03-18T07:44:17.000Z | 2019-10-28T03:01:33.000Z | code/test/duc_data.py | lavizhao/insummer | 16520a6c3114e2d6360dca469221bed00a570785 | [
"MIT"
] | 1 | 2020-01-06T06:45:40.000Z | 2020-01-06T06:45:40.000Z | code/test/duc_data.py | lavizhao/insummer | 16520a6c3114e2d6360dca469221bed00a570785 | [
"MIT"
] | 4 | 2016-08-09T02:56:57.000Z | 2019-10-19T14:19:42.000Z | #!/usr/bin/python3
#.py for test load data..
import sys
sys.path.append("../")
import insummer
from insummer.read_conf import config
import pickle
duc_conf = config('../../conf/question.conf')
if __name__ == "__main__":
test_question(duc_conf['duc_question'])
| 19.043478 | 45 | 0.671233 | #!/usr/bin/python3
#.py for test load data..
import sys
sys.path.append("../")
import insummer
from insummer.read_conf import config
import pickle
duc_conf = config('../../conf/question.conf')
def test_question(data_path):
f = open(data_path,'rb')
data = pickle.load(f)
for idx in data:
print(id... | 146 | 0 | 23 |
a1ff40f585b922370aba7035e95392ce289555e6 | 3,162 | py | Python | src/flair_management/loadout_manager/loadout_actions.py | PxT00/valorant-skin-cli | 4d142174e53769c10a06f2ba5343d8a4d4a7512c | [
"MIT"
] | 2 | 2021-08-11T02:09:15.000Z | 2021-08-11T02:09:19.000Z | src/flair_management/loadout_manager/loadout_actions.py | PxT00/valorant-skin-cli | 4d142174e53769c10a06f2ba5343d8a4d4a7512c | [
"MIT"
] | null | null | null | src/flair_management/loadout_manager/loadout_actions.py | PxT00/valorant-skin-cli | 4d142174e53769c10a06f2ba5343d8a4d4a7512c | [
"MIT"
] | null | null | null | from json import load
from InquirerPy.utils import color_print
from InquirerPy import inquirer
from .loadouts_manager import Loadouts_Manager
from ..loadout_grid import Loadout_Grid
| 45.171429 | 185 | 0.629665 | from json import load
from InquirerPy.utils import color_print
from InquirerPy import inquirer
from .loadouts_manager import Loadouts_Manager
from ..loadout_grid import Loadout_Grid
class Loadout_Actions:
@staticmethod
def print_loadout(client,loadout_override=None):
table, width = Loadout_Grid.fet... | 2,778 | 185 | 23 |
580990039852837d822098ac9d8c870cbfca3c2a | 17,457 | py | Python | gcloud/bigtable/_generated/bigtable_service_pb2.py | scrapinghub/gcloud-python | 1ec6d636ebf2c4d618aca6b2485fbbfa5f0fde29 | [
"Apache-2.0"
] | null | null | null | gcloud/bigtable/_generated/bigtable_service_pb2.py | scrapinghub/gcloud-python | 1ec6d636ebf2c4d618aca6b2485fbbfa5f0fde29 | [
"Apache-2.0"
] | null | null | null | gcloud/bigtable/_generated/bigtable_service_pb2.py | scrapinghub/gcloud-python | 1ec6d636ebf2c4d618aca6b2485fbbfa5f0fde29 | [
"Apache-2.0"
] | 2 | 2017-07-30T16:18:23.000Z | 2020-10-14T11:24:18.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/bigtable/v1/bigtable_service.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symb... | 63.25 | 1,522 | 0.829868 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/bigtable/v1/bigtable_service.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symb... | 12,165 | 0 | 618 |
bb58beeab0e42743155a5a727d63ebc17ba66c26 | 5,643 | py | Python | built-in/TensorFlow/Official/nlp/Transformer_for_TensorFlow/noahnmt/utils/decode_utils.py | Huawei-Ascend/modelzoo | df51ed9c1d6dbde1deef63f2a037a369f8554406 | [
"Apache-2.0"
] | null | null | null | built-in/TensorFlow/Official/nlp/Transformer_for_TensorFlow/noahnmt/utils/decode_utils.py | Huawei-Ascend/modelzoo | df51ed9c1d6dbde1deef63f2a037a369f8554406 | [
"Apache-2.0"
] | 3 | 2021-03-31T20:15:40.000Z | 2022-02-09T23:50:46.000Z | built-in/TensorFlow/Official/nlp/Transformer_for_TensorFlow/noahnmt/utils/decode_utils.py | Huawei-Ascend/modelzoo | df51ed9c1d6dbde1deef63f2a037a369f8554406 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright Huawei Noah's Ark Lab.
""" Generates model predictions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import sys
import tensorflow as tf
from noahnmt.utils import data_utils
from noahnmt.utils import... | 29.390625 | 96 | 0.705653 | # coding=utf-8
# Copyright Huawei Noah's Ark Lab.
""" Generates model predictions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import sys
import tensorflow as tf
from noahnmt.utils import data_utils
from noahnmt.utils import... | 3,578 | 0 | 92 |
53d07d459c56e652eb5311fbbb4f64529ff2d091 | 2,449 | py | Python | autograd/scipy/stats/multivariate_normal.py | gautam1858/autograd | 8d7acaf79e33139b4ebfedf7da0602a965b47c63 | [
"MIT"
] | 51 | 2019-02-01T19:43:37.000Z | 2022-03-16T09:07:03.000Z | autograd/scipy/stats/multivariate_normal.py | gautam1858/autograd | 8d7acaf79e33139b4ebfedf7da0602a965b47c63 | [
"MIT"
] | 6 | 2020-01-28T22:44:28.000Z | 2022-02-10T00:23:23.000Z | autograd/scipy/stats/multivariate_normal.py | gautam1858/autograd | 8d7acaf79e33139b4ebfedf7da0602a965b47c63 | [
"MIT"
] | 35 | 2019-02-08T02:00:31.000Z | 2022-03-01T23:17:00.000Z | from __future__ import absolute_import
import scipy.stats
import autograd.numpy as np
from autograd.numpy.numpy_vjps import unbroadcast_f
from autograd.extend import primitive, defvjp
pdf = primitive(scipy.stats.multivariate_normal.pdf)
logpdf = primitive(scipy.stats.multivariate_normal.logpdf)
entropy = primit... | 41.508475 | 119 | 0.682728 | from __future__ import absolute_import
import scipy.stats
import autograd.numpy as np
from autograd.numpy.numpy_vjps import unbroadcast_f
from autograd.extend import primitive, defvjp
pdf = primitive(scipy.stats.multivariate_normal.pdf)
logpdf = primitive(scipy.stats.multivariate_normal.logpdf)
entropy = primit... | 572 | 0 | 69 |
b4f0fd3c1e7111cf0459117142ca773e52dba84b | 125 | py | Python | tests/templates/__init__.py | genki0403/pytest-testreport | 9470ce49900e1accbb83fb6e7c955a6d7da73579 | [
"MIT"
] | 2 | 2021-05-17T06:30:24.000Z | 2021-11-16T03:43:21.000Z | tests/templates/__init__.py | genki0403/pytest-testreport | 9470ce49900e1accbb83fb6e7c955a6d7da73579 | [
"MIT"
] | null | null | null | tests/templates/__init__.py | genki0403/pytest-testreport | 9470ce49900e1accbb83fb6e7c955a6d7da73579 | [
"MIT"
] | 1 | 2021-12-29T10:49:05.000Z | 2021-12-29T10:49:05.000Z | """
============================
Author:柠檬班-木森
Time:2021/5/13 20:52
E-mail:3247119728@qq.com
Company:湖南零檬信息技术有限公司
=======
""" | 15.625 | 28 | 0.52 | """
============================
Author:柠檬班-木森
Time:2021/5/13 20:52
E-mail:3247119728@qq.com
Company:湖南零檬信息技术有限公司
=======
""" | 0 | 0 | 0 |
35a98bb08721555250d9ae8d3046527e2d5d93e1 | 628 | py | Python | 11_checkPrimalityFunctions.py | hjlarrea/pythonExercises | f634489d181292bc51b4a4770b497c1f57e097d7 | [
"MIT"
] | null | null | null | 11_checkPrimalityFunctions.py | hjlarrea/pythonExercises | f634489d181292bc51b4a4770b497c1f57e097d7 | [
"MIT"
] | null | null | null | 11_checkPrimalityFunctions.py | hjlarrea/pythonExercises | f634489d181292bc51b4a4770b497c1f57e097d7 | [
"MIT"
] | null | null | null | #Ask the user for a number and determine whether the number is prime or not.
# (For those who have forgotten, a prime number is a number that has no divisors.).
# You can (and should!) use your answer to Exercise 4 to help you. Take this
# opportunity to practice using functions, described below.
userNumber = int(i... | 33.052632 | 84 | 0.679936 | #Ask the user for a number and determine whether the number is prime or not.
# (For those who have forgotten, a prime number is a number that has no divisors.).
# You can (and should!) use your answer to Exercise 4 to help you. Take this
# opportunity to practice using functions, described below.
def howManyDivisor... | 118 | 0 | 23 |
fc13581c6053a484c21c064fa54601836bed6b84 | 4,206 | py | Python | sortedm2m_tests/test_forms.py | tenzo-dev/django-sorted-m2m | ce220ef23706dd4e4a9f53f216984c865f008ddf | [
"BSD-3-Clause"
] | 7 | 2019-06-10T09:48:18.000Z | 2020-04-26T08:05:07.000Z | sortedm2m_tests/test_forms.py | tenzo-dev/django-sorted-m2m | ce220ef23706dd4e4a9f53f216984c865f008ddf | [
"BSD-3-Clause"
] | null | null | null | sortedm2m_tests/test_forms.py | tenzo-dev/django-sorted-m2m | ce220ef23706dd4e4a9f53f216984c865f008ddf | [
"BSD-3-Clause"
] | 3 | 2019-06-21T09:02:42.000Z | 2019-08-15T19:37:54.000Z | # -*- coding: utf-8 -*-
from django import forms
from django.test import TestCase
from django.utils.encoding import force_text
from sortedm2m.forms import SortedMultipleChoiceField
from .models import Book, MessyStore, Shelf
# regression test
| 36.258621 | 106 | 0.605801 | # -*- coding: utf-8 -*-
from django import forms
from django.test import TestCase
from django.utils.encoding import force_text
from sortedm2m.forms import SortedMultipleChoiceField
from .models import Book, MessyStore, Shelf
class SortedForm(forms.Form):
values = SortedMultipleChoiceField(
queryset=Book.... | 3,401 | 243 | 310 |
7c34edabb7ee109a6e4b43929ffb0982cb2a95f0 | 487 | py | Python | templates/py/main.py | composo/composo-python-plugin | b199d296afaf8d23b291626d3d9cbce9c9d511e3 | [
"MIT"
] | null | null | null | templates/py/main.py | composo/composo-python-plugin | b199d296afaf8d23b291626d3d9cbce9c9d511e3 | [
"MIT"
] | null | null | null | templates/py/main.py | composo/composo-python-plugin | b199d296afaf8d23b291626d3d9cbce9c9d511e3 | [
"MIT"
] | null | null | null | import fire
from __PACKAGE_NAME__ import ioc
from appdirs import user_config_dir
from pathlib import Path
if __name__ == "__main__":
test()
| 19.48 | 57 | 0.694045 | import fire
from __PACKAGE_NAME__ import ioc
from appdirs import user_config_dir
from pathlib import Path
def main():
conf_dir = Path(user_config_dir("__PROJECT_NAME__"))
ioc.Config.config.from_yaml(conf_dir / "config.yaml")
app = ioc.App.app()
fire.Fire(app)
def test():
conf_dir = Path(user_co... | 293 | 0 | 46 |
9b713d44c8017dd0c27e083b05dd9b1c3f634594 | 4,550 | py | Python | 18_snailfish.py | xphade/aoc2021 | b19949a3b61c87ceaf0d367271a26677b694d287 | [
"MIT"
] | 2 | 2021-12-09T17:37:14.000Z | 2021-12-09T18:09:25.000Z | 18_snailfish.py | xphade/aoc2021 | b19949a3b61c87ceaf0d367271a26677b694d287 | [
"MIT"
] | null | null | null | 18_snailfish.py | xphade/aoc2021 | b19949a3b61c87ceaf0d367271a26677b694d287 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from aoc_utils import get_input_path, print_elapsed_time
from math import ceil, floor
import re
from timeit import default_timer as timer
from typing import List
RE_LAST_NUMBER = re.compile(r"(\d+)(?!.*\d)")
RE_NUMBER = re.compile(r"\d+")
RE_PAIR = re.compile(r"\[\d+,\d+\]")
RE_NUMBER_GT_10 = r... | 32.733813 | 87 | 0.641538 | #!/usr/bin/env python3
from aoc_utils import get_input_path, print_elapsed_time
from math import ceil, floor
import re
from timeit import default_timer as timer
from typing import List
RE_LAST_NUMBER = re.compile(r"(\d+)(?!.*\d)")
RE_NUMBER = re.compile(r"\d+")
RE_PAIR = re.compile(r"\[\d+,\d+\]")
RE_NUMBER_GT_10 = r... | 606 | 0 | 23 |
9cc76821d45cb65c82286f7c9a183be6b17cd12c | 1,577 | py | Python | CodigoBaseDoTTS.py | WandrelAlves/GAMETIME | a5166eabb6f7fabf274f5c6b505ec5f31cc05174 | [
"CC-BY-3.0"
] | 1 | 2022-01-22T18:45:27.000Z | 2022-01-22T18:45:27.000Z | CodigoBaseDoTTS.py | WandrelAlves/GAMETIME | a5166eabb6f7fabf274f5c6b505ec5f31cc05174 | [
"CC-BY-3.0"
] | null | null | null | CodigoBaseDoTTS.py | WandrelAlves/GAMETIME | a5166eabb6f7fabf274f5c6b505ec5f31cc05174 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().system('pip install ibm_watson')
# In[2]:
from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
# In[3]:
apikey = '4R5OHrdqVaLXzVXrIVJkYOkUHOzIQb4-GhREAzsm8S5D'
url = 'https://api.au-syd.text-to-speech... | 17.141304 | 338 | 0.703868 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().system('pip install ibm_watson')
# In[2]:
from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
# In[3]:
apikey = '4R5OHrdqVaLXzVXrIVJkYOkUHOzIQb4-GhREAzsm8S5D'
url = 'https://api.au-syd.text-to-speech... | 0 | 0 | 0 |
51da2917f3bde80a8ffd5c1279f93a77fc124a2f | 428 | py | Python | src/get_metrics.py | lazycoder1/Ziliiqa-DIF-NFT | d706526826722be0d302bef5d15657148fda5b45 | [
"MIT"
] | null | null | null | src/get_metrics.py | lazycoder1/Ziliiqa-DIF-NFT | d706526826722be0d302bef5d15657148fda5b45 | [
"MIT"
] | null | null | null | src/get_metrics.py | lazycoder1/Ziliiqa-DIF-NFT | d706526826722be0d302bef5d15657148fda5b45 | [
"MIT"
] | 1 | 2021-11-13T12:32:20.000Z | 2021-11-13T12:32:20.000Z | from pyzil.zilliqa import chain
from flask import Flask, jsonify
import json
app = Flask(__name__)
app.config.from_object(__name__)
@app.route('/addressState/<address>, 'methods=['GET'])
if __name__ == '__main__':
# address = "fe001824823b12b58708bf24edd94d8b5e1cfcf7"
app.run()
| 22.526316 | 55 | 0.775701 | from pyzil.zilliqa import chain
from flask import Flask, jsonify
import json
app = Flask(__name__)
app.config.from_object(__name__)
def init():
chain.set_active_chain(chain.MainNet)
@app.route('/addressState/<address>, 'methods=['GET'])
def get_contract_state(address):
chain.active_chain.api.GetSmartContractState(... | 95 | 0 | 45 |
14679e333a02955d7f35b7cc9022f4455d5d4ffa | 35 | py | Python | afrift/toolkit.py | albertvisser/filefindr | e6c7d7bbbcd34fe43e5f75c410cdd359b362e79e | [
"MIT"
] | 1 | 2020-11-21T11:02:27.000Z | 2020-11-21T11:02:27.000Z | afrift/toolkit.py | albertvisser/filefindr | e6c7d7bbbcd34fe43e5f75c410cdd359b362e79e | [
"MIT"
] | 4 | 2022-01-13T20:24:53.000Z | 2022-01-14T18:42:26.000Z | afrift/toolkit.py | albertvisser/filefindr | e6c7d7bbbcd34fe43e5f75c410cdd359b362e79e | [
"MIT"
] | 4 | 2020-07-25T16:44:00.000Z | 2022-01-14T09:21:16.000Z | # voor nu: qt of wx
toolkit = 'qt'
| 11.666667 | 19 | 0.6 | # voor nu: qt of wx
toolkit = 'qt'
| 0 | 0 | 0 |
9a23467bba0e1df3e287051c2193fa7e521146aa | 457 | py | Python | software_challenge_api/documents/migrations/0006_auto_20210822_1249.py | wibrvallejoma/Software-Challenge-API | 9935f4aaded84b264c533b67a424cb5c7cee0674 | [
"MIT"
] | null | null | null | software_challenge_api/documents/migrations/0006_auto_20210822_1249.py | wibrvallejoma/Software-Challenge-API | 9935f4aaded84b264c533b67a424cb5c7cee0674 | [
"MIT"
] | null | null | null | software_challenge_api/documents/migrations/0006_auto_20210822_1249.py | wibrvallejoma/Software-Challenge-API | 9935f4aaded84b264c533b67a424cb5c7cee0674 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-08-22 17:49
from django.db import migrations, models
| 24.052632 | 116 | 0.630197 | # Generated by Django 3.1.13 on 2021-08-22 17:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0005_auto_20210822_1233'),
]
operations = [
migrations.AlterField(
model_name='document',
name='childs... | 0 | 342 | 23 |
c3e5713e820504942fa19d39d82d04a7eca20126 | 2,529 | py | Python | answers/Python/@oseme-techguy/14-number-in-words.py | Flipponachi/20-questions | a6ad9a468683646781426008e71dbb508e8e59bb | [
"MIT"
] | 1 | 2019-09-13T14:13:07.000Z | 2019-09-13T14:13:07.000Z | answers/Python/@oseme-techguy/14-number-in-words.py | Flipponachi/20-questions | a6ad9a468683646781426008e71dbb508e8e59bb | [
"MIT"
] | null | null | null | answers/Python/@oseme-techguy/14-number-in-words.py | Flipponachi/20-questions | a6ad9a468683646781426008e71dbb508e8e59bb | [
"MIT"
] | 1 | 2021-01-02T12:01:46.000Z | 2021-01-02T12:01:46.000Z | """
Solution to Numbers in Words
Based off this Algorithm: https://stackoverflow.com/a/3299672/7396801
"""
import math
zero_to_nineteen_map = [
'zero', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen',
'fourteen', 'fifteen', 's... | 28.738636 | 90 | 0.542902 | """
Solution to Numbers in Words
Based off this Algorithm: https://stackoverflow.com/a/3299672/7396801
"""
import math
zero_to_nineteen_map = [
'zero', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen',
'fourteen', 'fifteen', 's... | 1,223 | 0 | 75 |
2e988649b340476dc738f6d529f94cae73539fd0 | 1,655 | py | Python | setup.py | ExpediaGroup/map-maker | 95fd76cdb9adade6862473068b5fcc1ceeb9f6ee | [
"Apache-2.0"
] | 12 | 2020-10-19T20:36:45.000Z | 2021-01-14T08:14:31.000Z | setup.py | ExpediaGroup/map-maker | 95fd76cdb9adade6862473068b5fcc1ceeb9f6ee | [
"Apache-2.0"
] | 4 | 2020-10-19T21:57:46.000Z | 2020-11-11T18:45:37.000Z | setup.py | ExpediaGroup/map-maker | 95fd76cdb9adade6862473068b5fcc1ceeb9f6ee | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 Expedia, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 31.826923 | 72 | 0.673112 | """
Copyright 2020 Expedia, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 0 | 0 | 0 |
f67a579863fd3add1562679811d453ef653bc0e0 | 840 | py | Python | examples/set_lcd.py | MasterSpecter/ekmmeters | 4b53e4aaba35f5912db14e8b7095d6db48d552fa | [
"MIT"
] | 9 | 2017-08-23T05:43:53.000Z | 2022-01-05T21:53:11.000Z | examples/set_lcd.py | levrix/ekmmeters | 6e3ad724c55ffda4b56c7584e9a5b27fe62b3f4c | [
"MIT"
] | 8 | 2016-03-30T00:33:42.000Z | 2016-04-05T15:02:00.000Z | examples/set_lcd.py | levrix/ekmmeters | 6e3ad724c55ffda4b56c7584e9a5b27fe62b3f4c | [
"MIT"
] | 4 | 2018-06-18T19:45:43.000Z | 2022-01-05T21:53:33.000Z | """ Simple example set LCD
(c) 2016 EKM Metering.
"""
from ekmmeters import *
#set up port
my_port_name = "/dev/ttyO4"
my_meter_address = "000300001463"
# log to console
ekm_set_log(ekm_print_log)
# init port and create meter
port = SerialPort(my_port_name)
if (port.initPort() == True):
my_meter = V4Meter(my_mete... | 26.25 | 83 | 0.742857 | """ Simple example set LCD
(c) 2016 EKM Metering.
"""
from ekmmeters import *
#set up port
my_port_name = "/dev/ttyO4"
my_meter_address = "000300001463"
# log to console
ekm_set_log(ekm_print_log)
# init port and create meter
port = SerialPort(my_port_name)
if (port.initPort() == True):
my_meter = V4Meter(my_mete... | 0 | 0 | 0 |
5482b25811838849d281789ee3938b0f7df0f049 | 32,305 | py | Python | core/source/anchor_filter.py | reinforcementdriving/Weakly-Supervised-3D-Object-Detection | 25f79f703627c1192384e8f686c3faefd759aa1c | [
"MIT"
] | 92 | 2020-07-28T04:17:43.000Z | 2022-03-17T14:16:28.000Z | core/source/anchor_filter.py | reinforcementdriving/Weakly-Supervised-3D-Object-Detection | 25f79f703627c1192384e8f686c3faefd759aa1c | [
"MIT"
] | 14 | 2020-07-28T04:15:06.000Z | 2022-03-18T13:37:23.000Z | core/source/anchor_filter.py | reinforcementdriving/Weakly-Supervised-3D-Object-Detection | 25f79f703627c1192384e8f686c3faefd759aa1c | [
"MIT"
] | 17 | 2020-07-29T09:29:12.000Z | 2022-03-18T02:27:55.000Z | import numpy as np
import tensorflow as tf
from source.model import Model
from source.model_lidar import ModelLiDAR
import utils
from utils import get_normal_map
| 42.395013 | 72 | 0.429438 | import numpy as np
import tensorflow as tf
from source.model import Model
from source.model_lidar import ModelLiDAR
import utils
from utils import get_normal_map
class AnchorFilter(object):
def __init__(self,
area_extend=[[-35, 35],
[0, 70]],
area_... | 31,585 | 6 | 552 |
b6156e621027d5d978fb529b3a66d6eec5106b70 | 791 | py | Python | hu/rotate_image.py | laputian/dml | d106f89567fa3dcdc304b5c6570fe1a69dd3c3ff | [
"MIT"
] | null | null | null | hu/rotate_image.py | laputian/dml | d106f89567fa3dcdc304b5c6570fe1a69dd3c3ff | [
"MIT"
] | null | null | null | hu/rotate_image.py | laputian/dml | d106f89567fa3dcdc304b5c6570fe1a69dd3c3ff | [
"MIT"
] | 3 | 2016-10-25T23:09:40.000Z | 2020-10-17T23:08:14.000Z | import numpy as np
import gzip
import cPickle as pickle
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import scipy.ndimage.interpolation as scipint
import sys
sys.path.insert(0, '../mlp_test')
from data_utils import load_mnist
data_set = load_mnist()[0]
index_1 = 4
rotangle = 30
img_arr_1 = data_set[0... | 20.815789 | 70 | 0.738306 | import numpy as np
import gzip
import cPickle as pickle
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import scipy.ndimage.interpolation as scipint
import sys
sys.path.insert(0, '../mlp_test')
from data_utils import load_mnist
data_set = load_mnist()[0]
index_1 = 4
rotangle = 30
img_arr_1 = data_set[0... | 0 | 0 | 0 |
6fc7c536f535a6b035ca283c3f6fb831c779a2ea | 9,024 | py | Python | examples/train_word_embedding.py | AlexTaguchi/nlp-notes | 3769cddfed9b4c560e6da3bfc2d5ccd19ce8ad0c | [
"MIT"
] | null | null | null | examples/train_word_embedding.py | AlexTaguchi/nlp-notes | 3769cddfed9b4c560e6da3bfc2d5ccd19ce8ad0c | [
"MIT"
] | null | null | null | examples/train_word_embedding.py | AlexTaguchi/nlp-notes | 3769cddfed9b4c560e6da3bfc2d5ccd19ce8ad0c | [
"MIT"
] | null | null | null | # Next Token Prediction with Transformers
# =======================================
# https://pytorch.org/tutorials/beginner/transformer_tutorial.html
#
# Purpose: Train the transformer model described in "Attention Is All You Need"
# (https://arxiv.org/pdf/1706.03762.pdf) on a language modeling task to predict
# the ... | 38.896552 | 100 | 0.669105 | # Next Token Prediction with Transformers
# =======================================
# https://pytorch.org/tutorials/beginner/transformer_tutorial.html
#
# Purpose: Train the transformer model described in "Attention Is All You Need"
# (https://arxiv.org/pdf/1706.03762.pdf) on a language modeling task to predict
# the ... | 1,787 | 0 | 134 |
91d6e544a36275cb8ec6bafd3c65e13fd3ccd240 | 29,270 | py | Python | ERTB.py | volkovskey/exchange-rates-tg-bot | cf41560e0c3f45f9327b81814b80293a3720513c | [
"MIT"
] | 10 | 2020-06-11T17:19:01.000Z | 2022-03-25T17:52:18.000Z | ERTB.py | volkovskey/exchange-rates-tg-bot | cf41560e0c3f45f9327b81814b80293a3720513c | [
"MIT"
] | 3 | 2021-08-16T16:33:25.000Z | 2022-01-13T18:30:53.000Z | ERTB.py | volkovskey/exchange-rates-tg-bot | cf41560e0c3f45f9327b81814b80293a3720513c | [
"MIT"
] | 6 | 2020-07-24T17:40:30.000Z | 2021-09-16T11:29:16.000Z | # Token
from Token import botToken, botUsername
# Public libraries
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types.message import ContentType
from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardButton
import numberize
from threading import Thread
import sys
from dateti... | 46.094488 | 458 | 0.648719 | # Token
from Token import botToken, botUsername
# Public libraries
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types.message import ContentType
from aiogram.types.inline_keyboard import InlineKeyboardMarkup, InlineKeyboardButton
import numberize
from threading import Thread
import sys
from dateti... | 25,940 | 0 | 490 |
ed0aa39af328d3c5d45d604a327a4acd216ba08b | 534 | py | Python | malepierre/characters/migrations/0006_auto_20150823_1757.py | EliotBerriot/malepierre | 34a11beae528242c062fcc308c2d98c28fa61fd1 | [
"BSD-3-Clause"
] | null | null | null | malepierre/characters/migrations/0006_auto_20150823_1757.py | EliotBerriot/malepierre | 34a11beae528242c062fcc308c2d98c28fa61fd1 | [
"BSD-3-Clause"
] | null | null | null | malepierre/characters/migrations/0006_auto_20150823_1757.py | EliotBerriot/malepierre | 34a11beae528242c062fcc308c2d98c28fa61fd1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| 22.25 | 77 | 0.586142 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('characters', '0005_auto_20150823_1729'),
]
operations = [
migrations.RemoveField(
model_name='career',
... | 0 | 404 | 23 |
7ea1ee6264daea1c101f82be5ba82b0797bae320 | 772 | py | Python | 1stRound/Easy/572 Subtree of Another Tree/DFSBFS.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | 2 | 2020-04-24T18:36:52.000Z | 2020-04-25T00:15:57.000Z | 1stRound/Easy/572 Subtree of Another Tree/DFSBFS.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | 1stRound/Easy/572 Subtree of Another Tree/DFSBFS.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
| 28.592593 | 103 | 0.536269 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def isSubtree(self, s, t):
"""
:type s: TreeNode
:type t: TreeNode
:rtype: bool
"... | 214 | 365 | 23 |
e75c133b9952e99e055e0383e3a0c94e7a2e5a6c | 17,463 | py | Python | Lesson/tableViewSample01/tableViewSample01.py | mammoth110/SampleOfPyside | 4ca8798fc900ce4886053d394b254d374aac6364 | [
"Unlicense"
] | null | null | null | Lesson/tableViewSample01/tableViewSample01.py | mammoth110/SampleOfPyside | 4ca8798fc900ce4886053d394b254d374aac6364 | [
"Unlicense"
] | null | null | null | Lesson/tableViewSample01/tableViewSample01.py | mammoth110/SampleOfPyside | 4ca8798fc900ce4886053d394b254d374aac6364 | [
"Unlicense"
] | null | null | null | import os
import sys
import dataclasses
import openpyxl
from typing import Any, List
from PySide2.QtCore import (
Qt,
QModelIndex,
QAbstractTableModel
)
# For Sample
from PySide2 import QtWidgets, QtCore, QtGui
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
path,... | 38.296053 | 139 | 0.603447 | import os
import sys
import dataclasses
import openpyxl
from typing import Any, List
from PySide2.QtCore import (
Qt,
QModelIndex,
QAbstractTableModel
)
# For Sample
from PySide2 import QtWidgets, QtCore, QtGui
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
path,... | 9,887 | 6,746 | 559 |
43ba959409762605e98917ca8d8b86f4ded0822e | 1,271 | py | Python | utils/make_dummy_coco_dataset.py | shalev1991/mmdetection | b6a87911322f5f949ceecd28371889f3bbb264ce | [
"Apache-2.0"
] | null | null | null | utils/make_dummy_coco_dataset.py | shalev1991/mmdetection | b6a87911322f5f949ceecd28371889f3bbb264ce | [
"Apache-2.0"
] | null | null | null | utils/make_dummy_coco_dataset.py | shalev1991/mmdetection | b6a87911322f5f949ceecd28371889f3bbb264ce | [
"Apache-2.0"
] | null | null | null | import os
import json
main()
| 29.55814 | 102 | 0.686074 | import os
import json
def create_ids_list(path):
lista=[]
for img_name in os.listdir(path):
lista.append(int(img_name.replace('.jpg','')))
return lista
def read_json(path):
with open(path, 'r') as j:
json_data = json.load(j)
return json_data
def fit_json_to_dir(json_path,dir_pa... | 1,123 | 0 | 115 |
16635626634abd762b4ef3a2fd9a9544388bb7c5 | 4,277 | py | Python | research/im2txt/data_analysis/evaluate_gradcam.py | dorazhao99/women-snowboard | 9cb2569d7a3cbb846d10aabae825ead9a6e1de29 | [
"Apache-2.0"
] | 19 | 2018-09-26T03:52:59.000Z | 2021-08-19T08:41:06.000Z | research/im2txt/data_analysis/evaluate_gradcam.py | dorazhao99/women-snowboard | 9cb2569d7a3cbb846d10aabae825ead9a6e1de29 | [
"Apache-2.0"
] | 13 | 2020-06-29T03:53:45.000Z | 2022-03-11T23:28:19.000Z | research/im2txt/data_analysis/evaluate_gradcam.py | dorazhao99/women-snowboard | 9cb2569d7a3cbb846d10aabae825ead9a6e1de29 | [
"Apache-2.0"
] | 6 | 2018-09-19T17:07:00.000Z | 2021-03-21T14:20:25.000Z | # Compute GradCam with predicted captions as input
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import sys
import json
import os.path as osp
import scipy
import numpy as np
import argparse
from im2txt import metrics
coco_dir = 'da... | 36.555556 | 130 | 0.694646 | # Compute GradCam with predicted captions as input
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import sys
import json
import os.path as osp
import scipy
import numpy as np
import argparse
from im2txt import metrics
def prepare_re... | 2,661 | 0 | 46 |
8b9265223e50ec100aaaa1b1c7a69d4103a4ce00 | 1,513 | py | Python | src/hvlrpc/apidef.py | fvutils/pyhvl-rpc | 6bc25bac023682109bd3338b71a6db256ea52442 | [
"Apache-2.0"
] | 1 | 2022-03-01T07:16:48.000Z | 2022-03-01T07:16:48.000Z | src/hvlrpc/apidef.py | fvutils/pyhvl-rpc | 6bc25bac023682109bd3338b71a6db256ea52442 | [
"Apache-2.0"
] | null | null | null | src/hvlrpc/apidef.py | fvutils/pyhvl-rpc | 6bc25bac023682109bd3338b71a6db256ea52442 | [
"Apache-2.0"
] | null | null | null | '''
Created on Jan 31, 2021
@author: mballance
'''
from endpoint_mgr import EndpointMgr
| 33.622222 | 76 | 0.510905 | '''
Created on Jan 31, 2021
@author: mballance
'''
from endpoint_mgr import EndpointMgr
class ApiDef(object):
def __init__(self, name, cls, is_imp, methods):
self.name = name
self.cls = cls
self.is_imp = is_imp
self.methods = methods
# Default import instance
... | 282 | 1,107 | 23 |
f83d88921f7b67d6c4d940147335fd2fe57aedbb | 4,010 | py | Python | numpy_bufr/tables/load_tables.py | Bram94/numpy-BUFR-DWDradar | 93bc315b22ce1c8ba753f863a28ddf6564f0f013 | [
"MIT"
] | 3 | 2019-12-02T19:00:41.000Z | 2020-09-30T02:21:08.000Z | numpy_bufr/tables/load_tables.py | Bram94/numpy_bufr | 93bc315b22ce1c8ba753f863a28ddf6564f0f013 | [
"MIT"
] | null | null | null | numpy_bufr/tables/load_tables.py | Bram94/numpy_bufr | 93bc315b22ce1c8ba753f863a28ddf6564f0f013 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Alexander Maul
#
# Author(s):
#
# Alexander Maul <alexander.maul@dwd.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software F... | 34.869565 | 102 | 0.62818 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Alexander Maul
#
# Author(s):
#
# Alexander Maul <alexander.maul@dwd.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software F... | 0 | 0 | 0 |
aa7fdd1491c6cd55cc5a48da60b1b9f1576ee892 | 2,346 | py | Python | parser.py | bdarcus/MigrationsMap.net | 9b0e2c5cbbedd182db75a0e61116d9ed748c770f | [
"MIT"
] | 48 | 2015-02-23T10:29:30.000Z | 2021-11-26T08:25:34.000Z | parser.py | bdarcus/MigrationsMap.net | 9b0e2c5cbbedd182db75a0e61116d9ed748c770f | [
"MIT"
] | 1 | 2021-02-23T07:40:56.000Z | 2021-02-23T10:11:43.000Z | parser.py | bdarcus/MigrationsMap.net | 9b0e2c5cbbedd182db75a0e61116d9ed748c770f | [
"MIT"
] | 16 | 2015-06-22T03:06:33.000Z | 2020-09-30T17:40:26.000Z | from collections import OrderedDict
import csv
import json
import requests
import time
from collections import defaultdict
#print code_to_name
if __name__ =="__main__":
matrix, reversed_matrix, code_to_name = load_matrices()
f = open('code_to_name.json','w')
code_to_name["WSAHARA"]="Western Sahara",
... | 26.965517 | 110 | 0.633845 | from collections import OrderedDict
import csv
import json
import requests
import time
from collections import defaultdict
def load_matrices():
reader = csv.reader(open('global_migrant_origin_database_version_4.csv', 'rU'), delimiter=',')
row = reader.next()
state_codes = row[2:]
i=0
matrix = {}
... | 1,783 | 0 | 68 |
61c39e3f60a715ffe5170cbdbfc27aab100a0048 | 2,500 | py | Python | src/utilities/title_preprocess.py | CompetitionDataResearch/recsys-spotify-challenge | 7468e82fcc69c45b46fd23ad924446d31f729a2e | [
"Apache-2.0"
] | 7 | 2018-07-02T07:03:41.000Z | 2020-12-01T08:07:25.000Z | src/utilities/title_preprocess.py | CompetitionDataResearch/recsys-spotify-challenge | 7468e82fcc69c45b46fd23ad924446d31f729a2e | [
"Apache-2.0"
] | null | null | null | src/utilities/title_preprocess.py | CompetitionDataResearch/recsys-spotify-challenge | 7468e82fcc69c45b46fd23ad924446d31f729a2e | [
"Apache-2.0"
] | 3 | 2018-07-23T04:21:26.000Z | 2021-07-06T19:33:20.000Z | # -*- coding: utf-8 -*-
"""
reference:
https://www.kaggle.com/fizzbuzz/toxic-data-preprocessing/code
Created on Fri Jun 1 18:00:22 2018
@author: bwhe
"""
import pandas as pd
import copy
import re
RE_PATTERNS = {'party':['party']}
####################### train title ########... | 29.761905 | 102 | 0.5624 | # -*- coding: utf-8 -*-
"""
reference:
https://www.kaggle.com/fizzbuzz/toxic-data-preprocessing/code
Created on Fri Jun 1 18:00:22 2018
@author: bwhe
"""
import pandas as pd
import copy
import re
class BaseTokenizer(object):
def process_text(self, text):
raise NotImplemented
... | 1,592 | 24 | 216 |
0327c46ce034b67c20794506709554f605a36c95 | 9,665 | py | Python | code/utils/loss.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | 1 | 2021-12-20T07:20:25.000Z | 2021-12-20T07:20:25.000Z | code/utils/loss.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | code/utils/loss.py | xueruoyao/FCN-pytorch | a5019da3943f47fa4f7baed3640cdbfeae2d677e | [
"MIT"
] | null | null | null | """
Different Losses
"""
import torch.nn as nn
import torch
import torch.nn.functional as F
from typing import Optional, Union, List
import numpy as np
class LogSoftmaxCELoss(Loss):
""" log softmax + cross entropy loss
"""
def __call__(self, preds: torch.tensor, gts: torch.tensor):
""" calculat... | 44.953488 | 113 | 0.594206 | """
Different Losses
"""
import torch.nn as nn
import torch
import torch.nn.functional as F
from typing import Optional, Union, List
import numpy as np
class Loss:
def __init__(self, n_class: int, weight: Optional[torch.tensor] = None,
smoothing: float = 0.):
""" base class for different... | 4,067 | 2,093 | 209 |
70d3ccec1713ea0f146092f3102b4b546f64e9d6 | 1,604 | py | Python | session_3/a_density_1d.py | Josephbousaleh/MACT21.22_Digital_tools_Big_Data_part_2 | d17a98d5ac1371c04b2616fe594ff867ec575a57 | [
"Apache-2.0"
] | 1 | 2022-02-18T14:35:34.000Z | 2022-02-18T14:35:34.000Z | session_3/a_density_1d.py | Josephbousaleh/MACT21.22_Digital_tools_Big_Data_part_2 | d17a98d5ac1371c04b2616fe594ff867ec575a57 | [
"Apache-2.0"
] | null | null | null | session_3/a_density_1d.py | Josephbousaleh/MACT21.22_Digital_tools_Big_Data_part_2 | d17a98d5ac1371c04b2616fe594ff867ec575a57 | [
"Apache-2.0"
] | 1 | 2022-02-18T14:35:40.000Z | 2022-02-18T14:35:40.000Z | # encoding: utf-8
##################################################
# This script shows how to visualise distribution from a single variable using matplotlib and seaborn
# Multiple tutorials inspired the current design but they mostly came from:
# https://seaborn.pydata.org/tutorial/distributions.html
# References fo... | 36.454545 | 103 | 0.682668 | # encoding: utf-8
##################################################
# This script shows how to visualise distribution from a single variable using matplotlib and seaborn
# Multiple tutorials inspired the current design but they mostly came from:
# https://seaborn.pydata.org/tutorial/distributions.html
# References fo... | 0 | 0 | 0 |
7ff7c5aa6f6f14131c4950482cfd7bb7a6bb5225 | 465 | py | Python | src/sima/simo/thrustcoefficientmodel.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/simo/thrustcoefficientmodel.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/simo/thrustcoefficientmodel.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | # Generated with ThrustCoefficientModel
#
from enum import Enum
from enum import auto
class ThrustCoefficientModel(Enum):
""""""
INTERNAL = auto()
FORWARD = auto()
SEPARATE = auto() | 25.833333 | 51 | 0.63871 | # Generated with ThrustCoefficientModel
#
from enum import Enum
from enum import auto
class ThrustCoefficientModel(Enum):
""""""
INTERNAL = auto()
FORWARD = auto()
SEPARATE = auto()
def label(self):
if self == ThrustCoefficientModel.INTERNAL:
return "Internal"
if self ... | 239 | 0 | 27 |
8377d92f2dad655376004eb338f17a383500ea46 | 1,973 | py | Python | app/rvp.py | LaxmanJonchhen12/CollegePredictor | cc9894932b5a2490be726231a25317abd91a4552 | [
"MIT"
] | null | null | null | app/rvp.py | LaxmanJonchhen12/CollegePredictor | cc9894932b5a2490be726231a25317abd91a4552 | [
"MIT"
] | null | null | null | app/rvp.py | LaxmanJonchhen12/CollegePredictor | cc9894932b5a2490be726231a25317abd91a4552 | [
"MIT"
] | null | null | null | # This function is used to predict the rank using Linear Regression
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
| 32.344262 | 92 | 0.546883 | # This function is used to predict the rank using Linear Regression
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
def pvr(perc,pwd,category):
rvp = pd.read_csv('rvp_cleaned.csv')
if(pwd == 'YES'):
if(categ... | 1,716 | 0 | 46 |
62caa386835ecba019407705b4c9672547a70553 | 1,524 | py | Python | ietf/person/migrations/0005_populate_person_name_from_draft.py | omunroe-com/ietfdb2 | aeaae292fbd55aca1b6043227ec105e67d73367f | [
"BSD-3-Clause"
] | 2 | 2021-11-20T03:40:56.000Z | 2021-11-20T03:40:59.000Z | ietf/person/migrations/0005_populate_person_name_from_draft.py | omunroe-com/ietfdb2 | aeaae292fbd55aca1b6043227ec105e67d73367f | [
"BSD-3-Clause"
] | null | null | null | ietf/person/migrations/0005_populate_person_name_from_draft.py | omunroe-com/ietfdb2 | aeaae292fbd55aca1b6043227ec105e67d73367f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-10 05:28
from __future__ import unicode_literals
import sys
from django.db import migrations
import debug # pyflakes:ignore
| 31.75 | 106 | 0.597769 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-10 05:28
from __future__ import unicode_literals
import sys
from django.db import migrations
import debug # pyflakes:ignore
def populate_person_name_from_draft(apps, schema_editor):
Submission = apps.get_model('subm... | 1,044 | 192 | 69 |
64b86bc86487c6ebdc528defe1c83a9af4f88357 | 341 | py | Python | tests/test05.py | urain39/retry.py | eb94b2ed413acf8cc01dcabedae2c5bd26552bf0 | [
"Apache-2.0"
] | null | null | null | tests/test05.py | urain39/retry.py | eb94b2ed413acf8cc01dcabedae2c5bd26552bf0 | [
"Apache-2.0"
] | 2 | 2019-04-22T11:06:32.000Z | 2019-08-31T09:43:12.000Z | tests/test05.py | urain39/retry.py | eb94b2ed413acf8cc01dcabedae2c5bd26552bf0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from time import sleep
from random import random
from retry import retry
@retry_when((Exception,))
touch()
| 17.05 | 65 | 0.639296 | #!/usr/bin/env python3
from time import sleep
from random import random
from retry import retry
def retry_when(errors):
def handler(err, cnt):
print("Error: retry wait 3s..(cnt: {0} / 3)".format(cnt))
sleep(3 * random())
return retry(errors, 3, handler)
@retry_when((Exception,))
def touch():... | 162 | 0 | 45 |
a5862621dd4050f856877c07f9506845fb376e33 | 549 | py | Python | sexting/transformers/__init__.py | JiangHaoJoinGitHubj/tomwadleyi | 4f62fda31b09cb526274fe34a2bf6f19fdc174ef | [
"0BSD"
] | 15 | 2015-11-12T18:18:17.000Z | 2022-03-08T01:11:32.000Z | sexting/transformers/__init__.py | JiangHaoJoinGitHubj/tomwadleyi | 4f62fda31b09cb526274fe34a2bf6f19fdc174ef | [
"0BSD"
] | null | null | null | sexting/transformers/__init__.py | JiangHaoJoinGitHubj/tomwadleyi | 4f62fda31b09cb526274fe34a2bf6f19fdc174ef | [
"0BSD"
] | 5 | 2017-04-23T12:59:58.000Z | 2022-01-07T01:04:42.000Z | from email import Email
from sms import SMS
from fbmsg import FBMsg
from phone import Phone
from bankwire import BankWire
from paypal import Paypal
from debitcard import DebitCard
from contactlesscard import ContactlessCard
from tube import Tube
from fbstatus import FBStatus
from tweet import Tweet
| 20.333333 | 43 | 0.644809 | from email import Email
from sms import SMS
from fbmsg import FBMsg
from phone import Phone
from bankwire import BankWire
from paypal import Paypal
from debitcard import DebitCard
from contactlesscard import ContactlessCard
from tube import Tube
from fbstatus import FBStatus
from tweet import Tweet
def all_transformer... | 226 | 0 | 23 |
38537ffdaded0b28a8c39d8678a36b530c245a19 | 457 | py | Python | ScotlandPYard/spyengine/maputils.py | AhmadZakaria/ScotlandPYard | 131e4b5c884319cb01a0c666dd54519986e515fa | [
"MIT"
] | 6 | 2017-12-12T08:45:16.000Z | 2020-05-15T19:34:09.000Z | ScotlandPYard/spyengine/maputils.py | AhmadZakaria/ScotlandPYard | 131e4b5c884319cb01a0c666dd54519986e515fa | [
"MIT"
] | 139 | 2017-12-15T22:29:27.000Z | 2022-03-01T15:01:24.000Z | ScotlandPYard/spyengine/maputils.py | AhmadZakaria/ScotlandPYard | 131e4b5c884319cb01a0c666dd54519986e515fa | [
"MIT"
] | 2 | 2018-10-09T17:38:55.000Z | 2020-06-21T21:28:28.000Z | import networkx as nx
from ..config.gameconfig import maps
| 26.882353 | 96 | 0.652079 | import networkx as nx
from ..config.gameconfig import maps
def get_map_graph(map_name):
if map_name not in maps:
raise NotImplementedError("This map is not implemented yet: {}".format(map_name))
map = maps[map_name]
G = nx.MultiGraph()
for ticket in map["connections"]:
for path in ma... | 373 | 0 | 23 |
33b418c90ca620217447920080642be24e6914b4 | 2,369 | py | Python | evil_mystery_word_tests.py | gcrowder/mystery_word | 4c137ee967b50cd73d3f4a0fc16fc020fb64a4bb | [
"MIT"
] | null | null | null | evil_mystery_word_tests.py | gcrowder/mystery_word | 4c137ee967b50cd73d3f4a0fc16fc020fb64a4bb | [
"MIT"
] | null | null | null | evil_mystery_word_tests.py | gcrowder/mystery_word | 4c137ee967b50cd73d3f4a0fc16fc020fb64a4bb | [
"MIT"
] | null | null | null | import unittest
import evil_mystery_word
test_words = ['i', 'spoke', 'to', 'several', 'people', 'with', 'delayed', 'sleep', 'phase', 'a', 'condition', 'that', 'congressional']
if __name__ == '__main__':
unittest.main()
| 50.404255 | 151 | 0.691431 | import unittest
import evil_mystery_word
test_words = ['i', 'spoke', 'to', 'several', 'people', 'with', 'delayed', 'sleep', 'phase', 'a', 'condition', 'that', 'congressional']
class TestMysteryWord(unittest.TestCase):
def test_assert_equal_get_words(self):
self.assertEqual(evil_mystery_word.get_words('te... | 1,776 | 20 | 347 |
a6007dc4ef5a842518819773606454e3a597339e | 42 | py | Python | gendist/gendist/__init__.py | probml/shift-happens | 67bd65a7652e0cd148d94a2085d6e546ace584b2 | [
"MIT"
] | 5 | 2022-01-19T18:58:25.000Z | 2022-03-08T16:08:54.000Z | gendist/gendist/__init__.py | probml/shift-happens | 67bd65a7652e0cd148d94a2085d6e546ace584b2 | [
"MIT"
] | null | null | null | gendist/gendist/__init__.py | probml/shift-happens | 67bd65a7652e0cd148d94a2085d6e546ace584b2 | [
"MIT"
] | 1 | 2022-01-20T01:56:55.000Z | 2022-01-20T01:56:55.000Z | from . import training, processing, models | 42 | 42 | 0.809524 | from . import training, processing, models | 0 | 0 | 0 |
12a1f384fb7ff28ae6e649beccdf4c74d93afe3e | 8,185 | py | Python | shellcraft/player.py | dwahme/shellcraft | 1c0f1a824a7e2564b232165f0ff1c02ec7f7def8 | [
"MIT"
] | 2 | 2020-02-20T04:50:12.000Z | 2020-08-31T02:05:31.000Z | shellcraft/player.py | dwahme/shellcraft | 1c0f1a824a7e2564b232165f0ff1c02ec7f7def8 | [
"MIT"
] | null | null | null | shellcraft/player.py | dwahme/shellcraft | 1c0f1a824a7e2564b232165f0ff1c02ec7f7def8 | [
"MIT"
] | null | null | null | from .enums.direction import Direction
from .enums.event import Event
from . import blocks, computer, monitor
from .utils.chilog import chilog
| 32.609562 | 164 | 0.478558 | from .enums.direction import Direction
from .enums.event import Event
from . import blocks, computer, monitor
from .utils.chilog import chilog
class Player:
def __init__(self):
self.y = 0
self.x = 0
self.item = "DIRT"
self.originalBlockType = "AIR"
self.action = "NORMAL"
... | 4,219 | 3,782 | 23 |
9c02a0d2ded9b1473f1949fd209fb901dbcbd3f0 | 1,521 | py | Python | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/cameras/migrations/0005_auto_20200922_0641.py | kaka-lin/azure-intelligent-edge-patterns | 766833c7c25d2458cec697937be288202d1763bc | [
"MIT"
] | 176 | 2019-07-03T00:20:15.000Z | 2022-03-14T07:51:22.000Z | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/cameras/migrations/0005_auto_20200922_0641.py | kaka-lin/azure-intelligent-edge-patterns | 766833c7c25d2458cec697937be288202d1763bc | [
"MIT"
] | 121 | 2019-06-24T20:47:27.000Z | 2022-03-28T02:16:18.000Z | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/cameras/migrations/0005_auto_20200922_0641.py | kaka-lin/azure-intelligent-edge-patterns | 766833c7c25d2458cec697937be288202d1763bc | [
"MIT"
] | 144 | 2019-06-18T18:48:43.000Z | 2022-03-31T12:14:46.000Z | # Generated by Django 3.0.8 on 2020-09-22 06:41
import json
import uuid
from django.db import migrations, models
def gen_default_lines():
"""gen_default_lines."""
template = {
"useCountingLine": True,
"countingLines": [
{
"id": "$UUID_PLACE_HOLDER",
... | 24.934426 | 70 | 0.505588 | # Generated by Django 3.0.8 on 2020-09-22 06:41
import json
import uuid
from django.db import migrations, models
def gen_default_lines():
"""gen_default_lines."""
template = {
"useCountingLine": True,
"countingLines": [
{
"id": "$UUID_PLACE_HOLDER",
... | 0 | 558 | 23 |
55c861095f41496f18d15d8407e0534f63665b7f | 4,702 | py | Python | driver/driver.py | alexanderwasey/turtlebot_software | e82311b6aa79cda438b70767b8bcfd8867a12f5e | [
"Unlicense"
] | null | null | null | driver/driver.py | alexanderwasey/turtlebot_software | e82311b6aa79cda438b70767b8bcfd8867a12f5e | [
"Unlicense"
] | null | null | null | driver/driver.py | alexanderwasey/turtlebot_software | e82311b6aa79cda438b70767b8bcfd8867a12f5e | [
"Unlicense"
] | null | null | null | from __future__ import absolute_import
import math
import threading
from time import sleep
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from tf.transformations import euler_from_quaternion
import collisions
from .exceptions import MovementObstructed
from .odometry import Odometer... | 35.621212 | 143 | 0.59698 | from __future__ import absolute_import
import math
import threading
from time import sleep
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from tf.transformations import euler_from_quaternion
import collisions
from .exceptions import MovementObstructed
from .odometry import Odometer... | 3,964 | 371 | 23 |
ca4c4d9b56284401ce5b6bc065cbf3e68910ad02 | 282 | py | Python | examples/pup/hub_shared/imu_tilt.py | thesynman/pybricks-api | fbbb81caf0703d3d862d5417416adb9295754de0 | [
"MIT"
] | 51 | 2020-04-02T10:03:45.000Z | 2022-03-27T23:49:39.000Z | examples/pup/hub_shared/imu_tilt.py | thesynman/pybricks-api | fbbb81caf0703d3d862d5417416adb9295754de0 | [
"MIT"
] | 77 | 2020-03-22T17:32:14.000Z | 2022-03-28T18:02:43.000Z | examples/pup/hub_shared/imu_tilt.py | thesynman/pybricks-api | fbbb81caf0703d3d862d5417416adb9295754de0 | [
"MIT"
] | 25 | 2020-03-18T23:35:17.000Z | 2022-01-01T12:52:01.000Z | # ExampleHub = TechnicHub PrimeHub
from pybricks.hubs import ExampleHub
from pybricks.tools import wait
# Initialize the hub.
hub = ExampleHub()
while True:
# Read the tilt values.
pitch, roll = hub.imu.tilt()
# Print the result.
print(pitch, roll)
wait(200)
| 18.8 | 36 | 0.695035 | # ExampleHub = TechnicHub PrimeHub
from pybricks.hubs import ExampleHub
from pybricks.tools import wait
# Initialize the hub.
hub = ExampleHub()
while True:
# Read the tilt values.
pitch, roll = hub.imu.tilt()
# Print the result.
print(pitch, roll)
wait(200)
| 0 | 0 | 0 |
16123c97dbbdbaba73fa0445af1dcb97ff0179bf | 1,390 | py | Python | controller/tasks.py | phyz777/muonic_webapp_BUW | e8c9f4622b477a739aaf4978ed35ac6c5caaf608 | [
"MIT"
] | null | null | null | controller/tasks.py | phyz777/muonic_webapp_BUW | e8c9f4622b477a739aaf4978ed35ac6c5caaf608 | [
"MIT"
] | null | null | null | controller/tasks.py | phyz777/muonic_webapp_BUW | e8c9f4622b477a739aaf4978ed35ac6c5caaf608 | [
"MIT"
] | null | null | null | from celery import shared_task
from muonic.lib.app import App
from muonic.lib.consumers import BufferedConsumer
from muonic_django.consumer import Consumer as DjangoConsumer
from muonic.lib.analyzers import *
from django.conf import settings
@shared_task(bind=True) | 36.578947 | 105 | 0.695683 | from celery import shared_task
from muonic.lib.app import App
from muonic.lib.consumers import BufferedConsumer
from muonic_django.consumer import Consumer as DjangoConsumer
from muonic.lib.analyzers import *
from django.conf import settings
@shared_task(bind=True)
def start_run(self, options = {}):
if 'data_pro... | 1,101 | 0 | 22 |
05f94477fa2f36f4f2654bf1865c7c6ae2afcb4c | 20,771 | py | Python | lib/modeling/fast_rcnn_heads.py | szrlee/Detectron.pytorch | b64f94305a8df184c863100de3840cbb78c25008 | [
"MIT"
] | null | null | null | lib/modeling/fast_rcnn_heads.py | szrlee/Detectron.pytorch | b64f94305a8df184c863100de3840cbb78c25008 | [
"MIT"
] | null | null | null | lib/modeling/fast_rcnn_heads.py | szrlee/Detectron.pytorch | b64f94305a8df184c863100de3840cbb78c25008 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
from core.config import cfg
import nn as mynn
import utils.net as net_utils
import utils.boxes as box_utils
import numpy as np
# -------------------------------------------------------... | 44.006356 | 117 | 0.625584 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
from core.config import cfg
import nn as mynn
import utils.net as net_utils
import utils.boxes as box_utils
import numpy as np
class fast_rcnn_outputs(nn.Module):
def __init__(self,... | 19,516 | 14 | 520 |
fbf27276f4103c076213cca870f14ffe216028dc | 2,181 | py | Python | swmm_baseline_model.py | UVAdMIST/smart_stormwater_rl | 0f0245e68a8ae15240df040bbda9ea5165f8f91f | [
"MIT"
] | null | null | null | swmm_baseline_model.py | UVAdMIST/smart_stormwater_rl | 0f0245e68a8ae15240df040bbda9ea5165f8f91f | [
"MIT"
] | null | null | null | swmm_baseline_model.py | UVAdMIST/smart_stormwater_rl | 0f0245e68a8ae15240df040bbda9ea5165f8f91f | [
"MIT"
] | 2 | 2020-12-05T20:40:45.000Z | 2021-04-15T13:41:18.000Z | """
Created by Benjamin Bowes, 4-19-19
This script records depth and flood values at each swmm model time step and plots them.
"""
from pyswmm import Simulation, Nodes, Links, Subcatchments
import matplotlib.pyplot as plt
from smart_stormwater_rl.pyswmm_utils import save_out
control_time_step = 900 # contro... | 27.607595 | 110 | 0.687758 | """
Created by Benjamin Bowes, 4-19-19
This script records depth and flood values at each swmm model time step and plots them.
"""
from pyswmm import Simulation, Nodes, Links, Subcatchments
import matplotlib.pyplot as plt
from smart_stormwater_rl.pyswmm_utils import save_out
control_time_step = 900 # contro... | 0 | 0 | 0 |
dad5bc5b9e7f8ed1a87ec3dc22a74bb63f3dfde1 | 839 | py | Python | p748_shortest_completing_word.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p748_shortest_completing_word.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p748_shortest_completing_word.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null |
fn = Solution().shortestCompletingWord
print(fn(licensePlate="1s3 PSt", words=["step", "steps", "stripe", "stepple"]))
print(fn(licensePlate="1s3 456", words=["looks", "pest", "stew", "show"]))
| 31.074074 | 79 | 0.52801 | class Solution:
def shortestCompletingWord(self, licensePlate, words):
"""
:type licensePlate: str
:type words: List[str]
:rtype: str
"""
from collections import Counter
import re
plate = Counter(re.findall(r'[a-z]', licensePlate.lower()))
best... | 0 | 620 | 22 |
ec81812dfb4fda9d1186442358286ac6716c02c7 | 1,805 | py | Python | social/serializers/user_search_serializer.py | Mangeneh/akkaskhooneh-backend | 2a81e73fbe0d55d5821ba1670a997bd8851c4af6 | [
"MIT"
] | 7 | 2018-09-17T18:34:49.000Z | 2019-09-15T11:39:15.000Z | social/serializers/user_search_serializer.py | Mangeneh/akkaskhooneh-backend | 2a81e73fbe0d55d5821ba1670a997bd8851c4af6 | [
"MIT"
] | 9 | 2019-10-21T17:12:21.000Z | 2022-03-11T23:28:14.000Z | social/serializers/user_search_serializer.py | Mangeneh/akkaskhooneh-backend | 2a81e73fbe0d55d5821ba1670a997bd8851c4af6 | [
"MIT"
] | 1 | 2019-11-29T16:12:12.000Z | 2019-11-29T16:12:12.000Z | from rest_framework import serializers
from authentication.models import User
from social.models import Followers, Request
from utils import paginator
| 30.083333 | 79 | 0.6 | from rest_framework import serializers
from authentication.models import User
from social.models import Followers, Request
from utils import paginator
class UserSearchSerializer(serializers.ModelSerializer):
count = serializers.SerializerMethodField()
results = serializers.SerializerMethodField()
total_pa... | 1,271 | 359 | 23 |
b8d034f6b7d5c2af9e03f103b4f28ec9eb63efce | 2,187 | py | Python | ALPR/alvr.py | juanmapf97/license-plate-detection | ea26395312bc5c464b8843071ea1e2c11536aa7a | [
"Unlicense"
] | null | null | null | ALPR/alvr.py | juanmapf97/license-plate-detection | ea26395312bc5c464b8843071ea1e2c11536aa7a | [
"Unlicense"
] | 2 | 2021-03-09T21:59:08.000Z | 2021-12-09T01:15:39.000Z | ALPR/alvr.py | juanmapf97/license-plate-detection | ea26395312bc5c464b8843071ea1e2c11536aa7a | [
"Unlicense"
] | 1 | 2019-11-14T18:27:59.000Z | 2019-11-14T18:27:59.000Z | import numpy as np
import cv2
import imutils
import pytesseract
from PIL import Image
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
# Get text from a cropped image of a license plate
# Detect a license plate in a picture
| 31.695652 | 103 | 0.644262 | import numpy as np
import cv2
import imutils
import pytesseract
from PIL import Image
pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
# Get text from a cropped image of a license plate
def getText(plate):
return pytesseract.image_to_string(plate, config='--psm 11')
#p... | 1,867 | 0 | 44 |
103fae9bb4a78dc0aaf46943b00526332eca3cc7 | 2,442 | py | Python | bin/CMakeModules.py | hanswenzel/opticks | b75b5929b6cf36a5eedeffb3031af2920f75f9f0 | [
"Apache-2.0"
] | 11 | 2020-07-05T02:39:32.000Z | 2022-03-20T18:52:44.000Z | bin/CMakeModules.py | hanswenzel/opticks | b75b5929b6cf36a5eedeffb3031af2920f75f9f0 | [
"Apache-2.0"
] | null | null | null | bin/CMakeModules.py | hanswenzel/opticks | b75b5929b6cf36a5eedeffb3031af2920f75f9f0 | [
"Apache-2.0"
] | 4 | 2020-09-03T20:36:32.000Z | 2022-01-19T07:42:21.000Z | #!/usr/bin/env python
"""
CMakeModules.py
==================
This copies cmake/Modules into the installation directory
which is necessary to allow building against the release.
Usage Example
---------------
Note that the destination directory is deleted and populated on every run
::
[blyth@localhost ~]$ C... | 30.525 | 198 | 0.612613 | #!/usr/bin/env python
"""
CMakeModules.py
==================
This copies cmake/Modules into the installation directory
which is necessary to allow building against the release.
Usage Example
---------------
Note that the destination directory is deleted and populated on every run
::
[blyth@localhost ~]$ C... | 508 | 681 | 23 |
56c076b268f48c00c66e04609c9a6a07a074d74d | 821 | py | Python | web-app/__init__.py | mohshawky5193/otakumeter | a227699724300890c775e8076d99e2cd313ae7a7 | [
"Apache-2.0"
] | null | null | null | web-app/__init__.py | mohshawky5193/otakumeter | a227699724300890c775e8076d99e2cd313ae7a7 | [
"Apache-2.0"
] | null | null | null | web-app/__init__.py | mohshawky5193/otakumeter | a227699724300890c775e8076d99e2cd313ae7a7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 13 00:32:45 2020
@author: mam22
"""
from flask import Flask, render_template,request,jsonify,session
from get_anime_characters_from_database import get_anime_characters_for_quiz
import gc
app = Flask(__name__)
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/')
@a... | 25.65625 | 76 | 0.732034 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 13 00:32:45 2020
@author: mam22
"""
from flask import Flask, render_template,request,jsonify,session
from get_anime_characters_from_database import get_anime_characters_for_quiz
import gc
app = Flask(__name__)
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/')
de... | 250 | 0 | 110 |
c4fdf0c6cbd74c43432e5f0a564c6078532ba5d6 | 271 | py | Python | chexpert-model/train_set_create_script.py | stanfordmlgroup/CheXseg | ca345d7c4523816c174aafd2c40929345b38b2b2 | [
"MIT"
] | 7 | 2021-05-19T20:55:42.000Z | 2022-03-22T05:20:59.000Z | chexpert-model/train_set_create_script.py | subratac/CheXseg | fb5c411ce08e394cd4a2a87d963843942bdc2021 | [
"MIT"
] | null | null | null | chexpert-model/train_set_create_script.py | subratac/CheXseg | fb5c411ce08e394cd4a2a87d963843942bdc2021 | [
"MIT"
] | 3 | 2021-05-19T20:52:39.000Z | 2021-09-01T01:57:25.000Z | from create_semi_supervised_train_set import filter_train_set
from constants import *
if __name__ == "__main__":
for i in [10, 100, 500, 1000]:
for task in LOCALIZATION_TASKS:
print("FILTERING TASK: ", task)
filter_train_set(task, i)
| 30.111111 | 61 | 0.675277 | from create_semi_supervised_train_set import filter_train_set
from constants import *
if __name__ == "__main__":
for i in [10, 100, 500, 1000]:
for task in LOCALIZATION_TASKS:
print("FILTERING TASK: ", task)
filter_train_set(task, i)
| 0 | 0 | 0 |
fb6bb8c209a40fe449dfa2e32402e823f9231e15 | 2,927 | py | Python | lib/couchBase.py | philipsales/airflow-couchbase-elasticsearch | f9bf06d88956d3e2322a7dfa6207becbdc1d1769 | [
"MIT"
] | null | null | null | lib/couchBase.py | philipsales/airflow-couchbase-elasticsearch | f9bf06d88956d3e2322a7dfa6207becbdc1d1769 | [
"MIT"
] | null | null | null | lib/couchBase.py | philipsales/airflow-couchbase-elasticsearch | f9bf06d88956d3e2322a7dfa6207becbdc1d1769 | [
"MIT"
] | null | null | null | import sys
import json
import time
import requests
from couchbase.bucket import Bucket
from couchbase.n1ql import N1QLQuery, N1QLError
from couchbase.exceptions import CouchbaseTransientError, CouchbaseNetworkError
from requests.exceptions import RequestException
from log.config import set_log_config, logging
logger... | 25.452174 | 95 | 0.565767 | import sys
import json
import time
import requests
from couchbase.bucket import Bucket
from couchbase.n1ql import N1QLQuery, N1QLError
from couchbase.exceptions import CouchbaseTransientError, CouchbaseNetworkError
from requests.exceptions import RequestException
from log.config import set_log_config, logging
logger... | 2,211 | 1 | 349 |
d131bda77cc5515f157ebd7ce385b6200a9828c5 | 1,841 | py | Python | tests/unit/test_taxonomy.py | anton-chekanov/lpipe | acc2c18150584e2e330eb0fbce889ea0ec77cd62 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_taxonomy.py | anton-chekanov/lpipe | acc2c18150584e2e330eb0fbce889ea0ec77cd62 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_taxonomy.py | anton-chekanov/lpipe | acc2c18150584e2e330eb0fbce889ea0ec77cd62 | [
"Apache-2.0"
] | null | null | null | import pytest
from lpipe.exceptions import InvalidTaxonomyURI
from lpipe.taxonomy import Brand, Company, Product, TaxonomyURI
| 29.693548 | 66 | 0.657795 | import pytest
from lpipe.exceptions import InvalidTaxonomyURI
from lpipe.taxonomy import Brand, Company, Product, TaxonomyURI
class TestTaxonomyURI:
def test_init(self):
uri = TaxonomyURI(1234, "foobar", 5678)
assert uri.version == 1234
assert uri.type == "foobar"
assert uri.id ==... | 1,402 | 1 | 307 |
518e0b3db8f6a55f6f0898c3512d7a0b274ceb3d | 1,510 | py | Python | scripts/cluster_scores.py | MathiasMeuleman/measure-clustering | 3451ab50c9d77eb83f211ab6bf713bd3ac545926 | [
"MIT"
] | null | null | null | scripts/cluster_scores.py | MathiasMeuleman/measure-clustering | 3451ab50c9d77eb83f211ab6bf713bd3ac545926 | [
"MIT"
] | null | null | null | scripts/cluster_scores.py | MathiasMeuleman/measure-clustering | 3451ab50c9d77eb83f211ab6bf713bd3ac545926 | [
"MIT"
] | null | null | null | import numpy as np
from score_analysis.measure_clusterer import MeasureClusterer
from util.dirs import get_musicdata_scores, get_parts
if __name__ == '__main__':
for score in get_musicdata_scores(follow_parts=False):
print('Clustering {}...'.format(score.name))
dist_matrix_path = score / 'dist_mat... | 45.757576 | 82 | 0.650331 | import numpy as np
from score_analysis.measure_clusterer import MeasureClusterer
from util.dirs import get_musicdata_scores, get_parts
if __name__ == '__main__':
for score in get_musicdata_scores(follow_parts=False):
print('Clustering {}...'.format(score.name))
dist_matrix_path = score / 'dist_mat... | 0 | 0 | 0 |
0918eb9886d1a8986e1dd632ee80b02436a057fa | 898 | py | Python | corehq/form_processor/migrations/0031_add_details_field_to_case_transaction.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/form_processor/migrations/0031_add_details_field_to_case_transaction.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/form_processor/migrations/0031_add_details_field_to_case_transaction.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import models, migrations
import jsonfield.fields
| 30.965517 | 224 | 0.643653 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('form_processor', '0030_casetransaction_revoked'),
]
operations = [
... | 0 | 705 | 23 |
df0e4bc6c01a3fd360af919cd7a376f61a4072b9 | 521 | py | Python | spkcspider/apps/spider/migrations/0009_auto_20190929_2117.py | devkral/spkbspider | 97e448b4da412acebd66c4469c7fcdd07bf90ed2 | [
"MIT"
] | 5 | 2019-06-24T14:15:54.000Z | 2021-05-14T23:16:31.000Z | spkcspider/apps/spider/migrations/0009_auto_20190929_2117.py | devkral/spkbspider | 97e448b4da412acebd66c4469c7fcdd07bf90ed2 | [
"MIT"
] | 2 | 2018-06-19T09:56:18.000Z | 2018-11-20T12:02:44.000Z | spkcspider/apps/spider/migrations/0009_auto_20190929_2117.py | devkral/spkbspider | 97e448b4da412acebd66c4469c7fcdd07bf90ed2 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-09-29 21:17
from django.db import migrations, models
| 27.421053 | 170 | 0.612284 | # Generated by Django 2.2.5 on 2019-09-29 21:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spider_base', '0008_auto_20190817_1815'),
]
operations = [
migrations.AlterField(
model_name='assignedprotection',
n... | 0 | 407 | 23 |
cbdda6115be4368160a4438da0c35144e4ff86ab | 337 | py | Python | pokedex/pokemon/views.py | arpradhan/django-pokedex | 77e154bc0b38e6cf9a75dc3cafd0605ea0f0bb8e | [
"MIT"
] | null | null | null | pokedex/pokemon/views.py | arpradhan/django-pokedex | 77e154bc0b38e6cf9a75dc3cafd0605ea0f0bb8e | [
"MIT"
] | null | null | null | pokedex/pokemon/views.py | arpradhan/django-pokedex | 77e154bc0b38e6cf9a75dc3cafd0605ea0f0bb8e | [
"MIT"
] | null | null | null | from rest_framework import viewsets, permissions
from .serializers import PokemonSerializer
from .models import Pokemon
| 25.923077 | 57 | 0.789318 | from rest_framework import viewsets, permissions
from .serializers import PokemonSerializer
from .models import Pokemon
class PokemonViewSet(viewsets.ModelViewSet):
queryset = Pokemon.objects.all()
serializer_class = PokemonSerializer
permission_classes = [
permissions.DjangoModelPermissionsOrAno... | 0 | 192 | 23 |
9efc297bee0e9e48acfa9f0bf6ff3f741ac2e410 | 182 | py | Python | pl_gaze_estimation/datasets/mpiigaze/transforms.py | hysts/pl_gaze_estimation | 1123053a57115da5bb8ea9675911e7d9230f3ec9 | [
"MIT"
] | 10 | 2021-11-27T20:12:14.000Z | 2022-03-21T09:02:33.000Z | pl_gaze_estimation/datasets/mpiigaze/transforms.py | hysts/pl_gaze_estimation | 1123053a57115da5bb8ea9675911e7d9230f3ec9 | [
"MIT"
] | 1 | 2022-02-24T08:03:11.000Z | 2022-02-26T06:13:15.000Z | pl_gaze_estimation/datasets/mpiigaze/transforms.py | hysts/pl_gaze_estimation | 1123053a57115da5bb8ea9675911e7d9230f3ec9 | [
"MIT"
] | 3 | 2021-11-29T02:22:41.000Z | 2022-01-18T08:11:49.000Z | from typing import Callable
import torchvision.transforms as T
| 16.545455 | 35 | 0.681319 | from typing import Callable
import torchvision.transforms as T
def create_transform() -> Callable:
transforms = [
T.ToTensor(),
]
return T.Compose(transforms)
| 94 | 0 | 23 |
078602765783dfcc956246aa743f95305b6d12fc | 15,033 | py | Python | LoopStructural/interpolators/structured_grid.py | saward/LoopStructural | 541f0500a5387f2a337c5e715828d2c9e4cfe7b2 | [
"MIT"
] | null | null | null | LoopStructural/interpolators/structured_grid.py | saward/LoopStructural | 541f0500a5387f2a337c5e715828d2c9e4cfe7b2 | [
"MIT"
] | null | null | null | LoopStructural/interpolators/structured_grid.py | saward/LoopStructural | 541f0500a5387f2a337c5e715828d2c9e4cfe7b2 | [
"MIT"
] | null | null | null | """
Cartesian grid for fold interpolator
"""
import logging
import numpy as np
logger = logging.getLogger(__name__)
class StructuredGrid:
"""
"""
def __init__(self,
origin=np.zeros(3),
nsteps=np.array([10, 10, 10]),
step_vector=np.ones(3),
... | 31.985106 | 83 | 0.490321 | """
Cartesian grid for fold interpolator
"""
import logging
import numpy as np
logger = logging.getLogger(__name__)
class StructuredGrid:
"""
"""
def __init__(self,
origin=np.zeros(3),
nsteps=np.array([10, 10, 10]),
step_vector=np.ones(3),
... | 2,966 | 0 | 215 |
1b090d276d8aa2518c7d0b005d01bc2541f16d3d | 500 | py | Python | core/features/steps/access_system.py | rodrigoncalves/anato-hub | bb6c5a39bfbc247476a6ef4fe410c972b5e561c4 | [
"MIT"
] | null | null | null | core/features/steps/access_system.py | rodrigoncalves/anato-hub | bb6c5a39bfbc247476a6ef4fe410c972b5e561c4 | [
"MIT"
] | null | null | null | core/features/steps/access_system.py | rodrigoncalves/anato-hub | bb6c5a39bfbc247476a6ef4fe410c972b5e561c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from behave import given, when, then
from selenium import webdriver
from should_dsl import should
@given(u'que o usuário abre o navegador')
@when(u'acessa a url "{url}"')
@then(u'o sistema exibe a pagina de login')
| 23.809524 | 65 | 0.72 | # -*- coding: utf-8 -*-
from behave import given, when, then
from selenium import webdriver
from should_dsl import should
@given(u'que o usuário abre o navegador')
def open_browser(context):
context.driver = webdriver.Firefox()
@when(u'acessa a url "{url}"')
def access_localhost(context, url):
context.drive... | 189 | 0 | 66 |
37c9c251d957221d52ff1c6d37ee2af1d18657a1 | 3,387 | py | Python | projects/crontab/logic/stock_monitor.py | kingking888/crawler-pyspider | 29ba13905c73081097df9ef646a5c8194eb024be | [
"Apache-2.0"
] | 1 | 2021-12-07T15:48:51.000Z | 2021-12-07T15:48:51.000Z | projects/crontab/logic/stock_monitor.py | GongSong/crawler-pyspider | b6dcec4afa4e1cd393f94627290a21ed95238676 | [
"Apache-2.0"
] | null | null | null | projects/crontab/logic/stock_monitor.py | GongSong/crawler-pyspider | b6dcec4afa4e1cd393f94627290a21ed95238676 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:12:02.000Z | 2021-11-10T07:12:02.000Z | """
仓库服务的库存监控
"""
from alarm.page.ding_talk import DingTalk
from crontab.config import prod_filter_warehouse_ids, ROBOT_TOKEN
from crontab.model.mysql.order_goods import OrderGoods
from crontab.model.mysql.order_info import OrderInfo
from crontab.model.mysql.product import Product
if __name__ == '__main__':
Stoc... | 34.561224 | 112 | 0.574255 | """
仓库服务的库存监控
"""
from alarm.page.ding_talk import DingTalk
from crontab.config import prod_filter_warehouse_ids, ROBOT_TOKEN
from crontab.model.mysql.order_goods import OrderGoods
from crontab.model.mysql.order_info import OrderInfo
from crontab.model.mysql.product import Product
class StockMonitor:
def __init_... | 1,212 | 1,961 | 23 |
629a216e731ea8a603abf2d42e522179e0ccd8ae | 439 | py | Python | tfim/data/utils.py | c0de2eat/tf-img-models | c8e13cd11d2ad86acb42952751ace46419795555 | [
"MIT"
] | null | null | null | tfim/data/utils.py | c0de2eat/tf-img-models | c8e13cd11d2ad86acb42952751ace46419795555 | [
"MIT"
] | null | null | null | tfim/data/utils.py | c0de2eat/tf-img-models | c8e13cd11d2ad86acb42952751ace46419795555 | [
"MIT"
] | null | null | null | import tensorflow as tf
__all__ = ["batchify"]
| 23.105263 | 77 | 0.694761 | import tensorflow as tf
__all__ = ["batchify"]
def batchify(
dataset: tf.data.Dataset,
batch_size: int,
*,
shuffle: bool = False,
buffer_size: int = None
) -> tf.data.Dataset:
if shuffle:
dataset = dataset.shuffle(buffer_size, reshuffle_each_iteration=True)
dataset = dataset.batc... | 366 | 0 | 23 |
0f682671465213324b8c7e9ef554ca565045e8a6 | 565 | py | Python | macstract.py | balthebladre/macstract | 5beb4c7a1435022825e9caf9f316aa6dd71e96ba | [
"MIT"
] | null | null | null | macstract.py | balthebladre/macstract | 5beb4c7a1435022825e9caf9f316aa6dd71e96ba | [
"MIT"
] | null | null | null | macstract.py | balthebladre/macstract | 5beb4c7a1435022825e9caf9f316aa6dd71e96ba | [
"MIT"
] | null | null | null | # shebang goes here
import argparse, shutil
parser = argparse.ArgumentParser(description='TODO')
parser.add_argument('destination', help='Destination to copy files')
parser.add_argument('-f',action='count',help='Force script to copy all files regardless of size')
args = parser.parse_args()
if __name__ == "__main__":... | 26.904762 | 97 | 0.704425 | # shebang goes here
import argparse, shutil
parser = argparse.ArgumentParser(description='TODO')
parser.add_argument('destination', help='Destination to copy files')
parser.add_argument('-f',action='count',help='Force script to copy all files regardless of size')
args = parser.parse_args()
def copy_verbose(source_pa... | 170 | 0 | 23 |
29a592057919ed377e4b419360a1a74f50986bc0 | 941 | py | Python | setup.py | deathbeds/ktop | b9ff55af75980526337ea1903bda83ccf1bf2f1e | [
"BSD-3-Clause"
] | null | null | null | setup.py | deathbeds/ktop | b9ff55af75980526337ea1903bda83ccf1bf2f1e | [
"BSD-3-Clause"
] | 1 | 2018-01-19T17:11:40.000Z | 2018-01-19T17:11:40.000Z | setup.py | deathbeds/ktop | b9ff55af75980526337ea1903bda83ccf1bf2f1e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from os.path import dirname, join
from setuptools import setup, find_packages
name = "ktop"
brand = "ripxl"
full_name = "Dead Pixel Collective"
with open(join(dirname(__file__), "src", name, "__init__.py")) as fp:
for i, line in enumerate(fp.readlines()):
if line.startswith("__versio... | 28.515152 | 73 | 0.650372 | #!/usr/bin/env python
from os.path import dirname, join
from setuptools import setup, find_packages
name = "ktop"
brand = "ripxl"
full_name = "Dead Pixel Collective"
with open(join(dirname(__file__), "src", name, "__init__.py")) as fp:
for i, line in enumerate(fp.readlines()):
if line.startswith("__versio... | 0 | 0 | 0 |
437ab89d95677cae1c788b6a5c326d70ad6d4f3a | 4,313 | py | Python | gradient_and_color_libary.py | nkowdley/CarND-Advanced-Lane-Lines | 620f2e3dd2a5c7a4ee528018592fb0fb651d8cee | [
"MIT"
] | null | null | null | gradient_and_color_libary.py | nkowdley/CarND-Advanced-Lane-Lines | 620f2e3dd2a5c7a4ee528018592fb0fb651d8cee | [
"MIT"
] | null | null | null | gradient_and_color_libary.py | nkowdley/CarND-Advanced-Lane-Lines | 620f2e3dd2a5c7a4ee528018592fb0fb651d8cee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
A python library for the Udacity Project Advanced Lane Lines
This library is designed to abstract away some useful functions, so that using this code
for images/video becomes almost like calling an API
"""
import numpy as np
import cv2
import glob
import pickle
from pprint import pprint
# T... | 44.927083 | 105 | 0.697426 | #!/usr/bin/env python
"""
A python library for the Udacity Project Advanced Lane Lines
This library is designed to abstract away some useful functions, so that using this code
for images/video becomes almost like calling an API
"""
import numpy as np
import cv2
import glob
import pickle
from pprint import pprint
# T... | 3,384 | 0 | 141 |
20417b9c67d97dbf17f6edb3acd987f7ead23169 | 1,016 | py | Python | sample-sentiment.py | EEICHS/Twotter2 | 964c312df6c00186031312924b5d8a8872a6753b | [
"MIT"
] | null | null | null | sample-sentiment.py | EEICHS/Twotter2 | 964c312df6c00186031312924b5d8a8872a6753b | [
"MIT"
] | null | null | null | sample-sentiment.py | EEICHS/Twotter2 | 964c312df6c00186031312924b5d8a8872a6753b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Natural Language Processing example performing
# sentiment analysis and setting a Belleds light to
# a color matching sentiment.
#
# Example usage:
# echo "I hate you and I'm having a terrible day" | ./sample-sentiment.py
# => user is angry, light turns red
# echo "I love chocolate. So awesome... | 28.222222 | 101 | 0.700787 | #!/usr/bin/env python3
# Natural Language Processing example performing
# sentiment analysis and setting a Belleds light to
# a color matching sentiment.
#
# Example usage:
# echo "I hate you and I'm having a terrible day" | ./sample-sentiment.py
# => user is angry, light turns red
# echo "I love chocolate. So awesome... | 0 | 0 | 0 |
9d36a1832960e4df3f6843cd57434dc65225af9d | 256 | py | Python | tests/test_models.py | dpla/dplaapi | 07e2301fb67311c78a0b1da3266e84dcb7f0f451 | [
"MIT"
] | 6 | 2018-11-16T11:54:48.000Z | 2021-11-23T04:52:38.000Z | tests/test_models.py | dpla/dplaapi | 07e2301fb67311c78a0b1da3266e84dcb7f0f451 | [
"MIT"
] | 6 | 2018-09-17T19:58:09.000Z | 2022-03-31T18:17:53.000Z | tests/test_models.py | dpla/dplaapi | 07e2301fb67311c78a0b1da3266e84dcb7f0f451 | [
"MIT"
] | null | null | null |
from dplaapi import models
| 18.285714 | 47 | 0.726563 |
from dplaapi import models
def test_db_can_be_instantiated():
assert models.db
def test_account_can_be_instantiated():
account = models.Account(
key='08e3918eeb8bf4469924f062072459a8',
email='x@example.org')
assert account
| 180 | 0 | 46 |