hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f752ecc33832f2ac9fb87b2dbebbb978e23f1a7e | 2,755 | py | Python | draw.py | VGGatGitHub/QWorld-silver | 4da363df7d8544959ff80f6e71fccc520db86745 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-05-26T13:35:30.000Z | 2021-05-26T13:35:30.000Z | draw.py | Innanov/QSilver | 99fc53d9c0f77dd1122e65ec24117574fff7c8a5 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | draw.py | Innanov/QSilver | 99fc53d9c0f77dd1122e65ec24117574fff7c8a5 | [
"Apache-2.0",
"CC-BY-4.0"
] | 2 | 2021-12-01T17:41:53.000Z | 2022-01-07T20:11:11.000Z | ##############################################################################
# Copyright 2019 Rigetti Computing
#
# 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://ww... | 37.739726 | 96 | 0.662069 | true | true | |
f752ece6e85caf219e8dd6811d61d6fb7c6cb0b6 | 53,090 | py | Python | analysis/pymo/preprocessing.py | guillefix/mt-lightning | 56e93a569d85a768c178b15461e5362c25fdc3e3 | [
"MIT"
] | 46 | 2021-06-29T01:30:59.000Z | 2022-02-21T14:07:43.000Z | analysis/pymo/preprocessing.py | guillefix/mt-lightning | 56e93a569d85a768c178b15461e5362c25fdc3e3 | [
"MIT"
] | 4 | 2021-07-08T06:34:09.000Z | 2022-02-08T12:56:20.000Z | analysis/pymo/preprocessing.py | guillefix/transflower-lightning | 56e93a569d85a768c178b15461e5362c25fdc3e3 | [
"MIT"
] | 5 | 2021-07-14T03:18:37.000Z | 2021-11-18T08:14:05.000Z | '''
Preprocessing Tranformers Based on sci-kit's API
By Omid Alemi
Created on June 12, 2017
'''
import copy
import pandas as pd
import numpy as np
import transforms3d as t3d
import scipy.ndimage.filters as filters
from sklearn.base import BaseEstimator, TransformerMixin
from analysis.pymo.rotation_tools import Rotat... | 39.887303 | 230 | 0.565587 | import copy
import pandas as pd
import numpy as np
import transforms3d as t3d
import scipy.ndimage.filters as filters
from sklearn.base import BaseEstimator, TransformerMixin
from analysis.pymo.rotation_tools import Rotation, euler2expmap, euler2expmap2, expmap2euler, euler_reorder, unroll
from analysis.pymo.Quaterni... | true | true |
f752ed777a0c535cc01b0d59abb89b63c2ce484d | 1,630 | py | Python | setup.py | deknijf/python-terraform-runner | 8b9141536f9bd39c3f00aeca83ce5ac5d793804b | [
"Apache-2.0"
] | null | null | null | setup.py | deknijf/python-terraform-runner | 8b9141536f9bd39c3f00aeca83ce5ac5d793804b | [
"Apache-2.0"
] | null | null | null | setup.py | deknijf/python-terraform-runner | 8b9141536f9bd39c3f00aeca83ce5ac5d793804b | [
"Apache-2.0"
] | null | null | null | from distutils.core import setup
DEPENDENCIES = [
'python_terraform',
'requests',
'argparse'
]
VERSION = '0.6'
URL = 'https://github.com/deknijf/python-terraform-runner'
setup(
name='python-terraform-runner',
#packages=['tf-runner'],
version=VERSION,
# Chose a license from here: https://h... | 32.6 | 103 | 0.636196 | from distutils.core import setup
DEPENDENCIES = [
'python_terraform',
'requests',
'argparse'
]
VERSION = '0.6'
URL = 'https://github.com/deknijf/python-terraform-runner'
setup(
name='python-terraform-runner',
version=VERSION,
license='Apache Software License',
description='... | true | true |
f752ee187af3f9a845474c1888f8c6dd176f0e28 | 6,475 | py | Python | openspeech/search/beam_search_rnn_transducer.py | techthiyanes/openspeech | 71d28bae1232420da1d6f357f52ff1a607dc983f | [
"Apache-2.0",
"MIT"
] | 207 | 2021-07-22T02:04:47.000Z | 2022-03-31T07:24:12.000Z | openspeech/search/beam_search_rnn_transducer.py | tqslj2/openspeech | 10307587f08615224df5a868fb5249c68c70b12d | [
"Apache-2.0",
"MIT"
] | 81 | 2021-07-21T16:52:22.000Z | 2022-03-31T14:56:54.000Z | openspeech/search/beam_search_rnn_transducer.py | tqslj2/openspeech | 10307587f08615224df5a868fb5249c68c70b12d | [
"Apache-2.0",
"MIT"
] | 43 | 2021-07-21T16:33:27.000Z | 2022-03-23T09:43:49.000Z | # MIT License
#
# Copyright (c) 2021 Soohwan Kim and Sangchun Ha and Soyoung Cho
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights... | 41.50641 | 112 | 0.589961 |
import torch
from openspeech.search.beam_search_base import OpenspeechBeamSearchBase
from openspeech.decoders import RNNTransducerDecoder
class BeamSearchRNNTransducer(OpenspeechBeamSearchBase):
def __init__(
self,
joint,
decoder: RNNTransducerDecoder,
... | true | true |
f752ee3f9287486c4c7081e7f854a0bc65f04d81 | 1,268 | py | Python | mmdet/models/backbones/__init__.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/__init__.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/__init__.py | DongshuoYin/garbage_dump_detection | 1087f2cd35f781c5d973db5a59ecf8eb3bfa2537 | [
"Apache-2.0"
] | null | null | null | from .darknet import Darknet
from .detectors_resnet import DetectoRS_ResNet
from .detectors_resnext import DetectoRS_ResNeXt
from .hourglass import HourglassNet
from .hrnet import HRNet
from .regnet import RegNet
from .res2net import Res2Net
from .resnest import ResNeSt
from .resnet import ResNet, ResNetV1d
from .resne... | 39.625 | 89 | 0.77918 | from .darknet import Darknet
from .detectors_resnet import DetectoRS_ResNet
from .detectors_resnext import DetectoRS_ResNeXt
from .hourglass import HourglassNet
from .hrnet import HRNet
from .regnet import RegNet
from .res2net import Res2Net
from .resnest import ResNeSt
from .resnet import ResNet, ResNetV1d
from .resne... | true | true |
f752eeb5e863b4e583cea6ec3a4fe492cc08b182 | 17,827 | py | Python | benchmarks/bench_plot_randomized_svd.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 8 | 2015-01-24T04:53:08.000Z | 2021-06-11T22:08:11.000Z | benchmarks/bench_plot_randomized_svd.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 29 | 2021-03-04T02:56:48.000Z | 2021-04-06T04:06:45.000Z | benchmarks/bench_plot_randomized_svd.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 12 | 2021-02-05T20:33:04.000Z | 2022-02-17T04:11:25.000Z | """
Benchmarks on the power iterations phase in randomized SVD.
We test on various synthetic and real datasets the effect of increasing
the number of power iterations in terms of quality of approximation
and running time. A number greater than 0 should help with noisy matrices,
which are characterized by a slow spectr... | 38.255365 | 79 | 0.609637 |
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import gc
import pickle
from time import time
from collections import defaultdict
import os.path
from sklearn.utils._arpack import _init_arpack_v0
from sklearn.utils import gen_batches
from sklearn.utils.validation import check_random_state
from... | true | true |
f752eec1cdf78bb5eedf42facf3e65c2428a6848 | 1,996 | py | Python | build/plugins/xs.py | SitdikovRustam/CatBoost | 39fb9dfddb24e977ed87efc71063b03cd4bc8f16 | [
"Apache-2.0"
] | 33 | 2016-12-15T21:47:13.000Z | 2020-10-27T23:53:59.000Z | build/plugins/xs.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | null | null | null | build/plugins/xs.py | dsferz/machinelearning_yandex | 8fde8314c5c70299ece8b8f00075ddfcd5e07ddf | [
"Apache-2.0"
] | 14 | 2016-12-28T17:00:33.000Z | 2022-01-16T20:15:27.000Z | import os
import re
import _import_wrapper as iw
class XsParser(object):
def __init__(self, path, unit):
self._path = path
retargeted = os.path.join(unit.path(), os.path.basename(path))
with open(path, 'rb') as f:
includes, induced = XsParser.parse_includes(f.readlines())
... | 26.613333 | 96 | 0.573647 | import os
import re
import _import_wrapper as iw
class XsParser(object):
def __init__(self, path, unit):
self._path = path
retargeted = os.path.join(unit.path(), os.path.basename(path))
with open(path, 'rb') as f:
includes, induced = XsParser.parse_includes(f.readlines())
... | true | true |
f752efef5c6f2cf9d2106f2b9413dfb810ba4946 | 1,823 | py | Python | gdrest/levels/routes.py | Silverflower67/GDRest | c6a02d18aa876c9df4c60a738b589da0509897b2 | [
"MIT"
] | null | null | null | gdrest/levels/routes.py | Silverflower67/GDRest | c6a02d18aa876c9df4c60a738b589da0509897b2 | [
"MIT"
] | null | null | null | gdrest/levels/routes.py | Silverflower67/GDRest | c6a02d18aa876c9df4c60a738b589da0509897b2 | [
"MIT"
] | null | null | null | import gd
from starlette.requests import Request
from starlette.responses import JSONResponse, RedirectResponse
from starlette.routing import Mount, Route
from gdrest.levels.level import Level
from auth import auth_client
async def get_level(request: Request):
client = auth_client(request.user)
lid: int = re... | 33.145455 | 95 | 0.667032 | import gd
from starlette.requests import Request
from starlette.responses import JSONResponse, RedirectResponse
from starlette.routing import Mount, Route
from gdrest.levels.level import Level
from auth import auth_client
async def get_level(request: Request):
client = auth_client(request.user)
lid: int = re... | true | true |
f752f0ed94c202bb19f9330da8bc51cb49fd1a73 | 620 | py | Python | core/models/job_run_logs.py | seamless-io/seamless-web | ad171c9c00f34b7f0453b18b9ea33f16a5427015 | [
"Apache-2.0"
] | 1 | 2021-02-16T04:47:52.000Z | 2021-02-16T04:47:52.000Z | core/models/job_run_logs.py | seamless-io/seamless-web | ad171c9c00f34b7f0453b18b9ea33f16a5427015 | [
"Apache-2.0"
] | 2 | 2020-12-30T02:57:42.000Z | 2020-12-30T03:23:01.000Z | core/models/job_run_logs.py | seamless-io/seamless-web | ad171c9c00f34b7f0453b18b9ea33f16a5427015 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import Column, Integer, DateTime, Text, ForeignKey
from sqlalchemy.orm import relationship
from core.models.base import base
class JobRunLog(base):
__tablename__ = 'job_run_logs'
id = Column(Integer, primary_key=True)
job_run_id = Column(Integer, ForeignKey('job_runs.id', ondelete='CASCA... | 32.631579 | 95 | 0.727419 | from sqlalchemy import Column, Integer, DateTime, Text, ForeignKey
from sqlalchemy.orm import relationship
from core.models.base import base
class JobRunLog(base):
__tablename__ = 'job_run_logs'
id = Column(Integer, primary_key=True)
job_run_id = Column(Integer, ForeignKey('job_runs.id', ondelete='CASCA... | true | true |
f752f19bfa307b074c9553595820c117808cc645 | 3,644 | py | Python | onnx/backend/test/case/node/cumsum.py | How-Wang/onnx | c940fa3fea84948e46603cab2f86467291443beb | [
"Apache-2.0"
] | 1 | 2022-02-04T07:45:14.000Z | 2022-02-04T07:45:14.000Z | onnx/backend/test/case/node/cumsum.py | How-Wang/onnx | c940fa3fea84948e46603cab2f86467291443beb | [
"Apache-2.0"
] | null | null | null | onnx/backend/test/case/node/cumsum.py | How-Wang/onnx | c940fa3fea84948e46603cab2f86467291443beb | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class CumSum(Base):
@staticmeth... | 32.828829 | 82 | 0.512075 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class CumSum(Base):
@staticmethod
def export_cumsum_1d() -> None:
node... | true | true |
f752f1b8c527725c006db71e1c2dae0cff77de9c | 4,694 | py | Python | var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # 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 EcpDataVisSdk(BundlePackage):
"""ECP Data & Vis SDK"""
homepage = "https://github.com... | 41.910714 | 85 | 0.602897 |
from spack import *
class EcpDataVisSdk(BundlePackage):
homepage = "https://github.com/chuckatkins/ecp-data-viz-sdk"
tags = ['ecp']
maintainers = ['chuckatkins']
version('1.0')
| true | true |
f752f27605649ae4987dd08eac6a9c03ff8029ca | 34 | py | Python | regulation/regutil/util/__init__.py | RNatvik/rntools | ddaf8f9cc440bcd0ed0439f087bc951e0add6dce | [
"MIT"
] | null | null | null | regulation/regutil/util/__init__.py | RNatvik/rntools | ddaf8f9cc440bcd0ed0439f087bc951e0add6dce | [
"MIT"
] | 1 | 2020-08-11T16:05:51.000Z | 2020-08-11T16:05:51.000Z | regulation/regutil/util/__init__.py | RNatvik/rntools | ddaf8f9cc440bcd0ed0439f087bc951e0add6dce | [
"MIT"
] | null | null | null | from regutil.util.timing import *
| 17 | 33 | 0.794118 | from regutil.util.timing import *
| true | true |
f752f2bf83ecdc7a43a3ad74742bb0c55ed16594 | 3,670 | py | Python | parsel/csstranslator.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 22 | 2018-03-13T13:51:41.000Z | 2022-02-19T07:27:48.000Z | parsel/csstranslator.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2021-03-31T18:31:06.000Z | 2021-12-13T19:46:40.000Z | parsel/csstranslator.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 5 | 2018-03-28T09:07:03.000Z | 2020-02-23T12:49:52.000Z | from cssselect import GenericTranslator as OriginalGenericTranslator
from cssselect import HTMLTranslator as OriginalHTMLTranslator
from cssselect.xpath import XPathExpr as OriginalXPathExpr
from cssselect.xpath import _unicode_safe_getattr, ExpressionError
from cssselect.parser import FunctionalPseudoElement
class X... | 34.299065 | 82 | 0.623433 | from cssselect import GenericTranslator as OriginalGenericTranslator
from cssselect import HTMLTranslator as OriginalHTMLTranslator
from cssselect.xpath import XPathExpr as OriginalXPathExpr
from cssselect.xpath import _unicode_safe_getattr, ExpressionError
from cssselect.parser import FunctionalPseudoElement
class X... | true | true |
f752f43bcff2516cd044771ab96bc85c89bc1640 | 5,598 | py | Python | python/smqtk/bin/make_train_test_sets.py | jbeezley/SMQTK | e6b00f94be95f39bbca52a7983ac3d6d1f86f847 | [
"BSD-3-Clause"
] | 1 | 2021-04-10T10:51:26.000Z | 2021-04-10T10:51:26.000Z | python/smqtk/bin/make_train_test_sets.py | jbeezley/SMQTK | e6b00f94be95f39bbca52a7983ac3d6d1f86f847 | [
"BSD-3-Clause"
] | 3 | 2021-09-08T02:17:49.000Z | 2022-03-12T00:40:33.000Z | python/smqtk/bin/make_train_test_sets.py | DigitalCompanion/SMQTK | fc9404b69150ef44f24423844bc80735c0c2b669 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import argparse
import csv
import itertools
import os
import re
import numpy
import six
from sklearn.model_selection import StratifiedShuffleSplit
class KeyToFilepath(argparse.Action):
"""
Custom argparse action for parsing out positional class-to-filepath
arguments.
"""
re_... | 39.146853 | 80 | 0.562344 |
import argparse
import csv
import itertools
import os
import re
import numpy
import six
from sklearn.model_selection import StratifiedShuffleSplit
class KeyToFilepath(argparse.Action):
re_key2path = re.compile('(\w+)=(.+)', flags=re.UNICODE)
def __init__(self, option_strings, dest, nargs=None, const=N... | true | true |
f752f6aa6b93aedbe8e8b73ee6d5507083cd2d82 | 821 | py | Python | python/paddle_fl/mpc/version.py | barrierye/PaddleFL | eff6ef28491fa2011686ca3daa4f680e5ef83deb | [
"Apache-2.0"
] | 379 | 2019-09-27T14:26:42.000Z | 2022-03-29T14:28:12.000Z | python/paddle_fl/mpc/version.py | Sprate/PaddleFL | 583691acd5db0a7ca331cc9a72415017b18669b8 | [
"Apache-2.0"
] | 132 | 2019-10-16T03:22:03.000Z | 2022-03-23T08:54:29.000Z | python/paddle_fl/mpc/version.py | Sprate/PaddleFL | 583691acd5db0a7ca331cc9a72415017b18669b8 | [
"Apache-2.0"
] | 106 | 2019-09-27T12:47:18.000Z | 2022-03-29T09:07:25.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 29.321429 | 74 | 0.727162 |
CURRENT_VER = '1.0.0'
__all__ = ['version', ]
def version():
print("Paddle Encrypted Version: " + CURRENT_VER)
| true | true |
f752f79eea8bba4248f71b571a1bf9396c4307a7 | 3,286 | py | Python | bot/exts/utilities/realpython.py | brad90four/sir-lancebot | b266be04b00f371392f75e698f2a588038242213 | [
"MIT"
] | null | null | null | bot/exts/utilities/realpython.py | brad90four/sir-lancebot | b266be04b00f371392f75e698f2a588038242213 | [
"MIT"
] | null | null | null | bot/exts/utilities/realpython.py | brad90four/sir-lancebot | b266be04b00f371392f75e698f2a588038242213 | [
"MIT"
] | null | null | null | import logging
from html import unescape
from typing import Optional
from urllib.parse import quote_plus
from discord import Embed
from discord.ext import commands
from bot.bot import Bot
from bot.constants import Colours
logger = logging.getLogger(__name__)
API_ROOT = "https://realpython.com/search/api/v1/"
ARTIC... | 32.534653 | 110 | 0.613512 | import logging
from html import unescape
from typing import Optional
from urllib.parse import quote_plus
from discord import Embed
from discord.ext import commands
from bot.bot import Bot
from bot.constants import Colours
logger = logging.getLogger(__name__)
API_ROOT = "https://realpython.com/search/api/v1/"
ARTIC... | true | true |
f752f9012b60304c6f5aab0061c437205453ae9b | 3,288 | py | Python | aioddd/errors.py | Yasti4/python-aioddd | a0731e05a0133bf5636437ceb7625f7deaa100ab | [
"MIT"
] | 4 | 2020-07-28T12:34:02.000Z | 2021-02-11T09:57:20.000Z | aioddd/errors.py | Yasti4/python-aioddd | a0731e05a0133bf5636437ceb7625f7deaa100ab | [
"MIT"
] | 2 | 2020-11-19T20:45:53.000Z | 2020-12-25T13:48:08.000Z | aioddd/errors.py | Yasti4/python-aioddd | a0731e05a0133bf5636437ceb7625f7deaa100ab | [
"MIT"
] | 1 | 2020-11-19T20:39:09.000Z | 2020-11-19T20:39:09.000Z | from json import dumps
from typing import Any, Dict, Optional
from uuid import uuid4
def raise_(err: BaseException) -> BaseException:
raise err # pragma: no cover
class BaseError(Exception):
_id: str
_code: str = 'code'
_title: str = 'title'
_detail: str
_meta: Dict[str, Any]
def __ini... | 24.355556 | 84 | 0.629258 | from json import dumps
from typing import Any, Dict, Optional
from uuid import uuid4
def raise_(err: BaseException) -> BaseException:
raise err
class BaseError(Exception):
_id: str
_code: str = 'code'
_title: str = 'title'
_detail: str
_meta: Dict[str, Any]
def __init__(self, *args, *... | true | true |
f752fa61471ce0ba7580075f3d215c0c449beb2e | 7,320 | py | Python | cynetworkx/algorithms/centrality/load.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 12 | 2019-07-23T08:07:53.000Z | 2022-03-09T06:13:16.000Z | cynetworkx/algorithms/centrality/load.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 7 | 2019-08-30T07:00:00.000Z | 2021-12-30T08:02:56.000Z | cynetworkx/algorithms/centrality/load.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 5 | 2020-10-10T03:40:32.000Z | 2021-11-23T12:28:53.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2004-2018 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
#
# Authors: Aric Hagberg (hagberg@lanl.gov)
# Pieter Swart (swart@lanl.gov)
# Sasha Gutfrai... | 34.205607 | 79 | 0.597541 |
from __future__ import division
from operator import itemgetter
import cynetworkx as nx
__all__ = ['load_centrality', 'edge_load_centrality']
def newman_betweenness_centrality(G, v=None, cutoff=None,
normalized=True, weight=None):
if v is not None:
between... | true | true |
f752fa81f03ba81084e737c6b9d288c28f89e6af | 8,841 | py | Python | docs/conf.py | TrackNet/python-lz4 | 28d59e3b00f0ec763463ada5b92e529d4c1fb80b | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | TrackNet/python-lz4 | 28d59e3b00f0ec763463ada5b92e529d4c1fb80b | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | TrackNet/python-lz4 | 28d59e3b00f0ec763463ada5b92e529d4c1fb80b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# python-lz4 documentation build configuration file, created by
# sphinx-quickstart on Sat Jun 4 21:29:32 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
... | 31.575 | 79 | 0.727067 |
import sys
import os
needs_sphinx = '1.4.8'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'python-lz4'
copyright = u'2... | true | true |
f752faf4287ec84b5805ccf334d07fe854cc3658 | 3,569 | py | Python | sdk/python/pulumi_gcp/tpu/get_tensorflow_versions.py | dimpu47/pulumi-gcp | 38355de300a5768e11c49d344a8165ba0735deed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/tpu/get_tensorflow_versions.py | dimpu47/pulumi-gcp | 38355de300a5768e11c49d344a8165ba0735deed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/tpu/get_tensorflow_versions.py | dimpu47/pulumi-gcp | 38355de300a5768e11c49d344a8165ba0735deed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import ... | 35.336634 | 244 | 0.657047 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
__all__ = [
'GetTensorflowVersionsResult',
'AwaitableGetTensorflowVersionsResult',
'get_tensorflow_versions',
]
@pulumi.output_type
class GetTensor... | true | true |
f752fb318e8ac6abcd367ad4040847fb0c13df95 | 279 | py | Python | components/oneshot.py | Yooooomi/my-car | 7b6d0fec6537876471e0293bdcc8edc80d684acd | [
"MIT"
] | null | null | null | components/oneshot.py | Yooooomi/my-car | 7b6d0fec6537876471e0293bdcc8edc80d684acd | [
"MIT"
] | null | null | null | components/oneshot.py | Yooooomi/my-car | 7b6d0fec6537876471e0293bdcc8edc80d684acd | [
"MIT"
] | null | null | null | import core
from component import Component
import asyncio
class Oneshot(Component):
async def start(self):
core.core.delete_component(self)
await asyncio.sleep(5)
print("End start")
def stop(self):
super().stop()
print("Closed") | 21.461538 | 40 | 0.641577 | import core
from component import Component
import asyncio
class Oneshot(Component):
async def start(self):
core.core.delete_component(self)
await asyncio.sleep(5)
print("End start")
def stop(self):
super().stop()
print("Closed") | true | true |
f752fbee322e46007e66f92fc7a32682121f4ffc | 8,298 | py | Python | var/spack/repos/builtin/packages/lua/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/lua/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/lua/package.py | robertodr/spack | 9b809e01b47d48f01b3d257912fe1b752943cd3d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 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 *
import os
class Lua(Package):
"""The Lua programming language interpreter and library."""
h... | 42.994819 | 95 | 0.597132 |
from spack import *
import os
class Lua(Package):
homepage = "http://www.lua.org"
url = "http://www.lua.org/ftp/lua-5.3.4.tar.gz"
version('5.3.5', sha256='0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac')
version('5.3.4', sha256='f681aa518233bc407e23acf0f5887c884f17436f000d453b... | true | true |
f752fbf7d55f19811d816d787e4e6d59db6475ac | 21,290 | py | Python | geophys_utils/netcdf_converter/aseg_gdf_utils.py | GeoscienceAustralia/geophys_utils | e5580f582f3e42f347d71b140dd9213f784e2fde | [
"Apache-2.0"
] | 18 | 2018-05-16T04:46:56.000Z | 2021-04-02T13:12:46.000Z | geophys_utils/netcdf_converter/aseg_gdf_utils.py | alex-ip/geophys_utils | 0681f6260f8fe7a9d5097fb8759a2b57c41fccc3 | [
"Apache-2.0"
] | 6 | 2018-08-06T00:38:36.000Z | 2021-11-01T01:28:49.000Z | geophys_utils/netcdf_converter/aseg_gdf_utils.py | GeoscienceAustralia/geophys_utils | e5580f582f3e42f347d71b140dd9213f784e2fde | [
"Apache-2.0"
] | 9 | 2018-05-15T23:03:34.000Z | 2021-12-16T00:00:44.000Z | '''
Functions to work with ASEG-GDF format string
Refer to https://www.aseg.org.au/sites/default/files/pdf/ASEG-GDF2-REV4.pdf for further information
Created on 19 Jun. 2018
@author: u76345
'''
import re
import numpy as np
from collections import OrderedDict
from math import ceil, log10
import logging
logger = logg... | 56.62234 | 159 | 0.57985 |
import re
import numpy as np
from collections import OrderedDict
from math import ceil, log10
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def dfrexp(f):
if type(f) == np.ndarray:
fexp = np.zeros(shape=f.shape, dtype='int32')
fexp[f != 0] = np.ceil(np.lo... | true | true |
f752fc1f96446be9fed0c71f41d06703d3283d3d | 2,707 | py | Python | watchdog.py | appKom/watchdog | fcf3ed3efc435a701bea956d72653e82afe13bcf | [
"MIT"
] | null | null | null | watchdog.py | appKom/watchdog | fcf3ed3efc435a701bea956d72653e82afe13bcf | [
"MIT"
] | null | null | null | watchdog.py | appKom/watchdog | fcf3ed3efc435a701bea956d72653e82afe13bcf | [
"MIT"
] | null | null | null | import os
import datetime
import time
from models import checkin, metadata
from sqlalchemy import create_engine, MetaData
# Generates the variables used later
engine = create_engine('sqlite:///checkins.db')
#TODO: get the name associated with cardnumber from API
def returnName(numb):
#Temp name until API is in place... | 33.419753 | 145 | 0.701145 | import os
import datetime
import time
from models import checkin, metadata
from sqlalchemy import create_engine, MetaData
engine = create_engine('sqlite:///checkins.db')
def returnName(numb):
name = "Onliner"
return name
try:
conn = engine.connect()
metadata.create_all(engine)
except:
print("Oooops. Somet... | true | true |
f752fc6d41b905f0a405638f64421ba1204dca18 | 9,127 | py | Python | deepchem/utils/save.py | saurabhclusterone/deepchem | 29bcf0fbf29a74c264a553237627ad3573a4b09d | [
"MIT"
] | null | null | null | deepchem/utils/save.py | saurabhclusterone/deepchem | 29bcf0fbf29a74c264a553237627ad3573a4b09d | [
"MIT"
] | null | null | null | deepchem/utils/save.py | saurabhclusterone/deepchem | 29bcf0fbf29a74c264a553237627ad3573a4b09d | [
"MIT"
] | null | null | null | """
Simple utils to save and load from disk.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
# TODO(rbharath): Use standard joblib once old-data has been regenerated.
import joblib
from sklearn.externals import joblib as old_joblib
import gzip
import js... | 30.023026 | 156 | 0.696176 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import joblib
from sklearn.externals import joblib as old_joblib
import gzip
import json
import pickle
import pandas as pd
import numpy as np
import os
import deepchem
from rdkit import Chem
import warnings
f... | true | true |
f752fcc5fd13d79414efee84a4c82b5eab2bb52e | 371 | py | Python | study/functools_study.py | strawsyz/straw | db313c78c2e3c0355cd10c70ac25a15bb5632d41 | [
"MIT"
] | 2 | 2020-04-06T09:09:19.000Z | 2020-07-24T03:59:55.000Z | study/functools_study.py | strawsyz/straw | db313c78c2e3c0355cd10c70ac25a15bb5632d41 | [
"MIT"
] | null | null | null | study/functools_study.py | strawsyz/straw | db313c78c2e3c0355cd10c70ac25a15bb5632d41 | [
"MIT"
] | null | null | null | from functools import partial
# 偏函数(functools.partial)
def add(*args, **kwargs):
# 打印位置参数
for n in args:
print(n)
print("-" * 20)
# 打印关键字参数
for k, v in kwargs.items():
print('%s:%s' % (k, v))
add_partial = partial(add, 10, k1=10, k2=20)
if __name__ == '__main__':
# add(1, 2... | 17.666667 | 44 | 0.552561 | from functools import partial
def add(*args, **kwargs):
for n in args:
print(n)
print("-" * 20)
for k, v in kwargs.items():
print('%s:%s' % (k, v))
add_partial = partial(add, 10, k1=10, k2=20)
if __name__ == '__main__':
add_partial(1, 2, 3, k3=20)
| true | true |
f752fcfa56c8de2a2d31b9434422811cc975fa82 | 1,411 | py | Python | app/FrontendMicroservice/setup_app/config.py | AdavisSnakes/GrocerySaaS | 1d0b50d1c0d2e53b1bdb9fe57e94c6168b7e4c84 | [
"MIT"
] | null | null | null | app/FrontendMicroservice/setup_app/config.py | AdavisSnakes/GrocerySaaS | 1d0b50d1c0d2e53b1bdb9fe57e94c6168b7e4c84 | [
"MIT"
] | null | null | null | app/FrontendMicroservice/setup_app/config.py | AdavisSnakes/GrocerySaaS | 1d0b50d1c0d2e53b1bdb9fe57e94c6168b7e4c84 | [
"MIT"
] | null | null | null | MODE='NotTesting'
DEBUG=True
if MODE == 'Testing':
# For MacOS, this fixes an issue where you can't reach other endpoints on localhost
MYSQL_HOST='host.docker.internal'
BASE_URL='host.docker.internal'
else:
MYSQL_HOST='localhost'
BASE_URL='localhost'
MYSQL_PORT='3306'
MYSQL_USER="root"
MYSQL_PASSW... | 32.068182 | 113 | 0.836286 | MODE='NotTesting'
DEBUG=True
if MODE == 'Testing':
MYSQL_HOST='host.docker.internal'
BASE_URL='host.docker.internal'
else:
MYSQL_HOST='localhost'
BASE_URL='localhost'
MYSQL_PORT='3306'
MYSQL_USER="root"
MYSQL_PASSWORD="Thetree565"
MYSQL_DB_NAME="FrontendDb"
TRIAL_LENGTH_DAYS=1
SQLALCHEMY_TRACK_M... | true | true |
f752fd98470b80d081be0e8714ae6e4f05bd2e96 | 436 | py | Python | src/action/migrations/0024_auto_20180630_1418.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | 1 | 2020-11-08T16:47:46.000Z | 2020-11-08T16:47:46.000Z | src/action/migrations/0024_auto_20180630_1418.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | null | null | null | src/action/migrations/0024_auto_20180630_1418.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-30 04:48
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('action', '0023_set_content_and_columns'),
]
operations = [
migrations.RenameField(... | 20.761905 | 51 | 0.612385 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('action', '0023_set_content_and_columns'),
]
operations = [
migrations.RenameField(
model_name='action',
old_name='_content',
... | true | true |
f752fdb06a3c16647d3be763ba89305cacad3ce1 | 3,109 | py | Python | fn_misp/fn_misp/components/misp_create_event.py | rudimeyer/resilient-community-apps | 7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00 | [
"MIT"
] | 1 | 2020-08-25T03:43:07.000Z | 2020-08-25T03:43:07.000Z | fn_misp/fn_misp/components/misp_create_event.py | rudimeyer/resilient-community-apps | 7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00 | [
"MIT"
] | 1 | 2019-07-08T16:57:48.000Z | 2019-07-08T16:57:48.000Z | fn_misp/fn_misp/components/misp_create_event.py | rudimeyer/resilient-community-apps | 7a46841ba41fa7a1c421d4b392b0a3ca9e36bd00 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
"""Function implementation"""
import logging
from pymisp import PyMISP
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
PACKAGE= "fn_misp"
class FunctionComponent(ResilientC... | 39.35443 | 159 | 0.621743 |
import logging
from pymisp import PyMISP
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
PACKAGE= "fn_misp"
class FunctionComponent(ResilientComponent):
def __init__(self, opts):
super(FunctionComponent, self).__init__(opts)
se... | true | true |
f752feb07f34b09d7a64b8932bc6cc20424af18f | 5,615 | py | Python | qa/rpc-tests/rpcbind_test.py | kazucoin/kazugold | 7b0e034b08eceacf907b18913be7043c9cdcf5f4 | [
"MIT"
] | 1 | 2019-06-02T17:21:29.000Z | 2019-06-02T17:21:29.000Z | qa/rpc-tests/rpcbind_test.py | kazucoin/kazugold | 7b0e034b08eceacf907b18913be7043c9cdcf5f4 | [
"MIT"
] | null | null | null | qa/rpc-tests/rpcbind_test.py | kazucoin/kazugold | 7b0e034b08eceacf907b18913be7043c9cdcf5f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 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 for -rpcbind, as well as -rpcallowip and -rpcconnect
# TODO extend this test from the test framew... | 37.939189 | 118 | 0.643099 |
import tempfile
import traceback
from test_framework.util import *
from test_framework.netutil import *
def run_bind_test(tmpdir, allow_ips, connect_to, addresses, expected):
expected = [(addr_to_hex(addr), port) for (addr, port) in expected]
base_args = ['-disablewallet', '-nolisten']
if allow_i... | true | true |
f752febf3d0b910578269f3eec4095f27767e765 | 4,974 | py | Python | dislash/application_commands/errors.py | Bakersbakebread/dislash.py | afe19c3ebf0b95a3abdec08f3fde8b455024aabd | [
"MIT"
] | 371 | 2021-02-07T07:47:38.000Z | 2022-02-17T13:06:51.000Z | dislash/application_commands/errors.py | Bakersbakebread/dislash.py | afe19c3ebf0b95a3abdec08f3fde8b455024aabd | [
"MIT"
] | 39 | 2021-03-22T06:06:05.000Z | 2021-12-20T05:46:36.000Z | dislash/application_commands/errors.py | Bakersbakebread/dislash.py | afe19c3ebf0b95a3abdec08f3fde8b455024aabd | [
"MIT"
] | 51 | 2021-02-08T18:12:40.000Z | 2022-01-17T14:14:50.000Z | from discord import DiscordException
class ApplicationCommandError(DiscordException):
"""
The base exception type for all slash-command related errors.
This inherits from :exc:`discord.DiscordException`.
This exception and exceptions inherited from it are handled
in a special way as they are cau... | 32.090323 | 103 | 0.660836 | from discord import DiscordException
class ApplicationCommandError(DiscordException):
def __init__(self, message=None, *args):
if message is not None:
m = message.replace("@everyone", "@\u200beveryone").replace("@here", "@\u200bhere")
super().__init__(m, *args)
... | true | true |
f752feffd2396b65976a86502ed1c62a7b81d545 | 381 | py | Python | rabbit_python/sender.py | flaviogf/Exemplos | fc666429f6e90c388e201fb7b7d5801e3c25bd25 | [
"MIT"
] | null | null | null | rabbit_python/sender.py | flaviogf/Exemplos | fc666429f6e90c388e201fb7b7d5801e3c25bd25 | [
"MIT"
] | 5 | 2019-12-29T04:58:10.000Z | 2021-03-11T04:35:15.000Z | rabbit_python/sender.py | flaviogf/Exemplos | fc666429f6e90c388e201fb7b7d5801e3c25bd25 | [
"MIT"
] | null | null | null | import pika
import os
URL_RABBIT = os.getenv('URL_RABBIT')
connection = pika.BlockingConnection(pika.ConnectionParameters(URL_RABBIT))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
routing_key='hello',
body='Hello W... | 23.8125 | 75 | 0.687664 | import pika
import os
URL_RABBIT = os.getenv('URL_RABBIT')
connection = pika.BlockingConnection(pika.ConnectionParameters(URL_RABBIT))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='',
routing_key='hello',
body='Hello W... | true | true |
f752ff3e2478a58215db3f6b7dc628f8e1956fb2 | 306 | py | Python | tests/sproc/metrics_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-03-20T07:13:33.000Z | 2017-05-03T03:39:53.000Z | tests/sproc/metrics_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 12 | 2017-07-10T07:04:06.000Z | 2017-07-26T09:32:54.000Z | tests/sproc/metrics_test.py | gaocegege/treadmill | 04325d319c0ee912c066f07b88b674e84485f154 | [
"Apache-2.0"
] | 2 | 2017-05-04T11:25:32.000Z | 2017-07-11T09:10:01.000Z | """Unit test for treadmill.sproc.metrics"""
import unittest
# the point of this file is to check at least the syntax
from treadmill.sproc import metrics # noqa: F401
class MetricsTest(unittest.TestCase):
"""Test treadmill.sproc.metrics"""
pass
if __name__ == '__main__':
unittest.main()
| 19.125 | 56 | 0.715686 |
import unittest
from treadmill.sproc import metrics
class MetricsTest(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
| true | true |
f752fffbaec2694ca4123a218a65bea81481dec8 | 1,110 | py | Python | cvxpy/constraints/constraint.py | quantopian/cvxpy | 7deee4d172470aa8f629dab7fead50467afa75ff | [
"Apache-2.0"
] | 5 | 2017-08-31T01:37:00.000Z | 2022-03-24T04:23:09.000Z | cvxpy/constraints/constraint.py | quantopian/cvxpy | 7deee4d172470aa8f629dab7fead50467afa75ff | [
"Apache-2.0"
] | null | null | null | cvxpy/constraints/constraint.py | quantopian/cvxpy | 7deee4d172470aa8f629dab7fead50467afa75ff | [
"Apache-2.0"
] | 6 | 2017-02-09T19:37:07.000Z | 2021-01-07T00:17:54.000Z | """
Copyright 2017 Steven Diamond
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 27.073171 | 72 | 0.707207 |
import cvxpy.lin_ops.lin_utils as lu
import abc
class Constraint(object):
__metaclass__ = abc.ABCMeta
def __init__(self, constr_id=None):
if constr_id is None:
self.constr_id = lu.get_id()
else:
self.constr_id = constr_id
super(Constraint, self).__init__()
| true | true |
f75300fb96e8326a7cd967fd813024ab01e76c27 | 11,419 | py | Python | configs/_base_/datasets/char_bbox_instance.py | jireh-father/mmdetection | b797e4d5b81c5a3d7d868ee2dc9aa27dbab23e7d | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/char_bbox_instance.py | jireh-father/mmdetection | b797e4d5b81c5a3d7d868ee2dc9aa27dbab23e7d | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/char_bbox_instance.py | jireh-father/mmdetection | b797e4d5b81c5a3d7d868ee2dc9aa27dbab23e7d | [
"Apache-2.0"
] | null | null | null | dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
dict(type='Resize', img_scale=(1333, 800),... | 219.596154 | 9,657 | 0.308784 | dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
dict(type='Resize', img_scale=(1333, 800),... | true | true |
f753011ef525e355a2583e0f353335c1c2ee27a6 | 6,457 | py | Python | purity_fb/purity_fb_1dot9/models/array_connection_path.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot9/models/array_connection_path.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot9/models/array_connection_path.py | bsamz-ps/purity_fb_python_client | 11f27ef0c72d8aac1fc4e1ed036cca038b85dfa4 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.9 Python SDK
Pure Storage FlashBlade REST 1.9 Python SDK. Compatible with REST API versions 1.0 - 1.9. Developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
... | 27.130252 | 249 | 0.567446 |
from pprint import pformat
from six import iteritems
import re
class ArrayConnectionPath(object):
swagger_types = {
'id': 'str',
'name': 'str',
'destination': 'str',
'source': 'str',
'status': 'str'
}
attribute_map = {
'id': 'id',
'name': 'nam... | true | true |
f75301a4ec187d1c996f877032870e7abff8cecd | 1,133 | py | Python | h/views/api/decorators/response.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | h/views/api/decorators/response.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:38:24.000Z | 2022-03-02T05:45:01.000Z | h/views/api/decorators/response.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""API view decorators for response headers"""
from __future__ import unicode_literals
from h.views.api import API_VERSION_DEFAULT
from h.views.api.helpers.media_types import media_type_for_version, version_media_types
def version_media_type_header(wrapped):
"""View decorator to add resp... | 37.766667 | 87 | 0.690203 |
from __future__ import unicode_literals
from h.views.api import API_VERSION_DEFAULT
from h.views.api.helpers.media_types import media_type_for_version, version_media_types
def version_media_type_header(wrapped):
def wrapper(context, request):
response = wrapped(context, request)
versi... | true | true |
f75301b42296322c8e560a51805682386fd76383 | 1,562 | py | Python | blackbox/handlers/notifiers/telegram.py | rabibh/blackbox | c77dac14449a4a3d74ee3d2b00170b3085642bbf | [
"MIT"
] | 31 | 2021-01-07T11:29:24.000Z | 2022-03-19T12:43:43.000Z | blackbox/handlers/notifiers/telegram.py | rabibh/blackbox | c77dac14449a4a3d74ee3d2b00170b3085642bbf | [
"MIT"
] | 61 | 2021-01-07T11:28:00.000Z | 2021-07-05T11:25:54.000Z | blackbox/handlers/notifiers/telegram.py | rabibh/blackbox | c77dac14449a4a3d74ee3d2b00170b3085642bbf | [
"MIT"
] | 10 | 2021-01-22T18:25:49.000Z | 2022-03-05T18:19:08.000Z | import telebot
from telebot.apihelper import ApiTelegramException
from blackbox.handlers.notifiers._base import BlackboxNotifier
from blackbox.utils.logger import log
STRING_LIMIT = 2000 # Limit output
CHECKMARK_EMOJI = "\U00002705" # ✔
FAIL_EMOJI = "\U0000274C" # ❌
WARNING_EMOJI = "\U000026A0" # ⚠
clas... | 33.234043 | 78 | 0.596031 | import telebot
from telebot.apihelper import ApiTelegramException
from blackbox.handlers.notifiers._base import BlackboxNotifier
from blackbox.utils.logger import log
STRING_LIMIT = 2000
CHECKMARK_EMOJI = "\U00002705"
FAIL_EMOJI = "\U0000274C"
WARNING_EMOJI = "\U000026A0"
class Telegram(BlackboxNoti... | true | true |
f753023f1508f1f3c459466ddb192c4be9c79b3e | 3,560 | py | Python | ambari-server/src/test/python/TestVersionSelectUtil.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | 3 | 2016-12-01T15:55:11.000Z | 2016-12-01T15:56:38.000Z | ambari-server/src/test/python/TestVersionSelectUtil.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/TestVersionSelectUtil.py | fangxingli/mambari | 6da9f6090d4d42623529b73413c8feb8b7f6fe45 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-01-07T08:55:01.000Z | 2021-01-07T08:55:01.000Z | '''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 37.87234 | 162 | 0.705899 |
from unittest import TestCase
import os
from mock.mock import patch, MagicMock
from resource_management.core.logger import Logger
class TestVersionSelectUtil(TestCase):
def setUp(self):
import imp
Logger.logger = MagicMock()
self.test_directory = os.path.dirname(os.path.abspath(__file__))
test_fi... | true | true |
f75303662800f737c834689b990c32bbe2d19c44 | 2,482 | py | Python | 3Dface_priors/facial_landmark.py | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | [
"MIT"
] | 29 | 2020-10-19T09:59:22.000Z | 2022-03-28T00:55:34.000Z | 3Dface_priors/facial_landmark.py | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | [
"MIT"
] | 10 | 2021-01-29T20:36:38.000Z | 2021-11-30T07:25:36.000Z | 3Dface_priors/facial_landmark.py | HUuxiaobin/Face-Super-Resolution-Guided-by-3D-Facial-Priors | 987e7c74d33d26cc5e9d1c0e395a06519a31792f | [
"MIT"
] | 4 | 2020-12-07T15:41:13.000Z | 2021-11-07T07:07:27.000Z | # import the necessary packages
from imutils import face_utils
import numpy as np
import argparse
import imutils
import dlib
import cv2
#python facial_landmarks.py --shape-predictor shape_predictor_68_face_landmarks.dat --image test1.jpg
def rect_to_bb(rect):
# take a bounding predicted by dlib and convert it
# to the ... | 37.044776 | 101 | 0.692184 |
from imutils import face_utils
import numpy as np
import argparse
import imutils
import dlib
import cv2
def rect_to_bb(rect):
x = rect.left()
y = rect.top()
w = rect.right() - x
h = rect.bottom() - y
return (x, y, w, h)
def shape_to_np(shape, dtype="int"):
coords = np.zeros((68, 2), ... | true | true |
f7530443cbcf99b302496fac676d8ba76e94f0ae | 11,932 | py | Python | userbot/modules/android.py | CrysTalesiaS/Bot | 69312bda7d009ff39dad81e0c9cfcc77dd9038e6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/android.py | CrysTalesiaS/Bot | 69312bda7d009ff39dad81e0c9cfcc77dd9038e6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/android.py | CrysTalesiaS/Bot | 69312bda7d009ff39dad81e0c9cfcc77dd9038e6 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module containing commands related to android"""
import asyncio
import json
import re
import os
import tim... | 36.048338 | 96 | 0.573416 |
import asyncio
import json
import re
import os
import time
import math
from requests import get
from bs4 import BeautifulSoup
from userbot import CMD_HELP, TEMP_DOWNLOAD_DIRECTORY
from userbot.events import register
from userbot.utils import (
chrome, humanbytes, time_formatter, md5, human_to_bytes
)
GITHU... | true | true |
f75304e9fc1ebda25188ae03374672ad4149393d | 741 | py | Python | main.py | CodeSlammers/python-base | c9e3b0c564d792355cfec6132cd5048d77eed230 | [
"MIT"
] | 1 | 2018-02-18T04:22:40.000Z | 2018-02-18T04:22:40.000Z | main.py | CodeSlammers/python-base | c9e3b0c564d792355cfec6132cd5048d77eed230 | [
"MIT"
] | null | null | null | main.py | CodeSlammers/python-base | c9e3b0c564d792355cfec6132cd5048d77eed230 | [
"MIT"
] | null | null | null | from flask import Flask
from database import register_db
from flask_bootstrap import Bootstrap
from flask_debug import Debug
from flask_session import Session
from nav import nav
from bundle import apply_assets
app = Flask(__name__)
app.config.from_object('config.DevConfig')
session = Session(app)
register_db(app, app... | 24.7 | 106 | 0.790823 | from flask import Flask
from database import register_db
from flask_bootstrap import Bootstrap
from flask_debug import Debug
from flask_session import Session
from nav import nav
from bundle import apply_assets
app = Flask(__name__)
app.config.from_object('config.DevConfig')
session = Session(app)
register_db(app, app... | true | true |
f753091a0f09b22966f035c2520fb456a34008af | 2,973 | py | Python | universaldatatool/sample.py | bribroder/python-universaldatatool | 343b3c0f137bf94a99941c299f25dac16680afcc | [
"MIT"
] | 4 | 2020-04-30T22:15:43.000Z | 2021-01-16T15:48:35.000Z | universaldatatool/sample.py | bribroder/python-universaldatatool | 343b3c0f137bf94a99941c299f25dac16680afcc | [
"MIT"
] | 6 | 2020-06-22T13:26:32.000Z | 2020-08-08T23:59:01.000Z | universaldatatool/sample.py | bribroder/python-universaldatatool | 343b3c0f137bf94a99941c299f25dac16680afcc | [
"MIT"
] | 5 | 2020-05-25T04:39:41.000Z | 2021-08-11T23:59:26.000Z | from .camelify import camelify_dict, camelify
import os
def correct_param(name, value):
if name == "img" and not value.startswith("http"):
name = "imagePath"
if name.endswith("Path"):
name = name[:-4] + "Url"
value = "file://" + os.path.abspath(value)
elif name == "audio" or name =... | 29.73 | 99 | 0.536159 | from .camelify import camelify_dict, camelify
import os
def correct_param(name, value):
if name == "img" and not value.startswith("http"):
name = "imagePath"
if name.endswith("Path"):
name = name[:-4] + "Url"
value = "file://" + os.path.abspath(value)
elif name == "audio" or name =... | true | true |
f7530947b45a89cad5e454f88ca6d81ff1118e32 | 4,161 | py | Python | tests/test_account.py | Korben11/dj-stripe | 06661c174f0cda52b33be9a421f8b80438d71ab0 | [
"MIT"
] | null | null | null | tests/test_account.py | Korben11/dj-stripe | 06661c174f0cda52b33be9a421f8b80438d71ab0 | [
"MIT"
] | null | null | null | tests/test_account.py | Korben11/dj-stripe | 06661c174f0cda52b33be9a421f8b80438d71ab0 | [
"MIT"
] | null | null | null | """
dj-stripe Account Tests.
"""
from copy import deepcopy
from unittest.mock import patch
import pytest
from django.test.testcases import TestCase
from djstripe.models import Account
from djstripe.settings import STRIPE_SECRET_KEY
from . import (
FAKE_ACCOUNT,
FAKE_FILEUPLOAD_ICON,
FAKE_FILEUPLOAD_LOGO,... | 32.76378 | 88 | 0.719539 | from copy import deepcopy
from unittest.mock import patch
import pytest
from django.test.testcases import TestCase
from djstripe.models import Account
from djstripe.settings import STRIPE_SECRET_KEY
from . import (
FAKE_ACCOUNT,
FAKE_FILEUPLOAD_ICON,
FAKE_FILEUPLOAD_LOGO,
IS_STATICMETHOD_AUTOSPEC_SUP... | true | true |
f75309684c7846950442fba245fe375d97159a9b | 8,360 | py | Python | config/settings/production.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | null | null | null | config/settings/production.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | null | null | null | config/settings/production.py | dopeheadz/Ploopy | e6d1ff8b3351062ed8971c37943a71bfe8294ee4 | [
"MIT"
] | 1 | 2020-09-30T17:38:59.000Z | 2020-09-30T17:38:59.000Z | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY')
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 39.809524 | 96 | 0.615789 | from .base import *
from .base import env
= env('DJANGO_SECRET_KEY')
= env.list('DJANGO_ALLOWED_HOSTS', default=['ploopy.oa.to'])
DATABASES['default'] = env.db('DATABASE_URL')
DATABASES['default']['ATOMIC_REQUESTS'] = True
DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', default=60)
CAC... | true | true |
f75309f92daf715fa82b4ec279b7d901fd935a55 | 1,956 | py | Python | auth-api/migrations/versions/eaef1147f25c_permissions_for_frcr_review.py | argush3/sbc-auth | 96a4de3a4358b3158540aea8c4d99e06909793f2 | [
"Apache-2.0"
] | null | null | null | auth-api/migrations/versions/eaef1147f25c_permissions_for_frcr_review.py | argush3/sbc-auth | 96a4de3a4358b3158540aea8c4d99e06909793f2 | [
"Apache-2.0"
] | null | null | null | auth-api/migrations/versions/eaef1147f25c_permissions_for_frcr_review.py | argush3/sbc-auth | 96a4de3a4358b3158540aea8c4d99e06909793f2 | [
"Apache-2.0"
] | 1 | 2019-07-25T18:20:41.000Z | 2019-07-25T18:20:41.000Z | """permissions for FRCR review
Revision ID: eaef1147f25c
Revises: b72d4946fb3c
Create Date: 2021-01-09 08:11:26.337104
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import column, table
# revision identifiers, used by Alembic.
revision = 'eaef1147f25c'
down_revision = 'b72d4946fb3c'
branch_l... | 39.918367 | 118 | 0.642638 | import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import column, table
revision = 'eaef1147f25c'
down_revision = 'b72d4946fb3c'
branch_labels = None
depends_on = None
def upgrade():
permissions_table = table('permissions',
column('id', sa.Integer()),
... | true | true |
f7530a3b90444f1e9d5a3f44ae3a9254398ca381 | 2,428 | py | Python | tests/ext/sklearn/test_model.py | koskotG/ebonite | 9f9ae016b70fb24865d5edc99142afb8ab4ddc59 | [
"Apache-2.0"
] | 270 | 2019-11-14T15:46:08.000Z | 2021-09-17T16:43:03.000Z | tests/ext/test_sklearn/test_model.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 14 | 2019-11-29T11:49:39.000Z | 2022-02-10T00:23:59.000Z | tests/ext/test_sklearn/test_model.py | leepand/ebonite | b01b662c43709d152940f488574d78ff25f89ecf | [
"Apache-2.0"
] | 18 | 2019-11-22T13:15:14.000Z | 2021-09-01T13:36:12.000Z | import numpy as np
import pytest
from sklearn.linear_model import LinearRegression, LogisticRegression
from ebonite.core.analyzer.model import ModelAnalyzer
from ebonite.ext.sklearn import SklearnModelWrapper
@pytest.fixture
def inp_data():
return [[1, 2, 3], [3, 2, 1]]
@pytest.fixture
def out_data():
retu... | 30.35 | 107 | 0.743822 | import numpy as np
import pytest
from sklearn.linear_model import LinearRegression, LogisticRegression
from ebonite.core.analyzer.model import ModelAnalyzer
from ebonite.ext.sklearn import SklearnModelWrapper
@pytest.fixture
def inp_data():
return [[1, 2, 3], [3, 2, 1]]
@pytest.fixture
def out_data():
retu... | true | true |
f7530abf37296b6ec799486b241f1b0899e56b7e | 90 | py | Python | pod_manager/api/urls_v10.py | racker/pod-manager | 40a748eed8931e98f5ae01b03b4590ec192ad6ed | [
"Apache-2.0"
] | null | null | null | pod_manager/api/urls_v10.py | racker/pod-manager | 40a748eed8931e98f5ae01b03b4590ec192ad6ed | [
"Apache-2.0"
] | null | null | null | pod_manager/api/urls_v10.py | racker/pod-manager | 40a748eed8931e98f5ae01b03b4590ec192ad6ed | [
"Apache-2.0"
] | null | null | null | from werkzeug.routing import Map, Rule
url_map = Map([
Rule('/', endpoint='home')
])
| 15 | 38 | 0.644444 | from werkzeug.routing import Map, Rule
url_map = Map([
Rule('/', endpoint='home')
])
| true | true |
f7530acb46b2e33fc5406c1a24957aeb2468be97 | 1,930 | py | Python | nitorch/nitorch/initialization.py | derEitel/patch_individual_filter_layer | ecd7b3ace759e10ceda8c39ebe1190a7bc27f223 | [
"BSD-3-Clause"
] | 2 | 2021-12-29T12:04:08.000Z | 2022-01-20T05:11:00.000Z | nitorch/nitorch/initialization.py | derEitel/patch_individual_filter_layer | ecd7b3ace759e10ceda8c39ebe1190a7bc27f223 | [
"BSD-3-Clause"
] | null | null | null | nitorch/nitorch/initialization.py | derEitel/patch_individual_filter_layer | ecd7b3ace759e10ceda8c39ebe1190a7bc27f223 | [
"BSD-3-Clause"
] | null | null | null | # Initialize weights
from torch.nn import init, Conv3d, BatchNorm3d, Linear
def xavier(x):
"""Wrapper for torch.nn.init.xavier method.
Parameters
----------
x : torch.tensor
Input tensor to be initialized. See torch.nn.init.py for more information
Returns
-------
torch.tensor
... | 19.896907 | 81 | 0.609326 |
from torch.nn import init, Conv3d, BatchNorm3d, Linear
def xavier(x):
return init.xavier_normal_(x)
def xavier_uniform(x):
return init.xavier_uniform_(x)
def he(x):
return init.kaiming_normal_(x)
def he_uniform(x):
return init.kaiming_uniform_(x)
def weights_init(m, func=he_uniform):
if i... | true | true |
f7530bbb67b96ea8bc79fdde0def14765fcf08aa | 20,788 | py | Python | ivi/dicon/diconGP700.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/dicon/diconGP700.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | ivi/dicon/diconGP700.py | edupo/python-ivi | 8105d8064503725dde781f0378d75db58defaecb | [
"MIT"
] | null | null | null | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014-2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | 40.601563 | 121 | 0.538484 |
import time
from .. import ivi
from .. import scpi
class diconGP700(scpi.common.IdnCommand, scpi.common.ErrorQuery, scpi.common.Reset,
scpi.common.SelfTest, scpi.common.Memory,
ivi.Driver):
def __init__(self, *args, **kwargs):
self.__dict__.setdefault('_instrument_i... | true | true |
f7530be5d969556ae26c51e8c12195cd943aa557 | 618 | py | Python | apps/base/urls/attribute.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 115 | 2019-08-18T16:12:54.000Z | 2022-03-29T14:17:20.000Z | apps/base/urls/attribute.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 22 | 2019-09-09T01:34:54.000Z | 2022-03-12T00:33:40.000Z | apps/base/urls/attribute.py | youssriaboelseod/pyerp | 9ef9873e2ff340010656f0c518bccf9d7a14dbaa | [
"MIT"
] | 83 | 2019-08-17T17:09:20.000Z | 2022-03-25T04:46:53.000Z | """The store routes
"""
# Django Library
from django.urls import path
# Localfolder Library
from ..views.attribute import (
AttributeCreateView, AttributeDeleteView, AttributeDetailView,
AttributeListView, AttributeUpdateView)
app_name = 'PyAttribute'
urlpatterns = [
path('', AttributeListView.as_view(),... | 30.9 | 75 | 0.710356 |
from django.urls import path
from ..views.attribute import (
AttributeCreateView, AttributeDeleteView, AttributeDetailView,
AttributeListView, AttributeUpdateView)
app_name = 'PyAttribute'
urlpatterns = [
path('', AttributeListView.as_view(), name='list'),
path('add/', AttributeCreateView.as_view()... | true | true |
f7530cd5a418fe3ada85b5024506dbdae38333f9 | 1,869 | py | Python | level03/smartshoe/save_accel_righthip_serial2csv.py | bmcage/skills4smartex | 44ed5b074c441974cd66025ef83b0eb7ca12546c | [
"BSD-3-Clause"
] | null | null | null | level03/smartshoe/save_accel_righthip_serial2csv.py | bmcage/skills4smartex | 44ed5b074c441974cd66025ef83b0eb7ca12546c | [
"BSD-3-Clause"
] | null | null | null | level03/smartshoe/save_accel_righthip_serial2csv.py | bmcage/skills4smartex | 44ed5b074c441974cd66025ef83b0eb7ca12546c | [
"BSD-3-Clause"
] | null | null | null | # test04 code prints to serial the following:
# print (sec, accel, peaks[current_peak-1], peaks_sec[current_peak-1],
# valleys[current_valley-1], valleys_sec[current_valley-1], amplitude_avg)
# we capture this here and save
import serial
import time
import csv
# Typing dmesg | tail will shows you which /d... | 29.203125 | 84 | 0.573034 |
import serial
import time
import csv
port = '/dev/ttyACM0'
filename = "walking_data_accelhip.csv"
import os.path
if os.path.isfile(filename):
print("File {0} exists. Rename!".format(filename))
raise Exception("File {0} exists. Rename!".format(filename))
ser = serial.Serial(port=port,
... | true | true |
f7530d4ab538ce6db0697cae062250304970795a | 3,384 | py | Python | updateReadme.py | githubib/hosts | 595249aa6fa59ccac0211dcf43c9a2af66a32505 | [
"MIT"
] | 22,197 | 2015-01-05T09:30:34.000Z | 2022-03-31T20:22:18.000Z | updateReadme.py | githubib/hosts | 595249aa6fa59ccac0211dcf43c9a2af66a32505 | [
"MIT"
] | 1,853 | 2015-01-02T01:53:21.000Z | 2022-03-31T13:21:27.000Z | updateReadme.py | githubib/hosts | 595249aa6fa59ccac0211dcf43c9a2af66a32505 | [
"MIT"
] | 2,687 | 2015-01-05T06:06:17.000Z | 2022-03-29T23:03:43.000Z | #!/usr/bin/env python
# Script by Steven Black
# https://github.com/StevenBlack
#
# This Python script will update the readme files in this repo.
import json
import os
import time
from string import Template
# Project Settings
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
README_TEMPLATE = os.path.join(... | 31.626168 | 79 | 0.525414 |
import json
import os
import time
from string import Template
BASEDIR_PATH = os.path.dirname(os.path.realpath(__file__))
README_TEMPLATE = os.path.join(BASEDIR_PATH, "readme_template.md")
README_FILENAME = "readme.md"
README_DATA_FILENAME = "readmeData.json"
def main():
s = Template(
"${descripti... | true | true |
f7530dd6872500b0ff66d15833e6117be533e251 | 10,767 | py | Python | tranzact/wallet/wallet_coin_store.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | 8 | 2021-09-19T18:57:49.000Z | 2022-02-09T04:32:50.000Z | tranzact/wallet/wallet_coin_store.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | 3 | 2021-09-29T10:56:48.000Z | 2021-11-19T00:09:28.000Z | tranzact/wallet/wallet_coin_store.py | Tranzact-Network/tranzact-blockchain | 692362155e46563aa70559123b93bc9379cac111 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Optional, Set
import aiosqlite
import sqlite3
from tranzact.types.blockchain_format.coin import Coin
from tranzact.types.blockchain_format.sized_bytes import bytes32
from tranzact.util.db_wrapper import DBWrapper
from tranzact.util.ints import uint32, uint64
from tranzact.wallet.util.wa... | 43.068 | 120 | 0.637782 | from typing import Dict, List, Optional, Set
import aiosqlite
import sqlite3
from tranzact.types.blockchain_format.coin import Coin
from tranzact.types.blockchain_format.sized_bytes import bytes32
from tranzact.util.db_wrapper import DBWrapper
from tranzact.util.ints import uint32, uint64
from tranzact.wallet.util.wa... | true | true |
f7530f647018869e81b46fbba98bce81ce524309 | 129,355 | py | Python | astropy/io/votable/tree.py | piersharding/astropy | 9680cd546aa9063758f2c23c836ca79a7c8f1eb1 | [
"BSD-3-Clause"
] | null | null | null | astropy/io/votable/tree.py | piersharding/astropy | 9680cd546aa9063758f2c23c836ca79a7c8f1eb1 | [
"BSD-3-Clause"
] | null | null | null | astropy/io/votable/tree.py | piersharding/astropy | 9680cd546aa9063758f2c23c836ca79a7c8f1eb1 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: Test FITS parsing
# STDLIB
import io
import re
import gzip
import base64
import codecs
import urllib.request
# THIRD-PARTY
import numpy as np
from numpy import ma
# LOCAL
from astropy.io import fits
from astropy import __version__ as astropy_ver... | 33.659901 | 102 | 0.542863 |
import io
import re
import gzip
import base64
import codecs
import urllib.request
import numpy as np
from numpy import ma
from astropy.io import fits
from astropy import __version__ as astropy_version
from astropy.utils.collections import HomogeneousList
from astropy.utils.xml.writer import XMLWriter
from . im... | true | true |
f75310af67421781de6b7e4f35d2e535421bd044 | 13,298 | py | Python | dlp/google/cloud/dlp_v2/gapic/enums.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | dlp/google/cloud/dlp_v2/gapic/enums.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | dlp/google/cloud/dlp_v2/gapic/enums.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-30T02:23:29.000Z | 2020-11-30T02:23:29.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 30.360731 | 113 | 0.641224 |
import enum
class Likelihood(enum.IntEnum):
LIKELIHOOD_UNSPECIFIED = 0
VERY_UNLIKELY = 1
UNLIKELY = 2
POSSIBLE = 3
LIKELY = 4
VERY_LIKELY = 5
class FileType(enum.IntEnum):
FILE_TYPE_UNSPECIFIED = 0
BINARY_FILE = 1
TEXT_FILE = 2
class DayOfWeek(enum.IntEnum):
... | true | true |
f75310b346a0feebc0bf75d93c3aee032a65515e | 1,576 | py | Python | tf.py | tsaodingtw/pttanal | c1d786c04e2d6f1ce02f6886748b4dbec1f37676 | [
"MIT"
] | null | null | null | tf.py | tsaodingtw/pttanal | c1d786c04e2d6f1ce02f6886748b4dbec1f37676 | [
"MIT"
] | null | null | null | tf.py | tsaodingtw/pttanal | c1d786c04e2d6f1ce02f6886748b4dbec1f37676 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from feature import Feature
import sqlite3
import pickle
db = sqlite3.connect('ptt.db')
cur = db.execute('SELECT * FROM ARTICLES LIMIT 1000')
# Create 100 phony x, y data points in NumPy, y = x * 0.1 + 0.3
f = Feature()
post_data = []
push_data = []
boo_data = []
for i in c... | 28.654545 | 72 | 0.680838 | import tensorflow as tf
import numpy as np
from feature import Feature
import sqlite3
import pickle
db = sqlite3.connect('ptt.db')
cur = db.execute('SELECT * FROM ARTICLES LIMIT 1000')
f = Feature()
post_data = []
push_data = []
boo_data = []
for i in cur:
post_data.append(f.features_for_tensorflow(i[5]))
p... | true | true |
f75311158484e590eab563484849feb9fd5b1eff | 5,587 | py | Python | sound/dacc/mg.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 4 | 2016-12-17T20:06:10.000Z | 2021-11-19T04:45:29.000Z | sound/dacc/mg.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 11 | 2021-01-06T05:35:11.000Z | 2022-03-11T23:28:31.000Z | sound/dacc/mg.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 3 | 2015-06-12T10:44:16.000Z | 2021-07-26T18:39:47.000Z | __author__ = 'thor'
import os
import pandas as pd
from pymongo import MongoClient
from pymongo.cursor import Cursor
from ut.sound import util as sutil
from ut.daf.manip import reorder_columns_as
from ut.sound.util import Sound
from ut.pstr.trans import str_to_utf8_or_bust
class MgDacc(object):
def __init__(sel... | 39.34507 | 102 | 0.574548 | __author__ = 'thor'
import os
import pandas as pd
from pymongo import MongoClient
from pymongo.cursor import Cursor
from ut.sound import util as sutil
from ut.daf.manip import reorder_columns_as
from ut.sound.util import Sound
from ut.pstr.trans import str_to_utf8_or_bust
class MgDacc(object):
def __init__(sel... | true | true |
f7531197ec636f8c985d6b501a7404b5d8fb650d | 62 | py | Python | tests/__init__.py | astralblue/sig2srv | 5a080542e3888decfb856cf64adbc0838e038cea | [
"MIT"
] | null | null | null | tests/__init__.py | astralblue/sig2srv | 5a080542e3888decfb856cf64adbc0838e038cea | [
"MIT"
] | 234 | 2017-07-27T03:51:03.000Z | 2021-11-15T17:47:36.000Z | tests/__init__.py | astralblue/sig2srv | 5a080542e3888decfb856cf64adbc0838e038cea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Unit test package for sig2srv."""
| 15.5 | 36 | 0.564516 | true | true | |
f7531291acd99c061b78d641d7ec85aebf889e8f | 2,910 | py | Python | napari/utils/_dtype.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 1,345 | 2019-03-03T21:14:14.000Z | 2022-03-31T19:46:39.000Z | napari/utils/_dtype.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 3,904 | 2019-03-02T01:30:24.000Z | 2022-03-31T20:17:27.000Z | napari/utils/_dtype.py | MaksHess/napari | 64a144607342c02177fc62fa83a3442ace0a98e7 | [
"BSD-3-Clause"
] | 306 | 2019-03-29T17:09:10.000Z | 2022-03-30T09:54:11.000Z | from typing import Tuple, Union
import numpy as np
_np_uints = {
8: np.uint8,
16: np.uint16,
32: np.uint32,
64: np.uint64,
}
_np_ints = {
8: np.int8,
16: np.int16,
32: np.int32,
64: np.int64,
}
_np_floats = {
16: np.float16,
32: np.float32,
64: np.float64,
}
_np_complex ... | 25.752212 | 77 | 0.635052 | from typing import Tuple, Union
import numpy as np
_np_uints = {
8: np.uint8,
16: np.uint16,
32: np.uint32,
64: np.uint64,
}
_np_ints = {
8: np.int8,
16: np.int16,
32: np.int32,
64: np.int64,
}
_np_floats = {
16: np.float16,
32: np.float32,
64: np.float64,
}
_np_complex ... | true | true |
f75312b5c673a11a8d32efd533ce3c601024e27f | 1,673 | py | Python | controller/model.py | romenr/bachelorthesis | 1f4325d5f10274597efb81194b6869768cc38659 | [
"MIT"
] | 2 | 2018-12-07T11:21:24.000Z | 2021-08-31T05:41:10.000Z | controller/model.py | romenr/bachelorthesis | 1f4325d5f10274597efb81194b6869768cc38659 | [
"MIT"
] | null | null | null | controller/model.py | romenr/bachelorthesis | 1f4325d5f10274597efb81194b6869768cc38659 | [
"MIT"
] | 1 | 2021-11-07T11:56:57.000Z | 2021-11-07T11:56:57.000Z | #!/usr/bin/env python
import numpy as np
from parameters import *
from snn import TargetFollowingSNN, ObstacleAvoidanceSNN, nest_simulate
class Model:
def __init__(self):
self.snn_tf = TargetFollowingSNN()
self.snn_oa = ObstacleAvoidanceSNN()
self.turn_pre = 0.0
self.angle_pre = 0.0
self.weights_tf = []
... | 24.970149 | 74 | 0.696952 |
import numpy as np
from parameters import *
from snn import TargetFollowingSNN, ObstacleAvoidanceSNN, nest_simulate
class Model:
def __init__(self):
self.snn_tf = TargetFollowingSNN()
self.snn_oa = ObstacleAvoidanceSNN()
self.turn_pre = 0.0
self.angle_pre = 0.0
self.weights_tf = []
self.weights_oa = [... | true | true |
f7531423b00f9ddab08d8604c42f700f99dc8a6d | 1,233 | py | Python | src/pydybm/arraymath/dycupy/random.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | 1 | 2017-09-04T13:40:41.000Z | 2017-09-04T13:40:41.000Z | src/pydybm/arraymath/dycupy/random.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | null | null | null | src/pydybm/arraymath/dycupy/random.py | rraymondhp/dybm | 3d618874a2f8838eaeca17ce40649a3789e9f140 | [
"Apache-2.0"
] | 1 | 2019-06-09T01:24:25.000Z | 2019-06-09T01:24:25.000Z | """``cupy``-based implementation of the random module
"""
__author__ = "Taro Sekiyama"
__copyright__ = "(C) Copyright IBM Corp. 2016"
import numpy.random as r
import cupy as cp
def _to_gpu(a):
arr = cp.empty_like(a)
arr.set(a)
return arr
class RandomState:
def __init__(self, seed):
self._... | 20.898305 | 76 | 0.660178 |
__author__ = "Taro Sekiyama"
__copyright__ = "(C) Copyright IBM Corp. 2016"
import numpy.random as r
import cupy as cp
def _to_gpu(a):
arr = cp.empty_like(a)
arr.set(a)
return arr
class RandomState:
def __init__(self, seed):
self._random = r.RandomState(seed)
def uniform(self, low=0.... | true | true |
f7531449b6b1b06cf7881739b889778761557c3d | 2,307 | py | Python | tool/picture_compression.py | mcBegins2Snow/TouhouLittleMaid | a25dcd18ee111caeb35fb26956593c88811475eb | [
"MIT"
] | null | null | null | tool/picture_compression.py | mcBegins2Snow/TouhouLittleMaid | a25dcd18ee111caeb35fb26956593c88811475eb | [
"MIT"
] | 1 | 2019-12-28T02:03:26.000Z | 2019-12-28T02:03:26.000Z | tool/picture_compression.py | mcBegins2Snow/TouhouLittleMaid | a25dcd18ee111caeb35fb26956593c88811475eb | [
"MIT"
] | 1 | 2019-12-27T20:20:15.000Z | 2019-12-27T20:20:15.000Z | import logging
import shutil
import tempfile
import tkinter as tk
from tkinter.filedialog import *
from PIL import Image
# 命令提示行的颜色代码
YELLOW = "\033[33m"
GREEN = "\033[32m"
CYAN = "\033[36m"
GRAY = "\033[37m"
RESET = "\033[0;39m"
# 临时放置处理文件的文件夹
TMP_ASSETS_DIR = tempfile.TemporaryDirectory()
# 日志初始化
logging.basicCon... | 27.464286 | 111 | 0.61205 | import logging
import shutil
import tempfile
import tkinter as tk
from tkinter.filedialog import *
from PIL import Image
YELLOW = "\033[33m"
GREEN = "\033[32m"
CYAN = "\033[36m"
GRAY = "\033[37m"
RESET = "\033[0;39m"
TMP_ASSETS_DIR = tempfile.TemporaryDirectory()
logging.basicConfig(
level=logging.INFO,
... | true | true |
f75314bb4952672c082c83819e9de3a44c8ad901 | 2,097 | py | Python | inference_2.py | mosvlad/tumor_mask_rcnn | 16d6b20431553e6e1cf1594686a1f503171d5f8d | [
"MIT"
] | null | null | null | inference_2.py | mosvlad/tumor_mask_rcnn | 16d6b20431553e6e1cf1594686a1f503171d5f8d | [
"MIT"
] | null | null | null | inference_2.py | mosvlad/tumor_mask_rcnn | 16d6b20431553e6e1cf1594686a1f503171d5f8d | [
"MIT"
] | null | null | null | import os
import cv2
import sys
import random
import math
import re
import time
import numpy as np
import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import skimage
import glob
ROOT_DIR = os.getcwd()
sys.path.append(ROOT_DIR)
from Mask_RCNN.mrcnn import util... | 26.884615 | 95 | 0.741536 | import os
import cv2
import sys
import random
import math
import re
import time
import numpy as np
import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import skimage
import glob
ROOT_DIR = os.getcwd()
sys.path.append(ROOT_DIR)
from Mask_RCNN.mrcnn import util... | true | true |
f75316db187264acd547e92b9a375c0bf8205fd7 | 2,745 | py | Python | angalabiri/suggestion/views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 1 | 2021-03-25T14:06:23.000Z | 2021-03-25T14:06:23.000Z | angalabiri/suggestion/views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 5 | 2021-09-08T03:08:46.000Z | 2022-03-12T00:56:35.000Z | angalabiri/suggestion/views.py | me-edavids/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | null | null | null | from django.db.models import Sum, F
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.urls i... | 34.3125 | 91 | 0.738434 | from django.db.models import Sum, F
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.urls i... | true | true |
f75317a6380ef2f6bacaf23d6dc962a3d4586d97 | 1,193 | py | Python | trans_alt.py | Liying1996/ASBanalyzer | 9593818be5e1977e60317a9318a23a51d6d318f5 | [
"MIT"
] | null | null | null | trans_alt.py | Liying1996/ASBanalyzer | 9593818be5e1977e60317a9318a23a51d6d318f5 | [
"MIT"
] | null | null | null | trans_alt.py | Liying1996/ASBanalyzer | 9593818be5e1977e60317a9318a23a51d6d318f5 | [
"MIT"
] | null | null | null | ## python to get alt fasta
import argparse, os
parser = argparse.ArgumentParser()
parser.add_argument("-name", help = "output name, eg. ENCFF758RQJ", required = True)
parser.add_argument("-input_file", help = "please give an AS bed file's path", required = True)
parser.add_argument("-fa", help = "please give the path o... | 27.113636 | 95 | 0.602682 | er = argparse.ArgumentParser()
parser.add_argument("-name", help = "output name, eg. ENCFF758RQJ", required = True)
parser.add_argument("-input_file", help = "please give an AS bed file's path", required = True)
parser.add_argument("-fa", help = "please give the path of fastq file", required = True)
parser.add_argument... | true | true |
f75317f91a967096a36364322d444d8e02e127f0 | 23,792 | py | Python | egs/wsj/s5/steps/nnet3/train_raw_dnn.tmp.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | egs/wsj/s5/steps/nnet3/train_raw_dnn.tmp.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | egs/wsj/s5/steps/nnet3/train_raw_dnn.tmp.py | zeek-han/kaldi | e3ed0812db7abd3c266d5616babfd0adff8260ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 Vijayaditya Peddinti.
# 2016 Vimal Manohar
# Apache 2.0.
""" This script is similar to steps/nnet3/train_dnn.py but trains a
raw neural network instead of an acoustic model.
"""
from __future__ import print_function
from __future__ import division
import argpars... | 45.666027 | 252 | 0.597049 |
from __future__ import print_function
from __future__ import division
import argparse
import logging
import pprint
import os
import sys
import traceback
sys.path.insert(0, 'steps')
import libs.nnet3.train.common_tmp as common_train_lib
import libs.common as common_lib
import libs.nnet3.train.frame_level_objf_tm... | true | true |
f753187d782e5920847b9bf586983f627bb0f9a2 | 603 | py | Python | fastapi/tutorial/16_cors/main.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | fastapi/tutorial/16_cors/main.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | fastapi/tutorial/16_cors/main.py | jianchengwang/todo-python | 36bdaf6fae714531946047ececca995d60f86e4a | [
"MIT"
] | null | null | null | import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost.tiangolo.com",
"https://localhost.tiangolo.com",
"http://localhost",
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origin... | 20.1 | 69 | 0.668325 | import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost.tiangolo.com",
"https://localhost.tiangolo.com",
"http://localhost",
"http://localhost:8080",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origin... | true | true |
f7531953ffe7f5ec8d2d008f647409945152b71b | 8,963 | py | Python | yolo.py | huxian123/mask_detecting | a9564d595edaff9317378fbe682cad4400760bff | [
"MIT"
] | 18 | 2020-02-07T02:21:14.000Z | 2022-03-08T14:27:04.000Z | yolo.py | huxian123/mask_detecting | a9564d595edaff9317378fbe682cad4400760bff | [
"MIT"
] | 1 | 2020-02-10T12:34:52.000Z | 2020-02-10T12:34:52.000Z | yolo.py | huxian123/mask_detecting | a9564d595edaff9317378fbe682cad4400760bff | [
"MIT"
] | 7 | 2020-02-07T02:21:16.000Z | 2020-07-19T08:54:57.000Z | # -*- coding: utf-8 -*-
"""
Class definition of YOLO_v3 style detection model on image and video
"""
import colorsys
import os
from timeit import default_timer as timer
import numpy as np
from keras import backend as K
from keras.models import load_model
from keras.layers import Input
from PIL import Image, ImageFont... | 39.139738 | 106 | 0.601696 |
import colorsys
import os
from timeit import default_timer as timer
import numpy as np
from keras import backend as K
from keras.models import load_model
from keras.layers import Input
from PIL import Image, ImageFont, ImageDraw
from yolo3.model import yolo_eval, yolo_body, tiny_yolo_body
from yolo3.utils import le... | true | true |
f7531957a145a5fa1a093eea378aaf0d59ce501d | 466 | py | Python | ports/blog/blog_schema.py | Jinxes/pipe | 3ce5b8b7b80e7b378e7773cc038d9b305848a081 | [
"BSD-2-Clause"
] | null | null | null | ports/blog/blog_schema.py | Jinxes/pipe | 3ce5b8b7b80e7b378e7773cc038d9b305848a081 | [
"BSD-2-Clause"
] | null | null | null | ports/blog/blog_schema.py | Jinxes/pipe | 3ce5b8b7b80e7b378e7773cc038d9b305848a081 | [
"BSD-2-Clause"
] | null | null | null | from marshmallow import Schema, fields, pre_load, post_dump
class UserSchema(Schema):
id = fields.Int()
title = fields.Str()
subtitle = fields.Str()
intro = fields.Str()
logo = fields.Str()
@pre_load
def make_user_data(self, data):
return data
@post_dump
def dump_user(self... | 20.26087 | 59 | 0.648069 | from marshmallow import Schema, fields, pre_load, post_dump
class UserSchema(Schema):
id = fields.Int()
title = fields.Str()
subtitle = fields.Str()
intro = fields.Str()
logo = fields.Str()
@pre_load
def make_user_data(self, data):
return data
@post_dump
def dump_user(self... | true | true |
f75319e85fcafdd645d532d13f8a52baa396bfc3 | 4,358 | py | Python | meniscus/data/model/tenant.py | ProjectMeniscus/meniscus | 1df9efe33ead702d0f53dfc227b5da385ba9cf23 | [
"Apache-2.0"
] | 12 | 2015-01-14T03:40:05.000Z | 2018-08-20T13:19:07.000Z | meniscus/data/model/tenant.py | ProjectMeniscus/meniscus | 1df9efe33ead702d0f53dfc227b5da385ba9cf23 | [
"Apache-2.0"
] | 1 | 2015-07-02T17:03:47.000Z | 2015-07-02T17:03:47.000Z | meniscus/data/model/tenant.py | ProjectMeniscus/meniscus | 1df9efe33ead702d0f53dfc227b5da385ba9cf23 | [
"Apache-2.0"
] | 4 | 2015-05-12T12:04:44.000Z | 2020-11-17T19:08:43.000Z | from uuid import uuid4
from meniscus.openstack.common.timeutils import isotime
from meniscus.sinks import DEFAULT_SINK
class EventProducer(object):
"""
An event producer is a nicer way of describing a parsing template
for a producer of events. Event producer definitions should be
reusable and not spec... | 27.408805 | 75 | 0.602111 | from uuid import uuid4
from meniscus.openstack.common.timeutils import isotime
from meniscus.sinks import DEFAULT_SINK
class EventProducer(object):
def __init__(self, _id, name, pattern, durable=False,
encrypted=False, sinks=None):
if not sinks:
self.sinks = [DEFAULT_SINK]
... | true | true |
f7531a0915c8465b0480fced097c2978ce606fce | 1,249 | py | Python | tests/test_transforms.py | ParhamYZ/MusicSourceSeparation | 26a42fbebdf50d2ae2ef674ef64f4c88cbe7e8e3 | [
"MIT"
] | null | null | null | tests/test_transforms.py | ParhamYZ/MusicSourceSeparation | 26a42fbebdf50d2ae2ef674ef64f4c88cbe7e8e3 | [
"MIT"
] | null | null | null | tests/test_transforms.py | ParhamYZ/MusicSourceSeparation | 26a42fbebdf50d2ae2ef674ef64f4c88cbe7e8e3 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
import torch
from openunmix import transforms
@pytest.fixture(params=[4096, 44100])
def nb_timesteps(request):
return int(request.param)
@pytest.fixture(params=[1, 2])
def nb_channels(request):
return request.param
@pytest.fixture(params=[1, 2])
def nb_sam... | 24.019231 | 97 | 0.67494 | import pytest
import numpy as np
import torch
from openunmix import transforms
@pytest.fixture(params=[4096, 44100])
def nb_timesteps(request):
return int(request.param)
@pytest.fixture(params=[1, 2])
def nb_channels(request):
return request.param
@pytest.fixture(params=[1, 2])
def nb_sam... | true | true |
f7531b47e938a142ce12345cb00b5b8535eafcef | 11,745 | py | Python | SCons/Variables/__init__.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | 2 | 2019-11-21T14:40:00.000Z | 2020-10-25T15:44:53.000Z | SCons/Variables/__init__.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | SCons/Variables/__init__.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | 2 | 2019-12-23T05:06:28.000Z | 2020-01-16T12:57:55.000Z | """SCons.Variables
This file defines the Variables class that is used to add user-friendly
customizable variables to an SCons build.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal ... | 35.483384 | 118 | 0.567476 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import sys
from functools import cmp_to_key
import SCons.Environment
import SCons.Errors
import SCons.Util
import SCons.Warnings
from .BoolVariable import BoolVariable
from .EnumVariable import EnumVariable
from .... | true | true |
f7531ce9dfd8089e394ca7d54c810a144920a90c | 14 | py | Python | rebound/__init__.py | kste/aeshash | 985ee3a8a3e9853580ac1ab745b446c82c97a095 | [
"MIT"
] | 5 | 2015-10-09T22:23:50.000Z | 2021-02-21T22:10:38.000Z | rebound/__init__.py | kste/aeshash | 985ee3a8a3e9853580ac1ab745b446c82c97a095 | [
"MIT"
] | null | null | null | rebound/__init__.py | kste/aeshash | 985ee3a8a3e9853580ac1ab745b446c82c97a095 | [
"MIT"
] | null | null | null | import rebound | 14 | 14 | 0.928571 | import rebound | true | true |
f7531d0382434928f4102e4fd51afaf4e6dd11ed | 3,482 | py | Python | app/app/settings.py | tuvshinot/recipe-django-rest-app-api | 3782e471a7372d2d3430e6b9dbd070df21278be8 | [
"MIT"
] | null | null | null | app/app/settings.py | tuvshinot/recipe-django-rest-app-api | 3782e471a7372d2d3430e6b9dbd070df21278be8 | [
"MIT"
] | null | null | null | app/app/settings.py | tuvshinot/recipe-django-rest-app-api | 3782e471a7372d2d3430e6b9dbd070df21278be8 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bui... | 25.416058 | 91 | 0.686674 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '$&8@$(&u0@d_3#$khih_q-5l)3cki0!ysjzsc!ngiv4c+$x+=b'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f7531d4ec7bef209b74d461d1d1ac99f49d81929 | 2,879 | py | Python | pymc3_ext/tests/test_missing.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/tests/test_missing.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | pymc3_ext/tests/test_missing.py | wlad111/pymc3 | 43432834be5bbca72caa32d40a848515eea554a8 | [
"Apache-2.0"
] | null | null | null | import pytest
from numpy import ma, array
import numpy
import pandas as pd
from pymc3_ext import Model, Normal, sample_prior_predictive, sample, ImputationWarning
def test_missing():
data = ma.masked_values([1, 2, -1, 4, -1], value=-1)
with Model() as model:
x = Normal('x', 1, 1)
with pytest.wa... | 33.476744 | 87 | 0.612713 | import pytest
from numpy import ma, array
import numpy
import pandas as pd
from pymc3_ext import Model, Normal, sample_prior_predictive, sample, ImputationWarning
def test_missing():
data = ma.masked_values([1, 2, -1, 4, -1], value=-1)
with Model() as model:
x = Normal('x', 1, 1)
with pytest.wa... | true | true |
f7531dd4add092f27de67e5426e4eda50f3a0db4 | 1,411 | py | Python | posts/models.py | Vilbert55/yatube | 4ec1fc111a88c0b4c6d1f679602c1f720b19959f | [
"BSD-3-Clause"
] | null | null | null | posts/models.py | Vilbert55/yatube | 4ec1fc111a88c0b4c6d1f679602c1f720b19959f | [
"BSD-3-Clause"
] | 9 | 2021-03-19T12:33:23.000Z | 2022-03-12T00:48:25.000Z | posts/models.py | Vilbert55/yatube | 4ec1fc111a88c0b4c6d1f679602c1f720b19959f | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(verbose_name='URL', max_length=50, unique=True, blank=True, null=True)
description = models.TextField(max_length=... | 38.135135 | 122 | 0.746279 | from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(verbose_name='URL', max_length=50, unique=True, blank=True, null=True)
description = models.TextField(max_length=... | true | true |
f7531fef06b8f3e4b33f42610c055450eab311a7 | 6,327 | py | Python | pron_dict_quality_assurance/align_xsampa.py | cadia-lvl/lvl_tts_frontend | 5100cba30d77424899679044c90a0de9f9c1777a | [
"Apache-2.0"
] | null | null | null | pron_dict_quality_assurance/align_xsampa.py | cadia-lvl/lvl_tts_frontend | 5100cba30d77424899679044c90a0de9f9c1777a | [
"Apache-2.0"
] | 1 | 2021-06-01T11:56:52.000Z | 2021-06-01T11:56:52.000Z | pron_dict_quality_assurance/align_xsampa.py | cadia-lvl/lvl_tts_frontend | 5100cba30d77424899679044c90a0de9f9c1777a | [
"Apache-2.0"
] | 2 | 2019-11-11T10:15:36.000Z | 2019-12-05T10:43:59.000Z | #!/usr/bin/env python3
#
# Copyright 2015 Robert Kjaran
#
#
from collections import OrderedDict
from pprint import pprint
# Eiríkur Rögnvaldsson. Icelandic Phonetic Transcription.
ER_PHONEMES_SAMPA = {
# Consonants Plosives
'p',
'p_h',
't',
't_h',
'c',
'c_h',
'k',
'k_h',
# Cons... | 28.759091 | 93 | 0.529319 |
from collections import OrderedDict
from pprint import pprint
ER_PHONEMES_SAMPA = {
'p',
'p_h',
't',
't_h',
'c',
'c_h',
'k',
'k_h',
'f',
'v',
'D',
'T',
's',
'j',
'C',
'G',
'x',
'h',
'm',
'n',
'J',
'N',
'm_... | true | true |
f75321017375931478c261004740f35672b8e534 | 8,829 | py | Python | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/extraction/postgisC6Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Guido Lemoine
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
# Version :
import time
import sys
import os
import io
import json... | 29.528428 | 99 | 0.61751 |
import time
import sys
import os
import io
import json
import psycopg2
import psycopg2.extras
import rasterio
import pandas as pd
from rasterstats import zonal_stats
from datetime import datetime
import download_with_boto3 as dwb
start = time.time()
with open('s3_config.json', 'r') as f:
s3config = j... | true | true |
f7532102d03901b35f7279dad903b19eb137926a | 466 | py | Python | examples/basic.py | chachan/pynotify2 | 43cd1e75f4339deb6014504a36825649a6e67865 | [
"BSD-2-Clause"
] | 1 | 2021-12-15T02:47:23.000Z | 2021-12-15T02:47:23.000Z | examples/basic.py | chachan/pynotify2 | 43cd1e75f4339deb6014504a36825649a6e67865 | [
"BSD-2-Clause"
] | null | null | null | examples/basic.py | chachan/pynotify2 | 43cd1e75f4339deb6014504a36825649a6e67865 | [
"BSD-2-Clause"
] | 1 | 2021-12-15T02:47:24.000Z | 2021-12-15T02:47:24.000Z | #!/usr/bin/env python
"""This illustrates the basic functionality of notify2 - creating and displaying
a notification message.
"""
import notify2
# This must be called before using notify2
notify2.init("Demo application")
# A number of stock
n = notify2.Notification("Summary", "Body text goes here",
"no... | 29.125 | 80 | 0.665236 |
import notify2
notify2.init("Demo application")
n = notify2.Notification("Summary", "Body text goes here",
"notification-message-im")
n.show()
| true | true |
f75321b0f09d9a1751b5b3b0d6d50b7b6493d932 | 708 | py | Python | 4_ifelse_2.py | polatbilek/python-101 | 8957ec8561cb3763be33fb2ef3f486375df58ea4 | [
"MIT"
] | null | null | null | 4_ifelse_2.py | polatbilek/python-101 | 8957ec8561cb3763be33fb2ef3f486375df58ea4 | [
"MIT"
] | null | null | null | 4_ifelse_2.py | polatbilek/python-101 | 8957ec8561cb3763be33fb2ef3f486375df58ea4 | [
"MIT"
] | null | null | null | list1 = [1, 10, 3, 4, 6]
if 3 in list1:
print("3 is in list.")
if 11 not in list1:
print("list doesn't contain 11")
variable1 = 4
if list1[3] == variable1:
print("element in index 3 is equal to variable1")
my_string = "this is an example string"
print(my_string[0])
print(my_string[1])
print(... | 19.135135 | 87 | 0.638418 | list1 = [1, 10, 3, 4, 6]
if 3 in list1:
print("3 is in list.")
if 11 not in list1:
print("list doesn't contain 11")
variable1 = 4
if list1[3] == variable1:
print("element in index 3 is equal to variable1")
my_string = "this is an example string"
print(my_string[0])
print(my_string[1])
print(... | true | true |
f753231caabe55c8c5f931774ef9e41d022202d0 | 249,749 | py | Python | Python2.7-CDN_Edgepack/tencentcloud/dayu/v20180709/models.py | tencentyun/scf-demo-repo | c75f9b9e8be8d079f0510b14fb0c7098d0b6bb7e | [
"Python-2.0",
"OLDAP-2.7"
] | 46 | 2019-03-01T02:19:18.000Z | 2021-12-18T12:37:02.000Z | Python3.6-CDN_PushUrlsCache/tencentcloud/dayu/v20180709/models.py | Juliiii/scf-demo-repo | 766928f14c64fbccab0713d6c6af0de3e716c9b0 | [
"Python-2.0",
"OLDAP-2.7"
] | 8 | 2019-01-22T10:46:43.000Z | 2020-12-30T13:03:04.000Z | Python2.7-CDN_Refresh/tencentcloud/dayu/v20180709/models.py | tencentyun/scf-demo-repo | c75f9b9e8be8d079f0510b14fb0c7098d0b6bb7e | [
"Python-2.0",
"OLDAP-2.7"
] | 67 | 2018-10-29T09:50:49.000Z | 2022-01-06T07:35:56.000Z | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 29.210409 | 186 | 0.601752 |
from tencentcloud.common.abstract_model import AbstractModel
class BaradData(AbstractModel):
def __init__(self):
self.MetricName = None
self.Data = None
self.Count = None
def _deserialize(self, params):
self.MetricName = params.get("MetricName")
self.D... | true | true |
f753235d42eb26c88d363fa1ccf74fbd3ae519b9 | 501 | py | Python | nlp_annotator_api/server/signals/process_pool.py | dasaku-ai/nlpmodel-v-h | 326bb9467df11d517285610c70f9d22627eb5efc | [
"Apache-2.0"
] | 3 | 2022-01-04T12:15:22.000Z | 2022-03-25T21:19:20.000Z | nlp_annotator_api/server/signals/process_pool.py | IBM/deepsearch-nlp-annotator-api-example | 76c2c8fd83c1e6d51c51c7b581a8c3f273b23c40 | [
"Apache-2.0"
] | 1 | 2022-02-02T09:26:44.000Z | 2022-02-02T09:26:44.000Z | nlp_annotator_api/server/signals/process_pool.py | dasaku-ai/nlpmodel-v-h | 326bb9467df11d517285610c70f9d22627eb5efc | [
"Apache-2.0"
] | 5 | 2021-09-27T08:26:09.000Z | 2022-03-10T11:41:35.000Z | import logging
from concurrent.futures.process import ProcessPoolExecutor
logger = logging.getLogger(__name__)
def process_pool_factory(num_workers: int):
async def process_pool(app_instance):
logger.debug("Setting up process pool with %r workers", num_workers)
pool = ProcessPoolExecutor(max_wo... | 21.782609 | 76 | 0.720559 | import logging
from concurrent.futures.process import ProcessPoolExecutor
logger = logging.getLogger(__name__)
def process_pool_factory(num_workers: int):
async def process_pool(app_instance):
logger.debug("Setting up process pool with %r workers", num_workers)
pool = ProcessPoolExecutor(max_wo... | true | true |
f753242d5bd13d286d7fbb0d872cc359e81f727e | 797 | py | Python | tensorflow_model_remediation/min_diff/keras/__init__.py | sarvex/model-remediation | c0592dccfa4706577fe94786cf3d59d4b80cd825 | [
"Apache-2.0"
] | 27 | 2020-10-23T18:00:06.000Z | 2022-03-28T02:50:47.000Z | tensorflow_model_remediation/min_diff/keras/__init__.py | sarvex/model-remediation | c0592dccfa4706577fe94786cf3d59d4b80cd825 | [
"Apache-2.0"
] | 12 | 2020-11-13T20:51:30.000Z | 2022-03-30T22:58:18.000Z | tensorflow_model_remediation/min_diff/keras/__init__.py | sarvex/model-remediation | c0592dccfa4706577fe94786cf3d59d4b80cd825 | [
"Apache-2.0"
] | 14 | 2020-11-16T12:13:35.000Z | 2022-03-27T09:14:28.000Z | # coding=utf-8
# Copyright 2021 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 ... | 36.227273 | 74 | 0.780427 |
from tensorflow_model_remediation.min_diff.keras import models
from tensorflow_model_remediation.min_diff.keras import utils
MinDiffModel = models.MinDiffModel
| true | true |
f753245c6149b5b259cd11b8a8f9fa6891a02d8c | 6,261 | py | Python | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | null | null | null | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2017-07-31T08:15:26.000Z | 2017-07-31T08:15:26.000Z | ucb_cs61A/projects/scheme/scheme_reader.py | tavaresdong/courses-notes | 7fb89103bca679f5ef9b14cbc777152daac1402e | [
"MIT"
] | 1 | 2019-10-06T16:52:31.000Z | 2019-10-06T16:52:31.000Z | """This module implements the built-in data types of the Scheme language, along
with a parser for Scheme expressions.
In addition to the types defined in this file, some data types in Scheme are
represented by their corresponding type in Python:
number: int or float
symbol: string
boolean: ... | 29.257009 | 79 | 0.576585 |
from ucb import main, trace, interact
from scheme_tokens import tokenize_lines, DELIMITERS
from buffer import Buffer, InputReader, LineReader
class Pair:
def __init__(self, first, second):
self.first = first
self.second = second
def __iter__(self):
self.cur = self
return sel... | true | true |
f753248881389b5f9291cb4d292ef226acceeea2 | 1,244 | py | Python | src/os_tornado/commands/runserver.py | cfhamlet/os-tornado | a1ac204889d561d2db9d646ee49214c39fa546c1 | [
"MIT"
] | 5 | 2018-03-01T12:28:50.000Z | 2020-12-08T19:19:56.000Z | src/os_tornado/commands/runserver.py | cfhamlet/os-tornado | a1ac204889d561d2db9d646ee49214c39fa546c1 | [
"MIT"
] | 3 | 2017-12-20T05:41:42.000Z | 2018-03-13T05:42:28.000Z | src/os_tornado/commands/runserver.py | cfhamlet/os-tornado | a1ac204889d561d2db9d646ee49214c39fa546c1 | [
"MIT"
] | null | null | null | """The runserver command"""
from __future__ import print_function
from os_tornado.commands import Command
from os_tornado.component_manager import ComponentManager
from os_tornado.exceptions import UsageError
from os_tornado.runner import Runner
class RunserverCommand(Command):
"""Command for starting server"""
... | 33.621622 | 93 | 0.659968 | from __future__ import print_function
from os_tornado.commands import Command
from os_tornado.component_manager import ComponentManager
from os_tornado.exceptions import UsageError
from os_tornado.runner import Runner
class RunserverCommand(Command):
def short_desc(self):
return "run server."
def a... | true | true |
f7532610b54959b4e8cbbbc39867ac6245084ad6 | 2,874 | py | Python | dizzy/objects/regex.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T10:11:43.000Z | 2020-11-19T10:11:43.000Z | dizzy/objects/regex.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | null | null | null | dizzy/objects/regex.py | 0xc0decafe/dizzy | 6cf6abf7a9b990fe77618e42651f3c3d286cc15b | [
"BSD-3-Clause"
] | 1 | 2020-11-19T10:12:18.000Z | 2020-11-19T10:12:18.000Z | # regex.py
#
# Copyright 2017 Daniel Mende <mail@c0decafe.de>
#
# 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
#... | 42.264706 | 80 | 0.652749 |
from dizzy.value import Value
from dizzy.config import CONFIG
from dizzy import DizzyParseException
if CONFIG["DEPS"]["exrex"]:
from exrex import generate, count
class Regex:
def __init__(self, name, regex, limit=20):
if isinstance(name, str) and name:
... | true | true |
f753272cfe4f364b62862db19bd91d0bb77e66b2 | 1,728 | py | Python | setup.py | Liatwilight/txtai | abf9104a1a47969147152c3100ef2bc7ed2265ed | [
"Apache-2.0"
] | null | null | null | setup.py | Liatwilight/txtai | abf9104a1a47969147152c3100ef2bc7ed2265ed | [
"Apache-2.0"
] | null | null | null | setup.py | Liatwilight/txtai | abf9104a1a47969147152c3100ef2bc7ed2265ed | [
"Apache-2.0"
] | null | null | null | # pylint: disable = C0111
from setuptools import find_packages, setup
with open("README.md", "r") as f:
DESCRIPTION = f.read()
setup(name="txtai",
version="1.4.0",
author="NeuML",
description="AI-powered search engine",
long_description=DESCRIPTION,
long_description_content_type="tex... | 34.56 | 71 | 0.555556 |
from setuptools import find_packages, setup
with open("README.md", "r") as f:
DESCRIPTION = f.read()
setup(name="txtai",
version="1.4.0",
author="NeuML",
description="AI-powered search engine",
long_description=DESCRIPTION,
long_description_content_type="text/markdown",
url="h... | true | true |
f7532781ca18bfaa28bc8f549f7df37dbba45c3c | 15,639 | py | Python | coronet/main2_worker_gradient_quantization.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | coronet/main2_worker_gradient_quantization.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | coronet/main2_worker_gradient_quantization.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | import time
from numpy.random import seed
seed(8) #1
import tensorflow
tensorflow.random.set_seed(7)
# tensorflow.random.set_random_seed(7)
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
from tensorflow.keras import backend as K
from tensorflow.... | 31.466801 | 116 | 0.617942 | import time
from numpy.random import seed
seed(8)
import tensorflow
tensorflow.random.set_seed(7)
import numpy as np
import pandas as pd
import os
from tensorflow.keras import backend as K
from tensorflow.keras.models import Model ,load_model
from tensorflow.keras.layers import Flatten, Dense, Dropout
from ten... | true | true |
f7532838cb01421566643ccdecefe5e78ef886df | 423 | py | Python | examples/task.py | hamakou108/luigi-batch-flow | e52d6ecf503d8a91903c10c36edc86483afc6d68 | [
"MIT"
] | null | null | null | examples/task.py | hamakou108/luigi-batch-flow | e52d6ecf503d8a91903c10c36edc86483afc6d68 | [
"MIT"
] | 4 | 2018-09-16T05:42:55.000Z | 2018-12-06T13:10:18.000Z | examples/task.py | hamakou108/luigi-batch-flow | e52d6ecf503d8a91903c10c36edc86483afc6d68 | [
"MIT"
] | null | null | null | from luigi.mock import MockTarget
from examples import batch as b
from luigi_batch_flow.task import Task
class FirstTask(Task):
"""
FirstTask is an example.
"""
batch = b.FirstBatch()
target = MockTarget("first_task.txt")
class SecondTask(Task):
"""
SecondTask is an example.
"""
... | 16.92 | 42 | 0.664303 | from luigi.mock import MockTarget
from examples import batch as b
from luigi_batch_flow.task import Task
class FirstTask(Task):
batch = b.FirstBatch()
target = MockTarget("first_task.txt")
class SecondTask(Task):
required_task = FirstTask()
batch = b.SecondBatch()
target = MockTarget("second_... | true | true |
f7532914447f413eed5274c4e54cca2f9bb6b81c | 2,535 | py | Python | seeker/apps.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 24 | 2015-01-05T21:03:56.000Z | 2021-12-30T03:35:26.000Z | seeker/apps.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 30 | 2016-03-11T21:29:38.000Z | 2022-03-29T21:09:05.000Z | seeker/apps.py | imszhongj/django-seeker | 6b1c4b03cd4d2ef8967496c0a9f76e032a425d00 | [
"BSD-2-Clause"
] | 30 | 2015-01-08T19:49:04.000Z | 2021-12-22T21:41:55.000Z | from django.apps import AppConfig, apps
from django.conf import settings
from .mapping import Indexable
from .registry import register
from .utils import import_class
import importlib
import inspect
import logging
logger = logging.getLogger(__name__)
class SeekerConfig (AppConfig):
name = 'seeker'
def re... | 42.25 | 142 | 0.599211 | from django.apps import AppConfig, apps
from django.conf import settings
from .mapping import Indexable
from .registry import register
from .utils import import_class
import importlib
import inspect
import logging
logger = logging.getLogger(__name__)
class SeekerConfig (AppConfig):
name = 'seeker'
def re... | true | true |
f75329eb245b8a73b5cf9d4b829c11ae70c07605 | 414 | py | Python | embedders/FAb-Net/Datasets/generate_large_voxceleb.py | mumumu99/latent-pose-reenactment | bfe8175f9cf3d67d46c21194bb5b6f898ef3ea53 | [
"Apache-2.0"
] | 79 | 2018-08-29T08:58:34.000Z | 2021-12-12T23:12:36.000Z | embedders/FAb-Net/Datasets/generate_large_voxceleb.py | mumumu99/latent-pose-reenactment | bfe8175f9cf3d67d46c21194bb5b6f898ef3ea53 | [
"Apache-2.0"
] | 5 | 2018-09-06T08:31:19.000Z | 2020-09-28T09:52:02.000Z | embedders/FAb-Net/Datasets/generate_large_voxceleb.py | mumumu99/latent-pose-reenactment | bfe8175f9cf3d67d46c21194bb5b6f898ef3ea53 | [
"Apache-2.0"
] | 14 | 2018-09-30T09:07:50.000Z | 2021-08-05T08:16:44.000Z |
import os
ids = [d for d in os.listdir(VOX_CELEB_LOCATION) if d[0:2] == 'id']
train = ids[0:int(0.7*len(ids))]
val = ids[int(0.7*len(ids)):int(0.8*len(ids))]
test = ids[int(0.8*len(ids)):]
import numpy as np
np.save('./large_voxceleb/train.npy', np.array(train))
np.save('./large_voxceleb/test.npy', np.array(test))... | 23 | 67 | 0.666667 |
import os
ids = [d for d in os.listdir(VOX_CELEB_LOCATION) if d[0:2] == 'id']
train = ids[0:int(0.7*len(ids))]
val = ids[int(0.7*len(ids)):int(0.8*len(ids))]
test = ids[int(0.8*len(ids)):]
import numpy as np
np.save('./large_voxceleb/train.npy', np.array(train))
np.save('./large_voxceleb/test.npy', np.array(test))... | true | true |
f7532a629fbd5e65a163a91a7a2bf4c4519a23be | 983 | py | Python | django2/bookmarks/account/forms.py | Gozeon/code-collections | 7304e2b9c4c91a809125198d22cf40dcbb45a23b | [
"MIT"
] | 2 | 2020-10-28T11:36:28.000Z | 2020-11-06T12:36:24.000Z | django2/bookmarks/account/forms.py | Gozeon/code-collections | 7304e2b9c4c91a809125198d22cf40dcbb45a23b | [
"MIT"
] | 136 | 2020-09-28T16:36:28.000Z | 2022-03-28T19:34:14.000Z | account/forms.py | vitorpvcampos/social-net-django | fbda648f6c2c7f317436fa5f70f845deda0af875 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from .models import Profile
class LoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput)
class UserRegistrationForm(forms.ModelForm):
password = forms.CharField(label='Password', widg... | 27.305556 | 84 | 0.675483 | from django import forms
from django.contrib.auth.models import User
from .models import Profile
class LoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput)
class UserRegistrationForm(forms.ModelForm):
password = forms.CharField(label='Password', widg... | true | true |
f7532aa4aa3ade9a6ba2aa21ce694ce0cbe330ea | 4,540 | py | Python | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 385 | 2015-11-20T02:21:18.000Z | 2022-03-24T09:38:24.000Z | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 127 | 2016-07-08T20:23:20.000Z | 2022-02-23T13:52:19.000Z | stoq/installer.py | ytreister/stoq | 8bfc78b226ee6500eb78e1bdf361fc83bc5005b7 | [
"Apache-2.0"
] | 68 | 2015-11-20T12:51:44.000Z | 2022-01-25T04:35:54.000Z | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | 37.213115 | 112 | 0.529075 |
import os
import sys
import logging
import requests
import subprocess
from tempfile import NamedTemporaryFile
from .exceptions import StoqException, StoqPluginException
log = logging.getLogger()
class StoqPluginInstaller:
DEFAULT_REPO = 'git+https://github.com/PUNCH-Cyber/stoq-plugins-public.gi... | true | true |
f7532b4f7ffc5780a15c35dbf7c2675512c6f684 | 2,272 | py | Python | setup.py | laughedelic/sparql-kernel | a7fa090ec75cde4e432d4145d1c63249bdef8b70 | [
"BSD-3-Clause"
] | null | null | null | setup.py | laughedelic/sparql-kernel | a7fa090ec75cde4e432d4145d1c63249bdef8b70 | [
"BSD-3-Clause"
] | null | null | null | setup.py | laughedelic/sparql-kernel | a7fa090ec75cde4e432d4145d1c63249bdef8b70 | [
"BSD-3-Clause"
] | null | null | null | """
Install the package containing the SPARQL kernel for Jupyter.
To actually use the kernel it needs to be installed into Jupyter afterwards.
"""
from __future__ import print_function
import os
import os.path
import sys
from setuptools import setup
from sparqlkernel.constants import __version__, LANGUAGE, DISPLAY_N... | 31.123288 | 78 | 0.611356 |
from __future__ import print_function
import os
import os.path
import sys
from setuptools import setup
from sparqlkernel.constants import __version__, LANGUAGE, DISPLAY_NAME
PKGNAME = 'sparqlkernel'
GITHUB_URL = 'https://github.com/paulovn/sparql-kernel'
setup_args = dict (
name=PKGNAME,
version=__version... | true | true |
f7532bc1477ba440f90704335a746ad779329719 | 4,452 | py | Python | IMDB-Clone-DRF-Cleaned-main/IMDB-Clone-DRF-Cleaned-main/watchlist_app/api/views.py | PacktPublishing/Build-REST-APIs-with-Django-REST-Framework-and-Python | 7cd16918b964746377baac31e138193ef0a17dc8 | [
"MIT"
] | 6 | 2021-08-04T06:10:03.000Z | 2022-03-18T03:00:39.000Z | IMDB-Clone-DRF-Cleaned-main/IMDB-Clone-DRF-Cleaned-main/watchlist_app/api/views.py | rizwandel/Build-REST-APIs-with-Django-REST-Framework-and-Python | 7cd16918b964746377baac31e138193ef0a17dc8 | [
"MIT"
] | 1 | 2022-02-22T03:30:50.000Z | 2022-03-09T14:33:00.000Z | IMDB-Clone-DRF-Cleaned-main/IMDB-Clone-DRF-Cleaned-main/watchlist_app/api/views.py | rizwandel/Build-REST-APIs-with-Django-REST-Framework-and-Python | 7cd16918b964746377baac31e138193ef0a17dc8 | [
"MIT"
] | 3 | 2021-06-14T15:23:19.000Z | 2021-12-20T18:50:21.000Z | from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, generics, status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
from rest_f... | 36.195122 | 92 | 0.729784 | from django.shortcuts import get_object_or_404
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters, generics, status, viewsets
from rest_framework.exceptions import ValidationError
from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly
from rest_f... | true | true |
f7532bdcc2bb714ad21fdc4ba7ce48e33a7bbfa1 | 12,114 | py | Python | sdk/cosmos/azure-cosmos/samples/nonpartitioned_collection_operations.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | sdk/cosmos/azure-cosmos/samples/nonpartitioned_collection_operations.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | sdk/cosmos/azure-cosmos/samples/nonpartitioned_collection_operations.py | lmcarreiro/azure-sdk-for-python | 0bde943383725320eaaa1408fa6264fb0cd0febf | [
"MIT"
] | null | null | null | #The MIT License (MIT)
#Copyright (c) 2018 Microsoft Corporation
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modi... | 39.588235 | 127 | 0.616229 |
import azure.cosmos.cosmos_client as cosmos_client
import azure.cosmos.errors as errors
import requests
import six
import json
import uuid
from six.moves.urllib.parse import quote as urllib_quote
import azure.cosmos.auth as auth
import azure.cosmos.partition_key as partition_key
import datetime
im... | true | true |
f7533038c3104e4c8a0cc2959d17f62b3298ed7e | 1,319 | py | Python | test/testSequence.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T19:22:17.000Z | 2021-05-26T19:22:17.000Z | test/testSequence.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | null | null | null | test/testSequence.py | turkeydonkey/nzmath3 | a48ae9efcf0d9ad1485c2e9863c948a7f1b20311 | [
"BSD-3-Clause"
] | null | null | null | import unittest
import nzmath.sequence as sequence
class SequenceTest(unittest.TestCase):
def testGeneratorFibonacci(self):
gf = sequence.generator_fibonacci(40)
fibo_40 = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610,
987, 1597, 2584, 4181, 6765, 10946, 17711, 28657,... | 38.794118 | 81 | 0.648218 | import unittest
import nzmath.sequence as sequence
class SequenceTest(unittest.TestCase):
def testGeneratorFibonacci(self):
gf = sequence.generator_fibonacci(40)
fibo_40 = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610,
987, 1597, 2584, 4181, 6765, 10946, 17711, 28657,... | true | true |
f753311a80b359f1830cdf5f04a2340a842c2b95 | 3,562 | py | Python | my_configs/cattle/resnet_50_15/tail_black.py | EricChan-OC/mmpose | b7f36b29eb077b69791675cce39dfcc23c658647 | [
"Apache-2.0"
] | null | null | null | my_configs/cattle/resnet_50_15/tail_black.py | EricChan-OC/mmpose | b7f36b29eb077b69791675cce39dfcc23c658647 | [
"Apache-2.0"
] | null | null | null | my_configs/cattle/resnet_50_15/tail_black.py | EricChan-OC/mmpose | b7f36b29eb077b69791675cce39dfcc23c658647 | [
"Apache-2.0"
] | null | null | null | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=210)
evaluation = dict(interval=5, metric='PCK', key_indicator='PCK')
COLOR = 'black'
EXTEND = '15'
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = ... | 27.19084 | 79 | 0.625772 | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=210)
evaluation = dict(interval=5, metric='PCK', key_indicator='PCK')
COLOR = 'black'
EXTEND = '15'
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = ... | true | true |
f75331ff0af91d6b888f2bd5c304dfee46c9e14f | 260 | py | Python | osccontroller/command_line_interface.py | gogo2/osc-controller | dadc2345dfb1858468c044048e73b11ce1552dbc | [
"MIT"
] | 1 | 2020-07-19T05:57:12.000Z | 2020-07-19T05:57:12.000Z | osccontroller/command_line_interface.py | gogo2/osc-controller | dadc2345dfb1858468c044048e73b11ce1552dbc | [
"MIT"
] | null | null | null | osccontroller/command_line_interface.py | gogo2/osc-controller | dadc2345dfb1858468c044048e73b11ce1552dbc | [
"MIT"
] | null | null | null | class CommandLineInterface:
def __init__(self):
self.commands = dict()
def loop(self):
while True:
command = ""
if command in self.commands.keys():
pass
def add_command(self):
pass
| 18.571429 | 47 | 0.523077 | class CommandLineInterface:
def __init__(self):
self.commands = dict()
def loop(self):
while True:
command = ""
if command in self.commands.keys():
pass
def add_command(self):
pass
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.