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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4ca8d914db8f80f1a127210560f44c395e212d78 | 1,213 | py | Python | setup.py | avmaint/obs-ws-rc | 8ff2c36bdd2ac1636feabb356864b9ebb20e9b30 | [
"MIT"
] | 38 | 2017-08-07T04:30:28.000Z | 2021-11-03T08:30:47.000Z | setup.py | avmaint/obs-ws-rc | 8ff2c36bdd2ac1636feabb356864b9ebb20e9b30 | [
"MIT"
] | 10 | 2017-09-20T11:21:41.000Z | 2021-09-27T22:56:22.000Z | setup.py | avmaint/obs-ws-rc | 8ff2c36bdd2ac1636feabb356864b9ebb20e9b30 | [
"MIT"
] | 13 | 2017-10-28T20:41:39.000Z | 2020-12-28T02:51:03.000Z | from pathlib import Path
from setuptools import setup
root = Path(__file__).parent.absolute()
with open(str(root / 'README.rst')) as f:
long_description = f.read()
setup(
name='obs-ws-rc',
version='2.3.0',
description=("asyncio-based Python 3.5+ client to obs-websocket "
"plugin ... | 21.280702 | 71 | 0.602638 | from pathlib import Path
from setuptools import setup
root = Path(__file__).parent.absolute()
with open(str(root / 'README.rst')) as f:
long_description = f.read()
setup(
name='obs-ws-rc',
version='2.3.0',
description=("asyncio-based Python 3.5+ client to obs-websocket "
"plugin ... | 0 | 0 | 0 |
db570ba3a1be2917db42a3105f080646ef9b30bc | 192 | py | Python | ida/daenerys_utils.py | daenerys-sre/source | e9175407d4f43b33e20a5d7060480a7659535874 | [
"MIT"
] | 296 | 2019-03-19T04:02:41.000Z | 2021-12-15T08:06:35.000Z | ida/daenerys_utils.py | daenerys-sre/source | e9175407d4f43b33e20a5d7060480a7659535874 | [
"MIT"
] | 1 | 2019-04-01T14:13:56.000Z | 2019-04-01T14:14:18.000Z | ida/daenerys_utils.py | daenerys-sre/source | e9175407d4f43b33e20a5d7060480a7659535874 | [
"MIT"
] | 24 | 2019-03-19T09:48:11.000Z | 2021-12-10T14:35:57.000Z | # Daenerys IDA/Ghidra interop framework
# by Elias Bachaalany <elias.bachaalany@gmail.com>
#
# Python utility functions
import numbers | 21.333333 | 50 | 0.786458 | # Daenerys IDA/Ghidra interop framework
# by Elias Bachaalany <elias.bachaalany@gmail.com>
#
# Python utility functions
import numbers
def is_number(n):
return isinstance(n, numbers.Number) | 34 | 0 | 23 |
ee0c68f70bcd626146ccf821e62ba39daab4b397 | 8,242 | py | Python | py_everything/sencrypt.py | tsukuyomm/py_everything | 1d0578670d5ae28f16711b92a9fc0f2ff5bf6897 | [
"MIT"
] | null | null | null | py_everything/sencrypt.py | tsukuyomm/py_everything | 1d0578670d5ae28f16711b92a9fc0f2ff5bf6897 | [
"MIT"
] | null | null | null | py_everything/sencrypt.py | tsukuyomm/py_everything | 1d0578670d5ae28f16711b92a9fc0f2ff5bf6897 | [
"MIT"
] | null | null | null | '''
Super Encrypt - Encryption Algorithm with 4 key encryption and decryption
__author__ = "PyBash"
__version__ = "v1.0.0"
'''
import random
from . import error
BASE_LETTERS = 'abcdefghijklmnopqrstuvwxyz'
BASE_SYMBOLS = ' 1234567890!@#$%^&*()-_=+[{]};:\'"<,>.?/`~|\\'
| 35.07234 | 77 | 0.545377 | '''
Super Encrypt - Encryption Algorithm with 4 key encryption and decryption
__author__ = "PyBash"
__version__ = "v1.0.0"
'''
import random
from . import error
BASE_LETTERS = 'abcdefghijklmnopqrstuvwxyz'
BASE_SYMBOLS = ' 1234567890!@#$%^&*()-_=+[{]};:\'"<,>.?/`~|\\'
def genCharKeys():
base = list(BASE_LETTERS)
... | 7,773 | 0 | 199 |
b4b57c521467495188566db029e82728527ac2ce | 21 | py | Python | devel/lib/python2.7/dist-packages/rosserial_mbed/srv/__init__.py | ankit131199/Rebellious-Cowards | 56ec395147f2fc59a26669a74a04fe02227bc7b7 | [
"BSD-2-Clause"
] | 3 | 2021-08-20T03:25:37.000Z | 2022-03-31T02:47:28.000Z | devel/lib/python2.7/dist-packages/rosserial_mbed/srv/__init__.py | ankit131199/Rebellious-Cowards | 56ec395147f2fc59a26669a74a04fe02227bc7b7 | [
"BSD-2-Clause"
] | 30 | 2020-11-27T23:12:12.000Z | 2021-04-25T15:37:42.000Z | devel/lib/python2.7/dist-packages/rosserial_mbed/srv/__init__.py | ankit131199/Rebellious-Cowards | 56ec395147f2fc59a26669a74a04fe02227bc7b7 | [
"BSD-2-Clause"
] | 3 | 2020-10-01T15:22:00.000Z | 2020-10-01T17:06:55.000Z | from ._Test import *
| 10.5 | 20 | 0.714286 | from ._Test import *
| 0 | 0 | 0 |
39862178fd723b90f84b5890435898f345b96a59 | 4,479 | py | Python | Exercises.py | cnaseeb/Pythonify | c4f2206e660f5edf2b069b6cfb9a4b504cb6c685 | [
"Apache-2.0"
] | null | null | null | Exercises.py | cnaseeb/Pythonify | c4f2206e660f5edf2b069b6cfb9a4b504cb6c685 | [
"Apache-2.0"
] | null | null | null | Exercises.py | cnaseeb/Pythonify | c4f2206e660f5edf2b069b6cfb9a4b504cb6c685 | [
"Apache-2.0"
] | null | null | null | # The code below almost works
name = input("Enter your name")
print("Hello", name)
##2
# This first line is provided for you
hrs = input("Enter Hours:")
# hrs = float(hrs) #use the one in line 9 instead
ratePerHour = input("Enter rate per hour:")
# rateperHour = float(ratePerHour) #use the one in line 9 instead
# y... | 29.084416 | 189 | 0.652154 | # The code below almost works
name = input("Enter your name")
print("Hello", name)
##2
# This first line is provided for you
hrs = input("Enter Hours:")
# hrs = float(hrs) #use the one in line 9 instead
ratePerHour = input("Enter rate per hour:")
# rateperHour = float(ratePerHour) #use the one in line 9 instead
# y... | 520 | 0 | 23 |
9a50bec54ba634d2c7dab08f7f2245948c044388 | 5,352 | py | Python | setup.py | kenzanlabs/spinikube | 07850a30769139c846e187aeeee9f0d24dce897e | [
"Apache-2.0"
] | 113 | 2016-09-03T02:53:37.000Z | 2021-04-20T00:18:49.000Z | setup.py | kenzanlabs/spinikube | 07850a30769139c846e187aeeee9f0d24dce897e | [
"Apache-2.0"
] | 27 | 2016-08-04T20:28:41.000Z | 2018-08-22T10:04:15.000Z | setup.py | kenzanlabs/spinikube | 07850a30769139c846e187aeeee9f0d24dce897e | [
"Apache-2.0"
] | 47 | 2016-08-16T15:34:17.000Z | 2020-06-13T17:57:37.000Z | #!/usr/local/bin/python
import os
import time
import collections
import subprocess
o("minikube delete")
o("minikube start --memory 10000 --cpus 4 --disk-size=60g")
#o("kubectl delete namespace spinnaker")
#time.sleep(30)
o("kubectl create namespace spinnaker")
c("applications/kubedash/bundle.yaml")
c("application... | 28.92973 | 302 | 0.678812 | #!/usr/local/bin/python
import os
import time
import collections
import subprocess
def cmdOut(cmd):
return subprocess.check_output(cmd, shell=True).strip()
def poll():
creating = "ContainerCreating"
while creating.find("ContainerCreating") != -1:
creating = cmdOut("kubectl get pods --all-namespaces")
o... | 457 | 0 | 115 |
e9a7d2f66b4f8dbaa2eb22e345ef51c2d6c7fe14 | 2,360 | py | Python | src/Line.py | npanuhin/BIOCAD-BWA | 50f56fd7d08b8ad1247934c902fb137f3c28cdf8 | [
"MIT"
] | null | null | null | src/Line.py | npanuhin/BIOCAD-BWA | 50f56fd7d08b8ad1247934c902fb137f3c28cdf8 | [
"MIT"
] | null | null | null | src/Line.py | npanuhin/BIOCAD-BWA | 50f56fd7d08b8ad1247934c902fb137f3c28cdf8 | [
"MIT"
] | null | null | null | from typing import List
from collections import deque
class Line:
"""
Properties:
start_x {0}
start_y {1}
end_x {2}
end_y {3}
dots = [dot1, ..., dotN] {4}
coords = (start_x, start_y, end_x, end_y)
"""
@property
# @property
# def x1(self... | 25.106383 | 84 | 0.555932 | from typing import List
from collections import deque
class Line:
"""
Properties:
start_x {0}
start_y {1}
end_x {2}
end_y {3}
dots = [dot1, ..., dotN] {4}
coords = (start_x, start_y, end_x, end_y)
"""
def __init__(self, start_x=None, start_y=Non... | 1,434 | 0 | 315 |
84581387c769a73a11b21a07890f917ea1153434 | 11,312 | py | Python | Interfaz/UIPyfiles/VistaAnalisisDatos.py | Dumaru/ExcelReports | 989d8864d77e2b84dc73f16205894a6afa8e11ab | [
"MIT"
] | 1 | 2020-10-16T19:54:17.000Z | 2020-10-16T19:54:17.000Z | Interfaz/UIPyfiles/VistaAnalisisDatos.py | Dumaru/ExcelReports | 989d8864d77e2b84dc73f16205894a6afa8e11ab | [
"MIT"
] | null | null | null | Interfaz/UIPyfiles/VistaAnalisisDatos.py | Dumaru/ExcelReports | 989d8864d77e2b84dc73f16205894a6afa8e11ab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\VistaAnalisisDatos.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from UI.Recursos import images_rc
# import DATOS IMAGENES_rc
if _... | 57.714286 | 144 | 0.726397 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\VistaAnalisisDatos.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from UI.Recursos import images_rc
class Ui_VistaAnalisisDatos(obje... | 10,647 | 15 | 76 |
0e510ebbd43fbd50d21e92622e59d0b9da6eb08e | 120 | py | Python | mtproxy/proxy/streams/wappers/__init__.py | i-Naji/mtproxy | b8fe68023cf35bc6bc8e96d797f1f39304d4e5fa | [
"MIT"
] | 16 | 2019-06-21T11:26:26.000Z | 2021-03-14T08:06:36.000Z | mtproxy/proxy/streams/wappers/__init__.py | WhymustIhaveaname/mtproxy | b8fe68023cf35bc6bc8e96d797f1f39304d4e5fa | [
"MIT"
] | 2 | 2020-02-27T16:25:41.000Z | 2021-03-14T08:31:14.000Z | mtproxy/proxy/streams/wappers/__init__.py | WhymustIhaveaname/mtproxy | b8fe68023cf35bc6bc8e96d797f1f39304d4e5fa | [
"MIT"
] | 4 | 2019-06-21T15:59:56.000Z | 2021-03-17T04:54:42.000Z | from .crypto_stream_reader import CryptoWrappedStreamReader
from .crypto_stream_writer import CryptoWrappedStreamWriter
| 40 | 59 | 0.916667 | from .crypto_stream_reader import CryptoWrappedStreamReader
from .crypto_stream_writer import CryptoWrappedStreamWriter
| 0 | 0 | 0 |
541297fe7105352dad73ba97488ae9bb7f7fcee2 | 947 | py | Python | docs/plots/extended/stereographic/mobius_add.py | SsnL/geoopt | 47e7e6b79c177e3172161afaef8424d61b917a7b | [
"Apache-2.0"
] | 438 | 2019-03-05T11:24:03.000Z | 2022-03-31T14:46:42.000Z | docs/plots/extended/stereographic/mobius_add.py | SsnL/geoopt | 47e7e6b79c177e3172161afaef8424d61b917a7b | [
"Apache-2.0"
] | 98 | 2019-03-07T21:38:24.000Z | 2022-03-25T10:48:45.000Z | docs/plots/extended/stereographic/mobius_add.py | SsnL/geoopt | 47e7e6b79c177e3172161afaef8424d61b917a7b | [
"Apache-2.0"
] | 58 | 2019-04-13T04:52:16.000Z | 2022-03-14T09:26:00.000Z | from geoopt import Stereographic
import torch
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import rcParams
import shutil
if shutil.which("latex") is not None:
rcParams["text.latex.preamble"] = r"\usepackage{amsmath}"
rcParams["text.usetex"] = True
sns.set_style("white")
x = torch.ten... | 27.057143 | 79 | 0.673706 | from geoopt import Stereographic
import torch
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import rcParams
import shutil
if shutil.which("latex") is not None:
rcParams["text.latex.preamble"] = r"\usepackage{amsmath}"
rcParams["text.usetex"] = True
sns.set_style("white")
x = torch.ten... | 0 | 0 | 0 |
3c6171802f81af4f59089aacf6f1c0531e686ce7 | 8,224 | py | Python | project/forms.py | Make-Munich/SaBoT | cabc7e2f5e0f7166d94d2ef683f75d8d3be02834 | [
"MIT"
] | null | null | null | project/forms.py | Make-Munich/SaBoT | cabc7e2f5e0f7166d94d2ef683f75d8d3be02834 | [
"MIT"
] | null | null | null | project/forms.py | Make-Munich/SaBoT | cabc7e2f5e0f7166d94d2ef683f75d8d3be02834 | [
"MIT"
] | null | null | null | from django import forms
from models import Project
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Field, Submit, Div, HTML, ButtonHolder
from crispy_forms.bootstrap import FormActions, StrictButton, TabHolder, Tab, PrependedText, InlineCheckboxes, InlineField
import requests
from dj... | 33.843621 | 301 | 0.680691 | from django import forms
from models import Project
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Field, Submit, Div, HTML, ButtonHolder
from crispy_forms.bootstrap import FormActions, StrictButton, TabHolder, Tab, PrependedText, InlineCheckboxes, InlineField
import requests
from dj... | 6,259 | 1,364 | 138 |
4d52788cd7cfccd02577ac558846c01bff961277 | 1,560 | py | Python | 2/CH2_NN.py | ys19931127/TensorFlow | 814ae734db5c252ff8dc5a503523b23ea0661ee3 | [
"MIT"
] | 270 | 2016-11-21T13:54:44.000Z | 2022-02-18T01:50:49.000Z | 2/CH2_NN.py | ys19931127/TensorFlow | 814ae734db5c252ff8dc5a503523b23ea0661ee3 | [
"MIT"
] | 12 | 2016-12-28T00:06:09.000Z | 2021-09-29T06:19:24.000Z | 2/CH2_NN.py | ys19931127/TensorFlow | 814ae734db5c252ff8dc5a503523b23ea0661ee3 | [
"MIT"
] | 192 | 2016-11-21T13:54:47.000Z | 2021-11-25T08:33:18.000Z | import tensorflow as tf
import numpy as np
import time
import matplotlib
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_circles
N=210
K=2
# Maximum number of iterations, if the conditions are not met
MAX_ITERS = 1000
cut=int(N*0.7)
start = time.time()
data, features = make_circ... | 27.857143 | 121 | 0.721154 | import tensorflow as tf
import numpy as np
import time
import matplotlib
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_circles
N=210
K=2
# Maximum number of iterations, if the conditions are not met
MAX_ITERS = 1000
cut=int(N*0.7)
start = time.time()
data, features = make_circ... | 0 | 0 | 0 |
1fdce70173b0951074f03a0d68e77c0cc775a0fc | 2,936 | py | Python | ds/graph.py | BaiqiangGit/Data-Structure-and-Algorithms---Python3 | 964a41f210356b8d7b192bf54a2a1eb9a754b19e | [
"Apache-2.0"
] | 2 | 2021-01-14T08:58:05.000Z | 2021-11-25T21:25:16.000Z | ds/graph.py | BaiqiangGit/Data-Structure-and-Algorithms---Python3 | 964a41f210356b8d7b192bf54a2a1eb9a754b19e | [
"Apache-2.0"
] | null | null | null | ds/graph.py | BaiqiangGit/Data-Structure-and-Algorithms---Python3 | 964a41f210356b8d7b192bf54a2a1eb9a754b19e | [
"Apache-2.0"
] | 1 | 2021-01-14T08:58:06.000Z | 2021-01-14T08:58:06.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
## Baiqiang XIA implementation of data structures
## Graph represented as Adjacency List
## init
## add Edge
## print
## bread first search (traversal), assuming all node are connected
## the task is to visit all the nodes... | 31.913043 | 92 | 0.531676 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
## Baiqiang XIA implementation of data structures
## Graph represented as Adjacency List
class directedGraph(object):
## init
def __init__(self):
self.graph = {} ## adjacency diction
## add Edge
def addEdge(self, fromVertex, toVertex):
... | 2,220 | 7 | 213 |
a84fec674e866f8507cbef9561c482b7154ff4c0 | 244 | py | Python | codeforces/math数学/1000/1359A摸大王.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/1000/1359A摸大王.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/1000/1359A摸大王.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# https://codeforces.com/problemset/problem/1359/A
t = int(input())
for _ in range(t):
n,m,k = list(map(int,input().split()))
winner = min(n//k,m)
second = (m-winner+k-2)//(k-1)
print(winner-second)
| 22.181818 | 50 | 0.598361 | #!/usr/bin/env python3
# https://codeforces.com/problemset/problem/1359/A
t = int(input())
for _ in range(t):
n,m,k = list(map(int,input().split()))
winner = min(n//k,m)
second = (m-winner+k-2)//(k-1)
print(winner-second)
| 0 | 0 | 0 |
bc3140a00caacc8db57f94c6a0db831bee8d9301 | 244 | py | Python | p16.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | p16.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | p16.py | nymoral/euler | 9dcc1bb6c733e3164e06e97f2363993fb932f5fc | [
"MIT"
] | null | null | null | """
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2^1000?
"""
if __name__ == "__main__":
print(sum_digits(2**1000))
| 22.181818 | 65 | 0.618852 | """
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2^1000?
"""
def sum_digits(n):
return sum(int(x) for x in str(n))
if __name__ == "__main__":
print(sum_digits(2**1000))
| 36 | 0 | 23 |
8d1c1db8400e459c9493cf2d5adb601c5b5910b4 | 2,083 | py | Python | examples/fitbit_interday/sleep_dataset.py | qcri/tasrif | 327bc1eccb8f8e11d8869ba65a7c72ad038aa094 | [
"BSD-3-Clause"
] | 20 | 2021-12-06T10:41:54.000Z | 2022-03-13T16:25:43.000Z | examples/fitbit_interday/sleep_dataset.py | qcri/tasrif | 327bc1eccb8f8e11d8869ba65a7c72ad038aa094 | [
"BSD-3-Clause"
] | 33 | 2021-12-06T08:27:18.000Z | 2022-03-14T05:07:53.000Z | examples/fitbit_interday/sleep_dataset.py | qcri/tasrif | 327bc1eccb8f8e11d8869ba65a7c72ad038aa094 | [
"BSD-3-Clause"
] | 2 | 2022-02-07T08:06:48.000Z | 2022-02-14T07:13:42.000Z | import os
from tasrif.data_readers.fitbit_interday_dataset import FitbitInterdayDataset
from tasrif.processing_pipeline import SequenceOperator
from tasrif.processing_pipeline.custom import AggregateOperator, CreateFeatureOperator
from tasrif.processing_pipeline.pandas import (
ConvertToDatetimeOperator,
SetIn... | 30.188406 | 90 | 0.662506 | import os
from tasrif.data_readers.fitbit_interday_dataset import FitbitInterdayDataset
from tasrif.processing_pipeline import SequenceOperator
from tasrif.processing_pipeline.custom import AggregateOperator, CreateFeatureOperator
from tasrif.processing_pipeline.pandas import (
ConvertToDatetimeOperator,
SetIn... | 0 | 0 | 0 |
c3a0dd529b678d2984acd9b3350424464c379f44 | 311 | py | Python | landing/serializers.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | landing/serializers.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | landing/serializers.py | cactus-computing/product-recommendation | b5d9bb27205a4fb032fd19934ecab56a5a8c6d81 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from landing.models import Contact
import re
from rest_framework.response import Response
#from store.models import Store
| 28.272727 | 54 | 0.755627 | from rest_framework import serializers
from landing.models import Contact
import re
from rest_framework.response import Response
#from store.models import Store
class ContactSerializer(serializers.ModelSerializer):
class Meta:
model = Contact
fields = ("name", "email", "phone", "website") | 0 | 127 | 23 |
635c5fa8734b68f1c1a855e1daaac1237bea340e | 17,944 | py | Python | app/searchcom/callbacks.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | null | null | null | app/searchcom/callbacks.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | 1 | 2021-04-20T14:56:31.000Z | 2021-04-20T14:56:31.000Z | app/searchcom/callbacks.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | null | null | null | """
Dash callbacks
Only applicant and posting data depend on the requisition number value
Pipeline and subfield data depend on the posting data
Callback chain:
Requisition number dropdown value changes
-> applicant data and posting data load
---> pipeline and subfield data load
-----> charts and footers load
"""
# T... | 41.730233 | 170 | 0.534329 | """
Dash callbacks
Only applicant and posting data depend on the requisition number value
Pipeline and subfield data depend on the posting data
Callback chain:
Requisition number dropdown value changes
-> applicant data and posting data load
---> pipeline and subfield data load
-----> charts and footers load
"""
# T... | 16,228 | 0 | 23 |
6e1f0cddd752d2501ab71db2277d2b19c88f128c | 656 | py | Python | tracks/views.py | daatrujillopu/Sfotipy | b77466b0b04b1f47b02b66a51b00df0be9b136bc | [
"MIT"
] | null | null | null | tracks/views.py | daatrujillopu/Sfotipy | b77466b0b04b1f47b02b66a51b00df0be9b136bc | [
"MIT"
] | null | null | null | tracks/views.py | daatrujillopu/Sfotipy | b77466b0b04b1f47b02b66a51b00df0be9b136bc | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404
import json
# Create your views here.
from .models import Track | 32.8 | 67 | 0.664634 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404
import json
# Create your views here.
from .models import Track
def track_view(request, title):
track = get_object_or_404(Track, title=title)
data = {
'title': track.title,
'order': track.order,... | 469 | 0 | 23 |
f67f538e988db0543b692f179b047d468a68118b | 3,132 | py | Python | apps/cp2k/reframe_cp2k.py | stackhpc/nrel-benchmarks | 07e1078590c1668d3d9da6ab98eccfbbf9c5310a | [
"Apache-2.0"
] | null | null | null | apps/cp2k/reframe_cp2k.py | stackhpc/nrel-benchmarks | 07e1078590c1668d3d9da6ab98eccfbbf9c5310a | [
"Apache-2.0"
] | null | null | null | apps/cp2k/reframe_cp2k.py | stackhpc/nrel-benchmarks | 07e1078590c1668d3d9da6ab98eccfbbf9c5310a | [
"Apache-2.0"
] | null | null | null | """ Performance test using CP2K quantum chemistry and solid state physics software package for atomistic simulations.
See README.md for details.
NB:
- The executable is either cp2k.popt (for MPI only) or cp2k.psmp (for MPI + OpenMP).
- Only the former is currently implemented here.
"""
import reframe... | 41.76 | 125 | 0.604087 | """ Performance test using CP2K quantum chemistry and solid state physics software package for atomistic simulations.
See README.md for details.
NB:
- The executable is either cp2k.popt (for MPI only) or cp2k.psmp (for MPI + OpenMP).
- Only the former is currently implemented here.
"""
import reframe... | 2,105 | 25 | 49 |
9c93d549439c3cccb498a651bfc4df35dba94430 | 1,817 | py | Python | base/config.py | northwestern-mti/CeNDR-1 | 9d8f9d9a9fba7f4304202094c48bc5f80baf8e71 | [
"MIT"
] | null | null | null | base/config.py | northwestern-mti/CeNDR-1 | 9d8f9d9a9fba7f4304202094c48bc5f80baf8e71 | [
"MIT"
] | 2 | 2021-04-21T15:34:04.000Z | 2021-05-04T20:29:39.000Z | base/config.py | northwestern-mti/CeNDR-1 | 9d8f9d9a9fba7f4304202094c48bc5f80baf8e71 | [
"MIT"
] | null | null | null | # Application Configuration
import os
import yaml
from base.utils.data_utils import json_encoder
# CeNDR Version
APP_CONFIG, CENDR_VERSION = os.environ['GAE_VERSION'].split("-", 1)
if APP_CONFIG not in ['development', 'master']:
APP_CONFIG = 'development'
CENDR_VERSION = CENDR_VERSION.replace("-", '.')
# BUILDS A... | 30.79661 | 87 | 0.681343 | # Application Configuration
import os
import yaml
from base.utils.data_utils import json_encoder
# CeNDR Version
APP_CONFIG, CENDR_VERSION = os.environ['GAE_VERSION'].split("-", 1)
if APP_CONFIG not in ['development', 'master']:
APP_CONFIG = 'development'
CENDR_VERSION = CENDR_VERSION.replace("-", '.')
# BUILDS A... | 56 | 0 | 23 |
777beac9ae08c62f39158657df84701c5b5b92be | 1,477 | py | Python | recipes/blood_cells/object_detection/train.py | lbolanos/HugsVision | c9b1708928916bc413a795590d731308ea8c582b | [
"MIT"
] | 154 | 2021-08-14T00:09:15.000Z | 2022-03-16T02:42:01.000Z | recipes/blood_cells/object_detection/train.py | lbolanos/HugsVision | c9b1708928916bc413a795590d731308ea8c582b | [
"MIT"
] | 36 | 2021-08-13T23:42:15.000Z | 2022-03-31T03:57:23.000Z | recipes/blood_cells/object_detection/train.py | lbolanos/HugsVision | c9b1708928916bc413a795590d731308ea8c582b | [
"MIT"
] | 12 | 2021-09-04T00:49:35.000Z | 2022-02-24T13:20:54.000Z | import argparse
from hugsvision.nnet.ObjectDetectionTrainer import ObjectDetectionTrainer
parser = argparse.ArgumentParser(description='Object Detection')
parser.add_argument('--name', type=str, default="MyDETRModel", help='The name of the model')
parser.add_argument('--train', type=str, default="./BCCD_COCO/tr... | 43.441176 | 151 | 0.738659 | import argparse
from hugsvision.nnet.ObjectDetectionTrainer import ObjectDetectionTrainer
parser = argparse.ArgumentParser(description='Object Detection')
parser.add_argument('--name', type=str, default="MyDETRModel", help='The name of the model')
parser.add_argument('--train', type=str, default="./BCCD_COCO/tr... | 0 | 0 | 0 |
673d9575322508e179fee0b5f4ca442afccabd22 | 16,575 | py | Python | montepython/PolyChord.py | fkoehlin/montepython_2cosmos_public | 9901eaad8fb2497eb8fd899ec2a40c405e421d98 | [
"MIT"
] | 2 | 2019-02-14T18:44:52.000Z | 2020-04-06T10:25:31.000Z | montepython/PolyChord.py | fkoehlin/montepython_2cosmos_public | 9901eaad8fb2497eb8fd899ec2a40c405e421d98 | [
"MIT"
] | 2 | 2019-07-10T13:49:38.000Z | 2019-08-07T16:00:31.000Z | montepython/PolyChord.py | fkoehlin/montepython_2cosmos_public | 9901eaad8fb2497eb8fd899ec2a40c405e421d98 | [
"MIT"
] | null | null | null | """
.. module:: PolyChord
:synopsis: Interface the PolyChord program with MontePython
This implementation relies heavily on the existing Python wrapper for
PolyChord, called PyPolyChord, which comes with the PolyChord code.
To install PolyChord, download it from
`its GitHub repo <https://github.com/PolyChord/Poly... | 34.245868 | 119 | 0.614057 | """
.. module:: PolyChord
:synopsis: Interface the PolyChord program with MontePython
This implementation relies heavily on the existing Python wrapper for
PolyChord, called PyPolyChord, which comes with the PolyChord code.
To install PolyChord, download it from
`its GitHub repo <https://github.com/PolyChord/Poly... | 0 | 0 | 0 |
71f3a33777560c44b8e78c3aa4322f9ac1433b34 | 1,226 | py | Python | services/ldnormaliser/servicer.py | SailSlick/rabble | 8da1705d15d265abf8c3173851d8894a309c955b | [
"MIT"
] | null | null | null | services/ldnormaliser/servicer.py | SailSlick/rabble | 8da1705d15d265abf8c3173851d8894a309c955b | [
"MIT"
] | null | null | null | services/ldnormaliser/servicer.py | SailSlick/rabble | 8da1705d15d265abf8c3173851d8894a309c955b | [
"MIT"
] | null | null | null | import json
from pyld import jsonld
from services.proto import ldnorm_pb2_grpc
from services.proto import ldnorm_pb2 as lpb2
from services.proto import general_pb2
| 35.028571 | 78 | 0.655791 | import json
from pyld import jsonld
from services.proto import ldnorm_pb2_grpc
from services.proto import ldnorm_pb2 as lpb2
from services.proto import general_pb2
class LDNormServicer(ldnorm_pb2_grpc.LDNormServicer):
def __init__(self, logger):
self._logger = logger
requests = jsonld.requests_do... | 925 | 32 | 103 |
6ce0196b579de3a6a9f29c8aeebefeb7079eb496 | 607 | py | Python | GameOfLife/__init__.py | JnyJny/GameOfLife | 5df27fa0b288466b779a9a89590b3e9b022583d2 | [
"MIT"
] | 21 | 2016-06-29T20:50:01.000Z | 2022-03-08T03:38:30.000Z | GameOfLife/__init__.py | JnyJny/GameOfLife | 5df27fa0b288466b779a9a89590b3e9b022583d2 | [
"MIT"
] | null | null | null | GameOfLife/__init__.py | JnyJny/GameOfLife | 5df27fa0b288466b779a9a89590b3e9b022583d2 | [
"MIT"
] | 5 | 2016-06-29T20:50:16.000Z | 2021-06-02T10:10:12.000Z | '''Conway's Game of Life
See: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
This particular Game of Life is implemented as a two dimensional
world populated with cells.
'''
__author__ = '\n'.join(["Erik O'Shaughnessy",
'erik.oshaughnessy@gmail.com',
'https://gi... | 27.590909 | 64 | 0.678748 | '''Conway's Game of Life
See: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
This particular Game of Life is implemented as a two dimensional
world populated with cells.
'''
__author__ = '\n'.join(["Erik O'Shaughnessy",
'erik.oshaughnessy@gmail.com',
'https://gi... | 0 | 0 | 0 |
c31e92f37d0b6f7546db17b2925dd74a6087d199 | 8,109 | py | Python | mybitbank/libs/entities/coinaccount.py | kahazazzu/mybitbank | 945e604e5fee3914c7c98a25c2c34831ba0ad946 | [
"MIT"
] | 15 | 2015-08-29T12:35:59.000Z | 2018-02-06T06:26:26.000Z | mybitbank/libs/entities/coinaccount.py | FireWalkerX/mybitbank | 945e604e5fee3914c7c98a25c2c34831ba0ad946 | [
"MIT"
] | null | null | null | mybitbank/libs/entities/coinaccount.py | FireWalkerX/mybitbank | 945e604e5fee3914c7c98a25c2c34831ba0ad946 | [
"MIT"
] | 19 | 2015-02-03T21:32:51.000Z | 2021-11-06T12:08:26.000Z | """
The MIT License (MIT)
Copyright (c) 2016 Stratos Goudelis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | 33.7875 | 137 | 0.60735 | """
The MIT License (MIT)
Copyright (c) 2016 Stratos Goudelis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | 383 | 0 | 31 |
ced18a94b7867a0d537b815e9378c0be5f8d23c8 | 1,226 | py | Python | week_3/POO_livros.py | angelitabrg/lih_lab_python2 | 88d19d20704552e1a82c29793073e59dcf4b78c6 | [
"MIT"
] | null | null | null | week_3/POO_livros.py | angelitabrg/lih_lab_python2 | 88d19d20704552e1a82c29793073e59dcf4b78c6 | [
"MIT"
] | null | null | null | week_3/POO_livros.py | angelitabrg/lih_lab_python2 | 88d19d20704552e1a82c29793073e59dcf4b78c6 | [
"MIT"
] | null | null | null |
main() | 43.785714 | 145 | 0.614192 | def main(self):
livro1 = Livros_lidos('Eleanor & Park', 'Rainbow Rowell', 2012, 5, 3.99)
livro2 = Livros_lidos('O mito da beleza', 'Naomi Wolf', 1990, 4.5, 3.90)
livro3 = Livros_lidos('21 Lessons for the 21st Century', 'Yuval Noah Harari', 2018, 4.75, 4.17)
livro4 = Livros_lidos('In the Penal Colony', '... | 1,126 | -2 | 98 |
0d0d20b8d1fe4a06cb81c806169aa0a616284346 | 382 | py | Python | school/simpleApi/migrations/0007_alter_gradeable_student.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | school/simpleApi/migrations/0007_alter_gradeable_student.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | school/simpleApi/migrations/0007_alter_gradeable_student.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-07 22:45
from django.db import migrations, models
| 20.105263 | 49 | 0.596859 | # Generated by Django 3.2.4 on 2021-07-07 22:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('simpleApi', '0006_auto_20210707_2119'),
]
operations = [
migrations.AlterField(
model_name='gradeable',
name='studen... | 0 | 268 | 23 |
552249907b4b1b3ba5dc30b9255b8c99440d938a | 51 | py | Python | python/191108_python_review/datatype.py | hbyyy/TIL | e89ae2913a8a38eb7f480a9ec2324c3ac11e309e | [
"MIT"
] | null | null | null | python/191108_python_review/datatype.py | hbyyy/TIL | e89ae2913a8a38eb7f480a9ec2324c3ac11e309e | [
"MIT"
] | 1 | 2022-03-26T07:50:54.000Z | 2022-03-26T07:50:54.000Z | python/191108_python_review/datatype.py | hbyyy/TIL | e89ae2913a8a38eb7f480a9ec2324c3ac11e309e | [
"MIT"
] | null | null | null | a = {'a': 1, 'b' : 2}
b = list(a.items())
print(b)
| 12.75 | 21 | 0.431373 | a = {'a': 1, 'b' : 2}
b = list(a.items())
print(b)
| 0 | 0 | 0 |
944fe4b4d75c9a0c4096ba02d7a1fe92bd4513de | 2,968 | py | Python | main.py | manacute/Runtime-Terror-C4 | 6c9d9246090c32077bc4425c75e80f485037fe3e | [
"Apache-2.0"
] | null | null | null | main.py | manacute/Runtime-Terror-C4 | 6c9d9246090c32077bc4425c75e80f485037fe3e | [
"Apache-2.0"
] | null | null | null | main.py | manacute/Runtime-Terror-C4 | 6c9d9246090c32077bc4425c75e80f485037fe3e | [
"Apache-2.0"
] | null | null | null | import pygame, sys
from Move import Move
from BoardModel import BoardModel
from MoveController import MoveController
from HelpModel import HelpModel
from MenuModel import MenuModel
from Model import Model
'''
CSC290 Group Project
C4: Four In A Row
University of Toronto Mississauga
'''
class Game():
'''
Base g... | 31.242105 | 79 | 0.618598 | import pygame, sys
from Move import Move
from BoardModel import BoardModel
from MoveController import MoveController
from HelpModel import HelpModel
from MenuModel import MenuModel
from Model import Model
'''
CSC290 Group Project
C4: Four In A Row
University of Toronto Mississauga
'''
class Game():
'''
Base g... | 0 | 0 | 0 |
bb981e8b64818ad0fa1689a93c7582162a9771aa | 2,326 | py | Python | cauldron/test/cli/commands/test_steps_insert.py | JohnnyPeng18/cauldron | 09120c2a4cef65df46f8c0c94f5d79395b3298cd | [
"MIT"
] | 90 | 2016-09-02T15:11:10.000Z | 2022-01-02T11:37:57.000Z | cauldron/test/cli/commands/test_steps_insert.py | JohnnyPeng18/cauldron | 09120c2a4cef65df46f8c0c94f5d79395b3298cd | [
"MIT"
] | 86 | 2016-09-23T16:52:22.000Z | 2022-03-31T21:39:56.000Z | cauldron/test/cli/commands/test_steps_insert.py | JohnnyPeng18/cauldron | 09120c2a4cef65df46f8c0c94f5d79395b3298cd | [
"MIT"
] | 261 | 2016-12-22T05:36:48.000Z | 2021-11-26T12:40:42.000Z | import cauldron
from cauldron.test import support
from cauldron.test.support import scaffolds
class TestStepsInsert(scaffolds.ResultsTest):
"""..."""
def test_before(self):
"""Should properly rename default filenames."""
support.create_project(self, 'candice')
support.add_step(self)
... | 34.205882 | 62 | 0.662511 | import cauldron
from cauldron.test import support
from cauldron.test.support import scaffolds
class TestStepsInsert(scaffolds.ResultsTest):
"""..."""
def test_before(self):
"""Should properly rename default filenames."""
support.create_project(self, 'candice')
support.add_step(self)
... | 0 | 0 | 0 |
b5a9c66b94d0c7027220e3333efdb755dfe9e90b | 284 | py | Python | grb/defense/base.py | Stanislas0/grb | 96fc521f57fdb06ab6a3c442fcf4a8bc97894829 | [
"MIT"
] | null | null | null | grb/defense/base.py | Stanislas0/grb | 96fc521f57fdb06ab6a3c442fcf4a8bc97894829 | [
"MIT"
] | null | null | null | grb/defense/base.py | Stanislas0/grb | 96fc521f57fdb06ab6a3c442fcf4a8bc97894829 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
| 17.75 | 54 | 0.56338 | from abc import ABCMeta, abstractmethod
class Defense(metaclass=ABCMeta):
@abstractmethod
def defense(self, model, adj, features, **kwargs):
"""
:param model:
:param features:
:param adj:
:param kwargs:
:return:
"""
| 0 | 220 | 23 |
230a51a7ddf70165298befece4dc77ccda252454 | 24,386 | py | Python | bin/FMU-QSS.gen.py | NREL/SOEP-QSS | 354df458f6eaf13e9f0271eccd747047ab4f0f71 | [
"BSD-3-Clause"
] | 13 | 2017-08-04T15:15:59.000Z | 2022-03-24T06:02:22.000Z | bin/FMU-QSS.gen.py | NREL/SOEP-QSS | 354df458f6eaf13e9f0271eccd747047ab4f0f71 | [
"BSD-3-Clause"
] | 4 | 2021-08-19T01:56:30.000Z | 2021-08-23T01:41:36.000Z | bin/FMU-QSS.gen.py | NREL/SOEP-QSS | 354df458f6eaf13e9f0271eccd747047ab4f0f71 | [
"BSD-3-Clause"
] | 1 | 2017-09-15T17:14:57.000Z | 2017-09-15T17:14:57.000Z | #!/usr/bin/env python
# FMU-QSS Generator
#
# Project: QSS Solver
#
# Language: Python 2.7 and 3.x
#
# Developed by Objexx Engineering, Inc. (https://objexx.com) under contract to
# the National Renewable Energy Laboratory of the U.S. Department of Energy
#
# Copyright (c) 2017-2021 Objexx Engineering, Inc. All rights... | 49.464503 | 204 | 0.580005 | #!/usr/bin/env python
# FMU-QSS Generator
#
# Project: QSS Solver
#
# Language: Python 2.7 and 3.x
#
# Developed by Objexx Engineering, Inc. (https://objexx.com) under contract to
# the National Renewable Energy Laboratory of the U.S. Department of Energy
#
# Copyright (c) 2017-2021 Objexx Engineering, Inc. All rights... | 0 | 0 | 0 |
c31cb5968a3e41dcb813778db8984573df0ddd4c | 9,324 | py | Python | src/Mapping/gridmap.py | josiahw/pyrover | c73aabb4b05d047c4a10b832627a0eae70cbe157 | [
"BSD-2-Clause"
] | 6 | 2017-05-23T10:34:07.000Z | 2018-11-27T09:41:13.000Z | src/Mapping/gridmap.py | josiahw/pyrover | c73aabb4b05d047c4a10b832627a0eae70cbe157 | [
"BSD-2-Clause"
] | null | null | null | src/Mapping/gridmap.py | josiahw/pyrover | c73aabb4b05d047c4a10b832627a0eae70cbe157 | [
"BSD-2-Clause"
] | 1 | 2019-07-23T02:36:44.000Z | 2019-07-23T02:36:44.000Z | """
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | 43.570093 | 152 | 0.593844 | """
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | 0 | 0 | 0 |
40229217811bbae1abcba8967ec11cb22fe0716e | 4,766 | py | Python | database/scores.py | Ollie-Hooper/SpotifySentiment | bafdacd3a6f668c708c67dab40055a3b5629aa87 | [
"MIT"
] | 10 | 2020-05-23T12:01:20.000Z | 2021-07-23T12:58:29.000Z | database/scores.py | Ollie-Hooper/SpotifySentiment | bafdacd3a6f668c708c67dab40055a3b5629aa87 | [
"MIT"
] | 1 | 2021-03-31T19:38:42.000Z | 2021-03-31T19:38:42.000Z | database/scores.py | Ollie-Hooper/SpotifySentiment | bafdacd3a6f668c708c67dab40055a3b5629aa87 | [
"MIT"
] | 4 | 2020-06-19T20:52:04.000Z | 2021-02-11T17:07:06.000Z | import pandas as pd
from database.tools import Database, str_list
from app.functions import time_method
audio_features = ['danceability', 'energy', 'key', 'loudness', 'mode', 'speechiness', 'acousticness',
'instrumentalness', 'liveness', 'valence', 'tempo', 'duration_ms', 'time_signature']
@time_... | 34.788321 | 102 | 0.626311 | import pandas as pd
from database.tools import Database, str_list
from app.functions import time_method
audio_features = ['danceability', 'energy', 'key', 'loudness', 'mode', 'speechiness', 'acousticness',
'instrumentalness', 'liveness', 'valence', 'tempo', 'duration_ms', 'time_signature']
def ini... | 4,178 | 0 | 252 |
2a6c9ecec46d0b8f0cd8c8ef989149930ee5589a | 4,698 | py | Python | 2021/Day5_argparse_makefile_docker/Makefile/4_paper2_bib/Fig1gen.py | afarnudi/ScientificSoftwareDevelopment | c70f8b1c80d24dbcca12dbcca3722053954f7eaa | [
"BSD-3-Clause"
] | null | null | null | 2021/Day5_argparse_makefile_docker/Makefile/4_paper2_bib/Fig1gen.py | afarnudi/ScientificSoftwareDevelopment | c70f8b1c80d24dbcca12dbcca3722053954f7eaa | [
"BSD-3-Clause"
] | null | null | null | 2021/Day5_argparse_makefile_docker/Makefile/4_paper2_bib/Fig1gen.py | afarnudi/ScientificSoftwareDevelopment | c70f8b1c80d24dbcca12dbcca3722053954f7eaa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 8 10:19:43 2021
@author: ali
"""
import numpy as np
import matplotlib.pyplot as plt
from funcs import calcHelfrichUq
from funcs import calc_Helfrich_curve
from funcs import u_m2_calculator
from funcs import calcNelsonUl
from funcs import calc_nels... | 30.309677 | 233 | 0.631332 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 8 10:19:43 2021
@author: ali
"""
import numpy as np
import matplotlib.pyplot as plt
from funcs import calcHelfrichUq
from funcs import calc_Helfrich_curve
from funcs import u_m2_calculator
from funcs import calcNelsonUl
from funcs import calc_nels... | 4,180 | 0 | 23 |
13f21ee9ec6be5b734c4474d2ae83b3205c0edf6 | 9,427 | py | Python | multi_obj_pose_estimation/region_loss_multi.py | HannahHaensen/singleshotpose | 0cf15d500bc07bd113d1330bbf439b06c7b3eb54 | [
"MIT"
] | null | null | null | multi_obj_pose_estimation/region_loss_multi.py | HannahHaensen/singleshotpose | 0cf15d500bc07bd113d1330bbf439b06c7b3eb54 | [
"MIT"
] | null | null | null | multi_obj_pose_estimation/region_loss_multi.py | HannahHaensen/singleshotpose | 0cf15d500bc07bd113d1330bbf439b06c7b3eb54 | [
"MIT"
] | null | null | null | import time
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from utils_multi import *
| 45.322115 | 208 | 0.55341 | import time
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from utils_multi import *
def build_targets(pred_corners, target, num_keypoints, anchors, num_anchors, num_classes, nH, nW, noobject_scale,
object_scale, sil_thresh, seen):
... | 9,166 | 7 | 99 |
d98034ed1a5e72aceede024697574ded18bae3a8 | 317 | py | Python | stock/forms.py | pmaigutyak/mp-stock | 42051acebeda32803398de925497eece4b273d47 | [
"0BSD"
] | 1 | 2021-09-25T14:31:47.000Z | 2021-09-25T14:31:47.000Z | stock/forms.py | pmaigutyak/mp-stock | 42051acebeda32803398de925497eece4b273d47 | [
"0BSD"
] | null | null | null | stock/forms.py | pmaigutyak/mp-stock | 42051acebeda32803398de925497eece4b273d47 | [
"0BSD"
] | null | null | null |
from django import forms
from django.utils.translation import ugettext_lazy as _
from categories.models import Category
| 21.133333 | 55 | 0.757098 |
from django import forms
from django.utils.translation import ugettext_lazy as _
from categories.models import Category
class StockReportForm(forms.Form):
categories = forms.ModelMultipleChoiceField(
required=False,
queryset=Category.objects.all())
ids = forms.CharField(required=False)
| 0 | 171 | 23 |
711028c668c7cf809b88df63c59f52dd682db445 | 1,783 | py | Python | src/passmanager.py | Nova-Striker/Open-Palm | c7a4b0ae11fc12706bb93deca489ca622295e66d | [
"MIT"
] | 4 | 2020-10-02T05:15:29.000Z | 2020-10-09T16:42:31.000Z | src/passmanager.py | JDeepD/Open-Palm | 894e4e53f5766d98e6f16e54aafd1f5f8f3f7815 | [
"MIT"
] | 5 | 2020-11-20T18:53:05.000Z | 2021-04-08T10:42:54.000Z | src/passmanager.py | Nova-Striker/Open-Palm | c7a4b0ae11fc12706bb93deca489ca622295e66d | [
"MIT"
] | 1 | 2020-10-30T05:42:40.000Z | 2020-10-30T05:42:40.000Z | """This module will deal with password management"""
import csv
def storepass(user, passwd, target="admins.csv"):
"""This function is used for storing user-pass combo
as elements to a csv file. By default, the values will be
stored in `creds/admins.csv`. The csvs will always be
saved in the `creds` ... | 27.859375 | 74 | 0.630959 | """This module will deal with password management"""
import csv
def storepass(user, passwd, target="admins.csv"):
"""This function is used for storing user-pass combo
as elements to a csv file. By default, the values will be
stored in `creds/admins.csv`. The csvs will always be
saved in the `creds` ... | 0 | 0 | 0 |
17b06b8704d83d3bd45aff590923ec8ff1b8db9b | 1,568 | py | Python | app/error_handler.py | drone/ff-python-flask-sample | 7ec1d81b3a61610a6c57ac5745d561c75830f96a | [
"Apache-2.0"
] | null | null | null | app/error_handler.py | drone/ff-python-flask-sample | 7ec1d81b3a61610a6c57ac5745d561c75830f96a | [
"Apache-2.0"
] | null | null | null | app/error_handler.py | drone/ff-python-flask-sample | 7ec1d81b3a61610a6c57ac5745d561c75830f96a | [
"Apache-2.0"
] | 1 | 2021-11-01T09:53:37.000Z | 2021-11-01T09:53:37.000Z | from flask import make_response, jsonify
class Error(Exception):
"""Base class for exceptions in this module."""
pass
| 25.704918 | 72 | 0.66773 | from flask import make_response, jsonify
def init_errorhandler(app):
@app.errorhandler(400)
def bad_request(error):
return make_response(jsonify({'error': error.description}), 400)
@app.errorhandler(401)
def unauthorized(error):
return make_response(jsonify({'error': error.description... | 1,083 | 33 | 317 |
9555d4d2d0c4a3b8b918f4cc4516e07e520a98bc | 3,163 | py | Python | webkit/build/rule_binding.py | zachlatta/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | 1 | 2021-09-24T22:49:10.000Z | 2021-09-24T22:49:10.000Z | webkit/build/rule_binding.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | null | null | null | webkit/build/rule_binding.py | changbai1980/chromium | c4625eefca763df86471d798ee5a4a054b4716ae | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# usage: rule_binding.py INPUT CPPDIR HDIR -- INPUTS -- OPTIONS
#
# INPUT is an IDL file, such as Whatever.idl.
#
# CPPDIR is the dire... | 28.754545 | 80 | 0.68258 | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# usage: rule_binding.py INPUT CPPDIR HDIR -- INPUTS -- OPTIONS
#
# INPUT is an IDL file, such as Whatever.idl.
#
# CPPDIR is the dire... | 2,324 | 0 | 46 |
82cadcf5c827cd7c4238ba6a9191950713dbe2fe | 4,162 | py | Python | src/test/python/apache/aurora/client/commands/util.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/test/python/apache/aurora/client/commands/util.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/test/python/apache/aurora/client/commands/util.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Apache Software 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 agree... | 30.82963 | 91 | 0.717924 | #
# Copyright 2013 Apache Software 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 agree... | 558 | 2,687 | 23 |
071c73c6884f4a13b40eb710f548d4aa790d04e8 | 2,088 | py | Python | experiments/dataset_stats/stats_utils.py | Tobias-Fischer/dreyeve | a65342d9c503ce3ec932e2229b90aaeebfd82944 | [
"MIT"
] | 83 | 2017-05-29T04:16:42.000Z | 2022-03-03T08:09:22.000Z | experiments/dataset_stats/stats_utils.py | ashinmarin/dreyeve | d73979d738e706d90a8aa9d696c6e4dcb19c1134 | [
"MIT"
] | 26 | 2017-11-09T23:35:52.000Z | 2022-03-11T03:22:57.000Z | experiments/dataset_stats/stats_utils.py | ashinmarin/dreyeve | d73979d738e706d90a8aa9d696c6e4dcb19c1134 | [
"MIT"
] | 36 | 2017-09-23T02:48:41.000Z | 2022-03-11T01:34:23.000Z | """
Some statistics utils.
"""
import numpy as np
from os.path import join
def expectation_2d(pdf):
"""
Computes the statistical expectation of a pdf defined
over two discrete random variables.
Parameters
----------
pdf: ndarray
a numpy 2-dimensional array with probability for e... | 21.090909 | 83 | 0.604885 | """
Some statistics utils.
"""
import numpy as np
from os.path import join
def expectation_2d(pdf):
"""
Computes the statistical expectation of a pdf defined
over two discrete random variables.
Parameters
----------
pdf: ndarray
a numpy 2-dimensional array with probability for e... | 0 | 0 | 0 |
d5835217c99d1b1decaa544b038ac29991c0172b | 824 | py | Python | telemetry/main.py | MovoLovo/Robotics | 5efcf546ad6074595617875db04f402848a796c3 | [
"MIT"
] | null | null | null | telemetry/main.py | MovoLovo/Robotics | 5efcf546ad6074595617875db04f402848a796c3 | [
"MIT"
] | null | null | null | telemetry/main.py | MovoLovo/Robotics | 5efcf546ad6074595617875db04f402848a796c3 | [
"MIT"
] | 1 | 2020-11-16T21:47:21.000Z | 2020-11-16T21:47:21.000Z | #!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybricks.tools import wait, St... | 24.969697 | 78 | 0.747573 | #!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybricks.tools import wait, St... | 0 | 0 | 0 |
fb424fb1d756cf4cd0f7c5620c5fe0dcc99bab7d | 581 | py | Python | cybot/plug/newmember.py | francis-taylor/Timotty-Bot | 2cf7c9897ed31d26d331594e2578b253e3b970d8 | [
"MIT"
] | 6 | 2017-10-18T14:22:48.000Z | 2017-10-26T15:14:52.000Z | cybot/plug/newmember.py | Fr4ncisTaylor/Timotty | 2cf7c9897ed31d26d331594e2578b253e3b970d8 | [
"MIT"
] | 1 | 2017-10-20T19:16:03.000Z | 2017-10-20T19:16:03.000Z | cybot/plug/newmember.py | Fr4ncisTaylor/Timotty | 2cf7c9897ed31d26d331594e2578b253e3b970d8 | [
"MIT"
] | 7 | 2017-10-18T14:19:52.000Z | 2017-10-22T15:23:33.000Z | #coding:utf-8 -*-
import config, metodos
from mensagens import bemvindo
from pprint import *
from metodos import sendMessage
| 27.666667 | 142 | 0.698795 | #coding:utf-8 -*-
import config, metodos
from mensagens import bemvindo
from pprint import *
from metodos import sendMessage
def welcome(msg):
if 'new_chat_member' in msg:
sendMessage(msg['chat']['id'], bemvindo['welcome'].format(msg['new_chat_member']['first_name']),reply_to_message_id=msg['message_id'])... | 387 | 0 | 69 |
eb2db6022afb454387e5f42136c03a4a0dd14767 | 139 | py | Python | example/test/core/light/dark/unit.py | dmilos/IceRay | 4e01f141363c0d126d3c700c1f5f892967e3d520 | [
"MIT-0"
] | 2 | 2020-09-04T12:27:15.000Z | 2022-01-17T14:49:40.000Z | example/test/core/light/dark/unit.py | dmilos/IceRay | 4e01f141363c0d126d3c700c1f5f892967e3d520 | [
"MIT-0"
] | null | null | null | example/test/core/light/dark/unit.py | dmilos/IceRay | 4e01f141363c0d126d3c700c1f5f892967e3d520 | [
"MIT-0"
] | 1 | 2020-09-04T12:27:52.000Z | 2020-09-04T12:27:52.000Z | import IceRayCpp
| 12.636364 | 34 | 0.553957 | import IceRayCpp
def name( ):
return "dark"
def make( ):
light = IceRayCpp.LightDark()
return { 'this': light }
| 71 | 0 | 50 |
c78551398e7c80311e36e1af2905f117981784e3 | 533 | py | Python | TimeWrapper_JE/venv/Lib/site-packages/pkginfo/index.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/pkginfo/index.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/pkginfo/index.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | from .distribution import Distribution
| 33.3125 | 66 | 0.606004 | from .distribution import Distribution
class Index(dict):
def __setitem__(self, key, value):
if not isinstance(value, Distribution):
raise ValueError('Not a distribution: %r.' % value)
if key != '%s-%s' % (value.name, value.version):
raise ValueError('Key must match... | 411 | -3 | 83 |
06a385fb58c0fd830b984e212ec507d4558954b3 | 1,037 | py | Python | python/tests/test_ll_zip.py | M7madMomani2/data-structures-and-algorithms | 35ba48973d45f6972d097e4aaac7cfb7147a83a2 | [
"MIT"
] | null | null | null | python/tests/test_ll_zip.py | M7madMomani2/data-structures-and-algorithms | 35ba48973d45f6972d097e4aaac7cfb7147a83a2 | [
"MIT"
] | null | null | null | python/tests/test_ll_zip.py | M7madMomani2/data-structures-and-algorithms | 35ba48973d45f6972d097e4aaac7cfb7147a83a2 | [
"MIT"
] | 1 | 2021-08-29T20:16:19.000Z | 2021-08-29T20:16:19.000Z | import pytest
from data_structures.linked_list.ll_zip import *
from data_structures.linked_list.linked_list import *
@pytest.fixture
@pytest.fixture
| 29.628571 | 91 | 0.702025 | import pytest
from data_structures.linked_list.ll_zip import *
from data_structures.linked_list.linked_list import *
def test_zipLists(linked_list_ob,linked_list_ob2):
actual_output1 =linked_list_ob.zipLists(linked_list_ob2).to_string()
expected_output1=" {0} -> {1} -> {3} -> {2} -> {2} -> {3} -> {1} -> {0} -... | 816 | 0 | 67 |
9c08c75fac5d3fba256ebb61b6ce5501cf322d19 | 737 | py | Python | networks/encoders/__init__.py | Yaoyi-Li/HOP-Matting | 4ac22d92b5432734ffe416cf2c0a99fb730d0c04 | [
"MIT"
] | 56 | 2020-04-26T16:19:50.000Z | 2021-12-30T07:20:40.000Z | networks/encoders/__init__.py | Yaoyi-Li/HOP-Matting | 4ac22d92b5432734ffe416cf2c0a99fb730d0c04 | [
"MIT"
] | 5 | 2020-04-27T19:17:17.000Z | 2021-07-17T13:55:35.000Z | networks/encoders/__init__.py | Yaoyi-Li/HOP-Matting | 4ac22d92b5432734ffe416cf2c0a99fb730d0c04 | [
"MIT"
] | 11 | 2020-04-29T10:01:35.000Z | 2022-03-31T03:34:50.000Z | import logging
from .resnet_enc import ResNet_D, BasicBlock, Bottleneck
from .res_localHOP_posEmb_enc import ResLocalHOP_PosEmb
__all__ = ['resnet_localHOP_posEmb_encoder_29']
if __name__ == "__main__":
import torch
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] %(levelname)s: %(message)s'... | 28.346154 | 95 | 0.701493 | import logging
from .resnet_enc import ResNet_D, BasicBlock, Bottleneck
from .res_localHOP_posEmb_enc import ResLocalHOP_PosEmb
__all__ = ['resnet_localHOP_posEmb_encoder_29']
def _res_localHOP_posEmb(block, layers, **kwargs):
model = ResLocalHOP_PosEmb(block, layers, **kwargs)
return model
def resnet_loc... | 197 | 0 | 46 |
597ea9e787724f7ec681dab7b426f06cda2a4e67 | 1,057 | py | Python | par_checker_general.py | Yasir323/Data-Structures-and-Algorithms-in-Python | b721d0ca0218b9665d4f6ca0bbfd4417244bcdf0 | [
"MIT"
] | null | null | null | par_checker_general.py | Yasir323/Data-Structures-and-Algorithms-in-Python | b721d0ca0218b9665d4f6ca0bbfd4417244bcdf0 | [
"MIT"
] | null | null | null | par_checker_general.py | Yasir323/Data-Structures-and-Algorithms-in-Python | b721d0ca0218b9665d4f6ca0bbfd4417244bcdf0 | [
"MIT"
] | null | null | null | # Program to check closing of all brackets
print(par_checker('{({([][])}())}')) # True
print(par_checker('[{()]')) # False
| 19.574074 | 52 | 0.522233 | # Program to check closing of all brackets
class Stack:
def __init__(self, items=[]):
self.items = items
def is_empty(self):
return self.items == []
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
ret... | 705 | -9 | 231 |
2284af4298e7f6432c522550cff209b741fb1b8e | 65 | py | Python | lib/__init__.py | gideontong/Humingbird | 07f8ef2e52e2212742e80b2cece06566b0ebea86 | [
"MIT"
] | 1 | 2020-07-19T22:16:14.000Z | 2020-07-19T22:16:14.000Z | lib/__init__.py | gideontong/Humingbird | 07f8ef2e52e2212742e80b2cece06566b0ebea86 | [
"MIT"
] | 1 | 2020-07-31T04:43:25.000Z | 2020-07-31T09:16:50.000Z | lib/__init__.py | gideontong/Humingbird | 07f8ef2e52e2212742e80b2cece06566b0ebea86 | [
"MIT"
] | 1 | 2021-03-07T20:09:44.000Z | 2021-03-07T20:09:44.000Z | from . import csvTasks
from . import Gender
# from . import Learn | 21.666667 | 22 | 0.753846 | from . import csvTasks
from . import Gender
# from . import Learn | 0 | 0 | 0 |
6146fe70d4b5666a37f29b0b26d9dd1fe27dabca | 17 | py | Python | env-sample.py | peeomid/fbmsgbot-sample-py | 489018ab269f9beb4d38a6157af7f42205cffbfb | [
"MIT"
] | null | null | null | env-sample.py | peeomid/fbmsgbot-sample-py | 489018ab269f9beb4d38a6157af7f42205cffbfb | [
"MIT"
] | null | null | null | env-sample.py | peeomid/fbmsgbot-sample-py | 489018ab269f9beb4d38a6157af7f42205cffbfb | [
"MIT"
] | null | null | null | VERIFY_TOKEN = '' | 17 | 17 | 0.705882 | VERIFY_TOKEN = '' | 0 | 0 | 0 |
408085c17ca0fc1260b46e80780ea878b34a31c5 | 2,716 | py | Python | generate-html.py | tebeka/py2go-cheatsheet | 14c83850876ef80c36af326ab4fc6f56344781c7 | [
"BSD-3-Clause"
] | 13 | 2017-09-09T08:32:34.000Z | 2022-02-28T04:32:43.000Z | generate-html.py | tebeka/py2go-cheatsheet | 14c83850876ef80c36af326ab4fc6f56344781c7 | [
"BSD-3-Clause"
] | 3 | 2017-11-25T18:48:11.000Z | 2017-12-30T13:00:04.000Z | generate-html.py | tebeka/py2go-cheatsheet | 14c83850876ef80c36af326ab4fc6f56344781c7 | [
"BSD-3-Clause"
] | 2 | 2019-11-03T19:58:17.000Z | 2020-04-28T01:14:17.000Z | #!/usr/bin/env python
import html
import re
from subprocess import check_output
import yaml
find_code = re.compile(r'code: (\w+)').search
table_html = '''
<table class="code table table-sm">
<tbody>
<tr>
<td>{py}</td>
<td>{go}</td>
</tr>
</tbody>
</table>
'''
module_html = '''
<tr>
<td>{task}</t... | 24.468468 | 73 | 0.555596 | #!/usr/bin/env python
import html
import re
from subprocess import check_output
import yaml
find_code = re.compile(r'code: (\w+)').search
table_html = '''
<table class="code table table-sm">
<tbody>
<tr>
<td>{py}</td>
<td>{go}</td>
</tr>
</tbody>
</table>
'''
module_html = '''
<tr>
<td>{task}</t... | 1,309 | 0 | 115 |
ad1bb7663f7a9d7fe0f5b7b2838066a4f8f734ea | 9,247 | py | Python | transiter/http/endpoints/systemendpoints.py | jamespfennell/realtimerail | 352dd7d185d3501d28276476e1390d3288735690 | [
"MIT"
] | null | null | null | transiter/http/endpoints/systemendpoints.py | jamespfennell/realtimerail | 352dd7d185d3501d28276476e1390d3288735690 | [
"MIT"
] | null | null | null | transiter/http/endpoints/systemendpoints.py | jamespfennell/realtimerail | 352dd7d185d3501d28276476e1390d3288735690 | [
"MIT"
] | null | null | null | """
Systems
Endpoints for installing, reading, configuring and deleting transit systems.
"""
import flask
import requests
from transiter import exceptions
from transiter.http import httpmanager, httpviews
from transiter.http.httpmanager import (
http_endpoint,
link_target,
HttpMethod,
HttpStatus,
)
fr... | 37.136546 | 178 | 0.701525 | """
Systems
Endpoints for installing, reading, configuring and deleting transit systems.
"""
import flask
import requests
from transiter import exceptions
from transiter.http import httpmanager, httpviews
from transiter.http.httpmanager import (
http_endpoint,
link_target,
HttpMethod,
HttpStatus,
)
fr... | 638 | 0 | 23 |
33ce6abae939c65243a3a41bb7afe2b0e8f4f745 | 234 | py | Python | XCTF/2019 Finals/babytaint/solver.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | 1 | 2021-08-24T22:16:41.000Z | 2021-08-24T22:16:41.000Z | XCTF/2019 Finals/babytaint/solver.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | XCTF/2019 Finals/babytaint/solver.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | # xctf{35eedc512678301f582de3176d1fc81c}
payload = ''
for i in range(16):
payload += 'x%d=["Source"()[%d]];' % (i, i)
payload += 'a=['
payload += ','.join('x%d[0]' % i for i in range(16))
payload += '];"Sink"(a)'
print payload
| 19.5 | 52 | 0.57265 | # xctf{35eedc512678301f582de3176d1fc81c}
payload = ''
for i in range(16):
payload += 'x%d=["Source"()[%d]];' % (i, i)
payload += 'a=['
payload += ','.join('x%d[0]' % i for i in range(16))
payload += '];"Sink"(a)'
print payload
| 0 | 0 | 0 |
2c88e07b2599ec87bce1d6dde1049ee4ec409b53 | 512 | py | Python | fbapp/urls.py | lund5000/chirpradio | e084d53e92d897766ac19fe85eeabad68a1d7e39 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2016-01-26T08:09:59.000Z | 2019-03-23T23:27:07.000Z | fbapp/urls.py | lund5000/chirpradio | e084d53e92d897766ac19fe85eeabad68a1d7e39 | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2016-02-16T03:36:14.000Z | 2020-05-04T16:19:00.000Z | fbapp/urls.py | lund5000/chirpradio | e084d53e92d897766ac19fe85eeabad68a1d7e39 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2016-04-16T02:51:35.000Z | 2021-12-06T19:25:15.000Z | from django.conf import settings
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',
url(r'^$', 'fbapp.views.canvas', name="fbapp.canvas"),
url(r'^page_tab$', 'fbapp.views.page_tab', name="fbapp.page_tab"),
url(r'^owa$', 'fbapp.views.open_web_app', name="fbapp.open_web_app"),
... | 42.666667 | 73 | 0.691406 | from django.conf import settings
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',
url(r'^$', 'fbapp.views.canvas', name="fbapp.canvas"),
url(r'^page_tab$', 'fbapp.views.page_tab', name="fbapp.page_tab"),
url(r'^owa$', 'fbapp.views.open_web_app', name="fbapp.open_web_app"),
... | 0 | 0 | 0 |
bff42427c2600dfea0e27fbe38b4ffeff88124fb | 3,116 | py | Python | MQ/Models/BoxCoder.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 27 | 2021-10-16T02:39:17.000Z | 2022-03-31T11:16:11.000Z | Models/BoxCoder.py | coolbay/VSGN | 51a3fd59343820aed82879266df3be0147231cab | [
"MIT"
] | 5 | 2022-03-23T04:53:36.000Z | 2022-03-29T23:39:07.000Z | Models/BoxCoder.py | coolbay/VSGN | 51a3fd59343820aed82879266df3be0147231cab | [
"MIT"
] | 13 | 2021-11-25T19:17:29.000Z | 2022-03-25T14:01:47.000Z |
import torch
import math | 42.684932 | 91 | 0.523748 |
import torch
import math
class BoxCoder(object):
def __init__(self, opt):
self.cfg = opt
def encode(self, gt_boxes, anchors):
if False: #self.cfg.MODEL.ATSS.REGRESSION_TYPE == 'POINT':
TO_REMOVE = 1 # TODO remove
anchors_w = anchors[:, 2] - anchors[:, 0] + TO_REMOVE
... | 2,985 | 2 | 104 |
9e99b9353b020386db6b01e64d0da4bf91fb2d1d | 1,107 | py | Python | handle_image/handle.py | hyjalxl/spidier2 | 3ab1dec50bf03bd673665297147606a418757969 | [
"Apache-2.0"
] | null | null | null | handle_image/handle.py | hyjalxl/spidier2 | 3ab1dec50bf03bd673665297147606a418757969 | [
"Apache-2.0"
] | null | null | null | handle_image/handle.py | hyjalxl/spidier2 | 3ab1dec50bf03bd673665297147606a418757969 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# name=hu_yang_jie
#coding=utf-8
import cv2
import numpy as np
img = cv2.imread("bili.jpg") #载入图像
h, w = img.shape[:2] #获取图像的高和宽
cv2.imshow("Origin", img) #显示原始图像
blured = cv2.blur(img,(5,5)) #进行滤波去掉噪声
cv2.imshow("Blur", blured) #显示低通滤波后的图像
mask = np.zeros((h+2, w+2), np.uint8) #掩码... | 25.159091 | 86 | 0.722674 | # coding=utf-8
# name=hu_yang_jie
#coding=utf-8
import cv2
import numpy as np
img = cv2.imread("bili.jpg") #载入图像
h, w = img.shape[:2] #获取图像的高和宽
cv2.imshow("Origin", img) #显示原始图像
blured = cv2.blur(img,(5,5)) #进行滤波去掉噪声
cv2.imshow("Blur", blured) #显示低通滤波后的图像
mask = np.zeros((h+2, w+2), np.uint8) #掩码... | 0 | 0 | 0 |
57808233141949087e2b74753b28ec52afb50789 | 184 | py | Python | nxturtle/version.py | mar10/nxturtle | 12762ab7e5d95514f189aa715b09750e801293fb | [
"MIT"
] | 1 | 2020-09-02T17:43:58.000Z | 2020-09-02T17:43:58.000Z | nxturtle/version.py | TheVinhLuong102/nxturtle | 12762ab7e5d95514f189aa715b09750e801293fb | [
"MIT"
] | null | null | null | nxturtle/version.py | TheVinhLuong102/nxturtle | 12762ab7e5d95514f189aa715b09750e801293fb | [
"MIT"
] | 3 | 2016-05-16T19:09:27.000Z | 2020-09-02T17:44:01.000Z | """
Package version number.
"""
# We have to put it here, because setup.py (and easy_install) cannot import
# nxturtle before requirements are satisfied.
__version__ = "1.0.4"
| 26.285714 | 77 | 0.706522 | """
Package version number.
"""
# We have to put it here, because setup.py (and easy_install) cannot import
# nxturtle before requirements are satisfied.
__version__ = "1.0.4"
| 0 | 0 | 0 |
1f33a171260f3a0ed852b9c166dbad3fffa969b3 | 1,415 | py | Python | tests/schemas/test_schema_with_complex_types.py | slawak/dataclasses-avroschema | 04e69a176b3e72bfa0acd3edbd044ecd161b1a68 | [
"MIT"
] | null | null | null | tests/schemas/test_schema_with_complex_types.py | slawak/dataclasses-avroschema | 04e69a176b3e72bfa0acd3edbd044ecd161b1a68 | [
"MIT"
] | null | null | null | tests/schemas/test_schema_with_complex_types.py | slawak/dataclasses-avroschema | 04e69a176b3e72bfa0acd3edbd044ecd161b1a68 | [
"MIT"
] | null | null | null | import dataclasses
import datetime
import json
import typing
import uuid
from dataclasses_avroschema.schema_generator import SchemaGenerator
| 28.877551 | 83 | 0.738516 | import dataclasses
import datetime
import json
import typing
import uuid
from dataclasses_avroschema.schema_generator import SchemaGenerator
def test_schema_with_complex_types(user_advance_dataclass, user_advance_avro_json):
user_schema = SchemaGenerator(
user_advance_dataclass, include_schema_doc=False
... | 1,201 | 0 | 69 |
4fc8985147ea244f52071c25c82698f009c5ee2d | 5,398 | py | Python | spira/lne/geometry.py | cloudcalvin/spira | 2dcaef188f2bc8c3839e1b5ff0be027e0cd4908c | [
"MIT"
] | null | null | null | spira/lne/geometry.py | cloudcalvin/spira | 2dcaef188f2bc8c3839e1b5ff0be027e0cd4908c | [
"MIT"
] | 1 | 2021-10-17T10:18:04.000Z | 2021-10-17T10:18:04.000Z | spira/lne/geometry.py | cloudcalvin/spira | 2dcaef188f2bc8c3839e1b5ff0be027e0cd4908c | [
"MIT"
] | null | null | null | import os
import spira
import pygmsh
import meshio
import inspect
from spira.core.lists import ElementList
# from spira.gdsii.utils import numpy_to_list
from spira import param
from spira.lne.mesh import Mesh
from spira.core.initializer import ElementalInitializer
| 29.336957 | 79 | 0.559466 | import os
import spira
import pygmsh
import meshio
import inspect
from spira.core.lists import ElementList
# from spira.gdsii.utils import numpy_to_list
from spira import param
from spira.lne.mesh import Mesh
from spira.core.initializer import ElementalInitializer
class __Geometry__(ElementalInitializer):
def _... | 1,704 | 3,302 | 123 |
183d1196e1f6f1aa96619ac36af307eec5de268e | 3,805 | py | Python | astroquery/utils/tap/conn/tests/DummyConnHandler.py | jmilou/astroquery | 06d6e6740865d0461570390726e1831ea139b558 | [
"BSD-3-Clause"
] | null | null | null | astroquery/utils/tap/conn/tests/DummyConnHandler.py | jmilou/astroquery | 06d6e6740865d0461570390726e1831ea139b558 | [
"BSD-3-Clause"
] | 2 | 2020-10-29T19:55:25.000Z | 2021-05-14T19:17:44.000Z | astroquery/utils/tap/conn/tests/DummyConnHandler.py | mevtorres/localAstroquery | 06d6e6740865d0461570390726e1831ea139b558 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
from astroquery.utils.tap import taputils... | 29.726563 | 78 | 0.600526 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
from astroquery.utils.tap import taputils... | 2,891 | 10 | 536 |
681fd52b15338d6c2c9dd4b4bdc669825c9b4c27 | 4,658 | py | Python | WeOptPy/algorithms/sa.py | kb2623/WeOptPy | 2e9e75acf8fedde0ae4c99da6c786a712d4f011c | [
"MIT"
] | 1 | 2021-05-12T10:02:21.000Z | 2021-05-12T10:02:21.000Z | WeOptPy/algorithms/sa.py | kb2623/WeOptPy | 2e9e75acf8fedde0ae4c99da6c786a712d4f011c | [
"MIT"
] | null | null | null | WeOptPy/algorithms/sa.py | kb2623/WeOptPy | 2e9e75acf8fedde0ae4c99da6c786a712d4f011c | [
"MIT"
] | null | null | null | # encoding=utf8
"""Simulated annealing algorithm module."""
import numpy as np
from WeOptPy.algorithms.interfaces import Algorithm
__all__ = [
'SimulatedAnnealing',
'coolDelta',
'coolLinear'
]
def coolDelta(currentT, T, deltaT, nFES, **kwargs):
r"""Calculate new temperature by differences.
Args:
currentT ... | 24.515789 | 108 | 0.683985 | # encoding=utf8
"""Simulated annealing algorithm module."""
import numpy as np
from WeOptPy.algorithms.interfaces import Algorithm
__all__ = [
'SimulatedAnnealing',
'coolDelta',
'coolLinear'
]
def coolDelta(currentT, T, deltaT, nFES, **kwargs):
r"""Calculate new temperature by differences.
Args:
currentT ... | 0 | 0 | 0 |
ba98afdb26c78c2e50fad1d16a3cc2b5bb4d30d1 | 2,761 | py | Python | bot.py | esjimenezro/trading-bot | bbffd35285da2bafd616b0fcc4e15ae9d250ac45 | [
"MIT"
] | null | null | null | bot.py | esjimenezro/trading-bot | bbffd35285da2bafd616b0fcc4e15ae9d250ac45 | [
"MIT"
] | null | null | null | bot.py | esjimenezro/trading-bot | bbffd35285da2bafd616b0fcc4e15ae9d250ac45 | [
"MIT"
] | null | null | null | import sys
sys.path.append("../config_files")
import mysql.connector
from settings_project import CONFIG_MYSQL
import pandas as pd
import numpy as np
import time
#DEFINIMOS FUNCIONES
# CALCULAR MEDIAS MOVILES
# CREAMOS CICLO INFINITO CON PAUSA CADA 10S
while True:
# Cargar datos
datos = load_bitso_data_top5... | 30.01087 | 105 | 0.6092 | import sys
sys.path.append("../config_files")
import mysql.connector
from settings_project import CONFIG_MYSQL
import pandas as pd
import numpy as np
import time
#DEFINIMOS FUNCIONES
def load_bitso_data_top500(CONFIG_MYSQL):
conn = mysql.connector(**CONFIG_MYSQL)
cursor = conn.cursor()
query = """SELECT
... | 313 | 0 | 45 |
711587f58366a89e232d7627e3317ebe481064d0 | 1,812 | py | Python | blog/tests/test_models.py | broadsinatlanta/higashi-hiroshima-tours- | 5ae44056d4cb577eab2e5a0525a330b3ac19e122 | [
"MIT"
] | null | null | null | blog/tests/test_models.py | broadsinatlanta/higashi-hiroshima-tours- | 5ae44056d4cb577eab2e5a0525a330b3ac19e122 | [
"MIT"
] | 14 | 2020-02-12T00:00:09.000Z | 2022-03-11T23:44:27.000Z | blog/tests/test_models.py | broadsinatlanta/higashi-hiroshima-tours- | 5ae44056d4cb577eab2e5a0525a330b3ac19e122 | [
"MIT"
] | null | null | null | from django.test import TestCase
# from django.contrib.auth.models import User
from blog.models import Post, Comment
import blog.tests.helper as h
| 29.704918 | 101 | 0.662252 | from django.test import TestCase
# from django.contrib.auth.models import User
from blog.models import Post, Comment
import blog.tests.helper as h
class CommentTestCase(TestCase):
def setUp(self):
self.user = h.create_user()
self.post = h.create_post(self.user)
self.comment = h.create_c... | 1,372 | 19 | 270 |
19fb02b9eddeb85e1565a9aaff760be0fe27b29c | 9,391 | py | Python | mud/models/player.py | erwanaubry/alamud_IUT_Escape | cc9e77203245a9b933300edc2efb9bd5fcd8abc3 | [
"Unlicense"
] | null | null | null | mud/models/player.py | erwanaubry/alamud_IUT_Escape | cc9e77203245a9b933300edc2efb9bd5fcd8abc3 | [
"Unlicense"
] | null | null | null | mud/models/player.py | erwanaubry/alamud_IUT_Escape | cc9e77203245a9b933300edc2efb9bd5fcd8abc3 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Denys Duchier, IUT d'Orléans
#==============================================================================
import mud.game
from .thing import Thing
from .mixins.containing import Containing
from .location import Location
import queue
from tornado.iolo... | 35.304511 | 88 | 0.485571 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Denys Duchier, IUT d'Orléans
#==============================================================================
import mud.game
from .thing import Thing
from .mixins.containing import Containing
from .location import Location
import queue
from tornado.iolo... | 2,583 | 6,444 | 23 |
ba1d80b3a90811062c59fdbc4b11f2783bbedce3 | 3,057 | py | Python | pipeline.py | alfiopuglisi/pipeline | bb0774cff8845c683f7e38475885a6e74e2d86ee | [
"MIT"
] | 4 | 2021-02-07T23:07:38.000Z | 2021-09-29T09:35:23.000Z | pipeline.py | alfiopuglisi/pipeline | bb0774cff8845c683f7e38475885a6e74e2d86ee | [
"MIT"
] | null | null | null | pipeline.py | alfiopuglisi/pipeline | bb0774cff8845c683f7e38475885a6e74e2d86ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Module for pipelining composition.
value >> func1 >> func2 >> func3 ...
Pipelines are expressions whose resulting value can be assigned:
result = value >> func1 >> func2
Rules:
* First value can be any python value
* Functions must be chained with the '>>' operator.
* All fun... | 28.839623 | 90 | 0.66634 | #!/usr/bin/env python
'''
Module for pipelining composition.
value >> func1 >> func2 >> func3 ...
Pipelines are expressions whose resulting value can be assigned:
result = value >> func1 >> func2
Rules:
* First value can be any python value
* Functions must be chained with the '>>' operator.
* All fun... | 532 | -7 | 207 |
0778d7f2ea48b9691400a4b10a602762013b70cf | 2,995 | py | Python | scripts/real/cat_img.py | ZJU-Robotics-Lab/CICT | ff873a03ab03d9113b8db96d26246939bb5da0d4 | [
"MIT"
] | 12 | 2021-02-09T05:08:36.000Z | 2022-02-24T07:51:30.000Z | scripts/real/cat_img.py | ZJU-Robotics-Lab/CICT | ff873a03ab03d9113b8db96d26246939bb5da0d4 | [
"MIT"
] | null | null | null | scripts/real/cat_img.py | ZJU-Robotics-Lab/CICT | ff873a03ab03d9113b8db96d26246939bb5da0d4 | [
"MIT"
] | 6 | 2021-03-30T06:30:13.000Z | 2022-03-01T14:15:00.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import glob
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), '..'))
sys.path.insert(0, join(dirname(__file__), '../..'))
import cv2
import numpy as np
if __name__ == '__main__':
rate = 1.25
rate2 = 1.0
dataset = {}
... | 34.034091 | 132 | 0.6 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import glob
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), '..'))
sys.path.insert(0, join(dirname(__file__), '../..'))
import cv2
import numpy as np
def read_files(index):
file_path = '/media/wang/Data/video/data'+str(index)
... | 1,037 | 0 | 46 |
4f1b4c79fe935ceee776c57b22a97040f332d3db | 512 | py | Python | examples/Gephi_streaming.py | chumpblocckami/Tweet2Graph | eaf986ea83e5a420b26c6417ddca887506814fd4 | [
"MIT"
] | null | null | null | examples/Gephi_streaming.py | chumpblocckami/Tweet2Graph | eaf986ea83e5a420b26c6417ddca887506814fd4 | [
"MIT"
] | null | null | null | examples/Gephi_streaming.py | chumpblocckami/Tweet2Graph | eaf986ea83e5a420b26c6417ddca887506814fd4 | [
"MIT"
] | null | null | null | from gephistreamer import graph
from gephistreamer import streamer
#https://github.com/totetmatt/GephiStreamer
#DA FARE
stream = streamer.Streamer(streamer.GephiWS(hostname="localhost", port=8080, workspace="workspace0"),)
node_a = graph.Node("A",custom_property=1)
node_b = graph.Node("B",custom_property=2)
node_c = gr... | 36.571429 | 102 | 0.791016 | from gephistreamer import graph
from gephistreamer import streamer
#https://github.com/totetmatt/GephiStreamer
#DA FARE
stream = streamer.Streamer(streamer.GephiWS(hostname="localhost", port=8080, workspace="workspace0"),)
node_a = graph.Node("A",custom_property=1)
node_b = graph.Node("B",custom_property=2)
node_c = gr... | 0 | 0 | 0 |
ec505f1cf69b1833c3a8ad53a5c963b1d29f8429 | 14,640 | py | Python | tts/src/tts/synthesizer.py | mjsobrep/tts-ros1 | b3829ee93f76a70ff1460f505fd8ba70cf8f8d24 | [
"Apache-2.0"
] | null | null | null | tts/src/tts/synthesizer.py | mjsobrep/tts-ros1 | b3829ee93f76a70ff1460f505fd8ba70cf8f8d24 | [
"Apache-2.0"
] | 11 | 2021-05-11T16:13:36.000Z | 2022-03-25T16:10:26.000Z | tts/src/tts/synthesizer.py | mjsobrep/tts-ros1 | b3829ee93f76a70ff1460f505fd8ba70cf8f8d24 | [
"Apache-2.0"
] | 1 | 2019-11-13T22:03:28.000Z | 2019-11-13T22:03:28.000Z | #!/usr/bin/env python
# Copyright (c) 2018, Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or i... | 43.442136 | 119 | 0.60888 | #!/usr/bin/env python
# Copyright (c) 2018, Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or i... | 2,594 | 19 | 283 |
d25a7bd75d7c54850950a409c269be37acd67a36 | 6,722 | py | Python | wso.py | daakru/BLReLM | ad1001c101821356abff711c1ed4d3178a77baa7 | [
"MIT"
] | null | null | null | wso.py | daakru/BLReLM | ad1001c101821356abff711c1ed4d3178a77baa7 | [
"MIT"
] | null | null | null | wso.py | daakru/BLReLM | ad1001c101821356abff711c1ed4d3178a77baa7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Writable String Object | Stores data to simplify writing outputs.
Created on Sat Nov 28 19:06:09 2020
Version 1.3.0 (debug support) A-05-2021 @ 14:34 UTC -5
Requires: NONE
@author: Kinetos#6935
"""
import argparse
class wso(object):
"""
A class to to simplify writing outputs when... | 21.476038 | 77 | 0.520678 | # -*- coding: utf-8 -*-
"""
Writable String Object | Stores data to simplify writing outputs.
Created on Sat Nov 28 19:06:09 2020
Version 1.3.0 (debug support) A-05-2021 @ 14:34 UTC -5
Requires: NONE
@author: Kinetos#6935
"""
import argparse
class wso(object):
"""
A class to to simplify writing outputs when... | 329 | 0 | 50 |
bfca6e0fa0eb15b62fed5d38aacf62564fa094de | 900 | py | Python | app/schema/answers/month_year_date_answer.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | null | null | null | app/schema/answers/month_year_date_answer.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | 8 | 2020-03-24T15:24:18.000Z | 2022-03-02T04:32:56.000Z | app/schema/answers/month_year_date_answer.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | null | null | null | from app.schema.answer import Answer
from app.schema.exceptions import TypeCheckingException
from app.schema.widgets.month_year_date_widget import MonthYearDateWidget
from app.validation.month_year_date_type_check import MonthYearDateTypeCheck
| 36 | 76 | 0.744444 | from app.schema.answer import Answer
from app.schema.exceptions import TypeCheckingException
from app.schema.widgets.month_year_date_widget import MonthYearDateWidget
from app.validation.month_year_date_type_check import MonthYearDateTypeCheck
class MonthYearDateAnswer(Answer):
def __init__(self, answer_id=None):... | 539 | 13 | 103 |
2078827fc55525f8112757f3bcc7571c050f6d7c | 793 | py | Python | __init__.py | samg11/SpaceX-Launch-Data | ae4d70fc991e4b6a6b0e8b294e8d25e2a1a91f52 | [
"MIT"
] | null | null | null | __init__.py | samg11/SpaceX-Launch-Data | ae4d70fc991e4b6a6b0e8b294e8d25e2a1a91f52 | [
"MIT"
] | null | null | null | __init__.py | samg11/SpaceX-Launch-Data | ae4d70fc991e4b6a6b0e8b294e8d25e2a1a91f52 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, url_for, flash, redirect
app = Flask(__name__)
@app.route('/')
@app.route('/next')
@app.route('/upcoming')
@app.route('/rockets')
@app.route('/rockets/<rocket>')
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0')
| 29.37037 | 94 | 0.672131 | from flask import Flask, render_template, url_for, flash, redirect
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html', script="index.js", name="Home Page")
@app.route('/next')
def next():
return render_template('next.html', script="next.js", name="Next Launch")
... | 384 | 0 | 115 |
cd6b1eaf10be5e0429bcdbb1b2ff218d05d45adb | 6,304 | py | Python | System_of_Beams/testing_collection/test_runner.py | ChairOfStructuralMechanicsTUM/Mechanics_Apps | b064a42d4df3fa9bde62a5cff9cb27ca61b0127c | [
"MIT"
] | 11 | 2017-05-06T17:05:29.000Z | 2020-11-12T09:26:47.000Z | System_of_Beams/testing_collection/test_runner.py | ChairOfStructuralMechanicsTUM/Mechanics_Apps | b064a42d4df3fa9bde62a5cff9cb27ca61b0127c | [
"MIT"
] | 49 | 2017-04-20T11:26:11.000Z | 2020-05-29T13:18:06.000Z | System_of_Beams/testing_collection/test_runner.py | ChairOfStructuralMechanicsTUM/Mechanics_Apps | b064a42d4df3fa9bde62a5cff9cb27ca61b0127c | [
"MIT"
] | 4 | 2017-02-14T12:55:34.000Z | 2022-01-12T15:07:07.000Z | from testing_collection import visualisation_tests as visu_tests
from Classes.CurrentDocument import CurrentDoc
def run_tests(curr_doc: CurrentDoc):
"""
1.) write test case and add it to file test_cases.py
2.) Call it in this function (run_tests() will be called in 'System_of_Beams\main.py'
3.) make s... | 44.70922 | 101 | 0.521415 | from testing_collection import visualisation_tests as visu_tests
from Classes.CurrentDocument import CurrentDoc
def run_tests(curr_doc: CurrentDoc):
"""
1.) write test case and add it to file test_cases.py
2.) Call it in this function (run_tests() will be called in 'System_of_Beams\main.py'
3.) make s... | 0 | 0 | 0 |
2ee6ff7af3295482ca8a08e6514f2134c750464d | 5,280 | py | Python | retrievals/data/ecmwf/grib.py | leric2/pyretrievals | 3cae0afc9951ce079a44aa093689867b17a11060 | [
"MIT"
] | null | null | null | retrievals/data/ecmwf/grib.py | leric2/pyretrievals | 3cae0afc9951ce079a44aa093689867b17a11060 | [
"MIT"
] | null | null | null | retrievals/data/ecmwf/grib.py | leric2/pyretrievals | 3cae0afc9951ce079a44aa093689867b17a11060 | [
"MIT"
] | 2 | 2020-05-13T10:35:21.000Z | 2022-03-31T07:47:27.000Z | import pygrib
import numpy as np
from collections import defaultdict
from collections import namedtuple
from collections import Iterable
import xarray as xr
def grb_msg_to_xr(message, has_levels=True):
"""
Convert a single grib message to xarray.
:param message:
:type message: pygrib message
:par... | 30.520231 | 93 | 0.58447 | import pygrib
import numpy as np
from collections import defaultdict
from collections import namedtuple
from collections import Iterable
import xarray as xr
def grb_msg_to_xr(message, has_levels=True):
"""
Convert a single grib message to xarray.
:param message:
:type message: pygrib message
:par... | 1,414 | 1,678 | 46 |
465c3233b80f7af04fe584f39fcb8e47b7171fe4 | 11,615 | py | Python | tests/system/python/api/test_service.py | doug-dianomic/fledge | cab620d1f31e6dca8e31ca8e483adaad7ce94834 | [
"Apache-2.0"
] | null | null | null | tests/system/python/api/test_service.py | doug-dianomic/fledge | cab620d1f31e6dca8e31ca8e483adaad7ce94834 | [
"Apache-2.0"
] | null | null | null | tests/system/python/api/test_service.py | doug-dianomic/fledge | cab620d1f31e6dca8e31ca8e483adaad7ce94834 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge.readthedocs.io/
# FLEDGE_END
""" Test add service using poll and async plugins for both python & C version REST API """
import os
import http.client
import json
import time
from uuid import UUID
from collections import Counter
from urllib.parse import quote... | 39.372881 | 118 | 0.624709 | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge.readthedocs.io/
# FLEDGE_END
""" Test add service using poll and async plugins for both python & C version REST API """
import os
import http.client
import json
import time
from uuid import UUID
from collections import Counter
from urllib.parse import quote... | 9,756 | 1,046 | 68 |
424d8efd24e564601ab5d62dad56f9fc790093c6 | 201 | py | Python | apps/aggregate/stores/serializers.py | KimSoungRyoul/DjangoBackendProgramming | b346e04ce85388beba788bd3e6a405635ed913dc | [
"MIT"
] | null | null | null | apps/aggregate/stores/serializers.py | KimSoungRyoul/DjangoBackendProgramming | b346e04ce85388beba788bd3e6a405635ed913dc | [
"MIT"
] | null | null | null | apps/aggregate/stores/serializers.py | KimSoungRyoul/DjangoBackendProgramming | b346e04ce85388beba788bd3e6a405635ed913dc | [
"MIT"
] | null | null | null | from rest_framework import serializers
from aggregate.stores.models import Store
| 20.1 | 51 | 0.741294 | from rest_framework import serializers
from aggregate.stores.models import Store
class StoreSerializer(serializers.ModelSerializer):
class Meta:
model = Store
fields = "__all__"
| 0 | 95 | 23 |
71c5edd92cbebdc52ea8a994e7bdfb165cfbd92a | 727 | py | Python | metricbeat/module/couchbase/test_couchbase.py | phillip2019/beats | c825258c3dc62f05e5feefa9956befa7fb47fa68 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-06-24T21:20:14.000Z | 2021-06-24T21:20:14.000Z | metricbeat/module/couchbase/test_couchbase.py | michaelolo24/beats | cf46a2a12fbe879562ab56ee1f9c33d6bb4ac40d | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | metricbeat/module/couchbase/test_couchbase.py | michaelolo24/beats | cf46a2a12fbe879562ab56ee1f9c33d6bb4ac40d | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-10-26T15:34:06.000Z | 2021-12-10T08:51:58.000Z | import os
import sys
import unittest
from parameterized import parameterized
sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system'))
import metricbeat
| 25.068966 | 83 | 0.657497 | import os
import sys
import unittest
from parameterized import parameterized
sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system'))
import metricbeat
class Test(metricbeat.BaseTest):
COMPOSE_SERVICES = ['couchbase']
FIELDS = ['couchbase']
@parameterized.expand([
("bucket... | 71 | 457 | 23 |
d039b9142821aa0cafb9f36af8ed2e45442dee5f | 1,834 | py | Python | odScrape.py | willkim28/openDota | 90f8543be2aa6392d3016003827d825fca6dc92b | [
"MIT"
] | null | null | null | odScrape.py | willkim28/openDota | 90f8543be2aa6392d3016003827d825fca6dc92b | [
"MIT"
] | null | null | null | odScrape.py | willkim28/openDota | 90f8543be2aa6392d3016003827d825fca6dc92b | [
"MIT"
] | null | null | null | import requests
import time
import json
url = 'https://api.opendota.com/api/'
gang = {
'will': {
'name': 'Will',
'pid': '67798385'
},
'pat': {
'name': 'Pat',
'pid': '52147853'
},
'james': {
'name': 'James',
'pid': '84941438'
... | 22.641975 | 87 | 0.52181 | import requests
import time
import json
url = 'https://api.opendota.com/api/'
gang = {
'will': {
'name': 'Will',
'pid': '67798385'
},
'pat': {
'name': 'Pat',
'pid': '52147853'
},
'james': {
'name': 'James',
'pid': '84941438'
... | 0 | 0 | 0 |
22b7392e8aa851501042abde6b644a775d931b00 | 3,364 | py | Python | robotarium_node/robotarium_node/utilities/coordinates.py | zmk5/ros2_robotarium | 6fc31bb6d3cdd89cf0b0b063d674897287ec1f8d | [
"MIT"
] | 22 | 2020-08-16T21:40:17.000Z | 2022-03-10T15:54:55.000Z | robotarium_node/robotarium_node/utilities/coordinates.py | zmk5/ros2_robotarium | 6fc31bb6d3cdd89cf0b0b063d674897287ec1f8d | [
"MIT"
] | null | null | null | robotarium_node/robotarium_node/utilities/coordinates.py | zmk5/ros2_robotarium | 6fc31bb6d3cdd89cf0b0b063d674897287ec1f8d | [
"MIT"
] | 1 | 2020-08-26T09:06:12.000Z | 2020-08-26T09:06:12.000Z | """A series of conversion tools for Quaternions and Euler Angles.
These functions are modified versions of the algorithms found here:
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
Written by: Zahi Kakish (zmk5)
"""
from typing import Tuple
import numpy as np
def quaternion_to_roll(... | 28.268908 | 79 | 0.54786 | """A series of conversion tools for Quaternions and Euler Angles.
These functions are modified versions of the algorithms found here:
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
Written by: Zahi Kakish (zmk5)
"""
from typing import Tuple
import numpy as np
def quaternion_to_roll(... | 0 | 0 | 0 |
60162f2a3bc07b7804ae4d7b5cfdf462e1b196d6 | 12,649 | py | Python | tests/UnitTestBase.py | raj-TIP/wlan-testing | 470e85eb52a8ff6b7e9cacab8fcdf73ccc4b1733 | [
"BSD-3-Clause"
] | null | null | null | tests/UnitTestBase.py | raj-TIP/wlan-testing | 470e85eb52a8ff6b7e9cacab8fcdf73ccc4b1733 | [
"BSD-3-Clause"
] | null | null | null | tests/UnitTestBase.py | raj-TIP/wlan-testing | 470e85eb52a8ff6b7e9cacab8fcdf73ccc4b1733 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
import sys
for folder in 'py-json', 'py-scripts':
if folder not in sys.path:
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
sys.path.append(f'../libs/lanforge')
sys.path.append(f... | 49.027132 | 120 | 0.627085 | #!/usr/bin/python3
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
import sys
for folder in 'py-json', 'py-scripts':
if folder not in sys.path:
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
sys.path.append(f'../libs/lanforge')
sys.path.append(f... | 10,082 | -2 | 50 |
9677e8b1e3d2314707fc9d6edfb084e573607f21 | 1,064 | py | Python | exerciciosEntrega/exercicioEntrega07.py | igorprati/python_modulo01_entrega | ba35181159c8f7c0916eaea431c591666977f16a | [
"MIT"
] | null | null | null | exerciciosEntrega/exercicioEntrega07.py | igorprati/python_modulo01_entrega | ba35181159c8f7c0916eaea431c591666977f16a | [
"MIT"
] | null | null | null | exerciciosEntrega/exercicioEntrega07.py | igorprati/python_modulo01_entrega | ba35181159c8f7c0916eaea431c591666977f16a | [
"MIT"
] | null | null | null | #07 - Crie um programa onde o usuário possa digitar sete valores numéricos e cadastre-os em uma lista única que mantenha separados os valores pares e ímpares. No final, mostre os valores pares e ímpares em ordem crescente.
numeros = list() # lista geral contendo todos os números
listaPar = list() # lista contendo ape... | 53.2 | 222 | 0.734023 | #07 - Crie um programa onde o usuário possa digitar sete valores numéricos e cadastre-os em uma lista única que mantenha separados os valores pares e ímpares. No final, mostre os valores pares e ímpares em ordem crescente.
numeros = list() # lista geral contendo todos os números
listaPar = list() # lista contendo ape... | 0 | 0 | 0 |
6ddeac54e95c696aac7b3d3256112b68253bdc0e | 2,084 | py | Python | tests/unit/test_04_array_perf.py | PureStorage-OpenConnect/pure-fb-prometheus-exporter | 53fd72a2a858a60d17d4ca4ade1d82540596f9f0 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_04_array_perf.py | PureStorage-OpenConnect/pure-fb-prometheus-exporter | 53fd72a2a858a60d17d4ca4ade1d82540596f9f0 | [
"Apache-2.0"
] | 2 | 2022-02-15T21:30:25.000Z | 2022-02-16T15:29:48.000Z | tests/unit/test_04_array_perf.py | PureStorage-OpenConnect/pure-fb-prometheus-exporter | 53fd72a2a858a60d17d4ca4ade1d82540596f9f0 | [
"Apache-2.0"
] | null | null | null | from pure_fb_openmetrics_exporter.flashblade_collector.flashblade_metrics.array_performance_metrics import ArrayPerformanceMetrics
| 52.1 | 130 | 0.559021 | from pure_fb_openmetrics_exporter.flashblade_collector.flashblade_metrics.array_performance_metrics import ArrayPerformanceMetrics
def test_array_perf_name(fb_client):
array_perf = ArrayPerformanceMetrics(fb_client)
for m in array_perf.get_metrics():
for s in m.samples:
assert s.name in ['... | 1,874 | 0 | 78 |
536a2bffd176dcd62a3d6b9ea6c56b220e727387 | 1,168 | py | Python | requests_cache/backends/dynamodb.py | Ax6/requests-cache | 6717a336430eb7e6fe17e75c5517f3076ca85b42 | [
"BSD-2-Clause"
] | 6 | 2018-09-12T07:03:55.000Z | 2021-08-11T18:26:32.000Z | requests_cache/backends/dynamodb.py | Ax6/requests-cache | 6717a336430eb7e6fe17e75c5517f3076ca85b42 | [
"BSD-2-Clause"
] | 1 | 2019-05-29T01:43:33.000Z | 2019-05-29T01:43:33.000Z | requests_cache/backends/dynamodb.py | Ax6/requests-cache | 6717a336430eb7e6fe17e75c5517f3076ca85b42 | [
"BSD-2-Clause"
] | 1 | 2020-04-05T14:10:56.000Z | 2020-04-05T14:10:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.backends.dynamodb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``dynamodb`` cache backend
"""
from .base import BaseCache
from .storage.dynamodbdict import DynamoDbDict
class DynamoDbCache(BaseCache):
""" ``dynamodb`` cache backend.
"""
def _... | 37.677419 | 77 | 0.504281 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.backends.dynamodb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``dynamodb`` cache backend
"""
from .base import BaseCache
from .storage.dynamodbdict import DynamoDbDict
class DynamoDbCache(BaseCache):
""" ``dynamodb`` cache backend.
"""
def _... | 0 | 0 | 0 |
14fb213ab57c57350fada5692e917462a2570e9a | 830 | py | Python | setup.py | kislenko-artem/dataclasses-ujson | 6113d8b3db0f45be0b9ade846e408e3b50979bb2 | [
"Apache-2.0"
] | 3 | 2018-07-02T05:38:13.000Z | 2018-10-06T22:15:48.000Z | setup.py | kislenko-artem/dataclasses-ujson | 6113d8b3db0f45be0b9ade846e408e3b50979bb2 | [
"Apache-2.0"
] | null | null | null | setup.py | kislenko-artem/dataclasses-ujson | 6113d8b3db0f45be0b9ade846e408e3b50979bb2 | [
"Apache-2.0"
] | null | null | null | import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
README = (HERE / "ReadMe.md").read_text()
setup(
name="dataclasses_ujson",
version="0.0.14",
packages=find_packages(exclude=("tests*","bench_marks.py")),
author="Kislenko Artem ",
author_email="artem@we... | 27.666667 | 64 | 0.678313 | import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
README = (HERE / "ReadMe.md").read_text()
setup(
name="dataclasses_ujson",
version="0.0.14",
packages=find_packages(exclude=("tests*","bench_marks.py")),
author="Kislenko Artem ",
author_email="artem@we... | 0 | 0 | 0 |
b6e1b5baa73bbe671f372c5fbb39114cf328bee3 | 2,820 | py | Python | django_mail_viewer/backends/cache.py | jmichalicek/django-mail-viewer | ede04bc6a0809b8e62621f5646396893ad966d71 | [
"MIT"
] | 3 | 2017-07-19T23:35:31.000Z | 2022-02-13T18:49:04.000Z | django_mail_viewer/backends/cache.py | jmichalicek/django-mail-viewer | ede04bc6a0809b8e62621f5646396893ad966d71 | [
"MIT"
] | 1 | 2019-10-05T14:51:39.000Z | 2019-10-05T14:51:40.000Z | django_mail_viewer/backends/cache.py | jmichalicek/django-mail-viewer | ede04bc6a0809b8e62621f5646396893ad966d71 | [
"MIT"
] | null | null | null | """
Backend for test environment.
"""
from django.core import cache
from django.core.mail.backends.base import BaseEmailBackend
from .. import settings as mailviewer_settings
class EmailBackend(BaseEmailBackend):
"""
An email backend to use during testing and local development with Django Mail Viewer.
U... | 37.105263 | 89 | 0.65 | """
Backend for test environment.
"""
from django.core import cache
from django.core.mail.backends.base import BaseEmailBackend
from .. import settings as mailviewer_settings
class EmailBackend(BaseEmailBackend):
"""
An email backend to use during testing and local development with Django Mail Viewer.
U... | 1,177 | 0 | 54 |
230c5789d1fbe742142cfe2e077b786e10a70cf9 | 757 | py | Python | puzzle9/main.py | apaku/aoc2020 | b90b1ec519014b851c6160d5b0e14c2ca8f86b91 | [
"BSD-3-Clause"
] | 1 | 2020-12-03T19:51:19.000Z | 2020-12-03T19:51:19.000Z | puzzle9/main.py | apaku/aoc2020 | b90b1ec519014b851c6160d5b0e14c2ca8f86b91 | [
"BSD-3-Clause"
] | null | null | null | puzzle9/main.py | apaku/aoc2020 | b90b1ec519014b851c6160d5b0e14c2ca8f86b91 | [
"BSD-3-Clause"
] | null | null | null | import sys
from itertools import combinations
data = [int(line.strip()) for line in sys.stdin.readlines()]
preamble = int(sys.argv[1])
idx = preamble
while idx < len(data):
found = False
for (a,b) in combinations(data[idx-preamble:idx], 2):
if a + b == data[idx]:
found = True
... | 22.939394 | 76 | 0.570674 | import sys
from itertools import combinations
data = [int(line.strip()) for line in sys.stdin.readlines()]
preamble = int(sys.argv[1])
idx = preamble
while idx < len(data):
found = False
for (a,b) in combinations(data[idx-preamble:idx], 2):
if a + b == data[idx]:
found = True
... | 0 | 0 | 0 |
aeaca77a0c6cb513574a6991c453ae4a01b6dc4d | 1,252 | py | Python | backend/src/gql/mutation/create_patient.py | spiritutumduo/spiritumDuo | 987785906cd504f46ccebe3bbfe0e81cbf02bf7c | [
"MIT"
] | 1 | 2022-03-11T14:07:16.000Z | 2022-03-11T14:07:16.000Z | backend/src/gql/mutation/create_patient.py | spiritutumduo/spiritumDuo | 987785906cd504f46ccebe3bbfe0e81cbf02bf7c | [
"MIT"
] | 3 | 2022-02-25T22:46:46.000Z | 2022-03-30T08:19:41.000Z | backend/src/gql/mutation/create_patient.py | spiritutumduo/spiritumDuo | 987785906cd504f46ccebe3bbfe0e81cbf02bf7c | [
"MIT"
] | 1 | 2022-03-31T14:35:51.000Z | 2022-03-31T14:35:51.000Z | from models import Patient
from .mutation_type import mutation
from authentication.authentication import needsAuthorization
from graphql.type import GraphQLResolveInfo
from datacreators.patient import CreatePatient
from SdTypes import Permissions
@mutation.field("createPatient")
@needsAuthorization([Permissions.PATIE... | 33.837838 | 77 | 0.704473 | from models import Patient
from .mutation_type import mutation
from authentication.authentication import needsAuthorization
from graphql.type import GraphQLResolveInfo
from datacreators.patient import CreatePatient
from SdTypes import Permissions
@mutation.field("createPatient")
@needsAuthorization([Permissions.PATIE... | 898 | 0 | 22 |
886b96d6b50ebb192157cd1dec991c1cf191d83a | 1,130 | py | Python | sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py | sima-zhu/azure-sdk-for-python | a413dc783f0df7dc65e9c2ef9762fabff1708c4e | [
"MIT"
] | null | null | null | sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py | sima-zhu/azure-sdk-for-python | a413dc783f0df7dc65e9c2ef9762fabff1708c4e | [
"MIT"
] | null | null | null | sdk/eventgrid/azure-eventgrid/samples/champion_scenarios/cs6_consume_events_using_cloud_events_1.0_schema.py | sima-zhu/azure-sdk-for-python | a413dc783f0df7dc65e9c2ef9762fabff1708c4e | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
FILE:... | 34.242424 | 88 | 0.683186 | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
FILE:... | 0 | 0 | 0 |
668ed1659ae67dc4bdcd72703d472161d2741ed0 | 1,817 | py | Python | augment_image.py | JayD1912/image_outpaint | 0b47d94c6cbd10f749ed717d7d5f76bba03c0d9d | [
"MIT"
] | null | null | null | augment_image.py | JayD1912/image_outpaint | 0b47d94c6cbd10f749ed717d7d5f76bba03c0d9d | [
"MIT"
] | null | null | null | augment_image.py | JayD1912/image_outpaint | 0b47d94c6cbd10f749ed717d7d5f76bba03c0d9d | [
"MIT"
] | null | null | null | import imgaug as ia
from imgaug import augmenters as iaa
import numpy as np
import random
import cv2
brightness = iaa.Add((-7, 7), per_channel=0.5)
contrast = iaa.LinearContrast((0.8, 1.6), per_channel=0.5)
perspective = iaa.PerspectiveTransform(scale=(0.025, 0.090))
gaussian_noise = iaa.AdditiveGaussianNoise... | 8.735577 | 95 | 0.521739 | import imgaug as ia
from imgaug import augmenters as iaa
import numpy as np
import random
import cv2
brightness = iaa.Add((-7, 7), per_channel=0.5)
contrast = iaa.LinearContrast((0.8, 1.6), per_channel=0.5)
perspective = iaa.PerspectiveTransform(scale=(0.025, 0.090))
gaussian_noise = iaa.AdditiveGaussianNoise... | 452 | 0 | 25 |
53f20f21d4816c8461ab14d8b28d336b630cfee5 | 54,739 | py | Python | pyinjective/proto/injective/peggy/v1/msgs_pb2.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 10 | 2021-09-07T08:03:52.000Z | 2022-03-08T08:39:30.000Z | pyinjective/proto/injective/peggy/v1/msgs_pb2.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 39 | 2021-08-19T20:09:35.000Z | 2022-03-22T19:51:59.000Z | pyinjective/proto/injective/peggy/v1/msgs_pb2.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 5 | 2021-11-02T16:23:48.000Z | 2022-01-20T22:30:05.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: injective/peggy/v1/msgs.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fro... | 43.861378 | 5,674 | 0.772502 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: injective/peggy/v1/msgs.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fro... | 0 | 0 | 0 |
1d8534395fdd5c7f55a83b8b80a845e28e72c98e | 272 | py | Python | Mundo 2_Estruturas de Controle/Desafio_64.py | VictorOliveira02/Desafios-Python3-Curso-em-Video | 53ee8bd814b816f3a21936677ef3f155b582843f | [
"MIT"
] | null | null | null | Mundo 2_Estruturas de Controle/Desafio_64.py | VictorOliveira02/Desafios-Python3-Curso-em-Video | 53ee8bd814b816f3a21936677ef3f155b582843f | [
"MIT"
] | null | null | null | Mundo 2_Estruturas de Controle/Desafio_64.py | VictorOliveira02/Desafios-Python3-Curso-em-Video | 53ee8bd814b816f3a21936677ef3f155b582843f | [
"MIT"
] | null | null | null | n = conta = soma = 0
n = int(input('Digite um valor para soma (999 para SAIR): '))
while n != 999:
soma = soma + n
conta = conta + 1
n = int(input('Digite um valor para soma (999 para SAIR): '))
print(f'A SOMA DOS {conta} VALORES É IGUAL Á {soma}.')
| 27.2 | 65 | 0.584559 | n = conta = soma = 0
n = int(input('Digite um valor para soma (999 para SAIR): '))
while n != 999:
soma = soma + n
conta = conta + 1
n = int(input('Digite um valor para soma (999 para SAIR): '))
print(f'A SOMA DOS {conta} VALORES É IGUAL Á {soma}.')
| 0 | 0 | 0 |
4d41a74f377233e4cdcc594f3e6d19359490d7d0 | 1,429 | py | Python | Section 3/imdb.py | PacktPublishing/-Natural-Language-Processing-in-Practice | c9d999bdb7ac499d3df4f25e3aa5f949d180ec22 | [
"MIT"
] | 15 | 2019-01-24T20:54:35.000Z | 2022-03-31T07:28:28.000Z | Section 3/imdb.py | PacktPublishing/-Natural-Language-Processing-in-Practice | c9d999bdb7ac499d3df4f25e3aa5f949d180ec22 | [
"MIT"
] | null | null | null | Section 3/imdb.py | PacktPublishing/-Natural-Language-Processing-in-Practice | c9d999bdb7ac499d3df4f25e3aa5f949d180ec22 | [
"MIT"
] | 13 | 2019-02-08T00:35:02.000Z | 2022-03-11T13:31:39.000Z | from keras.datasets import imdb
import keras
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers import Flatten, Dense
from keras.preprocessing import sequence
from numpy import array
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=5000)
word_t... | 34.02381 | 89 | 0.716585 | from keras.datasets import imdb
import keras
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers import Flatten, Dense
from keras.preprocessing import sequence
from numpy import array
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=5000)
word_t... | 0 | 0 | 0 |
4af8e420262bb1d6912fb82b24d8afd62bd757c1 | 657 | py | Python | packages/scikit-image/examples/plot_threshold.py | zmoon/scipy-lecture-notes | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | [
"CC-BY-4.0"
] | 2,538 | 2015-01-01T04:58:41.000Z | 2022-03-31T21:06:05.000Z | packages/scikit-image/examples/plot_threshold.py | zmoon/scipy-lecture-notes | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | [
"CC-BY-4.0"
] | 362 | 2015-01-18T14:16:23.000Z | 2021-11-18T16:24:34.000Z | packages/scikit-image/examples/plot_threshold.py | zmoon/scipy-lecture-notes | 75a89ddedeb48930dbdb6fe25a76e9ef0587ae21 | [
"CC-BY-4.0"
] | 1,127 | 2015-01-05T14:39:29.000Z | 2022-03-25T08:38:39.000Z | """
Otsu thresholding
==================
This example illustrates automatic Otsu thresholding.
"""
import matplotlib.pyplot as plt
from skimage import data
from skimage import filters
from skimage import exposure
camera = data.camera()
val = filters.threshold_otsu(camera)
hist, bins_center = exposure.histogram(came... | 21.193548 | 62 | 0.727549 | """
Otsu thresholding
==================
This example illustrates automatic Otsu thresholding.
"""
import matplotlib.pyplot as plt
from skimage import data
from skimage import filters
from skimage import exposure
camera = data.camera()
val = filters.threshold_otsu(camera)
hist, bins_center = exposure.histogram(came... | 0 | 0 | 0 |
4a399209469f54d6a0788f38c4cdc3ee7b55bff7 | 1,471 | py | Python | BS/BS_082_170521/main.py | Aleksey-Voko/Word_forms_bases | f14173cef830e7a514dfaefba3bbbf0c02a3ac0f | [
"MIT"
] | null | null | null | BS/BS_082_170521/main.py | Aleksey-Voko/Word_forms_bases | f14173cef830e7a514dfaefba3bbbf0c02a3ac0f | [
"MIT"
] | null | null | null | BS/BS_082_170521/main.py | Aleksey-Voko/Word_forms_bases | f14173cef830e7a514dfaefba3bbbf0c02a3ac0f | [
"MIT"
] | null | null | null | from BS.utils import read_src_bs, save_bs_dicts_to_txt, read_src_socket_bs, save_socket_bs_dicts_to_txt
if __name__ == '__main__':
change_template_bg()
| 36.775 | 103 | 0.588715 | from BS.utils import read_src_bs, save_bs_dicts_to_txt, read_src_socket_bs, save_socket_bs_dicts_to_txt
def change_template_bs():
word_forms_bases = list(read_src_bs('src_dict/БС 15.05.21.txt'))
for group in word_forms_bases:
title_form = group.title_word_form
if all([
title_fo... | 1,311 | 0 | 46 |
8f59783e7c2993679127dfa529b5ae4433b0fd0d | 456 | py | Python | config/conv.py | aarzilli/yacco | 8378d59579ed3644a8da6b3dd5ee85496e32f0c9 | [
"BSD-3-Clause"
] | 24 | 2018-05-09T12:43:15.000Z | 2022-03-06T01:58:49.000Z | config/conv.py | aarzilli/yacco | 8378d59579ed3644a8da6b3dd5ee85496e32f0c9 | [
"BSD-3-Clause"
] | 5 | 2019-04-21T20:06:04.000Z | 2020-05-11T07:41:28.000Z | config/conv.py | aarzilli/yacco | 8378d59579ed3644a8da6b3dd5ee85496e32f0c9 | [
"BSD-3-Clause"
] | 3 | 2019-04-23T09:06:54.000Z | 2020-05-09T14:48:30.000Z | #!/usr/bin/env python
convert("config/luxisr.ttf", "luxibytes")
convert("config/luximr.ttf", "luximonobytes")
convert("config/DejaVuSans.ttf", "dejabytes")
convert("config/DejaVuSansMono.ttf", "dejamonobytes")
| 25.333333 | 53 | 0.640351 | #!/usr/bin/env python
def convert(path, name):
v = open(path).read()
out = open("config/" + name + ".go", "w")
out.write("package config\n")
out.write("var " + name + " = []byte{\n\t")
for c in v:
out.write(str(ord(c)) + ", ")
out.write("}\n")
out.close()
convert("config/luxisr.ttf", "luxibytes")
convert("c... | 222 | 0 | 23 |
8b3383cc48592356ea045efba36bd7d2d0455bb9 | 3,744 | py | Python | Algos/base.py | benzomo/PyPackages | 880823315411f6bf812827f59dd3a4408052e9a6 | [
"MIT"
] | null | null | null | Algos/base.py | benzomo/PyPackages | 880823315411f6bf812827f59dd3a4408052e9a6 | [
"MIT"
] | null | null | null | Algos/base.py | benzomo/PyPackages | 880823315411f6bf812827f59dd3a4408052e9a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 25 15:32:42 2018
@author: benmo
"""
import pandas as pd, numpy as np
from .functions import *
| 35.320755 | 154 | 0.523504 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 25 15:32:42 2018
@author: benmo
"""
import pandas as pd, numpy as np
from .functions import *
def scale(df, columns=None, how='minmax'):
if columns == None:
columns=df.columns
class Transform():
def __init__(self, ... | 3,264 | 237 | 46 |
3a0357b70fc8ab6473954d253bcffcd7a4900065 | 2,110 | py | Python | Draft_Phuong/ternary_ver2/sample.py | phuong27102000/NTRU_HRSS_KEM_SV | fe4fd095134a41f4131a3aa953197e3933b303ad | [
"MIT"
] | null | null | null | Draft_Phuong/ternary_ver2/sample.py | phuong27102000/NTRU_HRSS_KEM_SV | fe4fd095134a41f4131a3aa953197e3933b303ad | [
"MIT"
] | null | null | null | Draft_Phuong/ternary_ver2/sample.py | phuong27102000/NTRU_HRSS_KEM_SV | fe4fd095134a41f4131a3aa953197e3933b303ad | [
"MIT"
] | null | null | null | import poly
| 25.119048 | 218 | 0.493839 | import poly
def fg_HPS(b,sib,sftb,n,q):
#len(b) must = sib + sftb
f = ter(b[0:sib],sib,n)
g = fixed_type(b[sib:sftb+sib],sftb,n,q)
g+=[0]
return f,g
def fg_HRSS(b,sib,n):
#len(b) must = 2*sib
f = ter_plus(b[0:sib],sib,n)
g0 = ter_plus(b[sib:2*sib],sib,n)
g = []
g += [-g0[... | 1,920 | 0 | 178 |
84756ffec0a18ca4293137fdbd786719cd66ced4 | 3,562 | py | Python | Classification/training.py | Natural-Goldfish/CatDogClassification | 5ae0fe8bc37c6ee8a1cd3bd75cc862c650822263 | [
"CECILL-B"
] | null | null | null | Classification/training.py | Natural-Goldfish/CatDogClassification | 5ae0fe8bc37c6ee8a1cd3bd75cc862c650822263 | [
"CECILL-B"
] | null | null | null | Classification/training.py | Natural-Goldfish/CatDogClassification | 5ae0fe8bc37c6ee8a1cd3bd75cc862c650822263 | [
"CECILL-B"
] | null | null | null | from src.dataset import CatDogDataset
from src.utils import *
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import os
_CUDA_FLAG = torch.cuda.is_available()
| 45.666667 | 121 | 0.667602 | from src.dataset import CatDogDataset
from src.utils import *
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import os
_CUDA_FLAG = torch.cuda.is_available()
def train(args):
train_dataset = CatDogDataset(mode = "train", img_path = args.img_path, annotation_path = args.a... | 3,337 | 0 | 23 |
a4623bf3c0b9253d21821dea3146c26d3d23d37a | 596 | py | Python | apiv2-python/api/vars.py | databeast/apicore | 2ac982e399d98510fc2bafed0aeb55eb0d2cf9c1 | [
"BSD-3-Clause"
] | null | null | null | apiv2-python/api/vars.py | databeast/apicore | 2ac982e399d98510fc2bafed0aeb55eb0d2cf9c1 | [
"BSD-3-Clause"
] | null | null | null | apiv2-python/api/vars.py | databeast/apicore | 2ac982e399d98510fc2bafed0aeb55eb0d2cf9c1 | [
"BSD-3-Clause"
] | null | null | null | from contextvars import ContextVar
current_user_role = ContextVar('role', default=None)
list_of_roles = ContextVar('roles', default=None)
current_user = ContextVar('users_ID', default=None)
headers = ContextVar('headers', default={})
nrpayload = ContextVar('nrpayload', default=None)
tid = ContextVar('tid', default=No... | 39.733333 | 61 | 0.785235 | from contextvars import ContextVar
current_user_role = ContextVar('role', default=None)
list_of_roles = ContextVar('roles', default=None)
current_user = ContextVar('users_ID', default=None)
headers = ContextVar('headers', default={})
nrpayload = ContextVar('nrpayload', default=None)
tid = ContextVar('tid', default=No... | 0 | 0 | 0 |