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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e162d03b2d444fb9c15d3bb29545b543108922e2 | 7,999 | py | Python | uasyncio/uasyncio/__init__.py | ccooper21/micropython-lib | d19253a222fd6ec789ce04949ab36abb6b9d30e7 | [
"PSF-2.0"
] | 1 | 2019-07-31T12:39:53.000Z | 2019-07-31T12:39:53.000Z | uasyncio/uasyncio/__init__.py | ccooper21/micropython-lib | d19253a222fd6ec789ce04949ab36abb6b9d30e7 | [
"PSF-2.0"
] | null | null | null | uasyncio/uasyncio/__init__.py | ccooper21/micropython-lib | d19253a222fd6ec789ce04949ab36abb6b9d30e7 | [
"PSF-2.0"
] | 2 | 2017-11-21T16:53:03.000Z | 2021-07-29T08:47:14.000Z | import uerrno
import uselect as select
import usocket as _socket
from uasyncio.core import *
DEBUG = 0
log = None
def set_debug(val):
global DEBUG, log
DEBUG = val
if val:
import logging
log = logging.getLogger("uasyncio")
class PollEventLoop(EventLoop):
def __init__(self, len=42):... | 31.868526 | 88 | 0.554694 |
49c540ff6369f48774894a4bccac4120314f0ac6 | 895 | py | Python | meiduo_mall/meiduo_mall/apps/users/urls.py | infotit/mdmall | c1d215ca6314a4ebe4aa1ffdeb6ec6b3486ec751 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/users/urls.py | infotit/mdmall | c1d215ca6314a4ebe4aa1ffdeb6ec6b3486ec751 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/users/urls.py | infotit/mdmall | c1d215ca6314a4ebe4aa1ffdeb6ec6b3486ec751 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
from rest_framework_jwt.views import obtain_jwt_token
urlpatterns = [
url(r'^users/$', views.UserView.as_view()),
url(r'usernames/(?P<username>\w{5,20})/count/', views.UsernameCountView.as_view()),
url(r'mobiles/(?P<mobile>1[345789]\d{9})/count/', views... | 38.913043 | 96 | 0.672626 |
45d71276637a8c0bd5e55e2999fb5a8f5d572a76 | 625 | py | Python | manage.py | Guo-xuejian/- | 100114eaba3fe4cc4f6ac7c67e2266b44d1a245b | [
"MulanPSL-1.0"
] | 1 | 2022-01-26T12:58:30.000Z | 2022-01-26T12:58:30.000Z | manage.py | Guo-xuejian/bugua | 100114eaba3fe4cc4f6ac7c67e2266b44d1a245b | [
"MulanPSL-1.0"
] | null | null | null | manage.py | Guo-xuejian/bugua | 100114eaba3fe4cc4f6ac7c67e2266b44d1a245b | [
"MulanPSL-1.0"
] | 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', 'bugua.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportEr... | 28.409091 | 73 | 0.6816 |
f94d7f702529a4b6955a17716f87ec4c8ed25ad4 | 98,270 | py | Python | smlnjkernel.py | twyair/simple-ismlnj | f189108fac073b80a97597f587bfa769b20ee2a2 | [
"MIT"
] | null | null | null | smlnjkernel.py | twyair/simple-ismlnj | f189108fac073b80a97597f587bfa769b20ee2a2 | [
"MIT"
] | null | null | null | smlnjkernel.py | twyair/simple-ismlnj | f189108fac073b80a97597f587bfa769b20ee2a2 | [
"MIT"
] | 1 | 2022-03-14T18:29:32.000Z | 2022-03-14T18:29:32.000Z | import html
import json
import re
from typing import Dict, List, Optional, Any
import re
import signal
from ipykernel.kernelbase import Kernel
from ipykernel.kernelapp import IPKernelApp
import pexpect
from subprocess import check_output
crlf_pat = re.compile(r"[\r\n]+")
REGEX_WORD = re.compile(r"(\w+)$")
SML_KEYWORD... | 108.585635 | 1,720 | 0.612293 |
4a782c64ecb206670ce7ca4a27db98416c29344a | 2,096 | py | Python | conanfile.py | mjvk/conan-coverxygen_installer | 132cdc3695255e264509a114899c9ee496ba0e75 | [
"MIT"
] | null | null | null | conanfile.py | mjvk/conan-coverxygen_installer | 132cdc3695255e264509a114899c9ee496ba0e75 | [
"MIT"
] | null | null | null | conanfile.py | mjvk/conan-coverxygen_installer | 132cdc3695255e264509a114899c9ee496ba0e75 | [
"MIT"
] | null | null | null | from conans import ConanFile
from conans import tools
import subprocess
import os
import codecs
class CoverxygenConan(ConanFile):
name = "coverxygen_installer"
version = "1.5.0"
url = "https://github.com/mjvk/conan-covergygen_installer"
homepage = "https://github.com/psycofdj/coverxygen"
topics = (... | 40.307692 | 239 | 0.649809 |
dcc2bb0a96f51c1c26238e9505d601f65fd21ec1 | 477 | py | Python | example_apps/shopping_list.py | jock-dalby/pythonTreehouse | ba24d36ba9f4013c99a0e081c06bc4891fe78212 | [
"MIT"
] | null | null | null | example_apps/shopping_list.py | jock-dalby/pythonTreehouse | ba24d36ba9f4013c99a0e081c06bc4891fe78212 | [
"MIT"
] | null | null | null | example_apps/shopping_list.py | jock-dalby/pythonTreehouse | ba24d36ba9f4013c99a0e081c06bc4891fe78212 | [
"MIT"
] | null | null | null | # make a list to hold onto items
shopping_list = []
# print out instructions on how to use the app
print("What should we pick up from the store?")
print("Enter 'DONE' to stop adding items")
while True:
# ask for new items
new_item = input("> ")
#be able to quit the app
if new_item.lower() == "done":
brea... | 19.875 | 47 | 0.687631 |
05a3a44d4488f753f52923ed8867aeab2cb12938 | 576 | py | Python | 0 - CURSOS/11_Introducao a programacao com Python/aula8_lambda.py | saldanhayg/Bootcamp_Banco_Carrefour_Data_Engineer | 00c3b070e1c9f6e31293399521d7c5d1e97dc309 | [
"MIT"
] | null | null | null | 0 - CURSOS/11_Introducao a programacao com Python/aula8_lambda.py | saldanhayg/Bootcamp_Banco_Carrefour_Data_Engineer | 00c3b070e1c9f6e31293399521d7c5d1e97dc309 | [
"MIT"
] | null | null | null | 0 - CURSOS/11_Introducao a programacao com Python/aula8_lambda.py | saldanhayg/Bootcamp_Banco_Carrefour_Data_Engineer | 00c3b070e1c9f6e31293399521d7c5d1e97dc309 | [
"MIT"
] | null | null | null | contador_letras = lambda lista: [len(x) for x in lista]
lista_animais = ['cachorro', 'gato', 'elefante']
print(contador_letras(lista_animais))
soma = lambda a,b: a + b
subtracao = lambda a,b: a - b
print(soma(10,5))
print(subtracao(10,5))
calculadora = {
'soma': lambda a, b: a + b,
'subtracao': lambda a, b: ... | 27.428571 | 58 | 0.651042 |
163587f86f3862f0a9d77fb1b5e79f89ede505c4 | 355 | py | Python | fabric_cf/orchestrator/swagger_server/__init__.py | fabric-testbed/ActorBase | 3c7dd040ee79fef0759e66996c93eeec57c790b2 | [
"MIT"
] | null | null | null | fabric_cf/orchestrator/swagger_server/__init__.py | fabric-testbed/ActorBase | 3c7dd040ee79fef0759e66996c93eeec57c790b2 | [
"MIT"
] | 67 | 2020-12-21T15:39:49.000Z | 2022-02-27T17:55:00.000Z | fabric_cf/orchestrator/swagger_server/__init__.py | fabric-testbed/ControlFramework | 95ab745e32f15c993bc7a017aa97a5a0f67f210f | [
"MIT"
] | null | null | null | import logging
import prometheus_client
received_counter = prometheus_client.Counter('Requests_Received', 'HTTP Requests', ['method', 'endpoint'])
success_counter = prometheus_client.Counter('Requests_Success', 'HTTP Success', ['method', 'endpoint'])
failure_counter = prometheus_client.Counter('Requests_Failed', 'HTTP... | 59.166667 | 106 | 0.785915 |
b61df28e0aee6c0b12a0579b77f3a2614044bb73 | 2,010 | py | Python | src/logger.py | jorgediazjr/fast_dp | 972fe7f09fb28b07053de595faa6857692320cbe | [
"Apache-2.0"
] | null | null | null | src/logger.py | jorgediazjr/fast_dp | 972fe7f09fb28b07053de595faa6857692320cbe | [
"Apache-2.0"
] | null | null | null | src/logger.py | jorgediazjr/fast_dp | 972fe7f09fb28b07053de595faa6857692320cbe | [
"Apache-2.0"
] | null | null | null | import os
class _writer:
'''A specialist class to write to the screen and fast_dp.log.'''
def __init__(self):
self._fout = None
self._afout = None
self._filename = 'fast_dp.log'
self._afilename = None
self._afilepath = None
self._afileprefix = None
retu... | 24.216867 | 69 | 0.61194 |
c721f0bda8241811538b87c1314d2cacb2fb82f5 | 568 | py | Python | setup.py | willu47/lcoe | 9aa2d04ec6134ee21686bfad87fad58451b5af62 | [
"MIT"
] | 3 | 2020-09-09T15:06:21.000Z | 2021-09-16T12:14:17.000Z | setup.py | willu47/lcoe | 9aa2d04ec6134ee21686bfad87fad58451b5af62 | [
"MIT"
] | null | null | null | setup.py | willu47/lcoe | 9aa2d04ec6134ee21686bfad87fad58451b5af62 | [
"MIT"
] | 1 | 2021-10-03T14:00:14.000Z | 2021-10-03T14:00:14.000Z | # -*- coding: utf-8 -*-
"""
Setup file for lcoe.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 3.2.3.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
import sys
from pkg_resources import Versio... | 23.666667 | 75 | 0.700704 |
e9f4ea40d9d99069542095bffc1b9039cbf36e9a | 12,127 | py | Python | SocialRobotCustom/python/social_bot/teacher.py | jesbu1/h-baselines | f6f775bb18de22527f2d01d73bd733ed2e435ba3 | [
"MIT"
] | null | null | null | SocialRobotCustom/python/social_bot/teacher.py | jesbu1/h-baselines | f6f775bb18de22527f2d01d73bd733ed2e435ba3 | [
"MIT"
] | null | null | null | SocialRobotCustom/python/social_bot/teacher.py | jesbu1/h-baselines | f6f775bb18de22527f2d01d73bd733ed2e435ba3 | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Horizon Robotics. 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 applicab... | 34.160563 | 82 | 0.601385 |
38e6944eea9df33e992e819607051c52a913265c | 5,101 | py | Python | dags/mwaalib/workflow_lib.py | aws-samples/amazon-mwaa-complex-workflow-using-step-functions | 73835d3398ced067b40129c8cc9d9197f38e99a8 | [
"MIT-0"
] | 21 | 2021-01-12T14:43:06.000Z | 2021-10-01T16:47:19.000Z | dags/mwaalib/workflow_lib.py | aws-samples/amazon-mwaa-complex-workflow-using-step-functions | 73835d3398ced067b40129c8cc9d9197f38e99a8 | [
"MIT-0"
] | null | null | null | dags/mwaalib/workflow_lib.py | aws-samples/amazon-mwaa-complex-workflow-using-step-functions | 73835d3398ced067b40129c8cc9d9197f38e99a8 | [
"MIT-0"
] | 11 | 2021-02-10T16:37:18.000Z | 2022-01-18T21:35:12.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3, json, pprint, requests, textwrap, time, logging, requests
import os
from datetime import datetime
from typing import Optional, Union
sfn_non_terminal_states = {"RUNNING"}
sfn_failed_states = {"FAILED", ... | 35.17931 | 196 | 0.639678 |
c5f35e8acfd6fb4b84766cbd81753d9236985d08 | 5,226 | py | Python | SEIR_model.py | MarcusRainbow/Covid19 | ef6c7ba130493c889ca187214e3b5b123b2de928 | [
"MIT"
] | null | null | null | SEIR_model.py | MarcusRainbow/Covid19 | ef6c7ba130493c889ca187214e3b5b123b2de928 | [
"MIT"
] | null | null | null | SEIR_model.py | MarcusRainbow/Covid19 | ef6c7ba130493c889ca187214e3b5b123b2de928 | [
"MIT"
] | null | null | null | import numpy as np
from topography import nearest_neighbour_topography, stratified_topography
class SEIR_Model:
"""
Model represents the topographical SEIR model as vectors of
floating point numbers. The vectors are Susceptible, Exposed,
Infected and Resistant (recovered, quarantined or dead).
... | 29.525424 | 87 | 0.618829 |
a417b5a6cb69730c1d64389c46c267cc19cf7b8b | 68 | py | Python | src/wann_genetic/postopt/vis/__init__.py | plonerma/wann-genetic | c4a8a1db81665b2549994d615e1d347dbe00226a | [
"MIT"
] | null | null | null | src/wann_genetic/postopt/vis/__init__.py | plonerma/wann-genetic | c4a8a1db81665b2549994d615e1d347dbe00226a | [
"MIT"
] | null | null | null | src/wann_genetic/postopt/vis/__init__.py | plonerma/wann-genetic | c4a8a1db81665b2549994d615e1d347dbe00226a | [
"MIT"
] | null | null | null | from .vis_network import draw_graph, draw_weight_matrix, node_names
| 34 | 67 | 0.867647 |
d7109572a9a49fba3d81c6bb0fe11f18372736ef | 8,161 | py | Python | mmdetection/mmdet/core/evaluation/kitti_utils.py | lidongyv/Reppoint-Tracking | 81b81e921f6b905e68aba117ffc4fca8ffcfcfd6 | [
"MIT"
] | null | null | null | mmdetection/mmdet/core/evaluation/kitti_utils.py | lidongyv/Reppoint-Tracking | 81b81e921f6b905e68aba117ffc4fca8ffcfcfd6 | [
"MIT"
] | null | null | null | mmdetection/mmdet/core/evaluation/kitti_utils.py | lidongyv/Reppoint-Tracking | 81b81e921f6b905e68aba117ffc4fca8ffcfcfd6 | [
"MIT"
] | null | null | null | import itertools
import mmcv
import numpy as np
from pycocotools.kitti import COCO
from pycocotools.kittieval import COCOeval
from terminaltables import AsciiTable
from .recall import eval_recalls
def coco_eval(result_files,
result_types,
coco,
max_dets=(100, 300, 1000),
... | 36.761261 | 169 | 0.563656 |
a2e3c4b22592073f2901c0ef775b43267f20caae | 90 | py | Python | lead_bot/apps.py | LEXResearch/lex | 346cfafa5f313ca0228cab47e8dfe61ecc0ed995 | [
"MIT"
] | null | null | null | lead_bot/apps.py | LEXResearch/lex | 346cfafa5f313ca0228cab47e8dfe61ecc0ed995 | [
"MIT"
] | null | null | null | lead_bot/apps.py | LEXResearch/lex | 346cfafa5f313ca0228cab47e8dfe61ecc0ed995 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class LeadBotConfig(AppConfig):
name = 'lead_bot'
| 15 | 33 | 0.755556 |
33de4fc0b5ec45f8da646da5403509bac35def49 | 807 | py | Python | demo_app/flippy_demo_app/views.py | Kos/flippy | 2d77dc1a981ec25025e7e7067a71c142df194d2a | [
"0BSD"
] | 6 | 2019-04-18T08:04:04.000Z | 2021-06-23T09:57:18.000Z | demo_app/flippy_demo_app/views.py | Kos/flippy | 2d77dc1a981ec25025e7e7067a71c142df194d2a | [
"0BSD"
] | 7 | 2019-04-24T10:35:27.000Z | 2019-10-03T09:13:53.000Z | demo_app/flippy_demo_app/views.py | Kos/flippy | 2d77dc1a981ec25025e7e7067a71c142df194d2a | [
"0BSD"
] | 1 | 2021-04-08T07:24:36.000Z | 2021-04-08T07:24:36.000Z | from django.contrib.auth.models import User
from django.template.response import TemplateResponse
from .flags import enable_weather, enable_cats, enable_sudoku
def index(request):
if request.user.is_authenticated:
show_sudoku = should_show_sudoku(request.user)
else:
show_sudoku = False
#... | 28.821429 | 77 | 0.698885 |
dfee77ee5531d84afa5f17aa69d9b48584d5c94d | 2,993 | py | Python | audio/record.py | bbcdli/xuexi | f791d6bdc2fccc1bab322b474c9cfc7572690f44 | [
"Apache-2.0"
] | 1 | 2019-01-16T05:55:23.000Z | 2019-01-16T05:55:23.000Z | audio/record.py | bbcdli/xuexi | f791d6bdc2fccc1bab322b474c9cfc7572690f44 | [
"Apache-2.0"
] | null | null | null | audio/record.py | bbcdli/xuexi | f791d6bdc2fccc1bab322b474c9cfc7572690f44 | [
"Apache-2.0"
] | null | null | null | from sys import byteorder
from array import array
from struct import pack
import pyaudio
import wave
THRESHOLD = 500
CHUNK_SIZE = 1024
FORMAT = pyaudio.paInt16
RATE = 44100
def is_silent(snd_data):
"Returns 'True' if below the 'silent' threshold"
return max(snd_data) < THRESHOLD
def normalize(snd_data):
... | 24.941667 | 80 | 0.625459 |
0e472c7420a6718ce02f46ab9e5c34a4034a65ef | 2,155 | py | Python | setup.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 289 | 2017-08-03T17:30:12.000Z | 2022-03-30T12:04:21.000Z | setup.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 34 | 2017-08-03T21:47:49.000Z | 2021-06-16T17:59:45.000Z | setup.py | lisy14liz/importance-sampling | 15040a3c4435735e9b0155d3d0228909bd4e47b7 | [
"MIT"
] | 58 | 2017-08-06T01:10:24.000Z | 2022-03-07T00:30:24.000Z | #!/usr/bin/env python
#
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/
# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>
#
"""Setup importance-sampling"""
from itertools import dropwhile
from os import path
from setuptools import find_packages, setup
def collect_docstring(line... | 30.785714 | 81 | 0.585615 |
666b76b53b77c6b36505a574547cb5c195b761ba | 48,522 | py | Python | chives/wallet/wallet_state_manager.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | 1 | 2021-08-01T17:14:54.000Z | 2021-08-01T17:14:54.000Z | chives/wallet/wallet_state_manager.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | null | null | null | chives/wallet/wallet_state_manager.py | ChivesWorld/chives-blockchain | 56734ef0719f7bf844213823bb95b0fcc642d222 | [
"Apache-2.0"
] | null | null | null | import asyncio
import base64
import json
import logging
import time
from collections import defaultdict
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
import aiosqlite
from blspy import AugSchemeMPL, G1Element, PrivateKey
from chiabip158 import PyBIP158
from cryptography.fe... | 42.046794 | 120 | 0.638762 |
d0ab2fa07ec216f8af2558d0b182fc6b664345b5 | 61,891 | py | Python | metalpipe/node.py | zacernst/nanostream | 382389b09c42b55c6bdb64c7b0017d4810c7165f | [
"MIT"
] | 2 | 2019-04-12T19:32:55.000Z | 2019-12-24T16:50:09.000Z | metalpipe/node.py | zacernst/metalpipe | 382389b09c42b55c6bdb64c7b0017d4810c7165f | [
"MIT"
] | 10 | 2019-04-03T01:25:52.000Z | 2019-12-16T05:09:35.000Z | metalpipe/node.py | zacernst/nanostream | 382389b09c42b55c6bdb64c7b0017d4810c7165f | [
"MIT"
] | 1 | 2019-04-17T12:55:19.000Z | 2019-04-17T12:55:19.000Z | """
Node module
===========
The ``node`` module contains the ``MetalNode`` class, which is the foundation
for MetalPipe.
"""
import time
import datetime
import uuid
import importlib
import logging
import os
import threading
import pprint
import sys
import copy
import random
import functools
import csv
import MySQLdb
... | 35.185333 | 97 | 0.587194 |
a398e86c39e2b6840a4241a3fb3fdf25bae17d1f | 2,164 | py | Python | examples/simple_pruning.py | ammaddd/optuna | a24b3aa6e1ae2e4daf19ed3a79ac52f8b4265206 | [
"MIT"
] | null | null | null | examples/simple_pruning.py | ammaddd/optuna | a24b3aa6e1ae2e4daf19ed3a79ac52f8b4265206 | [
"MIT"
] | null | null | null | examples/simple_pruning.py | ammaddd/optuna | a24b3aa6e1ae2e4daf19ed3a79ac52f8b4265206 | [
"MIT"
] | null | null | null | """
Optuna example that demonstrates a pruner.
In this example, we optimize a classifier configuration using scikit-learn. Note that, to enable
the pruning feature, the following 2 methods are invoked after each step of the iterative training.
(1) :func:`optuna.trial.Trial.report`
(2) :func:`optuna.trial.Trial.should... | 31.362319 | 99 | 0.709335 |
8149db7c0a6f0e15714071474c4fe0e53fd9e682 | 1,959 | py | Python | test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/_configuration_async.py | Azure/autorest.azure-functions-python | b0896d8aec6b0fd6f0bcb12ea8e0489652dc2783 | [
"MIT"
] | 4 | 2020-10-22T20:35:38.000Z | 2021-12-21T07:29:01.000Z | test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/_configuration_async.py | Azure/autorest.azure-functions-python | b0896d8aec6b0fd6f0bcb12ea8e0489652dc2783 | [
"MIT"
] | 3 | 2020-09-09T15:16:15.000Z | 2021-12-20T15:25:18.000Z | test/vanilla/Expected/AcceptanceTests/ParameterFlattening/parameterflattening/aio/_configuration_async.py | Azure/autorest.azure-functions-python | b0896d8aec6b0fd6f0bcb12ea8e0489652dc2783 | [
"MIT"
] | 2 | 2020-11-10T07:16:23.000Z | 2020-12-30T11:03:14.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 43.533333 | 106 | 0.678407 |
22232d59e31a3a66fe0c7449ed51a0a3a1aedade | 926 | py | Python | bluebird/api/resources/seed.py | rkm/bluebird | 2325ebb151724d4444c092c095a040d7365dda79 | [
"MIT"
] | 8 | 2019-01-29T15:19:39.000Z | 2020-07-16T03:55:36.000Z | bluebird/api/resources/seed.py | rkm/bluebird | 2325ebb151724d4444c092c095a040d7365dda79 | [
"MIT"
] | 46 | 2019-02-08T14:23:11.000Z | 2021-04-06T13:45:10.000Z | bluebird/api/resources/seed.py | rkm/bluebird | 2325ebb151724d4444c092c095a040d7365dda79 | [
"MIT"
] | 3 | 2019-05-06T14:18:07.000Z | 2021-06-17T10:39:59.000Z | """
Provides logic for the SEED (set seed) API endpoint
"""
from flask_restful import reqparse
from flask_restful import Resource
import bluebird.api.resources.utils.responses as responses
import bluebird.api.resources.utils.utils as utils
from bluebird.utils.types import is_valid_seed
_PARSER = reqparse.RequestPars... | 28.060606 | 83 | 0.694384 |
00e801779df86aebadd5e0e5ec153c7c6b93f6a1 | 4,969 | py | Python | vnpy/trader/app/ctaStrategy/ctaPosition.py | frikyalong/vnpy | d8ea554e34ff285c97cc2ddb4e881a1f0a6f02d3 | [
"MIT"
] | 1 | 2018-11-05T07:34:36.000Z | 2018-11-05T07:34:36.000Z | vnpy/trader/app/ctaStrategy/ctaPosition.py | currently1/vnpy | 674c9f04fe7d8e0784e5d98e96cd9f797742d22a | [
"MIT"
] | null | null | null | vnpy/trader/app/ctaStrategy/ctaPosition.py | currently1/vnpy | 674c9f04fe7d8e0784e5d98e96cd9f797742d22a | [
"MIT"
] | null | null | null | # encoding: UTF-8
from datetime import datetime
from vnpy.trader.app.ctaStrategy.ctaBase import *
from vnpy.trader.vtConstant import *
DEBUGCTALOG = True
class CtaPosition:
"""策略的仓位管理类
v 0.1 简单的数值,代表多仓数量和空仓数量
v 0.2 增加多仓和空仓的持仓,去除持仓均价
v 0.3 正式取消更新上层strategy的pos
"""
def __init__(self, strategy... | 32.058065 | 99 | 0.511169 |
7791537b77bf42c98dd57fdf86704371e0ee9ddd | 3,732 | py | Python | untitled1.py | MohitKumar21/JAIPUR-RENTAL-PRICE-PREDICTION | 03cc8558a9775117f841f1f181c96e20edf8fe7d | [
"Apache-2.0"
] | 1 | 2020-04-29T08:43:24.000Z | 2020-04-29T08:43:24.000Z | untitled1.py | MohitKumar21/JAIPUR-RENTAL-PRICE-PREDICTION | 03cc8558a9775117f841f1f181c96e20edf8fe7d | [
"Apache-2.0"
] | null | null | null | untitled1.py | MohitKumar21/JAIPUR-RENTAL-PRICE-PREDICTION | 03cc8558a9775117f841f1f181c96e20edf8fe7d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 20 22:56:12 2019
@author: Suman
JaipurRentals
Jaipur’s Real Estate Market is experiencing an incredible resurgence, with property prices soaring by double-digits on an
yearly basis since 2013. While home owne... | 31.361345 | 128 | 0.651393 |
f3e014367fe20b3c3e537bc49d451f56312fa336 | 23,957 | py | Python | tests/view/runtests/test_views.py | yifanjiang/moztrap | 2130c7101b7596b19a2697ab5f1c745e93e7c95b | [
"BSD-2-Clause"
] | 1 | 2015-02-10T15:09:42.000Z | 2015-02-10T15:09:42.000Z | tests/view/runtests/test_views.py | yifanjiang/moztrap | 2130c7101b7596b19a2697ab5f1c745e93e7c95b | [
"BSD-2-Clause"
] | null | null | null | tests/view/runtests/test_views.py | yifanjiang/moztrap | 2130c7101b7596b19a2697ab5f1c745e93e7c95b | [
"BSD-2-Clause"
] | null | null | null | """
Tests for runtests views.
"""
from datetime import datetime
from django.core.urlresolvers import reverse
from BeautifulSoup import BeautifulSoup
from mock import patch
from tests import case
class SelectTest(case.view.AuthenticatedViewTestCase,
case.view.NoCacheTest,
):
... | 31.234681 | 88 | 0.598072 |
75f7acd92c656d4c518b85b32a58b8441315759f | 117 | py | Python | ALS/__init__.py | np179/ALSCPD | 86fe4743585bb80867bfb7ff61c060c22037de74 | [
"MIT"
] | null | null | null | ALS/__init__.py | np179/ALSCPD | 86fe4743585bb80867bfb7ff61c060c22037de74 | [
"MIT"
] | null | null | null | ALS/__init__.py | np179/ALSCPD | 86fe4743585bb80867bfb7ff61c060c22037de74 | [
"MIT"
] | null | null | null | __all__ = ['dvr', 'h2o', 'ALS1D', 'ALS2D', 'twoDsub', 'tracker', 'MonteC', 'ALSclass', 'potentials']
from . import * | 39 | 100 | 0.606838 |
455233aade18dc0076ddca73c44fda9743df9038 | 4,577 | py | Python | setup.py | makkes/dcos | a6df70f3f58ead134c8c49af8fa1387b4f81c19c | [
"Apache-2.0"
] | 1 | 2019-10-01T14:53:09.000Z | 2019-10-01T14:53:09.000Z | setup.py | makkes/dcos | a6df70f3f58ead134c8c49af8fa1387b4f81c19c | [
"Apache-2.0"
] | 1 | 2020-03-19T18:01:32.000Z | 2020-03-19T18:01:32.000Z | setup.py | makkes/dcos | a6df70f3f58ead134c8c49af8fa1387b4f81c19c | [
"Apache-2.0"
] | 1 | 2019-09-02T11:45:32.000Z | 2019-09-02T11:45:32.000Z | from pathlib import Path
from setuptools import setup
def get_advanced_templates():
template_base = 'aws/templates/advanced/'
template_names = ['advanced-master', 'advanced-priv-agent', 'advanced-pub-agent', 'infra', 'zen']
return [template_base + name + '.json' for name in template_names]
# These fil... | 34.156716 | 119 | 0.58357 |
4a7efd88767fb918ffc36be328a839f48925530e | 29,650 | py | Python | great_expectations/util.py | jaidparmar/great_expectations | dac57e3638a0ca2c7adc62a8c0cee8525ea706a5 | [
"Apache-2.0"
] | null | null | null | great_expectations/util.py | jaidparmar/great_expectations | dac57e3638a0ca2c7adc62a8c0cee8525ea706a5 | [
"Apache-2.0"
] | null | null | null | great_expectations/util.py | jaidparmar/great_expectations | dac57e3638a0ca2c7adc62a8c0cee8525ea706a5 | [
"Apache-2.0"
] | null | null | null | import copy
import importlib
import json
import logging
import os
import time
from collections import OrderedDict
from functools import wraps
from gc import get_referrers
from inspect import (
ArgInfo,
BoundArguments,
Parameter,
Signature,
currentframe,
getargvalues,
getclosurevars,
getm... | 34.51688 | 120 | 0.677504 |
84fc5ea5c2e9d002eb569aea68fce38273ca34ec | 1,888 | py | Python | vk/constants.py | fossabot/vk.py | 94d5c719eb8da6d778d2be208038c447971d5cff | [
"MIT"
] | null | null | null | vk/constants.py | fossabot/vk.py | 94d5c719eb8da6d778d2be208038c447971d5cff | [
"MIT"
] | null | null | null | vk/constants.py | fossabot/vk.py | 94d5c719eb8da6d778d2be208038c447971d5cff | [
"MIT"
] | null | null | null | """
A file which contains all project constants.
"""
from vk.utils.json import AbstractJsonLibrary
from vk.utils.json import JsonLibrary
API_VERSION: str = "5.101" # current api version https://vk.com/dev/versions
API_LINK: str = "https://api.vk.com/method/" # link to access API
try:
import orjson # noqa
excep... | 23.6 | 88 | 0.637712 |
932cae6feac9139ad3b25923cd557894522fed02 | 6,034 | py | Python | examples/mnist/tests/test_generate_mnist_dataset.py | cclauss/petastorm | 12fc6542005c6dc7c99997604b939536cca79fa9 | [
"Apache-2.0"
] | null | null | null | examples/mnist/tests/test_generate_mnist_dataset.py | cclauss/petastorm | 12fc6542005c6dc7c99997604b939536cca79fa9 | [
"Apache-2.0"
] | null | null | null | examples/mnist/tests/test_generate_mnist_dataset.py | cclauss/petastorm | 12fc6542005c6dc7c99997604b939536cca79fa9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2018 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.878613 | 115 | 0.708982 |
55fa6cc2808021f59d7c485685c587139a47a63d | 3,466 | py | Python | src/scraper/helpers.py | open-austin/Odyssey-Court-Records-to-JSON | 2fc8bfaceece02ed34aeaa387a686f7a1a43ed3b | [
"MIT"
] | 5 | 2022-02-06T23:26:20.000Z | 2022-03-23T05:50:00.000Z | src/scraper/helpers.py | open-austin/Odyssey-Court-Records-to-JSON | 2fc8bfaceece02ed34aeaa387a686f7a1a43ed3b | [
"MIT"
] | 11 | 2022-02-07T00:25:36.000Z | 2022-03-31T23:07:52.000Z | src/scraper/helpers.py | open-austin/Odyssey-Court-Records-to-JSON | 2fc8bfaceece02ed34aeaa387a686f7a1a43ed3b | [
"MIT"
] | 1 | 2022-03-13T22:29:40.000Z | 2022-03-13T22:29:40.000Z | import os, sys
import requests
from time import sleep
from logging import Logger
from typing import Dict, Optional, Tuple, Literal
from enum import Enum
def write_debug_and_quit(
page_text: str, logger: Logger, verification_text: Optional[str] = None
) -> None:
logger.error(
(
f"{verificat... | 33.326923 | 132 | 0.565782 |
c3cc4a8dcf9d9e5ada33c2a69d610435fbb8377d | 177 | py | Python | initpylib/templates_common/_PLEASE_PYPROJECT_NAME_/__PLEASE_PYPROJECT_NAME_.py | kirin123kirin/initpylib_capi | 48442f10fbbbbd6d3caad2517a3cbccfe541ca37 | [
"MIT"
] | null | null | null | initpylib/templates_common/_PLEASE_PYPROJECT_NAME_/__PLEASE_PYPROJECT_NAME_.py | kirin123kirin/initpylib_capi | 48442f10fbbbbd6d3caad2517a3cbccfe541ca37 | [
"MIT"
] | null | null | null | initpylib/templates_common/_PLEASE_PYPROJECT_NAME_/__PLEASE_PYPROJECT_NAME_.py | kirin123kirin/initpylib_capi | 48442f10fbbbbd6d3caad2517a3cbccfe541ca37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def _PLEASE_PYPROJECT_NAME_(word=None):
print(word)
if __name__ == "__main__":
_PLEASE_PYPROJECT_NAME_("hello world!")
| 17.7 | 43 | 0.677966 |
efb0ae99c05f0b0f05a9ef761ff56a696b5fa9f1 | 2,516 | py | Python | test/functional/p2p_blocksonly.py | estxcoin/estcore | 4398b1d944373fe25668469966fa2660da454279 | [
"MIT"
] | 1 | 2019-09-17T07:53:52.000Z | 2019-09-17T07:53:52.000Z | test/functional/p2p_blocksonly.py | estxcoin/estcore | 4398b1d944373fe25668469966fa2660da454279 | [
"MIT"
] | null | null | null | test/functional/p2p_blocksonly.py | estxcoin/estcore | 4398b1d944373fe25668469966fa2660da454279 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p blocksonly"""
from test_framework.messages import msg_tx, CTransaction, FromHex
from test_framewor... | 41.933333 | 98 | 0.639507 |
6a40171717a5a3a99b4de2bede01d53c0f2ad5e5 | 1,241 | py | Python | stream_alert/rules_engine/main.py | yutiansut/streamalert | 7d198a3273781f66465420e90886a3ce53ec7559 | [
"Apache-2.0"
] | 7 | 2018-12-26T14:38:08.000Z | 2022-03-09T13:21:00.000Z | stream_alert/rules_engine/main.py | revaniki/streamalert | 7d198a3273781f66465420e90886a3ce53ec7559 | [
"Apache-2.0"
] | 14 | 2018-05-09T19:18:15.000Z | 2021-06-02T02:34:09.000Z | stream_alert/rules_engine/main.py | revaniki/streamalert | 7d198a3273781f66465420e90886a3ce53ec7559 | [
"Apache-2.0"
] | 1 | 2018-12-06T20:51:58.000Z | 2018-12-06T20:51:58.000Z | """
Copyright 2017-present, Airbnb Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 32.657895 | 90 | 0.704271 |
1261f6eee4f34733967bedf692e3168f6260c260 | 3,284 | py | Python | circuitPython/examples/internet-data-display/page2_ui.py | BRTSG-FOSS/pico-bteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | 1 | 2022-01-29T03:16:57.000Z | 2022-01-29T03:16:57.000Z | circuitPython/examples/internet-data-display/page2_ui.py | BRTSG-FOSS/pico-brteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | 15 | 2021-09-22T08:36:08.000Z | 2022-01-26T08:51:42.000Z | circuitPython/examples/internet-data-display/page2_ui.py | BRTSG-FOSS/pico-bteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | null | null | null | from brteve.brt_eve_common import align4
from brteve.brt_eve_bt817_8 import BrtEve
class Page2_UI:
def __init__(self, eve: BrtEve) -> None:
self.eve=eve
self.CMD_PRIV = 1
self.CMD_NEXT = 2
self.CMD_BACK = 3
self._oldtag = 0
def start_load_image(self):
eve=self.... | 26.918033 | 95 | 0.529233 |
03af17b9230d8ed5914beeb754cb241d79b84636 | 2,511 | py | Python | Classes/Super/Camera.py | crablab/cs1830_project | af0767a5860e18f5c7d58464704f186552a90ee6 | [
"MIT"
] | null | null | null | Classes/Super/Camera.py | crablab/cs1830_project | af0767a5860e18f5c7d58464704f186552a90ee6 | [
"MIT"
] | null | null | null | Classes/Super/Camera.py | crablab/cs1830_project | af0767a5860e18f5c7d58464704f186552a90ee6 | [
"MIT"
] | null | null | null | from Classes.Base.Vector import Vector
import configparser
config = configparser.ConfigParser()
config.read_file(open('Classes/config'))
import uuid
import time
class Camera:
def __init__(self, origin, dim):
self.idClass = 1
self.idObject = uuid.uuid4()
self.origin = origin
self.dim... | 37.477612 | 142 | 0.649542 |
9917370a9755f546072515c081158a22e0ef3ffb | 828 | py | Python | python/test_numpy.py | Halo9Pan/experiment | 856facc1a6699e098e95fc4feb5485f878a2ba20 | [
"MIT"
] | null | null | null | python/test_numpy.py | Halo9Pan/experiment | 856facc1a6699e098e95fc4feb5485f878a2ba20 | [
"MIT"
] | null | null | null | python/test_numpy.py | Halo9Pan/experiment | 856facc1a6699e098e95fc4feb5485f878a2ba20 | [
"MIT"
] | null | null | null | import numpy as np
import time
N = 6000
M = 10000
k_list = [64, 80, 96, 104, 112, 120, 128, 144, 160, 176, 192, 200, 208, 224, 240, 256, 384]
def get_gflops(M, N, K):
return M*N*(2.0*K-1.0) / 1000**3
np.show_config()
for K in k_list:
a = np.array(np.random.random((M, N)), dtype=np... | 23.657143 | 93 | 0.492754 |
7d18dd3203b7119834318c4470153b6b81e4c9b8 | 1,840 | py | Python | generators/name.py | vickio/compgen | 7bb9a473622e53df18501b577dca4a33fc83922c | [
"MIT"
] | 2 | 2018-11-24T05:52:48.000Z | 2018-11-29T20:46:18.000Z | generators/name.py | vickio/compgen | 7bb9a473622e53df18501b577dca4a33fc83922c | [
"MIT"
] | null | null | null | generators/name.py | vickio/compgen | 7bb9a473622e53df18501b577dca4a33fc83922c | [
"MIT"
] | 2 | 2018-11-23T12:33:07.000Z | 2018-11-27T02:50:06.000Z | from random import choice
from string import Template
from . import BaseGenerator
class Name(BaseGenerator):
def __init__(self, company):
self.company = company
self.data = self._load_json('name.json')
self.templates = self.data.pop('templates')
self.noun... | 34.716981 | 80 | 0.584239 |
79c43126ab265ebcf6a340757400bd518535df16 | 2,665 | py | Python | geonet/migrations/0001_initial.py | bbengfort/kahu | 57a2ba417d545a57a987b3620e46e56f023134d6 | [
"MIT"
] | 1 | 2018-08-27T10:07:06.000Z | 2018-08-27T10:07:06.000Z | geonet/migrations/0001_initial.py | bbengfort/kahu | 57a2ba417d545a57a987b3620e46e56f023134d6 | [
"MIT"
] | 22 | 2018-06-09T14:16:36.000Z | 2018-06-15T10:56:58.000Z | geonet/migrations/0001_initial.py | bbengfort/kahu | 57a2ba417d545a57a987b3620e46e56f023134d6 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-11 20:20
import django.contrib.postgres.fields.jsonb
import django.core.serializers.json
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
... | 50.283019 | 229 | 0.646904 |
c5da5c5cf1a064417a34aeba023bbfa24ba768c2 | 2,868 | py | Python | plotting/plotting/status.py | eric-erki/GISportal | 407764334b3ba50da4429fc170b98e20468ff8a0 | [
"Apache-2.0"
] | 55 | 2015-03-20T23:54:17.000Z | 2022-01-22T04:33:06.000Z | plotting/plotting/status.py | eric-erki/GISportal | 407764334b3ba50da4429fc170b98e20468ff8a0 | [
"Apache-2.0"
] | 27 | 2016-03-14T15:44:05.000Z | 2021-09-03T10:23:06.000Z | plotting/plotting/status.py | eric-erki/GISportal | 407764334b3ba50da4429fc170b98e20468ff8a0 | [
"Apache-2.0"
] | 24 | 2015-03-11T14:59:24.000Z | 2022-03-31T10:47:17.000Z | import json
from plotting.debug import debug
# Home rolled enums as Python 2.7 does not have them.
class Enum(set):
def __getattr__(self, name):
if name in self:
return name
raise AttributeError
# Valid plot status values.
Plot_status = Enum(["initialising", "extracting", "plotting", "complete... | 29.265306 | 124 | 0.621339 |
e55a022d40ea10ce099eb702250581bd0db311b7 | 980 | py | Python | google/appengine/tools/augment_mimetypes.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 1,463 | 2015-04-07T09:41:28.000Z | 2022-03-30T02:05:19.000Z | server/lib/google/appengine/tools/augment_mimetypes.py | Palsoso/GoAgent-Always-Available | 86c2fee6474890ff26b5a66b74a1306f7f31988b | [
"WTFPL",
"Apache-2.0"
] | 73 | 2015-04-08T05:08:52.000Z | 2019-06-05T06:38:21.000Z | server/lib/google/appengine/tools/augment_mimetypes.py | Palsoso/GoAgent-Always-Available | 86c2fee6474890ff26b5a66b74a1306f7f31988b | [
"WTFPL",
"Apache-2.0"
] | 698 | 2015-04-28T12:02:00.000Z | 2022-03-19T23:53:55.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.793103 | 74 | 0.735714 |
2ac585a6b47e0b35f12ec69e8771e73076858e6a | 1,078 | py | Python | resources/graphics/makeframes.py | paulscottrobson/string-trainer | 2c48c892d81d6dd700f091d6c0fadbf5df3d70fc | [
"MIT"
] | null | null | null | resources/graphics/makeframes.py | paulscottrobson/string-trainer | 2c48c892d81d6dd700f091d6c0fadbf5df3d70fc | [
"MIT"
] | null | null | null | resources/graphics/makeframes.py | paulscottrobson/string-trainer | 2c48c892d81d6dd700f091d6c0fadbf5df3d70fc | [
"MIT"
] | null | null | null | #
# Notebutton graphics creator.
#
from PIL import Image,ImageDraw
height = 50
roundWidth = 40
y3d = 8
widthGroup = [ 0,10,25,40,66,75,100,150,200,250,300 ]
for width in widthGroup:
for offset3D in range(1,2):
xl = 100+roundWidth/2
xr = xl + width
yc = 100
im = Image.new("RGBA",(600,200),0x00000000)
draw =... | 33.6875 | 88 | 0.675325 |
00afcbffdebb2adbb65d2e05ae834e5c6b41e309 | 29,457 | py | Python | dbn/models.py | CurrenWong/deep-belief-network | f6ca118c187816dee753e0004149c1e55737a20a | [
"MIT"
] | null | null | null | dbn/models.py | CurrenWong/deep-belief-network | f6ca118c187816dee753e0004149c1e55737a20a | [
"MIT"
] | null | null | null | dbn/models.py | CurrenWong/deep-belief-network | f6ca118c187816dee753e0004149c1e55737a20a | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.stats import truncnorm
from sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin, RegressorMixin
from .activations import SigmoidActivationFunction, ReLUActivationFunction
from .utils import batch_generator
class BaseModel(object)... | 37.717029 | 120 | 0.607767 |
72f230128b35d42d251f2f26bf132592048ab623 | 8,507 | py | Python | script_ROC_all8.py | Majeed7/L1LR | de6523d3881f52493f24da6386231d6315351dea | [
"MIT"
] | 4 | 2021-05-13T16:50:44.000Z | 2022-02-08T10:48:13.000Z | script_ROC_all8.py | Majeed7/L1LR | de6523d3881f52493f24da6386231d6315351dea | [
"MIT"
] | null | null | null | script_ROC_all8.py | Majeed7/L1LR | de6523d3881f52493f24da6386231d6315351dea | [
"MIT"
] | null | null | null | import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
from sklearn.datasets import load_svmlight_file
from sklearn.metrics import auc, roc_curve
plt.rcParams['figure.dpi'] = 300
plt.rcParams["font.family"] = "Arial"
plt.rcParams['font.size'] = 24
mpl.rcParams['xtick.labelsi... | 42.964646 | 308 | 0.630187 |
4cbd38a2e018585b35ec403d0bd2827b307eafef | 2,954 | py | Python | scripts/OrbitalDFTU_Searcher.py | petavazohi/PyChemia | e779389418771c25c830aed360773c63bb069372 | [
"MIT"
] | 67 | 2015-01-31T07:44:55.000Z | 2022-03-21T21:43:34.000Z | scripts/OrbitalDFTU_Searcher.py | petavazohi/PyChemia | e779389418771c25c830aed360773c63bb069372 | [
"MIT"
] | 13 | 2016-06-03T19:07:51.000Z | 2022-03-31T04:20:40.000Z | scripts/OrbitalDFTU_Searcher.py | petavazohi/PyChemia | e779389418771c25c830aed360773c63bb069372 | [
"MIT"
] | 37 | 2015-01-22T15:37:23.000Z | 2022-03-21T15:38:10.000Z | #!/usr/bin/env python
import os
import argparse
import logging
import pychemia
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Orbital DFT+U Searcher Manager')
parser.add_argument('-host', type=str, help='Hostname or IP of the Mongo Server (default: localhost)',
... | 36.02439 | 116 | 0.634733 |
5a2d512aa04de90482885b223683fafd85ad42db | 4,227 | py | Python | som_ae/somae_train.py | zutotonno/SOM-VAE | 76130589a47955f55af414a6e21c8d35d293a211 | [
"MIT"
] | null | null | null | som_ae/somae_train.py | zutotonno/SOM-VAE | 76130589a47955f55af414a6e21c8d35d293a211 | [
"MIT"
] | null | null | null | som_ae/somae_train.py | zutotonno/SOM-VAE | 76130589a47955f55af414a6e21c8d35d293a211 | [
"MIT"
] | null | null | null | import pickle as pickle
import numpy as np
import tensorflow as tf
from somae_model import SOMAE
import pandas as pd
# data_set = "/home/aritacco/SOM_AE/SOM-VAE/data/training_dataset.obj"
dataset_train = pd.read_csv('../data/HAPT_Dataset/Train/X_train.txt', sep=' ', header=None)
dataset_test = pd.read_csv('../data/HA... | 35.822034 | 164 | 0.688432 |
18917d030b1a7b090dd6b8a26789f93b921718d6 | 7,125 | py | Python | core/self_supervision_summarization_cat_batch.py | hbdat/eccv20_Multi_Task_Procedure_Learning | 9212f321e12cafb12030b982b4873fc7ddec8799 | [
"MIT"
] | 2 | 2020-09-08T19:53:17.000Z | 2021-01-20T04:57:09.000Z | core/self_supervision_summarization_cat_batch.py | hbdat/eccv20_Multi_Task_Procedure_Learning | 9212f321e12cafb12030b982b4873fc7ddec8799 | [
"MIT"
] | 7 | 2021-02-02T12:29:56.000Z | 2021-12-09T17:55:41.000Z | core/self_supervision_summarization_cat_batch.py | hbdat/eccv20_Multi_Task_Procedure_Learning | 9212f321e12cafb12030b982b4873fc7ddec8799 | [
"MIT"
] | 3 | 2021-02-10T13:31:49.000Z | 2021-05-31T07:08:33.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 17:09:50 2019
@author: Warmachine
"""
import numpy as np
import sklearn
import torch
import scipy
import pdb
from sklearn.cluster import KMeans,MiniBatchKMeans
from sklearn.externals import joblib
class SelfSupervisionSummarization:
def __init__(s... | 37.698413 | 280 | 0.556912 |
b1f95f237c6b77d2d814bfefa7ace3a320fd30b4 | 2,020 | py | Python | 7-assets/past-student-repos/Whiteboard-Pairing-master/BSTFromArray/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Whiteboard-Pairing-master/BSTFromArray/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Whiteboard-Pairing-master/BSTFromArray/model_solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import math
def create_minimal_BST(sorted_array):
return create_minimal_BST_helper(sorted_array, 0, len(sorted_array) - 1)
def create_minimal_BST_helper(sorted_array, left, right):
if right < left:
return None
mid = math.floor((left + right) / 2)
node = BinaryTreeNode(sorted_array[mid])
... | 31.076923 | 117 | 0.679208 |
06f7c6efa27850f78bb5173faadb684fdaa9a35c | 595 | py | Python | wagtailsharing/checks.py | fabrique/wagtail-sharing | 7943029c8c8a412da6bd0918c8e0a2fd78f76210 | [
"CC0-1.0"
] | 43 | 2017-01-10T17:26:02.000Z | 2022-03-23T08:09:50.000Z | wagtailsharing/checks.py | fabrique/wagtail-sharing | 7943029c8c8a412da6bd0918c8e0a2fd78f76210 | [
"CC0-1.0"
] | 25 | 2017-01-13T20:27:56.000Z | 2022-03-10T15:55:51.000Z | wagtailsharing/checks.py | fabrique/wagtail-sharing | 7943029c8c8a412da6bd0918c8e0a2fd78f76210 | [
"CC0-1.0"
] | 12 | 2017-01-31T20:47:50.000Z | 2021-11-03T09:38:06.000Z | from django.apps import apps
from django.core.checks import Error, register
@register()
def modeladmin_installed_check(app_configs, **kwargs):
errors = []
MODELADMIN_APP = "wagtail.contrib.modeladmin"
if not apps.is_installed(MODELADMIN_APP):
error_hint = "Is '{}' in settings.INSTALLED_APPS?".for... | 24.791667 | 71 | 0.605042 |
a0f0a01da72ea5567d5c573efd99daf952d027b6 | 384 | py | Python | bmlfs/examples/k_means.py | nguyentritai2906/bmlfs | cf5128065289caae9f38a29bbb762bcf2fe7fd3a | [
"MIT"
] | null | null | null | bmlfs/examples/k_means.py | nguyentritai2906/bmlfs | cf5128065289caae9f38a29bbb762bcf2fe7fd3a | [
"MIT"
] | null | null | null | bmlfs/examples/k_means.py | nguyentritai2906/bmlfs | cf5128065289caae9f38a29bbb762bcf2fe7fd3a | [
"MIT"
] | null | null | null | from sklearn import datasets
from bmlfs.unsupervised_learning import KMeans
from bmlfs.utils import Plot
def main():
X, y = datasets.make_blobs()
classifier = KMeans(k=3)
y_pred = classifier.predict(X)
p = Plot()
p.plot_in_2d(X, y_pred, title="K-Means Clustering")
p.plot_in_2d(X, y, title="G... | 20.210526 | 55 | 0.690104 |
054596bd1c94edc76b12f49c95534fb3ec97b048 | 622 | py | Python | saleor/shipping/utils.py | ammogcoder/saleor | e4160652b68de002b51708a775050c95bfd1a3a5 | [
"BSD-3-Clause"
] | 1 | 2018-03-17T02:41:15.000Z | 2018-03-17T02:41:15.000Z | saleor/shipping/utils.py | ammogcoder/saleor | e4160652b68de002b51708a775050c95bfd1a3a5 | [
"BSD-3-Clause"
] | 86 | 2018-03-08T14:19:19.000Z | 2018-05-12T14:55:16.000Z | saleor/shipping/utils.py | ammogcoder/saleor | e4160652b68de002b51708a775050c95bfd1a3a5 | [
"BSD-3-Clause"
] | 2 | 2018-03-05T12:29:10.000Z | 2018-09-28T12:40:52.000Z | from prices import PriceRange
from .models import ShippingMethodCountry
def get_shipment_options(country_code):
shipping_methods_qs = ShippingMethodCountry.objects.select_related(
'shipping_method')
shipping_methods = shipping_methods_qs.filter(country_code=country_code)
if not shipping_methods.e... | 36.588235 | 77 | 0.763666 |
4aba4e4b33271e6f867460a257c527185adba79c | 17 | py | Python | projects/pycountry/test.py | quinn-dougherty/python-on-nix | 910d3f6554acd4a4ef0425ebccd31104dccb283c | [
"Unlicense"
] | 25 | 2021-10-30T19:54:59.000Z | 2022-03-29T06:11:02.000Z | projects/pycountry/test.py | quinn-dougherty/python-on-nix | 910d3f6554acd4a4ef0425ebccd31104dccb283c | [
"Unlicense"
] | 21 | 2021-10-19T01:09:38.000Z | 2022-03-24T16:08:53.000Z | projects/pycountry/test.py | quinn-dougherty/python-on-nix | 910d3f6554acd4a4ef0425ebccd31104dccb283c | [
"Unlicense"
] | 3 | 2022-01-25T20:25:13.000Z | 2022-03-08T02:58:50.000Z | import pycountry
| 8.5 | 16 | 0.882353 |
65c2301a3c797e0440d0905ff47deaadab035ee4 | 3,561 | py | Python | numpy_demo/distutils/fcompiler/ibm.py | mpmkp2020/numpy_demo | 796262e06c84b7e9aa446b244a3faf3891d9ece1 | [
"BSD-3-Clause"
] | null | null | null | numpy_demo/distutils/fcompiler/ibm.py | mpmkp2020/numpy_demo | 796262e06c84b7e9aa446b244a3faf3891d9ece1 | [
"BSD-3-Clause"
] | null | null | null | numpy_demo/distutils/fcompiler/ibm.py | mpmkp2020/numpy_demo | 796262e06c84b7e9aa446b244a3faf3891d9ece1 | [
"BSD-3-Clause"
] | null | null | null | import os
import re
import sys
import subprocess
from numpy_demo.distutils.fcompiler import FCompiler
from numpy_demo.distutils.exec_command import find_executable
from numpy_demo.distutils.misc_util import make_temp_file
from distutils import log
compilers = ['IBMFCompiler']
class IBMFCompiler(FCompiler):
compi... | 36.336735 | 137 | 0.550126 |
d7125fd37625311ba75775ad492e00fec4e10d85 | 1,016 | py | Python | OMDB.py | Hydrayt777/OMDb-Bot | 79273f188e326adab628a3c4aa48957ba9c82bc8 | [
"MIT"
] | null | null | null | OMDB.py | Hydrayt777/OMDb-Bot | 79273f188e326adab628a3c4aa48957ba9c82bc8 | [
"MIT"
] | null | null | null | OMDB.py | Hydrayt777/OMDb-Bot | 79273f188e326adab628a3c4aa48957ba9c82bc8 | [
"MIT"
] | null | null | null | #sheriyenna
import requests
from info import API_KEY
user = {"User-Agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36 Edg/87.0.664.57"}
def get_movie_info(query):
try:
url = f'http://www.omdbapi.com/?apikey={AP... | 29.028571 | 174 | 0.564961 |
51114255ff318fd0c777cec01507e2d188978c03 | 905 | py | Python | treeio/core/trash/urls.py | Andrea-MariaDB-2/treeio | f50ab9bae93f7a0a062b5316485a7bbeb4b6ac4e | [
"MIT"
] | 242 | 2015-01-01T15:08:23.000Z | 2022-01-19T21:14:24.000Z | treeio/core/trash/urls.py | J4CODE/treeio | bae3115f4015aad2cbc5ab45572232ceec990495 | [
"MIT"
] | 52 | 2015-01-05T09:13:17.000Z | 2018-12-26T14:52:43.000Z | treeio/core/trash/urls.py | J4CODE/treeio | bae3115f4015aad2cbc5ab45572232ceec990495 | [
"MIT"
] | 99 | 2015-01-09T23:28:14.000Z | 2021-12-30T09:19:51.000Z | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Core module Administration panel URLs
"""
from django.conf.urls import patterns, url
urlpatterns = patterns('treeio.core.trash.views',
url(r'^(\.(?P<response_format>\w+))?/?$',
... | 37.708333 | 90 | 0.496133 |
b5cd030c68aff6a3458acbea6ccf34897629d672 | 614 | py | Python | live_notes/exp/nb_lesson82.py | timdavidlee/fastai_dl_p2_2019 | 760a28d4dc320848ba28dfd7146ff6bab51499e9 | [
"MIT"
] | null | null | null | live_notes/exp/nb_lesson82.py | timdavidlee/fastai_dl_p2_2019 | 760a28d4dc320848ba28dfd7146ff6bab51499e9 | [
"MIT"
] | null | null | null | live_notes/exp/nb_lesson82.py | timdavidlee/fastai_dl_p2_2019 | 760a28d4dc320848ba28dfd7146ff6bab51499e9 | [
"MIT"
] | null | null | null |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: dev_nb/lesson82.ipynb
# standard libraries
from pathlib import Path
from IPython.core.debugger import set_trace
import pickle, gzip, math, torch, matplo... | 23.615385 | 56 | 0.623779 |
92b35e1e0f94463fe35b18ddd8a172dd1ece07f3 | 3,754 | py | Python | travis_pypi_setup.py | mitodl/epithet | 4f95054fbdfbae0e9d6db2e3309993d00a8a6867 | [
"MIT"
] | 6 | 2017-05-25T18:30:44.000Z | 2019-08-13T20:39:34.000Z | travis_pypi_setup.py | mitodl/epithet | 4f95054fbdfbae0e9d6db2e3309993d00a8a6867 | [
"MIT"
] | 2 | 2021-03-25T21:39:52.000Z | 2021-11-15T17:46:46.000Z | travis_pypi_setup.py | mitodl/epithet | 4f95054fbdfbae0e9d6db2e3309993d00a8a6867 | [
"MIT"
] | 1 | 2019-08-13T20:39:39.000Z | 2019-08-13T20:39:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | 30.520325 | 79 | 0.70032 |
d6ce734893d926e7e0d155223ff70c8f29c03196 | 268 | py | Python | niyopolymers/niyopolymers/doctype/interview_round_feedback/interview_round_feedback.py | venku31/niyopolymers | f150ee591d2ea10720d8e98c5f6abf7c6e2edb2d | [
"MIT"
] | null | null | null | niyopolymers/niyopolymers/doctype/interview_round_feedback/interview_round_feedback.py | venku31/niyopolymers | f150ee591d2ea10720d8e98c5f6abf7c6e2edb2d | [
"MIT"
] | null | null | null | niyopolymers/niyopolymers/doctype/interview_round_feedback/interview_round_feedback.py | venku31/niyopolymers | f150ee591d2ea10720d8e98c5f6abf7c6e2edb2d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Atriina and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class InterviewRoundFeedback(Document):
pass
| 24.363636 | 49 | 0.783582 |
1f62db1216ca574207b9b8e070e4691f02426f64 | 131,162 | py | Python | tests/hwsim/test_fst_module.py | waittrue/wireless | 3c64f015dc62aec4da0b696f45cc4bcf41594c5d | [
"Unlicense"
] | 1 | 2016-04-22T19:32:57.000Z | 2016-04-22T19:32:57.000Z | tests/hwsim/test_fst_module.py | Acidburn0zzz/third_party-hostap | 0542463c4de76fde6e8164f75b3a52ce0ddd8087 | [
"Unlicense"
] | null | null | null | tests/hwsim/test_fst_module.py | Acidburn0zzz/third_party-hostap | 0542463c4de76fde6e8164f75b3a52ce0ddd8087 | [
"Unlicense"
] | null | null | null | # FST functionality tests
# Copyright (c) 2015, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import struct
import subprocess
import time
import os
import re
import hwsim_utils
from hwsim impor... | 46.577415 | 144 | 0.646849 |
4f84ac9fdc7da38f8f3809747bc7bc54b164effa | 1,603 | py | Python | bulk_resize.py | timothyyu/au_utils | 6d1f1095b7f5de823a329ca9beb787c72aaea53b | [
"BSD-3-Clause"
] | 1 | 2019-02-01T05:09:37.000Z | 2019-02-01T05:09:37.000Z | bulk_resize.py | timothyyu/au_utils | 6d1f1095b7f5de823a329ca9beb787c72aaea53b | [
"BSD-3-Clause"
] | null | null | null | bulk_resize.py | timothyyu/au_utils | 6d1f1095b7f5de823a329ca9beb787c72aaea53b | [
"BSD-3-Clause"
] | null | null | null | # https://kishstats.com/python/2018/04/27/bulk-image-resizing-python.html
import os
import argparse
from PIL import Image
DEFAULT_SIZE = (320, 180)
def resize_image(input_dir, infile, output_dir="resized", size=DEFAULT_SIZE):
outfile = os.path.splitext(infile)[0] + "_resized"
extension = os.path.splitext(in... | 27.637931 | 77 | 0.632564 |
5ee678e4ad93e4b750bbc05af602d20fceb99baf | 993 | py | Python | inference.py | sem-onyalo/dnn-training-model | f08d4aee4e87c3a72f9883e5232a628f0fe98cbc | [
"MIT"
] | null | null | null | inference.py | sem-onyalo/dnn-training-model | f08d4aee4e87c3a72f9883e5232a628f0fe98cbc | [
"MIT"
] | null | null | null | inference.py | sem-onyalo/dnn-training-model | f08d4aee4e87c3a72f9883e5232a628f0fe98cbc | [
"MIT"
] | null | null | null | from data import Data
from matplotlib import pyplot
from tensorflow.keras.models import load_model
class Inference:
def __init__(self, data:Data, modelPath:str, latentDim:int) -> None:
self.data = data
self.modelPath = modelPath
self.latentDim = latentDim
self.samples = 100
... | 34.241379 | 92 | 0.638469 |
6d50741dc7df1cb199b08995ec154c74e1444699 | 916 | py | Python | beginning-game-development/Chapter 7/7-7.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | 43 | 2015-09-20T02:05:48.000Z | 2022-03-01T22:00:43.000Z | beginning-game-development/Chapter 7/7-7.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | beginning-game-development/Chapter 7/7-7.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | 40 | 2015-05-19T06:51:13.000Z | 2022-03-27T18:11:16.000Z | class StateMachine(object):
def __init__(self):
self.states = {} # Stores the states
self.active_state = None # The currently active state
def add_state(self, state):
# Add a state to the internal dictionary
self.states[state.name] = state
def think(self):
# Only continue if t... | 26.941176 | 68 | 0.686681 |
84fa4ee95d10ab807258b45abe5cd882e3b89e9b | 6,984 | py | Python | log_caspase/model_21.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_caspase/model_21.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_caspase/model_21.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C3ub')
Monomer('C3A', ['Xiap', 'ParpU', 'C6pro'])
Mo... | 69.84 | 296 | 0.818013 |
08ca4d48422249a173591dfaafab7c2366822d51 | 819 | py | Python | config.py | dansam100/git2svn-sync | a9781f75e7d10074837e7ead50ba448545d4cc6c | [
"MIT"
] | null | null | null | config.py | dansam100/git2svn-sync | a9781f75e7d10074837e7ead50ba448545d4cc6c | [
"MIT"
] | null | null | null | config.py | dansam100/git2svn-sync | a9781f75e7d10074837e7ead50ba448545d4cc6c | [
"MIT"
] | null | null | null | import os
DUMMY_SVN = False
TRACE_LOGS = False
SWITCH_USER_FOR_COMMITS = False
USE_PATCH_TOOL = True
USE_SVN_PATCH_FORMAT = False
root_dir = os.getcwd().replace("\\", "/")
patches_dir = f"{root_dir}/patches/"
git_url = "C:/work/git_repo"
git_branch = "master"
git_pull_timeout = 60000
svn_url = 'C:/wo... | 31.5 | 138 | 0.733822 |
145b7fb27b2c4c622fb2eaa86b3fb1b8b57376b1 | 18,679 | py | Python | infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py | DmytroLiaskovskyi/incubator-dlab | af995e98b3b3cf526fb9741a3e5117dd1e04f3aa | [
"Apache-2.0"
] | null | null | null | infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py | DmytroLiaskovskyi/incubator-dlab | af995e98b3b3cf526fb9741a3e5117dd1e04f3aa | [
"Apache-2.0"
] | null | null | null | infrastructure-provisioning/src/general/lib/os/debian/ssn_lib.py | DmytroLiaskovskyi/incubator-dlab | af995e98b3b3cf526fb9741a3e5117dd1e04f3aa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# *****************************************************************************
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The A... | 53.829971 | 313 | 0.546924 |
89de3551bbf751e74c9a229abac7290f4b051d84 | 3,634 | py | Python | tests/modules/test_molotov.py | yurifrl/taurus | 7e56c4c50142a8294b1a950fb780ce5c1333c245 | [
"Apache-2.0"
] | 1 | 2019-12-05T14:57:58.000Z | 2019-12-05T14:57:58.000Z | tests/modules/test_molotov.py | hiroksarker/taurus | 0982f64b7cf36669dc88c6286b880d2b9ad2a514 | [
"Apache-2.0"
] | null | null | null | tests/modules/test_molotov.py | hiroksarker/taurus | 0982f64b7cf36669dc88c6286b880d2b9ad2a514 | [
"Apache-2.0"
] | null | null | null | import sys
import time
import unittest
from os.path import exists, join
from bzt import ToolError
from bzt.modules.aggregator import DataPoint, KPISet
from bzt.modules.molotov import MolotovExecutor, MolotovReportReader
from bzt.utils import EXE_SUFFIX, is_windows
from tests import BZTestCase, ExecutorTestCase, RESOUR... | 33.33945 | 93 | 0.606494 |
38527ecd9abcb1b362d75e6fc85ed8ce134a3450 | 11,471 | py | Python | distributed/process.py | sodre/distributed | 0b68318112b13d70a9cdd741e5db00da2ec6a8f5 | [
"BSD-3-Clause"
] | 1 | 2021-06-24T09:12:47.000Z | 2021-06-24T09:12:47.000Z | distributed/process.py | sodre/distributed | 0b68318112b13d70a9cdd741e5db00da2ec6a8f5 | [
"BSD-3-Clause"
] | null | null | null | distributed/process.py | sodre/distributed | 0b68318112b13d70a9cdd741e5db00da2ec6a8f5 | [
"BSD-3-Clause"
] | 1 | 2020-11-25T04:42:07.000Z | 2020-11-25T04:42:07.000Z | import atexit
from datetime import timedelta
import logging
import os
from queue import Queue as PyQueue
import re
import threading
import weakref
import dask
from .utils import mp_context
from tornado import gen
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
logger = logging.getLogger(__na... | 32.868195 | 87 | 0.599163 |
8a68a18f841e6b934a86c07c0bb5a88d66297552 | 4,825 | py | Python | demos/incompressible_flow/lid_driven_cavity/run_unif.py | marc-nguessan/mrpy | 6fb0bce485234a45bb863f71bc2bdf0a22014de3 | [
"BSD-3-Clause"
] | 2 | 2020-01-06T10:48:44.000Z | 2020-01-09T20:07:08.000Z | demos/incompressible_flow/lid_driven_cavity/run_unif.py | marc-nguessan/mrpy | 6fb0bce485234a45bb863f71bc2bdf0a22014de3 | [
"BSD-3-Clause"
] | 1 | 2020-01-09T20:08:50.000Z | 2020-01-09T20:11:20.000Z | demos/incompressible_flow/lid_driven_cavity/run_unif.py | marc-nguessan/mrpy | 6fb0bce485234a45bb863f71bc2bdf0a22014de3 | [
"BSD-3-Clause"
] | null | null | null | """...
"""
import sys, petsc4py
petsc4py.init(sys.argv)
import petsc4py.PETSc as petsc
import mpi4py.MPI as mpi
import numpy as np
import math
import importlib
import config as cfg
from mrpy.mr_utils import mesh
from mrpy.mr_utils import op
import mrpy.discretization.temporal as td
import mrpy.discretization.spatial ... | 37.403101 | 89 | 0.618653 |
b04130d14d7ced55d93254a84524e86f31414c18 | 1,652 | py | Python | src/transformers/models/transfo_xl/__init__.py | nhatminh46vn/transformers | 9972a0279f45d81b29e4bdc2a906436a783bc2f7 | [
"Apache-2.0"
] | 6 | 2021-11-03T05:10:35.000Z | 2022-03-25T20:28:06.000Z | src/transformers/models/transfo_xl/__init__.py | juand-r/transformers | 912f6881d2b69f180522172a5283702bd8c41d9c | [
"Apache-2.0"
] | null | null | null | src/transformers/models/transfo_xl/__init__.py | juand-r/transformers | 912f6881d2b69f180522172a5283702bd8c41d9c | [
"Apache-2.0"
] | 3 | 2021-09-19T08:20:42.000Z | 2022-02-19T16:32:40.000Z | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 36.711111 | 95 | 0.757869 |
e261ae3fda29791b10e1f4d18707ecdc859ab12b | 2,986 | py | Python | misc/nms.py | Luciano233/OCR_Japanease | 055bdd0cc8e4d053dfb471cd642b1616ba0938d1 | [
"MIT"
] | 1 | 2021-03-15T02:57:21.000Z | 2021-03-15T02:57:21.000Z | misc/nms.py | Luciano233/OCR_Japanease | 055bdd0cc8e4d053dfb471cd642b1616ba0938d1 | [
"MIT"
] | null | null | null | misc/nms.py | Luciano233/OCR_Japanease | 055bdd0cc8e4d053dfb471cd642b1616ba0938d1 | [
"MIT"
] | null | null | null | import numpy as np
def non_max_suppression(boxes, overlapThresh=0.3):
if len(boxes) == 0:
return []
sorted_box = sorted(boxes, key=lambda x:x.score())[::-1]
ignore_flg = [False] * len(sorted_box)
for i in range(len(sorted_box)):
if not ignore_flg[i]:
for j in range(i+1,len... | 41.472222 | 90 | 0.495311 |
f402c6ad026f4f5a8307796a183c392a47eed0ac | 694 | py | Python | meetings/models.py | mauricejulesm/meeting_plannerApp-Django3.0 | 4e99893ea1ce98d983d2f6d19dd621d7ea56a808 | [
"MIT"
] | null | null | null | meetings/models.py | mauricejulesm/meeting_plannerApp-Django3.0 | 4e99893ea1ce98d983d2f6d19dd621d7ea56a808 | [
"MIT"
] | null | null | null | meetings/models.py | mauricejulesm/meeting_plannerApp-Django3.0 | 4e99893ea1ce98d983d2f6d19dd621d7ea56a808 | [
"MIT"
] | null | null | null | from datetime import time
from django.db import models
# Create your models here.
class Room(models.Model):
room_name = models.CharField(max_length=100)
room_number = models.IntegerField()
floor_number = models.IntegerField()
def __str__(self):
return f"{self.room_name} on {self.floor_number... | 27.76 | 76 | 0.714697 |
79a38f3502166233f1c08c6393e69c6b4727bda4 | 7,568 | py | Python | litex_boards/targets/versa_ecp5.py | jersey99/litex-boards | 98c80f0b2b07b8c7807105ec3d7d0c0896b80cac | [
"BSD-2-Clause"
] | 1 | 2021-05-29T21:57:17.000Z | 2021-05-29T21:57:17.000Z | litex_boards/targets/versa_ecp5.py | jersey99/litex-boards | 98c80f0b2b07b8c7807105ec3d7d0c0896b80cac | [
"BSD-2-Clause"
] | null | null | null | litex_boards/targets/versa_ecp5.py | jersey99/litex-boards | 98c80f0b2b07b8c7807105ec3d7d0c0896b80cac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2018-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2018-2019 David Shah <dave@ds0.me>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncReset... | 44 | 174 | 0.552061 |
7954d73f446c343c4c0fbf1e55bf7095f3d52925 | 5,588 | py | Python | ALGO_BreadthFirstSearch.py | divergent63/DataStructureAlgorithms | 1e378a31beb6ac1b333b560f0bfe2a3daeef7be2 | [
"Apache-2.0"
] | null | null | null | ALGO_BreadthFirstSearch.py | divergent63/DataStructureAlgorithms | 1e378a31beb6ac1b333b560f0bfe2a3daeef7be2 | [
"Apache-2.0"
] | null | null | null | ALGO_BreadthFirstSearch.py | divergent63/DataStructureAlgorithms | 1e378a31beb6ac1b333b560f0bfe2a3daeef7be2 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
import math
import DST_Graph
import DST_Queue
# 词梯问题
def BuildWordGraph(file):
with open(file) as f:
word_data = f.readlines()
buckets = {}
for line in word_data:
for i in range(len(line)-1):
bucket = line[:i] + '_' + line[i+1:]
if bucket no... | 34.073171 | 123 | 0.535612 |
a3f7a10ac372d192bc4af3cde260133fcf26f733 | 3,715 | py | Python | webdriver/tests/print/user_prompts.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 1 | 2021-12-19T09:30:55.000Z | 2021-12-19T09:30:55.000Z | webdriver/tests/print/user_prompts.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 6 | 2021-03-31T20:00:14.000Z | 2022-03-12T00:50:17.000Z | webdriver/tests/print/user_prompts.py | spao234/wpt | 4b9447991bcb28f37b45532caf7f8e8747f9ad41 | [
"BSD-3-Clause"
] | 1 | 2020-11-09T05:05:06.000Z | 2020-11-09T05:05:06.000Z | # META: timeout=long
import base64
import pytest
from six import ensure_binary
from tests.support.asserts import assert_dialog_handled, assert_error, assert_success
from tests.support.inline import inline
from .printcmd import do_print, assert_pdf
@pytest.fixture
def check_user_prompt_closed_without_exception(sess... | 32.304348 | 90 | 0.756662 |
21035f14cc1c5d4a4de4b46b58c5d88b1cf13a2c | 3,826 | py | Python | 1dim_gaussian/model.py | MasazI/gan_basic | 37e23e1799616bafa18527aeffc1d3c8e7c5f2ef | [
"MIT"
] | 7 | 2017-04-03T14:08:52.000Z | 2021-03-15T02:55:04.000Z | 1dim_gaussian/model.py | MasazI/gan_basic | 37e23e1799616bafa18527aeffc1d3c8e7c5f2ef | [
"MIT"
] | 2 | 2017-06-06T21:31:20.000Z | 2017-10-15T07:40:18.000Z | 1dim_gaussian/model.py | MasazI/gan_basic | 37e23e1799616bafa18527aeffc1d3c8e7c5f2ef | [
"MIT"
] | 5 | 2017-10-15T09:27:53.000Z | 2021-02-26T06:53:42.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import model_part
class Discriminator():
def __init__(self, hidden_layer_dim, output_dim):
self.hidden_layer_dim = hidden_layer_dim
self.hidden_layer_dim2 = hidden_... | 53.887324 | 135 | 0.65839 |
11cdf217f5c9984858725334cd8aae25bbfe199b | 341 | py | Python | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/features.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/features.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/features.py | diego-d5000/MisValesMd | b641782bc2546776e9f55f452ec7fb48100dc482 | [
"MIT"
] | null | null | null | from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
from django.db.backends.postgresql_psycopg2.features import \
DatabaseFeatures as Psycopg2DatabaseFeatures
class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures):
supports_3d_functions = True
supports_left_r... | 37.888889 | 77 | 0.826979 |
1be32bf821512c9f06894132200385e966b30103 | 4,621 | py | Python | PythonClient/computer_vision/qzc_cv_capture.py | aqiugroup/AirSim | b8ea885963d38f15a3176f9f0b4a4473ba21c4a6 | [
"MIT"
] | null | null | null | PythonClient/computer_vision/qzc_cv_capture.py | aqiugroup/AirSim | b8ea885963d38f15a3176f9f0b4a4473ba21c4a6 | [
"MIT"
] | null | null | null | PythonClient/computer_vision/qzc_cv_capture.py | aqiugroup/AirSim | b8ea885963d38f15a3176f9f0b4a4473ba21c4a6 | [
"MIT"
] | null | null | null | # In settings.json first activate computer vision mode:
# https://github.com/Microsoft/AirSim/blob/master/docs/image_apis.md#computer-vision-mode
import setup_path
import airsim
import pprint
import tempfile
import os
import sys
import time
file_path = "/Users/aqiu/Documents/AirSim/2022-03-07-02-02-06/airsim_rec.tx... | 37.877049 | 150 | 0.675611 |
e85c6e06858444be1865a9e74a2be9c94a7e00f2 | 46 | py | Python | salon/api/serializers/__init__.py | amirRamirfatahi/beautstertest | 53f6e515903fd11992fd1eb70760318b17896437 | [
"MIT"
] | null | null | null | salon/api/serializers/__init__.py | amirRamirfatahi/beautstertest | 53f6e515903fd11992fd1eb70760318b17896437 | [
"MIT"
] | 5 | 2021-03-30T13:08:19.000Z | 2021-09-22T18:54:13.000Z | salon/api/serializers/__init__.py | amirRamirfatahi/beautstertest | 53f6e515903fd11992fd1eb70760318b17896437 | [
"MIT"
] | null | null | null | from .salon_serializer import SalonSerializer
| 23 | 45 | 0.891304 |
6f62a23b1d438b27fecc10ff692c7af3351ff007 | 7,019 | py | Python | plaid/model/credit_filter.py | hboshnak/plaid-python | 69f0879b01ce7119d220a2a2b6e2f48570df609f | [
"MIT"
] | null | null | null | plaid/model/credit_filter.py | hboshnak/plaid-python | 69f0879b01ce7119d220a2a2b6e2f48570df609f | [
"MIT"
] | null | null | null | plaid/model/credit_filter.py | hboshnak/plaid-python | 69f0879b01ce7119d220a2a2b6e2f48570df609f | [
"MIT"
] | null | null | null | """
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | 38.994444 | 110 | 0.591395 |
fe7e6dd9aa21ae646052be9ca790a47424be55ec | 3,973 | py | Python | alipay/aop/api/request/AlipayOpenIotmbsRoomstateSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayOpenIotmbsRoomstateSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayOpenIotmbsRoomstateSyncRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayOpenIotmbsRoomstateSyncModel import AlipayOpenIotmbsRoomstateSyncModel
class AlipayOpenIotmbsRoomstateSyncRequest(object):
... | 27.4 | 148 | 0.644853 |
d1d221f085d4138ecedd2364200f61ba4713d47a | 2,685 | py | Python | docker_hoernchen/flask/gsheets.py | sroertgen/oerhoernchen20_docker | b7cd697b62f2865b24879b2ccbe8dcd65c512fb6 | [
"CC0-1.0"
] | 2 | 2019-12-14T16:33:41.000Z | 2020-01-14T09:34:58.000Z | docker_hoernchen/flask/gsheets.py | sroertgen/oerhoernchen20_docker | b7cd697b62f2865b24879b2ccbe8dcd65c512fb6 | [
"CC0-1.0"
] | 6 | 2020-02-27T11:22:53.000Z | 2022-02-13T02:27:14.000Z | docker_hoernchen/flask/gsheets.py | sroertgen/oerhoernchen20_docker | b7cd697b62f2865b24879b2ccbe8dcd65c512fb6 | [
"CC0-1.0"
] | 2 | 2020-03-25T10:37:51.000Z | 2020-04-22T09:41:59.000Z | from flask_restful import Resource, reqparse
import uuid
import requests
import json
import pprint
from elasticsearch import Elasticsearch
# Link to sheet: https://spreadsheets.google.com/feeds/list/1kntJWO9iP6rL6WFqKXNsINoa923LjoDfEz38_NA4-ao/od6/public/values?alt=json
# Setup gsheet link
gsheet_link = 'https://spre... | 32.743902 | 131 | 0.603724 |
ea2aeacc64707fc64db8e483b4cc667b5b213b8b | 469 | py | Python | SmartBadge/timedata.py | SmartBadge/SmartBadge | 7bddc1ec230bcf5fa6185999b0b0c0e448528629 | [
"MIT"
] | null | null | null | SmartBadge/timedata.py | SmartBadge/SmartBadge | 7bddc1ec230bcf5fa6185999b0b0c0e448528629 | [
"MIT"
] | null | null | null | SmartBadge/timedata.py | SmartBadge/SmartBadge | 7bddc1ec230bcf5fa6185999b0b0c0e448528629 | [
"MIT"
] | null | null | null | import ujson
class TimeData(object):
def __init__(self, filename, subject, slot):
f = open(filename)
timedata = ujson.load(f)
self.title = timedata[subject]['class' + str(slot)]['title']
self.time = timedata[subject]['class' + str(slot)]['time']
self.location = timedata[s... | 24.684211 | 74 | 0.603412 |
82e6c1b6afa5608d7f213c902116afec72f6181e | 3,417 | py | Python | homeassistant/components/mobile_app/helpers.py | zemerick1/home-assistant-1 | 2d2abc783151ea7a876c6ffd0cbc9e5062834c9a | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mobile_app/helpers.py | zemerick1/home-assistant-1 | 2d2abc783151ea7a876c6ffd0cbc9e5062834c9a | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mobile_app/helpers.py | zemerick1/home-assistant-1 | 2d2abc783151ea7a876c6ffd0cbc9e5062834c9a | [
"Apache-2.0"
] | null | null | null | """Helpers for mobile_app."""
import logging
import json
from typing import Callable, Dict, Tuple
from aiohttp.web import Response
from homeassistant.core import Context
from homeassistant.helpers.typing import HomeAssistantType
from .const import (ATTR_APP_DATA, ATTR_APP_ID, ATTR_APP_NAME,
ATTR_... | 32.855769 | 79 | 0.687445 |
bccafb05c62b2b658ee4691d6bdaa94bee99acd4 | 4,118 | py | Python | lib/python-bitcoinlib/bitcoin/tests/test_transactions.py | petertodd/tx-flood-attack | 772ec12cb503e721c29a24bc78c9cd64f843d015 | [
"MIT"
] | 3 | 2016-07-29T02:13:51.000Z | 2018-06-05T23:12:47.000Z | lib/python-bitcoinlib/bitcoin/tests/test_transactions.py | ezaruba/tx-flood-attack | 772ec12cb503e721c29a24bc78c9cd64f843d015 | [
"MIT"
] | null | null | null | lib/python-bitcoinlib/bitcoin/tests/test_transactions.py | ezaruba/tx-flood-attack | 772ec12cb503e721c29a24bc78c9cd64f843d015 | [
"MIT"
] | 2 | 2015-01-17T22:54:44.000Z | 2019-01-19T14:39:15.000Z | # Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import unittest
import os
from bitcoin.core import COutPoint, CTxIn, CTxOut, CTra... | 36.122807 | 133 | 0.609519 |
5207d092a56aa016945dd43165d33f64156c0d7a | 2,419 | py | Python | tests/test_quantum_volume.py | msohaibalam/forest-benchmarking | 40f5fd5235803204b34fa8ba1ced4ef2e0f3098d | [
"Apache-2.0"
] | null | null | null | tests/test_quantum_volume.py | msohaibalam/forest-benchmarking | 40f5fd5235803204b34fa8ba1ced4ef2e0f3098d | [
"Apache-2.0"
] | null | null | null | tests/test_quantum_volume.py | msohaibalam/forest-benchmarking | 40f5fd5235803204b34fa8ba1ced4ef2e0f3098d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import warnings
from forest_benchmarking.quantum_volume import *
np.random.seed(1)
def test_ideal_sim_heavy_probs(qvm):
qvm.qam.random_seed = 1
depths = [2, 3]
# silence warning from too few circuits, since 100 circuits is too slow
with warnings.catch_warnings():
warnings.... | 29.144578 | 96 | 0.686234 |
0fb70af5fb7994297bbf3711f2fb9f5cd49eb8de | 2,609 | py | Python | src/exhaustive_search/graph.py | ciarand/exhausting-search-homework | af9404abec70d6d92d69f1eb8237e6c8b74e7a39 | [
"0BSD"
] | 1 | 2015-04-26T21:21:40.000Z | 2015-04-26T21:21:40.000Z | src/exhaustive_search/graph.py | ciarand/exhausting-search-homework | af9404abec70d6d92d69f1eb8237e6c8b74e7a39 | [
"0BSD"
] | null | null | null | src/exhaustive_search/graph.py | ciarand/exhausting-search-homework | af9404abec70d6d92d69f1eb8237e6c8b74e7a39 | [
"0BSD"
] | null | null | null | """ Graph is provided to add some structure to the algorithms """
import random, math
from .point import Point
class Edge:
""" Edge represents a connection between two Points """
def __init__(self, left, right):
# guards
if not isinstance(left, Point):
raise TypeError("expected Po... | 32.6125 | 99 | 0.596014 |
b50d1f6d7ed1e9591d18473b1dfb133be4557120 | 2,521 | py | Python | main.py | ashishsahu1/Space-Invader | be85178840ad103d98c9d56550cdc2a7f0b17b78 | [
"MIT"
] | 1 | 2021-01-12T20:53:35.000Z | 2021-01-12T20:53:35.000Z | main.py | ashishsahu1/Space-Invader | be85178840ad103d98c9d56550cdc2a7f0b17b78 | [
"MIT"
] | null | null | null | main.py | ashishsahu1/Space-Invader | be85178840ad103d98c9d56550cdc2a7f0b17b78 | [
"MIT"
] | null | null | null | import pygame
from pygame.constants import KEYDOWN
import random
#initialise pygame module
pygame.init()
#creating screen (x,y)
screen = pygame.display.set_mode((800,600))
background = pygame.image.load('img/bg.png')
#title and icon
pygame.display.set_caption("Space Invader")
icon = pygame.image.load('img/icon2.png... | 21.921739 | 73 | 0.630305 |
df4f6617ee0fc7bc1cfa3f066889734dfd88b046 | 10,202 | py | Python | homeassistant/components/spaceapi/__init__.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/spaceapi/__init__.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/spaceapi/__init__.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for the SpaceAPI."""
from contextlib import suppress
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_ICON,
ATTR_LOCATION,
ATTR_NAME,
ATTR_STATE,
ATTR_UNIT_OF_MEASUREMENT,
CONF_ADDRESS,
... | 30.183432 | 86 | 0.656048 |
bf0379b343888a2fdff27906cd8519c1689c9c83 | 4,788 | py | Python | coreutils/fileutil.py | bcsr0009/pdtf | 5d3cc7933ac07457f6b4b59f2d4d70e0de1ffaec | [
"MIT"
] | null | null | null | coreutils/fileutil.py | bcsr0009/pdtf | 5d3cc7933ac07457f6b4b59f2d4d70e0de1ffaec | [
"MIT"
] | null | null | null | coreutils/fileutil.py | bcsr0009/pdtf | 5d3cc7933ac07457f6b4b59f2d4d70e0de1ffaec | [
"MIT"
] | null | null | null | # coding: utf-8
import requests
import json
import paramiko
import time
import logging
import os
import difflib
import pdb
from coreutils.logdecorator import logwrap
@logwrap
def execute_command(ssh_connection_handler, cmd):
'''
This method provides execute_command option on device
'''
stdin,stdout,st... | 38.926829 | 134 | 0.794277 |
a34bee5f601a595592d67466729c0ac4b0af96e4 | 6,084 | py | Python | espresso/tools/simple_greedy_decoder.py | beat-buesser/espresso | bd6ba1f7745c90a2c3c8ff0a0d7332efeebcc808 | [
"MIT"
] | 1 | 2021-01-08T02:51:16.000Z | 2021-01-08T02:51:16.000Z | espresso/tools/simple_greedy_decoder.py | opendp/espresso | 2017183c33bc3414dddcbc7850f2fa4284e6d944 | [
"MIT"
] | null | null | null | espresso/tools/simple_greedy_decoder.py | opendp/espresso | 2017183c33bc3414dddcbc7850f2fa4284e6d944 | [
"MIT"
] | 1 | 2021-09-10T15:35:58.000Z | 2021-09-10T15:35:58.000Z | # Copyright (c) Yiming Wang
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List, Optional
import numpy as np
import torch
import torch.nn as nn
from torch import Tensor
class SimpleGreedyDecoder(nn.Module):
... | 42.25 | 93 | 0.59977 |
80496d1c7089a23fe5e0a46e149a45417ea68e3d | 58,606 | py | Python | transformers/modeling_t5.py | UKPLab/StructAdapt | a4d17712de06b61064524e888ed05e12bce4fd32 | [
"Apache-2.0"
] | 16 | 2021-09-09T02:09:41.000Z | 2022-03-22T15:38:11.000Z | transformers/modeling_t5.py | UKPLab/StructAdapt | a4d17712de06b61064524e888ed05e12bce4fd32 | [
"Apache-2.0"
] | 3 | 2021-11-08T04:40:28.000Z | 2022-03-30T09:10:31.000Z | transformers/modeling_t5.py | UKPLab/StructAdapt | a4d17712de06b61064524e888ed05e12bce4fd32 | [
"Apache-2.0"
] | 6 | 2021-11-01T09:45:53.000Z | 2022-01-06T06:18:45.000Z | # coding=utf-8
# Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. 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... | 43.508537 | 213 | 0.649217 |
03f0c43bca8da24f54eff1f9d372fb3376167825 | 4,264 | py | Python | dbaas/workflow/steps/util/metric_collector.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | null | null | null | dbaas/workflow/steps/util/metric_collector.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | null | null | null | dbaas/workflow/steps/util/metric_collector.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | null | null | null | from base import BaseInstanceStep
from dbaas_credentials.models import CredentialType
from util import get_credentials_for
from util import build_context_script
from util import exec_remote_command_host
import logging
LOG = logging.getLogger(__name__)
class MetricsCollector(BaseInstanceStep):
def __init__(self,... | 32.30303 | 77 | 0.653143 |
f5effc2413e15ea411a06d72bf58d61216409a78 | 1,923 | py | Python | better/tdagent/algorithms/bcrp.py | bettertony/Better | edb58ac1a44692f4227d1c0f6cdde550eca13f4f | [
"BSD-3-Clause"
] | 1 | 2019-12-07T00:27:35.000Z | 2019-12-07T00:27:35.000Z | better/tdagent/algorithms/bcrp.py | bettertony/Better | edb58ac1a44692f4227d1c0f6cdde550eca13f4f | [
"BSD-3-Clause"
] | null | null | null | better/tdagent/algorithms/bcrp.py | bettertony/Better | edb58ac1a44692f4227d1c0f6cdde550eca13f4f | [
"BSD-3-Clause"
] | null | null | null | from ..tdagent import TDAgent
from better.tdagent.algorithms.crp import CRP
import numpy as np
from scipy.optimize import minimize
class BCRP(CRP):
""" Best Constant Rebalanced Portfolio = Constant Rebalanced Portfolio constructed with hindsight. It is often used as benchmark.
Reference:
T. Cover. Uni... | 33.736842 | 133 | 0.657826 |
7f9ab75b7f9e674a571b5904f06f61f00cf1b1b1 | 257 | py | Python | scripts/portal/enterMCave.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 9 | 2021-04-26T11:59:29.000Z | 2021-12-20T13:15:27.000Z | scripts/portal/enterMCave.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/portal/enterMCave.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 6 | 2021-07-14T06:32:05.000Z | 2022-02-06T02:32:56.000Z | # 101020400
if sm.hasQuest(21201):
sm.warpInstanceIn(914021000, 1)
sm.addQRValue(21203, "0")
sm.setInstanceTime(15*60)
if sm.hasQuest(21302):
sm.warpInstanceIn(914022100, 0)
sm.setQRValue(21203, "1", False)
sm.setInstanceTime(20*60)
| 25.7 | 36 | 0.692607 |
a5a5a2ae1ddac59e1687d05ea6df51be3ab96fb8 | 31,175 | py | Python | st7789.py | Eureka1024/RP2040-MicroPython-Mouse | fd3c113c64965601732e8625057985b799a14052 | [
"Apache-2.0"
] | null | null | null | st7789.py | Eureka1024/RP2040-MicroPython-Mouse | fd3c113c64965601732e8625057985b799a14052 | [
"Apache-2.0"
] | null | null | null | st7789.py | Eureka1024/RP2040-MicroPython-Mouse | fd3c113c64965601732e8625057985b799a14052 | [
"Apache-2.0"
] | null | null | null | """
st7789 tft driver in MicroPython based on devbis' st7789py_mpy module from
https://github.com/devbis/st7789py_mpy.
I added support for display rotation, scrolling and drawing text using 8 and 16
bit wide bitmap fonts with heights that are multiples of 8. Included are 12
bitmap fonts derived from classic pc text m... | 41.291391 | 79 | 0.527057 |
ab1ad29b0492945e5de819d81e7c9dc2b59780dd | 623 | py | Python | files/get_files.py | SitwalaM/aws_fitbit_monitor | 9827c27a58eb47dfa8d5def952991171f8939796 | [
"MIT"
] | null | null | null | files/get_files.py | SitwalaM/aws_fitbit_monitor | 9827c27a58eb47dfa8d5def952991171f8939796 | [
"MIT"
] | null | null | null | files/get_files.py | SitwalaM/aws_fitbit_monitor | 9827c27a58eb47dfa8d5def952991171f8939796 | [
"MIT"
] | null | null | null | import json
#import datetime
#import requests
#import numpy as np
import boto3
# aws services clients
s3 = boto3.client("s3")
s3_resource = boto3.resource('s3')
bucket = "bucketfitbit"
def get_s3_files_list():
my_bucket = s3_resource.Bucket(bucket)
files_in_bucket = []
files_in_bucket = [files_in_bucket... | 20.766667 | 90 | 0.70947 |
7bd2a321824acb0213bd30edfb205413559a8d80 | 2,518 | py | Python | pyquil/experiment/tests/test_setting.py | kalzoo/pyquil | f37d55acb906a02c0f3320ee3990e9051ee64145 | [
"Apache-2.0"
] | null | null | null | pyquil/experiment/tests/test_setting.py | kalzoo/pyquil | f37d55acb906a02c0f3320ee3990e9051ee64145 | [
"Apache-2.0"
] | null | null | null | pyquil/experiment/tests/test_setting.py | kalzoo/pyquil | f37d55acb906a02c0f3320ee3990e9051ee64145 | [
"Apache-2.0"
] | null | null | null | import functools
from operator import mul
import numpy as np
import pytest
from pyquil.experiment._setting import (ExperimentSetting, SIC0, SIC1, SIC2, SIC3,
TensorProductState, minusX, minusY, minusZ, plusX, plusY,
plusZ, zeros_state)
fr... | 37.58209 | 98 | 0.661239 |
90da83289c9fbb1ae258d70fe268a50e058698d4 | 7,144 | py | Python | src/paths/long/scripts/filter_vcfs.py | bayolau/discovar | 9e472aca13670e40ab2234b89c8afd64875c58bf | [
"MIT"
] | null | null | null | src/paths/long/scripts/filter_vcfs.py | bayolau/discovar | 9e472aca13670e40ab2234b89c8afd64875c58bf | [
"MIT"
] | null | null | null | src/paths/long/scripts/filter_vcfs.py | bayolau/discovar | 9e472aca13670e40ab2234b89c8afd64875c58bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
## SOFTWARE COPYRIGHT NOTICE AGREEMENT ##
## This software and its documentation are copyright (2013) by the ##
## Broad Institute. All rights are reserved. This soft... | 41.534884 | 121 | 0.496361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.