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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
258082e4d5a04c0a557f83c8074d8edbead1b428 | 683 | py | Python | combinePDF.py | LuisTarma/PythonCombinePDF | 2bab57ec186f17fc280f6abbbb446ee69f28460e | [
"Apache-2.0"
] | 4 | 2019-12-08T08:18:24.000Z | 2021-11-15T09:55:15.000Z | combinePDF.py | LuisTarma/PythonCombinePDF | 2bab57ec186f17fc280f6abbbb446ee69f28460e | [
"Apache-2.0"
] | null | null | null | combinePDF.py | LuisTarma/PythonCombinePDF | 2bab57ec186f17fc280f6abbbb446ee69f28460e | [
"Apache-2.0"
] | 1 | 2020-05-17T22:32:08.000Z | 2020-05-17T22:32:08.000Z | # combinePDF.py
# Author: Tiffany Tse
# Date: Oct 09,2018
# Updated: Oct 10, 2018
# Description: Combining pdf locally
# Dependencies: os, pyPDF2
import os
from PyPDF2 import PdfFileMerger
# Directory of the where script and py are located
fileDir = os.path.dirname(os.path.realpath(__file__))
print "This is fileDir: ... | 23.551724 | 88 | 0.729136 |
3fdce24ded05ebe522ad1f8158129781b989720f | 647 | py | Python | flask_app/__init__.py | Silicrex/HackathonProject | 887f322d1786c1aabe1c1c831c5f3082133f4998 | [
"BSD-3-Clause"
] | null | null | null | flask_app/__init__.py | Silicrex/HackathonProject | 887f322d1786c1aabe1c1c831c5f3082133f4998 | [
"BSD-3-Clause"
] | null | null | null | flask_app/__init__.py | Silicrex/HackathonProject | 887f322d1786c1aabe1c1c831c5f3082133f4998 | [
"BSD-3-Clause"
] | null | null | null | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_bootstrap import Bootstrap
app = Flask(__name__) # The central Flask instance
app.config.from_object(Config) # Load config from Config class
db =... | 38.058824 | 77 | 0.802164 |
98d52552c330d335aab0be181aa87a7a436b6035 | 54 | py | Python | T22-04/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 2 | 2019-11-20T19:26:07.000Z | 2019-11-22T00:42:23.000Z | T22-04/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 2 | 2019-11-28T05:21:24.000Z | 2019-11-28T05:21:58.000Z | T22-04/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 25 | 2019-11-27T01:40:56.000Z | 2019-12-04T23:38:59.000Z | a = c("asd")
b = 10
if a == b:
t(a)
w(a)
w(b)
| 7.714286 | 12 | 0.333333 |
d727c3c85adcf155d22093e6f6fa0c761b66fc4a | 14,752 | py | Python | blackjack_simulator.py | dennis-ho/blackjack-simulator | 8cf10f19c529f6db19b3155c07efd7455351e0ce | [
"MIT"
] | null | null | null | blackjack_simulator.py | dennis-ho/blackjack-simulator | 8cf10f19c529f6db19b3155c07efd7455351e0ce | [
"MIT"
] | null | null | null | blackjack_simulator.py | dennis-ho/blackjack-simulator | 8cf10f19c529f6db19b3155c07efd7455351e0ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import csv
import logging
import math
import random
H = 'H' # Hit
S = 'S' # Stand
Dh = 'DH' # Double Down if allowed, otherwise Hit
Ds = 'DS' # Double Down if allowed, otherwise Stand
P = 'P' # Split
Ph = 'PH' # Split if allowed, otherwise Hit
Rh = 'RH' # Surrender if all... | 38.020619 | 119 | 0.550298 |
c5886ea022fb0ba6b4e09cdca8512278b33d4b3f | 1,972 | py | Python | venv/lib/python3.8/site-packages/vsts/work_item_tracking_process_template/v4_1/models/check_template_existence_result.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/work_item_tracking_process_template/v4_1/models/check_template_existence_result.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/work_item_tracking_process_template/v4_1/models/check_template_existence_result.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 51.894737 | 141 | 0.630325 |
470f7c8ff6c95c50405a9ed6afdbdb319e214c02 | 1,657 | py | Python | var/spack/repos/builtin/packages/hibench/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/hibench/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/hibench/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 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.package import *
class Hibench(MavenPackage):
"""HiBench is a big data benchmark suite that helps evalua... | 57.137931 | 97 | 0.780326 |
a6a173dfa16946d1b343a80b4e42d5cc67ea6e07 | 397 | py | Python | lolexport/log.py | dleiferives/lolexport | 894c97240893da829e96f46e2c4cdebf85846412 | [
"MIT"
] | 2 | 2021-02-23T09:21:07.000Z | 2022-03-25T15:02:50.000Z | lolexport/log.py | dleiferives/lolexport | 894c97240893da829e96f46e2c4cdebf85846412 | [
"MIT"
] | 5 | 2021-02-24T01:26:36.000Z | 2022-02-27T13:05:27.000Z | lolexport/log.py | dleiferives/lolexport | 894c97240893da829e96f46e2c4cdebf85846412 | [
"MIT"
] | 1 | 2022-02-27T02:17:17.000Z | 2022-02-27T02:17:17.000Z | from os import environ
import logging
from logzero import setup_logger # type: ignore[import]
# https://docs.python.org/3/library/logging.html#logging-levels
loglevel: int = logging.DEBUG # (10)
if "LOLEXPORT" in environ:
loglevel = int(environ["LOLEXPORT"])
# logzero handles this fine, can be imported/configu... | 28.357143 | 63 | 0.758186 |
676ef66a3f3c3d91528be28cf7186a5e710394ec | 3,853 | py | Python | selfdrive/car/nissan/interface.py | pevdh/openpilot | fca82ba503a663ec97b7ba89c2c3da80aef739b2 | [
"MIT"
] | 1 | 2020-09-09T12:08:10.000Z | 2020-09-09T12:08:10.000Z | selfdrive/car/nissan/interface.py | pevdh/openpilot | fca82ba503a663ec97b7ba89c2c3da80aef739b2 | [
"MIT"
] | null | null | null | selfdrive/car/nissan/interface.py | pevdh/openpilot | fca82ba503a663ec97b7ba89c2c3da80aef739b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET
from selfdrive.car.nissan.values import CAR
from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint
... | 37.048077 | 116 | 0.717623 |
cf81db59081b1a13c016144ee94bff7e2930f3bc | 6,471 | py | Python | ple/ple_peru/doctype/libro_electronico_diario_simplificado/libro_electronico_diario_simplificado.py | ovenube/ple | d016e7ba6e949645613865be7198db689ca2e11f | [
"MIT"
] | 1 | 2021-02-20T19:18:51.000Z | 2021-02-20T19:18:51.000Z | ple/ple_peru/doctype/libro_electronico_diario_simplificado/libro_electronico_diario_simplificado.py | ovenube/ple | d016e7ba6e949645613865be7198db689ca2e11f | [
"MIT"
] | 1 | 2021-02-20T19:21:54.000Z | 2021-02-20T19:21:54.000Z | ple/ple_peru/doctype/libro_electronico_diario_simplificado/libro_electronico_diario_simplificado.py | ovenube/ple | d016e7ba6e949645613865be7198db689ca2e11f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, seethersan and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from ple.ple_peru.utils import Utils, to_file
class LibroElectronicoDiarioSimplificado(Utils):
def get_account(self, company, year, period... | 38.064706 | 123 | 0.625251 |
688776a7438b9583c123a0f61f01003fdc6a4fea | 6,868 | py | Python | saleor/graphql/shipping/mutations.py | overboardfreak/Project-On-Saleor | 3dd05c2705f614d3472d249e2a79f6ed82274a43 | [
"BSD-3-Clause"
] | 6 | 2019-01-06T08:39:20.000Z | 2022-03-04T18:07:47.000Z | saleor/graphql/shipping/mutations.py | alexredondosk8/saleor | 1ca28980eccb5c71e8f021c2dba66346c244d89e | [
"BSD-3-Clause"
] | 5 | 2021-03-18T23:51:16.000Z | 2022-03-11T23:45:26.000Z | saleor/graphql/shipping/mutations.py | alexredondosk8/saleor | 1ca28980eccb5c71e8f021c2dba66346c244d89e | [
"BSD-3-Clause"
] | null | null | null | from textwrap import dedent
import graphene
from ...dashboard.shipping.forms import default_shipping_zone_exists
from ...shipping import models
from ..core.mutations import ModelDeleteMutation, ModelMutation
from ..core.scalars import Decimal, WeightScalar
from .enums import ShippingMethodTypeEnum
from .types import ... | 34.862944 | 79 | 0.655504 |
c6a03e3f3f55710af48c8ccd2c18664611810482 | 7,752 | py | Python | cirq-core/cirq/ops/pauli_gates_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | 1 | 2022-02-05T22:17:39.000Z | 2022-02-05T22:17:39.000Z | cirq-core/cirq/ops/pauli_gates_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | 4 | 2022-01-16T14:12:15.000Z | 2022-02-24T03:58:46.000Z | cirq-core/cirq/ops/pauli_gates_test.py | LLcat1217/Cirq | b88069f7b01457e592ad69d6b413642ef11a56b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.762332 | 83 | 0.672472 |
bf39d4b3ac681ae0893c8e7bed39af081af76267 | 958 | py | Python | ptp/tools/wapiti/signatures.py | owtf/ptp | b43e581d7646330810f526432c689c3d88995df9 | [
"BSD-3-Clause"
] | 23 | 2015-03-22T09:18:35.000Z | 2022-03-10T23:28:13.000Z | ptp/tools/wapiti/signatures.py | owtf/ptp | b43e581d7646330810f526432c689c3d88995df9 | [
"BSD-3-Clause"
] | 22 | 2015-07-12T12:23:40.000Z | 2017-02-26T12:39:48.000Z | ptp/tools/wapiti/signatures.py | owtf/ptp | b43e581d7646330810f526432c689c3d88995df9 | [
"BSD-3-Clause"
] | 14 | 2015-06-03T19:16:22.000Z | 2022-03-10T23:28:15.000Z | """
:synopsis: Wapiti does not provide ranking for the vulnerabilities it has found. This file tries to define a ranking
for every vulnerability Wapiti might find.
.. moduleauthor:: Tao Sauvage
"""
from ptp.libptp.constants import HIGH, MEDIUM, LOW, INFO
#: :data: :class:`dict` of the categories with their r... | 27.371429 | 116 | 0.689979 |
0d0841caecbd4dd02dc8166911bf37e38d83ce9c | 977 | py | Python | apiv3/urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | 1 | 2021-08-10T13:33:37.000Z | 2021-08-10T13:33:37.000Z | apiv3/urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | apiv3/urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | 1 | 2021-09-27T08:48:32.000Z | 2021-09-27T08:48:32.000Z |
from . import views
from django.urls import path
app_name = "apiv3"
# New URLs
urlpatterns = [
path('grids/', view=views.grid_list,
name="grid_list",
),
path('grids/<slug:slug>/', view=views.grid_detail,
name="grid_detail",
),
path('grids/<slug:slug>/packages/', view=views.grid_pa... | 24.425 | 70 | 0.60696 |
573db1ce531cd6a2468e86a7a124ab15f094a47f | 1,893 | py | Python | node_modules/extsprintf/deps/javascriptlint/javascriptlint/visitation.py | tross78/placematch | 07bb4463b75bc68c3ee275c288890232f91533af | [
"MIT"
] | 3 | 2015-02-22T18:06:22.000Z | 2016-04-07T07:26:49.000Z | node_modules/extsprintf/deps/javascriptlint/javascriptlint/visitation.py | tross78/placematch | 07bb4463b75bc68c3ee275c288890232f91533af | [
"MIT"
] | 4 | 2016-02-04T15:45:32.000Z | 2016-02-05T04:25:23.000Z | node_modules/extsprintf/deps/javascriptlint/javascriptlint/visitation.py | tross78/placematch | 07bb4463b75bc68c3ee275c288890232f91533af | [
"MIT"
] | 1 | 2016-02-02T06:52:43.000Z | 2016-02-02T06:52:43.000Z | # vim: ts=4 sw=4 expandtab
""" This is an abstract module for visiting specific nodes. This is useed to
traverse the tree to generate warnings.
"""
def visit(event, *args):
""" This decorator is used to indicate which nodes the function should
examine. The function should accept (self, node) and return the rel... | 35.716981 | 78 | 0.58954 |
6ec2e42536594c28897f6645f5ce0db47668af5b | 5,538 | py | Python | utils/others/jointencoder_args.py | guopeiming/JointCPNER | 1978665a8e2559fbb4d418105f5bca47cf90addb | [
"Apache-2.0"
] | 1 | 2021-02-23T13:59:28.000Z | 2021-02-23T13:59:28.000Z | utils/others/jointencoder_args.py | guopeiming/JointCPNER | 1978665a8e2559fbb4d418105f5bca47cf90addb | [
"Apache-2.0"
] | null | null | null | utils/others/jointencoder_args.py | guopeiming/JointCPNER | 1978665a8e2559fbb4d418105f5bca47cf90addb | [
"Apache-2.0"
] | null | null | null | # @Author : guopeiming
# @Contact : guopeiming.gpm@{qq, gmail}.com
import argparse
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Neural model for NLP')
# [Data]
parser.add_argument('--joint_input', type=str, default='./data/onto/joint_char/', help='path of input da... | 71 | 207 | 0.717046 |
f0b08a5ba41ac597a8633116014df698252a7fe5 | 4,089 | py | Python | recognize_functions.py | CRM-UAM/Romualdo-HackUPC2017 | 9880330b648605339ada0be75c75752131edaf0e | [
"MIT"
] | null | null | null | recognize_functions.py | CRM-UAM/Romualdo-HackUPC2017 | 9880330b648605339ada0be75c75752131edaf0e | [
"MIT"
] | null | null | null | recognize_functions.py | CRM-UAM/Romualdo-HackUPC2017 | 9880330b648605339ada0be75c75752131edaf0e | [
"MIT"
] | null | null | null | import numpy as np
import time
import cv2
import sys
from voz import *
VALOR_UMBRAL=50
UMBRAL=450000
class Coordenadas:
def __init__(self, x, y):
self.x = x
self.y = y
class Persona:
def __init__(self, name, picture):
self.name = name
self.picture = picture
def reconocer(controller):
#Espacio... | 23.635838 | 101 | 0.668623 |
ded6679cb9d07be8e26f8f76023d7060780fd2c2 | 7,696 | py | Python | viper/icon_viper/actions/list_malware/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | viper/icon_viper/actions/list_malware/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | viper/icon_viper/actions/list_malware/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "List malware for this project"
class Input:
PROJECT_NAME = "project_name"
class Output:
MALWARE = "malware"
class ListMalwareInput(komand.Input):
schema = json.loads("""
{
"type": "obje... | 23.463415 | 66 | 0.383056 |
1109493ae6bf83b41e9a8d8e737191946936a99f | 7,170 | py | Python | core/model/metric/adm_kl.py | CharleyZhao123/LibFewShot | 8a6b0fc9b89900b04fe2f57982db8f8871322426 | [
"MIT"
] | 1 | 2021-09-20T15:39:28.000Z | 2021-09-20T15:39:28.000Z | core/model/metric/adm_kl.py | CharleyZhao123/LibFewShot | 8a6b0fc9b89900b04fe2f57982db8f8871322426 | [
"MIT"
] | null | null | null | core/model/metric/adm_kl.py | CharleyZhao123/LibFewShot | 8a6b0fc9b89900b04fe2f57982db8f8871322426 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@inproceedings{DBLP:conf/ijcai/LiWHSGL20,
author = {Wenbin Li and
Lei Wang and
Jing Huo and
Yinghuan Shi and
Yang Gao and
Jiebo Luo},
title = {Asymmetric Distribution Measure for Few-shot Learning},
bookt... | 35.85 | 100 | 0.580335 |
5404ba0c4099f6d8718375e33f1c69e4c0bc7eae | 2,980 | py | Python | 07_gashlycrumb/test.py | ddijk/tiny_python_projects | a9416039559b34bf8d36f1c043d6670f86a4583f | [
"MIT"
] | null | null | null | 07_gashlycrumb/test.py | ddijk/tiny_python_projects | a9416039559b34bf8d36f1c043d6670f86a4583f | [
"MIT"
] | null | null | null | 07_gashlycrumb/test.py | ddijk/tiny_python_projects | a9416039559b34bf8d36f1c043d6670f86a4583f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""tests for gashlycrumb.py"""
import os
import re
import random
import string
from subprocess import getstatusoutput
prg = './gashlycrumb.py'
# --------------------------------------------------
def file_flag():
"""Either -f or --file"""
return '-f' if random.randint(0, 1) else '--f... | 25.042017 | 77 | 0.474497 |
acfdadfb81f369c78c783f1b32400870685a6acf | 1,030 | py | Python | coremltools/test/sklearn_tests/test_feature_names.py | LaudateCorpus1/coremltools | 777a4460d6823e5e91dea4fa3eacb0b11c7d5dfc | [
"BSD-3-Clause"
] | 2,740 | 2017-10-03T23:19:01.000Z | 2022-03-30T15:16:39.000Z | coremltools/test/sklearn_tests/test_feature_names.py | LaudateCorpus1/coremltools | 777a4460d6823e5e91dea4fa3eacb0b11c7d5dfc | [
"BSD-3-Clause"
] | 1,057 | 2017-10-05T22:47:01.000Z | 2022-03-31T23:51:15.000Z | coremltools/test/sklearn_tests/test_feature_names.py | LaudateCorpus1/coremltools | 777a4460d6823e5e91dea4fa3eacb0b11c7d5dfc | [
"BSD-3-Clause"
] | 510 | 2017-10-04T19:22:28.000Z | 2022-03-31T12:16:52.000Z | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import coremltools.models._feature_management as fm
import coremltools.models.datatypes as dt
import uni... | 34.333333 | 82 | 0.666019 |
10a067b03b079d9e7f7278e2eeb4b87d4ca94834 | 6,560 | py | Python | rl/agents/cem.py | svdt/keras-rl | f5b560410daa1e8e86af6ac7bfb18f14c35c504b | [
"MIT"
] | null | null | null | rl/agents/cem.py | svdt/keras-rl | f5b560410daa1e8e86af6ac7bfb18f14c35c504b | [
"MIT"
] | null | null | null | rl/agents/cem.py | svdt/keras-rl | f5b560410daa1e8e86af6ac7bfb18f14c35c504b | [
"MIT"
] | null | null | null | from __future__ import division
from collections import deque
from copy import deepcopy
import numpy as np
import keras.backend as K
from keras.models import Model
from rl.core import Agent
from rl.util import *
class CEMAgent(Agent):
"""Write me
"""
def __init__(self, model, nb_actions, memory, batch_si... | 37.062147 | 136 | 0.627591 |
503dd910ee3ae91b404de79df44bbf83367e2347 | 1,264 | py | Python | Week_7/translate_mRNA.py | actaylor05/learning_python | d8c72fdb7c07bac4176a4418f83d75013db2245a | [
"MIT"
] | null | null | null | Week_7/translate_mRNA.py | actaylor05/learning_python | d8c72fdb7c07bac4176a4418f83d75013db2245a | [
"MIT"
] | null | null | null | Week_7/translate_mRNA.py | actaylor05/learning_python | d8c72fdb7c07bac4176a4418f83d75013db2245a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import biotools as bt
# Use argparse
# Write a program that translates mRNA
# Assume the protein encoded is the longest ORF
# Use a dictionary for translation and store in biotools
parser = argparse.ArgumentParser(
description='Translates mRNA.')
parser.add_argument('--file'... | 30.829268 | 290 | 0.802215 |
88c48bf92629ae84b1da10e99efc74471bd1b24d | 7,990 | py | Python | server.py | openHPI/Embedded-Smart-Home-2016 | f234f58bcde5f841e793d8c9a63388b0a333e143 | [
"MIT"
] | 1 | 2017-07-11T14:14:48.000Z | 2017-07-11T14:14:48.000Z | server.py | openHPI/Embedded-Smart-Home-2016 | f234f58bcde5f841e793d8c9a63388b0a333e143 | [
"MIT"
] | null | null | null | server.py | openHPI/Embedded-Smart-Home-2016 | f234f58bcde5f841e793d8c9a63388b0a333e143 | [
"MIT"
] | 1 | 2020-06-18T20:44:05.000Z | 2020-06-18T20:44:05.000Z | import RPi.GPIO as GPIO
from http.server import BaseHTTPRequestHandler, HTTPServer
import threading
import spidev
import time
from datetime import datetime
import os
import json
global sensor_display_thread
# HTTPRequestHandler class
class FirstHTTP_RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
s... | 29.702602 | 127 | 0.581852 |
b20f88fb9795e1b2e76dec7261899de5e78f1709 | 732 | py | Python | setup.py | anijackich/sdamgia-api | efae4176ea07c0c3127d1044adf01dcc1e171b6c | [
"MIT"
] | 5 | 2021-04-08T01:18:05.000Z | 2022-01-16T09:57:01.000Z | setup.py | anijackich/sdamgia-api | efae4176ea07c0c3127d1044adf01dcc1e171b6c | [
"MIT"
] | 2 | 2021-04-21T13:48:04.000Z | 2021-09-05T17:28:50.000Z | setup.py | anijackich/sdamgia-api | efae4176ea07c0c3127d1044adf01dcc1e171b6c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='sdamgia-api',
version='0.1.8',
author='anijack',
author_email='anijackich@gmail.com',
description='Python модуль для взаимодействия с образовательным порталом СДАМ ГИА',
long_description=open('README.md', encoding="utf8").read()... | 31.826087 | 90 | 0.65847 |
246118c25308df88d92c1061cdda3967f8e56066 | 23 | py | Python | refcount/__init__.py | jmp75/pyrefcount | 89ba62977fe21d755077f43fefb01451fec3733a | [
"Net-SNMP",
"Xnet",
"MIT"
] | 1 | 2021-01-12T10:35:12.000Z | 2021-01-12T10:35:12.000Z | tests/__init__.py | csiro-hydroinformatics/pyrefcount | daf3a94ba33e181f2311395d345a6aa0ef001f99 | [
"Net-SNMP",
"Xnet",
"MIT"
] | 2 | 2019-01-02T00:53:16.000Z | 2019-01-06T22:00:09.000Z | tests/__init__.py | csiro-hydroinformatics/pyrefcount | daf3a94ba33e181f2311395d345a6aa0ef001f99 | [
"Net-SNMP",
"Xnet",
"MIT"
] | null | null | null | # required for python2
| 11.5 | 22 | 0.782609 |
1e765ba00bdd1470dbd63f254c8589b6f69e1c82 | 983 | py | Python | src/dataload/sources/ensembl/ensembl_interpro.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | src/dataload/sources/ensembl/ensembl_interpro.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | src/dataload/sources/ensembl/ensembl_interpro.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | from .ensembl_base import EnsemblParser
__metadata__ = {
'__collection__': 'ensembl_interpro',
'id_type': 'ensembl_gene'
}
def load_genedoc(self=None):
ep = EnsemblParser()
ensembl2interpro = ep.load_ensembl2interpro()
return ensembl2interpro
def get_mapping(self=None):
mapping = {
... | 24.575 | 51 | 0.427263 |
f44d53808b8a76114bf06a3aa5cf1b9e0b0a4208 | 222 | py | Python | proto/run_codegen.py | QWERDF007/Serving | 436a1a1c26949fa0c072eb1ada7dd9288d885743 | [
"Apache-2.0"
] | null | null | null | proto/run_codegen.py | QWERDF007/Serving | 436a1a1c26949fa0c072eb1ada7dd9288d885743 | [
"Apache-2.0"
] | null | null | null | proto/run_codegen.py | QWERDF007/Serving | 436a1a1c26949fa0c072eb1ada7dd9288d885743 | [
"Apache-2.0"
] | null | null | null | """Runs protoc with the gRPC plugin to generate messages and gRPC stubs."""
from grpc_tools import protoc
protoc.main((
'',
'-I.',
'--python_out=.',
'--grpc_python_out=.',
'pipeline_service.proto',))
| 20.181818 | 75 | 0.630631 |
fb2ffba7722f5074aa77024778b6cadcc6b05a6d | 1,264 | py | Python | tensorflow/neural_network_decision_tree.py | ssehztirom/DNDT | 38f25cf6aa8531c50fee8dc6a755234d8ee53a89 | [
"Unlicense"
] | null | null | null | tensorflow/neural_network_decision_tree.py | ssehztirom/DNDT | 38f25cf6aa8531c50fee8dc6a755234d8ee53a89 | [
"Unlicense"
] | null | null | null | tensorflow/neural_network_decision_tree.py | ssehztirom/DNDT | 38f25cf6aa8531c50fee8dc6a755234d8ee53a89 | [
"Unlicense"
] | null | null | null | import tensorflow as tf
from functools import reduce
def tf_kron_prod(a, b):
res = tf.compat.v1.einsum('ij,ik->ijk', a, b)
res = tf.compat.v1.reshape(res, [-1, tf.compat.v1.reduce_prod(res.shape[1:])])
return res
def tf_bin(x, cut_points, temperature=0.1):
# x is a N-by-1 matrix (column vector)
... | 43.586207 | 116 | 0.675633 |
cbb7c2c818794826f986e01a5e53af0c20c50909 | 820 | py | Python | config.py | cyrustabatab/Flitter | 6f3569988ff3448c6d916216785817b57ed39783 | [
"MIT"
] | 1 | 2021-07-29T23:35:48.000Z | 2021-07-29T23:35:48.000Z | config.py | cyrustabatab/Flitter | 6f3569988ff3448c6d916216785817b57ed39783 | [
"MIT"
] | 1 | 2021-06-02T02:21:32.000Z | 2021-06-02T02:21:32.000Z | config.py | cyrustabatab/Flitter | 6f3569988ff3448c6d916216785817b57ed39783 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///'... | 37.272727 | 71 | 0.706098 |
5f6d35edfb5ca49c2a4e4393150affe531da6590 | 1,970 | py | Python | 1.py | ankitpandey2708/upvote-bot | 0d6482082de69ff5aa1dc4f90f7844d3d9f6e302 | [
"MIT"
] | 2 | 2021-01-15T15:52:16.000Z | 2021-01-20T23:28:18.000Z | 1.py | ankitpandey2708/upvote-bot | 0d6482082de69ff5aa1dc4f90f7844d3d9f6e302 | [
"MIT"
] | null | null | null | 1.py | ankitpandey2708/upvote-bot | 0d6482082de69ff5aa1dc4f90f7844d3d9f6e302 | [
"MIT"
] | 1 | 2021-01-20T23:28:25.000Z | 2021-01-20T23:28:25.000Z | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time, threading
from configparser import ConfigParser
# Reading configuration file
parser = ConfigParser()
parser.read('config.ini')
parameters = {} # Dictiona... | 42.826087 | 161 | 0.640102 |
70d229302a19e9ce8c17a648a354d5b51dffb190 | 16,257 | py | Python | Python/Shape Constrained risk measures/Prototype code ( not cleaned )/quantile.py | MohamedMkaouar/Some_Projects | 8170126dc91f313638595f9f4b81e9ae8b308334 | [
"Apache-2.0"
] | null | null | null | Python/Shape Constrained risk measures/Prototype code ( not cleaned )/quantile.py | MohamedMkaouar/Some_Projects | 8170126dc91f313638595f9f4b81e9ae8b308334 | [
"Apache-2.0"
] | null | null | null | Python/Shape Constrained risk measures/Prototype code ( not cleaned )/quantile.py | MohamedMkaouar/Some_Projects | 8170126dc91f313638595f9f4b81e9ae8b308334 | [
"Apache-2.0"
] | 1 | 2021-02-02T17:09:04.000Z | 2021-02-02T17:09:04.000Z | import gc
gc.collect()
import numpy as np
import pandas as pd
import scipy as sp
import sklearn as skl
from sklearn.model_selection import cross_val_score
from math import *
import random as rd
import cvxpy as cp
import multiprocessing as mp
import matplotlib.pyplot as plt
import gc
import statsmodels.api ... | 32.128458 | 130 | 0.559697 |
a7ae097fd43fb1c90b71aa2b8abfedbbf7be9619 | 13,219 | py | Python | chess/board/board.py | certik/chess | dc806fccc0fb9acc57c40db56e620f2c55157425 | [
"MIT"
] | 1 | 2016-05-09T00:40:16.000Z | 2016-05-09T00:40:16.000Z | chess/board/board.py | certik/chess | dc806fccc0fb9acc57c40db56e620f2c55157425 | [
"MIT"
] | null | null | null | chess/board/board.py | certik/chess | dc806fccc0fb9acc57c40db56e620f2c55157425 | [
"MIT"
] | null | null | null | class InvalidMove(Exception):
pass
class Board(object):
def __init__(self):
self._board = [None]*64
self.setup()
self._moves = []
def setup(self):
self[0, 0] = Rock(self)
self[1, 0] = Knight(self)
self[2, 0] = Bishop(self)
self[3, 0] = Queen(self)
... | 32.320293 | 1,844 | 0.439216 |
77915dab6b4de8797354be0beca009ce1c2fb57b | 5,462 | py | Python | imaginaire/discriminators/spade.py | MichaelDoron/imaginaire | 5f95b988453d391e972fa528152121d0dd3cb51a | [
"RSA-MD"
] | 1 | 2021-03-22T21:14:02.000Z | 2021-03-22T21:14:02.000Z | imaginaire/discriminators/spade.py | jrfrantz/imaginaire | 7c650977b29ea2dd12557d1fef447df9809db737 | [
"RSA-MD"
] | null | null | null | imaginaire/discriminators/spade.py | jrfrantz/imaginaire | 7c650977b29ea2dd12557d1fef447df9809db737 | [
"RSA-MD"
] | 1 | 2021-06-09T01:28:59.000Z | 2021-06-09T01:28:59.000Z | # Copyright (C) 2020 NVIDIA Corporation. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md
import torch
import torch.nn as nn
from imaginaire.discriminators.fpse import FPSEDiscriminator
from imaginaire.discriminators.m... | 46.288136 | 79 | 0.641157 |
629cd774b27a038b90e11fcd8c357354c09fc13f | 1,781 | py | Python | setup.py | lyubov888L/trio-typing | f32f17b0f242daf2d42407f383ca581d64b6c299 | [
"Apache-2.0",
"MIT"
] | null | null | null | setup.py | lyubov888L/trio-typing | f32f17b0f242daf2d42407f383ca581d64b6c299 | [
"Apache-2.0",
"MIT"
] | null | null | null | setup.py | lyubov888L/trio-typing | f32f17b0f242daf2d42407f383ca581d64b6c299 | [
"Apache-2.0",
"MIT"
] | null | null | null | from setuptools import setup
import os
exec(open("trio_typing/_version.py", encoding="utf-8").read())
LONG_DESC = open("README.rst", encoding="utf-8").read()
stub_packages = ["async_generator-stubs", "outcome-stubs", "trio-stubs"]
setup(
name="trio-typing",
version=__version__,
description="Static type ... | 37.104167 | 85 | 0.623807 |
c63408b682b376bffeec716ddbae0d475d97ccd9 | 6,231 | py | Python | pybind/slxos/v16r_1_00b/vrf/address_family/ipv6/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/vrf/address_family/ipv6/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/vrf/address_family/ipv6/__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... | 50.25 | 591 | 0.706789 |
fbf10e292458d1c4322ee11a330dfcd162ab2c01 | 15,010 | py | Python | batch/getting-started-sample/src/batch_runner.py | manalotoj/python-samples | cadd00ccdb2218a82220484bfc28eb952043d75c | [
"MIT"
] | null | null | null | batch/getting-started-sample/src/batch_runner.py | manalotoj/python-samples | cadd00ccdb2218a82220484bfc28eb952043d75c | [
"MIT"
] | null | null | null | batch/getting-started-sample/src/batch_runner.py | manalotoj/python-samples | cadd00ccdb2218a82220484bfc28eb952043d75c | [
"MIT"
] | null | null | null | from __future__ import print_function
import datetime
from datetime import timedelta
import io
import os
import sys
import time
import local_config
import uuid
try:
input = raw_input
except NameError:
pass
import azure.storage.blob as azureblob
from azure.storage.blob import ContainerPermissions
# from azure.s... | 35.738095 | 205 | 0.649967 |
bd1d178b0f8666f454209c2fafd802128d42c88d | 3,998 | py | Python | Federal/Formatter/DateFormatter.py | Jaseibert/Federal | 86a69d4247a1926f5632eb9b7c68ee80f20081ff | [
"MIT"
] | 1 | 2019-03-21T21:56:32.000Z | 2019-03-21T21:56:32.000Z | Federal/Formatter/DateFormatter.py | Jaseibert/Federal | 86a69d4247a1926f5632eb9b7c68ee80f20081ff | [
"MIT"
] | null | null | null | Federal/Formatter/DateFormatter.py | Jaseibert/Federal | 86a69d4247a1926f5632eb9b7c68ee80f20081ff | [
"MIT"
] | null | null | null | import datetime as dt
import re
class DateFormatter(object):
def __init__(self,start=None,end=None):
self.start = start
self.end = end
return
############################################################################################
#DateTime Formatting
#################################... | 44.921348 | 99 | 0.426463 |
daa865fff3df2b2dd67cb2dc14bcb6d89b969e19 | 4,567 | py | Python | leetcode_python/Greedy/patching-array.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Greedy/patching-array.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Greedy/patching-array.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
330. Patching Array
Hard
Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array.
Return the minimum number of patches required.
Example 1:
Input: nums = [1,3], n = 6
Output:... | 30.245033 | 312 | 0.556164 |
0eadece991a1bc60994e6457acbdfc19aa90a82f | 1,206 | py | Python | office365/entity_collection.py | andrewcchoi/Office365-REST-Python-Client | 43db12ae532c804c75a3a34f7b0d7d79e30fdac3 | [
"MIT"
] | null | null | null | office365/entity_collection.py | andrewcchoi/Office365-REST-Python-Client | 43db12ae532c804c75a3a34f7b0d7d79e30fdac3 | [
"MIT"
] | null | null | null | office365/entity_collection.py | andrewcchoi/Office365-REST-Python-Client | 43db12ae532c804c75a3a34f7b0d7d79e30fdac3 | [
"MIT"
] | null | null | null | from office365.runtime.client_object_collection import ClientObjectCollection
from office365.runtime.queries.create_entity_query import CreateEntityQuery
from office365.runtime.resource_path import ResourcePath
class EntityCollection(ClientObjectCollection):
def __getitem__(self, key):
"""
:para... | 31.736842 | 93 | 0.676617 |
aec54e7963ebd2fcf50ec9a861f2a6bc32b8310e | 817 | py | Python | rtcbproj/rtcb/tournament/models.py | RedTurtle/rtcb-backend | f097eae54a12ba4f3983869fef627ea1d55a37d1 | [
"Apache-2.0"
] | null | null | null | rtcbproj/rtcb/tournament/models.py | RedTurtle/rtcb-backend | f097eae54a12ba4f3983869fef627ea1d55a37d1 | [
"Apache-2.0"
] | 6 | 2020-02-11T22:47:25.000Z | 2021-06-09T17:29:29.000Z | rtcbproj/rtcb/tournament/models.py | RedTurtle/rtcb-backend | f097eae54a12ba4f3983869fef627ea1d55a37d1 | [
"Apache-2.0"
] | 1 | 2018-10-05T07:54:18.000Z | 2018-10-05T07:54:18.000Z | # -*- coding: utf-8 -*-
from django.db import models
from rtcb.team.models import Team
class Tournament(models.Model):
name = models.CharField(
verbose_name="Tournament name",
max_length=50,
)
teams = models.ManyToManyField(
Team,
verbose_name="Squadre",
related_na... | 19 | 42 | 0.598531 |
8b63bf78c58576eac80f86f208b01673adcd65ee | 1,529 | py | Python | bitmovin_api_sdk/encoding/encodings/streams/inputs/inputs_api.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/encoding/encodings/streams/inputs/inputs_api.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/encoding/encodings/streams/inputs/inputs_api.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from __future__ import absolute_import
from bitmovin_api_sdk.common import BaseApi, BitmovinApiLoggerBase
from bitmovin_api_sdk.common.poscheck import poscheck_except
from bitmovin_api_sdk.models.encoding_stream_input import EncodingStreamInput
from bitmovin_api_sdk.models.response_envelope import Res... | 35.55814 | 80 | 0.691956 |
28a5825e9d493b78c71d8fb6f18ee5a77e3490c1 | 12,975 | py | Python | Data_setting & Analysis/Final_Presentation/airpy/data.py | UPRMG/Classification_Airbnb | 2113199fd37c798bdec49402cef9238821168f33 | [
"MIT"
] | 1 | 2018-04-21T03:25:03.000Z | 2018-04-21T03:25:03.000Z | Data_setting & Analysis/airpy/data.py | UPRMG/Classification_Airbnb | 2113199fd37c798bdec49402cef9238821168f33 | [
"MIT"
] | null | null | null | Data_setting & Analysis/airpy/data.py | UPRMG/Classification_Airbnb | 2113199fd37c798bdec49402cef9238821168f33 | [
"MIT"
] | null | null | null |
# coding: utf-8
# ### Import
# In[1]:
from bs4 import BeautifulSoup
import requests
import numpy as np
import pandas as pd
import xgboost
import xgboost as xgb
from xgboost.sklearn import XGBClassifier
from sklearn.metrics import *
from IPython.core.display import Image
from sklearn.datasets import make_classifi... | 38.731343 | 566 | 0.666821 |
430916cacfa1c56e26a1c03a6b41293f5e172a28 | 5,449 | py | Python | clients/kratos/python/ory_kratos_client/exceptions.py | extraymond/sdk | d4e9ffe7335648b7af3fb8d4363e7991d1ba36b5 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/exceptions.py | extraymond/sdk | d4e9ffe7335648b7af3fb8d4363e7991d1ba36b5 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/exceptions.py | extraymond/sdk | d4e9ffe7335648b7af3fb8d4363e7991d1ba36b5 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 33.84472 | 446 | 0.617361 |
f0402ad2bcf38d52e551f2ab8a4508747eac269f | 1,384 | py | Python | Exercicios em python/ex95.py | GabrielSantos25/Python | 208eec0144587aa4e0aa7fa00da29ffa0478eac8 | [
"MIT"
] | null | null | null | Exercicios em python/ex95.py | GabrielSantos25/Python | 208eec0144587aa4e0aa7fa00da29ffa0478eac8 | [
"MIT"
] | null | null | null | Exercicios em python/ex95.py | GabrielSantos25/Python | 208eec0144587aa4e0aa7fa00da29ffa0478eac8 | [
"MIT"
] | null | null | null | time = list()
jogador = dict()
partidas = list()
while True:
jogador.clear()
jogador['nome'] = str(input('Nome do jogador: '))
tot = int(input(f'Quantas partidas {jogador["nome"]} jogou? '))
partidas.clear()
for c in range(0, tot):
partidas.append(int(input(f'Quantos gols na partida {c+1}? ... | 25.163636 | 71 | 0.540462 |
65194962c99b1598a22d23cf2c9a5a4aaa2cd730 | 2,585 | py | Python | Global/detection_models/antialiasing.py | abdullahselek/Bringing-Old-Photos-Back-to-Life | 41491171487a08121038e8c08f4bdc218d7d16e6 | [
"MIT"
] | 1 | 2022-03-17T05:08:25.000Z | 2022-03-17T05:08:25.000Z | Global/detection_models/antialiasing.py | abdullahselek/Bringing-Old-Photos-Back-to-Life | 41491171487a08121038e8c08f4bdc218d7d16e6 | [
"MIT"
] | null | null | null | Global/detection_models/antialiasing.py | abdullahselek/Bringing-Old-Photos-Back-to-Life | 41491171487a08121038e8c08f4bdc218d7d16e6 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import torch.nn.parallel
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class Downsample(nn.Module):
# https://github.com/adobe/antialiased-cnns
def __init__(
self, pad_type="reflect", fil... | 31.91358 | 81 | 0.518762 |
c3c85cc789675966c20fdd88b5e867529058d1de | 5,454 | py | Python | raspberry/run.py | tienthegainz/OutOfStockSystem | 84919ceded5b2e267535a6584b14423d6c5d102e | [
"MIT"
] | 5 | 2021-04-07T09:58:18.000Z | 2021-11-14T02:06:16.000Z | raspberry/run.py | tienthegainz/OutOfStockSystem | 84919ceded5b2e267535a6584b14423d6c5d102e | [
"MIT"
] | 1 | 2022-03-12T01:02:05.000Z | 2022-03-12T01:02:05.000Z | raspberry/run.py | tienthegainz/OutOfStockSystem | 84919ceded5b2e267535a6584b14423d6c5d102e | [
"MIT"
] | null | null | null | import io
import time
import picamera
from base64 import b64encode
import requests
import numpy as np
import cv2
import sys
import signal
import socketio
socket_url = 'http://10.42.0.1'
post_url = 'http://10.42.0.1:5001'
camera_info = {
"id": 1,
"password": "123"
}
def signal_handler(sig, frame):
respon... | 40.4 | 115 | 0.426659 |
ea08f91c68b65cc3a246a1a92f8fbf29663c17e6 | 14,040 | py | Python | umamusume-light/test.py | mEnow-ast/ui-theme-template | f0108295d4af0d741018fe12299173fac2d6aa08 | [
"MIT"
] | null | null | null | umamusume-light/test.py | mEnow-ast/ui-theme-template | f0108295d4af0d741018fe12299173fac2d6aa08 | [
"MIT"
] | null | null | null | umamusume-light/test.py | mEnow-ast/ui-theme-template | f0108295d4af0d741018fe12299173fac2d6aa08 | [
"MIT"
] | null | null | null | import os
import glob
import sys
import datetime
import tkinter
import openpyxl as op
import subprocess as sp
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
def is_empty(cell) :
"""
cell : 空欄か判断するセル
"""
return cell.value is None or not str(cell.... | 29.620253 | 99 | 0.580627 |
74214a88bbb703bed01570d71d58a5245c7b6246 | 10,822 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/system/test_java_keystore.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/system/test_java_keystore.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/system/test_java_keystore.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Ansible Project
# Copyright (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import os
from ansible_collections.community.general.tests.unit.modules.utils import ModuleTestCase... | 40.837736 | 129 | 0.59416 |
ab4ed578b9ce98b7df1651532183e5f31b3d9a48 | 907 | py | Python | visdrone/slice_visdrone.py | fcakyon/sahi-benchmark | 8ffa43afb23adb914f2ba8b4bb45dd9ce1284c42 | [
"MIT"
] | 7 | 2021-12-20T05:22:56.000Z | 2022-03-28T01:57:10.000Z | visdrone/slice_visdrone.py | fcakyon/sahi-benchmark | 8ffa43afb23adb914f2ba8b4bb45dd9ce1284c42 | [
"MIT"
] | 1 | 2022-03-19T14:52:38.000Z | 2022-03-21T13:19:05.000Z | visdrone/slice_visdrone.py | fcakyon/sahi-benchmark | 8ffa43afb23adb914f2ba8b4bb45dd9ce1284c42 | [
"MIT"
] | 3 | 2022-02-23T12:26:18.000Z | 2022-03-27T14:06:58.000Z | import fire
from sahi.scripts.slice_coco import slice
from tqdm import tqdm
SLICE_SIZE_LIST = [480, 640]
OVERLAP_RATIO_LIST = [0, 0.25]
IGNORE_NEGATIVE_SAMPLES = False
def slice_visdrone(image_dir: str, dataset_json_path: str, output_dir: str):
total_run = len(SLICE_SIZE_LIST) * len(OVERLAP_RATIO_LIST)
curre... | 30.233333 | 115 | 0.646086 |
89e20f73ec594c6a38cb1ee7af1df5c87110e9e7 | 10,478 | py | Python | webdataset/writer.py | YaboSu/webdataset | d88dd6e71c32f97352f56d831c3df4db2929a987 | [
"BSD-3-Clause"
] | null | null | null | webdataset/writer.py | YaboSu/webdataset | d88dd6e71c32f97352f56d831c3df4db2929a987 | [
"BSD-3-Clause"
] | null | null | null | webdataset/writer.py | YaboSu/webdataset | d88dd6e71c32f97352f56d831c3df4db2929a987 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2017-2019 NVIDIA CORPORATION. All rights reserved.
# This file is part of the WebDataset library.
# See the LICENSE file for licensing terms (BSD-style).
#
__all__ = "TarWriter ShardWriter".split()
import io
import pickle
import re
import tarfile
import time
import numpy as np
import PIL
import sim... | 29.18663 | 87 | 0.56652 |
ab9879b0cf31ac9ac5dc9ee8f5821a6bf54bcc27 | 1,807 | py | Python | floris/tools/optimization/scipy/optimization.py | ElieKadoche/floris | d18f4d263ecabf502242592f9d60815a07c7b89c | [
"Apache-2.0"
] | 91 | 2019-06-04T08:56:29.000Z | 2022-03-13T17:39:22.000Z | floris/tools/optimization/scipy/optimization.py | ElieKadoche/floris | d18f4d263ecabf502242592f9d60815a07c7b89c | [
"Apache-2.0"
] | 224 | 2019-04-08T22:03:45.000Z | 2022-03-31T17:56:09.000Z | floris/tools/optimization/scipy/optimization.py | ElieKadoche/floris | d18f4d263ecabf502242592f9d60815a07c7b89c | [
"Apache-2.0"
] | 97 | 2019-04-23T20:48:20.000Z | 2022-03-29T08:17:02.000Z | # Copyright 2021 NREL
# 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
# distri... | 26.970149 | 79 | 0.663531 |
b726465e9a830590f76761910fc4947eb2684487 | 814 | py | Python | standard/regular.py | RootCluster/rc-cluster-python | f8cb2bb3f345cb5b964116e5da49aca3de3868b1 | [
"Apache-2.0"
] | null | null | null | standard/regular.py | RootCluster/rc-cluster-python | f8cb2bb3f345cb5b964116e5da49aca3de3868b1 | [
"Apache-2.0"
] | null | null | null | standard/regular.py | RootCluster/rc-cluster-python | f8cb2bb3f345cb5b964116e5da49aca3de3868b1 | [
"Apache-2.0"
] | null | null | null | # python 中标准库应用比较广泛的是
# 1. 文章处理的 re
# 2. 日期类型的 time,datetime
# 3. 数字和数学类型的 math,random
# 4. 文件和目录访问的 pathlib,os.path
# 5. 数据压缩和归档的 tarfile
# 6. 通用操作系统的 os,logging,argparse
# 7. 多线程的 threading,queue
# 8. Internet 数据护理的 base64,json,urllib
# 9. 结构化标记处理工具的 HTML,XML
# 10. 开发工具 unitest
# 11. 调试工具 timeit
# 12. 软件包发布的 venv
# 1... | 22.611111 | 90 | 0.654791 |
b074cba0ae13a91852c624c89b20691e8c8e6972 | 12,829 | py | Python | loaders/old_champs.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | 1 | 2019-05-21T08:10:41.000Z | 2019-05-21T08:10:41.000Z | loaders/old_champs.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | null | null | null | loaders/old_champs.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | null | null | null | # need beautifulsoup
from bs4 import BeautifulSoup
import asyncio
import uvloop
import datetime
import logging
import pprint
from models import *
from helpers import OPRHelper, AwardHelper, ResultsPageHelper
from db.orm import orm
class OldChamps:
@classmethod
def mk_champs(cls, year, start_date, end_date):
... | 48.048689 | 151 | 0.623353 |
daa9473741cfb814e9b6000523664bec506762d4 | 13,207 | py | Python | seqtables/core/utils/insilica_sequences.py | costas821/seqtables | e4632898a912050fcd769d90e359fd6bee6d412b | [
"MIT"
] | 7 | 2017-07-24T18:06:23.000Z | 2021-06-03T18:34:54.000Z | seqtables/core/utils/insilica_sequences.py | cchrysostomou/seqtables | e4632898a912050fcd769d90e359fd6bee6d412b | [
"MIT"
] | 6 | 2018-07-10T18:28:40.000Z | 2021-06-01T23:15:45.000Z | seqtables/core/utils/insilica_sequences.py | costas821/seqtables | e4632898a912050fcd769d90e359fd6bee6d412b | [
"MIT"
] | 2 | 2017-01-13T19:03:16.000Z | 2018-02-28T21:02:09.000Z | import numpy as np
from seqtables.core.utils.seq_table_util import degen_to_base
"""
Methods for generating a set of fake sequences
"""
def generate_sequence(seq_len=100, chars='ACTG', p_bases=[0.25, 0.25, 0.25, 0.25]):
"""
Create a random DNA sequence
Args:
seq_len (int): Total characters in se... | 41.926984 | 167 | 0.655183 |
17023db295f81fe53bd301f8e5ef2a9556a107da | 11,355 | py | Python | validators/bar/marker/_colorbar.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | validators/bar/marker/_colorbar.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | validators/bar/marker/_colorbar.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="bar.marker", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 47.51046 | 83 | 0.527257 |
c2ebd7dabdf04469f6872320522c3ef7fabe7c1a | 2,955 | py | Python | robustgp_experiments/init_z/jug-plot-search-uci.py | kiminh/RobustGP | cfab7a9e7f56755bc7a6241f13a6f6ac29562107 | [
"Apache-2.0"
] | 1 | 2021-01-11T18:38:25.000Z | 2021-01-11T18:38:25.000Z | robustgp_experiments/init_z/jug-plot-search-uci.py | kiminh/RobustGP | cfab7a9e7f56755bc7a6241f13a6f6ac29562107 | [
"Apache-2.0"
] | null | null | null | robustgp_experiments/init_z/jug-plot-search-uci.py | kiminh/RobustGP | cfab7a9e7f56755bc7a6241f13a6f6ac29562107 | [
"Apache-2.0"
] | null | null | null | import jug.task
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
jug.init("jug_search_uci.py", "jug_search_uci.jugdata")
from jug_search_uci import (
dataset_names, sparse_task_results, get_settings, baseline_results, baseline_exps, sparse_exps
)
plot_all_datasets = False
plot_normalised = T... | 49.25 | 112 | 0.741794 |
9beedb2934daed3b8fffe5c95aa39ad0bc499bbc | 1,018 | py | Python | nbaPlayerStats.py | ws2516/sportsbookProjects | 92e541d5c8bcbdae837d9f791366305d94bd1b46 | [
"CC0-1.0"
] | null | null | null | nbaPlayerStats.py | ws2516/sportsbookProjects | 92e541d5c8bcbdae837d9f791366305d94bd1b46 | [
"CC0-1.0"
] | null | null | null | nbaPlayerStats.py | ws2516/sportsbookProjects | 92e541d5c8bcbdae837d9f791366305d94bd1b46 | [
"CC0-1.0"
] | null | null | null | '''
Redditor: u/NInjas101
Ask: I want to be able to track a players points rebounds assists over time and come up
with last 3 game average, last 5 game average etc
'''
import requests
import datetime
DaysBack = 21
NumGameAverage = 5
tod = datetime.datetime.now()
d = datetime.timedelta(days = DaysBack) # 3 weeks... | 27.513514 | 102 | 0.687623 |
de1e8001d413b38346f572eecd15a838954d2756 | 94 | py | Python | practice/AtCoder-Beginners-Selection/ABC086A.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | practice/AtCoder-Beginners-Selection/ABC086A.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | practice/AtCoder-Beginners-Selection/ABC086A.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | a, b = map(int, input().split())
if (a * b) % 2 == 0:
print('Even')
else:
print('Odd') | 18.8 | 32 | 0.478723 |
9e0ab0516e90c8c66c8936d7ba75a7c1d3bf6523 | 5,644 | py | Python | sweetviz/type_detection.py | DavidTitoInfantas/sweetviz | 531b17998cdecb9dc99e74a96aa938113ac46645 | [
"MIT"
] | 1,996 | 2020-06-03T19:55:02.000Z | 2022-03-30T11:53:48.000Z | sweetviz/type_detection.py | DavidTitoInfantas/sweetviz | 531b17998cdecb9dc99e74a96aa938113ac46645 | [
"MIT"
] | 103 | 2020-06-03T20:50:57.000Z | 2022-03-13T14:16:47.000Z | sweetviz/type_detection.py | DavidTitoInfantas/sweetviz | 531b17998cdecb9dc99e74a96aa938113ac46645 | [
"MIT"
] | 206 | 2020-06-05T13:25:14.000Z | 2022-03-14T18:13:48.000Z | import pandas as pd
from sweetviz.sv_types import FeatureType
from sweetviz.from_profiling_pandas import is_boolean, is_numeric, is_categorical, could_be_numeric
def determine_feature_type(series: pd.Series, counts: dict,
must_be_this_type: FeatureType, which_dataframe: str) -> object:
# Replace infinite ... | 64.136364 | 171 | 0.60932 |
16fd21360f533fbd353d41bc8d65c487821576be | 97 | py | Python | test.py | ndeshmukh80/active-qa | 7b7b6ce8a00d518b7f848ae44ef2b28e90db2043 | [
"Apache-2.0"
] | null | null | null | test.py | ndeshmukh80/active-qa | 7b7b6ce8a00d518b7f848ae44ef2b28e90db2043 | [
"Apache-2.0"
] | null | null | null | test.py | ndeshmukh80/active-qa | 7b7b6ce8a00d518b7f848ae44ef2b28e90db2043 | [
"Apache-2.0"
] | null | null | null | #This is python test code to check if git file can be executable on collab
print("Hello Collab")
| 32.333333 | 74 | 0.773196 |
6b6f4359f556f47e563d275416e400d443d14840 | 7,984 | py | Python | libsemver/semver_core.py | nirenjan/pysemver | 5de92bf1f21f4ead636c6a5b2fd7a3e6cfd577a5 | [
"MIT"
] | null | null | null | libsemver/semver_core.py | nirenjan/pysemver | 5de92bf1f21f4ead636c6a5b2fd7a3e6cfd577a5 | [
"MIT"
] | null | null | null | libsemver/semver_core.py | nirenjan/pysemver | 5de92bf1f21f4ead636c6a5b2fd7a3e6cfd577a5 | [
"MIT"
] | null | null | null | """
SemVerCore top level class
"""
class SemVerCore(object):
"""
Core Semantic Version class
"""
def __init__(self, major, minor, patch, prerelease=None, build_meta=None):
"""
Initialize a SemVerCore class by providing the attributes
"""
assert isinstance(major, int) an... | 26.613333 | 79 | 0.555361 |
0da3d1fb849bdbb4f693403c66071ba0604d6246 | 19,211 | py | Python | hpopt/sklearn.py | knowledge-learning/hp-optimization | 321486db068004b1b4b9b867876c7fbdb829076e | [
"MIT"
] | 4 | 2019-10-28T15:33:07.000Z | 2021-08-30T20:46:26.000Z | hpopt/sklearn.py | knowledge-learning/hp-optimization | 321486db068004b1b4b9b867876c7fbdb829076e | [
"MIT"
] | null | null | null | hpopt/sklearn.py | knowledge-learning/hp-optimization | 321486db068004b1b4b9b867876c7fbdb829076e | [
"MIT"
] | 2 | 2019-10-28T15:34:02.000Z | 2020-04-16T08:29:17.000Z | # coding: utf-8
import numpy as np
from scipy import sparse as sp
from collections import Counter
import spacy
import tqdm
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_ext... | 34.244207 | 255 | 0.57618 |
9950762383dd8e7fabb3496cf2089d4fdce6f685 | 495 | py | Python | users/urls.py | omiguelperez/basic-django-gram | 60e304671bc3dd7bdb2dc0b4fe808b9f8ea46ad5 | [
"MIT"
] | null | null | null | users/urls.py | omiguelperez/basic-django-gram | 60e304671bc3dd7bdb2dc0b4fe808b9f8ea46ad5 | [
"MIT"
] | null | null | null | users/urls.py | omiguelperez/basic-django-gram | 60e304671bc3dd7bdb2dc0b4fe808b9f8ea46ad5 | [
"MIT"
] | null | null | null | """Users urls."""
from django.urls import path
from django.views.generic import TemplateView
from users import views
urlpatterns = [
path('login/', views.LoginView.as_view(), name='login'),
path('signup/', views.SignupView.as_view(), name='signup'),
path('logout/', views.LogoutView.as_view(), name='logou... | 33 | 84 | 0.69899 |
f119203f0459f52516d0040714e2e6d8996aed19 | 694 | py | Python | pyro/contrib/timeseries/__init__.py | patrickeganfoley/pyro | 3bd5e099e85f3686c66fc3b53476c3b009a77a02 | [
"Apache-2.0"
] | 2 | 2020-06-05T20:40:50.000Z | 2020-09-05T15:39:48.000Z | pyro/contrib/timeseries/__init__.py | patrickeganfoley/pyro | 3bd5e099e85f3686c66fc3b53476c3b009a77a02 | [
"Apache-2.0"
] | 1 | 2020-05-12T16:26:21.000Z | 2020-05-12T17:23:13.000Z | pyro/contrib/timeseries/__init__.py | patrickeganfoley/pyro | 3bd5e099e85f3686c66fc3b53476c3b009a77a02 | [
"Apache-2.0"
] | 1 | 2020-06-04T18:25:38.000Z | 2020-06-04T18:25:38.000Z | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
"""
The :mod:`pyro.contrib.timeseries` module provides a collection of Bayesian time series
models useful for forecasting applications.
"""
from pyro.contrib.timeseries.base import TimeSeriesModel
from pyro.contrib.timeseries.gp im... | 33.047619 | 102 | 0.79683 |
a9968c649d379a489ed2ab31add1f7db4f0988d0 | 5,020 | py | Python | tests/python/pants_test/java/test_util.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | tests/python/pants_test/java/test_util.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/java/test_util.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import unittest
from contextlib import contextmanager
from unittest.mock import Mock, patch
from pants.java.executor import Executor
from pants.java.jar.manifest import Manifest... | 33.466667 | 100 | 0.615538 |
12ec4aefe40f5d5c698a9c3358324a2db5272ea2 | 3,801 | py | Python | configs/repdet/repdet_repvgg_a2_repdilatedencoder_yolof_1x_coco.py | karthiksharma98/mmdetection | 295145d41a74598db98a037224f0f82c074f3fff | [
"Apache-2.0"
] | null | null | null | configs/repdet/repdet_repvgg_a2_repdilatedencoder_yolof_1x_coco.py | karthiksharma98/mmdetection | 295145d41a74598db98a037224f0f82c074f3fff | [
"Apache-2.0"
] | null | null | null | configs/repdet/repdet_repvgg_a2_repdilatedencoder_yolof_1x_coco.py | karthiksharma98/mmdetection | 295145d41a74598db98a037224f0f82c074f3fff | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_poly.py', '../_base_/default_runtime.py'
]
model = dict(
type='RepDet',
pretrained='/raid/sjx/mmdetection/pretrained_models/RepVGG/RepVGG-A2-train.pth',
backbone=dict(
type='RepVGG',
arch='A2',
o... | 31.675 | 84 | 0.599316 |
0b5e353f75269c2e282b4d5f2134dcb4d12a771f | 1,484 | py | Python | tests/test_utils.py | obi1kenobi/csvs-to-sqlite | dc4177bfa6e4e7b46daf40ab60e060d8b3a9e3cb | [
"Apache-2.0"
] | 684 | 2017-11-14T00:51:13.000Z | 2022-03-29T15:16:00.000Z | tests/test_utils.py | obi1kenobi/csvs-to-sqlite | dc4177bfa6e4e7b46daf40ab60e060d8b3a9e3cb | [
"Apache-2.0"
] | 73 | 2017-11-14T16:42:16.000Z | 2022-03-27T19:23:14.000Z | tests/test_utils.py | obi1kenobi/csvs-to-sqlite | dc4177bfa6e4e7b46daf40ab60e060d8b3a9e3cb | [
"Apache-2.0"
] | 58 | 2017-11-22T17:08:27.000Z | 2022-03-04T03:22:36.000Z | from csvs_to_sqlite import utils
import pytest
import sqlite3
import pandas as pd
TEST_TABLES = """
CREATE TABLE foo (
id integer primary key,
value text
);
"""
@pytest.mark.parametrize("table,expected", [("foo", True), ("bar", False)])
def test_table_exists(table, expected):
conn = sqlite3.connect(":memory:... | 26.981818 | 81 | 0.561995 |
dc37113f6f345f17fb68d7ccf246fd4c34d3e835 | 825 | py | Python | functions/search_functions.py | fvergaracl/gonsa2_1 | 0cb705ca7ba717f0316f4764bbec9bbcb08fcc34 | [
"MIT"
] | 1 | 2020-07-19T03:17:12.000Z | 2020-07-19T03:17:12.000Z | functions/search_functions.py | fvergaracl/gonsa2_1 | 0cb705ca7ba717f0316f4764bbec9bbcb08fcc34 | [
"MIT"
] | 1 | 2021-06-02T00:49:57.000Z | 2021-06-02T00:49:57.000Z | functions/search_functions.py | fvergaracl/gonsa3 | 0cb705ca7ba717f0316f4764bbec9bbcb08fcc34 | [
"MIT"
] | null | null | null | import requests
from googlesearch import search
def googlesearch(query):
my_results_list = []
for i in search(query, # The query you want to run
tld='com', # The top level domain
lang='es', # The language
num=10, # Number of results per page
... | 34.375 | 66 | 0.56 |
bda1ec4fac519c53ab7646709d86b18d25a107f7 | 5,777 | py | Python | src/ploomber/jupyter/dag.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 2,141 | 2020-02-14T02:34:34.000Z | 2022-03-31T22:43:20.000Z | src/ploomber/jupyter/dag.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 660 | 2020-02-06T16:15:57.000Z | 2022-03-31T22:55:01.000Z | src/ploomber/jupyter/dag.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 122 | 2020-02-14T18:53:05.000Z | 2022-03-27T22:33:24.000Z | from pathlib import Path, PurePosixPath
import datetime
import nbformat
from ploomber.tasks import PythonCallable
class JupyterTaskResource:
def __init__(self, task, interactive, parent):
self.task = task
self.interactive = interactive
self.path = '/'.join([parent, self.task.name])
... | 30.405263 | 87 | 0.574347 |
e57320cfe4433494f035c8b781882222e00473bf | 57,063 | py | Python | test/ext/declarative/test_inheritance.py | hmhmj/sqlalchemy-study | eaf3a54c4cea9d623623c40b8c68d1649d79836c | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | test/ext/declarative/test_inheritance.py | hmhmj/sqlalchemy-study | eaf3a54c4cea9d623623c40b8c68d1649d79836c | [
"MIT"
] | null | null | null | test/ext/declarative/test_inheritance.py | hmhmj/sqlalchemy-study | eaf3a54c4cea9d623623c40b8c68d1649d79836c | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z |
from sqlalchemy.testing import eq_, assert_raises, \
assert_raises_message, is_, is_true, is_false
from sqlalchemy.ext import declarative as decl
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.testing.schema import Table, Column
from sqlalc... | 36.322724 | 79 | 0.563377 |
3cc6813b07d8afc326da551cd081a424a145fa6b | 5,544 | py | Python | model.py | bhneo/SimSiam-TF | cd2b44a1b1049fb08c2a4fada499863f06d47b16 | [
"MIT"
] | null | null | null | model.py | bhneo/SimSiam-TF | cd2b44a1b1049fb08c2a4fada499863f06d47b16 | [
"MIT"
] | null | null | null | model.py | bhneo/SimSiam-TF | cd2b44a1b1049fb08c2a4fada499863f06d47b16 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Input
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Add
from tensorflow.keras import Sequential
from tensorflow.keras import Model
from tensorflow.keras.re... | 37.208054 | 121 | 0.626984 |
b0c854002da5a93e1559ebd718de9b3f6bcdf1fc | 2,737 | py | Python | zilencer/management/commands/render_messages.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 2 | 2021-09-01T17:44:28.000Z | 2021-09-01T18:09:51.000Z | zilencer/management/commands/render_messages.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 1 | 2021-03-24T12:50:52.000Z | 2021-03-24T13:11:42.000Z | zilencer/management/commands/render_messages.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 1 | 2021-07-22T10:14:08.000Z | 2021-07-22T10:14:08.000Z | import os
from typing import Any, Iterator
import orjson
from django.core.management.base import BaseCommand, CommandParser
from django.db.models import QuerySet
from zerver.lib.message import render_markdown
from zerver.models import Message
def queryset_iterator(queryset: QuerySet, chunksize: int = 5000) -> Itera... | 40.25 | 100 | 0.572525 |
cad874f266f1346308ac23099e3b70165e905fc3 | 16,961 | py | Python | network.py | Rick-McCoy/MIDIWavenet | 229031df46c9b3791f6cd8fd4ff3d284083ee882 | [
"MIT"
] | 3 | 2019-03-19T09:44:43.000Z | 2020-05-12T12:57:34.000Z | network.py | Rick-McCoy/MIDIWavenet | 229031df46c9b3791f6cd8fd4ff3d284083ee882 | [
"MIT"
] | null | null | null | network.py | Rick-McCoy/MIDIWavenet | 229031df46c9b3791f6cd8fd4ff3d284083ee882 | [
"MIT"
] | null | null | null | """Wavenet, the raw network itself.
Contains various components of it as well as the network.
No hardcoded values, all passed arguments can be changed without issues."""
import queue
from math import sqrt
from torch import nn, cat, zeros
from utils import causal_pad
class DilatedConv1d(nn.Module):
"""Dilated 1D Co... | 28.602024 | 93 | 0.592418 |
7f5cdf8adf6390830e80b01eeafc4210eece9135 | 2,346 | py | Python | py3status/modules/docker.py | kevna/py3status | 8861944cd2facacd8d697958fe81513be3640fcb | [
"BSD-3-Clause"
] | null | null | null | py3status/modules/docker.py | kevna/py3status | 8861944cd2facacd8d697958fe81513be3640fcb | [
"BSD-3-Clause"
] | null | null | null | py3status/modules/docker.py | kevna/py3status | 8861944cd2facacd8d697958fe81513be3640fcb | [
"BSD-3-Clause"
] | null | null | null | r"""
Display properties of running docker containers.
Configuration parameters:
containers: filter the list by container or image name (default [])
delimiter: separator between containers (default ' ')
format: format to display each container (default '{name} {image}')
Format placeholders:
{name} inst... | 26.066667 | 84 | 0.620205 |
2051eba2f4e2d06a77dde793b3a1d3d5b724fb13 | 4,927 | py | Python | chances/methods.py | bjtho08/chances | ec713de1e11f7c2d9997507b07658df9f3369555 | [
"MIT"
] | 5 | 2018-10-09T11:00:39.000Z | 2021-07-19T06:21:29.000Z | chances/methods.py | bjtho08/chances | ec713de1e11f7c2d9997507b07658df9f3369555 | [
"MIT"
] | 13 | 2019-02-09T10:53:06.000Z | 2019-09-26T21:37:05.000Z | chances/methods.py | bjtho08/chances | ec713de1e11f7c2d9997507b07658df9f3369555 | [
"MIT"
] | 2 | 2019-03-07T10:05:01.000Z | 2019-09-25T12:29:07.000Z | import numpy as np
import random
from .sobol.sobol_seq import i4_sobol_generate
from .hypercube.hycusampling import halton, korobov_design_matrix
from .hypercube.hycusampling import improved_lhd_matrix, lhd_matrix
from .lhs_sudoku import sudoku
from .quantum import cached_generator, randint
class Randomizer:
''... | 26.632432 | 79 | 0.603816 |
82f054b4ceb245bd1cfb715f83913fdcf8476439 | 3,405 | py | Python | gui/qt/address_dialog.py | lazyboozer/electrum-desire | 42d204d9e7deef17b18bf9d7f43ce5c45cda5fc8 | [
"MIT"
] | null | null | null | gui/qt/address_dialog.py | lazyboozer/electrum-desire | 42d204d9e7deef17b18bf9d7f43ce5c45cda5fc8 | [
"MIT"
] | null | null | null | gui/qt/address_dialog.py | lazyboozer/electrum-desire | 42d204d9e7deef17b18bf9d7f43ce5c45cda5fc8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 35.103093 | 83 | 0.674302 |
3b8d8433264893f28bdace38626ec433bbfe86bf | 3,687 | py | Python | expertai/nlapi/common/model/token.py | DavidBakerEffendi/nlapi-python | a12fe8abc710824f2b8abe2154d0f193276a4ac7 | [
"Apache-2.0"
] | 36 | 2020-07-06T07:21:12.000Z | 2022-03-28T01:34:12.000Z | expertai/nlapi/common/model/token.py | DavidBakerEffendi/nlapi-python | a12fe8abc710824f2b8abe2154d0f193276a4ac7 | [
"Apache-2.0"
] | 14 | 2020-09-16T17:53:01.000Z | 2022-03-17T14:48:01.000Z | expertai/nlapi/common/model/token.py | DavidBakerEffendi/nlapi-python | a12fe8abc710824f2b8abe2154d0f193276a4ac7 | [
"Apache-2.0"
] | 14 | 2020-10-23T14:55:42.000Z | 2021-11-08T19:23:23.000Z | # Copyright (c) 2020 original authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 27.311111 | 74 | 0.632221 |
9418291929df9c455865794f10ae530d107cca0d | 17,647 | py | Python | tests/test_utils.py | marcoffee/typed-argument-parser | 1dac0c92a707dd7399a69f42213508cd2746b104 | [
"MIT"
] | null | null | null | tests/test_utils.py | marcoffee/typed-argument-parser | 1dac0c92a707dd7399a69f42213508cd2746b104 | [
"MIT"
] | null | null | null | tests/test_utils.py | marcoffee/typed-argument-parser | 1dac0c92a707dd7399a69f42213508cd2746b104 | [
"MIT"
] | null | null | null | from collections import OrderedDict
import json
import os
import platform
import subprocess
from tempfile import TemporaryDirectory
from typing import Any, Callable, List, Dict, Set, Tuple, Union
import unittest
from unittest import TestCase
from typing_extensions import Literal
from tap.utils import (
has_git,
... | 38.363043 | 119 | 0.628209 |
6a9cf3a0698042c30b148c5f909efb2e9e1c5e21 | 1,127 | py | Python | one_point_stats/utils/__init__.py | piyanatk/one_point_stats | b3d4ca0ea0ffc373b95ea62098bee009dd634755 | [
"MIT"
] | null | null | null | one_point_stats/utils/__init__.py | piyanatk/one_point_stats | b3d4ca0ea0ffc373b95ea62098bee009dd634755 | [
"MIT"
] | null | null | null | one_point_stats/utils/__init__.py | piyanatk/one_point_stats | b3d4ca0ea0ffc373b95ea62098bee009dd634755 | [
"MIT"
] | null | null | null | from .conversion import *
from .data import *
from .io import *
from .settings import *
from .fitting import *
from .interpolate import *
from .reproject import *
from .smooth import *
__all__ = ['beam_area', 'd2dms', 'dist2psf_pix', 'gaussian_fwhm2std',
'gaussian_std2fwhm', 'h2hms24', 'h2hms_signed', 'impi... | 45.08 | 79 | 0.65661 |
94be1bbd8af2e54faa801d5427dc0efed02110b5 | 4,501 | py | Python | article/plots/lem_Te_salhi_example.py | pytaunay/physics-of-cathodes | 4e0bee6b9224d7808dfd09e1b7ea23b297197e94 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | article/plots/lem_Te_salhi_example.py | pytaunay/physics-of-cathodes | 4e0bee6b9224d7808dfd09e1b7ea23b297197e94 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | article/plots/lem_Te_salhi_example.py | pytaunay/physics-of-cathodes | 4e0bee6b9224d7808dfd09e1b7ea23b297197e94 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2021 Pierre-Yves Camille Regis Taunay
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | 31.921986 | 99 | 0.699178 |
b324ae1af713f839bd8c9003731f6228d2f22788 | 10,482 | py | Python | catkin_ws/src/line_detector/src/line_detector_node.py | kjoelovelife/Knight_car | 5d5909ce495094fdc46bb87be2e28be8ba718854 | [
"CC-BY-2.0"
] | 7 | 2018-10-28T05:49:18.000Z | 2020-05-12T06:31:44.000Z | catkin_ws/src/line_detector/src/line_detector_node.py | kjoelovelife/Knight_car | 5d5909ce495094fdc46bb87be2e28be8ba718854 | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/line_detector/src/line_detector_node.py | kjoelovelife/Knight_car | 5d5909ce495094fdc46bb87be2e28be8ba718854 | [
"CC-BY-2.0"
] | 4 | 2019-08-17T03:36:07.000Z | 2020-09-29T02:19:46.000Z | #!/usr/bin/env python
from anti_instagram.AntiInstagram import *
from cv_bridge import CvBridge, CvBridgeError
from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment,
SegmentList, Vector2D)
from duckietown_utils.instantiate_utils import instantiate
from duckietown_utils.jpg import image_cv_fr... | 33.382166 | 122 | 0.623545 |
3e03557f60352afec59748ad92df639073644856 | 2,396 | py | Python | polycircles/test/test_exceptions.py | JMSchietekat/polycircles | 26f46bb77c234ac0aec756131f599f1651a559da | [
"MIT"
] | 9 | 2016-07-04T08:57:57.000Z | 2021-04-30T16:02:12.000Z | polycircles/test/test_exceptions.py | JMSchietekat/polycircles | 26f46bb77c234ac0aec756131f599f1651a559da | [
"MIT"
] | 11 | 2016-06-30T19:36:24.000Z | 2021-12-04T21:20:23.000Z | polycircles/test/test_exceptions.py | JMSchietekat/polycircles | 26f46bb77c234ac0aec756131f599f1651a559da | [
"MIT"
] | 7 | 2015-11-15T02:38:38.000Z | 2021-12-04T09:16:49.000Z | import unittest
from polycircles import polycircles
from nose.tools import raises
class TestExceptions(unittest.TestCase):
"""Tests that the right exceptions are raised for erroneous inputs."""
@raises(AssertionError)
def test_less_than_3_vertices_no_1(self):
polycircle = polycircles.Polycircle(la... | 40.610169 | 74 | 0.492905 |
4a6585716152091240a687bf3aa6d557cb0efc83 | 928 | py | Python | gamechangerml/scripts/using_existing_models.py | ekmixon/gamechanger-ml | e7967261a4b2f21b06347020cd7e6a010538eb8f | [
"MIT"
] | null | null | null | gamechangerml/scripts/using_existing_models.py | ekmixon/gamechanger-ml | e7967261a4b2f21b06347020cd7e6a010538eb8f | [
"MIT"
] | 76 | 2021-07-24T02:33:16.000Z | 2022-03-20T22:40:46.000Z | gamechangerml/scripts/using_existing_models.py | ekmixon/gamechanger-ml | e7967261a4b2f21b06347020cd7e6a010538eb8f | [
"MIT"
] | null | null | null | from gamechangerml.src.search.semantic.models import D2V
from gamechangerml.src.text_handling.entity import Phrase_Detector
from gamechangerml.src.text_handling.process import preprocess
from gamechangerml import REPO_PATH
import os
model_dir = os.path.join(
REPO_PATH,
"gamechangerml/src/modelzoo/semantic/mode... | 23.2 | 78 | 0.769397 |
9366ee3309d307e9d0a810a1418c3dcbae1b5bd2 | 478 | py | Python | python/taichi/tools/__init__.py | nasnoisaac/taichi | 11f8777d878e7afe336b1e0e3e1f2fd00013693d | [
"MIT"
] | null | null | null | python/taichi/tools/__init__.py | nasnoisaac/taichi | 11f8777d878e7afe336b1e0e3e1f2fd00013693d | [
"MIT"
] | null | null | null | python/taichi/tools/__init__.py | nasnoisaac/taichi | 11f8777d878e7afe336b1e0e3e1f2fd00013693d | [
"MIT"
] | null | null | null | from .image import imdisplay, imread, imresize, imshow, imwrite
from .np2ply import PLYWriter
from .util import *
# Don't import taichi_logo here which will cause circular import.
# If you need it, just import from taichi.tools.patterns
from .video import VideoManager
__all__ = [
'PLYWriter',
'VideoManager',
... | 22.761905 | 65 | 0.6841 |
273053706eb091d00c356012f2acc55b6e7dceab | 11,744 | py | Python | scripts/tests/test_encoder_decoder.py | davisliang/gluon-nlp | 18a736dbb55c80c2de82d73b923c3cd3d9d53591 | [
"Apache-2.0"
] | 7 | 2019-12-05T02:49:07.000Z | 2020-08-17T01:11:59.000Z | scripts/tests/test_encoder_decoder.py | davisliang/gluon-nlp | 18a736dbb55c80c2de82d73b923c3cd3d9d53591 | [
"Apache-2.0"
] | null | null | null | scripts/tests/test_encoder_decoder.py | davisliang/gluon-nlp | 18a736dbb55c80c2de82d73b923c3cd3d9d53591 | [
"Apache-2.0"
] | 3 | 2021-03-12T04:41:00.000Z | 2021-03-12T04:41:24.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 62.802139 | 133 | 0.539595 |
48d52bb257c5a09265819f87a74756d32f5d7459 | 1,869 | py | Python | monolith/modules/gitlab_repository_search.py | ronfury/monolith | 7b8c872c9058317497f37411c846b12ab08470b3 | [
"MIT"
] | 13 | 2020-10-24T05:47:52.000Z | 2021-10-17T18:40:12.000Z | monolith/modules/gitlab_repository_search.py | ronfury/monolith | 7b8c872c9058317497f37411c846b12ab08470b3 | [
"MIT"
] | null | null | null | monolith/modules/gitlab_repository_search.py | ronfury/monolith | 7b8c872c9058317497f37411c846b12ab08470b3 | [
"MIT"
] | 10 | 2020-11-10T23:26:15.000Z | 2022-02-04T11:05:32.000Z | from .monomodule import MonoModule
import requests
import datetime
import lxml.html
import urllib.parse
description = '''This module searches gitlab repository.
Set search keyword as a Query.
https://gitlab.com/explore/projects
'''
class CustomModule(MonoModule):
def set(self):
self.name ... | 38.142857 | 144 | 0.59176 |
1e5f360fd2a4400616b8433a230bfe1baf9e49e9 | 5,047 | py | Python | src/runners/alert_queries_runner.py | mikeurbanski1/SnowAlert | 85608343ac80bfcad69267e65eae5a21b9ad454d | [
"Apache-2.0"
] | null | null | null | src/runners/alert_queries_runner.py | mikeurbanski1/SnowAlert | 85608343ac80bfcad69267e65eae5a21b9ad454d | [
"Apache-2.0"
] | 1 | 2021-02-24T09:38:10.000Z | 2021-02-24T09:38:10.000Z | src/runners/alert_queries_runner.py | isabella232/SnowAlert | 85608343ac80bfcad69267e65eae5a21b9ad454d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import datetime
import os
from multiprocessing import Pool
from typing import Any, Dict
from runners.config import (
POOLSIZE,
RUN_ID,
QUERY_METADATA_TABLE,
RUN_METADATA_TABLE,
ALERT_QUERY_POSTFIX,
CLOUDWATCH_METRICS,
)
from runners.helpers import db, log
ALERT_CUTOFF_M... | 30.96319 | 86 | 0.650287 |
dea559b05f6d50572e9d07276a075b70f84db063 | 19 | py | Python | Kartik.py | sahilvalvi/WP-Hack | 22755454fb9d8db70b795ccf4a7e092c83ce0ad0 | [
"Unlicense"
] | null | null | null | Kartik.py | sahilvalvi/WP-Hack | 22755454fb9d8db70b795ccf4a7e092c83ce0ad0 | [
"Unlicense"
] | null | null | null | Kartik.py | sahilvalvi/WP-Hack | 22755454fb9d8db70b795ccf4a7e092c83ce0ad0 | [
"Unlicense"
] | null | null | null | 1:Kartik
Hdjdbddh
| 4.75 | 8 | 0.789474 |
4104d35a8576f1d833a3afd9b05a2c9b1253a6d2 | 3,726 | py | Python | graphs/perception/perception_2nodes/launch/trace_rectify_resize_fpga_streamlined.launch.py | dirksavage88/acceleration_examples | 97140d08d84e53d7c7cc04340dfefe2c4a954117 | [
"Apache-2.0"
] | null | null | null | graphs/perception/perception_2nodes/launch/trace_rectify_resize_fpga_streamlined.launch.py | dirksavage88/acceleration_examples | 97140d08d84e53d7c7cc04340dfefe2c4a954117 | [
"Apache-2.0"
] | null | null | null | graphs/perception/perception_2nodes/launch/trace_rectify_resize_fpga_streamlined.launch.py | dirksavage88/acceleration_examples | 97140d08d84e53d7c7cc04340dfefe2c4a954117 | [
"Apache-2.0"
] | null | null | null | # ____ ____
# / /\/ /
# /___/ \ / Copyright (c) 2021, Xilinx®.
# \ \ \/ Author: Víctor Mayoral Vilches <victorma@xilinx.com>
# \ \
# / /
# /___/ /\
# \ \ / \
# \___\/\___\
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... | 33.567568 | 74 | 0.549651 |
5c55663aa794698dda73c317321fcad807dcc61e | 13,648 | py | Python | python_modules/libraries/dagstermill/dagstermill/manager.py | devarajnadiger/dagster | fae430f1d9463c23a427efa06dc9d0deb76429bb | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagstermill/dagstermill/manager.py | devarajnadiger/dagster | fae430f1d9463c23a427efa06dc9d0deb76429bb | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagstermill/dagstermill/manager.py | devarajnadiger/dagster | fae430f1d9463c23a427efa06dc9d0deb76429bb | [
"Apache-2.0"
] | 1 | 2021-11-30T21:40:46.000Z | 2021-11-30T21:40:46.000Z | import os
import pickle
import uuid
from dagster import (
AssetMaterialization,
ExpectationResult,
Failure,
Materialization,
ModeDefinition,
PipelineDefinition,
SolidDefinition,
TypeCheck,
check,
seven,
)
from dagster.core.definitions.dependency import NodeHandle
from dagster.co... | 38.337079 | 196 | 0.667424 |
7afea4ed18834346098f81e1f09750268f242682 | 5,288 | py | Python | pysrc/bytewax/parse.py | yutiansut/bytewax | 54dba26cbab2afd24007865f69083a92c05cbdc1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-03-24T15:53:50.000Z | 2022-03-24T15:53:50.000Z | pysrc/bytewax/parse.py | yutiansut/bytewax | 54dba26cbab2afd24007865f69083a92c05cbdc1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | pysrc/bytewax/parse.py | yutiansut/bytewax | 54dba26cbab2afd24007865f69083a92c05cbdc1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """Helpers to read execution arguments from the environment or command
line.
"""
import os
from argparse import ArgumentParser
from typing import Any, Dict, Iterable, List, Optional, Tuple
def __skip_doctest_on_win_gha():
import os, pytest
if os.name == "nt" and os.environ.get("GITHUB_ACTION"):
pyte... | 26.049261 | 90 | 0.604387 |
6e18e8c86f228d9e9eed6d66721d556b73b51817 | 10,064 | py | Python | eupheme/mime.py | Parnassos/Eupheme | 015ab4452bdcb324568d2f786b77c4a6986d4b99 | [
"BSD-3-Clause"
] | null | null | null | eupheme/mime.py | Parnassos/Eupheme | 015ab4452bdcb324568d2f786b77c4a6986d4b99 | [
"BSD-3-Clause"
] | null | null | null | eupheme/mime.py | Parnassos/Eupheme | 015ab4452bdcb324568d2f786b77c4a6986d4b99 | [
"BSD-3-Clause"
] | null | null | null | import re
import codecs
import eupheme.negotiation as negotiation
# A token as described in RFC2045 section 5.1. Consists of any ASCII character
# except non-printable ones, spaces as well as ( ) < > @ , ; \ " [ ] ? =
RE_TOKEN = re.compile(r'^[^\x00-\x20\x80-\xff()<>@,;:\\"/\[\]?=]+$')
class MimeParameters:
# T... | 34.823529 | 79 | 0.583863 |
6554c0d3c209041bf608d39dc34d63bbf617cc33 | 21,072 | py | Python | synapse/handlers/profile.py | buffless-matt/synapse | dda9b7fc4d2e6ca84a1a994a7ff1943b590e71df | [
"Apache-2.0"
] | null | null | null | synapse/handlers/profile.py | buffless-matt/synapse | dda9b7fc4d2e6ca84a1a994a7ff1943b590e71df | [
"Apache-2.0"
] | 2 | 2022-03-01T08:22:45.000Z | 2022-03-11T08:13:55.000Z | synapse/handlers/profile.py | buffless-matt/synapse | dda9b7fc4d2e6ca84a1a994a7ff1943b590e71df | [
"Apache-2.0"
] | 1 | 2022-03-31T09:03:27.000Z | 2022-03-31T09:03:27.000Z | # Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 38.452555 | 90 | 0.600228 |
543059a0ec7cd558f8986b264b822d4ec7709ed4 | 2,145 | py | Python | gpplot/style.py | gpp-rnd/gpplot | 627a2feb398fe8de5539ee6d0ae3150079578a7a | [
"MIT"
] | 2 | 2020-06-19T19:35:14.000Z | 2020-07-22T17:24:02.000Z | gpplot/style.py | gpp-rnd/gpplot | 627a2feb398fe8de5539ee6d0ae3150079578a7a | [
"MIT"
] | 1 | 2020-08-23T21:47:57.000Z | 2020-08-23T21:47:57.000Z | gpplot/style.py | gpp-rnd/gpplot | 627a2feb398fe8de5539ee6d0ae3150079578a7a | [
"MIT"
] | null | null | null | """style module. Contains functions to standardize styles for matplotlib-based plots"""
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
def discrete_palette(palette='Set2', n=8):
"""Default discrete palette"""
return sns.color_palette(palette, n)
def diverging_cmap(cmap='RdBu... | 29.791667 | 87 | 0.665734 |
667785310a7968737e3c9a743979877d5fec08c5 | 1,048 | py | Python | sendgrid/helpers/mail/group_id.py | modernwarfareuplink/sendgrid-python | b360223622418216f89a98278cfa1cde3e2a9ceb | [
"MIT"
] | 1,268 | 2015-01-07T01:26:41.000Z | 2022-03-31T12:40:59.000Z | sendgrid/helpers/mail/group_id.py | modernwarfareuplink/sendgrid-python | b360223622418216f89a98278cfa1cde3e2a9ceb | [
"MIT"
] | 881 | 2015-01-08T23:14:57.000Z | 2022-03-30T15:10:21.000Z | sendgrid/helpers/mail/group_id.py | modernwarfareuplink/sendgrid-python | b360223622418216f89a98278cfa1cde3e2a9ceb | [
"MIT"
] | 761 | 2015-01-08T10:28:25.000Z | 2022-03-29T12:04:42.000Z | class GroupId(object):
"""The unsubscribe group ID to associate with this email."""
def __init__(self, group_id=None):
"""Create a GroupId object
:param group_id: The unsubscribe group to associate with this email.
:type group_id: integer, optional
"""
self._group_id = ... | 26.2 | 76 | 0.604008 |
556747fbf93023c2764ce2504210ac942a3a6f29 | 1,027 | py | Python | src/asphalt/serialization/serializers/pickle.py | Asphalt-framework/asphalt-serialization | 07fbf1e2295e6e27c9b396f2b88943166759cf32 | [
"Apache-2.0"
] | null | null | null | src/asphalt/serialization/serializers/pickle.py | Asphalt-framework/asphalt-serialization | 07fbf1e2295e6e27c9b396f2b88943166759cf32 | [
"Apache-2.0"
] | null | null | null | src/asphalt/serialization/serializers/pickle.py | Asphalt-framework/asphalt-serialization | 07fbf1e2295e6e27c9b396f2b88943166759cf32 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import pickle
from typing import Any
from ..api import Serializer
class PickleSerializer(Serializer):
"""
Serializes objects using the standard library :mod:`pickle` module.
.. warning:: This serializer is insecure because it allows execution of arbitrary
code... | 27.756757 | 85 | 0.685492 |
de09f558b7eb400207a486f01f9d13a7f8bb39d3 | 1,797 | py | Python | 1_open3d/27_non_blocking_visualization.py | lyffly/Python-3DPointCloud-and-RGBD | b3b973ec96045a34d3540522a115c5a77f4de136 | [
"Apache-2.0"
] | 16 | 2019-10-28T01:17:09.000Z | 2022-01-20T08:26:06.000Z | 1_open3d/27_non_blocking_visualization.py | lyffly/Python-3DPointCloud-and-RGBD | b3b973ec96045a34d3540522a115c5a77f4de136 | [
"Apache-2.0"
] | null | null | null | 1_open3d/27_non_blocking_visualization.py | lyffly/Python-3DPointCloud-and-RGBD | b3b973ec96045a34d3540522a115c5a77f4de136 | [
"Apache-2.0"
] | 3 | 2020-04-07T08:48:28.000Z | 2021-09-22T14:47:42.000Z | # coding = utf-8
# coding by liuyunfei
# origin code from open3d samples(github)
import numpy as np
import open3d as op3
import matplotlib.pyplot as plt
import copy
import time
from trajectory_io import *
import os
import sys
if __name__ == "__main__":
op3.utility.set_verbosity_level(op3.utility.VerbosityLevel... | 26.820896 | 72 | 0.631608 |
42e81b691c3ee3b3db9a896e42ffc1a11976046d | 2,127 | py | Python | saleor/product/utils/__init__.py | bennetritters/saleor | f4b0beaf586f15f260d838ddaba45bee5f133e0f | [
"CC-BY-4.0"
] | 1 | 2020-12-19T14:19:00.000Z | 2020-12-19T14:19:00.000Z | saleor/product/utils/__init__.py | bennetritters/saleor | f4b0beaf586f15f260d838ddaba45bee5f133e0f | [
"CC-BY-4.0"
] | 1 | 2020-11-10T13:57:37.000Z | 2020-11-10T13:57:37.000Z | saleor/product/utils/__init__.py | bennetritters/saleor | f4b0beaf586f15f260d838ddaba45bee5f133e0f | [
"CC-BY-4.0"
] | 1 | 2020-11-11T18:53:55.000Z | 2020-11-11T18:53:55.000Z | from typing import TYPE_CHECKING, List, Union
from urllib.parse import urlencode
from django.conf import settings
from django.db import transaction
from ...core.taxes import TaxedMoney, zero_taxed_money
from ..tasks import update_products_minimal_variant_prices_task
if TYPE_CHECKING:
# flake8: noqa
from date... | 34.868852 | 83 | 0.748002 |
5ca8779f07cbbfd460bdf0263592e0ec83d0c273 | 3,811 | py | Python | config/api_router.py | jaseemkm/care | 51c081121f5dcb4db3a721f563862b5a05b16cc8 | [
"MIT"
] | null | null | null | config/api_router.py | jaseemkm/care | 51c081121f5dcb4db3a721f563862b5a05b16cc8 | [
"MIT"
] | null | null | null | config/api_router.py | jaseemkm/care | 51c081121f5dcb4db3a721f563862b5a05b16cc8 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url
from rest_framework.routers import DefaultRouter, SimpleRouter
from rest_framework_nested.routers import NestedSimpleRouter
from care.facility.api.viewsets.ambulance import AmbulanceCreateViewSet, AmbulanceViewSet
from care.facility.api.viewset... | 44.313953 | 119 | 0.844398 |
cb3128ff6c12794e5062572c1365d7706620abc4 | 144 | py | Python | smart_cctv/myauth/apps.py | Ming-desu/smart-cctv | b4214ef362bcdd02802f7287a6fd6237e4b02535 | [
"MIT"
] | null | null | null | smart_cctv/myauth/apps.py | Ming-desu/smart-cctv | b4214ef362bcdd02802f7287a6fd6237e4b02535 | [
"MIT"
] | null | null | null | smart_cctv/myauth/apps.py | Ming-desu/smart-cctv | b4214ef362bcdd02802f7287a6fd6237e4b02535 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MyauthConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'myauth'
| 20.571429 | 56 | 0.756944 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.