hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4769b77a6b07ea94825a12d364fc9b88d2123602 | 1,494 | py | Python | python_bindings/setup.py | mikeseven/Halide | 739513cc290d0351b69cedd31829032788bc3a7e | [
"MIT"
] | 1 | 2016-10-08T00:18:46.000Z | 2016-10-08T00:18:46.000Z | python_bindings/setup.py | mikeseven/Halide | 739513cc290d0351b69cedd31829032788bc3a7e | [
"MIT"
] | null | null | null | python_bindings/setup.py | mikeseven/Halide | 739513cc290d0351b69cedd31829032788bc3a7e | [
"MIT"
] | null | null | null | from distutils.core import setup
from distutils.extension import Extension
import os, os.path, sys
import glob
import subprocess
import shutil
build_prefix = os.getenv('BUILD_PREFIX')
if not build_prefix:
build_prefix = ''
halide_root = '..'
include_path = os.path.join(halide_root, 'include')
bin_path = os.path.j... | 34.744186 | 141 | 0.637885 |
f64f11ab9e5ee65f90f42b7d7c618896508e115c | 4,389 | py | Python | pollbot/telegram/callback_handler/__init__.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 112 | 2019-06-11T17:52:57.000Z | 2022-03-18T00:05:21.000Z | pollbot/telegram/callback_handler/__init__.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 91 | 2019-05-28T11:33:40.000Z | 2022-02-27T12:12:07.000Z | pollbot/telegram/callback_handler/__init__.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 69 | 2019-07-10T16:58:06.000Z | 2022-03-30T22:09:44.000Z | """Callback query handling."""
from datetime import date
from sqlalchemy.exc import IntegrityError
from pollbot.enums import CallbackType
from pollbot.helper.stats import increase_stat, increase_user_stat
from pollbot.models import Option, UserStatistic
from pollbot.telegram.callback_handler.context import CallbackCo... | 38.5 | 95 | 0.706083 |
ab65c3d6afb0c23fbf28a9ab647cadfe9273a44c | 1,565 | py | Python | fission/np-examp.py | qianl15/serverless-zoo | 5cf34492a9186e636fbc6ad7e603a01db55a54ca | [
"MIT"
] | null | null | null | fission/np-examp.py | qianl15/serverless-zoo | 5cf34492a9186e636fbc6ad7e603a01db55a54ca | [
"MIT"
] | null | null | null | fission/np-examp.py | qianl15/serverless-zoo | 5cf34492a9186e636fbc6ad7e603a01db55a54ca | [
"MIT"
] | null | null | null | import sys
from flask import request
from flask import current_app
import numpy as np
from google.cloud import storage
# Python env doesn't pass in an argument
# we can get request data by request.headers, request.get_data()
def main():
current_app.logger.info("Received request")
msg = '---HEADERS---\n{}\n--... | 25.655738 | 96 | 0.608946 |
677e5edf38508b7b5834b07534e8559097ebee28 | 495 | py | Python | accounts/utils.py | dieisonborges/sicario | 3282c7bc89e7e6ae087ab4b67a9387dca9c71a4f | [
"MIT"
] | 1 | 2019-04-16T12:42:36.000Z | 2019-04-16T12:42:36.000Z | accounts/utils.py | dieisonborges/sicario | 3282c7bc89e7e6ae087ab4b67a9387dca9c71a4f | [
"MIT"
] | 11 | 2019-02-28T02:39:56.000Z | 2019-02-28T19:19:15.000Z | accounts/utils.py | dieisonborges/sicario | 3282c7bc89e7e6ae087ab4b67a9387dca9c71a4f | [
"MIT"
] | 1 | 2019-04-28T13:36:44.000Z | 2019-04-28T13:36:44.000Z | import string, random, os
from datetime import datetime
def rand_gen(size=100):
current_time = datetime.now()
current_time = current_time.strftime("%Y%m%d%H%M%S")
chars = string.ascii_uppercase + string.digits
return current_time+("".join(random.choice(chars) for x in range(size)))
def path_and_rename... | 35.357143 | 76 | 0.692929 |
fcf11606d18d51e49c896007466ef03111633b44 | 1,134 | py | Python | plugins/aws/conftest.py | agilityroots/ramukaka | 4ade291f9b17795b9d04b47406818ad65918cbf6 | [
"MIT"
] | null | null | null | plugins/aws/conftest.py | agilityroots/ramukaka | 4ade291f9b17795b9d04b47406818ad65918cbf6 | [
"MIT"
] | 12 | 2018-01-16T04:05:10.000Z | 2018-02-01T05:20:11.000Z | plugins/aws/conftest.py | agilityroots/ramukaka | 4ade291f9b17795b9d04b47406818ad65918cbf6 | [
"MIT"
] | null | null | null | # References:
# https://docs.pytest.org/en/latest/fixture.html#fixture-function
import pytest
import os
CONFIG = {
'access_id': os.environ['ERRBOT_AWS_ACCESS_KEY'],
'secret_key': os.environ['ERRBOT_AWS_SECRET_KEY'],
'account_id': os.environ['ERRBOT_AWS_ACCOUNT_ID'],
'region': os.environ['ERRBOT_AWS_DEF... | 23.625 | 92 | 0.691358 |
0a6bf2b8fd24ab830ecee360629be23d7cdf2855 | 1,063 | py | Python | src/api/views/operation/DataOperationJobDetailPageResource.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | null | null | null | src/api/views/operation/DataOperationJobDetailPageResource.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | null | null | null | src/api/views/operation/DataOperationJobDetailPageResource.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | null | null | null | import json
from flask import make_response, request
from injector import inject
from IocManager import IocManager
from domain.operation.page.DataOperationJobDetailPage import DataOperationJobDetailPage
from domain.operation.page.DataOperationJobPage import DataOperationJobPage
from infrastructor.api.ResourceBase imp... | 37.964286 | 87 | 0.774224 |
6fca98e7432d12b53e72f1304dca83172998a535 | 156 | py | Python | text.py | sumathi-kanthakumar/PythonITMFCS | 720874976907b79a688377d794c0f14dcf77979c | [
"MIT"
] | null | null | null | text.py | sumathi-kanthakumar/PythonITMFCS | 720874976907b79a688377d794c0f14dcf77979c | [
"MIT"
] | null | null | null | text.py | sumathi-kanthakumar/PythonITMFCS | 720874976907b79a688377d794c0f14dcf77979c | [
"MIT"
] | null | null | null |
#Comment below two lines to run in jupyter
from colorama import init
init()
from colorama import Fore
print(Fore.BLUE + "Blue")
print(Fore.GREEN+ "Green")
| 19.5 | 42 | 0.75641 |
a7e7ef6c07da287ab23d2fe7c7b86e845c2d219b | 1,238 | py | Python | data/merge_claim_tweets_real.py | TIMAN-group/covid19_misinformation | 901d528dd4a98a113cba3dce3050f50b21e00bcb | [
"MIT"
] | 7 | 2020-11-06T03:33:31.000Z | 2022-03-19T05:49:17.000Z | data/merge_claim_tweets_real.py | TIMAN-group/covid19_misinformation | 901d528dd4a98a113cba3dce3050f50b21e00bcb | [
"MIT"
] | null | null | null | data/merge_claim_tweets_real.py | TIMAN-group/covid19_misinformation | 901d528dd4a98a113cba3dce3050f50b21e00bcb | [
"MIT"
] | 1 | 2020-12-03T03:02:24.000Z | 2020-12-03T03:02:24.000Z | #!/usr/bin/env python
import os
import pandas as pd
COAID_PATH = os.path.join(os.path.dirname(__file__), "..", "CoAID")
REAL_TWEET_PATH = os.getcwd()
df_claim_real_tweet = pd.read_csv(os.path.join(COAID_PATH, "ClaimRealCOVID-19_tweets.csv"))
df_claim_real_tweet["id"] = df_claim_real_tweet["tweet_id"]
df_claim_real... | 41.266667 | 110 | 0.756058 |
1dd0ff26c40f2f14dd5085bf43833229ab971d3f | 205 | py | Python | build/lib.linux-x86_64-2.7/tornado_swirl/__init__.py | arthur-barbosa18/ecs-lib-tornado-swirl | 8d38d0c06242c70f58178f673f55033dfd066a78 | [
"MIT"
] | null | null | null | build/lib.linux-x86_64-2.7/tornado_swirl/__init__.py | arthur-barbosa18/ecs-lib-tornado-swirl | 8d38d0c06242c70f58178f673f55033dfd066a78 | [
"MIT"
] | null | null | null | build/lib.linux-x86_64-2.7/tornado_swirl/__init__.py | arthur-barbosa18/ecs-lib-tornado-swirl | 8d38d0c06242c70f58178f673f55033dfd066a78 | [
"MIT"
] | 1 | 2019-12-30T14:28:39.000Z | 2019-12-30T14:28:39.000Z | # -*- coding: utf-8 -*-
__version__ = '0.0.1'
__author__ = 'serena'
from tornado_swirl.settings import api_routes
from tornado_swirl.swagger import Application, describe, restapi, schema, add_global_tag
| 25.625 | 88 | 0.765854 |
c0bca476d5fdd9d9bfadda6489f021c899b6a520 | 695 | py | Python | qa/rpc-tests/create_cache.py | kazucoin/kazucoin-core | 1af2c5f9fa6240cffd68e1ab627339fe107a484a | [
"MIT"
] | 1 | 2019-06-02T17:20:49.000Z | 2019-06-02T17:20:49.000Z | qa/rpc-tests/create_cache.py | kazucoin/kazucoin-core | 1af2c5f9fa6240cffd68e1ab627339fe107a484a | [
"MIT"
] | null | null | null | qa/rpc-tests/create_cache.py | kazucoin/kazucoin-core | 1af2c5f9fa6240cffd68e1ab627339fe107a484a | [
"MIT"
] | 1 | 2018-12-23T23:33:18.000Z | 2018-12-23T23:33:18.000Z | #!/usr/bin/env python3
# Copyright (c) 2016 The Kazucoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helper script to create the cache
# (see KazucoinTestFramework.setup_chain)
#
from test_framework.test_f... | 23.166667 | 69 | 0.700719 |
18d673531348102217e66138b6c87ecbf0f49f12 | 7,529 | py | Python | setup.py | liberix/taichi | bbd4ba13e021b32dbf9a52507f637aff0851fe39 | [
"MIT"
] | 1 | 2021-08-08T14:05:33.000Z | 2021-08-08T14:05:33.000Z | setup.py | liberix/taichi | bbd4ba13e021b32dbf9a52507f637aff0851fe39 | [
"MIT"
] | null | null | null | setup.py | liberix/taichi | bbd4ba13e021b32dbf9a52507f637aff0851fe39 | [
"MIT"
] | null | null | null | import glob
import multiprocessing
import os
import platform
import shutil
import subprocess
import sys
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
from setuptools.command.build_py import build_py
from setuptools.command.egg_info import egg_info
classifier... | 35.018605 | 79 | 0.618542 |
0e1ac07c956691c128ac8f4c2517be792c059f54 | 6,499 | py | Python | openstack_dashboard/dashboards/project/data_processing/clusters/tabs.py | Tehsmash/horizon | 8ffade099a3a437509dcdcf25d5b054e5c188b61 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/data_processing/clusters/tabs.py | Tehsmash/horizon | 8ffade099a3a437509dcdcf25d5b054e5c188b61 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/data_processing/clusters/tabs.py | Tehsmash/horizon | 8ffade099a3a437509dcdcf25d5b054e5c188b61 | [
"Apache-2.0"
] | null | null | null | # 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
# distributed under the... | 35.513661 | 78 | 0.592707 |
0a8af9efc4c9ef5c7d5bdd359150fcd7b24774a2 | 401 | py | Python | SensorMonitor/wsgi.py | circuitar/SensorMonitor | 5d1bdaa448f1f52eac357782bb0eb7389e420c0f | [
"MIT"
] | 4 | 2015-03-24T20:15:06.000Z | 2021-04-27T16:53:37.000Z | SensorMonitor/wsgi.py | circuitar/SensorMonitor | 5d1bdaa448f1f52eac357782bb0eb7389e420c0f | [
"MIT"
] | null | null | null | SensorMonitor/wsgi.py | circuitar/SensorMonitor | 5d1bdaa448f1f52eac357782bb0eb7389e420c0f | [
"MIT"
] | 3 | 2017-01-15T08:32:26.000Z | 2020-12-16T12:58:40.000Z | """
WSGI config for SensorMonitor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SensorMonitor.settings")
from d... | 26.733333 | 78 | 0.795511 |
a5f895dd84c149ec9b60942d0167405ad276fb0a | 11,921 | py | Python | deutschland/lebensmittelwarnung/model/request_options.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/lebensmittelwarnung/model/request_options.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/lebensmittelwarnung/model/request_options.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Lebensmittelwarnungen API
Liste aller Lebensmittel und Produktwarnungen # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F... | 42.123675 | 106 | 0.557168 |
b4bafd6cca35dec480a200e152dba92e846ec20a | 990 | py | Python | app/app/urls.py | sibelkahraman/recipe-app-api | 2132ed21783ab1aaf57520a610505898abca14e5 | [
"MIT"
] | null | null | null | app/app/urls.py | sibelkahraman/recipe-app-api | 2132ed21783ab1aaf57520a610505898abca14e5 | [
"MIT"
] | null | null | null | app/app/urls.py | sibelkahraman/recipe-app-api | 2132ed21783ab1aaf57520a610505898abca14e5 | [
"MIT"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 36.666667 | 77 | 0.716162 |
27323c0d4945cfd136c2c38c20faf2eec33874f1 | 571 | py | Python | botfriend/tests/__init__.py | 0xdc/botfriend | 6157a873c4158ccfdda4bf021059bddf14217654 | [
"MIT"
] | 39 | 2017-06-19T16:12:34.000Z | 2022-03-02T10:06:29.000Z | botfriend/tests/__init__.py | 0xdc/botfriend | 6157a873c4158ccfdda4bf021059bddf14217654 | [
"MIT"
] | null | null | null | botfriend/tests/__init__.py | 0xdc/botfriend | 6157a873c4158ccfdda4bf021059bddf14217654 | [
"MIT"
] | 5 | 2018-08-27T19:49:56.000Z | 2020-10-22T02:31:04.000Z | import sys
import os
from nose.tools import set_trace
# Add the parent directory to the path so that import statements will work
# the same in tests as in code.
this_dir = os.path.abspath(os.path.dirname(__file__))
parent = os.path.split(this_dir)[0]
sys.path.insert(0, parent)
# Having problems with the database not ... | 25.954545 | 74 | 0.765324 |
819e5549d05ae0c6274b1a2d09ae27f3fc46e7d6 | 1,324 | py | Python | pandas/tests/extension/arrow/test_timestamp.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-07T04:58:36.000Z | 2021-05-07T04:58:59.000Z | pandas/tests/extension/arrow/test_timestamp.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/extension/arrow/test_timestamp.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-06-16T07:19:12.000Z | 2021-12-16T10:24:44.000Z | from __future__ import annotations
import datetime
from typing import Type
import pytest
import pandas as pd
from pandas.api.extensions import (
ExtensionDtype,
register_extension_dtype,
)
pytest.importorskip("pyarrow", minversion="0.13.0")
import pyarrow as pa # isort:skip
from pandas.tests.extension.ar... | 22.066667 | 81 | 0.660876 |
3377d1b446b2897e756bbfd986538cb7632e88b8 | 995 | py | Python | b_tree/binary_search_tree/bst_nodes_in_a_range.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | null | null | null | b_tree/binary_search_tree/bst_nodes_in_a_range.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | 5 | 2021-03-10T11:49:39.000Z | 2022-02-27T01:35:59.000Z | b_tree/binary_search_tree/bst_nodes_in_a_range.py | rjsnh1522/geeks-4-geeks-python | 9bea0ce4f3fae9b5f9e5952fb5b4b3a8c6186cf4 | [
"MIT"
] | null | null | null | # Definition for a binary tree node
# NOT_SOLVED
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def __init__(self):
self.count = 0
def solve(self, A, B, C):
in_order = self.in_order_traversal(A)
ind... | 22.111111 | 45 | 0.467337 |
f0b5a6489e0dee063254c6cfaac2017a25107489 | 9,831 | py | Python | cupy/testing/_helper.py | Onkar627/cupy | 8eef1ad5393c0a92c5065bc05137bf997f37044a | [
"MIT"
] | null | null | null | cupy/testing/_helper.py | Onkar627/cupy | 8eef1ad5393c0a92c5065bc05137bf997f37044a | [
"MIT"
] | null | null | null | cupy/testing/_helper.py | Onkar627/cupy | 8eef1ad5393c0a92c5065bc05137bf997f37044a | [
"MIT"
] | 1 | 2022-03-21T20:19:12.000Z | 2022-03-21T20:19:12.000Z | import contextlib
import inspect
from typing import Callable
import unittest
from unittest import mock
import warnings
import numpy
import cupy
from cupy._core import internal
import cupyx
import cupyx.scipy.sparse
from cupy.testing._pytest_impl import is_available
if is_available():
import pytest
_skipif:... | 31.012618 | 79 | 0.644594 |
bee54213fdb90c22607fdc8141da14d570deb89e | 3,702 | py | Python | BackEnd/api/service/evaluation.py | camilleAmaury/X5GON_project | 8d5b61eb45a357fe1881c0523389d463724c6448 | [
"Unlicense"
] | 1 | 2021-05-02T14:24:38.000Z | 2021-05-02T14:24:38.000Z | BackEnd/api/service/evaluation.py | camilleAmaury/X5GON_project | 8d5b61eb45a357fe1881c0523389d463724c6448 | [
"Unlicense"
] | 1 | 2022-02-10T00:48:47.000Z | 2022-02-10T00:48:47.000Z | BackEnd/api/service/evaluation.py | camilleAmaury/X5GON_project | 8d5b61eb45a357fe1881c0523389d463724c6448 | [
"Unlicense"
] | null | null | null | from flask import abort, jsonify, make_response
from . import user as user_service
from api.database import db
from api.database.model import User, Document, Evaluation
from . import user as userService
from .event import badge_possession_verification
def build_evaluation_schema(evaluation):
mod = {}
mod['us... | 34.277778 | 113 | 0.613722 |
6f4da346853dc8ac999dfcd0c880fa996a31b382 | 320 | py | Python | home/migrations/0011_remove_team_position.py | nurpeiis/RED | 0e1f61488f79283749ec11b5d0e5b066dd02bd68 | [
"MIT"
] | null | null | null | home/migrations/0011_remove_team_position.py | nurpeiis/RED | 0e1f61488f79283749ec11b5d0e5b066dd02bd68 | [
"MIT"
] | 12 | 2019-02-03T07:54:32.000Z | 2022-03-11T23:33:19.000Z | home/migrations/0011_remove_team_position.py | nurpeiis/RED | 0e1f61488f79283749ec11b5d0e5b066dd02bd68 | [
"MIT"
] | 2 | 2018-12-28T11:38:17.000Z | 2019-09-11T22:45:04.000Z | # Generated by Django 2.1.3 on 2019-05-05 07:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0010_team_position'),
]
operations = [
migrations.RemoveField(
model_name='team',
name='position',
),
]
| 17.777778 | 47 | 0.58125 |
05f2732e918e12b915e85fdbf19a7fbe33517456 | 718 | py | Python | BOJ/graph_boj/dfs_reference.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/graph_boj/dfs_reference.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/graph_boj/dfs_reference.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # 음료수 얼려 먹기
"""
n * m 크기의 얼음 틀이 있다. 구멍이 뚫려 있는 부분은 0, 칸막이가 존재하는 부분은 1로 표시된다.
구멍이 뚫려 있는 부분끼리 상, 하, 좌, 우로 붙어있는 경우 서로 연결되어있는것으로 간주한다.
이때 얼음 틀의 모양이 주어졌을 때 생성되는 총 아이스크림의 개수를 구하는 프로그램을 작성하라
"""
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]
def dfs(x, y):
if x <= -1 or x >= n or y <= -1 or y >= m:
return False
if gr... | 18.410256 | 59 | 0.512535 |
42e215ea64e85d9cb2c85199015ce4f156d4bdd0 | 5,429 | py | Python | getsub/downloader/subhd.py | nicolaszf/GetSubtitles | 34458cc1c853bab6fa238eff073162b83ba2c0e6 | [
"MIT"
] | null | null | null | getsub/downloader/subhd.py | nicolaszf/GetSubtitles | 34458cc1c853bab6fa238eff073162b83ba2c0e6 | [
"MIT"
] | null | null | null | getsub/downloader/subhd.py | nicolaszf/GetSubtitles | 34458cc1c853bab6fa238eff073162b83ba2c0e6 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import print_function
import time
import json
import re
from contextlib import closing
from collections import OrderedDict as order_dict
import requests
from bs4 import BeautifulSoup
from getsub.downloader.downloader import Downloader
from getsub.sys_global_var import py, prefix
from ... | 37.184932 | 97 | 0.504697 |
d24ad9c8ecbe3259091b402be1e94a52509fd928 | 5,024 | py | Python | tests/unit/test_ecsclient.py | lipak2345/python-ecsclient | d3f61497348f7c89c760c036d010aa6ca1317c22 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_ecsclient.py | lipak2345/python-ecsclient | d3f61497348f7c89c760c036d010aa6ca1317c22 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_ecsclient.py | lipak2345/python-ecsclient | d3f61497348f7c89c760c036d010aa6ca1317c22 | [
"Apache-2.0"
] | null | null | null | import unittest
import mock
from ecsclient import baseclient
from ecsclient import v2, v3
from ecsclient.client import Client
from ecsclient.common.exceptions import ECSClientException
class TestEcsClient(unittest.TestCase):
def test_verify_attributes(self):
c = baseclient.Client(username='someone',
... | 41.866667 | 106 | 0.572452 |
b19e5db315dfdf22f0ff0984ca7a84481162ad5e | 2,815 | py | Python | tests/fireworks/user_objects/firetasks/test_ssh_tasks.py | IMTEK-Simulation/imteksimfw | 887275920ea864b02ae5149a7c85c656ab5f34b6 | [
"MIT"
] | null | null | null | tests/fireworks/user_objects/firetasks/test_ssh_tasks.py | IMTEK-Simulation/imteksimfw | 887275920ea864b02ae5149a7c85c656ab5f34b6 | [
"MIT"
] | null | null | null | tests/fireworks/user_objects/firetasks/test_ssh_tasks.py | IMTEK-Simulation/imteksimfw | 887275920ea864b02ae5149a7c85c656ab5f34b6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Test dtool integration.
To see verbose logging during testing, run something like
import logging
import unittest
from imteksimfw.fireworks.user_objects.firetasks.tests.test_dtool_tasks import DtoolTasksTest
logging.basicConfig(level=logging.DEBUG)
suite = unittest.TestSuite()
... | 33.117647 | 97 | 0.653641 |
e70a29af57b6b5f1916a9656b15340fd38ecec58 | 59,065 | py | Python | pytorch_pretrained_bert/modeling_transfo_xl.py | z422684562/pytorch-pretrained-BERT | 5cd0a3db927b3b9232187674aad98d04f505cece | [
"Apache-2.0"
] | 12 | 2022-01-27T04:20:10.000Z | 2022-02-25T07:20:48.000Z | pytorch_pretrained_bert/modeling_transfo_xl.py | z422684562/pytorch-pretrained-BERT | 5cd0a3db927b3b9232187674aad98d04f505cece | [
"Apache-2.0"
] | null | null | null | pytorch_pretrained_bert/modeling_transfo_xl.py | z422684562/pytorch-pretrained-BERT | 5cd0a3db927b3b9232187674aad98d04f505cece | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 42.401292 | 131 | 0.594701 |
7ebddf5061ff85632f7c6e48db13d8587cecc0b8 | 2,111 | py | Python | src/dist.py | Tradehunt/kotlin-web-site | 5c2f88fb72130071746bde2c375acbb4182858c0 | [
"Apache-2.0"
] | 1,289 | 2015-01-17T23:02:12.000Z | 2022-03-31T07:05:05.000Z | src/dist.py | Tradehunt/kotlin-web-site | 5c2f88fb72130071746bde2c375acbb4182858c0 | [
"Apache-2.0"
] | 1,230 | 2015-01-04T08:16:08.000Z | 2022-03-25T00:00:42.000Z | src/dist.py | Tradehunt/kotlin-web-site | 5c2f88fb72130071746bde2c375acbb4182858c0 | [
"Apache-2.0"
] | 3,395 | 2015-01-02T20:45:03.000Z | 2022-03-30T21:01:15.000Z | from bs4 import BeautifulSoup
from os import path, walk
dist_path = path.join(path.dirname(__file__), "../", "dist")
def get_dist_page_content(url):
path_file = dist_path + url
if url.endswith('/'):
path_file += 'index.html'
if path.exists(path_file):
with open(path_file, 'r', encoding... | 26.721519 | 85 | 0.604927 |
d02263946c9f25c359893e1766810d8af4385d4f | 161 | py | Python | src/hist/numpy.py | amangoel185/hist | 040872b978ecfd98e9836ad0a7e5c27d8dd44d09 | [
"BSD-3-Clause"
] | 84 | 2020-02-12T02:02:58.000Z | 2022-03-23T10:50:03.000Z | src/hist/numpy.py | amangoel185/hist | 040872b978ecfd98e9836ad0a7e5c27d8dd44d09 | [
"BSD-3-Clause"
] | 213 | 2020-03-09T02:38:25.000Z | 2022-03-16T19:22:31.000Z | src/hist/numpy.py | amangoel185/hist | 040872b978ecfd98e9836ad0a7e5c27d8dd44d09 | [
"BSD-3-Clause"
] | 15 | 2020-03-14T12:05:18.000Z | 2021-11-12T14:25:07.000Z | from __future__ import annotations
from boost_histogram.numpy import histogram, histogram2d, histogramdd
__all__ = ("histogram", "histogram2d", "histogramdd")
| 26.833333 | 69 | 0.807453 |
57290b537faaf6ae5152b2f1e459f5ac314494fb | 10,993 | py | Python | onmt/Trainer.py | mingchen62/im2text-pytorch | 9516be1aad70517603383a92670c296f8d7e343e | [
"MIT"
] | 1 | 2020-03-24T08:42:38.000Z | 2020-03-24T08:42:38.000Z | onmt/Trainer.py | mingchen62/im2text-pytorch | 9516be1aad70517603383a92670c296f8d7e343e | [
"MIT"
] | null | null | null | onmt/Trainer.py | mingchen62/im2text-pytorch | 9516be1aad70517603383a92670c296f8d7e343e | [
"MIT"
] | null | null | null | from __future__ import division
"""
This is the loadable seq2seq trainer library that is
in charge of training details, loss compute, and statistics.
See train.py for a use case of this library.
Note!!! To make this a general library, we implement *only*
mechanism things here(i.e. what to do), and leave the strategy
t... | 34.139752 | 79 | 0.557537 |
c6866d315765361e3787f4cbb5e12217d4cdfeaf | 1,467 | py | Python | kay/ext/appstats/middleware.py | Letractively/kay-framework | a4cfabe3497e13c3785e5ec381b9cff11a378df3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-13T06:56:22.000Z | 2020-09-13T06:56:22.000Z | kay/ext/appstats/middleware.py | Letractively/kay-framework | a4cfabe3497e13c3785e5ec381b9cff11a378df3 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | kay/ext/appstats/middleware.py | Letractively/kay-framework | a4cfabe3497e13c3785e5ec381b9cff11a378df3 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2.5
# -*- coding:utf-8 -*-
"""
AppStatsMiddleware adapted to Kay framework.
:Copyright: (c) 2010 Ian Lewis <ianmlewis@gmail.com>,
:license: BSD, see LICENSE for more details.
"""
from kay.conf import settings
class AppStatsMiddleware(object):
"""
Middleware to enable appstats recording.
... | 28.211538 | 73 | 0.70893 |
a9e637161e36af87c923e992209cab10dc40092b | 868 | py | Python | tree_bark_synthesis/TextureByNumbers/init/chamfer_distance_transformation.py | laitoch/tree-bark-synthesis | 0bd43d6699d2e05f62d144f310874f986bbd91d2 | [
"MIT"
] | null | null | null | tree_bark_synthesis/TextureByNumbers/init/chamfer_distance_transformation.py | laitoch/tree-bark-synthesis | 0bd43d6699d2e05f62d144f310874f986bbd91d2 | [
"MIT"
] | null | null | null | tree_bark_synthesis/TextureByNumbers/init/chamfer_distance_transformation.py | laitoch/tree-bark-synthesis | 0bd43d6699d2e05f62d144f310874f986bbd91d2 | [
"MIT"
] | null | null | null | import numpy as np
from neighborhood import *
def _surround_with_border(array_2d, size, fill_value):
row = np.full([size, array_2d.shape[1]+2*size], fill_value)
col = np.full([array_2d.shape[0], size], fill_value)
return np.block([[row],[col,array_2d,col],[row]])
def chamfer_distance_transformation(image... | 33.384615 | 69 | 0.624424 |
8ad6b57d6a96a856f4f59f22acdfcbb82e0641b7 | 2,288 | py | Python | docs/conf.py | Zamy97/internship_5 | f0a037ac3bc4ee0d465c6bb8aefce5bfe13e9722 | [
"MIT"
] | null | null | null | docs/conf.py | Zamy97/internship_5 | f0a037ac3bc4ee0d465c6bb8aefce5bfe13e9722 | [
"MIT"
] | null | null | null | docs/conf.py | Zamy97/internship_5 | f0a037ac3bc4ee0d465c6bb8aefce5bfe13e9722 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 36.31746 | 79 | 0.667832 |
cc04122f7499096e1521e29648720c1dff47c279 | 5,806 | py | Python | src/networks.py | ajenningsfrankston/ICIAR2018 | b0e6a19ee31ab941113294b32055bd14deca35cd | [
"MIT"
] | 175 | 2018-01-20T04:20:47.000Z | 2022-03-14T02:09:22.000Z | src/networks.py | ajenningsfrankston/ICIAR2018 | b0e6a19ee31ab941113294b32055bd14deca35cd | [
"MIT"
] | 12 | 2018-04-28T15:24:50.000Z | 2020-10-01T10:48:55.000Z | src/networks.py | ajenningsfrankston/ICIAR2018 | b0e6a19ee31ab941113294b32055bd14deca35cd | [
"MIT"
] | 75 | 2018-03-17T01:29:19.000Z | 2022-03-30T04:24:52.000Z | import numpy as np
import torch.nn as nn
import torch.nn.functional as F
class BaseNetwork(nn.Module):
def __init__(self, name, channels=1):
super(BaseNetwork, self).__init__()
self._name = name
self._channels = channels
def name(self):
return self._name
def initialize_we... | 35.839506 | 102 | 0.568033 |
149fa0d5e891c6cba49b0c9c675c8355b73aefc8 | 13,079 | py | Python | backup/multiview - Copy 4.10.py | puhachov/Discovering-spammers-from-multiple-views | 0484552af19e68148bd7c29d3a726b4323c00834 | [
"MIT"
] | 1 | 2022-01-23T11:28:53.000Z | 2022-01-23T11:28:53.000Z | backup/multiview - Copy 4.10.py | puhachov/Discovering-spammers-from-multiple-views | 0484552af19e68148bd7c29d3a726b4323c00834 | [
"MIT"
] | null | null | null | backup/multiview - Copy 4.10.py | puhachov/Discovering-spammers-from-multiple-views | 0484552af19e68148bd7c29d3a726b4323c00834 | [
"MIT"
] | null | null | null | import numpy as np
import scipy
import copy
from numpy.linalg import multi_dot
class multiview():
"""
U - base matrices
X is passed as a list containing three multiview numpy matrices
Y is passed as a numpy matrix
regularisation_coefficients is a vector [[lambda_v], lambda_f, lambda_star_f, l... | 41 | 203 | 0.514642 |
9fc65aae8e9b59a5150436e852cf53ea0ea408e9 | 11,423 | py | Python | openpype/lib/delivery.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/lib/delivery.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/lib/delivery.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | """Functions useful for delivery action or loader"""
import os
import shutil
import glob
import clique
import collections
def collect_frames(files):
"""
Returns dict of source path and its frame, if from sequence
Uses clique as most precise solution
Args:
files(list): list of... | 33.206395 | 79 | 0.6163 |
4286b3afbac80f935b21128e9604c1fdb33a3600 | 1,132 | py | Python | style/utils.py | A-Grabish/py-style2 | 564dad9c954b541634a204d4ef4b54d937c0a520 | [
"MIT"
] | 23 | 2018-08-08T07:12:09.000Z | 2022-03-18T08:29:35.000Z | style/utils.py | A-Grabish/py-style2 | 564dad9c954b541634a204d4ef4b54d937c0a520 | [
"MIT"
] | 2 | 2019-02-21T17:27:58.000Z | 2019-04-29T17:29:45.000Z | style/utils.py | A-Grabish/py-style2 | 564dad9c954b541634a204d4ef4b54d937c0a520 | [
"MIT"
] | 5 | 2019-01-07T23:17:55.000Z | 2022-03-10T18:35:31.000Z | import matplotlib.pyplot as plt
import matplotlib.animation as animation
import math
import numpy as np
def gallery(imgtuples, rows=1, cols=None, figsize=None):
cols = cols or int(math.ceil(len(imgtuples) / rows))
fig, axs = plt.subplots(rows, cols, figsize=figsize)
axs = np.asarray(axs).flatten()
... | 27.609756 | 86 | 0.662544 |
a4b82ed9882df3b715a284b0fdf967a5516a4db1 | 4,801 | py | Python | tests/dpaycli/test_witness.py | dpays/dpay-cli | dfa80898e1faea2cee92ebec6fe04873381bd40f | [
"MIT"
] | null | null | null | tests/dpaycli/test_witness.py | dpays/dpay-cli | dfa80898e1faea2cee92ebec6fe04873381bd40f | [
"MIT"
] | null | null | null | tests/dpaycli/test_witness.py | dpays/dpay-cli | dfa80898e1faea2cee92ebec6fe04873381bd40f | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import super
import unittest
from parameterized import parameterized
from pprint import pprint
from dpaycli import DPay
from dpaycli.witness import Witness, ... | 31.379085 | 117 | 0.569881 |
ace8fb2e069fb1ebaae41c69a50dff82e7a3307c | 1,689 | py | Python | src/config/setting.py | jack139/trouble | 00f3f8a84229d71aaa507bd6b8eb2ccbd4e32ac0 | [
"BSD-3-Clause"
] | null | null | null | src/config/setting.py | jack139/trouble | 00f3f8a84229d71aaa507bd6b8eb2ccbd4e32ac0 | [
"BSD-3-Clause"
] | null | null | null | src/config/setting.py | jack139/trouble | 00f3f8a84229d71aaa507bd6b8eb2ccbd4e32ac0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import web
from pymongo import MongoClient
#####
debug_mode = True # Flase - production, True - staging
#####
#
enable_proxy = True
http_proxy = 'http://192.168.2.108:8888'
https_proxy = 'https://192.168.2.108:8888'
proxy_list = ['192.168.2.103']
enable_local_test = True... | 22.223684 | 101 | 0.677324 |
935a5396b9ab1626006272f41440ff5f9882ca96 | 14,631 | py | Python | tests/cli/test_run.py | mkp6781/zulip-terminal | c1977a4058277772a3abb96bb76631d69f3ce41c | [
"Apache-2.0"
] | null | null | null | tests/cli/test_run.py | mkp6781/zulip-terminal | c1977a4058277772a3abb96bb76631d69f3ce41c | [
"Apache-2.0"
] | null | null | null | tests/cli/test_run.py | mkp6781/zulip-terminal | c1977a4058277772a3abb96bb76631d69f3ce41c | [
"Apache-2.0"
] | null | null | null | import builtins
import os
import stat
import pytest
from zulipterminal.cli.run import (
THEMES,
_write_zuliprc,
exit_with_error,
get_login_id,
in_color,
main,
parse_args,
)
from zulipterminal.model import ServerConnectionFailure
from zulipterminal.version import ZT_VERSION
@pytest.mark.p... | 28.688235 | 87 | 0.631741 |
76ba42d1732b02e04a6ed07c711fa8f84da86ec2 | 5,991 | py | Python | test/test_plugin_enigma2.py | caronc/pnotify | 4c57d76ee7d88b04b3ac2667f91d9e7062486415 | [
"MIT"
] | null | null | null | test/test_plugin_enigma2.py | caronc/pnotify | 4c57d76ee7d88b04b3ac2667f91d9e7062486415 | [
"MIT"
] | null | null | null | test/test_plugin_enigma2.py | caronc/pnotify | 4c57d76ee7d88b04b3ac2667f91d9e7062486415 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... | 31.366492 | 79 | 0.602904 |
be6e5d3382d9858116246c092f791658fc96bf03 | 13,197 | py | Python | tools/nntool/utils/tabular.py | knmcguire/gap_sdk | 7b0a09a353ab6f0550793d40bd46e98051f4a3d7 | [
"Apache-2.0"
] | null | null | null | tools/nntool/utils/tabular.py | knmcguire/gap_sdk | 7b0a09a353ab6f0550793d40bd46e98051f4a3d7 | [
"Apache-2.0"
] | null | null | null | tools/nntool/utils/tabular.py | knmcguire/gap_sdk | 7b0a09a353ab6f0550793d40bd46e98051f4a3d7 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019 GreenWaves Technologies
# All rights reserved.
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
from abc import ABC, abstractmethod
import csv
from texttable import Texttable
import xlsxwriter as xl
ALLOWED_TYPES = set(list... | 29.722973 | 99 | 0.507918 |
489449326f353defd6423c4a2e826914413f1d7d | 747 | py | Python | pycheck.io/ELEMENTARY/The Most Numbers.py | jz2010927/pycheck.io | 627898bed6fe712921f082c53a1858b8d80835a4 | [
"MIT"
] | null | null | null | pycheck.io/ELEMENTARY/The Most Numbers.py | jz2010927/pycheck.io | 627898bed6fe712921f082c53a1858b8d80835a4 | [
"MIT"
] | null | null | null | pycheck.io/ELEMENTARY/The Most Numbers.py | jz2010927/pycheck.io | 627898bed6fe712921f082c53a1858b8d80835a4 | [
"MIT"
] | null | null | null | def checkio(*args):
if len(args) > 0:
return max(args) - min(args)
return 0
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
def almost_equal(checked, correct, significant_digits):
precision = 0.1 ** signific... | 41.5 | 87 | 0.62249 |
e95739dd978710cb70fb304875d3831171d06ef4 | 1,873 | py | Python | pipelines/optuna-pipeline/optuna-pipeline.py | tonouchi510/kfp-project | 67b78ae53cc3de594b8254999a4f553a8d5cec27 | [
"MIT"
] | null | null | null | pipelines/optuna-pipeline/optuna-pipeline.py | tonouchi510/kfp-project | 67b78ae53cc3de594b8254999a4f553a8d5cec27 | [
"MIT"
] | null | null | null | pipelines/optuna-pipeline/optuna-pipeline.py | tonouchi510/kfp-project | 67b78ae53cc3de594b8254999a4f553a8d5cec27 | [
"MIT"
] | null | null | null | import kfp
from kfp import dsl
import os
# Initialize component store
component_store = kfp.components.ComponentStore(
local_search_paths=["pipelines/optuna-pipeline", "components"])
# Create component factories
optuna_op = component_store.load_component("optuna-worker")
slack_notification_op = component_store.lo... | 30.704918 | 122 | 0.654031 |
d4e6f4dc6a7682a6fc8760af766aac0f6811ee07 | 3,214 | py | Python | tests/test_scripted_effects_unused.py | Pelmen323/Kaiserreich_Autotests | 3ad60ae09bb6d15922c5f581c0b1d80c3e8f08de | [
"MIT"
] | null | null | null | tests/test_scripted_effects_unused.py | Pelmen323/Kaiserreich_Autotests | 3ad60ae09bb6d15922c5f581c0b1d80c3e8f08de | [
"MIT"
] | null | null | null | tests/test_scripted_effects_unused.py | Pelmen323/Kaiserreich_Autotests | 3ad60ae09bb6d15922c5f581c0b1d80c3e8f08de | [
"MIT"
] | null | null | null | ##########################
# Test script to check if there are scripted effects that are not used via "xxx = yes"
# By Pelmen, https://github.com/Pelmen323
##########################
import glob
import os
import re
from ..test_classes.generic_test_class import FileOpener, DataCleaner, ResultsReporter
FALSE_POSITIVES = ... | 38.261905 | 138 | 0.734287 |
80307a635261fd66ddc3bcf72111c375dd60783b | 4,100 | py | Python | benchmark/startQiskit_noisy1248.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy1248.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy1248.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=43
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 31.538462 | 82 | 0.619512 |
ef00c6969d5c74e49c2d2be394d67d0efc61d7e9 | 5,734 | py | Python | backend-tests/tests/test_tenantadm.py | kacf/integration | d617eed3c1e8dbbddda716422c168ad1d0fad8e0 | [
"Apache-2.0"
] | null | null | null | backend-tests/tests/test_tenantadm.py | kacf/integration | d617eed3c1e8dbbddda716422c168ad1d0fad8e0 | [
"Apache-2.0"
] | 104 | 2020-07-06T06:03:41.000Z | 2022-02-04T08:26:31.000Z | backend-tests/tests/test_tenantadm.py | kacf/integration | d617eed3c1e8dbbddda716422c168ad1d0fad8e0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Northern.tech AS
#
# 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 a... | 33.928994 | 79 | 0.608301 |
677a897e2f3b01bfe68441a295ef7fe8753393f1 | 2,935 | py | Python | website/users/forms.py | eli-lam/flask-website | c003b6daf4fc92ef773a1650397a4b08c365704e | [
"MIT"
] | null | null | null | website/users/forms.py | eli-lam/flask-website | c003b6daf4fc92ef773a1650397a4b08c365704e | [
"MIT"
] | null | null | null | website/users/forms.py | eli-lam/flask-website | c003b6daf4fc92ef773a1650397a4b08c365704e | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed
from wtforms import StringField, PasswordField, SubmitField, BooleanField
from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError
from flask_login import current_user
from website.models import User
class Reg... | 43.80597 | 106 | 0.698807 |
e9496fe9ea5cf6c9bf89b1462e813e35037c611e | 702 | py | Python | autoflow/scripts/mactab.py | sh-biswas/autoflow | 4c3a5f6b837bb6d546c81f11ef777eb805230b7e | [
"MIT"
] | 7 | 2020-11-18T16:29:31.000Z | 2021-09-08T19:06:40.000Z | autoflow/scripts/mactab.py | sksuryan/autoflow | ac1924e616e2d093de29719292b2a0fbad375dbd | [
"MIT"
] | 8 | 2020-11-18T17:15:11.000Z | 2020-11-27T15:05:52.000Z | autoflow/scripts/mactab.py | sksuryan/autoflow | ac1924e616e2d093de29719292b2a0fbad375dbd | [
"MIT"
] | 5 | 2020-11-19T14:15:03.000Z | 2021-10-29T18:22:01.000Z | from subprocess import Popen, PIPE
import sys
import os
def osascript(scpt):
p = Popen(['osascript', '-'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate(scpt.encode('utf-8'))
return stdout, stderr
def openTab():
script = f"""
tell application "System Events"
... | 31.909091 | 75 | 0.586895 |
4a9e3d2f26a08b1a88f3eabe3716d0d175229947 | 1,190 | py | Python | nextcord/__init__.py | VincentRPS/nextcord-v3 | c34ac1adf9afad589703cc9ec904e39eb43303ac | [
"MIT"
] | null | null | null | nextcord/__init__.py | VincentRPS/nextcord-v3 | c34ac1adf9afad589703cc9ec904e39eb43303ac | [
"MIT"
] | null | null | null | nextcord/__init__.py | VincentRPS/nextcord-v3 | c34ac1adf9afad589703cc9ec904e39eb43303ac | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2021-present vcokltfre & tag-epic
#
# 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... | 47.6 | 77 | 0.77479 |
9a3bd538bea03740ef7ae809014fdeee7a5f4f58 | 10,740 | py | Python | rootfs/api/tests/test_limits.py | drycc/controller | 7e9f3695df29af77d99729dc0185863f0791b183 | [
"Apache-2.0"
] | null | null | null | rootfs/api/tests/test_limits.py | drycc/controller | 7e9f3695df29af77d99729dc0185863f0791b183 | [
"Apache-2.0"
] | 19 | 2020-07-30T06:31:29.000Z | 2022-03-14T07:33:44.000Z | rootfs/api/tests/test_limits.py | drycc/controller | 7e9f3695df29af77d99729dc0185863f0791b183 | [
"Apache-2.0"
] | 9 | 2020-07-30T02:50:12.000Z | 2020-12-11T06:44:19.000Z | import json
import requests_mock
from django.core.cache import cache
from django.contrib.auth import get_user_model
from rest_framework.authtoken.models import Token
from api.serializers import MEMLIMIT_MATCH
from api.serializers import CPUSHARE_MATCH
from api.tests import adapter, DryccTransactionTestCase
User = ge... | 40.992366 | 97 | 0.621322 |
fd12cb8e998472f9ae1bd542d5db6e41ce2586ab | 3,560 | py | Python | implementation/tests/gcn-dgl.py | ZhuFanCheng/Thesis | eba9a7567a5c254acb2e78fdac0cda7dddabb327 | [
"MIT"
] | null | null | null | implementation/tests/gcn-dgl.py | ZhuFanCheng/Thesis | eba9a7567a5c254acb2e78fdac0cda7dddabb327 | [
"MIT"
] | null | null | null | implementation/tests/gcn-dgl.py | ZhuFanCheng/Thesis | eba9a7567a5c254acb2e78fdac0cda7dddabb327 | [
"MIT"
] | null | null | null | import dgl
import dgl.data
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import GraphConv
import argparse
import dgl.nn
dataset = dgl.data.CoraGraphDataset()
g=dataset[0]
# class GCN(nn.Module):
# def __init__(self,
# g,
# in_feats,
# ... | 32.363636 | 128 | 0.574719 |
a07fc9630d3112fba76addf4f67488ca2b90d324 | 1,637 | py | Python | Shorty/urls.py | Rodrigo-NH/Shorty | 1c29f69918de163caef0ae95f743fb81002e14a5 | [
"MIT"
] | null | null | null | Shorty/urls.py | Rodrigo-NH/Shorty | 1c29f69918de163caef0ae95f743fb81002e14a5 | [
"MIT"
] | null | null | null | Shorty/urls.py | Rodrigo-NH/Shorty | 1c29f69918de163caef0ae95f743fb81002e14a5 | [
"MIT"
] | null | null | null | """Shorty URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 41.974359 | 77 | 0.704948 |
75af42c16295b431df24199666393b412fa58474 | 5,346 | py | Python | Text_Classify/utils/tools.py | Serpentera/Machine-Learning | eb037188f415cec6d50f218dfef466dfb742a207 | [
"MIT"
] | null | null | null | Text_Classify/utils/tools.py | Serpentera/Machine-Learning | eb037188f415cec6d50f218dfef466dfb742a207 | [
"MIT"
] | null | null | null | Text_Classify/utils/tools.py | Serpentera/Machine-Learning | eb037188f415cec6d50f218dfef466dfb742a207 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : lianggq
# @Time : 2019/7/19 10:24
# @FileName: tools.py
import numpy as np
import jieba
jieba.load_userdict('../stopword/myjieba.txt')
from tensorflow import keras as kr
from article_categories.config.config import FLAGS
def read_data(filename):
"""
... | 29.213115 | 119 | 0.620464 |
c85f39c3b2544295435a9dca47932e38bea5d2b3 | 908 | py | Python | zerver/webhooks/flock/view.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | 1 | 2020-03-19T00:52:48.000Z | 2020-03-19T00:52:48.000Z | zerver/webhooks/flock/view.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/flock/view.py | pranayshahxyz/zulip | 3da483487af79fde9dce2d21124dfa39b94936a5 | [
"Apache-2.0"
] | 1 | 2020-07-06T11:43:28.000Z | 2020-07-06T11:43:28.000Z | # Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import REQ, api_key_only_webhook_view, \
has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
f... | 30.266667 | 89 | 0.746696 |
56fa445307e90482a2f96bb18cfd6baffb50e967 | 2,478 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/net/filehandler.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/net/filehandler.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/net/filehandler.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import os
from browser import help_functions
from utils import color
BUFFER_SIZE = 8 * 1024
class Filehandler:
def __init__(self, unionpath, client):
self.unionpath = unionpath
self.client = client
def send_file(self, hash):
name, timestamp, type, location, hash, extension, fs_path, ... | 37.545455 | 154 | 0.544794 |
616f2507fecc36d9561eea5a6bbb22cedfe9c704 | 418 | py | Python | corehq/sql_accessors/migrations/0048_livequery_sql.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/sql_accessors/migrations/0048_livequery_sql.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/sql_accessors/migrations/0048_livequery_sql.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | # Generated by Django 1.10.7 on 2017-07-06 21:18
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('corehq', 'sql_accessors', 'sql_templates'), {})
class Migration(migrations.Migration):
dependencies = [
('sql_accessors', '0047_livequery_... | 22 | 76 | 0.703349 |
7c7c15413ecac75c0a2b2b446a62f86a6ce3b951 | 3,956 | py | Python | models/dtree.py | oaao/decisiontreehugger | 95472693ee9326c1ff4f54c414622761dfb36b87 | [
"MIT"
] | null | null | null | models/dtree.py | oaao/decisiontreehugger | 95472693ee9326c1ff4f54c414622761dfb36b87 | [
"MIT"
] | null | null | null | models/dtree.py | oaao/decisiontreehugger | 95472693ee9326c1ff4f54c414622761dfb36b87 | [
"MIT"
] | null | null | null | import numpy as np
from .base import ProtoTree
class DecisionTree(ProtoTree):
def __init__(self, max_depth=4, depth=1):
self.L = None
self.R = None
self.max_depth = max_depth
self.depth = depth
self.criteria = None
self.split_feature = None
sel... | 28.257143 | 117 | 0.591507 |
cbb30a13b938aa6024c8f2367793389c61bc0852 | 5,622 | py | Python | GuiStylizedWidgets/coffee_widgets.py | TiNezlobinsky/SplineLV | 7281bca555f8eda802091cfbe3687b8ab59bfa4b | [
"MIT"
] | null | null | null | GuiStylizedWidgets/coffee_widgets.py | TiNezlobinsky/SplineLV | 7281bca555f8eda802091cfbe3687b8ab59bfa4b | [
"MIT"
] | null | null | null | GuiStylizedWidgets/coffee_widgets.py | TiNezlobinsky/SplineLV | 7281bca555f8eda802091cfbe3687b8ab59bfa4b | [
"MIT"
] | null | null | null | from PyQt5 import QtCore, QtWidgets
color_1 = "216, 218, 162"
color_2 = "134, 172, 176"
color_3 = "130, 113, 26"
color_4 = "232, 140, 90"
color_5 = "180, 212, 76"
color_6 = "196, 141, 195"
color_7 = "219, 189, 217"
back_rgb = color_1
class CoffeeButton(QtWidgets.QPushButton):
_buttons_style_sheet = "background: ... | 39.041667 | 89 | 0.524191 |
61167c042d116128b1c7cbe28ca5de9ef425cf7a | 68 | py | Python | src/__init__.py | Promeos/LADOT-Street-Sweeping-Transition-Pan | eb0d224a7ba910c4bf1db78b9fdb1365de0e6945 | [
"MIT"
] | 1 | 2021-02-05T16:05:02.000Z | 2021-02-05T16:05:02.000Z | src/__init__.py | Promeos/LADOT-Street-Sweeping-Transition-Plan | eb0d224a7ba910c4bf1db78b9fdb1365de0e6945 | [
"MIT"
] | null | null | null | src/__init__.py | Promeos/LADOT-Street-Sweeping-Transition-Plan | eb0d224a7ba910c4bf1db78b9fdb1365de0e6945 | [
"MIT"
] | null | null | null | from .acquire import *
from .prepare import *
from .explore import * | 22.666667 | 22 | 0.75 |
cd806c9e2e4c333b8a1e82d1522723012d692250 | 10,981 | py | Python | e2e_tests/helpers.py | QueensU-Cloud/AzureTRE | 8118bb9720785b64ba01dae0ce4558b1d40dee1c | [
"MIT"
] | null | null | null | e2e_tests/helpers.py | QueensU-Cloud/AzureTRE | 8118bb9720785b64ba01dae0ce4558b1d40dee1c | [
"MIT"
] | null | null | null | e2e_tests/helpers.py | QueensU-Cloud/AzureTRE | 8118bb9720785b64ba01dae0ce4558b1d40dee1c | [
"MIT"
] | null | null | null | import asyncio
from contextlib import asynccontextmanager
from httpx import AsyncClient
from starlette import status
import config
from resources import strings
class InstallFailedException(Exception):
pass
def read_workspace_id() -> str:
with open('workspace_id.txt', 'r') as f:
workspace_id = f.r... | 47.951965 | 252 | 0.740643 |
1b23149dea3b2b3be4ad662e7d41184141c292a0 | 7,375 | py | Python | aiida_gaussian/calculations/gaussian.py | kjappelbaum/aiida-gaussian | 6208a2a195b1decd292f6cc35c84f3999bad2c55 | [
"MIT"
] | null | null | null | aiida_gaussian/calculations/gaussian.py | kjappelbaum/aiida-gaussian | 6208a2a195b1decd292f6cc35c84f3999bad2c55 | [
"MIT"
] | null | null | null | aiida_gaussian/calculations/gaussian.py | kjappelbaum/aiida-gaussian | 6208a2a195b1decd292f6cc35c84f3999bad2c55 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Gaussian input plugin."""
from __future__ import absolute_import
import os
from shutil import copyfile, copytree
import six
from six.moves import map, range
from aiida.orm import Dict, FolderData, List, RemoteData, SinglefileData
from aiida.common import CalcInfo, CodeInfo, InputValidationEr... | 32.488987 | 87 | 0.595661 |
2c50002de300f801c0db5ff35c4a155507d72594 | 116,638 | py | Python | sympy/core/numbers.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 2 | 2021-01-09T23:11:25.000Z | 2021-01-11T15:04:22.000Z | sympy/core/numbers.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 3 | 2021-02-28T03:58:40.000Z | 2021-03-07T06:12:47.000Z | sympy/core/numbers.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 2 | 2021-01-08T23:03:23.000Z | 2021-01-13T18:57:02.000Z | import numbers
import decimal
import fractions
import math
import re as regex
from .containers import Tuple
from .sympify import (SympifyError, converter, sympify, _convert_numpy_types, _sympify,
_is_numpy_instance)
from .singleton import S, Singleton
from .expr import Expr, AtomicExpr
from .eval... | 29.402067 | 108 | 0.561447 |
a439b8f61d38e52515082a5498ca97088d36971d | 1,013 | py | Python | python_fishc/14.0.py | iisdd/Courses | a47d202e0d7e1ba85a38c6fe3dd9619eceb1045c | [
"MIT"
] | 1 | 2020-11-29T14:42:01.000Z | 2020-11-29T14:42:01.000Z | python_fishc/14.0.py | iisdd/Courses | a47d202e0d7e1ba85a38c6fe3dd9619eceb1045c | [
"MIT"
] | null | null | null | python_fishc/14.0.py | iisdd/Courses | a47d202e0d7e1ba85a38c6fe3dd9619eceb1045c | [
"MIT"
] | null | null | null | '''0. 请写一个密码安全性检查的代码代码:check.py'''
# 密码安全性检查代码
#
# 低级密码要求:
# 1. 密码由单纯的数字或字母组成
# 2. 密码长度小于等于8位
#
# 中级密码要求:
# 1. 密码必须由数字、字母或特殊字符(仅限:~!@#$%^&*()_=-/,.?<>;:[]{}|\)任意两种组合
# 2. 密码长度不能低于8位
#
# 高级密码要求:
# 1. 密码必须由数字、字母及特殊字符(仅限:~!@#$%^&*()_=-/,.?<>;:[]{}|\)三种组合
# 2. 密码只能由字母开头
# 3. 密码长度不能低于16位
def c... | 19.862745 | 62 | 0.461007 |
7b71f8165676437ee4dc9b535508ee24df6b424a | 2,013 | py | Python | demos/kitchen_sink/libs/baseclass/download_file.py | p3g4asus/KivyMD | 441b3ef9daf412bd588bbb485612c5f2a53d669c | [
"MIT"
] | 1 | 2020-07-01T12:39:51.000Z | 2020-07-01T12:39:51.000Z | demos/kitchen_sink/libs/baseclass/download_file.py | p3g4asus/KivyMD | 441b3ef9daf412bd588bbb485612c5f2a53d669c | [
"MIT"
] | null | null | null | demos/kitchen_sink/libs/baseclass/download_file.py | p3g4asus/KivyMD | 441b3ef9daf412bd588bbb485612c5f2a53d669c | [
"MIT"
] | null | null | null | import os
from kivy.uix.screenmanager import Screen
from kivymd.toast import toast
class KitchenSinkDownloadFile(Screen):
def download_progress_hide(self, instance_progress, value):
"""Hides progress progress."""
self.ids.toolbar.right_action_items = [
[
"download",
... | 31.453125 | 78 | 0.584699 |
15c06c70b78669fcd16c8fb81794076ec4ab28c1 | 450 | py | Python | examples/context_example.py | tomasvotava/retry-helper | cfbb587e38838d9e9d59c4eb80f296941db5c13f | [
"Apache-2.0"
] | 1 | 2020-11-23T09:48:33.000Z | 2020-11-23T09:48:33.000Z | examples/context_example.py | tomasvotava/retry-helper | cfbb587e38838d9e9d59c4eb80f296941db5c13f | [
"Apache-2.0"
] | null | null | null | examples/context_example.py | tomasvotava/retry-helper | cfbb587e38838d9e9d59c4eb80f296941db5c13f | [
"Apache-2.0"
] | 1 | 2021-02-01T14:25:57.000Z | 2021-02-01T14:25:57.000Z | import random
import logging
from retry_helper import RetryManager
logging.basicConfig(level=logging.DEBUG)
with RetryManager(max_attempts=3, wait_seconds=0, exceptions=(ValueError,)) as retry:
while retry:
with retry.attempt:
number = random.randint(1, 6)
if number != 6:
... | 28.125 | 85 | 0.611111 |
05d5fbbfc64238daff37410605b9d4951d165527 | 8,738 | py | Python | code/level.py | leggettc18/zelda-style-rpg | 4f4114f263801ab09eb6b71d9fd77a80ddce727a | [
"MIT"
] | null | null | null | code/level.py | leggettc18/zelda-style-rpg | 4f4114f263801ab09eb6b71d9fd77a80ddce727a | [
"MIT"
] | null | null | null | code/level.py | leggettc18/zelda-style-rpg | 4f4114f263801ab09eb6b71d9fd77a80ddce727a | [
"MIT"
] | null | null | null | """Module containing classes and functions that manage the state of the level map and camera."""
from random import choice, randint
import pygame
from enemy import Enemy
# pylint:disable=wildcard-import,unused-wildcard-import
from settings import *
from tile import Tile
from player import Player
from weapon imp... | 43.044335 | 101 | 0.529183 |
2563a1fa7261568647dc1e0c4c3ed3c52110f1f9 | 683 | py | Python | careers/admin.py | Surveyor-Jr/zimaps | d4def072b50c7018e9f7800a36c2050f28791cc2 | [
"CC-BY-4.0"
] | null | null | null | careers/admin.py | Surveyor-Jr/zimaps | d4def072b50c7018e9f7800a36c2050f28791cc2 | [
"CC-BY-4.0"
] | null | null | null | careers/admin.py | Surveyor-Jr/zimaps | d4def072b50c7018e9f7800a36c2050f28791cc2 | [
"CC-BY-4.0"
] | null | null | null | from django.contrib import admin
from .models import FAQ, Services, Project, Category
@admin.register(Services)
class ServicesAdmin(admin.ModelAdmin):
'''Admin View for Service'''
list_display = ('name', 'intro')
list_filter = ('author', 'category')
search_fields = ('name',)
@admin.register(Project)... | 24.392857 | 52 | 0.672035 |
d46f9e611feddb3df6313fd7942e655d714305e7 | 2,519 | py | Python | flash/wifi.py | sleepychild/diy_sha_sep2019 | 2fdf9ec548e725e48013e6d84311da01a1b7521b | [
"MIT"
] | null | null | null | flash/wifi.py | sleepychild/diy_sha_sep2019 | 2fdf9ec548e725e48013e6d84311da01a1b7521b | [
"MIT"
] | null | null | null | flash/wifi.py | sleepychild/diy_sha_sep2019 | 2fdf9ec548e725e48013e6d84311da01a1b7521b | [
"MIT"
] | null | null | null | import network
class network_interface():
station_interface = network.WLAN(network.STA_IF)
ap_interface = network.WLAN(network.AP_IF)
def interface_mode(self, mode=None):
if mode == None:
if self.station_interface.active():
self.ap_interface.active(False)
... | 34.506849 | 85 | 0.593886 |
e1f352cf37484cdf7a0801d52b3a76de01518832 | 3,869 | py | Python | examples/wavenet/generate.py | nishnik/chainer | 03fc8a54b657f703855b25cbe53f56fda1295e76 | [
"MIT"
] | 1 | 2020-08-12T23:08:41.000Z | 2020-08-12T23:08:41.000Z | examples/wavenet/generate.py | nishnik/chainer | 03fc8a54b657f703855b25cbe53f56fda1295e76 | [
"MIT"
] | null | null | null | examples/wavenet/generate.py | nishnik/chainer | 03fc8a54b657f703855b25cbe53f56fda1295e76 | [
"MIT"
] | null | null | null | import argparse
import chainer
import chainerx
import librosa
import numpy
import tqdm
from net import UpsampleNet
from net import WaveNet
from utils import MuLaw
from utils import Preprocess
parser = argparse.ArgumentParser()
parser.add_argument('--input', '-i', help='input file')
parser.add_argument('--output', '-... | 36.847619 | 79 | 0.688292 |
d885023b0d41dc7066d14d3610125c2ad5a25c43 | 2,404 | py | Python | backend/mondo.py | STARInformatics/biomed-workbench | 510f533d9ec1296f69b0a5e979da5831d0aeb2dd | [
"MIT"
] | null | null | null | backend/mondo.py | STARInformatics/biomed-workbench | 510f533d9ec1296f69b0a5e979da5831d0aeb2dd | [
"MIT"
] | 17 | 2019-05-08T00:31:20.000Z | 2022-02-26T10:30:58.000Z | backend/mondo.py | STARInformatics/biomed-workbench | 510f533d9ec1296f69b0a5e979da5831d0aeb2dd | [
"MIT"
] | null | null | null | import json, os
from functools import lru_cache
from typing import List
MONDO = 'http://purl.obolibrary.org/obo/MONDO_'
def get(d:dict, *keys:str, default=None):
try:
for key in keys:
d = d[key]
return d
except:
return default
@lru_cache()
def load_mondo():
path = os.p... | 32.931507 | 108 | 0.522047 |
cccedaa5942ee4e46b25c11785c1b9ea160181bf | 23,827 | py | Python | mesonbuild/mintro.py | jekstrand/meson | 189d3b051393271a938e78e159da1ee6476a34c9 | [
"Apache-2.0"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | mesonbuild/mintro.py | jekstrand/meson | 189d3b051393271a938e78e159da1ee6476a34c9 | [
"Apache-2.0"
] | 2 | 2015-03-23T15:30:17.000Z | 2015-03-23T20:19:19.000Z | mesonbuild/mintro.py | jekstrand/meson | 189d3b051393271a938e78e159da1ee6476a34c9 | [
"Apache-2.0"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | # Copyright 2014-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | 44.787594 | 192 | 0.623914 |
2517cca648f8b325a9b6a0c26e2b317c99bf7047 | 37,677 | py | Python | ratsql/models/nl2code/decoder.py | drawar/rat-sql | 95ffe45d1a55d54e22e1d51851177e783a12fac5 | [
"MIT"
] | null | null | null | ratsql/models/nl2code/decoder.py | drawar/rat-sql | 95ffe45d1a55d54e22e1d51851177e783a12fac5 | [
"MIT"
] | null | null | null | ratsql/models/nl2code/decoder.py | drawar/rat-sql | 95ffe45d1a55d54e22e1d51851177e783a12fac5 | [
"MIT"
] | 1 | 2021-07-19T04:40:42.000Z | 2021-07-19T04:40:42.000Z | import collections.abc
import copy
import itertools
import json
import os
import attr
import entmax
import torch
import torch.nn.functional as F
from ratsql.models import abstract_preproc
from ratsql.models import attention
from ratsql.models import variational_lstm
from ratsql.models.nl2code.infer_tree_traversal imp... | 38.057576 | 106 | 0.566022 |
dd00373802cecaad52bc54c36933fc5d0db77f21 | 941 | py | Python | wherenottoeat/eatery/migrations/0005_auto_20161113_1803.py | jrigden/wherenottoeat.net | 67424b8795e030fa29b8a995c735e5cddc3f166f | [
"MIT"
] | null | null | null | wherenottoeat/eatery/migrations/0005_auto_20161113_1803.py | jrigden/wherenottoeat.net | 67424b8795e030fa29b8a995c735e5cddc3f166f | [
"MIT"
] | null | null | null | wherenottoeat/eatery/migrations/0005_auto_20161113_1803.py | jrigden/wherenottoeat.net | 67424b8795e030fa29b8a995c735e5cddc3f166f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-13 18:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eatery', '0004_auto_20161113_1744'),
]
operations = [
migrations.AlterField... | 26.138889 | 50 | 0.577046 |
4147aab5f0d11ff0f2c52c82ec4bb3ba4caa12f5 | 113 | py | Python | tf_implementation/segmentation/metrics/segmentation.py | arekmula/skull_stripping | d03cef81392f8cd243dc1c6d32ffa897af922eb2 | [
"MIT"
] | 3 | 2021-02-23T15:26:40.000Z | 2021-08-11T19:36:21.000Z | tf_implementation/segmentation/metrics/segmentation.py | arekmula/skull_stripping | d03cef81392f8cd243dc1c6d32ffa897af922eb2 | [
"MIT"
] | null | null | null | tf_implementation/segmentation/metrics/segmentation.py | arekmula/skull_stripping | d03cef81392f8cd243dc1c6d32ffa897af922eb2 | [
"MIT"
] | null | null | null | import segmentation_models as sm
def f_score(threshold=0.5):
return sm.metrics.FScore(threshold=threshold)
| 18.833333 | 49 | 0.787611 |
c7de397dafe13afff433057924d2887a4133a76a | 44 | py | Python | enthought/kiva/constants.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/kiva/constants.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/kiva/constants.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from kiva.constants import *
| 14.666667 | 28 | 0.772727 |
0253594d73091b2f09814bcc6a90f24a9be03c48 | 501 | py | Python | components/markers/lambdaProblemMarker.py | Linzee/tmsei_doodle | b08580fe5d58f6dd614ba6f3f53a03bcd859277b | [
"MIT"
] | null | null | null | components/markers/lambdaProblemMarker.py | Linzee/tmsei_doodle | b08580fe5d58f6dd614ba6f3f53a03bcd859277b | [
"MIT"
] | null | null | null | components/markers/lambdaProblemMarker.py | Linzee/tmsei_doodle | b08580fe5d58f6dd614ba6f3f53a03bcd859277b | [
"MIT"
] | null | null | null | import pandas as pd
from components.flowUtils import annotateProgress, cached
class LambdaProblemMarker:
def __init__(self, flow, lambdaMarker=None):
self.lambdaMarker = lambdaMarker
self.similarityMatrix = flow.getSimilarityMatrix()
self.problems = flow.getProblems()
@annotateProgre... | 31.3125 | 139 | 0.738523 |
cd1ee076814bc0d59a4fb5a40c7385f5d61038a4 | 2,255 | py | Python | Dorta/accounting_modification/models/account_invoice_modify.py | aaparicio87/Odoo12 | 25cfc349b2e85fa1b5f5846ffe693029f77b3b7d | [
"MIT"
] | null | null | null | Dorta/accounting_modification/models/account_invoice_modify.py | aaparicio87/Odoo12 | 25cfc349b2e85fa1b5f5846ffe693029f77b3b7d | [
"MIT"
] | null | null | null | Dorta/accounting_modification/models/account_invoice_modify.py | aaparicio87/Odoo12 | 25cfc349b2e85fa1b5f5846ffe693029f77b3b7d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
class AccountInvoiceModification(models.Model):
_inherit = "account.invoice"
sales_team_user_id = fields.Many2one('res.users', string="Líder de Equipo", related="team_id.user_id")
# @api.multi
# def _get_report_base_filename(self):
... | 47.978723 | 130 | 0.594678 |
9317b2ec943d3c5f7f57e6f0698a068209046ba6 | 8,079 | py | Python | esphome/components/font/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 249 | 2018-04-07T12:04:11.000Z | 2019-01-25T01:11:34.000Z | esphome/components/font/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 243 | 2018-04-11T16:37:11.000Z | 2019-01-25T16:50:37.000Z | esphome/components/font/__init__.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 40 | 2018-04-10T05:50:14.000Z | 2019-01-25T15:20:36.000Z | import functools
from pathlib import Path
import hashlib
import re
import requests
from esphome import core
from esphome.components import display
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.const import (
CONF_FAMILY,
CONF_FILE,
CONF_GLYPHS,
CONF_ID,
CONF_RAW_... | 27.955017 | 96 | 0.605768 |
8d3fb17c426d3bc47d1c94199bfea3de5c646a0e | 1,242 | py | Python | tolerant/response.py | christiemj09/tolerant | c936c9879a2220ea798a5a51736da6283364bb1f | [
"MIT"
] | null | null | null | tolerant/response.py | christiemj09/tolerant | c936c9879a2220ea798a5a51736da6283364bb1f | [
"MIT"
] | null | null | null | tolerant/response.py | christiemj09/tolerant | c936c9879a2220ea798a5a51736da6283364bb1f | [
"MIT"
] | null | null | null | """
Wrap functions in error-tolerant response objects.
"""
class Response(object):
"""A response from a function."""
def __init__(self, val, func, error=None):
self.val = val
self.func = func
self.error = error
def __call__(self):
return self.val
def response(fu... | 22.581818 | 69 | 0.580515 |
5d2c409ac445aaa8b25322946247a2d1292f80ae | 6,474 | py | Python | sdk/python/pulumi_aws/directoryservice/log_service.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/directoryservice/log_service.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/directoryservice/log_service.py | mdop-wh/pulumi-aws | 05bb32e9d694dde1c3b76d440fd2cd0344d23376 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import ... | 48.676692 | 413 | 0.669293 |
d04c82cfdb34772c0e539ed0430fe05082ed7d44 | 155 | py | Python | customer_app/apps.py | AtakanAytar/Django-Restaurant-app | 30d7e1e4ceaec049858a4199d86783aa214edc16 | [
"MIT"
] | null | null | null | customer_app/apps.py | AtakanAytar/Django-Restaurant-app | 30d7e1e4ceaec049858a4199d86783aa214edc16 | [
"MIT"
] | null | null | null | customer_app/apps.py | AtakanAytar/Django-Restaurant-app | 30d7e1e4ceaec049858a4199d86783aa214edc16 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CustomerAppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'customer_app'
| 22.142857 | 56 | 0.774194 |
9cd53c2ed0d9757731b0b514f20ea52398c81a6a | 14,284 | py | Python | official/cv/yolov5/postprocess.py | polar-region/MindSpore | b96bf8e175faabe2521882c0b7f6e89928e267c7 | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/yolov5/postprocess.py | Li-kewei/models | d02ba6a87c37ad9d0bc413413b9e9ddc8c60f43c | [
"Apache-2.0"
] | null | null | null | official/cv/yolov5/postprocess.py | Li-kewei/models | d02ba6a87c37ad9d0bc413413b9e9ddc8c60f43c | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.950769 | 119 | 0.536754 |
f59d243d07a25e7dcd5e7992c28bf6c35a54fa45 | 1,968 | py | Python | migu.py | squ33ker/Dlink_Parse | b8ea35e64e480720fff5f466c3959e631b379abf | [
"MIT"
] | 1 | 2021-07-06T17:16:42.000Z | 2021-07-06T17:16:42.000Z | migu.py | squ33ker/Dlink_Parse | b8ea35e64e480720fff5f466c3959e631b379abf | [
"MIT"
] | null | null | null | migu.py | squ33ker/Dlink_Parse | b8ea35e64e480720fff5f466c3959e631b379abf | [
"MIT"
] | 1 | 2021-08-05T03:09:07.000Z | 2021-08-05T03:09:07.000Z | import requests
class migu:
def __init__(self, url):
self.url = url
self.cid = self.url.split("cid=")[-1]
self.headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36¬"
}
def ... | 33.931034 | 148 | 0.537093 |
36f00c2c37ee193ceadf038ad4449be39e5e6828 | 395 | py | Python | login_register/v1/models.py | General-ITer/Django-Introduction | e88b12682f9abc46a90a0fc79e7443537230a506 | [
"Apache-2.0"
] | null | null | null | login_register/v1/models.py | General-ITer/Django-Introduction | e88b12682f9abc46a90a0fc79e7443537230a506 | [
"Apache-2.0"
] | 1 | 2020-12-09T18:26:36.000Z | 2020-12-09T18:26:36.000Z | login_register/v1/models.py | General-ITer/Django-Introduction | e88b12682f9abc46a90a0fc79e7443537230a506 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.models import User, AbstractUser
from django.db import models
# Create your models here.
class MyUser(AbstractUser):
phone = models.CharField(
max_length=20,
verbose_name='手机号',
unique=True
)
is_active = models.BooleanField(
default=False
)
... | 20.789474 | 57 | 0.643038 |
7f3f3fffb5d2d2052d2abea522a3b5bdb167af39 | 53,799 | py | Python | .buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Lib/test/test_warnings/__init__.py | VPetras/mobile-test-app | 6708dade6873ae2fb1ecb13aa70662f95fb42dc6 | [
"MIT"
] | 3 | 2019-06-25T22:14:51.000Z | 2021-07-31T23:09:42.000Z | .buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Lib/test/test_warnings/__init__.py | VPetras/mobile-test-app | 6708dade6873ae2fb1ecb13aa70662f95fb42dc6 | [
"MIT"
] | 6 | 2020-01-31T18:04:48.000Z | 2021-06-05T10:53:55.000Z | .buildozer/android/platform/build-armeabi-v7a/build/other_builds/python3-libffi-openssl-sqlite3/armeabi-v7a__ndk_target_21/python3/Lib/test/test_warnings/__init__.py | VPetras/mobile-test-app | 6708dade6873ae2fb1ecb13aa70662f95fb42dc6 | [
"MIT"
] | 1 | 2019-09-30T23:47:05.000Z | 2019-09-30T23:47:05.000Z | from contextlib import contextmanager
import linecache
import os
from io import StringIO
import re
import sys
import textwrap
import unittest
from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.test_warnings.data import stacklevel as warning_tests
import w... | 41.964899 | 101 | 0.599881 |
d7394a8e981308f556b64f7a841fe2a770e2952c | 573 | py | Python | lib/python/tests/test_all.py | onexeno/plow | 5c19c78ce0579f624cc774ac260f3178286ccb07 | [
"Apache-2.0"
] | null | null | null | lib/python/tests/test_all.py | onexeno/plow | 5c19c78ce0579f624cc774ac260f3178286ccb07 | [
"Apache-2.0"
] | 3 | 2020-05-15T21:01:33.000Z | 2021-12-09T20:25:17.000Z | lib/python/tests/test_all.py | onexeno/plow | 5c19c78ce0579f624cc774ac260f3178286ccb07 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import unittest
import logging
logging.basicConfig(level=logging.INFO)
TESTS = []
# rndaemon tests
TESTS += ['.'.join(['plowapp.rndaemon.test', p]) for p in (
'test_profile',
'test_run.TestCommunications',
'test_run.TestResourceManager',
'test_run.TestProcessManager',
)
]
... | 20.464286 | 66 | 0.705061 |
a275513342534c84ebbae58dada0934a5d15d2e1 | 407 | py | Python | coding/learn_python/context_manager/ContextDecorator_demo.py | yatao91/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | 3 | 2021-05-25T16:58:52.000Z | 2022-02-05T09:37:17.000Z | coding/learn_python/context_manager/ContextDecorator_demo.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | coding/learn_python/context_manager/ContextDecorator_demo.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from contextlib import ContextDecorator
class mycontext(ContextDecorator):
def __enter__(self):
print('Starting')
return self
def __exit__(self, exc_type, exc_val, exc_tb):
print('Finishing')
return False
@mycontext()
def function():
print("The b... | 15.653846 | 50 | 0.641278 |
5a7a617f7dd3d3743731613f07b9124e7a143fdf | 7,025 | py | Python | napari/utils/perf/_timers.py | chili-chiu/napari | eb6e672975ce105ac0125f71da3d0970d17cefb9 | [
"BSD-3-Clause"
] | 7 | 2018-07-03T17:35:46.000Z | 2018-11-07T15:48:58.000Z | napari/utils/perf/_timers.py | chili-chiu/napari | eb6e672975ce105ac0125f71da3d0970d17cefb9 | [
"BSD-3-Clause"
] | 120 | 2018-09-04T22:05:13.000Z | 2019-03-02T01:13:57.000Z | napari/utils/perf/_timers.py | chili-chiu/napari | eb6e672975ce105ac0125f71da3d0970d17cefb9 | [
"BSD-3-Clause"
] | 8 | 2018-09-04T21:48:26.000Z | 2019-01-29T04:48:30.000Z | """PerfTimers class and global instance.
"""
import contextlib
import os
from time import perf_counter_ns
from typing import Dict, Optional
from ._event import PerfEvent
from ._stat import Stat
from ._trace_file import PerfTraceFile
USE_PERFMON = os.getenv("NAPARI_PERFMON", "0") != "0"
class PerfTimers:
"""Time... | 29.393305 | 80 | 0.62121 |
2d88cd9613d993b5b6a450a78df3d9f8806e28b7 | 7,830 | py | Python | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py | opnfv/samplevnf | 75597545ef748d7113591cdbfc8d1aaa88cf15cb | [
"Apache-2.0"
] | 19 | 2017-10-13T11:14:19.000Z | 2022-02-13T12:26:42.000Z | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py | opnfv/samplevnf | 75597545ef748d7113591cdbfc8d1aaa88cf15cb | [
"Apache-2.0"
] | 1 | 2022-01-25T12:33:52.000Z | 2022-01-25T12:33:52.000Z | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py | opnfv/samplevnf | 75597545ef748d7113591cdbfc8d1aaa88cf15cb | [
"Apache-2.0"
] | 22 | 2017-09-21T01:54:35.000Z | 2021-11-07T06:40:11.000Z | ##
## Copyright (c) 2019-2020 Intel Corporation
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable la... | 37.464115 | 90 | 0.565517 |
d78cb5c8aa922ddaed3d5840193c55bc16dfed3a | 32,837 | py | Python | selectel_dns_api/apis/domains_api.py | nwton/fork_mdsina_selectel-dns-api | 30b02260a3bf86e0fbbafad372292aafb13206ee | [
"Apache-2.0"
] | null | null | null | selectel_dns_api/apis/domains_api.py | nwton/fork_mdsina_selectel-dns-api | 30b02260a3bf86e0fbbafad372292aafb13206ee | [
"Apache-2.0"
] | null | null | null | selectel_dns_api/apis/domains_api.py | nwton/fork_mdsina_selectel-dns-api | 30b02260a3bf86e0fbbafad372292aafb13206ee | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Selectel DNS API
Simple Selectel DNS API.
OpenAPI spec version: 1.0.0
Contact: info@mdsina.ru
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complianc... | 39.23178 | 110 | 0.553187 |
c3460e311c5b6a1c760ee6c9e8309d6263165032 | 660 | py | Python | repository/versions/009_Add_study_attributes.py | LCBRU/no_api_etl | 80272743047f8a36ede4b092150e3b76c2fb0186 | [
"MIT"
] | null | null | null | repository/versions/009_Add_study_attributes.py | LCBRU/no_api_etl | 80272743047f8a36ede4b092150e3b76c2fb0186 | [
"MIT"
] | null | null | null | repository/versions/009_Add_study_attributes.py | LCBRU/no_api_etl | 80272743047f8a36ede4b092150e3b76c2fb0186 | [
"MIT"
] | null | null | null | from sqlalchemy import Table, MetaData, Column, NVARCHAR, Boolean
def upgrade(migrate_engine):
meta = MetaData(bind=migrate_engine)
study = Table('edge_study', meta, autoload=True)
is_uhl_lead_centre = Column('is_uhl_lead_centre', Boolean)
is_uhl_lead_centre.create(study)
primary_clinical_managem... | 36.666667 | 98 | 0.775758 |
487f7f74001fbd3a128a361f1f41251e87608a1e | 3,112 | py | Python | src/attrbench/metrics/impact_score/impact_score.py | zoeparman/benchmark | 96331b7fa0db84f5f422b52cae2211b41bbd15ce | [
"MIT"
] | null | null | null | src/attrbench/metrics/impact_score/impact_score.py | zoeparman/benchmark | 96331b7fa0db84f5f422b52cae2211b41bbd15ce | [
"MIT"
] | 7 | 2020-03-02T13:03:50.000Z | 2022-03-12T00:16:20.000Z | src/attrbench/metrics/impact_score/impact_score.py | zoeparman/benchmark | 96331b7fa0db84f5f422b52cae2211b41bbd15ce | [
"MIT"
] | null | null | null | from typing import Callable, List
import torch
from torch.nn.functional import softmax, sigmoid
from torch.utils.data import DataLoader
from attrbench.lib.masking import Masker
from attrbench.metrics import Metric
from ._dataset import _ImpactScoreDataset
from .result import ImpactScoreResult
def impact_score(sampl... | 43.830986 | 135 | 0.661311 |
f2bf28298f1e5a1117e87f0876f8ebc4456191d3 | 3,806 | py | Python | selfdrive/car/subaru/carcontroller.py | zairwolf/pilot | e4cb0d26e75db5f2ef39eebe496f3356f9d0245b | [
"MIT"
] | null | null | null | selfdrive/car/subaru/carcontroller.py | zairwolf/pilot | e4cb0d26e75db5f2ef39eebe496f3356f9d0245b | [
"MIT"
] | null | null | null | selfdrive/car/subaru/carcontroller.py | zairwolf/pilot | e4cb0d26e75db5f2ef39eebe496f3356f9d0245b | [
"MIT"
] | null | null | null | #from common.numpy_fast import clip
from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.subaru import subarucan
from selfdrive.car.subaru.values import DBC
from opendbc.can.packer import CANPacker
from common.params import Params
params = Params()
from common.dp import get_last_modified
from comm... | 35.90566 | 114 | 0.685497 |
7cceb4a46af093dd1c90212c591a98c12d7157d5 | 982 | py | Python | chatroom/migrations/0001_initial.py | MitchellSturba/COMP-4800-FinalProject-Chatroom | 5e795eb4ddd36bb410fd4faf863f1007a9d38f46 | [
"MIT"
] | 3 | 2020-11-29T18:25:22.000Z | 2021-12-24T14:23:57.000Z | chatroom/migrations/0001_initial.py | MitchellSturba/COMP-4800-FinalProject-Chatroom | 5e795eb4ddd36bb410fd4faf863f1007a9d38f46 | [
"MIT"
] | null | null | null | chatroom/migrations/0001_initial.py | MitchellSturba/COMP-4800-FinalProject-Chatroom | 5e795eb4ddd36bb410fd4faf863f1007a9d38f46 | [
"MIT"
] | 3 | 2021-05-29T19:28:27.000Z | 2022-02-26T06:56:02.000Z | # Generated by Django 3.1.3 on 2020-11-04 08:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Room',
fields=[
... | 30.6875 | 114 | 0.578411 |
0345bfb3ad10c9ef5ad7569ec5a86a73374123db | 100 | py | Python | easy_uploader/apps.py | naritotakizawa/django-easy-uploader | 745c849588cf99618d19f39194396cfd934c1ff5 | [
"MIT"
] | 6 | 2017-06-24T08:35:16.000Z | 2021-02-27T01:52:44.000Z | easy_uploader/apps.py | naritotakizawa/django-easy-uploader | 745c849588cf99618d19f39194396cfd934c1ff5 | [
"MIT"
] | 10 | 2017-06-15T21:07:17.000Z | 2018-02-27T11:48:58.000Z | easy_uploader/apps.py | naritotakizawa/django-easy-uploader | 745c849588cf99618d19f39194396cfd934c1ff5 | [
"MIT"
] | 1 | 2018-02-21T01:30:50.000Z | 2018-02-21T01:30:50.000Z | from django.apps import AppConfig
class EasyUploaderConfig(AppConfig):
name = 'easy_uploader'
| 16.666667 | 36 | 0.78 |
f3b856d9cce004f5a4aaf0f7f8f174a52ac88dfe | 4,158 | py | Python | kubernetes/client/models/v1_ip_block.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | 3 | 2019-05-19T05:05:37.000Z | 2020-03-20T04:56:20.000Z | kubernetes/client/models/v1_ip_block.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_ip_block.py | Scalr/kubernetes-client-python | 07442bdb76f0876ec96c0b0da6f9c4b06d7e5e38 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 26.653846 | 185 | 0.55267 |
6b1bae51421a8700570ba3a732af3198d0e2f58b | 5,050 | py | Python | share/lib/python/neuron/rxdtests/tests/hh_param.py | tommorse/nrn | 73236b12977118ae0a98d7dbbed60973994cdaee | [
"BSD-3-Clause"
] | 1 | 2020-05-28T17:21:52.000Z | 2020-05-28T17:21:52.000Z | share/lib/python/neuron/rxdtests/tests/hh_param.py | tommorse/nrn | 73236b12977118ae0a98d7dbbed60973994cdaee | [
"BSD-3-Clause"
] | 2 | 2019-11-09T23:02:28.000Z | 2019-11-18T00:17:10.000Z | share/lib/python/neuron/rxdtests/tests/hh_param.py | tommorse/nrn | 73236b12977118ae0a98d7dbbed60973994cdaee | [
"BSD-3-Clause"
] | 1 | 2018-12-18T13:52:16.000Z | 2018-12-18T13:52:16.000Z | from neuron import h, crxd as rxd
from neuron.crxd import v
from neuron.crxd.rxdmath import vtrap, exp, log
from math import pi
from matplotlib import pyplot
h.load_file('stdrun.hoc')
# parameters
h.celsius = 6.3
e = 1.60217662e-19
scale = 1e-14/e
gnabar = 0.12*scale # molecules/um2 ms mV
gkbar = 0.036*scale
gl ... | 28.055556 | 94 | 0.634851 |
9e1be7c8be64305b88afe9e6f5525bcc75ff289a | 7,424 | py | Python | prepare_dataset/utils.py | dongkwan-kim/SubGNN | 8e3ad75d4a5d0eedb6fd35a94e7810d388444027 | [
"MIT"
] | null | null | null | prepare_dataset/utils.py | dongkwan-kim/SubGNN | 8e3ad75d4a5d0eedb6fd35a94e7810d388444027 | [
"MIT"
] | null | null | null | prepare_dataset/utils.py | dongkwan-kim/SubGNN | 8e3ad75d4a5d0eedb6fd35a94e7810d388444027 | [
"MIT"
] | null | null | null | # General
import random
import numpy as np
# Pytorch
import torch
import torch.nn.functional as F
from torch.nn import Sigmoid
from torch_geometric.data import Dataset
# Matplotlib
from matplotlib import pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
# Sci-kit Learn
from sklearn.metrics import ro... | 33.59276 | 116 | 0.565867 |
8b05f4ddbeaa7db6bc6f4e796172f5a91bda9ec1 | 2,434 | py | Python | BackTesting/BAIS.py | Jacarlianda/FinMind | 181e478727c7cda498da2b42495e2a6fea9688e3 | [
"Apache-2.0"
] | null | null | null | BackTesting/BAIS.py | Jacarlianda/FinMind | 181e478727c7cda498da2b42495e2a6fea9688e3 | [
"Apache-2.0"
] | null | null | null | BackTesting/BAIS.py | Jacarlianda/FinMind | 181e478727c7cda498da2b42495e2a6fea9688e3 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import requests
# class name,必須跟檔案名一致,例如 class BAIS,檔名也是 BAIS.py
class BAIS:
def __init__(self,
stock_price,
**kwargs, ):
# -------------------------------------------------------------------
# 此區塊請勿更動
stock_price = stock_price.sort_val... | 31.205128 | 117 | 0.534511 |
1a66f31cf54afbc4f4633af2105c8ceb245fb5c4 | 3,737 | py | Python | yolo/yolo.py | phil-hoang/general-object-detector | a59fcfd4cf237dda7bde370b947d0d3096631d56 | [
"MIT"
] | null | null | null | yolo/yolo.py | phil-hoang/general-object-detector | a59fcfd4cf237dda7bde370b947d0d3096631d56 | [
"MIT"
] | null | null | null | yolo/yolo.py | phil-hoang/general-object-detector | a59fcfd4cf237dda7bde370b947d0d3096631d56 | [
"MIT"
] | null | null | null | """
YOLOv3 Model
"""
import numpy as np
import torch
import torch.nn as nn
from torch import jit
import torchvision.transforms as T
from torchvision.ops import nms
def coco80_to_coco91_class(label):
# converts 80-index (val2014) to 91-index (paper)
coco91_classes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 1... | 28.968992 | 138 | 0.632861 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.