hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73f526fb320491a4e8c361c6ccf86f4cd4462be | 8,080 | py | Python | purity_fb/purity_fb_1dot12/models/multi_protocol_rule.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot12/models/multi_protocol_rule.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot12/models/multi_protocol_rule.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.12 Python SDK
Pure Storage FlashBlade REST 1.12 Python SDK. Compatible with REST API versions 1.0 - 1.12. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/... | 53.509934 | 1,242 | 0.688738 |
import pprint
import re
import six
class MultiProtocolRule(object):
__test__ = False
swagger_types = {
'access_control_style': 'str',
'safeguard_acls': 'bool'
}
attribute_map = {
'access_control_style': 'access_control_style',
'safeguard_acls': 'safegua... | true | true |
f73f52db7ce7f0c8f812863830f045263e6e5a7f | 256 | py | Python | backend/api_v1/users/endpoints.py | arineto/home_expenses | 6120f86aca360d2aed71285c2073da905ce5e91d | [
"MIT"
] | null | null | null | backend/api_v1/users/endpoints.py | arineto/home_expenses | 6120f86aca360d2aed71285c2073da905ce5e91d | [
"MIT"
] | null | null | null | backend/api_v1/users/endpoints.py | arineto/home_expenses | 6120f86aca360d2aed71285c2073da905ce5e91d | [
"MIT"
] | null | null | null | from rest_framework import generics
from api_v1.users.serializers import UserSerializer
from users.models import User
class UserListAPIView(generics.ListAPIView):
serializer_class = UserSerializer
queryset = User.objects.all().order_by("email")
| 25.6 | 51 | 0.808594 | from rest_framework import generics
from api_v1.users.serializers import UserSerializer
from users.models import User
class UserListAPIView(generics.ListAPIView):
serializer_class = UserSerializer
queryset = User.objects.all().order_by("email")
| true | true |
f73f52f7a5cc453862a4a3ccf0e123a419ccc664 | 8,694 | py | Python | tensorflow_probability/python/internal/backend/numpy/debugging.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 2 | 2020-12-17T20:43:24.000Z | 2021-06-11T22:09:16.000Z | tensorflow_probability/python/internal/backend/numpy/debugging.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/debugging.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 1 | 2020-12-19T13:05:15.000Z | 2020-12-19T13:05:15.000Z | # Copyright 2018 The TensorFlow Probability 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 29.672355 | 93 | 0.701748 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import six
from tensorflow_probability.python.internal.backend.numpy import _utils as utils
from tensorflow_probability.python.internal.backend.numpy.ops import convert_to_tens... | true | true |
f73f53583ea74525d21213b3ab956d86f2e38dc2 | 597 | py | Python | RestAPIS/migrations/0004_auto_20200618_0223.py | michaelzap94/lasantabiblia-platform-django | e33aa769737a2f2bcd61bfd594e85f4cdcb4751f | [
"MIT"
] | null | null | null | RestAPIS/migrations/0004_auto_20200618_0223.py | michaelzap94/lasantabiblia-platform-django | e33aa769737a2f2bcd61bfd594e85f4cdcb4751f | [
"MIT"
] | 8 | 2021-03-19T11:25:38.000Z | 2022-03-12T00:49:05.000Z | RestAPIS/migrations/0004_auto_20200618_0223.py | michaelzap94/lasantabiblia-platform-django | e33aa769737a2f2bcd61bfd594e85f4cdcb4751f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-18 01:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('RestAPIS', '0003_auto_20200618_0222'),
]
operations = [
migrations.AlterField(
model_name='verses_learned',
name='st... | 24.875 | 72 | 0.59464 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('RestAPIS', '0003_auto_20200618_0222'),
]
operations = [
migrations.AlterField(
model_name='verses_learned',
name='state',
field=models.IntegerField(bla... | true | true |
f73f53adfb265ba8f519f7c0c8aa2e5629b34f51 | 28,672 | py | Python | SecretsManagerRDSSQLServerRotationMultiUser/lambda_function.py | WilliamWeiWei/aws-secrets-manager-rotation-lambdas | e5a9dbf464d4e7be294200e0b6f567939947af9f | [
"MIT-0"
] | null | null | null | SecretsManagerRDSSQLServerRotationMultiUser/lambda_function.py | WilliamWeiWei/aws-secrets-manager-rotation-lambdas | e5a9dbf464d4e7be294200e0b6f567939947af9f | [
"MIT-0"
] | null | null | null | SecretsManagerRDSSQLServerRotationMultiUser/lambda_function.py | WilliamWeiWei/aws-secrets-manager-rotation-lambdas | e5a9dbf464d4e7be294200e0b6f567939947af9f | [
"MIT-0"
] | 1 | 2021-06-02T22:42:25.000Z | 2021-06-02T22:42:25.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import boto3
import json
import logging
import os
import pymssql
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
"""Secrets Manager RDS SQL Server Handler
... | 47.391736 | 180 | 0.665388 |
import boto3
import json
import logging
import os
import pymssql
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
arn = event['SecretId']
token = event['ClientRequestToken']
step = event['Step']
service_client = boto3.client('secretsmanager', end... | true | true |
f73f55ccf63114bb9f03ac90b09a7fccf11c6873 | 1,131 | py | Python | pyBlog/db.py | IXLives/pyBlog | 73cba4c9e1e356653b49ead67c4c3648c05cb6f1 | [
"CC0-1.0"
] | null | null | null | pyBlog/db.py | IXLives/pyBlog | 73cba4c9e1e356653b49ead67c4c3648c05cb6f1 | [
"CC0-1.0"
] | 1 | 2020-09-10T23:44:48.000Z | 2020-09-10T23:44:48.000Z | pyBlog/db.py | IXLives/pyBlog | 73cba4c9e1e356653b49ead67c4c3648c05cb6f1 | [
"CC0-1.0"
] | null | null | null | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
# g
# g is a unique request object used to store data that might be accessed by multiple functions during the request.
# Stored and re-used if called during the same request instead of creating a new connection
def ge... | 23.081633 | 114 | 0.681698 | import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row... | true | true |
f73f561b666cf34d28172e011246867c73100eb6 | 11,690 | py | Python | userbot/modules/afk.py | Alamsyah-ard/UserButt | 7feeb765b326d286b5519313c67e62a7a79161c4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-05-10T12:26:15.000Z | 2020-05-10T12:26:15.000Z | userbot/modules/afk.py | Alamsyah-ard/UserButt | 7feeb765b326d286b5519313c67e62a7a79161c4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/afk.py | Alamsyah-ard/UserButt | 7feeb765b326d286b5519313c67e62a7a79161c4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Ported by @azrim
""" Userbot module which contains afk-related commands """
from datetime import datetime
import ti... | 42.355072 | 273 | 0.562532 |
from datetime import datetime
import time
from random import choice, randint
from asyncio import sleep
from telethon.events import StopPropagation
from userbot import (AFKREASON, COUNT_MSG, CMD_HELP, ISAFK, BOTLOG,
BOTLOG_CHATID, USERS, PM_AUTO_BAN)
from userbot.events import register
A... | true | true |
f73f582c9317ab0d38b84e8d16bd51e396c3b389 | 734 | py | Python | astrobase/varclass/__init__.py | pierfra-ro/astrobase | b9f62c59a3ab9cdc1388d409fa281c26f1e6db6c | [
"MIT"
] | 45 | 2017-03-09T19:08:44.000Z | 2022-03-24T00:36:28.000Z | astrobase/varclass/__init__.py | pierfra-ro/astrobase | b9f62c59a3ab9cdc1388d409fa281c26f1e6db6c | [
"MIT"
] | 92 | 2016-12-21T19:01:20.000Z | 2022-01-03T15:28:45.000Z | astrobase/varclass/__init__.py | pierfra-ro/astrobase | b9f62c59a3ab9cdc1388d409fa281c26f1e6db6c | [
"MIT"
] | 20 | 2016-12-20T23:01:29.000Z | 2021-03-07T16:24:15.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# varclass - Waqas Bhatti (wbhatti@astro.princeton.edu) - Oct 2017
# License: MIT. See the LICENSE file for more details.
'''This contains various modules that obtain features to use in variable star
classification.
- :py:mod:`astrobase.varclass.starfeatures`: features r... | 33.363636 | 80 | 0.764305 | true | true | |
f73f58f3a1f258e13b8ad0843ccc27e59e9c6fb6 | 1,938 | py | Python | homeassistant/components/ubee/device_tracker.py | jan--f/home-assistant | ac7f1a7a37c7d46f1d2fefb66a4654180c084363 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ubee/device_tracker.py | jan--f/home-assistant | ac7f1a7a37c7d46f1d2fefb66a4654180c084363 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ubee/device_tracker.py | jan--f/home-assistant | ac7f1a7a37c7d46f1d2fefb66a4654180c084363 | [
"Apache-2.0"
] | null | null | null | """Support for Ubee router."""
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = [... | 28.086957 | 75 | 0.68937 |
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyubee==0.5']
_LOGGER = loggi... | true | true |
f73f59503ae75cae0f9091ee562e69292be63308 | 1,746 | py | Python | w09-text-files/teach-search-student-number/students.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | w09-text-files/teach-search-student-number/students.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | w09-text-files/teach-search-student-number/students.py | carloswm85/2021-cs111-programming-with-functions | 73cc376e3f0de60aa0150d33ec95568d217096ec | [
"Unlicense"
] | null | null | null | import csv
import re
def main():
run = True
I_NUMBERS = 0
STUDENT_NAME = 1
path = 'E:/GitHub/2021-cs111-programming-with-functions/w09-text-files/teach-/students.csv'
students = get_dictionary(path, I_NUMBERS, STUDENT_NAME)
while run:
print()
number_student = input('Please enter an I-Number (xx-xxx-xxxx): ... | 24.942857 | 92 | 0.639175 | import csv
import re
def main():
run = True
I_NUMBERS = 0
STUDENT_NAME = 1
path = 'E:/GitHub/2021-cs111-programming-with-functions/w09-text-files/teach-/students.csv'
students = get_dictionary(path, I_NUMBERS, STUDENT_NAME)
while run:
print()
number_student = input('Please enter an I-Number (xx-xxx-xxxx): ... | true | true |
f73f5a4d26c2e563c4d4faff2bebd7e5f8e63b2b | 8,509 | py | Python | unityparser/csharp/csharp_class_member_parser.py | adrianogil/SublimeUnityIntel | b3f3d686654c4dd62b3a792488d63bfd8105ce6a | [
"MIT"
] | null | null | null | unityparser/csharp/csharp_class_member_parser.py | adrianogil/SublimeUnityIntel | b3f3d686654c4dd62b3a792488d63bfd8105ce6a | [
"MIT"
] | null | null | null | unityparser/csharp/csharp_class_member_parser.py | adrianogil/SublimeUnityIntel | b3f3d686654c4dd62b3a792488d63bfd8105ce6a | [
"MIT"
] | null | null | null | import os, sys
__file__ = os.path.normpath(os.path.abspath(__file__))
__path__ = os.path.dirname(__file__)
# print(__path__)
if __path__ not in sys.path:
sys.path.insert(0, __path__)
from csharp_element import CSharpElement
import csharp_utils
class CSharpClassField(CSharpElement):
def __init__(self, csh... | 40.519048 | 131 | 0.59725 | import os, sys
__file__ = os.path.normpath(os.path.abspath(__file__))
__path__ = os.path.dirname(__file__)
if __path__ not in sys.path:
sys.path.insert(0, __path__)
from csharp_element import CSharpElement
import csharp_utils
class CSharpClassField(CSharpElement):
def __init__(self, csharp_field_name, t... | true | true |
f73f5ab2227b332ddc2faf8f2e7d5191762693d6 | 8,163 | py | Python | tqsdk/test/api/test_md_basic.py | gamcing/tqsdk-python | 1c21b61c3418325d2e1e76dedb2a111963d781bd | [
"Apache-2.0"
] | null | null | null | tqsdk/test/api/test_md_basic.py | gamcing/tqsdk-python | 1c21b61c3418325d2e1e76dedb2a111963d781bd | [
"Apache-2.0"
] | null | null | null | tqsdk/test/api/test_md_basic.py | gamcing/tqsdk-python | 1c21b61c3418325d2e1e76dedb2a111963d781bd | [
"Apache-2.0"
] | 1 | 2020-07-03T08:11:16.000Z | 2020-07-03T08:11:16.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import random
import unittest
from datetime import datetime
from tqsdk.test.api.helper import MockInsServer, MockServer
from tqsdk import TqApi, TqBacktest
class TestMdBasic(unittest.TestCase):
"""
测试TqApi行情相关函数基本功能, 以及TqApi与行情服务器交互是否符合设计预期
... | 43.420213 | 106 | 0.654906 |
import json
import os
import random
import unittest
from datetime import datetime
from tqsdk.test.api.helper import MockInsServer, MockServer
from tqsdk import TqApi, TqBacktest
class TestMdBasic(unittest.TestCase):
def setUp(self):
self.mock = MockServer()
self.ins_url = "htt... | true | true |
f73f5ab40138e3cee9316a4b125efd239f265ba0 | 4,231 | py | Python | tests/test_sparseholescleaning.py | uio-bmi/graph_peak_caller | 89deeabf3cd0b23fba49b1304f1c81222fb534d7 | [
"BSD-3-Clause"
] | 10 | 2018-04-19T21:54:31.000Z | 2021-07-22T12:46:33.000Z | tests/test_sparseholescleaning.py | uio-bmi/graph_peak_caller | 89deeabf3cd0b23fba49b1304f1c81222fb534d7 | [
"BSD-3-Clause"
] | 9 | 2018-01-30T20:41:36.000Z | 2021-01-28T23:00:18.000Z | tests/test_sparseholescleaning.py | uio-bmi/graph_peak_caller | 89deeabf3cd0b23fba49b1304f1c81222fb534d7 | [
"BSD-3-Clause"
] | 3 | 2019-08-20T21:43:53.000Z | 2022-01-20T14:39:34.000Z | import numpy as np
import offsetbasedgraph as obg
from graph_peak_caller.postprocess.holecleaner import HolesCleaner
from graph_peak_caller.sparsediffs import SparseValues
import pytest
@pytest.fixture
def complicated_graph():
nodes = {i: obg.Block(2) for i in range(1, 11)}
edges = {1: [2, 3],
2:... | 30.007092 | 76 | 0.519972 | import numpy as np
import offsetbasedgraph as obg
from graph_peak_caller.postprocess.holecleaner import HolesCleaner
from graph_peak_caller.sparsediffs import SparseValues
import pytest
@pytest.fixture
def complicated_graph():
nodes = {i: obg.Block(2) for i in range(1, 11)}
edges = {1: [2, 3],
2:... | true | true |
f73f5c6126f1b5be1fb3de9bd26b43c41f5fa508 | 7,070 | py | Python | utils/test/testapi/opnfv_testapi/resources/result_models.py | hwoarang/releng | fc8cb9f1bc3a37039d19ae7a5a17699d8a36bfb8 | [
"Apache-2.0"
] | null | null | null | utils/test/testapi/opnfv_testapi/resources/result_models.py | hwoarang/releng | fc8cb9f1bc3a37039d19ae7a5a17699d8a36bfb8 | [
"Apache-2.0"
] | null | null | null | utils/test/testapi/opnfv_testapi/resources/result_models.py | hwoarang/releng | fc8cb9f1bc3a37039d19ae7a5a17699d8a36bfb8 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2015 Orange
# guyrodrigue.koffi@orange.com / koffirodrigue@gmail.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompani... | 30.474138 | 78 | 0.557426 | true | true | |
f73f5d12b3bba7a0698f934dba14be122dfaba10 | 1,890 | py | Python | resources/tests/test_equipment_category_api.py | HotStew/respa | 04f39efb15b4f4206a122e665f8377c7198e1f25 | [
"MIT"
] | 49 | 2015-10-21T06:25:31.000Z | 2022-03-20T07:24:20.000Z | resources/tests/test_equipment_category_api.py | HotStew/respa | 04f39efb15b4f4206a122e665f8377c7198e1f25 | [
"MIT"
] | 728 | 2015-06-24T13:26:54.000Z | 2022-03-24T12:18:41.000Z | resources/tests/test_equipment_category_api.py | HotStew/respa | 04f39efb15b4f4206a122e665f8377c7198e1f25 | [
"MIT"
] | 46 | 2015-06-26T10:52:57.000Z | 2021-12-17T09:38:25.000Z | # -*- coding: utf-8 -*-
import pytest
from resources.models import Equipment, ResourceEquipment, EquipmentCategory
from django.urls import reverse
from .utils import check_disallowed_methods, UNSAFE_METHODS
@pytest.fixture
def list_url():
return reverse('equipmentcategory-list')
@pytest.mark.django_db
@pytest.... | 30.983607 | 98 | 0.733862 |
import pytest
from resources.models import Equipment, ResourceEquipment, EquipmentCategory
from django.urls import reverse
from .utils import check_disallowed_methods, UNSAFE_METHODS
@pytest.fixture
def list_url():
return reverse('equipmentcategory-list')
@pytest.mark.django_db
@pytest.fixture
def detail_url(... | true | true |
f73f5d1c451476fa6e123fd435927d70f3eefbc0 | 45,365 | py | Python | tests/models/test_dagrun.py | OSUF/airflow-container-image | a38d57f82e6213c0468a744470a5f4465761a296 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/models/test_dagrun.py | OSUF/airflow-container-image | a38d57f82e6213c0468a744470a5f4465761a296 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2022-03-08T16:17:19.000Z | 2022-03-08T17:22:52.000Z | tests/models/test_dagrun.py | OSUF/airflow-container-image | a38d57f82e6213c0468a744470a5f4465761a296 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# 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... | 38.315034 | 110 | 0.664719 |
import datetime
from typing import Mapping, Optional
from unittest import mock
from unittest.mock import call
import pendulum
import pytest
from sqlalchemy.orm.session import Session
from airflow import settings
from airflow.callbacks.callback_requests import DagCallbackRequest
from airflow.decorato... | true | true |
f73f5d97789598b0255b48ffad3e8579c535098f | 2,608 | py | Python | src/mem/ruby/network/BasicLink.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | 11 | 2015-03-21T13:35:06.000Z | 2022-01-27T07:31:52.000Z | src/mem/ruby/network/BasicLink.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | 4 | 2017-02-14T06:33:15.000Z | 2017-05-09T13:14:15.000Z | src/mem/ruby/network/BasicLink.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | 4 | 2015-03-21T13:35:24.000Z | 2020-06-30T02:09:36.000Z | # Copyright (c) 2011 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... | 47.418182 | 79 | 0.763037 |
from m5.params import *
from m5.SimObject import SimObject
class BasicLink(SimObject):
type = 'BasicLink'
link_id = Param.Int("ID in relation to other links")
latency = Param.Int(1, "latency")
bandwidth_factor = Param.Int("generic bandwidth factor, usual... | true | true |
f73f5eebf1dc263c051ba07a30db11e935b2f1dd | 3,019 | py | Python | practical_test.py | cuhsat/practical | 9ed17a59213b280671678b7d1ab68417c5c46ce6 | [
"Unlicense"
] | 1 | 2022-03-25T22:05:17.000Z | 2022-03-25T22:05:17.000Z | practical_test.py | cuhsat/practical | 9ed17a59213b280671678b7d1ab68417c5c46ce6 | [
"Unlicense"
] | null | null | null | practical_test.py | cuhsat/practical | 9ed17a59213b280671678b7d1ab68417c5c46ce6 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdicti... | 29.891089 | 71 | 0.626698 |
import re
import sys
from practical import Practical
try:
import pytest
except ImportError:
sys.exit("Requires pytest")
class TestPractical:
VECTORS = [
("AAAAAA", "999999", "999999"),
("999999", "999999", "AAAAAA"),
("A9A9A9", "A9A9A9", "AAAAAA"),
("9A9A9A", "9A9A9A",... | true | true |
f73f5f69179fd726ca10cdf4a804c65a2ae91bfc | 809 | py | Python | setup.py | eacharles/chippr | e69960cddafbd0bfbac96d23e0f065ca6db7672f | [
"MIT"
] | 1 | 2020-07-27T18:57:58.000Z | 2020-07-27T18:57:58.000Z | setup.py | eacharles/chippr | e69960cddafbd0bfbac96d23e0f065ca6db7672f | [
"MIT"
] | 56 | 2016-12-24T00:05:31.000Z | 2020-09-22T17:26:58.000Z | setup.py | eacharles/chippr | e69960cddafbd0bfbac96d23e0f065ca6db7672f | [
"MIT"
] | 2 | 2018-10-08T15:30:01.000Z | 2020-09-14T17:25:38.000Z | from setuptools import setup
setup(
name="chippr",
version="0.1",
author="Alex Malz",
author_email="aimalz@nyu.edu",
url = "https://github.com/aimalz/chippr",
packages=["chippr"],
description="Cosmological Hierarchical Inference with Probabilistic Photometric Redshifts",
long_descriptio... | 33.708333 | 95 | 0.639061 | from setuptools import setup
setup(
name="chippr",
version="0.1",
author="Alex Malz",
author_email="aimalz@nyu.edu",
url = "https://github.com/aimalz/chippr",
packages=["chippr"],
description="Cosmological Hierarchical Inference with Probabilistic Photometric Redshifts",
long_descriptio... | true | true |
f73f5fbd1eb0fcbbd7d680d24323c7418ced3d86 | 784 | py | Python | DataConnectors/Digital shadows/DigitalShadowsConnectorAzureFunction/__init__.py | shikhin-metron/Azure-Sentinel | 11093016d8469f0d68464e2f6b7b8103cd00ebc0 | [
"MIT"
] | null | null | null | DataConnectors/Digital shadows/DigitalShadowsConnectorAzureFunction/__init__.py | shikhin-metron/Azure-Sentinel | 11093016d8469f0d68464e2f6b7b8103cd00ebc0 | [
"MIT"
] | null | null | null | DataConnectors/Digital shadows/DigitalShadowsConnectorAzureFunction/__init__.py | shikhin-metron/Azure-Sentinel | 11093016d8469f0d68464e2f6b7b8103cd00ebc0 | [
"MIT"
] | null | null | null | import datetime
import logging
from . import DS_poller
import azure.functions as func
import os
account_id = os.environ['ID']
customer_id = os.environ['WID']
shared_key = os.environ['WKEY']
key = os.environ['KEY']
secret = os.environ['SECRET']
connection_string = os.environ['STORE']
historical_days = 10
url = os.envi... | 27.034483 | 119 | 0.720663 | import datetime
import logging
from . import DS_poller
import azure.functions as func
import os
account_id = os.environ['ID']
customer_id = os.environ['WID']
shared_key = os.environ['WKEY']
key = os.environ['KEY']
secret = os.environ['SECRET']
connection_string = os.environ['STORE']
historical_days = 10
url = os.envi... | true | true |
f73f5fce4dc9dd177f8dd8f84f12083e4bbd039c | 926,994 | py | Python | models_all/color_lab6b_4x20.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 7 | 2019-05-08T19:14:34.000Z | 2021-12-24T00:00:40.000Z | models_all/color_lab6b_4x20.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_all/color_lab6b_4x20.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 2 | 2020-05-21T22:15:51.000Z | 2020-06-02T23:02:08.000Z | # MINLP written by GAMS Convert at 05/15/20 00:50:44
#
# Equation counts
# Total E G L N X C B
# 49 49 0 0 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 115.197465 | 120 | 0.553862 |
from pyomo.environ import *
model = m = ConcreteModel()
m.b2 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b3 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b4 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b5 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b6 = Var(within=Binary,bounds=(0... | true | true |
f73f605d32d188a2353596982a4c8bc46b0e5b4c | 1,126 | bzl | Python | rust/rust_proto_library.bzl | purkhusid/rules_proto_grpc | 943656d049d2932a32d8f882bbb05c024b499020 | [
"Apache-2.0"
] | null | null | null | rust/rust_proto_library.bzl | purkhusid/rules_proto_grpc | 943656d049d2932a32d8f882bbb05c024b499020 | [
"Apache-2.0"
] | null | null | null | rust/rust_proto_library.bzl | purkhusid/rules_proto_grpc | 943656d049d2932a32d8f882bbb05c024b499020 | [
"Apache-2.0"
] | null | null | null | """Generated definition of rust_proto_library."""
load("//rust:rust_proto_compile.bzl", "rust_proto_compile")
load("//internal:compile.bzl", "proto_compile_attrs")
load("//rust:rust_proto_lib.bzl", "rust_proto_lib")
load("@rules_rust//rust:rust.bzl", "rust_library")
def rust_proto_library(name, **kwargs): # buildifi... | 28.15 | 93 | 0.599467 |
load("//rust:rust_proto_compile.bzl", "rust_proto_compile")
load("//internal:compile.bzl", "proto_compile_attrs")
load("//rust:rust_proto_lib.bzl", "rust_proto_lib")
load("@rules_rust//rust:rust.bzl", "rust_library")
def rust_proto_library(name, **kwargs):
name_pb = name + "_pb"
name_lib = name + "_lib... | true | true |
f73f60c422dda0259b0edcf66ccc5a4c699588ab | 2,566 | py | Python | new-instance-prepare.py | compilenix/nextcloud-docker-composer | 77f1cc59ae911fafe0aeb6c8bd91a5d2beab0718 | [
"MIT"
] | null | null | null | new-instance-prepare.py | compilenix/nextcloud-docker-composer | 77f1cc59ae911fafe0aeb6c8bd91a5d2beab0718 | [
"MIT"
] | null | null | null | new-instance-prepare.py | compilenix/nextcloud-docker-composer | 77f1cc59ae911fafe0aeb6c8bd91a5d2beab0718 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import subprocess
import click
from rich import pretty, inspect
from rich.console import Console
# setup Rich
pretty.install()
console = Console()
print = console.print
log = console.log
# setup click
@click.command()
@click.option('--dns-name', prompt='DNS Name', help='DNS name use... | 44.241379 | 237 | 0.692128 |
import os
import subprocess
import click
from rich import pretty, inspect
from rich.console import Console
pretty.install()
console = Console()
print = console.print
log = console.log
@click.command()
@click.option('--dns-name', prompt='DNS Name', help='DNS name used by this Nextcloud instance.')
@click.option('... | true | true |
f73f60dc33ae48a27d08b16b6d6d0fc00917447b | 6,397 | py | Python | augly/video/helpers/ffmpeg.py | Adib234/AugLy | 35a6a5de07e64f465b8979e3257218551929e57a | [
"MIT"
] | null | null | null | augly/video/helpers/ffmpeg.py | Adib234/AugLy | 35a6a5de07e64f465b8979e3257218551929e57a | [
"MIT"
] | null | null | null | augly/video/helpers/ffmpeg.py | Adib234/AugLy | 35a6a5de07e64f465b8979e3257218551929e57a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
import io
import math
import os
import shutil
from typing import Any, Dict, Optional, Union
import augly.audio.utils as audutils
import ffmpeg
import numpy as np
from augly.utils import pathmgr, SILENT_AUDIO_PATH
from augly.utils.ffmpeg import ... | 32.308081 | 85 | 0.659997 |
import io
import math
import os
import shutil
from typing import Any, Dict, Optional, Union
import augly.audio.utils as audutils
import ffmpeg
import numpy as np
from augly.utils import pathmgr, SILENT_AUDIO_PATH
from augly.utils.ffmpeg import FFMPEG_PATH, FFPROBE_PATH
from ffmpeg.nodes import FilterableStream
de... | true | true |
f73f628385893e1f0f6d3ad7d437c6d2c2a37f79 | 583 | py | Python | LeetCode/_0001_0050/_050_Pow.py | BigEggStudy/LeetCode-Py | 735e782742fab15bdb046eb6d5fc7b03502cc92d | [
"MIT"
] | 1 | 2021-01-30T04:07:26.000Z | 2021-01-30T04:07:26.000Z | LeetCode/_0001_0050/_050_Pow.py | BigEggStudy/LeetCode-Py | 735e782742fab15bdb046eb6d5fc7b03502cc92d | [
"MIT"
] | null | null | null | LeetCode/_0001_0050/_050_Pow.py | BigEggStudy/LeetCode-Py | 735e782742fab15bdb046eb6d5fc7b03502cc92d | [
"MIT"
] | 1 | 2021-09-09T20:12:25.000Z | 2021-09-09T20:12:25.000Z | #-----------------------------------------------------------------------------
# Runtime: 32ms
# Memory Usage:
# Link:
#-----------------------------------------------------------------------------
class Solution:
def myPow(self, x: float, n: int) -> float:
if x == 0 or n == 1:
return x
... | 22.423077 | 78 | 0.253859 |
class Solution:
def myPow(self, x: float, n: int) -> float:
if x == 0 or n == 1:
return x
if n == 0:
return 1
if n < 0:
n = -n
x = 1 / x
result = 1.0
while n > 0:
if n & 0x1 == 1:
result *= x
... | true | true |
f73f631d1f1f6d93432603126ac521e611996a65 | 428 | py | Python | ExerciciosSequenciais/2num_int_1_real.py | athavus/ListaExerciciosPythonBrasil | be5e1b3d442c1b790908089cf93bdf71172a5b90 | [
"MIT"
] | 1 | 2020-11-12T14:03:30.000Z | 2020-11-12T14:03:30.000Z | ExerciciosSequenciais/2num_int_1_real.py | athavus/ListaExerciciosPythonBrasil | be5e1b3d442c1b790908089cf93bdf71172a5b90 | [
"MIT"
] | null | null | null | ExerciciosSequenciais/2num_int_1_real.py | athavus/ListaExerciciosPythonBrasil | be5e1b3d442c1b790908089cf93bdf71172a5b90 | [
"MIT"
] | null | null | null | a = int(input('Digite um número inteiro: '))
b = int(input('Digite um outro número inteiro: '))
c = float(input('Digite um número real: '))
la = (a * 2) * (b / 2)
lb = (a * 3) + c
lc = c ** 3
print(f'O produto do dobro do primeiro número com metade do segundo número é igual a {la}')
print(f'A soma do triplo do p... | 42.8 | 92 | 0.649533 | a = int(input('Digite um número inteiro: '))
b = int(input('Digite um outro número inteiro: '))
c = float(input('Digite um número real: '))
la = (a * 2) * (b / 2)
lb = (a * 3) + c
lc = c ** 3
print(f'O produto do dobro do primeiro número com metade do segundo número é igual a {la}')
print(f'A soma do triplo do p... | true | true |
f73f642899ee9cf270cb72783152d247d1e5bd54 | 6,708 | py | Python | mars/lib/sparse/matrix.py | ueshin/mars | 0b542974243be4e0ff239eaf49ab0fb2935f3361 | [
"Apache-2.0"
] | 1 | 2020-06-25T13:51:16.000Z | 2020-06-25T13:51:16.000Z | mars/lib/sparse/matrix.py | ueshin/mars | 0b542974243be4e0ff239eaf49ab0fb2935f3361 | [
"Apache-2.0"
] | null | null | null | mars/lib/sparse/matrix.py | ueshin/mars | 0b542974243be4e0ff239eaf49ab0fb2935f3361 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding 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-... | 32.563107 | 107 | 0.593769 |
import numpy as np
from collections.abc import Iterable
from .core import issparse, get_array_module, cp, cps, \
get_sparse_module, naked, sps, splinalg
from .array import SparseNDArray, SparseArray
def zeros_sparse_matrix(shape, dtype=float, gpu=False):
m = sps if not gpu else cps
return... | true | true |
f73f643232346bf4d7f347b10e7db0e2a395ed33 | 3,447 | py | Python | magnumclient/v1/certificates_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 29 | 2015-04-17T12:06:04.000Z | 2019-05-03T06:27:17.000Z | magnumclient/v1/certificates_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 2 | 2016-01-19T14:45:58.000Z | 2016-11-17T16:30:18.000Z | magnumclient/v1/certificates_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 26 | 2015-08-17T19:28:56.000Z | 2020-07-10T08:12:07.000Z | # Copyright 2015 NEC 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 License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 30.776786 | 79 | 0.637076 |
import os.path
from magnumclient.common import cliutils as utils
from magnumclient.i18n import _
DEPRECATION_MESSAGE = (
'WARNING: The bay parameter is deprecated and will be removed in a future '
'release.\nUse the cluster parameter to avoid seeing this message.')
def _show_cert(certificate)... | true | true |
f73f643ec9257c51cb069aa0c20290d85193c158 | 2,401 | py | Python | src/tracks/migrations/0001_initial.py | MAE776569/project-manager | 986a1a8b84950da81e98125d70ae3ef380e96e54 | [
"Apache-2.0"
] | null | null | null | src/tracks/migrations/0001_initial.py | MAE776569/project-manager | 986a1a8b84950da81e98125d70ae3ef380e96e54 | [
"Apache-2.0"
] | 7 | 2020-03-24T17:08:34.000Z | 2022-02-10T09:50:00.000Z | src/tracks/migrations/0001_initial.py | MAE776569/project-manager | 986a1a8b84950da81e98125d70ae3ef380e96e54 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.7 on 2018-07-20 17:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 39.360656 | 114 | 0.596418 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f73f64632f58e69ea9de482f9e7ac3fbb73685bb | 588 | py | Python | kanban/api/migrations/0003_user.py | richardpanda/kanban | 36b3712d59382c26deb4127d9730863755f0a530 | [
"MIT"
] | null | null | null | kanban/api/migrations/0003_user.py | richardpanda/kanban | 36b3712d59382c26deb4127d9730863755f0a530 | [
"MIT"
] | null | null | null | kanban/api/migrations/0003_user.py | richardpanda/kanban | 36b3712d59382c26deb4127d9730863755f0a530 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-22 04:21
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('api', '0002_delete_user'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
... | 24.5 | 114 | 0.569728 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('api', '0002_delete_user'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=... | true | true |
f73f6492783c31a22b8892988474cba021fc91a8 | 2,839 | py | Python | model/dropout.py | iwangjian/ByteCup2018 | c59c6a495f81c493eaaf7fda710c8acd7ef148b9 | [
"MIT"
] | 80 | 2018-09-08T01:11:36.000Z | 2022-01-18T13:41:30.000Z | model/dropout.py | Whoolly/ByteCup2018 | 348bdee3215c146ef7d6e4fe1fecbe4598798c8a | [
"MIT"
] | 3 | 2018-12-02T15:08:05.000Z | 2020-02-10T04:11:28.000Z | model/dropout.py | Whoolly/ByteCup2018 | 348bdee3215c146ef7d6e4fe1fecbe4598798c8a | [
"MIT"
] | 21 | 2018-10-27T07:40:25.000Z | 2022-03-28T12:30:01.000Z | import torch
import torch.nn as nn
from torch.autograd import Variable
class LockedDropout(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, dropout=0.5, seq_lens=None):
if not self.training or not dropout:
return x
if seq_lens == None:
m ... | 38.890411 | 92 | 0.606904 | import torch
import torch.nn as nn
from torch.autograd import Variable
class LockedDropout(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x, dropout=0.5, seq_lens=None):
if not self.training or not dropout:
return x
if seq_lens == None:
m ... | true | true |
f73f64f7fe4d61b43db8d8445a55c9c16b1ecb4e | 5,357 | py | Python | ecr-basic-scan/automate-manual-scan.py | yzhanggithub/aws-fast-fixes | 45a65067af6acc815576f9012014dea08b76f52a | [
"Apache-2.0"
] | null | null | null | ecr-basic-scan/automate-manual-scan.py | yzhanggithub/aws-fast-fixes | 45a65067af6acc815576f9012014dea08b76f52a | [
"Apache-2.0"
] | null | null | null | ecr-basic-scan/automate-manual-scan.py | yzhanggithub/aws-fast-fixes | 45a65067af6acc815576f9012014dea08b76f52a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import boto3
from botocore.exceptions import ClientError
import os
import logging
import time
from datetime import datetime as dt, timedelta, time
import json
# Assume basic scan setting has been set up in the private registry, otherwise the script throws error
# Trigger manual scan for all im... | 32.271084 | 119 | 0.606683 |
import boto3
from botocore.exceptions import ClientError
import os
import logging
import time
from datetime import datetime as dt, timedelta, time
import json
def start_image_scan(client, registry_id, repo_name, image_digest):
try:
response = client.start_image_scan(
registryId=registry_id... | true | true |
f73f669326d2c6c4677a1d5e8ee19ed7cc991ac9 | 2,970 | py | Python | homeassistant/components/broadlink/sensor.py | Andrew55529/core | c440a30aff0d8f573d8aa0d949068702dd36c386 | [
"Apache-2.0"
] | 1 | 2021-07-31T21:08:49.000Z | 2021-07-31T21:08:49.000Z | homeassistant/components/broadlink/sensor.py | flexy2dd/core | 1019ee22ff13e5f542e868179d791e6a0d87369a | [
"Apache-2.0"
] | 70 | 2020-07-16T02:07:46.000Z | 2022-03-31T06:01:48.000Z | homeassistant/components/broadlink/sensor.py | flexy2dd/core | 1019ee22ff13e5f542e868179d791e6a0d87369a | [
"Apache-2.0"
] | 1 | 2020-03-09T19:15:38.000Z | 2020-03-09T19:15:38.000Z | """Support for Broadlink sensors."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassis... | 31.263158 | 86 | 0.709091 | import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.const import CONF_HOST, PERCENTA... | true | true |
f73f670bd2472ad5d0d9e8212557060ea0bbff97 | 1,966 | py | Python | homura/utils/environment.py | Xiangyu-Han/homura | c366ca70b4b65f6a4809bf76926bbd926320262e | [
"Apache-2.0"
] | 1 | 2021-01-12T08:35:44.000Z | 2021-01-12T08:35:44.000Z | homura/utils/environment.py | Xiangyu-Han/homura | c366ca70b4b65f6a4809bf76926bbd926320262e | [
"Apache-2.0"
] | null | null | null | homura/utils/environment.py | Xiangyu-Han/homura | c366ca70b4b65f6a4809bf76926bbd926320262e | [
"Apache-2.0"
] | null | null | null | """ Helper functions to get information about the environment.
"""
import importlib.util
import os as python_os
import subprocess
import sys as python_sys
from typing import Any, Optional
from homura.liblog import get_logger
logger = get_logger("homura.environment")
# Utility functions that useful libraries are av... | 27.305556 | 94 | 0.657172 |
import importlib.util
import os as python_os
import subprocess
import sys as python_sys
from typing import Any, Optional
from homura.liblog import get_logger
logger = get_logger("homura.environment")
def is_accimage_available() -> bool:
return importlib.util.find_spec("accimage") is not None
def enable_acci... | true | true |
f73f6764bc553a59d9a938daa376f4cffe16d077 | 362 | py | Python | src/codechef/cook131/c/sol_0.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 1 | 2021-07-11T03:20:10.000Z | 2021-07-11T03:20:10.000Z | src/codechef/cook131/c/sol_0.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | 39 | 2021-07-10T05:21:09.000Z | 2021-12-15T06:10:12.000Z | src/codechef/cook131/c/sol_0.py | kagemeka/competitive-programming | c70fe481bcd518f507b885fc9234691d8ce63171 | [
"MIT"
] | null | null | null | import typing
from collections import (
Counter,
)
def solve(
a: typing.List[int],
) -> typing.NoReturn:
c = Counter(a)
s = 0
for k, v in c.items():
s += min(v, k - 1)
print(s)
def main() -> typing.NoReturn:
t = int(input())
for _ in range(t):
n = int(input())
*a, = map(
int, in... | 13.407407 | 30 | 0.527624 | import typing
from collections import (
Counter,
)
def solve(
a: typing.List[int],
) -> typing.NoReturn:
c = Counter(a)
s = 0
for k, v in c.items():
s += min(v, k - 1)
print(s)
def main() -> typing.NoReturn:
t = int(input())
for _ in range(t):
n = int(input())
*a, = map(
int, in... | true | true |
f73f676d14dd06ebf66110f6c74686a23f449d18 | 7,940 | py | Python | python/ccxt/southxchange.py | destenson/ccxt--ccxt | 3928a058cb1ecf00d11309c7812a0fcdb502080a | [
"MIT"
] | null | null | null | python/ccxt/southxchange.py | destenson/ccxt--ccxt | 3928a058cb1ecf00d11309c7812a0fcdb502080a | [
"MIT"
] | null | null | null | python/ccxt/southxchange.py | destenson/ccxt--ccxt | 3928a058cb1ecf00d11309c7812a0fcdb502080a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
class southxchange (Exchange):
def describe(self):
return self.deep_extend(super(southxchange, self).describe(), {
'id': 'southxchange',
'name': 'SouthXchange... | 34.372294 | 126 | 0.486524 |
from ccxt.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
class southxchange (Exchange):
def describe(self):
return self.deep_extend(super(southxchange, self).describe(), {
'id': 'southxchange',
'name': 'SouthXchange',
'countri... | true | true |
f73f686cfdeef5455d64abf170ee61901064e8e1 | 40 | py | Python | masonite/contrib/azure/providers/__init__.py | josephmancuso/masonite-azure-driver | 06e766f9833b48d28a6ffd4afb24114be1a60a1c | [
"MIT"
] | null | null | null | masonite/contrib/azure/providers/__init__.py | josephmancuso/masonite-azure-driver | 06e766f9833b48d28a6ffd4afb24114be1a60a1c | [
"MIT"
] | null | null | null | masonite/contrib/azure/providers/__init__.py | josephmancuso/masonite-azure-driver | 06e766f9833b48d28a6ffd4afb24114be1a60a1c | [
"MIT"
] | 1 | 2019-08-07T16:53:09.000Z | 2019-08-07T16:53:09.000Z | from .AzureProvider import AzureProvider | 40 | 40 | 0.9 | from .AzureProvider import AzureProvider | true | true |
f73f6874be14c10a9cb804c46840cbe949966200 | 51,670 | py | Python | utils/build_swift/build_swift/driver_arguments.py | QuantumAa/swift | 5f0cccabc086fdc7cebbcdd6eca2cbfd717b60a2 | [
"Apache-2.0"
] | 1 | 2020-02-23T20:10:11.000Z | 2020-02-23T20:10:11.000Z | utils/build_swift/build_swift/driver_arguments.py | QuantumAa/swift | 5f0cccabc086fdc7cebbcdd6eca2cbfd717b60a2 | [
"Apache-2.0"
] | null | null | null | utils/build_swift/build_swift/driver_arguments.py | QuantumAa/swift | 5f0cccabc086fdc7cebbcdd6eca2cbfd717b60a2 | [
"Apache-2.0"
] | null | null | null | # This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list o... | 40.272798 | 80 | 0.62516 |
from __future__ import absolute_import, unicode_literals
import multiprocessing
import os
import android.adb.commands
from swift_build_support.swift_build_support import targets
from swift_build_support.swift_build_support.targets import \
StdlibDeploymentTarget
from . import argparse
from . import def... | true | true |
f73f68951cd0f39bf1c6476c15f8f217af6f9d0b | 5,501 | py | Python | segmentation_models/backbones/backbones_factory.py | duraes-antonio/segmentation_models | 34eca67e6e81820a677b70baaa9b2f3003e7c9e2 | [
"MIT"
] | null | null | null | segmentation_models/backbones/backbones_factory.py | duraes-antonio/segmentation_models | 34eca67e6e81820a677b70baaa9b2f3003e7c9e2 | [
"MIT"
] | null | null | null | segmentation_models/backbones/backbones_factory.py | duraes-antonio/segmentation_models | 34eca67e6e81820a677b70baaa9b2f3003e7c9e2 | [
"MIT"
] | null | null | null | import copy
import efficientnet.model as eff
import keras_applications as ka
from classification_models.models_factory import ModelsFactory
from . import inception_resnet_v2 as irv2
from . import inception_v3 as iv3
from . import vgg19
class BackbonesFactory(ModelsFactory):
_default_feature_layers = {
# ... | 47.017094 | 103 | 0.653518 | import copy
import efficientnet.model as eff
import keras_applications as ka
from classification_models.models_factory import ModelsFactory
from . import inception_resnet_v2 as irv2
from . import inception_v3 as iv3
from . import vgg19
class BackbonesFactory(ModelsFactory):
_default_feature_layers = {
... | true | true |
f73f68a88f2c84252f1dacb4d6edc732714315be | 5,107 | py | Python | pilot/models/alex_net_v4.py | kkelchte/pilot | e3c3b753351efac30323af57465abe360973653a | [
"Apache-2.0"
] | null | null | null | pilot/models/alex_net_v4.py | kkelchte/pilot | e3c3b753351efac30323af57465abe360973653a | [
"Apache-2.0"
] | null | null | null | pilot/models/alex_net_v4.py | kkelchte/pilot | e3c3b753351efac30323af57465abe360973653a | [
"Apache-2.0"
] | 1 | 2020-06-18T14:26:49.000Z | 2020-06-18T14:26:49.000Z | """
Version of Alexnet with smaller input size and less weights
"""
import tensorflow as tf
import numpy as np
# input downscaled to 128x128x1
def alexnet(inputs,
num_outputs=1,
dropout_rate=0,
reuse=None,
is_training=False,
verbose=False):
"""A basic al... | 49.105769 | 256 | 0.699236 |
import tensorflow as tf
import numpy as np
def alexnet(inputs,
num_outputs=1,
dropout_rate=0,
reuse=None,
is_training=False,
verbose=False):
end_points={}
end_point = 'conv_1'
l1 = tf.layers.conv2d(inputs, 32, kernel_size=[11,11], stri... | true | true |
f73f68ad7edb9561d329e50e8c00f17509d164ea | 2,339 | py | Python | readthedocs/projects/exceptions.py | yarons/readthedocs.org | 05c99a0adc222a1d48654d305b492ec142c3026b | [
"MIT"
] | 4,054 | 2015-01-01T00:58:07.000Z | 2019-06-28T05:50:49.000Z | readthedocs/projects/exceptions.py | yarons/readthedocs.org | 05c99a0adc222a1d48654d305b492ec142c3026b | [
"MIT"
] | 4,282 | 2015-01-01T21:38:49.000Z | 2019-06-28T15:41:00.000Z | readthedocs/projects/exceptions.py | yarons/readthedocs.org | 05c99a0adc222a1d48654d305b492ec142c3026b | [
"MIT"
] | 3,224 | 2015-01-01T07:38:45.000Z | 2019-06-28T09:19:10.000Z |
"""Project exceptions."""
from django.conf import settings
from django.utils.translation import gettext_noop as _
from readthedocs.doc_builder.exceptions import BuildAppError, BuildUserError
class ProjectConfigurationError(BuildUserError):
"""Error raised trying to configure a project for build."""
NOT_F... | 32.486111 | 84 | 0.684908 |
from django.conf import settings
from django.utils.translation import gettext_noop as _
from readthedocs.doc_builder.exceptions import BuildAppError, BuildUserError
class ProjectConfigurationError(BuildUserError):
NOT_FOUND = _(
'A configuration file was not found. '
'Make sure you have a con... | true | true |
f73f69fccd1812ab42ab4a8817f2c6bebf5c6433 | 5,539 | py | Python | IMLearn/learners/classifiers/decision_stump.py | goldnimrod/IML.HUJI | 4fe39f597e1fc9eb188ca12daa2b3111bae92ee9 | [
"MIT"
] | null | null | null | IMLearn/learners/classifiers/decision_stump.py | goldnimrod/IML.HUJI | 4fe39f597e1fc9eb188ca12daa2b3111bae92ee9 | [
"MIT"
] | null | null | null | IMLearn/learners/classifiers/decision_stump.py | goldnimrod/IML.HUJI | 4fe39f597e1fc9eb188ca12daa2b3111bae92ee9 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Tuple, NoReturn
from ...base import BaseEstimator
import numpy as np
from ...metrics import misclassification_error
from itertools import product
class DecisionStump(BaseEstimator):
"""
A decision stump classifier for {-1,1} labels according to the CART al... | 33.569697 | 107 | 0.555335 | from __future__ import annotations
from typing import Tuple, NoReturn
from ...base import BaseEstimator
import numpy as np
from ...metrics import misclassification_error
from itertools import product
class DecisionStump(BaseEstimator):
def __init__(self) -> DecisionStump:
super().__init__()
self.... | true | true |
f73f6a1d2af6780fe74bab82ba77c1b7cd5dee66 | 1,345 | py | Python | xgboost_model.py | dataubc/number_-of_clicks_prediction | 738c2e15dc627b247ad5692ab80d3713fe5c8f3e | [
"Apache-2.0"
] | null | null | null | xgboost_model.py | dataubc/number_-of_clicks_prediction | 738c2e15dc627b247ad5692ab80d3713fe5c8f3e | [
"Apache-2.0"
] | null | null | null | xgboost_model.py | dataubc/number_-of_clicks_prediction | 738c2e15dc627b247ad5692ab80d3713fe5c8f3e | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
import xgboost
# reading data
hotel_data = pd.read_csv('cleaned_train.csv')
X = hotel_data.drop(columns=['n_clicks', 'hotel_id'])
# let's also add the new feature avg_saving_cash
X['avg_saving_cash'] = X['avg_price'] * X['avg_saving_percent']
y = hotel_data['n_clicks']
# let's c... | 32.804878 | 100 | 0.737546 | import pandas as pd
import numpy as np
import xgboost
hotel_data = pd.read_csv('cleaned_train.csv')
X = hotel_data.drop(columns=['n_clicks', 'hotel_id'])
X['avg_saving_cash'] = X['avg_price'] * X['avg_saving_percent']
y = hotel_data['n_clicks']
# let's create trained data for xgboost
dtrain = xgboost.DMatrix(X, lab... | true | true |
f73f6a53225fd819a45c7a98f3568630d7251524 | 3,345 | py | Python | graphene/relay/node.py | dialoguemd/graphene | ceffc4de691509968f200065642731fcc4acd217 | [
"MIT"
] | null | null | null | graphene/relay/node.py | dialoguemd/graphene | ceffc4de691509968f200065642731fcc4acd217 | [
"MIT"
] | null | null | null | graphene/relay/node.py | dialoguemd/graphene | ceffc4de691509968f200065642731fcc4acd217 | [
"MIT"
] | null | null | null | from functools import partial
import six
from graphql_relay import from_global_id, to_global_id
from ..types import ID, Field, Interface, ObjectType
from ..types.interface import InterfaceMeta
def is_node(objecttype):
'''
Check if the given objecttype has Node as an interface
'''
assert issubclass(... | 30.135135 | 98 | 0.6571 | from functools import partial
import six
from graphql_relay import from_global_id, to_global_id
from ..types import ID, Field, Interface, ObjectType
from ..types.interface import InterfaceMeta
def is_node(objecttype):
assert issubclass(objecttype, ObjectType), (
'Only ObjectTypes can have a Node interf... | true | true |
f73f6ae74b6ec8340a4f952ede0cecf56120c69f | 1,605 | py | Python | tools/check_md5.py | uranusjr/pythonup-windows | af25844af1c5fdc8a90ae95435c8ce322e5e41e5 | [
"0BSD"
] | 22 | 2018-01-18T21:03:26.000Z | 2021-06-29T00:19:44.000Z | tools/check_md5.py | uranusjr/pythonup-windows | af25844af1c5fdc8a90ae95435c8ce322e5e41e5 | [
"0BSD"
] | 22 | 2018-02-22T17:08:50.000Z | 2021-11-07T09:20:18.000Z | tools/check_md5.py | uranusjr/pythonup-windows | af25844af1c5fdc8a90ae95435c8ce322e5e41e5 | [
"0BSD"
] | 2 | 2018-01-18T21:03:30.000Z | 2021-01-18T05:14:18.000Z | """Quick way to verify I provided matching download URL and MD5.
"""
import hashlib
import json
import pathlib
import sys
import requests
def download_data(url):
print('Downloading', url, '... ', end='', flush=True)
response = requests.get(url)
response.raise_for_status()
print('Done')
return re... | 24.318182 | 79 | 0.611838 |
import hashlib
import json
import pathlib
import sys
import requests
def download_data(url):
print('Downloading', url, '... ', end='', flush=True)
response = requests.get(url)
response.raise_for_status()
print('Done')
return response.content
def check_download(url, version_info, md5sum):
p... | true | true |
f73f6af5de7d4b249fe215d8a41dbbf0409ff50c | 1,341 | py | Python | core/results/results.py | shreyagupta30/vineperf | d5c0a03054f720da2a5ff9eba74feee57fb0296d | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2017-05-18T03:25:39.000Z | 2021-04-30T18:35:32.000Z | core/results/results.py | shreyagupta30/vineperf | d5c0a03054f720da2a5ff9eba74feee57fb0296d | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-11-26T09:29:12.000Z | 2021-03-19T22:59:35.000Z | core/results/results.py | shreyagupta30/vineperf | d5c0a03054f720da2a5ff9eba74feee57fb0296d | [
"ECL-2.0",
"Apache-2.0"
] | 16 | 2016-12-09T12:47:04.000Z | 2021-05-20T09:28:37.000Z | # Copyright 2015 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 36.243243 | 74 | 0.661447 |
class IResults(object):
def print_results(self):
raise NotImplementedError("This class does not implement the" \
" \"print_results\" function.")
def get_results(self):
raise NotImplementedError("This class does not implement the" \
... | true | true |
f73f6afe014fd10d5105b7e7f7828284bf17cecb | 5,547 | py | Python | promptsource/seqio_tasks/tasks.py | arunraja-hub/promptsource | b1d454051056ef318bfe2e6b17fe2d58ad6d90f9 | [
"Apache-2.0"
] | null | null | null | promptsource/seqio_tasks/tasks.py | arunraja-hub/promptsource | b1d454051056ef318bfe2e6b17fe2d58ad6d90f9 | [
"Apache-2.0"
] | null | null | null | promptsource/seqio_tasks/tasks.py | arunraja-hub/promptsource | b1d454051056ef318bfe2e6b17fe2d58ad6d90f9 | [
"Apache-2.0"
] | null | null | null | import functools
import datasets
import seqio
import t5
import tensorflow as tf
import promptsource.templates
from . import load_annotated_prompts, utils
# Tasks deemed as clean/useful
annotated_tasks = load_annotated_prompts.load_annotated_prompts()
CLEAN_TASKS = [t["dataset_subset_template"] for t in annotated_t... | 36.019481 | 105 | 0.706147 | import functools
import datasets
import seqio
import t5
import tensorflow as tf
import promptsource.templates
from . import load_annotated_prompts, utils
annotated_tasks = load_annotated_prompts.load_annotated_prompts()
CLEAN_TASKS = [t["dataset_subset_template"] for t in annotated_tasks if not t["skip_train"]]
C... | true | true |
f73f6b26cc1616785645291857ff1255cfd708b5 | 486 | py | Python | tests/test_cli.py | fkshom/filtergenerator | e3932c6bda038e05b84d1f0acb04408adaf2e494 | [
"MIT"
] | null | null | null | tests/test_cli.py | fkshom/filtergenerator | e3932c6bda038e05b84d1f0acb04408adaf2e494 | [
"MIT"
] | null | null | null | tests/test_cli.py | fkshom/filtergenerator | e3932c6bda038e05b84d1f0acb04408adaf2e494 | [
"MIT"
] | null | null | null | import pytest
from assertpy import assert_that, fail
import yaml
import logging
import filtergenerator.cli as cli
import io
import textwrap
import tempfile
import subprocess
import os
import sys
from pprint import pprint as pp
class Test_gen():
def test_stdoutに出力される(self, capfd):
definitionfile = "sample.y... | 23.142857 | 49 | 0.72428 | import pytest
from assertpy import assert_that, fail
import yaml
import logging
import filtergenerator.cli as cli
import io
import textwrap
import tempfile
import subprocess
import os
import sys
from pprint import pprint as pp
class Test_gen():
def test_stdoutに出力される(self, capfd):
definitionfile = "sample.y... | true | true |
f73f6b70adab1d24a57a3a0d3e47d7e331a432d3 | 11,942 | py | Python | ue4docker/build.py | e1d1s1/ue4-docker | 3d19ab811b340b14027723942155ffe076893005 | [
"MIT"
] | null | null | null | ue4docker/build.py | e1d1s1/ue4-docker | 3d19ab811b340b14027723942155ffe076893005 | [
"MIT"
] | null | null | null | ue4docker/build.py | e1d1s1/ue4-docker | 3d19ab811b340b14027723942155ffe076893005 | [
"MIT"
] | null | null | null | import argparse, getpass, humanfriendly, os, shutil, sys, tempfile, time
from .infrastructure import *
from os.path import join
def _getCredential(args, name, envVar, promptFunc):
# Check if the credential was specified via the command-line
if getattr(args, name, None) is not None:
print('Using {} specified via ... | 47.388889 | 143 | 0.725423 | import argparse, getpass, humanfriendly, os, shutil, sys, tempfile, time
from .infrastructure import *
from os.path import join
def _getCredential(args, name, envVar, promptFunc):
if getattr(args, name, None) is not None:
print('Using {} specified via `-{}` command-line argument.'.format(name, name))
return g... | true | true |
f73f6bdad816866698469a14f55b05de0f730f60 | 41,542 | py | Python | tests/unit/gapic/compute_v1/test_zone_operations.py | igor-solomatov/python-compute | 16e7294cd536af9a8bf8e4e99219a883339aa955 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/compute_v1/test_zone_operations.py | igor-solomatov/python-compute | 16e7294cd536af9a8bf8e4e99219a883339aa955 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/compute_v1/test_zone_operations.py | igor-solomatov/python-compute | 16e7294cd536af9a8bf8e4e99219a883339aa955 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.146924 | 116 | 0.694213 |
import os
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from requests import Response
from requests.sessions import Session
from google import auth
from google.api_core import client_options
from g... | true | true |
f73f6cb1402e5bd7aa8dab6a45c6c696988978b2 | 19,886 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/aio/operations/_routes_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.918072 | 210 | 0.662728 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f73f6d3bf17cca6dc52756b61d166c3225f1b7e1 | 1,272 | py | Python | import_faces.py | vignettist/image-import | 7fd8860e3f5cd1011d98d5a2137327e304cbd884 | [
"MIT"
] | null | null | null | import_faces.py | vignettist/image-import | 7fd8860e3f5cd1011d98d5a2137327e304cbd884 | [
"MIT"
] | null | null | null | import_faces.py | vignettist/image-import | 7fd8860e3f5cd1011d98d5a2137327e304cbd884 | [
"MIT"
] | null | null | null | import openface
import cv2
class FaceFinder:
def __init__(self):
self.align = openface.AlignDlib("models/dlib/shape_predictor_68_face_landmarks.dat")
self.net = openface.TorchNeuralNet("models/openface/nn4.small2.v1.t7", 96)
def getFaces(self, imgPath):
bgrImg = cv2.imread(imgPath)
... | 35.333333 | 93 | 0.555031 | import openface
import cv2
class FaceFinder:
def __init__(self):
self.align = openface.AlignDlib("models/dlib/shape_predictor_68_face_landmarks.dat")
self.net = openface.TorchNeuralNet("models/openface/nn4.small2.v1.t7", 96)
def getFaces(self, imgPath):
bgrImg = cv2.imread(imgPath)
... | true | true |
f73f6dc58cb15585bd41bdfa5524a94ecefcd869 | 63 | py | Python | .history/ClassFiles/DatesTimeCalenders/Calenders_20210109133401.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DatesTimeCalenders/Calenders_20210109133401.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DatesTimeCalenders/Calenders_20210109133401.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | """ Working with calendars
The calender
"""
| 9 | 42 | 0.492063 | true | true | |
f73f6f7c89f650db4d51ae56262358fe0d17ad45 | 3,361 | py | Python | certbot-dns-dnsimple/setup.py | BigMichi1/certbot | f0b32783f01d8e37ce9f68a24af93e003bf30933 | [
"Apache-2.0"
] | null | null | null | certbot-dns-dnsimple/setup.py | BigMichi1/certbot | f0b32783f01d8e37ce9f68a24af93e003bf30933 | [
"Apache-2.0"
] | null | null | null | certbot-dns-dnsimple/setup.py | BigMichi1/certbot | f0b32783f01d8e37ce9f68a24af93e003bf30933 | [
"Apache-2.0"
] | null | null | null | from distutils.version import LooseVersion
import os
import sys
from setuptools import __version__ as setuptools_version
from setuptools import find_packages
from setuptools import setup
version = '1.12.0.dev0'
# Remember to update local-oldest-requirements.txt when changing the minimum
# acme/certbot version.
insta... | 35.010417 | 97 | 0.676287 | from distutils.version import LooseVersion
import os
import sys
from setuptools import __version__ as setuptools_version
from setuptools import find_packages
from setuptools import setup
version = '1.12.0.dev0'
install_requires = [
'setuptools>=39.0.1',
'zope.interface',
]
if not os.environ.get('SNAP_BUIL... | true | true |
f73f6ff466d60a813616bcfe9409b1cd6daa0902 | 716 | py | Python | problems/test_0657.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0657.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0657.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import unittest
class Solution:
def judgeCircle(self, moves):
"""
:type moves: str
:rtype: bool
"""
lr = ud = 0
for move in moves:
if move == 'L':
lr += 1
elif move == 'R':
lr -= 1
elif move == 'U':... | 20.457143 | 46 | 0.456704 | import unittest
class Solution:
def judgeCircle(self, moves):
lr = ud = 0
for move in moves:
if move == 'L':
lr += 1
elif move == 'R':
lr -= 1
elif move == 'U':
ud += 1
else:
ud -= 1
... | true | true |
f73f703b0a0589395371ed8ec77e9a60c1cd6c9e | 11,746 | py | Python | config/settings/base.py | rzr911/django-bulk-saving-demo | e647ee665617f862a508b228716d8753994ac9de | [
"MIT"
] | null | null | null | config/settings/base.py | rzr911/django-bulk-saving-demo | e647ee665617f862a508b228716d8753994ac9de | [
"MIT"
] | null | null | null | config/settings/base.py | rzr911/django-bulk-saving-demo | e647ee665617f862a508b228716d8753994ac9de | [
"MIT"
] | null | null | null | """
Base settings to build other settings files upon.
"""
from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# django_bulk_saving_benchmark/
APPS_DIR = ROOT_DIR / "django_bulk_saving_benchmark"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_... | 40.926829 | 93 | 0.636387 | from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
APPS_DIR = ROOT_DIR / "django_bulk_saving_benchmark"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
if READ_DOT_ENV_FILE:
env.read_env(str(ROOT_DIR / ".en... | true | true |
f73f70c17ccf9655f91ec0a7e2c64164a38bee6d | 726 | py | Python | shan.py | qingyibaimao/- | 6f88b590b92b610ba997b377679386d0d07a6dd2 | [
"MIT"
] | null | null | null | shan.py | qingyibaimao/- | 6f88b590b92b610ba997b377679386d0d07a6dd2 | [
"MIT"
] | null | null | null | shan.py | qingyibaimao/- | 6f88b590b92b610ba997b377679386d0d07a6dd2 | [
"MIT"
] | null | null | null | import os
filePath2 = r'D:/downloads/cungudafa-keras-yolo3-master/keras-yolo3/dataset/phonts'
filePath1 = r'D:/downloads/cungudafa-keras-yolo3-master/keras-yolo3/dataset/Annotations'
list1 = os.listdir(filePath1)
file_list1 = [] #annotations中的文件名列表 不带后缀
for i in list1:
file_list1.append(os.path.splitext(i... | 33 | 89 | 0.730028 | import os
filePath2 = r'D:/downloads/cungudafa-keras-yolo3-master/keras-yolo3/dataset/phonts'
filePath1 = r'D:/downloads/cungudafa-keras-yolo3-master/keras-yolo3/dataset/Annotations'
list1 = os.listdir(filePath1)
file_list1 = []
for i in list1:
file_list1.append(os.path.splitext(i)[0])
list2 = os.list... | true | true |
f73f70d29b42ea5e1b94be69411dabe4dfbae519 | 3,162 | py | Python | tests/awsparameterstore_loader_test.py | jjmckain/secretbox | f3e5118c697bef99b4098fcc4a796304bf79a00f | [
"MIT"
] | null | null | null | tests/awsparameterstore_loader_test.py | jjmckain/secretbox | f3e5118c697bef99b4098fcc4a796304bf79a00f | [
"MIT"
] | null | null | null | tests/awsparameterstore_loader_test.py | jjmckain/secretbox | f3e5118c697bef99b4098fcc4a796304bf79a00f | [
"MIT"
] | null | null | null | """Unit tests for aws parameter store interactions"""
import importlib
import sys
from typing import Generator
from unittest.mock import patch
import pytest
from secretbox import awsparameterstore_loader as ssm_loader_module
from secretbox.awsparameterstore_loader import AWSParameterStore
from tests.conftest import T... | 34.747253 | 85 | 0.734662 | import importlib
import sys
from typing import Generator
from unittest.mock import patch
import pytest
from secretbox import awsparameterstore_loader as ssm_loader_module
from secretbox.awsparameterstore_loader import AWSParameterStore
from tests.conftest import TEST_LIST
from tests.conftest import TEST_PATH
from tes... | true | true |
f73f70d35c40cefea09528fe9ea7413df46c069d | 4,362 | py | Python | neighbour/settings.py | kamransumar/neighbourhood_watch | 79917e4143143b95c5364bcb7f72eb073eab66d3 | [
"Unlicense"
] | null | null | null | neighbour/settings.py | kamransumar/neighbourhood_watch | 79917e4143143b95c5364bcb7f72eb073eab66d3 | [
"Unlicense"
] | null | null | null | neighbour/settings.py | kamransumar/neighbourhood_watch | 79917e4143143b95c5364bcb7f72eb073eab66d3 | [
"Unlicense"
] | null | null | null | """
Django settings for neighbour project.
Generated by 'django-admin startproject' using Django 2.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
... | 26.597561 | 91 | 0.695552 |
import os
import django_heroku
import dj_database_url
from decouple import config, Csv
MODE = config("MODE", default="dev")
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
EMAIL_USE_TLS = config('EMAIL_USE_TLS')
EMAIL_HOST = config('EMAIL_HOST')
EMAIL_PORT = config('EMAIL_PORT')
EMAIL_HOST_... | true | true |
f73f7143385eb1f1b5f04584aa7b7a1b34cb4f07 | 1,034 | py | Python | paper_retrieval/preprocessing/basic_preprocessing.py | JNKielmann/Master-Thesis | 47475d15a2d63e11320405cc60b0e49ccda2c468 | [
"MIT"
] | null | null | null | paper_retrieval/preprocessing/basic_preprocessing.py | JNKielmann/Master-Thesis | 47475d15a2d63e11320405cc60b0e49ccda2c468 | [
"MIT"
] | 1 | 2020-05-17T11:20:51.000Z | 2020-05-17T11:20:51.000Z | paper_retrieval/preprocessing/basic_preprocessing.py | JNKielmann/Master-Thesis | 47475d15a2d63e11320405cc60b0e49ccda2c468 | [
"MIT"
] | 1 | 2021-02-17T21:24:55.000Z | 2021-02-17T21:24:55.000Z | import re
class BasicPreprocessing:
def __init__(self):
self.name = "basic"
def __call__(self, text: str):
return clean_text(text)
def clean_text(text):
text = text.lower()
text = replace_all(text, [
("n't ", " not "),
("'ve ", " have "),
("'ll ", " will "),
... | 20.27451 | 78 | 0.541586 | import re
class BasicPreprocessing:
def __init__(self):
self.name = "basic"
def __call__(self, text: str):
return clean_text(text)
def clean_text(text):
text = text.lower()
text = replace_all(text, [
("n't ", " not "),
("'ve ", " have "),
("'ll ", " will "),
... | true | true |
f73f71cefac902ff3a4f6de250c8a65560c97eda | 1,352 | py | Python | Chapter10/birch.py | PacktPublishing/Machine-Learning-Algorithms-Second-Edition | 2ddacea1c9f81b4ef9a0a51c4230687350afba6c | [
"MIT"
] | 50 | 2018-08-13T13:11:04.000Z | 2022-02-17T23:00:20.000Z | Chapter10/birch.py | srikanthlakkoju/Machine-Learning-Algorithms-Second-Edition | b25d3607e9d5cc388bcf5f1a029bae39bb2b837b | [
"MIT"
] | null | null | null | Chapter10/birch.py | srikanthlakkoju/Machine-Learning-Algorithms-Second-Edition | b25d3607e9d5cc388bcf5f1a029bae39bb2b837b | [
"MIT"
] | 29 | 2018-06-08T10:56:40.000Z | 2022-02-19T06:26:23.000Z | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.cluster import Birch
from sklearn.metrics import adjusted_rand_score
# Set random seed for reproducibility
np.random.seed(1000)
nb_samples = 2000
batch_size = 80
if __nam... | 25.037037 | 109 | 0.632396 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.cluster import Birch
from sklearn.metrics import adjusted_rand_score
np.random.seed(1000)
nb_samples = 2000
batch_size = 80
if __name__ == '__main__':
X, Y = ma... | true | true |
f73f71e51c8ee8ea887fda17ad8eed500dad5d18 | 1,113 | py | Python | example.py | atharva-naik/social_media | 520964efe938fb89d3b1caa64b231ab1a63e6c76 | [
"BSD-3-Clause"
] | 7 | 2020-12-13T13:31:16.000Z | 2020-12-31T12:26:07.000Z | example.py | atharva-naik/social_media | 520964efe938fb89d3b1caa64b231ab1a63e6c76 | [
"BSD-3-Clause"
] | 4 | 2021-04-06T18:41:34.000Z | 2021-09-08T02:52:35.000Z | example.py | atharva-naik/social_media | 520964efe938fb89d3b1caa64b231ab1a63e6c76 | [
"BSD-3-Clause"
] | null | null | null | from social_media.base import Engine
from social_media.simulation import RandomBehaviour
engine = Engine.select('hangouts')
rb = RandomBehaviour(engine)
engine.login(read_from_env=True)
rb.pause(10, silent=False)
rb.stay_on_page(duration=10)
rb.driver.get("https://icons8.com/icons/set/git-fork")
engine.close()
# engin... | 79.5 | 752 | 0.850854 | from social_media.base import Engine
from social_media.simulation import RandomBehaviour
engine = Engine.select('hangouts')
rb = RandomBehaviour(engine)
engine.login(read_from_env=True)
rb.pause(10, silent=False)
rb.stay_on_page(duration=10)
rb.driver.get("https://icons8.com/icons/set/git-fork")
engine.close()
| true | true |
f73f739195c7c42a0ed04d39fc8e09e34dff6347 | 724 | py | Python | search/views.py | alexmortali/grapple | 4c6fc2386c915e16eea10847d733aceff3cb3891 | [
"Adobe-2006",
"Adobe-Glyph"
] | null | null | null | search/views.py | alexmortali/grapple | 4c6fc2386c915e16eea10847d733aceff3cb3891 | [
"Adobe-2006",
"Adobe-Glyph"
] | 5 | 2021-02-08T18:00:28.000Z | 2022-03-12T00:18:16.000Z | search/views.py | alexmortali/grapple | 4c6fc2386c915e16eea10847d733aceff3cb3891 | [
"Adobe-2006",
"Adobe-Glyph"
] | 1 | 2020-04-25T20:30:51.000Z | 2020-04-25T20:30:51.000Z | from django.shortcuts import render
from products.models import Product
from products.constants import ORDER_BY_CHOICES
# Create your views here.
def search_products(request):
""" View that returns search results """
# Filter the products based on search results
products = Product.objects.filter(name__i... | 31.478261 | 71 | 0.703039 | from django.shortcuts import render
from products.models import Product
from products.constants import ORDER_BY_CHOICES
def search_products(request):
products = Product.objects.filter(name__icontains=request.GET['q'])
search_request = request.GET['q']
template = 'list_of_products.html'
... | true | true |
f73f73929405c1b115d467e9f7b6cbdd75ab73b0 | 798 | py | Python | HackGatchina/urls.py | MenacingDwarf/HackGatchina | 35333d235274f5efb910afb2895ab7390c800b26 | [
"MIT"
] | 1 | 2019-05-26T15:23:12.000Z | 2019-05-26T15:23:12.000Z | HackGatchina/urls.py | MenacingDwarf/HackGatchina | 35333d235274f5efb910afb2895ab7390c800b26 | [
"MIT"
] | 16 | 2019-05-25T10:45:55.000Z | 2022-02-26T11:02:52.000Z | HackGatchina/urls.py | MenacingDwarf/HackGatchina | 35333d235274f5efb910afb2895ab7390c800b26 | [
"MIT"
] | 2 | 2019-05-26T15:23:21.000Z | 2019-05-30T13:13:29.000Z | """HackGatchina URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/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-... | 34.695652 | 77 | 0.704261 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('main.urls'))
]
| true | true |
f73f74fb385eff6ba00006288244470312ecd210 | 6,151 | py | Python | tensorflow/python/compat/compat.py | rniranjan93/tensorflow | 2d22f93b04cd137d2480528a80b45ea5306ca9b3 | [
"Apache-2.0"
] | 6 | 2021-03-30T07:42:04.000Z | 2022-03-23T02:42:36.000Z | tensorflow/python/compat/compat.py | rniranjan93/tensorflow | 2d22f93b04cd137d2480528a80b45ea5306ca9b3 | [
"Apache-2.0"
] | 7 | 2021-02-21T21:05:59.000Z | 2022-02-10T01:39:06.000Z | tensorflow/python/compat/compat.py | rniranjan93/tensorflow | 2d22f93b04cd137d2480528a80b45ea5306ca9b3 | [
"Apache-2.0"
] | 4 | 2019-06-15T01:13:28.000Z | 2020-12-16T02:28:45.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.554913 | 82 | 0.745895 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import datetime
import os
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import tf_contextlib
from tensorflow.python.util.tf_export import tf_export
... | true | true |
f73f75ab3e2fc53baa45440dd1243ed0ef14e767 | 2,326 | py | Python | src/orders/tests/order_shipping/tests_order_set_paid.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 62 | 2021-09-22T18:38:26.000Z | 2022-03-29T06:09:42.000Z | src/orders/tests/order_shipping/tests_order_set_paid.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 50 | 2021-09-16T07:17:31.000Z | 2022-03-26T12:06:58.000Z | src/orders/tests/order_shipping/tests_order_set_paid.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 16 | 2021-10-17T17:43:31.000Z | 2022-03-26T11:22:45.000Z | import pytest
from datetime import datetime
pytestmark = [
pytest.mark.django_db,
pytest.mark.freeze_time('2032-12-01 15:30'),
]
def test_works(order):
assert order.paid is None
order.set_paid()
order.refresh_from_db()
assert order.paid == datetime(2032, 12, 1, 15, 30)
assert order.stud... | 22.365385 | 87 | 0.712382 | import pytest
from datetime import datetime
pytestmark = [
pytest.mark.django_db,
pytest.mark.freeze_time('2032-12-01 15:30'),
]
def test_works(order):
assert order.paid is None
order.set_paid()
order.refresh_from_db()
assert order.paid == datetime(2032, 12, 1, 15, 30)
assert order.stud... | true | true |
f73f77efa4bad1f9b22673aa5a1f3fb862b7c690 | 1,743 | py | Python | HealthChecker/migrations/0003_auto_20200705_1016.py | abozaralizadeh/api_watch_tower | a646b9b437585fc0b3944348ec5153be00c85d52 | [
"MIT"
] | null | null | null | HealthChecker/migrations/0003_auto_20200705_1016.py | abozaralizadeh/api_watch_tower | a646b9b437585fc0b3944348ec5153be00c85d52 | [
"MIT"
] | null | null | null | HealthChecker/migrations/0003_auto_20200705_1016.py | abozaralizadeh/api_watch_tower | a646b9b437585fc0b3944348ec5153be00c85d52 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.14 on 2020-07-05 08:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('HealthChecker', '0002_auto_20200704_1853'),
]
operations = [
migrations.CreateModel(
name='ClientCertificate',
... | 44.692308 | 131 | 0.578313 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('HealthChecker', '0002_auto_20200704_1853'),
]
operations = [
migrations.CreateModel(
name='ClientCertificate',
fields=[
('id', models... | true | true |
f73f780a7a7ee00c38db35dff1b7df923b5843be | 3,789 | py | Python | webdriver/tests/actions/mouse_dblclick.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | null | null | null | webdriver/tests/actions/mouse_dblclick.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | null | null | null | webdriver/tests/actions/mouse_dblclick.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from tests.actions.support.mouse import assert_move_to_coordinates, get_center
from tests.actions.support.refine import get_events, filter_dict
_DBLCLICK_INTERVAL = 640
# Using local fixtures because we want to start a new session between
# each test, otherwise the clicks in each test interfere with ... | 34.761468 | 92 | 0.594088 | import pytest
from tests.actions.support.mouse import assert_move_to_coordinates, get_center
from tests.actions.support.refine import get_events, filter_dict
_DBLCLICK_INTERVAL = 640
@pytest.fixture(autouse=True)
def release_actions(dblclick_session, request):
request.addfinalizer(dblclick_session.... | true | true |
f73f7c1279a797fb6e544cb9e446e57309f72ff0 | 1,041 | py | Python | pyvisdk/do/lun_hba_association.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/lun_hba_association.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/lun_hba_association.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def LunHbaAssociation(vim, *args, **kwargs):
'''This data object represents the lun, HBA ... | 30.617647 | 124 | 0.607109 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
| true | true |
f73f7ddcc40a6e2d1dc8bf3db466ec038e087e49 | 3,582 | py | Python | tests/scheduler/test_waveforms.py | quantify-os/quantify-scheduler | 9dee17ca9345560b998b52f956c23b79a9ab287f | [
"BSD-4-Clause"
] | 1 | 2022-03-23T16:55:07.000Z | 2022-03-23T16:55:07.000Z | tests/scheduler/test_waveforms.py | quantify-os/quantify-scheduler | 9dee17ca9345560b998b52f956c23b79a9ab287f | [
"BSD-4-Clause"
] | null | null | null | tests/scheduler/test_waveforms.py | quantify-os/quantify-scheduler | 9dee17ca9345560b998b52f956c23b79a9ab287f | [
"BSD-4-Clause"
] | null | null | null | # pylint: disable=missing-function-docstring
import numpy as np
import numpy.testing as npt
import pytest
from quantify_scheduler.waveforms import (
square,
drag,
staircase,
modulate_wave,
rotate_wave,
)
def test_square_wave():
amped_sq = square(np.arange(50), 2.44)
npt.assert_array_equa... | 25.585714 | 84 | 0.579285 |
import numpy as np
import numpy.testing as npt
import pytest
from quantify_scheduler.waveforms import (
square,
drag,
staircase,
modulate_wave,
rotate_wave,
)
def test_square_wave():
amped_sq = square(np.arange(50), 2.44)
npt.assert_array_equal(amped_sq, np.linspace(2.44, 2.44, 50))
... | true | true |
f73f7fb0655f5b961fe4b84847683016494f05db | 12,368 | py | Python | slashtags/mixins/processor.py | JeffJrShim/phen-cogs | b0fcfdf25e3b2ac2ee00e3f965d60f6056747f3c | [
"MIT"
] | null | null | null | slashtags/mixins/processor.py | JeffJrShim/phen-cogs | b0fcfdf25e3b2ac2ee00e3f965d60f6056747f3c | [
"MIT"
] | null | null | null | slashtags/mixins/processor.py | JeffJrShim/phen-cogs | b0fcfdf25e3b2ac2ee00e3f965d60f6056747f3c | [
"MIT"
] | null | null | null | import asyncio
import logging
from copy import copy
from functools import partial
from typing import List, Optional, Union
import discord
import TagScriptEngine as tse
from redbot.core import commands
from ..abc import MixinMeta
from ..blocks import HideBlock
from ..errors import RequireCheckFailure
from ..http impor... | 38.291022 | 99 | 0.612629 | import asyncio
import logging
from copy import copy
from functools import partial
from typing import List, Optional, Union
import discord
import TagScriptEngine as tse
from redbot.core import commands
from ..abc import MixinMeta
from ..blocks import HideBlock
from ..errors import RequireCheckFailure
from ..http impor... | true | true |
f73f7fff23280f17f95ee068b69f7cd2917a7d28 | 6,132 | py | Python | zubbi/scraper/repos/github.py | kohtoa15/zubbi | 479d8d88e306915d93e8bf88a395a79ee88fffdc | [
"Apache-2.0"
] | null | null | null | zubbi/scraper/repos/github.py | kohtoa15/zubbi | 479d8d88e306915d93e8bf88a395a79ee88fffdc | [
"Apache-2.0"
] | null | null | null | zubbi/scraper/repos/github.py | kohtoa15/zubbi | 479d8d88e306915d93e8bf88a395a79ee88fffdc | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 BMW Car IT GmbH
#
# 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 writi... | 34.256983 | 83 | 0.612198 |
import logging
import github3
import requests
from zubbi.scraper.exceptions import CheckoutError
from zubbi.scraper.repos import Repository
from zubbi.utils import urljoin
LOGGER = logging.getLogger(__name__)
GRAPHQL_BLAME_QUERY = """
query($owner:String!, $repo:String!, $path:String!) {
repository... | true | true |
f73f8041f91509670106d4bf059139480bd7e334 | 3,766 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/compute_management_client_enums.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 24.940397 | 76 | 0.681625 |
from enum import Enum
class StatusLevelTypes(Enum):
info = "Info"
warning = "Warning"
error = "Error"
class OperatingSystemTypes(Enum):
windows = "Windows"
linux = "Linux"
class VirtualMachineSizeTypes(Enum):
basic_a0 = "Basic_A0"
basic_a1 = "Basic_A1"
basic_a2 = "Bas... | true | true |
f73f80582a13f90b3db11c34929847d7790b1032 | 5,996 | py | Python | frappe/utils/csvutils.py | neelbhanushali/frappe | 7bbf4ef7db581b3b6759726e4e49776d61511a4e | [
"MIT"
] | null | null | null | frappe/utils/csvutils.py | neelbhanushali/frappe | 7bbf4ef7db581b3b6759726e4e49776d61511a4e | [
"MIT"
] | 4 | 2020-12-04T21:06:17.000Z | 2022-03-12T00:39:08.000Z | frappe/utils/csvutils.py | neelbhanushali/frappe | 7bbf4ef7db581b3b6759726e4e49776d61511a4e | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
import json
import csv
import six
import requests
from six import StringIO, text_type, string_types
from frappe.utils import encode, c... | 28.283019 | 112 | 0.694797 |
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
import json
import csv
import six
import requests
from six import StringIO, text_type, string_types
from frappe.utils import encode, cstr, cint, flt, comma_or
def read_csv_content_from_uploaded_file(ignore_encoding=False):
if geta... | true | true |
f73f80afd82a9968a588d5a7d96da180e7517b8a | 1,055 | py | Python | manage.py | Audiotuete/backend_hotornot_api | 0ef7025e0beed60420b2fcc048321e24cd2fb10a | [
"MIT"
] | null | null | null | manage.py | Audiotuete/backend_hotornot_api | 0ef7025e0beed60420b2fcc048321e24cd2fb10a | [
"MIT"
] | null | null | null | manage.py | Audiotuete/backend_hotornot_api | 0ef7025e0beed60420b2fcc048321e24cd2fb10a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 34.032258 | 77 | 0.664455 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportE... | true | true |
f73f84d849050ee098c2101af347f664e3d1f5f4 | 2,732 | py | Python | tests/utils/test_hook.py | hnrkcode/InstaSave | 81dd1638a20d8191566ad30772f652a6781d6c81 | [
"MIT"
] | 1 | 2020-07-05T19:42:44.000Z | 2020-07-05T19:42:44.000Z | tests/utils/test_hook.py | hnrkcode/InstaSave | 81dd1638a20d8191566ad30772f652a6781d6c81 | [
"MIT"
] | null | null | null | tests/utils/test_hook.py | hnrkcode/InstaSave | 81dd1638a20d8191566ad30772f652a6781d6c81 | [
"MIT"
] | 2 | 2019-09-10T20:21:35.000Z | 2019-09-19T09:43:03.000Z | import json
import os.path
import unittest
from unittest.mock import patch
from instasave.utils import hook
DATA = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "test_data", "json"
)
class TestHooks(unittest.TestCase):
def test_private_profile_returns_true(self):
with open(os.path.join(D... | 40.776119 | 73 | 0.686676 | import json
import os.path
import unittest
from unittest.mock import patch
from instasave.utils import hook
DATA = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "test_data", "json"
)
class TestHooks(unittest.TestCase):
def test_private_profile_returns_true(self):
with open(os.path.join(D... | true | true |
f73f84e4e9f74ea2315976d2745ecb77e4f67f24 | 1,063 | py | Python | source/tutorials/files/mnist.py | surchs/lab-documentation | 9d71a4710b66da5341e7c3c67108d175f8a9fe0d | [
"MIT"
] | 1 | 2021-03-23T17:30:49.000Z | 2021-03-23T17:30:49.000Z | source/tutorials/files/mnist.py | surchs/lab-documentation | 9d71a4710b66da5341e7c3c67108d175f8a9fe0d | [
"MIT"
] | 12 | 2020-05-12T15:20:12.000Z | 2022-03-04T14:46:22.000Z | source/tutorials/files/mnist.py | surchs/lab-documentation | 9d71a4710b66da5341e7c3c67108d175f8a9fe0d | [
"MIT"
] | 6 | 2020-04-02T15:39:15.000Z | 2021-11-08T15:51:28.000Z | import tensorflow as tf
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.cifar10.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Conv2D(filters=16, kernel_size=(3, 3), activation='relu'),
tf.keras.layers.MaxPool2D(),
tf.keras.layer... | 39.37037 | 79 | 0.693321 | import tensorflow as tf
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.cifar10.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Conv2D(filters=16, kernel_size=(3, 3), activation='relu'),
tf.keras.layers.MaxPool2D(),
tf.keras.layer... | true | true |
f73f8542d32aa28cc133a506ef07c975c1a46bf0 | 276 | py | Python | demos/mpi-collective.py | kahilah/hpc-python | 5d2efa08076ed2706c81ca255c7e4574c937557c | [
"MIT"
] | 1 | 2021-12-16T08:55:28.000Z | 2021-12-16T08:55:28.000Z | demos/mpi-collective.py | kahilah/hpc-python | 5d2efa08076ed2706c81ca255c7e4574c937557c | [
"MIT"
] | null | null | null | demos/mpi-collective.py | kahilah/hpc-python | 5d2efa08076ed2706c81ca255c7e4574c937557c | [
"MIT"
] | 1 | 2021-12-05T02:40:42.000Z | 2021-12-05T02:40:42.000Z | from mpi4py import MPI
from numpy import arange, empty
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
n = 10
data = empty(n, float)
if rank == 0:
data = arange(n, dtype=float)
comm.Bcast(data, 0)
if rank == 1:
print("Received: " + str(data))
| 15.333333 | 35 | 0.655797 | from mpi4py import MPI
from numpy import arange, empty
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
n = 10
data = empty(n, float)
if rank == 0:
data = arange(n, dtype=float)
comm.Bcast(data, 0)
if rank == 1:
print("Received: " + str(data))
| true | true |
f73f858431f33be0daa63a11be0488d27cbfe7f2 | 1,544 | py | Python | File_Transfer_Protocol/ftp_client_server.py | niroshajayasundara/Python | ed113841165717d135a001307d06f4282ad16870 | [
"MIT"
] | 5 | 2018-04-02T08:06:54.000Z | 2018-08-02T03:01:27.000Z | File_Transfer_Protocol/ftp_client_server.py | niroshajayasundara/Python | ed113841165717d135a001307d06f4282ad16870 | [
"MIT"
] | 1 | 2018-10-01T05:19:54.000Z | 2018-10-01T05:19:54.000Z | File_Transfer_Protocol/ftp_client_server.py | niroshajayasundara/Python | ed113841165717d135a001307d06f4282ad16870 | [
"MIT"
] | 5 | 2020-12-18T09:41:21.000Z | 2022-03-09T11:40:58.000Z | # server
import socket # Import socket module
port = 60000 # Reserve a port for your service.
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
s.bind((host, port)) # Bind to the port
s.listen(5) ... | 26.169492 | 67 | 0.580311 |
import socket
port = 60000
s = socket.socket()
host = socket.gethostname()
s.bind((host, port))
s.listen(5)
print('Server listening....')
while True:
conn, addr = s.accept()
print('Got connection from', addr)
... | true | true |
f73f886a87f5b3e9e9514370c3ae480a9ed14e49 | 2,161 | py | Python | locations/spiders/kristoil.py | nbeecher/alltheplaces | f28b75ffbd7a6b09aaf80bf3a46cb563527632de | [
"MIT"
] | 297 | 2017-12-07T01:29:14.000Z | 2022-03-29T06:58:01.000Z | locations/spiders/kristoil.py | nbeecher/alltheplaces | f28b75ffbd7a6b09aaf80bf3a46cb563527632de | [
"MIT"
] | 2,770 | 2017-11-28T04:20:21.000Z | 2022-03-31T11:29:16.000Z | locations/spiders/kristoil.py | nbeecher/alltheplaces | f28b75ffbd7a6b09aaf80bf3a46cb563527632de | [
"MIT"
] | 111 | 2017-11-27T21:40:02.000Z | 2022-01-22T01:21:52.000Z | import json
import re
import scrapy
from locations.items import GeojsonPointItem
class KristoilSpider(scrapy.Spider):
name = "kristoil"
item_attributes = { 'brand': "Kristoil" }
allowed_domains = ["www.kristoil.com"]
def start_requests(self):
url = 'http://www.kristoil.com/wp-content/themes/kr... | 36.016667 | 76 | 0.502545 | import json
import re
import scrapy
from locations.items import GeojsonPointItem
class KristoilSpider(scrapy.Spider):
name = "kristoil"
item_attributes = { 'brand': "Kristoil" }
allowed_domains = ["www.kristoil.com"]
def start_requests(self):
url = 'http://www.kristoil.com/wp-content/themes/kr... | true | true |
f73f88e487fc9fc75bd95726629a6caee02eb3b7 | 1,977 | py | Python | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/security_monitoring_rule_type_create.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/security_monitoring_rule_type_create.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | code/venv/lib/python3.8/site-packages/datadog_api_client/v2/model/security_monitoring_rule_type_create.py | Valisback/hiring-engineers | 7196915dd5a429ae27c21fa43d527f0332e662ed | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from datadog_api_client.v2.model_utils import (
ApiTypeError,
ModelSimple,
... | 28.242857 | 108 | 0.609004 |
from datadog_api_client.v2.model_utils import (
ApiTypeError,
ModelSimple,
cached_property,
)
class SecurityMonitoringRuleTypeCreate(ModelSimple):
allowed_values = {
"value": {
"LOG_DETECTION": "log_detection",
"WORKLOAD_SECURITY": "workload_security",
},
... | true | true |
f73f89bd5de5299b1f38db90c205732cf9f73542 | 12,106 | py | Python | qutip/propagator.py | yangyuethz/qutip | 7f5682b5edfd4c906b2e89f69cf0a8be4bfd529b | [
"BSD-3-Clause"
] | 1 | 2018-05-31T17:38:03.000Z | 2018-05-31T17:38:03.000Z | qutip/propagator.py | yangyuethz/qutip | 7f5682b5edfd4c906b2e89f69cf0a8be4bfd529b | [
"BSD-3-Clause"
] | 3 | 2021-08-23T19:00:52.000Z | 2021-08-24T21:38:04.000Z | qutip/propagator.py | yangyuethz/qutip | 7f5682b5edfd4c906b2e89f69cf0a8be4bfd529b | [
"BSD-3-Clause"
] | 2 | 2017-08-11T11:14:52.000Z | 2022-03-13T21:37:47.000Z | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | 37.713396 | 79 | 0.569552 |
or m in range(N)])
_cols = np.zeros_like(_rows)
_data = np.ones_like(_rows, dtype=complex)
psi0 = Qobj(sp.coo_matrix((_data, (_rows, _cols))).tocsr())
if td_type[1] > 0 or td_type[2] > 0:
H2 = []
... | true | true |
f73f8ab4cbbd790e9126d4818fed7c4ad1705f1c | 429 | py | Python | Attendance_Management_System/vcet/student/migrations/0004_auto_20180329_0226.py | jainritik153/ATTENDANCE-MANAGEMENT-SYSTEM | 182be2e07f63e6c5d6207e7e7d3c0d9629608e68 | [
"MIT"
] | null | null | null | Attendance_Management_System/vcet/student/migrations/0004_auto_20180329_0226.py | jainritik153/ATTENDANCE-MANAGEMENT-SYSTEM | 182be2e07f63e6c5d6207e7e7d3c0d9629608e68 | [
"MIT"
] | null | null | null | Attendance_Management_System/vcet/student/migrations/0004_auto_20180329_0226.py | jainritik153/ATTENDANCE-MANAGEMENT-SYSTEM | 182be2e07f63e6c5d6207e7e7d3c0d9629608e68 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-29 02:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('student', '0003_auto_20180329_0209'),
]
operations = [
migrations.AlterField(
model_name='india',
name='Type',
... | 22.578947 | 96 | 0.585082 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('student', '0003_auto_20180329_0209'),
]
operations = [
migrations.AlterField(
model_name='india',
name='Type',
field=models.CharField(choices=[('T', 'T... | true | true |
f73f8d09bacab0cef310cd171d2b92c639255c97 | 10,964 | py | Python | test/functional/test_framework/test_node.py | XcelRProject/XcelR | 991f0ca8b60078d5b8fe95c122fff0e95275009b | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | XcelRProject/XcelR | 991f0ca8b60078d5b8fe95c122fff0e95275009b | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | XcelRProject/XcelR | 991f0ca8b60078d5b8fe95c122fff0e95275009b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoind node under test"""
import decimal
import errno
import http.client
import json
import log... | 38.605634 | 248 | 0.629059 |
import decimal
import errno
import http.client
import json
import logging
import os
import re
import subprocess
import time
from .authproxy import JSONRPCException
from .util import (
assert_equal,
delete_cookie_file,
get_rpc_proxy,
rpc_url,
wait_until,
p2p_port,
)
JSONDecodeError = geta... | true | true |
f73f8e3490044385e6bded9d468112f4fad59eb5 | 9,275 | py | Python | src/epicast/fc_epicast_analysis.py | dfarrow0/flu-contest | 8356cf48910a76d2643d105651342288076a9377 | [
"MIT"
] | null | null | null | src/epicast/fc_epicast_analysis.py | dfarrow0/flu-contest | 8356cf48910a76d2643d105651342288076a9377 | [
"MIT"
] | 5 | 2020-02-24T19:06:24.000Z | 2020-04-30T16:40:55.000Z | src/epicast/fc_epicast_analysis.py | dfarrow0/flu-contest | 8356cf48910a76d2643d105651342288076a9377 | [
"MIT"
] | 3 | 2020-03-22T16:30:38.000Z | 2020-04-27T17:39:12.000Z | from statistics import median_low
import mysql.connector
import numpy as np
import scipy.stats
from ..forecasters.fc_abstract import Forecaster
from delphi.epidata.client.delphi_epidata import Epidata
import delphi.operations.secrets as secrets
import delphi.utils.epiweek as flu
from ..utils.forecast_type import Foreca... | 35.949612 | 115 | 0.615202 | from statistics import median_low
import mysql.connector
import numpy as np
import scipy.stats
from ..forecasters.fc_abstract import Forecaster
from delphi.epidata.client.delphi_epidata import Epidata
import delphi.operations.secrets as secrets
import delphi.utils.epiweek as flu
from ..utils.forecast_type import Foreca... | true | true |
f73f8e3a205abd320776bf51c153f09a2f593d5f | 140,070 | py | Python | wand/image.py | Artoria2e5/wand | 380068e9cc1268a8c20e2fa13621058a68d55cb3 | [
"MIT"
] | null | null | null | wand/image.py | Artoria2e5/wand | 380068e9cc1268a8c20e2fa13621058a68d55cb3 | [
"MIT"
] | null | null | null | wand/image.py | Artoria2e5/wand | 380068e9cc1268a8c20e2fa13621058a68d55cb3 | [
"MIT"
] | null | null | null | """:mod:`wand.image` --- Image objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opens and manipulates images. Image objects can be used in :keyword:`with`
statement, and these resources will be automatically managed (even if any
error happened)::
with Image(filename='pikachu.png') as i:
print('width =', i.w... | 37.693757 | 84 | 0.565096 | import collections
import ctypes
import functools
import numbers
import weakref
from . import compat
from .api import MagickPixelPacket, libc, libmagick, library
from .color import Color
from .compat import (binary, binary_type, encode_filename, file_types,
string_type, text, xrange)
from .excepti... | true | true |
f73f8e5c5681128c97f1baf416888a2e6cfbd34a | 1,938 | py | Python | social_core/tests/backends/test_slack.py | BenRogersNewsome/social-core | 1ea27e8989657bb35dd37b6ee2e038e1358fbc96 | [
"BSD-3-Clause"
] | 1 | 2021-12-27T21:10:59.000Z | 2021-12-27T21:10:59.000Z | social_core/tests/backends/test_slack.py | BorisPlus/social-core | 1ea27e8989657bb35dd37b6ee2e038e1358fbc96 | [
"BSD-3-Clause"
] | null | null | null | social_core/tests/backends/test_slack.py | BorisPlus/social-core | 1ea27e8989657bb35dd37b6ee2e038e1358fbc96 | [
"BSD-3-Clause"
] | null | null | null | import json
from .oauth import OAuth2Test
class SlackOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.slack.SlackOAuth2'
user_data_url = 'https://slack.com/api/users.identity'
access_token_body = json.dumps({
'access_token': 'foobar',
'token_type': 'bearer'
})
user_dat... | 25.168831 | 62 | 0.540248 | import json
from .oauth import OAuth2Test
class SlackOAuth2Test(OAuth2Test):
backend_path = 'social_core.backends.slack.SlackOAuth2'
user_data_url = 'https://slack.com/api/users.identity'
access_token_body = json.dumps({
'access_token': 'foobar',
'token_type': 'bearer'
})
user_dat... | true | true |
f73f8f8f084ef469a06e9033c5a3e4e1d2ff3b06 | 1,105 | py | Python | tests/ace/api/test_apikey.py | ace-ecosystem/ace2-core | a0de6b90f7437a98b1ee6ebcc693fa14f4b13c53 | [
"Apache-2.0"
] | null | null | null | tests/ace/api/test_apikey.py | ace-ecosystem/ace2-core | a0de6b90f7437a98b1ee6ebcc693fa14f4b13c53 | [
"Apache-2.0"
] | 11 | 2020-12-30T03:13:09.000Z | 2021-05-02T14:09:32.000Z | tests/ace/api/test_apikey.py | ace-ecosystem/ace2-core | a0de6b90f7437a98b1ee6ebcc693fa14f4b13c53 | [
"Apache-2.0"
] | 1 | 2022-03-16T20:44:16.000Z | 2022-03-16T20:44:16.000Z | import uuid
from ace.api.apikey import ApiKey
import pytest
key_value = "5dbc0b66-fcf7-4b98-a0f4-59e523dbba92"
key_name = "test"
key_description = "test description"
key_is_admin = False
@pytest.mark.parametrize(
"key",
[
ApiKey(api_key=key_value, name=key_name, description=key_description, is_admi... | 25.113636 | 101 | 0.700452 | import uuid
from ace.api.apikey import ApiKey
import pytest
key_value = "5dbc0b66-fcf7-4b98-a0f4-59e523dbba92"
key_name = "test"
key_description = "test description"
key_is_admin = False
@pytest.mark.parametrize(
"key",
[
ApiKey(api_key=key_value, name=key_name, description=key_description, is_admi... | true | true |
f73f9075e8bcea636474d5071cc61b4ef8f1a19f | 1,761 | py | Python | setup.py | nasifimtiazohi/changelogs | bd53faf6993580627edb492cd221558b43d004c7 | [
"MIT"
] | 54 | 2017-01-12T09:44:49.000Z | 2022-02-01T18:15:07.000Z | setup.py | pyupio/changelogs | bd53faf6993580627edb492cd221558b43d004c7 | [
"MIT"
] | 254 | 2016-12-23T12:53:52.000Z | 2021-11-23T14:59:01.000Z | setup.py | nasifimtiazohi/changelogs | bd53faf6993580627edb492cd221558b43d004c7 | [
"MIT"
] | 26 | 2017-02-25T08:21:05.000Z | 2022-01-10T15:46:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'requests',
'validators',
'packaging',
'lxml',
'gitchang... | 23.171053 | 49 | 0.613856 |
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'requests',
'validators',
'packaging',
'lxml',
'gitchangelog'
]
test_requirements = [
'mock',
... | true | true |
f73f909fdaef0f6545abf7adf8377ec1a8b30bd5 | 855 | py | Python | formats/sound/sample_transform.py | C3RV1/LaytonEditor | 51e1a9a372a8acdaa4183ae008235a721dc56cdc | [
"Unlicense"
] | 6 | 2019-12-24T00:18:54.000Z | 2022-02-28T17:09:22.000Z | formats/sound/sample_transform.py | C3RV1/LaytonEditor | 51e1a9a372a8acdaa4183ae008235a721dc56cdc | [
"Unlicense"
] | 1 | 2021-08-18T11:10:35.000Z | 2021-08-18T17:32:21.000Z | formats/sound/sample_transform.py | C3RV1/LaytonEditor | 51e1a9a372a8acdaa4183ae008235a721dc56cdc | [
"Unlicense"
] | 2 | 2021-01-17T10:42:48.000Z | 2021-08-18T11:10:54.000Z | import math
import numpy as np
def change_sample_rate(buffer: np.ndarray, current, target) -> np.ndarray:
shape = [0, 0]
shape[0] = buffer.shape[0]
# RATEo = SAMPLESo
# RATEm = (SAMPLESo / RATEo) * RATEm
extend = target / current
shape[1] = int(math.ceil(buffer.shape[1] * extend))
convert... | 29.482759 | 79 | 0.625731 | import math
import numpy as np
def change_sample_rate(buffer: np.ndarray, current, target) -> np.ndarray:
shape = [0, 0]
shape[0] = buffer.shape[0]
extend = target / current
shape[1] = int(math.ceil(buffer.shape[1] * extend))
converted = np.zeros(shape, dtype=buffer.dtype)
for chan... | true | true |
f73f936fab2e2ba9c7dfb763566641f590a9b92d | 1,069 | py | Python | algorithms/02-edge-subdivision/osmnx_hz/district.py | sunmengnan/city_brain | 478f0b974f4491b4201956f37b83ce6860712bc8 | [
"MIT"
] | null | null | null | algorithms/02-edge-subdivision/osmnx_hz/district.py | sunmengnan/city_brain | 478f0b974f4491b4201956f37b83ce6860712bc8 | [
"MIT"
] | null | null | null | algorithms/02-edge-subdivision/osmnx_hz/district.py | sunmengnan/city_brain | 478f0b974f4491b4201956f37b83ce6860712bc8 | [
"MIT"
] | null | null | null | import pandas as pd
import osmnx
import numpy as np
fix = {'西湖区,杭州市,浙江省,中国': 2}
city_query = [
'杭州市,浙江省,中国',
]
district_query = [
'上城区,杭州市,浙江省,中国',
'下城区,杭州市,浙江省,中国',
'江干区,杭州市,浙江省,中国',
'西湖区,杭州市,浙江省,中国',
'拱墅区,杭州市,浙江省,中国',
'滨江区,杭州市,浙江省,中国',
]
def query_str_to_dic(query_str):
result = que... | 21.38 | 67 | 0.642657 | import pandas as pd
import osmnx
import numpy as np
fix = {'西湖区,杭州市,浙江省,中国': 2}
city_query = [
'杭州市,浙江省,中国',
]
district_query = [
'上城区,杭州市,浙江省,中国',
'下城区,杭州市,浙江省,中国',
'江干区,杭州市,浙江省,中国',
'西湖区,杭州市,浙江省,中国',
'拱墅区,杭州市,浙江省,中国',
'滨江区,杭州市,浙江省,中国',
]
def query_str_to_dic(query_str):
result = que... | true | true |
f73f94c3158ed613dbc0d80b35b507f9509e5682 | 212 | py | Python | submissions/contains-duplicate/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | submissions/contains-duplicate/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | 1 | 2022-03-04T20:24:32.000Z | 2022-03-04T20:31:58.000Z | submissions/contains-duplicate/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/contains-duplicate
class Solution:
def containsDuplicate(self, nums):
hs = set()
for num in nums:
hs.add(num)
return len(hs) != len(nums)
| 21.2 | 50 | 0.589623 |
class Solution:
def containsDuplicate(self, nums):
hs = set()
for num in nums:
hs.add(num)
return len(hs) != len(nums)
| true | true |
f73f953c8da65da350b82dec261a0027f450116a | 3,213 | py | Python | ola_convolve.py | shun60s/impulse-response | 4bdf8ef671ed0b55afd452a12b43f6fde6cdf3ac | [
"MIT"
] | null | null | null | ola_convolve.py | shun60s/impulse-response | 4bdf8ef671ed0b55afd452a12b43f6fde6cdf3ac | [
"MIT"
] | null | null | null | ola_convolve.py | shun60s/impulse-response | 4bdf8ef671ed0b55afd452a12b43f6fde6cdf3ac | [
"MIT"
] | null | null | null | #coding:utf-8
# overlap-add convolve with impulse response waveform
import sys
import os
import argparse
import numpy as np
from scipy import signal
from scipy.io.wavfile import read as wavread
from scipy.io.wavfile import write as wavwrite
# Check version
# Python 3.6.4 on win32 (Windows 10)
# num... | 29.477064 | 163 | 0.57423 |
import sys
import os
import argparse
import numpy as np
from scipy import signal
from scipy.io.wavfile import read as wavread
from scipy.io.wavfile import write as wavwrite
def load_wav( path0, force_mono=False):
try:
sr, y = wavread(path0)
except:
print... | true | true |
f73f963a8a00e3aca23c77a1118759e0f0abab77 | 446 | py | Python | export_as_json.py | UweSausL/GPSTracker | 2d9dbc4e516acc4936d17f7fd0b22ed29330eef6 | [
"MIT"
] | null | null | null | export_as_json.py | UweSausL/GPSTracker | 2d9dbc4e516acc4936d17f7fd0b22ed29330eef6 | [
"MIT"
] | 1 | 2020-08-26T16:42:29.000Z | 2020-08-26T16:42:29.000Z | export_as_json.py | UweSausL/GPSTracker | 2d9dbc4e516acc4936d17f7fd0b22ed29330eef6 | [
"MIT"
] | null | null | null | import os
import json
import redis
redis_connection = redis.Redis(decode_responses=True)
if not os.path.isdir('logs_json'):
os.mkdir('logs_json')
for key in redis_connection.scan_iter('*'):
file_name = 'logs_json/' + '_'.join(key.split(':')) + '.json'
print(key)
data = redis_connection.lrange(key, 0,... | 24.777778 | 65 | 0.612108 | import os
import json
import redis
redis_connection = redis.Redis(decode_responses=True)
if not os.path.isdir('logs_json'):
os.mkdir('logs_json')
for key in redis_connection.scan_iter('*'):
file_name = 'logs_json/' + '_'.join(key.split(':')) + '.json'
print(key)
data = redis_connection.lrange(key, 0,... | true | true |
f73f971fddea21290772fc19e89a9f41717e09d9 | 2,655 | py | Python | Dashboard/specs.py | jviteMx/AMDCapstone | fd38b3e68e34ee5aa30f8c13d200bf97d748b623 | [
"MIT"
] | 3 | 2020-12-10T19:12:01.000Z | 2021-06-24T04:41:51.000Z | Dashboard/specs.py | jviteMx/AMDCapstone | fd38b3e68e34ee5aa30f8c13d200bf97d748b623 | [
"MIT"
] | 11 | 2021-01-07T19:14:05.000Z | 2021-04-29T17:32:25.000Z | docker-combined/dashboard/specs.py | jviteMx/AMDCapstone | fd38b3e68e34ee5aa30f8c13d200bf97d748b623 | [
"MIT"
] | 4 | 2021-01-29T22:21:45.000Z | 2021-04-30T23:06:35.000Z | # MIT License
# This project is a software package to automate the performance tracking of the HPC algorithms
# Copyright (c) 2021. Victor Tuah Kumi, Ahmed Iqbal, Javier Vite, Aidan Forester
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation... | 45 | 95 | 0.587194 |
import model
def get_specs(hardware_ids, rocm_versions):
specs_info = []
for rocm in rocm_versions:
for hardw_id in hardware_ids:
specs = model.get_specs(hardw_id, rocm)
if specs is not None:
title = f'{rocm} specs'
info ... | true | true |
f73f97f4860bc026d7b7fbe60dca77d7f5fa820f | 2,065 | py | Python | Synthesis/units.py | pablorutschmann/3DPopSynthesis | 6c2206bef0cf0b0dc21aeb6cbda6386a525ffbc7 | [
"MIT"
] | null | null | null | Synthesis/units.py | pablorutschmann/3DPopSynthesis | 6c2206bef0cf0b0dc21aeb6cbda6386a525ffbc7 | [
"MIT"
] | null | null | null | Synthesis/units.py | pablorutschmann/3DPopSynthesis | 6c2206bef0cf0b0dc21aeb6cbda6386a525ffbc7 | [
"MIT"
] | null | null | null | import astropy.constants as astroconst
from astropy import units as u
import numpy as np
# Defining Constants
# AU in cm
au = astroconst.au.decompose(u.cgs.bases).value
# Jupiter Radius in cm
# R_J = astroconst.R_jup.decompose(u.cgs.bases).value
R_J = astroconst.R_jup.decompose(u.cgs.bases).value
# Jupiter Radius sq... | 20.65 | 78 | 0.715738 | import astropy.constants as astroconst
from astropy import units as u
import numpy as np
au = astroconst.au.decompose(u.cgs.bases).value
R_J = astroconst.R_jup.decompose(u.cgs.bases).value
R_J2 = R_J ** 2
M_J = astroconst.M_jup.decompose(u.cgs.bases).value
R_S = astroconst.R_sun.decompose(u.cgs.bases).valu... | true | true |
f73f982d51bce455f556a08b6f3c83529ec286cd | 7,733 | py | Python | plugins/opencv/src/opencv/__init__.py | erikolofsson/scrypted | 39016a617464003cac13719a426eefcc2421e51a | [
"MIT"
] | null | null | null | plugins/opencv/src/opencv/__init__.py | erikolofsson/scrypted | 39016a617464003cac13719a426eefcc2421e51a | [
"MIT"
] | null | null | null | plugins/opencv/src/opencv/__init__.py | erikolofsson/scrypted | 39016a617464003cac13719a426eefcc2421e51a | [
"MIT"
] | null | null | null | from __future__ import annotations
from time import sleep
from detect import DetectionSession, DetectPlugin
from typing import Any, List
import numpy as np
import cv2
import imutils
from gi.repository import GLib, Gst
from scrypted_sdk.types import ObjectDetectionModel, ObjectDetectionResult, ObjectsDetected
class Ope... | 38.472637 | 184 | 0.608431 | from __future__ import annotations
from time import sleep
from detect import DetectionSession, DetectPlugin
from typing import Any, List
import numpy as np
import cv2
import imutils
from gi.repository import GLib, Gst
from scrypted_sdk.types import ObjectDetectionModel, ObjectDetectionResult, ObjectsDetected
class Ope... | true | true |
f73f99b4f33f87d5032eaeea1002643918e72a45 | 403 | py | Python | constants.py | Medouni/telegram-bot-cf | 15b3434b10573ff59d8f3a065322c6e196ce23a3 | [
"MIT"
] | null | null | null | constants.py | Medouni/telegram-bot-cf | 15b3434b10573ff59d8f3a065322c6e196ce23a3 | [
"MIT"
] | null | null | null | constants.py | Medouni/telegram-bot-cf | 15b3434b10573ff59d8f3a065322c6e196ce23a3 | [
"MIT"
] | 1 | 2021-03-06T19:11:42.000Z | 2021-03-06T19:11:42.000Z |
# CloudFoundry (Heroku, IBM, etc.)
HOST = "0.0.0.0"
PORT = 8080
WEBHOOK_URI = None
# Telegram
PROXY = 'socks5://1.171.182.155:1080'
ENDPOINT = 'https://api.telegram.org'
# Text constants
MSG_GREETING = (f"Hi there, I am EchoBot. "
f"I am here to echo your kind words back to you. "
f"J... | 25.1875 | 83 | 0.60794 |
HOST = "0.0.0.0"
PORT = 8080
WEBHOOK_URI = None
PROXY = 'socks5://1.171.182.155:1080'
ENDPOINT = 'https://api.telegram.org'
MSG_GREETING = (f"Hi there, I am EchoBot. "
f"I am here to echo your kind words back to you. "
f"Just say anything nice and I'll say the exact same thing to y... | true | true |
f73f99da83a275c64d6ac55705003bb615091af8 | 153 | py | Python | Week20190508/CH01_16.py | wrightgarr/PYTHON_416 | 0accadc214b8d7b0140be6bc61222e2286ae72fa | [
"MIT"
] | null | null | null | Week20190508/CH01_16.py | wrightgarr/PYTHON_416 | 0accadc214b8d7b0140be6bc61222e2286ae72fa | [
"MIT"
] | null | null | null | Week20190508/CH01_16.py | wrightgarr/PYTHON_416 | 0accadc214b8d7b0140be6bc61222e2286ae72fa | [
"MIT"
] | null | null | null | def sigma_days(days, daily_sigma):
return days*daily_sigma
sigma10 = sigma_days(10, 0.2)
print("The 10-day volatility is ${0:.2f}".format(sigma10))
| 19.125 | 58 | 0.72549 | def sigma_days(days, daily_sigma):
return days*daily_sigma
sigma10 = sigma_days(10, 0.2)
print("The 10-day volatility is ${0:.2f}".format(sigma10))
| true | true |
f73f99f34d2bb49184367ae61ec7e7ec902044fb | 966 | py | Python | src/scs_core/sys/logging.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 3 | 2019-03-12T01:59:58.000Z | 2020-09-12T07:27:42.000Z | src/scs_core/sys/logging.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 1 | 2018-04-20T07:58:38.000Z | 2021-03-27T08:52:45.000Z | src/scs_core/sys/logging.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 4 | 2017-09-29T13:08:43.000Z | 2019-10-09T09:13:58.000Z | """
Created on 20 Jan 2021
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
https://realpython.com/python-logging/
"""
import logging
import sys
# --------------------------------------------------------------------------------------------------------------------
# noinspection PyPep8Naming
class Loggin... | 23.560976 | 118 | 0.511387 |
import logging
import sys
class Logging(object):
__NAME = None
__MULTI_FORMAT = '%(name)s: %(message)s'
@classmethod
def config(cls, name, verbose=False, level=logging.ERROR, stream=sys.stderr):
cls.__NAME = name
level = logging.INFO if verbose else level
logging... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.