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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f706fc6b9ab563a9c57b7760402e6984b1c26dee | 2,951 | py | Python | vega/algorithms/nas/fis/autogate_s2_trainer_callback.py | jie311/vega | 1bba6100ead802697e691403b951e6652a99ccae | [
"MIT"
] | 724 | 2020-06-22T12:05:30.000Z | 2022-03-31T07:10:54.000Z | vega/algorithms/nas/fis/autogate_s2_trainer_callback.py | jie311/vega | 1bba6100ead802697e691403b951e6652a99ccae | [
"MIT"
] | 147 | 2020-06-30T13:34:46.000Z | 2022-03-29T11:30:17.000Z | vega/algorithms/nas/fis/autogate_s2_trainer_callback.py | jie311/vega | 1bba6100ead802697e691403b951e6652a99ccae | [
"MIT"
] | 160 | 2020-06-29T18:27:58.000Z | 2022-03-23T08:42:21.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without ev... | 40.986111 | 96 | 0.674348 |
import logging
import pandas as pd
from vega.common import ClassFactory, ClassType
from vega.common import FileOps
from vega.algorithms.nas.fis.ctr_trainer_callback import CtrTrainerCallback
from vega.core.pipeline.conf import ModelConfig
logger = logging.getLogger(__name__)
@ClassFactory.register(Clas... | true | true |
f706fdb17b580094febbd7f8292e1a81c38059ac | 1,364 | py | Python | setup.py | catsital/pycasso | eb54cd82e66d06b3677c2c068716ceb818c19f97 | [
"MIT"
] | 4 | 2021-11-08T08:35:10.000Z | 2022-02-23T21:22:11.000Z | setup.py | catsital/pycasso | eb54cd82e66d06b3677c2c068716ceb818c19f97 | [
"MIT"
] | null | null | null | setup.py | catsital/pycasso | eb54cd82e66d06b3677c2c068716ceb818c19f97 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setup_requirements = [
"wheel>=0.35.1",
]
requirements = ["Pillow>=7.2.0"]
test_requirements = [
"flake8>=3.8.3",
"pytest>=5.4.3",
]
dev_requirements = [
*setup_requiremen... | 25.735849 | 81 | 0.674487 | from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setup_requirements = [
"wheel>=0.35.1",
]
requirements = ["Pillow>=7.2.0"]
test_requirements = [
"flake8>=3.8.3",
"pytest>=5.4.3",
]
dev_requirements = [
*setup_requiremen... | true | true |
f706fe5448d953da1ef20ac3b617d48dd7209577 | 5,517 | py | Python | company/tests/test_serialisers.py | uktrade/dnb-service | c8f22af82af70f33b8d6bf92e3ca6992fce1f220 | [
"MIT"
] | 4 | 2019-12-03T14:59:50.000Z | 2020-04-28T12:42:24.000Z | company/tests/test_serialisers.py | uktrade/dnb-service | c8f22af82af70f33b8d6bf92e3ca6992fce1f220 | [
"MIT"
] | 17 | 2019-04-11T13:12:57.000Z | 2022-01-13T10:08:07.000Z | company/tests/test_serialisers.py | uktrade/dnb-service | c8f22af82af70f33b8d6bf92e3ca6992fce1f220 | [
"MIT"
] | 3 | 2021-05-11T16:13:57.000Z | 2022-03-08T15:57:19.000Z | from collections import OrderedDict
import pytest
from company.constants import RegistrationNumberChoices
from company.models import Country
from company.serialisers import CompanySerialiser
from .factories import CompanyFactory, IndustryCodeFactory, PrimaryIndustryCodeFactory, RegistrationNumberFactory
@pytest.mar... | 38.3125 | 113 | 0.598151 | from collections import OrderedDict
import pytest
from company.constants import RegistrationNumberChoices
from company.models import Country
from company.serialisers import CompanySerialiser
from .factories import CompanyFactory, IndustryCodeFactory, PrimaryIndustryCodeFactory, RegistrationNumberFactory
@pytest.mar... | true | true |
f706fea8fc73c2f8c61410dd279f46f126de6e02 | 3,759 | py | Python | drf_sample/drf_sample/settings.py | tipsi/fan_integration | e05029bb0a357a6d01ee5b0a6347fc6b1d39b890 | [
"MIT"
] | null | null | null | drf_sample/drf_sample/settings.py | tipsi/fan_integration | e05029bb0a357a6d01ee5b0a6347fc6b1d39b890 | [
"MIT"
] | null | null | null | drf_sample/drf_sample/settings.py | tipsi/fan_integration | e05029bb0a357a6d01ee5b0a6347fc6b1d39b890 | [
"MIT"
] | null | null | null | """
Django settings for drf_sample project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import ... | 25.06 | 91 | 0.652833 | import sys
import os
sys.path.append('/fan/')
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'ov0!!1=grqmn-1^gdcm87a+=al3)(t9xnionsx)*&oe&3l+x4*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.aut... | true | true |
f706ffa75534fea5b616d11980b8e5edcdb71734 | 941 | py | Python | app/routes.py | felixtomlinson/Script_Location_Reader | 67cdfd83c3cdd0d04b70781b96685507e78323fa | [
"MIT"
] | null | null | null | app/routes.py | felixtomlinson/Script_Location_Reader | 67cdfd83c3cdd0d04b70781b96685507e78323fa | [
"MIT"
] | 1 | 2018-06-06T17:34:02.000Z | 2018-06-06T17:34:02.000Z | app/routes.py | felixtomlinson/Script_Location_Reader | 67cdfd83c3cdd0d04b70781b96685507e78323fa | [
"MIT"
] | 1 | 2017-12-13T10:30:50.000Z | 2017-12-13T10:30:50.000Z | import os
from flask import render_template, url_for, redirect
from werkzeug.utils import secure_filename
from app import app
from app.forms import ScriptForm
from Script_reader import table_creator
@app.route('/', methods=['POST', 'GET'])
@app.route('/index', methods=['POST', 'GET'])
def index():
form = ScriptF... | 32.448276 | 109 | 0.700319 | import os
from flask import render_template, url_for, redirect
from werkzeug.utils import secure_filename
from app import app
from app.forms import ScriptForm
from Script_reader import table_creator
@app.route('/', methods=['POST', 'GET'])
@app.route('/index', methods=['POST', 'GET'])
def index():
form = ScriptF... | true | true |
f7070071c606f131a0565513cee6023cb6cc2bd6 | 5,777 | py | Python | lessons/CRISP_DM/RemovingData.py | aauss/DSND_Term2 | ff1ff8edc208652c29bfc25f18c610a02dc9d299 | [
"MIT"
] | null | null | null | lessons/CRISP_DM/RemovingData.py | aauss/DSND_Term2 | ff1ff8edc208652c29bfc25f18c610a02dc9d299 | [
"MIT"
] | null | null | null | lessons/CRISP_DM/RemovingData.py | aauss/DSND_Term2 | ff1ff8edc208652c29bfc25f18c610a02dc9d299 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from collections import defaultdict
import RemovingDataSolns as s
# Question 1
def prop_sals_test(prop_sals):
'''
INPUT prop_sals - a float as the percent of missing values in the salary column
Prints statement related to the correctness of the solution of ... | 47.743802 | 208 | 0.716808 | import pandas as pd
import numpy as np
from collections import defaultdict
import RemovingDataSolns as s
def prop_sals_test(prop_sals):
if np.allclose(prop_sals, s.prop_sals):
print("Nice job! That looks right!")
else:
print("Oops! Make sure your value is for the proportion of nan val... | true | true |
f707013f0ade202fd0dc1c40e6d97314a3fef583 | 1,692 | py | Python | tests/coupled/prescribed/prescribed_test.py | ACea15/sharpy | c89ecb74be3cb9e37b23ac8a282c73b9b55dd792 | [
"BSD-3-Clause"
] | 80 | 2018-08-30T13:01:52.000Z | 2022-03-24T15:02:48.000Z | tests/coupled/prescribed/prescribed_test.py | ACea15/sharpy | c89ecb74be3cb9e37b23ac8a282c73b9b55dd792 | [
"BSD-3-Clause"
] | 88 | 2018-05-17T16:18:58.000Z | 2022-03-11T21:05:48.000Z | tests/coupled/prescribed/prescribed_test.py | ACea15/sharpy | c89ecb74be3cb9e37b23ac8a282c73b9b55dd792 | [
"BSD-3-Clause"
] | 44 | 2018-01-02T14:27:28.000Z | 2022-03-12T13:49:36.000Z | # import sharpy.utils.settings as settings
# import sharpy.utils.exceptions as exceptions
# import sharpy.utils.cout_utils as cout
import numpy as np
import importlib
import unittest
import os
import sharpy.utils.cout_utils as cout
class TestCoupledPrescribed(unittest.TestCase):
"""
"""
@classmethod
... | 36.782609 | 98 | 0.647754 | import numpy as np
import importlib
import unittest
import os
import sharpy.utils.cout_utils as cout
class TestCoupledPrescribed(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
pass
... | true | true |
f707014da652c85523c03cb6b9953231332822dc | 7,766 | py | Python | isi_sdk_8_2_2/isi_sdk_8_2_2/models/cloud_proxy_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/cloud_proxy_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_2/isi_sdk_8_2_2/models/cloud_proxy_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_2_2.models.cloud_p... | 29.086142 | 111 | 0.578676 |
import pprint
import re
import six
from isi_sdk_8_2_2.models.cloud_proxy import CloudProxy
class CloudProxyCreateParams(object):
swagger_types = {
'host': 'str',
'name': 'str',
'password': 'str',
'port': 'int',
'type': 'str',
'username': 'str'
}
att... | true | true |
f707015ee5157714c8c543d7b3e2ce79d2298d9d | 652 | py | Python | service/api/urls.py | mohammedyousuf051/playlist | 21c570fcff6d58855e139b4ecdaf91b92aba37e3 | [
"MIT"
] | null | null | null | service/api/urls.py | mohammedyousuf051/playlist | 21c570fcff6d58855e139b4ecdaf91b92aba37e3 | [
"MIT"
] | null | null | null | service/api/urls.py | mohammedyousuf051/playlist | 21c570fcff6d58855e139b4ecdaf91b92aba37e3 | [
"MIT"
] | null | null | null | from django.urls import include, path
from rest_framework import routers
from . import views
from .views import *
router = routers.DefaultRouter()
router.register(r"tracks", views.TrackViewSet)
urlpatterns = [
path("", include(router.urls)),
path('playlist/add', PlaylistAPIView.as_view()),
path('allplayl... | 32.6 | 84 | 0.71319 | from django.urls import include, path
from rest_framework import routers
from . import views
from .views import *
router = routers.DefaultRouter()
router.register(r"tracks", views.TrackViewSet)
urlpatterns = [
path("", include(router.urls)),
path('playlist/add', PlaylistAPIView.as_view()),
path('allplayl... | true | true |
f7070232c44083e1755f69fd89696d2db684d2a2 | 2,250 | py | Python | pyiArduinoI2Cmatrix/examples/10Image.py | tremaru/pyiArduinoI2Cmatrix | 76cbe92c725d04ebf88bd0a46e1170b9bde55207 | [
"MIT"
] | null | null | null | pyiArduinoI2Cmatrix/examples/10Image.py | tremaru/pyiArduinoI2Cmatrix | 76cbe92c725d04ebf88bd0a46e1170b9bde55207 | [
"MIT"
] | null | null | null | pyiArduinoI2Cmatrix/examples/10Image.py | tremaru/pyiArduinoI2Cmatrix | 76cbe92c725d04ebf88bd0a46e1170b9bde55207 | [
"MIT"
] | null | null | null | # Данный пример выводит изображения myImage_1 и myImage_2.
# Создаём изображение "смайлик".
myImage_1 = [ 0b00111100, #
0b01000010, #
0b10100101, # ... | 70.3125 | 125 | 0.360444 | myImage_1 = [ 0b00111100, 0b01000010, 0b10100101, 0b10000001, 0b10100101, 0b10011001, 0b01000010, ... | true | true |
f707025075bdd4bca147ad41790eabda0c40b66a | 5,953 | py | Python | examples/if_this_then_that/ifttt_sports.py | rootless4real/cozmo-python-sdk | dd29edef18748fcd816550469195323842a7872e | [
"Apache-2.0"
] | 794 | 2016-10-14T16:56:34.000Z | 2022-03-31T16:21:21.000Z | examples/if_this_then_that/ifttt_sports.py | rootless4real/cozmo-python-sdk | dd29edef18748fcd816550469195323842a7872e | [
"Apache-2.0"
] | 63 | 2016-10-16T21:16:32.000Z | 2021-12-25T06:01:36.000Z | examples/if_this_then_that/ifttt_sports.py | rootless4real/cozmo-python-sdk | dd29edef18748fcd816550469195323842a7872e | [
"Apache-2.0"
] | 485 | 2016-10-14T19:49:43.000Z | 2022-03-29T17:30:09.000Z | #!/usr/bin/env python3
# Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | 39.423841 | 115 | 0.676298 |
import asyncio
import sys
try:
from aiohttp import web
except ImportError:
sys.exit("Cannot import from aiohttp. Do `pip3 install --user aiohttp` to install")
import cozmo
from common import IFTTTRobot
app = web.Application()
async def serve_sports(request):
json_object = await request.json()
... | true | true |
f70702dd2fe64f01093f2d17f089eb2272429f8c | 3,102 | py | Python | Creating_Web_services_in_Python/WEEK_4_Web_interfaces_with_Django_and_Bootstrap/praktichieskoie-zadaniie-po-shablonizatsii/coursera_assignment_tmp-master/template/views.py | diekaltesonne/PYTHON_COURSE | 16213ff2cfc18c2cbf52c9884722e004febbf7f4 | [
"MIT"
] | 1 | 2020-11-04T13:41:57.000Z | 2020-11-04T13:41:57.000Z | Creating_Web_services_in_Python/WEEK_4_Web_interfaces_with_Django_and_Bootstrap/praktichieskoie-zadaniie-po-shablonizatsii/coursera_assignment_tmp-master/template/views.py | diekaltesonne/Python_course | 16213ff2cfc18c2cbf52c9884722e004febbf7f4 | [
"MIT"
] | null | null | null | Creating_Web_services_in_Python/WEEK_4_Web_interfaces_with_Django_and_Bootstrap/praktichieskoie-zadaniie-po-shablonizatsii/coursera_assignment_tmp-master/template/views.py | diekaltesonne/Python_course | 16213ff2cfc18c2cbf52c9884722e004febbf7f4 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.views.decorators.http import require_http_methods
from django.shortcuts import render
import re
# Create your views here.
@require_http_methods(['GET', 'POST'])
def echo_0(request):
if request.method == 'GET' and something == None:
return render(request,'tem... | 33.354839 | 90 | 0.565442 | from django.http import HttpResponse
from django.views.decorators.http import require_http_methods
from django.shortcuts import render
import re
@require_http_methods(['GET', 'POST'])
def echo_0(request):
if request.method == 'GET' and something == None:
return render(request,'templates/echo.html',context)... | true | true |
f7070330779a9fe04827fb39e8aadcb73d617a6d | 5,282 | py | Python | gui/kivy/uix/dialogs/tx_dialog.py | cmmpay/cpwallet-cmm | 44b96d7c5ec500d13dbd128dd472c55eb4e0b2a8 | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/tx_dialog.py | cmmpay/cpwallet-cmm | 44b96d7c5ec500d13dbd128dd472c55eb4e0b2a8 | [
"MIT"
] | 1 | 2021-11-15T17:48:48.000Z | 2021-11-15T17:48:48.000Z | gui/kivy/uix/dialogs/tx_dialog.py | cmmpay/cpwallet-cmm | 44b96d7c5ec500d13dbd128dd472c55eb4e0b2a8 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from electrum_commercium_gui.kivy.i18n import _
from datetime import datetime
from electrum_commercium.util import InvalidPass... | 34.077419 | 150 | 0.531427 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from electrum_commercium_gui.kivy.i18n import _
from datetime import datetime
from electrum_commercium.util import InvalidPass... | true | true |
f70703e3975a63defe632a8b14c08ce2fa4889ae | 2,892 | py | Python | allennlp/interpret/saliency_interpreters/simple_gradient.py | pengshuang/allennlp | 478bf46cb676524ee9b74fb271ec0a592d1c4a48 | [
"Apache-2.0"
] | 8 | 2021-08-09T14:12:09.000Z | 2022-03-15T09:56:44.000Z | allennlp/interpret/saliency_interpreters/simple_gradient.py | ZhaofengWu/allennlp | 91d0fa1a51485c4118e48426d76328acd8049587 | [
"Apache-2.0"
] | 123 | 2020-04-26T02:41:30.000Z | 2021-08-02T21:18:00.000Z | allennlp/interpret/saliency_interpreters/simple_gradient.py | ZhaofengWu/allennlp | 91d0fa1a51485c4118e48426d76328acd8049587 | [
"Apache-2.0"
] | 5 | 2018-07-02T01:20:31.000Z | 2021-07-15T11:32:50.000Z | import math
from typing import List
import numpy
from allennlp.common.util import JsonDict, sanitize
from allennlp.interpret.saliency_interpreters.saliency_interpreter import SaliencyInterpreter
from allennlp.nn import util
@SaliencyInterpreter.register("simple-gradient")
class SimpleGradient(SaliencyInterpreter):
... | 44.492308 | 99 | 0.67462 | import math
from typing import List
import numpy
from allennlp.common.util import JsonDict, sanitize
from allennlp.interpret.saliency_interpreters.saliency_interpreter import SaliencyInterpreter
from allennlp.nn import util
@SaliencyInterpreter.register("simple-gradient")
class SimpleGradient(SaliencyInterpreter):
... | true | true |
f70704c8ef49eaa798541455885f97467add1c0b | 4,245 | py | Python | pypureclient/flasharray/FA_2_5/models/qos.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_5/models/qos.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_5/models/qos.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 33.164063 | 207 | 0.568905 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_5 import models
class Qos(object):
swagger_types = {
'bandwidth_limit': 'int',
'iops_limit': 'int'
}
attribute_map = {
'bandwidth... | true | true |
f707063cbdc77dd2af91b752dfa16f337acc8732 | 3,174 | bzl | Python | pw_build/pigweed.bzl | janosmurai/pigweed | e302587f8912c65db2ccf2821453a3a244e14732 | [
"Apache-2.0"
] | null | null | null | pw_build/pigweed.bzl | janosmurai/pigweed | e302587f8912c65db2ccf2821453a3a244e14732 | [
"Apache-2.0"
] | null | null | null | pw_build/pigweed.bzl | janosmurai/pigweed | e302587f8912c65db2ccf2821453a3a244e14732 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 28.339286 | 82 | 0.672338 |
DEBUGGING = [
"-g",
]
REDUCED_SIZE_COPTS = [
"-fno-common",
"-fno-exceptions",
"-ffunction-sections",
"-fdata-sections",
]
STRICT_WARNINGS_COPTS = [
"-Wall",
"-Wextra",
"-Werror",
"-Wno-error=cpp", "-Wno-error=deprecated-declarations", ]
CPP17_COPTS = [
"-std=c++17... | true | true |
f70706decb1ee64f87a23cb104cbab753738c9bd | 4,816 | py | Python | website/addons/github/routes.py | harrismendell/osf.io | e2727b1bb2aaa7de494f941be08cb3e9305ae624 | [
"Apache-2.0"
] | null | null | null | website/addons/github/routes.py | harrismendell/osf.io | e2727b1bb2aaa7de494f941be08cb3e9305ae624 | [
"Apache-2.0"
] | null | null | null | website/addons/github/routes.py | harrismendell/osf.io | e2727b1bb2aaa7de494f941be08cb3e9305ae624 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from framework.routing import Rule, json_renderer
from website.addons.github import views
settings_routes = {
'rules': [
# Configuration
Rule(
[
'/project/<pid>/github/settings/',
'/project/<pid>/node/<nid>/github/settings/',
... | 25.617021 | 70 | 0.422757 |
from framework.routing import Rule, json_renderer
from website.addons.github import views
settings_routes = {
'rules': [
Rule(
[
'/project/<pid>/github/settings/',
'/project/<pid>/node/<nid>/github/settings/',
],
'post',
... | true | true |
f707082ecc50ab313ab037c031d2b914ba9a2a34 | 70 | py | Python | sphinx/build/reamber/algorithms/generate/sv/generators/svOsuMeasureLine-1.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | 10 | 2020-06-28T11:16:36.000Z | 2021-08-09T21:41:43.000Z | sphinx/build/reamber/algorithms/generate/sv/generators/svOsuMeasureLine-1.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | 35 | 2020-06-18T13:05:50.000Z | 2022-02-18T10:13:35.000Z | docs/reamber/algorithms/generate/sv/generators/SvOsuMeasureLine-1.py | Eve-ning/reamber_base_py | 6d19c84f2c110b60e633b82b73e0516396466f56 | [
"MIT"
] | 2 | 2021-05-26T17:05:06.000Z | 2021-06-12T18:42:13.000Z | import matplotlib.pyplot as plt
from math import pi
import numpy as np | 23.333333 | 31 | 0.828571 | import matplotlib.pyplot as plt
from math import pi
import numpy as np | true | true |
f707090f141f031ebce45611f2e592bfb5aa3905 | 22,309 | py | Python | tensor2tensor/data_generators/problem.py | webdeveloper0012/Tensor2tensor | 48bce065278eba461c8a2840e4132becbc822c7c | [
"Apache-2.0"
] | 1 | 2021-02-26T10:25:54.000Z | 2021-02-26T10:25:54.000Z | tensor2tensor/data_generators/problem.py | webdeveloper0012/Tensor2tensor | 48bce065278eba461c8a2840e4132becbc822c7c | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/problem.py | webdeveloper0012/Tensor2tensor | 48bce065278eba461c8a2840e4132becbc822c7c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2017 The Tensor2Tensor 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... | 32.952733 | 80 | 0.68618 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import random
import six
from tensor2tensor.data_generators import generator_utils
from tensor2tensor.data_generators import text_encoder
from tensor2tensor.utils import metrics
fro... | true | true |
f70709d9245cc6871fc30af40a42a1323a626d85 | 19,582 | py | Python | bin/ingest.py | KhalilMrini/acl-anthology | ca36605b81b508ee3d70480a41e92f4e11c29032 | [
"Apache-2.0"
] | null | null | null | bin/ingest.py | KhalilMrini/acl-anthology | ca36605b81b508ee3d70480a41e92f4e11c29032 | [
"Apache-2.0"
] | null | null | null | bin/ingest.py | KhalilMrini/acl-anthology | ca36605b81b508ee3d70480a41e92f4e11c29032 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2019, 2020 Matt Post <post@cs.jhu.edu>
#
# 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/LICE... | 36.739212 | 94 | 0.552906 |
import argparse
import iso639
import os
import re
import readline
import shutil
import sys
import lxml.etree as etree
from collections import defaultdict, OrderedDict
from datetime import datetime
from normalize_anth import normalize
from anthology.bibtex import read_bibtex
from anthology.index import AnthologyInd... | true | true |
f7070d657862af43cffe15ffc3bd75dec3b00737 | 1,896 | py | Python | Tensorflow-tutorials/tutorial-2-image-classifier/predict2.py | A-Charvin/cv-tricks.com | 3c6da9c62665abefa6114e0b7f0c39a0a012f496 | [
"MIT"
] | null | null | null | Tensorflow-tutorials/tutorial-2-image-classifier/predict2.py | A-Charvin/cv-tricks.com | 3c6da9c62665abefa6114e0b7f0c39a0a012f496 | [
"MIT"
] | null | null | null | Tensorflow-tutorials/tutorial-2-image-classifier/predict2.py | A-Charvin/cv-tricks.com | 3c6da9c62665abefa6114e0b7f0c39a0a012f496 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os,glob,cv2
import sys,argparse
# First, pass the path of the image
dir_path = os.path.dirname(os.path.realpath(__file__))
image_path=sys.argv[1]
filename = dir_path +'/' +image_path
image_size=128
num_channels=3
images = []
# Reading the image using OpenCV
image = c... | 37.92 | 103 | 0.768987 | import tensorflow as tf
import numpy as np
import os,glob,cv2
import sys,argparse
dir_path = os.path.dirname(os.path.realpath(__file__))
image_path=sys.argv[1]
filename = dir_path +'/' +image_path
image_size=128
num_channels=3
images = []
image = cv2.imread(filename)
image = cv2.resize(image, (image_size, image_size... | true | true |
f7070e00041db82b5e7c16d7f5ffead49b45cb9d | 7,057 | py | Python | tools/mytools/ARIA/src/py/aria/NOEModel.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | tools/mytools/ARIA/src/py/aria/NOEModel.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | tools/mytools/ARIA/src/py/aria/NOEModel.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | """
ARIA -- Ambiguous Restraints for Iterative Assignment
A software for automated NOE assignment
Version 2.3
Copyright (C) Benjamin Bardiaux, Michael Habeck, Therese Malliavin,
Wolfgang Rieping, and Michael Nilges
All rights reserved.
NO W... | 29.282158 | 98 | 0.614992 |
from aria.ariabase import *
from numpy import *
from aria.Settings import Settings
class NOEModel(AriaBaseClass):
def __init__(self):
AriaBaseClass.__init__(self)
from aria.Contribution import ContributionEvaluator
self.__evaluator = ContributionEvaluator()
self.i... | true | true |
f7070e3c8c9061a7867b5a9b9d321ebd8ce741cd | 3,496 | py | Python | utils/losses.py | 87003697/Segmentation | 5973a64768632fc52c55f9ffc9f0b43746699b37 | [
"MIT"
] | null | null | null | utils/losses.py | 87003697/Segmentation | 5973a64768632fc52c55f9ffc9f0b43746699b37 | [
"MIT"
] | null | null | null | utils/losses.py | 87003697/Segmentation | 5973a64768632fc52c55f9ffc9f0b43746699b37 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from sklearn.utils import class_weight
from utils.lovasz_losses import lovasz_softmax
import pdb
def make_one_hot(labels, classes):
one_hot = torch.FloatTensor(labels.size()[0], classes, labels.size()[2], labels.size()[3]).zero_... | 38.417582 | 120 | 0.66476 | import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from sklearn.utils import class_weight
from utils.lovasz_losses import lovasz_softmax
import pdb
def make_one_hot(labels, classes):
one_hot = torch.FloatTensor(labels.size()[0], classes, labels.size()[2], labels.size()[3]).zero_... | true | true |
f7070e9829949b7818b7398d2805a4d51dced4bb | 16,109 | py | Python | src/anyio/_core/_synchronization.py | JonathanPlasse/anyio | 4c87f0783549b4e00a09d856fecf7b124ffb5244 | [
"MIT"
] | null | null | null | src/anyio/_core/_synchronization.py | JonathanPlasse/anyio | 4c87f0783549b4e00a09d856fecf7b124ffb5244 | [
"MIT"
] | null | null | null | src/anyio/_core/_synchronization.py | JonathanPlasse/anyio | 4c87f0783549b4e00a09d856fecf7b124ffb5244 | [
"MIT"
] | null | null | null | from collections import deque
from dataclasses import dataclass
from types import TracebackType
from typing import Deque, Optional, Tuple, Type
from warnings import warn
from ..lowlevel import cancel_shielded_checkpoint, checkpoint, checkpoint_if_cancelled
from ._compat import DeprecatedAwaitable
from ._eventloop impo... | 29.182971 | 99 | 0.627475 | from collections import deque
from dataclasses import dataclass
from types import TracebackType
from typing import Deque, Optional, Tuple, Type
from warnings import warn
from ..lowlevel import cancel_shielded_checkpoint, checkpoint, checkpoint_if_cancelled
from ._compat import DeprecatedAwaitable
from ._eventloop impo... | true | true |
f7071061849bb3be7b47faa1e7edfbdcb7fd5e97 | 5,537 | py | Python | nova/api/openstack/compute/image_metadata.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | 2 | 2021-10-11T04:56:25.000Z | 2022-02-16T08:49:29.000Z | nova/api/openstack/compute/image_metadata.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/api/openstack/compute/image_metadata.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 8 | 2017-03-27T07:50:38.000Z | 2020-02-14T16:55:56.000Z | # Copyright 2011 OpenStack Foundation
# 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 requ... | 41.320896 | 78 | 0.653422 |
from webob import exc
from nova.api.openstack.api_version_request import \
MAX_IMAGE_META_PROXY_API_VERSION
from nova.api.openstack import common
from nova.api.openstack.compute.schemas import image_metadata
from nova.api.openstack import wsgi
from nova.api import validation
from nova import exception
from nova.... | true | true |
f7071061d07ab6f901fd672c19e2ec3b002d50a4 | 36,669 | py | Python | pandas/core/sparse/frame.py | meeseeksmachine/pandas | 27ebb3e1e40513ad5f8919a5bbc7298e2e070a39 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2018-07-19T12:18:52.000Z | 2018-07-19T12:18:52.000Z | pandas/core/sparse/frame.py | meeseeksmachine/pandas | 27ebb3e1e40513ad5f8919a5bbc7298e2e070a39 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/sparse/frame.py | meeseeksmachine/pandas | 27ebb3e1e40513ad5f8919a5bbc7298e2e070a39 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-01-04T07:52:37.000Z | 2019-01-04T07:52:37.000Z | """
Data structures for sparse float data. Life is made simpler by dealing only
with float64 data
"""
from __future__ import division
# pylint: disable=E1101,E1103,W0231,E0202
import warnings
from pandas.compat import lmap
from pandas import compat
import numpy as np
from pandas.core.dtypes.missing import isna, notna... | 36.020629 | 79 | 0.584281 | from __future__ import division
import warnings
from pandas.compat import lmap
from pandas import compat
import numpy as np
from pandas.core.dtypes.missing import isna, notna
from pandas.core.dtypes.cast import maybe_upcast, find_common_type
from pandas.core.dtypes.common import ensure_platform_int, is_scipy_sparse
... | true | true |
f70710908596563a0d2c6f6850a3931c21b4378a | 4,294 | py | Python | AZBot/teleBot.py | ariaamadeus/BacaPDF | a2f411da9c7b0d4372e205f75368e4f59c02a3d1 | [
"MIT"
] | null | null | null | AZBot/teleBot.py | ariaamadeus/BacaPDF | a2f411da9c7b0d4372e205f75368e4f59c02a3d1 | [
"MIT"
] | null | null | null | AZBot/teleBot.py | ariaamadeus/BacaPDF | a2f411da9c7b0d4372e205f75368e4f59c02a3d1 | [
"MIT"
] | null | null | null | import time
import telebot
from Responses import TELE_HI_GREET, TELE_CLASS_CODE
import BacaPdf as pdf
import csvHandler as csvH
with open('API_KEY.txt') as API_KEY:
bot = telebot.TeleBot(API_KEY.read()[:-1])
#Message type check
#ClassCode, TimeInterval, Status, Feedback
messageBool = [False, False,... | 33.286822 | 135 | 0.628319 | import time
import telebot
from Responses import TELE_HI_GREET, TELE_CLASS_CODE
import BacaPdf as pdf
import csvHandler as csvH
with open('API_KEY.txt') as API_KEY:
bot = telebot.TeleBot(API_KEY.read()[:-1])
messageBool = [False, False, False, False]
def Echooo(themessage):
for ID in csvH.Al... | true | true |
f70710af1c9c1ee7f663d29e91c58788228812b7 | 957 | py | Python | source/complice_triager.py | giovannicoppola/alfred-complice | 3ccb21547cab633e8782cee3ada8e7a049a4cc66 | [
"BSD-3-Clause-Attribution"
] | 1 | 2021-11-10T03:07:56.000Z | 2021-11-10T03:07:56.000Z | source/complice_triager.py | giovannicoppola/alfred-complice | 3ccb21547cab633e8782cee3ada8e7a049a4cc66 | [
"BSD-3-Clause-Attribution"
] | 2 | 2022-02-10T09:32:03.000Z | 2022-02-18T10:19:59.000Z | source/complice_triager.py | giovannicoppola/alfred-complice | 3ccb21547cab633e8782cee3ada8e7a049a4cc66 | [
"BSD-3-Clause-Attribution"
] | null | null | null | #!/usr/bin/python3
# encoding: utf-8
### python script to interact with Complice
### giovanni, Saturday, April 10, 2021, 2:11 PM
### March 2022 updated to Python 3
import sys
from config import POMOLENGTH, TIMERLENGTH, TOKEN
import complice_post
myInput = sys.argv[1]
if myInput == "startTimer":
complic... | 18.764706 | 49 | 0.716823 |
import sys
from config import POMOLENGTH, TIMERLENGTH, TOKEN
import complice_post
myInput = sys.argv[1]
if myInput == "startTimer":
complice_post.start_hourglass()
if myInput == "startPomo":
complice_post.start_pomo()
if myInput == "Timer30":
complice_post.start_custom_hourglass30()
... | true | true |
f70710e622e29b88ff546c1cea16be884932d06d | 7,825 | py | Python | tests/test_serverless.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | 1 | 2021-02-14T15:18:12.000Z | 2021-02-14T15:18:12.000Z | tests/test_serverless.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | null | null | null | tests/test_serverless.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | 5 | 2020-05-10T13:50:32.000Z | 2021-09-09T09:06:54.000Z | import unittest
from troposphere import Tags, Template
from troposphere.s3 import Filter, Rules, S3Key
from troposphere.serverless import (
Api, DeadLetterQueue, DeploymentPreference, Function, FunctionForPackaging,
LayerVersion, S3Event, S3Location, SimpleTable,
)
class TestServerless(unittest.TestCase):
... | 28.046595 | 79 | 0.474121 | import unittest
from troposphere import Tags, Template
from troposphere.s3 import Filter, Rules, S3Key
from troposphere.serverless import (
Api, DeadLetterQueue, DeploymentPreference, Function, FunctionForPackaging,
LayerVersion, S3Event, S3Location, SimpleTable,
)
class TestServerless(unittest.TestCase):
... | true | true |
f7071119b89186522d9e94b32679b24c49a01d8a | 3,469 | py | Python | Visualize/freq_by_time_plot.py | takkasila/GeoAnalysis_Twit | a14801906e935c31b54582d2c219b19916e0ee63 | [
"MIT"
] | null | null | null | Visualize/freq_by_time_plot.py | takkasila/GeoAnalysis_Twit | a14801906e935c31b54582d2c219b19916e0ee63 | [
"MIT"
] | null | null | null | Visualize/freq_by_time_plot.py | takkasila/GeoAnalysis_Twit | a14801906e935c31b54582d2c219b19916e0ee63 | [
"MIT"
] | null | null | null | import sys
import csv
import time
import calendar
import matplotlib.pyplot as plt
from collections import OrderedDict
from datetime import date, timedelta as td
if __name__ == '__main__':
if len(sys.argv) < 2:
print 'Please insert processed twitdata.csv'
exit()
twitReader = csv.DictReader(ope... | 36.135417 | 176 | 0.625829 | import sys
import csv
import time
import calendar
import matplotlib.pyplot as plt
from collections import OrderedDict
from datetime import date, timedelta as td
if __name__ == '__main__':
if len(sys.argv) < 2:
print 'Please insert processed twitdata.csv'
exit()
twitReader = csv.DictReader(ope... | false | true |
f70711283e8b666596cee0773d2271d34f958cea | 7,068 | py | Python | floweditor/views.py | PeterCloudyWillmott/biffy | c632bd7792f211688e7085a65c9f0af24fec5d98 | [
"MIT"
] | 2 | 2015-03-19T22:59:05.000Z | 2019-04-11T20:15:23.000Z | floweditor/views.py | onixus74/biffy | c632bd7792f211688e7085a65c9f0af24fec5d98 | [
"MIT"
] | null | null | null | floweditor/views.py | onixus74/biffy | c632bd7792f211688e7085a65c9f0af24fec5d98 | [
"MIT"
] | 1 | 2019-04-11T20:15:25.000Z | 2019-04-11T20:15:25.000Z | from django.shortcuts import render
from django.http import JsonResponse
from django.http import HttpResponse, HttpResponseNotFound
from django.contrib.auth.decorators import login_required
from floweditor.models import B1if
from easywebdavbiffy import *
import xmltodict
import StringIO
from zipfile import ZipFile
from... | 41.576471 | 229 | 0.759196 | from django.shortcuts import render
from django.http import JsonResponse
from django.http import HttpResponse, HttpResponseNotFound
from django.contrib.auth.decorators import login_required
from floweditor.models import B1if
from easywebdavbiffy import *
import xmltodict
import StringIO
from zipfile import ZipFile
from... | true | true |
f70711468420152d926e040d3a9335a283503ad6 | 4,890 | py | Python | gslib/commands/cat.py | rjschwei/gsutil | 4b5fdbafc2a4f498e7e4c755c5045c9483327f0c | [
"Apache-2.0"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | gslib/commands/cat.py | rjschwei/gsutil | 4b5fdbafc2a4f498e7e4c755c5045c9483327f0c | [
"Apache-2.0"
] | 1 | 2021-02-23T22:20:14.000Z | 2021-02-23T22:20:14.000Z | gslib/commands/cat.py | rjschwei/gsutil | 4b5fdbafc2a4f498e7e4c755c5045c9483327f0c | [
"Apache-2.0"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | # -*- coding: utf-8 -*-
# Copyright 2011 Google Inc. All Rights Reserved.
# Copyright 2011, Nexenta Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 33.724138 | 80 | 0.648671 |
from __future__ import absolute_import
import re
from gslib.cat_helper import CatHelper
from gslib.command import Command
from gslib.command_argument import CommandArgument
from gslib.cs_api_map import ApiSelector
from gslib.exception import CommandException
from gslib.util import NO_MAX
_SYNOPSIS = """
gsutil ca... | true | true |
f70711efe97d7937b3ed35c84101300462901e79 | 1,229 | py | Python | src/nav/nav_tests/src/azmutils.py | APMMonteiro/european_robotic_league | 1a7345bdbdf4a57c434c6fda44b0714c277877a7 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/nav/nav_tests/src/azmutils.py | APMMonteiro/european_robotic_league | 1a7345bdbdf4a57c434c6fda44b0714c277877a7 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/nav/nav_tests/src/azmutils.py | APMMonteiro/european_robotic_league | 1a7345bdbdf4a57c434c6fda44b0714c277877a7 | [
"BSD-3-Clause-Clear"
] | 5 | 2021-11-26T12:06:56.000Z | 2022-02-15T14:15:16.000Z | from math import sqrt
from math import pi
import json
import tf
from geometry_msgs.msg import Quaternion
def dynamic_euclid_dist(a, b):
o = 0
for i in range(len(a)):
o += (a[i]-b[i])**2
return sqrt(o)
def quaternion_from_euler(roll, pitch, yaw):
'''
From HSR's utils.py
'''
q = tf.t... | 26.717391 | 112 | 0.573637 | from math import sqrt
from math import pi
import json
import tf
from geometry_msgs.msg import Quaternion
def dynamic_euclid_dist(a, b):
o = 0
for i in range(len(a)):
o += (a[i]-b[i])**2
return sqrt(o)
def quaternion_from_euler(roll, pitch, yaw):
q = tf.transformations.quaternion_from_euler(rol... | true | true |
f707122efe7d3e1624e537fa21b25a7e8bc0b353 | 8,259 | py | Python | anchore_engine/services/apiext/api/controllers/archive.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 1,484 | 2017-09-11T19:08:42.000Z | 2022-03-29T07:47:44.000Z | anchore_engine/services/apiext/api/controllers/archive.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 913 | 2017-09-27T20:37:53.000Z | 2022-03-29T17:21:28.000Z | anchore_engine/services/apiext/api/controllers/archive.py | rbrady/anchore-engine | 5a5c492d76b5f911e60be422912fe8d42a74872b | [
"Apache-2.0"
] | 294 | 2017-09-12T16:54:03.000Z | 2022-03-14T01:28:51.000Z | import re
from anchore_engine.apis.authorization import (
ActionBoundPermission,
Permission,
RequestingAccountValue,
get_authorizer,
)
from anchore_engine.apis.context import ApiRequestContextProxy
from anchore_engine.apis.exceptions import BadRequest
from anchore_engine.clients.services import interna... | 33.437247 | 125 | 0.684344 | import re
from anchore_engine.apis.authorization import (
ActionBoundPermission,
Permission,
RequestingAccountValue,
get_authorizer,
)
from anchore_engine.apis.context import ApiRequestContextProxy
from anchore_engine.apis.exceptions import BadRequest
from anchore_engine.clients.services import interna... | true | true |
f7071377e87c1543283b97671722625c0240605c | 1,405 | py | Python | setup.py | brymck/pygclip | 63d3002a7463ebcf57c19354cfeed1a79585bf41 | [
"MIT"
] | null | null | null | setup.py | brymck/pygclip | 63d3002a7463ebcf57c19354cfeed1a79585bf41 | [
"MIT"
] | null | null | null | setup.py | brymck/pygclip | 63d3002a7463ebcf57c19354cfeed1a79585bf41 | [
"MIT"
] | null | null | null | import io
import re
import sys
from setuptools import setup
if sys.version_info < (3, 5):
sys.exit('Sorry, Python < 3.5 is not supported.')
with io.open('README.rst', 'rt', encoding='utf8') as f:
readme = f.read()
with io.open('pygclip/__init__.py', 'rt', encoding='utf8') as f:
version = re.search(r'__ve... | 24.224138 | 70 | 0.557295 | import io
import re
import sys
from setuptools import setup
if sys.version_info < (3, 5):
sys.exit('Sorry, Python < 3.5 is not supported.')
with io.open('README.rst', 'rt', encoding='utf8') as f:
readme = f.read()
with io.open('pygclip/__init__.py', 'rt', encoding='utf8') as f:
version = re.search(r'__ve... | true | true |
f70714ede073cd6facf92842d4ff92e6d88d7122 | 237 | py | Python | 06-Curriculum-Resources/utils/unsolve_script/setup.py | anirudhmungre/sneaky-lessons | 8e48015c50865059db96f8cd369bcc15365d66c7 | [
"ADSL"
] | 1 | 2021-04-13T07:14:34.000Z | 2021-04-13T07:14:34.000Z | 06-Curriculum-Resources/utils/unsolve_script/setup.py | anirudhmungre/sneaky-lessons | 8e48015c50865059db96f8cd369bcc15365d66c7 | [
"ADSL"
] | 2 | 2021-06-02T03:14:19.000Z | 2022-02-11T23:21:24.000Z | 06-Curriculum-Resources/utils/unsolve_script/setup.py | anirudhmungre/sneaky-lessons | 8e48015c50865059db96f8cd369bcc15365d66c7 | [
"ADSL"
] | 1 | 2021-05-07T13:26:50.000Z | 2021-05-07T13:26:50.000Z | from setuptools import setup
setup(
name='unsolve',
version='0.1',
py_modules=['unsolve'],
install_requires=[
'Click',
],
entry_points='''
[console_scripts]
unsolve=unsolve:cli
''',
)
| 15.8 | 28 | 0.556962 | from setuptools import setup
setup(
name='unsolve',
version='0.1',
py_modules=['unsolve'],
install_requires=[
'Click',
],
entry_points='''
[console_scripts]
unsolve=unsolve:cli
''',
)
| true | true |
f70715cd939d13bf965ac07f8dd3e07ed055a580 | 2,603 | py | Python | k/resources/gen-spec.py | vaporlang/verified-vyper-contracts | 0f2957a5a73eea09adebe354cc3c977605ecb15e | [
"Apache-2.0"
] | 45 | 2018-11-12T00:38:44.000Z | 2022-01-06T18:15:39.000Z | k/resources/gen-spec.py | vaporlang/verified-vyper-contracts | 0f2957a5a73eea09adebe354cc3c977605ecb15e | [
"Apache-2.0"
] | 52 | 2018-11-12T06:58:25.000Z | 2021-04-19T15:12:34.000Z | k/resources/gen-spec.py | vaporlang/verified-vyper-contracts | 0f2957a5a73eea09adebe354cc3c977605ecb15e | [
"Apache-2.0"
] | 8 | 2018-11-21T03:19:57.000Z | 2022-02-22T17:13:01.000Z | #!/usr/bin/env python3
import sys
import re
import configparser
def app(specs, spec):
if not specs:
return spec
else:
delimiter = "\n\n"
return delimiter.join((specs, spec))
# TODO: for Python 3.5 or higher: z = {**x, **y}
def merge_two_dicts(x, y):
z = dict(x)
z.update(y)
re... | 32.5375 | 105 | 0.593162 |
import sys
import re
import configparser
def app(specs, spec):
if not specs:
return spec
else:
delimiter = "\n\n"
return delimiter.join((specs, spec))
def merge_two_dicts(x, y):
z = dict(x)
z.update(y)
return z
def subst(text, key, val):
return text.replace('{' + key.upp... | true | true |
f707167e2db22dce557124444fe29dc665992953 | 2,105 | py | Python | src/mist/api/dummy/rbac.py | SpiralUp/mist.api | a3b5233ab4aa3f6a0a2dea6333ff1e5a260af934 | [
"Apache-2.0"
] | 6 | 2017-08-24T00:34:30.000Z | 2022-01-16T21:29:22.000Z | src/mist/api/dummy/rbac.py | SpiralUp/mist.api | a3b5233ab4aa3f6a0a2dea6333ff1e5a260af934 | [
"Apache-2.0"
] | 9 | 2021-03-31T18:50:47.000Z | 2022-01-09T23:20:02.000Z | src/mist/api/dummy/rbac.py | SpiralUp/mist.api | a3b5233ab4aa3f6a0a2dea6333ff1e5a260af934 | [
"Apache-2.0"
] | 13 | 2017-09-21T18:17:02.000Z | 2022-02-21T04:29:25.000Z | import logging
import mist.api.users.models
import mist.api.auth.models
import mist.api.tag.models
log = logging.getLogger(__name__)
class AuthContext(object):
def __init__(self, user, token):
assert isinstance(user, mist.api.users.models.User)
self.user = user
assert isinstance(token... | 27.337662 | 79 | 0.619002 | import logging
import mist.api.users.models
import mist.api.auth.models
import mist.api.tag.models
log = logging.getLogger(__name__)
class AuthContext(object):
def __init__(self, user, token):
assert isinstance(user, mist.api.users.models.User)
self.user = user
assert isinstance(token... | true | true |
f70716a91a0947727e29352772847929d829fc4e | 1,544 | py | Python | encargo-backend/app/encargoapi/auth/tests/test_auth.py | coonprogrammer/encargoexpress | ca8d9eeec47f59486113780e0b1c2a54dcc89043 | [
"MIT"
] | null | null | null | encargo-backend/app/encargoapi/auth/tests/test_auth.py | coonprogrammer/encargoexpress | ca8d9eeec47f59486113780e0b1c2a54dcc89043 | [
"MIT"
] | null | null | null | encargo-backend/app/encargoapi/auth/tests/test_auth.py | coonprogrammer/encargoexpress | ca8d9eeec47f59486113780e0b1c2a54dcc89043 | [
"MIT"
] | null | null | null | import json
import base64
from tests import TestBase
class TestAuth(TestBase):
def setUp(self):
super(TestAuth, self).setUp()
self.data_user = {
'username': 'nicolas',
'password': 'password',
}
def test_auth(self):
self.app.post(
... | 26.62069 | 66 | 0.441062 | import json
import base64
from tests import TestBase
class TestAuth(TestBase):
def setUp(self):
super(TestAuth, self).setUp()
self.data_user = {
'username': 'nicolas',
'password': 'password',
}
def test_auth(self):
self.app.post(
... | true | true |
f70717b8757cb159c844eb3a1e9d56b569e141ec | 1,210 | py | Python | devilry/project/develop/middleware.py | devilry/devilry-django | 9ae28e462dfa4cfee966ebacbca04ade9627e715 | [
"BSD-3-Clause"
] | 29 | 2015-01-18T22:56:23.000Z | 2020-11-10T21:28:27.000Z | devilry/project/develop/middleware.py | devilry/devilry-django | 9ae28e462dfa4cfee966ebacbca04ade9627e715 | [
"BSD-3-Clause"
] | 786 | 2015-01-06T16:10:18.000Z | 2022-03-16T11:10:50.000Z | devilry/project/develop/middleware.py | devilry/devilry-django | 9ae28e462dfa4cfee966ebacbca04ade9627e715 | [
"BSD-3-Clause"
] | 15 | 2015-04-06T06:18:43.000Z | 2021-02-24T12:28:30.000Z | from django.contrib import auth
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class FakeLoginMiddleware(MiddlewareMixin):
"""
Login using ?fakeuser=USERNAME as long as settings.DEBUG is true.
This is for DEVELOPMENT ONLY.
"""
def process_request(self, requ... | 37.8125 | 83 | 0.628099 | from django.contrib import auth
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class FakeLoginMiddleware(MiddlewareMixin):
def process_request(self, request):
if settings.DEBUG and 'fakeuser' in request.GET:
username = request.GET['fakeuser']
... | true | true |
f70717e8fce8ef0a46f784c00326ffa9ec40db17 | 403 | py | Python | get_version.py | erramuzpe/mriqc | 03eb869b0966cf27fe85db88a970f8ab8640c9e9 | [
"BSD-3-Clause"
] | 1 | 2021-12-16T10:34:46.000Z | 2021-12-16T10:34:46.000Z | get_version.py | erramuzpe/mriqc | 03eb869b0966cf27fe85db88a970f8ab8640c9e9 | [
"BSD-3-Clause"
] | null | null | null | get_version.py | erramuzpe/mriqc | 03eb869b0966cf27fe85db88a970f8ab8640c9e9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# @Author: oesteban
# @Date: 2017-06-13 09:42:38
import os.path as op
import sys
def main():
from mriqc.__about__ import __version__
print(__version_... | 22.388889 | 73 | 0.637717 | import os.path as op
import sys
def main():
from mriqc.__about__ import __version__
print(__version__)
if __name__ == '__main__':
sys.path.insert(0, op.abspath('.'))
main()
| true | true |
f7071830227799a49171f479948124a49ebe3646 | 79,306 | py | Python | angr/engines/vex/ccall.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | null | null | null | angr/engines/vex/ccall.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | null | null | null | angr/engines/vex/ccall.py | aeflores/angr | ac85a3f168375ed0ee20551b1b716c1bff4ac02b | [
"BSD-2-Clause"
] | null | null | null | import claripy
import logging
from archinfo.arch_arm import is_arm_arch
l = logging.getLogger(name=__name__)
#l.setLevel(logging.DEBUG)
# pylint: disable=R0911
# pylint: disable=W0613
# pylint: disable=W0612
# pylint: disable=invalid-unary-operand-type
###############
### Helpers ###
###############
# There might b... | 43.670705 | 201 | 0.644012 | import claripy
import logging
from archinfo.arch_arm import is_arm_arch
l = logging.getLogger(name=__name__)
def calc_paritybit(state, p, msb=7, lsb=0):
if len(p) > msb:
p_part = p[msb:lsb]
else:
p_part = p
b = state.solver.BVV(1, 1)
for i in range(p_part.size()):
b = b ^ p_... | true | true |
f707190056d85fc7244684bc97fee8f0a9b8096e | 18,052 | py | Python | tensorflow_federated/python/core/impl/tree_to_cc_transformations_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 1 | 2020-08-27T14:16:06.000Z | 2020-08-27T14:16:06.000Z | tensorflow_federated/python/core/impl/tree_to_cc_transformations_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/tree_to_cc_transformations_test.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, The TensorFlow Federated 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... | 49.322404 | 107 | 0.725958 |
import tensorflow as tf
from tensorflow_federated.python.common_libs import test
from tensorflow_federated.python.core.api import computation_types
from tensorflow_federated.python.core.impl import tree_to_cc_transformations
from tensorflow_federated.python.core.impl.compiler import building_block_factory
from tensor... | true | true |
f7071a31fe28b13be8a97e806e583ceeb5f5df18 | 9,994 | py | Python | h2o-py/tests/testdir_algos/automl/target_encoding/pyunit_automl_target_encoding.py | jbentleyEG/h2o-3 | 93f1084b5e244beca517b0a1fc8b0c02061d597f | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_algos/automl/target_encoding/pyunit_automl_target_encoding.py | jbentleyEG/h2o-3 | 93f1084b5e244beca517b0a1fc8b0c02061d597f | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_algos/automl/target_encoding/pyunit_automl_target_encoding.py | jbentleyEG/h2o-3 | 93f1084b5e244beca517b0a1fc8b0c02061d597f | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys, os, time
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.targetencoder import TargetEncoder
"""
This test is used to check Rapids wrapper for java TargetEncoder
"""
def test_target_encoding_parameters():
print("C... | 44.816143 | 133 | 0.741345 | from __future__ import print_function
import sys, os, time
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.targetencoder import TargetEncoder
def test_target_encoding_parameters():
print("Check arguments to TargetEncoder class")
targetEncoder = TargetEncoder... | true | true |
f7071a9607608286e237d9d2a2ab5e8c0950b2e5 | 2,027 | py | Python | dataset_characteristics.py | jamesdu0504/760GroupProject | dd870b3af7958fb2088c627ab02c781412b2a20f | [
"MIT"
] | 1 | 2021-11-01T07:09:51.000Z | 2021-11-01T07:09:51.000Z | dataset_characteristics.py | jamesdu0504/760GroupProject | dd870b3af7958fb2088c627ab02c781412b2a20f | [
"MIT"
] | null | null | null | dataset_characteristics.py | jamesdu0504/760GroupProject | dd870b3af7958fb2088c627ab02c781412b2a20f | [
"MIT"
] | null | null | null | import datasets.import_datasets as im
import pandas as pd
#Takes a very long time to run, probably not worth running when the output
datasets = ["BMS1",
"BMS2",
"toydata"
"uci_retail",
"mushroom",
"Belgian_retail",
"chess",
"conn... | 31.184615 | 75 | 0.507153 | import datasets.import_datasets as im
import pandas as pd
datasets = ["BMS1",
"BMS2",
"toydata"
"uci_retail",
"mushroom",
"Belgian_retail",
"chess",
"connect",
"mushroom",
"pumsb",
"pumsb_sta... | true | true |
f7071bbd6e920cc673d169ccd5e0d1c5483f8b4b | 9,058 | py | Python | ex_ablation/exp_conv.py | gaozhangyang/DecST | 116ce9efa28a07793900d09345abab4cb512db98 | [
"MIT"
] | 2 | 2021-05-30T15:08:07.000Z | 2021-06-13T12:36:18.000Z | ex_ablation/exp_conv.py | gaozhangyang/DecST | 116ce9efa28a07793900d09345abab4cb512db98 | [
"MIT"
] | null | null | null | ex_ablation/exp_conv.py | gaozhangyang/DecST | 116ce9efa28a07793900d09345abab4cb512db98 | [
"MIT"
] | 1 | 2021-05-27T12:24:20.000Z | 2021-05-27T12:24:20.000Z |
import sys; sys.path.append('..')
from API.tools import EarlyStopping
from API.exp_basic import Exp_Basic
import numpy as np
import torch
import torch.nn as nn
from torch import optim
from ex_ablation.model import ConvUnet
from API.dataloader import load_data
import json
import os
import time
import logging
from tqd... | 39.043103 | 210 | 0.591963 |
import sys; sys.path.append('..')
from API.tools import EarlyStopping
from API.exp_basic import Exp_Basic
import numpy as np
import torch
import torch.nn as nn
from torch import optim
from ex_ablation.model import ConvUnet
from API.dataloader import load_data
import json
import os
import time
import logging
from tqd... | true | true |
f7071bec3ec67eb1804d0bfb3e44160309b8a73e | 4,166 | py | Python | test/test_swap_n3.py | ROZBEH/rdflib | 5b9da927714a92a8888407f42b46249002964e8e | [
"BSD-3-Clause"
] | 2 | 2021-02-06T17:36:05.000Z | 2021-04-21T07:33:39.000Z | test/test_swap_n3.py | ROZBEH/rdflib | 5b9da927714a92a8888407f42b46249002964e8e | [
"BSD-3-Clause"
] | 2 | 2020-05-09T15:03:57.000Z | 2020-05-30T10:51:40.000Z | test/test_swap_n3.py | ROZBEH/rdflib | 5b9da927714a92a8888407f42b46249002964e8e | [
"BSD-3-Clause"
] | 4 | 2020-05-08T08:36:19.000Z | 2020-05-28T07:23:23.000Z | from nose.exc import SkipTest
import os
import sys
import unittest
try:
maketrans = str.maketrans
except AttributeError:
from string import maketrans
import rdflib
"""
SWAP N3 parser test suite
"""
rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
rdfs = rdflib.Namespace("http://www.w3.or... | 29.132867 | 152 | 0.595055 | from nose.exc import SkipTest
import os
import sys
import unittest
try:
maketrans = str.maketrans
except AttributeError:
from string import maketrans
import rdflib
rdf = rdflib.Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
rdfs = rdflib.Namespace("http://www.w3.org/2000/01/rdf-schema#")
xsd = rdfl... | true | true |
f7071c737354ad44105068d757c4ee4387e3f4ba | 1,181 | py | Python | tests/conftest.py | jaswanth-amili/RailYatri-Automation | 097283c3f8af321b44294a004cc38e8640f30107 | [
"MIT"
] | null | null | null | tests/conftest.py | jaswanth-amili/RailYatri-Automation | 097283c3f8af321b44294a004cc38e8640f30107 | [
"MIT"
] | null | null | null | tests/conftest.py | jaswanth-amili/RailYatri-Automation | 097283c3f8af321b44294a004cc38e8640f30107 | [
"MIT"
] | null | null | null | """
This module contains shared fixtures.
"""
import json
import pytest
import selenium.webdriver
@pytest.fixture
def config(scope='session'):
# Read JSON file
with open('config.json') as config_file:
config = json.load(config_file)
# Assert values are acceptable
assert config['browser'] in ['Firefox'... | 24.604167 | 70 | 0.712108 |
import json
import pytest
import selenium.webdriver
@pytest.fixture
def config(scope='session'):
with open('config.json') as config_file:
config = json.load(config_file)
assert config['browser'] in ['Firefox', 'Chrome', 'Headless Chrome']
assert isinstance(config['implicit_wait'],int)
assert confi... | true | true |
f7071e9c6a21223e02c96c388d09112294f3f118 | 5,893 | py | Python | huaweicloud-sdk-ddm/huaweicloudsdkddm/v1/model/compute_flavor_groups_info.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ddm/huaweicloudsdkddm/v1/model/compute_flavor_groups_info.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ddm/huaweicloudsdkddm/v1/model/compute_flavor_groups_info.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ComputeFlavorGroupsInfo:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): Th... | 26.426009 | 99 | 0.575938 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ComputeFlavorGroupsInfo:
sensitive_list = []
openapi_types = {
'group_type': 'str',
'compute_flavors': 'list[ComputeFlavors]',
'offset': 'int',
'limit': 'int',
... | true | true |
f7071f677e4a2851bd5ef43d794f9ff207bdcbfa | 94 | py | Python | project_RL/linear_sarsa/__init__.py | Ronnypetson/gym-minigrid | 1f0a607160960f00b664130c756a4f3bab356752 | [
"Apache-2.0"
] | null | null | null | project_RL/linear_sarsa/__init__.py | Ronnypetson/gym-minigrid | 1f0a607160960f00b664130c756a4f3bab356752 | [
"Apache-2.0"
] | 2 | 2021-10-15T01:57:47.000Z | 2021-10-29T20:24:56.000Z | project_RL/linear_sarsa/__init__.py | Ronnypetson/gym-minigrid | 1f0a607160960f00b664130c756a4f3bab356752 | [
"Apache-2.0"
] | null | null | null | import project_RL.linear_sarsa.train
from project_RL.linear_sarsa.sarsa_lambda_agent import *
| 31.333333 | 56 | 0.882979 | import project_RL.linear_sarsa.train
from project_RL.linear_sarsa.sarsa_lambda_agent import *
| true | true |
f70722233930765e77b6f5f597d7d8277dbade42 | 9,987 | py | Python | githooks/git.py | mxtadmin/sc-githooks | e5a105dcac082953634b37f991f84b0262c29476 | [
"MIT"
] | 3 | 2021-01-22T02:52:51.000Z | 2021-10-18T08:31:00.000Z | githooks/git.py | mxtadmin/sc-githooks | e5a105dcac082953634b37f991f84b0262c29476 | [
"MIT"
] | null | null | null | githooks/git.py | mxtadmin/sc-githooks | e5a105dcac082953634b37f991f84b0262c29476 | [
"MIT"
] | 1 | 2021-04-02T08:37:00.000Z | 2021-04-02T08:37:00.000Z | """sc-githooks - Git routines
Copyright (c) 2021 Scott Lau
Portions Copyright (c) 2021 InnoGames GmbH
Portions Copyright (c) 2021 Emre Hasegeli
"""
from os.path import isabs, join as joinpath, normpath
from subprocess import check_output
from githooks.utils import get_exe_path, get_extension, decode_str
git_exe_pat... | 32.216129 | 90 | 0.562732 |
from os.path import isabs, join as joinpath, normpath
from subprocess import check_output
from githooks.utils import get_exe_path, get_extension, decode_str
git_exe_path = get_exe_path('git')
class CommitList(list):
ref_path = None
def __init__(self, other, branch_name):
super(CommitList, self).__... | true | true |
f7072282324b2c842adb0702a11c0bbc9e10dbfb | 3,821 | py | Python | Tutorials/MLADS-spring-2018/CNTK_distributed/CNTK_distributed.py | cvitolo/DataScienceVM | 97e1b780de572266dcdab89d443af55d5b930f42 | [
"MIT"
] | 165 | 2017-04-21T07:42:38.000Z | 2022-02-08T13:13:20.000Z | Tutorials/MLADS-spring-2018/CNTK_distributed/CNTK_distributed.py | cvitolo/DataScienceVM | 97e1b780de572266dcdab89d443af55d5b930f42 | [
"MIT"
] | 32 | 2017-08-14T16:50:23.000Z | 2021-06-29T09:27:01.000Z | Tutorials/MLADS-spring-2018/CNTK_distributed/CNTK_distributed.py | cvitolo/DataScienceVM | 97e1b780de572266dcdab89d443af55d5b930f42 | [
"MIT"
] | 106 | 2017-04-26T08:46:36.000Z | 2022-03-20T11:44:08.000Z | import numpy as np
import os
import sys
import cntk
from cntk.layers import Convolution2D, MaxPooling, Dense, Dropout
from utils import *
import argparse
from cntk.train.distributed import Communicator, mpi_communicator
# Hyperparams
EPOCHS = 1
BATCHSIZE = 64 * 4
LR = 0.01
MOMENTUM = 0.9
N_CLASSES = 10
def create_bas... | 35.71028 | 116 | 0.708715 | import numpy as np
import os
import sys
import cntk
from cntk.layers import Convolution2D, MaxPooling, Dense, Dropout
from utils import *
import argparse
from cntk.train.distributed import Communicator, mpi_communicator
EPOCHS = 1
BATCHSIZE = 64 * 4
LR = 0.01
MOMENTUM = 0.9
N_CLASSES = 10
def create_basic_model(input... | true | true |
f70722c7ba7c0847b70eba56320918b09e65b299 | 5,456 | py | Python | otrans/encoder/transformer.py | jjjjohnson/OpenTransformer | 9a6371095ee83896d886addf55bda3a42c3918f6 | [
"MIT"
] | 3 | 2020-04-09T07:18:37.000Z | 2021-01-07T08:52:08.000Z | otrans/encoder/transformer.py | jjjjohnson/OpenTransformer | 9a6371095ee83896d886addf55bda3a42c3918f6 | [
"MIT"
] | null | null | null | otrans/encoder/transformer.py | jjjjohnson/OpenTransformer | 9a6371095ee83896d886addf55bda3a42c3918f6 | [
"MIT"
] | null | null | null | # File : transformer.py
# Author : Zhengkun Tian
# Email : zhengkun.tian@outlook.com
import logging
import torch
import torch.nn as nn
from otrans.module.pos import MixedPositionalEncoding, RelPositionalEncoding
from otrans.module.ffn import PositionwiseFeedForward
from otrans.module.attention import MultiHeadedSel... | 35.894737 | 131 | 0.655975 |
import logging
import torch
import torch.nn as nn
from otrans.module.pos import MixedPositionalEncoding, RelPositionalEncoding
from otrans.module.ffn import PositionwiseFeedForward
from otrans.module.attention import MultiHeadedSelfAttention, MultiHeadedSelfAttentionWithRelPos
logger = logging.getLogger(__name__)
... | true | true |
f7072395412ad1d9fe5f43c10e8343cbe181879e | 926 | py | Python | config/settings.py | hadadiashkan/yousician | 99b8e6a6d04f0304fccbaef8ee5f423ac92b7b45 | [
"MIT"
] | null | null | null | config/settings.py | hadadiashkan/yousician | 99b8e6a6d04f0304fccbaef8ee5f423ac92b7b45 | [
"MIT"
] | null | null | null | config/settings.py | hadadiashkan/yousician | 99b8e6a6d04f0304fccbaef8ee5f423ac92b7b45 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Application configuration.
Most configuration is set via environment variables.
For local development, use a .env file to set
environment variables.
"""
from os import path, urandom
class Config:
"""Application Configuration."""
from environs import Env
env = Env()
env.r... | 21.045455 | 68 | 0.631749 | from os import path, urandom
class Config:
from environs import Env
env = Env()
env.read_env()
BASE_DIR = path.dirname(path.dirname(__file__))
ENV = env.str("FLASK_ENV", default="production")
DEBUG = ENV == "development"
MONGODB_SETTINGS = [
{
"db": env.str("MONGOD... | true | true |
f707247820885f918e2322dce81656cd217e805e | 2,447 | py | Python | docs/source/conf.py | jiazhihao/FlexFlow-1 | b9bf0b615d8cf6d22bc38de4755b76ee3f8c4c22 | [
"Apache-2.0"
] | 1 | 2021-03-09T05:43:58.000Z | 2021-03-09T05:43:58.000Z | docs/source/conf.py | jiazhihao/FlexFlow-1 | b9bf0b615d8cf6d22bc38de4755b76ee3f8c4c22 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | jiazhihao/FlexFlow-1 | b9bf0b615d8cf6d22bc38de4755b76ee3f8c4c22 | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.957143 | 79 | 0.686146 |
import os
import sys
sys.path.insert(0, os.path.abspath('../../python'))
import sphinx_rtd_theme
project = 'FlexFlow'
copyright = '2020, Stanford, LANL, CMU, Facebook'
author = 'Stanford, LANL, CMU, Facebook'
extensions = [
'sphinx_rtd_theme',
'sphinx.ext.autodoc',
]
html_theme_options = {
"collaps... | true | true |
f70724b36e9afd7704d8c2048546089ecb389695 | 156,504 | py | Python | stage/test_jdbc_stages.py | anubandhan/datacollector-tests | 301c024c66d68353735256b262b681dd05ba16cc | [
"Apache-2.0"
] | null | null | null | stage/test_jdbc_stages.py | anubandhan/datacollector-tests | 301c024c66d68353735256b262b681dd05ba16cc | [
"Apache-2.0"
] | 1 | 2019-04-24T11:06:38.000Z | 2019-04-24T11:06:38.000Z | stage/test_jdbc_stages.py | anubandhan/datacollector-tests | 301c024c66d68353735256b262b681dd05ba16cc | [
"Apache-2.0"
] | 2 | 2019-05-24T06:34:37.000Z | 2020-03-30T11:48:18.000Z | # Copyright 2017 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 44.260181 | 253 | 0.664929 |
import copy
import json
import logging
import math
import os
import random
import string
import tempfile
import time
from collections import OrderedDict
import pytest
import sqlalchemy
import datetime
from streamsets.sdk.utils import Version
from streamsets.testframework.environments.databases import Db2Database, Ora... | true | true |
f70725f5a9bfaedd20365a6820a9ecc9799dfff4 | 315 | py | Python | app/health/tests.py | fuzz88/photo_stock | bdba73e5dfaca1831467df51eabf7e442ce68da9 | [
"BSD-2-Clause"
] | null | null | null | app/health/tests.py | fuzz88/photo_stock | bdba73e5dfaca1831467df51eabf7e442ce68da9 | [
"BSD-2-Clause"
] | null | null | null | app/health/tests.py | fuzz88/photo_stock | bdba73e5dfaca1831467df51eabf7e442ce68da9 | [
"BSD-2-Clause"
] | null | null | null | import json
from django.test import TestCase
from django.test import Client
class TestHealthCheck(TestCase):
def setUp(self):
self.c = Client()
def test_is_service_online_route(self):
resp = self.c.get("/health/")
self.assertEquals(json.loads(resp.content), {"status": "online"})
| 24.230769 | 73 | 0.685714 | import json
from django.test import TestCase
from django.test import Client
class TestHealthCheck(TestCase):
def setUp(self):
self.c = Client()
def test_is_service_online_route(self):
resp = self.c.get("/health/")
self.assertEquals(json.loads(resp.content), {"status": "online"})
| true | true |
f707277f5ded85ad4ea02b3190201d0e5460d9de | 1,360 | py | Python | Sketches/MPS/Old/queue.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MPS/Old/queue.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MPS/Old/queue.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | 30.909091 | 78 | 0.694853 | class Queue(list):
def shift(self):
if self == []:
return None
result = self[0]
del self[0]
return result
def push(self, value):
self.append(value)
class MessageQueue(Queue):
def read(Queue):
raise NotImplementedError
def write(Queue):
raise NotImplementedError
class InboundQueue(MessageQueue):... | true | true |
f707279312754480d7e42f12f571227804d33f27 | 56,827 | py | Python | research/object_detection/utils/visualization_utils.py | haruiz/models | 4dfcf48f7e15646dca2089a0e9f583d24661924c | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/visualization_utils.py | haruiz/models | 4dfcf48f7e15646dca2089a0e9f583d24661924c | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/visualization_utils.py | haruiz/models | 4dfcf48f7e15646dca2089a0e9f583d24661924c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.031805 | 80 | 0.663417 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import collections
import matplotlib.pyplot as plt import numpy as np
import PIL.Image as Image
import PIL.ImageColor as ImageColor
import PIL.ImageDraw as ImageDraw
import PIL.ImageFont as ImageFo... | true | true |
f70727e089c71aff666751c893d92b1c40ce9606 | 8,935 | py | Python | dreamer/models/rnns.py | huy-ha/dreamer-pytorch | 98561a5fe4ee5323b955f5fc79bbebf483f08d58 | [
"MIT"
] | null | null | null | dreamer/models/rnns.py | huy-ha/dreamer-pytorch | 98561a5fe4ee5323b955f5fc79bbebf483f08d58 | [
"MIT"
] | null | null | null | dreamer/models/rnns.py | huy-ha/dreamer-pytorch | 98561a5fe4ee5323b955f5fc79bbebf483f08d58 | [
"MIT"
] | null | null | null | import torch
import torch.distributions as td
import torch.nn as nn
import torch.nn.functional as tf
from rlpyt.utils.collections import namedarraytuple
from rlpyt.utils.buffer import buffer_method
from dreamer.utils.module import FreezeParameters
RSSMState = namedarraytuple('RSSMState', ['mean', 'std', 'stoch', 'det... | 41.175115 | 115 | 0.660325 | import torch
import torch.distributions as td
import torch.nn as nn
import torch.nn.functional as tf
from rlpyt.utils.collections import namedarraytuple
from rlpyt.utils.buffer import buffer_method
from dreamer.utils.module import FreezeParameters
RSSMState = namedarraytuple('RSSMState', ['mean', 'std', 'stoch', 'det... | true | true |
f707289710cfb737c607993f461b1e7358d5d4cb | 14,832 | py | Python | sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/models/_models.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 9 | 2018-06-25T21:31:18.000Z | 2022-01-10T13:07:12.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 ... | 37.172932 | 137 | 0.65062 |
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class CloudError(Model):
_attribute_map = {
}
class Display(Model):
_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
... | true | true |
f7072976d4f81e4ab2da6128dd3225e597d07f8f | 5,643 | py | Python | stubs.min/System/Windows/Navigation_parts/JournalEntry.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Windows/Navigation_parts/JournalEntry.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Navigation_parts/JournalEntry.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class JournalEntry(DependencyObject,ISerializable):
""" Represents an entry in either back or forward navigation history. """
@staticmethod
def GetKeepAlive(dependencyObject):
"""
GetKeepAlive(dependencyObject: DependencyObject) -> bool
Returns the System.Windows.Navigation.JournalEntry.KeepAlive�... | 41.8 | 535 | 0.746766 | class JournalEntry(DependencyObject,ISerializable):
@staticmethod
def GetKeepAlive(dependencyObject):
dependencyObject: The element from which to get the attached property value.
the specified element.
Returns a value that indicates whether serialization processes should seri... | true | true |
f7072a1931d0391257262bad2b44d22835aed5d1 | 6,698 | py | Python | stayclean-2015-august/display-during-signup.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | 1 | 2020-01-13T13:03:48.000Z | 2020-01-13T13:03:48.000Z | stayclean-2015-july/display-during-signup.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | 2 | 2021-04-06T18:40:31.000Z | 2021-06-02T03:46:59.000Z | stayclean-2015-july/display-during-signup.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | null | null | null | #!/usr/bin/python
import participantCollection
import string
import re
import datetime
import pyperclip
#TODO: need to figure out how to get total days in current month...
# Remember, this is during signup, so current month is not July, it's June.
currentMonthTotalDays = 30
#TODO: fill in the current month url...
curr... | 66.98 | 538 | 0.720364 | import participantCollection
import string
import re
import datetime
import pyperclip
currentMonthTotalDays = 30
#TODO: fill in the current month url...
currentMonthURL = "https://www.reddit.com/r/pornfree/comments/381nyz/stay_clean_june_this_thread_updated_daily_check/"
currentMonthIndex = datetime.date.today().mont... | false | true |
f7072a48c7263da070590c41c93c484268008c5b | 15,335 | py | Python | Lib/test/test_genericalias.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 953 | 2021-10-08T17:12:34.000Z | 2022-03-31T18:31:50.000Z | Lib/test/test_genericalias.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 27 | 2021-10-13T20:54:09.000Z | 2022-03-27T14:41:13.000Z | Lib/test/test_genericalias.py | cyyever/nogil | 2607880dd93de52cf34045f1b7e850639a06c137 | [
"0BSD"
] | 42 | 2021-10-08T16:05:57.000Z | 2022-03-18T13:06:12.000Z | """Tests for C-implemented GenericAlias."""
import unittest
import pickle
import copy
from collections import (
defaultdict, deque, OrderedDict, Counter, UserDict, UserList
)
from collections.abc import *
from concurrent.futures import Future
from concurrent.futures.thread import _WorkItem
from contextlib import A... | 38.822785 | 95 | 0.58761 |
import unittest
import pickle
import copy
from collections import (
defaultdict, deque, OrderedDict, Counter, UserDict, UserList
)
from collections.abc import *
from concurrent.futures import Future
from concurrent.futures.thread import _WorkItem
from contextlib import AbstractContextManager, AbstractAsyncContextM... | true | true |
f7072b372e6788349d32f3f9f0909b7ffce815f9 | 4,202 | py | Python | widgets/windows/CreateConfigWindow/CreateConfigWindow.py | Wanket/DeSnapper | a321e6ce9ae493dfe4345b6b103e10050e380636 | [
"MIT"
] | null | null | null | widgets/windows/CreateConfigWindow/CreateConfigWindow.py | Wanket/DeSnapper | a321e6ce9ae493dfe4345b6b103e10050e380636 | [
"MIT"
] | null | null | null | widgets/windows/CreateConfigWindow/CreateConfigWindow.py | Wanket/DeSnapper | a321e6ce9ae493dfe4345b6b103e10050e380636 | [
"MIT"
] | null | null | null | from os import listdir
from os.path import isfile, join
from re import compile
from typing import Dict
from PyQt5.QtCore import QRegularExpression
from PyQt5.QtGui import QRegularExpressionValidator
from PyQt5.QtWidgets import QDialog, QMessageBox
from dbus import DBusException
from snapper.SnapperConnection import S... | 35.91453 | 118 | 0.669205 | from os import listdir
from os.path import isfile, join
from re import compile
from typing import Dict
from PyQt5.QtCore import QRegularExpression
from PyQt5.QtGui import QRegularExpressionValidator
from PyQt5.QtWidgets import QDialog, QMessageBox
from dbus import DBusException
from snapper.SnapperConnection import S... | true | true |
f7072b572b5a86900dd7d84fbf7e5cfd930336d9 | 293 | py | Python | src/ground/python_test/test_router_receiver.py | granum-space/cansat-2017-2018 | 4d9db6f2d55c726e11abbb60fd436ec3eafc2373 | [
"MIT"
] | null | null | null | src/ground/python_test/test_router_receiver.py | granum-space/cansat-2017-2018 | 4d9db6f2d55c726e11abbb60fd436ec3eafc2373 | [
"MIT"
] | 9 | 2017-10-31T19:20:05.000Z | 2018-06-17T19:08:52.000Z | src/ground/python_test/test_router_receiver.py | granum-space/cansat-2018 | 4d9db6f2d55c726e11abbb60fd436ec3eafc2373 | [
"MIT"
] | 1 | 2018-06-12T11:30:10.000Z | 2018-06-12T11:30:10.000Z | #!/usr/bin/python3
from init_env import init_env
init_env()
from pymavlink import mavutil
connection = mavutil.mavlink_connection('udpin:localhost:11000')
mav = connection
while (True):
msg = mav.recv_match(blocking=True)
print("Message from %d: %s" % (msg.get_srcSystem(), msg))
| 19.533333 | 64 | 0.730375 |
from init_env import init_env
init_env()
from pymavlink import mavutil
connection = mavutil.mavlink_connection('udpin:localhost:11000')
mav = connection
while (True):
msg = mav.recv_match(blocking=True)
print("Message from %d: %s" % (msg.get_srcSystem(), msg))
| true | true |
f7072bd3fec1c52d225a68bdd5f0f583c4ceaf70 | 544 | py | Python | Application/ReclamaCaicoProject/ReclamaCaicoApp/migrations/0011_auto_20190907_1138.py | WesleyVitor/ReclamaCaico | df67997821fc00236f1d9c77e8685ed8e4a6934b | [
"MIT"
] | null | null | null | Application/ReclamaCaicoProject/ReclamaCaicoApp/migrations/0011_auto_20190907_1138.py | WesleyVitor/ReclamaCaico | df67997821fc00236f1d9c77e8685ed8e4a6934b | [
"MIT"
] | null | null | null | Application/ReclamaCaicoProject/ReclamaCaicoApp/migrations/0011_auto_20190907_1138.py | WesleyVitor/ReclamaCaico | df67997821fc00236f1d9c77e8685ed8e4a6934b | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-09-07 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ReclamaCaicoApp', '0010_comentario_user'),
]
operations = [
migrations.RemoveField(
model_name='comentario',
name='u... | 22.666667 | 62 | 0.579044 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ReclamaCaicoApp', '0010_comentario_user'),
]
operations = [
migrations.RemoveField(
model_name='comentario',
name='user',
),
migrations.AddField(
... | true | true |
f7072db18f84521d48cad426da7f582430b88219 | 1,353 | py | Python | nonebot/adapters/qqguild/config.py | nonebot/adapter-qqguild | a3e4d353bfdaafb296743bc0f15ed5d643c64d85 | [
"MIT"
] | 39 | 2021-12-23T14:26:41.000Z | 2022-03-22T14:11:19.000Z | nonebot/adapters/qqguild/config.py | nonebot/adapter-qqguild | a3e4d353bfdaafb296743bc0f15ed5d643c64d85 | [
"MIT"
] | 4 | 2022-01-22T17:59:50.000Z | 2022-03-22T12:40:10.000Z | nonebot/adapters/qqguild/config.py | nonebot/adapter-qqguild | a3e4d353bfdaafb296743bc0f15ed5d643c64d85 | [
"MIT"
] | 2 | 2022-01-16T02:38:51.000Z | 2022-03-01T15:48:36.000Z | from typing import List, Tuple, Optional
from pydantic import Field, HttpUrl, BaseModel
class Intents(BaseModel):
guilds: bool = True
guild_members: bool = True
guild_messages: bool = False
guild_message_reactions: bool = True
direct_message: bool = False
message_audit: bool = False
forum... | 28.787234 | 82 | 0.630451 | from typing import List, Tuple, Optional
from pydantic import Field, HttpUrl, BaseModel
class Intents(BaseModel):
guilds: bool = True
guild_members: bool = True
guild_messages: bool = False
guild_message_reactions: bool = True
direct_message: bool = False
message_audit: bool = False
forum... | true | true |
f7072df96bc224f24537a45bea166eb91dd20e41 | 6,737 | py | Python | bindings/python/ensmallen_graph/datasets/string/pseudoalteromonastunicata.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/pseudoalteromonastunicata.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/pseudoalteromonastunicata.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Pseudoalteromonas tunicata.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: ... | 35.645503 | 223 | 0.705952 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def PseudoalteromonasTunicata(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f7072f5cca5f103f34d27145768ad06983d73c8d | 4,607 | py | Python | mlrun/api/utils/alembic.py | rpatil524/mlrun | bb2259a959f871d7a479834ddc55ad1470e6c2c0 | [
"Apache-2.0"
] | null | null | null | mlrun/api/utils/alembic.py | rpatil524/mlrun | bb2259a959f871d7a479834ddc55ad1470e6c2c0 | [
"Apache-2.0"
] | 1 | 2020-12-31T14:36:29.000Z | 2020-12-31T14:36:29.000Z | mlrun/api/utils/alembic.py | rpatil524/mlrun | bb2259a959f871d7a479834ddc55ad1470e6c2c0 | [
"Apache-2.0"
] | 1 | 2019-12-10T01:54:27.000Z | 2019-12-10T01:54:27.000Z | import os
import pathlib
import shutil
import typing
import alembic.command
import alembic.config
from mlrun import mlconf
class AlembicUtil(object):
def __init__(self, alembic_config_path: pathlib.Path):
self._alembic_config_path = str(alembic_config_path)
self._alembic_config = alembic.config.... | 37.153226 | 99 | 0.670936 | import os
import pathlib
import shutil
import typing
import alembic.command
import alembic.config
from mlrun import mlconf
class AlembicUtil(object):
def __init__(self, alembic_config_path: pathlib.Path):
self._alembic_config_path = str(alembic_config_path)
self._alembic_config = alembic.config.... | true | true |
f7072fb2af05fa8afae4ccce65b0510d38361e04 | 3,864 | py | Python | cihai/utils.py | darren0h/cihai | b4eaa9acfbd5632ac62067e05d00fba3905b1a32 | [
"MIT"
] | null | null | null | cihai/utils.py | darren0h/cihai | b4eaa9acfbd5632ac62067e05d00fba3905b1a32 | [
"MIT"
] | null | null | null | cihai/utils.py | darren0h/cihai | b4eaa9acfbd5632ac62067e05d00fba3905b1a32 | [
"MIT"
] | null | null | null | # -*- coding: utf8 - *-
"""
Utility and helper methods for cihai.
"""
from __future__ import absolute_import, print_function, unicode_literals
import sys
from . import exc
from ._compat import collections_abc, reraise
def merge_dict(base, additional):
"""
Combine two dictionary-like objects.
Notes
... | 28.411765 | 82 | 0.642857 | from __future__ import absolute_import, print_function, unicode_literals
import sys
from . import exc
from ._compat import collections_abc, reraise
def merge_dict(base, additional):
if base is None:
return additional
if additional is None:
return base
if not (
isinstance(base, ... | true | true |
f70730499b56b9e5e4b7a00f127aa5b675b7089e | 4,634 | py | Python | sound_slice.py | sujeffreyl/storybuilder | bba18e15e01812837f7d7ea1291e8e88cad8a243 | [
"MIT"
] | 2 | 2018-12-29T06:19:37.000Z | 2019-05-24T23:30:22.000Z | sound_slice.py | sujeffreyl/storybuilder | bba18e15e01812837f7d7ea1291e8e88cad8a243 | [
"MIT"
] | 1 | 2019-09-12T02:46:53.000Z | 2019-09-12T02:46:53.000Z | sound_slice.py | sujeffreyl/storybuilder | bba18e15e01812837f7d7ea1291e8e88cad8a243 | [
"MIT"
] | 3 | 2018-12-20T21:20:26.000Z | 2021-09-27T15:55:31.000Z | from pydub import AudioSegment
import json
import re
timing_src = [
"./inputs/timing/04-JHN-01-timing.txt",
"./inputs/timing/04-JHN-02-timing.txt",
"./inputs/timing/04-JHN-03-timing.txt",
"./inputs/timing/04-JHN-04-timing.txt",
"./inputs/timing/04-JHN-05-timing.txt",
"./inputs/timing/04-JHN-06-timing.txt"... | 27.583333 | 96 | 0.631852 | from pydub import AudioSegment
import json
import re
timing_src = [
"./inputs/timing/04-JHN-01-timing.txt",
"./inputs/timing/04-JHN-02-timing.txt",
"./inputs/timing/04-JHN-03-timing.txt",
"./inputs/timing/04-JHN-04-timing.txt",
"./inputs/timing/04-JHN-05-timing.txt",
"./inputs/timing/04-JHN-06-timing.txt"... | true | true |
f70730f265a7c9c49ce0bd4398168d09e3e3f1b9 | 1,401 | py | Python | kdesupport/qca/qca.py | KDE/craft-blueprints-kde | 14932d4b95ce0070ab8ae5669411c62ffa304c9b | [
"BSD-2-Clause"
] | 14 | 2017-09-04T09:01:03.000Z | 2022-01-04T20:09:00.000Z | kdesupport/qca/qca.py | KDE/craft-blueprints-kde | 14932d4b95ce0070ab8ae5669411c62ffa304c9b | [
"BSD-2-Clause"
] | 14 | 2017-12-15T08:11:22.000Z | 2020-12-29T19:11:13.000Z | kdesupport/qca/qca.py | KDE/craft-blueprints-kde | 14932d4b95ce0070ab8ae5669411c62ffa304c9b | [
"BSD-2-Clause"
] | 19 | 2017-09-05T19:16:21.000Z | 2020-10-18T12:46:06.000Z | import info
class subinfo(info.infoclass):
def setDependencies(self):
self.runtimeDependencies["virtual/base"] = None
self.runtimeDependencies["libs/qt5/qtbase"] = None
self.runtimeDependencies["libs/openssl"] = None
self.runtimeDependencies["libs/cyrus-sasl"] = None
def setTa... | 37.864865 | 150 | 0.693076 | import info
class subinfo(info.infoclass):
def setDependencies(self):
self.runtimeDependencies["virtual/base"] = None
self.runtimeDependencies["libs/qt5/qtbase"] = None
self.runtimeDependencies["libs/openssl"] = None
self.runtimeDependencies["libs/cyrus-sasl"] = None
def setTa... | true | true |
f7073151f61692a4576cdf4de59362c8552b5e05 | 395 | py | Python | Books Library/dataflair/wsgi.py | Neeraj2701/numpy | bbc3167427eb8ecafeee3c5c9606b3532405dd96 | [
"BSD-3-Clause"
] | null | null | null | Books Library/dataflair/wsgi.py | Neeraj2701/numpy | bbc3167427eb8ecafeee3c5c9606b3532405dd96 | [
"BSD-3-Clause"
] | null | null | null | Books Library/dataflair/wsgi.py | Neeraj2701/numpy | bbc3167427eb8ecafeee3c5c9606b3532405dd96 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for dataflair project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dataflair.settings')
application = get_wsgi_application()
| true | true |
f70731b0ce69d54278a0e901863a01127eb31f3b | 232 | py | Python | tictactoe/__init__.py | protago90/tictactoe-arena | 13576fd1e950268f263de4a4818252b9d7f9b200 | [
"Beerware"
] | null | null | null | tictactoe/__init__.py | protago90/tictactoe-arena | 13576fd1e950268f263de4a4818252b9d7f9b200 | [
"Beerware"
] | null | null | null | tictactoe/__init__.py | protago90/tictactoe-arena | 13576fd1e950268f263de4a4818252b9d7f9b200 | [
"Beerware"
] | null | null | null | from tictactoe.board import BoardAPI, XOBoard
from tictactoe.main import PlayerFcty, recap_game_stats
from tictactoe.player import PlayerAPI, HumanUI
__ALL__ = [PlayerAPI, PlayerFcty, HumanUI, BoardAPI, XOBoard, recap_game_stats]
| 38.666667 | 80 | 0.831897 | from tictactoe.board import BoardAPI, XOBoard
from tictactoe.main import PlayerFcty, recap_game_stats
from tictactoe.player import PlayerAPI, HumanUI
__ALL__ = [PlayerAPI, PlayerFcty, HumanUI, BoardAPI, XOBoard, recap_game_stats]
| true | true |
f70731f3a599cd6abca5686675777ce718220878 | 4,021 | py | Python | tests/test_script.py | bhrutledge/zkeys | d049c61af18e0618559547c29605296b428792af | [
"MIT"
] | null | null | null | tests/test_script.py | bhrutledge/zkeys | d049c61af18e0618559547c29605296b428792af | [
"MIT"
] | 4 | 2021-07-08T23:35:34.000Z | 2021-07-27T10:17:54.000Z | tests/test_script.py | bhrutledge/zkeys | d049c61af18e0618559547c29605296b428792af | [
"MIT"
] | null | null | null | import io
import re
import textwrap
from typing import List
import pytest
from pytest_console_scripts import ScriptRunner
SCRIPT_NAME = "zkeys"
SCRIPT_USAGE = f"usage: {SCRIPT_NAME} [-h] [--version]"
def test_prints_help(script_runner: ScriptRunner) -> None:
result = script_runner.run(SCRIPT_NAME, "-h")
ass... | 27.731034 | 80 | 0.498632 | import io
import re
import textwrap
from typing import List
import pytest
from pytest_console_scripts import ScriptRunner
SCRIPT_NAME = "zkeys"
SCRIPT_USAGE = f"usage: {SCRIPT_NAME} [-h] [--version]"
def test_prints_help(script_runner: ScriptRunner) -> None:
result = script_runner.run(SCRIPT_NAME, "-h")
ass... | true | true |
f707324724f2f5c1147c95e6dee87755b9a2f3f4 | 5,277 | py | Python | src/phl_budget_data/etl/collections/monthly/school.py | PhilaController/phl-budget-data | fd249937c843aaff2375624160e2bec0b8043e3c | [
"MIT"
] | 1 | 2022-03-08T18:59:04.000Z | 2022-03-08T18:59:04.000Z | src/phl_budget_data/etl/collections/monthly/school.py | PhilaController/phl-budget-data | fd249937c843aaff2375624160e2bec0b8043e3c | [
"MIT"
] | null | null | null | src/phl_budget_data/etl/collections/monthly/school.py | PhilaController/phl-budget-data | fd249937c843aaff2375624160e2bec0b8043e3c | [
"MIT"
] | null | null | null | """Module for parsing montly school collections data."""
from typing import ClassVar
import pandas as pd
import pdfplumber
from ...utils.misc import rename_tax_rows
from ...utils.pdf import extract_words, words_to_table
from .core import COLLECTION_TYPES, MonthlyCollectionsReport, get_column_names
class SchoolTaxCo... | 30.680233 | 87 | 0.526435 | from typing import ClassVar
import pandas as pd
import pdfplumber
from ...utils.misc import rename_tax_rows
from ...utils.pdf import extract_words, words_to_table
from .core import COLLECTION_TYPES, MonthlyCollectionsReport, get_column_names
class SchoolTaxCollections(MonthlyCollectionsReport):
report_type: C... | true | true |
f707326f8f9ff084dc430279e9bef4eba5d38a97 | 3,042 | py | Python | convert2/pkg/rolex/util.py | MacHu-GWU/convert2-project | aad1837676b3702aa22f53f6462beb8c5c17d4e1 | [
"MIT"
] | null | null | null | convert2/pkg/rolex/util.py | MacHu-GWU/convert2-project | aad1837676b3702aa22f53f6462beb8c5c17d4e1 | [
"MIT"
] | null | null | null | convert2/pkg/rolex/util.py | MacHu-GWU/convert2-project | aad1837676b3702aa22f53f6462beb8c5c17d4e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
time math calculation.
"""
from datetime import date, datetime, timedelta
try:
from .tz import utc, local
except: # pragma: no cover
from rolex.tz import utc, local
def to_ordinal(a_date):
"""
Calculate number of days from 0000-00-00.
"""
... | 23.581395 | 78 | 0.666995 |
from datetime import date, datetime, timedelta
try:
from .tz import utc, local
except: from rolex.tz import utc, local
def to_ordinal(a_date):
return a_date.toordinal()
def from_ordinal(days):
return date.fromordinal(days)
def to_utctimestamp(a_datetime):
if a_datetime.tzinfo is None:
... | true | true |
f70732f3471c5476017981233b5e7e3f6156afa7 | 608 | py | Python | python/thousands/twc.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | python/thousands/twc.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | python/thousands/twc.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python2.4
"""
"""
def thousands_with_commas(i):
s = ''
while i > 999:
r = i % 1000
i = i // 1000
s = (",%03d" % r) + s
if i:
s = str(i) + s
print s
return s
if __name__ == '__main__':
assert thousands_with_commas(1001) == '1,001'
assert tho... | 20.965517 | 60 | 0.587171 |
"""
"""
def thousands_with_commas(i):
s = ''
while i > 999:
r = i % 1000
i = i // 1000
s = (",%03d" % r) + s
if i:
s = str(i) + s
print s
return s
if __name__ == '__main__':
assert thousands_with_commas(1001) == '1,001'
assert thousands_with_commas(1234) ... | false | true |
f70733012bbeb3207e55a1f6978cdf1a1ad84ab4 | 4,336 | py | Python | app/recipe/test/test_ingredient_api.py | daryabsb/recipe-app-api | c41f22ebe5856054a0f3b03864ac07ce43a9c549 | [
"MIT"
] | null | null | null | app/recipe/test/test_ingredient_api.py | daryabsb/recipe-app-api | c41f22ebe5856054a0f3b03864ac07ce43a9c549 | [
"MIT"
] | null | null | null | app/recipe/test/test_ingredient_api.py | daryabsb/recipe-app-api | c41f22ebe5856054a0f3b03864ac07ce43a9c549 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:... | 33.612403 | 78 | 0.659594 | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:... | true | true |
f7073482ebc5b4276db919f8bb98736a84a82f1c | 679 | py | Python | solutions/p231.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | solutions/p231.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | solutions/p231.py | xianlinfeng/project_euler_python3 | 77eca44eb2b1d13bc70d6dc0258b737449d43a23 | [
"MIT"
] | null | null | null | #
# Solution to Project Euler problem 231
# Copyright (c) Project Nayuki. All rights reserved.
#
# https://www.nayuki.io/page/project-euler-solutions
# https://github.com/nayuki/Project-Euler-solutions
#
import eulerlib
def compute():
N = 20000000
K = 15000000
smallestprimefactor = eulerlib.list_smallest_prime... | 20.575758 | 104 | 0.705449 |
import eulerlib
def compute():
N = 20000000
K = 15000000
smallestprimefactor = eulerlib.list_smallest_prime_factors(N)
def factorial_prime_factor_sum(n):
result = 0
for i in range(n + 1):
j = i
while j > 1:
p = smallestprimefactor[j]
result += p
j //= p
return result
ans = factorial_... | true | true |
f70735297c5e5ea418b61d51f1d1fc86b20dd9df | 625 | py | Python | 1272. Remove Interval/main.py | amanchadha/LeetCode | 20dddf0616351ad399f0fa03cb6a2b5cbdd25279 | [
"MIT"
] | 1 | 2021-07-18T06:18:40.000Z | 2021-07-18T06:18:40.000Z | 1272. Remove Interval/main.py | amanchadha/LeetCode | 20dddf0616351ad399f0fa03cb6a2b5cbdd25279 | [
"MIT"
] | null | null | null | 1272. Remove Interval/main.py | amanchadha/LeetCode | 20dddf0616351ad399f0fa03cb6a2b5cbdd25279 | [
"MIT"
] | 3 | 2020-09-27T05:48:30.000Z | 2021-08-13T10:07:08.000Z | class Solution:
def removeInterval(self, intervals: List[List[int]], toBeRemoved: List[int]) -> List[List[int]]:
res = []
x, y = toBeRemoved
for interval in intervals:
l, h = interval
if l <= x <= h <= y:
res.append([l, x])
elif x ... | 29.761905 | 100 | 0.3792 | class Solution:
def removeInterval(self, intervals: List[List[int]], toBeRemoved: List[int]) -> List[List[int]]:
res = []
x, y = toBeRemoved
for interval in intervals:
l, h = interval
if l <= x <= h <= y:
res.append([l, x])
elif x ... | true | true |
f70735a07186b0ef34c4838a90487a4431ea2470 | 38 | py | Python | cvtron/model_zoo/vgg/constant.py | opencollective/CVTron | fd111d734fed4008ba9d04d18c359dbd441a1897 | [
"Apache-2.0"
] | 94 | 2018-03-31T06:32:50.000Z | 2020-09-25T10:19:23.000Z | cvtron/model_zoo/vgg/constant.py | opencollective/CVTron | fd111d734fed4008ba9d04d18c359dbd441a1897 | [
"Apache-2.0"
] | 98 | 2018-04-02T15:55:25.000Z | 2020-04-06T09:35:36.000Z | cvtron/model_zoo/vgg/constant.py | opencollective/CVTron | fd111d734fed4008ba9d04d18c359dbd441a1897 | [
"Apache-2.0"
] | 18 | 2018-07-10T22:54:19.000Z | 2021-03-23T05:17:39.000Z | VGG_MEAN = [103.939, 116.779, 123.68]
| 19 | 37 | 0.657895 | VGG_MEAN = [103.939, 116.779, 123.68]
| true | true |
f7073649e62e949175e13479fa4a5397d607fc76 | 5,512 | py | Python | file-generator/tornado-app/localdbutils.py | gcrosti/brine-pelican | 9267e5b6929c422946bed2b9d10f8d9e4ed3450f | [
"Apache-2.0"
] | null | null | null | file-generator/tornado-app/localdbutils.py | gcrosti/brine-pelican | 9267e5b6929c422946bed2b9d10f8d9e4ed3450f | [
"Apache-2.0"
] | null | null | null | file-generator/tornado-app/localdbutils.py | gcrosti/brine-pelican | 9267e5b6929c422946bed2b9d10f8d9e4ed3450f | [
"Apache-2.0"
] | null | null | null | import json
import boto3
from datetime import datetime
import ast
class S3DAO:
USERS_DISHES_S3_KEY = 'users-dishes'
PAGE_CONTENT_S3_KEY = 'page-content'
BRINE_DATA_BUCKET_NAME = 'brine-data'
def __init__(self):
self.s3_client = None
self.users_dishes_last_modified = None
self.p... | 35.333333 | 118 | 0.631531 | import json
import boto3
from datetime import datetime
import ast
class S3DAO:
USERS_DISHES_S3_KEY = 'users-dishes'
PAGE_CONTENT_S3_KEY = 'page-content'
BRINE_DATA_BUCKET_NAME = 'brine-data'
def __init__(self):
self.s3_client = None
self.users_dishes_last_modified = None
self.p... | true | true |
f70737113253e843e03488c34e78cf3462f307b7 | 21,598 | py | Python | lib/JobBrowserBFF/JobBrowserBFF_JSONRPCServer.py | eapearson/kbase-sdk-module-job-browser-bff | 04f99f6418b0bdd88bf680bcb933b3d9092d56ed | [
"MIT"
] | null | null | null | lib/JobBrowserBFF/JobBrowserBFF_JSONRPCServer.py | eapearson/kbase-sdk-module-job-browser-bff | 04f99f6418b0bdd88bf680bcb933b3d9092d56ed | [
"MIT"
] | null | null | null | lib/JobBrowserBFF/JobBrowserBFF_JSONRPCServer.py | eapearson/kbase-sdk-module-job-browser-bff | 04f99f6418b0bdd88bf680bcb933b3d9092d56ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from wsgiref.simple_server import make_server
from JobBrowserBFF.jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError, \
JSO... | 37.046312 | 151 | 0.57297 | import datetime
import json
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from wsgiref.simple_server import make_server
from JobBrowserBFF.jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError, \
JSONRPCError, InvalidRequestError
from JobBrowser... | true | true |
f707377adaa266f31c81cc94c157949b52db3244 | 33,175 | py | Python | tests/gcp/hooks/test_cloud_storage_transfer_service.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2021-11-04T20:11:58.000Z | 2021-11-04T20:11:58.000Z | tests/gcp/hooks/test_cloud_storage_transfer_service.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 3 | 2020-07-07T20:39:24.000Z | 2021-09-29T17:34:46.000Z | tests/gcp/hooks/test_cloud_storage_transfer_service.py | suensummit/airflow | 37a342d0e96a91ce2d34085e225a4e86f54c4e21 | [
"Apache-2.0"
] | 1 | 2020-11-04T03:17:51.000Z | 2020-11-04T03:17:51.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 46.725352 | 110 | 0.728922 | import json
import unittest
from copy import deepcopy
from parameterized import parameterized
from airflow import AirflowException
from airflow.gcp.hooks.cloud_storage_transfer_service import (
DESCRIPTION, FILTER_JOB_NAMES, FILTER_PROJECT_ID, METADATA, OPERATIONS, PROJECT_ID, STATUS,
TIME_TO_SLEEP_IN_SECONDS... | true | true |
f707379df387ec698456dd760a585ec90b375fea | 1,426 | py | Python | PMOC_Standalone/PMOC/setup.py | Argzero/PACH | 99f6c9e8870fff05057ce54c14e585238a1f38b6 | [
"Unlicense"
] | null | null | null | PMOC_Standalone/PMOC/setup.py | Argzero/PACH | 99f6c9e8870fff05057ce54c14e585238a1f38b6 | [
"Unlicense"
] | null | null | null | PMOC_Standalone/PMOC/setup.py | Argzero/PACH | 99f6c9e8870fff05057ce54c14e585238a1f38b6 | [
"Unlicense"
] | null | null | null | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.1',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate ... | 34.780488 | 80 | 0.610098 | __doc__ = """
Manipulate audio with an simple and easy high level interface.
See the README file for details, usage info, and a list of gotchas.
"""
from setuptools import setup
setup(
name='pydub',
version='0.11.1',
author='James Robert',
author_email='jiaaro@gmail.com',
description='Manipulate ... | true | true |
f70737fd5fb974627c90224cc451b628fa286ec7 | 245 | py | Python | answer/a9_fizzbuzz.py | breeze-shared-inc/python_training_01 | 7e918b37adbce062ae279f060bc25cfacda2fb85 | [
"MIT"
] | null | null | null | answer/a9_fizzbuzz.py | breeze-shared-inc/python_training_01 | 7e918b37adbce062ae279f060bc25cfacda2fb85 | [
"MIT"
] | 1 | 2020-05-11T04:59:04.000Z | 2020-05-11T05:29:08.000Z | answer/a9_fizzbuzz.py | bzgwhite/python_training_01 | 7e918b37adbce062ae279f060bc25cfacda2fb85 | [
"MIT"
] | null | null | null | for num in range(1, 51):
if num % 3 == 0 and num % 5 == 0:
print("fizzbuzz")
elif num % 3 == 0 and num % 5 != 0:
print("fizz")
elif num % 3 != 0 and num % 5 == 0:
print("buzz")
else:
print(num) | 18.846154 | 39 | 0.440816 | for num in range(1, 51):
if num % 3 == 0 and num % 5 == 0:
print("fizzbuzz")
elif num % 3 == 0 and num % 5 != 0:
print("fizz")
elif num % 3 != 0 and num % 5 == 0:
print("buzz")
else:
print(num) | true | true |
f7073889c5af752e055589ef6c34b11b55b8eee6 | 2,666 | py | Python | va_explorer/users/tests/test_validators.py | VA-Explorer/va_explorer | e43cfbff0ce5209c12134b7ac4ce439db6fc87a2 | [
"Apache-2.0"
] | null | null | null | va_explorer/users/tests/test_validators.py | VA-Explorer/va_explorer | e43cfbff0ce5209c12134b7ac4ce439db6fc87a2 | [
"Apache-2.0"
] | 125 | 2020-10-07T12:00:15.000Z | 2022-03-31T21:29:21.000Z | va_explorer/users/tests/test_validators.py | VA-Explorer/va_explorer | e43cfbff0ce5209c12134b7ac4ce439db6fc87a2 | [
"Apache-2.0"
] | 2 | 2020-10-29T16:08:42.000Z | 2020-12-08T19:03:41.000Z | from unittest import TestCase
import pytest
from django.core.exceptions import ValidationError
from va_explorer.tests.factories import UserFactory
from va_explorer.users.models import UserPasswordHistory
from va_explorer.users.validators import PasswordComplexityValidator, PasswordHistoryValidator
pytestmark = pytest... | 37.027778 | 97 | 0.704426 | from unittest import TestCase
import pytest
from django.core.exceptions import ValidationError
from va_explorer.tests.factories import UserFactory
from va_explorer.users.models import UserPasswordHistory
from va_explorer.users.validators import PasswordComplexityValidator, PasswordHistoryValidator
pytestmark = pytest... | true | true |
f70738dc0f35cdbd8c3f390571ccfb7450539fba | 3,657 | py | Python | tests/inventory/pipelines/test_data/fake_forwarding_rules.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | 1 | 2018-03-26T08:15:21.000Z | 2018-03-26T08:15:21.000Z | tests/inventory/pipelines/test_data/fake_forwarding_rules.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | tests/inventory/pipelines/test_data/fake_forwarding_rules.py | pombredanne/forseti-security | 68a9a88243460065e00b6c131b3d9abd0331fb37 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The Forseti Security 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
#
#... | 37.701031 | 124 | 0.689363 |
from google.cloud.security.common.util import parser
FAKE_FORWARDING_RULE1 = {
"kind": "compute#forwardingRule",
"description": "",
"IPAddress": "10.10.10.1",
"region": "https://www.googleapis.com/compute/v1/projects/project1/regions/us-central1",
"loadBalancingScheme": "EXTERNAL",
"target":... | true | true |
f7073a2e3a8576061dc97ac75e1786f07482634b | 1,744 | py | Python | vispy/app/backends/__init__.py | robmcmullen/vispy | 8d5092fdae4a24fc364ae51c7e34e12d3fd6d0a2 | [
"BSD-3-Clause"
] | null | null | null | vispy/app/backends/__init__.py | robmcmullen/vispy | 8d5092fdae4a24fc364ae51c7e34e12d3fd6d0a2 | [
"BSD-3-Clause"
] | null | null | null | vispy/app/backends/__init__.py | robmcmullen/vispy | 8d5092fdae4a24fc364ae51c7e34e12d3fd6d0a2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
""" vispy.app.backends
The backend modules are dynamically imported when needed. This module
defines a small description of each supported backend, so that for
instance we ca... | 34.196078 | 77 | 0.68578 |
CORE_BACKENDS = [
('PyQt4', '_pyqt4', 'PyQt4'),
('PyQt5', '_pyqt5', 'PyQt5'),
('PySide', '_pyside', 'PySide'),
('Pyglet', '_pyglet', 'pyglet'),
('Glfw', '_glfw', 'vispy.ext.glfw'),
('SDL2', '_sdl2', 'sdl2'),
('wx', '_wx', 'wx'),
('EGL', '_egl', 'vispy.ext.egl'),
('Glut', '_glut', '... | true | true |
f7073a8f51c9c770caaffed60a0ee9383beb72fe | 14,339 | py | Python | Birnn_Transformer/ncc/utils/graph.py | code-backdoor/code-backdoor | 1eeb3d79aa8a54c8f08e8d0156b569de5edd974e | [
"MIT"
] | 71 | 2020-12-04T02:18:13.000Z | 2022-03-30T15:19:50.000Z | Birnn_Transformer/ncc/utils/graph.py | code-backdoor/code-backdoor | 1eeb3d79aa8a54c8f08e8d0156b569de5edd974e | [
"MIT"
] | 4 | 2021-03-10T17:48:50.000Z | 2022-03-13T10:42:22.000Z | Birnn_Transformer/ncc/utils/graph.py | code-backdoor/code-backdoor | 1eeb3d79aa8a54c8f08e8d0156b569de5edd974e | [
"MIT"
] | 11 | 2020-12-09T12:17:44.000Z | 2022-03-30T09:02:13.000Z | # -*- coding: utf-8 -*-
import dgl
import networkx as nx
import numpy as np
import torch
from dataset.codesearchnet import MAX_SUB_TOKEN_LEN
def build_graph(tree_dict, dictionary, tree_leaf_subtoken=1, DGLGraph_PAD_WORD=-1) -> dgl.DGLGraph:
# 叶子节点存的是拆开后的subtoken ,当然,如果token拆不开,那就还是一个token
# 用来训练的.pt数据里叶子节点... | 48.442568 | 130 | 0.508125 |
import dgl
import networkx as nx
import numpy as np
import torch
from dataset.codesearchnet import MAX_SUB_TOKEN_LEN
def build_graph(tree_dict, dictionary, tree_leaf_subtoken=1, DGLGraph_PAD_WORD=-1) -> dgl.DGLGraph:
nx_graph = nx.DiGraph()
def _build(nid, idx, tree):
... | true | true |
f7073bf97ad59c09fc7b7b6c346d0721bbb11e86 | 65 | py | Python | ufdl-speech-app/src/ufdl/speech_app/models/__init__.py | waikato-ufdl/ufdl-backend | 776fc906c61eba6c2f2e6324758e7b8a323e30d7 | [
"Apache-2.0"
] | null | null | null | ufdl-speech-app/src/ufdl/speech_app/models/__init__.py | waikato-ufdl/ufdl-backend | 776fc906c61eba6c2f2e6324758e7b8a323e30d7 | [
"Apache-2.0"
] | 85 | 2020-07-24T00:04:28.000Z | 2022-02-10T10:35:15.000Z | ufdl-speech-app/src/ufdl/speech_app/models/__init__.py | waikato-ufdl/ufdl-backend | 776fc906c61eba6c2f2e6324758e7b8a323e30d7 | [
"Apache-2.0"
] | null | null | null | from ._SpeechDataset import SpeechDataset, SpeechDatasetQuerySet
| 32.5 | 64 | 0.892308 | from ._SpeechDataset import SpeechDataset, SpeechDatasetQuerySet
| true | true |
f7073cac7dcb3f3cd6858c4186de23919f7d37cb | 148 | py | Python | gds/blueprint/views.py | UniqueHK/pholcus | bf14621cf1fcd3517f2bbca7f9a7e73ee06cbf4a | [
"MIT"
] | 4 | 2015-12-15T06:06:40.000Z | 2016-06-20T07:52:06.000Z | gds/blueprint/views.py | UniqueHK/pholcus | bf14621cf1fcd3517f2bbca7f9a7e73ee06cbf4a | [
"MIT"
] | 1 | 2016-02-02T04:35:16.000Z | 2016-02-02T04:35:16.000Z | gds/blueprint/views.py | UniqueHK/pholcus | bf14621cf1fcd3517f2bbca7f9a7e73ee06cbf4a | [
"MIT"
] | 1 | 2016-06-18T03:47:26.000Z | 2016-06-18T03:47:26.000Z | #!/usr/bin/env python
# coding=utf8
from flask import Blueprint
running = Blueprint('running', __name__)
from snapshot import *
from log import *
| 16.444444 | 40 | 0.75 | from flask import Blueprint
running = Blueprint('running', __name__)
from snapshot import *
from log import *
| true | true |
f7073cae57c782d40fa5850740cf7861d460ca11 | 2,694 | py | Python | tweets/api/serializers.py | Hassanzadeh-sd/tweetme | a25db991694ed1c44c76fbb1880fdc4837ea320b | [
"MIT"
] | 12 | 2019-05-24T11:06:17.000Z | 2021-05-11T15:57:52.000Z | tweets/api/serializers.py | Hassanzadeh-sd/tweetme | a25db991694ed1c44c76fbb1880fdc4837ea320b | [
"MIT"
] | 10 | 2020-02-12T00:20:48.000Z | 2022-03-11T23:48:26.000Z | tweets/api/serializers.py | Hassanzadeh-sd/tweetme | a25db991694ed1c44c76fbb1880fdc4837ea320b | [
"MIT"
] | null | null | null | from rest_framework import serializers
from ..models import Tweet
from accounts.api.serializers import UserModelSerializer
from django.utils.timesince import timesince
class ParentTweetModelSerializer(serializers.ModelSerializer):
user = UserModelSerializer(read_only=True)
date_display = serializers.Serializer... | 28.357895 | 64 | 0.585004 | from rest_framework import serializers
from ..models import Tweet
from accounts.api.serializers import UserModelSerializer
from django.utils.timesince import timesince
class ParentTweetModelSerializer(serializers.ModelSerializer):
user = UserModelSerializer(read_only=True)
date_display = serializers.Serializer... | true | true |
f7073d660fc43e81874b7d92b4b6d2808e1f1424 | 2,363 | py | Python | applications/eis-experience-kit/roles/etcd/deploy/files/eis_integ/etcd_users.py | ryanmccluretx/edgeapps | 78ab4601bae986ab7b8ab169840a3e880fda7ce5 | [
"Apache-2.0"
] | null | null | null | applications/eis-experience-kit/roles/etcd/deploy/files/eis_integ/etcd_users.py | ryanmccluretx/edgeapps | 78ab4601bae986ab7b8ab169840a3e880fda7ce5 | [
"Apache-2.0"
] | null | null | null | applications/eis-experience-kit/roles/etcd/deploy/files/eis_integ/etcd_users.py | ryanmccluretx/edgeapps | 78ab4601bae986ab7b8ab169840a3e880fda7ce5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Intel Corporation
""" ETCD Access Management Tool """
import argparse
import logging
import os
import sys
import eis_integ
def parse_arguments(_cli_args):
""" Parse argument passed to function """
parser = argparse.ArgumentParse... | 42.963636 | 99 | 0.676259 |
import argparse
import logging
import os
import sys
import eis_integ
def parse_arguments(_cli_args):
parser = argparse.ArgumentParser(description="ETCD Access Management Tool"
" - add and remove a new EIS application user to the"
" ETCD dat... | true | true |
f7073d7b67c5b6e98735dc73285dc8f85f1e8556 | 1,627 | py | Python | tests/processors/transformers/test_pattern_transformer.py | ALMSIVI/novel_tools | d1511607c5055ab293ce6b1294810c127ab9c01d | [
"WTFPL"
] | 1 | 2020-08-03T02:29:20.000Z | 2020-08-03T02:29:20.000Z | tests/processors/transformers/test_pattern_transformer.py | ALMSIVI/novel_tools | d1511607c5055ab293ce6b1294810c127ab9c01d | [
"WTFPL"
] | null | null | null | tests/processors/transformers/test_pattern_transformer.py | ALMSIVI/novel_tools | d1511607c5055ab293ce6b1294810c127ab9c01d | [
"WTFPL"
] | null | null | null | from pytest import fixture
from novel_tools.common import NovelData, Type
from novel_tools.processors.transformers.pattern_transformer import PatternTransformer
@fixture
def pattern_transformer():
return PatternTransformer({
'units': [
{
'filter': {
'type': ... | 31.288462 | 91 | 0.473264 | from pytest import fixture
from novel_tools.common import NovelData, Type
from novel_tools.processors.transformers.pattern_transformer import PatternTransformer
@fixture
def pattern_transformer():
return PatternTransformer({
'units': [
{
'filter': {
'type': ... | true | true |
f7073f6c7b905943162e0a4465b0f7dd5633618e | 7,069 | py | Python | te_algorithms/gdal/util.py | ConservationInternational/trends.earth-algorithms | 15d96b4f2af99a8e60ad1a809084aee47a975a3c | [
"MIT"
] | 2 | 2021-11-19T13:57:44.000Z | 2021-12-22T03:35:26.000Z | te_algorithms/gdal/util.py | ConservationInternational/trends.earth-algorithms | 15d96b4f2af99a8e60ad1a809084aee47a975a3c | [
"MIT"
] | null | null | null | te_algorithms/gdal/util.py | ConservationInternational/trends.earth-algorithms | 15d96b4f2af99a8e60ad1a809084aee47a975a3c | [
"MIT"
] | null | null | null | import json
import logging
import pathlib
import shutil
import tempfile
from typing import List
import marshmallow_dataclass
from defusedxml.ElementTree import parse
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from .util_numba import _accumulate_dicts
logger = logging.getLogger(__name__)
@ma... | 30.734783 | 84 | 0.626963 | import json
import logging
import pathlib
import shutil
import tempfile
from typing import List
import marshmallow_dataclass
from defusedxml.ElementTree import parse
from osgeo import gdal
from osgeo import ogr
from osgeo import osr
from .util_numba import _accumulate_dicts
logger = logging.getLogger(__name__)
@ma... | true | true |
f707402378c87d81408ba4acb29accc1fe7a2de9 | 16,119 | py | Python | example/example.py | chunkified/QDarkStyleSheet | 84905d8ec7df62cee2121067ac961477c6b0055e | [
"MIT"
] | null | null | null | example/example.py | chunkified/QDarkStyleSheet | 84905d8ec7df62cee2121067ac961477c6b0055e | [
"MIT"
] | null | null | null | example/example.py | chunkified/QDarkStyleSheet | 84905d8ec7df62cee2121067ac961477c6b0055e | [
"MIT"
] | null | null | null | #!python
# -*- coding: utf-8 -*-
"""Example of qdarkstyle use for Python and Qt applications.
This module a main window with every item that could be created with
Qt Design (common ones) in the basic states (enabled/disabled), and
(checked/unchecked) for those who has this attribute.
Requirements:
- Python 2 or... | 39.997519 | 110 | 0.717104 |
import argparse
import logging
import os
import sys
from os.path import abspath, dirname
sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/..'))
import qdarkstyle
from qdarkstyle import QT_BINDING, QT_ABSTRACTION
EXAMPLE_PATH = os.path.abspath(os.path.dirname(__file__))
REPO_PATH = os.path.dirname(EXAMPLE_... | true | true |
f70740665e64e7c1e705d63e371b27b68bf9d04e | 98,837 | py | Python | salt/states/bigip.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | salt/states/bigip.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2017-07-10T21:44:39.000Z | 2017-07-10T21:44:39.000Z | salt/states/bigip.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | """
A state module designed to enforce load-balancing configurations for F5 Big-IP entities.
:maturity: develop
:platform: f5_bigip_11.6
"""
import salt.utils.json
# set up virtual function
def __virtual__():
"""
Only load if the bigip exec module is available in __salt__
"""
if "b... | 29.442061 | 117 | 0.564181 |
import salt.utils.json
def __virtual__():
if "bigip.list_transaction" in __salt__:
return "bigip"
return (False, "bigip module could not be loaded")
def _load_result(response, ret):
if response["code"] is None:
ret["comment"] = response["content"]
elif response["code"] == ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.