hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a23f2f9761fce9b406a2bb8cd8bb8f8cd565702c | 3,072 | py | Python | tests/core/test_setget.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | 1 | 2022-01-19T01:12:43.000Z | 2022-01-19T01:12:43.000Z | tests/core/test_setget.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | null | null | null | tests/core/test_setget.py | mfkiwl/siliconcompiler | 49a16d9a07c526821afe1ce2f2d77394e439ca05 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Silicon Compiler Authors. All Rights Reserved.
import siliconcompiler
import re
def test_setget():
'''API test for set/get methods
Performs set or add based on API example for each entry in schema and
ensures that we can recover the same value back. Also tests that keypaths in
schema ... | 32.680851 | 95 | 0.546224 |
4af23d1e00d65474d4e45093e1caa14a4fb30f9f | 8,448 | py | Python | codegen/yeppp/library/math/arm.py | wdv4758h/Yeppp- | deeca59a88bc2b014be802fd575757f7c26c180e | [
"BSD-3-Clause"
] | 30 | 2015-09-18T00:52:22.000Z | 2021-11-03T17:44:30.000Z | codegen/yeppp/library/math/arm.py | wdv4758h/Yeppp- | deeca59a88bc2b014be802fd575757f7c26c180e | [
"BSD-3-Clause"
] | 1 | 2017-02-09T04:53:29.000Z | 2017-02-09T04:53:29.000Z | codegen/yeppp/library/math/arm.py | wdv4758h/Yeppp- | deeca59a88bc2b014be802fd575757f7c26c180e | [
"BSD-3-Clause"
] | 6 | 2017-02-09T03:05:32.000Z | 2022-03-17T06:50:19.000Z | #
# Yeppp! library implementation
#
# This file is part of Yeppp! library and licensed under the New BSD license.
# See LICENSE.txt for the full text of the license.
#
__author__ = 'Marat'
from peachpy.arm import *
from yeppp import Status
from yeppp.library.math import *
import math
... | 35.495798 | 234 | 0.646662 |
e343387f42e71dd5b4babfff4745ffd4c7f4f58b | 230 | py | Python | src/main/python/proc/value/boolean.py | cjblink1/lang | 245b8d002341dce4fa5905b1f274770e34867c7e | [
"MIT"
] | null | null | null | src/main/python/proc/value/boolean.py | cjblink1/lang | 245b8d002341dce4fa5905b1f274770e34867c7e | [
"MIT"
] | null | null | null | src/main/python/proc/value/boolean.py | cjblink1/lang | 245b8d002341dce4fa5905b1f274770e34867c7e | [
"MIT"
] | null | null | null | from proc.value.expressed_value import ExpressedValue
class BooleanValue(ExpressedValue):
def __init__(self, b: bool):
ExpressedValue.__init__(self, b)
self.b = b
def extract(self):
return self.b | 23 | 53 | 0.682609 |
83845838ddd59cdef99fb6b77fbf8537bfabaf9d | 3,847 | py | Python | setup/cRIO/server.py | MichiganRobotX/wamv | 4612255e9e14a2d1324d8daeb2b7ddf7c187e8a0 | [
"BSD-3-Clause"
] | 1 | 2022-01-26T17:12:25.000Z | 2022-01-26T17:12:25.000Z | setup/cRIO/server.py | MichiganRobotX/wamv | 4612255e9e14a2d1324d8daeb2b7ddf7c187e8a0 | [
"BSD-3-Clause"
] | null | null | null | setup/cRIO/server.py | MichiganRobotX/wamv | 4612255e9e14a2d1324d8daeb2b7ddf7c187e8a0 | [
"BSD-3-Clause"
] | 2 | 2020-05-09T10:21:02.000Z | 2022-02-26T16:40:44.000Z | """ cRIO server requests
'acquire_raw_data'
"""
import socket
import scipy
from scipy.fftpack import fft
import math as m
import numpy as np
def get_channels_from_bytes(bytes_data):
str_data = bytes_data.decode('utf-8')
str_list = str_data.split(',') # Or whatever separator
float_list = [float(s) for ... | 31.024194 | 117 | 0.59007 |
6ec1c43ce15b4ab7f7410f8665dd5a7007ec9609 | 14,280 | py | Python | pybind/slxos/v16r_1_00b/routing_system/router/isis/router_isis_cmds_holder/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/routing_system/router/isis/router_isis_cmds_holder/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/routing_system/router/isis/router_isis_cmds_holder/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 72.857143 | 931 | 0.737465 |
6aeec9101349061ce877e7ef8ab3d7673e4c8165 | 1,478 | py | Python | senk_poly_tools/edf_container.py | dualon/senk_poly_tools | beb954d732afd2c2c85c8fe449105159a58ddbe6 | [
"MIT"
] | null | null | null | senk_poly_tools/edf_container.py | dualon/senk_poly_tools | beb954d732afd2c2c85c8fe449105159a58ddbe6 | [
"MIT"
] | null | null | null | senk_poly_tools/edf_container.py | dualon/senk_poly_tools | beb954d732afd2c2c85c8fe449105159a58ddbe6 | [
"MIT"
] | null | null | null | """ A structured data container for EDF(+) header and data records.
An EdfContainer instance represents a single EDF file with the headers and
all its data records.
Note that the data container should *not* require all fields to be set and
it should not enforce any validation.
For the EDF(+) specification see:... | 31.446809 | 85 | 0.696211 |
ff756a2b725cd07f2fda7c0c20e74e74c7578962 | 1,558 | py | Python | sixweeks/sixweeks/urls.py | Chrysus/sixweeks | 4550a63aa74a621c236baa3c01136b94b944e7e9 | [
"MIT"
] | null | null | null | sixweeks/sixweeks/urls.py | Chrysus/sixweeks | 4550a63aa74a621c236baa3c01136b94b944e7e9 | [
"MIT"
] | null | null | null | sixweeks/sixweeks/urls.py | Chrysus/sixweeks | 4550a63aa74a621c236baa3c01136b94b944e7e9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2017 Chrysus
# Licensed under MIT (https://github.com/Chrysus/sixweeks/blob/master/LICENSE)
"""sixweeks_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
F... | 37.095238 | 120 | 0.675866 |
46d31b8516609639de2838b6b7879e27b86147f6 | 12,766 | py | Python | plugins/modules/oci_identity_customer_secret_key.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_identity_customer_secret_key.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_identity_customer_secret_key.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 38.221557 | 160 | 0.678991 |
6fa4eeaee34c0360b902671615b82294e3eea970 | 6,013 | py | Python | env/lib/python3.8/site-packages/pandas/tests/series/methods/test_sort_index.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | env/lib/python3.8/site-packages/pandas/tests/series/methods/test_sort_index.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | env/lib/python3.8/site-packages/pandas/tests/series/methods/test_sort_index.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | import random
import numpy as np
import pytest
from pandas import IntervalIndex, MultiIndex, Series
import pandas._testing as tm
class TestSeriesSortIndex:
def test_sort_index(self, datetime_series):
rindex = list(datetime_series.index)
random.shuffle(rindex)
random_order = datetime_ser... | 35.579882 | 88 | 0.632796 |
bab3adfd91facff28f47454ec62d9ef96e046ade | 1,032 | py | Python | setup.py | ComplexArts/pyctrl-core | a72bd53924410c2e7f1e71c8188a0391550febdd | [
"Apache-2.0"
] | 12 | 2017-06-20T13:20:40.000Z | 2021-01-18T00:12:10.000Z | setup.py | mcdeoliveira/beaglebone | 6c6062c6d1e9902178500abcd10be6ac0bcf043d | [
"Apache-2.0"
] | 2 | 2017-06-12T15:17:24.000Z | 2018-01-30T18:22:19.000Z | setup.py | mcdeoliveira/beaglebone | 6c6062c6d1e9902178500abcd10be6ac0bcf043d | [
"Apache-2.0"
] | 4 | 2017-09-25T12:19:19.000Z | 2019-01-31T21:46:24.000Z | from setuptools import setup, find_packages
def readme():
with open('README.rst') as f:
return f.read()
setup(
name="pyctrl",
version="0.4.3",
packages=find_packages(),
python_requires='>=3.4',
scripts=['scripts/pyctrl_start_server',
'scripts/pyctrl_stop_server'],... | 27.157895 | 79 | 0.623062 |
d983c276d7077862bc9370b48ca2e442d567dc32 | 5,818 | py | Python | AppDB/appscale/datastore/dbconstants.py | HafeezRai/appscale | 08c02c4ad21541bf107c7c059a42b1f544d92cd5 | [
"Apache-2.0"
] | null | null | null | AppDB/appscale/datastore/dbconstants.py | HafeezRai/appscale | 08c02c4ad21541bf107c7c059a42b1f544d92cd5 | [
"Apache-2.0"
] | null | null | null | AppDB/appscale/datastore/dbconstants.py | HafeezRai/appscale | 08c02c4ad21541bf107c7c059a42b1f544d92cd5 | [
"Apache-2.0"
] | null | null | null | """
Datastore Constants
"""
import cassandra.cluster
import re
SECRET_LOCATION = "/etc/appscale/secret.key"
ERROR_DEFAULT = "DB_ERROR:"
NONEXISTANT_TRANSACTION = "0"
# The datastore's default HTTP port.
DEFAULT_PORT = 4000
# The lowest character to separate different fields in a row key.
KEY_DELIMITER = '\x00'
# ... | 25.743363 | 79 | 0.692334 |
24ea960d0e006285ca3d1bc2b7cca5296f51b5de | 666 | py | Python | models/surgery.py | banctilrobitaille/MedicalAR-PatientMovingDetection | 9eed356a1e0cb4f967bae3265fbb9edf33f84045 | [
"CC-BY-3.0"
] | null | null | null | models/surgery.py | banctilrobitaille/MedicalAR-PatientMovingDetection | 9eed356a1e0cb4f967bae3265fbb9edf33f84045 | [
"CC-BY-3.0"
] | null | null | null | models/surgery.py | banctilrobitaille/MedicalAR-PatientMovingDetection | 9eed356a1e0cb4f967bae3265fbb9edf33f84045 | [
"CC-BY-3.0"
] | null | null | null | from PyQt5.QtCore import pyqtSignal, QObject
class Surgery(QObject):
patient_position_update = pyqtSignal(object, object, name="Surgery progress")
__patient = None
__type = None
__images_repository = None
def __init__(self, patient=None, type=None, images_repository=None):
QObject.__init... | 33.3 | 108 | 0.738739 |
eca3e0c6e6c0269eea86b9ead31093e290b983e5 | 3,433 | py | Python | 6._ Vectores/Vector.py | LuisNorberto1998/Estructura_de_datos-Practicas | 12a76afa44615cce2f5db98af9a3da6cd720d5d9 | [
"MIT"
] | null | null | null | 6._ Vectores/Vector.py | LuisNorberto1998/Estructura_de_datos-Practicas | 12a76afa44615cce2f5db98af9a3da6cd720d5d9 | [
"MIT"
] | null | null | null | 6._ Vectores/Vector.py | LuisNorberto1998/Estructura_de_datos-Practicas | 12a76afa44615cce2f5db98af9a3da6cd720d5d9 | [
"MIT"
] | null | null | null | # -*- coding: cp1252 -*-
from time import time #Funcion de tiempo
# Crear un algoritmo que solicite y almacene en un vector 10 números y programar(imprimir vector).
def leerVector():
x=[]
for i in range(0,10):
x.append(int(raw_input("Ingrese numero %d : " % i)))
return x
def imprimirVector(x):
... | 27.246032 | 98 | 0.651617 |
77e2e54ce3405d95e92b9b0cb27331ef97cd0990 | 4,718 | py | Python | src/data_standardization/tests/test_standardize_point_data.py | nsteins/crash-model | 521a63e48a561298e694432d74caa3c385f913b6 | [
"MIT"
] | 54 | 2018-06-21T18:48:34.000Z | 2020-04-15T23:07:20.000Z | src/data_standardization/tests/test_standardize_point_data.py | nsteins/crash-model | 521a63e48a561298e694432d74caa3c385f913b6 | [
"MIT"
] | 172 | 2018-06-14T17:33:41.000Z | 2020-06-15T16:45:15.000Z | src/data_standardization/tests/test_standardize_point_data.py | nsteins/crash-model | 521a63e48a561298e694432d74caa3c385f913b6 | [
"MIT"
] | 25 | 2017-02-13T21:45:07.000Z | 2018-06-13T19:41:38.000Z | import ruamel.yaml
import data.config
import os
import csv
import json
from .. import standardize_point_data
def create_test_csv(test_list, tmpdir, filename):
tmppath = tmpdir.strpath
os.makedirs(os.path.join(tmpdir, 'raw'))
os.makedirs(os.path.join(tmpdir, 'raw', 'supplemental'))
os.makedirs(os.... | 30.836601 | 67 | 0.547902 |
af20cb96bf5627219f5743dfce450ece38c3e1d9 | 18,077 | py | Python | GUI/Backup werkende GUI/Gui.py | RemcoTaal/IDP | 33959e29235448c38b7936f16c7421a24130e745 | [
"MIT"
] | null | null | null | GUI/Backup werkende GUI/Gui.py | RemcoTaal/IDP | 33959e29235448c38b7936f16c7421a24130e745 | [
"MIT"
] | null | null | null | GUI/Backup werkende GUI/Gui.py | RemcoTaal/IDP | 33959e29235448c38b7936f16c7421a24130e745 | [
"MIT"
] | null | null | null | import csv
import datetime
import json
import math
import pprint
import random
import socket
import time
import tkinter as tk
import tkinter.font
import uuid
from _thread import *
from tkinter import *
#from win32api import GetSystemMetrics
import requests
from matplotlib.backends.backend_tkagg import FigureCanvasTkAg... | 41.748268 | 120 | 0.599602 |
eec118b9402f1ab3d9a333bb53d8180c1858ff75 | 2,100 | py | Python | model/test.py | yacoubb/lang-classifier | d39a342cf8ad64b191ea235f9af3f833033f254a | [
"MIT"
] | 1 | 2019-07-03T11:28:55.000Z | 2019-07-03T11:28:55.000Z | model/test.py | yacoubb/lang-classifier | d39a342cf8ad64b191ea235f9af3f833033f254a | [
"MIT"
] | null | null | null | model/test.py | yacoubb/lang-classifier | d39a342cf8ad64b191ea235f9af3f833033f254a | [
"MIT"
] | null | null | null | from tensorflow import keras
import os
import numpy as np
import sys
import json
sys.path.append("/".join(os.path.abspath(__file__).split("/")[:-2]))
from model.dataset import utils, test_sampler
def estimate_model_accuracy(model):
def predict(word):
word = utils.total_conversion(word)
word = wor... | 28.378378 | 68 | 0.623333 |
430f8d018a900b9d98f780e9fa58a24802476083 | 414 | py | Python | tekton-master/backend/venv/Scripts/trial.py | seijiakiyama/fatec-script | 0aaa5223ab03b74b1d80f2e8829df7f9d1ea20b9 | [
"MIT"
] | null | null | null | tekton-master/backend/venv/Scripts/trial.py | seijiakiyama/fatec-script | 0aaa5223ab03b74b1d80f2e8829df7f9d1ea20b9 | [
"MIT"
] | null | null | null | tekton-master/backend/venv/Scripts/trial.py | seijiakiyama/fatec-script | 0aaa5223ab03b74b1d80f2e8829df7f9d1ea20b9 | [
"MIT"
] | null | null | null | #!D:\Seiji\Documentos\fatec-script\tekton-master\backend\venv\Scripts\python.exe
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import os, sys
try:
import _preamble
except ImportError:
sys.exc_clear()
# begin chdir armor
sys.path[:] = map(os.path.abspath, sys.path)
# end chdir armor
... | 21.789474 | 80 | 0.741546 |
c31b5d1e3db0290b02f78b95ecd5056127185282 | 401 | py | Python | real-estate/btre/wsgi.py | tienduy-nguyen/django-web | 4b4078042b9c388dd00907a09d10e2a7889f4dea | [
"MIT"
] | null | null | null | real-estate/btre/wsgi.py | tienduy-nguyen/django-web | 4b4078042b9c388dd00907a09d10e2a7889f4dea | [
"MIT"
] | 6 | 2021-04-08T20:20:47.000Z | 2022-02-13T20:21:29.000Z | real-estate/btre/wsgi.py | tienduy-nguyen/django-web | 4b4078042b9c388dd00907a09d10e2a7889f4dea | [
"MIT"
] | null | null | null | """
WSGI config for btre project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 23.588235 | 79 | 0.750623 |
ed31182ad7ca3015cf7f55d2bad1c9e1ec3fd903 | 11,509 | py | Python | main.py | testestzxcv/AutoCrawler_personal | 8e20c1024f9056e17a5f7381142165a7b4492242 | [
"Apache-2.0"
] | null | null | null | main.py | testestzxcv/AutoCrawler_personal | 8e20c1024f9056e17a5f7381142165a7b4492242 | [
"Apache-2.0"
] | null | null | null | main.py | testestzxcv/AutoCrawler_personal | 8e20c1024f9056e17a5f7381142165a7b4492242 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 YoongiKim
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | 39.146259 | 165 | 0.586063 |
79e85e2e837d4b2e86b1325e09a9869ad6715c43 | 4,466 | py | Python | coord2vec/common/visualizations/photo_slider.py | jonzarecki/coord2vec | 4f267fdd87af7b3d3558ca834b88e9ab7c309c18 | [
"Apache-2.0"
] | null | null | null | coord2vec/common/visualizations/photo_slider.py | jonzarecki/coord2vec | 4f267fdd87af7b3d3558ca834b88e9ab7c309c18 | [
"Apache-2.0"
] | null | null | null | coord2vec/common/visualizations/photo_slider.py | jonzarecki/coord2vec | 4f267fdd87af7b3d3558ca834b88e9ab7c309c18 | [
"Apache-2.0"
] | 1 | 2021-01-25T09:21:17.000Z | 2021-01-25T09:21:17.000Z | import os
import pickle as pkl
import numpy as np
from PIL import Image
from auto_tqdm import tqdm
from bokeh.layouts import column
from bokeh.layouts import row
from bokeh.models import CustomJS, ColumnDataSource, Slider
from bokeh.models.glyphs import ImageURL
from bokeh.plotting import figure
from bokeh.plotting im... | 33.578947 | 109 | 0.633677 |
86f73dbd465f83b73c4f4e80ef0b50d3108af52f | 303 | py | Python | data/multilingual/Latn.BUG/Mono_16/pdf_to_json_test_Latn.BUG_Mono_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.BUG/Mono_16/pdf_to_json_test_Latn.BUG_Mono_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.BUG/Mono_16/pdf_to_json_test_Latn.BUG_Mono_16.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.BUG/Mono_16/udhr_Latn.BUG_Mono_16.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 30.3 | 73 | 0.811881 |
17055b1c9ba9c1deca6e0f9c35baf515559e9137 | 580 | py | Python | var/spack/repos/builtin/packages/py-types-pyyaml/package.py | genric/spack | e35a99e5d6da729f197954802d697d75e02aefe0 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/py-types-pyyaml/package.py | BlueBrain/spack | 047fa4b21b90abfd227dd70a77689bb473cd1a57 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/py-types-pyyaml/package.py | genric/spack | e35a99e5d6da729f197954802d697d75e02aefe0 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyTypesPyyaml(PythonPackage):
"""Typing stubs for PyYAML."""
homepage = "https://gith... | 32.222222 | 95 | 0.734483 |
884581dfaf1ab7697ca8b47accbe5a4e1e8e62a2 | 478 | py | Python | databass/ops/where.py | ivychen/databass-public | ddb706dfb14c828075842e49d086b7fe5aa29a83 | [
"MIT"
] | 6 | 2019-11-06T20:57:19.000Z | 2022-01-06T22:09:14.000Z | databass/ops/where.py | ivychen/databass-public | ddb706dfb14c828075842e49d086b7fe5aa29a83 | [
"MIT"
] | 1 | 2020-09-13T02:04:02.000Z | 2020-09-13T14:59:19.000Z | databass/ops/where.py | ivychen/databass-public | ddb706dfb14c828075842e49d086b7fe5aa29a83 | [
"MIT"
] | 22 | 2019-01-31T15:20:06.000Z | 2022-03-22T19:52:18.000Z | from ..baseops import *
from ..exprs import *
from ..db import Database
from ..schema import *
from ..tuples import *
from ..util import cache, OBTuple
from itertools import chain
class Filter(UnaryOp):
def __init__(self, c:Op, cond:Expr):
"""
@c child operator
@cond boolean Expression... | 19.916667 | 38 | 0.623431 |
e2302bf44ebd423dfb90fe0e31bb6d33f51fbba3 | 1,299 | py | Python | au/test/testutils.py | pwais/au2018 | edd224e5fb649b9f0095ffad39b94f72f73e4853 | [
"Apache-2.0"
] | null | null | null | au/test/testutils.py | pwais/au2018 | edd224e5fb649b9f0095ffad39b94f72f73e4853 | [
"Apache-2.0"
] | 3 | 2019-01-05T22:43:37.000Z | 2019-01-26T05:45:01.000Z | au/test/testutils.py | pwais/au2018 | edd224e5fb649b9f0095ffad39b94f72f73e4853 | [
"Apache-2.0"
] | 1 | 2020-05-03T21:10:03.000Z | 2020-05-03T21:10:03.000Z | import itertools
from au import conf
from au import spark
from au.fixtures import dataset
class LocalSpark(spark.Spark):
MASTER = 'local[8]'
def iter_video_images(n, w, h):
images_dir = conf.AU_IMAGENET_SAMPLE_IMGS_DIR
rows = dataset.ImageRow.rows_from_images_dir(images_dir)
imgs = [r.as_numpy() for r in row... | 24.509434 | 74 | 0.649731 |
850d17499f13c78c5d401fa2a9b0ffaa0decc5be | 20,900 | py | Python | packages/main/tests/python/test_robocorp_workitems.py | amisol/rpaframework | b1ee8a745a8e4d7bd41fa7765b26ab02b90cfb57 | [
"Apache-2.0"
] | null | null | null | packages/main/tests/python/test_robocorp_workitems.py | amisol/rpaframework | b1ee8a745a8e4d7bd41fa7765b26ab02b90cfb57 | [
"Apache-2.0"
] | null | null | null | packages/main/tests/python/test_robocorp_workitems.py | amisol/rpaframework | b1ee8a745a8e4d7bd41fa7765b26ab02b90cfb57 | [
"Apache-2.0"
] | null | null | null | import copy
import json
import os
import pytest
import tempfile
from contextlib import contextmanager
from pathlib import Path
from RPA.Robocorp.WorkItems import (
BaseAdapter,
EmptyQueue,
FileAdapter,
State,
WorkItems,
)
VARIABLES_FIRST = {"username": "testguy", "address": "guy@company.com"}
VAR... | 33.386581 | 87 | 0.622727 |
b7c5f5405b2753759a4f802dac40aace8b5603bc | 1,687 | py | Python | sdk/python/tests/compiler/testdata/loop_static_with_parallelism.py | chinhuang007/kfp-tekton | f1f1a1cae678b22fc0d5280ff4b8722bf99d07e5 | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/compiler/testdata/loop_static_with_parallelism.py | chinhuang007/kfp-tekton | f1f1a1cae678b22fc0d5280ff4b8722bf99d07e5 | [
"Apache-2.0"
] | null | null | null | sdk/python/tests/compiler/testdata/loop_static_with_parallelism.py | chinhuang007/kfp-tekton | f1f1a1cae678b22fc0d5280ff4b8722bf99d07e5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 kubeflow.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 30.125 | 74 | 0.644339 |
bd8093b44c2987144d005ae0b2e92c04843a11d3 | 16,612 | py | Python | apps/profiles/views.py | Chemtogether/chemtogehter-registration | 22d39c31c1ea4fa66af30dc77a4af5ccab7931c9 | [
"MIT"
] | null | null | null | apps/profiles/views.py | Chemtogether/chemtogehter-registration | 22d39c31c1ea4fa66af30dc77a4af5ccab7931c9 | [
"MIT"
] | null | null | null | apps/profiles/views.py | Chemtogether/chemtogehter-registration | 22d39c31c1ea4fa66af30dc77a4af5ccab7931c9 | [
"MIT"
] | null | null | null | import logging
import datetime
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.shortcuts import render
from django.forms.models import model_to_dict
from django.contrib import messages
from django.core.mail import EmailMessage
from django.template.loader import render_to_s... | 36.113043 | 299 | 0.595714 |
3b5779e29cf5cbabe408120d0c87af9b43a87430 | 919 | py | Python | environment.py | vkartik97/habitat-challenge-two-docker | 1d563dc4566bcad3de9953c0214c45f294bcf2b2 | [
"MIT"
] | null | null | null | environment.py | vkartik97/habitat-challenge-two-docker | 1d563dc4566bcad3de9953c0214c45f294bcf2b2 | [
"MIT"
] | null | null | null | environment.py | vkartik97/habitat-challenge-two-docker | 1d563dc4566bcad3de9953c0214c45f294bcf2b2 | [
"MIT"
] | null | null | null | import pickle
import time
import grpc
import habitat
from concurrent import futures
import evaluation_pb2
import evaluation_pb2_grpc
def pack_for_grpc(entity):
return pickle.dumps(entity)
def unpack_for_grpc(entity):
return pickle.loads(entity)
class Environment(evaluation_pb2_grpc.EnvironmentServicer):... | 22.414634 | 76 | 0.763874 |
b13f97b31d5fa6fc4bc20f6da9178a89c1db164c | 17,532 | py | Python | tests/test_ghdl.py | abs-tudelft/vhdeps | dfd679e1c3d8fa1c61285558b0589f40ecd40441 | [
"Apache-2.0"
] | 17 | 2019-06-06T06:28:38.000Z | 2021-04-23T09:52:10.000Z | tests/test_ghdl.py | jonasjj/vhdeps | dfd679e1c3d8fa1c61285558b0589f40ecd40441 | [
"Apache-2.0"
] | 34 | 2019-06-17T11:55:28.000Z | 2020-10-01T11:27:49.000Z | tests/test_ghdl.py | jvanstraten/vhdeps | dfd679e1c3d8fa1c61285558b0589f40ecd40441 | [
"Apache-2.0"
] | 1 | 2021-04-23T05:22:41.000Z | 2021-04-23T05:22:41.000Z | """Tests the GHDL backend."""
from unittest import TestCase, skipIf
from unittest.mock import patch
import re
import os
import tempfile
from plumbum import local
from .common import run_vhdeps, MockMissingImport
DIR = os.path.realpath(os.path.dirname(__file__))
def ghdl_installed():
"""Returns whether GHDL is in... | 46.752 | 93 | 0.608145 |
f126d235ebde899f31e6cfe9d7afcc4350e58bd4 | 456 | py | Python | aoc2020/day13/day13_part1.py | GetPastTheMonkey/advent-of-code | db80be6d87baba4d5315cc69276905c55762da86 | [
"MIT"
] | 1 | 2019-09-15T16:37:24.000Z | 2019-09-15T16:37:24.000Z | aoc2020/day13/day13_part1.py | GetPastTheMonkey/advent-of-code | db80be6d87baba4d5315cc69276905c55762da86 | [
"MIT"
] | null | null | null | aoc2020/day13/day13_part1.py | GetPastTheMonkey/advent-of-code | db80be6d87baba4d5315cc69276905c55762da86 | [
"MIT"
] | null | null | null | from utils import get_input_lines
arrival, bus_ids = get_input_lines(__file__)
arrival = int(arrival)
smallest_bus_id = None
smallest_wait = None
for bus_id in bus_ids.split(","):
if bus_id == "x":
continue
bus_id = int(bus_id)
bus_wait = bus_id - (arrival % bus_id)
if smallest_wait is None... | 21.714286 | 57 | 0.703947 |
d8b62cf62abc31b901d15d9fe44026356b868606 | 4,163 | py | Python | accounts/views.py | anurag0singh/Jagrati | d4487e08368da38cf53a77dc1303ea8841c71ba9 | [
"MIT"
] | null | null | null | accounts/views.py | anurag0singh/Jagrati | d4487e08368da38cf53a77dc1303ea8841c71ba9 | [
"MIT"
] | null | null | null | accounts/views.py | anurag0singh/Jagrati | d4487e08368da38cf53a77dc1303ea8841c71ba9 | [
"MIT"
] | null | null | null | from django.shortcuts import render, HttpResponse, redirect
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.conf import setti... | 30.166667 | 109 | 0.701177 |
edfc8eef5f446298c459279ff3eaa4cff525a864 | 4,378 | py | Python | scripts/validation_metrics.py | cjwallace/CML_AMP_Structural_Time_Series | 2360b3bff8601f9f0cf5c016d8a9191ba9d8dc6d | [
"Apache-2.0"
] | 20 | 2020-10-16T16:57:41.000Z | 2022-03-29T21:03:11.000Z | scripts/validation_metrics.py | andrewrreed/CML_AMP_Structural_Time_Series | e3477134553f5ebbc11d629a44a0c39e80362ff5 | [
"Apache-2.0"
] | 6 | 2020-10-26T15:25:42.000Z | 2021-06-20T08:09:53.000Z | scripts/validation_metrics.py | andrewrreed/CML_AMP_Structural_Time_Series | e3477134553f5ebbc11d629a44a0c39e80362ff5 | [
"Apache-2.0"
] | 13 | 2020-10-16T08:51:05.000Z | 2021-09-03T16:55:11.000Z | # ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2020
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hun... | 37.418803 | 77 | 0.725902 |
98e72a2c4f43d6f9e9ca12958759669afe3a44c4 | 719 | py | Python | src/tests/common/test_common_models_log.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | src/tests/common/test_common_models_log.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | src/tests/common/test_common_models_log.py | codingcatgirl/pretalx | 26554967772efa5248ae9b6a0fa838b0e8713807 | [
"Apache-2.0"
] | null | null | null | import pytest
from django_scopes import scope
@pytest.mark.django_db
def test_log_hides_password(submission):
with scope(event=submission.event):
submission.log_action(
"test.hide", data={"password": "12345", "non-sensitive": "foo"}
)
log = submission.logged_actions().get(actio... | 31.26087 | 81 | 0.642559 |
db40b26a56e150331f9fff35daf49e582d6b69f1 | 10,599 | py | Python | example/finetune_ranker.py | arita37/ERNIE-1 | 72e2123540910c6b830eaf88c81032f01df69b33 | [
"Apache-2.0"
] | 1 | 2019-10-29T08:36:54.000Z | 2019-10-29T08:36:54.000Z | example/finetune_ranker.py | GaryXiangK/ERNIE | 14ee0f01b625ed312e6e97040a2ddbfe8355a4fb | [
"Apache-2.0"
] | null | null | null | example/finetune_ranker.py | GaryXiangK/ERNIE | 14ee0f01b625ed312e6e97040a2ddbfe8355a4fb | [
"Apache-2.0"
] | 1 | 2020-12-08T16:16:53.000Z | 2020-12-08T16:16:53.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.845865 | 166 | 0.617888 |
c4d8cfba975aeaf557fb0a1cbf7ef04a3a58e57c | 2,637 | py | Python | dci/dci_config.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 17 | 2016-09-02T09:21:29.000Z | 2021-09-27T11:33:58.000Z | dci/dci_config.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 80 | 2015-12-09T09:29:26.000Z | 2021-01-06T08:24:22.000Z | dci/dci_config.py | redhat-cip/dci-control-server | 6dee30e7b8770fde2466f2b09554d299a3f3db4d | [
"Apache-2.0"
] | 10 | 2015-09-29T21:34:53.000Z | 2021-09-27T11:34:01.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.625 | 85 | 0.712931 |
6450db2b9bd8c86dec4435ff0aea07b4ac3558c2 | 7,607 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20191201/get_firewall_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20191201/get_firewall_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20191201/get_firewall_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 35.713615 | 217 | 0.644012 |
417be191765eaa8142b87a2fa50e5df9f335c261 | 15,246 | py | Python | raynet/common/sampling_schemes.py | paschalidoud/raynet | bf468dadddaf30da9cf5b1ecdfbcf4f161476242 | [
"MIT"
] | 76 | 2018-04-08T04:33:26.000Z | 2021-09-24T15:05:45.000Z | raynet/common/sampling_schemes.py | paschalidoud/raynet | bf468dadddaf30da9cf5b1ecdfbcf4f161476242 | [
"MIT"
] | 8 | 2018-08-24T16:56:19.000Z | 2021-04-11T08:41:31.000Z | raynet/common/sampling_schemes.py | paschalidoud/raynet | bf468dadddaf30da9cf5b1ecdfbcf4f161476242 | [
"MIT"
] | 18 | 2018-06-28T13:23:22.000Z | 2021-03-29T03:17:39.000Z | import numpy as np
from ..utils.geometry import ray_aabbox_intersection, ray_ray_intersection
from ..utils.generic_utils import get_voxel_grid
from ..ray_marching.ray_tracing import voxel_traversal
from ..tf_implementations.sampling_schemes import build_sample_points_in_bbox,\
build_sample_points_in_range
class ... | 35.704918 | 79 | 0.613341 |
e894a8db89a5ccf24225f0a4758656ff31aebada | 3,421 | py | Python | Gesture Recognition/final_gesture_recognition.py | Shubhamskg/HackFest2018-Hack_manias | 0131c6c751907656a225330ea74533ffd8dd482b | [
"MIT"
] | 2 | 2019-08-22T09:29:31.000Z | 2020-07-16T19:00:29.000Z | Gesture Recognition/final_gesture_recognition.py | Shubhamskg/HackFest2018-Hack_manias | 0131c6c751907656a225330ea74533ffd8dd482b | [
"MIT"
] | null | null | null | Gesture Recognition/final_gesture_recognition.py | Shubhamskg/HackFest2018-Hack_manias | 0131c6c751907656a225330ea74533ffd8dd482b | [
"MIT"
] | 4 | 2018-04-14T07:45:47.000Z | 2019-10-29T08:32:23.000Z | import cv2
import numpy as np
import math
cap = cv2.VideoCapture(0)
while(cap.isOpened()):
# read image
ret, img = cap.read()
# get hand data from the rectangle sub window on the screen
cv2.rectangle(img, (400,400), (100,100), (0,255,0),0)
crop_img = img[100:400, 100:400]
# convert to graysc... | 33.213592 | 102 | 0.61064 |
3eb32204bc84d952aef383fcaf6faaf59dfab18b | 32,184 | py | Python | tools/make_hex_module.py | blueantst/hex | d7b8773dae8dde63f3807cef1d48c017077db727 | [
"BSD-3-Clause"
] | 1,030 | 2015-01-01T10:56:37.000Z | 2022-03-18T18:19:09.000Z | tools/make_hex_module.py | danni5678/hex | d7b8773dae8dde63f3807cef1d48c017077db727 | [
"BSD-3-Clause"
] | 34 | 2015-01-04T10:20:44.000Z | 2022-02-18T01:09:50.000Z | tools/make_hex_module.py | danni5678/hex | d7b8773dae8dde63f3807cef1d48c017077db727 | [
"BSD-3-Clause"
] | 229 | 2015-01-08T00:55:27.000Z | 2022-03-28T08:49:39.000Z | # Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from date_util import *
from file_util import *
from gclient_util import *
from optparse import OptionParser
import os
import re
impor... | 40.894536 | 130 | 0.681612 |
a33c45c50a0de2f854ef12e7321726c850c2ac5f | 5,739 | py | Python | Lib/lib2to3/tests/test_main.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 52,316 | 2015-01-01T15:56:25.000Z | 2022-03-31T23:19:01.000Z | Lib/lib2to3/tests/test_main.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 25,286 | 2015-03-03T23:18:02.000Z | 2022-03-31T23:17:27.000Z | Lib/lib2to3/tests/test_main.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 31,623 | 2015-01-01T13:29:37.000Z | 2022-03-31T19:55:06.000Z | # -*- coding: utf-8 -*-
import codecs
import io
import logging
import os
import re
import shutil
import sys
import tempfile
import unittest
from lib2to3 import main
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
PY2_TEST_MODULE = os.path.join(TEST_DATA_DIR, "py2_test_grammar.py")
class TestMain(un... | 40.992857 | 78 | 0.60568 |
758ce6a07d21f4db7d8361799b38c7db188a1d7b | 6,539 | py | Python | pyESN.py | wangzcl/pyESN | 6e50a43bf7348cb55503a6289e03cefc86b56921 | [
"MIT"
] | null | null | null | pyESN.py | wangzcl/pyESN | 6e50a43bf7348cb55503a6289e03cefc86b56921 | [
"MIT"
] | null | null | null | pyESN.py | wangzcl/pyESN | 6e50a43bf7348cb55503a6289e03cefc86b56921 | [
"MIT"
] | null | null | null | import numpy as np
class ESN():
def __init__(self, n_inputs: int, n_outputs: int, n_reservoir: int = 500,
input_scale=1, feedback_scale=1, spectral_radius=0.95,
teacher_forcing: bool = True, sparsity=0, noise=0.001,
bias=0.01, ridge=10**-10, rng=np.random.default... | 42.738562 | 92 | 0.621961 |
e19316c8a67652ac7d9ff82bfc4ba2da02bfee04 | 32,241 | py | Python | tests/forms/convs.py | boltnev/iktomi | bc92006c026f9b42e56f1af5ced2fe577673a486 | [
"MIT"
] | 14 | 2015-02-15T05:24:22.000Z | 2020-03-19T10:07:28.000Z | tests/forms/convs.py | boltnev/iktomi | bc92006c026f9b42e56f1af5ced2fe577673a486 | [
"MIT"
] | 10 | 2015-04-04T10:10:41.000Z | 2016-06-01T13:17:58.000Z | tests/forms/convs.py | boltnev/iktomi | bc92006c026f9b42e56f1af5ced2fe577673a486 | [
"MIT"
] | 5 | 2015-02-20T11:18:58.000Z | 2016-10-18T15:30:13.000Z | # -*- coding: utf-8 -*-
import unittest
from datetime import datetime, date, time
from iktomi.forms import *
from iktomi.web.app import AppEnvironment
from webob.multidict import MultiDict
from collections import OrderedDict
from iktomi.forms import Form, Field, FieldSet
from iktomi.utils import cached_property
from ... | 34.262487 | 89 | 0.586458 |
9d9c50fbf2076adcafb3c45e41ecbfdd4d2e9ae3 | 700 | py | Python | tests/datastructures/arrays/test_maxlen_contiguous_binary_subarray.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | tests/datastructures/arrays/test_maxlen_contiguous_binary_subarray.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | tests/datastructures/arrays/test_maxlen_contiguous_binary_subarray.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | import unittest
from datastructures.arrays.maxlen_contiguous_binary_subarray import find_max_length
class MaxLengthContiguousBinarySubArrayTestCases(unittest.TestCase):
def test_0_1(self):
nums = [0, 1]
expected = 2
actual = find_max_length(nums)
self.assertEqual(expected, actual)... | 25 | 83 | 0.65 |
b801ce0160ed3a263aba7dc89a31afe916670689 | 10,619 | py | Python | src/radish/parser/errors.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 182 | 2015-06-27T16:17:17.000Z | 2022-03-19T11:49:10.000Z | src/radish/parser/errors.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 357 | 2015-11-06T19:30:19.000Z | 2022-03-28T19:49:04.000Z | src/radish/parser/errors.py | radish-bdd/radish2 | 4ea71291aac8700ec2b284b7f2bbf79bf2970324 | [
"MIT"
] | 52 | 2015-08-22T08:36:37.000Z | 2022-03-01T06:04:06.000Z | """
radish
~~~~~~
the root from red to green. BDD tooling for Python.
:copyright: (c) 2019 by Timo Furrer <tuxtimo@gmail.com>
:license: MIT, see LICENSE for more details.
"""
from radish.errors import RadishError
class RadishSyntaxError(RadishError, SyntaxError):
def __str__(self):
context, line, colu... | 23.135076 | 110 | 0.485921 |
9c88eaf00414a1673e64cdd77f1ffc9bdb1d17c6 | 988 | py | Python | fuzzers/ECP5/110-dcu_routing/fuzzer.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 256 | 2018-03-05T00:28:46.000Z | 2022-03-04T22:33:29.000Z | fuzzers/ECP5/110-dcu_routing/fuzzer.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 70 | 2018-03-12T21:55:02.000Z | 2020-06-22T12:06:08.000Z | fuzzers/ECP5/110-dcu_routing/fuzzer.py | Keno/prjtrellis | 3311e6d814e0001c8785d6d77a4c93e327875b6d | [
"ISC"
] | 68 | 2018-03-12T21:05:01.000Z | 2021-03-14T21:08:33.000Z | from fuzzconfig import FuzzConfig
import interconnect
import nets
import pytrellis
import re
jobs = [
((71, 42), FuzzConfig(job="DCUROUTE0", family="ECP5", device="LFE5UM5G-45F", ncl="dcuroute.ncl",
tiles=["MIB_R71C42:DCU0", "MIB_R71C43:DCU1", "MIB_R71C44:DCU2", "MIB_R71C45:DCU3",
... | 29.939394 | 108 | 0.536437 |
6ded56bde363ee4ae724a514550a74fac341f550 | 5,513 | py | Python | research/object_detection/utils/np_box_list_test.py | Dzinushi/models_1_4 | d7e72793a68c1667d403b1542c205d1cd9b1d17c | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/np_box_list_test.py | Dzinushi/models_1_4 | d7e72793a68c1667d403b1542c205d1cd9b1d17c | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/np_box_list_test.py | Dzinushi/models_1_4 | d7e72793a68c1667d403b1542c205d1cd9b1d17c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.536765 | 85 | 0.594595 |
f11d63f2f03a8475a0d8a362925c8fb01eab75b1 | 783 | py | Python | django/solution/addressbook/addressbook/contact/migrations/0008_auto_20180613_1630.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | 1 | 2019-01-02T15:04:08.000Z | 2019-01-02T15:04:08.000Z | django/solution/addressbook/addressbook/contact/migrations/0008_auto_20180613_1630.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | null | null | null | django/solution/addressbook/addressbook/contact/migrations/0008_auto_20180613_1630.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-13 14:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contact', '0007_contact_is_deleted'),
]
operations = [
migrations.AlterFie... | 30.115385 | 160 | 0.651341 |
f77ad416b29d1807fda87f5feb478ddb1e39ec3e | 6,422 | py | Python | mmdet/models/backbones/imgclsmob.py | morkovka1337/mmdetection | 5187d94b6c96084b17817249622d6e4520213ae6 | [
"Apache-2.0"
] | 58 | 2020-09-21T08:17:26.000Z | 2022-03-31T19:38:14.000Z | mmdet/models/backbones/imgclsmob.py | morkovka1337/mmdetection | 5187d94b6c96084b17817249622d6e4520213ae6 | [
"Apache-2.0"
] | 170 | 2020-09-08T12:29:06.000Z | 2022-03-31T18:28:09.000Z | mmdet/models/backbones/imgclsmob.py | morkovka1337/mmdetection | 5187d94b6c96084b17817249622d6e4520213ae6 | [
"Apache-2.0"
] | 21 | 2020-10-06T13:49:41.000Z | 2022-03-30T14:52:45.000Z | # Copyright (C) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 44.597222 | 136 | 0.527562 |
d9223e87e2d8b01f2c1c47ebbe134507e478e5cd | 2,479 | py | Python | server/server.py | lancewl/python-multithreaded-http-server | d4b848a0a367c902d1bfe4152781deffaaef8590 | [
"MIT"
] | null | null | null | server/server.py | lancewl/python-multithreaded-http-server | d4b848a0a367c902d1bfe4152781deffaaef8590 | [
"MIT"
] | null | null | null | server/server.py | lancewl/python-multithreaded-http-server | d4b848a0a367c902d1bfe4152781deffaaef8590 | [
"MIT"
] | null | null | null | from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
from http import HTTPStatus
import urllib.parse
import sys
import io
import os
import hashlib
import click
import json
class MyHttpRequestHandler(SimpleHTTPRequestHandler):
def list_directory(self, path):
# Override the original file li... | 33.5 | 89 | 0.581686 |
07ae584d72679b8511ee66df34269e76847a6182 | 2,683 | py | Python | rlpyt/experiments/scripts/mujoco/launch/pabti/launch_mujoco_sac_serial.py | ZiwenZhuang/rlpyt | 95a05a86f576190cf6217fd9aad7b5f615ee97d1 | [
"MIT"
] | null | null | null | rlpyt/experiments/scripts/mujoco/launch/pabti/launch_mujoco_sac_serial.py | ZiwenZhuang/rlpyt | 95a05a86f576190cf6217fd9aad7b5f615ee97d1 | [
"MIT"
] | null | null | null | rlpyt/experiments/scripts/mujoco/launch/pabti/launch_mujoco_sac_serial.py | ZiwenZhuang/rlpyt | 95a05a86f576190cf6217fd9aad7b5f615ee97d1 | [
"MIT"
] | null | null | null |
from exptools.launching.affinity import encode_affinity
from exptools.launching.exp_launcher import run_experiments
from exptools.launching.variant import make_variants, VariantLevel
affinity_code = encode_affinity(
n_cpu_core=16,
n_gpu=8,
contexts_per_gpu=2,
hyperthread_offset=24,
n_socket=2,
... | 27.947917 | 77 | 0.745061 |
442ff98e8d92f81ec922c37afa1a92f1e3e3ffd2 | 3,263 | py | Python | src/main/beans/items/base_item.py | malcolmwhite/DungeonsAndDragons | f38f36f29b72a2228005756015d400f49e4339b6 | [
"MIT"
] | 4 | 2015-09-09T23:22:26.000Z | 2020-01-04T20:01:06.000Z | src/main/beans/items/base_item.py | malcolmwhite/DungeonsAndDragons | f38f36f29b72a2228005756015d400f49e4339b6 | [
"MIT"
] | null | null | null | src/main/beans/items/base_item.py | malcolmwhite/DungeonsAndDragons | f38f36f29b72a2228005756015d400f49e4339b6 | [
"MIT"
] | null | null | null | from src.main.utils.utils import generate_attribute
from src.main.utils.utils import raise_
class BaseItem(object):
# Name used to discern where item should be stored in item manager.
# Implementations of BaseItem should select a category name from ItemManager
CATEGORY_NAME = lambda: raise_(NotImplement... | 51.793651 | 116 | 0.647564 |
40f54d0d20aba7315e706dc47fc0d033c7eb3f5a | 1,107 | py | Python | repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 21 | 2018-11-20T15:58:39.000Z | 2022-03-15T19:57:24.000Z | repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 732 | 2018-11-21T18:33:26.000Z | 2022-03-31T16:16:24.000Z | repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 85 | 2018-11-20T17:55:00.000Z | 2022-03-29T09:40:31.000Z | import pytest
from leapp.libraries.common import persistentnetnames
from leapp.models import Interface, PCIAddress, PersistentNetNamesFacts
from leapp.snactor.fixture import current_actor_context
def interface_mocked(i=0):
return Interface(
name='n{}'.format(i),
devpath='dp{}'.format(i),
... | 29.131579 | 93 | 0.650407 |
980dc0da41c041a3aeaeb267910fe37ec46cb497 | 1,592 | py | Python | kaffepause/relationships/test/graphql_requests.py | Eirsteir/kaffepause | 77535f057e68d575831e3a44f36285ab2fe621d4 | [
"MIT"
] | null | null | null | kaffepause/relationships/test/graphql_requests.py | Eirsteir/kaffepause | 77535f057e68d575831e3a44f36285ab2fe621d4 | [
"MIT"
] | 2 | 2022-02-28T21:04:22.000Z | 2022-03-01T21:05:37.000Z | kaffepause/relationships/test/graphql_requests.py | Eirsteir/kaffepause | 77535f057e68d575831e3a44f36285ab2fe621d4 | [
"MIT"
] | null | null | null | """Queries and mutations used by the test suite."""
SEND_FRIEND_REQUEST_MUTATION = """
mutation sendFriendRequest($toFriend: String!) {
sendFriendRequest(toFriend: $toFriend) {
sentFriendRequestee {
uuid
}
success
errors
}
}
"""
C... | 21.513514 | 55 | 0.500628 |
9b0cd906904ccd8aa11a4e69050601b0e3af2d90 | 6,315 | py | Python | CreateCompetitionData/createCompetitionData.py | benhamner/ExpediaPersonalizedSortCompetition | 432cfee41ea2949328d56972cc0bfc82b3b81157 | [
"BSD-3-Clause"
] | 23 | 2015-04-06T21:49:22.000Z | 2021-03-08T18:10:41.000Z | CreateCompetitionData/createCompetitionData.py | benhamner/ExpediaPersonalizedSortCompetition | 432cfee41ea2949328d56972cc0bfc82b3b81157 | [
"BSD-3-Clause"
] | null | null | null | CreateCompetitionData/createCompetitionData.py | benhamner/ExpediaPersonalizedSortCompetition | 432cfee41ea2949328d56972cc0bfc82b3b81157 | [
"BSD-3-Clause"
] | 31 | 2015-01-07T12:58:54.000Z | 2022-01-02T23:06:44.000Z | from __future__ import division
import csv
import heapq
from itertools import ifilter
import json
import numpy as np
import os
def expedia_personalized_sort_data_split_seed():
seed_path = os.environ["SeedPath"]
seeds = json.loads(open(seed_path).read())
return seeds["ExpediaPersonalizedSortDataSplitSeed"]
... | 36.50289 | 92 | 0.631354 |
89040bf1c65485b8961d36c7ab67063f1b78339d | 1,047 | py | Python | src/OCR-Mike/pyimagesearch/az_dataset/helpers.py | EquipoIA/image-recon | f53cef4073b49fc20be44d2555eb2e88c5154b2e | [
"MIT"
] | null | null | null | src/OCR-Mike/pyimagesearch/az_dataset/helpers.py | EquipoIA/image-recon | f53cef4073b49fc20be44d2555eb2e88c5154b2e | [
"MIT"
] | null | null | null | src/OCR-Mike/pyimagesearch/az_dataset/helpers.py | EquipoIA/image-recon | f53cef4073b49fc20be44d2555eb2e88c5154b2e | [
"MIT"
] | null | null | null | # import the necessary packages
from tensorflow.keras.datasets import mnist
import numpy as np
#cargar la base de datos de letras
def load_az_dataset(datasetPath):
# inicialisar arreglos de datos y etiquetas
data = []
labels = []
# ciclo sobre las filas de la base de datos
for row in open(datasetPath):
# asigna... | 31.727273 | 71 | 0.722063 |
f28b84f7813f2dad60e31c8d5efb066a1e870aee | 1,452 | py | Python | tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | 1 | 2021-02-20T21:48:36.000Z | 2021-02-20T21:48:36.000Z | tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | null | null | null | tools/accuracy_checker/accuracy_checker/adapters/hit_ratio.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | 1 | 2018-12-14T07:52:51.000Z | 2018-12-14T07:52:51.000Z | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | 30.25 | 82 | 0.702479 |
36880dbeacaae6f85073796e3a71828419b5a438 | 915 | py | Python | site/exhibitionInferenceSite/exhibitionInferenceApp/admin.py | Marchhill/exhibition-inference | 2e349dabc1571e8b961ee8844ab692ecf9ad76e0 | [
"MIT"
] | 4 | 2022-02-21T13:05:31.000Z | 2022-03-15T02:14:10.000Z | site/exhibitionInferenceSite/exhibitionInferenceApp/admin.py | Marchhill/exhibition-inference | 2e349dabc1571e8b961ee8844ab692ecf9ad76e0 | [
"MIT"
] | null | null | null | site/exhibitionInferenceSite/exhibitionInferenceApp/admin.py | Marchhill/exhibition-inference | 2e349dabc1571e8b961ee8844ab692ecf9ad76e0 | [
"MIT"
] | 2 | 2022-03-16T22:10:48.000Z | 2022-03-16T22:12:34.000Z | from django.contrib import admin
from .models import Metadata, Session, Reading, Device
admin.site.site_header = "Exhibition Inference Database Admin"
class MetadataAdmin(admin.ModelAdmin):
list_display = ("key", "value")
class SessionAdmin(admin.ModelAdmin):
list_display = ("admin_session_id", "device_id... | 28.59375 | 75 | 0.731148 |
572f4746bdf5d665b053e8c1514cd6281922ad31 | 19,976 | py | Python | python/algo/misc.py | icdm-extract/extract | 18d6e8509f2f35719535e1de6c88874ec533cfb9 | [
"MIT"
] | 1 | 2019-03-05T01:17:05.000Z | 2019-03-05T01:17:05.000Z | python/algo/misc.py | icdm-extract/extract | 18d6e8509f2f35719535e1de6c88874ec533cfb9 | [
"MIT"
] | null | null | null | python/algo/misc.py | icdm-extract/extract | 18d6e8509f2f35719535e1de6c88874ec533cfb9 | [
"MIT"
] | null | null | null | #!/usr/env/python
import numpy as np
import matplotlib.pyplot as plt
# from scipy.ndimage import filters
from scipy.misc import logsumexp
# from scipy.stats import describe
from sklearn.decomposition import TruncatedSVD
from ..datasets import datasets
from ..datasets import synthetic as synth
from ..utils import arr... | 32.693944 | 101 | 0.706898 |
c4b07c3033f98a936936c0a94cafea3e6a209c86 | 4,280 | py | Python | openks/models/pytorch/mmd_modules/ThreeDVG/scripts/compute_multiview_features.py | vivym/OpenKS | ea380782162de2e4c1a413f37ad12b85ccb7048a | [
"Apache-2.0"
] | null | null | null | openks/models/pytorch/mmd_modules/ThreeDVG/scripts/compute_multiview_features.py | vivym/OpenKS | ea380782162de2e4c1a413f37ad12b85ccb7048a | [
"Apache-2.0"
] | null | null | null | openks/models/pytorch/mmd_modules/ThreeDVG/scripts/compute_multiview_features.py | vivym/OpenKS | ea380782162de2e4c1a413f37ad12b85ccb7048a | [
"Apache-2.0"
] | 2 | 2021-11-18T06:55:55.000Z | 2021-12-29T15:21:07.000Z | import os
import sys
import math
import torch
import argparse
import numpy as np
import torch.nn as nn
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader
from imageio import imread
from PIL import Image
from tqdm import tqdm
sys.path.append(os.path.join(os.getcwd())) # HACK ad... | 33.968254 | 160 | 0.650234 |
bfce443b7406e4680e3ad25690ae03c2658c36e9 | 199 | py | Python | forum/forms.py | rafaelbantu/timtec | 86c51b7440a044704ed33c3e752a6cf6b15ceae3 | [
"BSD-3-Clause"
] | 21 | 2015-09-23T14:07:16.000Z | 2022-02-18T01:35:18.000Z | forum/forms.py | rafaelbantu/timtec | 86c51b7440a044704ed33c3e752a6cf6b15ceae3 | [
"BSD-3-Clause"
] | 178 | 2016-05-10T16:16:19.000Z | 2021-12-15T20:21:21.000Z | forum/forms.py | rafaelbantu/timtec | 86c51b7440a044704ed33c3e752a6cf6b15ceae3 | [
"BSD-3-Clause"
] | 18 | 2015-10-23T13:28:17.000Z | 2021-09-22T13:08:28.000Z | # -*- coding: utf-8 -*-
from django import forms
from forum.models import Question
class QuestionForm(forms.ModelForm):
class Meta:
model = Question
fields = ('title', 'text')
| 18.090909 | 36 | 0.643216 |
6f4bf97f5ee9dcfd72a0a68451a7e1d08acbbb14 | 2,159 | py | Python | generate_submission.py | abdalazizrashid/idao-21-baseline | 649c2c70a1754b09fa06bf2264d7e8217b3e10f0 | [
"Apache-2.0"
] | 7 | 2021-03-11T15:25:01.000Z | 2021-03-16T23:31:37.000Z | generate_submission.py | abdalazizrashid/idao-21-baseline | 649c2c70a1754b09fa06bf2264d7e8217b3e10f0 | [
"Apache-2.0"
] | 4 | 2021-03-15T10:39:21.000Z | 2021-03-16T22:03:32.000Z | generate_submission.py | abdalazizrashid/idao-21-baseline | 649c2c70a1754b09fa06bf2264d7e8217b3e10f0 | [
"Apache-2.0"
] | 11 | 2021-03-12T08:17:02.000Z | 2021-07-19T13:56:34.000Z | import configparser
import gc
import logging
import pathlib as path
import sys
from collections import defaultdict
from itertools import chain
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scikitplot as skplt
import torch
from more_itertools import bu... | 29.175676 | 112 | 0.69245 |
29d25b9050a48c9734e5a08db8b1ac8e55136e9a | 869 | py | Python | var/spack/repos/builtin/packages/sowing/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/sowing/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/sowing/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Sowing(AutotoolsPackage):
"""Sowing generates Fortran interfaces and documentation for PE... | 36.208333 | 99 | 0.749137 |
6f3046627da9684f2bbfca25d9f863a630263113 | 911 | py | Python | admin_tools/dashboard/management/commands/customdashboard.py | hhru/lucid-python-django-admin-tools | a551fe988e18109239e59165081d931f15ed8cf9 | [
"MIT"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | base/site-packages/admin_tools/dashboard/management/commands/customdashboard.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 6 | 2018-03-30T10:06:12.000Z | 2021-06-10T17:59:44.000Z | admin_tools/dashboard/management/commands/customdashboard.py | artscoop/django-admin-tools | f98189615db5114ef3b136c90983a6bc5590c9af | [
"MIT"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z | import os
from django.core.management.base import BaseCommand, CommandError
from django.template.loader import render_to_string
DEFAULT_FILE = 'dashboard.py'
class Command(BaseCommand):
help = ('Creates a template file containing the base code to get you '
'started with your custom dashboard.')
ar... | 37.958333 | 80 | 0.654226 |
9738d7fb2912fd84aa0468622199b0fc69043232 | 23,109 | py | Python | python/target_selection/cartons/bhm_rm.py | sdss/target_selection | 7196bf1491c4e9c18140301c7001e503f391a8e1 | [
"BSD-3-Clause"
] | 3 | 2020-07-07T01:38:59.000Z | 2020-11-24T21:46:58.000Z | python/target_selection/cartons/bhm_rm.py | sdss/target_selection | 7196bf1491c4e9c18140301c7001e503f391a8e1 | [
"BSD-3-Clause"
] | 26 | 2020-05-28T07:18:54.000Z | 2021-11-30T18:36:10.000Z | python/target_selection/cartons/bhm_rm.py | sdss/target_selection | 7196bf1491c4e9c18140301c7001e503f391a8e1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Tom Dwelly
# @Date: 2020-03-31
# @Filename: bhm_rm.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
# derived from guide.py
# isort: skip_file
import peewee
from peewee import JOIN
from peewee import fn
from target_selection.cart... | 38.450915 | 99 | 0.45532 |
d9a796e728975146ee5fba89d10f830ea053ff7d | 40,471 | py | Python | ophyd/signal.py | lucask07/ophyd | f8d914d2f31728962284a2f4a6f2bd3deeb69638 | [
"BSD-3-Clause"
] | null | null | null | ophyd/signal.py | lucask07/ophyd | f8d914d2f31728962284a2f4a6f2bd3deeb69638 | [
"BSD-3-Clause"
] | 4 | 2018-06-07T20:46:11.000Z | 2018-07-06T18:18:37.000Z | ophyd/signal.py | lucask07/ophyd | f8d914d2f31728962284a2f4a6f2bd3deeb69638 | [
"BSD-3-Clause"
] | 1 | 2021-01-29T18:42:47.000Z | 2021-01-29T18:42:47.000Z | # vi: ts=4 sw=4
import logging
import time
import threading
import numpy as np
from .utils import ReadOnlyError, LimitError, set_and_wait
from .utils.epics_pvs import (waveform_to_string,
raise_if_disconnected, data_type, data_shape,
AlarmStatus, AlarmSeveri... | 32.903252 | 81 | 0.593783 |
4076244171d31ec935517d83fc25fef036f5a767 | 166 | py | Python | tests/__init__.py | druttka/iotedgedev | c1014993410f220cb8646e5bbdc7d87d064e27c5 | [
"MIT"
] | null | null | null | tests/__init__.py | druttka/iotedgedev | c1014993410f220cb8646e5bbdc7d87d064e27c5 | [
"MIT"
] | null | null | null | tests/__init__.py | druttka/iotedgedev | c1014993410f220cb8646e5bbdc7d87d064e27c5 | [
"MIT"
] | 1 | 2019-01-07T22:20:04.000Z | 2019-01-07T22:20:04.000Z | # -*- coding: utf-8 -*-
"""Test package for Azure IoT Edge Dev Tool ."""
__author__ = 'David Ruttka'
__email__ = 'david.ruttka@microsoft.com'
__version__ = '0.0.1'
| 20.75 | 48 | 0.662651 |
01647d4f2f75b32e40af8c5abc6c89af222decf3 | 13,973 | py | Python | python/ccxt/async/bitmarket.py | bilibilihuangyifan/ccxt | e3e058067808014c7110813d626d8a076ce96edb | [
"MIT"
] | 73 | 2018-05-15T00:53:50.000Z | 2022-03-07T14:45:11.000Z | python/ccxt/async/bitmarket.py | bilibilihuangyifan/ccxt | e3e058067808014c7110813d626d8a076ce96edb | [
"MIT"
] | 20 | 2018-05-15T08:46:45.000Z | 2018-06-19T08:49:27.000Z | python/ccxt/async/bitmarket.py | bilibilihuangyifan/ccxt | e3e058067808014c7110813d626d8a076ce96edb | [
"MIT"
] | 11 | 2018-05-15T00:09:30.000Z | 2022-03-07T14:45:27.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
class bitmarket (Exchange):
... | 39.583569 | 129 | 0.418665 |
99b5d101db36969e6a05786f9d0923620d1ea95b | 13,019 | py | Python | src/common/register_test_setups.py | libphy/SPTM | 095759412a01aeda8a9d01a659cf200e83e8362e | [
"MIT"
] | 99 | 2018-03-02T10:34:06.000Z | 2022-01-03T14:09:43.000Z | src/common/register_test_setups.py | buffv/SPTM | 74305a73e45e788db186da9442d2a4213009aa79 | [
"MIT"
] | 2 | 2019-09-14T05:45:16.000Z | 2021-11-18T10:28:44.000Z | src/common/register_test_setups.py | buffv/SPTM | 74305a73e45e788db186da9442d2a4213009aa79 | [
"MIT"
] | 32 | 2018-03-02T10:33:50.000Z | 2021-06-28T15:45:54.000Z | DATA_PATH = '../../data/'
class TestSetup:
def __init__(self,
dir,
wad,
memory_buffer_lmp,
goal_lmps,
maps,
exploration_map,
goal_locations,
goal_names,
box):
self.wad = DATA_PAT... | 40.557632 | 69 | 0.547507 |
24f7b8647aee1c313db07f9cb7e15a27a58afa71 | 4,521 | py | Python | mpf/platforms/smartmatrix.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | mpf/platforms/smartmatrix.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | mpf/platforms/smartmatrix.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | """Contains code for SmartMatrix RGB DMD."""
import logging
import asyncio
import threading
from typing import Dict
import serial
from mpf.platforms.interfaces.dmd_platform import DmdPlatformInterface
from mpf.exceptions.config_file_error import ConfigFileError
from mpf.core.platform import RgbDmdPlatform
class ... | 32.06383 | 120 | 0.625304 |
46809de03b71a3cbcc52ee2ee2dd69e364f5c79c | 2,522 | py | Python | main/migrations/0014_auto_20161124_1615.py | jsmnbom/htxaarhuslan | 5244c4e65f4912c5d2e193f1ac355b3206d1c1b8 | [
"MIT"
] | 1 | 2019-09-06T10:28:40.000Z | 2019-09-06T10:28:40.000Z | main/migrations/0014_auto_20161124_1615.py | jsmnbom/htxaarhuslan | 5244c4e65f4912c5d2e193f1ac355b3206d1c1b8 | [
"MIT"
] | 2 | 2018-10-22T10:33:04.000Z | 2019-01-31T19:36:04.000Z | main/migrations/0014_auto_20161124_1615.py | jsmnbom/htxaarhuslan | 5244c4e65f4912c5d2e193f1ac355b3206d1c1b8 | [
"MIT"
] | 1 | 2019-09-06T10:28:41.000Z | 2019-09-06T10:28:41.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-24 15:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import main.models
import main.storage
class Migration(migrations.Migration):
dependencies = [
('main', '0013_auto_20... | 34.081081 | 168 | 0.588818 |
8410c19b6b9ebfed5d1eaba7b85392d3f3ef7d98 | 6,090 | py | Python | tests/frameworks/test_task_store.py | xcorail/paasta | 3f132c73b45fcf0afc31ddb889205ecd9394d4bb | [
"Apache-2.0"
] | null | null | null | tests/frameworks/test_task_store.py | xcorail/paasta | 3f132c73b45fcf0afc31ddb889205ecd9394d4bb | [
"Apache-2.0"
] | 4 | 2021-02-08T20:42:08.000Z | 2021-06-02T00:51:04.000Z | tests/frameworks/test_task_store.py | eric-erki/An-open-distributed-platform-as-a-service | 6769c5601685deb1017910ab8d09109e8e998892 | [
"Apache-2.0"
] | null | null | null | import json
import mock
import pytest
from kazoo.client import KazooClient
from kazoo.exceptions import BadVersionError
from kazoo.exceptions import NodeExistsError
from kazoo.exceptions import NoNodeError
from paasta_tools.frameworks.task_store import DictTaskStore
from paasta_tools.frameworks.task_store import Meso... | 38.0625 | 118 | 0.642365 |
56bb12518a20ccf7931f16db869be6f6d5116c8c | 931 | py | Python | test/python/functional_tests/test_file_or_project.py | nihalshetty-boop/hyperstyle | 9a6d53cd1ca220d97d296c0087056b5885b26281 | [
"Apache-2.0"
] | null | null | null | test/python/functional_tests/test_file_or_project.py | nihalshetty-boop/hyperstyle | 9a6d53cd1ca220d97d296c0087056b5885b26281 | [
"Apache-2.0"
] | null | null | null | test/python/functional_tests/test_file_or_project.py | nihalshetty-boop/hyperstyle | 9a6d53cd1ca220d97d296c0087056b5885b26281 | [
"Apache-2.0"
] | null | null | null | import subprocess
from test.python.functional_tests.conftest import DATA_PATH, LocalCommandBuilder
def test_inspect_file_works(local_command: LocalCommandBuilder):
file_path = DATA_PATH / 'file_or_project' / 'file.py'
local_command.path = file_path
process = subprocess.run(
local_command.build(... | 25.162162 | 80 | 0.707841 |
6d85addc04d04107f00459bc404d53214c504c46 | 901 | py | Python | src/videoprocessing/object_detect/process_frame.py | deep-cube/deep-cube | de4623e94e569a2f09f3f0b1c332618bca753a77 | [
"MIT"
] | 1 | 2022-01-27T00:34:37.000Z | 2022-01-27T00:34:37.000Z | src/videoprocessing/object_detect/process_frame.py | deep-cube/deep-cube | de4623e94e569a2f09f3f0b1c332618bca753a77 | [
"MIT"
] | 5 | 2021-04-30T21:13:30.000Z | 2022-01-27T16:12:08.000Z | src/videoprocessing/object_detect/process_frame.py | deep-cube/deep-cube | de4623e94e569a2f09f3f0b1c332618bca753a77 | [
"MIT"
] | null | null | null |
from object_detect import *
import numpy as np
cap = cv2.VideoCapture('../../../data/video/kevin_single_moves_2.mp4')
# Check if camera opened successfully
if (cap.isOpened()== False):
print("Error opening video stream or file")
# Set up the detector, can also use mode='segmentation'
detector = ObjectDetector(... | 23.102564 | 70 | 0.692564 |
c7ec08ff401e8e98bd3fa778b964bff1247c29f2 | 696 | py | Python | benchmarks/common.py | loj/datalad | 26e1e54baea82d21748f44adc26b7eacec2d216b | [
"MIT"
] | null | null | null | benchmarks/common.py | loj/datalad | 26e1e54baea82d21748f44adc26b7eacec2d216b | [
"MIT"
] | 6 | 2015-11-20T21:41:13.000Z | 2018-06-12T14:27:32.000Z | benchmarks/common.py | loj/datalad | 26e1e54baea82d21748f44adc26b7eacec2d216b | [
"MIT"
] | 1 | 2017-03-28T14:44:16.000Z | 2017-03-28T14:44:16.000Z | # ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Helpers for benc... | 30.26087 | 79 | 0.557471 |
e9a90379e1bcc6cc74f47641692d0cee92cf3d18 | 1,112 | py | Python | MEAV/memory.py | hfwittmann/MEAV | 38aa9dadb4ce313dd483e5186e4f9377af19e693 | [
"MIT"
] | null | null | null | MEAV/memory.py | hfwittmann/MEAV | 38aa9dadb4ce313dd483e5186e4f9377af19e693 | [
"MIT"
] | null | null | null | MEAV/memory.py | hfwittmann/MEAV | 38aa9dadb4ce313dd483e5186e4f9377af19e693 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 7 12:20:02 2018
@author: hfwittmann
"""
class Memory:
def __init__(self, capacity):
# capacity : how much memory can the class hold?
self.capacity = capacity
self.clear()
return None
def ... | 23.166667 | 67 | 0.504496 |
9fe475aa05033e4b203dec5c0044ecb568c561f0 | 2,042 | py | Python | examples/cinder/04_list_search.py | hustbeta/openstack-juno-api-adventure | 0c62cdc33599256ca7063478bb1e2906a8a6c2a2 | [
"MIT"
] | 4 | 2015-08-27T08:39:15.000Z | 2020-06-24T01:47:30.000Z | examples/cinder/04_list_search.py | hustbeta/openstack-juno-api-adventure | 0c62cdc33599256ca7063478bb1e2906a8a6c2a2 | [
"MIT"
] | null | null | null | examples/cinder/04_list_search.py | hustbeta/openstack-juno-api-adventure | 0c62cdc33599256ca7063478bb1e2906a8a6c2a2 | [
"MIT"
] | 2 | 2015-08-27T08:39:20.000Z | 2018-11-20T08:48:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import keystoneclient.auth.identity.v3
import keystoneclient.session
import cinderclient.client
import local_settings
def to_dict(volume):
"""volume没有to_dict()方法,这里加一个,方便转为json"""
attrs = ['attachments', 'availability_zone', 'bootable', 'consistencygr... | 51.05 | 106 | 0.642018 |
c7fe84f0b2b02b76bc515c7886ba8cafcd482990 | 2,066 | py | Python | awx/main/notifications/rocketchat_backend.py | iamroddo/awx | b04e944ea52586c722843e7557f649fea4cd1287 | [
"Apache-2.0"
] | 2 | 2018-11-12T18:52:24.000Z | 2020-05-22T18:41:21.000Z | awx/main/notifications/rocketchat_backend.py | iamroddo/awx | b04e944ea52586c722843e7557f649fea4cd1287 | [
"Apache-2.0"
] | 4 | 2022-02-15T01:33:35.000Z | 2022-03-02T12:47:41.000Z | awx/main/notifications/rocketchat_backend.py | iamroddo/awx | b04e944ea52586c722843e7557f649fea4cd1287 | [
"Apache-2.0"
] | 9 | 2019-05-11T00:03:30.000Z | 2021-07-07T16:09:17.000Z | # Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import logging
import requests
import json
from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _
from awx.main.notifications.base import AWXBaseEmailBackend
logger = logging.getLogger('awx.main.notifications.rock... | 39.730769 | 138 | 0.641336 |
0cdb4c424b80297813247f17d17e04fdfd2e5683 | 13,760 | py | Python | mesonbuild/envconfig.py | ueno/meson | 5a0fec13b6463f45f88860d67e8fb50f34c8d739 | [
"Apache-2.0"
] | null | null | null | mesonbuild/envconfig.py | ueno/meson | 5a0fec13b6463f45f88860d67e8fb50f34c8d739 | [
"Apache-2.0"
] | null | null | null | mesonbuild/envconfig.py | ueno/meson | 5a0fec13b6463f45f88860d67e8fb50f34c8d739 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | 35.833333 | 132 | 0.615189 |
e905a738cea67ba6d9425d8f94127615ae63311a | 3,314 | py | Python | doc/integrations/pytorch/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_self_chat.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-10-08T06:14:16.000Z | 2021-10-08T06:14:16.000Z | doc/integrations/pytorch/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_self_chat.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-08-04T11:17:39.000Z | 2021-08-04T11:17:39.000Z | doc/integrations/pytorch/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_self_chat.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-05-03T13:27:14.000Z | 2021-05-03T13:27:14.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the Fast ACUTE crowdsourcing task.
"""
import os
import shutil
import tempfile
im... | 33.816327 | 114 | 0.608328 |
e8e6ac0785d30430b1c7a8bb642033cec93c31c7 | 231 | py | Python | backend/tests/mocks.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 8 | 2019-06-03T16:29:49.000Z | 2021-05-11T20:38:36.000Z | backend/tests/mocks.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 342 | 2019-01-15T19:13:58.000Z | 2020-03-24T16:38:13.000Z | backend/tests/mocks.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 5 | 2019-02-15T09:06:47.000Z | 2022-01-24T21:38:41.000Z | def mock_request(response):
def mock_request_func(*args, **kwargs):
class MockResponse:
def json(self):
return {'data': response}
return MockResponse()
return mock_request_func
| 23.1 | 43 | 0.606061 |
47bf1b21253bda52dbed1e3f0011b9701c89abd3 | 634 | py | Python | backend/manage.py | crowdbotics-apps/nametest-34052 | 2c38aea05036aa8a7aaae1093457df85892bc710 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/nametest-34052 | 2c38aea05036aa8a7aaae1093457df85892bc710 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/nametest-34052 | 2c38aea05036aa8a7aaae1093457df85892bc710 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'nametest_34052.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise... | 28.818182 | 78 | 0.68612 |
7a4ba0e21b65b905d8092f8e5a0f886ddacd4d80 | 393 | py | Python | Day1/plusOperation.py | ananthramas/pythonEducation | 7abd0341ee6cf46aaf3b337ba5870e3e3ea72e83 | [
"MIT"
] | null | null | null | Day1/plusOperation.py | ananthramas/pythonEducation | 7abd0341ee6cf46aaf3b337ba5870e3e3ea72e83 | [
"MIT"
] | null | null | null | Day1/plusOperation.py | ananthramas/pythonEducation | 7abd0341ee6cf46aaf3b337ba5870e3e3ea72e83 | [
"MIT"
] | 1 | 2021-03-16T00:04:42.000Z | 2021-03-16T00:04:42.000Z | akash_age = 10
pranav_age = 12
sarabsh_age = 15
# if variables are of type int/float '+' will add values
sum_of_age = akash_age+pranav_age+sarabsh_age
print ("Sum of ages : ", sum_of_age)
# for string varaibles '+' will concatenate
akash_first_name = "Akash"
akash_last_name = "Gupta"
akash_full_name = akash_first... | 23.117647 | 56 | 0.750636 |
05a633dc71bbead448092e1329ee557284dd191a | 16,915 | py | Python | lib/nats_bench/api_topology.py | rainwangphy/AutoDL-Projects | 1a40948255ac3c16ee529d94144a39bf26e89bfa | [
"MIT"
] | null | null | null | lib/nats_bench/api_topology.py | rainwangphy/AutoDL-Projects | 1a40948255ac3c16ee529d94144a39bf26e89bfa | [
"MIT"
] | null | null | null | lib/nats_bench/api_topology.py | rainwangphy/AutoDL-Projects | 1a40948255ac3c16ee529d94144a39bf26e89bfa | [
"MIT"
] | null | null | null | #####################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020.08 #
##############################################################################
# NATS-Bench: Benchmarking NAS algorithms for Architecture Topology and Size #
######################################################... | 49.896755 | 342 | 0.63689 |
4e793e36937f11e2b1ca089b047a68228188c7ca | 2,162 | py | Python | epytope/Data/pssms/tepitopepan/mat/DRB1_1149_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/tepitopepan/mat/DRB1_1149_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/tepitopepan/mat/DRB1_1149_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | DRB1_1149_9 = {0: {'A': -999.0, 'E': -999.0, 'D': -999.0, 'G': -999.0, 'F': -0.004754, 'I': -0.99525, 'H': -999.0, 'K': -999.0, 'M': -0.99525, 'L': -0.99525, 'N': -999.0, 'Q': -999.0, 'P': -999.0, 'S': -999.0, 'R': -999.0, 'T': -999.0, 'W': -0.004754, 'V': -0.99525, 'Y': -0.004754}, 1: {'A': 0.0, 'E': 0.1, 'D': -1.3, '... | 2,162 | 2,162 | 0.392692 |
13b774d8773441547bf6571130cebcd2854b6dc9 | 44 | py | Python | notebooks/_solutions/pandas_04_time_series_data9.py | jonasvdd/DS-python-data-analysis | 835226f562ee0b0631d70e48a17c4526ff58a538 | [
"BSD-3-Clause"
] | 65 | 2017-03-21T09:15:40.000Z | 2022-02-01T23:43:08.000Z | notebooks/_solutions/pandas_04_time_series_data9.py | jonasvdd/DS-python-data-analysis | 835226f562ee0b0631d70e48a17c4526ff58a538 | [
"BSD-3-Clause"
] | 100 | 2016-12-15T03:44:06.000Z | 2022-03-07T08:14:07.000Z | notebooks/_solutions/pandas_04_time_series_data9.py | jorisvandenbossche/ICES-python-data | 63864947657f37cb26cb4e2dcd67ff106dffe9cd | [
"BSD-3-Clause"
] | 52 | 2016-12-19T07:48:52.000Z | 2022-02-19T17:53:48.000Z | data['2013':'2013'].mean().plot(kind='barh') | 44 | 44 | 0.636364 |
a7be7646dae735b11055b4b135bf5ea99b1c97f9 | 620 | py | Python | connery/modules/announce.py | mclellac/connery | d7444a46e023c8f5261d5b462ae970096cfecf0f | [
"EFL-2.0"
] | null | null | null | connery/modules/announce.py | mclellac/connery | d7444a46e023c8f5261d5b462ae970096cfecf0f | [
"EFL-2.0"
] | null | null | null | connery/modules/announce.py | mclellac/connery | d7444a46e023c8f5261d5b462ae970096cfecf0f | [
"EFL-2.0"
] | null | null | null | # coding=utf8
"""
announce.py - Send a message to all channels
Copyright © 2013, Elad Alfassa, <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
"""
from __future__ import unicode_literals
from connery.module import commands, example
@commands('announce')
@example('.announce Some important message... | 25.833333 | 64 | 0.695161 |
32208af9f4e5964ccb8da84f510420f5a06414eb | 1,835 | py | Python | scripts/test_case.py | ir5/chainer-compiler | c6d9b9ba3175931321c1e512c17642a613c03bfc | [
"MIT"
] | null | null | null | scripts/test_case.py | ir5/chainer-compiler | c6d9b9ba3175931321c1e512c17642a613c03bfc | [
"MIT"
] | null | null | null | scripts/test_case.py | ir5/chainer-compiler | c6d9b9ba3175931321c1e512c17642a613c03bfc | [
"MIT"
] | null | null | null | import os
def makedirs(d):
if not os.path.exists(d):
os.makedirs(d)
class TestCase(object):
def __init__(self, basedir=None, name=None, test_dir=None,
rtol=None, atol=None, equal_nan=False, fail=False,
skip_shape_inference=False,
skip_runtime_type_... | 31.101695 | 69 | 0.590736 |
071c2f378902965971a77d46911fd89a85a18bdc | 3,751 | py | Python | tools/wptrunner/wptrunner/formatters/chromium.py | yinghuazhilian/wpt | 3efff9b2d66aed3d8e2061205069883fd54df2be | [
"BSD-3-Clause"
] | 1 | 2020-07-03T21:13:22.000Z | 2020-07-03T21:13:22.000Z | tools/wptrunner/wptrunner/formatters/chromium.py | yinghuazhilian/wpt | 3efff9b2d66aed3d8e2061205069883fd54df2be | [
"BSD-3-Clause"
] | null | null | null | tools/wptrunner/wptrunner/formatters/chromium.py | yinghuazhilian/wpt | 3efff9b2d66aed3d8e2061205069883fd54df2be | [
"BSD-3-Clause"
] | 1 | 2017-09-04T11:09:07.000Z | 2017-09-04T11:09:07.000Z | import json
import time
from collections import defaultdict
from mozlog.formatters import base
class ChromiumFormatter(base.BaseFormatter):
"""Formatter to produce results matching the Chromium JSON Test Results format.
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_fo... | 38.27551 | 100 | 0.631832 |
aeff2f77d003faa66102ff64c7d3ec3bfd27f436 | 1,810 | py | Python | src/server/app/main/services/user_service.py | lalitsheoran/execode | 71de66eaee1c237677e60e379346c87bcca951a7 | [
"MIT"
] | null | null | null | src/server/app/main/services/user_service.py | lalitsheoran/execode | 71de66eaee1c237677e60e379346c87bcca951a7 | [
"MIT"
] | null | null | null | src/server/app/main/services/user_service.py | lalitsheoran/execode | 71de66eaee1c237677e60e379346c87bcca951a7 | [
"MIT"
] | null | null | null | from app.main.models.UsersModel import UserModel
from app.main import login_manager, db
import uuid
import datetime
@login_manager.user_loader
def load_user(user_id):
"""
[summary]
Args:
user_id ([type]): [description]
Returns:
[type]: [description]
"""
return UserModel.query... | 24.459459 | 78 | 0.601657 |
6a0cbb8e3e6cf9146424c466f4e9b4aa997dfd76 | 754 | py | Python | cowrie/commands/sleep.py | SecPascal/cowrie | 9dc70d788a65f087e8cebbb2e272dacf90928c80 | [
"BSD-3-Clause"
] | 12 | 2018-01-21T18:29:05.000Z | 2021-11-09T08:03:28.000Z | cowrie/commands/sleep.py | r3p3r/micheloosterhof-cowrie | 58d36cf1563eeaf3e660bff83c89ec0dc993c3a2 | [
"BSD-3-Clause"
] | null | null | null | cowrie/commands/sleep.py | r3p3r/micheloosterhof-cowrie | 58d36cf1563eeaf3e660bff83c89ec0dc993c3a2 | [
"BSD-3-Clause"
] | 8 | 2015-12-17T05:41:51.000Z | 2019-09-27T05:06:37.000Z | # Copyright (c) 2015 Michel Oosterhof <michel@oosterhof.net>
# All rights reserved.
"""
This module contains the sleep command
"""
from __future__ import division, absolute_import
from twisted.internet import reactor
from cowrie.shell.honeypot import HoneyPotCommand
commands = {}
class command_sleep(HoneyPotComma... | 18.390244 | 64 | 0.594164 |
f8c315cfbe7c0af2853d580ce6d15dc032041de9 | 13,870 | py | Python | DeepLearningExamples/TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/target_assigner.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | null | null | null | DeepLearningExamples/TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/target_assigner.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | null | null | null | DeepLearningExamples/TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/target_assigner.py | puririshi98/benchmark | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 45.775578 | 111 | 0.688825 |
860bb1a6b2cb6d152f4929a4ba9695c092b9ae0b | 1,673 | py | Python | ztf_viewer/pages/akb_table.py | snad-space/ztf-viewer | a0152d415beb11095134d0e407956ea088db1684 | [
"MIT"
] | 2 | 2020-11-14T02:24:57.000Z | 2021-06-04T06:13:42.000Z | ztf_viewer/pages/akb_table.py | snad-space/ztf-viewer | a0152d415beb11095134d0e407956ea088db1684 | [
"MIT"
] | 74 | 2020-07-13T09:38:41.000Z | 2022-03-31T15:58:04.000Z | ztf_viewer/pages/akb_table.py | snad-space/ztf-viewer | a0152d415beb11095134d0e407956ea088db1684 | [
"MIT"
] | null | null | null | from datetime import datetime
import dash_html_components as html
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from dash_table import DataTable
from ztf_viewer.akb import akb
from ztf_viewer.app import app
def get_layout(pathname):
return html.Div([
html.H... | 31.566038 | 103 | 0.560669 |
d8505c985bd5637991040da1c3e8eac313425ff9 | 6,126 | py | Python | rosshow/src/librosshow/viewers/sensor_msgs/NavSatFixViewer.py | homer-robotics/rosshow | f2fb65f42709016404870ecf636ec6564deeb1a1 | [
"BSD-3-Clause"
] | null | null | null | rosshow/src/librosshow/viewers/sensor_msgs/NavSatFixViewer.py | homer-robotics/rosshow | f2fb65f42709016404870ecf636ec6564deeb1a1 | [
"BSD-3-Clause"
] | null | null | null | rosshow/src/librosshow/viewers/sensor_msgs/NavSatFixViewer.py | homer-robotics/rosshow | f2fb65f42709016404870ecf636ec6564deeb1a1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import functools
from io import BytesIO, StringIO
import math
import numpy as np
import requests
import time
import librosshow.termgraphics as termgraphics
# <rant>
# had issues with accessing the openstreetmap tile server over IPv6.
# force IPv4 for now. the world isn't ready for IPv6 yet. :-... | 34.610169 | 134 | 0.577375 |
dde56fd72bd73a057d30c9d0c5953670f0861b7c | 1,837 | py | Python | magnumclient/osc/plugin.py | starlingx-staging/stx-python-magnumclient | 1d9a0bb412c8afb6d7176107b842c94861e78644 | [
"Apache-2.0"
] | null | null | null | magnumclient/osc/plugin.py | starlingx-staging/stx-python-magnumclient | 1d9a0bb412c8afb6d7176107b842c94861e78644 | [
"Apache-2.0"
] | null | null | null | magnumclient/osc/plugin.py | starlingx-staging/stx-python-magnumclient | 1d9a0bb412c8afb6d7176107b842c94861e78644 | [
"Apache-2.0"
] | 1 | 2019-01-11T16:12:44.000Z | 2019-01-11T16:12:44.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 32.22807 | 77 | 0.670659 |
4179642a05b7b728526cc1b6a09aafddb6ebb6a3 | 8,757 | py | Python | gnn.py | xuexue/neural-guided-minikanren | 7684e4191e22adc236f6d67f742893b7788417c8 | [
"MIT"
] | 74 | 2018-07-25T16:30:50.000Z | 2022-01-07T01:58:07.000Z | gnn.py | xuexue/neural-guided-minikanren | 7684e4191e22adc236f6d67f742893b7788417c8 | [
"MIT"
] | null | null | null | gnn.py | xuexue/neural-guided-minikanren | 7684e4191e22adc236f6d67f742893b7788417c8 | [
"MIT"
] | 10 | 2018-09-18T13:00:40.000Z | 2021-08-14T15:25:57.000Z | """For using a Graph Neural Network (GNN) to guide miniKanren"""
import random
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from torch.autograd import Variable
import lisp
import helper
from helper import MLP, MergeMLP
from interact import Interaction
fr... | 34.476378 | 163 | 0.582848 |
71f7ffb7ee9cf7b91433f3a10ee4b0e724a9ee33 | 1,376 | py | Python | tests/test_ml_stratifiers.py | Aroksak/iterative-stratification | 0a108bc2062fd32f98c9a6305508ea213292ba08 | [
"BSD-3-Clause"
] | 661 | 2018-02-23T23:19:08.000Z | 2022-03-18T08:27:15.000Z | good_github_tools/iterative-stratification/tests/test_ml_stratifiers.py | lyw615/code_accumulation | 5b2a5c039a725def37e19f226906ed1087880118 | [
"MIT"
] | 19 | 2018-02-24T16:06:46.000Z | 2021-11-11T13:00:13.000Z | good_github_tools/iterative-stratification/tests/test_ml_stratifiers.py | lyw615/code_accumulation | 5b2a5c039a725def37e19f226906ed1087880118 | [
"MIT"
] | 60 | 2018-02-24T16:56:38.000Z | 2022-03-14T19:32:20.000Z |
from unittest import TestCase, main
import numpy as np
from iterstrat.ml_stratifiers import MultilabelStratifiedKFold
class TestMultilabelStratifiedKFold(TestCase):
def test_integration(self):
def _test(n_labels, n_samples, n_splits):
x = np.zeros((n_samples, 2)) # This is not used in t... | 36.210526 | 89 | 0.545785 |
7346139d8350eb88229c8bb92983a8b1bcd468ca | 1,852 | py | Python | tests/test_derived_spatial_point.py | seung-lab/EMAnnotationSchemas | ef1061ca78860d53f1cd180496e87ad685a32ffe | [
"MIT"
] | null | null | null | tests/test_derived_spatial_point.py | seung-lab/EMAnnotationSchemas | ef1061ca78860d53f1cd180496e87ad685a32ffe | [
"MIT"
] | 18 | 2018-08-15T17:38:04.000Z | 2022-02-18T02:08:28.000Z | tests/test_derived_spatial_point.py | fcollman/EMAnnotationSchemas | bcc9f308868b2ea3e1504089d9cbab878b626acc | [
"MIT"
] | 5 | 2018-08-14T22:39:49.000Z | 2021-10-05T16:36:07.000Z | from emannotationschemas.schemas.derived_spatial_point import (
DerivedNumeric,
DerivedSpatialPoint,
DerivedTag,
)
derived_spatial_point_data = {
"position": [31, 31, 0],
"supervoxel_id": 122,
"root_id": 3232,
"dependent_chunk": 1,
"level": 2,
}
derived_tag_data = {
"pt": {
... | 25.369863 | 63 | 0.595032 |
88dbb16170b7eb8809556814fb1388baee24c001 | 17,356 | py | Python | generate_xml_from_google_services_json.py | oliwilkinsonio/firebase-cpp-sdk | 1a2790030e92f77ad2aaa87000a1222d12dcabfc | [
"Apache-2.0"
] | 193 | 2019-03-18T16:30:43.000Z | 2022-03-30T17:39:32.000Z | generate_xml_from_google_services_json.py | oliwilkinsonio/firebase-cpp-sdk | 1a2790030e92f77ad2aaa87000a1222d12dcabfc | [
"Apache-2.0"
] | 647 | 2019-03-18T20:50:41.000Z | 2022-03-31T18:32:33.000Z | generate_xml_from_google_services_json.py | oliwilkinsonio/firebase-cpp-sdk | 1a2790030e92f77ad2aaa87000a1222d12dcabfc | [
"Apache-2.0"
] | 86 | 2019-04-21T09:40:38.000Z | 2022-03-26T20:48:37.000Z | #!/usr/bin/python
# Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 34.921529 | 158 | 0.649631 |
f7661bad60badd2c013f9e36de36265fd6cd9edd | 5,106 | py | Python | flair/models/language_model.py | shuu-tatsu/subwordsLM | baae8657e3cd2957689b2365155156cd9d18cad8 | [
"MIT"
] | null | null | null | flair/models/language_model.py | shuu-tatsu/subwordsLM | baae8657e3cd2957689b2365155156cd9d18cad8 | [
"MIT"
] | 1 | 2020-08-19T08:37:49.000Z | 2020-08-19T08:37:49.000Z | flair/models/language_model.py | shuu-tatsu/subwordsLM | baae8657e3cd2957689b2365155156cd9d18cad8 | [
"MIT"
] | 1 | 2020-06-02T11:56:05.000Z | 2020-06-02T11:56:05.000Z | import torch.nn as nn
import torch
import math
from torch.autograd import Variable
from typing import Dict, List
from flair.data import Dictionary
class LanguageModel(nn.Module):
"""Container module with an encoder, a recurrent module, and a decoder."""
def __init__(self,
dictionary: Diction... | 34.268456 | 92 | 0.582648 |
42f94f2d218287b3cbb542528c30bb84086ce160 | 579 | py | Python | Chapter05/dataset.py | sweaterr/Hands-On-Neural-Networks-with-TensorFlow-2.0 | e9a76ee25d359e5e7652d6301c116fa071ded13d | [
"MIT"
] | 1 | 2020-01-29T13:38:27.000Z | 2020-01-29T13:38:27.000Z | Chapter05/dataset.py | sweaterr/Hands-On-Neural-Networks-with-TensorFlow-2.0 | e9a76ee25d359e5e7652d6301c116fa071ded13d | [
"MIT"
] | null | null | null | Chapter05/dataset.py | sweaterr/Hands-On-Neural-Networks-with-TensorFlow-2.0 | e9a76ee25d359e5e7652d6301c116fa071ded13d | [
"MIT"
] | null | null | null | import tensorflow as tf
dataset = tf.data.Dataset.from_tensor_slices({
"a":
tf.random.uniform([4]),
"b":
tf.random.uniform([4, 100], maxval=100, dtype=tf.int32)
})
for value in dataset:
print(value["a"])
def noise():
while True:
yield tf.random.uniform((100,))
dataset = tf.data.Data... | 21.444444 | 78 | 0.656304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.