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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7620bec8141bdd69ce071419002e0f50e1b1ae4 | 780 | py | Python | traffic_control/migrations/0014_update_permit_decision_id.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 2 | 2020-11-23T22:08:58.000Z | 2022-03-02T13:13:20.000Z | traffic_control/migrations/0014_update_permit_decision_id.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 170 | 2019-12-31T13:37:04.000Z | 2022-03-12T14:03:35.000Z | traffic_control/migrations/0014_update_permit_decision_id.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 3 | 2020-05-08T05:58:02.000Z | 2022-03-15T16:07:25.000Z | # Generated by Django 2.2.14 on 2020-07-06 11:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0013_additional_sign_device_type"),
]
operations = [
migrations.AlterField(
model_name="additionalsignreal",... | 27.857143 | 88 | 0.594872 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("traffic_control", "0013_additional_sign_device_type"),
]
operations = [
migrations.AlterField(
model_name="additionalsignreal",
name="permit_decision_id",
... | true | true |
f7620bf1cf612b5328d9a52d1f82456b0a8e38b8 | 17,652 | py | Python | parsers/AX.py | veqtrus/electricitymap-contrib | 4ec4857da1315899159688fe1fb7f95376a6badd | [
"MIT"
] | 1 | 2022-03-24T17:49:38.000Z | 2022-03-24T17:49:38.000Z | parsers/AX.py | veqtrus/electricitymap-contrib | 4ec4857da1315899159688fe1fb7f95376a6badd | [
"MIT"
] | 1 | 2020-04-28T20:40:59.000Z | 2020-04-28T20:41:11.000Z | parsers/AX.py | veqtrus/electricitymap-contrib | 4ec4857da1315899159688fe1fb7f95376a6badd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# The arrow library is used to handle datetimes
import arrow
# The request library is used to fetch content through HTTP
import requests
# Numpy and PIL are used to process the image
import numpy as np
from PIL import Image
def _get_masks(session=None):
Minus = np.array([[[255, 255, 255],[... | 49.307263 | 125 | 0.509744 | import arrow
import requests
import numpy as np
from PIL import Image
def _get_masks(session=None):
Minus = np.array([[[255, 255, 255],[255, 255, 255],[255, 255, 255],[255, 255, 255],[255, 255, 255],[255, 255, 255]],
[[255, 255, 255],[255, 255, 255], [255, 255, 255], [255, 255, 255],[255, 255, 255],[255, 25... | true | true |
f7620c6165b271046079308dbfbe3cd27a6a557c | 4,820 | py | Python | configs/wholebody/darkpose/coco-wholebody/hrnet_w32_coco_wholebody_384x288_dark.py | ssumin6/buob | 4fb4537423a993cd2894f54cb12f5f3b3fb73141 | [
"Apache-2.0"
] | 5 | 2022-01-13T15:06:45.000Z | 2022-01-28T19:39:54.000Z | configs/wholebody/darkpose/coco-wholebody/hrnet_w32_coco_wholebody_384x288_dark.py | ssumin6/buob | 4fb4537423a993cd2894f54cb12f5f3b3fb73141 | [
"Apache-2.0"
] | null | null | null | configs/wholebody/darkpose/coco-wholebody/hrnet_w32_coco_wholebody_384x288_dark.py | ssumin6/buob | 4fb4537423a993cd2894f54cb12f5f3b3fb73141 | [
"Apache-2.0"
] | 1 | 2021-06-17T13:56:23.000Z | 2021-06-17T13:56:23.000Z | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning... | 28.52071 | 79 | 0.595436 | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
lr_config ... | true | true |
f7620d82041494f850a0689244115b4914b0d06a | 1,550 | py | Python | src/pyOpenMS/tests/unittests/test_MSSpectrumAndRichSpectrum.py | tomas-pluskal/openms | 136ec9057435f6d45d65a8e1465b2a6cff9621a8 | [
"Zlib",
"Apache-2.0"
] | 1 | 2016-12-09T01:45:03.000Z | 2016-12-09T01:45:03.000Z | src/pyOpenMS/tests/unittests/test_MSSpectrumAndRichSpectrum.py | tomas-pluskal/openms | 136ec9057435f6d45d65a8e1465b2a6cff9621a8 | [
"Zlib",
"Apache-2.0"
] | null | null | null | src/pyOpenMS/tests/unittests/test_MSSpectrumAndRichSpectrum.py | tomas-pluskal/openms | 136ec9057435f6d45d65a8e1465b2a6cff9621a8 | [
"Zlib",
"Apache-2.0"
] | null | null | null | import unittest
import os
import pyopenms
class TestMSSpectrumAndRichSpectrum(unittest.TestCase):
def setUp(self):
dirname = os.path.dirname(os.path.abspath(__file__))
def testMSSpectrum(self):
spec = pyopenms.MSSpectrum()
p = pyopenms.Peak1D()
p.setMZ(500.0)
p.setIn... | 27.678571 | 60 | 0.62 | import unittest
import os
import pyopenms
class TestMSSpectrumAndRichSpectrum(unittest.TestCase):
def setUp(self):
dirname = os.path.dirname(os.path.abspath(__file__))
def testMSSpectrum(self):
spec = pyopenms.MSSpectrum()
p = pyopenms.Peak1D()
p.setMZ(500.0)
p.setIn... | true | true |
f7620f1a6c5cdaf1f6c775766815308fd6d83e2c | 46,988 | py | Python | lerc_server/server.py | IntegralDefense/lerc | 84c82aea1f311062016ab13189dc3213ca94b255 | [
"Apache-2.0"
] | 1 | 2021-06-18T14:36:10.000Z | 2021-06-18T14:36:10.000Z | lerc_server/server.py | IntegralDefense/lerc | 84c82aea1f311062016ab13189dc3213ca94b255 | [
"Apache-2.0"
] | 13 | 2018-10-15T19:31:11.000Z | 2019-05-15T20:59:40.000Z | lerc_server/server.py | IntegralDefense/lerc | 84c82aea1f311062016ab13189dc3213ca94b255 | [
"Apache-2.0"
] | 2 | 2018-08-05T00:08:22.000Z | 2018-08-06T18:52:59.000Z | #!/usr/bin/python3
import os
import sys
import json
import logging
import pytz
import configparser
from hashlib import md5
from datetime import datetime
from flask_restful import Resource, Api
from flask import Flask, request, jsonify, stream_with_context, Response, make_response
# only used if we're runing the app n... | 47.946939 | 234 | 0.605155 |
import os
import sys
import json
import logging
import pytz
import configparser
from hashlib import md5
from datetime import datetime
from flask_restful import Resource, Api
from flask import Flask, request, jsonify, stream_with_context, Response, make_response
from werkzeug.serving import WSGIRequestHandler
import ... | false | true |
f76211c93e479224ce1ba46c6b0981fda197c3bc | 10,360 | py | Python | src/config/common/vnc_db.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | 3 | 2019-01-11T06:16:40.000Z | 2021-02-24T23:48:21.000Z | src/config/common/vnc_db.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/config/common/vnc_db.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | 2 | 2019-02-06T12:52:00.000Z | 2019-04-11T23:19:28.000Z | #
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of database model for contrail config daemons
"""
from exceptions import NoIdError
from vnc_api.gen.resource_client import *
from utils import obj_type_to_vnc_class
class DBBase(object):
# This is the base c... | 32.476489 | 79 | 0.57973 |
from exceptions import NoIdError
from vnc_api.gen.resource_client import *
from utils import obj_type_to_vnc_class
class DBBase(object):
_logger = None
_cassandra = None
_manager = None
_indexed_by_name = False
@classmethod
def init(cls, manager, logger, cassandra):
... | true | true |
f762142cbd13589baec743161dd8ff42a0f43183 | 36,732 | py | Python | app.py | constantinadrian/savour | 043975c2667cad8dbf23bdf654073c1dc6047617 | [
"Xnet"
] | null | null | null | app.py | constantinadrian/savour | 043975c2667cad8dbf23bdf654073c1dc6047617 | [
"Xnet"
] | null | null | null | app.py | constantinadrian/savour | 043975c2667cad8dbf23bdf654073c1dc6047617 | [
"Xnet"
] | 1 | 2021-06-06T00:06:47.000Z | 2021-06-06T00:06:47.000Z | import os
from flask import (
Flask, flash, render_template,
redirect, request, session, url_for, json, abort)
from flask_pymongo import PyMongo
from pymongo.collection import ReturnDocument
from bson.objectid import ObjectId
from werkzeug.security import generate_password_hash, check_password_hash
from helpers... | 33.606587 | 79 | 0.61132 | import os
from flask import (
Flask, flash, render_template,
redirect, request, session, url_for, json, abort)
from flask_pymongo import PyMongo
from pymongo.collection import ReturnDocument
from bson.objectid import ObjectId
from werkzeug.security import generate_password_hash, check_password_hash
from helpers... | true | true |
f762148330898e4d88e96f3b8527baafda6f0ee1 | 8,480 | py | Python | pytype/vm_test.py | OrBin/pytype | 52bf1b5b03e6c3caf39bf0f187980970d70fd536 | [
"Apache-2.0"
] | 1 | 2020-03-31T13:05:05.000Z | 2020-03-31T13:05:05.000Z | pytype/vm_test.py | OrBin/pytype | 52bf1b5b03e6c3caf39bf0f187980970d70fd536 | [
"Apache-2.0"
] | null | null | null | pytype/vm_test.py | OrBin/pytype | 52bf1b5b03e6c3caf39bf0f187980970d70fd536 | [
"Apache-2.0"
] | null | null | null | """Tests for vm.py."""
import dis
import textwrap
from pytype import blocks
from pytype import compat
from pytype import errors
from pytype import utils
from pytype import vm
from pytype.pyc import pyc
from pytype.tests import test_base
from pytype.tests import test_utils
import six
class TraceVM(vm.VirtualMachine... | 36.551724 | 79 | 0.569222 |
import dis
import textwrap
from pytype import blocks
from pytype import compat
from pytype import errors
from pytype import utils
from pytype import vm
from pytype.pyc import pyc
from pytype.tests import test_base
from pytype.tests import test_utils
import six
class TraceVM(vm.VirtualMachine):
def __init__(self... | true | true |
f7621512dee59196a0a542a8d6392e6e89898832 | 794 | py | Python | var/spack/repos/builtin/packages/r-png/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/r-png/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/r-png/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RPng(RPackage):
"""This package provides an easy and simple way to read, write and display... | 36.090909 | 95 | 0.715365 |
from spack import *
class RPng(RPackage):
homepage = "https://www.rforge.net/png/"
url = "https://cloud.r-project.org/src/contrib/png_0.1-7.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/png"
version('0.1-7', sha256='e269ff968f04384fc9421d17cfc7c10cf7756b11c2d6d126e9776f5a... | true | true |
f762153b7706c33ce4695577757937a2fbb7b768 | 359 | py | Python | entity/cards/LETL_040H/LETL_040P7.py | wenhr/lushi_script | b067e811b0179654046ba0e3b947795f31b44e5e | [
"MIT"
] | null | null | null | entity/cards/LETL_040H/LETL_040P7.py | wenhr/lushi_script | b067e811b0179654046ba0e3b947795f31b44e5e | [
"MIT"
] | null | null | null | entity/cards/LETL_040H/LETL_040P7.py | wenhr/lushi_script | b067e811b0179654046ba0e3b947795f31b44e5e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from hearthstone.entities import Entity
from entity.spell_entity import SpellEntity
class LETL_040P7(SpellEntity):
"""
虚空吞噬者5
<b>嘲讽</b>。在你施放一个暗影技能后,获得+3/+5。
"""
def __init__(self, entity: Entity):
super().__init__(entity)
self.damage = 0
def p... | 17.95 | 43 | 0.604457 | from hearthstone.entities import Entity
from entity.spell_entity import SpellEntity
class LETL_040P7(SpellEntity):
def __init__(self, entity: Entity):
super().__init__(entity)
self.damage = 0
def play(self, hero, target):
pass
| true | true |
f76216e5afdd1657dc3d8b60a336bf446cc63a76 | 13,502 | py | Python | test/test_graph/test_namespace_rebinding.py | gtfierro/rdflib | be3d026e9065c8f60f59ac79a70da9f3199f5f43 | [
"BSD-3-Clause"
] | 1 | 2022-02-02T23:04:51.000Z | 2022-02-02T23:04:51.000Z | test/test_graph/test_namespace_rebinding.py | gtfierro/rdflib | be3d026e9065c8f60f59ac79a70da9f3199f5f43 | [
"BSD-3-Clause"
] | 4 | 2021-12-28T10:57:18.000Z | 2022-03-30T09:58:12.000Z | test/test_graph/test_namespace_rebinding.py | gjhiggins/rdflib | eba13739e1d24b3e52697a1ec9545a361116951f | [
"BSD-3-Clause"
] | null | null | null | from test.data import context1, context2, tarek
import pytest
from rdflib import ConjunctiveGraph, Graph, Literal
from rdflib.namespace import OWL, Namespace
from rdflib.plugins.stores.memory import Memory
from rdflib.term import URIRef
foaf1_uri = URIRef("http://xmlns.com/foaf/0.1/")
foaf2_uri = URIRef("http://xmln... | 30.686364 | 98 | 0.64272 | from test.data import context1, context2, tarek
import pytest
from rdflib import ConjunctiveGraph, Graph, Literal
from rdflib.namespace import OWL, Namespace
from rdflib.plugins.stores.memory import Memory
from rdflib.term import URIRef
foaf1_uri = URIRef("http://xmlns.com/foaf/0.1/")
foaf2_uri = URIRef("http://xmln... | true | true |
f7621770d26f6e61ce232c4ac601700ab57bbccd | 3,019 | py | Python | molo/surveys/tests/test_multi_site_one_root_page.py | praekelt/molo.surveys | c86d231f7cee669eb1c91db49ec05cf711984e30 | [
"BSD-3-Clause"
] | null | null | null | molo/surveys/tests/test_multi_site_one_root_page.py | praekelt/molo.surveys | c86d231f7cee669eb1c91db49ec05cf711984e30 | [
"BSD-3-Clause"
] | 88 | 2016-06-14T18:36:18.000Z | 2018-09-21T07:33:58.000Z | molo/surveys/tests/test_multi_site_one_root_page.py | praekeltfoundation/molo.surveys | c86d231f7cee669eb1c91db49ec05cf711984e30 | [
"BSD-3-Clause"
] | 1 | 2017-10-02T09:27:45.000Z | 2017-10-02T09:27:45.000Z | from django.test import TestCase, Client
from molo.core.models import Main, SiteLanguageRelation, Languages
from molo.core.tests.base import MoloTestCaseMixin
from molo.core.utils import generate_slug
from molo.surveys.models import (
SurveysIndexPage,
MoloSurveyPage,
MoloSurveyFormField
)
from wagtail.cor... | 38.21519 | 74 | 0.657171 | from django.test import TestCase, Client
from molo.core.models import Main, SiteLanguageRelation, Languages
from molo.core.tests.base import MoloTestCaseMixin
from molo.core.utils import generate_slug
from molo.surveys.models import (
SurveysIndexPage,
MoloSurveyPage,
MoloSurveyFormField
)
from wagtail.cor... | true | true |
f762178a49406f6041a022ececc74c93cd9f9135 | 27 | py | Python | search/routes/__init__.py | ID2797370/arxiv-search | 889402e8eef9a2faaa8e900978cd27ff2784ce33 | [
"MIT"
] | 35 | 2018-12-18T02:51:09.000Z | 2022-03-30T04:43:20.000Z | search/routes/__init__.py | Acidburn0zzz/arxiv-search | e0d91dadc6533ff25f521e37977c4e690a505531 | [
"MIT"
] | 172 | 2018-02-02T14:35:11.000Z | 2018-12-04T15:35:30.000Z | search/routes/__init__.py | Acidburn0zzz/arxiv-search | e0d91dadc6533ff25f521e37977c4e690a505531 | [
"MIT"
] | 13 | 2019-01-10T22:01:48.000Z | 2021-11-05T12:25:08.000Z | """arxiv search routes."""
| 13.5 | 26 | 0.62963 | true | true | |
f76217aa82f808381ac003b1e82d7c1fc97cd831 | 1,326 | py | Python | setup.py | caser789/flask-jwt | 4b06a20799f5bee237763add3af5b80c79ac684f | [
"MIT"
] | null | null | null | setup.py | caser789/flask-jwt | 4b06a20799f5bee237763add3af5b80c79ac684f | [
"MIT"
] | 1 | 2021-03-25T22:35:35.000Z | 2021-03-25T22:35:35.000Z | setup.py | caser789/flask-jwt | 4b06a20799f5bee237763add3af5b80c79ac684f | [
"MIT"
] | null | null | null | """
Flask-JWT-Extended
-------------------
Flask-Login provides jwt endpoint protection for Flask.
"""
from setuptools import setup
setup(name='JX-Flask-JWT-Extention',
version='0.0.2',
url='https://github.com/caser789/flask-jwt',
license='MIT',
author='Xue Jiao',
author_email='jiao.xueji... | 36.833333 | 70 | 0.604072 | from setuptools import setup
setup(name='JX-Flask-JWT-Extention',
version='0.0.2',
url='https://github.com/caser789/flask-jwt',
license='MIT',
author='Xue Jiao',
author_email='jiao.xuejiao@gmail.com',
description='Extended JWT integration with Flask',
long_description='Extende... | true | true |
f76217f7f0c579fa7abcd2c5d2d9b9512658b93f | 2,987 | py | Python | examples/v201/central_system.py | maurerle/ocpp | 41d4a16c368cab124264a052844332d29248372e | [
"MIT"
] | 257 | 2019-05-27T09:44:49.000Z | 2022-03-29T15:38:53.000Z | examples/v201/central_system.py | maurerle/ocpp | 41d4a16c368cab124264a052844332d29248372e | [
"MIT"
] | 281 | 2019-05-26T14:44:14.000Z | 2022-03-31T12:43:13.000Z | examples/v201/central_system.py | maurerle/ocpp | 41d4a16c368cab124264a052844332d29248372e | [
"MIT"
] | 147 | 2019-06-14T21:14:19.000Z | 2022-03-31T19:58:20.000Z | import asyncio
import logging
from datetime import datetime
try:
import websockets
except ModuleNotFoundError:
print("This example relies on the 'websockets' package.")
print("Please install it by running: ")
print()
print(" $ pip install websockets")
import sys
sys.exit(1)
from ocpp.routi... | 31.114583 | 78 | 0.644125 | import asyncio
import logging
from datetime import datetime
try:
import websockets
except ModuleNotFoundError:
print("This example relies on the 'websockets' package.")
print("Please install it by running: ")
print()
print(" $ pip install websockets")
import sys
sys.exit(1)
from ocpp.routi... | true | true |
f76218400b012cddf2ab8ea4c7860a8ff4995a16 | 615 | py | Python | tests/test_EpochArray.py | elifesciences-publications/nelpy | 68c1ffff5eee5de60fc365c4f5df3c7200f5c319 | [
"MIT"
] | null | null | null | tests/test_EpochArray.py | elifesciences-publications/nelpy | 68c1ffff5eee5de60fc365c4f5df3c7200f5c319 | [
"MIT"
] | null | null | null | tests/test_EpochArray.py | elifesciences-publications/nelpy | 68c1ffff5eee5de60fc365c4f5df3c7200f5c319 | [
"MIT"
] | 1 | 2018-11-26T04:56:40.000Z | 2018-11-26T04:56:40.000Z | """EpochArray tests"""
import nelpy as nel
from nelpy.core import *
class TestEpochArray:
def test_partition(self):
ep = EpochArray([0,10])
partitioned = ep.partition(n_epochs=5)
assert ep.n_epochs == 1
assert partitioned.n_epochs == 5
# epochs_a = nel.EpochArray([[0, 5], [5,10],... | 23.653846 | 72 | 0.538211 | import nelpy as nel
from nelpy.core import *
class TestEpochArray:
def test_partition(self):
ep = EpochArray([0,10])
partitioned = ep.partition(n_epochs=5)
assert ep.n_epochs == 1
assert partitioned.n_epochs == 5
| true | true |
f7621926422a608ae9da5953576237c4be0f074f | 4,459 | py | Python | azfilebak/azurevminstancemetadata.py | chgeuer/python_backup_files | 97263643d831ed8664e59c06311e5d6530afb831 | [
"MIT"
] | 1 | 2021-07-07T14:59:16.000Z | 2021-07-07T14:59:16.000Z | azfilebak/azurevminstancemetadata.py | chgeuer/python_backup_files | 97263643d831ed8664e59c06311e5d6530afb831 | [
"MIT"
] | 1 | 2021-06-01T22:37:28.000Z | 2021-06-01T22:37:28.000Z | azfilebak/azurevminstancemetadata.py | chgeuer/python_backup_files | 97263643d831ed8664e59c06311e5d6530afb831 | [
"MIT"
] | 1 | 2018-09-05T15:39:06.000Z | 2018-09-05T15:39:06.000Z | # coding=utf-8
"""AzureVMInstanceMetadata module."""
import urllib2
import json
from .backupexception import BackupException
def lazy_property(fn):
"""Decorator that makes a property lazy-evaluated."""
attr_name = '_lazy_' + fn.__name__
@property
def _lazy_property(self):
if not hasattr(self,... | 45.5 | 601 | 0.668536 |
import urllib2
import json
from .backupexception import BackupException
def lazy_property(fn):
attr_name = '_lazy_' + fn.__name__
@property
def _lazy_property(self):
if not hasattr(self, attr_name):
setattr(self, attr_name, fn(self))
return getattr(self, attr_name)
return ... | true | true |
f76219704832db89ea85ca41c936abaae3555786 | 1,924 | py | Python | test/functional/rpc_help.py | bugls/worldcoin | 214767f3f2aaea7312bccc6593ad4dce10447576 | [
"MIT"
] | 3 | 2021-11-09T00:54:55.000Z | 2022-01-14T04:28:47.000Z | test/functional/rpc_help.py | bugls/worldcoin | 214767f3f2aaea7312bccc6593ad4dce10447576 | [
"MIT"
] | 1 | 2021-10-31T18:00:16.000Z | 2021-10-31T18:00:16.000Z | test/functional/rpc_help.py | bugls/worldcoin | 214767f3f2aaea7312bccc6593ad4dce10447576 | [
"MIT"
] | 2 | 2021-03-29T14:53:31.000Z | 2022-02-06T22:17:04.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Worldcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC help output."""
from test_framework.test_framework import WorldcoinTestFramework
from test_frame... | 33.172414 | 123 | 0.650728 |
from test_framework.test_framework import WorldcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error
import os
class HelpRpcTest(WorldcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
self.test_categories()
self.d... | true | true |
f762198212ae336667fb76228287c8ecac7633eb | 874 | py | Python | sqlite_colorbrewer/__init__.py | eyeseast/sqlite-colorbrewer | ce9f1e0dda489e1a032d3579d45639ea7f0b597d | [
"Apache-2.0"
] | 3 | 2022-02-23T15:16:57.000Z | 2022-03-03T17:16:40.000Z | sqlite_colorbrewer/__init__.py | eyeseast/sqlite-colorbrewer | ce9f1e0dda489e1a032d3579d45639ea7f0b597d | [
"Apache-2.0"
] | null | null | null | sqlite_colorbrewer/__init__.py | eyeseast/sqlite-colorbrewer | ce9f1e0dda489e1a032d3579d45639ea7f0b597d | [
"Apache-2.0"
] | null | null | null | import sqlite3
import sys
from . import colorbrewer
try:
from datasette import hookimpl
has_datasette = True
except ImportError:
has_datasette = False
if has_datasette:
@hookimpl
def prepare_connection(conn):
register(conn)
def register(conn):
if sys.version_info >= (3, 8):
... | 21.85 | 73 | 0.679634 | import sqlite3
import sys
from . import colorbrewer
try:
from datasette import hookimpl
has_datasette = True
except ImportError:
has_datasette = False
if has_datasette:
@hookimpl
def prepare_connection(conn):
register(conn)
def register(conn):
if sys.version_info >= (3, 8):
... | true | true |
f7621b082162561a3d0106552860318f55f14f5f | 5,045 | py | Python | tools/seccomp_policy_lint.py | dgreid/minijail | 43c54d7994db642fca1491572c3ae3ec74f4e02f | [
"BSD-3-Clause"
] | null | null | null | tools/seccomp_policy_lint.py | dgreid/minijail | 43c54d7994db642fca1491572c3ae3ec74f4e02f | [
"BSD-3-Clause"
] | null | null | null | tools/seccomp_policy_lint.py | dgreid/minijail | 43c54d7994db642fca1491572c3ae3ec74f4e02f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (C) 2021 The Android Open Source Project
#
# 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 re... | 33.190789 | 80 | 0.586323 |
import argparse
import re
import sys
from typing import List, NamedTuple
DANGEROUS_SYSCALLS = (
'clone',
'mount',
'setns',
'kill',
'execve',
'execveat',
'bpf',
'socket',
'ptrace',
'swapon',
'swapoff',
'prctl',
'ioctl',
)
class CheckPolicyReturn(NamedTuple):
... | true | true |
f7621b2e7ede3c055606e7fcfeabebd4d8ce497c | 248 | py | Python | datacollection/mysite/polls/libs/mclient/config.py | slient2010/tools | 20811e600753a477512b9d2ceded48003654faf4 | [
"MIT"
] | null | null | null | datacollection/mysite/polls/libs/mclient/config.py | slient2010/tools | 20811e600753a477512b9d2ceded48003654faf4 | [
"MIT"
] | null | null | null | datacollection/mysite/polls/libs/mclient/config.py | slient2010/tools | 20811e600753a477512b9d2ceded48003654faf4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 加密密钥
SECRET_KEY="H2rqkNJVi9f4Uo4WQ5HIqlydxeNlyTSEz5lU/De9qfI="
#SERVER='127.0.0.1'
SERVER='m0058.baiduwebgame.com'
PORT=9911
USER="elasticsearchapi"
PASSWD="NjS2zQ7sAyyTymz0dS-RYstC_EFkH1sE"
| 20.666667 | 58 | 0.729839 | SECRET_KEY="H2rqkNJVi9f4Uo4WQ5HIqlydxeNlyTSEz5lU/De9qfI="
SERVER='m0058.baiduwebgame.com'
PORT=9911
USER="elasticsearchapi"
PASSWD="NjS2zQ7sAyyTymz0dS-RYstC_EFkH1sE"
| true | true |
f7621be987beea456b3b7a908ab886d87221f813 | 9,683 | py | Python | troveclient/v1/backups.py | mail2nsrajesh/python-troveclient | 8aaa4e81aa6d8f35038c6c736fb4ab0eb44a97f0 | [
"Apache-2.0"
] | null | null | null | troveclient/v1/backups.py | mail2nsrajesh/python-troveclient | 8aaa4e81aa6d8f35038c6c736fb4ab0eb44a97f0 | [
"Apache-2.0"
] | null | null | null | troveclient/v1/backups.py | mail2nsrajesh/python-troveclient | 8aaa4e81aa6d8f35038c6c736fb4ab0eb44a97f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | 34.706093 | 79 | 0.599608 |
import json
import six
import uuid
from mistralclient.api.client import client as mistral_client
from troveclient import base
from troveclient import common
class Backup(base.Resource):
def __repr__(self):
return "<Backup: %s>" % self.name
class Schedule(base.Resource):
def __repr__(self):
... | true | true |
f7621ccac625b619ae4d56754dd21e53ad6f088b | 197 | py | Python | terra_sdk/core/treasury/__init__.py | yeeyangtee/terra-sdk-python | 44e31290cfcb5563dd31a0d9c64c3ef2af72c0e2 | [
"MIT"
] | 1 | 2021-09-13T22:27:37.000Z | 2021-09-13T22:27:37.000Z | terra_sdk/core/treasury/__init__.py | yeeyangtee/terra-sdk-python | 44e31290cfcb5563dd31a0d9c64c3ef2af72c0e2 | [
"MIT"
] | null | null | null | terra_sdk/core/treasury/__init__.py | yeeyangtee/terra-sdk-python | 44e31290cfcb5563dd31a0d9c64c3ef2af72c0e2 | [
"MIT"
] | 1 | 2021-05-06T09:56:58.000Z | 2021-05-06T09:56:58.000Z | from .data import PolicyConstraints
from .proposals import RewardWeightUpdateProposal, TaxRateUpdateProposal
__all__ = ["PolicyConstraints", "TaxRateUpdateProposal", "RewardWeightUpdateProposal"]
| 39.4 | 86 | 0.852792 | from .data import PolicyConstraints
from .proposals import RewardWeightUpdateProposal, TaxRateUpdateProposal
__all__ = ["PolicyConstraints", "TaxRateUpdateProposal", "RewardWeightUpdateProposal"]
| true | true |
f7621e444e64678f45e1b1404005e228da6c07dc | 5,924 | py | Python | plugins/subcategory/subcategory.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 13 | 2020-01-27T09:02:25.000Z | 2022-01-20T07:45:26.000Z | plugins/subcategory/subcategory.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 29 | 2020-03-22T06:57:57.000Z | 2022-01-24T22:46:42.000Z | plugins/subcategory/subcategory.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 6 | 2020-07-10T00:13:30.000Z | 2022-01-26T08:22:33.000Z | # -*- coding: utf-8 -*-
"""
@Author: Alistair Magee
Adds support for subcategories on pelican articles
"""
import os
from collections import defaultdict
from operator import attrgetter
from functools import partial
from pelican import signals
from pelican.urlwrappers import URLWrapper, Category
from pelican.utils imp... | 36.795031 | 87 | 0.650405 | import os
from collections import defaultdict
from operator import attrgetter
from functools import partial
from pelican import signals
from pelican.urlwrappers import URLWrapper, Category
from pelican.utils import slugify, python_2_unicode_compatible
from six import text_type
class SubCategory(URLWrapper):
def... | true | true |
f7621ebcddc112707b1de7b2717feb43539d91e2 | 2,281 | py | Python | reach/airflow/safe_import.py | j-jaworski/reach | 4f28eca1b35ce9cb57a0b6eeca788b7179421e91 | [
"MIT"
] | 11 | 2019-11-04T08:24:00.000Z | 2021-12-16T23:11:47.000Z | split_reach/base/safe_import.py | AzizIlyosov/reach | 9cd8e9ab11231cc3f761bff58df1c78d355e4d78 | [
"MIT"
] | 274 | 2019-10-30T15:37:17.000Z | 2021-03-25T16:13:36.000Z | split_reach/base/safe_import.py | AzizIlyosov/reach | 9cd8e9ab11231cc3f761bff58df1c78d355e4d78 | [
"MIT"
] | 3 | 2019-11-12T13:38:14.000Z | 2020-04-16T07:49:04.000Z | """
Prevents multiple threads from trying to import at the same time and
hitting an import lock. Implemented because airflow's web server
regularly re-imports all DAGs and all tasks therein -- and
unfortunately, our tasks import so many dependencies that reloading them
takes enough time (by some random distribution) th... | 38.016667 | 72 | 0.72249 |
from contextlib import contextmanager
from threading import Lock
SAFE_IMPORT_LOCK = Lock()
@contextmanager
def safe_import():
acquired = SAFE_IMPORT_LOCK.acquire(blocking=False)
try:
if not acquired:
# works, only one call to execute() should happen at a time,
... | true | true |
f7621fd4d0b7a7dbeb4f949638e687054289955a | 1,552 | py | Python | pynsxt/nsx_dfw_section.py | yktsubo/pynsxt | 29d20409b417414327a3417341af60ced3d561dd | [
"MIT"
] | null | null | null | pynsxt/nsx_dfw_section.py | yktsubo/pynsxt | 29d20409b417414327a3417341af60ced3d561dd | [
"MIT"
] | 1 | 2020-01-21T05:59:27.000Z | 2020-01-21T05:59:27.000Z | pynsxt/nsx_dfw_section.py | yktsubo/pynsxt | 29d20409b417414327a3417341af60ced3d561dd | [
"MIT"
] | 3 | 2018-03-28T18:37:33.000Z | 2019-05-21T02:03:10.000Z | from logging import basicConfig, getLogger, DEBUG
logger = getLogger(__name__)
OBJECT = 'DFW section'
MODULE = 'Services'
def get_list(client):
"""
"""
request = client.__getattr__(MODULE).ListSections()
response, _ = request.result()
return response['results']
def get_id(client, data):
if... | 23.164179 | 65 | 0.598582 | from logging import basicConfig, getLogger, DEBUG
logger = getLogger(__name__)
OBJECT = 'DFW section'
MODULE = 'Services'
def get_list(client):
request = client.__getattr__(MODULE).ListSections()
response, _ = request.result()
return response['results']
def get_id(client, data):
if data.has_key('i... | true | true |
f762224c4758d06506bef2627645f74de6a04bdc | 831 | py | Python | tests/test_io.py | joaogui1/evoflow | 4824c70443498c5ceb7311f235a7fe8274c69a23 | [
"Apache-2.0"
] | 33 | 2020-05-16T22:45:52.000Z | 2021-12-11T14:31:38.000Z | tests/test_io.py | joaogui1/evoflow | 4824c70443498c5ceb7311f235a7fe8274c69a23 | [
"Apache-2.0"
] | 54 | 2020-05-17T05:09:38.000Z | 2020-12-02T05:26:58.000Z | tests/test_io.py | isabella232/evoflow | b2649137e77b237416e7022b0eb9cf7cf03c0d62 | [
"Apache-2.0"
] | 6 | 2020-05-30T13:23:47.000Z | 2022-01-16T11:39:19.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.678571 | 74 | 0.743682 |
from evoflow import io
def test_print_debug_multi_msg():
io.print_debug('component', 'msg1', 'msg2')
def test_casting_msg():
io.print_debug('component', [1, 2], 3)
def test_print_debug_single_msg():
io.print_debug('component', "simple")
| true | true |
f7622587221f9b8c2e93c5025ff2aac94b1469a2 | 320 | py | Python | units/temperature/kelvin.py | putridparrot/PyUnits | 4f1095c6fc0bee6ba936921c391913dbefd9307c | [
"MIT"
] | null | null | null | units/temperature/kelvin.py | putridparrot/PyUnits | 4f1095c6fc0bee6ba936921c391913dbefd9307c | [
"MIT"
] | null | null | null | units/temperature/kelvin.py | putridparrot/PyUnits | 4f1095c6fc0bee6ba936921c391913dbefd9307c | [
"MIT"
] | null | null | null | # <auto-generated>
# This code was generated by the UnitCodeGenerator tool
#
# Changes to this file will be lost if the code is regenerated
# </auto-generated>
def to_celsius(value):
return value - 273.15
def to_fahrenheit(value):
return ((value - 273.15) * 1.8) + 32.0
def to_rankine(value):
return value * 1.8
| 22.857143 | 62 | 0.7125 |
def to_celsius(value):
return value - 273.15
def to_fahrenheit(value):
return ((value - 273.15) * 1.8) + 32.0
def to_rankine(value):
return value * 1.8
| true | true |
f762275526c6f4d303298e85ea00c12d49f66c2c | 22,010 | py | Python | qa/rpc-tests/replace-by-fee.py | mirzaei-ce/linux-shiabit | 1c0e7371d1bb41e3efe20add0819d4e5050a3a0f | [
"MIT"
] | null | null | null | qa/rpc-tests/replace-by-fee.py | mirzaei-ce/linux-shiabit | 1c0e7371d1bb41e3efe20add0819d4e5050a3a0f | [
"MIT"
] | null | null | null | qa/rpc-tests/replace-by-fee.py | mirzaei-ce/linux-shiabit | 1c0e7371d1bb41e3efe20add0819d4e5050a3a0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test replace by fee code
#
from test_framework.test_framework import ShiabitTestFramework
from test_... | 37.116358 | 105 | 0.602908 |
from test_framework.test_framework import ShiabitTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
import binascii
COIN = 100000000
MAX_REPLACEMENT_LIMIT = 100
def satoshi_round(amount):
return Decimal(amount).quantize(Decimal('0.00000001')... | false | true |
f762280d87c26f91f23cd6a830245b3188f01ae6 | 1,054 | py | Python | camera/main.py | ITogane/study-picamera-examples | 5db3f041721f817acaaa805b9274e71ce4dfc3c5 | [
"MIT"
] | null | null | null | camera/main.py | ITogane/study-picamera-examples | 5db3f041721f817acaaa805b9274e71ce4dfc3c5 | [
"MIT"
] | null | null | null | camera/main.py | ITogane/study-picamera-examples | 5db3f041721f817acaaa805b9274e71ce4dfc3c5 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Response
from processor.simple_streamer import SimpleStreamer as VideoCamera
# from processor.pedestrian_detector import PedestrianDetector as VideoCamera
# from processor.motion_detector import MotionDetector as VideoCamera
# from processor.qr_detector import QRDetector as Vid... | 30.114286 | 77 | 0.736243 | from flask import Flask, render_template, Response
from processor.simple_streamer import SimpleStreamer as VideoCamera
import time
import threading
video_camera = VideoCamera(flip=False)
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
def gen(camera):
while True:
... | true | true |
f76228b23934d890feb0c55b22c0b9a59faa66c3 | 698 | py | Python | Netmiko/Multi_File_Nmko.py | parth1197/Network-Configurations | dac9f3cdd8de55ea687db4d2b7fc36911b80eb8e | [
"Apache-2.0"
] | null | null | null | Netmiko/Multi_File_Nmko.py | parth1197/Network-Configurations | dac9f3cdd8de55ea687db4d2b7fc36911b80eb8e | [
"Apache-2.0"
] | null | null | null | Netmiko/Multi_File_Nmko.py | parth1197/Network-Configurations | dac9f3cdd8de55ea687db4d2b7fc36911b80eb8e | [
"Apache-2.0"
] | null | null | null | from netmiko import ConnectHandler
import getpass
passwd = getpass.getpass()
with open('config.txt','r') as f:
device_list = f.read().splitlines()
print(device_list)
my_list = list()
for ip in device_list:
cisco_device = {
'device_type': 'cisco_ios',
'ip': ip,
'username': 'parth'... | 20.529412 | 41 | 0.623209 | from netmiko import ConnectHandler
import getpass
passwd = getpass.getpass()
with open('config.txt','r') as f:
device_list = f.read().splitlines()
print(device_list)
my_list = list()
for ip in device_list:
cisco_device = {
'device_type': 'cisco_ios',
'ip': ip,
'username': 'parth'... | true | true |
f76228b59c9819588b36faf84f19ce4a94173c89 | 7,940 | py | Python | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/create_or_delete_publish_record_for_api_v2_response.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-apig/huaweicloudsdkapig/v2/model/create_or_delete_publish_record_for_api_v2_response.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-apig/huaweicloudsdkapig/v2/model/create_or_delete_publish_record_for_api_v2_response.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.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateOrDeletePublishRecordForApiV2Response(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.66426 | 130 | 0.616373 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateOrDeletePublishRecordForApiV2Response(SdkResponse):
sensitive_list = []
openapi_types = {
'publish_id': 'str',
'api_id': 's... | true | true |
f76228c5de77feeb35d42165223857045ce1f800 | 1,436 | py | Python | newrelic/core/graphql_utils.py | newrelic/newrelic-python-agen | 4f292ec1219c0daffc5721a7b3a245b97d0f83ba | [
"Apache-2.0"
] | 92 | 2020-06-12T17:53:23.000Z | 2022-03-01T11:13:21.000Z | newrelic/core/graphql_utils.py | newrelic/newrelic-python-agen | 4f292ec1219c0daffc5721a7b3a245b97d0f83ba | [
"Apache-2.0"
] | 347 | 2020-07-10T00:10:19.000Z | 2022-03-31T17:58:56.000Z | newrelic/core/graphql_utils.py | newrelic/newrelic-python-agen | 4f292ec1219c0daffc5721a7b3a245b97d0f83ba | [
"Apache-2.0"
] | 58 | 2020-06-17T13:51:57.000Z | 2022-03-06T14:26:53.000Z | # Copyright 2010 New Relic, 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 writ... | 27.615385 | 74 | 0.733287 |
import weakref
from newrelic.core.database_utils import SQLStatement
class GraphQLStyle(object):
quoting_style = "single+double"
class GraphQLStatement(SQLStatement):
def __init__(self, graphql):
super(GraphQLStatement, self).__init__(graphql, GraphQLStyle())
self._operation = "... | true | true |
f76228e9b7e2fbaa665052ab8062d801676e8fbd | 3,823 | py | Python | labman/gui/handlers/base.py | antgonza/labman | c3bb7a15cbfdbbf60a7b2b176fff207f99af0002 | [
"BSD-3-Clause"
] | null | null | null | labman/gui/handlers/base.py | antgonza/labman | c3bb7a15cbfdbbf60a7b2b176fff207f99af0002 | [
"BSD-3-Clause"
] | null | null | null | labman/gui/handlers/base.py | antgonza/labman | c3bb7a15cbfdbbf60a7b2b176fff207f99af0002 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2017-, labman development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------... | 35.073394 | 78 | 0.604499 |
import re
from datetime import datetime
from traceback import format_exception
from tornado.web import RequestHandler, authenticated
from labman.db.user import User
class BaseHandler(RequestHandler):
def get_current_user(self):
username = self.get_secure_cookie("user")
if username is not None:... | true | true |
f76229908ba9fccade1b2bf42ec901bec2bdf14f | 30,555 | py | Python | tests/__init__.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/__init__.py | SzySteve/dd-trace-py | 90d1d5981c72ea312c21ac04e5be47521d0f0f2e | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import contextlib
import inspect
import os
import sys
from contextlib import contextmanager
import pytest
from ddtrace.vendor import wrapt
import ddtrace
from ddtrace import Tracer, Span
from ddtrace.compat import httplib, to_unicode
from ddtrace.constants import SPAN_MEASURED_KEY
from ddtrace.encoding import JSONEnc... | 33.503289 | 111 | 0.60252 | import contextlib
import inspect
import os
import sys
from contextlib import contextmanager
import pytest
from ddtrace.vendor import wrapt
import ddtrace
from ddtrace import Tracer, Span
from ddtrace.compat import httplib, to_unicode
from ddtrace.constants import SPAN_MEASURED_KEY
from ddtrace.encoding import JSONEnc... | true | true |
f76229a8a533ef4d36f1f9df7a415bdf0128fb62 | 586 | py | Python | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/linear_model/least_angle.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/linear_model/least_angle.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/linear_model/least_angle.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 13 | 2020-09-07T07:24:35.000Z | 2022-02-24T04:56:16.000Z |
# THIS FILE WAS AUTOMATICALLY GENERATED BY deprecated_modules.py
import sys
# mypy error: Module X has no attribute y (typically for C extensions)
from . import _least_angle # type: ignore
from ..externals._pep562 import Pep562
from ..utils.deprecation import _raise_dep_warning_if_not_pytest
deprecated_path = 'sklea... | 30.842105 | 70 | 0.805461 |
import sys
from . import _least_angle from ..externals._pep562 import Pep562
from ..utils.deprecation import _raise_dep_warning_if_not_pytest
deprecated_path = 'sklearn.linear_model.least_angle'
correct_import_path = 'sklearn.linear_model'
_raise_dep_warning_if_not_pytest(deprecated_path, correct_import_path)
def ... | true | true |
f7622a01927e183950011834bc774af1be81678a | 971 | py | Python | core/exceptions.py | AnyKeyShik/Bismark | e957cf492c610162f2b9a168a484c825ed2861e4 | [
"MIT"
] | 2 | 2020-01-08T14:05:29.000Z | 2020-03-02T02:46:17.000Z | core/exceptions.py | AnyKeyShik/Bismarck | e957cf492c610162f2b9a168a484c825ed2861e4 | [
"MIT"
] | 11 | 2019-04-14T22:46:15.000Z | 2020-05-12T19:11:04.000Z | core/exceptions.py | AnyKeyShik/Bismark | e957cf492c610162f2b9a168a484c825ed2861e4 | [
"MIT"
] | 2 | 2020-02-11T15:14:43.000Z | 2020-04-07T06:01:38.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020.
#
# Created by AnyKeyShik Rarity
#
# Telegram: @AnyKeyShik
# GitHub: https://github.com/AnyKeyShik
# E-mail: nikitag594@gmail.com
class NotFoundException(Exception):
pass
class AnimeNotFoundException(NotFoundException):
pass
class CommandNotFoundExce... | 14.938462 | 50 | 0.759011 |
class NotFoundException(Exception):
pass
class AnimeNotFoundException(NotFoundException):
pass
class CommandNotFoundException(NotFoundException):
pass
class PictureNotFoundException(NotFoundException):
pass
class RatingNotFoundException(NotFoundException):
pass
class TagsNotFoundExceptio... | true | true |
f7622a0e8cb54686307717dfc205c3ba03a27138 | 2,193 | py | Python | urbandict-search/app.py | madhukar01/examples | 7f4a2ee3394a2483bb9c848a674abd93c0f34443 | [
"Apache-2.0"
] | null | null | null | urbandict-search/app.py | madhukar01/examples | 7f4a2ee3394a2483bb9c848a674abd93c0f34443 | [
"Apache-2.0"
] | null | null | null | urbandict-search/app.py | madhukar01/examples | 7f4a2ee3394a2483bb9c848a674abd93c0f34443 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import click
import os
import string
import random
from jina.flow import Flow
RANDOM_SEED = 10 # 5
os.environ['PARALLEL'] = str(2)
os.environ['SHARDS'] = str(2)
def get_random_ws(workspace_path, length=8):
ra... | 31.782609 | 104 | 0.599635 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import click
import os
import string
import random
from jina.flow import Flow
RANDOM_SEED = 10 os.environ['PARALLEL'] = str(2)
os.environ['SHARDS'] = str(2)
def get_random_ws(workspace_path, length=8):
random... | true | true |
f7622a47090f6e6a819c495ef27a4a1e1d020d7b | 145,923 | py | Python | src/config/api-server/vnc_cfg_api_server.py | sagarc-contrail/contrail-controller | 834302367f3ff81f1ce93f4036b6b3788dfd6994 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server.py | sagarc-contrail/contrail-controller | 834302367f3ff81f1ce93f4036b6b3788dfd6994 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server.py | sagarc-contrail/contrail-controller | 834302367f3ff81f1ce93f4036b6b3788dfd6994 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
"""
This is the main module in vnc_cfg_api_server package. It manages interaction
between http/rest, address management, authentication and database interfaces.
"""
from gevent import monkey
monkey.patch_all()
from gevent import hub
# from neutron p... | 41.209545 | 136 | 0.587961 | """
This is the main module in vnc_cfg_api_server package. It manages interaction
between http/rest, address management, authentication and database interfaces.
"""
from gevent import monkey
monkey.patch_all()
from gevent import hub
import gevent.pywsgi
gevent.pywsgi.MAX_REQUEST_LINE = 65535
import sys
reload(sys)
s... | false | true |
f7622bdbd148128a912a21d30fc2a0f97001fcb8 | 10,710 | py | Python | utils/helpful_util.py | drcastillo/hicss2020 | 0a812257215c75054d8b891e23c933d6a8327c0d | [
"Apache-2.0"
] | null | null | null | utils/helpful_util.py | drcastillo/hicss2020 | 0a812257215c75054d8b891e23c933d6a8327c0d | [
"Apache-2.0"
] | null | null | null | utils/helpful_util.py | drcastillo/hicss2020 | 0a812257215c75054d8b891e23c933d6a8327c0d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Reference:
#from __future__ import print_function
#from utils.heaton_utils import *
import numpy as np
import warnings
import os
import pandas as pd
import matplotlib.pyplot as plt
import sys
import glob
#pip install counter
from collections import Counter
import pic... | 32.259036 | 129 | 0.610458 |
import numpy as np
import warnings
import os
import pandas as pd
import matplotlib.pyplot as plt
import sys
import glob
from collections import Counter
import pickle
import sklearn
from sklearn.model_selection import GridSearchCV, cross_val_score, StratifiedKFold, learning_curve
from keras.models import load_model... | true | true |
f7622c6edb51a53ce9850b1312af23d8ac4de86d | 6,741 | py | Python | rest/models/employee.py | feliu-io/hr-rest-api | 0a81edbd7045d679e8fa16a08ced8610be4efd8a | [
"MIT"
] | null | null | null | rest/models/employee.py | feliu-io/hr-rest-api | 0a81edbd7045d679e8fa16a08ced8610be4efd8a | [
"MIT"
] | null | null | null | rest/models/employee.py | feliu-io/hr-rest-api | 0a81edbd7045d679e8fa16a08ced8610be4efd8a | [
"MIT"
] | null | null | null | from db import db
from models.absence_authorization import AbsenceAuthorizationModel
from models.attendance import AttendanceModel
from models.bank_account import BankAccountModel
from models.deduction import DeductionModel
from models.dependent import DependentModel
from models.emergency_contact import EmergencyContac... | 46.171233 | 78 | 0.622015 | from db import db
from models.absence_authorization import AbsenceAuthorizationModel
from models.attendance import AttendanceModel
from models.bank_account import BankAccountModel
from models.deduction import DeductionModel
from models.dependent import DependentModel
from models.emergency_contact import EmergencyContac... | true | true |
f7622e7fe9a72ff1f4b1ab83e5f6c96f7eed457c | 7,447 | py | Python | bb-master/sandbox/lib/python3.5/site-packages/buildbot/reporters/gitlab.py | Alecto3-D/testable-greeter | 09e8e488edfb7e46cf5867b2b5a6ebe0b1929f78 | [
"MIT"
] | 2 | 2017-07-11T18:56:27.000Z | 2017-07-28T14:01:12.000Z | bb-master/sandbox/lib/python3.5/site-packages/buildbot/reporters/gitlab.py | Alecto3-D/testable-greeter | 09e8e488edfb7e46cf5867b2b5a6ebe0b1929f78 | [
"MIT"
] | 1 | 2017-07-28T13:53:41.000Z | 2017-07-31T15:30:40.000Z | bb-master/sandbox/lib/python3.5/site-packages/buildbot/reporters/gitlab.py | Alecto3-D/testable-greeter | 09e8e488edfb7e46cf5867b2b5a6ebe0b1929f78 | [
"MIT"
] | null | null | null | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | 40.254054 | 88 | 0.599436 |
from __future__ import absolute_import
from __future__ import print_function
from future.moves.urllib.parse import quote_plus as urlquote_plus
from twisted.internet import defer
from twisted.python import log
from buildbot.process.properties import Interpolate
from buildbot.process.properties import Properties
from ... | true | true |
f762303f66071aca8156046f5fe21d172a484b68 | 8,387 | py | Python | dummies/protoss/proxy_zealot_rush.py | eladyaniv01/sharpy-sc2 | 91119cc3e3fce683c2dbe9687c616c9cc0461b06 | [
"MIT"
] | null | null | null | dummies/protoss/proxy_zealot_rush.py | eladyaniv01/sharpy-sc2 | 91119cc3e3fce683c2dbe9687c616c9cc0461b06 | [
"MIT"
] | null | null | null | dummies/protoss/proxy_zealot_rush.py | eladyaniv01/sharpy-sc2 | 91119cc3e3fce683c2dbe9687c616c9cc0461b06 | [
"MIT"
] | null | null | null | from sharpy.managers.building_solver import WallType
from sharpy.managers.roles import UnitTask
from sharpy.plans.acts import *
from sharpy.plans.acts.protoss import *
from sharpy.plans.require import *
from sharpy.plans.tactics import *
from sharpy.plans import BuildOrder, Step, SequentialList, StepBuildGas
from shar... | 41.519802 | 130 | 0.571003 | from sharpy.managers.building_solver import WallType
from sharpy.managers.roles import UnitTask
from sharpy.plans.acts import *
from sharpy.plans.acts.protoss import *
from sharpy.plans.require import *
from sharpy.plans.tactics import *
from sharpy.plans import BuildOrder, Step, SequentialList, StepBuildGas
from shar... | true | true |
f76230466c917bd9ffb6e97eaef973bfd11b3728 | 2,737 | py | Python | org/geo/entity/agent_police.py | haiming-97/Conflict1227 | c40f8fef17b59cbdc372405a6559f18d4f91c32b | [
"MIT"
] | null | null | null | org/geo/entity/agent_police.py | haiming-97/Conflict1227 | c40f8fef17b59cbdc372405a6559f18d4f91c32b | [
"MIT"
] | null | null | null | org/geo/entity/agent_police.py | haiming-97/Conflict1227 | c40f8fef17b59cbdc372405a6559f18d4f91c32b | [
"MIT"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
from org.geo.config.global_param import AgentStatus, ResidentAgent, PoliceAgent
from org.geo.entity.agent_base import Agent, Location
from org.geo.config.global_param import *
from org.geo.entity.agent_resident import *
from org.geo.config.global_param import AgentStatus, ResidentAgent, ... | 44.145161 | 110 | 0.674826 | from org.geo.config.global_param import AgentStatus, ResidentAgent, PoliceAgent
from org.geo.entity.agent_base import Agent, Location
from org.geo.config.global_param import *
from org.geo.entity.agent_resident import *
from org.geo.config.global_param import AgentStatus, ResidentAgent, SimulationParam
from org.geo.uti... | true | true |
f76230f35b3db4508ae8f531de8485689bd4c8de | 1,035 | py | Python | mysite/mysite/urls.py | chiachun2491/NTNU_OOAD-Project | d215dc4bfe13cadd1f95aff91753d43581f358dc | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | chiachun2491/NTNU_OOAD-Project | d215dc4bfe13cadd1f95aff91753d43581f358dc | [
"MIT"
] | 1 | 2021-06-05T13:40:28.000Z | 2021-06-05T17:41:32.000Z | mysite/mysite/urls.py | chiachun2491/NTNU_OOAD-Project | d215dc4bfe13cadd1f95aff91753d43581f358dc | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 35.689655 | 77 | 0.71401 | from django.conf.urls import include
from django.contrib import admin
from django.urls import path
from django.urls import re_path
from django.views.generic import TemplateView
urlpatterns = [
path('api/auth/', include('authentication.urls')),
path('api/game/', include('game.urls')),
path('admin/', admin.... | true | true |
f762310f25c24cb7a56296af113556da7b2897cc | 6,983 | py | Python | tests/integration/test_clustergram.py | shday/dash-bio-1 | 81bb6fa257febb59d7841f8c5573e7231f5a9095 | [
"MIT"
] | 430 | 2019-01-24T16:48:36.000Z | 2022-03-24T22:29:27.000Z | tests/integration/test_clustergram.py | shday/dash-bio-1 | 81bb6fa257febb59d7841f8c5573e7231f5a9095 | [
"MIT"
] | 370 | 2019-01-24T16:22:07.000Z | 2022-03-18T22:52:23.000Z | tests/integration/test_clustergram.py | shday/dash-bio-1 | 81bb6fa257febb59d7841f8c5573e7231f5a9095 | [
"MIT"
] | 201 | 2019-01-28T22:22:14.000Z | 2022-03-27T04:46:56.000Z | import json
import pandas as pd
import dash
import dash_html_components as html
import dash_bio
from common_features import nested_component_layout, nested_component_app_callback
_data = None
_mtcars_data = pd.read_csv(
"tests/dashbio_demos/dash-clustergram/data/mtcars.tsv", delimiter="\t", skiprows=4
).set_ind... | 28.736626 | 88 | 0.664328 | import json
import pandas as pd
import dash
import dash_html_components as html
import dash_bio
from common_features import nested_component_layout, nested_component_app_callback
_data = None
_mtcars_data = pd.read_csv(
"tests/dashbio_demos/dash-clustergram/data/mtcars.tsv", delimiter="\t", skiprows=4
).set_ind... | true | true |
f7623128f4c631cb86e0b5b055c9308e4d9c0d5a | 10,189 | py | Python | Section_05/5.03/view.py | PacktPublishing/Tkinter-GUI-Application-Development-Projects | 58b49e23e887bf45810666cb1c63d1e06291873b | [
"MIT"
] | 11 | 2019-05-24T17:03:55.000Z | 2021-11-24T23:59:38.000Z | Section_05/5.03/view.py | PacktPublishing/Tkinter-GUI-Application-Development-Projects | 58b49e23e887bf45810666cb1c63d1e06291873b | [
"MIT"
] | null | null | null | Section_05/5.03/view.py | PacktPublishing/Tkinter-GUI-Application-Development-Projects | 58b49e23e887bf45810666cb1c63d1e06291873b | [
"MIT"
] | 9 | 2019-06-19T02:20:15.000Z | 2022-03-25T01:36:14.000Z | import tkinter as tk
import tkinter.filedialog
import tkinter.messagebox
import tkinter.ttk
import os
import model
import player
AUDIO_PLAYER_NAME = "Achtung Baby"
class View:
loop_choices = [("No Loop", 1), ("Loop Current", 2), ("Loop All", 3)]
def __init__(self, root, model, player):
self.root = ... | 41.084677 | 132 | 0.657277 | import tkinter as tk
import tkinter.filedialog
import tkinter.messagebox
import tkinter.ttk
import os
import model
import player
AUDIO_PLAYER_NAME = "Achtung Baby"
class View:
loop_choices = [("No Loop", 1), ("Loop Current", 2), ("Loop All", 3)]
def __init__(self, root, model, player):
self.root = ... | true | true |
f76231a459c116e272b1bbd7db5970f7a78e46ee | 11,154 | py | Python | exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py | toumorokoshi/opentelemetry-python-contrib | 7159372e3b381119715c99a37603b3d2d6b9ea46 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py | toumorokoshi/opentelemetry-python-contrib | 7159372e3b381119715c99a37603b3d2d6b9ea46 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/exporter.py | toumorokoshi/opentelemetry-python-contrib | 7159372e3b381119715c99a37603b3d2d6b9ea46 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright The OpenTelemetry 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 or agreed to in ... | 34.85625 | 107 | 0.661108 |
import logging
import os
from urllib.parse import urlparse
from ddtrace.ext import SpanTypes as DatadogSpanTypes
from ddtrace.internal.writer import AgentWriter
from ddtrace.span import Span as DatadogSpan
import opentelemetry.trace as trace_api
from opentelemetry.exporter.datadog.constants import (
DD_ORIGIN,
... | true | true |
f76231badf1dc68840c0452bcc713e399403867d | 3,792 | py | Python | bokeh/sphinxext/bokeh_sitemap.py | TheLaw1337/bokeh | ca6c4abf3b0cef587136b8431e9d6ee6acbedc2f | [
"BSD-3-Clause"
] | 15,193 | 2015-01-01T05:11:45.000Z | 2022-03-31T19:30:20.000Z | bokeh/sphinxext/bokeh_sitemap.py | TheLaw1337/bokeh | ca6c4abf3b0cef587136b8431e9d6ee6acbedc2f | [
"BSD-3-Clause"
] | 9,554 | 2015-01-01T03:16:54.000Z | 2022-03-31T22:59:39.000Z | bokeh/sphinxext/bokeh_sitemap.py | TheLaw1337/bokeh | ca6c4abf3b0cef587136b8431e9d6ee6acbedc2f | [
"BSD-3-Clause"
] | 4,829 | 2015-01-02T03:35:32.000Z | 2022-03-30T16:40:26.000Z | # -----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------... | 32.135593 | 138 | 0.455169 |
from __future__ import annotations
import logging
log = logging.getLogger(__name__)
from html import escape
from os.path import join
from sphinx.errors import SphinxError
from sphinx.util import status_iterator
from . import PARALLEL_SAFE
__all__ = (
"build_finished",
"html_page_context",
"setup",... | true | true |
f76233ed188988a9cbbcb1af396528c0b8ab874e | 192 | py | Python | sample7.py | vswamy/python | 51835bf7cfec894059a41f2929509026fe611119 | [
"Apache-2.0"
] | null | null | null | sample7.py | vswamy/python | 51835bf7cfec894059a41f2929509026fe611119 | [
"Apache-2.0"
] | null | null | null | sample7.py | vswamy/python | 51835bf7cfec894059a41f2929509026fe611119 | [
"Apache-2.0"
] | null | null | null | #Learning Python
import os
#Remove duplicates in a string
x = 'madammadammadam'
s = set()
for c in x:
if(c in s):
continue
else:
s.add(c)
print(c)
print(s)
| 11.294118 | 30 | 0.567708 |
import os
x = 'madammadammadam'
s = set()
for c in x:
if(c in s):
continue
else:
s.add(c)
print(c)
print(s)
| true | true |
f7623462b9f9301a719b990f2198ae1b501b36eb | 18,733 | py | Python | sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/aks/azure-mgmt-devspaces/azure/mgmt/devspaces/models/_models.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 34.184307 | 150 | 0.656435 |
from azure.core.exceptions import HttpResponseError
import msrest.serialization
class ContainerHostMapping(msrest.serialization.Model):
_validation = {
'mapped_controller_resource_id': {'readonly': True},
}
_attribute_map = {
'container_host_resource_id': {'key': 'containerHostResourceI... | true | true |
f76235d2b3e2256ed465a850f87b4fa0ce9c1c8f | 194 | py | Python | ipix/admin.py | Evohmike/IPIX | 36b64da6c8d877018b2f5328661066bfd54c1a3e | [
"MIT"
] | 1 | 2018-10-03T07:59:13.000Z | 2018-10-03T07:59:13.000Z | ipix/admin.py | Evohmike/IPIX | 36b64da6c8d877018b2f5328661066bfd54c1a3e | [
"MIT"
] | 3 | 2020-06-05T19:09:59.000Z | 2021-09-08T00:29:11.000Z | ipix/admin.py | Evohmike/IPIX | 36b64da6c8d877018b2f5328661066bfd54c1a3e | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Category,Image,Location
# Register your models here.
admin.site.register(Category)
admin.site.register(Location)
admin.site.register(Image) | 24.25 | 43 | 0.819588 | from django.contrib import admin
from .models import Category,Image,Location
admin.site.register(Category)
admin.site.register(Location)
admin.site.register(Image) | true | true |
f76236915319f668960b5d87c4ce67f0b601b4d2 | 90,688 | py | Python | cluster-bootstrap/eks_cluster.py | GemeenteNijmegen/quickstart-eks-cdk-python | 32edcbf6aed317d413213bfe9ef86d70d5352a7c | [
"Apache-2.0"
] | null | null | null | cluster-bootstrap/eks_cluster.py | GemeenteNijmegen/quickstart-eks-cdk-python | 32edcbf6aed317d413213bfe9ef86d70d5352a7c | [
"Apache-2.0"
] | null | null | null | cluster-bootstrap/eks_cluster.py | GemeenteNijmegen/quickstart-eks-cdk-python | 32edcbf6aed317d413213bfe9ef86d70d5352a7c | [
"Apache-2.0"
] | null | null | null | """
Purpose
Example of how to provision an EKS cluster, create the IAM Roles for Service Accounts (IRSA) mappings,
and then deploy various common cluster add-ons (AWS Load Balancer Controller, ExternalDNS, EBS & EFS CSI Drivers,
Cluster Autoscaler, AWS Managed OpenSearch and fluentbit, Metrics Server, Calico Network P... | 46.31665 | 351 | 0.483813 |
from aws_cdk import (
aws_ec2 as ec2,
aws_eks as eks,
aws_iam as iam,
aws_opensearchservice as opensearch,
aws_logs as logs,
aws_certificatemanager as cm,
aws_efs as efs,
core
)
import os
import yaml
from ekslogs_custom_resource import EKSLogsObjectResource
from amp_custom_resource imp... | true | true |
f7623930a246f55c65ad9324884f6b86e900ac14 | 4,942 | py | Python | Supermicro/benchmarks/unet3d/implementations/mxnet_j2/runtime/distributed.py | jqueguiner/training_results_v1.0 | 8200377f425ae24b6ed6c2816b9273aab0996d43 | [
"Apache-2.0"
] | 27 | 2021-07-01T00:34:52.000Z | 2022-03-29T08:49:53.000Z | Supermicro/benchmarks/unet3d/implementations/mxnet_j2/runtime/distributed.py | jqueguiner/training_results_v1.0 | 8200377f425ae24b6ed6c2816b9273aab0996d43 | [
"Apache-2.0"
] | 21 | 2021-08-31T08:34:50.000Z | 2022-03-17T11:42:10.000Z | Supermicro/benchmarks/unet3d/implementations/mxnet_j2/runtime/distributed.py | jqueguiner/training_results_v1.0 | 8200377f425ae24b6ed6c2816b9273aab0996d43 | [
"Apache-2.0"
] | 39 | 2021-07-02T00:46:14.000Z | 2022-03-13T16:59:55.000Z | import os
from time import time
import numpy as np
from mpi4py import MPI
from mxnet import nd
def distribute_mpiranks(local_rank, local_size, size, nodes_for_eval, gpu_per_node):
# assign top "nodes_for_eval" nodes for evaluation. Rest of the nodes go to training
total_ranks = list(range(size))
train_ran... | 38.015385 | 108 | 0.643869 | import os
from time import time
import numpy as np
from mpi4py import MPI
from mxnet import nd
def distribute_mpiranks(local_rank, local_size, size, nodes_for_eval, gpu_per_node):
total_ranks = list(range(size))
train_ranks = total_ranks[:size - nodes_for_eval * gpu_per_node]
eval_ranks = train_ranks
... | true | true |
f762398a5ba75a46926799a61eb547148e7d9dee | 33,307 | py | Python | electrum/plugins/revealer/qt.py | yo5eff/electrum-ecc | 1ab9a3a25fbd9f3d4c4566ba07ba006410cf208c | [
"MIT"
] | 79 | 2017-11-10T03:00:57.000Z | 2022-02-27T16:35:04.000Z | electrum/plugins/revealer/qt.py | fabrizioschiavi/electrum | a0f2dadf11fa1636e46a8c233b4d5651032080e4 | [
"MIT"
] | 70 | 2017-12-25T05:28:26.000Z | 2022-03-26T22:31:47.000Z | electrum/plugins/revealer/qt.py | fabrizioschiavi/electrum | a0f2dadf11fa1636e46a8c233b4d5651032080e4 | [
"MIT"
] | 64 | 2017-12-19T09:09:23.000Z | 2022-02-08T10:26:13.000Z | '''
Revealer
Do you have something to hide?
Secret backup plug-in for the electrum wallet.
Tiago Romagnani Silveira, 2017
'''
import os
import random
import traceback
from decimal import Decimal
from functools import partial
import sys
import qrcode
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtCore impo... | 43.709974 | 159 | 0.584682 |
import os
import random
import traceback
from decimal import Decimal
from functools import partial
import sys
import qrcode
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtCore import Qt, QRectF, QRect, QSizeF, QUrl, QPoint, QSize
from PyQt5.QtGui import (QPixmap, QImage, QBitmap, QPainter, QFontDatabase, QPen... | true | true |
f7623993d4e2d4e51f004875178c55163a0f14f6 | 5,919 | py | Python | app/rooms/views.py | ShinJam/airbnb-clone | 5f79c6ff38d268e41e1b99ba1b1ccca65da746a3 | [
"MIT"
] | null | null | null | app/rooms/views.py | ShinJam/airbnb-clone | 5f79c6ff38d268e41e1b99ba1b1ccca65da746a3 | [
"MIT"
] | 10 | 2020-03-03T16:15:51.000Z | 2022-02-10T09:25:15.000Z | app/rooms/views.py | ShinJam/airbnb-clone | 5f79c6ff38d268e41e1b99ba1b1ccca65da746a3 | [
"MIT"
] | null | null | null | from django.http import Http404
from django.core.paginator import Paginator
from django.views.generic import ListView, DetailView, View, UpdateView, FormView
from django.shortcuts import render, redirect, reverse
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.c... | 29.893939 | 91 | 0.597567 | from django.http import Http404
from django.core.paginator import Paginator
from django.views.generic import ListView, DetailView, View, UpdateView, FormView
from django.shortcuts import render, redirect, reverse
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.c... | true | true |
f7623ab3f05c705be490854ed82314a225ba0568 | 2,231 | py | Python | src/python/nimbusml/internal/core/preprocessing/schema/columndropper.py | cclauss/NimbusML | b0c1e3aca30c4b6b58e3eefdb1c511a9a1cdef85 | [
"MIT"
] | 2 | 2019-03-01T01:22:54.000Z | 2019-07-10T19:57:38.000Z | src/python/nimbusml/internal/core/preprocessing/schema/columndropper.py | cclauss/NimbusML | b0c1e3aca30c4b6b58e3eefdb1c511a9a1cdef85 | [
"MIT"
] | null | null | null | src/python/nimbusml/internal/core/preprocessing/schema/columndropper.py | cclauss/NimbusML | b0c1e3aca30c4b6b58e3eefdb1c511a9a1cdef85 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
# - Generated manually! Required for... | 29.355263 | 94 | 0.580457 |
__all__ = ["ColumnDropper"]
from ....entrypoints.transforms_columnselector import transforms_columnselector
from ....utils.utils import trace
from ...base_pipeline_item import BasePipelineItem, NoOutputSignature
class ColumnDropper(BasePipelineItem, NoOutputSignature):
@trace
def __init__(
sel... | true | true |
f7623b184b9227c6e8dd7ac1f2819b9422d79682 | 400 | py | Python | pyprac/table.py | passingbreeze/LearnAlgorithm | fa1f0706a6b66f2ee4f0e7c9aef5fd3b2507f01b | [
"MIT"
] | null | null | null | pyprac/table.py | passingbreeze/LearnAlgorithm | fa1f0706a6b66f2ee4f0e7c9aef5fd3b2507f01b | [
"MIT"
] | null | null | null | pyprac/table.py | passingbreeze/LearnAlgorithm | fa1f0706a6b66f2ee4f0e7c9aef5fd3b2507f01b | [
"MIT"
] | null | null | null | #-*-coding:utf-8-*-
def table(n):
if n>0:
print("| | | | | | |")
print("| | | | | | |")
print("+-----+-----+-----+-----+-----+-----+")
table(n-1)
n = eval(input())
print("+-----+-----+-----+-----+-----+-----+")
print("| | MON | TU... | 26.666667 | 54 | 0.2275 |
def table(n):
if n>0:
print("| | | | | | |")
print("| | | | | | |")
print("+-----+-----+-----+-----+-----+-----+")
table(n-1)
n = eval(input())
print("+-----+-----+-----+-----+-----+-----+")
print("| | MON | TUE | WED | THU | FRI ... | true | true |
f7623b3a5210e764f0595df236a148f4750a0b43 | 539 | py | Python | furcate/__init__.py | mattstruble/furcate | 2acec812f10a6d543fed661a9b1c493e67214c70 | [
"MIT"
] | null | null | null | furcate/__init__.py | mattstruble/furcate | 2acec812f10a6d543fed661a9b1c493e67214c70 | [
"MIT"
] | null | null | null | furcate/__init__.py | mattstruble/furcate | 2acec812f10a6d543fed661a9b1c493e67214c70 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Matt Struble. All Rights Reserved.
#
# Use is subject to license terms.
#
# Author: Matt Struble
# Date: Nov. 18 2020
from importlib import import_module
from .fork import Fork # noqa. F401
from .util import get_gpu_stats # noqa. F401
# Import different versions of furcate with specific framewo... | 24.5 | 87 | 0.705009 | from importlib import import_module
from .fork import Fork from .util import get_gpu_stats
modules = ["furcate.furcate_tf.fork"]
for module in modules:
try:
lib = import_module(module)
except ImportError:
pass
else:
globals()["Fork"] = lib.Fork
| true | true |
f7623b77596aa27e93e942700b179f073b53e36e | 317 | py | Python | crm/exceptions.py | lordoftheflies/Django-CRM | 6e6b4b95811df00efdcdbc6040105d6b38b740b9 | [
"MIT"
] | 1 | 2020-03-06T09:51:29.000Z | 2020-03-06T09:51:29.000Z | crm/exceptions.py | lordoftheflies/Krynegger-CRM | 6e6b4b95811df00efdcdbc6040105d6b38b740b9 | [
"MIT"
] | null | null | null | crm/exceptions.py | lordoftheflies/Krynegger-CRM | 6e6b4b95811df00efdcdbc6040105d6b38b740b9 | [
"MIT"
] | null | null | null | from django.core.checks import Error
class DatabaseConnectionError(Error):
def __init__(self, inner_exception: BaseException, obj):
super().__init__(
id='crm.E001',
msg=str(inner_exception),
hint='Please check database configuration.',
obj=obj
)
| 24.384615 | 60 | 0.615142 | from django.core.checks import Error
class DatabaseConnectionError(Error):
def __init__(self, inner_exception: BaseException, obj):
super().__init__(
id='crm.E001',
msg=str(inner_exception),
hint='Please check database configuration.',
obj=obj
)
| true | true |
f7623bc47f87c9765b062a73afc0172c76a26b52 | 7,891 | py | Python | tests/python/pants_test/cache/test_caching_tarball_deference.py | lahosken/pants | 1b0340987c9b2eab9411416803c75b80736716e4 | [
"Apache-2.0"
] | 1 | 2021-11-11T14:04:24.000Z | 2021-11-11T14:04:24.000Z | tests/python/pants_test/cache/test_caching_tarball_deference.py | lahosken/pants | 1b0340987c9b2eab9411416803c75b80736716e4 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/cache/test_caching_tarball_deference.py | lahosken/pants | 1b0340987c9b2eab9411416803c75b80736716e4 | [
"Apache-2.0"
] | 1 | 2021-11-11T14:04:12.000Z | 2021-11-11T14:04:12.000Z | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | 39.853535 | 116 | 0.709796 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants.base.payload import Payload
from pants.build_graph.target import Target
from pants.cache.cache_setup import CacheSetup
from pants.task.task impo... | true | true |
f7623d3e204bb27488f45480a181b88c2023ea6f | 517 | py | Python | RESOURCES/jobj.tst.py | ihgazni2/eobj | d5d73759c4b4be9244c08afcb82d470c7f3cf35d | [
"MIT"
] | null | null | null | RESOURCES/jobj.tst.py | ihgazni2/eobj | d5d73759c4b4be9244c08afcb82d470c7f3cf35d | [
"MIT"
] | null | null | null | RESOURCES/jobj.tst.py | ihgazni2/eobj | d5d73759c4b4be9244c08afcb82d470c7f3cf35d | [
"MIT"
] | null | null | null | d = {'arr': [1, 2, 3], 'x': {'y': 100, 'z': {'u': 200}}}
o = ele2jobj(d)
arr = [[100],[200,300]]
o = ele2jobj(arr)
del o.x.y
o
d
del o.arr1
>>> d = {'arr': [1, 2, 3], 'x': {'y': 100, 'z': {'u': 200}}}
>>> o = ele2jobj(d)
>>>
>>> del o.arr1
>>> o
{'arr': [1, 3], 'x': {'y': 100, 'z': {'u': 200}}}
>>>
>>> d
{'arr':... | 12.309524 | 60 | 0.346228 | d = {'arr': [1, 2, 3], 'x': {'y': 100, 'z': {'u': 200}}}
o = ele2jobj(d)
arr = [[100],[200,300]]
o = ele2jobj(arr)
del o.x.y
o
d
del o.arr1
>>> d = {'arr': [1, 2, 3], 'x': {'y': 100, 'z': {'u': 200}}}
>>> o = ele2jobj(d)
>>>
>>> del o.arr1
>>> o
{'arr': [1, 3], 'x': {'y': 100, 'z': {'u': 200}}}
>>>
>>> d
{'arr':... | false | true |
f7623d576d9a094a51312cee2d4a1a665b38569c | 7,062 | py | Python | games/models.py | midouest/vampire-diary | 4d77b79147ec0cbe6ff063ad8aa1a6b776fce5e5 | [
"MIT"
] | null | null | null | games/models.py | midouest/vampire-diary | 4d77b79147ec0cbe6ff063ad8aa1a6b776fce5e5 | [
"MIT"
] | null | null | null | games/models.py | midouest/vampire-diary | 4d77b79147ec0cbe6ff063ad8aa1a6b776fce5e5 | [
"MIT"
] | null | null | null | from django.db import models
from config import settings
class TimestampMixin(models.Model):
"""
A TimestampMixin is used to add fields for automatically recording the
timestamp of create and update operations on a model.
"""
created_at = models.DateTimeField(auto_now_add=True)
updated_at = ... | 24.778947 | 80 | 0.637496 | from django.db import models
from config import settings
class TimestampMixin(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
ordering = ["created_at"]
class PromptGroup(TimestampMixin):
... | true | true |
f7623f64d1f61d172c6d5f7e1daa2dffd2345501 | 342 | py | Python | sql_app/models.py | gclen/fastapi-example | bae5ff6ab7fff727ac407d02e81cb3221ee93f5a | [
"MIT"
] | null | null | null | sql_app/models.py | gclen/fastapi-example | bae5ff6ab7fff727ac407d02e81cb3221ee93f5a | [
"MIT"
] | null | null | null | sql_app/models.py | gclen/fastapi-example | bae5ff6ab7fff727ac407d02e81cb3221ee93f5a | [
"MIT"
] | null | null | null | from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import RelationshipProperty
from .database import Base
class Team(Base):
__tablename__ = "teams"
id = Column(Integer, primary_key=True, index=True)
team = Column(String(64), index=True, unique=True)
wins = Column(... | 26.307692 | 67 | 0.74269 | from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import RelationshipProperty
from .database import Base
class Team(Base):
__tablename__ = "teams"
id = Column(Integer, primary_key=True, index=True)
team = Column(String(64), index=True, unique=True)
wins = Column(... | true | true |
f76240ca590808d3cd5c1b3f7625c05001a255cb | 4,160 | py | Python | pyqt_timer_label/timerLabel.py | yjg30737/pyqt-timer-label | 33c72e010f2af8833d4a22d85738d0947075c913 | [
"MIT"
] | null | null | null | pyqt_timer_label/timerLabel.py | yjg30737/pyqt-timer-label | 33c72e010f2af8833d4a22d85738d0947075c913 | [
"MIT"
] | null | null | null | pyqt_timer_label/timerLabel.py | yjg30737/pyqt-timer-label | 33c72e010f2af8833d4a22d85738d0947075c913 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtCore import pyqtSignal, QTime, QTimer
from pyqt_responsive_label.responsiveLabel import ResponsiveLabel
class TimerLabel(ResponsiveLabel):
doubleClicked = pyqtSignal()
prepared = pyqtSignal()
started = pyqtSignal()
paused = pyqtSignal()
restarted = pyqtSignal()
resetS... | 27.549669 | 87 | 0.618269 | import sys
from PyQt5.QtCore import pyqtSignal, QTime, QTimer
from pyqt_responsive_label.responsiveLabel import ResponsiveLabel
class TimerLabel(ResponsiveLabel):
doubleClicked = pyqtSignal()
prepared = pyqtSignal()
started = pyqtSignal()
paused = pyqtSignal()
restarted = pyqtSignal()
resetS... | true | true |
f7624134c9f106da5743d620fa0e77824fb31898 | 8,452 | py | Python | server/routers/internal/recommended_routes.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | 1 | 2022-03-10T12:46:11.000Z | 2022-03-10T12:46:11.000Z | server/routers/internal/recommended_routes.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | 2 | 2022-02-26T12:17:38.000Z | 2022-02-26T14:11:39.000Z | server/routers/internal/recommended_routes.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | null | null | null | from concurrent.futures import ThreadPoolExecutor, wait
import datetime
from traceback import format_exc
from typing import List
import haversine as hs
import json
import pytz
from .cycle_routes import CycleRoutesService
from .santander_cycles import SantanderCycles
from .tier_scooters import TierScooterService
from .... | 48.855491 | 134 | 0.649905 | from concurrent.futures import ThreadPoolExecutor, wait
import datetime
from traceback import format_exc
from typing import List
import haversine as hs
import json
import pytz
from .cycle_routes import CycleRoutesService
from .santander_cycles import SantanderCycles
from .tier_scooters import TierScooterService
from .... | true | true |
f762413fbb14de1ae88e409d5a9140e1eb9ac9a8 | 1,443 | py | Python | Python/Data Structure/Queue/Circular Queue.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | Python/Data Structure/Queue/Circular Queue.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | Python/Data Structure/Queue/Circular Queue.py | DeWill404/Data-Structure-and-Algorithm | c61d245c920edff747e87dc7c2ea139561766a3a | [
"MIT"
] | null | null | null | class Queue():
# Queue Initialization
def __init__(self):
self.MAX = 5
self.queue = []
# OVERFLOW CONDITION
def OVERFLOW(self):
if len(self.queue) == self.MAX:
return True
else:
return False
# UNDERFLOW CONDITION
def UNDERFLOW(self):
if len(self.queue) == 0:
return True
else:
return Fals... | 17.814815 | 50 | 0.615385 | class Queue():
def __init__(self):
self.MAX = 5
self.queue = []
def OVERFLOW(self):
if len(self.queue) == self.MAX:
return True
else:
return False
def UNDERFLOW(self):
if len(self.queue) == 0:
return True
else:
return False
def insert(self, item):
if not self.OVERFLOW():
self.qu... | true | true |
f76241b5af5c86da3836ada7aabbcfc019f42afe | 2,747 | py | Python | 06_Transformacoes_do_Conjunto_de_Dados/6.1_Pipelines_e_Estimadores_Compostos/6.1.2_Transformando_Alvo_em_Regressao.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | 06_Transformacoes_do_Conjunto_de_Dados/6.1_Pipelines_e_Estimadores_Compostos/6.1.2_Transformando_Alvo_em_Regressao.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | 06_Transformacoes_do_Conjunto_de_Dados/6.1_Pipelines_e_Estimadores_Compostos/6.1.2_Transformando_Alvo_em_Regressao.py | BrunoBertti/Scikit_Learning | 4b9e10ff7909f3728ac1e8bba19f5fd779340bc4 | [
"MIT"
] | null | null | null | ########## 6.1.2. Transformando alvo em regressão ##########
# TransformedTargetRegressor transforma os destinos y antes de ajustar um modelo de regressão. As previsões são mapeadas de volta ao espaço original por meio de uma transformação inversa. Toma como argumento o regressor que será usado para previsão e o ... | 45.032787 | 306 | 0.722971 |
import numpy as np
from sklearn.datasets import fetch_california_housing
from sklearn.compose import TransformedTargetRegressor
from sklearn.preprocessing import QuantileTransformer
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
X, y = fetch_california_hous... | true | true |
f76242ef7d6889bc6e682f1a826d2bd1a25b1085 | 2,013 | py | Python | src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/event_subscription_destination_py3.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2022-03-22T15:02:32.000Z | 2022-03-22T15:02:32.000Z | src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/event_subscription_destination_py3.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-02-10T22:04:59.000Z | 2021-02-10T22:04:59.000Z | src/eventgrid/azext_eventgrid/vendored_sdks/eventgrid/models/event_subscription_destination_py3.py | michimune/azure-cli-extensions | 697e2c674e5c0825d44c72d714542fe01331e107 | [
"MIT"
] | 1 | 2021-06-03T19:31:10.000Z | 2021-06-03T19:31:10.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 ... | 41.9375 | 449 | 0.707899 |
from msrest.serialization import Model
class EventSubscriptionDestination(Model):
_validation = {
'endpoint_type': {'required': True},
}
_attribute_map = {
'endpoint_type': {'key': 'endpointType', 'type': 'str'},
}
_subtype_map = {
'endpoint_type': {'WebHook': 'WebHookE... | true | true |
f76243bc365e9dab5b5ff286977bf5b4fb0c54ba | 7,327 | py | Python | samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py | data-experts/openapi-generator | b86a51ae17e25feae0e0c9f9e6f423b8ff54057d | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py | data-experts/openapi-generator | b86a51ae17e25feae0e0c9f9e6f423b8ff54057d | [
"Apache-2.0"
] | 5 | 2021-05-11T22:59:16.000Z | 2022-02-27T10:31:06.000Z | samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py | data-experts/openapi-generator | b86a51ae17e25feae0e0c9f9e6f423b8ff54057d | [
"Apache-2.0"
] | 1 | 2020-08-28T20:37:35.000Z | 2020-08-28T20:37:35.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 39.605405 | 174 | 0.596697 |
from __future__ import absolute_import
import re import sys
import six import nulltype
from petstore_api.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
... | true | true |
f762475c40620ffff477bdfc6ace1b886ef7504e | 870 | py | Python | connect_four/evaluation/victor/evaluator/evaluator_profile.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/victor/evaluator/evaluator_profile.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | connect_four/evaluation/victor/evaluator/evaluator_profile.py | rpachauri/connect4 | 6caf6965afaaff6883193ac295c6ac5b1f4e9c4a | [
"MIT"
] | null | null | null | import gym
import numpy as np
import cProfile
from connect_four.evaluation.board import Board
from connect_four.envs.connect_four_env import ConnectFourEnv
env = gym.make('connect_four-v0')
ConnectFourEnv.M = 6
ConnectFourEnv.N = 7
# The empty 6x7 board has no solution set for Black because White is guaranteed to w... | 24.857143 | 87 | 0.5 | import gym
import numpy as np
import cProfile
from connect_four.evaluation.board import Board
from connect_four.envs.connect_four_env import ConnectFourEnv
env = gym.make('connect_four-v0')
ConnectFourEnv.M = 6
ConnectFourEnv.N = 7
env.state = np.array([
[
[0, 0, 0, 0, 0, 0, 0, ],
[0, 0, 0, 0, 0... | true | true |
f76247654ce12582ae440302072ba652c1ea89a4 | 87 | py | Python | pokus1/apps.py | zvolsky/example_translation | 37a8e71df6bdc12dda96b9e84b5c1bb7a16087dc | [
"MIT"
] | null | null | null | pokus1/apps.py | zvolsky/example_translation | 37a8e71df6bdc12dda96b9e84b5c1bb7a16087dc | [
"MIT"
] | null | null | null | pokus1/apps.py | zvolsky/example_translation | 37a8e71df6bdc12dda96b9e84b5c1bb7a16087dc | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class Pokus1Config(AppConfig):
name = 'pokus1'
| 14.5 | 33 | 0.747126 | from django.apps import AppConfig
class Pokus1Config(AppConfig):
name = 'pokus1'
| true | true |
f76248a5bc821c1d0a9f181753ac9a59e6731330 | 1,580 | py | Python | example/tts/TACOTRON/config.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 18 | 2017-12-19T07:55:17.000Z | 2020-03-12T11:07:45.000Z | example/tts/TACOTRON/config.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 1 | 2019-04-18T10:31:41.000Z | 2019-05-23T06:47:24.000Z | example/tts/TACOTRON/config.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 5 | 2018-06-06T00:51:48.000Z | 2020-03-12T11:07:46.000Z | from text.symbols import symbols
raw_path = './LJSpeech/'
data_path = './data/'
melpath = './data/mel/'
quantpath = './data/quant/'
voc_mode = 'MOL'
extension = '.wav'
ignore_tts = False
norm_peaks = True
mu_law = True
sample_rate = 22050
n_fft = 2048
hop_length = 275
win_length = 1100
min_level_db = -100
ref_le... | 30.384615 | 118 | 0.679747 | from text.symbols import symbols
raw_path = './LJSpeech/'
data_path = './data/'
melpath = './data/mel/'
quantpath = './data/quant/'
voc_mode = 'MOL'
extension = '.wav'
ignore_tts = False
norm_peaks = True
mu_law = True
sample_rate = 22050
n_fft = 2048
hop_length = 275
win_length = 1100
min_level_db = -100
ref_le... | true | true |
f76248cbd65b22b3ea88d9fdf4d4124e75f14539 | 15,456 | py | Python | QATrainingFrontend/utils.py | molecul/qa-training-frontend | df7ccc3781da300045190ca4a37b480e57be1b42 | [
"Apache-2.0"
] | null | null | null | QATrainingFrontend/utils.py | molecul/qa-training-frontend | df7ccc3781da300045190ca4a37b480e57be1b42 | [
"Apache-2.0"
] | null | null | null | QATrainingFrontend/utils.py | molecul/qa-training-frontend | df7ccc3781da300045190ca4a37b480e57be1b42 | [
"Apache-2.0"
] | null | null | null | from QATrainingFrontend.models import db, WrongKeys, Pages, Config, Tracking, Users, Containers
from six.moves.urllib.parse import urlparse, urljoin
from werkzeug.utils import secure_filename
from functools import wraps
from flask import current_app as app, g, request, redirect, url_for, session, render_template, abor... | 28.464088 | 127 | 0.622153 | from QATrainingFrontend.models import db, WrongKeys, Pages, Config, Tracking, Users, Containers
from six.moves.urllib.parse import urlparse, urljoin
from werkzeug.utils import secure_filename
from functools import wraps
from flask import current_app as app, g, request, redirect, url_for, session, render_template, abor... | false | true |
f76249a980af01b9ac13efa1db36d59d4f0c4f03 | 2,853 | py | Python | scripts/test/TestAgent.py | scoumeri/geopm | 2406b8cca92d8eb32d4dc26d24bb2273164f186c | [
"BSD-3-Clause"
] | null | null | null | scripts/test/TestAgent.py | scoumeri/geopm | 2406b8cca92d8eb32d4dc26d24bb2273164f186c | [
"BSD-3-Clause"
] | null | null | null | scripts/test/TestAgent.py | scoumeri/geopm | 2406b8cca92d8eb32d4dc26d24bb2273164f186c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2015 - 2022, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, th... | 39.625 | 74 | 0.69646 |
from __future__ import absolute_import
import unittest
import json
import geopmpy.agent
class TestAgent(unittest.TestCase):
def test_policy_names(self):
for agent in geopmpy.agent.names():
policy = geopmpy.agent.policy_names(agent)
self.assertTrue(type(policy) is list)
def t... | true | true |
f76249b3d442bf0c5c9ae2431337ca72d7d5fd13 | 14,174 | py | Python | pychron/processing/analyses/view/dvc_commit_view.py | aelamspychron/pychron | ad87c22b0817c739c7823a24585053041ee339d5 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/processing/analyses/view/dvc_commit_view.py | aelamspychron/pychron | ad87c22b0817c739c7823a24585053041ee339d5 | [
"Apache-2.0"
] | 20 | 2020-09-09T20:58:39.000Z | 2021-10-05T17:48:37.000Z | pychron/processing/analyses/view/dvc_commit_view.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 36.625323 | 120 | 0.532807 |
import os
from git import Repo
from pyface.message_dialog import information
from traits.api import HasTraits, Str, Int, Bool, List, Event, Either, Float, on_trait_change
from traitsui.api import View, UItem, VGroup, TabularEditor, HGroup, Item, TextEditor, VSplit
from traitsui.tabular_adapter import TabularAdapter
... | true | true |
f76249d9b84527a2166a172b459553f5c50eacdf | 2,654 | py | Python | merge_learned_and_skeletonize.py | DominikSauter/skelnet | 77d32541fc8361b52a8e45d2f919a755b2f706b3 | [
"MIT"
] | null | null | null | merge_learned_and_skeletonize.py | DominikSauter/skelnet | 77d32541fc8361b52a8e45d2f919a755b2f706b3 | [
"MIT"
] | 2 | 2021-06-08T21:15:05.000Z | 2021-09-08T01:52:53.000Z | merge_learned_and_skeletonize.py | DominikSauter/skelnet | 77d32541fc8361b52a8e45d2f919a755b2f706b3 | [
"MIT"
] | null | null | null | from PIL import Image
import os
import shutil
import numpy as np
def main():
in_learned_skeletons_path = "dataset/point/skelnet_black_skel_test_black_epoch252"
in_learned_black_skeletons_test_normal_path = "dataset/point/skelnet_black_skel_test_normal_epoch252"
in_skeletonize_path = "dataset/point/skeleto... | 47.392857 | 393 | 0.680859 | from PIL import Image
import os
import shutil
import numpy as np
def main():
in_learned_skeletons_path = "dataset/point/skelnet_black_skel_test_black_epoch252"
in_learned_black_skeletons_test_normal_path = "dataset/point/skelnet_black_skel_test_normal_epoch252"
in_skeletonize_path = "dataset/point/skeleto... | true | true |
f7624a1930bfc80965fe473b68e2cf9df4b9e699 | 5,751 | py | Python | test/mouse_test.py | sagarjadhav1456/pygame | 7d3900d5b04dc8102f218cc60f3fbf5e06dd8fa1 | [
"Python-2.0",
"OLDAP-2.3"
] | 2 | 2021-04-03T20:01:35.000Z | 2021-09-09T23:42:21.000Z | test/mouse_test.py | sagarjadhav1456/pygame | 7d3900d5b04dc8102f218cc60f3fbf5e06dd8fa1 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | test/mouse_test.py | sagarjadhav1456/pygame | 7d3900d5b04dc8102f218cc60f3fbf5e06dd8fa1 | [
"Python-2.0",
"OLDAP-2.3"
] | 1 | 2020-10-31T11:32:34.000Z | 2020-10-31T11:32:34.000Z | import unittest
import os
import platform
import pygame
SDL1 = pygame.get_sdl_version()[0] < 2
DARWIN = "Darwin" in platform.platform()
class MouseTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
# The display needs to be initialized for mouse functions.
pygame.display.init()
... | 32.308989 | 84 | 0.590506 | import unittest
import os
import platform
import pygame
SDL1 = pygame.get_sdl_version()[0] < 2
DARWIN = "Darwin" in platform.platform()
class MouseTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
pygame.display.init()
@classmethod
def tearDownClass(cls):
pygame.dis... | true | true |
f7624cbe0bb500074fb081ea8d27a921f24984b5 | 756 | py | Python | chapter01/meilisearch_study.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter01/meilisearch_study.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter01/meilisearch_study.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | # pip install meilisearch
from meilisearch import Client
# Connect to database
client = Client("http://127.0.0.1:7700", "password")
# Create index
client.create_index("index_name")
# Insert information
client.index("index_name").add_documents(
[
{
"id": 1,
"sku": 134218478,
... | 26.068966 | 170 | 0.652116 | from meilisearch import Client
client = Client("http://127.0.0.1:7700", "password")
client.create_index("index_name")
client.index("index_name").add_documents(
[
{
"id": 1,
"sku": 134218478,
"name": "Rb-01 - Robô Aspirador De Pó Fast Clean Bivolt - Mondial",
... | true | true |
f7624cd6de91078b0eb69b69ff8d77033e453b80 | 909 | py | Python | submissions/constants.py | kinaklub/next.filmfest.by | b537c0d2dac4195e9e7b460c569007d20a5954e7 | [
"Unlicense"
] | 7 | 2016-07-18T07:37:37.000Z | 2022-03-23T08:12:04.000Z | submissions/constants.py | kinaklub/next.filmfest.by | b537c0d2dac4195e9e7b460c569007d20a5954e7 | [
"Unlicense"
] | 119 | 2015-11-08T07:16:44.000Z | 2022-03-11T23:25:53.000Z | submissions/constants.py | kinaklub/next.filmfest.by | b537c0d2dac4195e9e7b460c569007d20a5954e7 | [
"Unlicense"
] | 3 | 2016-07-21T17:22:31.000Z | 2016-10-04T08:38:48.000Z | from django.utils.translation import ugettext_lazy as _
import pycountry
__all__ = ['YESNO', 'YESNOMAYBE', 'SECTIONS', 'BACKLINKS', 'LANGUAGES']
YESNO = (
(1, _('Yes')),
(2, _('No')),
)
YESNOMAYBE = (
(0, _('Maybe')),
(1, _('Yes')),
(2, _('No')),
)
SECTIONS = (
(1, _('Fiction')),
(2, ... | 17.823529 | 71 | 0.50055 | from django.utils.translation import ugettext_lazy as _
import pycountry
__all__ = ['YESNO', 'YESNOMAYBE', 'SECTIONS', 'BACKLINKS', 'LANGUAGES']
YESNO = (
(1, _('Yes')),
(2, _('No')),
)
YESNOMAYBE = (
(0, _('Maybe')),
(1, _('Yes')),
(2, _('No')),
)
SECTIONS = (
(1, _('Fiction')),
(2, ... | true | true |
f7624d0fc0611603817897998b15d08bf110b1ec | 3,015 | py | Python | MLLib/NeuralNet/net.py | Tim15/MLib | 2222dc67ec0cbaf07942371120be1690359e0ab3 | [
"MIT"
] | null | null | null | MLLib/NeuralNet/net.py | Tim15/MLib | 2222dc67ec0cbaf07942371120be1690359e0ab3 | [
"MIT"
] | null | null | null | MLLib/NeuralNet/net.py | Tim15/MLib | 2222dc67ec0cbaf07942371120be1690359e0ab3 | [
"MIT"
] | null | null | null | # import curses
# import datetime
#
# stdscr = curses.initscr()
# curses.noecho()
# stdscr.nodelay(1) # set getch() non-blocking
#
# stdscr.addstr(0,0,"Press \"p\" to show count, \"q\" to exit...")
# line = 1
# try:
# while 1:
# c = stdscr.getch()
# if c == ord('p'):
# stdsc... | 41.30137 | 384 | 0.562852 | # Do more things
# """
import numpy as np
def nonlin(x, deriv=False):
if deriv:
return (x*(1-x))
return 1/(1+np.exp(-x))
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])
np.random.seed(1)
nums = [2, 4, 1]
network = [2*np.random.random((nums[i]+1,nums[i+1... | true | true |
f7624dbe5a69432ba26652d5057f2103985e3672 | 1,652 | py | Python | samples/generated_samples/dialogflow_generated_dialogflowcx_v3_experiments_create_experiment_async.py | nicain/python-dialogflow-cx | 2292ff540aea24c3c831a5ffe1604c2c022ccb82 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/dialogflow_generated_dialogflowcx_v3_experiments_create_experiment_async.py | nicain/python-dialogflow-cx | 2292ff540aea24c3c831a5ffe1604c2c022ccb82 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/dialogflow_generated_dialogflowcx_v3_experiments_create_experiment_async.py | nicain/python-dialogflow-cx | 2292ff540aea24c3c831a5ffe1604c2c022ccb82 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.04 | 85 | 0.767554 |
from google.cloud import dialogflowcx_v3
async def sample_create_experiment():
client = dialogflowcx_v3.ExperimentsAsyncClient()
experiment = dialogflowcx_v3.Experiment()
experiment.display_name = "display_name_value"
request = dialogflowcx_v3.CreateExperimentRequest(
parent="pare... | true | true |
f7624e269bfc4c42cdfb4acc1fa701fd10897bac | 2,201 | py | Python | test/integration/ggrc/models/factories.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | null | null | null | test/integration/ggrc/models/factories.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 12 | 2015-01-08T14:50:19.000Z | 2017-11-29T19:37:53.000Z | test/integration/ggrc/models/factories.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 1 | 2015-01-08T13:25:09.000Z | 2015-01-08T13:25:09.000Z | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: vraj@reciprocitylabs.com
import factory
import random
from ggrc import db
from ggrc import models
def ra... | 19.651786 | 78 | 0.731486 |
import factory
import random
from ggrc import db
from ggrc import models
def random_string(prefix=''):
return '{prefix}{suffix}'.format(
prefix=prefix,
suffix=random.randint(0, 9999999999),
)
class ModelFactory(factory.Factory):
@classmethod
def _create(cls, target_class, *args, **kwargs):
... | true | true |
f7625030c829e344936b999bb8dd74c800f87be8 | 2,338 | py | Python | tests/test_collections.py | ChowNow/elixir | 3f154ee21115254923c6661f35240b0a8f86e6bf | [
"MIT"
] | null | null | null | tests/test_collections.py | ChowNow/elixir | 3f154ee21115254923c6661f35240b0a8f86e6bf | [
"MIT"
] | null | null | null | tests/test_collections.py | ChowNow/elixir | 3f154ee21115254923c6661f35240b0a8f86e6bf | [
"MIT"
] | null | null | null | """
Test collections
"""
from __future__ import absolute_import
from builtins import object
from sqlalchemy import Table
from elixir import *
import elixir
def setup():
metadata.bind = 'sqlite://'
def teardown():
cleanup_all()
class TestCollections(object):
def teardown(self):
cleanup_all()
... | 24.610526 | 79 | 0.631309 | from __future__ import absolute_import
from builtins import object
from sqlalchemy import Table
from elixir import *
import elixir
def setup():
metadata.bind = 'sqlite://'
def teardown():
cleanup_all()
class TestCollections(object):
def teardown(self):
cleanup_all()
def test_no_collection(... | true | true |
f762505db6370d02ac06a3fe971e7a7a31ba22b0 | 5,541 | py | Python | src/config/utils/provision_control.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | 3 | 2019-01-11T06:16:40.000Z | 2021-02-24T23:48:21.000Z | src/config/utils/provision_control.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/config/utils/provision_control.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | 18 | 2017-01-12T09:28:44.000Z | 2019-04-18T20:47:42.000Z | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import argparse
import ConfigParser
from provision_bgp import BgpProvisioner
from vnc_api.vnc_api import *
class ControlProvisioner(object):
def __init__(self, args_str=None):
self._args = None
if n... | 39.297872 | 124 | 0.582386 | import sys
import argparse
import ConfigParser
from provision_bgp import BgpProvisioner
from vnc_api.vnc_api import *
class ControlProvisioner(object):
def __init__(self, args_str=None):
self._args = None
if not args_str:
args_str = ' '.join(sys.argv[1:])
self._parse_args(arg... | false | true |
f762519c03f558cbfde00ce42563a092ea6aacf2 | 245 | py | Python | head_first/chapter2/vowels3.py | adubois85/python_projects | e8794ed100e4fb2cbe89380c5d636ebdf954b33b | [
"Apache-2.0"
] | null | null | null | head_first/chapter2/vowels3.py | adubois85/python_projects | e8794ed100e4fb2cbe89380c5d636ebdf954b33b | [
"Apache-2.0"
] | null | null | null | head_first/chapter2/vowels3.py | adubois85/python_projects | e8794ed100e4fb2cbe89380c5d636ebdf954b33b | [
"Apache-2.0"
] | null | null | null | vowels = ['a', 'e', 'i', 'o', 'u']
found = []
word = input('Type your word here to search for the vowels: ')
for letter in word:
if letter in vowels and letter not in found:
found.append(letter)
for vowel in found:
print(vowel)
| 24.5 | 62 | 0.62449 | vowels = ['a', 'e', 'i', 'o', 'u']
found = []
word = input('Type your word here to search for the vowels: ')
for letter in word:
if letter in vowels and letter not in found:
found.append(letter)
for vowel in found:
print(vowel)
| true | true |
f762524fd8d6161f565f6232a417dbed61faa9aa | 8,397 | py | Python | galaxy_templates/licence_modules/fortios_registration_vdom.py | chillancezen/fortios-ansible-generator | 1ae04996f651414793503aadbc35d8420ef9e5b4 | [
"Apache-2.0"
] | null | null | null | galaxy_templates/licence_modules/fortios_registration_vdom.py | chillancezen/fortios-ansible-generator | 1ae04996f651414793503aadbc35d8420ef9e5b4 | [
"Apache-2.0"
] | null | null | null | galaxy_templates/licence_modules/fortios_registration_vdom.py | chillancezen/fortios-ansible-generator | 1ae04996f651414793503aadbc35d8420ef9e5b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | 29.055363 | 105 | 0.64916 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_registration_vdom
short_description: Add a VDOM li... | true | true |
f76252512ab50544309ce06ce0a3d27ee8325493 | 1,899 | py | Python | opencivicdata/elections/migrations/0006_auto_20171005_2029.py | tubaman/python-opencivicdata | 010cd72bdd806e76f342195a1f1e20acbed5a431 | [
"BSD-3-Clause"
] | null | null | null | opencivicdata/elections/migrations/0006_auto_20171005_2029.py | tubaman/python-opencivicdata | 010cd72bdd806e76f342195a1f1e20acbed5a431 | [
"BSD-3-Clause"
] | null | null | null | opencivicdata/elections/migrations/0006_auto_20171005_2029.py | tubaman/python-opencivicdata | 010cd72bdd806e76f342195a1f1e20acbed5a431 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-05 20:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('elections', '0005_auto_20170823_1648'),
]
operatio... | 51.324324 | 322 | 0.697736 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('elections', '0005_auto_20170823_1648'),
]
operations = [
migrations.AlterField(
model_name='candidacy',... | true | true |
f76252c9670aa1d8b28cc2dbfce44bb8940606c3 | 8,767 | py | Python | netmiko/huawei/huawei.py | Microbuse/netmiko | b4046cde9280da88e2f308c50f9862bee0f2e48b | [
"MIT"
] | 2 | 2021-09-29T13:50:01.000Z | 2021-11-15T16:07:39.000Z | netmiko/huawei/huawei.py | Microbuse/netmiko | b4046cde9280da88e2f308c50f9862bee0f2e48b | [
"MIT"
] | null | null | null | netmiko/huawei/huawei.py | Microbuse/netmiko | b4046cde9280da88e2f308c50f9862bee0f2e48b | [
"MIT"
] | null | null | null | from typing import Optional, Any
import time
import re
import warnings
from netmiko.no_enable import NoEnable
from netmiko.base_connection import DELAY_FACTOR_DEPR_SIMPLE_MSG
from netmiko.cisco_base_connection import CiscoBaseConnection
from netmiko.exceptions import NetmikoAuthenticationException
from netmiko import ... | 35.068 | 88 | 0.612296 | from typing import Optional, Any
import time
import re
import warnings
from netmiko.no_enable import NoEnable
from netmiko.base_connection import DELAY_FACTOR_DEPR_SIMPLE_MSG
from netmiko.cisco_base_connection import CiscoBaseConnection
from netmiko.exceptions import NetmikoAuthenticationException
from netmiko import ... | true | true |
f7625530d8d71b8a7aaf40461f2c8c8b40468cbc | 5,138 | py | Python | image_lite/filters_wand.py | rcrowther/django-image-lite | b9f21b8630907752fab4231f1d498e4cde4a4a3a | [
"BSD-3-Clause"
] | null | null | null | image_lite/filters_wand.py | rcrowther/django-image-lite | b9f21b8630907752fab4231f1d498e4cde4a4a3a | [
"BSD-3-Clause"
] | null | null | null | image_lite/filters_wand.py | rcrowther/django-image-lite | b9f21b8630907752fab4231f1d498e4cde4a4a3a | [
"BSD-3-Clause"
] | null | null | null | from wand.image import WandImage
from io import BytesIO
from image_lite.filters import (
Filter,
FormatMixin,
PhotoFXMixin,
ResizeCropMixin,
ResizeCropSmartMixin,
)
from image_lite import image_ops_wand
from image_lite.constants import FORMAT_APP_TO_UCLIB, FORMAT_UCLIB_TO_APP
from image_lite.decisio... | 28.544444 | 76 | 0.56306 | from wand.image import WandImage
from io import BytesIO
from image_lite.filters import (
Filter,
FormatMixin,
PhotoFXMixin,
ResizeCropMixin,
ResizeCropSmartMixin,
)
from image_lite import image_ops_wand
from image_lite.constants import FORMAT_APP_TO_UCLIB, FORMAT_UCLIB_TO_APP
from image_lite.decisio... | true | true |
f7625545c3cf7f270a34dc2b7318085988947033 | 30,038 | py | Python | subspace_openapi_client/api/sip_teleport_service_api.py | subspace-com/subspace_python_openapi_client | a86a3235de683d38b8f76dbf83deef9ade13f4a6 | [
"MIT"
] | 1 | 2021-11-21T07:27:52.000Z | 2021-11-21T07:27:52.000Z | subspace_openapi_client/api/sip_teleport_service_api.py | subspace-com/subspace_python_openapi_client | a86a3235de683d38b8f76dbf83deef9ade13f4a6 | [
"MIT"
] | null | null | null | subspace_openapi_client/api/sip_teleport_service_api.py | subspace-com/subspace_python_openapi_client | a86a3235de683d38b8f76dbf83deef9ade13f4a6 | [
"MIT"
] | null | null | null | """
Subspace Product API
# Introduction The Subspace API is based on REST, has resource-oriented URLs, returns JSON-encoded responses, and returns standard HTTP response codes. The base URL for the API is: `https://api.subspace.com/` # Naming Convention * Version name currently in use is: *v1* * Example... | 46.212308 | 6,372 | 0.533025 |
import re import sys
from subspace_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
from subspace_openapi_client.model_utils import ( check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from subspace_openapi_clien... | true | true |
f762558bdd2cd820189766d18e1a2fbf25177757 | 1,655 | py | Python | facelib/InsightFace/models/data/config.py | zakerifahimeh/FaceLib | bf8eadc26baf04907e3800ada02896ac7056080c | [
"MIT"
] | null | null | null | facelib/InsightFace/models/data/config.py | zakerifahimeh/FaceLib | bf8eadc26baf04907e3800ada02896ac7056080c | [
"MIT"
] | null | null | null | facelib/InsightFace/models/data/config.py | zakerifahimeh/FaceLib | bf8eadc26baf04907e3800ada02896ac7056080c | [
"MIT"
] | 1 | 2021-08-19T11:33:47.000Z | 2021-08-19T11:33:47.000Z | from easydict import EasyDict as edict
from pathlib import Path
import torch
from torch.nn import CrossEntropyLoss
def get_config(training=True):
conf = edict()
conf.data_path = Path('models/data')
conf.work_path = Path('weights/')
conf.model_path = conf.work_path / 'models'
conf.log_path = conf.w... | 36.777778 | 84 | 0.621752 | from easydict import EasyDict as edict
from pathlib import Path
import torch
from torch.nn import CrossEntropyLoss
def get_config(training=True):
conf = edict()
conf.data_path = Path('models/data')
conf.work_path = Path('weights/')
conf.model_path = conf.work_path / 'models'
conf.log_path = conf.w... | true | true |
f76255e684b0341c206585b030d42d9914154c62 | 11,506 | py | Python | Transfer Learning with MobileNetV2/MobileNetV2.py | FurkanCan-eee/Convolutional-Neural-Network | e7ee0d94075fa724d394b6a3c32e1b5abfe67285 | [
"MIT"
] | null | null | null | Transfer Learning with MobileNetV2/MobileNetV2.py | FurkanCan-eee/Convolutional-Neural-Network | e7ee0d94075fa724d394b6a3c32e1b5abfe67285 | [
"MIT"
] | null | null | null | Transfer Learning with MobileNetV2/MobileNetV2.py | FurkanCan-eee/Convolutional-Neural-Network | e7ee0d94075fa724d394b6a3c32e1b5abfe67285 | [
"MIT"
] | null | null | null | # Packages
import matplotlib.pyplot as plt
import numpy as np
import os
import tensorflow as tf
import tensorflow.keras.layers as tfl
from tensorflow.keras.preprocessing import image_dataset_from_directory
from tensorflow.keras.layers.experimental.preprocessing import RandomFlip, RandomRotation
# Creating the datase... | 34.866667 | 104 | 0.684339 |
import matplotlib.pyplot as plt
import numpy as np
import os
import tensorflow as tf
import tensorflow.keras.layers as tfl
from tensorflow.keras.preprocessing import image_dataset_from_directory
from tensorflow.keras.layers.experimental.preprocessing import RandomFlip, RandomRotation
BATCH_SIZE = 32
IMG_SIZE = (160... | true | true |
f762561306f4da33c3e55693d28118e93b02e1c9 | 3,539 | py | Python | bin/fix_requests/fix_request_6420.py | PRIMAVERA-H2020/pre-proc | 0c47636cbe32a13a9544f3e5ce9f4c778dc55078 | [
"BSD-3-Clause"
] | null | null | null | bin/fix_requests/fix_request_6420.py | PRIMAVERA-H2020/pre-proc | 0c47636cbe32a13a9544f3e5ce9f4c778dc55078 | [
"BSD-3-Clause"
] | null | null | null | bin/fix_requests/fix_request_6420.py | PRIMAVERA-H2020/pre-proc | 0c47636cbe32a13a9544f3e5ce9f4c778dc55078 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
fix_request_6420.py
MOHC.coupled.SImon.sistr[xy]ubot
SistrxubotStandardNameAdd and SistryubotStandardNameAdd
"""
import argparse
import logging.config
import sys
import django
django.setup()
from pre_proc_app.models import DataRequest, FileFix
__version__ = '0.1.0b1'
DEFAULT_LOG_LEVEL =... | 26.410448 | 80 | 0.584063 | import argparse
import logging.config
import sys
import django
django.setup()
from pre_proc_app.models import DataRequest, FileFix
__version__ = '0.1.0b1'
DEFAULT_LOG_LEVEL = logging.WARNING
DEFAULT_LOG_FORMAT = '%(levelname)s: %(message)s'
logger = logging.getLogger(__name__)
def parse_args():
parser = arg... | true | true |
f76257651c4eedbb86a0cb98dfb70257c3ea4954 | 8,301 | py | Python | setup.py | BadSingleton/OpenTimelineIO | 4ec5cb79c2a393ba92fefc87a7ca6217ca769a84 | [
"Apache-2.0"
] | null | null | null | setup.py | BadSingleton/OpenTimelineIO | 4ec5cb79c2a393ba92fefc87a7ca6217ca769a84 | [
"Apache-2.0"
] | null | null | null | setup.py | BadSingleton/OpenTimelineIO | 4ec5cb79c2a393ba92fefc87a7ca6217ca769a84 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2017 Pixar Animation Studios
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted... | 31.562738 | 80 | 0.661487 |
import os
import sys
import unittest
from setuptools import setup
import setuptools.command.build_py
import distutils.version
import pip
PIP_VERSION = pip.__version__
REQUIRED_PIP_VERSION = "6.0.0"
if (
distutils.version.StrictVersion(PIP_VERSION)
<= distutils.version.StrictVersion(REQUIRED_PIP_VERS... | true | true |
f762582997a864099c10a2c6ff9110b14c64a46c | 6,890 | py | Python | tests/test_sklearn_double_tensor_type_reg.py | elcolie/sklearn-onnx | 004fa39cb995ada0cde232ae8e30341018f450ac | [
"MIT"
] | null | null | null | tests/test_sklearn_double_tensor_type_reg.py | elcolie/sklearn-onnx | 004fa39cb995ada0cde232ae8e30341018f450ac | [
"MIT"
] | null | null | null | tests/test_sklearn_double_tensor_type_reg.py | elcolie/sklearn-onnx | 004fa39cb995ada0cde232ae8e30341018f450ac | [
"MIT"
] | null | null | null | """Tests GLMRegressor converter."""
import unittest
from distutils.version import StrictVersion
import numpy as np
from sklearn.exceptions import ConvergenceWarning
try:
from sklearn.utils._testing import ignore_warnings
except ImportError:
from sklearn.utils.testing import ignore_warnings
from sklea... | 43.88535 | 78 | 0.653266 |
import unittest
from distutils.version import StrictVersion
import numpy as np
from sklearn.exceptions import ConvergenceWarning
try:
from sklearn.utils._testing import ignore_warnings
except ImportError:
from sklearn.utils.testing import ignore_warnings
from sklearn.ensemble import BaggingRegressor
... | true | true |
f762594c1dc5c4d6bb741c4659cc9172fd62bff7 | 39,584 | py | Python | vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2019-06-14T10:11:59.000Z | 2019-06-14T10:11:59.000Z | vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2018-04-06T19:51:23.000Z | 2018-04-06T19:51:23.000Z | vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py | nielm/google-cloud-python | fd126fdea34206109eb00d675374ff7dc4dcc5ef | [
"Apache-2.0"
] | 1 | 2020-04-14T10:47:41.000Z | 2020-04-14T10:47:41.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/vision_v1p1beta1/proto/text_annotation.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _messa... | 34.906526 | 3,150 | 0.623585 |
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym... | true | true |
f7625a9c0e384524c92f57ae27dd2a42616177e6 | 11,194 | py | Python | samples/simple/matmul.py | xiacijie/dace | 2d942440b1d7b139ba112434bfa78f754e10bfe5 | [
"BSD-3-Clause"
] | 1 | 2021-07-26T07:58:06.000Z | 2021-07-26T07:58:06.000Z | samples/simple/matmul.py | xiacijie/dace | 2d942440b1d7b139ba112434bfa78f754e10bfe5 | [
"BSD-3-Clause"
] | null | null | null | samples/simple/matmul.py | xiacijie/dace | 2d942440b1d7b139ba112434bfa78f754e10bfe5 | [
"BSD-3-Clause"
] | 1 | 2021-03-04T13:01:48.000Z | 2021-03-04T13:01:48.000Z | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
from __future__ import print_function
import argparse
import dace
import numpy as np
from typing import List
# For optimizations
from dace.transformation.dataflow import (DoubleBuffering, MapCollapse,
... | 38.335616 | 80 | 0.596748 | from __future__ import print_function
import argparse
import dace
import numpy as np
from typing import List
from dace.transformation.dataflow import (DoubleBuffering, MapCollapse,
MapExpansion, MapReduceFusion,
StripMining, InLocalSt... | true | true |
f7625a9e745a1b2f6d4ff339a1524def82d59b51 | 5,185 | py | Python | alipay/aop/api/domain/InsApplication.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/InsApplication.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/InsApplication.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.InsObject import InsObject
from alipay.aop.api.domain.InsPerson import InsPerson
class InsApplication(object):
def __init__(self):
self._biz_data = None
self.... | 30.680473 | 85 | 0.587271 | import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.InsObject import InsObject
from alipay.aop.api.domain.InsPerson import InsPerson
class InsApplication(object):
def __init__(self):
self._biz_data = None
self._copies = None
self._effect_end_time =... | true | true |
f7625d081fd51fe28d084a14c95ea83ca075e6a3 | 1,567 | py | Python | venv/lib/python3.6/site-packages/quorum/request.py | coolkapil/flask-Api | 53b42dcba298bd94c07dbe18f0f8cb7f5710d3bc | [
"MIT"
] | 1 | 2019-09-15T20:20:12.000Z | 2019-09-15T20:20:12.000Z | venv/lib/python3.6/site-packages/quorum/request.py | coolkapil/flask-Api | 53b42dcba298bd94c07dbe18f0f8cb7f5710d3bc | [
"MIT"
] | 51 | 2019-10-08T01:53:02.000Z | 2021-06-04T22:02:21.000Z | venv/lib/python3.6/site-packages/quorum/request.py | coolkapil/flask-Api | 53b42dcba298bd94c07dbe18f0f8cb7f5710d3bc | [
"MIT"
] | 2 | 2019-10-10T17:06:33.000Z | 2020-06-16T05:34:13.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Flask Quorum
# Copyright (C) 2008-2012 Hive Solutions Lda.
#
# This file is part of Hive Flask Quorum.
#
# Hive Flask Quorum is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | 32.645833 | 76 | 0.699426 |
__author__ = "João Magalhães <joamag@hive.pt>"
__version__ = "1.0.0"
__revision__ = "$LastChangedRevision$"
__date__ = "$LastChangedDate$"
__copyright__ = "Copyright (c) 2008-2012 Hive Solutions Lda."
__license__ = "GNU General Public License (GPL), Version 3"
import flask
class Request(flask.R... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.