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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
222f2b885bae826ffd49b963ae706336578e70ae | 770 | py | Python | test/AggregationTest.py | drbobdugan/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | null | null | null | test/AggregationTest.py | drbobdugan/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | 3 | 2018-04-15T16:34:00.000Z | 2018-04-15T16:48:43.000Z | test/AggregationTest.py | CSC400-S18/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | 1 | 2019-02-21T02:27:40.000Z | 2019-02-21T02:27:40.000Z | import unittest
from Aggregation import Aggregation
if __name__ == '__main__':
unittest.main()
| 27.5 | 78 | 0.672727 | import unittest
from Aggregation import Aggregation
class MyTestCase(unittest.TestCase):
def setUp(self):
self.aggregation = Aggregation("name", 0) #(Name, Data)
def test_getName(self):
self.assertEqual(self.aggregation.getName(), "name")
def test_setName(self):
self.aggregation.s... | 470 | 15 | 184 |
1f6db259e333de15840e73f5d1d44c55e1081bcd | 4,737 | py | Python | CV/HW10/HW10.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null | CV/HW10/HW10.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null | CV/HW10/HW10.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null |
# coding: utf-8
from PIL import Image, ImageDraw
import numpy as np
lena = Image.open("lena.bmp")
mask1 = np.array([[0 , 1 , 0],
[1 ,-4 , 1],
[0 , 1 , 0]])
mask2 = (1/3) * np.array([[1, 1, 1],
[1,-8, 1],
[1, 1, 1]])
minimum_... | 41.920354 | 149 | 0.411231 |
# coding: utf-8
from PIL import Image, ImageDraw
import numpy as np
def Laplace(img,threshold,mask):
pixel = img.load()
img_new = Image.new(img.mode,img.size)
array = np.zeros((img.width,img.height))
for i in range(1,img.width-1):
for j in range(1,img.height-1):
temp = 0
... | 1,232 | 0 | 50 |
eac790f835d536d512973a4f464d89228db15603 | 8,966 | py | Python | Input/multi_texture.py | miladmolaee/nethub | 7ba6bb66ca8c67139cd8c90d73f915ccf0d3e5ea | [
"MIT"
] | 2 | 2021-07-15T08:24:46.000Z | 2021-07-15T08:58:50.000Z | Input/multi_texture.py | miladmolaee/nethub | 7ba6bb66ca8c67139cd8c90d73f915ccf0d3e5ea | [
"MIT"
] | null | null | null | Input/multi_texture.py | miladmolaee/nethub | 7ba6bb66ca8c67139cd8c90d73f915ccf0d3e5ea | [
"MIT"
] | null | null | null | from Engine.network import Net
| 33.084871 | 84 | 0.443007 | from Engine.network import Net
class Multi_Texture:
m_activations = []
m_neurons = []
run_number = 1
max_epoch = 2500
min_training_accuracy = 0.9
min_validation_accuracy = 0.9
min_test_accuracy = 0.9
max_training_loss = 5e-5
max_validation_loss = 5e-5
max_test_loss = 5e-5
... | 8,277 | 586 | 69 |
b4eafd640caac93dd636f0f796b99b6a750bf17c | 3,519 | py | Python | src/State.py | CURocketEngineering/firefly_chi | 4a6bd3f4a5f0e98fd3fb70e7b121409e490c980b | [
"MIT"
] | 2 | 2020-08-27T23:21:19.000Z | 2021-03-27T17:46:36.000Z | src/State.py | CURocketEngineering/firefly_chi | 4a6bd3f4a5f0e98fd3fb70e7b121409e490c980b | [
"MIT"
] | 4 | 2020-05-31T21:21:55.000Z | 2021-03-02T03:19:10.000Z | src/State.py | CURocketEngineering/firefly_chi | 4a6bd3f4a5f0e98fd3fb70e7b121409e490c980b | [
"MIT"
] | null | null | null | """
State.py
========
Perform actions of the rocket and manage state.
`hooks` is a dictionary mapping a hook string to a
list of functions to thread when the hook occurs.
"""
import datetime
from os import system
from threading import Thread
| 30.868421 | 78 | 0.580563 | """
State.py
========
Perform actions of the rocket and manage state.
`hooks` is a dictionary mapping a hook string to a
list of functions to thread when the hook occurs.
"""
import datetime
from os import system
from threading import Thread
class State:
def __init__(self, conf, data, hooks={}):
self.ho... | 801 | 2,450 | 23 |
cb5cc264838a049bb01efdf466c2192f20d6e36e | 1,361 | py | Python | red_light_detection/red_interval_extraction.py | nickchenchj/darknet | 49e0dcfed005a8982e4fc80885f234e9cffee4c8 | [
"BSD-3-Clause"
] | null | null | null | red_light_detection/red_interval_extraction.py | nickchenchj/darknet | 49e0dcfed005a8982e4fc80885f234e9cffee4c8 | [
"BSD-3-Clause"
] | null | null | null | red_light_detection/red_interval_extraction.py | nickchenchj/darknet | 49e0dcfed005a8982e4fc80885f234e9cffee4c8 | [
"BSD-3-Clause"
] | null | null | null | import sys
if __name__ == '__main__':
if len(sys.argv) < 5:
print("Error: too few arguments")
print("Usage: python3 %s <input-filename> <output-filename> <sample-size> <threshold>" % (sys.argv[0]))
sys.exit()
input_filename = sys.argv[1]
output_filename = sys.argv[2]
sample_siz... | 29.586957 | 111 | 0.587068 | import sys
if __name__ == '__main__':
if len(sys.argv) < 5:
print("Error: too few arguments")
print("Usage: python3 %s <input-filename> <output-filename> <sample-size> <threshold>" % (sys.argv[0]))
sys.exit()
input_filename = sys.argv[1]
output_filename = sys.argv[2]
sample_siz... | 0 | 0 | 0 |
d9cc10ef963e540b44c33e4e5ec9838d481d7efb | 1,617 | py | Python | recorded_future/unit_test/test_lookup_vulnerability.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | recorded_future/unit_test/test_lookup_vulnerability.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | recorded_future/unit_test/test_lookup_vulnerability.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.abspath('../'))
from unittest import TestCase
from komand_recorded_future.connection.connection import Connection
from komand_recorded_future.actions.lookup_vulnerability import LookupVulnerability
import json
import logging
| 35.933333 | 116 | 0.669759 | import sys
import os
sys.path.append(os.path.abspath('../'))
from unittest import TestCase
from komand_recorded_future.connection.connection import Connection
from komand_recorded_future.actions.lookup_vulnerability import LookupVulnerability
import json
import logging
class TestLookupVulnerability(TestCase):
de... | 1,277 | 19 | 49 |
1b03939b378717b4bea67bc3c3be919838f1e96f | 2,049 | py | Python | docs/02.AI_ML/code-1905/day04/demo07_vc2.py | mheanng/PythonNote | e3e5ede07968fab0a45f6ac4db96e62092c17026 | [
"Apache-2.0"
] | 2 | 2020-04-09T05:56:23.000Z | 2021-03-25T18:42:36.000Z | docs/02.AI_ML/code-1905/day04/demo07_vc2.py | mheanng/PythonNote | e3e5ede07968fab0a45f6ac4db96e62092c17026 | [
"Apache-2.0"
] | 22 | 2020-04-09T06:09:14.000Z | 2021-01-06T01:05:32.000Z | docs/02.AI_ML/code-1905/day04/demo07_vc2.py | mheanng/PythonNote | e3e5ede07968fab0a45f6ac4db96e62092c17026 | [
"Apache-2.0"
] | 6 | 2020-03-09T07:19:21.000Z | 2021-01-05T23:23:42.000Z | """
demo06_vc.py 验证曲线
"""
import numpy as np
import sklearn.preprocessing as sp
import sklearn.ensemble as se
import sklearn.model_selection as ms
import matplotlib.pyplot as mp
# 读取文件
data = np.loadtxt('../ml_data/car.txt',
delimiter=',', dtype='U20',
converters={0:f, 1:f, 2:f, 3:f, 4:f, 5:f, 6:f})
# 整理训练集的输入与输... | 25.296296 | 57 | 0.665691 | """
demo06_vc.py 验证曲线
"""
import numpy as np
import sklearn.preprocessing as sp
import sklearn.ensemble as se
import sklearn.model_selection as ms
import matplotlib.pyplot as mp
def f(s):
return str(s, encoding='utf-8')
# 读取文件
data = np.loadtxt('../ml_data/car.txt',
delimiter=',', dtype='U20',
converters={0:f,... | 21 | 0 | 23 |
2ee8659e429532b6e304cef3ce924e4ac9f21fe3 | 7,111 | py | Python | dataprep.py | qiulingxu/FeatureSpaceAttack | 121538bbc298a1ee485cf085e39472690ac9ce48 | [
"MIT"
] | 9 | 2020-10-24T00:58:50.000Z | 2022-01-26T16:44:33.000Z | dataprep.py | qqqlingx/FeatureSpaceAttack | 121538bbc298a1ee485cf085e39472690ac9ce48 | [
"MIT"
] | 2 | 2021-05-23T12:18:32.000Z | 2021-08-25T14:42:40.000Z | dataprep.py | qqqlingx/FeatureSpaceAttack | 121538bbc298a1ee485cf085e39472690ac9ce48 | [
"MIT"
] | null | null | null | import functools
import numpy as np
import settings
from imagenetmod.interface import imagenet
from cifar10 import cifar10_input
| 33.384977 | 89 | 0.557868 | import functools
import numpy as np
import settings
from imagenetmod.interface import imagenet
from cifar10 import cifar10_input
class datapairs():
def __init__(self, class_num, batch_size, stack_num=10):
self.class_num = class_num
self.batch_size = batch_size
self.bucket = [[... | 6,525 | -7 | 453 |
20aba656cffc937d4c4331116e4220baff9c76ba | 1,313 | py | Python | trivia/create_app.py | Xevion/trivia | 5e7a659f8c4a7516a039ea9585d266be983b071d | [
"MIT"
] | null | null | null | trivia/create_app.py | Xevion/trivia | 5e7a659f8c4a7516a039ea9585d266be983b071d | [
"MIT"
] | null | null | null | trivia/create_app.py | Xevion/trivia | 5e7a659f8c4a7516a039ea9585d266be983b071d | [
"MIT"
] | null | null | null | from flask import Flask
from flask_apscheduler import APScheduler
from trivia.config import configs
scheduler: APScheduler = None
| 29.177778 | 86 | 0.644326 | from flask import Flask
from flask_apscheduler import APScheduler
from trivia.config import configs
scheduler: APScheduler = None
def create_app(env=None):
app = Flask(__name__)
if not env:
env = app.config['ENV']
app.config.from_object(configs[env])
# Fixes poor whitespace rendering in te... | 1,157 | 0 | 23 |
d169bdd391bd55defad7a541f6c8edfe9454a3fb | 299 | py | Python | ELAB04/04-06.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB04/04-06.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB04/04-06.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | t = int(input("Input: "))
for i in range(t) :
ans = ''
for j in range(i+1) :
ans += str(cal(i,j)) + " "
###print(f"({i},{j} )",end=" ")
print(ans) | 21.357143 | 42 | 0.454849 | def fac(n) :
if n==0:
return 1
else :
return n * fac(n-1)
def cal(a,b):
return int (fac(a) / (fac(b)*fac(a-b)))
t = int(input("Input: "))
for i in range(t) :
ans = ''
for j in range(i+1) :
ans += str(cal(i,j)) + " "
###print(f"({i},{j} )",end=" ")
print(ans) | 87 | 0 | 46 |
12e9e185652313844f0d61cf6bee19810f22d361 | 7,581 | py | Python | lib/net_util.py | asjchen/skyflow_pollution | d54bc2ae2ad3235631f1a337249535b11a6c29bd | [
"BSD-3-Clause"
] | 3 | 2018-01-09T11:11:34.000Z | 2021-05-23T16:09:17.000Z | lib/net_util.py | asjchen/skyflow_pollution | d54bc2ae2ad3235631f1a337249535b11a6c29bd | [
"BSD-3-Clause"
] | null | null | null | lib/net_util.py | asjchen/skyflow_pollution | d54bc2ae2ad3235631f1a337249535b11a6c29bd | [
"BSD-3-Clause"
] | 3 | 2017-01-04T23:44:52.000Z | 2017-01-05T09:51:19.000Z | """
Functions common to both neural networks
"""
import math
import numpy as np
import data_util
import test_util
import feed_forward_nn
import elman_rnn
from nn_globals import NetHyperparams
from nn_globals import OUTPUT_DIM, NUM_VARS
def stochastic_gradient_descent(network_setup, train_data, model, \
verbose=2,... | 39.279793 | 85 | 0.669437 | """
Functions common to both neural networks
"""
import math
import numpy as np
import data_util
import test_util
import feed_forward_nn
import elman_rnn
from nn_globals import NetHyperparams
from nn_globals import OUTPUT_DIM, NUM_VARS
def stochastic_gradient_descent(network_setup, train_data, model, \
verbose=2,... | 4,835 | 0 | 92 |
6c26d63d7ae8a7c7c7e69a1f99e9275446c1f3fb | 955 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/pygorithm/pygorithm/strings/anagram.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 4,736 | 2017-08-06T03:36:33.000Z | 2022-03-31T07:32:55.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/pygorithm/pygorithm/strings/anagram.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 56 | 2017-08-06T16:34:49.000Z | 2022-02-09T19:41:02.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/pygorithm/pygorithm/strings/anagram.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 658 | 2017-08-06T08:52:02.000Z | 2022-03-15T12:09:08.000Z | """
Author: OMKAR PATHAK
Created On: 17th August 2017
"""
from collections import Counter
import inspect
def is_anagram(word, _list):
"""ANAGRAM
An anagram is direct word switch or word play,
the result of rearranging the letters of a word
or phrase to produce a new word or phrase, using
all the o... | 25.131579 | 55 | 0.659686 | """
Author: OMKAR PATHAK
Created On: 17th August 2017
"""
from collections import Counter
import inspect
def is_anagram(word, _list):
"""ANAGRAM
An anagram is direct word switch or word play,
the result of rearranging the letters of a word
or phrase to produce a new word or phrase, using
all the o... | 0 | 0 | 0 |
69155fa92fa29e1f8e7e8803b79f8acd0d8c1a18 | 6,551 | py | Python | scripts/update_package_cache.py | KenMacD/pipx | 2ecc668acf472ad6956cc682499c077c1130d17e | [
"MIT"
] | 3,573 | 2019-02-06T07:13:28.000Z | 2021-05-27T02:34:20.000Z | scripts/update_package_cache.py | KenMacD/pipx | 2ecc668acf472ad6956cc682499c077c1130d17e | [
"MIT"
] | 533 | 2019-02-06T19:37:59.000Z | 2021-05-27T04:05:30.000Z | scripts/update_package_cache.py | KenMacD/pipx | 2ecc668acf472ad6956cc682499c077c1130d17e | [
"MIT"
] | 187 | 2019-02-24T21:56:21.000Z | 2021-05-21T15:46:13.000Z | #!/usr/bin/env python3
import argparse
import re
import subprocess
import sys
from pathlib import Path
from typing import List
from list_test_packages import create_test_packages_list
from test_packages_support import get_platform_list_path, get_platform_packages_dir_path
def process_command_line(argv: List[str]) ->... | 33.423469 | 101 | 0.601893 | #!/usr/bin/env python3
import argparse
import re
import subprocess
import sys
from pathlib import Path
from typing import List
from list_test_packages import create_test_packages_list
from test_packages_support import get_platform_list_path, get_platform_packages_dir_path
def process_command_line(argv: List[str]) ->... | 4,771 | 0 | 46 |
7c5bb86893977616bf99379a741a3ca7f6af3003 | 12,981 | py | Python | spirl/rl/components/sampler.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | spirl/rl/components/sampler.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | null | null | null | spirl/rl/components/sampler.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | import numpy as np
import contextlib
from collections import deque
from spirl.utils.general_utils import listdict2dictlist, AttrDict, ParamDict, obj2np
from spirl.modules.variational_inference import MultivariateGaussian
from spirl.rl.utils.reward_fcns import sparse_threshold
class Sampler:
"""Collects rollouts ... | 47.724265 | 125 | 0.579925 | import numpy as np
import contextlib
from collections import deque
from spirl.utils.general_utils import listdict2dictlist, AttrDict, ParamDict, obj2np
from spirl.modules.variational_inference import MultivariateGaussian
from spirl.rl.utils.reward_fcns import sparse_threshold
class Sampler:
"""Collects rollouts ... | 2,508 | 434 | 564 |
6714fbeb710fcef63d832311201eece32ab3f7e1 | 5,669 | py | Python | airflow/dags/etl.py | Ayazdi/tweetbot | d9b3ddd77ba530d6a192fe53f65a4d9994c3a092 | [
"MIT"
] | null | null | null | airflow/dags/etl.py | Ayazdi/tweetbot | d9b3ddd77ba530d6a192fe53f65a4d9994c3a092 | [
"MIT"
] | null | null | null | airflow/dags/etl.py | Ayazdi/tweetbot | d9b3ddd77ba530d6a192fe53f65a4d9994c3a092 | [
"MIT"
] | null | null | null | import time
from datetime import datetime, timedelta
import random
import re
import logging
from config import SLACK_TOKEN
import pandas as pd
import slack
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from pymongo import MongoClient
from sqlalchemy import create_engi... | 33.946108 | 155 | 0.676133 | import time
from datetime import datetime, timedelta
import random
import re
import logging
from config import SLACK_TOKEN
import pandas as pd
import slack
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from pymongo import MongoClient
from sqlalchemy import create_engi... | 0 | 0 | 0 |
07e7e3e2137257e0b56dc2a7750cbb5cde4f42cd | 114 | py | Python | chapter09/example07.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | chapter09/example07.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | chapter09/example07.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | #looping over the generated range of numbers
total = 0
for i in range(1, 101):
total = total + i
print(total) | 19 | 44 | 0.692982 | #looping over the generated range of numbers
total = 0
for i in range(1, 101):
total = total + i
print(total) | 0 | 0 | 0 |
0ea7768fd185301fdacd4b292ea08a02f037179e | 21,031 | py | Python | train_cloudcast.py | tianyu-z/Super-SloMo | 55a278cc46b6edb731895548b5a5c26e9b3439ae | [
"MIT"
] | null | null | null | train_cloudcast.py | tianyu-z/Super-SloMo | 55a278cc46b6edb731895548b5a5c26e9b3439ae | [
"MIT"
] | null | null | null | train_cloudcast.py | tianyu-z/Super-SloMo | 55a278cc46b6edb731895548b5a5c26e9b3439ae | [
"MIT"
] | null | null | null | # [Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
from comet_ml import Experiment, ExistingExperiment
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional a... | 31.578078 | 149 | 0.595787 | # [Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
from comet_ml import Experiment, ExistingExperiment
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional a... | 4,748 | 0 | 46 |
dd5c591d8629070d56f3f787c2b2d5d71c6c3c42 | 448 | py | Python | test/test_tokenize/case2.py | xupingmao/subpy | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 6 | 2015-10-11T15:06:54.000Z | 2016-07-03T06:06:52.000Z | test/test_tokenize/case2.py | xupingmao/snake | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 7 | 2015-08-03T12:01:21.000Z | 2016-04-24T09:00:09.000Z | test/test_tokenize/case2.py | xupingmao/snake | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 2 | 2016-04-18T14:51:25.000Z | 2016-04-18T15:07:09.000Z | # -*- coding:utf-8 -*-
# @author xupingmao
# @since 2022/04/10 15:06:25
# @modified 2022/04/10 15:10:04
# @filename case2.py
input_text = """
def foo(bar):
return bar * 5
"""
output = [
"nl", "nl",
"def", "def",
"name", "foo",
"(", "(",
"name", "bar",
")", ")",
":", ":",
"nl", "nl"... | 15.448276 | 31 | 0.419643 | # -*- coding:utf-8 -*-
# @author xupingmao
# @since 2022/04/10 15:06:25
# @modified 2022/04/10 15:10:04
# @filename case2.py
input_text = """
def foo(bar):
return bar * 5
"""
output = [
"nl", "nl",
"def", "def",
"name", "foo",
"(", "(",
"name", "bar",
")", ")",
":", ":",
"nl", "nl"... | 0 | 0 | 0 |
6efc3b3f2991661bf76fd6544abf0ea9b3f3a66e | 153 | py | Python | hadTopTools/__init__.py | mdkdrnevich/DeepHadTopTagger | 560b51b98e0d9a3a78a0986408ad4d2a30f9960f | [
"MIT"
] | 3 | 2018-04-14T18:07:00.000Z | 2020-07-15T13:21:49.000Z | hadTopTools/__init__.py | mdkdrnevich/DeepHadTopTagger | 560b51b98e0d9a3a78a0986408ad4d2a30f9960f | [
"MIT"
] | null | null | null | hadTopTools/__init__.py | mdkdrnevich/DeepHadTopTagger | 560b51b98e0d9a3a78a0986408ad4d2a30f9960f | [
"MIT"
] | null | null | null | import matplotlib as mpl
mpl.use("Agg")
from .utils import CollisionDataset, AutoencoderDataset, train, test, plot_curves
from . import nn_classes as nn | 30.6 | 81 | 0.803922 | import matplotlib as mpl
mpl.use("Agg")
from .utils import CollisionDataset, AutoencoderDataset, train, test, plot_curves
from . import nn_classes as nn | 0 | 0 | 0 |
3636d7aab0b716744fe8b791609bf4d2625e4679 | 4,760 | py | Python | survey_system_files/views.py | CompSci17/Survey-System | b30ddb3c4dc6d65504bbef58bb1600becc4bb6f5 | [
"MIT"
] | 1 | 2020-10-19T15:27:54.000Z | 2020-10-19T15:27:54.000Z | survey_system_files/views.py | CompSci17/Survey-System | b30ddb3c4dc6d65504bbef58bb1600becc4bb6f5 | [
"MIT"
] | 1 | 2020-07-14T15:03:02.000Z | 2020-07-14T15:03:02.000Z | survey_system_files/views.py | CompSci17/Survey-System | b30ddb3c4dc6d65504bbef58bb1600becc4bb6f5 | [
"MIT"
] | null | null | null | import uuid
import hashlib
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from .models import Survey, Question, Answers
from .forms import SurveyForm
from .results import Results
# Create your views here.
| 29.02439 | 197 | 0.65021 | import uuid
import hashlib
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from .models import Survey, Question, Answers
from .forms import SurveyForm
from .results import Results
# Create your views here.
def survey_list( request, *args, **kwargs ):
# Get a list of al... | 4,434 | 0 | 69 |
9d7b4fe660aa92ee6eb5bbd020297c0ee9cb4dd1 | 2,873 | py | Python | src/mnist/train.py | iden-kalemaj/SIDP | ee6da502cc6c0f42042b54d6329b3bd8c67fb991 | [
"Apache-2.0"
] | 10 | 2020-06-22T22:11:43.000Z | 2021-11-10T12:25:53.000Z | src/mnist/train.py | iden-kalemaj/SIDP | ee6da502cc6c0f42042b54d6329b3bd8c67fb991 | [
"Apache-2.0"
] | 2 | 2020-12-10T09:25:59.000Z | 2021-12-27T09:33:36.000Z | src/mnist/train.py | iden-kalemaj/SIDP | ee6da502cc6c0f42042b54d6329b3bd8c67fb991 | [
"Apache-2.0"
] | 3 | 2020-07-11T05:45:06.000Z | 2022-03-03T21:08:56.000Z | import torch
from torchvision import datasets
from torch.utils.data import DataLoader, RandomSampler
import torchvision.transforms as transforms
from tqdm import tqdm
from .dataset import data_loaders, axi_loader
| 31.571429 | 107 | 0.649147 | import torch
from torchvision import datasets
from torch.utils.data import DataLoader, RandomSampler
import torchvision.transforms as transforms
from tqdm import tqdm
from .dataset import data_loaders, axi_loader
def train(model, criterion, optimizer, device, train_loader, clip, noise_multiplier, batch_size, axi_x):
... | 2,575 | 0 | 69 |
eac66d468a7e07323da015ce90324eb30ccacdcf | 17,976 | py | Python | pysql.py | morfat/PySQL | a887977ec7fc17e34c03027f044c40539d12e046 | [
"MIT"
] | null | null | null | pysql.py | morfat/PySQL | a887977ec7fc17e34c03027f044c40539d12e046 | [
"MIT"
] | null | null | null | pysql.py | morfat/PySQL | a887977ec7fc17e34c03027f044c40539d12e046 | [
"MIT"
] | 1 | 2020-09-14T17:32:59.000Z | 2020-09-14T17:32:59.000Z | import MySQLdb
from urllib import parse
class PySQL:
"""
For making Mariadb / Mysql db queries
"""
FILTER_COMMANDS = {
"$eq":" = %s ",
"$in":" IN (%s) ",
"$nin":" NOT IN (%s) ",
"$neq":" != %s ",
"$lt":" < %s ",
"$lte":" <= %s ",
"$gt":" ... | 28.807692 | 139 | 0.547063 | import MySQLdb
from urllib import parse
class PySQL:
"""
For making Mariadb / Mysql db queries
"""
FILTER_COMMANDS = {
"$eq":" = %s ",
"$in":" IN (%s) ",
"$nin":" NOT IN (%s) ",
"$neq":" != %s ",
"$lt":" < %s ",
"$lte":" <= %s ",
"$gt":" ... | 8,828 | 1,230 | 490 |
a9c9d9ad9a74e5fe13167144fcd090943b6c7714 | 2,297 | py | Python | main/General_Circuit/Meta_Reporter.py | user-ccarr/ECIF | b858c22b9c2959efbc52ab93f21eac94663598ad | [
"BSD-3-Clause"
] | null | null | null | main/General_Circuit/Meta_Reporter.py | user-ccarr/ECIF | b858c22b9c2959efbc52ab93f21eac94663598ad | [
"BSD-3-Clause"
] | null | null | null | main/General_Circuit/Meta_Reporter.py | user-ccarr/ECIF | b858c22b9c2959efbc52ab93f21eac94663598ad | [
"BSD-3-Clause"
] | null | null | null | import yaml
import sys
def meta_report(meta_data_loc="Experiment_Data.yml"):
"""
Reads meta data from file called "Experiment_Data.yml" and adds a report
Parameters
----------
meta_data_loc : str
the path to file that contains experiment meta data
Returns
-------
con... | 40.298246 | 150 | 0.627775 | import yaml
import sys
def meta_report(meta_data_loc="Experiment_Data.yml"):
"""
Reads meta data from file called "Experiment_Data.yml" and adds a report
Parameters
----------
meta_data_loc : str
the path to file that contains experiment meta data
Returns
-------
con... | 0 | 0 | 0 |
c741e0fabfcf222376d9c9ed9b7269d024ada2be | 33,048 | py | Python | src/nunavut/lang/__init__.py | DNedic/nunavut | 61232b31b82ba1b6a3b0bf82392975399a541137 | [
"MIT",
"BSD-3-Clause"
] | 24 | 2019-05-14T19:31:49.000Z | 2021-11-20T09:39:48.000Z | src/nunavut/lang/__init__.py | DNedic/nunavut | 61232b31b82ba1b6a3b0bf82392975399a541137 | [
"MIT",
"BSD-3-Clause"
] | 163 | 2019-05-14T06:03:01.000Z | 2022-03-31T18:21:15.000Z | src/nunavut/lang/__init__.py | DNedic/nunavut | 61232b31b82ba1b6a3b0bf82392975399a541137 | [
"MIT",
"BSD-3-Clause"
] | 12 | 2019-11-24T06:21:43.000Z | 2022-02-23T13:42:51.000Z | #
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright (C) 2018-2020 UAVCAN Development Team <uavcan.org>
# This software is distributed under the terms of the MIT License.
#
"""Language-specific support in nunavut.
This package contains modules that provide specific support for gene... | 43.656539 | 120 | 0.645576 | #
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright (C) 2018-2020 UAVCAN Development Team <uavcan.org>
# This software is distributed under the terms of the MIT License.
#
"""Language-specific support in nunavut.
This package contains modules that provide specific support for gene... | 5,081 | 0 | 273 |
3121ed78f11108b68e6bcfba53bebde2323837e6 | 10,692 | py | Python | test/cal_accuracy.py | goroyabu/etnet | 9d8e65fd9e8263eb9e84ac903e07638edba292b4 | [
"MIT"
] | null | null | null | test/cal_accuracy.py | goroyabu/etnet | 9d8e65fd9e8263eb9e84ac903e07638edba292b4 | [
"MIT"
] | null | null | null | test/cal_accuracy.py | goroyabu/etnet | 9d8e65fd9e8263eb9e84ac903e07638edba292b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import argparse
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import numpy
from ROOT import TFile, TH1D, TH2D, TCanvas
from ROOT import gROOT, gPad, gStyle
import ROOT
from etnet.dataset import EtrackDataset
from e... | 31.447059 | 129 | 0.601104 | #!/usr/bin/env python3
import os
import argparse
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import numpy
from ROOT import TFile, TH1D, TH2D, TCanvas
from ROOT import gROOT, gPad, gStyle
import ROOT
from etnet.dataset import EtrackDataset
from e... | 10,120 | 0 | 69 |
86a8487288d3f453a3a245387200f20ccee0ea4b | 3,825 | py | Python | keras_frcnn/FixedBatchNormalization.py | nikhilraj1997/keras-frcnn | 13978cbf8b9c816a1b55f927d560163329f43f3c | [
"Apache-2.0"
] | null | null | null | keras_frcnn/FixedBatchNormalization.py | nikhilraj1997/keras-frcnn | 13978cbf8b9c816a1b55f927d560163329f43f3c | [
"Apache-2.0"
] | null | null | null | keras_frcnn/FixedBatchNormalization.py | nikhilraj1997/keras-frcnn | 13978cbf8b9c816a1b55f927d560163329f43f3c | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from tensorflow.keras.layers import Layer, InputSpec
from tensorflow.keras import initializers, regularizers
import tensorflow.keras.backend as K
| 45.535714 | 111 | 0.589804 | import tensorflow as tf
from tensorflow.keras.layers import Layer, InputSpec
from tensorflow.keras import initializers, regularizers
import tensorflow.keras.backend as K
class FixedBatchNormalization(Layer):
def __init__(self, epsilon=1e-3, axis=-1,
weights=None, beta_init='zero', gamma_init='on... | 3,508 | 16 | 131 |
8b79540aa0e5c98c7cc1c464554ec367c707f147 | 89,543 | py | Python | pyvdk/types/objects.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 16 | 2020-11-24T18:27:59.000Z | 2021-05-14T19:25:44.000Z | pyvdk/types/objects.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 1 | 2021-04-21T14:35:55.000Z | 2021-06-26T04:18:44.000Z | pyvdk/types/objects.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 2 | 2020-12-03T16:56:31.000Z | 2020-12-19T16:28:58.000Z | # -*- coding: utf-8 -*-
#
import enum
import json
from typing import Any, Callable, Dict, List, Optional, Union
from pydantic import Json
from .abc import Model
... | 21.289349 | 90 | 0.676837 | # -*- coding: utf-8 -*-
#
import enum
import json
from typing import Any, Callable, Dict, List, Optional, Union
from pydantic import Json
from .abc import Model
class AccountAccountCounters(Model):
app_requests: int
events: int
faves: int
friends: int
friends_suggestions: int
friends_recomme... | 0 | 77,911 | 10,902 |
e0a03231ac695e3b52250875b13d9576ddc71fd0 | 248 | py | Python | info.py | PapaDoraemon/marina-AI | 9f9281b5decf889a55d6c1bdbfe3a62adadd47f9 | [
"Apache-2.0"
] | 1 | 2020-09-04T12:42:54.000Z | 2020-09-04T12:42:54.000Z | info.py | PapaDoraemon/marina-AI | 9f9281b5decf889a55d6c1bdbfe3a62adadd47f9 | [
"Apache-2.0"
] | null | null | null | info.py | PapaDoraemon/marina-AI | 9f9281b5decf889a55d6c1bdbfe3a62adadd47f9 | [
"Apache-2.0"
] | null | null | null |
import json
| 15.5 | 106 | 0.620968 |
import json
def get_info(host):
headers = {
'User-Agent': 'MARINA 2.0'
}
shodan_data = requests.get("http://192.168.0.3/marina-shodan.php?ip={}".format(host), headers=headers)
return json.loads(shodan_data.text)
| 205 | 0 | 23 |
79ebda0ce039164287373a53487e4e2f1bccc2b6 | 3,649 | py | Python | project/pro2-typing_test/utils.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | 3 | 2021-11-21T06:09:39.000Z | 2022-03-12T08:05:27.000Z | project/pro2-typing_test/utils.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | project/pro2-typing_test/utils.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | from math import sqrt
import string
############################################################################################
# Important: Read over the information in the "Appendix: Utility Functions" in the Project #
# Project Specification in order to better understand how to use the functions below. #
####... | 26.635036 | 92 | 0.585366 | from math import sqrt
import string
############################################################################################
# Important: Read over the information in the "Appendix: Utility Functions" in the Project #
# Project Specification in order to better understand how to use the functions below. #
####... | 186 | 0 | 24 |
de57dabc2f021eb3cff5c6361aadded8586e7845 | 1,632 | py | Python | aws_sam/fargateIR/tests/integration/test_full.py | andrewkrug/fargate-ir | 9c5c49c34f435a8eb9123d686643890957724f25 | [
"Apache-2.0"
] | 11 | 2019-12-05T17:56:34.000Z | 2022-02-25T10:24:30.000Z | aws_sam/fargateIR/tests/integration/test_full.py | andrewkrug/fargate-ir | 9c5c49c34f435a8eb9123d686643890957724f25 | [
"Apache-2.0"
] | 2 | 2019-12-05T16:42:53.000Z | 2019-12-05T17:38:31.000Z | aws_sam/fargateIR/tests/integration/test_full.py | andrewkrug/fargate-ir | 9c5c49c34f435a8eb9123d686643890957724f25 | [
"Apache-2.0"
] | 2 | 2019-12-06T03:18:10.000Z | 2019-12-27T15:27:53.000Z | import os
from lambda_handler import handle
# Use an event structure that follows GuardDuty Schema 2.0 to simulate a ticketing system integration.
EVENT_FIXTURE = {
"detail-type": "GuardDuty Finding",
"source": "aws.guardduty",
"detail": {
"schemaVersion": "2.0",
"accountId": "874153891031... | 30.792453 | 102 | 0.586397 | import os
from lambda_handler import handle
# Use an event structure that follows GuardDuty Schema 2.0 to simulate a ticketing system integration.
EVENT_FIXTURE = {
"detail-type": "GuardDuty Finding",
"source": "aws.guardduty",
"detail": {
"schemaVersion": "2.0",
"accountId": "874153891031... | 476 | 0 | 23 |
ced0e92053dfc14cd64b84707b6b59c2d18deccc | 340 | py | Python | setup.py | rmatsum836/pyfooty | 621fe06b4517223aab875cb60a88ee5825506c21 | [
"MIT"
] | 1 | 2020-11-08T23:50:26.000Z | 2020-11-08T23:50:26.000Z | setup.py | rmatsum836/pyfooty | 621fe06b4517223aab875cb60a88ee5825506c21 | [
"MIT"
] | 2 | 2021-01-05T00:29:54.000Z | 2021-01-05T00:56:16.000Z | setup.py | rmatsum836/pyfooty | 621fe06b4517223aab875cb60a88ee5825506c21 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='pyfooty',
version='0.0',
description='Parse the fbref website with python',
url='https://github.com/rmatsum836/pyfooty',
author='Ray Matsumoto',
author_email='raymatsum@gmail.com',
license='MIT',
packages=['pyfooty'],
... | 28.333333 | 58 | 0.617647 | from setuptools import setup
setup(name='pyfooty',
version='0.0',
description='Parse the fbref website with python',
url='https://github.com/rmatsum836/pyfooty',
author='Ray Matsumoto',
author_email='raymatsum@gmail.com',
license='MIT',
packages=['pyfooty'],
... | 0 | 0 | 0 |
6b680c1b1fcbc411b748a75b07e98af22697f813 | 19,783 | py | Python | compflow/fortran.py | jb753/compflow | 7ede6cb860a2573a1ab5e7e40b1591c3e72c3783 | [
"MIT"
] | null | null | null | compflow/fortran.py | jb753/compflow | 7ede6cb860a2573a1ab5e7e40b1591c3e72c3783 | [
"MIT"
] | 1 | 2022-03-04T12:10:26.000Z | 2022-03-14T22:57:56.000Z | compflow/fortran.py | jb753/compflow | 7ede6cb860a2573a1ab5e7e40b1591c3e72c3783 | [
"MIT"
] | null | null | null | """This module wraps the fortran backend."""
import numpy as np
import compflow_fort_from_Ma as fort_from_Ma
import compflow_fort_der_from_Ma as fort_der_from_Ma
import compflow_fort_to_Ma as fort_to_Ma
def _restore_shape(func, args):
"""Call a function and restore output to same shape as first argument."""
s... | 27.211829 | 115 | 0.577769 | """This module wraps the fortran backend."""
import numpy as np
import compflow_fort_from_Ma as fort_from_Ma
import compflow_fort_der_from_Ma as fort_der_from_Ma
import compflow_fort_to_Ma as fort_to_Ma
def _restore_shape(func, args):
"""Call a function and restore output to same shape as first argument."""
s... | 0 | 0 | 0 |
ed0b665e5274119fc4253441bc0c65ee3ffef274 | 7,378 | py | Python | userbot/plugins/ping.py | aksr-aashish/FIREXUSERBOT | dff0b7bf028cb27779626ce523402346cc990402 | [
"MIT"
] | null | null | null | userbot/plugins/ping.py | aksr-aashish/FIREXUSERBOT | dff0b7bf028cb27779626ce523402346cc990402 | [
"MIT"
] | 1 | 2022-01-09T11:35:06.000Z | 2022-01-09T11:35:06.000Z | userbot/plugins/ping.py | aksr-aashish/FIREXUSERBOT | dff0b7bf028cb27779626ce523402346cc990402 | [
"MIT"
] | null | null | null | import asyncio
import datetime
import os
from .. import ALIVE_NAME
from ..cmdhelp import CmdHelp
from ..utils import admin_cmd, edit_or_reply, sudo_cmd
from . import *
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "eviral User"
eviral = borg.uid
eviral_IMG = os.environ.get(
"PING_PIC", "https://te.legra.ph/fil... | 82.898876 | 410 | 0.197343 | import asyncio
import datetime
import os
from .. import ALIVE_NAME
from ..cmdhelp import CmdHelp
from ..utils import admin_cmd, edit_or_reply, sudo_cmd
from . import *
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "eviral User"
eviral = borg.uid
eviral_IMG = os.environ.get(
"PING_PIC", "https://te.legra.ph/fil... | 16,123 | 0 | 44 |
ee73b60e03568dfaebc7bf0d67bd3f2349a997e1 | 965 | py | Python | collate_info.py | justincely/hstcos_dark_data | a42042ae7babc73c7feb5058186ea4fa42e9c0be | [
"BSD-3-Clause"
] | null | null | null | collate_info.py | justincely/hstcos_dark_data | a42042ae7babc73c7feb5058186ea4fa42e9c0be | [
"BSD-3-Clause"
] | null | null | null | collate_info.py | justincely/hstcos_dark_data | a42042ae7babc73c7feb5058186ea4fa42e9c0be | [
"BSD-3-Clause"
] | null | null | null | import glob
import json
from copy import deepcopy
import numpy as np
from astropy.table import Table
from astropy.time import Time
from cos_monitoring import dark
from cos_monitoring.dark import solar
import pdb
solar.get_solar_data("./")
data = Table.read('solar_flux.txt', format='ascii')
all_info = []
for item... | 20.978261 | 82 | 0.634197 | import glob
import json
from copy import deepcopy
import numpy as np
from astropy.table import Table
from astropy.time import Time
from cos_monitoring import dark
from cos_monitoring.dark import solar
import pdb
solar.get_solar_data("./")
data = Table.read('solar_flux.txt', format='ascii')
all_info = []
for item... | 0 | 0 | 0 |
c7607658161aabf0b09b3024ff70cf6f856fe8d3 | 2,225 | py | Python | noisysystem_temp/Analysis/PositivePhiAnalysis.py | Tom271/InteractingParticleSystems | 1cfc8b228077c2465e71d82cc288d713d3755392 | [
"MIT"
] | 1 | 2019-10-22T19:48:22.000Z | 2019-10-22T19:48:22.000Z | noisysystem_temp/Analysis/PositivePhiAnalysis.py | Tom271/InteractingParticleSystems | 1cfc8b228077c2465e71d82cc288d713d3755392 | [
"MIT"
] | 1 | 2019-10-22T21:32:19.000Z | 2019-10-22T21:32:19.000Z | noisysystem_temp/Analysis/PositivePhiAnalysis.py | Tom271/InteractingParticleSystems | 1cfc8b228077c2465e71d82cc288d713d3755392 | [
"MIT"
] | 1 | 2019-10-22T19:49:38.000Z | 2019-10-22T19:49:38.000Z | from matplotlib import rc
import matplotlib.pyplot as plt
import os
import seaborn as sns
from particle.plotting import (
plot_averaged_convergence_from_clusters,
plot_averaged_avg_vel,
plot_avg_vel,
)
sns.set(style="white", context="talk")
search_parameters = {
# "particle_count": 480,
# "G": "S... | 33.208955 | 86 | 0.698876 | from matplotlib import rc
import matplotlib.pyplot as plt
import os
import seaborn as sns
from particle.plotting import (
plot_averaged_convergence_from_clusters,
plot_averaged_avg_vel,
plot_avg_vel,
)
sns.set(style="white", context="talk")
search_parameters = {
# "particle_count": 480,
# "G": "S... | 0 | 0 | 0 |
d3eb3879f29d5a988281b193f192ff03806bb576 | 8,310 | py | Python | codemetrics/vega.py | Wonshtrum/codemetrics | ae82a742aeedc7fc1edf39a817edb3d41ea3887d | [
"MIT"
] | 6 | 2019-08-07T09:11:35.000Z | 2021-06-22T10:58:33.000Z | codemetrics/vega.py | Wonshtrum/codemetrics | ae82a742aeedc7fc1edf39a817edb3d41ea3887d | [
"MIT"
] | 11 | 2019-09-25T22:04:44.000Z | 2022-03-23T03:06:05.000Z | codemetrics/vega.py | Wonshtrum/codemetrics | ae82a742aeedc7fc1edf39a817edb3d41ea3887d | [
"MIT"
] | 4 | 2019-02-23T15:25:35.000Z | 2021-06-22T12:11:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import typing
import pandas as pd
from . import internals
def build_hierarchy(
data: pd.DataFrame,
get_parent=os.path.dirname,
root: str = "",
max_iter: int = 100,
col_name: typing.Optional[str] = None,
) -> pd.DataFrame:
"... | 31.83908 | 94 | 0.541637 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import typing
import pandas as pd
from . import internals
def build_hierarchy(
data: pd.DataFrame,
get_parent=os.path.dirname,
root: str = "",
max_iter: int = 100,
col_name: typing.Optional[str] = None,
) -> pd.DataFrame:
"... | 0 | 0 | 0 |
565de340dea6258a5a31b85b0559d11b832043c5 | 1,414 | py | Python | master/Alarm_dialog.py | chingchan1996/Distributed-Resource-Monitoring-System | d85a74616307bf5ba7ae5b363512c1fd487143a5 | [
"Apache-2.0"
] | null | null | null | master/Alarm_dialog.py | chingchan1996/Distributed-Resource-Monitoring-System | d85a74616307bf5ba7ae5b363512c1fd487143a5 | [
"Apache-2.0"
] | null | null | null | master/Alarm_dialog.py | chingchan1996/Distributed-Resource-Monitoring-System | d85a74616307bf5ba7ae5b363512c1fd487143a5 | [
"Apache-2.0"
] | null | null | null | from Alarm_dialog_ui import Alarm_Ui_Dialog
from PyQt5 import QtCore, QtWidgets, QtGui
import threading
import sys
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
form = AlarmDialog("Slave3", "CPU overloading", "CPU usage > 95%", "50%", "2017/11/25 12:00")
form.setWindowTitle('Ala... | 36.25641 | 104 | 0.662659 | from Alarm_dialog_ui import Alarm_Ui_Dialog
from PyQt5 import QtCore, QtWidgets, QtGui
import threading
import sys
class AlarmDialog(QtWidgets.QMainWindow):
def __init__(self, hostname, problem, threshold, current, time):
QtWidgets.QWidget.__init__(self)
self.ui = Alarm_Ui_Dialog()
... | 875 | 38 | 133 |
927d226a221c8200e40efd7d6c8599a8cd204230 | 2,725 | py | Python | zaqar/storage/sqlalchemy/migration/alembic_migrations/versions/001_liberty.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | 97 | 2015-01-02T09:35:23.000Z | 2022-03-25T00:38:45.000Z | zaqar/storage/sqlalchemy/migration/alembic_migrations/versions/001_liberty.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | zaqar/storage/sqlalchemy/migration/alembic_migrations/versions/001_liberty.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | 44 | 2015-01-28T03:01:28.000Z | 2021-05-13T18:55:19.000Z | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.328767 | 71 | 0.540917 | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 1,842 | 0 | 23 |
8c996016d532556f72b8858fadfdec8cbc13fd3b | 1,188 | py | Python | article/models.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | article/models.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | article/models.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | from django.db import models
from ckeditor.fields import RichTextField
# Create your models here. | 47.52 | 112 | 0.768519 | from django.db import models
from ckeditor.fields import RichTextField
# Create your models here.
class Article(models.Model):
author=models.ForeignKey("auth.User",on_delete=models.CASCADE)
title = models.CharField(max_length=50,verbose_name= "Title")
content=RichTextField(verbose_name="Content")
crea... | 106 | 943 | 45 |
2ee0c3e1ef08b9ecf5b43f9f4cd90918f39395df | 5,971 | py | Python | lib/util.py | jhkennedy/processflow | c404bd3ad043fd6ae18d4f24d735777574faa660 | [
"MIT"
] | null | null | null | lib/util.py | jhkennedy/processflow | c404bd3ad043fd6ae18d4f24d735777574faa660 | [
"MIT"
] | null | null | null | lib/util.py | jhkennedy/processflow | c404bd3ad043fd6ae18d4f24d735777574faa660 | [
"MIT"
] | null | null | null | import logging
import sys
import traceback
import re
import os
import socket
import jinja2
import json
from shutil import rmtree
from time import sleep
from datetime import datetime
from string import Formatter
from lib.jobstatus import ReverseMap, JobStatus
from mailer import Mailer
from models import DataFile
def... | 30.156566 | 94 | 0.624016 | import logging
import sys
import traceback
import re
import os
import socket
import jinja2
import json
from shutil import rmtree
from time import sleep
from datetime import datetime
from string import Formatter
from lib.jobstatus import ReverseMap, JobStatus
from mailer import Mailer
from models import DataFile
def... | 540 | 180 | 46 |
1030cc86d52100b1ce19fd96943c5c044fb57a72 | 8,258 | py | Python | cogs/share.py | StefDuda01/Bot | 3ffc318a52534e45e111875fb4e5fe2df3b35ce8 | [
"MIT"
] | null | null | null | cogs/share.py | StefDuda01/Bot | 3ffc318a52534e45e111875fb4e5fe2df3b35ce8 | [
"MIT"
] | null | null | null | cogs/share.py | StefDuda01/Bot | 3ffc318a52534e45e111875fb4e5fe2df3b35ce8 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.gateway import DiscordWebSocket
import requests, os
import json
import subprocess
import io
import random
import dotenv
import aiomysql
| 33.844262 | 93 | 0.53875 | import discord
from discord.ext import commands
from discord.gateway import DiscordWebSocket
import requests, os
import json
import subprocess
import io
import random
import dotenv
import aiomysql
class Share(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.staff_chat = self.bot.get_cha... | 6,811 | 1,204 | 46 |
f4aa9a6ca0730f8fd955fa36c1c422547825b170 | 3,519 | py | Python | lino/utils/mldbc/fields.py | NewRGB/lino | 43799e42107169ff173d3b8bc0324d5773471499 | [
"BSD-2-Clause"
] | 1 | 2019-11-13T19:38:50.000Z | 2019-11-13T19:38:50.000Z | lino/utils/mldbc/fields.py | NewRGB/lino | 43799e42107169ff173d3b8bc0324d5773471499 | [
"BSD-2-Clause"
] | null | null | null | lino/utils/mldbc/fields.py | NewRGB/lino | 43799e42107169ff173d3b8bc0324d5773471499 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright 2012-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Defines the babel field classes (:class:`BabelCharField` and
:class:`BabelTextField`) and the :class:`LanguageField` class.
**Babel fields** are fields which "generate" in the Django model a
series of normal ... | 31.419643 | 111 | 0.674339 | # -*- coding: UTF-8 -*-
# Copyright 2012-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Defines the babel field classes (:class:`BabelCharField` and
:class:`BabelTextField`) and the :class:`LanguageField` class.
**Babel fields** are fields which "generate" in the Django model a
series of normal ... | 852 | 0 | 81 |
9adec4e977a6a1862dcf1dc6a136a4af18c39044 | 1,100 | py | Python | 2016/day02/day02-pt2.py | mcbor/advent_of_code_2016 | 14453b970d3e0f031ae6a66f2028652b6ed870dd | [
"MIT"
] | 1 | 2016-12-17T10:53:22.000Z | 2016-12-17T10:53:22.000Z | 2016/day02/day02-pt2.py | mcbor/adventofcode | 14453b970d3e0f031ae6a66f2028652b6ed870dd | [
"MIT"
] | null | null | null | 2016/day02/day02-pt2.py | mcbor/adventofcode | 14453b970d3e0f031ae6a66f2028652b6ed870dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Advent of Code 2016 - Day 2, Part Two
import sys
from turtle import Vec2D
keypad = [[None, None, '1', None, None],
[None, '2', '3', '4', None],
[ '5', '6', '7', '8', '9'],
[None, 'A', 'B', 'C', None],
[None, None, 'D', None, None]]
moves = ... | 26.829268 | 67 | 0.48 | #!/usr/bin/env python3
# Advent of Code 2016 - Day 2, Part Two
import sys
from turtle import Vec2D
keypad = [[None, None, '1', None, None],
[None, '2', '3', '4', None],
[ '5', '6', '7', '8', '9'],
[None, 'A', 'B', 'C', None],
[None, None, 'D', None, None]]
moves = ... | 518 | 0 | 77 |
49fab2ca3160ce1caa8610ee409dddbe3785c054 | 91 | py | Python | tests/data/directive/conf.py | t4ngo/sphinxcontrib-multilatex | cb63e0ef5d3059aa9db892abfd550a60a1e650a1 | [
"Apache-2.0"
] | 1 | 2016-09-10T10:16:03.000Z | 2016-09-10T10:16:03.000Z | tests/data/directive/conf.py | t4ngo/sphinxcontrib-multilatex | cb63e0ef5d3059aa9db892abfd550a60a1e650a1 | [
"Apache-2.0"
] | null | null | null | tests/data/directive/conf.py | t4ngo/sphinxcontrib-multilatex | cb63e0ef5d3059aa9db892abfd550a60a1e650a1 | [
"Apache-2.0"
] | null | null | null | source_suffix = ".txt"
master_doc = "index"
extensions = ["sphinxcontrib.multilatex"]
| 18.2 | 42 | 0.703297 | source_suffix = ".txt"
master_doc = "index"
extensions = ["sphinxcontrib.multilatex"]
| 0 | 0 | 0 |
c70fb720099cd2599c5ecd57955fdb2d15a4cf94 | 2,282 | py | Python | src/magento2/language-csv-fixer.py | jeremycurny/devops-py | eea36ff2bcd97affaae929a67ed289fe9e462ff0 | [
"MIT"
] | null | null | null | src/magento2/language-csv-fixer.py | jeremycurny/devops-py | eea36ff2bcd97affaae929a67ed289fe9e462ff0 | [
"MIT"
] | null | null | null | src/magento2/language-csv-fixer.py | jeremycurny/devops-py | eea36ff2bcd97affaae929a67ed289fe9e462ff0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import csv, json, operator, os, sys
import xml.etree.ElementTree as ET
composerJsonPath = 'composer.json'
languageXmlPath = 'language.xml'
if not os.path.exists(composerJsonPath):
# File does not exists
print "File " + composerJsonPath + " not found"
sys.exit(1)
if not os.path.exists(lan... | 30.026316 | 93 | 0.608677 | #!/usr/bin/env python
import csv, json, operator, os, sys
import xml.etree.ElementTree as ET
composerJsonPath = 'composer.json'
languageXmlPath = 'language.xml'
if not os.path.exists(composerJsonPath):
# File does not exists
print "File " + composerJsonPath + " not found"
sys.exit(1)
if not os.path.exists(lan... | 0 | 0 | 0 |
44c2d4091b0b65c4e713d3fb92c8d2106838080c | 1,340 | py | Python | mopy/impl/dvonn/action.py | TylerSandman/mopy | df66bb728f6dacee8ee6267a8802a4b71a04fd43 | [
"MIT"
] | null | null | null | mopy/impl/dvonn/action.py | TylerSandman/mopy | df66bb728f6dacee8ee6267a8802a4b71a04fd43 | [
"MIT"
] | null | null | null | mopy/impl/dvonn/action.py | TylerSandman/mopy | df66bb728f6dacee8ee6267a8802a4b71a04fd43 | [
"MIT"
] | null | null | null | """This module contains a representation of an action in the game Dvonn."""
from mopy.action import Action
from enum import Enum
| 31.904762 | 79 | 0.567164 | """This module contains a representation of an action in the game Dvonn."""
from mopy.action import Action
from enum import Enum
class DvonnAction(Action):
class Type(Enum):
PLACE = 1
MOVE = 2
def __init__(self, type_, end, start=None):
"""
Create an action rep... | 423 | 757 | 24 |
2f6fc55efb4642bc95fccfcc575e39d053da1f03 | 1,069 | py | Python | data/transcoder_evaluation_gfg/python/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#TOFILL
if __name__ == '__main__':
param = [
(23,16,16,),
(56,95,6,),
(30,63,1,),
(51,89,46,),
(21,99... | 24.860465 | 64 | 0.466791 | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( n , x , y ) :
arr = [ False for i in range ( n + 2 ) ]
if ( x <= n ) :
arr [ x ] = True
if ( y ... | 417 | 0 | 22 |
cb2b2350e7afa94fce2f50c53e2912e1644d082c | 559 | py | Python | python/005/005.py | seaneshbaugh/rosetta-euler | 14f24dfc347e7d9a4c9c0f090acf2811aa65f453 | [
"MIT"
] | 36 | 2015-01-24T08:11:52.000Z | 2021-03-21T00:32:00.000Z | python/005/005.py | seaneshbaugh/rosetta-euler | 14f24dfc347e7d9a4c9c0f090acf2811aa65f453 | [
"MIT"
] | null | null | null | python/005/005.py | seaneshbaugh/rosetta-euler | 14f24dfc347e7d9a4c9c0f090acf2811aa65f453 | [
"MIT"
] | 4 | 2015-01-24T08:17:42.000Z | 2022-01-11T16:10:56.000Z | from operator import mul
from functools import reduce
print(reduce(mul, reduce(overlap, [prime_factors(x) for x in range(1, 21)])))
| 15.108108 | 77 | 0.509839 | from operator import mul
from functools import reduce
def prime_factors(n):
found = False
v = 2
i = 2
while i < n -1 and found == False:
if n % i == 0:
found = True
v = i
i += 1
if found:
factors = [v] + prime_factors(n // v)
else:
f... | 380 | 0 | 46 |
ca7c7edf7ff446e57c190dc6666d3e16fbd106a2 | 792 | py | Python | docker-min/mkimage/just-bash.py | robnagler/container-play | 8f112a1bdaf14d9be0a62a548a08a34f03c193f6 | [
"Apache-2.0"
] | null | null | null | docker-min/mkimage/just-bash.py | robnagler/container-play | 8f112a1bdaf14d9be0a62a548a08a34f03c193f6 | [
"Apache-2.0"
] | null | null | null | docker-min/mkimage/just-bash.py | robnagler/container-play | 8f112a1bdaf14d9be0a62a548a08a34f03c193f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# ./mkimage.sh --tag m1 m1.py
from __future__ import absolute_import, division, print_function
import os
import shutil
import subprocess
import sys
files=[
'/usr/bin/bash',
'/usr/bin/ls',
]
os.chdir(sys.argv[1])
os.umask(0o22)
for d in (
'etc',
'tmp',
'var/tmp',
'usr/bin... | 16.851064 | 64 | 0.565657 | #!/usr/bin/env python
# ./mkimage.sh --tag m1 m1.py
from __future__ import absolute_import, division, print_function
import os
import shutil
import subprocess
import sys
files=[
'/usr/bin/bash',
'/usr/bin/ls',
]
os.chdir(sys.argv[1])
os.umask(0o22)
for d in (
'etc',
'tmp',
'var/tmp',
'usr/bin... | 44 | 0 | 23 |
d9bda7d97a3a63c0a34725e21d88e1e13fa70eeb | 2,610 | py | Python | ch07/bagging.py | stoneflyop1/py_machine_learning | 18fd635d312f957ca4fcc23d856a1bcd4cf95f48 | [
"MIT"
] | null | null | null | ch07/bagging.py | stoneflyop1/py_machine_learning | 18fd635d312f957ca4fcc23d856a1bcd4cf95f48 | [
"MIT"
] | null | null | null | ch07/bagging.py | stoneflyop1/py_machine_learning | 18fd635d312f957ca4fcc23d856a1bcd4cf95f48 | [
"MIT"
] | null | null | null | import pandas as pd
df_wine = pd.read_csv('../data/wine.data', header=None)
df_wine.columns = [
'Class label', 'Alcohol', 'Malic acid', 'Ash', 'Alcalinity of ash',
'Magnesium', 'TOtal phenols', 'Flavanoids', 'Nonflavanoid phenols',
'Proanthocyanins', 'Color intensity', 'Hue',
'OD280/OD315 of diluted win... | 37.285714 | 82 | 0.702682 | import pandas as pd
df_wine = pd.read_csv('../data/wine.data', header=None)
df_wine.columns = [
'Class label', 'Alcohol', 'Malic acid', 'Ash', 'Alcalinity of ash',
'Magnesium', 'TOtal phenols', 'Flavanoids', 'Nonflavanoid phenols',
'Proanthocyanins', 'Color intensity', 'Hue',
'OD280/OD315 of diluted win... | 0 | 0 | 0 |
44ca70b70e43421fd03a35b311c2fb12bc1b0a12 | 251 | py | Python | scraping/views.py | stepacool/work4sharingPy | c6ffdb3ac8a2956181c290bc4617e3cb11e13dba | [
"MIT"
] | null | null | null | scraping/views.py | stepacool/work4sharingPy | c6ffdb3ac8a2956181c290bc4617e3cb11e13dba | [
"MIT"
] | 5 | 2021-03-19T01:48:51.000Z | 2021-09-22T18:52:20.000Z | scraping/views.py | stepacool/work4sharingPy | c6ffdb3ac8a2956181c290bc4617e3cb11e13dba | [
"MIT"
] | 2 | 2020-04-16T20:23:11.000Z | 2020-04-18T12:35:46.000Z | from django.shortcuts import render
# Create your views here.
from rest_framework.generics import CreateAPIView
from scraping.serializers import EmployeeSerializer
| 22.818182 | 51 | 0.844622 | from django.shortcuts import render
# Create your views here.
from rest_framework.generics import CreateAPIView
from scraping.serializers import EmployeeSerializer
class CreateEmployeeView(CreateAPIView):
serializer_class = EmployeeSerializer
| 0 | 61 | 23 |
1e70df7c2ef9bce6a79c55efd4279997fce505e9 | 7,610 | py | Python | src/test_verbindung_ms&r.py | technikamateur/robolab | 1509c0c558f5c5d9a6cf944a21e79b07486853a0 | [
"MIT"
] | null | null | null | src/test_verbindung_ms&r.py | technikamateur/robolab | 1509c0c558f5c5d9a6cf944a21e79b07486853a0 | [
"MIT"
] | null | null | null | src/test_verbindung_ms&r.py | technikamateur/robolab | 1509c0c558f5c5d9a6cf944a21e79b07486853a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 11:15:09 2019
@author: panyongyi
"""
#!/usr/bin/env python3
# Suggestion: Do not import the ev3dev.ev3 module in this file
import json
import paho.mqtt.client as mqtt
import uuid
import time
from planet import Planet, Direction
class Communi... | 31.708333 | 236 | 0.595795 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 11:15:09 2019
@author: panyongyi
"""
#!/usr/bin/env python3
# Suggestion: Do not import the ev3dev.ev3 module in this file
import json
import paho.mqtt.client as mqtt
import uuid
import time
from planet import Planet, Direction
class Communi... | 4,228 | 0 | 349 |
d7fa780746f7314c474e988e5736d6c252c9a458 | 500 | py | Python | biblio/migrations/0003_book_isbn.py | DanicoSantos/librhes | 616ed1444d47c50dfbd6ecda0d32ee216d2044cb | [
"MIT"
] | null | null | null | biblio/migrations/0003_book_isbn.py | DanicoSantos/librhes | 616ed1444d47c50dfbd6ecda0d32ee216d2044cb | [
"MIT"
] | null | null | null | biblio/migrations/0003_book_isbn.py | DanicoSantos/librhes | 616ed1444d47c50dfbd6ecda0d32ee216d2044cb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-09 18:23
from django.db import migrations, models
| 26.315789 | 167 | 0.628 | # Generated by Django 3.2.7 on 2021-09-09 18:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biblio', '0002_rename_isbn_book_genre'),
]
operations = [
migrations.AddField(
model_name='book',
name='isbn',
... | 0 | 386 | 23 |
7d614047f48da2ec532109926d3175e03253eb47 | 2,276 | py | Python | pytorch-frontend/caffe2/python/operator_test/channel_backprop_stats_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | pytorch-frontend/caffe2/python/operator_test/channel_backprop_stats_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | pytorch-frontend/caffe2/python/operator_test/channel_backprop_stats_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
from hypothesis import given, settings
import caffe2.python.serialized_test.serialized_test... | 36.126984 | 79 | 0.59007 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
from hypothesis import given, settings
import caffe2.python.serialized_test.serialized_test... | 1,557 | 240 | 23 |
4835b82cff8e79a73e117d4f3ed005f2366de7c5 | 16,367 | py | Python | gear_builder_gui/manifest.py | joshicola/fw-gear-building-gui | 924aa742479f6f0983509106e8d63a3fc267eaa3 | [
"Apache-2.0"
] | null | null | null | gear_builder_gui/manifest.py | joshicola/fw-gear-building-gui | 924aa742479f6f0983509106e8d63a3fc267eaa3 | [
"Apache-2.0"
] | null | null | null | gear_builder_gui/manifest.py | joshicola/fw-gear-building-gui | 924aa742479f6f0983509106e8d63a3fc267eaa3 | [
"Apache-2.0"
] | null | null | null | import copy
import json
import os
from pathlib import Path
import pystache
from PyQt5 import QtCore, QtGui, QtWidgets
from gear_builder_gui.config_dialog import config_dialog
from gear_builder_gui.input_dialog import input_dialog
class Manifest:
"""
A class to manage the manifest of a gear
TODO: Includ... | 35.197849 | 87 | 0.569194 | import copy
import json
import os
from pathlib import Path
import pystache
from PyQt5 import QtCore, QtGui, QtWidgets
from gear_builder_gui.config_dialog import config_dialog
from gear_builder_gui.input_dialog import input_dialog
class Manifest:
"""
A class to manage the manifest of a gear
TODO: Includ... | 0 | 0 | 0 |
47fcdec47eb87ee97751e3275df1278d4abe7646 | 6,012 | py | Python | spycial/erf.py | person142/spycial | d017048c8c09ee0714f438cb75c2e221e068baee | [
"BSD-3-Clause"
] | 6 | 2019-04-04T21:53:40.000Z | 2020-02-10T17:16:40.000Z | spycial/erf.py | person142/special | d017048c8c09ee0714f438cb75c2e221e068baee | [
"BSD-3-Clause"
] | null | null | null | spycial/erf.py | person142/special | d017048c8c09ee0714f438cb75c2e221e068baee | [
"BSD-3-Clause"
] | 1 | 2019-09-14T15:09:21.000Z | 2019-09-14T15:09:21.000Z | """Code adapted from Boost, which is:
(C) Copyright John Maddock 2006.
Use, modification and distribution are subject to the
Boost Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
from numba import njit, vectorize
import numpy as np
from . imp... | 26.72 | 69 | 0.618596 | """Code adapted from Boost, which is:
(C) Copyright John Maddock 2006.
Use, modification and distribution are subject to the
Boost Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
from numba import njit, vectorize
import numpy as np
from . imp... | 44 | 0 | 44 |
729b980ba4203cd8152efa3abec70e7a6d8e8e89 | 2,499 | py | Python | adsa/demo.py | jtkorhonen/droplet-shape-solver | a88422d0505cb5b0b52419758b4e7c1c6910ecfe | [
"MIT"
] | null | null | null | adsa/demo.py | jtkorhonen/droplet-shape-solver | a88422d0505cb5b0b52419758b4e7c1c6910ecfe | [
"MIT"
] | null | null | null | adsa/demo.py | jtkorhonen/droplet-shape-solver | a88422d0505cb5b0b52419758b4e7c1c6910ecfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A simulation and visualization demonstration.
This module runs a simple demonstration of the capabilities of the adsa
simulations and analysis.
"""
import logging
from pathlib import Path
import csv
from .solver import simulate_droplet_shape
from .analysis import calculate_volume
from .visu... | 34.708333 | 95 | 0.585034 | # -*- coding: utf-8 -*-
"""A simulation and visualization demonstration.
This module runs a simple demonstration of the capabilities of the adsa
simulations and analysis.
"""
import logging
from pathlib import Path
import csv
from .solver import simulate_droplet_shape
from .analysis import calculate_volume
from .visu... | 2,055 | 0 | 46 |
31be368eb110b35254e54ddbccc580822d685138 | 14,497 | py | Python | tools/run.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | tools/run.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | tools/run.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | from condor_scheduler import *
from basic_scheduler import *
from helper import *
#scheduler = CondorScheduler()
scheduler = BasicScheduler()
app_flags = {}
trials = ['', '_1', '_2']
trials = ['']
#thds = [4, 8] #, 16, 20, 24, 28, 32]
thds = [8, 16, 32]
thds = [4, 8, 16, 20, 24, 28, 32]
thds = [16]
thds = [4, 8, 1... | 29.346154 | 82 | 0.631579 | from condor_scheduler import *
from basic_scheduler import *
from helper import *
#scheduler = CondorScheduler()
scheduler = BasicScheduler()
def add_dbms_job(app_flags = {}, executable = "./rundb", output_dir = "results/"):
app_args = " "
for key in app_flags.keys():
if key in args_mapping.keys():
app_args +... | 414 | 0 | 23 |
56e2f739f22e14fa46944fddc6d4bb6c6f1226be | 152 | py | Python | compiled/construct/opaque_with_param.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 4 | 2017-04-08T12:55:11.000Z | 2020-12-05T21:09:31.000Z | compiled/construct/opaque_with_param.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 7 | 2018-04-23T01:30:33.000Z | 2020-10-30T23:56:14.000Z | compiled/construct/opaque_with_param.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 6 | 2017-04-08T11:41:14.000Z | 2020-10-30T22:47:31.000Z | from construct import *
from construct.lib import *
opaque_with_param = Struct(
'one' / LazyBound(lambda: params_def),
)
_schema = opaque_with_param
| 16.888889 | 39 | 0.763158 | from construct import *
from construct.lib import *
opaque_with_param = Struct(
'one' / LazyBound(lambda: params_def),
)
_schema = opaque_with_param
| 0 | 0 | 0 |
85b9d73931a1a3a5f2a12915b8b01497ab128c23 | 521,619 | py | Python | sympy/integrals/rubi/rules/inverse_hyperbolic.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 2 | 2018-12-05T02:30:43.000Z | 2020-11-14T01:43:15.000Z | sympy/integrals/rubi/rules/inverse_hyperbolic.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2017-10-23T06:56:43.000Z | 2017-10-23T06:56:43.000Z | sympy/integrals/rubi/rules/inverse_hyperbolic.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2020-10-02T15:05:03.000Z | 2020-10-02T15:05:03.000Z | from sympy.external import import_module
matchpy = import_module("matchpy")
from sympy.utilities.decorator import doctest_depends_on
if matchpy:
from matchpy import Pattern, ReplacementRule, CustomConstraint
from sympy.integrals.rubi.utility_function import (Int, Set, With, Module, Scan, MapAnd, FalseQ, ZeroQ,... | 185.563501 | 6,553 | 0.591269 | from sympy.external import import_module
matchpy = import_module("matchpy")
from sympy.utilities.decorator import doctest_depends_on
if matchpy:
from matchpy import Pattern, ReplacementRule, CustomConstraint
from sympy.integrals.rubi.utility_function import (Int, Set, With, Module, Scan, MapAnd, FalseQ, ZeroQ,... | 513,811 | 0 | 23 |
00f674dd269b5ded3bd8cfeb250e25da5e9bb9c5 | 1,777 | py | Python | l19z3.py | hubieva-a/lab19 | 516357b25d62bc7aab9a6b45528b4611adf9acdd | [
"MIT"
] | null | null | null | l19z3.py | hubieva-a/lab19 | 516357b25d62bc7aab9a6b45528b4611adf9acdd | [
"MIT"
] | null | null | null | l19z3.py | hubieva-a/lab19 | 516357b25d62bc7aab9a6b45528b4611adf9acdd | [
"MIT"
] | null | null | null | from tkinter import *
root = Tk()
text1 = Text(width=20,height=1)
label1 = Label(width=20)
but1 = Button(width=5, height=5, bg='#ff0000')
but2 = Button(width=5, height=5, bg='#ff7d00')
but3 = Button(width=5, height=5, bg='#ffff00')
but4 = Button(width=5, height=5, bg='#00ff00')
but5 = Button(width=5, height... | 26.132353 | 47 | 0.62296 | from tkinter import *
def color_red(event):
text1.delete(1.0, "end")
text1.insert(1.0,'Красный')
label1['text'] = '#ff0000'
def color_orange(event):
text1.delete(1.0, "end")
text1.insert(1.0,'Оранжевый')
label1['text'] = '#ff7d00'
def color_yellow(event):
text1.delete(1.0, "e... | 733 | 0 | 175 |
c78e735101ac48aa6d6991855b779aa1b42eaff5 | 40,950 | py | Python | src/rtl/decoder.py | giraffe50/RISCV-M4F | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 3 | 2021-01-13T03:41:14.000Z | 2021-03-23T11:31:48.000Z | src/rtl/decoder.py | scutdig/LG-32HP | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 1 | 2021-03-01T09:32:59.000Z | 2021-03-01T09:32:59.000Z | src/rtl/decoder.py | scutdig/LG-32HP | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 4 | 2021-01-07T03:01:26.000Z | 2021-02-28T02:20:10.000Z | """
Copyright Digisim, Computer Architecture team of South China University of Technology,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | 53.952569 | 136 | 0.522344 | """
Copyright Digisim, Computer Architecture team of South China University of Technology,
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | 39,732 | 0 | 66 |
bff925f7c3f355eb5ffbb6f8cb0de00147144a52 | 884 | py | Python | xuexiStudyScore_month_v2.py | g-mitu/timeseries | 3b2daf33f9af022d1aae7c4a9caf69b8abd58348 | [
"BSD-3-Clause"
] | null | null | null | xuexiStudyScore_month_v2.py | g-mitu/timeseries | 3b2daf33f9af022d1aae7c4a9caf69b8abd58348 | [
"BSD-3-Clause"
] | null | null | null | xuexiStudyScore_month_v2.py | g-mitu/timeseries | 3b2daf33f9af022d1aae7c4a9caf69b8abd58348 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 1 10:16:25 2020
@author: winhl
modify 2022-1-6
"""
import pandas as pd
import json
work_dir = "D:/__E__/支部/积分"
#n0 = "2021s1p9"
n0 = "2021.01-12.xuexi.cn" #2022-1-6
with open(f"{work_dir}/{n0}.json", "r", encoding="utf-8") as f:
fr = f.read()
... | 22.666667 | 74 | 0.616516 | # -*- coding: utf-8 -*-
"""
Created on Fri May 1 10:16:25 2020
@author: winhl
modify 2022-1-6
"""
import pandas as pd
import json
work_dir = "D:/__E__/支部/积分"
#n0 = "2021s1p9"
n0 = "2021.01-12.xuexi.cn" #2022-1-6
with open(f"{work_dir}/{n0}.json", "r", encoding="utf-8") as f:
fr = f.read()
... | 0 | 0 | 0 |
cf9ad7ad972d6588d169b5cc55ce7927f2bf7751 | 799 | py | Python | models.py | seanli3/fastGCN | e3704ae2c96363da0d6318f9f2a53df4384474bf | [
"MIT"
] | 28 | 2020-06-03T01:03:05.000Z | 2022-03-26T16:37:36.000Z | models.py | seanli3/fastGCN | e3704ae2c96363da0d6318f9f2a53df4384474bf | [
"MIT"
] | null | null | null | models.py | seanli3/fastGCN | e3704ae2c96363da0d6318f9f2a53df4384474bf | [
"MIT"
] | 4 | 2020-08-12T07:55:50.000Z | 2022-03-11T05:11:24.000Z | import torch.nn as nn
import torch.nn.functional as F
from layers import GraphConvolution
| 31.96 | 76 | 0.652065 | import torch.nn as nn
import torch.nn.functional as F
from layers import GraphConvolution
class GCN(nn.Module):
def __init__(self, nfeat, nhid, nclass, dropout, sampler):
super().__init__()
self.gc1 = GraphConvolution(nfeat, nhid)
self.gc2 = GraphConvolution(nhid, nclass)
self.dro... | 605 | 0 | 103 |
e2dedf6fb31777077279b3ee42c8daaea82f726d | 10,683 | py | Python | _tbnf/fable_modules/fable_library/reflection.py | thautwarm/Typed-BNF | 897a4a2bd389dcb2ca16c6c773b28f0388336f63 | [
"MIT"
] | 38 | 2022-01-01T06:45:27.000Z | 2022-03-20T14:18:38.000Z | lua_parser/fable_sedlex/fable_modules/fable_library/reflection.py | thautwarm/lua-parser-lark | 06cf19bc8595a70823fc0f67462ca29dd9e118a0 | [
"MIT"
] | 7 | 2021-09-17T16:46:50.000Z | 2021-12-31T20:49:35.000Z | _tbnf/fable_modules/fable_library/reflection.py | thautwarm/typed-bnf | b5694a34fe21a064250f2ef88745d8ebad51eb33 | [
"MIT"
] | 3 | 2022-01-01T07:33:44.000Z | 2022-01-09T11:41:33.000Z | from __future__ import annotations
from argparse import ArgumentError
import functools
from dataclasses import dataclass
from typing import Any, Callable, List, Optional, Type, Union
from .types import Union as FsUnion, FSharpRef, Record
from .util import equal_arrays_with
Constructor = Callable[..., Any]
EnumCase ... | 27.89295 | 106 | 0.666479 | from __future__ import annotations
from argparse import ArgumentError
import functools
from dataclasses import dataclass
from typing import Any, Callable, List, Optional, Type, Union
from .types import Union as FsUnion, FSharpRef, Record
from .util import equal_arrays_with
Constructor = Callable[..., Any]
EnumCase ... | 7,846 | 435 | 1,170 |
75d1e9be3c0054dda73122202f10bfd3443b59e0 | 13,344 | py | Python | cgal4py/domain_decomp/__init__.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 4 | 2020-01-05T06:31:55.000Z | 2021-03-06T03:11:33.000Z | cgal4py/domain_decomp/__init__.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 1 | 2020-03-21T14:59:03.000Z | 2020-03-21T14:59:03.000Z | cgal4py/domain_decomp/__init__.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 1 | 2021-03-07T07:08:11.000Z | 2021-03-07T07:08:11.000Z | import numpy as np
import cykdtree as kdtree
from cgal4py import PY_MAJOR_VERSION
def tree(method, pts, left_edge, right_edge, periodic, *args, **kwargs):
r"""Get tree for a given domain decomposition schema.
Args:
method (str): Domain decomposition method. Supported options are:
'kdtree':... | 43.465798 | 79 | 0.549086 | import numpy as np
import cykdtree as kdtree
from cgal4py import PY_MAJOR_VERSION
def tree(method, pts, left_edge, right_edge, periodic, *args, **kwargs):
r"""Get tree for a given domain decomposition schema.
Args:
method (str): Domain decomposition method. Supported options are:
'kdtree':... | 0 | 4,336 | 46 |
47de195050b2ce241f5bd06bf41a7f034574533c | 787 | py | Python | satsound/migrations/0002_auto_20161110_1753.py | saanobhaai/apman | e07452f54fcb895fb6039b6be63abf3861d7b9cb | [
"MIT"
] | null | null | null | satsound/migrations/0002_auto_20161110_1753.py | saanobhaai/apman | e07452f54fcb895fb6039b6be63abf3861d7b9cb | [
"MIT"
] | null | null | null | satsound/migrations/0002_auto_20161110_1753.py | saanobhaai/apman | e07452f54fcb895fb6039b6be63abf3861d7b9cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-10 17:53
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
| 29.148148 | 116 | 0.631512 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-10 17:53
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('satsound', '0001_initial'),
]
operations = [
... | 0 | 575 | 23 |
25e24f00aae6558660cbd00a9c7e07a9e7f285e8 | 2,990 | py | Python | tests/test_config.py | power-edge/PySBR | f768c24e539557c08dfcaf39ce1eaca7d730cf25 | [
"MIT"
] | 49 | 2020-12-13T07:07:50.000Z | 2022-02-09T18:54:39.000Z | tests/test_config.py | power-edge/PySBR | f768c24e539557c08dfcaf39ce1eaca7d730cf25 | [
"MIT"
] | 11 | 2021-01-08T05:04:52.000Z | 2022-03-16T12:51:28.000Z | tests/test_config.py | power-edge/PySBR | f768c24e539557c08dfcaf39ce1eaca7d730cf25 | [
"MIT"
] | 9 | 2021-01-18T02:03:24.000Z | 2022-01-29T04:47:01.000Z | import pytest
from pytest import mark
from pytest_lazyfixture import lazy_fixture
| 32.5 | 83 | 0.485619 | import pytest
from pytest import mark
from pytest_lazyfixture import lazy_fixture
class TestConfig:
@mark.parametrize(
"league",
[
lazy_fixture("nfl"),
lazy_fixture("ncaaf"),
lazy_fixture("epl"),
lazy_fixture("mlb"),
lazy_fixture("nba"),
... | 659 | 2,225 | 23 |
65ad5cf978781fc39296c7ef6130f2bc6c3e1a86 | 21,851 | py | Python | attic/pyromsguiwx_old.py | rsoutelino/romsview | 0a44e6ef795ff3580960792836adcc64730994d6 | [
"MIT"
] | 2 | 2021-12-11T19:27:37.000Z | 2022-03-05T04:09:18.000Z | attic/pyromsguiwx_old.py | rsoutelino/romsview | 0a44e6ef795ff3580960792836adcc64730994d6 | [
"MIT"
] | null | null | null | attic/pyromsguiwx_old.py | rsoutelino/romsview | 0a44e6ef795ff3580960792836adcc64730994d6 | [
"MIT"
] | 3 | 2021-11-06T20:17:02.000Z | 2022-01-16T09:23:48.000Z | #!/usr/bin/env python
######################################################
# GUI to vizualize ROMS input/output files
# Sep 2021
# rsoutelino@gmail.com
######################################################
import os
import wx
import datetime as dt
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as F... | 36.540134 | 103 | 0.565558 | #!/usr/bin/env python
######################################################
# GUI to vizualize ROMS input/output files
# Sep 2021
# rsoutelino@gmail.com
######################################################
import os
import wx
import datetime as dt
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as F... | 18,372 | 197 | 513 |
700588898a4c3e0a8dc6ac4dc1d2cd5ed25b1673 | 1,464 | py | Python | 02_Math/sum_of_pairwise_hamming_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 61 | 2018-02-18T08:16:31.000Z | 2022-02-17T17:18:57.000Z | 02_Math/sum_of_pairwise_hamming_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 1 | 2018-02-23T20:06:18.000Z | 2019-12-29T18:52:20.000Z | 02_Math/sum_of_pairwise_hamming_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 30 | 2018-03-28T19:02:23.000Z | 2021-07-06T20:00:14.000Z | # Sum of pairwise Hamming Distance
# https://www.interviewbit.com/problems/sum-of-pairwise-hamming-distance/
#
# Hamming distance between two non-negative integers is defined as the number of positions at
# which the corresponding bits are different.
#
# For example,
#
# HammingDistance(2, 7) = 2, as only the first and... | 26.142857 | 99 | 0.503415 | # Sum of pairwise Hamming Distance
# https://www.interviewbit.com/problems/sum-of-pairwise-hamming-distance/
#
# Hamming distance between two non-negative integers is defined as the number of positions at
# which the corresponding bits are different.
#
# For example,
#
# HammingDistance(2, 7) = 2, as only the first and... | 274 | -6 | 49 |
a3630273dbac15d887205a06684a473409e30b99 | 1,865 | py | Python | Python/Algorithms/Machine Learning Algorithms/Naive Bayes in python.py | ThunderZ007/Data-Structures-and-Algorithms | 148415faf6472115f6848b1a4e21b660b6d327da | [
"MIT"
] | 245 | 2020-10-05T14:52:37.000Z | 2022-03-29T07:40:38.000Z | Python/Algorithms/Machine Learning Algorithms/Naive Bayes in python.py | ThunderZ007/Data-Structures-and-Algorithms | 148415faf6472115f6848b1a4e21b660b6d327da | [
"MIT"
] | 521 | 2020-10-05T15:25:29.000Z | 2021-11-09T13:24:01.000Z | Python/Algorithms/Machine Learning Algorithms/Naive Bayes in python.py | ThunderZ007/Data-Structures-and-Algorithms | 148415faf6472115f6848b1a4e21b660b6d327da | [
"MIT"
] | 521 | 2020-10-05T15:29:42.000Z | 2022-03-27T10:22:00.000Z | #!/usr/bin/env python
# coding: utf-8
# In[16]:
#importing required packages
import pandas as pd
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
fr... | 25.202703 | 124 | 0.742091 | #!/usr/bin/env python
# coding: utf-8
# In[16]:
#importing required packages
import pandas as pd
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
fr... | 426 | 0 | 24 |
44ea9fb9dbeae66a8bc24c2056240e71d2dc20e2 | 464 | py | Python | python/basis/11-string.py | weizhenwei/tech-docs-2016 | 253564a1633e9ec75ac94efede57f52c02b29280 | [
"BSD-2-Clause"
] | 3 | 2017-06-09T08:48:07.000Z | 2020-12-13T10:37:44.000Z | python/basis/11-string.py | weizhenwei/tech-docs-sharetome | 253564a1633e9ec75ac94efede57f52c02b29280 | [
"BSD-2-Clause"
] | null | null | null | python/basis/11-string.py | weizhenwei/tech-docs-sharetome | 253564a1633e9ec75ac94efede57f52c02b29280 | [
"BSD-2-Clause"
] | 4 | 2020-04-29T07:03:44.000Z | 2021-07-25T15:12:15.000Z | #!/usr/bin/env python
import math
var1 = "Hello"
var2 = "Worldpress"
print "var1 = ", var1
print "var2 = ", var2
print "var1[0] = ", var1[0]
print "var2[1:5] = ", var2[1:5]
if ('H' in var1):
print "H is in var1 ", var1
else:
print "H is not in var1 ", var1
if ('H' not in var2):
print "H is not in var2... | 15.466667 | 43 | 0.571121 | #!/usr/bin/env python
import math
var1 = "Hello"
var2 = "Worldpress"
print "var1 = ", var1
print "var2 = ", var2
print "var1[0] = ", var1[0]
print "var2[1:5] = ", var2[1:5]
if ('H' in var1):
print "H is in var1 ", var1
else:
print "H is not in var1 ", var1
if ('H' not in var2):
print "H is not in var2... | 0 | 0 | 0 |
a1352f79c8742aa930e6ed10fa6c5d2c55aed433 | 2,462 | py | Python | quarantine/model/qplayer.py | kwoolter/Quarantine | 7b824a3d6eebbded611c48e44dcb3c2e4007033e | [
"BSD-2-Clause"
] | null | null | null | quarantine/model/qplayer.py | kwoolter/Quarantine | 7b824a3d6eebbded611c48e44dcb3c2e4007033e | [
"BSD-2-Clause"
] | null | null | null | quarantine/model/qplayer.py | kwoolter/Quarantine | 7b824a3d6eebbded611c48e44dcb3c2e4007033e | [
"BSD-2-Clause"
] | null | null | null | import random
| 28.298851 | 88 | 0.606418 | import random
class QPlayer:
# The states that a player can be in
STATE_AWAKE = "awake"
STATE_ASLEEP = "asleep"
STATE_DEAD = "dead"
STATES = (STATE_AWAKE, STATE_ASLEEP)
# The properties that a player has
PROPERTY_HUNGER = "hunger"
PROPERTY_TIREDNESS = "tiredness"
PROPERTY_ENERGY =... | 1,245 | 1,180 | 23 |
2a935db27b0f7abbafe27f11270e5ac3ad8002f9 | 3,293 | py | Python | encyclopedia/views.py | jeff-eng/CS50W2020__Project1-Wiki | 6eea612163aaf30bd5014da37afac10ce0f199df | [
"MIT"
] | null | null | null | encyclopedia/views.py | jeff-eng/CS50W2020__Project1-Wiki | 6eea612163aaf30bd5014da37afac10ce0f199df | [
"MIT"
] | null | null | null | encyclopedia/views.py | jeff-eng/CS50W2020__Project1-Wiki | 6eea612163aaf30bd5014da37afac10ce0f199df | [
"MIT"
] | null | null | null | import markdown2, re, random
from django.shortcuts import render
from django.urls import reverse
from django.http import HttpResponseRedirect
from . import util | 33.948454 | 102 | 0.595809 | import markdown2, re, random
from django.shortcuts import render
from django.urls import reverse
from django.http import HttpResponseRedirect
from . import util
def index(request):
return render(request, 'encyclopedia/index.html', {
'entries': util.list_entries()
})
def entry(request, title):
en... | 2,970 | 0 | 161 |
62abacff8a003309f019d0e8ef1a6850d38f3dde | 1,707 | py | Python | gunpowder/tensorflow/local_server.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 43 | 2017-05-03T22:27:11.000Z | 2022-02-11T19:07:28.000Z | gunpowder/tensorflow/local_server.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 102 | 2017-06-09T10:11:06.000Z | 2022-03-29T13:56:37.000Z | gunpowder/tensorflow/local_server.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 43 | 2017-04-25T20:25:17.000Z | 2022-02-11T19:07:34.000Z | import logging
import multiprocessing
import ctypes
from gunpowder.ext import tensorflow as tf
from gunpowder.freezable import Freezable
logger = logging.getLogger(__name__)
class LocalServer(Freezable):
'''Wrapper around ``tf.train.Server`` to create a local server on-demand.
This class is necessary because... | 34.836735 | 77 | 0.656122 | import logging
import multiprocessing
import ctypes
from gunpowder.ext import tensorflow as tf
from gunpowder.freezable import Freezable
logger = logging.getLogger(__name__)
class LocalServer(Freezable):
'''Wrapper around ``tf.train.Server`` to create a local server on-demand.
This class is necessary because... | 0 | 0 | 0 |
838b2b92c45e629173b0d35fc53eade12724bb23 | 6,945 | py | Python | src/python/pants/backend/go/tailor.py | williamscs/pants | 4d1f2ca1a58e98c27a26adcb0e9b844a27b75a63 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/go/tailor.py | williamscs/pants | 4d1f2ca1a58e98c27a26adcb0e9b844a27b75a63 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/go/tailor.py | williamscs/pants | 4d1f2ca1a58e98c27a26adcb0e9b844a27b75a63 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import os
from dataclasses import dataclass
from typing import Dict, List
from pants.backend.go.module import ResolvedGoModule, ResolveGoModuleRequest
from pants.backend.g... | 38.370166 | 109 | 0.694168 | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import os
from dataclasses import dataclass
from typing import Dict, List
from pants.backend.go.module import ResolvedGoModule, ResolveGoModuleRequest
from pants.backend.g... | 5,090 | 156 | 178 |
5e55f73c2a86f2dd55e0bb3efcee4238d5951700 | 44 | py | Python | Cursos/dados.py | FranciscoAlveJr/Bot_Telegram | 9960485a4a25648719ef6fafcb3b02c82db79253 | [
"MIT"
] | null | null | null | Cursos/dados.py | FranciscoAlveJr/Bot_Telegram | 9960485a4a25648719ef6fafcb3b02c82db79253 | [
"MIT"
] | null | null | null | Cursos/dados.py | FranciscoAlveJr/Bot_Telegram | 9960485a4a25648719ef6fafcb3b02c82db79253 | [
"MIT"
] | null | null | null | import os
import cursos
print(os.getcwd())
| 8.8 | 18 | 0.75 | import os
import cursos
print(os.getcwd())
| 0 | 0 | 0 |
b28910cf47ea8e3a98d8eb43d5925251f87a8b1c | 692 | py | Python | onlinecourse/migrations/0007_auto_20210420_1459.py | enricosiagri/final-cloud-app-with-database | d4dc4646c1e238bcba71fa240cf808b360e959c0 | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/0007_auto_20210420_1459.py | enricosiagri/final-cloud-app-with-database | d4dc4646c1e238bcba71fa240cf808b360e959c0 | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/0007_auto_20210420_1459.py | enricosiagri/final-cloud-app-with-database | d4dc4646c1e238bcba71fa240cf808b360e959c0 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.3 on 2021-04-20 14:59
from django.db import migrations, models
| 23.862069 | 52 | 0.562139 | # Generated by Django 3.1.3 on 2021-04-20 14:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0006_auto_20210416_1459'),
]
operations = [
migrations.RenameField(
model_name='submission',
old_nam... | 0 | 578 | 23 |
a65f39ef854ba9a4bb94c8cf08a568806963b135 | 7,416 | py | Python | finitediff/unit_tests.py | jolyonb/finitediff | fb6d05490fcf8a7a7603e68aec165b9fb931ba3a | [
"MIT"
] | null | null | null | finitediff/unit_tests.py | jolyonb/finitediff | fb6d05490fcf8a7a7603e68aec165b9fb931ba3a | [
"MIT"
] | null | null | null | finitediff/unit_tests.py | jolyonb/finitediff | fb6d05490fcf8a7a7603e68aec165b9fb931ba3a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Unit tests for finite_diff library
"""
import unittest
import random
from math import pi
import numpy as np
import finitediff
class TestFiniteDiff(unittest.TestCase):
"""Unit test class for the finitediff library"""
order = 4 # Order of the derivatives
... | 37.836735 | 91 | 0.618797 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Unit tests for finite_diff library
"""
import unittest
import random
from math import pi
import numpy as np
import finitediff
class TestFiniteDiff(unittest.TestCase):
"""Unit test class for the finitediff library"""
order = 4 # Order of the derivatives
... | 0 | 0 | 0 |
cd31afc24dd0c8fd36f1b2e599cb704db2845b1c | 199 | py | Python | problem0143.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0143.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0143.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #143 Investigating the Torricelli point of a triangle - Project Euler
# https://projecteuler.net/problem=143
#
# Code by Kevin Marciniak
#
###########################
| 22.111111 | 71 | 0.537688 | ###########################
#
# #143 Investigating the Torricelli point of a triangle - Project Euler
# https://projecteuler.net/problem=143
#
# Code by Kevin Marciniak
#
###########################
| 0 | 0 | 0 |
d0299594988dabb3885370f57f0c63136d56db5c | 94 | py | Python | connected_accounts/__init__.py | surajsonee/socialapp | e741d2467e2bbde5b7bdbe90702e4123ce31bddb | [
"BSD-3-Clause"
] | null | null | null | connected_accounts/__init__.py | surajsonee/socialapp | e741d2467e2bbde5b7bdbe90702e4123ce31bddb | [
"BSD-3-Clause"
] | null | null | null | connected_accounts/__init__.py | surajsonee/socialapp | e741d2467e2bbde5b7bdbe90702e4123ce31bddb | [
"BSD-3-Clause"
] | null | null | null | __version__ = '0.1.4'
default_app_config = 'connected_accounts.apps.ConnectedAccountsConfig'
| 23.5 | 70 | 0.819149 | __version__ = '0.1.4'
default_app_config = 'connected_accounts.apps.ConnectedAccountsConfig'
| 0 | 0 | 0 |
648bed7c4d6a2f610991e053956f05ea27c2023b | 1,600 | py | Python | nehushtan/socket/NehushtanUDPSocketServer.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | null | null | null | nehushtan/socket/NehushtanUDPSocketServer.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | 1 | 2020-11-20T03:10:23.000Z | 2020-11-20T09:30:34.000Z | nehushtan/socket/NehushtanUDPSocketServer.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | 1 | 2021-10-13T10:16:58.000Z | 2021-10-13T10:16:58.000Z | import socket
from abc import abstractmethod
from threading import Thread
from typing import Optional
from nehushtan.socket.SocketHandleThreadManager import SocketHandlerThreadManager
class NehushtanUDPSocketServer:
"""
Since 0.4.16
"""
def should_terminate(self) -> bool:
"""
If retu... | 30.769231 | 99 | 0.6775 | import socket
from abc import abstractmethod
from threading import Thread
from typing import Optional
from nehushtan.socket.SocketHandleThreadManager import SocketHandlerThreadManager
class NehushtanUDPSocketServer:
"""
Since 0.4.16
"""
def __init__(self, host: str, port: int, buffer_size=0, tm: Soc... | 1,007 | 0 | 134 |
80397360440b25ef17a5effd5d326a5b6eb37ed9 | 4,603 | py | Python | optable/OptModel.py | dgroner/optable | 4ee2947901c179925cdb6a6ceb172c54bf9b1844 | [
"MIT"
] | null | null | null | optable/OptModel.py | dgroner/optable | 4ee2947901c179925cdb6a6ceb172c54bf9b1844 | [
"MIT"
] | null | null | null | optable/OptModel.py | dgroner/optable | 4ee2947901c179925cdb6a6ceb172c54bf9b1844 | [
"MIT"
] | null | null | null | # Specify and solve an LP using a Pandas DataFrame
import pandas as pd
if __name__ != "__main__":
from . import LpModel
from . import Result
else:
from LpModel import LpModel
from Result import Result
if __name__ == "__main__":
df = OptModel.read_csv("lpmodel.txt")
#print(df.fillna(""))
lpmodel =... | 27.562874 | 93 | 0.575277 | # Specify and solve an LP using a Pandas DataFrame
import pandas as pd
if __name__ != "__main__":
from . import LpModel
from . import Result
else:
from LpModel import LpModel
from Result import Result
class OptModel:
def __init__(self, df):
#print("in OptModel()")
self.df = df
self.is... | 2,956 | 828 | 23 |
532041ff67fa4cd1a9c8b9a2481c86017407d677 | 1,264 | py | Python | test/test_module1.py | PhilippSchuette/PackagingTest | 51f151747b3f9d65ab0eb6168969df060071ed16 | [
"MIT"
] | 3 | 2020-09-10T13:34:47.000Z | 2021-06-02T19:23:07.000Z | test/test_module1.py | PhilippSchuette/PackagingTest | 51f151747b3f9d65ab0eb6168969df060071ed16 | [
"MIT"
] | null | null | null | test/test_module1.py | PhilippSchuette/PackagingTest | 51f151747b3f9d65ab0eb6168969df060071ed16 | [
"MIT"
] | null | null | null | import argparse
import module1 as mod1
import pytest
from hypothesis import given
from hypothesis.strategies import integers
@given(integers())
@given(integers(), integers())
| 19.446154 | 54 | 0.635285 | import argparse
import module1 as mod1
import pytest
from hypothesis import given
from hypothesis.strategies import integers
def test_parser():
parser = mod1.get_parser()
assert isinstance(parser, argparse.ArgumentParser)
def test_Employee():
emp = mod1.Employee(1234, "John", "Smith")
assert emp.id ... | 825 | 0 | 251 |
2ad242ae4823f4b754e9228620d08ce52c874c74 | 2,320 | py | Python | back-end/www/util/export_answers.py | Disfactory/SpotDiff | 18a4bf88d9bd82cc58ac96658ad1f7d067f10a5c | [
"MIT"
] | 2 | 2021-11-10T13:30:01.000Z | 2021-11-17T13:15:19.000Z | back-end/www/util/export_answers.py | Disfactory/SpotDiff | 18a4bf88d9bd82cc58ac96658ad1f7d067f10a5c | [
"MIT"
] | 26 | 2021-10-06T12:01:33.000Z | 2022-03-16T11:26:17.000Z | back-end/www/util/export_answers.py | Disfactory/SpotDiff | 18a4bf88d9bd82cc58ac96658ad1f7d067f10a5c | [
"MIT"
] | 1 | 2022-01-16T10:53:42.000Z | 2022-01-16T10:53:42.000Z | """
The script exports the answer table to a CSV file.
Config
------
CFG_NAME : The config name can be Develpment, Staging, Testing
Output
------
The total answer numbers after export, and the CSV file. (aswer_YYYY_MM_DD_HH_mm_ss.csv)
"""
CFG_NAME = "config.config.DevelopmentConfig"
import sys
import os
sys.path.a... | 38.032787 | 153 | 0.747845 | """
The script exports the answer table to a CSV file.
Config
------
CFG_NAME : The config name can be Develpment, Staging, Testing
Output
------
The total answer numbers after export, and the CSV file. (aswer_YYYY_MM_DD_HH_mm_ss.csv)
"""
CFG_NAME = "config.config.DevelopmentConfig"
import sys
import os
sys.path.a... | 0 | 0 | 0 |
8c71dc08b4073fc0f5c77bf4656761e04ddb2485 | 317 | py | Python | src/blacksmith/sd/_async/base.py | mardiros/blacksmith | c86a870da04b0d916f243cb51f8861529284337d | [
"BSD-3-Clause"
] | 15 | 2022-01-16T15:23:23.000Z | 2022-01-20T21:42:53.000Z | src/blacksmith/sd/_async/base.py | mardiros/blacksmith | c86a870da04b0d916f243cb51f8861529284337d | [
"BSD-3-Clause"
] | 9 | 2022-01-11T19:42:42.000Z | 2022-01-26T20:24:23.000Z | src/blacksmith/sd/_async/base.py | mardiros/blacksmith | c86a870da04b0d916f243cb51f8861529284337d | [
"BSD-3-Clause"
] | null | null | null | import abc
from blacksmith.typing import ServiceName, Url, Version
class AsyncAbstractServiceDiscovery(abc.ABC):
"""Define the Service Discovery interface."""
@abc.abstractmethod
async def get_endpoint(self, service: ServiceName, version: Version) -> Url:
"""Get the endpoint of a service."""
| 26.416667 | 80 | 0.725552 | import abc
from blacksmith.typing import ServiceName, Url, Version
class AsyncAbstractServiceDiscovery(abc.ABC):
"""Define the Service Discovery interface."""
@abc.abstractmethod
async def get_endpoint(self, service: ServiceName, version: Version) -> Url:
"""Get the endpoint of a service."""
| 0 | 0 | 0 |
b04105b29ed75ba096bb6529389fda511f9ef726 | 986 | py | Python | data/anthropocentric/Geyer2017_plastic_production/viz/generate.py | ilopezgp/human_impacts | b2758245edac0946080a647f1dbfd1098c0f0b27 | [
"MIT"
] | 4 | 2020-08-25T00:52:01.000Z | 2020-11-16T16:57:46.000Z | data/anthropocentric/Geyer2017_plastic_production/viz/generate.py | ilopezgp/human_impacts | b2758245edac0946080a647f1dbfd1098c0f0b27 | [
"MIT"
] | 5 | 2020-10-30T21:22:55.000Z | 2021-12-30T02:07:02.000Z | data/anthropocentric/Geyer2017_plastic_production/viz/generate.py | ilopezgp/human_impacts | b2758245edac0946080a647f1dbfd1098c0f0b27 | [
"MIT"
] | 2 | 2020-08-28T10:11:28.000Z | 2020-11-11T07:58:46.000Z | #%%
import numpy as np
import pandas as pd
import altair as alt
import anthro.io
# Load the produciton data.
data = pd.read_csv('../processed/Geyer2017_plastic_production.csv')
data['year'] = pd.to_datetime(data['year'], format='%Y')
chart = alt.Chart(data).encode(
x=alt.X(field='year', type='temporal... | 31.806452 | 95 | 0.600406 | #%%
import numpy as np
import pandas as pd
import altair as alt
import anthro.io
# Load the produciton data.
data = pd.read_csv('../processed/Geyer2017_plastic_production.csv')
data['year'] = pd.to_datetime(data['year'], format='%Y')
chart = alt.Chart(data).encode(
x=alt.X(field='year', type='temporal... | 0 | 0 | 0 |
576e4546e2ca69d03d664c617ab23bbd9d8bb19c | 6,967 | py | Python | scripts/trio_ircproxy/ial.py | ashburry-chat-irc/trio_ircproxy | 10d651d916505e3b3aeb9019e18466fffeaec667 | [
"BSD-3-Clause"
] | null | null | null | scripts/trio_ircproxy/ial.py | ashburry-chat-irc/trio_ircproxy | 10d651d916505e3b3aeb9019e18466fffeaec667 | [
"BSD-3-Clause"
] | 44 | 2021-08-28T00:48:31.000Z | 2022-01-14T11:36:26.000Z | scripts/trio_ircproxy/ial.py | ashburry-chat-irc/trio_ircproxy | 10d651d916505e3b3aeb9019e18466fffeaec667 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from fnmatch import fnmatch
from typing import Union, List, Dict, Set
from threading import Timer
import circular
| 36.098446 | 105 | 0.592077 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from fnmatch import fnmatch
from typing import Union, List, Dict, Set
from threading import Timer
import circular
class IALData:
from circular import XsSocket
myial: Dict[XsSocket, Dict[str, str]] = dict()
myial_chan: Dict[XsSocket, Dict[str, Set[str]]] = dict()
... | 350 | 6,438 | 23 |
a92523bd30212da5bb8ef2fd59130659e4470e80 | 10,353 | py | Python | eduid_proofing_amp/__init__.py | SUNET/eduid-proofing-amp | aaf4e93070089ba51c6a985e0c6fce0c9c687b93 | [
"BSD-3-Clause"
] | null | null | null | eduid_proofing_amp/__init__.py | SUNET/eduid-proofing-amp | aaf4e93070089ba51c6a985e0c6fce0c9c687b93 | [
"BSD-3-Clause"
] | 1 | 2017-06-07T08:55:39.000Z | 2017-06-07T08:55:39.000Z | eduid_proofing_amp/__init__.py | SUNET/eduid-proofing-amp | aaf4e93070089ba51c6a985e0c6fce0c9c687b93 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from eduid_userdb.proofing import OidcProofingUserDB, LetterProofingUserDB, LookupMobileProofingUserDB
from eduid_userdb.proofing import EmailProofingUserDB, PhoneProofingUserDB, OrcidProofingUserDB
from eduid_userdb.proofing import EidasProofingUserDB
from eduid_userdb.personal_... | 26.546154 | 120 | 0.640587 | from __future__ import absolute_import
from eduid_userdb.proofing import OidcProofingUserDB, LetterProofingUserDB, LookupMobileProofingUserDB
from eduid_userdb.proofing import EmailProofingUserDB, PhoneProofingUserDB, OrcidProofingUserDB
from eduid_userdb.proofing import EidasProofingUserDB
from eduid_userdb.personal_... | 3,554 | 0 | 266 |
0a35a64bc8e129fa895b6268a0bf03dcfbeb2e19 | 3,974 | py | Python | razzbee/webviewengine.py | razzbee/kivy-android-webview- | 9f8910e710ed271ff32d20b6e1fd2bbab71522bf | [
"MIT"
] | 14 | 2017-04-01T09:05:53.000Z | 2021-02-05T19:31:28.000Z | razzbee/webviewengine.py | razzbee/kivy-android-webview- | 9f8910e710ed271ff32d20b6e1fd2bbab71522bf | [
"MIT"
] | 3 | 2018-03-16T00:35:16.000Z | 2020-04-29T15:48:05.000Z | razzbee/webviewengine.py | razzbee/kivy-android-webview- | 9f8910e710ed271ff32d20b6e1fd2bbab71522bf | [
"MIT"
] | 8 | 2017-08-15T16:07:12.000Z | 2022-03-27T03:41:34.000Z | from kivy.uix.widget import Widget
from kivy.clock import Clock
from runnable import run_on_ui_thread
from kivy.event import EventDispatcher
from jnius import autoclass
from webviewclient ... | 28.589928 | 130 | 0.668596 | from kivy.uix.widget import Widget
from kivy.clock import Clock
from runnable import run_on_ui_thread
from kivy.event import EventDispatcher
from jnius import autoclass
from webviewclient ... | 2,480 | 737 | 23 |
22b196265c0b570aebf802d2bbc1df1a5a65933f | 3,313 | py | Python | vaas-app/src/vaas/purger/tests/test_views.py | allegro/vaas | 3d2d1f1a9dae6ac69a13563a37f9bfdf4f986ae2 | [
"Apache-2.0"
] | 251 | 2015-09-02T10:50:51.000Z | 2022-03-16T08:00:35.000Z | vaas-app/src/vaas/purger/tests/test_views.py | allegro/vaas | 3d2d1f1a9dae6ac69a13563a37f9bfdf4f986ae2 | [
"Apache-2.0"
] | 154 | 2015-09-02T14:54:08.000Z | 2022-03-16T08:34:17.000Z | vaas-app/src/vaas/purger/tests/test_views.py | allegro/vaas | 3d2d1f1a9dae6ac69a13563a37f9bfdf4f986ae2 | [
"Apache-2.0"
] | 31 | 2015-09-03T07:51:05.000Z | 2020-09-24T09:02:40.000Z | from unittest.mock import patch, Mock
from vaas.cluster.models import LogicalCluster, VarnishServer, VclTemplateBlock, VclTemplate, Dc
from vaas.manager.tests.test_views import BaseApiViewPermissionsTest
| 53.435484 | 168 | 0.589798 | from unittest.mock import patch, Mock
from vaas.cluster.models import LogicalCluster, VarnishServer, VclTemplateBlock, VclTemplate, Dc
from vaas.manager.tests.test_views import BaseApiViewPermissionsTest
class TestPurgerApiViewPermissions(BaseApiViewPermissionsTest):
PURGER_RESOURCE = '/api/v0.1/purger/'
AP... | 2,547 | 537 | 23 |
200332a5b27e708f82148bbda4a77c474dc9ccba | 1,861 | py | Python | app/views/arduino.py | yakinaround/myadventure-api | aae56a93748457c2f060434b9faf81830de5bc99 | [
"Apache-2.0"
] | null | null | null | app/views/arduino.py | yakinaround/myadventure-api | aae56a93748457c2f060434b9faf81830de5bc99 | [
"Apache-2.0"
] | 2 | 2021-03-31T18:30:32.000Z | 2021-12-13T19:44:07.000Z | app/views/arduino.py | myadventure/myadventure-api | aae56a93748457c2f060434b9faf81830de5bc99 | [
"Apache-2.0"
] | null | null | null | """
android.py
Android views.
"""
import logging
from datetime import datetime
from flask import Blueprint, abort, request, jsonify
from werkzeug.exceptions import BadRequest
from app.decorators import crossdomain, ignore_exception
from app.models.adventure import Adventure
from app.models.point import Point
SFLOAT... | 30.508197 | 99 | 0.612574 | """
android.py
Android views.
"""
import logging
from datetime import datetime
from flask import Blueprint, abort, request, jsonify
from werkzeug.exceptions import BadRequest
from app.decorators import crossdomain, ignore_exception
from app.models.adventure import Adventure
from app.models.point import Point
SFLOAT... | 0 | 0 | 0 |
625140e4b32448c38225b930dd958630e387c909 | 1,231 | py | Python | models/embedding.py | woo1/Anim-NeRF | 03977700420691b18b6aa0bc809f3a05a9f07b12 | [
"MIT"
] | 130 | 2021-09-07T15:37:42.000Z | 2022-03-30T16:22:50.000Z | models/embedding.py | woo1/Anim-NeRF | 03977700420691b18b6aa0bc809f3a05a9f07b12 | [
"MIT"
] | 18 | 2021-11-24T05:01:50.000Z | 2022-03-18T07:11:13.000Z | models/embedding.py | woo1/Anim-NeRF | 03977700420691b18b6aa0bc809f3a05a9f07b12 | [
"MIT"
] | 15 | 2022-01-21T10:26:41.000Z | 2022-03-30T08:32:12.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F | 31.564103 | 76 | 0.566206 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Embedding(nn.Module):
def __init__(self, in_channels, N_freqs, logscale=True):
"""
Defines a function that embeds x to (x, sin(2^k x), cos(2^k x), ...)
in_channels: number of input channels (3 for both xyz and directio... | 0 | 1,142 | 23 |
8281f6c429c581dacbd8c9cc2bf5636484bbc7fa | 989 | py | Python | flyer/fix.py | FIXFlyer/pyflyer | e40fdedff4db642a804ed6c29de742444ab0ffe5 | [
"MIT"
] | 2 | 2019-06-07T16:03:26.000Z | 2020-12-20T22:12:19.000Z | flyer/fix.py | mdvx/pyflyer | e40fdedff4db642a804ed6c29de742444ab0ffe5 | [
"MIT"
] | null | null | null | flyer/fix.py | mdvx/pyflyer | e40fdedff4db642a804ed6c29de742444ab0ffe5 | [
"MIT"
] | 4 | 2017-07-18T15:06:33.000Z | 2022-03-30T05:26:46.000Z | #! /usr/bin/env python
#-----------------------------------------------------------------------
# COPYRIGHT_BEGIN
# Copyright (C) 2016, FixFlyer, LLC.
# All rights reserved.
# COPYRIGHT_END
#-----------------------------------------------------------------------
| 21.5 | 88 | 0.517695 | #! /usr/bin/env python
#-----------------------------------------------------------------------
# COPYRIGHT_BEGIN
# Copyright (C) 2016, FixFlyer, LLC.
# All rights reserved.
# COPYRIGHT_END
#-----------------------------------------------------------------------
class Message(object):
def clear(self):
pas... | 378 | 1 | 347 |
e3f5fa29d31a1ca5ef53447a8be8495dc15d52a4 | 328 | py | Python | djangomom/account/views.py | emiamar/d | abfd0ca81224a1259fdfac92ed21ad771d901e18 | [
"BSD-3-Clause"
] | null | null | null | djangomom/account/views.py | emiamar/d | abfd0ca81224a1259fdfac92ed21ad771d901e18 | [
"BSD-3-Clause"
] | 2 | 2018-02-27T07:56:18.000Z | 2018-03-09T12:45:48.000Z | djangomom/account/views.py | emiamar/d | abfd0ca81224a1259fdfac92ed21ad771d901e18 | [
"BSD-3-Clause"
] | 2 | 2018-02-21T07:43:04.000Z | 2018-11-10T18:09:26.000Z | from django import forms
from .models import SignUp
from base.views import GenericModalCreateView
| 16.4 | 45 | 0.698171 | from django import forms
from .models import SignUp
from base.views import GenericModalCreateView
class SignUpForm(forms.ModelForm):
class Meta:
model = SignUp
fields = ('email', )
class SignUpView(GenericModalCreateView):
form_class = SignUpForm
success_url = '/'
object_name = '... | 0 | 180 | 46 |
167af61bf6438845997063a10538e46eff0df427 | 4,815 | py | Python | AI701/bbo_osi/example_submissions/turbo/optimizer.py | sungnyun/AI-assignments | 6451fd6db33fd8671ca362b4ad4c190979a98c22 | [
"MIT"
] | 103 | 2020-06-26T04:10:11.000Z | 2022-03-17T02:09:29.000Z | example_submissions/turbo/optimizer.py | ntienvu/bbo_challenge_starter_kit | bba852b380388c1f1087b232dae62117ddb065bf | [
"Apache-2.0"
] | 5 | 2020-07-12T16:49:42.000Z | 2021-07-21T23:26:22.000Z | example_submissions/turbo/optimizer.py | ntienvu/bbo_challenge_starter_kit | bba852b380388c1f1087b232dae62117ddb065bf | [
"Apache-2.0"
] | 35 | 2020-07-02T07:55:19.000Z | 2021-03-31T19:00:27.000Z | from copy import deepcopy
import numpy as np
import scipy.stats as ss
from turbo import Turbo1
from turbo.utils import from_unit_cube, latin_hypercube, to_unit_cube
from bayesmark.abstract_optimizer import AbstractOptimizer
from bayesmark.experiment import experiment_main
from bayesmark.space import JointSpace
i... | 36.755725 | 101 | 0.61703 | from copy import deepcopy
import numpy as np
import scipy.stats as ss
from turbo import Turbo1
from turbo.utils import from_unit_cube, latin_hypercube, to_unit_cube
from bayesmark.abstract_optimizer import AbstractOptimizer
from bayesmark.experiment import experiment_main
from bayesmark.space import JointSpace
def ... | 2,223 | 2,141 | 69 |
794bd7ed69e1e978e635f64a2d7412ba530be4c8 | 4,375 | py | Python | setup.py | PRITI1999/klever | ac80edf4301c15f6b63e35837f4ffbf7e3e68809 | [
"Apache-2.0"
] | 1 | 2021-01-09T08:44:37.000Z | 2021-01-09T08:44:37.000Z | setup.py | Abhik1998/klever | 827bbd31b29e213bf74cb1d1b158153e62a2933e | [
"Apache-2.0"
] | 3 | 2021-03-19T09:15:16.000Z | 2021-09-22T19:24:40.000Z | setup.py | Abhik1998/klever | 827bbd31b29e213bf74cb1d1b158153e62a2933e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# htt... | 35.282258 | 91 | 0.636343 | # Copyright (c) 2020 ISP RAS (http://www.ispras.ru)
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
#
# 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
#
# htt... | 422 | 0 | 46 |
28334f96479ecb761075604e60d6c1e5c3a15823 | 1,891 | py | Python | Lib/vanilla/test/list2/selection.py | roboDocs/vanilla | d8bb60b24edcc550c3d8cc60cf73143eee87d547 | [
"MIT"
] | 31 | 2015-02-09T09:09:26.000Z | 2019-01-01T19:04:52.000Z | Lib/vanilla/test/list2/selection.py | roboDocs/vanilla | d8bb60b24edcc550c3d8cc60cf73143eee87d547 | [
"MIT"
] | 63 | 2015-04-14T00:40:50.000Z | 2019-01-12T15:04:54.000Z | Lib/vanilla/test/list2/selection.py | roboDocs/vanilla | d8bb60b24edcc550c3d8cc60cf73143eee87d547 | [
"MIT"
] | 16 | 2015-03-28T21:00:22.000Z | 2018-08-17T20:28:53.000Z | import vanilla
if __name__ == "__main__":
from vanilla.test.testTools import executeVanillaTest
executeVanillaTest(Test)
| 27.405797 | 61 | 0.524061 | import vanilla
def makeItems():
items = []
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i, letter in enumerate(letters):
number = i + 1
item = dict(
letter=letter,
number=number
)
items.append(item)
return items
class Test:
def __init__(self)... | 1,669 | -10 | 100 |
76f55ae94b6824f6292bc5b3ea75cb7ecfa43f4f | 398 | py | Python | api/sonetworks/migrations/0016_remove_staticpage_page.py | gvaldez81/semitki | 6c7cbb2bb2260db79478de48a9b2e71b8ed633ff | [
"MIT"
] | null | null | null | api/sonetworks/migrations/0016_remove_staticpage_page.py | gvaldez81/semitki | 6c7cbb2bb2260db79478de48a9b2e71b8ed633ff | [
"MIT"
] | 51 | 2017-02-07T22:30:49.000Z | 2022-03-11T23:15:55.000Z | api/sonetworks/migrations/0016_remove_staticpage_page.py | gvaldez81/semitki | 6c7cbb2bb2260db79478de48a9b2e71b8ed633ff | [
"MIT"
] | 1 | 2017-10-09T14:21:35.000Z | 2017-10-09T14:21:35.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-30 20:21
from __future__ import unicode_literals
from django.db import migrations
| 19.9 | 50 | 0.61809 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-30 20:21
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0015_auto_20170330_2001'),
]
operations = [
migrations.RemoveField(
... | 0 | 227 | 23 |
f7b6ea0ae206265a155eeb220d8b4777db821527 | 13,540 | py | Python | bitsharesbase/operations.py | gdfbacchus/python-bitshares | 95f9cefab2f6b72073221bb647df8ab40bcf8e4b | [
"MIT"
] | null | null | null | bitsharesbase/operations.py | gdfbacchus/python-bitshares | 95f9cefab2f6b72073221bb647df8ab40bcf8e4b | [
"MIT"
] | null | null | null | bitsharesbase/operations.py | gdfbacchus/python-bitshares | 95f9cefab2f6b72073221bb647df8ab40bcf8e4b | [
"MIT"
] | 1 | 2018-11-20T03:50:25.000Z | 2018-11-20T03:50:25.000Z | from collections import OrderedDict
import json
from graphenebase.types import (
Uint8, Int16, Uint16, Uint32, Uint64,
Varint32, Int64, String, Bytes, Void,
Array, PointInTime, Signature, Bool,
Set, Fixed_array, Optional, Static_variant,
Map, Id, VoteId
)
from .objects import GrapheneObject, isArgsT... | 37.821229 | 99 | 0.511226 | from collections import OrderedDict
import json
from graphenebase.types import (
Uint8, Int16, Uint16, Uint32, Uint64,
Varint32, Int64, String, Bytes, Void,
Array, PointInTime, Signature, Bool,
Set, Fixed_array, Optional, Static_variant,
Map, Id, VoteId
)
from .objects import GrapheneObject, isArgsT... | 11,646 | 283 | 784 |