hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
61edf8e56aafc788890693ecef4b8284d295fe05 | 930 | py | Python | CV/HW3/CV_HW3.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null | CV/HW3/CV_HW3.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null | CV/HW3/CV_HW3.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null |
# coding: utf-8
from PIL import Image
lena= Image.open("lena.bmp")
pix=lena.load()
coulmn,row=lena.size
Histogram_Equalization(coulmn,row,pix)
| 25.135135 | 65 | 0.6 |
# coding: utf-8
from PIL import Image, ImageDraw
import matplotlib.pyplot as plt
import numpy as np
def Histogram_Equalization(coulmn,row,pix):
total=0
hist = np.zeros(256)
S_k = np.zeros(256)
count = np.zeros(256)
n = coulmn*row
for i in range(coulmn):
for j in range(row):
... | 0 | 0 | 0 | 0 | 0 | 699 | 0 | 18 | 67 |
548daa1583c314f07189eda313c66d2eb502233d | 227 | py | Python | Polygons..py | iNavneetKumar/cython | ad845eae4d6a0b750bd3c454a9f012c092e4f61d | [
"Apache-2.0"
] | null | null | null | Polygons..py | iNavneetKumar/cython | ad845eae4d6a0b750bd3c454a9f012c092e4f61d | [
"Apache-2.0"
] | null | null | null | Polygons..py | iNavneetKumar/cython | ad845eae4d6a0b750bd3c454a9f012c092e4f61d | [
"Apache-2.0"
] | null | null | null | import turtle
print('Draw Any polygon')
t = turtle.Turtle()
n = int(input("Enter the no of the sides of the polygon from 3 to 10 : "))
l = 80
for i in range(n):
turtle.forward(l)
turtle.right(360 / n)
| 22.7 | 75 | 0.60793 | import turtle
print('Draw Any polygon')
t = turtle.Turtle()
n = int(input("Enter the no of the sides of the polygon from 3 to 10 : "))
l = 80
for i in range(n):
turtle.forward(l)
turtle.right(360 / n)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d93e0e96295c740e1019a086570bd723e800fcb3 | 1,515 | py | Python | utils/fixroles.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | null | null | null | utils/fixroles.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | 1 | 2019-07-03T13:32:38.000Z | 2019-07-03T13:32:38.000Z | utils/fixroles.py | time-track-tool/time-track-tool | a1c280f32a7766e460c862633b748fa206256f24 | [
"MIT"
] | 1 | 2019-05-15T16:01:31.000Z | 2019-05-15T16:01:31.000Z | #!/usr/bin/python
import os
from roundup import instance
from roundup.password import Password, encodePassword
from optparse import OptionParser
dir = os.getcwd ()
tracker = instance.open (dir)
db = tracker.open ('admin')
"""
Fix roles: loop over all users and clean up roles that don't exist.
"""
cmd = ... | 26.578947 | 71 | 0.561056 | #!/usr/bin/python
import os
from roundup import instance
from roundup.password import Password, encodePassword
from optparse import OptionParser
dir = os.getcwd ()
tracker = instance.open (dir)
db = tracker.open ('admin')
"""
Fix roles: loop over all users and clean up roles that don'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0 |
5c2e66f730f37092345b01d3da460aa30630c6c5 | 717 | py | Python | docs/cornell CS class/lesson 7. Specifications/demos/read.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 7. Specifications/demos/read.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 7. Specifications/demos/read.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
A module with a function to read text
This module shows off a more complicated type of precondition
Author: Walker M. White
Date: February 14, 2019
"""
import introcs
def get_number(filename):
"""
Returns the number stored in the file <filename>
When we read a file, we get a string. This fun... | 25.607143 | 78 | 0.698745 | """
A module with a function to read text
This module shows off a more complicated type of precondition
Author: Walker M. White
Date: February 14, 2019
"""
import introcs
def get_number(filename):
"""
Returns the number stored in the file <filename>
When we read a file, we get a string. This fun... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab8c449f846854c05434976fef46667b2e0de732 | 2,387 | py | Python | speech2text.py | hooshvare/speech2text | ba1f5286027b8b4fd242b95eabc6d37339278722 | [
"MIT"
] | 2 | 2020-05-08T03:08:14.000Z | 2020-08-15T00:17:43.000Z | speech2text.py | hooshvare/speech2text | ba1f5286027b8b4fd242b95eabc6d37339278722 | [
"MIT"
] | null | null | null | speech2text.py | hooshvare/speech2text | ba1f5286027b8b4fd242b95eabc6d37339278722 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import os
import fleep
import arabic_reshaper
from bidi.algorithm import get_display
from src.mic import MicrophoneReader
from src.audio import AudioReader
if __name__ == "__main__":
parser = argparse.ArgumentParser(
formatter_class=argparse.Argument... | 26.820225 | 106 | 0.584416 | from __future__ import print_function
import argparse
import os
import fleep
import arabic_reshaper
from bidi.algorithm import get_display
from src.mic import MicrophoneReader
from src.audio import AudioReader
def str_to_bool(value):
if isinstance(value, bool):
return value
if value.lower() in ('yes'... | 0 | 0 | 0 | 0 | 0 | 288 | 0 | 0 | 23 |
9a5b9a6833337f441d6b54f056a2a4464b99aba8 | 8,928 | py | Python | csm_web/scheduler/serializers.py | shadaj/csm_web | aab7920987bf3212b6da7fa26bac24cca77c6d03 | [
"MIT"
] | null | null | null | csm_web/scheduler/serializers.py | shadaj/csm_web | aab7920987bf3212b6da7fa26bac24cca77c6d03 | [
"MIT"
] | null | null | null | csm_web/scheduler/serializers.py | shadaj/csm_web | aab7920987bf3212b6da7fa26bac24cca77c6d03 | [
"MIT"
] | null | null | null |
def make_omittable(field_class, omit_key, *args, predicate=None, **kwargs):
"""
Behaves exactly as if the field were defined directly by calling `field_class(*args, **kwargs)`,
except that if `omit_key` is present in the context when the field is serialized and predicate returns True,
the value is o... | 42.113208 | 166 | 0.692652 | from rest_framework import serializers
from enum import Enum
from django.utils import timezone
from .models import Attendance, Course, Student, Section, Mentor, Override, Spacetime, Coordinator, DayOfWeekField
class Role(Enum):
COORDINATOR = "COORDINATOR"
STUDENT = "STUDENT"
MENTOR = "MENTOR"
def get_pr... | 0 | 0 | 0 | 7,404 | 0 | 144 | 0 | 122 | 368 |
0aa2a8dd8d58c3904b9bfc1630e7146895834c9a | 1,691 | py | Python | formapi/utils.py | 5monkeys/django-formapi | 90b7604ddd3733cb3e329b8ea19ce45f63c9b307 | [
"MIT"
] | 17 | 2015-11-28T09:22:52.000Z | 2020-10-22T07:22:19.000Z | formapi/utils.py | 5monkeys/django-formapi | 90b7604ddd3733cb3e329b8ea19ce45f63c9b307 | [
"MIT"
] | 5 | 2016-10-12T20:27:10.000Z | 2018-04-23T19:41:40.000Z | formapi/utils.py | 5monkeys/django-formapi | 90b7604ddd3733cb3e329b8ea19ce45f63c9b307 | [
"MIT"
] | 8 | 2015-10-13T12:25:30.000Z | 2021-12-25T05:11:47.000Z |
from django.utils.encoding import smart_bytes, smart_str
def get_sign(secret, querystring=None, **params):
"""
Return sign for querystring.
Logic:
- Sort querystring by parameter keys and by value if two or more parameter keys share the same name
- URL encode sorted querystring
- Generate a ... | 33.82 | 103 | 0.653459 | import hashlib
import hmac
import uuid
from urllib.parse import quote
from django.utils.encoding import force_str, smart_bytes, smart_str
def get_sign(secret, querystring=None, **params):
"""
Return sign for querystring.
Logic:
- Sort querystring by parameter keys and by value if two or more paramet... | 0 | 0 | 0 | 0 | 0 | 515 | 0 | -7 | 134 |
9842213a12b311e77f6637608ee01f7a21f0f13d | 6,172 | py | Python | TileLoader.py | flailingsquirrel/asciimapper | 1f83d63912f029b90912fae54073f570be0f3f17 | [
"BSD-3-Clause"
] | null | null | null | TileLoader.py | flailingsquirrel/asciimapper | 1f83d63912f029b90912fae54073f570be0f3f17 | [
"BSD-3-Clause"
] | null | null | null | TileLoader.py | flailingsquirrel/asciimapper | 1f83d63912f029b90912fae54073f570be0f3f17 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
######################################################################
# Ascii TMS Viewer
#
#--------------------------------------------------------------------
# Brian Hone | Initial Release
#--------------------------------------------------------------------
# ... | 31.489796 | 100 | 0.598023 | #!/usr/bin/python
######################################################################
# Ascii TMS Viewer
#
#--------------------------------------------------------------------
# Brian Hone | Initial Release
#--------------------------------------------------------------------
# ... | 0 | 0 | 0 | 3,974 | 0 | 0 | 0 | 31 | 90 |
5f0c9dce773b27efb025423efc48e3d97a878118 | 19 | py | Python | colorstats/__init__.py | nramkissoon/ColorStats | e204293c12108a43655c71f9e3cd250eb73e2864 | [
"MIT"
] | 1 | 2022-03-21T10:14:07.000Z | 2022-03-21T10:14:07.000Z | colorstats/__init__.py | nramkissoon/ColorStats | e204293c12108a43655c71f9e3cd250eb73e2864 | [
"MIT"
] | null | null | null | colorstats/__init__.py | nramkissoon/ColorStats | e204293c12108a43655c71f9e3cd250eb73e2864 | [
"MIT"
] | null | null | null | name = "colorstats" | 19 | 19 | 0.736842 | name = "colorstats" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2a132b5d94a4be9a6c0b5b5cbc7ec02e1f5efd0 | 2,655 | py | Python | tests/test_gs.py | kktsubota/piq | 831e4176424c0072ddba594d0f0a6648595df744 | [
"Apache-2.0"
] | 471 | 2020-06-20T00:28:09.000Z | 2022-03-28T01:55:14.000Z | tests/test_gs.py | kktsubota/piq | 831e4176424c0072ddba594d0f0a6648595df744 | [
"Apache-2.0"
] | 220 | 2020-06-19T16:14:23.000Z | 2022-03-29T21:45:52.000Z | tests/test_gs.py | kktsubota/piq | 831e4176424c0072ddba594d0f0a6648595df744 | [
"Apache-2.0"
] | 50 | 2020-08-30T14:19:44.000Z | 2022-03-25T18:05:21.000Z |
# ================== Test class: `GS` ==================
| 29.175824 | 91 | 0.686629 | import pytest
import torch
import subprocess
import sys
import builtins
from piq import GS
@pytest.fixture(scope='module')
def features_y_normal() -> torch.Tensor:
return torch.rand(1000, 20)
@pytest.fixture(scope='module')
def features_x_normal() -> torch.Tensor:
return torch.rand(1000, 20)
@pytest.fixt... | 0 | 1,640 | 0 | 0 | 0 | 602 | 0 | -41 | 385 |
087f361ea1640fcadde8f57bb36a03ed7ac3c763 | 2,839 | py | Python | console/mirage.py | shotastage/mirage-django | afdc1ca1fa6db01af174cf31310b6ef690d9254a | [
"Apache-2.0"
] | null | null | null | console/mirage.py | shotastage/mirage-django | afdc1ca1fa6db01af174cf31310b6ef690d9254a | [
"Apache-2.0"
] | 77 | 2019-05-10T22:24:54.000Z | 2021-07-02T03:11:01.000Z | console/mirage.py | shotastage/mirage-django | afdc1ca1fa6db01af174cf31310b6ef690d9254a | [
"Apache-2.0"
] | 1 | 2018-12-08T09:57:54.000Z | 2018-12-08T09:57:54.000Z | """
MIRAGE Console
mirage.py
Created by Shota Shimazu on 2018/06/05
Copyright (c) 2018-2020 Shota Shimazu All Rights Reserved.
This software is released under the Apache License, see LICENSE for detail.
https://github.com/shotastage/mirageframework/blob/master/LICENSE
"""
| 35.4875 | 107 | 0.697076 | """
MIRAGE Console
mirage.py
Created by Shota Shimazu on 2018/06/05
Copyright (c) 2018-2020 Shota Shimazu All Rights Reserved.
This software is released under the Apache License, see LICENSE for detail.
https://github.com/shotastage/mirageframework/blob/master/LICENSE
"""
import sys
from console.mgargparse import ... | 0 | 0 | 0 | 0 | 0 | 2,417 | 0 | 53 | 91 |
aa3b221745e4ef61aae3e53d10418bb466abb8b3 | 1,667 | py | Python | tests/test_planners/test_planner_grid.py | priyansh-1902/olympus | f57ad769918c0d5d805c439ab5ffbd180af698fa | [
"MIT"
] | 36 | 2020-10-10T14:05:40.000Z | 2022-02-12T07:21:47.000Z | tests/test_planners/test_planner_grid.py | kiminh/olympus | 054f7b4012faf6e516b5e4c895093c9fea0c793f | [
"MIT"
] | 12 | 2020-10-14T09:04:06.000Z | 2021-10-01T19:25:34.000Z | tests/test_planners/test_planner_grid.py | kiminh/olympus | 054f7b4012faf6e516b5e4c895093c9fea0c793f | [
"MIT"
] | 8 | 2020-10-24T12:43:45.000Z | 2022-02-12T07:21:50.000Z | #!/usr/bin/env python
# use parametrize to test multiple configurations of the planner
| 35.468085 | 107 | 0.629874 | #!/usr/bin/env python
import pytest
from olympus import Observations, ParameterVector
from olympus.planners import Grid
import numpy as np
# use parametrize to test multiple configurations of the planner
@pytest.mark.parametrize("levels, budget, shuffle, random_seed",
[(2, None, False, None)... | 0 | 756 | 0 | 0 | 0 | 658 | 0 | 29 | 134 |
35306e0231697ba185207806473287d0fedeb3d8 | 45 | py | Python | demos/python/hello.py | hustliyilin/occlum | e1789dc89f9d7b4bab76951c5dafe1d35b1bd885 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-04-28T06:25:12.000Z | 2020-04-28T06:25:12.000Z | demos/python/hello.py | hustliyilin/occlum | e1789dc89f9d7b4bab76951c5dafe1d35b1bd885 | [
"BSD-3-Clause-Clear"
] | null | null | null | demos/python/hello.py | hustliyilin/occlum | e1789dc89f9d7b4bab76951c5dafe1d35b1bd885 | [
"BSD-3-Clause-Clear"
] | null | null | null | # Sample code
print('Hello World, Python!')
| 11.25 | 29 | 0.688889 | # Sample code
print('Hello World, Python!')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b0dd66fddb91fb79e0c38cd37924e9d4549be808 | 289 | py | Python | contest/abc155/C.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc155/C.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | contest/abc155/C.py | mola1129/atcoder | 1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db | [
"MIT"
] | null | null | null | import collections
n = int(input())
s = [input() for _ in range(n)]
s = collections.Counter(s).most_common()
ans = []
for i in range(1, len(s) + 1):
ans.append(s[i - 1][0])
if i == len(s):
break
if s[i - 1][1] != s[i][1]:
break
ans.sort()
print(*ans, sep='\n')
| 20.642857 | 40 | 0.529412 | import collections
n = int(input())
s = [input() for _ in range(n)]
s = collections.Counter(s).most_common()
ans = []
for i in range(1, len(s) + 1):
ans.append(s[i - 1][0])
if i == len(s):
break
if s[i - 1][1] != s[i][1]:
break
ans.sort()
print(*ans, sep='\n')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
19742406313273fb23093f333dfbc15c06182c99 | 4,162 | py | Python | argtyped/custom_types.py | guhur/argtyped | 39ce53d5d05004ea3a622c0df9a1499f8a2abbf5 | [
"MIT"
] | null | null | null | argtyped/custom_types.py | guhur/argtyped | 39ce53d5d05004ea3a622c0df9a1499f8a2abbf5 | [
"MIT"
] | null | null | null | argtyped/custom_types.py | guhur/argtyped | 39ce53d5d05004ea3a622c0df9a1499f8a2abbf5 | [
"MIT"
] | null | null | null | import enum
from typing import Any, Optional, Tuple, Type, TypeVar, Union
__all__ = [
"Choices",
"Enum",
"auto", # also export auto for convenience
"Switch",
"is_choices",
"is_enum",
"is_optional",
"unwrap_optional",
]
auto = enum.auto
NoneType = type(None)
T = TypeVar('T')
Choice... | 33.564516 | 120 | 0.649688 | import enum
from typing import Any, Iterable, Optional, Tuple, Type, TypeVar, Union
__all__ = [
"Choices",
"Enum",
"auto", # also export auto for convenience
"Switch",
"is_choices",
"is_enum",
"is_optional",
"unwrap_optional",
]
auto = enum.auto
NoneType = type(None)
T = TypeVar('T')... | 0 | 0 | 0 | 797 | 0 | 0 | 0 | 10 | 46 |
8b73132733f7fe93253f6b10a5d86e2bba97013b | 15,046 | py | Python | faster_lime/explainers/numpy_robust_tabular_explainer.py | seansaito/Faster-LIME | 68cd0900858d9e087cf27ac67b1bf31d2fd02a36 | [
"MIT"
] | 4 | 2020-07-31T08:09:25.000Z | 2021-01-15T09:49:18.000Z | faster_lime/explainers/numpy_robust_tabular_explainer.py | seansaito/Faster-LIME | 68cd0900858d9e087cf27ac67b1bf31d2fd02a36 | [
"MIT"
] | null | null | null | faster_lime/explainers/numpy_robust_tabular_explainer.py | seansaito/Faster-LIME | 68cd0900858d9e087cf27ac67b1bf31d2fd02a36 | [
"MIT"
] | 2 | 2021-03-21T01:00:54.000Z | 2022-03-26T15:30:35.000Z | import numpy as np
if __name__ == '__main__':
from experiments.utils.dataset_utils import get_and_preprocess_compas_data
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
data = get_and_preprocess_compas_data()
X, y, _ = data['data'], data[... | 45.319277 | 106 | 0.622092 | import numpy as np
from ctgan import CTGANSynthesizer
from scipy.spatial.distance import cdist
from sklearn.linear_model import Ridge
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from faster_lime.utils import dict_disc_to_bin
def ridge_solve(tup):
data_synthetic_onehot, model_pred, weights = t... | 0 | 0 | 0 | 13,147 | 0 | 344 | 0 | 116 | 157 |
225dcea16fc6be709745d0c1a04f2483e917baa4 | 3,734 | py | Python | python/simeck.py | lyumoon/Simeck | c48011a37a84792afff20b415fffa817e7b0212e | [
"MIT"
] | 13 | 2016-07-19T13:54:13.000Z | 2021-11-29T08:28:23.000Z | python/simeck.py | lyumoon/Simeck | c48011a37a84792afff20b415fffa817e7b0212e | [
"MIT"
] | null | null | null | python/simeck.py | lyumoon/Simeck | c48011a37a84792afff20b415fffa817e7b0212e | [
"MIT"
] | 5 | 2016-09-03T17:58:25.000Z | 2021-02-15T15:02:23.000Z | #!/usr/bin/env python
NUM_ROUNDS = {
# (block_size, key_size): num_rounds
(32, 64): 32,
(48, 96): 36,
(64, 128): 44,
}
if __name__ == '__main__':
main()
| 30.859504 | 73 | 0.600161 | #!/usr/bin/env python
NUM_ROUNDS = {
# (block_size, key_size): num_rounds
(32, 64): 32,
(48, 96): 36,
(64, 128): 44,
}
def get_sequence(num_rounds):
if num_rounds < 40:
states = [1] * 5
else:
states = [1] * 6
for i in range(num_rounds - 5):
if num_rounds < 40:
... | 0 | 0 | 0 | 2,159 | 0 | 1,302 | 0 | 0 | 92 |
0ee8eef1457888852ba70902402e504c78c100a0 | 2,195 | py | Python | commands/utils/serversettings.py | Robertoskb/Betozinho | 5b8e2413c66452bb50d358178f77b3bb17726079 | [
"MIT"
] | null | null | null | commands/utils/serversettings.py | Robertoskb/Betozinho | 5b8e2413c66452bb50d358178f77b3bb17726079 | [
"MIT"
] | null | null | null | commands/utils/serversettings.py | Robertoskb/Betozinho | 5b8e2413c66452bb50d358178f77b3bb17726079 | [
"MIT"
] | null | null | null |
TABLE = 'serversettings'
| 26.130952 | 92 | 0.570843 | import mysql.connector
from decouple import config
TABLE = 'serversettings'
class ServerSettings:
def __init__(self, server):
self.con = self._get_con()
self.cursor = self._get_cursor()
self.server = self._checkServer(server)
def __del__(self):
if self.con.is_connected(... | 0 | 0 | 0 | 2,093 | 0 | 0 | 0 | 7 | 67 |
ca36f7d9f2131160e861599e6093d638e919cfc0 | 499 | py | Python | Python/GcdSUM.py | thefool76/hacktoberfest2021 | 237751e17a4fc325ded29fca013fb9f5853cd27c | [
"CC0-1.0"
] | 448 | 2021-10-01T04:24:14.000Z | 2022-03-06T14:34:20.000Z | Python/GcdSUM.py | Chanaka-Madushan-Herath/hacktoberfest2021 | 8473df9e058ccb6049720dd372342e0ea60f0e59 | [
"CC0-1.0"
] | 282 | 2021-10-01T04:29:06.000Z | 2022-03-07T12:42:57.000Z | Python/GcdSUM.py | Chanaka-Madushan-Herath/hacktoberfest2021 | 8473df9e058ccb6049720dd372342e0ea60f0e59 | [
"CC0-1.0"
] | 1,807 | 2021-10-01T04:24:02.000Z | 2022-03-28T04:51:25.000Z | import math
try:
testcase=int(input())
except:
print("Please enter a number")
testcase = 0
while testcase!=0:
gcd=0
try:
num=int(input())
except:
print("please enter a number")
num = 0
while gcd==0:
suma=0
for i in str(num):
suma=suma+int(i)... | 15.59375 | 38 | 0.468938 | import math
try:
testcase=int(input())
except:
print("Please enter a number")
testcase = 0
while testcase!=0:
gcd=0
try:
num=int(input())
except:
print("please enter a number")
num = 0
while gcd==0:
suma=0
for i in str(num):
suma=suma+int(i)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dc018b79b1ca879c1e97db6555a92b68c9930657 | 844 | py | Python | setup.py | ishadongre/my-first-blog | 07f19206209a2194a60b30ed8a33d43aa51166e7 | [
"BSD-3-Clause"
] | 44 | 2016-03-29T12:08:22.000Z | 2022-03-31T18:50:41.000Z | setup.py | ishadongre/my-first-blog | 07f19206209a2194a60b30ed8a33d43aa51166e7 | [
"BSD-3-Clause"
] | 11 | 2016-06-15T14:58:11.000Z | 2019-04-23T11:41:49.000Z | setup.py | ishadongre/my-first-blog | 07f19206209a2194a60b30ed8a33d43aa51166e7 | [
"BSD-3-Clause"
] | 25 | 2016-03-29T12:10:11.000Z | 2020-08-03T20:52:36.000Z | #!/usr/bin/env python
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
requires = ['']
setup(name... | 29.103448 | 79 | 0.693128 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
... | 0 | 0 | 0 | 0 | 0 | 66 | 0 | -12 | 44 |
fe9ee9584b3dd0161aa77809c745d90dc4239ac1 | 879 | py | Python | setup.py | AstrocyteResearch/financial-planner | 23d817e9221e308c48b35753bd4ce505cfb1944d | [
"Apache-2.0"
] | 2 | 2020-05-04T01:28:49.000Z | 2021-05-04T07:43:31.000Z | setup.py | AstrocyteResearch/financial-planner | 23d817e9221e308c48b35753bd4ce505cfb1944d | [
"Apache-2.0"
] | 2 | 2020-05-16T01:25:02.000Z | 2021-06-04T01:37:03.000Z | setup.py | AstrocyteResearch/financial-planner | 23d817e9221e308c48b35753bd4ce505cfb1944d | [
"Apache-2.0"
] | 3 | 2020-05-12T20:50:12.000Z | 2020-05-14T04:22:35.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 14 15:50:17 2015
@author: closedloop
"""
from setuptools import setup, find_packages
from setuptools import setup
import datetime
cur_year = datetime.datetime.today().year
setup(name='financial_planner',
version=open('VERSION').read(),
descriptio... | 32.555556 | 95 | 0.673493 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 14 15:50:17 2015
@author: closedloop
"""
from setuptools import setup, find_packages
from setuptools import setup
import datetime
cur_year = datetime.datetime.today().year
setup(name='financial_planner',
version=open('VERSION').read(),
descriptio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6e8f5c8a1d2baf80a406dbaafed3b297bd45dda8 | 13,887 | py | Python | pypykatz/alsadecryptor/lsa_template_nt6.py | wisdark/pypykatz | 7dccf2fa52532586da9b5ae3e849928b4ba5a3ba | [
"MIT"
] | 1,861 | 2018-05-26T11:16:39.000Z | 2022-03-24T19:48:55.000Z | pypykatz/alsadecryptor/lsa_template_nt6.py | wisdark/pypykatz | 7dccf2fa52532586da9b5ae3e849928b4ba5a3ba | [
"MIT"
] | 77 | 2018-05-28T21:43:31.000Z | 2021-12-05T00:11:31.000Z | pypykatz/alsadecryptor/lsa_template_nt6.py | wisdark/pypykatz | 7dccf2fa52532586da9b5ae3e849928b4ba5a3ba | [
"MIT"
] | 270 | 2018-05-26T16:42:14.000Z | 2022-03-24T03:05:08.000Z | #!/usr/bin/env python3
#
# Author:
# Tamas Jos (@skelsec)
#
templates = {
'nt6' : {
'x64' : {
'1' : LSA_x64_1(),
'2' : LSA_x64_2(),
'3' : LSA_x64_3(),
'4' : LSA_x64_4(),
'5' : LSA_x64_5(),
'6' : LSA_x64_6(),
},
'x86': {
'1' : LSA_x86_1(),
'2' : LSA_x86_2(),
'3' : LSA_x86_3(... | 31.561364 | 148 | 0.738028 | #!/usr/bin/env python3
#
# Author:
# Tamas Jos (@skelsec)
#
from pypykatz.alsadecryptor.win_datatypes import ULONG, PVOID, POINTER
from pypykatz.commons.common import KatzSystemArchitecture, WindowsMinBuild, WindowsBuild
from pypykatz.alsadecryptor.package_commons import PackageTemplate
class LsaTemplate_NT6(Packag... | 0 | 5,332 | 0 | 7,453 | 0 | 0 | 0 | 162 | 543 |
509c07a838b6c459889671947c123a9d5a995665 | 963 | py | Python | p25.py | fiskenslakt/aoc-2019 | c8f01fa1abe1a8b93e54605c3191cf7cd1a94ef4 | [
"MIT"
] | null | null | null | p25.py | fiskenslakt/aoc-2019 | c8f01fa1abe1a8b93e54605c3191cf7cd1a94ef4 | [
"MIT"
] | 1 | 2021-06-02T00:48:23.000Z | 2021-06-02T00:48:23.000Z | p25.py | fiskenslakt/aoc-2019 | c8f01fa1abe1a8b93e54605c3191cf7cd1a94ef4 | [
"MIT"
] | null | null | null |
from aocd import data
droid = Droid(data)
droid.execute()
| 27.514286 | 82 | 0.521288 | from collections import deque
from aocd import data
from intcode import Computer
class Droid(Computer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.queue = deque()
def _op_4(self, *args, **kwargs):
super()._op_4(*args, **kwargs)
print(chr(self... | 0 | 0 | 0 | 818 | 0 | 0 | 0 | 15 | 68 |
e8f68164db5e99b4ec76026df193c4bbee7e05e6 | 2,544 | py | Python | cohesity_management_sdk/models/site_identity.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-09-24T17:35:53.000Z | 2022-03-25T08:08:47.000Z | cohesity_management_sdk/models/site_identity.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-03-29T19:32:29.000Z | 2022-01-03T23:16:45.000Z | cohesity_management_sdk/models/site_identity.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 16 | 2019-02-27T06:54:12.000Z | 2021-11-16T18:10:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
| 31.02439 | 81 | 0.588443 | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class SiteIdentity(object):
"""Implementation of the 'SiteIdentity' model.
O365 Sharepoint online Site Identity. These may be obtained by Graph/REST
or PnP cmdlets. All fields are case insensitive.
Attributes:
id (string): Unique guid fo... | 0 | 947 | 0 | 1,517 | 0 | 0 | 0 | 0 | 23 |
fc43d3f2f748406df15649b6d8997710784e66c2 | 4,907 | py | Python | modules/dbnd/src/targets/value_meta.py | kalebinn/dbnd | 89b6ac3537f861784be73ffe8989bf63fca7401c | [
"Apache-2.0"
] | null | null | null | modules/dbnd/src/targets/value_meta.py | kalebinn/dbnd | 89b6ac3537f861784be73ffe8989bf63fca7401c | [
"Apache-2.0"
] | null | null | null | modules/dbnd/src/targets/value_meta.py | kalebinn/dbnd | 89b6ac3537f861784be73ffe8989bf63fca7401c | [
"Apache-2.0"
] | null | null | null | import typing
if typing.TYPE_CHECKING:
# keep it below VALUE_PREVIEW_MAX_LEN at web
_DEFAULT_VALUE_PREVIEW_MAX_LEN = 10000
| 35.817518 | 76 | 0.55431 | import typing
import attr
from dbnd._core.constants import MetricSource
from dbnd._core.tracking.log_data_request import LogDataRequest
from dbnd._core.tracking.schemas.metrics import Metric
from dbnd._core.utils.timezone import utcnow
if typing.TYPE_CHECKING:
from typing import Any, Dict, List, Optional, Seque... | 0 | 4,435 | 0 | 0 | 0 | 0 | 0 | 159 | 184 |
42a408dee9cf42573a33022e810cbebe77c57e56 | 434 | py | Python | app/views/home.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | null | null | null | app/views/home.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | 1 | 2021-04-20T14:56:31.000Z | 2021-04-20T14:56:31.000Z | app/views/home.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | null | null | null | """Home routing
/login/ and /logout/ routes are automatically added by flask-CAS extension
"""
# Third party imports
from flask import Blueprint
bp = Blueprint('main', __name__)
| 17.36 | 74 | 0.707373 | """Home routing
/login/ and /logout/ routes are automatically added by flask-CAS extension
"""
# Third party imports
from flask import Blueprint
from flask import render_template
bp = Blueprint('main', __name__)
@bp.route('/')
def index():
return render_template("index.html")
@bp.route('/about')
def about():
... | 0 | 148 | 0 | 0 | 0 | 0 | 0 | 12 | 91 |
24d406763ab984b6e99aea70a852a234a792a765 | 243 | py | Python | io/use_pickle.py | semoren/learn_python | d3140c3d4cb2bdb674d9c072c4195ebcfe686be3 | [
"Apache-2.0"
] | null | null | null | io/use_pickle.py | semoren/learn_python | d3140c3d4cb2bdb674d9c072c4195ebcfe686be3 | [
"Apache-2.0"
] | null | null | null | io/use_pickle.py | semoren/learn_python | d3140c3d4cb2bdb674d9c072c4195ebcfe686be3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pickle
d = dict(name='bob', age=20, score=80)
print(pickle.dumps(d))
f = open('dump.txt','wb')
pickle.dump(d,f)
f.close()
f = open('dump.txt', 'rb')
d = pickle.load(f)
f.close()
print(d) | 16.2 | 38 | 0.613169 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pickle
d = dict(name='bob', age=20, score=80)
print(pickle.dumps(d))
f = open('dump.txt','wb')
pickle.dump(d,f)
f.close()
f = open('dump.txt', 'rb')
d = pickle.load(f)
f.close()
print(d) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f1abfe5983b59c1000a4324d9a8915b8dba96fc9 | 1,478 | py | Python | discordobjects/dynamic/audited_objects.py | igo95862/DiscordBot_lib | 09624864a369751441a6eed2b3d0449f03c52151 | [
"MIT"
] | null | null | null | discordobjects/dynamic/audited_objects.py | igo95862/DiscordBot_lib | 09624864a369751441a6eed2b3d0449f03c52151 | [
"MIT"
] | null | null | null | discordobjects/dynamic/audited_objects.py | igo95862/DiscordBot_lib | 09624864a369751441a6eed2b3d0449f03c52151 | [
"MIT"
] | null | null | null | # TODO
'''
class LiveGuildMembersAudited(LiveGuildMembers):
def __init__(self):
self.audit_kick_stack = AuditStackKicks(self.client_bind, self.guild_id)
self.audit_ban_add_stack = AuditStackBanAdd(self.client_bind, self.guild_id)
self.invite_stack = InviteStack(self.client_bind, self.guild... | 41.055556 | 114 | 0.681326 | # TODO
'''
class LiveGuildMembersAudited(LiveGuildMembers):
def __init__(self):
self.audit_kick_stack = AuditStackKicks(self.client_bind, self.guild_id)
self.audit_ban_add_stack = AuditStackBanAdd(self.client_bind, self.guild_id)
self.invite_stack = InviteStack(self.client_bind, self.guild... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8314819ae0fbbff50429100471e1c056dc08655f | 626 | py | Python | example.py | lietu/wsps-python | 782146880bd47c3d96b2550e48cceeffcb9c2c2e | [
"BSD-3-Clause"
] | null | null | null | example.py | lietu/wsps-python | 782146880bd47c3d96b2550e48cceeffcb9c2c2e | [
"BSD-3-Clause"
] | null | null | null | example.py | lietu/wsps-python | 782146880bd47c3d96b2550e48cceeffcb9c2c2e | [
"BSD-3-Clause"
] | null | null | null | from time import sleep
from wsps import WSPSClient
if __name__ == "__main__":
subscribe_key = "subscribe-key"
publish_key = "publish-key"
wsps = WSPSClient("ws://127.0.0.1:52525", on_close)
wsps.connect()
wsps.subscribe("some-channel", on_msg, subscribe_key)
sleep(0.25)
wsps.publish("some-... | 27.217391 | 70 | 0.624601 | from time import sleep
from wsps import WSPSClient
if __name__ == "__main__":
subscribe_key = "subscribe-key"
publish_key = "publish-key"
def on_close(code, reason):
print("Disconnected with code {}, reason was: {}".format(
code, reason
))
def on_msg(packet):
print... | 0 | 0 | 0 | 0 | 0 | 166 | 0 | 0 | 54 |
1df19a40efbecaa9a68223b1b11563a09f7fc922 | 14,341 | py | Python | Linked_List/Problems.py | daniel-zeiler/potential-happiness | 1c9d503a52c35dab8b031f72e63725578735ac73 | [
"MIT"
] | null | null | null | Linked_List/Problems.py | daniel-zeiler/potential-happiness | 1c9d503a52c35dab8b031f72e63725578735ac73 | [
"MIT"
] | null | null | null | Linked_List/Problems.py | daniel-zeiler/potential-happiness | 1c9d503a52c35dab8b031f72e63725578735ac73 | [
"MIT"
] | null | null | null |
"""
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 it... | 26.169708 | 279 | 0.69249 | class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
from typing import Optional, List
"""
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add... | 0 | 0 | 0 | 687 | 0 | 809 | 0 | 12 | 390 |
4a998e2e04704891f9742380d8fabb71f6c737a9 | 2,026 | py | Python | promgen/apps.py | like-inspur/promgen | 2e5818c2734221b93fc34025252c6c90f9ca45b8 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | promgen/apps.py | like-inspur/promgen | 2e5818c2734221b93fc34025252c6c90f9ca45b8 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | promgen/apps.py | like-inspur/promgen | 2e5818c2734221b93fc34025252c6c90f9ca45b8 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import logging
logger = logging.getLogger(__name__)
| 32.15873 | 76 | 0.657453 | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
import logging
from django.apps import AppConfig
from django.db.models.signals import post_migrate
import warnings
logger = logging.getLogger(__name__)
def default_admin(sender, interactive, **kwargs)... | 0 | 0 | 0 | 274 | 0 | 1,386 | 0 | 34 | 159 |
c8b5786813a0c3e87d505b78f8ef58d5a186d763 | 257 | py | Python | python/mpi4py/hello_py2/hello_mpi.py | stu314159/HPC_Introduction_with_LBM | cbba81460513166b4814f3028807020be9b5c234 | [
"MIT"
] | null | null | null | python/mpi4py/hello_py2/hello_mpi.py | stu314159/HPC_Introduction_with_LBM | cbba81460513166b4814f3028807020be9b5c234 | [
"MIT"
] | null | null | null | python/mpi4py/hello_py2/hello_mpi.py | stu314159/HPC_Introduction_with_LBM | cbba81460513166b4814f3028807020be9b5c234 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 14 07:51:51 2021
@author: sblair
"""
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank();
size = comm.Get_size();
print 'Hello from process %d of %d!!' % (rank, size);
| 16.0625 | 53 | 0.642023 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 14 07:51:51 2021
@author: sblair
"""
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank();
size = comm.Get_size();
print 'Hello from process %d of %d!!' % (rank, size);
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
14867c56c929fc06ada4a10ea3359cdb4b93a8ff | 339 | py | Python | examples/image/show.py | dhaase-de/dh-python-dh | 40b04407e5f67ec261f559263718ec2b2588dabb | [
"MIT"
] | null | null | null | examples/image/show.py | dhaase-de/dh-python-dh | 40b04407e5f67ec261f559263718ec2b2588dabb | [
"MIT"
] | null | null | null | examples/image/show.py | dhaase-de/dh-python-dh | 40b04407e5f67ec261f559263718ec2b2588dabb | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import dh.data
if __name__ == "__main__":
main()
| 17.842105 | 56 | 0.60472 | #!/usr/bin/python3
import dh.data
import dh.image
def main():
L = dh.data.lena()
P = dh.data.pal()
B = dh.data.background()
dh.image.show(L, wait=0, closeWindow=True)
dh.image.show([L, P, B], wait=0, closeWindow=True)
dh.image.show([[L, P, B]], wait=0, closeWindow=True)
if __name__ == "__m... | 0 | 0 | 0 | 0 | 0 | 224 | 0 | -6 | 45 |
c54bf9f597fc72198c6d3062f1b9369a199bb127 | 554 | py | Python | algorithms/compare-the-triplets.py | gajubadge11/HackerRank-1 | 7b136ccaa1ed47ae737467ace6b494c720ccb942 | [
"MIT"
] | 340 | 2018-06-17T19:45:56.000Z | 2022-03-22T02:26:15.000Z | algorithms/compare-the-triplets.py | gajubadge11/HackerRank-1 | 7b136ccaa1ed47ae737467ace6b494c720ccb942 | [
"MIT"
] | 3 | 2021-02-02T17:17:29.000Z | 2021-05-18T10:06:04.000Z | algorithms/compare-the-triplets.py | gajubadge11/HackerRank-1 | 7b136ccaa1ed47ae737467ace6b494c720ccb942 | [
"MIT"
] | 229 | 2019-04-20T08:28:49.000Z | 2022-03-31T04:23:52.000Z | #!/bin/python3
a0, a1, a2 = input().strip().split(' ')
a0, a1, a2 = [int(a0), int(a1), int(a2)]
b0, b1, b2 = input().strip().split(' ')
b0, b1, b2 = [int(b0), int(b1), int(b2)]
result = solve(a0, a1, a2, b0, b1, b2)
print (" ".join(map(str, result)))
| 19.103448 | 40 | 0.472924 | #!/bin/python3
import sys
def solve(a0, a1, a2, b0, b1, b2):
alice = bob = 0
if a0 > b0:
alice += 1
elif a0 < b0:
bob += 1
if a1 > b1:
alice += 1
elif a1 < b1:
bob += 1
if a2 > b2:
alice += 1
elif a2 < b2:
bob += 1
return alice, bob
a0, ... | 0 | 0 | 0 | 0 | 0 | 265 | 0 | -11 | 46 |
ba672e3a602a77c24e84664ab835d313aea26f47 | 10,117 | py | Python | src/blacksmith/service/_async/route_proxy.py | mardiros/blacksmith | c86a870da04b0d916f243cb51f8861529284337d | [
"BSD-3-Clause"
] | 15 | 2022-01-16T15:23:23.000Z | 2022-01-20T21:42:53.000Z | src/blacksmith/service/_async/route_proxy.py | mardiros/blacksmith | c86a870da04b0d916f243cb51f8861529284337d | [
"BSD-3-Clause"
] | 9 | 2022-01-11T19:42:42.000Z | 2022-01-26T20:24:23.000Z | src/blacksmith/service/_async/route_proxy.py | mardiros/blacksmith | c86a870da04b0d916f243cb51f8861529284337d | [
"BSD-3-Clause"
] | null | null | null | from typing import Tuple, Union
from blacksmith.domain.model import (HTTPTimeout)
from blacksmith.middleware._async.base import AsyncHTTPMiddleware
ClientTimeout = Union[HTTPTimeout, float, Tuple[float, float]]
HTTPAuthentication = AsyncHTTPMiddleware
def build_timeout(timeout: ClientTimeout) -> HTTPTimeout:
"""... | 33.170492 | 82 | 0.638529 | from typing import Any, Dict, Generic, List, Optional, Tuple, Type, Union
from blacksmith.domain.exceptions import (
NoContractException,
UnregisteredRouteException,
WrongRequestTypeException,
)
from blacksmith.domain.model import (
CollectionIterator,
HTTPRequest,
HTTPResponse,
HTTPTimeout... | 0 | 0 | 5,589 | 3,309 | 0 | 0 | 0 | 521 | 157 |
67def3ea93ef9ac2ea9589ea3e463c29195ac21b | 19,729 | py | Python | print.py | Najsztub/sweden_trip | d6761802ef51dad6be78d20c2b476a4889fdf1be | [
"MIT"
] | null | null | null | print.py | Najsztub/sweden_trip | d6761802ef51dad6be78d20c2b476a4889fdf1be | [
"MIT"
] | null | null | null | print.py | Najsztub/sweden_trip | d6761802ef51dad6be78d20c2b476a4889fdf1be | [
"MIT"
] | null | null | null | import os
import numpy as np
import argparse
import matplotlib.pyplot as plt
def gen_boxes(tiles, dx=10, dy=10, minpx=0):
""" Generate boxes by dividing the canvas. """
box_list = []
(size_y, size_x) = tiles.tile_array.shape
for n_x in range(int(np.ceil(size_x/dx))):
for n_y in range(int(n... | 38.383268 | 121 | 0.511987 | import os
import re
import numpy as np
import math
from PIL import Image, ImageDraw, ImageOps, ImageEnhance, ImageFont
import argparse
import gpxpy
import utils
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
class Tiles:
"""Class for tiles"""
def __init__(self, path, zoom, tile_size... | 0 | 895 | 0 | 12,370 | 0 | 0 | 0 | 25 | 264 |
de0c0d94dbc32b6e4be2a9a4dc3ed2907960032c | 1,632 | py | Python | demo/05_curve_field_demo.py | bond-anton/BDSpaceVis | 5108175ffba2ae85a1be271534886d3589ad2762 | [
"Apache-2.0"
] | null | null | null | demo/05_curve_field_demo.py | bond-anton/BDSpaceVis | 5108175ffba2ae85a1be271534886d3589ad2762 | [
"Apache-2.0"
] | null | null | null | demo/05_curve_field_demo.py | bond-anton/BDSpaceVis | 5108175ffba2ae85a1be271534886d3589ad2762 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from BDSpace.Coordinates import Cartesian
from BDSpace import Space
from BDSpace.Curve.Parametric import Helix
from BDSpace.Field import HyperbolicPotentialCurveConservativeField
import BDSpaceVis as Visual
from mayavi import mlab
space = Space('Charged helix Space')
coordinate_system = Cartesian... | 34 | 99 | 0.715074 | import numpy as np
from BDSpace.Coordinates import Cartesian
from BDSpace import Space
from BDSpace.Curve.Parametric import Helix
from BDSpace.Field import HyperbolicPotentialCurveConservativeField
import BDSpaceVis as Visual
from mayavi import mlab
space = Space('Charged helix Space')
coordinate_system = Cartesian... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c5628b4c7ea9150c47d5d495790e676dec13105c | 36,261 | py | Python | plinf/runner.py | yanyongyu/PLinf | bf80e67c34bfacfe990497610fe04ee84ba9e50e | [
"MIT"
] | 2 | 2021-07-19T06:12:41.000Z | 2022-01-24T16:23:29.000Z | plinf/runner.py | yanyongyu/PLinf | bf80e67c34bfacfe990497610fe04ee84ba9e50e | [
"MIT"
] | null | null | null | plinf/runner.py | yanyongyu/PLinf | bf80e67c34bfacfe990497610fe04ee84ba9e50e | [
"MIT"
] | null | null | null | from typing import TypeVar, Callable
# stack accept type
CT = TypeVar("CT", int, float, bool, str)
F = Callable[..., None]
# operation class
| 38.089286 | 102 | 0.558782 | import sys
import operator
from enum import Enum, IntEnum, auto
from typing import Any, List, Type, Union, Tuple, Generic, TypeVar, Optional, Callable
from .core import OPCODE
class Symbol:
class SymbolType(IntEnum):
const = auto()
type = auto()
variable = auto()
procedure = auto(... | 0 | 2,135 | 0 | 32,975 | 0 | 483 | 0 | 51 | 455 |
c2f19f0f0d79a829a9f234cf6e3a47f8ddc63119 | 6,254 | py | Python | dash.py | KamaljeetSahoo/TableNet_PyTorch | fd839f450c6743e928a933ebbde39d49b74e7c8e | [
"MIT"
] | 1 | 2021-05-12T11:55:11.000Z | 2021-05-12T11:55:11.000Z | dash.py | RajArPatra/Super-OCR | d71e99bab98247c1e6e3d6a4f17d2aa1f34bc731 | [
"MIT"
] | null | null | null | dash.py | RajArPatra/Super-OCR | d71e99bab98247c1e6e3d6a4f17d2aa1f34bc731 | [
"MIT"
] | null | null | null | import streamlit as st
from pdf2image import convert_from_path
import os
from PIL import Image
from main import predict
import base64
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files (x86)/Tesseract-OCR/tesseract.exe'
tessdata_dir_config = r'--tessdata-dir "C:/Program Files (x86)/Tesseract-... | 46.325926 | 119 | 0.624081 | import streamlit as st
from pdf2image import convert_from_path
import os
from PIL import Image
from main import predict
import numpy as np
import cv2
import pandas as pd
import base64
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:/Program Files (x86)/Tesseract-OCR/tesseract.exe'
tessdata_dir_config = r... | 0 | 0 | 0 | 0 | 0 | 2,135 | 0 | -16 | 89 |
c5290051b53b17bd785401d2fd51cb2e802f9e22 | 329 | py | Python | code/varanus/src/test/c/shadow_stack_examples/example1/payload1.py | bu-icsg/PHMon | 23728d89fce054baf50e952ffc9f61244e723b6a | [
"Apache-2.0"
] | 16 | 2019-10-02T01:56:53.000Z | 2021-11-24T01:23:49.000Z | code/varanus/src/test/c/shadow_stack_examples/example1/payload1.py | bu-icsg/PHMon | 23728d89fce054baf50e952ffc9f61244e723b6a | [
"Apache-2.0"
] | 1 | 2021-03-03T07:52:34.000Z | 2021-03-07T18:01:52.000Z | code/varanus/src/test/c/shadow_stack_examples/example1/payload1.py | bu-icsg/PHMon | 23728d89fce054baf50e952ffc9f61244e723b6a | [
"Apache-2.0"
] | 4 | 2020-02-24T04:09:50.000Z | 2021-11-05T07:00:28.000Z | #!/usr/bin/python
import os
import struct
##This payload is for vuln1.exe
payload = "A"*0x6b
payload += "BBBB" #old sp
#return to not_called function
#payload +=\x64\x01\x01
#payload+=struct.pack("I",0x0002dd24)
payload+=struct.pack("I",0x0002dd24)
print "\"%s\""%payload
#(python -c 'print "A"*0x6c + "BBBB" + "\x1c\... | 21.933333 | 53 | 0.683891 | #!/usr/bin/python
import os
import struct
##This payload is for vuln1.exe
payload = "A"*0x6b
payload += "BBBB" #old sp
#return to not_called function
#payload +=\x64\x01\x01
#payload+=struct.pack("I",0x0002dd24)
payload+=struct.pack("I",0x0002dd24)
print "\"%s\""%payload
#(python -c 'print "A"*0x6c + "BBBB" + "\x1c\... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11ad3422973fecf8220b7572910b4ca937ad24c2 | 170 | py | Python | week04/code11.py | byeongal/KMUCP | 5bafe02c40aae67fc53d9e6cdcb727929368587e | [
"MIT"
] | null | null | null | week04/code11.py | byeongal/KMUCP | 5bafe02c40aae67fc53d9e6cdcb727929368587e | [
"MIT"
] | null | null | null | week04/code11.py | byeongal/KMUCP | 5bafe02c40aae67fc53d9e6cdcb727929368587e | [
"MIT"
] | 1 | 2019-11-27T20:28:19.000Z | 2019-11-27T20:28:19.000Z | score = float(input("(0~100) >>"))
if score <= 30:
print(" A.")
elif score <= 70:
print(" B.")
else:
print(" C.") | 21.25 | 48 | 0.588235 | score = float(input("백분위(0~100)점수를 입력해 주세요 >>"))
if score <= 30:
print("당신의 학점은 A입니다.")
elif score <= 70:
print("당신의 학점은 B입니다.")
else:
print("당신의 학점은 C입니다.") | 117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
226b431cb836d5c3652335d0bf49e6ff14313fbc | 437 | py | Python | test2.py | kyzhouhzau/TensorFlow | 81d03253b8b35bb6d012738ed58d608367eab6ba | [
"MIT"
] | 1 | 2019-04-27T13:45:11.000Z | 2019-04-27T13:45:11.000Z | test2.py | kyzhouhzau/TensorFlow | 81d03253b8b35bb6d012738ed58d608367eab6ba | [
"MIT"
] | null | null | null | test2.py | kyzhouhzau/TensorFlow | 81d03253b8b35bb6d012738ed58d608367eab6ba | [
"MIT"
] | null | null | null | #! usr/bin/env python3
# -*- coding:utf-8 -*-
import tensorflow as tf
matrix1 = tf.constant([[2,3]])
matrix2 = tf.constant([[2],
[3]])
product = tf.matmul(matrix1,matrix2)#matrix multipy np.dot(x1,x1
#method1
# sess = tf.Session()
# result = sess.run(product)
# print(result... | 16.185185 | 66 | 0.583524 | #! usr/bin/env python3
# -*- coding:utf-8 -*-
import tensorflow as tf
matrix1 = tf.constant([[2,3]])
matrix2 = tf.constant([[2],
[3]])
product = tf.matmul(matrix1,matrix2)#matrix multipy 同np.dot(x1,x1
#method1
# sess = tf.Session()
# result = sess.run(product)
# print(resul... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7f904492b5f0c696875d80e0ff4e1abdb6f373c2 | 1,422 | py | Python | app/views/errors.py | ferocious-ferret/throat | 27d6757703411e76d915f13101399021e7679898 | [
"MIT"
] | null | null | null | app/views/errors.py | ferocious-ferret/throat | 27d6757703411e76d915f13101399021e7679898 | [
"MIT"
] | null | null | null | app/views/errors.py | ferocious-ferret/throat | 27d6757703411e76d915f13101399021e7679898 | [
"MIT"
] | null | null | null | """ Pages to be migrated to a wiki-like system """
from flask import Blueprint
bp = Blueprint('errors', __name__)
| 30.913043 | 89 | 0.681435 | """ Pages to be migrated to a wiki-like system """
from flask import Blueprint, request, redirect, url_for, jsonify
from ..misc import engine
from ..forms import LoginForm
bp = Blueprint('errors', __name__)
@bp.app_errorhandler(401)
def unauthorized(error):
""" 401 Unauthorized """
return redirect(url_for('a... | 0 | 1,094 | 0 | 0 | 0 | 0 | 0 | 49 | 159 |
8555a3884909c168db96d9e5d7ec9d4586f851b9 | 2,505 | py | Python | Algorithms/graph/graph.py | BackEndTea/Learning | ccbf8fdbb8fb23643898d73e64fe7442ab46b791 | [
"MIT"
] | 1 | 2018-10-31T10:36:34.000Z | 2018-10-31T10:36:34.000Z | Algorithms/graph/graph.py | BackEndTea/Learning | ccbf8fdbb8fb23643898d73e64fe7442ab46b791 | [
"MIT"
] | null | null | null | Algorithms/graph/graph.py | BackEndTea/Learning | ccbf8fdbb8fb23643898d73e64fe7442ab46b791 | [
"MIT"
] | 2 | 2021-05-06T11:18:25.000Z | 2021-12-04T07:56:29.000Z |
n = 875714 # number of verticies 875.714
t = 0 # Number of nodes explored at this point. (1st pass)
s = None # Current source vertex (2nd pass)
# small_graph = 6,3,2,1,1
if __name__ == "__main__":
main()
| 24.80198 | 96 | 0.540519 | import sys
n = 875714 # number of verticies 875.714
t = 0 # Number of nodes explored at this point. (1st pass)
s = None # Current source vertex (2nd pass)
# small_graph = 6,3,2,1,1
def main():
sys.setrecursionlimit(16900) # This may be slightly sub-optimal
print(sys.getrecursionlimit())
graph = dict()
... | 0 | 0 | 0 | 206 | 0 | 1,982 | 0 | -11 | 114 |
b1326adf6e292989865f27bd1b12ee22ef654b12 | 3,752 | py | Python | ropy/backend/Sim/Sim.py | jhavl/ropy | 38b12369530253a16c22ef1f5be0bcb75053ffd8 | [
"MIT"
] | 16 | 2020-02-20T10:28:01.000Z | 2021-07-12T09:03:25.000Z | ropy/backend/Sim/Sim.py | jhavl/ropy | 38b12369530253a16c22ef1f5be0bcb75053ffd8 | [
"MIT"
] | 2 | 2020-04-27T01:35:44.000Z | 2020-04-27T23:19:53.000Z | ropy/backend/Sim/Sim.py | jhavl/ropy | 38b12369530253a16c22ef1f5be0bcb75053ffd8 | [
"MIT"
] | 3 | 2020-04-07T03:00:02.000Z | 2020-09-05T23:49:28.000Z | #!/usr/bin/env python
"""
@author Jesse Haviland
"""
| 25.52381 | 78 | 0.55064 | #!/usr/bin/env python
"""
@author Jesse Haviland
"""
import os
from subprocess import call, Popen
from ropy.backend.Connector import Connector
import zerorpc
import ropy as rp
import numpy as np
class Sim(Connector): # pragma nocover
def __init__(self):
super(Sim, self).__init__()
# Popen(['np... | 0 | 0 | 0 | 3,532 | 0 | 0 | 0 | 10 | 156 |
5a7c1bf230cb32e89058a8eb85bc47306a227d46 | 1,919 | py | Python | raincoat/parse.py | wo0dyn/raincoat | 56fb9624c92bc11690975b12efc192402ca334a4 | [
"MIT"
] | 18 | 2016-10-13T10:16:49.000Z | 2017-10-20T07:54:11.000Z | raincoat/parse.py | wo0dyn/raincoat | 56fb9624c92bc11690975b12efc192402ca334a4 | [
"MIT"
] | 18 | 2016-10-13T11:37:47.000Z | 2017-10-20T20:59:34.000Z | raincoat/parse.py | wo0dyn/raincoat | 56fb9624c92bc11690975b12efc192402ca334a4 | [
"MIT"
] | 2 | 2016-11-21T16:54:01.000Z | 2017-04-11T10:29:17.000Z | from __future__ import absolute_import
from typing import Iterable
Line = str
Lines = Iterable[Line]
| 27.811594 | 70 | 0.65086 | from __future__ import absolute_import
import ast
from collections import deque
from typing import Iterable, Tuple
import asttokens
from raincoat.constants import ELEMENT_NOT_FOUND
Line = str
Lines = Iterable[Line]
class CodeLocator(ast.NodeVisitor):
def __init__(self, source, filters):
self.path = de... | 0 | 0 | 0 | 1,174 | 478 | 0 | 0 | 26 | 137 |
0d1d55641db53c89ae4467d3b5ebb5670c101c65 | 1,134 | py | Python | hackerrank/contests/30_days_of_code/loops.py | spradeepv/dive-into-python | ec27d4686b7b007d21f9ba4f85d042be31ee2639 | [
"MIT"
] | null | null | null | hackerrank/contests/30_days_of_code/loops.py | spradeepv/dive-into-python | ec27d4686b7b007d21f9ba4f85d042be31ee2639 | [
"MIT"
] | null | null | null | hackerrank/contests/30_days_of_code/loops.py | spradeepv/dive-into-python | ec27d4686b7b007d21f9ba4f85d042be31ee2639 | [
"MIT"
] | null | null | null | """
Problem Statement
Welcome to Day 5! Check out the video review of loops here, or just jump
right into the problem.
In this problem you will test your knowledge of loops. Given three integers
a, b, and N, output the following series:
a+2^0b,a+2^0b+2^1b....a+2^0b+2^1b+...+2^N-1b
Input Format
The first line will c... | 21.807692 | 75 | 0.62522 | """
Problem Statement
Welcome to Day 5! Check out the video review of loops here, or just jump
right into the problem.
In this problem you will test your knowledge of loops. Given three integers
a, b, and N, output the following series:
a+2^0b,a+2^0b+2^1b....a+2^0b+2^1b+...+2^N-1b
Input Format
The first line will c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
72b3abdaee5c0a8e4efa5feb026f9cfe4180dc2b | 4,804 | py | Python | NotificationCenter.py | jhoffmann/lcd-notification | 3bd4223bbc880e951459ed42780dc02f002bea02 | [
"MIT"
] | 1 | 2016-01-04T06:38:22.000Z | 2016-01-04T06:38:22.000Z | NotificationCenter.py | jhoffmann/lcd-notification | 3bd4223bbc880e951459ed42780dc02f002bea02 | [
"MIT"
] | null | null | null | NotificationCenter.py | jhoffmann/lcd-notification | 3bd4223bbc880e951459ed42780dc02f002bea02 | [
"MIT"
] | null | null | null | import subprocess
import urllib2, json
from datetime import datetime
import psutil
import transmissionrpc
if __name__ == '__main__':
nc = NotificationCenter()
print '\n'.join(nc.random_quotes())
print '----------------'
print '\n'.join(nc.status_date())
print '----------------'
print '\n'.join(... | 35.065693 | 93 | 0.521857 | import subprocess
import urllib2, json
from datetime import datetime
import psutil
import transmissionrpc
class NotificationCenter:
TEMP_SYS = '/sys/class/thermal/thermal_zone0/temp'
DATE_FMT = '%a %b %d %H:%M'
TORRENT_HOST = 'localhost'
TORRENT_PORT = 9091
TORRENT_USER = 'pi'
TORRENT_P... | 0 | 0 | 0 | 4,273 | 0 | 0 | 0 | 0 | 23 |
ad56857f3eb7bf4fab592c714f6660a10de1156b | 2,319 | py | Python | DB/creat_tables.py | toddlerya/AnalyzeCoding | 7b469738d2770f0b919b555e30e45d4a1dd3efa6 | [
"MIT"
] | null | null | null | DB/creat_tables.py | toddlerya/AnalyzeCoding | 7b469738d2770f0b919b555e30e45d4a1dd3efa6 | [
"MIT"
] | null | null | null | DB/creat_tables.py | toddlerya/AnalyzeCoding | 7b469738d2770f0b919b555e30e45d4a1dd3efa6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: toddler
# date: 20171026
# sqlite, ORMsqlalchemy
import sys
import os
sys.path.append("..")
from Lib.my_lib import re_joint_dir_by_os
from Conf.analyzecoding import db_path
db_path = os.path.join(os.path.abspath(".."), re_joint_dir_by_os(db_path))
if __name_... | 33.128571 | 74 | 0.43812 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: toddler
# date: 20171026
# 数据库使用sqlite, ORM使用sqlalchemy
import sqlite3
import sys
import os
sys.path.append("..")
from Lib.my_lib import WriteLog, re_joint_dir_by_os
from Conf.analyzecoding import db_path
db_path = os.path.join(os.path.abspath(".."), re_joint_d... | 21 | 0 | 0 | 0 | 0 | 1,844 | 0 | 3 | 69 |
77b72c6a85e80f67c62694b217fc63c35349648b | 3,694 | py | Python | ETL/generate_train_test_info.py | SoufianeDataFan/Sepsis-PhysioNet-2019 | fcb15907cefe8090e99ec1a46b0317812fabc4c6 | [
"MIT"
] | 2 | 2020-04-24T03:32:37.000Z | 2021-01-24T23:46:38.000Z | ETL/generate_train_test_info.py | SoufianeDataFan/Sepsis-PhysioNet-2019 | fcb15907cefe8090e99ec1a46b0317812fabc4c6 | [
"MIT"
] | null | null | null | ETL/generate_train_test_info.py | SoufianeDataFan/Sepsis-PhysioNet-2019 | fcb15907cefe8090e99ec1a46b0317812fabc4c6 | [
"MIT"
] | null | null | null | #----------------------------------------------------------------------------------------------
'''
What to expect from this script:
1- This will generate list of patients with sepsis and no-sepsis in each sets.
2- More details be mentioned in the csv files "info_training_train/test"
'''
#-----------------------... | 34.849057 | 127 | 0.586627 | #----------------------------------------------------------------------------------------------
'''
What to expect from this script:
1- This will generate list of patients with sepsis and no-sepsis in each sets.
2- More details be mentioned in the csv files "info_training_train/test"
'''
#-----------------------... | 0 | 0 | 0 | 0 | 0 | 2,316 | 0 | 54 | 200 |
a5a455cc7f873081af9bd02740aab834965fd73c | 35,511 | py | Python | wage_forecast.py | chaosongdata/wage_prediction | b515c87f2b1551d3d6dd2f1b4790ba30ab07647a | [
"CECILL-B"
] | null | null | null | wage_forecast.py | chaosongdata/wage_prediction | b515c87f2b1551d3d6dd2f1b4790ba30ab07647a | [
"CECILL-B"
] | null | null | null | wage_forecast.py | chaosongdata/wage_prediction | b515c87f2b1551d3d6dd2f1b4790ba30ab07647a | [
"CECILL-B"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 18 21:52:30 2019
@author: c0s02bi
"""
#!/usr/bin/env python
# coding: utf-8
# Author: Chao Song 2019/01/08
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import pandas as pd
import numpy... | 57.368336 | 369 | 0.676072 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 18 21:52:30 2019
@author: c0s02bi
"""
#!/usr/bin/env python
# coding: utf-8
# Author: Chao Song 2019/01/08
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import pandas as pd
import numpy... | 0 | 0 | 0 | 0 | 0 | 559 | 0 | 109 | 161 |
ac03f95654498d61db74c8baac6567eb6a29dfa9 | 432 | py | Python | parallel.py | gitaroktato/microservices-availability-simulator | d22b4293ef573ca11a5d447778c83fd2702a2029 | [
"MIT"
] | 2 | 2021-04-30T01:34:26.000Z | 2021-05-11T11:09:36.000Z | parallel.py | gitaroktato/microservices-availability-simulator | d22b4293ef573ca11a5d447778c83fd2702a2029 | [
"MIT"
] | null | null | null | parallel.py | gitaroktato/microservices-availability-simulator | d22b4293ef573ca11a5d447778c83fd2702a2029 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 20.571429 | 41 | 0.664352 | from main.gui import Draw
from main.model import Service
from main.model import Cluster
def main():
# Configuring microservice structure
service = Service(50, 100, 'service')
cluster = Cluster(service, 2)
# Simulating calls in cycles
cycles = 100000
for _ in range(cycles):
cluster.call... | 0 | 0 | 0 | 0 | 0 | 280 | 0 | 22 | 89 |
579949921c1db344927ef370ebd56304040a3404 | 3,228 | py | Python | Audio/Conv-TasNet/nnet/separate.py | LiuHaolan/models | 1639b3039237c3997c51ff87f0b6113bb2e8d236 | [
"Apache-2.0"
] | 43 | 2021-06-03T09:07:08.000Z | 2022-03-31T15:21:48.000Z | Audio/Conv-TasNet/nnet/separate.py | LiuHaolan/models | 1639b3039237c3997c51ff87f0b6113bb2e8d236 | [
"Apache-2.0"
] | 64 | 2021-05-31T10:34:06.000Z | 2022-01-17T03:44:58.000Z | Audio/Conv-TasNet/nnet/separate.py | LiuHaolan/models | 1639b3039237c3997c51ff87f0b6113bb2e8d236 | [
"Apache-2.0"
] | 37 | 2021-07-04T03:13:18.000Z | 2022-03-25T07:30:47.000Z | #!/usr/bin/env python
import argparse
parser = argparse.ArgumentParser(
description="Command to do speech separation in time domain using ConvTasNet",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument(
"--input", type=str, required=True, help="Script for input waveform"
)
parser... | 28.069565 | 84 | 0.624226 | #!/usr/bin/env python
import os
import argparse
import oneflow as flow
import numpy as np
from conv_tas_net import ConvTasNet
from libs.audio import WaveReader, write_wav
parser = argparse.ArgumentParser(
description="Command to do speech separation in time domain using ConvTasNet",
formatter_class=argparse.A... | 2 | 0 | 0 | 0 | 0 | 1,181 | 0 | 23 | 134 |
50b6f037bc4ff9fa8bd15c8f6b007d127e14af21 | 13,074 | py | Python | Hessian/StyleGAN2_hess_spectrum.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | 2 | 2020-02-03T18:16:26.000Z | 2020-05-01T18:27:01.000Z | Hessian/StyleGAN2_hess_spectrum.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | null | null | null | Hessian/StyleGAN2_hess_spectrum.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | 2 | 2020-01-24T17:27:33.000Z | 2020-08-30T02:54:13.000Z | import torch
import torch.optim as optim
from torchvision.transforms import ToPILImage
from hessian_eigenthings.lanczos import lanczos
from GAN_hvp_operator import get_full_hessian
import sys
import numpy as np
import matplotlib.pylab as plt
from time import time
from os.path import join
#%%
from torchvision.utils impo... | 44.773973 | 146 | 0.658177 | from pytorch_pretrained_biggan import BigGAN, truncated_noise_sample
import torch
import torch.optim as optim
import torch.nn.functional as F
from torchvision.transforms import ToPILImage, ToTensor
from hessian_eigenthings.power_iter import Operator, deflated_power_iteration
from hessian_eigenthings.lanczos import lanc... | 0 | 0 | 0 | 1,765 | 0 | 1,096 | 0 | 361 | 353 |
7ddde47a5a9b949bfa5de2bc4a48e67e3bca6a04 | 636 | py | Python | lab/platform_info.py | arcivanov/coveragepy | 7a4292dcd68e7b9d4d426d9f2eaf6f0535cdd97f | [
"Apache-2.0"
] | 2 | 2020-12-03T09:49:16.000Z | 2022-02-25T09:01:07.000Z | lab/platform_info.py | lyyyuna/coveragepy | 72bd3c915f6dfff3eb367980e32f1e12f2344453 | [
"Apache-2.0"
] | 1 | 2020-06-30T11:05:23.000Z | 2020-06-30T16:45:37.000Z | lab/platform_info.py | lyyyuna/coveragepy | 72bd3c915f6dfff3eb367980e32f1e12f2344453 | [
"Apache-2.0"
] | 3 | 2020-05-11T23:39:12.000Z | 2021-08-31T17:19:17.000Z | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Dump information so we can get a quick look at what's available."""
import platform
import sys
for mod in [platform, sys]:
dump_module(mod)
| 23.555556 | 79 | 0.608491 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Dump information so we can get a quick look at what's available."""
import platform
import sys
def whatever(f):
try:
return f()
except:
... | 0 | 0 | 0 | 0 | 0 | 282 | 0 | 0 | 46 |
ffc477d6c7302e4cf1a619376184ecbfc3a73e0d | 1,211 | py | Python | Python/333.py | JWang169/LintCodeJava | b75b06fa1551f5e4d8a559ef64e1ac29db79c083 | [
"CNRI-Python"
] | 1 | 2020-12-10T05:36:15.000Z | 2020-12-10T05:36:15.000Z | Python/333.py | JWang169/LintCodeJava | b75b06fa1551f5e4d8a559ef64e1ac29db79c083 | [
"CNRI-Python"
] | null | null | null | Python/333.py | JWang169/LintCodeJava | b75b06fa1551f5e4d8a559ef64e1ac29db79c083 | [
"CNRI-Python"
] | 3 | 2020-04-06T05:55:08.000Z | 2021-08-29T14:26:54.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
| 29.536585 | 71 | 0.501239 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def largestBSTSubtree(self, root: TreeNode) -> int:
# left is bst, right is bst, leftMax < root and rightMin > root
self.r... | 0 | 0 | 0 | 1,027 | 0 | 0 | 0 | 0 | 22 |
5c7f99e1dc48ee7b5df7d233f592555ca510c6da | 20,507 | py | Python | api.py | mrbengutierrez/Musical-Instrument-Decoder | 15a51c133dc1b55ea76741315c9d6bcada40a6c1 | [
"MIT"
] | 1 | 2018-12-09T13:49:06.000Z | 2018-12-09T13:49:06.000Z | api.py | mrbengutierrez/Musical-Instrument-Decoder | 15a51c133dc1b55ea76741315c9d6bcada40a6c1 | [
"MIT"
] | null | null | null | api.py | mrbengutierrez/Musical-Instrument-Decoder | 15a51c133dc1b55ea76741315c9d6bcada40a6c1 | [
"MIT"
] | 1 | 2018-09-21T15:55:32.000Z | 2018-09-21T15:55:32.000Z | """
DESCRIPTION
Application Project Interface for Instrument Detection Software
Preprocess: Preprocesses audio data before sending to Neural Network
NeuralNetwork: General purpose neural network that can be used for many
applications
See demo in in main()
Please contact Benjamin Gutierrez for any questions or errors.... | 37.016245 | 112 | 0.654021 | """
DESCRIPTION
Application Project Interface for Instrument Detection Software
Preprocess: Preprocesses audio data before sending to Neural Network
NeuralNetwork: General purpose neural network that can be used for many
applications
See demo in in main()
Please contact Benjamin Gutierrez for any questions or errors.... | 0 | 0 | 0 | 8,212 | 0 | 225 | 0 | 0 | 77 |
42d93c9ee3d925df66d2b57804a14353cf98cf19 | 9,866 | py | Python | src/python/bot/fuzzers/ml/gradientfuzz/opts.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | null | null | null | src/python/bot/fuzzers/ml/gradientfuzz/opts.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | 2 | 2021-09-28T05:36:03.000Z | 2021-12-13T20:48:34.000Z | src/python/bot/fuzzers/ml/gradientfuzz/opts.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 30.079268 | 80 | 0.659943 | # Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04c2c0f34bcc6a0a3028f1ddd2a54f86f991d922 | 1,317 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/envmap_bumpmap.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/envmap_bumpmap.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/envmap_bumpmap.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
# Code generation uses this
# End users want this...
from OpenGL.constant import Constant as _C
_EXTENSION_NAME = 'GL_ATI_envmap_bumpmap'
GL_BUMP_ENVMAP_ATI=_C('GL_BUMP_ENVMAP_ATI',0x877B)
GL_BUMP_NUM_TEX_UNITS_ATI=_C('GL_BUMP_NUM_TEX_UNITS_ATI',0x8777)
GL_BUMP_R... | 38.735294 | 115 | 0.828398 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | 0 | 302 | 0 | 0 | 0 | 114 | 0 | 55 | 221 |
e467e28330d8f64eeab085ff75a77d71836791b9 | 1,209 | py | Python | examples/csg.py | Markus28/RayTracer | a24ec31069ae6a61a45d3df6c02f2dcbb772c9b6 | [
"MIT"
] | null | null | null | examples/csg.py | Markus28/RayTracer | a24ec31069ae6a61a45d3df6c02f2dcbb772c9b6 | [
"MIT"
] | null | null | null | examples/csg.py | Markus28/RayTracer | a24ec31069ae6a61a45d3df6c02f2dcbb772c9b6 | [
"MIT"
] | null | null | null | from RayTracer.renderable import SDFBox, SDFCylinder, SDFSphere, CSGObject
from RayTracer.material import Material
from RayTracer.camera import PinHoleCamera
from RayTracer.lights import DistantPointSource
from RayTracer.scene import Scene
objs = []
lights = []
blue = Material((0.1,0.3, 3), (0.1,0.1,3), (0.1, 0.3, 3)... | 28.785714 | 76 | 0.659222 | from RayTracer.renderable import SDFBox, SDFCylinder, SDFSphere, CSGObject
from RayTracer.material import Material
from RayTracer.camera import PinHoleCamera
from RayTracer.lights import DistantPointSource
from RayTracer.scene import Scene
objs = []
lights = []
blue = Material((0.1,0.3, 3), (0.1,0.1,3), (0.1, 0.3, 3)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4940f87d06b3dbf367d1ee50d8fef273cfc627f | 570 | py | Python | quickstart/replace_metadata.py | juvu/hasura-jwt-auth | b2430ad0a1d40d16a3cf73eaac1ebbd969693713 | [
"MIT"
] | 81 | 2019-07-19T00:59:13.000Z | 2022-03-12T03:10:37.000Z | quickstart/replace_metadata.py | juvu/hasura-jwt-auth | b2430ad0a1d40d16a3cf73eaac1ebbd969693713 | [
"MIT"
] | 6 | 2019-07-24T02:17:07.000Z | 2021-01-30T15:56:37.000Z | quickstart/replace_metadata.py | juvu/hasura-jwt-auth | b2430ad0a1d40d16a3cf73eaac1ebbd969693713 | [
"MIT"
] | 13 | 2019-07-19T03:29:58.000Z | 2022-01-01T04:11:08.000Z | import json
with open("metadata.json") as file:
metadata = json.load(file)
result = post("http://localhost:8080/v1/query", {
"type": "replace_metadata",
"args": metadata,
})
print(result)
| 28.5 | 58 | 0.633333 | import json
from urllib.request import Request, urlopen
def post(url, payload):
request = Request(url, json.dumps(payload), {
"x-hasura-admin-secret": "adminsecret",
"content-type": "application/json; charset=utf-8",
})
data = json.dumps(payload).encode("utf-8")
resp = urlopen(request, ... | 0 | 0 | 0 | 0 | 0 | 282 | 0 | 22 | 45 |
644196eb471af6f23268ba8a70937724510464c9 | 1,286 | py | Python | test_calculate_pow.py | matez0/proof-of-work-multiprocessing | 893b8480ace471f4cfd445659ee4327789de6712 | [
"MIT"
] | null | null | null | test_calculate_pow.py | matez0/proof-of-work-multiprocessing | 893b8480ace471f4cfd445659ee4327789de6712 | [
"MIT"
] | null | null | null | test_calculate_pow.py | matez0/proof-of-work-multiprocessing | 893b8480ace471f4cfd445659ee4327789de6712 | [
"MIT"
] | null | null | null |
test_data = [
'NMJDwDLSGwiJRcdOiwyeyFpZSbnaFSZPJCoFNvrqFFRjjxGxufKEDKmtBrSULHCe',
'bCTNzBWdmuzjrOsOHNwVMUoiKqreBZoXGAZOyDoHGaZtGFPArQeBNNSAOHphughq',
'mmhxAuitDefBRtJXunJMbKyYUkacTLbQmtUklVrfxPJCQzhtqSAdBhxARDYbluiV',
'xOLhHSZorlXVEIAEpDMEkiFyuZywXnDhHjSnIBsyMlwumDyLuUxwMlmpXajAoskT',
'XDNLtzVOXjF... | 35.722222 | 92 | 0.826594 | from hashlib import sha1
from time import perf_counter
import pytest
from pow_calculator import calculate_pow
test_data = [
'NMJDwDLSGwiJRcdOiwyeyFpZSbnaFSZPJCoFNvrqFFRjjxGxufKEDKmtBrSULHCe',
'bCTNzBWdmuzjrOsOHNwVMUoiKqreBZoXGAZOyDoHGaZtGFPArQeBNNSAOHphughq',
'mmhxAuitDefBRtJXunJMbKyYUkacTLbQmtUklVrfxPJ... | 0 | 412 | 0 | 0 | 0 | 0 | 0 | 22 | 113 |
6fb44b477e846c1832c675154d40e04581673682 | 2,109 | py | Python | zilean/datasets/sys/security.py | A-Hilaly/zilean | 2b2e87969a0d8064e8b92b07c346a4006f93c795 | [
"Apache-2.0"
] | null | null | null | zilean/datasets/sys/security.py | A-Hilaly/zilean | 2b2e87969a0d8064e8b92b07c346a4006f93c795 | [
"Apache-2.0"
] | null | null | null | zilean/datasets/sys/security.py | A-Hilaly/zilean | 2b2e87969a0d8064e8b92b07c346a4006f93c795 | [
"Apache-2.0"
] | null | null | null |
UNLOCK_USER = "ALTER USER '{0}'@'{1}' ACCOUNT UNLOCK;"
LOCK_USER = "ALTER USER '{0}'@'{1}' ACCOUNT LOCK;"
GRANT_POWER = "GRANT {0} ON {1}.{2} TO '{3}'@'{4}';"
REVOKE_POWER = "REVOKE {0} ON {1}.{2} FROM '{3}'@'{4}';"
USER_RIGHTS = "SHOW GRANTS FOR '{0}'@'{1}';"
| 27.38961 | 59 | 0.437174 | from greww.data.mysql import MysqlPen as M
UNLOCK_USER = "ALTER USER '{0}'@'{1}' ACCOUNT UNLOCK;"
LOCK_USER = "ALTER USER '{0}'@'{1}' ACCOUNT LOCK;"
GRANT_POWER = "GRANT {0} ON {1}.{2} TO '{3}'@'{4}';"
REVOKE_POWER = "REVOKE {0} ON {1}.{2} FROM '{3}'@'{4}';"
USER_RIGHTS = "SHOW GRANTS FOR '{0}'@'{1}';"
def _manage_kw... | 0 | 1,362 | 0 | 20 | 0 | 218 | 0 | 21 | 226 |
9f84205607fec62fa038f3e5b0e93f810bd97aee | 649 | py | Python | main/tests.py | ScriptHound/django-parser | c21fd6a293daf2cd19ecc320e0b1762116ef069e | [
"MIT"
] | 4 | 2021-02-05T16:23:01.000Z | 2021-02-18T16:50:39.000Z | main/tests.py | ScriptHound/django-parser | c21fd6a293daf2cd19ecc320e0b1762116ef069e | [
"MIT"
] | null | null | null | main/tests.py | ScriptHound/django-parser | c21fd6a293daf2cd19ecc320e0b1762116ef069e | [
"MIT"
] | null | null | null |
# Create your tests here.
| 29.5 | 84 | 0.682589 | from django.db.models.query import QuerySet
from django.test import TestCase
from .models import ResultRow, ResultIdModel
from .queries import get_all_pids, save_pid, save_parsing_results, get_results_by_id
# Create your tests here.
class QueryTest(TestCase):
def setUp(self):
self.pid = save_pid("pppp")
... | 0 | 0 | 0 | 392 | 0 | 0 | 0 | 119 | 110 |
d72b1290639dfbb4754c65cea22a7960e031cd40 | 3,834 | py | Python | mmdet/core/evaluation/bbox_overlaps.py | wobushishuiguo/Rotation-ship-detection | e49f2c7fd71d6f05b3d0fa6dd67ad751b306592e | [
"Apache-2.0"
] | 1 | 2021-11-17T16:07:14.000Z | 2021-11-17T16:07:14.000Z | mmdet/core/evaluation/bbox_overlaps.py | wobushishuiguo/Rotation-ship-detection | e49f2c7fd71d6f05b3d0fa6dd67ad751b306592e | [
"Apache-2.0"
] | null | null | null | mmdet/core/evaluation/bbox_overlaps.py | wobushishuiguo/Rotation-ship-detection | e49f2c7fd71d6f05b3d0fa6dd67ad751b306592e | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2
def rbox_overlaps(bboxes1, bboxes2, mode='iou', eps=1e-6):
"""Calculate the ious between each bbox of bboxes1 and bboxes2.
Args:
bboxes1(ndarray): shape (n, 4)
bboxes2(ndarray): shape (k, 4)
mode(str): iou (intersection over union) or iof (intersection
... | 33.631579 | 77 | 0.53469 | import numpy as np
import cv2
import math
def rbox_overlaps(bboxes1, bboxes2, mode='iou', eps=1e-6):
"""Calculate the ious between each bbox of bboxes1 and bboxes2.
Args:
bboxes1(ndarray): shape (n, 4)
bboxes2(ndarray): shape (k, 4)
mode(str): iou (intersection over union) or iof (inte... | 9 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
761762a26c7c49e728b9f71382d8c1d43101e54f | 10,184 | py | Python | userbot/plugins/autoprofile.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | userbot/plugins/autoprofile.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | userbot/plugins/autoprofile.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | """
Time In Profile Pic.....
Command: `.bloom`
Hmmmm U need to config DOWNLOAD_PFP_URL_CLOCK var in Heroku with any telegraph image link
:::::Credit Time::::::
1) Coded By: @s_n_a_p_s
2) Ported By: @r4v4n4 (Noodz Lober)
3) End Game Help By: @spechide
4) Better Colour Profile Pic By @PhycoNinja13b
#curse: who ever edits... | 36.113475 | 120 | 0.565102 | """
Time In Profile Pic.....
Command: `.bloom`
Hmmmm U need to config DOWNLOAD_PFP_URL_CLOCK var in Heroku with any telegraph image link
:::::Credit Time::::::
1) Coded By: @s_n_a_p_s
2) Ported By: @r4v4n4 (Noodz Lober)
3) End Game Help By: @spechide
4) Better Colour Profile Pic By @PhycoNinja13b
#curse: who ever edits... | 2,238 | 6,770 | 0 | 0 | 0 | 0 | 0 | 28 | 471 |
ffd21e5a39052546d7a5326eccab7a503a34e1c5 | 13,230 | py | Python | source/devtests.py | imnp/pygestalt | d332df64264cce4a2bec8a73d698c386f1eaca7b | [
"MIT"
] | 1 | 2020-02-02T06:58:50.000Z | 2020-02-02T06:58:50.000Z | source/devtests.py | imnp/pygestalt | d332df64264cce4a2bec8a73d698c386f1eaca7b | [
"MIT"
] | 3 | 2019-07-25T19:30:33.000Z | 2021-05-20T01:06:45.000Z | source/devtests.py | imnp/pygestalt | d332df64264cce4a2bec8a73d698c386f1eaca7b | [
"MIT"
] | 1 | 2017-09-13T00:17:39.000Z | 2017-09-13T00:17:39.000Z | # Testing code used during development
from pygestalt import core
# Define Packets
# payloadTestPacket = packets.template('port5Default')
# payloadTestPacket = packets.template('payloadTestPacket',
# packets.unsignedInt('xPosition', 2),
# packet... | 35.564516 | 170 | 0.659788 | # Testing code used during development
from pygestalt import packets
from pygestalt import utilities
from pygestalt import core
from pygestalt import nodes
from pygestalt import config
from pygestalt import interfaces
from pygestalt import units
from pygestalt import geometry
from pygestalt import mechanics
import cop... | 0 | 0 | 0 | 97 | 0 | 0 | 0 | 47 | 244 |
8702d95f8547e30c59768b46159399c83aa61e7c | 5,326 | py | Python | flocker/provision/_ssh/_conch.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/provision/_ssh/_conch.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/provision/_ssh/_conch.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null |
from eliot import MessageType, Field
from effect import TypeDispatcher
from twisted.conch.endpoints import (_NewConnectionHelper, _ReadFile, ConsoleUI)
from twisted.conch.client.knownhosts import KnownHostsFile
from twisted.internet import reactor
from twisted.internet.endpoints import UNIXClientEndpoint
from twist... | 29.103825 | 79 | 0.696207 |
from characteristic import attributes
from eliot import Message, MessageType, Field
from effect import TypeDispatcher, ComposedDispatcher
from effect.twisted import (
make_twisted_dispatcher,
)
from effect.twisted import (
perform, deferred_performer)
from twisted.conch.endpoints import (
SSHCommandClie... | 0 | 2,328 | 0 | 0 | 0 | 371 | 0 | 471 | 321 |
c774f8e536858d084af1756b0a3534e558dc1747 | 1,199 | py | Python | ravenml/tests/local_cache_test.py | autognc/ravenML | 5fc265d63a623ba45add164cedbe3ddeee2bb7ad | [
"MIT"
] | 2 | 2019-08-08T20:11:11.000Z | 2020-08-12T04:59:52.000Z | ravenml/tests/local_cache_test.py | autognc/ravenML | 5fc265d63a623ba45add164cedbe3ddeee2bb7ad | [
"MIT"
] | 17 | 2019-04-08T18:01:51.000Z | 2021-06-28T04:46:06.000Z | ravenml/tests/local_cache_test.py | autognc/ravenML | 5fc265d63a623ba45add164cedbe3ddeee2bb7ad | [
"MIT"
] | 1 | 2021-05-06T22:28:40.000Z | 2021-05-06T22:28:40.000Z | """
Author(s): Carson Schubert (carson.schubert14@gmail.com)
Date Created: 04/11/19
Tests the ravenml local_cache module.
NOTE: If this test fails, it may cause cascades of failures in other tests.
"""
import os
import re
from pathlib import Path
from click.testing import CliRunner
from ravenml.cli import cli
... | 26.644444 | 78 | 0.700584 | """
Author(s): Carson Schubert (carson.schubert14@gmail.com)
Date Created: 04/11/19
Tests the ravenml local_cache module.
NOTE: If this test fails, it may cause cascades of failures in other tests.
"""
import pytest
import os
import re
from pathlib import Path
from click.testing import CliRunner
from ravenml.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 23 |
28a1276fb318654f0d1f55292c788bbf8576fe8b | 5,747 | py | Python | autolux/models.py | logv/autolux | 759b02a5c22977202de6e9ae86b6d339756c057b | [
"MIT"
] | 40 | 2016-08-08T09:12:11.000Z | 2020-06-02T12:18:40.000Z | autolux/models.py | logv/autolux | 759b02a5c22977202de6e9ae86b6d339756c057b | [
"MIT"
] | 17 | 2016-08-08T03:13:55.000Z | 2021-03-13T14:30:16.000Z | autolux/models.py | logv/autolux | 759b02a5c22977202de6e9ae86b6d339756c057b | [
"MIT"
] | 2 | 2016-12-19T03:43:47.000Z | 2019-09-01T20:53:45.000Z | import time
import os
try: import cpickle as pickle
LUMA_BUCKET=500
LUMA_SPREAD=5000
# for a luma map, what we hold is:
# time of day -> luma -> [p1,p2,p3]
LUMA_MAP = {}
LUMA_OBS = []
LUMA_FILE=None
LUMA_DIR=os.path.expanduser("~/.config/autolux")
LUMA_FILE_DEFAULT = os.path.join(LUMA_DIR, "luma_map.p")
OLD_LUMA_FIL... | 28.171569 | 127 | 0.698799 | import math
import time
import os
try: import cpickle as pickle
except: import pickle
import opts
import autolux
LUMA_BUCKET=500
LUMA_SPREAD=5000
# for a luma map, what we hold is:
# time of day -> luma -> [p1,p2,p3]
LUMA_MAP = {}
LUMA_OBS = []
LUMA_FILE=None
LUMA_DIR=os.path.expanduser("~/.config/autolux")
LUMA_FI... | 0 | 0 | 0 | 0 | 0 | 4,594 | 0 | -35 | 323 |
09ac7cee2f76680348727f6765f8d8bc36c7e5c4 | 1,030 | py | Python | Diena_16_misc/my_tk_gui.py | edzya/Python_RTU_08_20 | d2921d998c611c18328dd523daf976a27ce858c1 | [
"MIT"
] | 8 | 2020-08-31T16:10:54.000Z | 2021-11-24T06:37:37.000Z | Diena_16_misc/my_tk_gui.py | edzya/Python_RTU_08_20 | d2921d998c611c18328dd523daf976a27ce858c1 | [
"MIT"
] | 8 | 2021-06-08T22:30:29.000Z | 2022-03-12T00:48:55.000Z | Diena_16_misc/my_tk_gui.py | edzya/Python_RTU_08_20 | d2921d998c611c18328dd523daf976a27ce858c1 | [
"MIT"
] | 12 | 2020-09-28T17:06:52.000Z | 2022-02-17T12:12:46.000Z | import tkinter as tk # this is in standard library
root = tk.Tk()
app = Application(master=root)
app.mainloop()
| 29.428571 | 102 | 0.602913 | import tkinter as tk # this is in standard library
class Application(tk.Frame):
count = 5
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.create_widgets()
def create_widgets(self):
self.hi_there = tk.Button(self)
... | 0 | 0 | 0 | 892 | 0 | 0 | 0 | 0 | 23 |
e3abf04d4b517ae31b999c918a54d9cf46e3ed04 | 5,859 | py | Python | Code/Cryptography/Solitaire Cipher.py | BambooFlower/Math-Scripts | ee89c4f8a1fe80f355e2daa0baa4f94374ee3ab5 | [
"MIT"
] | 3 | 2020-03-10T13:21:24.000Z | 2020-12-20T19:52:53.000Z | Code/Cryptography/Solitaire Cipher.py | BambooFlower/Math-Scripts | ee89c4f8a1fe80f355e2daa0baa4f94374ee3ab5 | [
"MIT"
] | 1 | 2020-07-25T14:25:08.000Z | 2020-07-25T14:28:07.000Z | Code/Cryptography/Solitaire Cipher.py | BambooFlower/Math-Scripts | ee89c4f8a1fe80f355e2daa0baa4f94374ee3ab5 | [
"MIT"
] | 3 | 2020-07-25T13:17:29.000Z | 2020-10-22T15:11:25.000Z | # This is a python implementation of the Solitaire Cipher, a key-generator encryption/decryption Algorithm based on a deck of french cards developed by Bruce Schneier
# Reference can be found at: https://www.schneier.com/academic/solitaire/
# This algorithm uses the bridge order of suits: clubs, diamonds, hearts and ... | 32.016393 | 167 | 0.624339 | # This is a python implementation of the Solitaire Cipher, a key-generator encryption/decryption Algorithm based on a deck of french cards developed by Bruce Schneier
# Reference can be found at: https://www.schneier.com/academic/solitaire/
# This algorithm uses the bridge order of suits: clubs, diamonds, hearts and ... | 0 | 0 | 0 | 0 | 0 | 5,017 | 0 | -3 | 114 |
454512d8a5152b774680d59e65547883882a53a2 | 4,433 | py | Python | 臺灣言語平臺/介面/加資料.py | sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-tai5 | 26f93e06176d8637556938d635a2e101ae7eb1ab | [
"MIT"
] | 14 | 2016-03-22T15:02:06.000Z | 2018-10-10T02:08:25.000Z | 臺灣言語平臺/介面/加資料.py | sih4sing5hong5/tai5-uan5_gian5-gi2_gi2-liau7_phing5-thai5 | 26f93e06176d8637556938d635a2e101ae7eb1ab | [
"MIT"
] | 160 | 2015-10-15T10:34:39.000Z | 2019-03-03T11:54:02.000Z | 臺灣言語平臺/介面/加資料.py | sih4sing5hong5/tai5-uan5_gian5-gi2_gi2-liau7_phing5-thai5 | 26f93e06176d8637556938d635a2e101ae7eb1ab | [
"MIT"
] | 5 | 2016-06-19T13:41:08.000Z | 2020-12-15T06:58:06.000Z | # -*- coding:utf-8 -*-
import json
from django.core.exceptions import ValidationError
from django.http.response import JsonResponse
from django.utils.datastructures import MultiValueDictKeyError
from . import from . import
from ..Json import Json
from . import from .tasks import sheet
else:
return js... | 23.705882 | 73 | 0.552448 | # -*- coding:utf-8 -*-
import json
from django.core.exceptions import ValidationError
from django.http.response import JsonResponse
from django.utils.datastructures import MultiValueDictKeyError
from 臺灣言語資料庫.資料模型 import 種類表
from 臺灣言語平臺.項目模型 import 平臺項目表
from 臺灣言語平臺.介面.Json失敗回應 import Json失敗回應
from 臺灣言語資料庫.資料模型 impor... | 2,958 | 0 | 0 | 191 | 0 | 940 | 0 | 2 | 69 |
931fa46ddf70cb90349c56a12d939bb7574edd14 | 210 | py | Python | tests/__init__.py | notexistence/cubes_lite | 2cbc54509e6dc8a529c9f33fd39d0f659d6a5647 | [
"MIT"
] | null | null | null | tests/__init__.py | notexistence/cubes_lite | 2cbc54509e6dc8a529c9f33fd39d0f659d6a5647 | [
"MIT"
] | null | null | null | tests/__init__.py | notexistence/cubes_lite | 2cbc54509e6dc8a529c9f33fd39d0f659d6a5647 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from cubes_lite.compat import py3k
if not py3k:
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
| 21 | 78 | 0.790476 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from cubes_lite.compat import py3k
if not py3k:
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4bbea199ba6274237104d0937dd0040d22379736 | 8,606 | py | Python | models/Differentiable_PQ.py | Lz1001/MoPQ | 46f02de20a80e2c5ab32fee0277910e5b7a88f48 | [
"MIT"
] | 12 | 2021-11-04T06:58:23.000Z | 2022-03-23T03:32:42.000Z | models/Differentiable_PQ.py | Lz1001/MoPQ | 46f02de20a80e2c5ab32fee0277910e5b7a88f48 | [
"MIT"
] | null | null | null | models/Differentiable_PQ.py | Lz1001/MoPQ | 46f02de20a80e2c5ab32fee0277910e5b7a88f48 | [
"MIT"
] | 4 | 2021-09-13T12:09:21.000Z | 2021-12-27T11:09:28.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch.nn as nn
| 45.057592 | 177 | 0.611434 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.TextEncoder import TextEncoder
class DPQ(TextEncoder):
'''
This is the implementation for differentiable product quantization models (e.g., SPQ, DQN, DVSQ)
... | 0 | 0 | 0 | 8,398 | 0 | 0 | 0 | 22 | 90 |
1247eb6b16337cbc507383e639262916b73353e6 | 2,934 | py | Python | aalpy/oracles/RandomWalkEqOracle.py | icezyclon/AALpy | 3c2f05fdbbcdc99b47ba6b918540239568fca17f | [
"MIT"
] | null | null | null | aalpy/oracles/RandomWalkEqOracle.py | icezyclon/AALpy | 3c2f05fdbbcdc99b47ba6b918540239568fca17f | [
"MIT"
] | null | null | null | aalpy/oracles/RandomWalkEqOracle.py | icezyclon/AALpy | 3c2f05fdbbcdc99b47ba6b918540239568fca17f | [
"MIT"
] | null | null | null |
from aalpy.automata import Onfsm, Mdp, StochasticMealyMachine
automaton_dict = {Onfsm: 'onfsm', Mdp: 'mdp', StochasticMealyMachine: 'smm'}
| 32.6 | 117 | 0.573279 | import random
from aalpy.automata import Onfsm, Mdp, StochasticMealyMachine
from aalpy.base import Oracle, SUL
automaton_dict = {Onfsm: 'onfsm', Mdp: 'mdp', StochasticMealyMachine: 'smm'}
class RandomWalkEqOracle(Oracle):
"""
Equivalence oracle where queries contain random inputs. After every step, 'reset_p... | 0 | 0 | 0 | 2,721 | 0 | 0 | 0 | 5 | 67 |
ff7228f103f63e2628b22f43132dbb559350fac4 | 7,084 | py | Python | sdk/python/pulumi_oci/database/get_vm_cluster_patch.py | EladGabay/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-08-17T11:14:46.000Z | 2021-12-31T02:07:03.000Z | sdk/python/pulumi_oci/database/get_vm_cluster_patch.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-06T11:21:29.000Z | 2021-09-06T11:21:29.000Z | sdk/python/pulumi_oci/database/get_vm_cluster_patch.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-08-24T23:31:30.000Z | 2022-01-02T19:26:54.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
from typing import Optional
from .. import _utilities
__all__ = [
'GetVmClusterPatchResult',
... | 37.481481 | 201 | 0.665867 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 0 | 4,203 | 0 | 599 | 0 | 0 | 0 | 35 | 69 |
6ebac28eed22a77cf6e5188829da9e6d9f538bae | 1,750 | py | Python | presentation/imgsrc/images.py | gertingold/feynman-intro | d5132df951f67ec989f18dc014940e4a47924fd6 | [
"CC-BY-4.0"
] | 4 | 2019-08-04T10:30:49.000Z | 2019-08-27T17:54:13.000Z | presentation/imgsrc/images.py | gertingold/feynman-intro | d5132df951f67ec989f18dc014940e4a47924fd6 | [
"CC-BY-4.0"
] | null | null | null | presentation/imgsrc/images.py | gertingold/feynman-intro | d5132df951f67ec989f18dc014940e4a47924fd6 | [
"CC-BY-4.0"
] | null | null | null | from pyx import canvas, color, deco, path, style, text, unit
boxwidth = 3
height = 4
qi = 0.2*boxwidth
qf = 0.7*boxwidth
linecolor1 = color.rgb(0.8, 0, 0)
linecolor2 = color.rgb(0, 0, 0.8)
text.set(engine=text.LatexEngine)
text.preamble(r'''\usepackage[sfdefault,scaled=.85]{FiraSans}
\usepackage{new... | 41.666667 | 78 | 0.613714 | from pyx import canvas, color, deco, path, style, text, unit
boxwidth = 3
height = 4
qi = 0.2*boxwidth
qf = 0.7*boxwidth
linecolor1 = color.rgb(0.8, 0, 0)
linecolor2 = color.rgb(0, 0, 0.8)
text.set(engine=text.LatexEngine)
text.preamble(r'''\usepackage[sfdefault,scaled=.85]{FiraSans}
\usepackage{new... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
996c4fa99b4c52a2db324c22ecb8e06eaf6e51fe | 590 | py | Python | leetcode/0-250/349-5. Longest Palindromic Substring.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 23 | 2018-11-06T03:54:00.000Z | 2022-03-14T13:30:40.000Z | leetcode/0-250/349-5. Longest Palindromic Substring.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | null | null | null | leetcode/0-250/349-5. Longest Palindromic Substring.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 5 | 2019-05-24T16:56:45.000Z | 2022-03-10T17:29:10.000Z | # 5. Longest Palindromic Substring | 28.095238 | 68 | 0.362712 | # 5. Longest Palindromic Substring
class Solution:
def longestPalindrome(self, s: str) -> str:
ans = ''
n = len(s)
for i in range(n):
j = 0
while 0 <= i-j-1 and i+j+1 < n and s[i-j-1] == s[i+j+1]:
j += 1
if len(ans) < j+j+1:
... | 0 | 0 | 0 | 534 | 0 | 0 | 0 | 0 | 22 |
fe3bf1ae9f520ebf267a242f4a1ae19c0cf1982e | 3,983 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/remote_management/dellemc/test_ome.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/remote_management/dellemc/test_ome.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/remote_management/dellemc/test_ome.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 2.0
# Copyright (C) 2019 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# All rights reserved. Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trad... | 50.417722 | 137 | 0.671353 | # -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 2.0
# Copyright (C) 2019 Dell Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# All rights reserved. Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trad... | 0 | 1,023 | 0 | 2,152 | 0 | 0 | 0 | 236 | 156 |
24c57bdc02953a502654a23efa8a1949b7c58132 | 518 | py | Python | alternat/generation/utilities.py | keplerlab/alternat | b57029dc7192cc09ed5e39e3f6f7b59ba72b8e86 | [
"MIT"
] | 15 | 2020-12-04T11:25:17.000Z | 2022-03-23T21:24:16.000Z | alternat/generation/utilities.py | keplerlab/alternat | b57029dc7192cc09ed5e39e3f6f7b59ba72b8e86 | [
"MIT"
] | 1 | 2020-12-10T16:50:16.000Z | 2020-12-10T16:58:20.000Z | alternat/generation/utilities.py | keplerlab/alternat | b57029dc7192cc09ed5e39e3f6f7b59ba72b8e86 | [
"MIT"
] | null | null | null | import json, os
def save_json_to_disk(dir_path: str, result: dict, rel_path: str):
"""Saves JSON object in a JSON file on disk.
:param dir_path: Path to directory where result needs to be saved.
:type dir_path: str
:param result: Data to be written in the JSON file.
:type result: dict
:param ... | 25.9 | 70 | 0.658301 | import json, os
def save_json_to_disk(dir_path: str, result: dict, rel_path: str):
"""Saves JSON object in a JSON file on disk.
:param dir_path: Path to directory where result needs to be saved.
:type dir_path: str
:param result: Data to be written in the JSON file.
:type result: dict
:param ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b3df745ca42527733326bd472f3dcaf4891e8d24 | 2,789 | py | Python | ETLPipeline (1).py | mudigosa/Disaster-Pipeline | 3a4a8cb78202def522f131d15e5f3938c15f1be5 | [
"CC-BY-4.0"
] | null | null | null | ETLPipeline (1).py | mudigosa/Disaster-Pipeline | 3a4a8cb78202def522f131d15e5f3938c15f1be5 | [
"CC-BY-4.0"
] | null | null | null | ETLPipeline (1).py | mudigosa/Disaster-Pipeline | 3a4a8cb78202def522f131d15e5f3938c15f1be5 | [
"CC-BY-4.0"
] | null | null | null | import sys
import pandas as pd
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
'''
input:
messages_filepath: The path of messages dataset.
categories_filepath: The path of categories dataset.
output:
df: The merged dataset
'''
disa... | 35.303797 | 102 | 0.674435 | import sys
import pandas as pd
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
'''
input:
messages_filepath: The path of messages dataset.
categories_filepath: The path of categories dataset.
output:
df: The merged dataset
'''
disa... | 0 | 0 | 0 | 0 | 0 | 247 | 0 | 0 | 46 |
53c65be24027ce8c425238ad5aefc0ee206754ed | 465 | py | Python | models/pytorch/charrnn/model_checker.py | filipecosta90/redisai-examples | d836dbaf776849c5d38319b48b168693d7317bcf | [
"MIT"
] | 51 | 2019-03-16T07:56:18.000Z | 2022-03-31T12:25:04.000Z | models/pytorch/charrnn/model_checker.py | filipecosta90/redisai-examples | d836dbaf776849c5d38319b48b168693d7317bcf | [
"MIT"
] | 16 | 2019-03-17T20:25:28.000Z | 2022-03-11T23:43:47.000Z | models/pytorch/charrnn/model_checker.py | filipecosta90/redisai-examples | d836dbaf776849c5d38319b48b168693d7317bcf | [
"MIT"
] | 18 | 2019-03-16T07:56:25.000Z | 2021-12-11T18:41:47.000Z | import torch
import string
charrnn = torch.jit.load('CharRNN_pipeline.pt')
all_characters = string.printable
n_characters = len(all_characters)
hidden_size = 300
n_layers = 2
batch_size = 1
prediction_seq_length = 200
primer = torch.tensor([5]).to(dtype=torch.long)
hidden = torch.zeros(n_layers, batch_size, hidden... | 21.136364 | 57 | 0.763441 | import torch
import string
charrnn = torch.jit.load('CharRNN_pipeline.pt')
all_characters = string.printable
n_characters = len(all_characters)
hidden_size = 300
n_layers = 2
batch_size = 1
prediction_seq_length = 200
def int2str(int_data):
return ''.join([all_characters[i] for i in int_data])
primer = torch.... | 0 | 0 | 0 | 0 | 0 | 59 | 0 | 0 | 23 |
fe1f7b2661997589bdc08dd023356110551e6f2c | 1,965 | py | Python | favourite/views.py | liuasliy/rdstourcms | 14bb993bff2a1060f714b85af51075e6b1265fe8 | [
"MIT"
] | 5 | 2016-11-29T14:21:16.000Z | 2020-05-28T17:42:15.000Z | favourite/views.py | liuasliy/rdstourcms | 14bb993bff2a1060f714b85af51075e6b1265fe8 | [
"MIT"
] | null | null | null | favourite/views.py | liuasliy/rdstourcms | 14bb993bff2a1060f714b85af51075e6b1265fe8 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from django.shortcuts import render_to_response
# Create your views here.
| 35.089286 | 148 | 0.748092 | # -*- coding: UTF-8 -*-
from django.shortcuts import render
from django.template import loader, Context
from django.http import HttpResponse, HttpResponseRedirect
from travels.models import *
from favourite.models import *
from accounts.models import *
from django.shortcuts import render_to_response
from django.templat... | 66 | 0 | 0 | 0 | 0 | 1,073 | 0 | 323 | 443 |
cc15fb2c1999dc6c97bbba0c2f535db0d6847a4d | 63 | py | Python | plugins/niux2_lazyload_helper/__init__.py | sdphome/blog-content | 927569d0d082bbcadb0e1d510f9e2b95af635ae1 | [
"Apache-2.0"
] | null | null | null | plugins/niux2_lazyload_helper/__init__.py | sdphome/blog-content | 927569d0d082bbcadb0e1d510f9e2b95af635ae1 | [
"Apache-2.0"
] | null | null | null | plugins/niux2_lazyload_helper/__init__.py | sdphome/blog-content | 927569d0d082bbcadb0e1d510f9e2b95af635ae1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
| 12.6 | 36 | 0.650794 | # -*- coding: UTF-8 -*-
from .niux2_lazyload_helper import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 23 |
e8af59d432fc6dd92d14b27f91dd09f0c9103e45 | 563 | py | Python | account/urls.py | robpop/explore_engine | 21942c73b28b7b22351877b9772773dfdf298667 | [
"MIT"
] | null | null | null | account/urls.py | robpop/explore_engine | 21942c73b28b7b22351877b9772773dfdf298667 | [
"MIT"
] | null | null | null | account/urls.py | robpop/explore_engine | 21942c73b28b7b22351877b9772773dfdf298667 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'account'
urlpatterns = [
path('two_factor/disable/', views.disableTwoFactor, name='disable-2fa'),
path('logout/', views.logoutView, name='logout'),
path('manage/', views.manage, name='manage'),
path('sign-up/', views.signup, name='signup'),
... | 40.214286 | 90 | 0.692718 | from django.urls import path
from . import views
app_name = 'account'
urlpatterns = [
path('two_factor/disable/', views.disableTwoFactor, name='disable-2fa'),
path('logout/', views.logoutView, name='logout'),
path('manage/', views.manage, name='manage'),
path('sign-up/', views.signup, name='signup'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
02d80b042f4189af7bedf4b0a686b4b0ab17aa8a | 12,833 | py | Python | zeppelin_provider/pyzeppelin/zeppelin_client.py | zjffdu/zeppelin_airflow | ef54e3977879f3e3c102eb7d1842f52ce7fe976b | [
"Apache-2.0"
] | 2 | 2021-10-18T02:41:05.000Z | 2021-10-19T02:43:34.000Z | zeppelin_provider/pyzeppelin/zeppelin_client.py | zjffdu/zeppelin_airflow | ef54e3977879f3e3c102eb7d1842f52ce7fe976b | [
"Apache-2.0"
] | null | null | null | zeppelin_provider/pyzeppelin/zeppelin_client.py | zjffdu/zeppelin_airflow | ef54e3977879f3e3c102eb7d1842f52ce7fe976b | [
"Apache-2.0"
] | 1 | 2021-12-09T20:48:37.000Z | 2021-12-09T20:48:37.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.855457 | 139 | 0.606327 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 0 | 0 | 0 | 11,888 | 0 | 0 | 0 | 4 | 157 |
5653cd7c118db1276be5b759ea50ac88039a6d7b | 1,512 | py | Python | wod/wod_rules/migrations/0003_auto_20150410_1448.py | wlansu/wod | 7a91747c7e25f9304c42ef6418612d3b391f4662 | [
"MIT"
] | null | null | null | wod/wod_rules/migrations/0003_auto_20150410_1448.py | wlansu/wod | 7a91747c7e25f9304c42ef6418612d3b391f4662 | [
"MIT"
] | null | null | null | wod/wod_rules/migrations/0003_auto_20150410_1448.py | wlansu/wod | 7a91747c7e25f9304c42ef6418612d3b391f4662 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 35.162791 | 166 | 0.560847 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wod_rules', '0002_auto_20150410_1125'),
]
operations = [
migrations.CreateModel(
name='MeritPrerequisiteSkill',
... | 0 | 0 | 0 | 1,382 | 0 | 0 | 0 | 19 | 46 |
de1cb65df596de3b01ca657a368a42b0094b593e | 1,230 | py | Python | Listprac.py | poojadhoble32/python-projects | 4c094dd0072d4213344e26476e4e99a4a12246e7 | [
"bzip2-1.0.6"
] | null | null | null | Listprac.py | poojadhoble32/python-projects | 4c094dd0072d4213344e26476e4e99a4a12246e7 | [
"bzip2-1.0.6"
] | null | null | null | Listprac.py | poojadhoble32/python-projects | 4c094dd0072d4213344e26476e4e99a4a12246e7 | [
"bzip2-1.0.6"
] | null | null | null |
L1 = ["John", 102, "USA",23.2,34,'pooja','xyz',80]
L2 = [1, 2, 3, 4, 5, 6,6,2,3,8]
print(type(L1))
print(type(L2)) #type of data
print(L1) #print elements of list
print(L2)
print(id(L1)) #id means address of list
print(id(L2))
print(L1==L2) #compare both list elements.elem... | 18.636364 | 113 | 0.517886 |
L1 = ["John", 102, "USA",23.2,34,'pooja','xyz',80]
L2 = [1, 2, 3, 4, 5, 6,6,2,3,8]
print(type(L1))
print(type(L2)) #type of data
print(L1) #print elements of list
print(L2)
print(id(L1)) #id means address of list
print(id(L2))
print(L1==L2) #compare both list elements.elem... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1b525c6b6ec094955543c215f8b0c379abd48cfd | 2,230 | py | Python | admin.py | registerguard/civic_calendar2 | d00f950cc1fb153df4423c914a61372592ee717d | [
"MIT"
] | null | null | null | admin.py | registerguard/civic_calendar2 | d00f950cc1fb153df4423c914a61372592ee717d | [
"MIT"
] | 21 | 2017-07-27T23:35:20.000Z | 2022-01-21T22:24:43.000Z | admin.py | registerguard/civic_calendar2 | d00f950cc1fb153df4423c914a61372592ee717d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User
from .models import Jurisdiction, Entity, Location
from schedule.models import Event
admin.site.register(Jurisdiction, JurisdictionAdmin)
admin.site.unregister(Event)
adm... | 32.794118 | 134 | 0.719731 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.forms import BaseModelFormSet
from .models import Jurisdiction, Entity, Location, Profile
from schedule.models import... | 0 | 0 | 0 | 1,479 | 0 | 0 | 0 | 55 | 182 |
e3683aec3a936fdd106aa2760e92f3f3cccf8d3d | 641 | py | Python | jp.atcoder/abc126/abc126_d/28295761.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc126/abc126_d/28295761.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc126/abc126_d/28295761.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null |
main()
| 19.424242 | 44 | 0.394696 | import typing
def main() -> typing.NoReturn:
# compute dist from a root.
n = int(input())
g = [[] for _ in range(n)]
for _ in range(n - 1):
u, v, w = map(int, input().split())
u -= 1
v -= 1
g[u].append((v, w))
g[v].append((u, w))
inf = 1 << ... | 0 | 0 | 0 | 0 | 0 | 588 | 0 | -8 | 48 |
9d9857819d7debc5f65a4102607d0ee1016106a1 | 12,974 | py | Python | src/tests/unit/test_sklearn.py | tipresias/augury | eaae2a7d27ee8c39796231ec55e0e2a82b59d60c | [
"MIT"
] | 4 | 2019-12-05T06:02:08.000Z | 2022-02-01T23:49:23.000Z | src/tests/unit/test_sklearn.py | tipresias/augury | eaae2a7d27ee8c39796231ec55e0e2a82b59d60c | [
"MIT"
] | 143 | 2019-07-30T11:06:56.000Z | 2022-03-14T19:02:39.000Z | src/tests/unit/test_sklearn.py | tipresias/augury | eaae2a7d27ee8c39796231ec55e0e2a82b59d60c | [
"MIT"
] | 3 | 2019-12-30T22:57:41.000Z | 2020-12-31T02:39:07.000Z | # pylint: disable=missing-docstring, redefined-outer-name
from faker import Faker
FAKE = Faker()
ROW_COUNT = 10
N_FAKE_CATS = 6
# We use FakeEstimator to generate predictions for #test_bits_scorer,
# and we don't care if it doesn't converge
| 34.597333 | 88 | 0.664791 | # pylint: disable=missing-docstring, redefined-outer-name
from unittest import TestCase
from unittest.mock import patch
import os
import warnings
from sklearn.linear_model import LogisticRegression
import pandas as pd
import numpy as np
from faker import Faker
from kedro.framework.session import get_current_session
f... | 0 | 1,804 | 0 | 8,754 | 0 | 938 | 0 | 478 | 742 |
588f919be08e0f1f457b1ebd7fb1644a4a818f02 | 531 | py | Python | smt/examples/one_D_step/tests/test_one_D_step.py | meliani09/smt | af729143be09b012257bf81dcd3e2c8c40f65c96 | [
"BSD-3-Clause"
] | 1 | 2020-07-01T09:54:46.000Z | 2020-07-01T09:54:46.000Z | smt/examples/one_D_step/tests/test_one_D_step.py | yuhaibo2017/smt | ab3bda1e38ca3a785dfc0ed692f1437bf7e78bd3 | [
"BSD-3-Clause"
] | null | null | null | smt/examples/one_D_step/tests/test_one_D_step.py | yuhaibo2017/smt | ab3bda1e38ca3a785dfc0ed692f1437bf7e78bd3 | [
"BSD-3-Clause"
] | 1 | 2018-11-20T09:01:59.000Z | 2018-11-20T09:01:59.000Z |
import matplotlib
matplotlib.use('Agg')
try:
compiled_available = True
except:
compiled_available = False
| 24.136364 | 68 | 0.753296 | import unittest
import matplotlib
matplotlib.use('Agg')
try:
from smt.surrogate_models import RMTB, RMTC
compiled_available = True
except:
compiled_available = False
class Test(unittest.TestCase):
@unittest.skipIf(not compiled_available, "C compilation failed")
def test_rmtb(self):
from... | 0 | 264 | 0 | 9 | 0 | 0 | 0 | 16 | 125 |
1e0c2af85d21088e4cb5eec6b8370c4af91a7588 | 1,578 | py | Python | greedy/332 reconstruct-itinerary.py | windowssocket/py_leetcode | 241dbf8d7dab7db5215c2526321fcdb378b45492 | [
"Apache-2.0"
] | 3 | 2018-05-29T02:29:40.000Z | 2020-02-05T03:28:16.000Z | greedy/332 reconstruct-itinerary.py | xidongc/py_leetcode | 241dbf8d7dab7db5215c2526321fcdb378b45492 | [
"Apache-2.0"
] | 1 | 2019-03-08T13:22:32.000Z | 2019-03-08T13:22:32.000Z | greedy/332 reconstruct-itinerary.py | xidongc/py_leetcode | 241dbf8d7dab7db5215c2526321fcdb378b45492 | [
"Apache-2.0"
] | 3 | 2018-05-29T11:50:24.000Z | 2018-11-27T12:31:01.000Z | # Eulerian path.
# The nodes which have odd degrees (int and out) are the entrance or exit.
# In your example it's JFK and A.The nodes which have odd degrees (int and out) are the entrance or exit.
# If there are no nodes have odd degrees, we could follow any path without stuck until hit the last exit node
# The reason... | 46.411765 | 109 | 0.579848 | # Eulerian path.
# The nodes which have odd degrees (int and out) are the entrance or exit.
# In your example it's JFK and A.The nodes which have odd degrees (int and out) are the entrance or exit.
# If there are no nodes have odd degrees, we could follow any path without stuck until hit the last exit node
# The reason... | 156 | 0 | 0 | 560 | 0 | 0 | 0 | -3 | 44 |
5929f14c401440828e57f02c95d1b574c3bffb9a | 2,530 | py | Python | src/paralog_filtering.py | acarafat/subtractive_analysis | 6b44b7f6405dfdbb65129b2953edbfc59bddbfcc | [
"Unlicense"
] | 1 | 2018-04-23T05:12:50.000Z | 2018-04-23T05:12:50.000Z | src/paralog_filtering.py | acarafat/subtractive_analysis | 6b44b7f6405dfdbb65129b2953edbfc59bddbfcc | [
"Unlicense"
] | null | null | null | src/paralog_filtering.py | acarafat/subtractive_analysis | 6b44b7f6405dfdbb65129b2953edbfc59bddbfcc | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Paralog filtering for subtractive analysis
'''This script works on CD-HIT output.
CD-Hit is an web server for homolog sequence clustering. One output file of
CD-Hit contains paralog sequence id in cluster. This script mine that output file,
find the unique sequence, and filter out those seque... | 36.142857 | 91 | 0.694862 | #!/usr/bin/env python
# Paralog filtering for subtractive analysis
'''This script works on CD-HIT output.
CD-Hit is an web server for homolog sequence clustering. One output file of
CD-Hit contains paralog sequence id in cluster. This script mine that output file,
find the unique sequence, and filter out those seque... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d871462e60c782fd9aeb65ba029c84c194c6aed2 | 4,699 | py | Python | api/views/owner.py | ZeFelix/dimenu-back | a7722f9714fdcf9173cc00a71826421d9a5c68fc | [
"MIT"
] | null | null | null | api/views/owner.py | ZeFelix/dimenu-back | a7722f9714fdcf9173cc00a71826421d9a5c68fc | [
"MIT"
] | 11 | 2020-05-24T00:30:38.000Z | 2022-03-12T00:31:12.000Z | api/views/owner.py | ZeFelix/dimenu-back | a7722f9714fdcf9173cc00a71826421d9a5c68fc | [
"MIT"
] | null | null | null | #encryptografia
| 44.752381 | 128 | 0.647372 | from django.shortcuts import render
from api.models import *
from api.serializers import OwnerSerializer
from django.http import Http404, JsonResponse
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from django.core.exceptions import ObjectDoesNotE... | 24 | 0 | 0 | 3,989 | 0 | 0 | 0 | 345 | 335 |
c8f774e3c6fbf368570bb2b243d5682813640ff6 | 1,785 | py | Python | utils.py | yuanx749/deep-vaccine | 11c2e7fbb1c89a08f96bada1153bd56577e592ff | [
"MIT"
] | null | null | null | utils.py | yuanx749/deep-vaccine | 11c2e7fbb1c89a08f96bada1153bd56577e592ff | [
"MIT"
] | null | null | null | utils.py | yuanx749/deep-vaccine | 11c2e7fbb1c89a08f96bada1153bd56577e592ff | [
"MIT"
] | null | null | null | import torch.nn as nn
| 28.333333 | 86 | 0.652101 | import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from sklearn import metrics
from sklearn.manifold import TSNE
@torch.no_grad()
def predict(model, dataloader):
"""Returns: numpy arrays of true labels and predicted probabilities."""
device = torch.device("cuda" if torch.cud... | 0 | 624 | 0 | 0 | 0 | 941 | 0 | 16 | 179 |
e7a36bd9ec451ef0ea2d16f89eab31a7ffc1f73b | 39,832 | py | Python | JSP/machine.py | Reallyhardtocreateaname/PhD-Thesis-Projects | de0878f51ec66c9905227b2d260ffaa0b4946f1f | [
"Apache-2.0"
] | 2 | 2022-03-25T07:51:17.000Z | 2022-03-25T07:52:23.000Z | JSP/machine.py | Harrison-Mao/PhD-Thesis-Projects | a4063c3fa06602d95d9215ae9b6ed3e4b55dc017 | [
"Apache-2.0"
] | null | null | null | JSP/machine.py | Harrison-Mao/PhD-Thesis-Projects | a4063c3fa06602d95d9215ae9b6ed3e4b55dc017 | [
"Apache-2.0"
] | 2 | 2022-03-23T03:47:16.000Z | 2022-03-25T07:50:37.000Z | import sys
sys.path
| 56.101408 | 170 | 0.647093 | import simpy
import sys
sys.path
import random
import numpy as np
import torch
import matplotlib.pyplot as plt
from tabulate import tabulate
import sequencing
class machine:
def __init__(self, env, index, *args, **kwargs):
# initialize the environment of simulation
self.env = env
... | 0 | 0 | 0 | 39,639 | 0 | 0 | 0 | -15 | 186 |
b8e999be8d6f214ca3faad0fcf51218bed2265f2 | 15,027 | py | Python | regime.py | atheesh1998/regime-detection | 352e9ea4f187c3371b39be1062dca92c76da0fed | [
"MIT"
] | null | null | null | regime.py | atheesh1998/regime-detection | 352e9ea4f187c3371b39be1062dca92c76da0fed | [
"MIT"
] | null | null | null | regime.py | atheesh1998/regime-detection | 352e9ea4f187c3371b39be1062dca92c76da0fed | [
"MIT"
] | null | null | null | #load libraries
# to check unit root in time series
import datetime
from statsmodels.tsa.stattools import adfuller
from sklearn.preprocessing import StandardScaler
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn.metrics import auc
from sklearn im... | 42.329577 | 125 | 0.705996 | #load libraries
# to check unit root in time series
import datetime
from statsmodels.tsa.stattools import adfuller
from sklearn.preprocessing import StandardScaler
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn.metrics import classification_rep... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 142 | 163 |
5a0fad5555d7f375c6929e7eedbf4c75ce7ae115 | 2,675 | py | Python | mir/orbis/hashcache.py | darkfeline/mir.orbis | a3f4f19aed97ae35909003ac8d4957d1bd45dd32 | [
"Apache-2.0"
] | null | null | null | mir/orbis/hashcache.py | darkfeline/mir.orbis | a3f4f19aed97ae35909003ac8d4957d1bd45dd32 | [
"Apache-2.0"
] | 1 | 2019-10-19T01:26:33.000Z | 2019-10-19T01:26:33.000Z | mir/orbis/hashcache.py | darkfeline/mir.orbis | a3f4f19aed97ae35909003ac8d4957d1bd45dd32 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Allen Li
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 29.395604 | 74 | 0.631776 | # Copyright (C) 2017 Allen Li
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 0 | 255 | 0 | 1,515 | 0 | 43 | 0 | -9 | 91 |