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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
688d4348ba03f88567d8b80507a9dd716dacb9bc | 404 | py | Python | ibench/benchmarks/lu.py | rscohn2/IDP-bench | 1b7540276369da6146b3cacae780dae3ffba73da | [
"MIT"
] | null | null | null | ibench/benchmarks/lu.py | rscohn2/IDP-bench | 1b7540276369da6146b3cacae780dae3ffba73da | [
"MIT"
] | null | null | null | ibench/benchmarks/lu.py | rscohn2/IDP-bench | 1b7540276369da6146b3cacae780dae3ffba73da | [
"MIT"
] | null | null | null | import numpy as np
import scipy
from .bench import Bench
| 23.764706 | 87 | 0.641089 | import numpy as np
import scipy
from .bench import Bench
class Lu(Bench):
sizes = {'large': 35000, 'small': 20000, 'test': 2}
def _ops(self, n):
return 2./3.*n*n*n*1e-9
def _make_args(self, n):
self._A = np.asfortranarray(np.asarray(np.random.rand(n,n), dtype=self._dtype))
def _comp... | 191 | 132 | 23 |
e3f69d32d00a3bb7eba166c677394c55c97dc3c6 | 6,928 | py | Python | waldur_batch_offering.py | ServerAnt/ansible-waldur-module | 4406a176a9a11f37e37affb6ccc0478f15ad1081 | [
"MIT"
] | null | null | null | waldur_batch_offering.py | ServerAnt/ansible-waldur-module | 4406a176a9a11f37e37affb6ccc0478f15ad1081 | [
"MIT"
] | null | null | null | waldur_batch_offering.py | ServerAnt/ansible-waldur-module | 4406a176a9a11f37e37affb6ccc0478f15ad1081 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
from waldur_client import WaldurClientException, waldur_client_from_module
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'OpenNode',
}
DOCUMENTATION = '''
---
options:
api_url:
des... | 30.121739 | 83 | 0.587904 | #!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
from waldur_client import WaldurClientException, waldur_client_from_module
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'OpenNode',
}
DOCUMENTATION = '''
---
options:
api_url:
des... | 3,073 | 0 | 69 |
abbe93d8493620ffe594b9b4c940094d973e1987 | 4,282 | py | Python | ConvNet.py | Gregory-Eales/Convolutional-Neural-Network | 50c07208f59526b9a86a162d8b356e9e19dd3310 | [
"MIT"
] | 1 | 2019-05-03T21:48:34.000Z | 2019-05-03T21:48:34.000Z | ConvNet.py | Gregory-Eales/Convolutional-Neural-Network | 50c07208f59526b9a86a162d8b356e9e19dd3310 | [
"MIT"
] | null | null | null | ConvNet.py | Gregory-Eales/Convolutional-Neural-Network | 50c07208f59526b9a86a162d8b356e9e19dd3310 | [
"MIT"
] | null | null | null | import numpy as np
# loading bar imports
import os
from tqdm import tqdm
import time
# Convolution Functions
# single convolutional operation
# Pool Funtions
| 32.439394 | 96 | 0.569827 | import numpy as np
# loading bar imports
import os
from tqdm import tqdm
import time
class ConvNet(object):
def __init__(self, x, y):
# define network topology
# remember to change # of each type of layers
# topology parameter?
self.x_size = x.shape
self.y_size = y.shape
... | 3,743 | 1 | 346 |
aac0f27d69e7306681029adb483e49112422799f | 1,156 | py | Python | make_sqls.py | na0fu3y/bqfunc | a77554c6160b37e01de6dbb6e36dd499acb17bf4 | [
"MIT"
] | 5 | 2020-11-30T13:25:05.000Z | 2022-02-25T12:29:39.000Z | make_sqls.py | na0fu3y/bqfunc | a77554c6160b37e01de6dbb6e36dd499acb17bf4 | [
"MIT"
] | null | null | null | make_sqls.py | na0fu3y/bqfunc | a77554c6160b37e01de6dbb6e36dd499acb17bf4 | [
"MIT"
] | null | null | null | import datetime
import urllib.request
from pathlib import Path
if __name__ == "__main__":
make_holidays_sql()
| 28.9 | 109 | 0.619377 | import datetime
import urllib.request
from pathlib import Path
def fetch_holidays():
# 内閣府「国民の祝日」
# https://www8.cao.go.jp/chosei/shukujitsu/gaiyou.html
url = "https://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv"
with urllib.request.urlopen(url) as res:
body = res.readlines()
# header ... | 1,098 | 0 | 46 |
dce5baf6c786a397b5a9edbf5f8a799edd0e5d8c | 1,299 | py | Python | login/login.py | nju161250102/NJUSystem_Server | 8b72fde8701d55e62ce8ed4bcb299ec8f0ab32fe | [
"MIT"
] | 1 | 2018-07-31T13:31:52.000Z | 2018-07-31T13:31:52.000Z | login/login.py | nju161250102/NJUSystem_Server | 8b72fde8701d55e62ce8ed4bcb299ec8f0ab32fe | [
"MIT"
] | null | null | null | login/login.py | nju161250102/NJUSystem_Server | 8b72fde8701d55e62ce8ed4bcb299ec8f0ab32fe | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from flask import Blueprint
from flask import request
from flask import Response
import json
import requests
loginModule = Blueprint('login', __name__)
@loginModule.route('/', methods=['POST'])
# 获得验证码图片并保存cookie, 验证码对应登录网址为http://cer.nju.edu.cn/amserver/UI/Login
@loginModule.route('/cer_cod... | 30.928571 | 116 | 0.664357 | # -*- coding:utf-8 -*-
from flask import Blueprint
from flask import request
from flask import Response
import json
import requests
loginModule = Blueprint('login', __name__)
@loginModule.route('/', methods=['POST'])
def login():
req_data = json.loads(request.data)
post_data = {
"IDToken1": req_data[... | 952 | 0 | 44 |
cf41028c39b31a7dc048944cfc4a553f51366dea | 4,434 | py | Python | scrape_mars.py | junki-ogawa/web-scraping-challenge | eeb181cabe48396a8068ef93ac41a62cc261b6a0 | [
"ADSL"
] | null | null | null | scrape_mars.py | junki-ogawa/web-scraping-challenge | eeb181cabe48396a8068ef93ac41a62cc261b6a0 | [
"ADSL"
] | null | null | null | scrape_mars.py | junki-ogawa/web-scraping-challenge | eeb181cabe48396a8068ef93ac41a62cc261b6a0 | [
"ADSL"
] | null | null | null | from splinter import Browser
from bs4 import BeautifulSoup
from webdriver_manager.chrome import ChromeDriverManager
import pymongo
import pandas as pd
import requests
from flask import Flask, render_template
import time
conn = 'mongodb://localhost:27017'
client = pymongo.MongoClient(conn)
db = client.mars... | 37.897436 | 97 | 0.690798 | from splinter import Browser
from bs4 import BeautifulSoup
from webdriver_manager.chrome import ChromeDriverManager
import pymongo
import pandas as pd
import requests
from flask import Flask, render_template
import time
conn = 'mongodb://localhost:27017'
client = pymongo.MongoClient(conn)
db = client.mars... | 4,059 | 0 | 24 |
57f9a91be26db31e5547c40be706239eb0346542 | 900 | py | Python | viettel_shake/shake/serializers.py | longphu0001/viettel-shake | 3326335eb3479d84db7fa9bb471d6a1a7ffa4019 | [
"MIT"
] | 20 | 2020-01-03T03:49:43.000Z | 2020-02-08T05:30:36.000Z | viettel_shake/shake/serializers.py | longphu0001/viettel-shake | 3326335eb3479d84db7fa9bb471d6a1a7ffa4019 | [
"MIT"
] | 4 | 2020-01-15T10:25:45.000Z | 2020-01-31T14:40:36.000Z | viettel_shake/shake/serializers.py | longphu0001/viettel-shake | 3326335eb3479d84db7fa9bb471d6a1a7ffa4019 | [
"MIT"
] | 18 | 2019-12-30T03:29:45.000Z | 2020-03-06T15:32:14.000Z | from rest_framework import serializers
from .consts import USE_TOTAL_SHAKE_TURN
from .models import Shake, ViettelUser
| 24.324324 | 58 | 0.725556 | from rest_framework import serializers
from .consts import USE_TOTAL_SHAKE_TURN
from .models import Shake, ViettelUser
def get_default_shake_turn():
return USE_TOTAL_SHAKE_TURN
class LoginSerializer(serializers.Serializer):
phone = serializers.CharField()
otp = serializers.CharField()
shake_turn = ... | 40 | 620 | 115 |
13806065b202f1f3a84428e15535c568b7658007 | 1,205 | py | Python | tchron/tests/vtk_test.py | dyvasey/riftinversion | 6707a22d3413ee5af6c8aee2660f1024214f1a31 | [
"MIT"
] | null | null | null | tchron/tests/vtk_test.py | dyvasey/riftinversion | 6707a22d3413ee5af6c8aee2660f1024214f1a31 | [
"MIT"
] | null | null | null | tchron/tests/vtk_test.py | dyvasey/riftinversion | 6707a22d3413ee5af6c8aee2660f1024214f1a31 | [
"MIT"
] | null | null | null | """
Test for forward modeling of ASPECT output, using cookbook output
"""
#%% Import and setup files
import matplotlib.pyplot as plt
from matplotlib import cm,colors
import numpy as np
import pyvista as pv
import vtk_plot as vp
# Read in sample data from continental extension cookbook
meshes = pv.re... | 30.125 | 108 | 0.66805 | """
Test for forward modeling of ASPECT output, using cookbook output
"""
#%% Import and setup files
import matplotlib.pyplot as plt
from matplotlib import cm,colors
import numpy as np
import pyvista as pv
import vtk_plot as vp
# Read in sample data from continental extension cookbook
meshes = pv.re... | 0 | 0 | 0 |
a8b0260995482da49d8adf4cf28f57de040c3349 | 1,759 | py | Python | final_gpt2_test_wikitext103-fp32.py | minhhn2910/conga2022 | 81ad2fb9c0055c332f8f305b2ea409b6577003f4 | [
"MIT"
] | null | null | null | final_gpt2_test_wikitext103-fp32.py | minhhn2910/conga2022 | 81ad2fb9c0055c332f8f305b2ea409b6577003f4 | [
"MIT"
] | null | null | null | final_gpt2_test_wikitext103-fp32.py | minhhn2910/conga2022 | 81ad2fb9c0055c332f8f305b2ea409b6577003f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Transformers installation
import numpy as np
from transformers import GPT2LMHeadModel, GPT2TokenizerFast
from qtorch.quant import posit_quantize, float_quantize, configurable_table_quantize
device = 'cuda'
model_id = 'gpt2-large'
tokenizer = GPT2TokenizerFast.from_pretrained(model_id)
fro... | 25.128571 | 84 | 0.670836 | # -*- coding: utf-8 -*-
# Transformers installation
import numpy as np
from transformers import GPT2LMHeadModel, GPT2TokenizerFast
from qtorch.quant import posit_quantize, float_quantize, configurable_table_quantize
device = 'cuda'
model_id = 'gpt2-large'
tokenizer = GPT2TokenizerFast.from_pretrained(model_id)
fro... | 1,120 | 0 | 23 |
810202aa9efdc363b89d45a92de4e299f0f1ac3c | 4,067 | py | Python | modules/iib_api.py | AATools/ib-metrics-pyclient | 2f3bae726201eabcb6c1bec0cfdf5957df538787 | [
"MIT"
] | 1 | 2020-07-28T15:47:44.000Z | 2020-07-28T15:47:44.000Z | modules/iib_api.py | AATools/ib-metrics-pyclient | 2f3bae726201eabcb6c1bec0cfdf5957df538787 | [
"MIT"
] | 5 | 2020-04-27T12:05:03.000Z | 2020-12-11T10:27:08.000Z | modules/iib_api.py | AATools/ib-metrics-pyclient | 2f3bae726201eabcb6c1bec0cfdf5957df538787 | [
"MIT"
] | 2 | 2020-11-11T03:21:13.000Z | 2022-03-08T17:45:12.000Z | # -*- coding: utf-8 -*-
"""Various functions for client api."""
import subprocess
def run_iib_command(**kwargs):
"""Calls predefined commands and returns their result."""
command_mapping = {
'get_brokers_status': 'mqsilist | grep Broker',
'get_integration_nodes_status': 'mqsilist | grep "Integ... | 40.267327 | 110 | 0.595771 | # -*- coding: utf-8 -*-
"""Various functions for client api."""
import subprocess
def run_iib_command(**kwargs):
"""Calls predefined commands and returns their result."""
command_mapping = {
'get_brokers_status': 'mqsilist | grep Broker',
'get_integration_nodes_status': 'mqsilist | grep "Integ... | 0 | 0 | 0 |
8cee128cf4e93fd417bbdce4ad0272375e780eed | 963 | py | Python | test/command_line/test_stereographic_projections.py | jbeilstenedmands/dials | fb9672b91854f564cbbba6f1cceeefa18d135965 | [
"BSD-3-Clause"
] | null | null | null | test/command_line/test_stereographic_projections.py | jbeilstenedmands/dials | fb9672b91854f564cbbba6f1cceeefa18d135965 | [
"BSD-3-Clause"
] | null | null | null | test/command_line/test_stereographic_projections.py | jbeilstenedmands/dials | fb9672b91854f564cbbba6f1cceeefa18d135965 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
import json
import os
import procrunner
| 30.09375 | 65 | 0.628245 | from __future__ import absolute_import, division, print_function
import json
import os
import procrunner
def test_stereographic_projection(dials_regression, tmpdir):
path = os.path.join(dials_regression, "experiment_test_data")
result = procrunner.run(
(
"dials.stereographic_projection",... | 832 | 0 | 23 |
bc6827cecb880364d64ad812e4e93528bfdf6b85 | 1,795 | py | Python | setup.py | nyergler/hieroglyph | 843ed9553fe640f9d6061dfb1accf131b467492e | [
"BSD-3-Clause"
] | 115 | 2015-01-08T12:54:49.000Z | 2021-05-20T18:27:14.000Z | setup.py | lpirl/hieroglyph | e41533276594fa9b826d5e9c48164db628fe1541 | [
"BSD-3-Clause"
] | 94 | 2015-01-05T15:34:27.000Z | 2020-10-09T08:13:25.000Z | setup.py | lpirl/hieroglyph | e41533276594fa9b826d5e9c48164db628fe1541 | [
"BSD-3-Clause"
] | 48 | 2015-01-21T06:13:34.000Z | 2020-05-07T22:10:24.000Z | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
import versioneer
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
install_requires = [
"setuptools",
"Sphinx >= 2.0",
]
se... | 28.951613 | 71 | 0.58663 | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
import versioneer
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
install_requires = [
"setuptools",
"Sphinx >= 2.0",
]
se... | 0 | 0 | 0 |
fe1d958575805e5d3d534043bf5eb33566f7cef4 | 952 | py | Python | y2022/CargoDetection/python/rapid_react/cargo/ui/subpanels.py | pjreiniger/GirlsOfSteelFRC | 03ab0fb699dfc14985ce3c95b1eacb145288fc7e | [
"BSD-3-Clause"
] | null | null | null | y2022/CargoDetection/python/rapid_react/cargo/ui/subpanels.py | pjreiniger/GirlsOfSteelFRC | 03ab0fb699dfc14985ce3c95b1eacb145288fc7e | [
"BSD-3-Clause"
] | 44 | 2021-11-09T23:23:48.000Z | 2022-03-22T23:44:15.000Z | y2022/CargoDetection/python/rapid_react/cargo/ui/subpanels.py | pjreiniger/GirlsOfSteelFRC | 03ab0fb699dfc14985ce3c95b1eacb145288fc7e | [
"BSD-3-Clause"
] | 1 | 2021-11-19T03:45:21.000Z | 2021-11-19T03:45:21.000Z | from PyQt5.QtWidgets import QWidget
from PyQt5.uic import loadUi
from rapid_react.cargo.cargo_pipeline_params import CargoPipelineParams
| 36.615385 | 73 | 0.746849 | from PyQt5.QtWidgets import QWidget
from PyQt5.uic import loadUi
from rapid_react.cargo.cargo_pipeline_params import CargoPipelineParams
class ParamsWidget(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
loadUi("rapid_react/cargo/ui/params_widget.ui", self)
def set_params... | 676 | 7 | 130 |
aff8057d4e984138d871f670277a645965da11d6 | 33,638 | py | Python | post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta2pt6/Output/Histos/MadAnalysis5job_0/selection_3.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta2pt6/Output/Histos/MadAnalysis5job_0/selection_3.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta2pt6/Output/Histos/MadAnalysis5job_0/selection_3.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null |
# Running!
if __name__ == '__main__':
selection_3()
| 154.302752 | 1,799 | 0.768238 | def selection_3():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.lin... | 33,559 | 0 | 22 |
7e8f902ed35a3c9b042fcc03e4adf01f5802e3f3 | 1,015 | py | Python | pyqt/getting_started/widget_layout.py | CospanDesign/python | 9f911509aae7abd9237c14a4635294c7719c9129 | [
"MIT"
] | 5 | 2015-12-12T20:16:45.000Z | 2020-02-21T19:50:31.000Z | pyqt/getting_started/widget_layout.py | CospanDesign/python | 9f911509aae7abd9237c14a4635294c7719c9129 | [
"MIT"
] | null | null | null | pyqt/getting_started/widget_layout.py | CospanDesign/python | 9f911509aae7abd9237c14a4635294c7719c9129 | [
"MIT"
] | 2 | 2020-06-01T06:27:06.000Z | 2022-03-10T13:21:03.000Z | import os
import sys
from PyQt4.Qt import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
if __name__ == '__main__':
app = QApplication(sys.argv)
scene = QGraphicsScene()
#text_edit = scene.addWidget(QLabel("Test"))
#push_button = scene.addWidget(QPushButton("button"))
#layout = QGraphicsG... | 24.756098 | 69 | 0.649261 | import os
import sys
from PyQt4.Qt import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
self.init_ui()
def init_ui(self):
qbtn = QtGui.QPushButton('Quit', self)
qbtn.clicked.connect(QtCo... | 322 | 8 | 77 |
52fe956ddac463089ef4c1dd09b2e5106fe7a862 | 4,001 | py | Python | playwell-client/playwell/slots.py | jiyulongxu/playwell | 3a5dc4d009c6fd75487e208edf0318db4f9ad21d | [
"Apache-2.0"
] | 4 | 2019-09-01T02:05:09.000Z | 2022-01-04T06:08:14.000Z | playwell-client/playwell/slots.py | jiyulongxu/playwell | 3a5dc4d009c6fd75487e208edf0318db4f9ad21d | [
"Apache-2.0"
] | null | null | null | playwell-client/playwell/slots.py | jiyulongxu/playwell | 3a5dc4d009c6fd75487e208edf0318db4f9ad21d | [
"Apache-2.0"
] | 6 | 2019-11-14T13:55:17.000Z | 2022-02-09T01:42:24.000Z | """Playwell slots API
"""
from playwell import (
API,
Arg,
ArgPos,
Methods,
load_config
)
## Alloc slots ##
ALLOC = API(
Methods.POST,
"/v1/slot/alloc",
(
Arg(
"slots_num",
ArgPos.BODY,
{
"required": True,
"hel... | 20.623711 | 82 | 0.444639 | """Playwell slots API
"""
from playwell import (
API,
Arg,
ArgPos,
Methods,
load_config
)
## Alloc slots ##
ALLOC = API(
Methods.POST,
"/v1/slot/alloc",
(
Arg(
"slots_num",
ArgPos.BODY,
{
"required": True,
"hel... | 0 | 0 | 0 |
57e20d4dabc078a9cb89fb535f8f13bd01dbed98 | 3,022 | py | Python | tests/analyzer/test_skip_import.py | CAM-Gerlach/unimport | acaebf547274a95a33816e47ec22bb73d8456b17 | [
"MIT"
] | 147 | 2019-09-19T15:43:06.000Z | 2022-03-25T16:42:08.000Z | tests/analyzer/test_skip_import.py | CAM-Gerlach/unimport | acaebf547274a95a33816e47ec22bb73d8456b17 | [
"MIT"
] | 154 | 2019-10-31T19:50:18.000Z | 2022-03-29T12:43:00.000Z | tests/analyzer/test_skip_import.py | CAM-Gerlach/unimport | acaebf547274a95a33816e47ec22bb73d8456b17 | [
"MIT"
] | 28 | 2019-10-31T18:11:13.000Z | 2021-09-06T08:24:14.000Z | import textwrap
import unittest
from tests.analyzer.utils import AnalyzerTestCase
from unimport.analyzer import Analyzer
from unimport.constants import PY38_PLUS
from unimport.statement import Import, ImportFrom, Name
| 27.724771 | 79 | 0.533752 | import textwrap
import unittest
from tests.analyzer.utils import AnalyzerTestCase
from unimport.analyzer import Analyzer
from unimport.constants import PY38_PLUS
from unimport.statement import Import, ImportFrom, Name
class SkipImportTestCase(AnalyzerTestCase):
def test_inside_try_except(self):
self.asse... | 2,018 | 761 | 23 |
51f40bd3d0b75602d9d7def00687a93587c0bce1 | 1,323 | py | Python | project/frontend/views.py | samuelkim7/pneumonia_cnn | 63712f4a6965c6bef55da202ff837e6aadcc1739 | [
"MIT"
] | null | null | null | project/frontend/views.py | samuelkim7/pneumonia_cnn | 63712f4a6965c6bef55da202ff837e6aadcc1739 | [
"MIT"
] | null | null | null | project/frontend/views.py | samuelkim7/pneumonia_cnn | 63712f4a6965c6bef55da202ff837e6aadcc1739 | [
"MIT"
] | 1 | 2021-01-29T18:47:26.000Z | 2021-01-29T18:47:26.000Z | from django.shortcuts import render
| 24.5 | 71 | 0.706727 | from django.shortcuts import render
def index(request):
return render(request, 'frontend/index.html')
def register(request):
return render(request, 'frontend/register.html')
def login(request):
return render(request, 'frontend/login.html')
def logout(request):
return render(reque... | 962 | 0 | 300 |
dc69d9f154a8a3dabd67814afb995e90b42c086e | 19,711 | py | Python | tests/autodiff/test_single_state.py | manuelburger/daceml | 501a05b0531bcf208b43816eeaba998feb83feb5 | [
"BSD-3-Clause"
] | null | null | null | tests/autodiff/test_single_state.py | manuelburger/daceml | 501a05b0531bcf208b43816eeaba998feb83feb5 | [
"BSD-3-Clause"
] | null | null | null | tests/autodiff/test_single_state.py | manuelburger/daceml | 501a05b0531bcf208b43816eeaba998feb83feb5 | [
"BSD-3-Clause"
] | null | null | null | from functools import reduce
import numpy as np
import pytest
import torch
import torch.nn.functional as F
import dace
from dace import data
import dace.sdfg.nodes as nd
from dace.transformation.interstate import StateFusion
import daceml.onnx as donnx
from daceml.autodiff import AutoDiffException, add_backward_pass... | 26.072751 | 79 | 0.536705 | from functools import reduce
import numpy as np
import pytest
import torch
import torch.nn.functional as F
import dace
from dace import data
import dace.sdfg.nodes as nd
from dace.transformation.interstate import StateFusion
import daceml.onnx as donnx
from daceml.autodiff import AutoDiffException, add_backward_pass... | 18,418 | 4 | 453 |
9eac8f5e2421103e0d037b229996a1a81517e5c6 | 1,245 | py | Python | 4point5.py | ishah011/CTCI | 41fb337c03aba98edb6a619c878c618a1113f231 | [
"MIT"
] | null | null | null | 4point5.py | ishah011/CTCI | 41fb337c03aba98edb6a619c878c618a1113f231 | [
"MIT"
] | null | null | null | 4point5.py | ishah011/CTCI | 41fb337c03aba98edb6a619c878c618a1113f231 | [
"MIT"
] | null | null | null | #
# 4.5
# Implement a function to check if a binary tree is a binary search tree
#
# create a new tree
# 2
# / \
# 1 3
# \ \
# 0 4
#
left_right = Tree(0)
left = Tree(1, None, left_right)
right_right = Tree(4)
right = Tree(3, None, right_right)
tree = Tree(2, left, rig... | 23.942308 | 84 | 0.632129 | #
# 4.5
# Implement a function to check if a binary tree is a binary search tree
#
class Tree:
def __init__(self, dat, left=None, right=None):
self.left = left
self.right = right
self.data = dat
def isBST(root, answer):
# check if the left and/or right nodes exist and if th... | 770 | -10 | 77 |
22b641f7e232b6d60727ffd8e33c6772dc3688fa | 534 | py | Python | pystratis/api/unity3d/tests/test_requestmodels.py | TjadenFroyda/pyStratis | 9cc7620d7506637f8a2b84003d931eceb36ac5f2 | [
"MIT"
] | 8 | 2021-06-30T20:44:22.000Z | 2021-12-07T14:42:22.000Z | pystratis/api/unity3d/tests/test_requestmodels.py | TjadenFroyda/pyStratis | 9cc7620d7506637f8a2b84003d931eceb36ac5f2 | [
"MIT"
] | 2 | 2021-07-01T11:50:18.000Z | 2022-01-25T18:39:49.000Z | pystratis/api/unity3d/tests/test_requestmodels.py | TjadenFroyda/pyStratis | 9cc7620d7506637f8a2b84003d931eceb36ac5f2 | [
"MIT"
] | 4 | 2021-07-01T04:36:42.000Z | 2021-09-17T10:54:19.000Z | import pytest
import json
from pystratis.api.unity3d.requestmodels import *
from pystratis.core.types import Address
from pystratis.core.networks import CirrusMain
@pytest.mark.parametrize('network', [CirrusMain()], ids=['CirrusMain'])
| 31.411765 | 71 | 0.745318 | import pytest
import json
from pystratis.api.unity3d.requestmodels import *
from pystratis.core.types import Address
from pystratis.core.networks import CirrusMain
@pytest.mark.parametrize('network', [CirrusMain()], ids=['CirrusMain'])
def test_addressrequest(network, generate_p2pkh_address):
data = {
'ad... | 274 | 0 | 22 |
f0a10fa0d2ee577c5d57bffcf06a524f47af6306 | 1,378 | py | Python | Leetcode/medium/partition-equal-subset-sum.py | jen-sjen/data-structures-basics-leetcode | addac32974b16e0a37aa60c210ab7820b349b279 | [
"MIT"
] | 6 | 2021-07-29T03:26:20.000Z | 2022-01-28T15:11:45.000Z | Leetcode/medium/partition-equal-subset-sum.py | jen-sjen/data-structures-basics-leetcode | addac32974b16e0a37aa60c210ab7820b349b279 | [
"MIT"
] | 2 | 2021-09-30T09:47:23.000Z | 2022-01-31T03:08:24.000Z | Leetcode/medium/partition-equal-subset-sum.py | jen-sjen/data-structures-basics-leetcode | addac32974b16e0a37aa60c210ab7820b349b279 | [
"MIT"
] | 5 | 2021-08-10T06:41:11.000Z | 2022-01-29T17:50:20.000Z | """
# PARTITION EQUAL SUBSET SUM
Given a non-empty array nums containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Example 1:
Input: nums = [1,5,11,5]
Output: true
Explanation: The array can be partitioned as [1, 5, 5] and [... | 25.054545 | 173 | 0.571118 | """
# PARTITION EQUAL SUBSET SUM
Given a non-empty array nums containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Example 1:
Input: nums = [1,5,11,5]
Output: true
Explanation: The array can be partitioned as [1, 5, 5] and [... | 760 | 0 | 52 |
e448d6c01725ab50de459e6de0fd3807ef933967 | 321 | py | Python | tests/test_utilities/__init__.py | amih90/bacpypes | 27ab4f18aa252ceb6ffdc32d53af2995a2e92647 | [
"MIT"
] | 240 | 2015-07-17T16:27:54.000Z | 2022-03-29T13:53:06.000Z | tests/test_utilities/__init__.py | amih90/bacpypes | 27ab4f18aa252ceb6ffdc32d53af2995a2e92647 | [
"MIT"
] | 400 | 2015-07-23T05:37:52.000Z | 2022-03-29T12:32:30.000Z | tests/test_utilities/__init__.py | amih90/bacpypes | 27ab4f18aa252ceb6ffdc32d53af2995a2e92647 | [
"MIT"
] | 143 | 2015-07-17T18:22:27.000Z | 2022-03-22T01:21:24.000Z | #!/usr/bin/python
"""
Test Utilities
--------------
This module tests the test utilities.
"""
from . import test_state_machine
from . import test_time_machine
from . import test_extended_tag_list
from . import test_client_state_machine
from . import test_server_state_machine
from . import test_service_access_point... | 17.833333 | 39 | 0.772586 | #!/usr/bin/python
"""
Test Utilities
--------------
This module tests the test utilities.
"""
from . import test_state_machine
from . import test_time_machine
from . import test_extended_tag_list
from . import test_client_state_machine
from . import test_server_state_machine
from . import test_service_access_point... | 0 | 0 | 0 |
4a41309297f5de0b6f38be80941bd38d0bb9c316 | 7,090 | py | Python | cloudmersive_validate_api_client/models/address_verify_syntax_only_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Validate | 894a3f578c3860db41b3eed179dcc52e02f565a0 | [
"Apache-2.0"
] | 3 | 2018-06-23T21:37:21.000Z | 2020-04-20T23:07:36.000Z | cloudmersive_validate_api_client/models/address_verify_syntax_only_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Validate | 894a3f578c3860db41b3eed179dcc52e02f565a0 | [
"Apache-2.0"
] | 1 | 2019-02-04T17:03:35.000Z | 2019-03-02T20:16:52.000Z | cloudmersive_validate_api_client/models/address_verify_syntax_only_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Validate | 894a3f578c3860db41b3eed179dcc52e02f565a0 | [
"Apache-2.0"
] | 2 | 2019-03-21T15:54:15.000Z | 2020-05-27T17:30:43.000Z | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 35.09901 | 240 | 0.642877 | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 0 | 0 | 0 |
10f6ed57eea3cf337b34879e604de30cac9c4f7f | 130 | py | Python | Configuration/ProcessModifiers/python/siPixelDigiMorphing_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/ProcessModifiers/python/siPixelDigiMorphing_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/ProcessModifiers/python/siPixelDigiMorphing_cff.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
# This modifier is to run the SiPixelDigiMorphing
siPixelDigiMorphing = cms.Modifier()
| 26 | 49 | 0.815385 | import FWCore.ParameterSet.Config as cms
# This modifier is to run the SiPixelDigiMorphing
siPixelDigiMorphing = cms.Modifier()
| 0 | 0 | 0 |
76d32f5341315082a53f44fb5fb5c02ec0b7bbfd | 3,683 | py | Python | src/Fourteenth Chapter/Exercise2.py | matthijskrul/ThinkPython | 34c1d81f4ef535c32b8b0309b23c7ca37f851606 | [
"MIT"
] | null | null | null | src/Fourteenth Chapter/Exercise2.py | matthijskrul/ThinkPython | 34c1d81f4ef535c32b8b0309b23c7ca37f851606 | [
"MIT"
] | null | null | null | src/Fourteenth Chapter/Exercise2.py | matthijskrul/ThinkPython | 34c1d81f4ef535c32b8b0309b23c7ca37f851606 | [
"MIT"
] | null | null | null | # Adapt the merge algorithm to write each of these functions, as was suggested there:
#
# Return only those items that are present in the first list, but not in the second.
import random
def return_xs_unique(xs, ys):
""" merge sorted lists xs and ys. Return only those items that are present in the first list,
... | 27.901515 | 110 | 0.590551 | # Adapt the merge algorithm to write each of these functions, as was suggested there:
#
# Return only those items that are present in the first list, but not in the second.
import random
def return_xs_unique(xs, ys):
""" merge sorted lists xs and ys. Return only those items that are present in the first list,
... | 0 | 0 | 0 |
053914ae8ca6bed144522d26cba1f2a52c6014f5 | 2,582 | py | Python | EE475/Ch6P13.py | PhoeniXuzoo/NU-Projects | a217ad46e6876ceffb3dec1d6e52f775674b2e8b | [
"MIT"
] | null | null | null | EE475/Ch6P13.py | PhoeniXuzoo/NU-Projects | a217ad46e6876ceffb3dec1d6e52f775674b2e8b | [
"MIT"
] | null | null | null | EE475/Ch6P13.py | PhoeniXuzoo/NU-Projects | a217ad46e6876ceffb3dec1d6e52f775674b2e8b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
## softmax: 0.1 600
## perceptron: 0.05 550
if __name__ == "__main__":
csvname = 'breast_cancer_data.csv'
x, y = readData(csvname)
w = np.ones([x.shape[0] + 1, 1])
x = np.insert(x, 0, values=np.ones([1, x.shape[1]]), axis=0)
xSoftList = [... | 29.011236 | 82 | 0.573199 | import numpy as np
import matplotlib.pyplot as plt
## softmax: 0.1 600
## perceptron: 0.05 550
def readData(csvname):
data = np.loadtxt(csvname, delimiter=',')
x = data[:-1, :]
y = data[-1:, :]
return x, y
def softmaxCostFunc(x, y, w):
cost = np.sum(np.log(1 + np.exp(-y*np.transpose(np.dot(np.t... | 962 | 0 | 115 |
7e5329dd16ac953e5b877329a106639b6061afe2 | 790 | py | Python | build/sources/hashing.py | AlexDev-py/CubIC | 7932d2789c0b45ebc9ce631d21f6bed99d3a3a51 | [
"MIT"
] | 2 | 2022-02-05T13:06:28.000Z | 2022-02-09T07:07:11.000Z | build/sources/hashing.py | AlexDev-py/CubIC | 7932d2789c0b45ebc9ce631d21f6bed99d3a3a51 | [
"MIT"
] | null | null | null | build/sources/hashing.py | AlexDev-py/CubIC | 7932d2789c0b45ebc9ce631d21f6bed99d3a3a51 | [
"MIT"
] | 2 | 2022-01-24T13:42:45.000Z | 2022-02-08T09:18:58.000Z | from __future__ import annotations
import json
import os
from DOM.hashing import get_hash
if __name__ == "__main__":
data_hash = generate_media_hash()[1]
os.system(f"heroku config:set DATA_HASH={data_hash} -a dungeon-of-masters")
| 29.259259 | 80 | 0.665823 | from __future__ import annotations
import json
import os
from DOM.hashing import get_hash
def generate_media_hash() -> tuple[dict, str]:
target_file_path = "resources/files.json"
data = {}
for root, dirs, files in os.walk("resources"):
for file_name in files:
file_path = os.path.join... | 524 | 0 | 23 |
e3a93ecb15d1e58e44a931302a4eb3b5be2d2826 | 7,707 | py | Python | baseline.py | JuliousHurtado/Meta-Iteration | 8edf09510c9c8c300c8ca42472e7e04bfd790938 | [
"MIT"
] | null | null | null | baseline.py | JuliousHurtado/Meta-Iteration | 8edf09510c9c8c300c8ca42472e7e04bfd790938 | [
"MIT"
] | 1 | 2021-09-08T03:25:12.000Z | 2021-09-08T03:25:12.000Z | baseline.py | JuliousHurtado/Meta-Iteration | 8edf09510c9c8c300c8ca42472e7e04bfd790938 | [
"MIT"
] | null | null | null | import torch
import random
import time
import copy
import numpy as np
from torch import nn
from torch import optim
import torchvision
import torchvision.models as models
from model.models import TaskNormalization
from utils import getArguments, getModel
from dataset.multidataset import DatasetGen as multi_cls
from d... | 37.052885 | 169 | 0.638381 | import torch
import random
import time
import copy
import numpy as np
from torch import nn
from torch import optim
import torchvision
import torchvision.models as models
from model.models import TaskNormalization
from utils import getArguments, getModel
from dataset.multidataset import DatasetGen as multi_cls
from d... | 6,480 | 4 | 123 |
7c1a7dba6e42b217dd9b7f0cf169a5d2c7f1ebe5 | 288 | py | Python | pipelineservice/pipeline.py | toandaominh1997/pipelineservice | 2946fc6b61cc73f8695eff03f5d2066e6064ad3f | [
"Apache-2.0"
] | 3 | 2021-02-24T07:42:17.000Z | 2021-08-22T09:32:31.000Z | pipelineservice/pipeline.py | toandaominh1997/pipelineservice | 2946fc6b61cc73f8695eff03f5d2066e6064ad3f | [
"Apache-2.0"
] | null | null | null | pipelineservice/pipeline.py | toandaominh1997/pipelineservice | 2946fc6b61cc73f8695eff03f5d2066e6064ad3f | [
"Apache-2.0"
] | 1 | 2021-08-23T05:31:36.000Z | 2021-08-23T05:31:36.000Z | import numpy as np
import pandas as pd
from sklearn.pipeline import FeatureUnion
| 28.8 | 64 | 0.6875 | import numpy as np
import pandas as pd
from sklearn.pipeline import FeatureUnion
class featureUninon(FeatureUnion):
def _hstack(self, Xs):
cols = [X.columns.tolist() for X in Xs]
cols = np.hstack(cols)
return pd.DataFrame(super()._hstack(Xs), columns = cols)
| 145 | 13 | 49 |
f7ca7c6028d40591dc9877fdad45f3a0e5b3bc15 | 11,922 | py | Python | test.py | MartinNiederl/anki_kanji_auto_fill | e51239dddc5b383d34d9d580294edc2d4dc98caf | [
"MIT"
] | null | null | null | test.py | MartinNiederl/anki_kanji_auto_fill | e51239dddc5b383d34d9d580294edc2d4dc98caf | [
"MIT"
] | null | null | null | test.py | MartinNiederl/anki_kanji_auto_fill | e51239dddc5b383d34d9d580294edc2d4dc98caf | [
"MIT"
] | null | null | null | # coding=utf8
import json
from typing import Dict, List, Set
import unicodedata
print(ord('alibaba'))
ranges = [
# (ord(u"\u3300"), ord(u"\u33ff")), # compatibility ideographs
# (ord(u"\ufe30"), ord(u"\ufe4f")), # compatibility ideographs
# (ord(u"\uf900"), ord(u"\ufaff")), # compatibility ideographs
... | 131.010989 | 1,011 | 0.541184 | # coding=utf8
import json
from typing import Dict, List, Set
import unicodedata
print(ord('alibaba'))
ranges = [
# (ord(u"\u3300"), ord(u"\u33ff")), # compatibility ideographs
# (ord(u"\ufe30"), ord(u"\ufe4f")), # compatibility ideographs
# (ord(u"\uf900"), ord(u"\ufaff")), # compatibility ideographs
... | 62 | 0 | 23 |
511736149de1ed981732f96324cc61206ed6f06e | 9,144 | py | Python | peerdid/core/peer_did_helper.py | andkononykhin/peer-did-python | bc56e7cb685cac15697a4b0c0d5ca0e12bdd1651 | [
"Apache-2.0"
] | null | null | null | peerdid/core/peer_did_helper.py | andkononykhin/peer-did-python | bc56e7cb685cac15697a4b0c0d5ca0e12bdd1651 | [
"Apache-2.0"
] | null | null | null | peerdid/core/peer_did_helper.py | andkononykhin/peer-did-python | bc56e7cb685cac15697a4b0c0d5ca0e12bdd1651 | [
"Apache-2.0"
] | null | null | null | import hashlib
import json
import re
from enum import Enum
from typing import Union, List, Optional
import base58
import varint
from peerdid.core.did_doc import (
VerificationMaterial,
PublicKeyField,
VerificationMaterialTypeAgreement,
VerificationMaterialTypeAuthentication,
JWK_OKP,
)
from peerdi... | 34.768061 | 110 | 0.714895 | import hashlib
import json
import re
from enum import Enum
from typing import Union, List, Optional
import base58
import varint
from peerdid.core.did_doc import (
VerificationMaterial,
PublicKeyField,
VerificationMaterialTypeAgreement,
VerificationMaterialTypeAuthentication,
JWK_OKP,
)
from peerdi... | 1,857 | 97 | 161 |
0d92b5e007c5d6d0f17cf60bdf5989db9053fe6d | 424 | py | Python | examples/pix_create_immediate_charge.py | gerencianet/gn-api-sdk-python | 09664fdcc7b9d99db6265c63b5c0efdfa413acd9 | [
"MIT"
] | 12 | 2016-10-14T15:56:59.000Z | 2021-10-30T01:56:51.000Z | examples/pix_create_immediate_charge.py | gerencianet/gn-api-sdk-python | 09664fdcc7b9d99db6265c63b5c0efdfa413acd9 | [
"MIT"
] | 7 | 2018-12-27T16:30:20.000Z | 2021-06-30T12:26:04.000Z | examples/pix_create_immediate_charge.py | gerencianet/gn-api-sdk-python | 09664fdcc7b9d99db6265c63b5c0efdfa413acd9 | [
"MIT"
] | 13 | 2016-07-13T14:28:47.000Z | 2022-03-16T14:17:40.000Z | from gerencianet import Gerencianet
from credentials import CREDENTIALS
gn = Gerencianet(CREDENTIALS)
body = {
'calendario': {
'expiracao': 3600
},
'devedor': {
'cpf': '',
'nome': ''
},
'valor': {
'original': ''
},
'chave': '',
'solicitacaoPagador': 'Cob... | 18.434783 | 60 | 0.591981 | from gerencianet import Gerencianet
from credentials import CREDENTIALS
gn = Gerencianet(CREDENTIALS)
body = {
'calendario': {
'expiracao': 3600
},
'devedor': {
'cpf': '',
'nome': ''
},
'valor': {
'original': ''
},
'chave': '',
'solicitacaoPagador': 'Cob... | 0 | 0 | 0 |
0b1315f177f51dde7d9757a1fdebf7c77dbae059 | 11,586 | py | Python | utils/rancher_mediator.py | Devwarlt/rancher2md-wrapper | 6a03f2504aad739f5549b6a8346d1bb4f153931d | [
"WTFPL"
] | 1 | 2021-04-29T00:42:29.000Z | 2021-04-29T00:42:29.000Z | utils/rancher_mediator.py | Devwarlt/rancher2md-wrapper | 6a03f2504aad739f5549b6a8346d1bb4f153931d | [
"WTFPL"
] | null | null | null | utils/rancher_mediator.py | Devwarlt/rancher2md-wrapper | 6a03f2504aad739f5549b6a8346d1bb4f153931d | [
"WTFPL"
] | null | null | null | from models.cluster import Cluster
from utils.markdown_mediator import MarkdownMediator
from utils.reload_credentials import ask_for_new_credentials
from utils.input_dialogs import yes_or_no_input_dialog
from extensions.url import format_url
from requests.models import Response
from utils.logger import Log
from config ... | 34.379822 | 88 | 0.529087 | from models.cluster import Cluster
from utils.markdown_mediator import MarkdownMediator
from utils.reload_credentials import ask_for_new_credentials
from utils.input_dialogs import yes_or_no_input_dialog
from extensions.url import format_url
from requests.models import Response
from utils.logger import Log
from config ... | 10,586 | 567 | 23 |
b76ad00900f8bb10caece4bf2ce27d9be5f5f1f5 | 1,070 | py | Python | SumarySearch/views.py | reetikaSR/summarySearch | c1de931c11d9dd755ba461742009a0d9d14ab08a | [
"MIT"
] | null | null | null | SumarySearch/views.py | reetikaSR/summarySearch | c1de931c11d9dd755ba461742009a0d9d14ab08a | [
"MIT"
] | null | null | null | SumarySearch/views.py | reetikaSR/summarySearch | c1de931c11d9dd755ba461742009a0d9d14ab08a | [
"MIT"
] | null | null | null | from django.views.decorators.csrf import csrf_exempt
from rest_framework.decorators import api_view
from rest_framework.response import Response
from SumarySearch.compute_match import match
from .serializers import BookSerializer
from django.http import HttpResponseBadRequest
@api_view(['POST'])
@csrf_exempt
def sear... | 32.424242 | 117 | 0.734579 | from django.views.decorators.csrf import csrf_exempt
from rest_framework.decorators import api_view
from rest_framework.response import Response
from SumarySearch.compute_match import match
from .serializers import BookSerializer
from django.http import HttpResponseBadRequest
@api_view(['POST'])
@csrf_exempt
def sear... | 0 | 0 | 0 |
399518ebae7320b7a8368861e51010b913d3a1aa | 2,239 | py | Python | SpectrometersV2/example_code.py | ColdMatter/PhotonBEC | c6bcf9bdefd267c8adde0d299cf5920b010c5022 | [
"MIT"
] | null | null | null | SpectrometersV2/example_code.py | ColdMatter/PhotonBEC | c6bcf9bdefd267c8adde0d299cf5920b010c5022 | [
"MIT"
] | null | null | null | SpectrometersV2/example_code.py | ColdMatter/PhotonBEC | c6bcf9bdefd267c8adde0d299cf5920b010c5022 | [
"MIT"
] | null | null | null | '''
Written by: Joao Rodrigues
Last Update: October 16th 2020
'''
import sys
from socket import gethostname
if gethostname().lower() == "ph-photonbec5":
sys.path.append("D:/Control/PythonPackages/")
import pbec_ipc
from time import sleep
from time import time
import matplotlib.pyplot as plt
from single_spec_IP... | 38.603448 | 186 | 0.820456 | '''
Written by: Joao Rodrigues
Last Update: October 16th 2020
'''
import sys
from socket import gethostname
if gethostname().lower() == "ph-photonbec5":
sys.path.append("D:/Control/PythonPackages/")
import pbec_ipc
from time import sleep
from time import time
import matplotlib.pyplot as plt
from single_spec_IP... | 0 | 0 | 0 |
8c62dfc48c7e80068f446336243ac76e72e649be | 2,293 | py | Python | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/cameras/apps.py | julialieberman/azure-intelligent-edge-patterns | 1e04748d640730301edd2c6fb51a02f9b6d2ff41 | [
"MIT"
] | 1 | 2020-08-17T16:50:09.000Z | 2020-08-17T16:50:09.000Z | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/cameras/apps.py | julialieberman/azure-intelligent-edge-patterns | 1e04748d640730301edd2c6fb51a02f9b6d2ff41 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/cameras/apps.py | julialieberman/azure-intelligent-edge-patterns | 1e04748d640730301edd2c6fb51a02f9b6d2ff41 | [
"MIT"
] | null | null | null | """
Cameras App
"""
import logging
import sys
from django.apps import AppConfig
logger = logging.getLogger(__name__)
DEFAULT_SETTING_NAME = 'DEFAULT_SETTING'
class CamerasConfig(AppConfig):
"""
Cameras App Config
"""
name = 'vision_on_edge.cameras'
def ready(self):
"""
Cameras ... | 29.779221 | 71 | 0.411688 | """
Cameras App
"""
import logging
import sys
from django.apps import AppConfig
logger = logging.getLogger(__name__)
DEFAULT_SETTING_NAME = 'DEFAULT_SETTING'
class CamerasConfig(AppConfig):
"""
Cameras App Config
"""
name = 'vision_on_edge.cameras'
def ready(self):
"""
Cameras ... | 0 | 0 | 0 |
72c67ce90edfb7400c6369cd615fde79fc8633f1 | 14,247 | py | Python | collaborative_system/temperature_scaling_vit.py | drunkcoding/efficient-nlp | 9509e0ef08016506280a7cfc600ea8e3778dea2d | [
"Apache-2.0"
] | null | null | null | collaborative_system/temperature_scaling_vit.py | drunkcoding/efficient-nlp | 9509e0ef08016506280a7cfc600ea8e3778dea2d | [
"Apache-2.0"
] | null | null | null | collaborative_system/temperature_scaling_vit.py | drunkcoding/efficient-nlp | 9509e0ef08016506280a7cfc600ea8e3778dea2d | [
"Apache-2.0"
] | null | null | null | import torch
import logging
import numpy as np
from outliers import smirnov_grubbs as grubbs
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from torch.utils.data.sampler import SubsetRandomSampler
from torchvision import datasets, transforms
import torchvision.models as cv_models
import os
imp... | 37.492105 | 209 | 0.639082 | import torch
import logging
import numpy as np
from outliers import smirnov_grubbs as grubbs
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from torch.utils.data.sampler import SubsetRandomSampler
from torchvision import datasets, transforms
import torchvision.models as cv_models
import os
imp... | 2,124 | 0 | 68 |
bfc3bd37a4aa95cb8512234de7cfe550577160db | 1,136 | py | Python | setup.py | shufps/pdfforms | 9e6eb9c63ab5c743580805942747a5445e79e9c7 | [
"MIT"
] | 1 | 2020-07-03T19:26:40.000Z | 2020-07-03T19:26:40.000Z | setup.py | shufps/pdfforms | 9e6eb9c63ab5c743580805942747a5445e79e9c7 | [
"MIT"
] | null | null | null | setup.py | shufps/pdfforms | 9e6eb9c63ab5c743580805942747a5445e79e9c7 | [
"MIT"
] | null | null | null | from os.path import join, dirname
from setuptools import setup
package_name = "pdfforms"
package_version = "1.2.1"
base_dir = dirname(__file__)
setup(
name = package_name,
version = package_version,
description = "Populate fillable pdf forms from csv data file",
long_description = read("README.rst") +... | 32.457143 | 76 | 0.636444 | from os.path import join, dirname
from setuptools import setup
package_name = "pdfforms"
package_version = "1.2.1"
base_dir = dirname(__file__)
def read(filename):
f = open(join(base_dir, filename))
return f.read()
setup(
name = package_name,
version = package_version,
description = "Populate fil... | 57 | 0 | 23 |
16e99ac5970e25e2230ef1f24565fa74e8d93890 | 31,772 | py | Python | libs/itsdangerous.py | bbondy/brianbondy.gae | 5c189e5d8f1ee0fdc77ab48c21f3da2c9e3f246c | [
"MIT"
] | null | null | null | libs/itsdangerous.py | bbondy/brianbondy.gae | 5c189e5d8f1ee0fdc77ab48c21f3da2c9e3f246c | [
"MIT"
] | null | null | null | libs/itsdangerous.py | bbondy/brianbondy.gae | 5c189e5d8f1ee0fdc77ab48c21f3da2c9e3f246c | [
"MIT"
] | 1 | 2020-10-01T16:36:12.000Z | 2020-10-01T16:36:12.000Z | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... | 36.51954 | 81 | 0.647237 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... | 8,632 | 0 | 855 |
9a937dba4abe57172578dec1a722bd3633ce7c2d | 3,583 | py | Python | events.py | IanHarvey/bluepy.device | be3f5802b7229ce50876bd4bb68b958586731d1b | [
"MIT"
] | 10 | 2017-09-29T00:18:21.000Z | 2022-01-27T09:03:29.000Z | events.py | IanHarvey/bluepy.device | be3f5802b7229ce50876bd4bb68b958586731d1b | [
"MIT"
] | 2 | 2017-09-11T11:07:35.000Z | 2019-04-19T11:02:00.000Z | events.py | IanHarvey/bluepy.device | be3f5802b7229ce50876bd4bb68b958586731d1b | [
"MIT"
] | 5 | 2017-10-10T18:01:02.000Z | 2021-05-24T07:36:52.000Z | import struct
import binascii
import gap
# HCI Events
# Spec V4.0, Vol 2, sec 7.7
E_DISCONN_COMPLETE = 0x05
E_ENCRYPT_CHANGE = 0x08
E_CMD_RESPONSE = 0x0E
E_CMD_STATUS = 0x0F
E_LE_META_EVENT = 0x3E
# LE Meta-event subcodes
# Vol 2, 7.7.65
E_LE_CONN_COMPLETE = 0x01
E_LE_ADVERTISING_REPORT = 0x02
E_LE_CONN_UPDATE_COMP... | 33.801887 | 117 | 0.6235 | import struct
import binascii
import gap
# HCI Events
# Spec V4.0, Vol 2, sec 7.7
E_DISCONN_COMPLETE = 0x05
E_ENCRYPT_CHANGE = 0x08
E_CMD_RESPONSE = 0x0E
E_CMD_STATUS = 0x0F
E_LE_META_EVENT = 0x3E
# LE Meta-event subcodes
# Vol 2, 7.7.65
E_LE_CONN_COMPLETE = 0x01
E_LE_ADVERTISING_REPORT = 0x02
E_LE_CONN_UPDATE_COMP... | 2,553 | 1 | 337 |
72645c0f047f889967cb8ede55344c574ef90c92 | 668 | py | Python | harvest-images.py | BinaryDragonStudios/ArenaGame | 0162568b64599a9fccab64e3cd08d8295885b32c | [
"MIT"
] | null | null | null | harvest-images.py | BinaryDragonStudios/ArenaGame | 0162568b64599a9fccab64e3cd08d8295885b32c | [
"MIT"
] | null | null | null | harvest-images.py | BinaryDragonStudios/ArenaGame | 0162568b64599a9fccab64e3cd08d8295885b32c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Use the built in json and sqlite library
import sqlite3
# Boilerplate python
if __name__ == '__main__':
main()
| 27.833333 | 98 | 0.652695 | #!/usr/bin/env python
# Use the built in json and sqlite library
import sqlite3
def card_image_url(card_game_id):
return "http://wow.zamimg.com/images/hearthstone/cards/enus/original/" + card_game_id + ".png"
def main():
sql = "SELECT card_game_id, card_name_en FROM cards ORDER BY card_name_en"
db = sql... | 481 | 0 | 46 |
47d5d5adce279fd60bc35ef87afa6132fa4ea625 | 6,124 | py | Python | binmom.py | isseikz/StarTracker | 01c1dfcf8c9a6886acfa18c038acc723f56cc94d | [
"MIT"
] | null | null | null | binmom.py | isseikz/StarTracker | 01c1dfcf8c9a6886acfa18c038acc723f56cc94d | [
"MIT"
] | null | null | null | binmom.py | isseikz/StarTracker | 01c1dfcf8c9a6886acfa18c038acc723f56cc94d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""画像の2値化(binalize)とモーメント中心を見つけるモジュール."""
import numpy as np
import cv2
from matplotlib import pyplot as plt
def binalize(img):
"""画像の2値化を行う.
1. 画像をグレースケールに変換
2. しきい値[0, 255]を基準に2値化する
# 入力:
+ img: cv2 モジュールで読み込んだ画像オブジェクト
# 出力:
+ img_binalized:... | 24.594378 | 183 | 0.566786 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""画像の2値化(binalize)とモーメント中心を見つけるモジュール."""
import numpy as np
import cv2
from matplotlib import pyplot as plt
def binalize(img):
"""画像の2値化を行う.
1. 画像をグレースケールに変換
2. しきい値[0, 255]を基準に2値化する
# 入力:
+ img: cv2 モジュールで読み込んだ画像オブジェクト
# 出力:
+ img_binalized:... | 0 | 0 | 0 |
50b35723f20fea2aeacd0fff6f501a16b7939d1c | 237 | py | Python | tests/parser/bug.70.bk.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/bug.70.bk.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/bug.70.bk.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
% Locations:
loc(dropOff).
loc(distCenter).
loc(truck).
%loc(dest).
% Packages:
pkg(pidVar).
"""
output = """
% Locations:
loc(dropOff).
loc(distCenter).
loc(truck).
%loc(dest).
% Packages:
pkg(pidVar).
"""
| 11.285714 | 17 | 0.586498 | input = """
% Locations:
loc(dropOff).
loc(distCenter).
loc(truck).
%loc(dest).
% Packages:
pkg(pidVar).
"""
output = """
% Locations:
loc(dropOff).
loc(distCenter).
loc(truck).
%loc(dest).
% Packages:
pkg(pidVar).
"""
| 0 | 0 | 0 |
dd0e5f1f8170f9a8b0f7092a2ceddf95c3c34a1c | 2,436 | py | Python | analyze/generate_periscope_chart_embed_code.py | danieldiamond/gitlab-analytics | f99e02c95c3a964b01cb14617a43cd5f64ecd88d | [
"MIT"
] | 3 | 2021-07-22T06:44:31.000Z | 2022-01-29T05:35:12.000Z | analyze/generate_periscope_chart_embed_code.py | danieldiamond/gitlab-analytics | f99e02c95c3a964b01cb14617a43cd5f64ecd88d | [
"MIT"
] | null | null | null | analyze/generate_periscope_chart_embed_code.py | danieldiamond/gitlab-analytics | f99e02c95c3a964b01cb14617a43cd5f64ecd88d | [
"MIT"
] | null | null | null | from os import environ as env
from urllib import parse as parse
import ast
import base64
import csv
import hashlib
import hmac
import json
import logging
API_KEY = env.get("PERISCOPE_API_KEY").encode("UTF-8")
input_csv = "chart_slide_deck.csv"
output_csv = "chart_links.csv"
if __name__ == "__main__":
logging.b... | 29.707317 | 80 | 0.65312 | from os import environ as env
from urllib import parse as parse
import ast
import base64
import csv
import hashlib
import hmac
import json
import logging
API_KEY = env.get("PERISCOPE_API_KEY").encode("UTF-8")
input_csv = "chart_slide_deck.csv"
output_csv = "chart_links.csv"
def csv_to_chart_list(input_csv):
logg... | 1,897 | 0 | 46 |
1bdc339c76d8e57fa714efafdde1b7083a06d571 | 763 | py | Python | Algos and notebooks/testMapWay.py | HehexOne/MapWay | 714889ca97d4199a4cb9f66403fac5c45d791297 | [
"MIT"
] | 1 | 2021-10-18T15:46:27.000Z | 2021-10-18T15:46:27.000Z | Algos and notebooks/testMapWay.py | HehexOne/MapWay | 714889ca97d4199a4cb9f66403fac5c45d791297 | [
"MIT"
] | null | null | null | Algos and notebooks/testMapWay.py | HehexOne/MapWay | 714889ca97d4199a4cb9f66403fac5c45d791297 | [
"MIT"
] | null | null | null | from MapWay import *
start = Place(name="Start", position=Position(latitude=20, longtitude=2))
'''
Уже точки не нужны, они в базе данных
'''
# p_in_1 = Place(name="p_in_1", position=Position(latitude=10, longtitude=50))
# p_in_2 = Place(name="p_in_2", position=Position(latitude=18, longtitude=70))
# p_out_1 = P... | 29.346154 | 82 | 0.722149 | from MapWay import *
start = Place(name="Start", position=Position(latitude=20, longtitude=2))
'''
Уже точки не нужны, они в базе данных
'''
# p_in_1 = Place(name="p_in_1", position=Position(latitude=10, longtitude=50))
# p_in_2 = Place(name="p_in_2", position=Position(latitude=18, longtitude=70))
# p_out_1 = P... | 0 | 0 | 0 |
f31378e6416b9e96d2caa400aa67a2a90f629978 | 1,796 | py | Python | main/mnist.py | yanMichellod/MNIST | d789e73295ce045c1b358efa1c6df26a8570b721 | [
"MIT"
] | null | null | null | main/mnist.py | yanMichellod/MNIST | d789e73295ce045c1b358efa1c6df26a8570b721 | [
"MIT"
] | null | null | null | main/mnist.py | yanMichellod/MNIST | d789e73295ce045c1b358efa1c6df26a8570b721 | [
"MIT"
] | null | null | null | import argparse
import sys
| 28.0625 | 88 | 0.554566 | import argparse
import sys
def main(args=None):
if not args:
args = sys.argv[1:]
example_doc = """\
examples:
1. Runs the full analysis with the whole MNIST dataset:
$ mnist --full=True
2. Only runs for a subset of MNIST dataset (f.e. for quick test):
$ mnist.py
or
... | 1,745 | 0 | 23 |
8826ed8824a2aa17e3bb3cde009518af14b96186 | 3,701 | py | Python | businessdate/businessrange.py | pbrisk/businessdate | 36eb9df687f7f3a30d659f356f16a05d5f41b309 | [
"Apache-2.0"
] | 2 | 2019-07-30T13:07:00.000Z | 2021-05-26T02:19:09.000Z | businessdate/businessrange.py | sonntagsgesicht/businessdate | 36eb9df687f7f3a30d659f356f16a05d5f41b309 | [
"Apache-2.0"
] | 2 | 2019-05-14T16:06:54.000Z | 2019-07-27T23:14:29.000Z | businessdate/businessrange.py | pbrisk/businessdate | 36eb9df687f7f3a30d659f356f16a05d5f41b309 | [
"Apache-2.0"
] | 7 | 2017-04-10T13:19:47.000Z | 2019-07-06T03:48:49.000Z | # -*- coding: utf-8 -*-
# businessdate
# ------------
# Python library for generating business dates for fast date operations
# and rich functionality.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.5, copyright Wednesday, 18 September 2019
# Website: https://github.com/son... | 35.586538 | 101 | 0.627398 | # -*- coding: utf-8 -*-
# businessdate
# ------------
# Python library for generating business dates for fast date operations
# and rich functionality.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.5, copyright Wednesday, 18 September 2019
# Website: https://github.com/son... | 1,202 | 1,995 | 23 |
a59182a74a30e5559913ac544809d405eb2da6c4 | 142 | py | Python | messages/models.py | ntdai95/AuctionWebsite | ed1e4c779c9ba27fd26956756b5bd80a47fb44c5 | [
"MIT"
] | 1 | 2022-01-24T07:46:47.000Z | 2022-01-24T07:46:47.000Z | messages/models.py | ntdai95/AuctionWebsite | ed1e4c779c9ba27fd26956756b5bd80a47fb44c5 | [
"MIT"
] | null | null | null | messages/models.py | ntdai95/AuctionWebsite | ed1e4c779c9ba27fd26956756b5bd80a47fb44c5 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
| 17.75 | 31 | 0.711268 | from pydantic import BaseModel
class Message(BaseModel):
message_id: int = None
sending_user_id: int = None
message: str = None
| 0 | 87 | 23 |
670546ec050434d9276a8108386da84f83c5dc42 | 180 | py | Python | codigo_programa/database.py | matheusparrela/Fisica_game | 7c6e1607c4786f1fa76f6be9abe51c0279754926 | [
"MIT"
] | 1 | 2022-02-06T18:33:50.000Z | 2022-02-06T18:33:50.000Z | codigo_programa/database.py | matheusparrela/Fisica_game | 7c6e1607c4786f1fa76f6be9abe51c0279754926 | [
"MIT"
] | null | null | null | codigo_programa/database.py | matheusparrela/Fisica_game | 7c6e1607c4786f1fa76f6be9abe51c0279754926 | [
"MIT"
] | null | null | null | import pyodbc
dados_conexao = (
"Driver={SQL Server};"
"Server=omicron;"
"Database=perguntas;"
)
conexao = pyodbc.connect(dados_conexao)
print('Conexão bem sucedida!') | 20 | 39 | 0.7 | import pyodbc
dados_conexao = (
"Driver={SQL Server};"
"Server=omicron;"
"Database=perguntas;"
)
conexao = pyodbc.connect(dados_conexao)
print('Conexão bem sucedida!') | 0 | 0 | 0 |
ed10a413930f081fc45944e232c2b7b86a1eac17 | 828 | py | Python | visualization/model_report.py | mahetoodang/abm | b27c0616aed288902d2f28444c79cf0720513249 | [
"MIT"
] | null | null | null | visualization/model_report.py | mahetoodang/abm | b27c0616aed288902d2f28444c79cf0720513249 | [
"MIT"
] | null | null | null | visualization/model_report.py | mahetoodang/abm | b27c0616aed288902d2f28444c79cf0720513249 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import webbrowser
import os
import glob
from pandas_profiling import ProfileReport
'''Automated generation of HTML data report to
be opened inside webbrowser'''
if __name__ == '__main__':
create_model_report(True)
| 30.666667 | 61 | 0.695652 | import pandas as pd
import numpy as np
import webbrowser
import os
import glob
from pandas_profiling import ProfileReport
'''Automated generation of HTML data report to
be opened inside webbrowser'''
def create_model_report(html_report=True):
if html_report == True:
file_list = glob.glob('data/stats/*')
... | 546 | 0 | 23 |
aeb73f304dad48bc29e2b1b63872e0a6a6e6411c | 870 | py | Python | software/redis.py | kylebush/bigdata-deploy | e52c4bc5f136802b69bec18d151b0c5d7f7af837 | [
"Apache-2.0"
] | 2 | 2017-01-08T17:17:59.000Z | 2017-07-18T12:14:11.000Z | software/redis.py | kylebush/bigdata-tools | e52c4bc5f136802b69bec18d151b0c5d7f7af837 | [
"Apache-2.0"
] | null | null | null | software/redis.py | kylebush/bigdata-tools | e52c4bc5f136802b69bec18d151b0c5d7f7af837 | [
"Apache-2.0"
] | null | null | null | import os
from fabric.api import env, sudo, put
import helper
from bootstrap import machine
| 33.461538 | 83 | 0.734483 | import os
from fabric.api import env, sudo, put
import helper
from bootstrap import machine
def install(host_config):
env.host_string = helper.get_env_host_string(host_config)
env.user = helper.get_env_user(host_config)
env.key_filename = helper.get_env_key_filename(host_config)
software_config = h... | 752 | 0 | 23 |
135ec19a63db6b926dd484003d11d8f4d8f345e4 | 492 | py | Python | FizzBuzz/tests/test.py | n0n0a/python-dev-tutorial | 565e2eaaaf4b8777295b83f8d8de425fe9f22bca | [
"MIT"
] | null | null | null | FizzBuzz/tests/test.py | n0n0a/python-dev-tutorial | 565e2eaaaf4b8777295b83f8d8de425fe9f22bca | [
"MIT"
] | null | null | null | FizzBuzz/tests/test.py | n0n0a/python-dev-tutorial | 565e2eaaaf4b8777295b83f8d8de425fe9f22bca | [
"MIT"
] | null | null | null | from unittest import TestCase
import pytest
from FizzBuzz.fizzbuzz import fizzbuzz
fizzbuzz_data = [(3, "Fizz"), (5, "Buzz"), (15, "FizzBuzz"), (2, "2")]
fizzbuzz_7_11_data = [(7,"Fizz"),(11,"Buzz"),(77,"FizzBuzz"), (2, "2")]
@pytest.mark.parametrize(('n','expected'),fizzbuzz_data)
@pytest.mark.parametrize(('n','exp... | 32.8 | 71 | 0.697154 | from unittest import TestCase
import pytest
from FizzBuzz.fizzbuzz import fizzbuzz
fizzbuzz_data = [(3, "Fizz"), (5, "Buzz"), (15, "FizzBuzz"), (2, "2")]
fizzbuzz_7_11_data = [(7,"Fizz"),(11,"Buzz"),(77,"FizzBuzz"), (2, "2")]
@pytest.mark.parametrize(('n','expected'),fizzbuzz_data)
def test_fizzbuzz(n,expected):
... | 100 | 0 | 44 |
dbd24433096ce21f12bbf4d0bf81b1a43cc47d60 | 1,172 | py | Python | applied_python/applied_python/lib/python2.7/site-packages/ncclient/devices/iosxe.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/ncclient/devices/iosxe.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/ncclient/devices/iosxe.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | """
Handler for Cisco IOS-XE device specific information.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Nexus", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic information... | 27.904762 | 87 | 0.715017 | """
Handler for Cisco IOS-XE device specific information.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Nexus", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic information... | 494 | 0 | 138 |
0b75ad5a395e43a103ee317b5d794d2aa4f68b3a | 525 | py | Python | automation.py | FathiMahdi/TNB_Social_Distance | ab5c13652e57d827180b92e03983cda39def51e8 | [
"MIT"
] | null | null | null | automation.py | FathiMahdi/TNB_Social_Distance | ab5c13652e57d827180b92e03983cda39def51e8 | [
"MIT"
] | null | null | null | automation.py | FathiMahdi/TNB_Social_Distance | ab5c13652e57d827180b92e03983cda39def51e8 | [
"MIT"
] | null | null | null | import os
import time
from cctv import *
for i in range(0,10000000000):
cctvDetect(i)# run cctv
time.sleep(2)
os.system('sudo python3 darknet_images.py --input /mnt/k/monitoring/204online_{}.png --batch_size 1 --weights /home/Social_Distance/darknet/backup/yolo-obj_last.weights --config_file /home/Social_... | 40.384615 | 314 | 0.731429 | import os
import time
from cctv import *
for i in range(0,10000000000):
cctvDetect(i)# run cctv
time.sleep(2)
os.system('sudo python3 darknet_images.py --input /mnt/k/monitoring/204online_{}.png --batch_size 1 --weights /home/Social_Distance/darknet/backup/yolo-obj_last.weights --config_file /home/Social_... | 0 | 0 | 0 |
5b106466dafaf888a5489b6369524357186de3c6 | 926 | py | Python | accounts/migrations/0021_auto_20210902_2010.py | simplymarco/Sistema-de-Controle-de-Processos-Titulados | f4e3bc7260611b848096d5fbfb1f72be9d440f1f | [
"MIT"
] | null | null | null | accounts/migrations/0021_auto_20210902_2010.py | simplymarco/Sistema-de-Controle-de-Processos-Titulados | f4e3bc7260611b848096d5fbfb1f72be9d440f1f | [
"MIT"
] | null | null | null | accounts/migrations/0021_auto_20210902_2010.py | simplymarco/Sistema-de-Controle-de-Processos-Titulados | f4e3bc7260611b848096d5fbfb1f72be9d440f1f | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2021-09-02 23:10
from django.db import migrations, models
| 30.866667 | 114 | 0.564795 | # Generated by Django 3.0 on 2021-09-02 23:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0020_auto_20210902_1708'),
]
operations = [
migrations.CreateModel(
name='Feedback',
fields=[
... | 0 | 814 | 23 |
f244d9daab59011f48024a89527c2f4f9c8108e1 | 4,836 | py | Python | flaskr/fetch_data.py | Amoghrd/StockPrediction | e33a2ec2209f24089b2b92739b82ec05414aa853 | [
"MIT"
] | 1 | 2020-10-27T03:31:29.000Z | 2020-10-27T03:31:29.000Z | flaskr/fetch_data.py | Amoghrd/StockPrediction | e33a2ec2209f24089b2b92739b82ec05414aa853 | [
"MIT"
] | 32 | 2020-10-06T01:34:09.000Z | 2020-11-17T01:31:30.000Z | flaskr/fetch_data.py | Amoghrd/StockPrediction | e33a2ec2209f24089b2b92739b82ec05414aa853 | [
"MIT"
] | 4 | 2020-10-19T20:10:49.000Z | 2020-12-12T15:31:44.000Z | import yfinance as yf
import matplotlib.pyplot as plt
import datetime
import math
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from sklearn.linear_model import LinearRegression
import csv
# Calculate slopes
| 33.351724 | 88 | 0.552316 | import yfinance as yf
import matplotlib.pyplot as plt
import datetime
import math
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from sklearn.linear_model import LinearRegression
import csv
def get_stock(ticker_name, days_number):
tick = yf.Ti... | 4,450 | 0 | 98 |
5ef3cbc4d43ee2bda16eaf11d41a36fef771729f | 3,917 | py | Python | python/fedml/simulation/mpi_p2p_mp/fedavg_robust/FedAvgRobustServerManager.py | NCLPhD/FedML | ffa15262ee963b9c856f34f0b2202f4dfeb3a76b | [
"Apache-2.0"
] | null | null | null | python/fedml/simulation/mpi_p2p_mp/fedavg_robust/FedAvgRobustServerManager.py | NCLPhD/FedML | ffa15262ee963b9c856f34f0b2202f4dfeb3a76b | [
"Apache-2.0"
] | null | null | null | python/fedml/simulation/mpi_p2p_mp/fedavg_robust/FedAvgRobustServerManager.py | NCLPhD/FedML | ffa15262ee963b9c856f34f0b2202f4dfeb3a76b | [
"Apache-2.0"
] | null | null | null | import logging
from .message_define import MyMessage
from .utils import transform_tensor_to_list
from ....core.distributed.communication.message import Message
from ....core.distributed.server.server_manager import ServerManager
| 39.969388 | 87 | 0.6699 | import logging
from .message_define import MyMessage
from .utils import transform_tensor_to_list
from ....core.distributed.communication.message import Message
from ....core.distributed.server.server_manager import ServerManager
class FedAvgRobustServerManager(ServerManager):
def __init__(self, args, aggregator,... | 3,449 | 26 | 211 |
b43155c65d83fd218975e62f7dc9a96ea5bcb480 | 1,355 | py | Python | ptsites/sites/1ptba.py | synthpop123/flexget_qbittorrent_mod | f8beea6bac3f07f25dfe10607117ef8068a935f2 | [
"MIT"
] | 202 | 2020-01-24T05:27:18.000Z | 2021-06-22T09:31:54.000Z | ptsites/sites/1ptba.py | synthpop123/flexget_qbittorrent_mod | f8beea6bac3f07f25dfe10607117ef8068a935f2 | [
"MIT"
] | 16 | 2021-08-01T10:08:23.000Z | 2022-02-04T04:18:08.000Z | ptsites/sites/1ptba.py | synthpop123/flexget_qbittorrent_mod | f8beea6bac3f07f25dfe10607117ef8068a935f2 | [
"MIT"
] | 62 | 2020-01-24T05:27:24.000Z | 2021-06-16T04:46:22.000Z | import re
from urllib.parse import urljoin
from ..schema.nexusphp import AttendanceHR
from ..schema.site_base import Work, SignState
| 33.875 | 93 | 0.539483 | import re
from urllib.parse import urljoin
from ..schema.nexusphp import AttendanceHR
from ..schema.site_base import Work, SignState
class MainClass(AttendanceHR):
URL = 'https://1ptba.com/'
USER_CLASSES = {
'downloaded': [805306368000, 3298534883328],
'share_ratio': [3.05, 4.55],
'da... | 1,141 | 238 | 23 |
97a137d77b023df62ea751088239bb68dcf34480 | 1,282 | py | Python | api/controllers/trace_controller.py | bailobah/relevanc | 1bb9bf895ca1b7bdc0553267c377f53472990d9b | [
"MIT"
] | null | null | null | api/controllers/trace_controller.py | bailobah/relevanc | 1bb9bf895ca1b7bdc0553267c377f53472990d9b | [
"MIT"
] | null | null | null | api/controllers/trace_controller.py | bailobah/relevanc | 1bb9bf895ca1b7bdc0553267c377f53472990d9b | [
"MIT"
] | null | null | null | import datetime
from flask import request
from flask_restplus import Resource
from flask_restplus import abort
from sqlalchemy.orm import load_only
from logger import Logger
from api.serilizers import dataset_response_succes, get_trace
from api.restplus import api
from database.models import TbTrace
log = Logger.log
... | 23.309091 | 118 | 0.730109 | import datetime
from flask import request
from flask_restplus import Resource
from flask_restplus import abort
from sqlalchemy.orm import load_only
from logger import Logger
from api.serilizers import dataset_response_succes, get_trace
from api.restplus import api
from database.models import TbTrace
log = Logger.log
... | 0 | 422 | 22 |
3934659f21a9d149a3c887921ac80207b3058b4e | 3,058 | py | Python | android-runner/AndroidRunner/Plugins/perfume_js/AddJS.py | S2-group/Lacuna-evaluation | b982d54a7cb65050f1743d0a514ebcabce01f23c | [
"MIT"
] | null | null | null | android-runner/AndroidRunner/Plugins/perfume_js/AddJS.py | S2-group/Lacuna-evaluation | b982d54a7cb65050f1743d0a514ebcabce01f23c | [
"MIT"
] | null | null | null | android-runner/AndroidRunner/Plugins/perfume_js/AddJS.py | S2-group/Lacuna-evaluation | b982d54a7cb65050f1743d0a514ebcabce01f23c | [
"MIT"
] | 1 | 2021-07-23T10:41:10.000Z | 2021-07-23T10:41:10.000Z | import os, sys
import subprocess
from distutils.dir_util import copy_tree
from bs4 import BeautifulSoup
if __name__ == '__main__':
#USAGE: (python3 AddJS.py path/To/Directory/With/All/WebApplication/ IPADRRESS)
#NOTE: IPADDRESS should be in the form of http://IP:8080/ and IP is the ip address
add_js(s... | 51.830508 | 677 | 0.599411 | import os, sys
import subprocess
from distutils.dir_util import copy_tree
from bs4 import BeautifulSoup
def bfs_dirs(root):
paths = [root]
while len(paths) > 0:
children = []
for parent in paths:
if parent.endswith(".gitignore"):
continue
... | 2,662 | 0 | 50 |
d207293da2f82b7baf5c06a2e00d92a54a8cf4dd | 1,879 | py | Python | las_test.py | paceholder/pylasdev | d63701d02d3a5f59de7f3ff33804d2f421f49402 | [
"BSD-3-Clause"
] | 2 | 2017-01-05T13:27:30.000Z | 2018-03-26T11:49:28.000Z | las_test.py | paceholder/pylasdev | d63701d02d3a5f59de7f3ff33804d2f421f49402 | [
"BSD-3-Clause"
] | null | null | null | las_test.py | paceholder/pylasdev | d63701d02d3a5f59de7f3ff33804d2f421f49402 | [
"BSD-3-Clause"
] | null | null | null | from pylasdev import *
#from mnem_base import *
# Simple test with full LAS output for LAS reader
test_files = [
# LAS 1.2
"test_data/sample.las", # 0 - OK
"test_data/sample_minimal.las", # 1 - OK
"test_data/sample_wrapped.las", # 2 - OK
"test_data/sample_curve_api.las", # 3 - OK
# "test_dat... | 24.402597 | 75 | 0.624268 | from pylasdev import *
#from mnem_base import *
# Simple test with full LAS output for LAS reader
test_files = [
# LAS 1.2
"test_data/sample.las", # 0 - OK
"test_data/sample_minimal.las", # 1 - OK
"test_data/sample_wrapped.las", # 2 - OK
"test_data/sample_curve_api.las", # 3 - OK
# "test_dat... | 0 | 0 | 0 |
b1666e2f97dc00556483a7e6a3be95c2b359059f | 6,873 | py | Python | Playable/full builds/0.1 movement build/Corak/Main_menu.py | LinearHaru/Corak | 269f827131cbdaf15e6cd81bee792fbb6b9c7606 | [
"MIT"
] | null | null | null | Playable/full builds/0.1 movement build/Corak/Main_menu.py | LinearHaru/Corak | 269f827131cbdaf15e6cd81bee792fbb6b9c7606 | [
"MIT"
] | null | null | null | Playable/full builds/0.1 movement build/Corak/Main_menu.py | LinearHaru/Corak | 269f827131cbdaf15e6cd81bee792fbb6b9c7606 | [
"MIT"
] | null | null | null | import pygame
from Corak.dicio import *
from Corak.mapread4 import mapread
screen = pygame.display.set_mode((ScreenX, ScreenY))
txt = "LRUDhallX.txt"
sala = openSala(txt)
tiles = mapread(sala)
tiles2 = pygame.sprite.Group()
size = getSize(sala)
offsets = getOffset(sala, size)
player1 = Corak()
print(tiles)
left =... | 29.753247 | 131 | 0.474465 | import pygame
from Corak.dicio import *
from Corak.mapread4 import mapread
class Corak(pygame.sprite.Sprite):
def __init__(self):
self.image = pygame.Surface([size, size])
self.image.fill(BLACK)
self.rect = self.image.get_rect()
self.at = [1, 11]
self.pos = [size * self.at[0... | 3,892 | 13 | 238 |
9ae35fd2f861db90faa296b2c3cb168bd8403548 | 6,842 | py | Python | RasPi_Dev/ros_ws/build/vslam/rtabmap_ros/catkin_generated/pkg.installspace.context.pc.py | QianheYu/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T03:31:15.000Z | 2022-03-11T03:31:15.000Z | RasPi_Dev/ros_ws/build/vslam/rtabmap_ros/catkin_generated/pkg.installspace.context.pc.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | RasPi_Dev/ros_ws/build/vslam/rtabmap_ros/catkin_generated/pkg.installspace.context.pc.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/xtark/ros_ws/install/include;/home/xtark/ros_ws/devel/lib/rtabmap-0.19/../../include/rtabmap-0.19;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv".split... | 760.222222 | 5,828 | 0.80152 | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/xtark/ros_ws/install/include;/home/xtark/ros_ws/devel/lib/rtabmap-0.19/../../include/rtabmap-0.19;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv".split... | 0 | 0 | 0 |
8a0630d38ab753c8a6ada60da69a9057613b5bc6 | 5,469 | py | Python | rbac/acl.py | eldorplus/simple-rbac | c7ca8ce6edb64797bbe43a0dfb11d686c2f5acf1 | [
"MIT"
] | 219 | 2015-01-15T23:56:29.000Z | 2022-03-27T19:56:47.000Z | rbac/acl.py | eldorplus/simple-rbac | c7ca8ce6edb64797bbe43a0dfb11d686c2f5acf1 | [
"MIT"
] | 6 | 2015-09-15T03:12:56.000Z | 2020-09-01T13:39:51.000Z | rbac/acl.py | eldorplus/simple-rbac | c7ca8ce6edb64797bbe43a0dfb11d686c2f5acf1 | [
"MIT"
] | 63 | 2015-03-15T05:36:21.000Z | 2021-07-22T12:40:49.000Z | from __future__ import absolute_import
import itertools
__all__ = ["Registry"]
class Registry(object):
"""The registry of access control list."""
def add_role(self, role, parents=[]):
"""Add a role or append parents roles to a special role.
All added roles should be hashable.
(htt... | 36.46 | 77 | 0.619492 | from __future__ import absolute_import
import itertools
__all__ = ["Registry"]
class Registry(object):
"""The registry of access control list."""
def __init__(self):
self._roles = {}
self._resources = {}
self._allowed = {}
self._denied = {}
# to allow additional sh... | 393 | 0 | 85 |
35ecdb8c51f52d9bb0708b4c0142ded1b98d2a57 | 23,704 | py | Python | ceph_report/collectors.py | Mirantis/ceph-monitoring | 2de4a90fb102337606732a46a382505047bfa1aa | [
"Apache-2.0"
] | 5 | 2016-09-19T10:42:15.000Z | 2018-09-05T11:18:03.000Z | ceph_report/collectors.py | Mirantis/ceph-monitoring | 2de4a90fb102337606732a46a382505047bfa1aa | [
"Apache-2.0"
] | 2 | 2016-10-18T09:15:19.000Z | 2018-03-21T10:24:54.000Z | ceph_report/collectors.py | Mirantis/ceph-monitoring | 2de4a90fb102337606732a46a382505047bfa1aa | [
"Apache-2.0"
] | 9 | 2016-10-17T13:20:01.000Z | 2019-01-09T14:33:48.000Z | from __future__ import annotations
import os
import re
import time
import json
import array
import random
import asyncio
import logging
import datetime
import contextlib
import collections
from enum import IntEnum
from dataclasses import dataclass, field
from typing import Any, List, Dict, Optional, Tuple, TypeVar, Ca... | 38.795417 | 120 | 0.610741 | from __future__ import annotations
import os
import re
import time
import json
import array
import random
import asyncio
import logging
import datetime
import contextlib
import collections
from enum import IntEnum
from dataclasses import dataclass, field
from typing import Any, List, Dict, Optional, Tuple, TypeVar, Ca... | 17,932 | 255 | 775 |
42677e1e3fc74b4db9834cf9ae727d99e53425d8 | 1,999 | py | Python | plantcv/apply_mask.py | Atitsuda/plantcv | 29932a0f0aa3573a74335425bccc394b2fb7b885 | [
"MIT"
] | 2 | 2017-12-05T12:07:47.000Z | 2021-01-25T08:58:52.000Z | plantcv/apply_mask.py | Atitsuda/plantcv | 29932a0f0aa3573a74335425bccc394b2fb7b885 | [
"MIT"
] | null | null | null | plantcv/apply_mask.py | Atitsuda/plantcv | 29932a0f0aa3573a74335425bccc394b2fb7b885 | [
"MIT"
] | 1 | 2020-08-13T17:44:53.000Z | 2020-08-13T17:44:53.000Z | # Apply White or Black Background Mask
import cv2
from . import print_image
from . import plot_image
from . import fatal_error
def apply_mask(img, mask, mask_color, device, debug=None):
"""Apply white image mask to image, with bitwise AND operator bitwise NOT operator and ADD operator.
Inputs:
img ... | 35.696429 | 104 | 0.643322 | # Apply White or Black Background Mask
import cv2
from . import print_image
from . import plot_image
from . import fatal_error
def apply_mask(img, mask, mask_color, device, debug=None):
"""Apply white image mask to image, with bitwise AND operator bitwise NOT operator and ADD operator.
Inputs:
img ... | 0 | 0 | 0 |
5bbe1c74e3eae40f3472dac89bbe701e7c69950a | 71 | py | Python | libs/gym-cartpole-world-master/gym_cartpole_world/envs/__init__.py | Adaptive-RL/AdaRL-code | 493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f | [
"MIT"
] | 8 | 2022-03-15T04:24:03.000Z | 2022-03-18T08:33:22.000Z | libs/gym-cartpole-world-master/gym_cartpole_world/envs/__init__.py | Adaptive-RL/AdaRL-code | 493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f | [
"MIT"
] | 1 | 2022-03-17T07:17:03.000Z | 2022-03-20T06:23:12.000Z | libs/gym-cartpole-world-master/gym_cartpole_world/envs/__init__.py | Adaptive-RL/AdaRL-code | 493b1ee5a0f98a220c5a1e5ce2e2ce6572d02e9f | [
"MIT"
] | 1 | 2022-03-18T06:08:37.000Z | 2022-03-18T06:08:37.000Z | from gym_cartpole_world.envs.cartpoleworld_env import CartPoleWorldEnv
| 35.5 | 70 | 0.915493 | from gym_cartpole_world.envs.cartpoleworld_env import CartPoleWorldEnv
| 0 | 0 | 0 |
1b7ccd8aaf4d068975398a6662e5f16f5a3693e4 | 147,800 | py | Python | all/emojitations/data/nb.py | idleberg/sublime-emojitations | b2b4e8ce2c33ed0f6b8d6db6085e21da4e8d895b | [
"MIT"
] | 6 | 2016-08-31T14:42:36.000Z | 2021-09-05T23:55:47.000Z | all/emojitations/data/nb.py | idleberg/sublime-emojitations | b2b4e8ce2c33ed0f6b8d6db6085e21da4e8d895b | [
"MIT"
] | 1 | 2016-10-20T10:52:06.000Z | 2016-10-20T18:47:19.000Z | all/emojitations/data/nb.py | idleberg/sublime-emojitations | b2b4e8ce2c33ed0f6b8d6db6085e21da4e8d895b | [
"MIT"
] | 5 | 2016-08-31T14:48:11.000Z | 2021-09-05T23:55:33.000Z | from emojitations.emojitypes import EmojiAnnotations
emoji = [
EmojiAnnotations(emoji='😀', codepoints=(128512,), name='glisefjes', slug='glisefjes', annotations=frozenset({'fjes', 'lol', 'latter', 'morsomt', 'smilende fjes'})),
EmojiAnnotations(emoji='😁', codepoints=(128513,), name='glisefjes med smilende øyne', ... | 146.772592 | 272 | 0.712882 | from emojitations.emojitypes import EmojiAnnotations
emoji = [
EmojiAnnotations(emoji='😀', codepoints=(128512,), name='glisefjes', slug='glisefjes', annotations=frozenset({'fjes', 'lol', 'latter', 'morsomt', 'smilende fjes'})),
EmojiAnnotations(emoji='😁', codepoints=(128513,), name='glisefjes med smilende øyne', ... | 0 | 0 | 0 |
2c589918bd089b9df29d1ef24cd732b1cc0b49ab | 850 | py | Python | JumpscaleCore/sal/tls/TLSFactory.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 1 | 2020-06-21T11:18:52.000Z | 2020-06-21T11:18:52.000Z | JumpscaleCore/sal/tls/TLSFactory.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 644 | 2019-08-25T10:19:56.000Z | 2020-12-23T09:41:04.000Z | JumpscaleCore/sal/tls/TLSFactory.py | gneumann333/jumpscaleX_core | 777d249fa3668c6e802c2f765f4b82fb39c3e5fa | [
"Apache-2.0"
] | 11 | 2019-08-29T21:38:50.000Z | 2020-06-21T11:18:55.000Z | from Jumpscale import j
from .TLS import TLS
JSBASE = j.baseclasses.object
TESTTOOLS = j.baseclasses.testtools
class TLSFactory(JSBASE, TESTTOOLS):
"""Factory class to deal with TLS, key and certificate generation"""
__jslocation__ = "j.sal.tls"
def get(self, path=None):
"""Get an instance of t... | 27.419355 | 116 | 0.635294 | from Jumpscale import j
from .TLS import TLS
JSBASE = j.baseclasses.object
TESTTOOLS = j.baseclasses.testtools
class TLSFactory(JSBASE, TESTTOOLS):
"""Factory class to deal with TLS, key and certificate generation"""
__jslocation__ = "j.sal.tls"
def get(self, path=None):
"""Get an instance of t... | 0 | 0 | 0 |
5e89c9f921c50d95ca9ada417987375b4027a411 | 2,670 | py | Python | src/cli/install.py | furukawaTakumi/kamaboko | 92dd31dc03c3735dca41b33a7166f6861450e5d9 | [
"MIT"
] | null | null | null | src/cli/install.py | furukawaTakumi/kamaboko | 92dd31dc03c3735dca41b33a7166f6861450e5d9 | [
"MIT"
] | null | null | null | src/cli/install.py | furukawaTakumi/kamaboko | 92dd31dc03c3735dca41b33a7166f6861450e5d9 | [
"MIT"
] | null | null | null |
import argparse, os, csv, json, datetime, pathlib
from typing import Iterator
import kamaboko | 25.92233 | 147 | 0.585019 |
import argparse, os, csv, json, datetime, pathlib
from typing import Iterator
import kamaboko
def install(args = None):
if args == None:
args = __parse_args()
__check_args(args)
with open(args.dic_path, 'r') as f:
data = csv.reader(f, delimiter=__delimiter(args.file_format))
dic... | 2,436 | 0 | 138 |
3eb68fc8603a458a23c9f596d4cd12e5aceca226 | 14,398 | py | Python | rplugin/python3/deoplete/sources/deoplete-ruby-core.py | etordera/deoplete-ruby | 57b85a5413d12e61478ff48917d2d708005e8110 | [
"MIT"
] | 3 | 2021-02-03T12:22:12.000Z | 2021-06-27T01:31:35.000Z | rplugin/python3/deoplete/sources/deoplete-ruby-core.py | etordera/deoplete-ruby | 57b85a5413d12e61478ff48917d2d708005e8110 | [
"MIT"
] | null | null | null | rplugin/python3/deoplete/sources/deoplete-ruby-core.py | etordera/deoplete-ruby | 57b85a5413d12e61478ff48917d2d708005e8110 | [
"MIT"
] | null | null | null | import re
import traceback
from deoplete.source.base import Base
# ------------------------------- KEYWORD -------------------------------------------------------------------------
ruby_core_keywords = [
'__callee__', '__dir__', '__enable', '__id__', '__method__', '__send__', '_id', 'abort', 'abort_on_exception',
... | 96.630872 | 142 | 0.631129 | import re
import traceback
from deoplete.source.base import Base
# ------------------------------- KEYWORD -------------------------------------------------------------------------
ruby_core_keywords = [
'__callee__', '__dir__', '__enable', '__id__', '__method__', '__send__', '_id', 'abort', 'abort_on_exception',
... | 432 | -2 | 103 |
979d3d74bd3866e1145259ed29b433998c6c400d | 186 | py | Python | neural_process/__init__.py | revsic/tf-attentive-neural-process | efa3bb0a9b6cfebaa3c1e025a9da00aef8d0a1e2 | [
"MIT"
] | 4 | 2020-08-30T14:20:05.000Z | 2021-03-23T12:53:27.000Z | neural_process/__init__.py | revsic/tf-attentive-neural-process | efa3bb0a9b6cfebaa3c1e025a9da00aef8d0a1e2 | [
"MIT"
] | null | null | null | neural_process/__init__.py | revsic/tf-attentive-neural-process | efa3bb0a9b6cfebaa3c1e025a9da00aef8d0a1e2 | [
"MIT"
] | 4 | 2020-03-23T06:34:49.000Z | 2021-10-25T23:57:24.000Z | from neural_process.np import NeuralProcess
from neural_process.cnp import ConditionalNP
from neural_process.anp import AttentiveNP
from neural_process.module.attention import Attention
| 37.2 | 53 | 0.887097 | from neural_process.np import NeuralProcess
from neural_process.cnp import ConditionalNP
from neural_process.anp import AttentiveNP
from neural_process.module.attention import Attention
| 0 | 0 | 0 |
88b9fb4e665f7210757b55549cc4282c8b38c598 | 432 | py | Python | docs/src/conf.py | EpicWink/python-swf-typed | f630f5a1b6e31ad6f6260b7af77ba52212585105 | [
"MIT"
] | null | null | null | docs/src/conf.py | EpicWink/python-swf-typed | f630f5a1b6e31ad6f6260b7af77ba52212585105 | [
"MIT"
] | 2 | 2021-11-09T07:22:37.000Z | 2021-11-16T06:08:17.000Z | docs/src/conf.py | EpicWink/python-swf-typed | f630f5a1b6e31ad6f6260b7af77ba52212585105 | [
"MIT"
] | null | null | null | """Sphinx documentation generation configuration."""
import importlib.metadata
project = "swf-typed"
copyright = "2021, Laurie O"
author = "Laurie O"
release = importlib.metadata.version("swf-typed") # full version
version = ".".join(release.split(".")[:2]) # short X.Y version
extensions = [
"sphinx.ext.autodo... | 22.736842 | 65 | 0.689815 | """Sphinx documentation generation configuration."""
import importlib.metadata
project = "swf-typed"
copyright = "2021, Laurie O"
author = "Laurie O"
release = importlib.metadata.version("swf-typed") # full version
version = ".".join(release.split(".")[:2]) # short X.Y version
extensions = [
"sphinx.ext.autodo... | 0 | 0 | 0 |
f1b172985ca70587402973a703d4eceb2acea396 | 670 | py | Python | Array/0189.RotateArray.3.py | joonion/leetcode-in-python | 9d621be1d736d81445ef19eebb7921eb4c212f83 | [
"Apache-2.0"
] | null | null | null | Array/0189.RotateArray.3.py | joonion/leetcode-in-python | 9d621be1d736d81445ef19eebb7921eb4c212f83 | [
"Apache-2.0"
] | null | null | null | Array/0189.RotateArray.3.py | joonion/leetcode-in-python | 9d621be1d736d81445ef19eebb7921eb4c212f83 | [
"Apache-2.0"
] | null | null | null | from typing import List
s = Solution()
# L, k = [1, 2, 3, 4, 5, 6, 7], 3
L, k = [-1, -100, 3, 99], 2
s.rotate(L, k)
print(L) | 26.8 | 61 | 0.435821 | from typing import List
class Solution:
def rotate(self, nums: List[int], k: int) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
n, k = len(nums), k % len(nums)
start = count = 0
while count < n:
curr, prev = start, nums[start]
... | 0 | 522 | 23 |
1161bacaa9f1743f84d4b231e15c83e73755dd30 | 3,002 | py | Python | ds_linked_list/sorted_linked_list.py | dileepkr/datastructures | e20f853a1247c9c6ae065696247900727e415d8f | [
"MIT"
] | null | null | null | ds_linked_list/sorted_linked_list.py | dileepkr/datastructures | e20f853a1247c9c6ae065696247900727e415d8f | [
"MIT"
] | null | null | null | ds_linked_list/sorted_linked_list.py | dileepkr/datastructures | e20f853a1247c9c6ae065696247900727e415d8f | [
"MIT"
] | null | null | null | from ds_linked_list.ll_node import Node
if __name__ == "__main__":
ll = Unsorted_linked_list()
for i in range(1,10):
ll.add(i)
print(ll) | 26.333333 | 75 | 0.538641 | from ds_linked_list.ll_node import Node
class Unsorted_linked_list:
def __init__(self):
self.head = None
def add(self, element):
node_ = Node(element)
if not self.head:
self.head = node_
else:
node_.next = self.head.next
self.head = node_... | 2,539 | 6 | 300 |
c9dda6b20451a34bd8a26cd49b9c5441acab86e2 | 1,779 | py | Python | Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0068_jogo_ParouImpar.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0068_jogo_ParouImpar.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0068_jogo_ParouImpar.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | """FAça um programa que jogue par ou impar com o computadr. O jogo só será interrompido quando o jogador PERDER,
mostrando o total de vitórias consecutivas que conquistou no final do jogo"""
from random import randint
print(f'''{"-=" * 20}
PAR OU IMPAR
{"-=" * 20}''')
contador = 0
while True:
jogadapc = randint(0,... | 39.533333 | 117 | 0.613266 | """FAça um programa que jogue par ou impar com o computadr. O jogo só será interrompido quando o jogador PERDER,
mostrando o total de vitórias consecutivas que conquistou no final do jogo"""
from random import randint
print(f'''{"-=" * 20}
PAR OU IMPAR
{"-=" * 20}''')
contador = 0
while True:
jogadapc = randint(0,... | 0 | 0 | 0 |
bc4c93cb414d187ed9e63256b173998897ab935c | 3,451 | py | Python | main.py | vlntsolo/multiprocessing-webscraper | a3b43bb68ec0c3897c1a6294f9268b44a19ed457 | [
"MIT"
] | null | null | null | main.py | vlntsolo/multiprocessing-webscraper | a3b43bb68ec0c3897c1a6294f9268b44a19ed457 | [
"MIT"
] | null | null | null | main.py | vlntsolo/multiprocessing-webscraper | a3b43bb68ec0c3897c1a6294f9268b44a19ed457 | [
"MIT"
] | 1 | 2021-09-25T07:06:51.000Z | 2021-09-25T07:06:51.000Z | import asyncio
import logging
from multiprocessing import Queue, Process, cpu_count
import queue
from threading import Thread
import time
import aiohttp
import aiosqlite
from bs4 import BeautifulSoup
PROCESSES = cpu_count() #P parameter
NUM_THREADS = 10 #T parameter
TARGET_RESOURCES = [
'https://example.org/',
... | 28.056911 | 100 | 0.630832 | import asyncio
import logging
from multiprocessing import Queue, Process, cpu_count
import queue
from threading import Thread
import time
import aiohttp
import aiosqlite
from bs4 import BeautifulSoup
PROCESSES = cpu_count() #P parameter
NUM_THREADS = 10 #T parameter
TARGET_RESOURCES = [
'https://example.org/',
... | 2,656 | 0 | 226 |
7770387e6f40283e78201fcab3863091f701b894 | 3,121 | py | Python | convert_videos/settings.py | justin8/convert_videos | ba4829079cf3562c71fddcd182ea4cacf9f8e249 | [
"MIT"
] | 3 | 2017-11-06T03:19:19.000Z | 2022-03-27T07:33:44.000Z | convert_videos/settings.py | justin8/convert_videos | ba4829079cf3562c71fddcd182ea4cacf9f8e249 | [
"MIT"
] | 3 | 2020-01-04T11:55:18.000Z | 2022-03-26T09:41:02.000Z | convert_videos/settings.py | justin8/convert_videos | ba4829079cf3562c71fddcd182ea4cacf9f8e249 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from video_utils import Codec
@dataclass
@dataclass
| 34.677778 | 137 | 0.603012 | from dataclasses import dataclass
from video_utils import Codec
@dataclass
class AudioSettings:
codec: Codec
channels: int
bitrate: int
def __str__(self):
output = ""
output += f" -acodec {self.codec.get_ffmpeg_name()}"
output += f" -ab {self.bitrate}k"
output += f" -... | 2,634 | 352 | 44 |
c7d20615c4661ca6379e79c0a04f84ac1184fea2 | 1,202 | py | Python | tests/backend/ini.py | edyan/python-anyconfig | d237909a6e4848737539b80951b710238c72052f | [
"MIT"
] | null | null | null | tests/backend/ini.py | edyan/python-anyconfig | d237909a6e4848737539b80951b710238c72052f | [
"MIT"
] | null | null | null | tests/backend/ini.py | edyan/python-anyconfig | d237909a6e4848737539b80951b710238c72052f | [
"MIT"
] | null | null | null | #
# Copyright (C) 2012 - 2017 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
from __future__ import absolute_import
import anyconfig.backend.ini as TT
import tests.backend.common as TBC
# :seealso: `tests.backend.common.CNF_0`
CNF_0_S = """\... | 23.115385 | 71 | 0.675541 | #
# Copyright (C) 2012 - 2017 Satoru SATOH <ssato @ redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
from __future__ import absolute_import
import anyconfig.backend.ini as TT
import tests.backend.common as TBC
# :seealso: `tests.backend.common.CNF_0`
CNF_0_S = """\... | 476 | 263 | 69 |
1ac8d5589ceca70f9e89f1d4ba9ffbf6e4b2d824 | 1,257 | py | Python | yandex_algorithm2/home1c.py | erjan/coding_exercises | 53ba035be85f1e7a12b4d4dbf546863324740467 | [
"Apache-2.0"
] | null | null | null | yandex_algorithm2/home1c.py | erjan/coding_exercises | 53ba035be85f1e7a12b4d4dbf546863324740467 | [
"Apache-2.0"
] | null | null | null | yandex_algorithm2/home1c.py | erjan/coding_exercises | 53ba035be85f1e7a12b4d4dbf546863324740467 | [
"Apache-2.0"
] | null | null | null | '''
Как известно, два наиболее распространённых формата записи даты — это европейский (сначала день, потом месяц, потом год) и американски (сначала месяц, потом день, потом год). Системный администратор поменял дату на одном из бэкапов и сейчас хочет вернуть дату обратно. Но он не проверил, в каком формате дата использ... | 18.761194 | 374 | 0.686555 | '''
Как известно, два наиболее распространённых формата записи даты — это европейский (сначала день, потом месяц, потом год) и американски (сначала месяц, потом день, потом год). Системный администратор поменял дату на одном из бэкапов и сейчас хочет вернуть дату обратно. Но он не проверил, в каком формате дата использ... | 261 | 0 | 23 |
59dfed6ae1adfd455ea56e6f83cd3404c581a165 | 655 | py | Python | tests/test_ase.py | jat255/MaterialsIO | 04df70eddc9d0a464f7a089cf753ce26c2adf81f | [
"Apache-2.0"
] | 10 | 2019-03-25T01:16:48.000Z | 2022-02-23T16:47:02.000Z | tests/test_ase.py | jat255/MaterialsIO | 04df70eddc9d0a464f7a089cf753ce26c2adf81f | [
"Apache-2.0"
] | 31 | 2019-02-05T22:47:44.000Z | 2022-03-25T21:50:55.000Z | tests/test_ase.py | jat255/MaterialsIO | 04df70eddc9d0a464f7a089cf753ce26c2adf81f | [
"Apache-2.0"
] | 2 | 2019-11-12T18:30:49.000Z | 2022-01-13T20:04:01.000Z | from materials_io.ase import AseParser
from math import isclose
import pytest
import os
@pytest.fixture
@pytest.fixture
| 22.586207 | 86 | 0.69313 | from materials_io.ase import AseParser
from math import isclose
import pytest
import os
@pytest.fixture
def ase():
return os.path.join(os.path.dirname(__file__), 'data', 'gaussian', 'molecule.log')
@pytest.fixture
def parser():
return AseParser()
def test_ase(parser, ase):
output = parser.parse(ase)
... | 463 | 0 | 67 |
dfee84d5a90ad6258f2c7a73186f191a93aded33 | 2,038 | py | Python | myTreeView.py | hebingyedu/Hyperspetral-Image-segmentation | f5c89358cb57227eb88ed9e49597a548c083e0dc | [
"MIT"
] | 1 | 2021-07-17T00:30:00.000Z | 2021-07-17T00:30:00.000Z | myTreeView.py | hebingyedu/Hyperspetral-Image-segmentation | f5c89358cb57227eb88ed9e49597a548c083e0dc | [
"MIT"
] | null | null | null | myTreeView.py | hebingyedu/Hyperspetral-Image-segmentation | f5c89358cb57227eb88ed9e49597a548c083e0dc | [
"MIT"
] | null | null | null | #coding=utf-8
from PySide2 import QtWidgets, QtCore, QtGui
import numpy as np
import os
import os.path
import processRS
| 35.137931 | 77 | 0.647694 | #coding=utf-8
from PySide2 import QtWidgets, QtCore, QtGui
import numpy as np
import os
import os.path
import processRS
class myTreeView(QtWidgets.QWidget):
def __init__(self, treeList=[],parent=None):
super().__init__(parent)
self.treeWidget=QtWidgets.QTreeView(parent)
self.fileModel=Qt... | 1,814 | 15 | 101 |
4ffce3d4a85b47defc757d070769705d37255bbe | 486 | py | Python | view/console.py | germank/training-monitor | 5cd27c8a6fe370840c602e3324fe9a46822be9d0 | [
"MIT"
] | null | null | null | view/console.py | germank/training-monitor | 5cd27c8a6fe370840c602e3324fe9a46822be9d0 | [
"MIT"
] | null | null | null | view/console.py | germank/training-monitor | 5cd27c8a6fe370840c602e3324fe9a46822be9d0 | [
"MIT"
] | null | null | null | import cmd
import logging
from signalslot import Signal
| 21.130435 | 50 | 0.613169 | import cmd
import logging
from signalslot import Signal
class CommandConsole(cmd.Cmd):
def __init__(self):
cmd.Cmd.__init__(self)
self.save_command = Signal(['output_dir'])
self.quit_command = Signal()
def do_save(self, line):
self.save_command.emit(output_dir=lin... | 260 | 9 | 151 |
cc5ea48635d7da4e40a03291da25afd53bb7a8d4 | 894 | py | Python | 02 - Curso Em Video/Aula 23/E - 113.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | 02 - Curso Em Video/Aula 23/E - 113.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | 02 - Curso Em Video/Aula 23/E - 113.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null |
nint = leiaInt('Digite um numero Inteiro: ')
nfloat = leiaFloat('Digite um número Flutuante: ')
print(f'Você digitou um número Inteiro: {nint}\nE um número Flutuante: {nfloat}') | 35.76 | 81 | 0.579418 | def leiaInt(msg):
while True:
try:
num = int(input(msg).replace(',','.').strip())
except(ValueError, TypeError, Exception) as erro:
print('\033[0;31mERRO! Digite um número inteiro valido\033[m')
print(f'Você digitou um erro: {erro.__class__}')
else:... | 665 | 0 | 48 |
b7d2c1ca306aa8bfac8f95fd02bac2ff9a17f2e2 | 6,255 | py | Python | ipme/utils/functions.py | evdoxiataka/ipme | ed2aa5322bf719994237a743adff89547b18a142 | [
"MIT"
] | 22 | 2020-10-31T21:39:18.000Z | 2021-12-05T02:21:15.000Z | ipme/utils/functions.py | evdoxiataka/ipme | ed2aa5322bf719994237a743adff89547b18a142 | [
"MIT"
] | null | null | null | ipme/utils/functions.py | evdoxiataka/ipme | ed2aa5322bf719994237a743adff89547b18a142 | [
"MIT"
] | 2 | 2021-01-27T09:14:02.000Z | 2021-03-05T02:47:20.000Z | import numpy as np
from math import gcd, ceil
# import itertools
def lcm(list_of_int):
"""
Get the Least Common Multyply (lcm) of a list of integer numbers.
Parameters:
--------
list_of_int A List of integers
Returns:
--------
An integer (the lcm... | 31.913265 | 91 | 0.53717 | import numpy as np
from math import gcd, ceil
# import itertools
def lcm(list_of_int):
"""
Get the Least Common Multyply (lcm) of a list of integer numbers.
Parameters:
--------
list_of_int A List of integers
Returns:
--------
An integer (the lcm... | 2,876 | 0 | 138 |
1f19f13e91c75f3090fe3500b07c916348d4e0d3 | 317 | py | Python | py/so/light_pixels.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/so/light_pixels.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/so/light_pixels.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import cv2
import numpy as np
# img = cv2.imread('4.png')
# hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# img[hsv[:,:,0] > 20] = 255
img = cv2.imread("4.png")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img[gray > 200] = 255
cv2.imwrite("4_.png", img)
cv2.imshow("img", img)
cv2.waitKey(0)
| 18.647059 | 44 | 0.659306 | #!/usr/bin/env python3
import cv2
import numpy as np
# img = cv2.imread('4.png')
# hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# img[hsv[:,:,0] > 20] = 255
img = cv2.imread("4.png")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img[gray > 200] = 255
cv2.imwrite("4_.png", img)
cv2.imshow("img", img)
cv2.waitKey(0)
| 0 | 0 | 0 |
22c03d85273a3ae5d9bb0f4814acf96c016dc277 | 2,303 | py | Python | cmdfunctools/types.py | Mr-Io/chtool | 4d4337b016c53d7e19d3b9dcec161b3ad115b611 | [
"MIT"
] | 1 | 2019-04-23T16:49:42.000Z | 2019-04-23T16:49:42.000Z | cmdfunctools/types.py | Mr-Io/chtool | 4d4337b016c53d7e19d3b9dcec161b3ad115b611 | [
"MIT"
] | null | null | null | cmdfunctools/types.py | Mr-Io/chtool | 4d4337b016c53d7e19d3b9dcec161b3ad115b611 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
cmdfunctools.types
~~~~~~~~~~~~~~~~~~~~~~~
Module with the type checkers for the function/commandline args.
"""
import string
# ***********************************************************
# default functions used when type argument are not provided
def default_true(*arg):
"""
Aux... | 21.933333 | 81 | 0.569257 | # -*- coding: utf-8 -*-
"""
cmdfunctools.types
~~~~~~~~~~~~~~~~~~~~~~~
Module with the type checkers for the function/commandline args.
"""
import string
# ***********************************************************
# default functions used when type argument are not provided
def default_true(*arg):
"""
Aux... | 63 | 0 | 22 |
5785cc952971cae8790212bea0f5458065c88ad7 | 291 | py | Python | api/models.py | Rytiggy/osfPages-service- | 06efc49c529f2a2623d03b9c790e931b84110d24 | [
"Apache-2.0"
] | null | null | null | api/models.py | Rytiggy/osfPages-service- | 06efc49c529f2a2623d03b9c790e931b84110d24 | [
"Apache-2.0"
] | 3 | 2020-02-12T00:11:57.000Z | 2021-06-10T19:50:20.000Z | api/models.py | Rytiggy/osfPages-service- | 06efc49c529f2a2623d03b9c790e931b84110d24 | [
"Apache-2.0"
] | 2 | 2017-08-28T18:58:11.000Z | 2017-08-28T18:59:33.000Z | from django.db import models
# Create your models here.
| 29.1 | 64 | 0.780069 | from django.db import models
# Create your models here.
class Home(models.Model):
guid = models.CharField(max_length=5, primary_key=True)
page_data = models.TextField()
unpublished_page_data = models.TextField(null=True, blank=True)
meta_data = models.TextField(null=True, blank=True)
| 0 | 211 | 23 |
0226bec4d9ef01c8ee635854ea31a5261ea22df3 | 7,402 | py | Python | shell-server.py | MathieuMorrissette/WebsocketShelling | d63e09216df10b2a38ee2d5cb9b2ee6531ff37c9 | [
"Unlicense"
] | null | null | null | shell-server.py | MathieuMorrissette/WebsocketShelling | d63e09216df10b2a38ee2d5cb9b2ee6531ff37c9 | [
"Unlicense"
] | null | null | null | shell-server.py | MathieuMorrissette/WebsocketShelling | d63e09216df10b2a38ee2d5cb9b2ee6531ff37c9 | [
"Unlicense"
] | null | null | null | import asyncio
import ssl
import websockets
import os
import json
import time
import base64
import random
import string
import hashlib
from OpenSSL import crypto, SSL
from datetime import datetime
server_password = ""
with open("./config.txt", "r") as config:
data = config.read()
data = json.loads(data)
s... | 32.897778 | 110 | 0.586598 | import asyncio
import ssl
import websockets
import os
import json
import time
import base64
import random
import string
import hashlib
from OpenSSL import crypto, SSL
from datetime import datetime
server_password = ""
with open("./config.txt", "r") as config:
data = config.read()
data = json.loads(data)
s... | 6,439 | 0 | 138 |
1a4d3826fe05523d57fcaa16a40fcae86b60e476 | 7,334 | py | Python | src/numcolorpy.py | dlanier/FlyingMachineFractal | 3889bfb8b8005717de83954d4a705154e908273b | [
"MIT"
] | 4 | 2017-03-27T19:50:37.000Z | 2021-07-15T03:23:03.000Z | pyreimpic/zcolormap.py | dlanier/FlyingMachineFractal | 3889bfb8b8005717de83954d4a705154e908273b | [
"MIT"
] | null | null | null | pyreimpic/zcolormap.py | dlanier/FlyingMachineFractal | 3889bfb8b8005717de83954d4a705154e908273b | [
"MIT"
] | 1 | 2017-03-27T19:50:54.000Z | 2017-03-27T19:50:54.000Z | # -*- coding: utf-8 -*-
"""
numcolorpy.py
Created Saturday April 22 2017
@author: del
lanier4@illinois.edu
mradmstr514226508@gmail.com
import numcolorpy as ncp
"""
import time
import numpy as np
from PIL import Image as IP
from PIL import ImageColor as IC
import colorsys
def range_norm(Z, lo=0.0, hi=1.0):
""" ... | 27.062731 | 105 | 0.565858 | # -*- coding: utf-8 -*-
"""
numcolorpy.py
Created Saturday April 22 2017
@author: del
lanier4@illinois.edu
mradmstr514226508@gmail.com
import numcolorpy as ncp
"""
import time
import numpy as np
from PIL import Image as IP
from PIL import ImageColor as IC
import colorsys
def range_norm(Z, lo=0.0, hi=1.0):
""" ... | 1,949 | 0 | 161 |
36827512a9f1775495657b3d791cc3c2672adda4 | 12,952 | py | Python | venv/lib/python3.8/site-packages/hgext/remotefilelog/contentstore.py | JesseDavids/mqtta | 389eb4f06242d4473fe1bcff7fc6a22290e0d99c | [
"Apache-2.0"
] | 4 | 2021-02-05T10:57:39.000Z | 2022-02-25T04:43:23.000Z | venv/lib/python3.8/site-packages/hgext/remotefilelog/contentstore.py | JesseDavids/mqtta | 389eb4f06242d4473fe1bcff7fc6a22290e0d99c | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/hgext/remotefilelog/contentstore.py | JesseDavids/mqtta | 389eb4f06242d4473fe1bcff7fc6a22290e0d99c | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import threading
from mercurial.node import hex, nullid
from mercurial.pycompat import getattr
from mercurial import (
mdiff,
pycompat,
revlog,
)
from . import (
basestore,
constants,
shallowutil,
)
class ChainIndicies(object):
"""A static class for... | 33.4677 | 80 | 0.602996 | from __future__ import absolute_import
import threading
from mercurial.node import hex, nullid
from mercurial.pycompat import getattr
from mercurial import (
mdiff,
pycompat,
revlog,
)
from . import (
basestore,
constants,
shallowutil,
)
class ChainIndicies(object):
"""A static class for... | 8,139 | 3,046 | 872 |
4ac075e9bb8b333093734151b20982bc493d6bb5 | 1,121 | py | Python | stock/adapters/topics/send_handler.py | rh-tech-supermarket-restocking-demo/stock-backend | 0d868b270c4142fd5efdad28966482c280478c85 | [
"Apache-2.0"
] | null | null | null | stock/adapters/topics/send_handler.py | rh-tech-supermarket-restocking-demo/stock-backend | 0d868b270c4142fd5efdad28966482c280478c85 | [
"Apache-2.0"
] | null | null | null | stock/adapters/topics/send_handler.py | rh-tech-supermarket-restocking-demo/stock-backend | 0d868b270c4142fd5efdad28966482c280478c85 | [
"Apache-2.0"
] | null | null | null | import logging
from proton.handlers import MessagingHandler
from proton import Message
| 35.03125 | 96 | 0.664585 | import logging
from proton.handlers import MessagingHandler
from proton import Message
class SendHandler(MessagingHandler):
def __init__(self, host: str, address: str, message_body: str):
super(SendHandler, self).__init__()
self.conn_url: str = host
self.address: str = address
self... | 888 | 15 | 130 |
90b0bf7b1dba201331c6a48219374b9f0a593643 | 2,098 | py | Python | backtracking/n-queens/Python/NQueen.py | CarbonDDR/al-go-rithms | 8e65affbe812931b7dde0e2933eb06c0f44b4130 | [
"CC0-1.0"
] | 1,253 | 2017-06-06T07:19:25.000Z | 2022-03-30T17:07:58.000Z | backtracking/n-queens/Python/NQueen.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 554 | 2017-09-29T18:56:01.000Z | 2022-02-21T15:48:13.000Z | backtracking/n-queens/Python/NQueen.py | rishabh99-rc/al-go-rithms | 4df20d7ef7598fda4bc89101f9a99aac94cdd794 | [
"CC0-1.0"
] | 2,226 | 2017-09-29T19:59:59.000Z | 2022-03-25T08:59:55.000Z | from __future__ import print_function
# Python program to solve N Queen
# Problem using backtracking
global N
N = 4
# A utility function to check if a queen can
# be placed on board[row][col]. Note that this
# function is called when "col" queens are
# already placed in columns from 0 to col -1.
# So we need to che... | 22.804348 | 52 | 0.672069 | from __future__ import print_function
# Python program to solve N Queen
# Problem using backtracking
global N
N = 4
def printSolution(board):
for i in range(N):
for j in range(N):
print(board[i][j], end=' ')
print()
# A utility function to check if a queen can
# be placed on board[row][col]. Note that this... | 1,256 | 0 | 90 |
1c8b0ae9b81fd2fe52f53218422c3f284a5c6b9e | 317 | py | Python | common/user.py | BaobabDuncan/us_api_server | 7b59feac6978bd6083b2d1aa7565f15a4dc89b2f | [
"Apache-2.0"
] | null | null | null | common/user.py | BaobabDuncan/us_api_server | 7b59feac6978bd6083b2d1aa7565f15a4dc89b2f | [
"Apache-2.0"
] | null | null | null | common/user.py | BaobabDuncan/us_api_server | 7b59feac6978bd6083b2d1aa7565f15a4dc89b2f | [
"Apache-2.0"
] | null | null | null |
from django.http import HttpResponseRedirect
from google.appengine.api import memcache
| 24.384615 | 49 | 0.640379 |
from django.http import HttpResponseRedirect
from google.appengine.api import memcache
class adminUser():
def __init__(self):
pass
def getAdminUser(self):
return memcache.get("adminUser")
def setAdminUser(self):
memcache.add("adminUser", "admin", 80000) | 109 | -3 | 121 |
cf6dae97fca58029e3d487cb8e373c64b3a1b651 | 232 | py | Python | Python Files/Helper Files/Spectogram_crop_test.py | brennanMosher/Music-Genre-Recognition-using-a-Machine-Learning-Appraoch | 7834fe5d709e894322ad76ef118067febaa78bce | [
"MIT"
] | 1 | 2021-04-13T16:22:27.000Z | 2021-04-13T16:22:27.000Z | Python Files/Helper Files/Spectogram_crop_test.py | brennanMosher/Music-Genre-Recognition-using-a-Machine-Learning-Appraoch | 7834fe5d709e894322ad76ef118067febaa78bce | [
"MIT"
] | null | null | null | Python Files/Helper Files/Spectogram_crop_test.py | brennanMosher/Music-Genre-Recognition-using-a-Machine-Learning-Appraoch | 7834fe5d709e894322ad76ef118067febaa78bce | [
"MIT"
] | null | null | null | import os
from PIL import Image
'''
Test file for cropping images
'''
file_loc = r'C:\Users\brenn\Desktop\Spectrogram/blues.00000.jpg'
im = Image.open(file_loc)
crop_box = (80, 58, 576, 427)
img1 = im.crop(crop_box)
img1.show() | 15.466667 | 64 | 0.711207 | import os
from PIL import Image
'''
Test file for cropping images
'''
file_loc = r'C:\Users\brenn\Desktop\Spectrogram/blues.00000.jpg'
im = Image.open(file_loc)
crop_box = (80, 58, 576, 427)
img1 = im.crop(crop_box)
img1.show() | 0 | 0 | 0 |
270f33d777b5a636518e2bff52d771a58ec2b9c2 | 3,976 | py | Python | algorithms/tsec/layers.py | mpoiitis/GraphM-framework | 82904b9940b029579b86c359e17312cfa7ef1692 | [
"MIT"
] | null | null | null | algorithms/tsec/layers.py | mpoiitis/GraphM-framework | 82904b9940b029579b86c359e17312cfa7ef1692 | [
"MIT"
] | null | null | null | algorithms/tsec/layers.py | mpoiitis/GraphM-framework | 82904b9940b029579b86c359e17312cfa7ef1692 | [
"MIT"
] | null | null | null | from tensorflow.keras.layers import Layer, Dense
from tensorflow.keras.regularizers import l2
import tensorflow as tf
class Sampling(Layer):
"""Uses (z_mean, z_log_var) to sample z, the vector encoding a digit."""
class Encoder(Layer):
"""Maps MNIST digits to a triplet (z_mean, z_log_var, z)."""
class Deco... | 37.509434 | 129 | 0.630533 | from tensorflow.keras.layers import Layer, Dense
from tensorflow.keras.regularizers import l2
import tensorflow as tf
class Sampling(Layer):
"""Uses (z_mean, z_log_var) to sample z, the vector encoding a digit."""
def call(self, inputs, **kwargs):
z_mean, z_log_var = inputs
batch = tf.shape(z_... | 1,088 | 2,320 | 158 |
01221d594e7e8a20c9a9d17c46c4a2281a62c2ae | 982 | py | Python | problems/15.3-sum.py | lucasheriques/leetcode-solutions | cd36b5df46a75a0cb17569faf9cf56186864f68a | [
"MIT"
] | null | null | null | problems/15.3-sum.py | lucasheriques/leetcode-solutions | cd36b5df46a75a0cb17569faf9cf56186864f68a | [
"MIT"
] | null | null | null | problems/15.3-sum.py | lucasheriques/leetcode-solutions | cd36b5df46a75a0cb17569faf9cf56186864f68a | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=15 lang=python3
#
# [15] 3Sum
#
# O(n^2) time | O(n) space
| 27.277778 | 76 | 0.407332 | #
# @lc app=leetcode id=15 lang=python3
#
# [15] 3Sum
#
# O(n^2) time | O(n) space
class Solution:
def threeSum(self, array, k=0):
array.sort()
ans = []
for i in range(len(array) - 1):
left = i + 1
right = len(array) - 1
if i > 0 and array[i] == array[... | 854 | -6 | 49 |
11705964d46a522a8400a13b9c02c8fb742ed68b | 434 | py | Python | 2018/day1/first_repeat.py | forrestrice/advent | 2451de84790e67c08676154bfa5167ee353d4e42 | [
"MIT"
] | 1 | 2019-12-03T07:41:10.000Z | 2019-12-03T07:41:10.000Z | 2018/day1/first_repeat.py | forrestrice/advent | 2451de84790e67c08676154bfa5167ee353d4e42 | [
"MIT"
] | null | null | null | 2018/day1/first_repeat.py | forrestrice/advent | 2451de84790e67c08676154bfa5167ee353d4e42 | [
"MIT"
] | null | null | null | input_file_name = "time_machine_input.txt"
sum = 0
seen_sums = {}
for time_input in infinite_input():
sum += int(time_input)
sum_frequency = seen_sums.get(sum, 0) + 1
seen_sums[sum] = sum_frequency
if sum_frequency > 1:
print(sum)
break | 24.111111 | 45 | 0.638249 | input_file_name = "time_machine_input.txt"
def infinite_input():
input_file = open(input_file_name, "r")
while True:
for line in input_file:
yield line
input_file.seek(0)
sum = 0
seen_sums = {}
for time_input in infinite_input():
sum += int(time_input)
sum_frequency = seen_... | 142 | 0 | 23 |
2fda7d56160fe8a774a3ce7da64ac6810295ef73 | 2,554 | py | Python | refbee/platforms/wikidata.py | kmdn/RefBee | c45e5fa7a3f011b760284a7ee8dafec8e0884280 | [
"MIT"
] | null | null | null | refbee/platforms/wikidata.py | kmdn/RefBee | c45e5fa7a3f011b760284a7ee8dafec8e0884280 | [
"MIT"
] | null | null | null | refbee/platforms/wikidata.py | kmdn/RefBee | c45e5fa7a3f011b760284a7ee8dafec8e0884280 | [
"MIT"
] | null | null | null | from refbee.util import get_sparql_query_results
platform_properties_dict = {
"ORCID": "wdt:P496",
"Google Scholar": "wdt:P1960",
"VIAF": "wdt:P214",
"DBLP": "wdt:P2456",
"Dimensions": "wdt:P6178",
"Github": "wdt:P2037",
"Microsoft Academic": "wdt:P6366",
"Semantic Scholar": "wdt:P4012"... | 38.69697 | 103 | 0.635082 | from refbee.util import get_sparql_query_results
platform_properties_dict = {
"ORCID": "wdt:P496",
"Google Scholar": "wdt:P1960",
"VIAF": "wdt:P214",
"DBLP": "wdt:P2456",
"Dimensions": "wdt:P6178",
"Github": "wdt:P2037",
"Microsoft Academic": "wdt:P6366",
"Semantic Scholar": "wdt:P4012"... | 1,201 | 0 | 46 |