hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6f62159a43423725ef27c820b6b056f93c11c850 | 331 | py | Python | util/core.py | IRIS-Team/tchecker | 7f0b3218f8914ac3d96eadc8a7db1c2d23016503 | [
"MIT"
] | 17 | 2021-09-05T11:35:03.000Z | 2022-03-23T19:06:54.000Z | util/core.py | IRIS-Team/tchecker | 7f0b3218f8914ac3d96eadc8a7db1c2d23016503 | [
"MIT"
] | 2 | 2021-09-04T11:06:02.000Z | 2021-09-06T06:40:08.000Z | util/core.py | IRIS-Team/tchecker | 7f0b3218f8914ac3d96eadc8a7db1c2d23016503 | [
"MIT"
] | 5 | 2021-09-04T13:13:59.000Z | 2022-02-19T00:22:56.000Z | import json
colours = json.loads(open("theme/default.json").read()) | 25.461538 | 55 | 0.673716 | import json
colours = json.loads(open("theme/default.json").read())
class colours:
main = colours["main_color"]
sencondary = colours["sencondary"]
text = colours["text"]
darktext = colours["darktext"]
error = colours["error"]
def returnColor(string) -> str:
return f'{colours.main}{string}{col... | 61 | 156 | 46 |
6b1ed1845a4dbd185d9265d1d2db0d1dc492042a | 17,657 | py | Python | examples/demo_runner.py | funky23exe/habitat-sim | a72ba43593a57995972ba1521f6f7a20d122761c | [
"MIT"
] | null | null | null | examples/demo_runner.py | funky23exe/habitat-sim | a72ba43593a57995972ba1521f6f7a20d122761c | [
"MIT"
] | null | null | null | examples/demo_runner.py | funky23exe/habitat-sim | a72ba43593a57995972ba1521f6f7a20d122761c | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import multiprocessing
import os
import random
import time
from enum import Enum
import numpy as np
from PIL import Image
from set... | 40.497706 | 103 | 0.607408 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import multiprocessing
import os
import random
import time
from enum import Enum
import numpy as np
from PIL import Image
from set... | 16,506 | 485 | 46 |
0c25ee0e646d54847337890d8e0fcb21c9e410f2 | 516 | py | Python | Util.py | WhatsFish/txt2json | 7fa998031a0901bf914f3e3268ce31c3b3894de2 | [
"MIT"
] | null | null | null | Util.py | WhatsFish/txt2json | 7fa998031a0901bf914f3e3268ce31c3b3894de2 | [
"MIT"
] | null | null | null | Util.py | WhatsFish/txt2json | 7fa998031a0901bf914f3e3268ce31c3b3894de2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 15:05:43 2020
@author: lihaoyang03
"""
| 17.2 | 35 | 0.587209 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 15:05:43 2020
@author: lihaoyang03
"""
def asc_sort(ages):
list.sort(ages)
return ages;
def desc_sort(ages):
list.sort(ages,reverse = True)
return ages;
def test_asc_sort(ages):
for i in range(len(ages)-1):
if ages[i... | 305 | 0 | 91 |
9893ddee6bbb747785141d0ec8f728428c20fbdd | 2,074 | py | Python | santa.py | alexander-travov/synchro | 74856e68bedfb2680ae4f2af191cb8220412bbde | [
"MIT"
] | null | null | null | santa.py | alexander-travov/synchro | 74856e68bedfb2680ae4f2af191cb8220412bbde | [
"MIT"
] | null | null | null | santa.py | alexander-travov/synchro | 74856e68bedfb2680ae4f2af191cb8220412bbde | [
"MIT"
] | null | null | null | import sys
import time
import random
from sync_utils import Thread, Semaphore, Barrier, watch
SANTA = Semaphore(0)
NUM_DEERS = 0
DEER_MUTEX = Semaphore(1)
SLEDGE = Semaphore(0)
SLEDGE_READY = Semaphore(0)
BARRIER = Barrier(9)
NUM_ELVES = 0
ELF_MUTEX = Semaphore(1)
ELF_MULTIPLEX = Semaphore(3)
HELP = Semaphore(0)
... | 20.74 | 57 | 0.575699 | import sys
import time
import random
from sync_utils import Thread, Semaphore, Barrier, watch
SANTA = Semaphore(0)
NUM_DEERS = 0
DEER_MUTEX = Semaphore(1)
SLEDGE = Semaphore(0)
SLEDGE_READY = Semaphore(0)
BARRIER = Barrier(9)
NUM_ELVES = 0
ELF_MUTEX = Semaphore(1)
ELF_MULTIPLEX = Semaphore(3)
HELP = Semaphore(0)
... | 1,646 | 0 | 92 |
02d35ea48440a2683538e39ea302a054c2d4db7f | 790 | py | Python | src/get_original_data.py | RosalRicardo/RTRGAN | 6f4551ab8445367f8b9c711f41f15dd465abaef1 | [
"MIT"
] | null | null | null | src/get_original_data.py | RosalRicardo/RTRGAN | 6f4551ab8445367f8b9c711f41f15dd465abaef1 | [
"MIT"
] | null | null | null | src/get_original_data.py | RosalRicardo/RTRGAN | 6f4551ab8445367f8b9c711f41f15dd465abaef1 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
| 52.666667 | 98 | 0.725316 | import pandas as pd
import numpy as np
def get_original_data(df_transformed, df_orig, ohe, scaler):
# df_int = df_orig.select_dtypes(['float','integer'])
df_ohe_int = df_transformed[:, :df_orig.select_dtypes(['float', 'integer']).shape[1]]
df_ohe_int = scaler.inverse_transform(df_ohe_int)
df_ohe_cats =... | 728 | 0 | 23 |
15be091dc287f310c631199352d615a271f2d3a6 | 3,126 | py | Python | axfr-test.py | internetwache/Python-AXFR-Test | 626c27d46b1f2f7fa76648cb771d48bc1f9fd9a3 | [
"MIT"
] | 52 | 2015-03-03T13:52:19.000Z | 2022-01-06T03:37:50.000Z | axfr-test.py | codingo/Python-AXFR-Test | 3c78829c8884ebcb4861e3237f756a1b21e41862 | [
"MIT"
] | null | null | null | axfr-test.py | codingo/Python-AXFR-Test | 3c78829c8884ebcb4861e3237f756a1b21e41862 | [
"MIT"
] | 25 | 2015-03-29T12:35:28.000Z | 2022-01-15T21:43:52.000Z | #!/usr/bin/python
import argparse
import dns.resolver
import dns.query
import dns.zone
import os
import sys
from multiprocessing import Pool
INPUTFILE = sys.stdin
OUTPUTFILE = sys.stdout
LOGFILE = sys.stderr
PROCESSES = 20
if __name__ == '__main__':
main()
| 30.647059 | 141 | 0.633397 | #!/usr/bin/python
import argparse
import dns.resolver
import dns.query
import dns.zone
import os
import sys
from multiprocessing import Pool
INPUTFILE = sys.stdin
OUTPUTFILE = sys.stdout
LOGFILE = sys.stderr
PROCESSES = 20
def checkaxfr(domain):
domain = domain.strip()
try:
ns_query = dns.resolver.query(doma... | 2,818 | 0 | 46 |
4e2d51086f3f82db4205166399a4a1197e55e89d | 1,226 | py | Python | data_utils/convert_imgs_to_jpg.py | sun-yitao/GrabAIChallenge | 05946339e5a478216d7a9234e29e9bd7af5b3492 | [
"MIT"
] | 10 | 2019-07-05T05:28:30.000Z | 2020-09-15T02:47:16.000Z | data_utils/convert_imgs_to_jpg.py | sun-yitao/GrabAIChallenge | 05946339e5a478216d7a9234e29e9bd7af5b3492 | [
"MIT"
] | 6 | 2019-11-18T12:59:22.000Z | 2022-02-10T00:23:00.000Z | data_utils/convert_imgs_to_jpg.py | sun-yitao/GrabAIChallenge | 05946339e5a478216d7a9234e29e9bd7af5b3492 | [
"MIT"
] | 2 | 2019-07-17T15:12:14.000Z | 2020-04-15T19:06:41.000Z | """Script to convert non-jpgs in a folder to jpg"""
import os
from pathlib import Path
from PIL import Image
from glob import glob
from tqdm import tqdm
from shutil import move
cwd = Path.cwd()
DATA_DIR = cwd.parent / 'data' / 'stanford-car-dataset-by-classes-folder' / 'car_data' / 'new_data'
if __name__ == '__ma... | 28.511628 | 99 | 0.556281 | """Script to convert non-jpgs in a folder to jpg"""
import os
from pathlib import Path
from PIL import Image
from glob import glob
from tqdm import tqdm
from shutil import move
cwd = Path.cwd()
DATA_DIR = cwd.parent / 'data' / 'stanford-car-dataset-by-classes-folder' / 'car_data' / 'new_data'
def convert_png_to_jpg... | 829 | 0 | 46 |
f06408f512996c1c23fa1eb9aa58df5911971391 | 3,169 | py | Python | test_learnable_histogram.py | donikv/IlluminationBase | 4aade52bb8a1065f10b94ffda09645a681d8160c | [
"MIT"
] | null | null | null | test_learnable_histogram.py | donikv/IlluminationBase | 4aade52bb8a1065f10b94ffda09645a681d8160c | [
"MIT"
] | null | null | null | test_learnable_histogram.py | donikv/IlluminationBase | 4aade52bb8a1065f10b94ffda09645a681d8160c | [
"MIT"
] | null | null | null | import learnable_histogram
import TauDataset
import data_processing as dp
import numpy as np
import tensorflow as tf
import losses
import histogram
import visualizer
import CubeDataset
from report import print_report, error_statistics
mode = 'rb'
# path = "/media/donik/Disk/intel_tau/paths_field.txt"
# imgs = load_... | 34.075269 | 116 | 0.646261 | import learnable_histogram
import TauDataset
import data_processing as dp
import numpy as np
import tensorflow as tf
import losses
import histogram
import visualizer
import CubeDataset
from report import print_report, error_statistics
def load_image_names(path, base_path):
names = np.loadtxt(path, dtype="str")
... | 574 | 0 | 46 |
0f792987d80e5861bf3ac86ee1a3d3b2bbbcfcc4 | 23 | py | Python | vgtk/vgtk/functional/__init__.py | chienerh/EPN_PointCloud | d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30 | [
"MIT"
] | 51 | 2021-03-29T08:57:50.000Z | 2022-03-30T07:43:58.000Z | vgtk/vgtk/functional/__init__.py | chienerh/EPN_PointCloud | d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30 | [
"MIT"
] | 2 | 2021-04-03T15:22:29.000Z | 2021-09-03T01:27:59.000Z | vgtk/vgtk/functional/__init__.py | chienerh/EPN_PointCloud | d1488cf1ff82a5bc7ac89c28df30fa2f3f2e0e30 | [
"MIT"
] | 4 | 2021-05-14T02:58:30.000Z | 2022-03-22T18:55:34.000Z | from .rotation import * | 23 | 23 | 0.782609 | from .rotation import * | 0 | 0 | 0 |
04cbaef966fa6fa70ab44438f50e64c3a5e06b8e | 251 | py | Python | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_max_length_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_max_length_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_max_length_3_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.list_pkg.any_uri.schema_instance.nistschema_sv_iv_list_any_uri_max_length_3_xsd.nistschema_sv_iv_list_any_uri_max_length_3 import NistschemaSvIvListAnyUriMaxLength3
__all__ = [
"NistschemaSvIvListAnyUriMaxLength3",
]
| 41.833333 | 193 | 0.89243 | from output.models.nist_data.list_pkg.any_uri.schema_instance.nistschema_sv_iv_list_any_uri_max_length_3_xsd.nistschema_sv_iv_list_any_uri_max_length_3 import NistschemaSvIvListAnyUriMaxLength3
__all__ = [
"NistschemaSvIvListAnyUriMaxLength3",
]
| 0 | 0 | 0 |
ad6f07e3a152dcb07c862494d1fbbcad0a6bcced | 3,579 | py | Python | flaskJSONRPCServer/example/mergeFlaskApp.py | byaka/flaskJSONRPCServer | 328e88c7358e8ce87cd8c56a2db22b0c43e9661d | [
"Apache-2.0"
] | 2 | 2017-04-12T05:54:38.000Z | 2019-10-09T15:56:18.000Z | flaskJSONRPCServer/example/mergeFlaskApp.py | byaka/flaskJSONRPCServer | 328e88c7358e8ce87cd8c56a2db22b0c43e9661d | [
"Apache-2.0"
] | 160 | 2015-04-24T09:39:08.000Z | 2019-10-13T15:27:29.000Z | flaskJSONRPCServer/example/mergeFlaskApp.py | byaka/flaskJSONRPCServer | 328e88c7358e8ce87cd8c56a2db22b0c43e9661d | [
"Apache-2.0"
] | 2 | 2016-02-26T13:20:02.000Z | 2021-10-05T04:05:04.000Z | # -*- coding: utf-8 -*-
import sys, time, random
#FLASK
from flask import Flask, request
from flaskJSONRPCServer import flaskJSONRPCServer
echo._alias='helloworld' #setting alias for method
app=Flask(__name__)
@app.route('/readpost', methods=['POST'])
app2=Flask(__name__)
@app2.route('/helloworld', methods=['GET'])... | 42.105882 | 244 | 0.686225 | # -*- coding: utf-8 -*-
import sys, time, random
#FLASK
from flask import Flask, request
from flaskJSONRPCServer import flaskJSONRPCServer
def echo(data='Hello world!'):
# Simply echo
return data
echo._alias='helloworld' #setting alias for method
def stats(_connection=None):
#return server's speed stats
... | 987 | 0 | 181 |
2971e7f8d7109db83925545f9423d8ef90054149 | 594 | py | Python | src/python/pants/core/util_rules/distdir_test.py | viktortnk/pants | 54c98206de5ac9aadfe26d83175f472941be6c7d | [
"Apache-2.0"
] | 1 | 2020-06-13T22:01:39.000Z | 2020-06-13T22:01:39.000Z | src/python/pants/core/util_rules/distdir_test.py | viktortnk/pants | 54c98206de5ac9aadfe26d83175f472941be6c7d | [
"Apache-2.0"
] | null | null | null | src/python/pants/core/util_rules/distdir_test.py | viktortnk/pants | 54c98206de5ac9aadfe26d83175f472941be6c7d | [
"Apache-2.0"
] | 2 | 2020-05-18T18:43:11.000Z | 2020-05-19T02:47:47.000Z | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pathlib import Path
import pytest
from pants.core.util_rules.distdir import DistDir, InvalidDistDir, validate_distdir
| 34.941176 | 96 | 0.747475 | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pathlib import Path
import pytest
from pants.core.util_rules.distdir import DistDir, InvalidDistDir, validate_distdir
def test_distdir():
buildroot = Path("/buildroot")
as... | 313 | 0 | 23 |
17b0a6e850d3e4025bc339029a459d15ea6ce799 | 9,504 | py | Python | brainstat/tests/test_f_test.py | rmarkello/BrainStat | f34ffa01274aabf411feb801a3ea1869f8a22d11 | [
"BSD-3-Clause"
] | null | null | null | brainstat/tests/test_f_test.py | rmarkello/BrainStat | f34ffa01274aabf411feb801a3ea1869f8a22d11 | [
"BSD-3-Clause"
] | null | null | null | brainstat/tests/test_f_test.py | rmarkello/BrainStat | f34ffa01274aabf411feb801a3ea1869f8a22d11 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pickle
from .testutil import datadir
from brainstat.stats.SLM import SLM, f_test
from brainstat.stats.terms import Term
# test data *pkl consists of slm1* and slm2* keys
# slm1* variables will be assigned to slm1 dictionary, and slm2* to the slm2 dict.
| 35.729323 | 86 | 0.59838 | import numpy as np
import pickle
from .testutil import datadir
from brainstat.stats.SLM import SLM, f_test
from brainstat.stats.terms import Term
def dummy_test(infile, expfile):
# load input test data
ifile = open(infile, "br")
idic = pickle.load(ifile)
ifile.close()
slm1 = SLM(Term(1), Term(1)... | 8,911 | 0 | 299 |
c99df33ef3173736e323be22afd14fcd3e379231 | 5,762 | py | Python | fragresp/scripts/run_check.py | wutobias/fragresp | 57ecd73b9f056812752ce6f00b6456b532311c76 | [
"MIT"
] | 1 | 2020-07-22T13:55:20.000Z | 2020-07-22T13:55:20.000Z | fragresp/scripts/run_check.py | wutobias/fragresp | 57ecd73b9f056812752ce6f00b6456b532311c76 | [
"MIT"
] | null | null | null | fragresp/scripts/run_check.py | wutobias/fragresp | 57ecd73b9f056812752ce6f00b6456b532311c76 | [
"MIT"
] | null | null | null | import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pickle
from collections import OrderedDict
from fragresp.gaussian_tools import check_opt as _check_opt
from fragresp.gaussian_tools import check_esp as _check_esp
from fragresp.gaussian_tools import get_energy a... | 30.812834 | 73 | 0.566644 | import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pickle
from collections import OrderedDict
from fragresp.gaussian_tools import check_opt as _check_opt
from fragresp.gaussian_tools import check_esp as _check_esp
from fragresp.gaussian_tools import get_energy a... | 5,312 | 0 | 69 |
fdead8cdb2770e15490a8872b628ae1a8cf86c76 | 2,057 | py | Python | examples/market.py | paulorauber/pgm | 6d5af508b0fa48e475b8a54c7dce8e1515f6a50e | [
"MIT"
] | 19 | 2015-04-28T18:23:18.000Z | 2022-01-27T10:20:44.000Z | examples/market.py | paulorauber/pgm | 6d5af508b0fa48e475b8a54c7dce8e1515f6a50e | [
"MIT"
] | 1 | 2020-10-16T04:24:26.000Z | 2020-10-16T04:24:26.000Z | examples/market.py | paulorauber/pgm | 6d5af508b0fa48e475b8a54c7dce8e1515f6a50e | [
"MIT"
] | 11 | 2017-08-01T17:11:05.000Z | 2021-11-26T14:48:40.000Z | from model.factor import RandomVar
from model.factor import CPD
from model.factor import Factor
from model.influence import InfluenceDiagram
from inference.exact import ExpectedUtility
if __name__ == '__main__':
main()
| 26.371795 | 60 | 0.562956 | from model.factor import RandomVar
from model.factor import CPD
from model.factor import Factor
from model.influence import InfluenceDiagram
from inference.exact import ExpectedUtility
def three_variables():
M = RandomVar('Market', 3)
F = RandomVar('Found', 2)
uMF = Factor([M, F], [0, -7, 0, 5, 0, 20])
... | 1,761 | 0 | 69 |
578135e235807cfcab22851a2858d9e073215126 | 6,116 | py | Python | zanichelli_parola_del_giorno/zanichelli_parola_del_giorno.py | cipz/InstagramBots | c9e391633684ae17aa8c6edf5b8d854e27b89bcc | [
"MIT"
] | 3 | 2020-10-28T09:51:14.000Z | 2020-10-29T08:22:50.000Z | zanichelli_parola_del_giorno/zanichelli_parola_del_giorno.py | cipz/InstagramBots | c9e391633684ae17aa8c6edf5b8d854e27b89bcc | [
"MIT"
] | null | null | null | zanichelli_parola_del_giorno/zanichelli_parola_del_giorno.py | cipz/InstagramBots | c9e391633684ae17aa8c6edf5b8d854e27b89bcc | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Importing custom files
import sys
sys.path.insert(1, '../')
import utils
import instagram
from datetime import date
from PIL import Image, ImageDraw
from bs4 import BeautifulSoup
import urllib.request
import requests
import time
import wget
import json
import os
if __name__ == "__main__":
i... | 33.059459 | 244 | 0.631295 | #!/usr/bin/python
# Importing custom files
import sys
sys.path.insert(1, '../')
import utils
import instagram
from datetime import date
from PIL import Image, ImageDraw
from bs4 import BeautifulSoup
import urllib.request
import requests
import time
import wget
import json
import os
def main(debug):
## -- #... | 5,606 | 0 | 26 |
1d90bc1b77764ec27f3c296f8d8edc9f0f1f66f9 | 307 | py | Python | build/lib/tnetwork/DCD/externals/utils.py | Yquetzal/tnetwork | 43fb2f19aeed57a8a9d9af032ee80f1c9f58516d | [
"BSD-2-Clause"
] | 4 | 2019-02-19T07:49:06.000Z | 2020-09-01T16:17:54.000Z | tnetwork/DCD/externals/utils.py | Yquetzal/tnetwork | 43fb2f19aeed57a8a9d9af032ee80f1c9f58516d | [
"BSD-2-Clause"
] | 1 | 2019-07-13T16:16:28.000Z | 2019-07-15T09:34:33.000Z | build/lib/tnetwork/DCD/externals/utils.py | Yquetzal/tnetwork | 43fb2f19aeed57a8a9d9af032ee80f1c9f58516d | [
"BSD-2-Clause"
] | 3 | 2019-07-13T16:09:20.000Z | 2022-02-08T02:23:46.000Z | import os
| 20.466667 | 43 | 0.641694 | import os
def clean_create_dir(dir):
if not os.path.exists(dir):
os.makedirs(dir, exist_ok=True)
filelist = [f for f in os.listdir(dir)]
for f in filelist:
os.remove(os.path.join(dir, f))
def clear_file(filename):
if os.path.exists(filename):
os.remove(filename)
| 250 | 0 | 46 |
78dcceb9d60795c264aadbff9ec8b0ea045d40a1 | 2,850 | py | Python | fusion/experiment/pe_array.py | SheaCai/optimus | e9a9a2354376c786d7e6c64e34dee2c2010e5585 | [
"MIT"
] | 3 | 2021-05-05T06:55:38.000Z | 2022-02-19T06:19:59.000Z | fusion/experiment/pe_array.py | SheaCai/optimus | e9a9a2354376c786d7e6c64e34dee2c2010e5585 | [
"MIT"
] | null | null | null | fusion/experiment/pe_array.py | SheaCai/optimus | e9a9a2354376c786d7e6c64e34dee2c2010e5585 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('../'))
sys.path.append(os.path.abspath('../../'))
import matplotlib.pyplot as plt
import numpy as np
from fusion.scheduling import batch_size
from fusion.scheduling import Resource
from fusion.scheduling import LoopLowerBound
... | 32.022472 | 110 | 0.631579 | import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('../'))
sys.path.append(os.path.abspath('../../'))
import matplotlib.pyplot as plt
import numpy as np
from fusion.scheduling import batch_size
from fusion.scheduling import Resource
from fusion.scheduling import LoopLowerBound
... | 0 | 0 | 0 |
2a35694f15ec6717ca92e616b88e2260cec47367 | 68 | py | Python | scripts/qgis_fixes/fix_future_builtins.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | scripts/qgis_fixes/fix_future_builtins.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | null | null | null | scripts/qgis_fixes/fix_future_builtins.py | dyna-mis/Hilabeling | cb7d5d4be29624a20c8a367162dbc6fd779b2b52 | [
"MIT"
] | 1 | 2021-12-25T08:40:30.000Z | 2021-12-25T08:40:30.000Z | from libfuturize.fixes.fix_future_builtins import FixFutureBuiltins
| 34 | 67 | 0.911765 | from libfuturize.fixes.fix_future_builtins import FixFutureBuiltins
| 0 | 0 | 0 |
907aad0046071a3624c9516fbf2c4978313c69da | 202 | py | Python | MyPython/test.py | LairdStreak/MyPyPlayGround | e999cfd179d457a6d17c81bf1bacaa7c90e3e1dc | [
"MIT"
] | null | null | null | MyPython/test.py | LairdStreak/MyPyPlayGround | e999cfd179d457a6d17c81bf1bacaa7c90e3e1dc | [
"MIT"
] | null | null | null | MyPython/test.py | LairdStreak/MyPyPlayGround | e999cfd179d457a6d17c81bf1bacaa7c90e3e1dc | [
"MIT"
] | null | null | null | """This module does blah blah."""
import httplib2
resp, content = httplib2.Http().request("http://myip.dk")
#start = content.find("ipv4address")
#end = start + 100
print (content) #[start:end].strip()) | 28.857143 | 57 | 0.688119 | """This module does blah blah."""
import httplib2
resp, content = httplib2.Http().request("http://myip.dk")
#start = content.find("ipv4address")
#end = start + 100
print (content) #[start:end].strip()) | 0 | 0 | 0 |
61b5cb8cdfd5f40d0b514f7d1175350b322a4808 | 3,161 | py | Python | src/bbdata/endpoint/output/values.py | big-building-data/bbdata-python | 46335c9f8db9ceccbd795c4931db0e3041ba9a50 | [
"MIT"
] | null | null | null | src/bbdata/endpoint/output/values.py | big-building-data/bbdata-python | 46335c9f8db9ceccbd795c4931db0e3041ba9a50 | [
"MIT"
] | null | null | null | src/bbdata/endpoint/output/values.py | big-building-data/bbdata-python | 46335c9f8db9ceccbd795c4931db0e3041ba9a50 | [
"MIT"
] | null | null | null | from enum import Enum
import requests
from bbdata.config import output_api_url
from bbdata.util import handle_response
from bbdata.exceptions import ClientException
| 33.273684 | 117 | 0.624486 | from enum import Enum
import requests
from bbdata.config import output_api_url
from bbdata.util import handle_response
from bbdata.exceptions import ClientException
class Aggregation(Enum):
QUARTERS = "quarters"
HOURS = "hours"
class Values:
base_path = "/values"
auth = None
def __init__(self, ... | 29 | 2,920 | 46 |
71902b1fce8341e9f2e83921f553231c3a499893 | 1,708 | py | Python | dict_tiny/util.py | louieh/dict-tiny | afa3eb9c5e5e00a103799e2b76c16819736d756e | [
"MIT"
] | 8 | 2018-06-28T09:17:18.000Z | 2022-01-12T03:22:05.000Z | dict_tiny/util.py | louieh/dict-tiny | afa3eb9c5e5e00a103799e2b76c16819736d756e | [
"MIT"
] | 1 | 2021-12-17T17:06:11.000Z | 2021-12-17T17:06:11.000Z | dict_tiny/util.py | louieh/dict-tiny | afa3eb9c5e5e00a103799e2b76c16819736d756e | [
"MIT"
] | null | null | null | from collections import defaultdict
from lxml import html
import requests
from plumbum import colors
from dict_tiny.setting import TIME_OUT
def is_alphabet(word):
"""
return the word is English or Chinese
:param word:
:return:
"""
is_alphabet = defaultdict(int)
word = word.replace(' ', '')... | 26.6875 | 71 | 0.595433 | from collections import defaultdict
from lxml import html
import requests
from plumbum import colors
from dict_tiny.setting import TIME_OUT
def is_alphabet(word):
"""
return the word is English or Chinese
:param word:
:return:
"""
is_alphabet = defaultdict(int)
word = word.replace(' ', '')... | 0 | 0 | 0 |
e16f51347983756b0b65cbcd4ff05bed86cadb4a | 341 | py | Python | recipe/run_test.py | conda-forge/cmlgenerator-feedstock | ad4662b2bcc6a7c1de69ed365e14cf4f34773b00 | [
"BSD-3-Clause"
] | null | null | null | recipe/run_test.py | conda-forge/cmlgenerator-feedstock | ad4662b2bcc6a7c1de69ed365e14cf4f34773b00 | [
"BSD-3-Clause"
] | null | null | null | recipe/run_test.py | conda-forge/cmlgenerator-feedstock | ad4662b2bcc6a7c1de69ed365e14cf4f34773b00 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Created on Thr Apr 8 18:00:00 2021
:Authors:
Mark Driver <mdd31>
Mark J. Williamson <mjw99>
"""
import logging
from cmlgenerator.test.cmlgeneratortests import run_tests
logging.basicConfig()
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.WARN)
if __name__ == "__main... | 17.05 | 57 | 0.730205 | #!/usr/bin/env python3
"""
Created on Thr Apr 8 18:00:00 2021
:Authors:
Mark Driver <mdd31>
Mark J. Williamson <mjw99>
"""
import logging
from cmlgenerator.test.cmlgeneratortests import run_tests
logging.basicConfig()
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.WARN)
if __name__ == "__main... | 0 | 0 | 0 |
00b8e893fb9addadfffde5ef162da631dad72050 | 14,987 | py | Python | operators/draw_nodes/draw_nodes_outlines.py | nwtajcky/RenderStackNode | 31516af6fa8572c9d6ee3df017e59cae394047a3 | [
"Apache-2.0"
] | null | null | null | operators/draw_nodes/draw_nodes_outlines.py | nwtajcky/RenderStackNode | 31516af6fa8572c9d6ee3df017e59cae394047a3 | [
"Apache-2.0"
] | 1 | 2021-12-27T06:39:08.000Z | 2021-12-27T06:39:08.000Z | operators/draw_nodes/draw_nodes_outlines.py | nwtajcky/RenderStackNode | 31516af6fa8572c9d6ee3df017e59cae394047a3 | [
"Apache-2.0"
] | null | null | null | from math import cos, sin, pi
import bgl
import blf
import bpy
import gpu
from bpy.props import *
from bpy.types import Operator
from gpu_extras.batch import batch_for_shader
from .utils import dpifac, draw_tri_fan
from ...preferences import get_pref
class RSN_OT_DrawNodes(Operator):
"""Draw the active ... | 35.683333 | 129 | 0.602389 | from math import cos, sin, pi
import bgl
import blf
import bpy
import gpu
from bpy.props import *
from bpy.types import Operator
from gpu_extras.batch import batch_for_shader
from .utils import dpifac, draw_tri_fan
from ...preferences import get_pref
def find_node_parent(node):
def get_parent(obj):
if ... | 14,285 | 0 | 261 |
1cac8ac00e852b70048e86fc5f1112d85ed2cd46 | 3,187 | py | Python | src/internal/checker.py | ziyan-wang/dcs290-proj2-judge | 3fa56f7e9cce58b2f6bc3fcc0fb8b8ae32eb968b | [
"MIT"
] | null | null | null | src/internal/checker.py | ziyan-wang/dcs290-proj2-judge | 3fa56f7e9cce58b2f6bc3fcc0fb8b8ae32eb968b | [
"MIT"
] | null | null | null | src/internal/checker.py | ziyan-wang/dcs290-proj2-judge | 3fa56f7e9cce58b2f6bc3fcc0fb8b8ae32eb968b | [
"MIT"
] | null | null | null | from internal.model import Node, Rule, ExistRule, ChildRule, Direction, RuleNode, ParentChildRule
| 40.858974 | 112 | 0.657986 | from internal.model import Node, Rule, ExistRule, ChildRule, Direction, RuleNode, ParentChildRule
def check(tree: Node, rules: list[Rule]) -> list[str]:
violated: list[str] = []
for rule in rules:
if _check(tree, rule) is False:
violated.append(rule.id)
return violated
def _check(roo... | 2,945 | 0 | 138 |
3922c0d00a10118d6f978a18d3a3ad837a2ecf59 | 1,034 | py | Python | portals/wwits/groups/access/function_authorize_list/schemas.py | jalanb/portals | 7a5360b48547719d3fbe50790f08eaf5571148dd | [
"ADSL"
] | null | null | null | portals/wwits/groups/access/function_authorize_list/schemas.py | jalanb/portals | 7a5360b48547719d3fbe50790f08eaf5571148dd | [
"ADSL"
] | null | null | null | portals/wwits/groups/access/function_authorize_list/schemas.py | jalanb/portals | 7a5360b48547719d3fbe50790f08eaf5571148dd | [
"ADSL"
] | null | null | null | from marshmallow import fields, post_load
from portals.wwits.apis.rest import BaseSchemaExcludeFields as Schema
from .models import ParmModel, FunctionAuthorizeListModel, FunctionModel
| 28.722222 | 72 | 0.718569 | from marshmallow import fields, post_load
from portals.wwits.apis.rest import BaseSchemaExcludeFields as Schema
from .models import ParmModel, FunctionAuthorizeListModel, FunctionModel
class ParmSchema(Schema):
Version = fields.Str(data_key="Version")
Env = fields.Str(data_key="Env")
UserID = fields.Str(... | 171 | 605 | 69 |
15e5add04b2bb411cd8af5ed528e6fddb6ed8c75 | 8,045 | py | Python | 05 Heap/canonical_heap.py | XuuRee/python-data-structures | a3972f5781d666d15d61c0d474877880d1b7c483 | [
"MIT"
] | null | null | null | 05 Heap/canonical_heap.py | XuuRee/python-data-structures | a3972f5781d666d15d61c0d474877880d1b7c483 | [
"MIT"
] | null | null | null | 05 Heap/canonical_heap.py | XuuRee/python-data-structures | a3972f5781d666d15d61c0d474877880d1b7c483 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# IB002 Domaci uloha 6.
#
# V nasledujicim textu pouzivame pojem "halda" ve vyznamu "binarni halda".
#
# Minimova halda je v kanonickem tvaru, pokud pro kazdy jeji prvek se dvema
# potomky plati, ze jeho levy potomek je mensi nez ten pravy nebo se oba
# rovnaji.
#
# Je v kanonickem tvaru | Neni... | 30.589354 | 79 | 0.592915 | #!/usr/bin/env python3
# IB002 Domaci uloha 6.
#
# V nasledujicim textu pouzivame pojem "halda" ve vyznamu "binarni halda".
#
# Minimova halda je v kanonickem tvaru, pokud pro kazdy jeji prvek se dvema
# potomky plati, ze jeho levy potomek je mensi nez ten pravy nebo se oba
# rovnaji.
#
# Je v kanonickem tvaru | Neni... | 1,127 | -7 | 141 |
0723c0fb5653e3940416fc37c1548f5e66e2068a | 1,201 | py | Python | data_helpers/decode_index_files.py | ArvinZhuang/COIL | 5cb492f2dcffe594d2be0ae4d4d557056051ffca | [
"Apache-2.0"
] | null | null | null | data_helpers/decode_index_files.py | ArvinZhuang/COIL | 5cb492f2dcffe594d2be0ae4d4d557056051ffca | [
"Apache-2.0"
] | null | null | null | data_helpers/decode_index_files.py | ArvinZhuang/COIL | 5cb492f2dcffe594d2be0ae4d4d557056051ffca | [
"Apache-2.0"
] | null | null | null | import os, glob
import json
from transformers import BertTokenizer
from tqdm import tqdm
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument('--file_path', type=str, required=True)
parser.add_argument('--output_path', type=str, required=True)
... | 34.314286 | 103 | 0.625312 | import os, glob
import json
from transformers import BertTokenizer
from tqdm import tqdm
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument('--file_path', type=str, required=True)
parser.add_argument('--output_path', type=str, required=True)
... | 0 | 0 | 0 |
b7c8b8db359b5c382b1b5f6804afa09f814e349b | 329 | py | Python | chapter/urls.py | 0lidaxiang/WeArt | 088bc2cdc7c653d4e4a84dea8f70cc86e12a8db9 | [
"BSD-3-Clause"
] | 1 | 2017-07-12T14:53:45.000Z | 2017-07-12T14:53:45.000Z | chapter/urls.py | 0lidaxiang/WeArt | 088bc2cdc7c653d4e4a84dea8f70cc86e12a8db9 | [
"BSD-3-Clause"
] | null | null | null | chapter/urls.py | 0lidaxiang/WeArt | 088bc2cdc7c653d4e4a84dea8f70cc86e12a8db9 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from chapter.view.createChapter import *
from chapter.view.getChapter import *
urlpatterns = [
# url('^login/$', login),
url('^createAChapter/$', createAChapter),
url('^getChapter/$', getChapter),
url('^bookChapter/$', bookCha... | 27.416667 | 45 | 0.699088 | from django.conf.urls import include, url
from django.contrib import admin
from chapter.view.createChapter import *
from chapter.view.getChapter import *
urlpatterns = [
# url('^login/$', login),
url('^createAChapter/$', createAChapter),
url('^getChapter/$', getChapter),
url('^bookChapter/$', bookCha... | 0 | 0 | 0 |
d148ed2e786ff5cc4c8278daf1b9318f71b5f6e0 | 15,641 | py | Python | yggdrasil/config.py | astro-friedel/yggdrasil | 5ecbfd083240965c20c502b4795b6dc93d94b020 | [
"BSD-3-Clause"
] | null | null | null | yggdrasil/config.py | astro-friedel/yggdrasil | 5ecbfd083240965c20c502b4795b6dc93d94b020 | [
"BSD-3-Clause"
] | null | null | null | yggdrasil/config.py | astro-friedel/yggdrasil | 5ecbfd083240965c20c502b4795b6dc93d94b020 | [
"BSD-3-Clause"
] | null | null | null | """
This module imports the configuration for yggdrasil.
.. todo::
Remove reference to environment variables for accessing config options.
"""
import os
import sys
import json
import shutil
import logging
import warnings
import subprocess
from yggdrasil.backwards import configparser
from yggdrasil import platform,... | 36.802353 | 84 | 0.592353 | """
This module imports the configuration for yggdrasil.
.. todo::
Remove reference to environment variables for accessing config options.
"""
import os
import sys
import json
import shutil
import logging
import warnings
import subprocess
from yggdrasil.backwards import configparser
from yggdrasil import platform,... | 967 | 0 | 81 |
169cbc55b107d627e16e8d100c9590e216f3c200 | 253 | py | Python | 226-invert-binary-tree/solution.py | phenix3443/leetcode | b6d8486e859b2db0bf3d58f55a6e1d439b0b891a | [
"MIT"
] | null | null | null | 226-invert-binary-tree/solution.py | phenix3443/leetcode | b6d8486e859b2db0bf3d58f55a6e1d439b0b891a | [
"MIT"
] | null | null | null | 226-invert-binary-tree/solution.py | phenix3443/leetcode | b6d8486e859b2db0bf3d58f55a6e1d439b0b891a | [
"MIT"
] | null | null | null | # -*- coding:utf-8; -*-
class Solution:
"""
解题思路:递归
"""
| 15.8125 | 87 | 0.541502 | # -*- coding:utf-8; -*-
class Solution:
"""
解题思路:递归
"""
def invertTree(self, root):
if not root:
return
root.left, root.right = self.invertTree(root.right), self.invertTree(root.left)
return root
| 156 | 0 | 27 |
d907e264b8481d24b1f44bc322e576f547d94156 | 35,143 | py | Python | domonit/inspect.py | riley022/DoMonit | 4ba0e9b145db03db579e38a126929c29f6f64e6c | [
"MIT"
] | null | null | null | domonit/inspect.py | riley022/DoMonit | 4ba0e9b145db03db579e38a126929c29f6f64e6c | [
"MIT"
] | 1 | 2018-05-22T09:50:35.000Z | 2018-05-22T09:50:35.000Z | domonit/inspect.py | riley022/DoMonit | 4ba0e9b145db03db579e38a126929c29f6f64e6c | [
"MIT"
] | null | null | null | import requests_unixsocket
import json
from errors import NoSuchContainerError, ServerErrorError
from utils.utils import Utils
u = Utils()
#https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/
| 30.29569 | 95 | 0.561477 | import requests_unixsocket
import json
from errors import NoSuchContainerError, ServerErrorError
from utils.utils import Utils
u = Utils()
#https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/
class Inspect():
def __init__(self, container_id):
self.container_id = container_id
... | 31,651 | -5 | 3,266 |
cb142d0c8442e3a75243e7defedf02e5725aacae | 518 | py | Python | iniciante/python/1099-soma-de-impares-consecutivos-ii.py | tfn10/beecrowd | 1ebf19ca9a253eb326160f03145d20be33064969 | [
"MIT"
] | null | null | null | iniciante/python/1099-soma-de-impares-consecutivos-ii.py | tfn10/beecrowd | 1ebf19ca9a253eb326160f03145d20be33064969 | [
"MIT"
] | null | null | null | iniciante/python/1099-soma-de-impares-consecutivos-ii.py | tfn10/beecrowd | 1ebf19ca9a253eb326160f03145d20be33064969 | [
"MIT"
] | null | null | null |
quant_de_testes = int(input())
soma_de_impares_consecutivos(quant_de_testes)
| 22.521739 | 55 | 0.552124 | def entrada():
numeros = list(map(int, input().split(' ')))
n1 = numeros[0]
n2 = numeros[1]
return n1, n2
def soma_de_impares_consecutivos(quantidade_de_testes):
while quantidade_de_testes > 0:
x, y = entrada()
if x > y:
x, y = y, x
soma = 0
for i in ran... | 393 | 0 | 45 |
500f0fc8f62478583876b9768e5dd75780ba3038 | 2,856 | py | Python | components/bigquery/query/src/query.py | xieqihui/pipelines | a39ae8eb779e69e4e85e424abba8ecac3f60435f | [
"Apache-2.0"
] | 9 | 2019-03-28T02:20:45.000Z | 2021-12-01T22:43:36.000Z | components/bigquery/query/src/query.py | xieqihui/pipelines | a39ae8eb779e69e4e85e424abba8ecac3f60435f | [
"Apache-2.0"
] | 21 | 2020-01-28T22:48:55.000Z | 2022-03-08T22:48:12.000Z | components/bigquery/query/src/query.py | xieqihui/pipelines | a39ae8eb779e69e4e85e424abba8ecac3f60435f | [
"Apache-2.0"
] | 4 | 2019-04-11T12:09:59.000Z | 2020-10-11T15:53:53.000Z | # Copyright 2018 Google LLC
#
# 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, ... | 28 | 81 | 0.708333 | # Copyright 2018 Google LLC
#
# 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, ... | 1,299 | 0 | 69 |
c54d1d9204fda34b28ecde787fd15c640bd4234a | 3,885 | py | Python | gs_pip_install/gs_pip_install.py | cseHdz/gs_pip_install | 743e572bf53d01ddbce35d93f740c224d08a494c | [
"MIT"
] | null | null | null | gs_pip_install/gs_pip_install.py | cseHdz/gs_pip_install | 743e572bf53d01ddbce35d93f740c224d08a494c | [
"MIT"
] | null | null | null | gs_pip_install/gs_pip_install.py | cseHdz/gs_pip_install | 743e572bf53d01ddbce35d93f740c224d08a494c | [
"MIT"
] | null | null | null | import os
import subprocess
import sys
import shutil
import logging
from typing import Optional, List
import click
from google.cloud import storage
@click.command()
@click.option('-b', "--bucket_name", help="(str) Name of GCS bucket")
@click.option(
'-r',
"--requirement",
help="(str) Name of Python packa... | 31.08 | 85 | 0.615444 | import os
import subprocess
import sys
import shutil
import logging
from typing import Optional, List
import click
from google.cloud import storage
@click.command()
@click.option('-b', "--bucket_name", help="(str) Name of GCS bucket")
@click.option(
'-r',
"--requirement",
help="(str) Name of Python packa... | 0 | 0 | 0 |
3c6c46496a0c4eb7347942566a531f86dc598146 | 118 | py | Python | scripts/generate_secret_key.py | dimadk24/english-fight-api | 506a3eb2cb4cb91203b1e023b5248c27975df075 | [
"MIT"
] | 2 | 2015-10-04T09:00:19.000Z | 2019-06-07T18:59:41.000Z | tools/django_new_secretkey.py | VlasovVitaly/internal | 3cb382ddd34f89ff10bb31537658114722084468 | [
"MIT"
] | null | null | null | tools/django_new_secretkey.py | VlasovVitaly/internal | 3cb382ddd34f89ff10bb31537658114722084468 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
| 19.666667 | 62 | 0.822034 | #!/usr/bin/env python
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
| 0 | 0 | 0 |
26201a87a95b649bd707768c61038ae09d833cee | 281 | py | Python | src/json_functions.py | iansedano/twitbotto | 5b25e2745548cb0a0ff705867bd0bd6fbbcafc99 | [
"MIT"
] | null | null | null | src/json_functions.py | iansedano/twitbotto | 5b25e2745548cb0a0ff705867bd0bd6fbbcafc99 | [
"MIT"
] | 2 | 2021-06-08T21:23:08.000Z | 2021-09-08T01:55:32.000Z | src/json_functions.py | iansedano/twitbotto | 5b25e2745548cb0a0ff705867bd0bd6fbbcafc99 | [
"MIT"
] | null | null | null | import json
import os
| 20.071429 | 50 | 0.672598 | import json
import os
def list_to_json(list_to_convert, json_file_name):
path = "..\\jsons\\" + json_file_name
with open(path, 'w') as fp:
json.dump(list_to_convert, fp)
def read_json(path):
with open(path) as json_file:
return json.load(json_file)
| 211 | 0 | 46 |
b8911302eb3439249e4effef1b079cd8227cb386 | 155 | py | Python | locate/__init__.py | AutoActuary/locate | c736b7374d453e5c7cfee3deacfb04a8649ea638 | [
"MIT"
] | null | null | null | locate/__init__.py | AutoActuary/locate | c736b7374d453e5c7cfee3deacfb04a8649ea638 | [
"MIT"
] | 3 | 2021-10-06T11:49:36.000Z | 2022-03-30T11:48:35.000Z | locate/__init__.py | AutoActuary/locate | c736b7374d453e5c7cfee3deacfb04a8649ea638 | [
"MIT"
] | null | null | null | from .locate import (
this_dir,
allow_relative_location_imports,
force_relative_location_imports,
append_sys_path,
prepend_sys_path,
)
| 19.375 | 36 | 0.754839 | from .locate import (
this_dir,
allow_relative_location_imports,
force_relative_location_imports,
append_sys_path,
prepend_sys_path,
)
| 0 | 0 | 0 |
56403e9193d1094b1cd5383247457c75f4873f69 | 230 | py | Python | commonuicomponents/ttk/containers/labeledwidget/labeledcontainer.py | RobinBobin/python3-common-ui-components | 281936a3bf6f1a366eeaaf8f177c0fae9ef24389 | [
"MIT"
] | 2 | 2020-08-04T16:30:13.000Z | 2020-10-28T14:23:33.000Z | commonuicomponents/ttk/containers/labeledwidget/labeledcontainer.py | RobinBobin/python3-common-ui-components | 281936a3bf6f1a366eeaaf8f177c0fae9ef24389 | [
"MIT"
] | null | null | null | commonuicomponents/ttk/containers/labeledwidget/labeledcontainer.py | RobinBobin/python3-common-ui-components | 281936a3bf6f1a366eeaaf8f177c0fae9ef24389 | [
"MIT"
] | null | null | null | from .basecontainer import inflateChildren
from .. import LabeledContainer
| 25.555556 | 54 | 0.769565 | from .basecontainer import inflateChildren
from .. import LabeledContainer
class LabeledWidgetLabeledContainer(LabeledContainer):
def _inflateChildren(self):
inflateChildren(self)
super()._inflateChildren()
| 74 | 33 | 48 |
816361f9f99094f3baec25c09e4c879eebf67dbd | 2,420 | py | Python | calls/utils.py | dtcooper/bmir-calls | f03e40b5037f1c7ec70b8035b9bb219e209e45b9 | [
"MIT"
] | 1 | 2019-11-03T17:37:56.000Z | 2019-11-03T17:37:56.000Z | calls/utils.py | dtcooper/bmir-calls | f03e40b5037f1c7ec70b8035b9bb219e209e45b9 | [
"MIT"
] | null | null | null | calls/utils.py | dtcooper/bmir-calls | f03e40b5037f1c7ec70b8035b9bb219e209e45b9 | [
"MIT"
] | null | null | null | from functools import wraps
import re
from urllib.parse import unquote
from twilio.base.exceptions import TwilioRestException
from flask import (
current_app as app,
render_template,
request,
Response,
url_for,
)
| 28.139535 | 88 | 0.620248 | from functools import wraps
import re
from urllib.parse import unquote
from twilio.base.exceptions import TwilioRestException
from flask import (
current_app as app,
render_template,
request,
Response,
url_for,
)
def sanitize_phone_number(phone_number, with_country_code=False):
sanitized = (... | 2,041 | 0 | 138 |
d204be1e4997608731daf912c09b1dfd1b309e6e | 1,665 | py | Python | python/ldtui/__init__.py | ezequielmastrasso/EZLookdevTools | 4914d8f92b1ff195aeb4b15b277035c61a235ae1 | [
"MIT"
] | 45 | 2019-07-12T16:03:20.000Z | 2022-03-04T06:03:48.000Z | python/ldtui/__init__.py | ezequielmastrasso/EZLookdevTools | 4914d8f92b1ff195aeb4b15b277035c61a235ae1 | [
"MIT"
] | 115 | 2019-05-22T09:10:38.000Z | 2020-03-25T11:01:35.000Z | python/ldtui/__init__.py | ezequielmastrasso/EZLookdevTools | 4914d8f92b1ff195aeb4b15b277035c61a235ae1 | [
"MIT"
] | 8 | 2019-12-03T07:19:37.000Z | 2021-12-13T10:31:15.000Z | """
.. module:: ldtui
:synopsis: Main tools UI.
.. moduleauthor:: Ezequiel Mastrasso
"""
from Qt import QtGui, QtWidgets, QtCore
from Qt.QtWidgets import QApplication, QWidget, QLabel, QMainWindow
import sys
import imp
import os
import logging
from functools import partial
from ldtui import qtutils
import ldt
... | 29.210526 | 75 | 0.671471 | """
.. module:: ldtui
:synopsis: Main tools UI.
.. moduleauthor:: Ezequiel Mastrasso
"""
from Qt import QtGui, QtWidgets, QtCore
from Qt.QtWidgets import QApplication, QWidget, QLabel, QMainWindow
import sys
import imp
import os
import logging
from functools import partial
from ldtui import qtutils
import ldt
... | 1,126 | 0 | 27 |
f4c3f100fa81a8416efb0fabbb2f62c7fe084acb | 5,754 | py | Python | solutions/poker/poker_test.py | mesmacosta/python-ciandt-intership | 65a8941997eee5d683e56de55d33423b2566b7d0 | [
"MIT"
] | 1 | 2020-08-31T23:06:43.000Z | 2020-08-31T23:06:43.000Z | solutions/poker/poker_test.py | mesmacosta/python-ciandt-intership | 65a8941997eee5d683e56de55d33423b2566b7d0 | [
"MIT"
] | null | null | null | solutions/poker/poker_test.py | mesmacosta/python-ciandt-intership | 65a8941997eee5d683e56de55d33423b2566b7d0 | [
"MIT"
] | null | null | null | import unittest
from poker import best_hands
if __name__ == "__main__":
unittest.main()
| 33.453488 | 110 | 0.521724 | import unittest
from poker import best_hands
class PokerTest(unittest.TestCase):
def test_single_hand_always_wins(self):
self.assertEqual(best_hands(["4♠ 5♠ 7♥ 8♦ J♣"]), ["4♠ 5♠ 7♥ 8♦ J♣"])
def test_highest_card_out_of_all_hands_wins(self):
self.assertEqual(
best_hands(["4♦ 5♠ 6♠ ... | 5,737 | 14 | 778 |
d26277a2445117f02d002af1e9017743e8bd3ff0 | 576 | py | Python | actions/push.py | cognifloyd/stackstorm-packer | c6820967bc07acb1c93d2d3fbd516ba9cc79f212 | [
"Apache-2.0"
] | 164 | 2015-01-17T16:08:33.000Z | 2021-08-03T02:34:07.000Z | actions/push.py | cognifloyd/stackstorm-packer | c6820967bc07acb1c93d2d3fbd516ba9cc79f212 | [
"Apache-2.0"
] | 442 | 2015-01-01T11:19:01.000Z | 2017-09-06T23:26:17.000Z | actions/push.py | cognifloyd/stackstorm-packer | c6820967bc07acb1c93d2d3fbd516ba9cc79f212 | [
"Apache-2.0"
] | 202 | 2015-01-13T00:37:40.000Z | 2020-11-07T11:30:10.000Z | from lib.actions import BaseAction
| 36 | 80 | 0.642361 | from lib.actions import BaseAction
class PushAction(BaseAction):
def run(self, packerfile, name, message=None, cwd=None, exclude=None,
only=None, variables=None, variables_file=None):
if cwd:
self.set_dir(cwd)
p = self.packer(packerfile, exc=exclude, only=only, variables=v... | 483 | 8 | 49 |
9dbfe74ec04012783b167322113aa628ebe775f9 | 360 | py | Python | app/exchanges/serializers.py | iyanuashiri/exchange-api | 86f7a4e9fb17f71888e6854510618876d1010c19 | [
"MIT"
] | null | null | null | app/exchanges/serializers.py | iyanuashiri/exchange-api | 86f7a4e9fb17f71888e6854510618876d1010c19 | [
"MIT"
] | null | null | null | app/exchanges/serializers.py | iyanuashiri/exchange-api | 86f7a4e9fb17f71888e6854510618876d1010c19 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Exchange
| 32.727273 | 118 | 0.713889 | from rest_framework import serializers
from .models import Exchange
class ExchangeSerializer(serializers.ModelSerializer):
class Meta:
model = Exchange
fields = ('from_currency_code', 'from_currency_name', 'to_currency_code', 'to_currency_name', 'exchange_rate',
'last_refreshed... | 0 | 268 | 23 |
c97ebed6e5aaf12aba02f2562b55b162f1f5033c | 10,230 | py | Python | optimum/utils/runs.py | huggingface/optimum | 65bb7fa4f635c6d2e6734485f1b8be58cb690fd0 | [
"Apache-2.0"
] | 414 | 2021-09-14T11:39:36.000Z | 2022-03-31T19:10:45.000Z | optimum/utils/runs.py | huggingface/optimum | 65bb7fa4f635c6d2e6734485f1b8be58cb690fd0 | [
"Apache-2.0"
] | 49 | 2021-09-14T11:29:52.000Z | 2022-03-31T14:02:34.000Z | optimum/utils/runs.py | huggingface/optimum | 65bb7fa4f635c6d2e6734485f1b8be58cb690fd0 | [
"Apache-2.0"
] | 29 | 2021-09-15T01:51:54.000Z | 2022-03-23T08:20:17.000Z | from dataclasses import field
from enum import Enum
from typing import Dict, List, Optional, Union
from . import is_pydantic_available
from .doc import generate_doc_dataclass
if is_pydantic_available():
from pydantic.dataclasses import dataclass
else:
from dataclasses import dataclass
@generate_doc_dat... | 38.458647 | 241 | 0.672434 | from dataclasses import field
from enum import Enum
from typing import Dict, List, Optional, Union
from . import is_pydantic_available
from .doc import generate_doc_dataclass
if is_pydantic_available():
from pydantic.dataclasses import dataclass
else:
from dataclasses import dataclass
class APIFeaturesMana... | 2,840 | 3,625 | 272 |
43ed48598a6360fbe18f54e747aef536f3e3507a | 3,111 | py | Python | examples/visualization/roi_erpimage_by_rt.py | andylikescodes/mne-python | 79ea57a4318d8d045f5966c26360b079f40a4865 | [
"BSD-3-Clause"
] | 1 | 2022-02-19T08:13:49.000Z | 2022-02-19T08:13:49.000Z | examples/visualization/roi_erpimage_by_rt.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | null | null | null | examples/visualization/roi_erpimage_by_rt.py | LiFeng-SECUC/mne-python | 732bb1f994e64e41a8e95dcc10dc98c22cac95c0 | [
"BSD-3-Clause"
] | null | null | null | """
===========================================================
Plot single trial activity, grouped by ROI and sorted by RT
===========================================================
This will produce what is sometimes called an event related
potential / field (ERP/ERF) image.
The EEGLAB example file, which contains... | 35.758621 | 78 | 0.630023 | """
===========================================================
Plot single trial activity, grouped by ROI and sorted by RT
===========================================================
This will produce what is sometimes called an event related
potential / field (ERP/ERF) image.
The EEGLAB example file, which contains... | 0 | 0 | 0 |
0cff792743ec078792babef838eedd3ca579a76c | 1,407 | py | Python | local_test.py | invenia/GitLabChangelog | 00d832e0552f3e6647a0030f3b3e0669d828b766 | [
"MIT"
] | null | null | null | local_test.py | invenia/GitLabChangelog | 00d832e0552f3e6647a0030f3b3e0669d828b766 | [
"MIT"
] | 10 | 2021-01-22T23:15:31.000Z | 2022-03-08T10:26:10.000Z | local_test.py | invenia/GitLabChangelog | 00d832e0552f3e6647a0030f3b3e0669d828b766 | [
"MIT"
] | 1 | 2021-03-17T06:03:23.000Z | 2021-03-17T06:03:23.000Z | # This file is intended for local testing when contributing to this repository
# Do not commit any changes
# You will need to generate a GitLab Personal Access Token to use this
from os import environ as env
import gitlab
from gitlabchangelog.changelog import Changelog
env["GITLAB_URL"] = "https://gitlab.invenia.ca"
e... | 31.977273 | 92 | 0.655295 | # This file is intended for local testing when contributing to this repository
# Do not commit any changes
# You will need to generate a GitLab Personal Access Token to use this
from os import environ as env
import gitlab
from gitlabchangelog.changelog import Changelog
env["GITLAB_URL"] = "https://gitlab.invenia.ca"
e... | 0 | 0 | 0 |
fb31d59284b6c9978be82fc5fa54580a4046af2c | 2,117 | py | Python | tree.py | Crowley-VS/Tree | eec5be3adb00aa8a9f0a4d1131bf36d2121271be | [
"MIT"
] | null | null | null | tree.py | Crowley-VS/Tree | eec5be3adb00aa8a9f0a4d1131bf36d2121271be | [
"MIT"
] | null | null | null | tree.py | Crowley-VS/Tree | eec5be3adb00aa8a9f0a4d1131bf36d2121271be | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from colorama import Fore, init
if __name__ == '__main__':
Tree().main()
| 44.104167 | 129 | 0.552197 | import os
from pathlib import Path
from colorama import Fore, init
class Tree:
def __init__(self):
'''Initialize Tree with rendering chars and colors.'''
self.rendering_chars = {'line': '│ ', 'middle': '├───', 'last': '└───', 'space': ' '}
self.dir_color = Fore.CYAN
self.dir_c... | 0 | 1,991 | 23 |
cbe42342e44e002e9e3412fb77108ecaf2dc2886 | 5,907 | py | Python | tests/models/test_card_identifier.py | lejion/django-sagepaypi | 86eeff5afb9681fcc820e2d75910c4e642fefe85 | [
"MIT"
] | null | null | null | tests/models/test_card_identifier.py | lejion/django-sagepaypi | 86eeff5afb9681fcc820e2d75910c4e642fefe85 | [
"MIT"
] | 12 | 2019-03-06T14:27:38.000Z | 2019-03-12T21:45:59.000Z | tests/models/test_card_identifier.py | lejion/django-sagepaypi | 86eeff5afb9681fcc820e2d75910c4e642fefe85 | [
"MIT"
] | 1 | 2021-01-06T12:09:42.000Z | 2021-01-06T12:09:42.000Z | import uuid
from django.core.exceptions import ValidationError
from django.db import models
from sagepaypi.constants import COUNTRY_CHOICES, US_STATE_CHOICES
from sagepaypi.models import CardIdentifier
from tests.test_case import AppTestCase
# fields
# properties
# validation
| 34.343023 | 97 | 0.651261 | import uuid
from django.core.exceptions import ValidationError
from django.db import models
from sagepaypi.constants import COUNTRY_CHOICES, US_STATE_CHOICES
from sagepaypi.models import CardIdentifier
from tests.test_case import AppTestCase
class TestModel(AppTestCase):
# fields
def test_id(self):
... | 4,986 | 8 | 617 |
e02d3f9446fae3b0835e7a0a413eec780fc039ae | 647 | py | Python | setup.py | Lokaltog/axis | f602ef8089ed0332317274e0433f4ede75109533 | [
"MIT"
] | null | null | null | setup.py | Lokaltog/axis | f602ef8089ed0332317274e0433f4ede75109533 | [
"MIT"
] | null | null | null | setup.py | Lokaltog/axis | f602ef8089ed0332317274e0433f4ede75109533 | [
"MIT"
] | null | null | null | """Setup for Axis."""
from setuptools import setup
setup(
name="axis",
packages=["axis"],
version="33",
description="A Python library for communicating with devices from Axis Communications",
author="Robert Svensson",
author_email="Kane610@users.noreply.github.com",
license="MIT",
url=... | 34.052632 | 91 | 0.676971 | """Setup for Axis."""
from setuptools import setup
setup(
name="axis",
packages=["axis"],
version="33",
description="A Python library for communicating with devices from Axis Communications",
author="Robert Svensson",
author_email="Kane610@users.noreply.github.com",
license="MIT",
url=... | 0 | 0 | 0 |
ce0390b04788ff18fa95b1ea11e3466267edb6f8 | 3,742 | py | Python | Research/squeezenet.py | ALEXKIRNAS/Kaggle-C-CORE-Iceberg-Classifier-Challenge | d8b06969c9393cfce6d9ac96b58c9d365ff4369d | [
"MIT"
] | null | null | null | Research/squeezenet.py | ALEXKIRNAS/Kaggle-C-CORE-Iceberg-Classifier-Challenge | d8b06969c9393cfce6d9ac96b58c9d365ff4369d | [
"MIT"
] | null | null | null | Research/squeezenet.py | ALEXKIRNAS/Kaggle-C-CORE-Iceberg-Classifier-Challenge | d8b06969c9393cfce6d9ac96b58c9d365ff4369d | [
"MIT"
] | null | null | null | from keras import backend as K
from keras.layers import Input, Convolution2D, MaxPooling2D, Activation, concatenate, Dense, add, GaussianNoise
from keras.layers import GlobalAveragePooling2D
from keras.models import Model
from keras.regularizers import l2
sq1x1 = "squeeze1x1"
exp1x1 = "expand1x1"
exp3x3 = "expand3x3"
... | 36.686275 | 111 | 0.616782 | from keras import backend as K
from keras.layers import Input, Convolution2D, MaxPooling2D, Activation, concatenate, Dense, add, GaussianNoise
from keras.layers import GlobalAveragePooling2D
from keras.models import Model
from keras.regularizers import l2
sq1x1 = "squeeze1x1"
exp1x1 = "expand1x1"
exp3x3 = "expand3x3"
... | 1,089 | 0 | 22 |
c1cd1f7d29474ae84a34ff288a63dd82125505f9 | 178 | py | Python | EX017.py | gjaosdij/PythonProject | ae27990efa93462b632f165d13c08c7fd93beb38 | [
"MIT"
] | null | null | null | EX017.py | gjaosdij/PythonProject | ae27990efa93462b632f165d13c08c7fd93beb38 | [
"MIT"
] | null | null | null | EX017.py | gjaosdij/PythonProject | ae27990efa93462b632f165d13c08c7fd93beb38 | [
"MIT"
] | null | null | null | co = float(input('Medida do cateto oposto: '))
ca = float(input('Medida do cateto adjacente:'))
hi = ((co**2) + (ca**2)) ** (1/2)
print('A hipotenusa mede {:.2f}.'.format(hi))
| 25.428571 | 48 | 0.601124 | co = float(input('Medida do cateto oposto: '))
ca = float(input('Medida do cateto adjacente:'))
hi = ((co**2) + (ca**2)) ** (1/2)
print('A hipotenusa mede {:.2f}.'.format(hi))
| 0 | 0 | 0 |
dddf243717789d4d4c72a9e3059e1d4d30d0b07c | 1,929 | py | Python | app/airtable/base_map_by_geographic_area/geo_area_contacts.py | WildflowerSchools/wf-airtable-api | 963021e5108462d33efa222fedb00890e1788ad6 | [
"MIT"
] | null | null | null | app/airtable/base_map_by_geographic_area/geo_area_contacts.py | WildflowerSchools/wf-airtable-api | 963021e5108462d33efa222fedb00890e1788ad6 | [
"MIT"
] | null | null | null | app/airtable/base_map_by_geographic_area/geo_area_contacts.py | WildflowerSchools/wf-airtable-api | 963021e5108462d33efa222fedb00890e1788ad6 | [
"MIT"
] | null | null | null | from typing import Optional
from pydantic import BaseModel, Field, validator
from app.airtable.response import AirtableResponse, ListAirtableResponse
from app.airtable.validators import get_first_or_default_none
| 37.096154 | 95 | 0.716952 | from typing import Optional
from pydantic import BaseModel, Field, validator
from app.airtable.response import AirtableResponse, ListAirtableResponse
from app.airtable.validators import get_first_or_default_none
class AirtableGeoAreaContactFields(BaseModel):
area_name: Optional[str] = Field(alias="Area Name")
... | 0 | 1,643 | 69 |
59bffbb2c39024844234f6defe4253e770fb15bf | 1,892 | py | Python | MoTrackSemanticSegmentation/scripts/testMTurk.py | ryerrabelli/MoTrackTherapyMobilePublic | 6c554854aec43ab030e1f884b639a2ed72847646 | [
"MIT"
] | 2 | 2020-04-18T22:13:47.000Z | 2020-04-23T15:08:05.000Z | MoTrackSemanticSegmentation/scripts/testMTurk.py | ryerrabelli/MoTrackTherapyMobilePublic | 6c554854aec43ab030e1f884b639a2ed72847646 | [
"MIT"
] | null | null | null | MoTrackSemanticSegmentation/scripts/testMTurk.py | ryerrabelli/MoTrackTherapyMobilePublic | 6c554854aec43ab030e1f884b639a2ed72847646 | [
"MIT"
] | null | null | null | '''
import boto3
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import HTMLQuestion
from boto.mturk.layoutparam import LayoutParameter
from boto.mturk.layoutparam import LayoutParameters
import json
# Create your connection to MTurk
mtc = MTurkConnection(aws_access_key_id='AKIAIBPHQKOJQZULH... | 34.4 | 82 | 0.786998 | '''
import boto3
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import HTMLQuestion
from boto.mturk.layoutparam import LayoutParameter
from boto.mturk.layoutparam import LayoutParameters
import json
# Create your connection to MTurk
mtc = MTurkConnection(aws_access_key_id='AKIAIBPHQKOJQZULH... | 0 | 0 | 0 |
e961b2c04df86d84fc7b10231a7e759b601bdbc9 | 5,694 | py | Python | final_model/space_recognition_original.py | AEyeAlliance/aeye-alliance | cd01f46e7d404558f034dd5e8eb7f251e2f4c7aa | [
"MIT"
] | 6 | 2018-06-08T19:08:58.000Z | 2019-09-07T14:15:10.000Z | final_model/space_recognition_original.py | sanglhx/aeye-alliance | ed5052af4a2130ed88604049d338adfd162a3b64 | [
"MIT"
] | null | null | null | final_model/space_recognition_original.py | sanglhx/aeye-alliance | ed5052af4a2130ed88604049d338adfd162a3b64 | [
"MIT"
] | 4 | 2018-06-22T16:17:11.000Z | 2019-09-22T13:28:55.000Z | import torch
import torch.nn as nn
# import torch.onnx
# import onnx
# import onnx_caffe2.backend
# from onnx import checker, helper
import torch.optim as optim
import numpy as np
import cv2
from PIL import Image
import torch.utils.model_zoo as model_zoo
import torch.onnx
# print(make_prediction("test/Prairie.jpg"))... | 31.285714 | 115 | 0.537232 | import torch
import torch.nn as nn
# import torch.onnx
# import onnx
# import onnx_caffe2.backend
# from onnx import checker, helper
import torch.optim as optim
import numpy as np
import cv2
from PIL import Image
import torch.utils.model_zoo as model_zoo
import torch.onnx
def export_model():
model = CNN()
mod... | 4,966 | 0 | 145 |
6528503a87be4a0b325028a625a1f3fc3d7c48e0 | 998 | py | Python | src/MOSIM/abstraction/access/local/local_adapter_client.py | dfki-asr/MMIPython-Core | 2f4b51ffde606c45661d9dbd5153576f919bdb8b | [
"MIT"
] | null | null | null | src/MOSIM/abstraction/access/local/local_adapter_client.py | dfki-asr/MMIPython-Core | 2f4b51ffde606c45661d9dbd5153576f919bdb8b | [
"MIT"
] | null | null | null | src/MOSIM/abstraction/access/local/local_adapter_client.py | dfki-asr/MMIPython-Core | 2f4b51ffde606c45661d9dbd5153576f919bdb8b | [
"MIT"
] | null | null | null | ## SPDX-License-Identifier: MIT
## The content of this file has been developed in the context of the MOSIM research project.
## Original author(s): Jannes Lehwald
# -*- coding: utf-8 -*-
"""
"""
from MOSIM.mmi.register import MMIAdapter
#from MMIStandard import MMIAdapter
from MOSIM.abstraction.access.interface.ad... | 24.341463 | 92 | 0.632265 | ## SPDX-License-Identifier: MIT
## The content of this file has been developed in the context of the MOSIM research project.
## Original author(s): Jannes Lehwald
# -*- coding: utf-8 -*-
"""
"""
from MOSIM.mmi.register import MMIAdapter
#from MMIStandard import MMIAdapter
from MOSIM.abstraction.access.interface.ad... | 0 | 0 | 0 |
4d013ccbd7526b2b29195f2123aa1bda69e2eba7 | 3,028 | py | Python | src/cli/cli.py | simondotsh/SidResolver | 4435970199fcb9aeeab836393782f9924a4a6872 | [
"MIT"
] | null | null | null | src/cli/cli.py | simondotsh/SidResolver | 4435970199fcb9aeeab836393782f9924a4a6872 | [
"MIT"
] | null | null | null | src/cli/cli.py | simondotsh/SidResolver | 4435970199fcb9aeeab836393782f9924a4a6872 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from getpass import getpass
from os.path import isfile, expanduser
from sys import exit | 30.28 | 79 | 0.575297 | from argparse import ArgumentParser
from getpass import getpass
from os.path import isfile, expanduser
from sys import exit
class Cli:
@classmethod
def parse_and_validate(cls):
parser = cls.__get_parser()
args = parser.parse_args()
args.sids = cls.__parse_sids(args.sids)
if (a... | 2,567 | 315 | 23 |
74ce49e76df3702caf440a65b380e7e8353b2302 | 12,447 | py | Python | tests/test_tree.py | biomadeira/taxonomy-resolver | ce7a264c2b8b552dde6284b4a74821184be8e489 | [
"Apache-2.0"
] | null | null | null | tests/test_tree.py | biomadeira/taxonomy-resolver | ce7a264c2b8b552dde6284b4a74821184be8e489 | [
"Apache-2.0"
] | null | null | null | tests/test_tree.py | biomadeira/taxonomy-resolver | ce7a264c2b8b552dde6284b4a74821184be8e489 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8
"""
Taxonomy Resolver
:copyright: (c) 2020-2021.
:license: Apache 2.0, see LICENSE for more details.
"""
import os
import pytest
from taxonresolver import TaxonResolver
from taxonresolver.utils import load_logging
@pytest.fixture
@pytest.fixture
| 47.507634 | 99 | 0.651884 | #!/usr/bin/env python
# -*- coding: utf-8
"""
Taxonomy Resolver
:copyright: (c) 2020-2021.
:license: Apache 2.0, see LICENSE for more details.
"""
import os
import pytest
from taxonresolver import TaxonResolver
from taxonresolver.utils import load_logging
@pytest.fixture
def context():
return load_logging("IN... | 11,091 | 992 | 67 |
53dd6eb163acaeef6aac44598d96fbcbb35fb393 | 961 | py | Python | src/learning/DecisionTreeEntropy.py | alexandrabenamar/Who-Wins | 23df54f98286e67aab39e92ac746bccf6916c231 | [
"MIT"
] | 3 | 2018-04-10T21:52:57.000Z | 2018-08-22T15:41:58.000Z | src/learning/DecisionTreeEntropy.py | alexandrabenamar/Who-Wins | 23df54f98286e67aab39e92ac746bccf6916c231 | [
"MIT"
] | null | null | null | src/learning/DecisionTreeEntropy.py | alexandrabenamar/Who-Wins | 23df54f98286e67aab39e92ac746bccf6916c231 | [
"MIT"
] | 1 | 2020-05-18T15:46:23.000Z | 2020-05-18T15:46:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyspark.mllib.tree import DecisionTree
from functions_MLlib import spark_context, training_set, test_set, write_result, brexit_labeled_data, mode_predict
if __name__ == "__main__" :
sc = spark_context()
numFeatures = 10000
print("Trainin... | 31 | 124 | 0.671176 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pyspark.mllib.tree import DecisionTree
from functions_MLlib import spark_context, training_set, test_set, write_result, brexit_labeled_data, mode_predict
if __name__ == "__main__" :
sc = spark_context()
numFeatures = 10000
print("Trainin... | 0 | 0 | 0 |
8a62452bd2c0e39afcbd171cc50d1d0a21550d89 | 13,646 | py | Python | lib/keybow2040/keybow2040.py | bschapendonk/pim551 | 277b7eddb744ed2733a854bb8e96cd66ec05bd0c | [
"MIT"
] | 47 | 2021-04-28T15:55:29.000Z | 2022-03-18T02:04:10.000Z | lib/keybow2040/keybow2040.py | bschapendonk/pim551 | 277b7eddb744ed2733a854bb8e96cd66ec05bd0c | [
"MIT"
] | 12 | 2021-04-30T19:22:35.000Z | 2022-02-09T10:16:57.000Z | lib/keybow2040/keybow2040.py | bschapendonk/pim551 | 277b7eddb744ed2733a854bb8e96cd66ec05bd0c | [
"MIT"
] | 19 | 2021-04-28T15:43:56.000Z | 2022-03-20T20:42:43.000Z | # SPDX-FileCopyrightText: 2021 Sandy Macdonald
#
# SPDX-License-Identifier: MIT
"""
`Keybow 2040 CircuitPython library`
====================================================
CircuitPython driver for the Pimoroni Keybow 2040 and Pico RGB Keypad Base.
Drop the `lib` contents (`keybow2040.py` file and `keybow_hardware` ... | 30.324444 | 114 | 0.589843 | # SPDX-FileCopyrightText: 2021 Sandy Macdonald
#
# SPDX-License-Identifier: MIT
"""
`Keybow 2040 CircuitPython library`
====================================================
CircuitPython driver for the Pimoroni Keybow 2040 and Pico RGB Keypad Base.
Drop the `lib` contents (`keybow2040.py` file and `keybow_hardware` ... | 10,189 | 0 | 688 |
e84367d8ec44da8b98fb3bfd77ea2cb55820c6e8 | 492 | py | Python | simp_py_examples/course/SM001_old/t216.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | simp_py_examples/course/SM001_old/t216.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | simp_py_examples/course/SM001_old/t216.py | kcfkwok2003/Simp_py | f75e66da01b45dc8688dda602f8b33d4258f0c31 | [
"MIT"
] | null | null | null | import urequests
from simp_py import lcd, mon
while 1:
try:
response = urequests.get('http://api.coindesk.com/v1/bpi/currentprice.json')
if response.reason==b'OK':
data= response.json()
updated=data['time']['updatedISO']
btc = data['bpi']['USD']['rate_float']
lcd.text(0,140,updated)
... | 25.894737 | 80 | 0.609756 | import urequests
from simp_py import lcd, mon
while 1:
try:
response = urequests.get('http://api.coindesk.com/v1/bpi/currentprice.json')
if response.reason==b'OK':
data= response.json()
updated=data['time']['updatedISO']
btc = data['bpi']['USD']['rate_float']
lcd.text(0,140,updated)
... | 0 | 0 | 0 |
ac98afe8378bea03f864f4493a06e66e2834e9bb | 3,384 | py | Python | Chapter 08/Windows/DISTAL/cgi-bin/mapGenerator.py | PacktPublishing/Python-Geospatial-Development-Third-Edition | e1e1f52da8509876e8576e081de9d5f251a21f77 | [
"MIT"
] | 44 | 2016-06-14T05:36:10.000Z | 2022-01-30T18:29:44.000Z | Chapter 09/Windows/cgi-bin/mapGenerator.py | KonstantinKlepikov/Python-Geospatial-Development-Third-Edition | ca3545dbab75dac63080582538de40d4d1c15dab | [
"MIT"
] | null | null | null | Chapter 09/Windows/cgi-bin/mapGenerator.py | KonstantinKlepikov/Python-Geospatial-Development-Third-Edition | ca3545dbab75dac63080582538de40d4d1c15dab | [
"MIT"
] | 48 | 2016-12-11T08:53:46.000Z | 2022-02-10T12:10:34.000Z | # mapGenerator.py
import os, os.path, sys, tempfile
# NOTE: The following needs to be added to fix a problem with my path and
# Python3. Remove to make this work generally.
sys.path.insert(0, "/usr/local/lib/python3.3/site-packages")
# End of fix.
import mapnik
| 31.333333 | 73 | 0.5724 | # mapGenerator.py
import os, os.path, sys, tempfile
# NOTE: The following needs to be added to fix a problem with my path and
# Python3. Remove to make this work generally.
sys.path.insert(0, "/usr/local/lib/python3.3/site-packages")
# End of fix.
import mapnik
def generateMap(tableName, minX, minY, maxX, maxY,
... | 3,095 | 0 | 23 |
9016f832d87f6b1b4790287aa9974c1686f5ad77 | 2,151 | py | Python | dataset/transforms/builder.py | TencentYoutuResearch/Classification-SemiCLS | ceb5546f8d8ba08e18de3b5d9426e6cda177e55e | [
"Apache-2.0"
] | 4 | 2022-03-23T05:16:15.000Z | 2022-03-31T07:33:26.000Z | dataset/transforms/builder.py | TencentYoutuResearch/Classification-SemiCLS | ceb5546f8d8ba08e18de3b5d9426e6cda177e55e | [
"Apache-2.0"
] | 2 | 2022-03-23T08:21:13.000Z | 2022-03-30T04:24:53.000Z | dataset/transforms/builder.py | TencentYoutuResearch/Classification-SemiCLS | ceb5546f8d8ba08e18de3b5d9426e6cda177e55e | [
"Apache-2.0"
] | null | null | null | """ The Code is under Tencent Youtu Public Rule
builder for transforms
transforms from torch or home-made
"""
import copy
from torchvision import transforms
from .randaugment import RandAugmentMC
from .gaussian_blur import GaussianBlur
other_func = {"RandAugmentMC": RandAugmentMC,"GaussianBlur":GaussianBlur}
cla... | 28.302632 | 73 | 0.654579 | """ The Code is under Tencent Youtu Public Rule
builder for transforms
transforms from torch or home-made
"""
import copy
from torchvision import transforms
from .randaugment import RandAugmentMC
from .gaussian_blur import GaussianBlur
other_func = {"RandAugmentMC": RandAugmentMC,"GaussianBlur":GaussianBlur}
def ... | 984 | 0 | 104 |
03c58ee0cbb4b8189195b618627ebfee904b2c49 | 204 | py | Python | yandex/admin.py | mkbeh/multiple-fishing | 5e0c87233c0cdacb61caa01870a726d47096116f | [
"MIT"
] | null | null | null | yandex/admin.py | mkbeh/multiple-fishing | 5e0c87233c0cdacb61caa01870a726d47096116f | [
"MIT"
] | null | null | null | yandex/admin.py | mkbeh/multiple-fishing | 5e0c87233c0cdacb61caa01870a726d47096116f | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models.fakeauth import FakeAuthMail
@admin.register(FakeAuthMail)
| 22.666667 | 54 | 0.779412 | from django.contrib import admin
from .models.fakeauth import FakeAuthMail
@admin.register(FakeAuthMail)
class VictimMailAdmin(admin.ModelAdmin):
list_display = ('email', 'password', 'user_agent')
| 0 | 74 | 22 |
d003406a8dae70ef44094ac0e756847f1bec276e | 1,919 | py | Python | startServer.py | MuddSub/labelImg | b77641207329b2be08e4d71306b36efee2ac7e50 | [
"MIT"
] | 3 | 2021-01-05T02:51:09.000Z | 2022-01-30T00:53:30.000Z | startServer.py | MuddSub/labelImg | b77641207329b2be08e4d71306b36efee2ac7e50 | [
"MIT"
] | null | null | null | startServer.py | MuddSub/labelImg | b77641207329b2be08e4d71306b36efee2ac7e50 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
ssh cvteam1@134.173.43.20
cd compData
python startServer.py
"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
from os import curdir
import json
from copy import deepcopy
if __name__ == '__main__':
# i.e. if this file is being run directly, not as imported module
main()... | 26.652778 | 69 | 0.620115 | #!/usr/bin/python3
"""
ssh cvteam1@134.173.43.20
cd compData
python startServer.py
"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
from os import curdir
import json
from copy import deepcopy
class requestHandler(SimpleHTTPRequestHandler):
def _set_headers(self):
self.send_response(200)
... | 1,392 | 26 | 180 |
2ac32a412dafa9bce712cbc3d292c036f1066547 | 885 | py | Python | server/extractor/serializers.py | lucmichalski/seo-audits-toolkit | d7a81d2ac1019f60268bad40dff6b0a475f46b1a | [
"MIT"
] | null | null | null | server/extractor/serializers.py | lucmichalski/seo-audits-toolkit | d7a81d2ac1019f60268bad40dff6b0a475f46b1a | [
"MIT"
] | null | null | null | server/extractor/serializers.py | lucmichalski/seo-audits-toolkit | d7a81d2ac1019f60268bad40dff6b0a475f46b1a | [
"MIT"
] | null | null | null | from extractor.models import Extractor
from rest_framework import serializers
from datetime import datetime
from .tasks import extractor_job
from .models import Extractor
from django.utils import timezone
import pytz | 36.875 | 168 | 0.703955 | from extractor.models import Extractor
from rest_framework import serializers
from datetime import datetime
from .tasks import extractor_job
from .models import Extractor
from django.utils import timezone
import pytz
class ExtractorSerializer(serializers.ModelSerializer):
class Meta:
model = Extractor
... | 461 | 185 | 23 |
fa94d442e625eda0e7b3b0718993bcbcb294bb1e | 1,582 | py | Python | Leetcode/Python Solutions/Dynamic Programming/IsSubsequence.py | Mostofa-Najmus-Sakib/Applied-Algorithm | bc656fd655617407856e0ce45b68585fa81c5035 | [
"MIT"
] | 1 | 2020-01-06T02:21:56.000Z | 2020-01-06T02:21:56.000Z | Leetcode/Python Solutions/Dynamic Programming/IsSubsequence.py | Mostofa-Najmus-Sakib/Applied-Algorithm | bc656fd655617407856e0ce45b68585fa81c5035 | [
"MIT"
] | null | null | null | Leetcode/Python Solutions/Dynamic Programming/IsSubsequence.py | Mostofa-Najmus-Sakib/Applied-Algorithm | bc656fd655617407856e0ce45b68585fa81c5035 | [
"MIT"
] | 3 | 2021-02-22T17:41:01.000Z | 2022-01-13T05:03:19.000Z | """
LeetCode Problem: 392. Is Subsequence
Link: https://leetcode.com/problems/is-subsequence/
Written by: Mostofa Adib Shakib
Language: Python
"""
"""
Recursion + Memoization[Built-in function]
Time Complexity: O(n*m)
Space Complexity: O(n*m)
"""
from functools import lru_cache
"""
Dynamic Programming
Time Complexi... | 24.71875 | 90 | 0.48799 | """
LeetCode Problem: 392. Is Subsequence
Link: https://leetcode.com/problems/is-subsequence/
Written by: Mostofa Adib Shakib
Language: Python
"""
"""
Recursion + Memoization[Built-in function]
Time Complexity: O(n*m)
Space Complexity: O(n*m)
"""
from functools import lru_cache
class Solution:
def isSubsequence... | 1,128 | -12 | 98 |
f832979e5111d8b798e7e68dcd21027570803401 | 5,339 | py | Python | geospacelab/datahub/sources/jhuapl/dmsp/ssusi/edraur/loader.py | JouleCai/GeoSpaceLab | 6cc498d3c32501e946931de596a840c73e83edb3 | [
"BSD-3-Clause"
] | 19 | 2021-08-07T08:49:22.000Z | 2022-03-02T18:26:30.000Z | geospacelab/datahub/sources/jhuapl/dmsp/ssusi/edraur/loader.py | JouleCai/GeoSpaceLab | 6cc498d3c32501e946931de596a840c73e83edb3 | [
"BSD-3-Clause"
] | 4 | 2021-11-09T05:53:42.000Z | 2022-03-25T11:49:37.000Z | geospacelab/datahub/sources/jhuapl/dmsp/ssusi/edraur/loader.py | JouleCai/GeoSpaceLab | 6cc498d3c32501e946931de596a840c73e83edb3 | [
"BSD-3-Clause"
] | 3 | 2021-11-07T11:41:20.000Z | 2022-02-14T13:43:11.000Z | # Licensed under the BSD 3-Clause License
# Copyright (C) 2021 GeospaceLab (geospacelab)
# Author: Lei Cai, Space Physics and Astronomy, University of Oulu
import netCDF4
import datetime
import numpy as np
import geospacelab.toolbox.utilities.pydatetime as dttool
if __name__ == "__main__":
import pathlib
fp... | 46.833333 | 118 | 0.648623 | # Licensed under the BSD 3-Clause License
# Copyright (C) 2021 GeospaceLab (geospacelab)
# Author: Lei Cai, Space Physics and Astronomy, University of Oulu
import netCDF4
import datetime
import numpy as np
import geospacelab.toolbox.utilities.pydatetime as dttool
class Loader(object):
def __init__(self, file_pa... | 4,620 | 0 | 77 |
e0b61c3b9fecec287da5c0f5895fe0dc1c55db51 | 153 | py | Python | src/kaggle_web_traffic_forecasting/__init__.py | DSmmartin/KaggleTimeSeries | 54a6627487070b28b2eea4e27bcb35c48acedf19 | [
"MIT"
] | null | null | null | src/kaggle_web_traffic_forecasting/__init__.py | DSmmartin/KaggleTimeSeries | 54a6627487070b28b2eea4e27bcb35c48acedf19 | [
"MIT"
] | null | null | null | src/kaggle_web_traffic_forecasting/__init__.py | DSmmartin/KaggleTimeSeries | 54a6627487070b28b2eea4e27bcb35c48acedf19 | [
"MIT"
] | null | null | null | """ My init to load all main process around my ML project """
from .spark_manage import spark_start
from .data_processing import dataset_train_transpose | 38.25 | 61 | 0.810458 | """ My init to load all main process around my ML project """
from .spark_manage import spark_start
from .data_processing import dataset_train_transpose | 0 | 0 | 0 |
d9bd4c79b64fa98e00b319bfb3427cb6b71d06ab | 21,549 | py | Python | conans/test/unittests/model/build_info/components_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | 1 | 2020-11-07T21:25:57.000Z | 2020-11-07T21:25:57.000Z | conans/test/unittests/model/build_info/components_test.py | ttencate/conan | 3dc4fb35cc3be9865f0ae480c89e6a58813d5076 | [
"MIT"
] | null | null | null | conans/test/unittests/model/build_info/components_test.py | ttencate/conan | 3dc4fb35cc3be9865f0ae480c89e6a58813d5076 | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import unittest
import six
from conans.errors import ConanException
from conans.model.build_info import CppInfo, DepsCppInfo, DepCppInfo
from conans.test.utils.test_files import temp_folder
from conans.util.files import save
| 51.676259 | 101 | 0.62388 | # coding=utf-8
import os
import unittest
import six
from conans.errors import ConanException
from conans.model.build_info import CppInfo, DepsCppInfo, DepCppInfo
from conans.test.utils.test_files import temp_folder
from conans.util.files import save
class CppInfoComponentsTest(unittest.TestCase):
def test_comp... | 20,896 | 26 | 374 |
2d71e7d9c1a86726265aa5646e677037196bd2a0 | 2,596 | py | Python | release/stubs.min/Wms/RemotingImplementation/Activities/Renderers.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/Wms/RemotingImplementation/Activities/Renderers.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/Wms/RemotingImplementation/Activities/Renderers.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | # encoding: utf-8
# module Wms.RemotingImplementation.Activities.Renderers calls itself Renderers
# from Wms.RemotingImplementation,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no important
from __init__ import *
# no functions
# classes
class MobileProgressBarRender... | 35.561644 | 215 | 0.720339 | # encoding: utf-8
# module Wms.RemotingImplementation.Activities.Renderers calls itself Renderers
# from Wms.RemotingImplementation,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no important
from __init__ import *
# no functions
# classes
class MobileProgressBarRender... | 0 | 0 | 0 |
913fccc0de77123589023d5f87c6e399d7e50a20 | 7,384 | py | Python | tools/ports/regal.py | undeadinu/emscripten | e9d8b5c4b62c2b27b92cb7635590238a39310aa0 | [
"MIT"
] | 1 | 2019-01-06T09:32:11.000Z | 2019-01-06T09:32:11.000Z | tools/ports/regal.py | undeadinu/emscripten | e9d8b5c4b62c2b27b92cb7635590238a39310aa0 | [
"MIT"
] | null | null | null | tools/ports/regal.py | undeadinu/emscripten | e9d8b5c4b62c2b27b92cb7635590238a39310aa0 | [
"MIT"
] | null | null | null | # Copyright 2015 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os, shutil, logging, subprocess, sys, stat
TAG = 'version_4'
... | 43.692308 | 149 | 0.551598 | # Copyright 2015 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os, shutil, logging, subprocess, sys, stat
TAG = 'version_4'
... | 6,968 | 0 | 92 |
a00f9789b69823cad94ca0d2ecec4ce1cc80a8ea | 1,592 | py | Python | web/vendor_scraping_controller.py | Zheruel/compari-ro-scraper | ec4ccdec8ac647d694eb78959f2411d901cfad70 | [
"MIT"
] | 1 | 2021-10-09T14:39:48.000Z | 2021-10-09T14:39:48.000Z | web/vendor_scraping_controller.py | Zheruel/compari-ro-scraper | ec4ccdec8ac647d694eb78959f2411d901cfad70 | [
"MIT"
] | null | null | null | web/vendor_scraping_controller.py | Zheruel/compari-ro-scraper | ec4ccdec8ac647d694eb78959f2411d901cfad70 | [
"MIT"
] | null | null | null | from requests import Session
from models.vendor import Vendor
from bs4 import BeautifulSoup
from io_utils.csv_exporter import save_scraped_vendor
| 33.87234 | 99 | 0.687814 | from requests import Session
from models.vendor import Vendor
from bs4 import BeautifulSoup
from io_utils.csv_exporter import save_scraped_vendor
def grab_vendor_information(vendor_page_url: str, ses: Session) -> Vendor:
res = ses.get(vendor_page_url)
soup = BeautifulSoup(res.content, 'html.parser')
stor... | 1,398 | 0 | 46 |
3ec8e4b9a94e2276fc35dc4cd360cde128b72c63 | 2,402 | py | Python | dvol_python/testtools.py | ClusterHQ/dvol | adf6c49bbf74d26fbc802a3cdd02ee47e18ad934 | [
"Apache-2.0"
] | 276 | 2015-11-03T23:14:11.000Z | 2021-11-08T11:05:57.000Z | dvol_python/testtools.py | ClusterHQ/dvol | adf6c49bbf74d26fbc802a3cdd02ee47e18ad934 | [
"Apache-2.0"
] | 62 | 2015-11-12T02:02:14.000Z | 2022-02-02T21:10:05.000Z | dvol_python/testtools.py | ClusterHQ/dvol | adf6c49bbf74d26fbc802a3cdd02ee47e18ad934 | [
"Apache-2.0"
] | 19 | 2015-11-14T08:17:14.000Z | 2017-07-19T13:32:57.000Z | """
Common test tools.
"""
from os import environ
from semver import compare
from unittest import skipIf
import requests
import subprocess
import time
TEST_GOLANG_VERSION = environ.get("TEST_GOLANG_VERSION", False)
DOCKER_VERSION = environ.get("DOCKER_VERSION", "")
skip_if_go_version = skipIf(
TEST_GOLANG_VERSIO... | 27.295455 | 77 | 0.636137 | """
Common test tools.
"""
from os import environ
from semver import compare
from unittest import skipIf
import requests
import subprocess
import time
TEST_GOLANG_VERSION = environ.get("TEST_GOLANG_VERSION", False)
DOCKER_VERSION = environ.get("DOCKER_VERSION", "")
skip_if_go_version = skipIf(
TEST_GOLANG_VERSIO... | 389 | 34 | 92 |
5811d4052a2da8a0c989ae54eefbdd10c28952bc | 6,675 | py | Python | disputatio/routines/vanes/front.py | nicholasmalaya/paleologos | 11959056caa80d3c910759b714a0f8e42f986f0f | [
"MIT"
] | 1 | 2021-11-04T17:49:42.000Z | 2021-11-04T17:49:42.000Z | disputatio/routines/vanes/front.py | nicholasmalaya/paleologos | 11959056caa80d3c910759b714a0f8e42f986f0f | [
"MIT"
] | null | null | null | disputatio/routines/vanes/front.py | nicholasmalaya/paleologos | 11959056caa80d3c910759b714a0f8e42f986f0f | [
"MIT"
] | 2 | 2019-01-04T16:08:18.000Z | 2019-12-16T19:34:24.000Z | #!/bin/py
#
# interpolate over data field with 2d polynomial fit
#
# fit a 2D, 3rd order polynomial to data
# estimate the 16 coefficients using all of your data points.
#
# http://stackoverflow.com/questions/18832763/drawing-directions-fields
#
#
import numpy as np
import matplotlib
matplotlib.use('Agg')
import iter... | 21.190476 | 93 | 0.497978 | #!/bin/py
#
# interpolate over data field with 2d polynomial fit
#
# fit a 2D, 3rd order polynomial to data
# estimate the 16 coefficients using all of your data points.
#
# http://stackoverflow.com/questions/18832763/drawing-directions-fields
#
#
import numpy as np
import matplotlib
matplotlib.use('Agg')
import iter... | 5,796 | 0 | 250 |
9c3b8eda5d94d6304e5ca32a9a4f89b5936e41a2 | 214 | py | Python | UdemyMegaCourse/cv2/galaxy.py | JeremyPie/PythonCourse1 | 5dd4c417c70c4ade5bb137ea8bdbb56d7d6c71c7 | [
"MIT"
] | null | null | null | UdemyMegaCourse/cv2/galaxy.py | JeremyPie/PythonCourse1 | 5dd4c417c70c4ade5bb137ea8bdbb56d7d6c71c7 | [
"MIT"
] | null | null | null | UdemyMegaCourse/cv2/galaxy.py | JeremyPie/PythonCourse1 | 5dd4c417c70c4ade5bb137ea8bdbb56d7d6c71c7 | [
"MIT"
] | null | null | null | import cv2
from matplotlib import pyplot as plt
img = cv2.imread('galaxy.jpg', 0)
img = cv2.resize(img, (int(img.shape[1]/2), int(img.shape[0]/2)))
cv2.imwrite('GlaxyResized.jpg', img)
plt.imshow(img)
plt.show()
| 21.4 | 65 | 0.700935 | import cv2
from matplotlib import pyplot as plt
img = cv2.imread('galaxy.jpg', 0)
img = cv2.resize(img, (int(img.shape[1]/2), int(img.shape[0]/2)))
cv2.imwrite('GlaxyResized.jpg', img)
plt.imshow(img)
plt.show()
| 0 | 0 | 0 |
b78fdd722081f7d224797321217f5335e2c23b47 | 4,778 | py | Python | xsdata/utils/downloader.py | pashashocky/xsdata | 1cd681598d2235626d0e21716fc9fb885d26e351 | [
"MIT"
] | null | null | null | xsdata/utils/downloader.py | pashashocky/xsdata | 1cd681598d2235626d0e21716fc9fb885d26e351 | [
"MIT"
] | null | null | null | xsdata/utils/downloader.py | pashashocky/xsdata | 1cd681598d2235626d0e21716fc9fb885d26e351 | [
"MIT"
] | null | null | null | import os
import re
from pathlib import Path
from typing import Dict
from typing import Optional
from typing import Union
from urllib.request import urlopen
from xsdata.codegen.parsers import DefinitionsParser
from xsdata.codegen.parsers import SchemaParser
from xsdata.logger import logger
from xsdata.models.wsdl impo... | 37.328125 | 87 | 0.636668 | import os
import re
from pathlib import Path
from typing import Dict
from typing import Optional
from typing import Union
from urllib.request import urlopen
from xsdata.codegen.parsers import DefinitionsParser
from xsdata.codegen.parsers import SchemaParser
from xsdata.logger import logger
from xsdata.models.wsdl impo... | 385 | 0 | 54 |
f5cf2fe8c3a53755d9392bd7e7eed0997ae7b6c5 | 1,052 | py | Python | setup.py | privatwolke/eclipse-profile-selector | e295e0589356aba51fa141420994793bfa62aaa8 | [
"MIT"
] | 1 | 2015-12-18T01:27:37.000Z | 2015-12-18T01:27:37.000Z | setup.py | privatwolke/eclipseprofileselector | e295e0589356aba51fa141420994793bfa62aaa8 | [
"MIT"
] | null | null | null | setup.py | privatwolke/eclipseprofileselector | e295e0589356aba51fa141420994793bfa62aaa8 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import sys, os
version = '0.2.2'
setup(name = 'eclipseprofileselector',
version = version,
description = 'Manage separate Eclipse profiles and workspaces with a nice graphical user interface.',
long_description = open('README.rst', 'r').read(),
keywords = 'eclipse profi... | 28.432432 | 103 | 0.695817 | from setuptools import setup, find_packages
import sys, os
version = '0.2.2'
setup(name = 'eclipseprofileselector',
version = version,
description = 'Manage separate Eclipse profiles and workspaces with a nice graphical user interface.',
long_description = open('README.rst', 'r').read(),
keywords = 'eclipse profi... | 0 | 0 | 0 |
0a6e54573a790fabc971c11e4a1a22c66eac3489 | 100 | py | Python | django_app/contributors/admin.py | ASRG/asrg.io | de29552096505ac03a4ec2602873ba0f688b7072 | [
"MIT"
] | 8 | 2020-04-03T19:33:37.000Z | 2022-01-10T18:46:49.000Z | django_app/contributors/admin.py | ASRG/asrg.io | de29552096505ac03a4ec2602873ba0f688b7072 | [
"MIT"
] | 359 | 2019-08-07T13:31:24.000Z | 2022-03-29T22:45:49.000Z | django_app/contributors/admin.py | ASRG/asrg.io | de29552096505ac03a4ec2602873ba0f688b7072 | [
"MIT"
] | 3 | 2020-08-07T20:43:24.000Z | 2020-08-20T20:54:30.000Z | from django.contrib import admin
from .models import Contributor
admin.site.register(Contributor)
| 16.666667 | 32 | 0.83 | from django.contrib import admin
from .models import Contributor
admin.site.register(Contributor)
| 0 | 0 | 0 |
f4110ee3e6aea36c216c4a811e8afcc766ec14e2 | 2,600 | py | Python | tests/uuidt/migrations/0001_initial.py | OlgaBorisova/django-pgfields | fc21efc116d017f1bf75c88fa3502cc23f8923b3 | [
"BSD-3-Clause"
] | 1 | 2015-03-26T09:34:32.000Z | 2015-03-26T09:34:32.000Z | tests/uuidt/migrations/0001_initial.py | elbaschid/django-pgfields | 37915b92349c392ed4980d255225e991be3463d6 | [
"BSD-3-Clause"
] | null | null | null | tests/uuidt/migrations/0001_initial.py | elbaschid/django-pgfields | 37915b92349c392ed4980d255225e991be3463d6 | [
"BSD-3-Clause"
] | 1 | 2018-10-23T21:31:29.000Z | 2018-10-23T21:31:29.000Z | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| 38.80597 | 128 | 0.565 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Movie'
db.create_table('uuidt_movie', (
('id', self.gf('django_pg.models.fields.... | 1,336 | 1,110 | 23 |
0b7fbd1451d21df02b8ac7806cf7eef5c4dcbb14 | 5,605 | py | Python | porthole/contact_management.py | speedyturkey/porthole | 5d47bb00d33d5aa93c3d2e84af993b5387b66be6 | [
"MIT"
] | 3 | 2017-06-22T01:52:10.000Z | 2019-09-25T22:52:56.000Z | porthole/contact_management.py | speedyturkey/porthole | 5d47bb00d33d5aa93c3d2e84af993b5387b66be6 | [
"MIT"
] | 48 | 2017-06-22T23:36:03.000Z | 2019-11-26T02:51:54.000Z | porthole/contact_management.py | speedyturkey/porthole | 5d47bb00d33d5aa93c3d2e84af993b5387b66be6 | [
"MIT"
] | 1 | 2019-02-27T13:59:07.000Z | 2019-02-27T13:59:07.000Z | from sqlalchemy.orm.exc import NoResultFound
from porthole.app import Session
from .logger import PortholeLogger
from porthole.models import AutomatedReport, AutomatedReportContact, AutomatedReportRecipient
| 49.60177 | 118 | 0.702587 | from sqlalchemy.orm.exc import NoResultFound
from porthole.app import Session
from .logger import PortholeLogger
from porthole.models import AutomatedReport, AutomatedReportContact, AutomatedReportRecipient
class AutomatedReportContactManager(object):
def __init__(self, session=None):
self.session = sessi... | 4,974 | 23 | 400 |
88cc6c11608e5ecae6a01861ea3c8f6aaf96bc47 | 3,679 | py | Python | commissioning/doscalars.py | dobos/pysynphot | 5d2e0b52ceda78890940ac9239c2d88e149e0bed | [
"BSD-3-Clause"
] | 24 | 2015-01-04T23:38:21.000Z | 2022-02-01T00:11:07.000Z | commissioning/doscalars.py | dobos/pysynphot | 5d2e0b52ceda78890940ac9239c2d88e149e0bed | [
"BSD-3-Clause"
] | 126 | 2015-01-29T14:50:37.000Z | 2022-02-15T01:58:13.000Z | commissioning/doscalars.py | dobos/pysynphot | 5d2e0b52ceda78890940ac9239c2d88e149e0bed | [
"BSD-3-Clause"
] | 25 | 2015-02-09T12:12:02.000Z | 2021-09-09T13:06:54.000Z | from __future__ import print_function
import kwfile_dict
import glob, os, sys
import numpy as N
from astropy.io import fits as pyfits
import pylab as P
import matplotlib
from pysynphot.compat import ASTROPY_LT_1_3
def reverse(d):
"""Return a reverse lookup dictionary for the input dictionary"""
r={}
for ... | 28.3 | 79 | 0.572982 | from __future__ import print_function
import kwfile_dict
import glob, os, sys
import numpy as N
from astropy.io import fits as pyfits
import pylab as P
import matplotlib
from pysynphot.compat import ASTROPY_LT_1_3
def getdata(dirpath,fieldname,instr,save=True):
#get the list of files
flist=glob.glob("%s/*.lo... | 3,054 | 0 | 69 |
7cec0f109dc0a38586ada7f4713451e263fe1ec9 | 5,408 | py | Python | flask-server/app.py | michael-conrad/neuspell | f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc | [
"MIT"
] | 1 | 2021-05-21T09:39:50.000Z | 2021-05-21T09:39:50.000Z | flask-server/app.py | michael-conrad/neuspell | f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc | [
"MIT"
] | null | null | null | flask-server/app.py | michael-conrad/neuspell | f1d1a8b4efa7c6aa6e0564ea17db152905f4c7dc | [
"MIT"
] | null | null | null | """
Usage
-----
CUDA_VISIBLE_DEVICES=0 python app.py
"""
import os
from time import time
# from neuspell import AspellChecker, JamspellChecker
from neuspell import BertsclstmChecker, CnnlstmChecker, ElmosclstmChecker, NestedlstmChecker
from neuspell import SclstmChecker, SclstmbertChecker, SclstmelmoChecke... | 36.789116 | 109 | 0.645155 | """
Usage
-----
CUDA_VISIBLE_DEVICES=0 python app.py
"""
import os
from time import time
# from neuspell import AspellChecker, JamspellChecker
from neuspell import BertsclstmChecker, CnnlstmChecker, ElmosclstmChecker, NestedlstmChecker
from neuspell import SclstmChecker, SclstmbertChecker, SclstmelmoChecke... | 4,092 | 0 | 167 |
77594b0aae3b85456427f41cabbaffe0102750d9 | 24,707 | py | Python | dist/ba_data/python/bastd/ui/helpui.py | Bartixxx32/Bombsquad-Ballistica-Modded-Server | 26d36f07a5b96702e4fbdf172c0d66671f1ee0bd | [
"MIT"
] | 317 | 2020-04-04T00:33:10.000Z | 2022-03-28T01:07:09.000Z | assets/src/ba_data/python/bastd/ui/helpui.py | Alshahriah/ballistica | 326f6677a0118667e93ce9034849622ebef706fa | [
"MIT"
] | 315 | 2020-04-04T22:33:10.000Z | 2022-03-31T22:50:02.000Z | assets/src/ba_data/python/bastd/ui/helpui.py | Alshahriah/ballistica | 326f6677a0118667e93ce9034849622ebef706fa | [
"MIT"
] | 97 | 2020-04-04T01:32:17.000Z | 2022-03-16T19:02:59.000Z | # Released under the MIT License. See LICENSE for details.
#
"""Provides help related ui."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
if TYPE_CHECKING:
from typing import Optional
class HelpWindow(ba.Window):
"""A window providing help on how to play."""
| 41.594276 | 79 | 0.442709 | # Released under the MIT License. See LICENSE for details.
#
"""Provides help related ui."""
from __future__ import annotations
from typing import TYPE_CHECKING
import _ba
import ba
if TYPE_CHECKING:
from typing import Optional
class HelpWindow(ba.Window):
"""A window providing help on how to play."""
... | 24,336 | 0 | 54 |
53880225806a57b224015eb20089f09627c278cd | 5,153 | py | Python | spyder/utils/switcher.py | suokunlong/spyder | 2d5d450fdcef232fb7f38e7fefc27f0e7f704c9a | [
"MIT"
] | 3 | 2019-09-27T21:00:00.000Z | 2021-03-07T23:28:32.000Z | spyder/utils/switcher.py | jastema/spyder | 0ef48ea227c53f57556cd8002087dc404b0108b0 | [
"MIT"
] | 3 | 2021-10-06T22:49:31.000Z | 2022-02-27T12:28:12.000Z | spyder/utils/switcher.py | jastema/spyder | 0ef48ea227c53f57556cd8002087dc404b0108b0 | [
"MIT"
] | 2 | 2021-04-30T01:18:22.000Z | 2021-09-19T06:31:42.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Utils to handle Switcher elements.
"""
# Standard library imports
import os
import os.path as osp
import sys
# Local imports
from spyder.config.base import _
fr... | 35.294521 | 79 | 0.55948 | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Utils to handle Switcher elements.
"""
# Standard library imports
import os
import os.path as osp
import sys
# Local imports
from spyder.config.base import _
fr... | 2,763 | 0 | 27 |
43f80d8042c492af4852a86396089d057c3c0ea6 | 448 | py | Python | ml-framework/batch_training.py | JetBrains-Research/extract-method-experiments | c733f6af32de2df9c1a00aa714cca11447ac2518 | [
"Apache-2.0"
] | 2 | 2021-07-01T16:46:13.000Z | 2022-01-22T09:28:25.000Z | ml-framework/batch_training.py | JetBrains-Research/extract-method-experiments | c733f6af32de2df9c1a00aa714cca11447ac2518 | [
"Apache-2.0"
] | 4 | 2021-07-12T07:02:06.000Z | 2022-03-09T09:52:06.000Z | ml-framework/batch_training.py | JetBrains-Research/extract-method-experiments | c733f6af32de2df9c1a00aa714cca11447ac2518 | [
"Apache-2.0"
] | null | null | null | import os
import logging
from src.trainer import train_by_config
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
directory = 'train_settings/'
for filename in os.listdir(directory):
config_path = os.path.join(directory, filename)
logging.info(f'Training model in accordance w... | 29.866667 | 76 | 0.712054 | import os
import logging
from src.trainer import train_by_config
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
directory = 'train_settings/'
for filename in os.listdir(directory):
config_path = os.path.join(directory, filename)
logging.info(f'Training model in accordance w... | 0 | 0 | 0 |
2b3b046d327cdb1666c09c8e99e70ac3d58c6717 | 952 | py | Python | freezeword/names.py | mattfister/freezeword | 74025da9e9a811e24b2cb0cfb77717d5eafd0283 | [
"MIT"
] | 10 | 2015-12-04T19:48:15.000Z | 2019-12-26T07:03:13.000Z | freezeword/names.py | mattfister/freezeword | 74025da9e9a811e24b2cb0cfb77717d5eafd0283 | [
"MIT"
] | null | null | null | freezeword/names.py | mattfister/freezeword | 74025da9e9a811e24b2cb0cfb77717d5eafd0283 | [
"MIT"
] | 2 | 2017-07-28T21:20:58.000Z | 2019-02-26T21:57:43.000Z | """
Simple utility to get random names. I think it uses data from a US census, located in the words folder.
"""
import random
import os.path
__author__ = "Matt Fister"
maleFirsts = [line.rstrip('\n').title() for line in open(os.path.join(os.path.dirname(__file__), (os.path.join('words', 'maleFirstNames.txt'))))]
fem... | 30.709677 | 149 | 0.682773 | """
Simple utility to get random names. I think it uses data from a US census, located in the words folder.
"""
import random
import os.path
__author__ = "Matt Fister"
maleFirsts = [line.rstrip('\n').title() for line in open(os.path.join(os.path.dirname(__file__), (os.path.join('words', 'maleFirstNames.txt'))))]
fem... | 194 | 0 | 69 |
aca2a4e1e23df5e70e73318fb26040b11d54ca14 | 522 | py | Python | access/privileges.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | null | null | null | access/privileges.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | null | null | null | access/privileges.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | null | null | null | from django.conf import settings
from core.utils import ensure_user_group_membership
from .models import SlackAccess
def invite_to_slack(privilege, person):
"""
Invites the user to Slack.
"""
privilege.slack_access.grant(person)
def add_to_group(privilege, person):
"""
Generic "add person... | 22.695652 | 95 | 0.733716 | from django.conf import settings
from core.utils import ensure_user_group_membership
from .models import SlackAccess
def invite_to_slack(privilege, person):
"""
Invites the user to Slack.
"""
privilege.slack_access.grant(person)
def add_to_group(privilege, person):
"""
Generic "add person... | 0 | 0 | 0 |
041159ae6b0c366db4204359e5e1da904e817c77 | 201 | py | Python | reports/admin.py | dgmarko/zach_p_eq_database | ffb69b84645695fe85c77129381fade5e39628d2 | [
"MIT"
] | null | null | null | reports/admin.py | dgmarko/zach_p_eq_database | ffb69b84645695fe85c77129381fade5e39628d2 | [
"MIT"
] | null | null | null | reports/admin.py | dgmarko/zach_p_eq_database | ffb69b84645695fe85c77129381fade5e39628d2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Transaction, Header, Ticker
# Register your models here.
admin.site.register(Transaction)
admin.site.register(Header)
admin.site.register(Ticker)
| 22.333333 | 47 | 0.810945 | from django.contrib import admin
from .models import Transaction, Header, Ticker
# Register your models here.
admin.site.register(Transaction)
admin.site.register(Header)
admin.site.register(Ticker)
| 0 | 0 | 0 |
181bb70f734ef532b0fb1a6ac83432c9a5343330 | 3,030 | py | Python | tests/operators/vector/test_ssd_all.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/operators/vector/test_ssd_all.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/operators/vector/test_ssd_all.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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 a... | 37.407407 | 170 | 0.609901 | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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 a... | 1,469 | 200 | 24 |
d5c648535ff4b61dff0b8d67671256949535c4ee | 3,658 | py | Python | cfn_encrypt/ssm_parameter.py | nordcloud/cfn-encrypt | 551f8d507477ff7ace03ec06339ed370d9b6c378 | [
"Apache-2.0"
] | 14 | 2018-01-16T08:51:21.000Z | 2020-11-18T20:47:53.000Z | cfn_encrypt/ssm_parameter.py | nordcloud/cfn-encrypt | 551f8d507477ff7ace03ec06339ed370d9b6c378 | [
"Apache-2.0"
] | 4 | 2018-05-17T13:42:47.000Z | 2019-11-21T10:28:36.000Z | cfn_encrypt/ssm_parameter.py | nordcloud/cfn-encrypt | 551f8d507477ff7ace03ec06339ed370d9b6c378 | [
"Apache-2.0"
] | 8 | 2018-02-13T12:48:51.000Z | 2020-03-03T18:29:15.000Z | import cfnresponse, logging, traceback, boto3
from random import choice
from string import ascii_uppercase, ascii_lowercase, digits
| 43.035294 | 187 | 0.609349 | import cfnresponse, logging, traceback, boto3
from random import choice
from string import ascii_uppercase, ascii_lowercase, digits
def parameter_exist(name):
response = boto3.client('ssm').describe_parameters(
ParameterFilters=[{
'Key': 'Name',
'Values': [
name
... | 3,478 | 0 | 46 |
a3960d16f61c3d52f45afc8d25e8cb8c2a0a5a3e | 519 | py | Python | supplier/urls.py | CrownKira/digitalace-backend | 9489b3dc4b856688360b60a7dca040c945faab74 | [
"MIT"
] | 1 | 2021-05-28T05:22:54.000Z | 2021-05-28T05:22:54.000Z | supplier/urls.py | CrownKira/digitalace-backend | 9489b3dc4b856688360b60a7dca040c945faab74 | [
"MIT"
] | 3 | 2021-05-31T15:44:14.000Z | 2021-06-29T07:48:13.000Z | supplier/urls.py | CrownKira/digitalace-backend | 9489b3dc4b856688360b60a7dca040c945faab74 | [
"MIT"
] | 1 | 2021-05-30T07:42:54.000Z | 2021-05-30T07:42:54.000Z | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from rest_framework_bulk.routes import BulkRouter
from supplier import views
router = DefaultRouter()
bulk_router = BulkRouter()
bulk_router.register("receives", views.ReceiveViewSet)
bulk_router.register("suppliers", views.Suppl... | 24.714286 | 67 | 0.789981 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from rest_framework_bulk.routes import BulkRouter
from supplier import views
router = DefaultRouter()
bulk_router = BulkRouter()
bulk_router.register("receives", views.ReceiveViewSet)
bulk_router.register("suppliers", views.Suppl... | 0 | 0 | 0 |
b4ebdd7e5b3a3d2cc1c95090b70f472364b115d9 | 957 | py | Python | CheckIfPangram.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | 14 | 2020-10-15T21:47:18.000Z | 2021-12-01T06:06:51.000Z | CheckIfPangram.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | null | null | null | CheckIfPangram.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | 4 | 2020-06-15T14:40:45.000Z | 2021-06-15T06:22:03.000Z | '''
A pangram is a sentence where every letter of the English alphabet appears at least once.
Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.
Example 1:
Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
Output: true
Explanation: sente... | 28.147059 | 124 | 0.607106 | '''
A pangram is a sentence where every letter of the English alphabet appears at least once.
Given a string sentence containing only lowercase English letters, return true if sentence is a pangram, or false otherwise.
Example 1:
Input: sentence = "thequickbrownfoxjumpsoverthelazydog"
Output: true
Explanation: sente... | 468 | -6 | 49 |
69611705ef9ded51b631df10fca6237883ab4cac | 9,208 | py | Python | free_hand.py | orenber/Widgets | 0df26370d9ac4d805d5c644f6db432c6732846d9 | [
"BSD-2-Clause"
] | 2 | 2019-08-31T05:15:22.000Z | 2019-09-19T20:27:21.000Z | free_hand.py | orenber/Widgets | 0df26370d9ac4d805d5c644f6db432c6732846d9 | [
"BSD-2-Clause"
] | null | null | null | free_hand.py | orenber/Widgets | 0df26370d9ac4d805d5c644f6db432c6732846d9 | [
"BSD-2-Clause"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QApplication
from draw_binary_image import plot_binary_image
if __name__ == "__main__":
main() | 29.703226 | 93 | 0.590356 | import matplotlib.pyplot as plt
import numpy as np
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QApplication
from draw_binary_image import plot_binary_image
class AxesEvent:
def __init__(self, *args, **kwargs):
self.ax = plt.axes(*args, **kwargs)
self.f... | 7,960 | 508 | 497 |
b945b76ccccdb43041716831f0119db495983ba8 | 5,921 | py | Python | src/legacy/evaluate.py | christear/APAIQ_release | 5a5031e69cabd4dbcf1d44ef05a7097cbb1e5c35 | [
"MIT"
] | null | null | null | src/legacy/evaluate.py | christear/APAIQ_release | 5a5031e69cabd4dbcf1d44ef05a7097cbb1e5c35 | [
"MIT"
] | null | null | null | src/legacy/evaluate.py | christear/APAIQ_release | 5a5031e69cabd4dbcf1d44ef05a7097cbb1e5c35 | [
"MIT"
] | null | null | null | from PolyAModel import *
import re
import os, sys, copy, getopt, re, argparse
import random
import pandas as pd
import numpy as np
from Bio.Seq import Seq
from TrimmedMean import TrimmedMean
import gc
#from extract_coverage_from_scanGenome import check
#def dataProcessing(scan_file,window,rst):
... | 32.894444 | 108 | 0.576254 | from PolyAModel import *
import re
import os, sys, copy, getopt, re, argparse
import random
import pandas as pd
import numpy as np
from Bio.Seq import Seq
from TrimmedMean import TrimmedMean
import gc
#from extract_coverage_from_scanGenome import check
def check(line1,line2,window):
#_,pos1,_ = line1[... | 5,408 | 0 | 124 |
bf4a6fef0a07d3313320f3e022cb1693d9674103 | 473 | py | Python | tools/vagrant/data/scripts/apply_env.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | 2 | 2022-03-17T18:53:58.000Z | 2022-03-17T22:04:22.000Z | tools/vagrant/data/scripts/apply_env.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | 9 | 2022-03-18T08:22:57.000Z | 2022-03-30T17:14:49.000Z | tools/vagrant/data/scripts/apply_env.py | hsong-rh/pinakes | 2f08cb757ca64c866af3244686b92a3074fc7571 | [
"Apache-2.0"
] | 7 | 2022-03-17T22:03:08.000Z | 2022-03-28T21:28:34.000Z | import sys
import os
from jinja2 import Template
# Apply environment variables to a Jinga2 Template file
# Save the results into an output file specified by the caller
if __name__ == "__main__":
if len(sys.argv) != 3:
print("usage: python apply_env.py input_file output_file")
sys.exit(1)
with ... | 26.277778 | 66 | 0.651163 | import sys
import os
from jinja2 import Template
# Apply environment variables to a Jinga2 Template file
# Save the results into an output file specified by the caller
if __name__ == "__main__":
if len(sys.argv) != 3:
print("usage: python apply_env.py input_file output_file")
sys.exit(1)
with ... | 0 | 0 | 0 |
f4d3e2fa9b5d5a03e3d66a3a1060b0253a42f444 | 1,666 | py | Python | lab4/image_stats.py | CG2016/barkovsky_3 | 784bb3e419736cd11b9bc84b3055b8a4b9ec57e6 | [
"MIT"
] | null | null | null | lab4/image_stats.py | CG2016/barkovsky_3 | 784bb3e419736cd11b9bc84b3055b8a4b9ec57e6 | [
"MIT"
] | null | null | null | lab4/image_stats.py | CG2016/barkovsky_3 | 784bb3e419736cd11b9bc84b3055b8a4b9ec57e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import argparse
import PIL.Image
import PIL.ExifTags
if __name__ == '__main__':
main()
| 26.03125 | 97 | 0.605642 | #!/usr/bin/env python
import os
import argparse
import PIL.Image
import PIL.ExifTags
def get_image_paths(path):
if os.path.isdir(path):
for dirpath, dirnames, filenames in os.walk(path):
for filename in filenames:
yield os.path.join(dirpath, filename)
else:
yield p... | 1,468 | 0 | 69 |
1f016bf5c421cd9b6e7ae9b9544f42ef7a8267f7 | 5,733 | py | Python | Tail/plugin.py | hacklab/doorbot | a0837505beedab8436bc6d451644eb18dde0a31d | [
"BSD-3-Clause"
] | 1 | 2016-05-09T01:55:04.000Z | 2016-05-09T01:55:04.000Z | Tail/plugin.py | hacklab/doorbot | a0837505beedab8436bc6d451644eb18dde0a31d | [
"BSD-3-Clause"
] | null | null | null | Tail/plugin.py | hacklab/doorbot | a0837505beedab8436bc6d451644eb18dde0a31d | [
"BSD-3-Clause"
] | null | null | null | ###
# Copyright (c) 2004-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | 35.83125 | 79 | 0.631258 | ###
# Copyright (c) 2004-2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of co... | 1,973 | 1,881 | 23 |
0f64541f7886f83908fd68e4ab290832262593f2 | 4,229 | py | Python | fusion_pickles_probability_3.py | pdturney/management-theory-revised | 12ac601658fec7001817bc981e8e851e853d4803 | [
"MIT"
] | null | null | null | fusion_pickles_probability_3.py | pdturney/management-theory-revised | 12ac601658fec7001817bc981e8e851e853d4803 | [
"MIT"
] | null | null | null | fusion_pickles_probability_3.py | pdturney/management-theory-revised | 12ac601658fec7001817bc981e8e851e853d4803 | [
"MIT"
] | null | null | null | #
# Fusion Pickles Probability 3 Parts
#
# Peter Turney, July 14, 2021
#
# From the 20 runs, extract all of the pickled three-part seeds
# that are stored in the 20 "fusion_storage.bin" pickle files.
# Read the pickles and run each pickle, recording the results in
# a numpy tensor:
#
# tensor = num_seeds x nu... | 33.832 | 77 | 0.674391 | #
# Fusion Pickles Probability 3 Parts
#
# Peter Turney, July 14, 2021
#
# From the 20 runs, extract all of the pickled three-part seeds
# that are stored in the 20 "fusion_storage.bin" pickle files.
# Read the pickles and run each pickle, recording the results in
# a numpy tensor:
#
# tensor = num_seeds x nu... | 0 | 0 | 0 |
65ac9cb1a116de9b39966c6fe34e3dcee6cf7692 | 8,839 | py | Python | cli/aws_ddk/__main__.py | vemel/aws-ddk | d34bd1d98f5a170026a1b65f9629e909ca839930 | [
"Apache-2.0"
] | null | null | null | cli/aws_ddk/__main__.py | vemel/aws-ddk | d34bd1d98f5a170026a1b65f9629e909ca839930 | [
"Apache-2.0"
] | null | null | null | cli/aws_ddk/__main__.py | vemel/aws-ddk | d34bd1d98f5a170026a1b65f9629e909ca839930 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 26.703927 | 115 | 0.663084 | #!/usr/bin/env python3
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 1,107 | 94 | 92 |