hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f711759e0907a6b1ed71c17303125fe06cbf6c66 | 26,496 | py | Python | EM_and_MD_answers_wc3.py | haddocking/MolMod-scripts | 604bdb05504c5b95a42e684b45b26f6306c856b9 | [
"Apache-2.0"
] | null | null | null | EM_and_MD_answers_wc3.py | haddocking/MolMod-scripts | 604bdb05504c5b95a42e684b45b26f6306c856b9 | [
"Apache-2.0"
] | null | null | null | EM_and_MD_answers_wc3.py | haddocking/MolMod-scripts | 604bdb05504c5b95a42e684b45b26f6306c856b9 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python
#############################################################
# Simple MD of Lennard Jones charged or uncharged particles #
# Alexandre Bonvin, Aalt Jan van Dijk, Utrecht University #
# Updated to a singular script with a modern look by Douwe #
# Schulte, Utrecht University (2022) ... | 34.012837 | 232 | 0.629265 |
from math import sqrt,log,sin,cos
from random import random,seed
from enum import Enum
from tkinter import Tk, Canvas, DoubleVar, StringVar
from tkinter.ttk import Label, Button, Style, Frame, Notebook, Entry
import sys
nAtoms = 20 Radius = 25.0 ... | true | true |
f71176f4acbc961020e19a3b62348580e1cc273d | 1,242 | py | Python | setup.py | parlarjb/github-cli | c5b4166976bbf94fc3f929cc369ce094bc02b88e | [
"BSD-3-Clause"
] | 2 | 2016-05-09T15:32:35.000Z | 2016-07-19T11:39:21.000Z | setup.py | parlarjb/github-cli | c5b4166976bbf94fc3f929cc369ce094bc02b88e | [
"BSD-3-Clause"
] | null | null | null | setup.py | parlarjb/github-cli | c5b4166976bbf94fc3f929cc369ce094bc02b88e | [
"BSD-3-Clause"
] | null | null | null | import os
from setuptools import setup, find_packages
version = '0.2.5.2'
description = "A command-line interface to the GitHub Issues API v2."
cur_dir = os.path.dirname(__file__)
try:
long_description = open(os.path.join(cur_dir, 'README.rst')).read()
except:
long_description = description
setup(
name =... | 28.883721 | 71 | 0.633655 | import os
from setuptools import setup, find_packages
version = '0.2.5.2'
description = "A command-line interface to the GitHub Issues API v2."
cur_dir = os.path.dirname(__file__)
try:
long_description = open(os.path.join(cur_dir, 'README.rst')).read()
except:
long_description = description
setup(
name =... | true | true |
f711771424da5145f12842b6f940f779e986d6f7 | 385 | py | Python | customer/migrations/0002_ordermodel_is_shipped.py | rishav142k/deliver-app | 89905c7341fdf17d124aec5042e2ff90ddd455e8 | [
"Unlicense",
"MIT"
] | null | null | null | customer/migrations/0002_ordermodel_is_shipped.py | rishav142k/deliver-app | 89905c7341fdf17d124aec5042e2ff90ddd455e8 | [
"Unlicense",
"MIT"
] | null | null | null | customer/migrations/0002_ordermodel_is_shipped.py | rishav142k/deliver-app | 89905c7341fdf17d124aec5042e2ff90ddd455e8 | [
"Unlicense",
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-04 04:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ordermodel',
name='is_shipped',
... | 20.263158 | 53 | 0.597403 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ordermodel',
name='is_shipped',
field=models.BooleanField(default=False),
... | true | true |
f711775130951f9f56a2eb5a79b1c5e85a13ea77 | 2,614 | py | Python | var/spack/repos/builtin/packages/dftfe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/dftfe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/dftfe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 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 Dftfe(CMakePackage):
"""Real-space DFT calculations using Finite Elements"""
homepage ... | 39.606061 | 123 | 0.65417 | from spack import *
class Dftfe(CMakePackage):
homepage = "https://sites.google.com/umich.edu/dftfe/"
url = "https://github.com/dftfeDevelopers/dftfe/archive/0.5.1.tar.gz"
maintainers = ['rmsds']
version('0.6.0', sha256='66b633a3aae2f557f241ee45b2faa41aa179e4a0bdf39c4ae2e679a2970845a1')
ve... | true | true |
f711776a4a7594038ad3c1faeaa5d5f87f7da312 | 5,910 | py | Python | oc-dvbobjects/DVB/DataCarousel.py | hyungkyulee/dvbts-hbbtv | 1f2f0a9b248fce99144400fe3b8ec3486a119050 | [
"BSD-3-Clause"
] | 4 | 2020-05-09T10:03:03.000Z | 2021-09-27T09:17:54.000Z | opencaster/libs/dvbobjects/dvbobjects/DVB/DataCarousel.py | hyungkyulee/dvbts-hbbtv | 1f2f0a9b248fce99144400fe3b8ec3486a119050 | [
"BSD-3-Clause"
] | 1 | 2017-12-14T23:03:55.000Z | 2017-12-14T23:03:55.000Z | opencaster/libs/dvbobjects/dvbobjects/DVB/DataCarousel.py | hyungkyulee/dvbts-hbbtv | 1f2f0a9b248fce99144400fe3b8ec3486a119050 | [
"BSD-3-Clause"
] | 2 | 2017-12-14T22:24:31.000Z | 2021-02-26T14:54:59.000Z | #! /usr/bin/env python
# This file is part of the dvbobjects library.
#
# Copyright 2000-2001, GMD, Sankt Augustin
# -- German National Research Center for Information Technology
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | 33.579545 | 78 | 0.573942 |
import os
import string
from dvbobjects.utils import *
from dvbobjects.DSMCC.Message import *
import dvbobjects.DSMCC.BIOP
from Loops import *
class SuperGroup(DownloadServerInitiate):
def __init__(self, PATH, transactionId, version):
self.groups = []
self.PATH = PATH
self.transactionId = transactionI... | false | true |
f71177de257d0e69f4e091f7b908830363392ce1 | 1,170 | py | Python | label_loader.py | fd873630/las_for_korean_bigginer | fa2a6fbbcaecb01bc649596699617afe4fd1f48d | [
"Apache-2.0"
] | null | null | null | label_loader.py | fd873630/las_for_korean_bigginer | fa2a6fbbcaecb01bc649596699617afe4fd1f48d | [
"Apache-2.0"
] | null | null | null | label_loader.py | fd873630/las_for_korean_bigginer | fa2a6fbbcaecb01bc649596699617afe4fd1f48d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019-present NAVER Corp.
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 wr... | 32.5 | 78 | 0.619658 |
def load_label(label_path):
char2index = dict() index2char = dict() with open(label_path, 'r') as f: for no, line in enumerate(f):
if line[0] == '#':
continue
index, char, freq = line.strip().split('\t')
char = char.strip()
... | true | true |
f71178e955fe419d4b14918267313415cc8e3184 | 1,111 | py | Python | tests/template_tests/test_origin.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/template_tests/test_origin.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/template_tests/test_origin.py | mustafa0x/django | d7394cfa13a4d1a02356e3a83e10ec100fbb9948 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | import os
from unittest import TestCase
from django.template import Engine
from .utils import TEMPLATE_DIR
class OriginTestCase(TestCase):
def setUp(self):
self.engine = Engine(dirs=[TEMPLATE_DIR])
def test_origin_compares_equal(self):
a = self.engine.get_template('index.html')
b = ... | 33.666667 | 67 | 0.660666 | import os
from unittest import TestCase
from django.template import Engine
from .utils import TEMPLATE_DIR
class OriginTestCase(TestCase):
def setUp(self):
self.engine = Engine(dirs=[TEMPLATE_DIR])
def test_origin_compares_equal(self):
a = self.engine.get_template('index.html')
b = ... | true | true |
f711796f876d51ba27773e6025a60538502c0b87 | 325 | py | Python | stage_0_Maurya.py | kristahbel/team-greider | 7d44039d2b2c9abf63d0781cf0eb0b07b5b0ae15 | [
"MIT"
] | 9 | 2021-08-01T20:26:55.000Z | 2021-08-07T11:32:25.000Z | stage_0_Maurya.py | kristahbel/team-greider | 7d44039d2b2c9abf63d0781cf0eb0b07b5b0ae15 | [
"MIT"
] | 2 | 2021-08-02T09:08:09.000Z | 2021-08-03T21:10:24.000Z | stage_0_Maurya.py | kristahbel/team-greider | 7d44039d2b2c9abf63d0781cf0eb0b07b5b0ae15 | [
"MIT"
] | 16 | 2021-08-01T19:41:45.000Z | 2021-08-06T09:26:15.000Z | print("NAME: Maurya Sharma \nE-MAIL: mauryasharma2001@gmail.com \nSLACK USERNAME: @Maurya \nBIOSTACK: Drug Development \nTwitter Handle: @Maurya")
def hamming_distance(a,b):
count=0
for i in range(len(a)):
if a[i] != b[i]:
count +=1
return count
print(hamming_distance('@Maurya','@Maurya... | 29.545455 | 146 | 0.655385 | print("NAME: Maurya Sharma \nE-MAIL: mauryasharma2001@gmail.com \nSLACK USERNAME: @Maurya \nBIOSTACK: Drug Development \nTwitter Handle: @Maurya")
def hamming_distance(a,b):
count=0
for i in range(len(a)):
if a[i] != b[i]:
count +=1
return count
print(hamming_distance('@Maurya','@Maurya... | true | true |
f71179d38880b8bc4de2699f0c56637b7ad4d1ca | 7,757 | py | Python | frappe/core/doctype/report/report.py | linkmultiselect/frappe | 0871db97f6aa9738e6aff169ad2b9853980b0653 | [
"MIT"
] | null | null | null | frappe/core/doctype/report/report.py | linkmultiselect/frappe | 0871db97f6aa9738e6aff169ad2b9853980b0653 | [
"MIT"
] | 5 | 2020-03-24T18:15:00.000Z | 2021-03-25T23:28:34.000Z | frappe/core/doctype/report/report.py | linkmultiselect/frappe | 0871db97f6aa9738e6aff169ad2b9853980b0653 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json, datetime
from frappe import _, scrub
import frappe.desk.query_report
from frappe.utils import cint
from frappe.model.document import Document
from frapp... | 30.904382 | 107 | 0.695114 |
from __future__ import unicode_literals
import frappe
import json, datetime
from frappe import _, scrub
import frappe.desk.query_report
from frappe.utils import cint
from frappe.model.document import Document
from frappe.modules.export_file import export_to_files
from frappe.modules import make_boilerplate
from frappe... | true | true |
f7117ab7e8d3065cd1ef2a5ccec476a5acced2e5 | 2,940 | py | Python | third_party/maya/lib/usdMaya/testenv/testUsdMayaBlockSceneModificationContext.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | 3 | 2019-02-20T07:34:17.000Z | 2019-08-13T08:17:04.000Z | third_party/maya/lib/usdMaya/testenv/testUsdMayaBlockSceneModificationContext.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | null | null | null | third_party/maya/lib/usdMaya/testenv/testUsdMayaBlockSceneModificationContext.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | null | null | null | #!/pxrpythonsubst
#
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 31.956522 | 78 | 0.709864 |
import unittest
try:
from pxr import UsdMaya
except ImportError:
from pixar import UsdMaya
from maya import cmds
from maya import standalone
class testUsdMayaBlockSceneModificationContext(unittest.TestCase):
@classmethod
def setUpClass(cls):
standalone.initialize('usd')
@classmethod
... | true | true |
f7117b559401200e7a843fee1491e12e035b59b3 | 5,643 | py | Python | tests/python/relay/test_op_qnn_subtract.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/relay/test_op_qnn_subtract.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | tests/python/relay/test_op_qnn_subtract.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.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 u... | 34.619632 | 97 | 0.605352 |
import tvm
import numpy as np
from tvm import relay
def qnn_subtract_driver(x_datas, y_datas, golden_outputs, scale_and_zp, data_dtype="uint8"):
assert len(x_datas) == len(y_datas)
assert len(y_datas) == len(golden_outputs)
x = relay.var("x", shape=(1, 4), dtype=data_dtype)
y = relay.var("y", sh... | true | true |
f7117b7fbebe9c690c58224ea3729a3b15dcc160 | 2,501 | py | Python | generate_thumbnails.py | AdamHawtin/bucket-thumbnail-generator | db42e0dca709156513b47f17cd540fb68c1dfe0e | [
"MIT"
] | null | null | null | generate_thumbnails.py | AdamHawtin/bucket-thumbnail-generator | db42e0dca709156513b47f17cd540fb68c1dfe0e | [
"MIT"
] | 6 | 2021-04-30T20:51:43.000Z | 2022-03-11T23:54:26.000Z | generate_thumbnails.py | AdamHawtin/bucket-thumbnail-generator | db42e0dca709156513b47f17cd540fb68c1dfe0e | [
"MIT"
] | null | null | null | import os
import tempfile
from pathlib import Path
from PIL import Image
from google.cloud import storage
from retrying import retry
THUMBNAIL_SIZE = int(os.getenv('THUMBNAIL_SIZE', '128'))
THUMBNAIL_MAX_DIM = THUMBNAIL_SIZE, THUMBNAIL_SIZE
THUMBNAIL_SUFFIX = f'_thumb{THUMBNAIL_SIZE}'
SUPPORTED_FILE_EXTENSIONS = {'jp... | 38.476923 | 110 | 0.745702 | import os
import tempfile
from pathlib import Path
from PIL import Image
from google.cloud import storage
from retrying import retry
THUMBNAIL_SIZE = int(os.getenv('THUMBNAIL_SIZE', '128'))
THUMBNAIL_MAX_DIM = THUMBNAIL_SIZE, THUMBNAIL_SIZE
THUMBNAIL_SUFFIX = f'_thumb{THUMBNAIL_SIZE}'
SUPPORTED_FILE_EXTENSIONS = {'jp... | true | true |
f7117ca57b1ebd5861c109a4273cbe7837519188 | 22,933 | py | Python | libcxx/utils/libcxx/test/config.py | val-verde/llvm-project | a5d4e884dad341ff80fbbdec6e7516b9c58c9eb0 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/config.py | val-verde/llvm-project | a5d4e884dad341ff80fbbdec6e7516b9c58c9eb0 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/config.py | val-verde/llvm-project | a5d4e884dad341ff80fbbdec6e7516b9c58c9eb0 | [
"Apache-2.0"
] | null | null | null | #===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------... | 46.706721 | 106 | 0.608032 |
import copy
import os
import pkgutil
import pipes
import platform
import re
import shlex
import shutil
import sys
from libcxx.compiler import CXXCompiler
from libcxx.test.target_info import make_target_info
import libcxx.util
import libcxx.test.features
import libcxx.test.newconfig
import libcxx.test.params
import li... | true | true |
f7117d2b4d5ff936d18079dc6cda0605b3a809a0 | 2,778 | py | Python | aodh/event.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | aodh/event.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | aodh/event.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 NEC Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 34.725 | 76 | 0.677826 |
from oslo_config import cfg
from oslo_log import log
import oslo_messaging
from oslo_service import service
from aodh.evaluator import event
from aodh import messaging
from aodh import storage
LOG = log.getLogger(__name__)
OPTS = [
cfg.StrOpt('event_alarm_topic',
default='alarm.all',
... | true | true |
f7117d745cb7ceac2a3526e0c33d5632064d579a | 14,533 | py | Python | seekr2/tests/test_analyze.py | astokely/seekr2 | 2fd8496dc885339437678a729b1f97a4b0bf9cfd | [
"MIT"
] | null | null | null | seekr2/tests/test_analyze.py | astokely/seekr2 | 2fd8496dc885339437678a729b1f97a4b0bf9cfd | [
"MIT"
] | null | null | null | seekr2/tests/test_analyze.py | astokely/seekr2 | 2fd8496dc885339437678a729b1f97a4b0bf9cfd | [
"MIT"
] | null | null | null | """
test_analyze.py
Testing analyze.py
"""
import os
from collections import defaultdict
import numpy as np
import seekr2.modules.common_analyze as common_analyze
import seekr2.modules.mmvt_analyze as mmvt_analyze
import seekr2.analyze as analyze
import seekr2.modules.common_base as base
import seekr2.modules.mmvt_... | 38.651596 | 106 | 0.616321 |
import os
from collections import defaultdict
import numpy as np
import seekr2.modules.common_analyze as common_analyze
import seekr2.modules.mmvt_analyze as mmvt_analyze
import seekr2.analyze as analyze
import seekr2.modules.common_base as base
import seekr2.modules.mmvt_base as mmvt_base
import seekr2.tests.smoluc... | true | true |
f7117e9d65d3037430dcb359a8dce4e7f2d80980 | 2,577 | py | Python | oamap/backend/numpyfile.py | Jayd-1234/oamap | b10ddab18ca2bf71171c5489c1b748a60ec962fb | [
"BSD-3-Clause"
] | null | null | null | oamap/backend/numpyfile.py | Jayd-1234/oamap | b10ddab18ca2bf71171c5489c1b748a60ec962fb | [
"BSD-3-Clause"
] | null | null | null | oamap/backend/numpyfile.py | Jayd-1234/oamap | b10ddab18ca2bf71171c5489c1b748a60ec962fb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017, DIANA-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list ... | 42.95 | 130 | 0.756306 |
import os
import numpy
import oamap.dataset
import oamap.database
class NumpyFileBackend(oamap.database.FilesystemBackend):
def __init__(self, directory):
super(NumpyFileBackend, self).__init__(directory, arraysuffix=".npy")
def instantiate(self, partitionid):
return NumpyArrays(lambda nam... | true | true |
f7117f6c404b1da6555aeeae0b08a7f9be81f25d | 89,437 | py | Python | intersight/model/softwarerepository_file_server.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/softwarerepository_file_server.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/softwarerepository_file_server.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 65.377924 | 1,678 | 0.677617 |
import re import sys
from intersight.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_... | true | true |
f71180058b96632b2f3dd3308a51630c15ace975 | 1,638 | bzl | Python | test/haxe_executable_dependency.bzl | kigero/rules_haxe | 1cee9a6ccf4c26656c5b7d1fb2d56f2fa9c01fa1 | [
"MIT"
] | null | null | null | test/haxe_executable_dependency.bzl | kigero/rules_haxe | 1cee9a6ccf4c26656c5b7d1fb2d56f2fa9c01fa1 | [
"MIT"
] | null | null | null | test/haxe_executable_dependency.bzl | kigero/rules_haxe | 1cee9a6ccf4c26656c5b7d1fb2d56f2fa9c01fa1 | [
"MIT"
] | null | null | null | """
Test that the build parameters for external modules with dependencies are computed correctly.
"""
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("//:providers.bzl", "HaxeLibraryInfo")
load("//:utils.bzl", "determine_source_root")
def _haxe_executable_dependency_test_impl(ctx):
... | 46.8 | 158 | 0.738706 |
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("//:providers.bzl", "HaxeLibraryInfo")
load("//:utils.bzl", "determine_source_root")
def _haxe_executable_dependency_test_impl(ctx):
env = analysistest.begin(ctx)
target_under_test = analysistest.target_under_test(env)
hxm... | true | true |
f711809cde8a0a5d600e12a758e6baa43a035a9b | 3,957 | py | Python | whalesong/managers/group_metadata.py | gladimaz/whalesong | dab496498d188b3f7b4d5d67ef1c0e2a46cce535 | [
"MIT"
] | 57 | 2018-06-20T12:37:58.000Z | 2021-08-14T14:32:26.000Z | whalesong/managers/group_metadata.py | gladimaz/whalesong | dab496498d188b3f7b4d5d67ef1c0e2a46cce535 | [
"MIT"
] | 91 | 2018-06-21T02:04:29.000Z | 2020-04-12T20:16:04.000Z | whalesong/managers/group_metadata.py | gladimaz/whalesong | dab496498d188b3f7b4d5d67ef1c0e2a46cce535 | [
"MIT"
] | 24 | 2018-07-02T08:31:52.000Z | 2020-05-19T01:36:18.000Z | from typing import List
from dirty_models import ArrayField, BooleanField, ModelField, StringField, StringIdField
from . import BaseCollectionManager, BaseModelManager
from ..models import BaseModel, DateTimeField
from ..results import Result
class Participant(BaseModel):
is_admin = BooleanField(default=False)
... | 26.736486 | 92 | 0.686631 | from typing import List
from dirty_models import ArrayField, BooleanField, ModelField, StringField, StringIdField
from . import BaseCollectionManager, BaseModelManager
from ..models import BaseModel, DateTimeField
from ..results import Result
class Participant(BaseModel):
is_admin = BooleanField(default=False)
... | true | true |
f711810d38d36cd3f0be40e84032878757f70e0d | 2,288 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/queueproperty.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/queueproperty.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/queueproperty.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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, modify, merge, p... | 37.508197 | 128 | 0.753934 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class QueueProperty(Base):
"""The QueueProperty class encapsulates a required queueProperty node in the ixnetwork hierarchy.
An instance of the class can be obtained by accessing the QueueProperty property from a parent ... | false | true |
f71181212ea961615fd991f19319e4e5222e52f0 | 5,905 | py | Python | skan/pipe.py | marlene09/skan | 4e84ff8ac83e912c9cf4a44b8274c3a5699027ad | [
"BSD-3-Clause"
] | 1 | 2021-02-08T04:45:38.000Z | 2021-02-08T04:45:38.000Z | skan/pipe.py | mkcor/skan | 97a217d36ec1393b380d4a797b5b7ceb68e824ec | [
"BSD-3-Clause"
] | null | null | null | skan/pipe.py | mkcor/skan | 97a217d36ec1393b380d4a797b5b7ceb68e824ec | [
"BSD-3-Clause"
] | null | null | null | import os
from . import pre, csr
import imageio
from tqdm import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
from .image_stats import image_summary
from skimage.feature import shape_index
from concurrent.futures import ThreadPoolExecutor, as_completed
import multiprocessing as mp
CPU_CO... | 41.584507 | 79 | 0.631499 | import os
from . import pre, csr
import imageio
from tqdm import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
from .image_stats import image_summary
from skimage.feature import shape_index
from concurrent.futures import ThreadPoolExecutor, as_completed
import multiprocessing as mp
CPU_CO... | true | true |
f71182b41ff8b9e2fa8dbc7fefb26861fff4e5a3 | 6,095 | py | Python | consolidate_sources.py | alxcord/my_public_scripts | 856decd73afe869b68095d5ab21d32ea261d872f | [
"Apache-2.0"
] | null | null | null | consolidate_sources.py | alxcord/my_public_scripts | 856decd73afe869b68095d5ab21d32ea261d872f | [
"Apache-2.0"
] | null | null | null | consolidate_sources.py | alxcord/my_public_scripts | 856decd73afe869b68095d5ab21d32ea261d872f | [
"Apache-2.0"
] | null | null | null |
"""
consolidate_sources.py
Consolida visão dos vários documentos de descrição de relatorios em um unico grupo de arquivos
Mais fácil de ler por uma ferramenta de BI.
Esse script resolve um monte de problemas
Por Alex Cordeiro
"""
import pandas as pd, os
print('Entre com o diretório origem:')
source_path = input... | 50.791667 | 116 | 0.515997 |
"""
consolidate_sources.py
Consolida visão dos vários documentos de descrição de relatorios em um unico grupo de arquivos
Mais fácil de ler por uma ferramenta de BI.
Esse script resolve um monte de problemas
Por Alex Cordeiro
"""
import pandas as pd, os
print('Entre com o diretório origem:')
source_path = input... | false | true |
f71183a31b57d8e8d37c461a4adb535c2b4581ed | 931 | py | Python | backend/public_info/migrations/0001_initial.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/public_info/migrations/0001_initial.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/public_info/migrations/0001_initial.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-05-29 18:22
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove... | 31.033333 | 128 | 0.627282 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.Create... | true | true |
f71183b5bb67d22693deef525c7d46aca9642f09 | 41,533 | py | Python | src/uvm/base/uvm_object.py | mgielda/uvm-python | 7750bc163130f59741e464bb5fcf8fb5324dbf56 | [
"Apache-2.0"
] | null | null | null | src/uvm/base/uvm_object.py | mgielda/uvm-python | 7750bc163130f59741e464bb5fcf8fb5324dbf56 | [
"Apache-2.0"
] | null | null | null | src/uvm/base/uvm_object.py | mgielda/uvm-python | 7750bc163130f59741e464bb5fcf8fb5324dbf56 | [
"Apache-2.0"
] | null | null | null | #
#-----------------------------------------------------------------------------
# Copyright 2007-2011 Mentor Graphics Corporation
# Copyright 2007-2011 Cadence Design Systems, Inc.
# Copyright 2010 Synopsys, Inc.
# Copyright 2013 NVIDIA Corporation
# Copyright 2019-2020 Tuomas Poikela (tpoikela)
# All Righ... | 38.815888 | 109 | 0.618905 |
from typing import Dict, Any
from .sv import sv, sv_obj
from .uvm_misc import UVMStatusContainer
from .uvm_object_globals import (UVM_PRINT, UVM_NONE, UVM_COPY, UVM_COMPARE,
UVM_RECORD, UVM_SETINT, UVM_SETOBJ, UVM_SETSTR, UVM_PACK, UVM_UNPACK)
from .uvm_globals import uvm_report_error, uvm_report_warning, uvm... | true | true |
f71184809c1d37c6cf6003cf5cf482e0e2c00413 | 851 | py | Python | api/source/actions/report.py | 1pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | 1 | 2019-12-17T10:31:48.000Z | 2019-12-17T10:31:48.000Z | api/source/actions/report.py | c-pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | null | null | null | api/source/actions/report.py | c-pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | 1 | 2019-04-29T08:19:36.000Z | 2019-04-29T08:19:36.000Z | from errors import Request
from .mixins import Identify
class Report(Identify):
def _validate(self, request):
super()._validate(request)
validator = self._application.validator
self.__message = self._get(request, 'message', '').strip()
if validator.isempty(self.__message):
... | 29.344828 | 66 | 0.599295 | from errors import Request
from .mixins import Identify
class Report(Identify):
def _validate(self, request):
super()._validate(request)
validator = self._application.validator
self.__message = self._get(request, 'message', '').strip()
if validator.isempty(self.__message):
... | true | true |
f71184decb3ccbf135e84e58d21e4b1a23058855 | 2,750 | py | Python | Canvas Announcement to Telegram bot/main.py | VoluSign/CanvasToTelegramBot | ce009616b0e59928705d216bb60ba38960a8121a | [
"MIT"
] | null | null | null | Canvas Announcement to Telegram bot/main.py | VoluSign/CanvasToTelegramBot | ce009616b0e59928705d216bb60ba38960a8121a | [
"MIT"
] | null | null | null | Canvas Announcement to Telegram bot/main.py | VoluSign/CanvasToTelegramBot | ce009616b0e59928705d216bb60ba38960a8121a | [
"MIT"
] | null | null | null | #install canvasapi, pyTelegramBotAPI
# Imports
import sys, os
import canvasapi
import telebot
from html.parser import HTMLParser
from canvasapi import Canvas, discussion_topic
#----# CANVAS #----#
#Class handles html to ascii conversion
class HTMLFilter(HTMLParser):
text = ""
def handle_data(se... | 26.442308 | 215 | 0.697091 |
import sys, os
import canvasapi
import telebot
from html.parser import HTMLParser
from canvasapi import Canvas, discussion_topic
class HTMLFilter(HTMLParser):
text = ""
def handle_data(self, postContent):
self.text += postContent
new = False
API_URL = "!CANVAS BASE URL!"
API_KEY = "... | true | true |
f71185711cb0e985705a4aeadd7aec248ed1e378 | 1,208 | py | Python | tests/integration/bulkexports/v1/test_export.py | ashish-s/twilio-python | 5462b05af0906a1464b1e95a56a1f15afddc3b8c | [
"MIT"
] | 1 | 2020-10-29T19:28:25.000Z | 2020-10-29T19:28:25.000Z | tests/integration/bulkexports/v1/test_export.py | CostantiniMatteo/twilio-python | 9eee1ca9e73790b12678e9a5660206ea44948d00 | [
"MIT"
] | 1 | 2020-08-25T15:27:57.000Z | 2020-08-25T15:27:57.000Z | tests/integration/bulkexports/v1/test_export.py | team-telnyx/twexit-python | 69e11c5c2b5681f9bc410795dda0cf8942219e6f | [
"MIT"
] | null | null | null | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ExportTestCase(Integratio... | 26.844444 | 82 | 0.575331 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ExportTestCase(IntegrationTestCase):
def test_fetch_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRa... | true | true |
f7118586b9feaedeb8d333db83568c6708557252 | 2,356 | py | Python | oidc_server/app/models.py | didx-xyz/aries-accpy-oidc | 63a91a58861383c38a43bca0aab0e0e837596a98 | [
"Apache-2.0"
] | null | null | null | oidc_server/app/models.py | didx-xyz/aries-accpy-oidc | 63a91a58861383c38a43bca0aab0e0e837596a98 | [
"Apache-2.0"
] | null | null | null | oidc_server/app/models.py | didx-xyz/aries-accpy-oidc | 63a91a58861383c38a43bca0aab0e0e837596a98 | [
"Apache-2.0"
] | null | null | null | '''OIDC server example'''
# import datetime
from sqlalchemy import Column, Integer, String
from sqlalchemy.dialects.sqlite import JSON
# from authlib.integrations.sqla_oauth2 import (
# OAuth2ClientMixin,
# OAuth2TokenMixin,
# OAuth2AuthorizationCodeMixin
# )
from database import Base
from utils import disa... | 32.722222 | 111 | 0.667233 | from sqlalchemy import Column, Integer, String
from sqlalchemy.dialects.sqlite import JSON
from database import Base
from utils import disambiguate_referent
import uuid
class User(Base):
__tablename__ = "user"
id = Column(Integer, primary_key=True)
uuid = Column(String(100), unique=True)
def get... | true | true |
f7118591d151dce6e3fd6f3d413d3c52d74ea81f | 440 | py | Python | examples/send.py | apistd/uni-python-sdk | e0607cfce86bea696896864a55f157d69ec532a2 | [
"MIT"
] | null | null | null | examples/send.py | apistd/uni-python-sdk | e0607cfce86bea696896864a55f157d69ec532a2 | [
"MIT"
] | null | null | null | examples/send.py | apistd/uni-python-sdk | e0607cfce86bea696896864a55f157d69ec532a2 | [
"MIT"
] | null | null | null | from unisdk.sms import UniSMS
from unisdk.exception import UniException
def example():
client = UniSMS("your access key id", "your access key secret")
try:
res = client.send({
"to": "your phone number",
"signature": "UniSMS",
"templateId": "login_tmpl",
"templateData": {
"code"... | 20 | 65 | 0.604545 | from unisdk.sms import UniSMS
from unisdk.exception import UniException
def example():
client = UniSMS("your access key id", "your access key secret")
try:
res = client.send({
"to": "your phone number",
"signature": "UniSMS",
"templateId": "login_tmpl",
"templateData": {
"code"... | true | true |
f7118593cd8a341fc9d5b082a83299a32ae61b18 | 1,666 | py | Python | setup.py | rafiibrahim8/truewho | 59323414ec196964bcb69364b942b0e11a26b592 | [
"MIT"
] | 1 | 2021-05-24T15:37:36.000Z | 2021-05-24T15:37:36.000Z | setup.py | rafiibrahim8/truewho | 59323414ec196964bcb69364b942b0e11a26b592 | [
"MIT"
] | 2 | 2021-08-17T16:22:24.000Z | 2022-02-08T20:40:55.000Z | setup.py | rafiibrahim8/truewho | 59323414ec196964bcb69364b942b0e11a26b592 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from truewho import __version__
def read_file(filename, lines=False):
try:
with open(filename, "r") as f:
if lines:
return [i.strip() for i in f.readlines() if (i.strip())]
return f.read()
except:
print("Can no... | 33.32 | 85 | 0.62485 | from setuptools import setup, find_packages
from truewho import __version__
def read_file(filename, lines=False):
try:
with open(filename, "r") as f:
if lines:
return [i.strip() for i in f.readlines() if (i.strip())]
return f.read()
except:
print("Can no... | true | true |
f71185ef3a091033b981050e0faaa74cbc6fd8c3 | 1,244 | py | Python | airflow/contrib/operators/bigquery_to_bigquery.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | airflow/contrib/operators/bigquery_to_bigquery.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 1 | 2019-05-14T14:32:40.000Z | 2019-05-14T14:32:40.000Z | airflow/contrib/operators/bigquery_to_bigquery.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 41.466667 | 109 | 0.777331 |
import warnings
from airflow.providers.google.cloud.operators.bigquery_to_bigquery import BigQueryToBigQueryOperator
warnings.warn(
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.bigquery_to_bigquery`.",
DeprecationWarning, stacklevel=2
)
| true | true |
f71186d761ae034d147180c445dbdb503ea95a8a | 270 | py | Python | messaging_abstract/protocol/protocol.py | fgiorgetti/qpid-dispatch-tests | 164c609d28db87692eed53d5361aa1ee5c97375c | [
"Apache-2.0"
] | null | null | null | messaging_abstract/protocol/protocol.py | fgiorgetti/qpid-dispatch-tests | 164c609d28db87692eed53d5361aa1ee5c97375c | [
"Apache-2.0"
] | 9 | 2018-09-25T10:10:58.000Z | 2019-03-19T14:59:43.000Z | messaging_abstract/protocol/protocol.py | fgiorgetti/qpid-dispatch-tests | 164c609d28db87692eed53d5361aa1ee5c97375c | [
"Apache-2.0"
] | 1 | 2019-03-13T10:40:35.000Z | 2019-03-13T10:40:35.000Z | class Protocol:
""" Protocol abstraction"""
def __init__(self, transaction, transport, default_port=None):
self.name = type(self).__name__
self.default_port = default_port
self.transaction = transaction
self.transport = transport
| 33.75 | 66 | 0.677778 | class Protocol:
def __init__(self, transaction, transport, default_port=None):
self.name = type(self).__name__
self.default_port = default_port
self.transaction = transaction
self.transport = transport
| true | true |
f71186fae75d95345162e3986a1e82e564e2b9b9 | 55,150 | py | Python | openprocurement/tender/openuadefense/tests/bid.py | Leits/openprocurement.tender.openuadefense | e7c512ed21166ae1928950bce80a11106fa2e545 | [
"Apache-2.0"
] | null | null | null | openprocurement/tender/openuadefense/tests/bid.py | Leits/openprocurement.tender.openuadefense | e7c512ed21166ae1928950bce80a11106fa2e545 | [
"Apache-2.0"
] | 2 | 2021-03-26T00:34:56.000Z | 2022-03-21T22:20:41.000Z | openprocurement/tender/openuadefense/tests/bid.py | leits/openprocurement.tender.openuadefense | e7c512ed21166ae1928950bce80a11106fa2e545 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from copy import deepcopy
from openprocurement.api.tests.base import test_organization
from openprocurement.tender.openua.tests.base import test_bids
from openprocurement.tender.openuadefense.tests.base import (
BaseTenderUAContentWebTest,
test_tender_data,
test_feat... | 54.38856 | 300 | 0.621958 | import unittest
from copy import deepcopy
from openprocurement.api.tests.base import test_organization
from openprocurement.tender.openua.tests.base import test_bids
from openprocurement.tender.openuadefense.tests.base import (
BaseTenderUAContentWebTest,
test_tender_data,
test_features_tender_ua_data)
c... | true | true |
f711872787c8b74e9d0ed508cf7608719b9ca9e6 | 578 | py | Python | simsoexp/migrations/0007_schedulingpolicy_contributor.py | Scriptopathe/simso-exp | d618463272f42a1ca3345ff162b7a9f1a6fab3f8 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | simsoexp/migrations/0007_schedulingpolicy_contributor.py | Scriptopathe/simso-exp | d618463272f42a1ca3345ff162b7a9f1a6fab3f8 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2015-07-31T15:00:21.000Z | 2015-07-31T15:09:37.000Z | simsoexp/migrations/0007_schedulingpolicy_contributor.py | Scriptopathe/simso-exp | d618463272f42a1ca3345ff162b7a9f1a6fab3f8 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('simsoexp', '0006_auto_20150721_1432'),
... | 25.130435 | 76 | 0.65917 | from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('simsoexp', '0006_auto_20150721_1432'),
]
operations = [
... | true | true |
f71187924dd29115494236387e90989c2fbe1e27 | 15,473 | py | Python | tests/integration/test_install_basic.py | jrottenberg/pipenv | cda15b3b30e04e038ee286bced6c47a311f1e0ec | [
"MIT"
] | 6,263 | 2017-01-20T17:41:36.000Z | 2022-02-15T20:48:57.000Z | tests/integration/test_install_basic.py | jrottenberg/pipenv | cda15b3b30e04e038ee286bced6c47a311f1e0ec | [
"MIT"
] | 1,100 | 2017-01-20T19:41:52.000Z | 2017-12-06T09:15:13.000Z | tests/integration/test_install_basic.py | jrottenberg/pipenv | cda15b3b30e04e038ee286bced6c47a311f1e0ec | [
"MIT"
] | 366 | 2017-01-21T10:06:52.000Z | 2021-11-25T17:09:19.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
import pytest
from flaky import flaky
from pipenv._compat import Path, TemporaryDirectory
from pipenv.utils import temp_environ
from pipenv.vendor import delegator
@pytest.mark.setup
@pytest.mark.basic
@pytest.mark.install
def... | 31.195565 | 95 | 0.625541 | from __future__ import absolute_import, print_function
import os
import pytest
from flaky import flaky
from pipenv._compat import Path, TemporaryDirectory
from pipenv.utils import temp_environ
from pipenv.vendor import delegator
@pytest.mark.setup
@pytest.mark.basic
@pytest.mark.install
def test_basic_setup(Pipenv... | true | true |
f71187b2306a598f985c5bc1f8ab04fb06221b75 | 4,764 | py | Python | docs/conf.py | aadu/cake | 4831ebea425a7c0414020702415b793e489e024e | [
"MIT"
] | null | null | null | docs/conf.py | aadu/cake | 4831ebea425a7c0414020702415b793e489e024e | [
"MIT"
] | 5 | 2020-03-24T16:25:11.000Z | 2021-06-01T22:51:29.000Z | docs/conf.py | aadu/cake | 4831ebea425a7c0414020702415b793e489e024e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# cake documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# 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
# autoge... | 29.04878 | 77 | 0.680101 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import cake
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'cake'
copyright = u"2018, Aaron Duke"
author = u"Aaron Duke"
# for |version| and |releas... | true | true |
f7118823a87b93a43872741884cd7efddc1ccb73 | 13,516 | py | Python | test/functional/rpc_scantxoutset.py | BitPalnet/BitPal | 0cce7aea31a2e45fecec0e2ef42728aa26355704 | [
"MIT"
] | 1 | 2021-03-09T22:25:20.000Z | 2021-03-09T22:25:20.000Z | test/functional/rpc_scantxoutset.py | BitPalnet/BitPal | 0cce7aea31a2e45fecec0e2ef42728aa26355704 | [
"MIT"
] | null | null | null | test/functional/rpc_scantxoutset.py | BitPalnet/BitPal | 0cce7aea31a2e45fecec0e2ef42728aa26355704 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The BitPal Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the scantxoutset rpc call."""
from test_framework.test_framework import BitPalTestFramework
from te... | 105.59375 | 531 | 0.73831 | from test_framework.test_framework import BitPalTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error
from decimal import Decimal
import shutil
import os
def descriptors(out):
return sorted(u['desc'] for u in out['unspents'])
class ScantxoutsetTest(BitPalTestFramework):
def set_... | true | true |
f711891408202ec5e37aa87f924bca39e8995574 | 5,611 | py | Python | reproject/utils.py | astropy/reproject | 43b0d8a4a5641cfbe6adbc3b1f2d7598f2fd5930 | [
"BSD-3-Clause"
] | 39 | 2019-05-11T19:23:33.000Z | 2022-02-28T12:25:37.000Z | reproject/utils.py | astropy/reproject | 43b0d8a4a5641cfbe6adbc3b1f2d7598f2fd5930 | [
"BSD-3-Clause"
] | 121 | 2018-12-06T16:36:05.000Z | 2022-03-31T23:52:40.000Z | reproject/utils.py | astropy/reproject | 43b0d8a4a5641cfbe6adbc3b1f2d7598f2fd5930 | [
"BSD-3-Clause"
] | 17 | 2018-12-05T04:14:48.000Z | 2021-12-09T22:29:54.000Z | import numpy as np
import astropy.nddata
from astropy.io import fits
from astropy.io.fits import CompImageHDU, HDUList, Header, ImageHDU, PrimaryHDU
from astropy.wcs import WCS
from astropy.wcs.wcsapi import BaseHighLevelWCS
__all__ = ['parse_input_data', 'parse_input_shape', 'parse_input_weights',
'parse_... | 41.257353 | 88 | 0.640171 | import numpy as np
import astropy.nddata
from astropy.io import fits
from astropy.io.fits import CompImageHDU, HDUList, Header, ImageHDU, PrimaryHDU
from astropy.wcs import WCS
from astropy.wcs.wcsapi import BaseHighLevelWCS
__all__ = ['parse_input_data', 'parse_input_shape', 'parse_input_weights',
'parse_... | true | true |
f71189ffbe9ac0e6918cf13b221be71313d98d51 | 574 | py | Python | tests/dumb_plugins/valid/__init__.py | dechainers/dechainy | f742cd77e93c6c5adfecf7509cf35e386ea25c6d | [
"Apache-2.0"
] | 1 | 2022-02-01T11:34:13.000Z | 2022-02-01T11:34:13.000Z | tests/dumb_plugins/valid/__init__.py | dechainers/dechainy | f742cd77e93c6c5adfecf7509cf35e386ea25c6d | [
"Apache-2.0"
] | null | null | null | tests/dumb_plugins/valid/__init__.py | dechainers/dechainy | f742cd77e93c6c5adfecf7509cf35e386ea25c6d | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from dechainy.plugins import Probe
from dechainy.ebpf import EbpfCompiler
@dataclass
class Valid(Probe):
def __post_init__(self):
self.ingress.required = True
self.ingress.cflags.append("-DCUSTOM_VARIABLE=0")
self.egress.required = False
super().... | 28.7 | 73 | 0.672474 | from dataclasses import dataclass
from dechainy.plugins import Probe
from dechainy.ebpf import EbpfCompiler
@dataclass
class Valid(Probe):
def __post_init__(self):
self.ingress.required = True
self.ingress.cflags.append("-DCUSTOM_VARIABLE=0")
self.egress.required = False
super().... | true | true |
f7118a0f9174dce416dc80c1510559d262408d78 | 1,959 | py | Python | powerline_shell/themes/default.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | powerline_shell/themes/default.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | powerline_shell/themes/default.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | class DefaultColor(object):
"""
This class should have the default colors for every segment.
Please test every new segment with this theme first.
"""
# RESET is not a real color code. It is used as in indicator
# within the code that any foreground / background color should
# be cleared
... | 22.011236 | 75 | 0.650332 | class DefaultColor(object):
RESET = -1
USERNAME_FG = 250
USERNAME_BG = 240
USERNAME_ROOT_FG = 250
USERNAME_ROOT_BG = 124
HOSTNAME_FG = 250
HOSTNAME_BG = 238
HOME_SPECIAL_DISPLAY = True
HOME_BG = 31 HOME_FG = 15 PATH_BG = 237 PATH_FG = 250 CWD_FG = 2... | true | true |
f7118a9b813f246228dc9f4c53befcf78bec63af | 327 | py | Python | quiz/permissions.py | raksa/django-quickstart | ff3ca34662b0adca4ffb29cfa8f871d861053bf3 | [
"MIT"
] | null | null | null | quiz/permissions.py | raksa/django-quickstart | ff3ca34662b0adca4ffb29cfa8f871d861053bf3 | [
"MIT"
] | 9 | 2019-12-04T23:11:06.000Z | 2022-02-10T11:54:05.000Z | quiz/permissions.py | raksa/django-quickstart | ff3ca34662b0adca4ffb29cfa8f871d861053bf3 | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission
class SuperAdmin(BasePermission):
def has_object_permission(self, request, view, obj):
user = request.user
if not (user and user.is_authenticated):
return False
if user.is_superuser:
return True
return... | 21.8 | 56 | 0.663609 | from rest_framework.permissions import BasePermission
class SuperAdmin(BasePermission):
def has_object_permission(self, request, view, obj):
user = request.user
if not (user and user.is_authenticated):
return False
if user.is_superuser:
return True
return... | true | true |
f7118ac45d271ba608e997e84615b7db483463ed | 1,749 | py | Python | venv/lib/python3.6/site-packages/chatterbot/input/mailgun.py | HackBots1111/flask-server-bot | 683932802d689d21b0b8397acd3f072197dea208 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/chatterbot/input/mailgun.py | HackBots1111/flask-server-bot | 683932802d689d21b0b8397acd3f072197dea208 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/chatterbot/input/mailgun.py | HackBots1111/flask-server-bot | 683932802d689d21b0b8397acd3f072197dea208 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import datetime
from chatterbot.input import InputAdapter
from chatterbot.conversation import Statement
class Mailgun(InputAdapter):
"""
Get input from Mailgun.
"""
def __init__(self, **kwargs):
super(Mailgun, self).__init__(**kwargs)
... | 28.209677 | 68 | 0.56032 | from __future__ import unicode_literals
import datetime
from chatterbot.input import InputAdapter
from chatterbot.conversation import Statement
class Mailgun(InputAdapter):
def __init__(self, **kwargs):
super(Mailgun, self).__init__(**kwargs)
self.name = kwargs.get('name')
... | true | true |
f7118b05dced8094fd2666a79e6f6a3ed7eb88be | 1,363 | py | Python | linear_regression.py | kohjingyu/prob-stats | df396686b641079b5db93118b1b2373d79de7d7a | [
"MIT"
] | 3 | 2018-03-16T15:31:57.000Z | 2018-06-13T06:36:57.000Z | linear_regression.py | kohjingyu/prob-stats | df396686b641079b5db93118b1b2373d79de7d7a | [
"MIT"
] | null | null | null | linear_regression.py | kohjingyu/prob-stats | df396686b641079b5db93118b1b2373d79de7d7a | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
x = [20, 23, 29, 27, 30, 34, 35, 37, 40, 43]
y = [1.32, 1.67, 2.17, 2.70, 2.75, 2.87, 3.65, 2.86, 3.61, 4.25]
n = len(x)
assert(n == len(y))
# Means
bar_x = sum(x) / n
bar_y = sum(y) / n
# Sum of squares
sxy = sum([(x[i] - bar_x) * (y[i] - bar_y) for i in range(n)])
... | 27.816327 | 74 | 0.581071 | import matplotlib
import matplotlib.pyplot as plt
x = [20, 23, 29, 27, 30, 34, 35, 37, 40, 43]
y = [1.32, 1.67, 2.17, 2.70, 2.75, 2.87, 3.65, 2.86, 3.61, 4.25]
n = len(x)
assert(n == len(y))
bar_x = sum(x) / n
bar_y = sum(y) / n
sxy = sum([(x[i] - bar_x) * (y[i] - bar_y) for i in range(n)])
sxx = sum([(x[i] - bar_x)... | true | true |
f7118bb7f85eb63551ff192af78a4fa82b04fb29 | 10,895 | py | Python | sensor.py | sasgoose/sureha | 47558ba2a000a7b65fa8b2e9fc91d5ce3e0c8291 | [
"Apache-2.0"
] | null | null | null | sensor.py | sasgoose/sureha | 47558ba2a000a7b65fa8b2e9fc91d5ce3e0c8291 | [
"Apache-2.0"
] | null | null | null | sensor.py | sasgoose/sureha | 47558ba2a000a7b65fa8b2e9fc91d5ce3e0c8291 | [
"Apache-2.0"
] | null | null | null | """Support for Sure PetCare Flaps/Pets sensors."""
from __future__ import annotations
from typing import Any, cast
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_VOLTAGE,
DEVICE_CLASS_BATTERY,
MASS_GRAMS,... | 31.397695 | 88 | 0.608261 | from __future__ import annotations
from typing import Any, cast
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_VOLTAGE,
DEVICE_CLASS_BATTERY,
MASS_GRAMS,
PERCENTAGE,
VOLUME_MILLILITERS,
)
from hom... | true | true |
f7118c03a435f2a29e604414e5c30c3bbf8bfdb0 | 22,879 | py | Python | toc_trends_analysis.py | JamesSample/icpw | 47562f601fc8fe23720267d083dabc540889565e | [
"MIT"
] | 1 | 2020-05-06T21:18:33.000Z | 2020-05-06T21:18:33.000Z | toc_trends_analysis.py | JamesSample/icpw | 47562f601fc8fe23720267d083dabc540889565e | [
"MIT"
] | 1 | 2020-02-05T16:50:23.000Z | 2020-03-26T16:16:37.000Z | toc_trends_analysis.py | JamesSample/icpw | 47562f601fc8fe23720267d083dabc540889565e | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# Name: toc_trends_analysis.py
# Purpose: Analyse RESA2 data for trends.
#
# Author: James Sample
#
# Created: Fri Jul 15 11:35:12 2016
# Copyright: (c) James Sample and NIVA
# Licence:
#--------------------------... | 38.516835 | 118 | 0.517287 |
def mk_test(x, stn_id, par, alpha=0.05):
import numpy as np
from scipy.stats import norm
n = len(x)
if n < 10:
print (' Data series for %s at site %s has fewer than 10 non-null values. '
'Significance estimates may be unreliable.' % (par, int(stn_id)))
s... | true | true |
f7118ca81a64318023c6f86e4904b3df0227a3a8 | 468 | py | Python | blogcbv/contrib/sites/migrations/0004_alter_options_ordering_domain.py | saaddine/BlogApp_CookieCutter | 9df5539adae62843c2d41449fe52acfab8e120d5 | [
"MIT"
] | 602 | 2021-10-24T02:17:35.000Z | 2022-03-31T14:45:45.000Z | blogcbv/contrib/sites/migrations/0004_alter_options_ordering_domain.py | saaddine/BlogApp_CookieCutter | 9df5539adae62843c2d41449fe52acfab8e120d5 | [
"MIT"
] | 162 | 2021-10-24T02:31:20.000Z | 2022-03-31T23:39:16.000Z | gestao_rh/contrib/sites/migrations/0004_alter_options_ordering_domain.py | andreFSilva/gestao_rh | 9e0bfce3c594186ed8b9acea12e4dff13337148e | [
"MIT"
] | 204 | 2021-11-02T12:18:07.000Z | 2022-03-31T08:31:53.000Z | # Generated by Django 3.1.7 on 2021-02-04 14:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("sites", "0003_set_site_domain_and_name"),
]
operations = [
migrations.AlterModelOptions(
name="site",
options={
... | 21.272727 | 51 | 0.527778 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("sites", "0003_set_site_domain_and_name"),
]
operations = [
migrations.AlterModelOptions(
name="site",
options={
"ordering": ["domain"],
"ver... | true | true |
f7118cb0bdc5e5841720741a7b7171647cf7632a | 2,886 | py | Python | trax/layers/normalization_test.py | zfisher/trax | c8187944fc036418a5c3b0491fc53c223e73faa6 | [
"Apache-2.0"
] | 1 | 2020-04-19T01:40:08.000Z | 2020-04-19T01:40:08.000Z | trax/layers/normalization_test.py | zfisher/trax | c8187944fc036418a5c3b0491fc53c223e73faa6 | [
"Apache-2.0"
] | null | null | null | trax/layers/normalization_test.py | zfisher/trax | c8187944fc036418a5c3b0491fc53c223e73faa6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.075 | 74 | 0.70201 |
from absl.testing import absltest
import numpy as onp
from trax.layers import base
from trax.layers import normalization
from trax.math import numpy as np
from trax.shapes import ShapeDtype
class NormalizationLayerTest(absltest.TestCase):
def test_batch_norm_shape(self):
input_signature = ShapeDtype((29, 5,... | true | true |
f7118d0dbc86cd00f058a109d84a4b6e7666a2d7 | 11,575 | py | Python | main.py | chicanica/TeleBot | 5f3c197fea22b812016a31f645db8178d459c4a5 | [
"MIT"
] | null | null | null | main.py | chicanica/TeleBot | 5f3c197fea22b812016a31f645db8178d459c4a5 | [
"MIT"
] | null | null | null | main.py | chicanica/TeleBot | 5f3c197fea22b812016a31f645db8178d459c4a5 | [
"MIT"
] | null | null | null | # Телеграм-бот v.002 - бот создаёт меню, присылает собачку, и анекдот
import telebot # pyTelegramBotAPI 4.3.1
from telebot import types
import requests
import bs4
import json
bot = telebot.TeleBot('5193117811:AAH0hWHVx0kH08sub52IFj2SAdJi1eugY-k') # Создаем экземпляр бота
# ---------------------------------------... | 42.555147 | 149 | 0.539611 |
import telebot from telebot import types
import requests
import bs4
import json
bot = telebot.TeleBot('5193117811:AAH0hWHVx0kH08sub52IFj2SAdJi1eugY-k')
@bot.message_handler(commands=["start"])
def start(message, res=False):
chat_id = message.chat.id
markup = types.ReplyKeyboardMarkup(resize_keyboard=Tru... | true | true |
f7118d7f8a48baf47c123ea7acecff67d1c87396 | 460 | py | Python | meetscheduler/settings/developments.py | leejooy96/meetscheduler | e29a96d5bcaa62a32ae240fb20e85379f37000e5 | [
"MIT"
] | null | null | null | meetscheduler/settings/developments.py | leejooy96/meetscheduler | e29a96d5bcaa62a32ae240fb20e85379f37000e5 | [
"MIT"
] | 6 | 2020-02-13T00:29:51.000Z | 2021-06-10T17:59:43.000Z | meetscheduler/settings/developments.py | leejooy96/meetscheduler | e29a96d5bcaa62a32ae240fb20e85379f37000e5 | [
"MIT"
] | 1 | 2019-12-12T02:19:20.000Z | 2019-12-12T02:19:20.000Z | from .base import *
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': get_value_from_secret('DB_NAME'),
'HOST': get_value_from_secret('DB_HOST'),
'USER': get_value_from_secret('DB_USER'),
'PASSWO... | 27.058824 | 57 | 0.608696 | from .base import *
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': get_value_from_secret('DB_NAME'),
'HOST': get_value_from_secret('DB_HOST'),
'USER': get_value_from_secret('DB_USER'),
'PASSWO... | true | true |
f7118dacceb344ed0d2633d7e6dd0d0119901228 | 5,711 | py | Python | backend/pyrogram/methods/chats/iter_chat_members.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/methods/chats/iter_chat_members.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/methods/chats/iter_chat_members.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 35.69375 | 120 | 0.575031 |
from string import ascii_lowercase
from typing import Union, AsyncGenerator, Optional
from pyrogram import raw
from pyrogram import types
from pyrogram.scaffold import Scaffold
class Filters:
ALL = "all"
KICKED = "kicked"
RESTRICTED = "restricted"
BOTS = "bots"
RECENT = "recent"
ADMINISTRATO... | true | true |
f7118e03c63e8796cb463067d621da592fba5da6 | 2,513 | py | Python | stackedcoil/cmulti_c1243_3c.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | 2 | 2022-02-15T08:39:26.000Z | 2022-02-17T11:51:06.000Z | stackedcoil/cmulti_c1243_3c.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | null | null | null | stackedcoil/cmulti_c1243_3c.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | null | null | null | # generate data: specify number of data points generated
NUM_DATA_POINTS = 5000
# the minimum number of variables required for the equation to work
MIN_VARIABLES = 4
# specify objective function
def func(x, num_var):
result = 0.0
for i in range(num_var):
result += x[i]**2
return result
# specify ... | 25.907216 | 102 | 0.670115 | NUM_DATA_POINTS = 5000
MIN_VARIABLES = 4
def func(x, num_var):
result = 0.0
for i in range(num_var):
result += x[i]**2
return result
MIN_OR_MAX_FLAG = 0
X_MIN_RANGE = -50.0
X_MAX_RANGE = 50.0
def c0(x, num_var):
result = 80 - x[0] - x[1]
if result <= 0.0:
return 0.0
els... | true | true |
f7118f37fa1e83d2b81be644d00dbe24bcf186ed | 5,814 | py | Python | file_utils.py | watanka/CRAFTS-implementation | bc514638755fe798a0d5eb583d6d477e8eb55bff | [
"Apache-2.0"
] | 1 | 2021-11-16T15:52:58.000Z | 2021-11-16T15:52:58.000Z | file_utils.py | watanka/CRAFTS-implementation | bc514638755fe798a0d5eb583d6d477e8eb55bff | [
"Apache-2.0"
] | null | null | null | file_utils.py | watanka/CRAFTS-implementation | bc514638755fe798a0d5eb583d6d477e8eb55bff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import numpy as np
import cv2
import imgproc
from PIL import Image, ImageDraw
# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py
def get_files(img_dir):
imgs, masks, xmls = list_files(img_dir)
return imgs, masks, xmls
def list_files(in... | 40.943662 | 136 | 0.484348 | import os
import numpy as np
import cv2
import imgproc
from PIL import Image, ImageDraw
def get_files(img_dir):
imgs, masks, xmls = list_files(img_dir)
return imgs, masks, xmls
def list_files(in_path):
img_files = []
mask_files = []
gt_files = []
for (dirpath, dirnames, filenames) in os.walk... | true | true |
f7118f84164b64de1d5f666d410c1b51fe89dbb3 | 985 | py | Python | migrations/versions/5b2f27493d7e_.py | NeverLeft/FLASKTPP | 3480131f3386bfc86e45a914f2140949863641dd | [
"Apache-2.0"
] | null | null | null | migrations/versions/5b2f27493d7e_.py | NeverLeft/FLASKTPP | 3480131f3386bfc86e45a914f2140949863641dd | [
"Apache-2.0"
] | null | null | null | migrations/versions/5b2f27493d7e_.py | NeverLeft/FLASKTPP | 3480131f3386bfc86e45a914f2140949863641dd | [
"Apache-2.0"
] | null | null | null | """empty message
Revision ID: 5b2f27493d7e
Revises: 1d17bfa8fe08
Create Date: 2018-06-14 14:54:29.224338
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5b2f27493d7e'
down_revision = '1d17bfa8fe08'
branch_labels = None
depends_on = None
def upgrade():
# ... | 26.621622 | 65 | 0.675127 | from alembic import op
import sqlalchemy as sa
revision = '5b2f27493d7e'
down_revision = '1d17bfa8fe08'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('movie_plan',
sa.Column('id', sa.String(length=128), nullable=False),
sa.Column('mp_movie', sa.Integer(), nullable=True),
... | true | true |
f711900c4366c1277c1a4b4099d698e25beaf991 | 5,029 | py | Python | chainer/links/connection/peephole.py | yuhonghong66/chainer | 15d475f54fc39587abd7264808c5e4b33782df9e | [
"MIT"
] | 1 | 2019-02-12T23:10:16.000Z | 2019-02-12T23:10:16.000Z | chainer/links/connection/peephole.py | nolfwin/chainer | 8d776fcc1e848cb9d3800a6aab356eb91ae9d088 | [
"MIT"
] | 2 | 2019-05-14T15:45:01.000Z | 2019-05-15T07:12:49.000Z | chainer/links/connection/peephole.py | nolfwin/chainer | 8d776fcc1e848cb9d3800a6aab356eb91ae9d088 | [
"MIT"
] | 1 | 2018-05-28T22:43:34.000Z | 2018-05-28T22:43:34.000Z | import chainer
from chainer.backends import cuda
from chainer.functions.activation import sigmoid
from chainer.functions.activation import tanh
from chainer.functions.array import reshape
from chainer.functions.array import split_axis
from chainer import link
from chainer.links.connection import linear
from chainer imp... | 39.289063 | 78 | 0.601114 | import chainer
from chainer.backends import cuda
from chainer.functions.activation import sigmoid
from chainer.functions.activation import tanh
from chainer.functions.array import reshape
from chainer.functions.array import split_axis
from chainer import link
from chainer.links.connection import linear
from chainer imp... | true | true |
f71190292a7421e463a92607ba0d07147a7f68d5 | 3,338 | py | Python | xenia_python_client_library/models/organization_user_update.py | DutchAnalytics/xenia-python-client-library | 60dc3e21094086124b552ff5bed5895fee826b57 | [
"Apache-2.0"
] | null | null | null | xenia_python_client_library/models/organization_user_update.py | DutchAnalytics/xenia-python-client-library | 60dc3e21094086124b552ff5bed5895fee826b57 | [
"Apache-2.0"
] | null | null | null | xenia_python_client_library/models/organization_user_update.py | DutchAnalytics/xenia-python-client-library | 60dc3e21094086124b552ff5bed5895fee826b57 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Xenia Python Client Library
Python Client Library to interact with the Xenia API. # noqa: E501
The version of the OpenAPI document: v2.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from xenia_python_client_library.configur... | 27.586777 | 81 | 0.579089 |
import pprint
import re
import six
from xenia_python_client_library.configuration import Configuration
class OrganizationUserUpdate(object):
openapi_types = {
'admin': 'bool'
}
attribute_map = {
'admin': 'admin'
}
def __init__(self, admin=False, local_vars_configuration=No... | true | true |
f71192f1a6d47ff40b424445a4968b83f2e91a89 | 9,469 | py | Python | tests/test_generate_files.py | bittner/cookiecutter | 3a3f4b247a5f5f326a614907ba915af773791fdf | [
"BSD-3-Clause"
] | 1 | 2020-12-19T08:02:33.000Z | 2020-12-19T08:02:33.000Z | tests/test_generate_files.py | imbi7py/cookiecutter | 7f4bc4929ec6dc4e77b389d698b576b8a089a091 | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate_files.py | imbi7py/cookiecutter | 7f4bc4929ec6dc4e77b389d698b576b8a089a091 | [
"BSD-3-Clause"
] | 1 | 2020-01-15T16:44:21.000Z | 2020-01-15T16:44:21.000Z | # -*- coding: utf-8 -*-
"""
test_generate_files
-------------------
Tests formerly known from a unittest residing in test_generate.py named
TestGenerateFiles.test_generate_files_nontemplated_exception
TestGenerateFiles.test_generate_files
TestGenerateFiles.test_generate_files_with_trailing_newline
TestGenerateFiles.t... | 32.317406 | 78 | 0.699018 |
from __future__ import unicode_literals
import os
import io
import pytest
from cookiecutter import generate
from cookiecutter import exceptions
from cookiecutter import utils
@pytest.mark.parametrize('invalid_dirname', ['', '{foo}', '{{foo', 'bar}}'])
def test_ensure_dir_is_templated_raises(invalid_dirname):
w... | true | true |
f71192fabb5e746aede1a9c9b5b7d8a1f18a4159 | 4,888 | py | Python | torch/jit/_monkeytype_config.py | rpindale/pytorch | b07264301d19869ab223957a15e2ce8825886d21 | [
"Intel"
] | 1 | 2021-06-21T09:43:33.000Z | 2021-06-21T09:43:33.000Z | torch/jit/_monkeytype_config.py | rpindale/pytorch | b07264301d19869ab223957a15e2ce8825886d21 | [
"Intel"
] | null | null | null | torch/jit/_monkeytype_config.py | rpindale/pytorch | b07264301d19869ab223957a15e2ce8825886d21 | [
"Intel"
] | null | null | null | import inspect
import typing
import torch
from typing import Optional, Iterable, List, Dict
from collections import defaultdict
_IS_MONKEYTYPE_INSTALLED = True
try:
import monkeytype # type: ignore[import]
from monkeytype import trace as monkeytype_trace
from monkeytype.db.base import CallTraceThunk, Call... | 38.488189 | 111 | 0.594926 | import inspect
import typing
import torch
from typing import Optional, Iterable, List, Dict
from collections import defaultdict
_IS_MONKEYTYPE_INSTALLED = True
try:
import monkeytype from monkeytype import trace as monkeytype_trace
from monkeytype.db.base import CallTraceThunk, CallTraceStore, CallTraceSt... | true | true |
f71193d757e833203e1e5b18a48ec2bdf4f531a0 | 1,029 | py | Python | edu/class8/config.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | 1 | 2021-12-12T12:34:01.000Z | 2021-12-12T12:34:01.000Z | edu/class8/config.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | null | null | null | edu/class8/config.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | null | null | null | from yacs.config import CfgNode as CN
import yaml
_C = CN()
_C.DATA = CN()
_C.DATA.DATASET = 'Cifar10'
_C.DATA.BATCH_SIZE = 128
_C.MODEL = CN()
_C.MODEL.NUM_CLASSES = 1000
_C.MODEL.TRANS = CN()
_C.MODEL.TRANS.EMBED_DIM = 96
_C.MODEL.TRANS.DEPTHS = [2, 2, 6, 2]
_C.MODEL.TRANS.QKV_BIAS = False
def _update_config_fr... | 18.709091 | 50 | 0.665695 | from yacs.config import CfgNode as CN
import yaml
_C = CN()
_C.DATA = CN()
_C.DATA.DATASET = 'Cifar10'
_C.DATA.BATCH_SIZE = 128
_C.MODEL = CN()
_C.MODEL.NUM_CLASSES = 1000
_C.MODEL.TRANS = CN()
_C.MODEL.TRANS.EMBED_DIM = 96
_C.MODEL.TRANS.DEPTHS = [2, 2, 6, 2]
_C.MODEL.TRANS.QKV_BIAS = False
def _update_config_fr... | true | true |
f71193ef3fbfbec2cf3575c19fdbffbc9b4086b6 | 7,520 | py | Python | test/integration/ggrc/review/test_api.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/review/test_api.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/review/test_api.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-02-13T12:32:45.000Z | 2020-02-13T12:32:45.000Z | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Base TestCase for proposal api."""
import ddt
from ggrc.models import all_models
from integration.ggrc import TestCase, generator
from integration.ggrc.models import factories
from integration.ggrc.api... | 34.814815 | 79 | 0.648404 |
import ddt
from ggrc.models import all_models
from integration.ggrc import TestCase, generator
from integration.ggrc.models import factories
from integration.ggrc.api_helper import Api
from integration.ggrc.review import build_reviewer_acl
@ddt.ddt
class TestReviewApi(TestCase):
def setUp(self):
super(Test... | true | true |
f7119443cc493f06975a851156fbc3ec8010dca5 | 998 | py | Python | flaskr/__init__.py | wiky-avis/flask_app | 7ea6964bb9dcd4a919161d062ddaff2a3c20ae43 | [
"MIT"
] | null | null | null | flaskr/__init__.py | wiky-avis/flask_app | 7ea6964bb9dcd4a919161d062ddaff2a3c20ae43 | [
"MIT"
] | null | null | null | flaskr/__init__.py | wiky-avis/flask_app | 7ea6964bb9dcd4a919161d062ddaff2a3c20ae43 | [
"MIT"
] | 1 | 2021-07-15T08:39:17.000Z | 2021-07-15T08:39:17.000Z | import os
from flask import Flask
def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
)
if test_config is None:
... | 23.209302 | 66 | 0.650301 | import os
from flask import Flask
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
)
if test_config is None:
app.config.from... | true | true |
f7119504da3f4521c3aee2052b77a4d48632efc2 | 8,573 | py | Python | json_commander.py | LairdCP/BT510-Python | a7c5b2825a3919b3b261524763ec0a5ed76d54da | [
"Apache-2.0"
] | 1 | 2021-05-16T17:53:33.000Z | 2021-05-16T17:53:33.000Z | json_commander.py | LairdCP/BT510-Python | a7c5b2825a3919b3b261524763ec0a5ed76d54da | [
"Apache-2.0"
] | null | null | null | json_commander.py | LairdCP/BT510-Python | a7c5b2825a3919b3b261524763ec0a5ed76d54da | [
"Apache-2.0"
] | 1 | 2021-04-23T22:33:21.000Z | 2021-04-23T22:33:21.000Z |
"""
BT510 commands (serial or BLE).
This is a subset of the jtester commands used for verification.
"""
import time
import json
import random
import string
import logging
from jsonrpcclient.requests import Request
class jtester:
def __init__(self, fname="config.json"):
""" JSON tester that is independen... | 32.721374 | 73 | 0.523737 |
import time
import json
import random
import string
import logging
from jsonrpcclient.requests import Request
class jtester:
def __init__(self, fname="config.json"):
print("jtester init")
self.protocol = None
self.inter_message_delay = 0.01
self.reset_delay = 10
self.rese... | true | true |
f711955d7814146fa3409fdcd71c37026ca25fdd | 11,405 | py | Python | augmentation/methods/cyclegan/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | 28 | 2020-08-19T02:59:37.000Z | 2022-03-17T18:10:24.000Z | augmentation/methods/cyclegan/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | null | null | null | augmentation/methods/cyclegan/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | 3 | 2021-01-29T10:20:14.000Z | 2021-11-15T17:06:27.000Z | import datetime
import tensorflow as tf
import random
import wandb
from tensorflow_examples.models.pix2pix import pix2pix
from augmentation.dataflows.utils import create_paired_direct_dataflow, \
create_paired_parallel_dataflow_via_numpy
from augmentation.methods.cyclegan.models import mnist_unet_generator, mnist... | 41.624088 | 128 | 0.635949 | import datetime
import tensorflow as tf
import random
import wandb
from tensorflow_examples.models.pix2pix import pix2pix
from augmentation.dataflows.utils import create_paired_direct_dataflow, \
create_paired_parallel_dataflow_via_numpy
from augmentation.methods.cyclegan.models import mnist_unet_generator, mnist... | true | true |
f71195d43ec5aff59399866c4085c5cb7a9cb696 | 433 | py | Python | collect.py | foamliu/Facial-Expression-Prediction-v2 | cb29f7cfbc2136e13adc2b35bbff95fdfbe063f6 | [
"MIT"
] | 4 | 2019-09-17T10:00:51.000Z | 2021-04-24T03:10:43.000Z | collect.py | foamliu/Facial-Expression-Prediction-v2 | cb29f7cfbc2136e13adc2b35bbff95fdfbe063f6 | [
"MIT"
] | 1 | 2019-09-26T08:08:41.000Z | 2019-09-26T08:22:08.000Z | collect.py | foamliu/Facial-Expression-Prediction-v2 | cb29f7cfbc2136e13adc2b35bbff95fdfbe063f6 | [
"MIT"
] | null | null | null | import pickle
import cv2 as cv
if __name__ == "__main__":
with open('fer2013.pkl', 'rb') as file:
data = pickle.load(file)
train = data['train']
train = train[:10]
for i, sample in enumerate(train):
filename = sample['image_path']
img = cv.imread(filename)
new_name = ... | 22.789474 | 44 | 0.581986 | import pickle
import cv2 as cv
if __name__ == "__main__":
with open('fer2013.pkl', 'rb') as file:
data = pickle.load(file)
train = data['train']
train = train[:10]
for i, sample in enumerate(train):
filename = sample['image_path']
img = cv.imread(filename)
new_name = ... | true | true |
f711965dc8523212746c3ea30163a0260f421dd0 | 24 | py | Python | torchlight/xp/__init__.py | l3robot/torchlight | e9a809aad0b5e75f97bf0cb50c9c799ea7b98eab | [
"MIT"
] | null | null | null | torchlight/xp/__init__.py | l3robot/torchlight | e9a809aad0b5e75f97bf0cb50c9c799ea7b98eab | [
"MIT"
] | null | null | null | torchlight/xp/__init__.py | l3robot/torchlight | e9a809aad0b5e75f97bf0cb50c9c799ea7b98eab | [
"MIT"
] | null | null | null | from .splitter import *
| 12 | 23 | 0.75 | from .splitter import *
| true | true |
f71199626d1f05e87cb35c323e9b5e8cccb1c230 | 1,888 | py | Python | tuiuiu/tuiuiutenant/migration_executors/base.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 3 | 2019-08-08T09:09:35.000Z | 2020-12-15T18:04:17.000Z | tuiuiu/tuiuiutenant/migration_executors/base.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | null | null | null | tuiuiu/tuiuiutenant/migration_executors/base.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 1 | 2017-09-09T20:10:40.000Z | 2017-09-09T20:10:40.000Z | import sys
from django.core.management.commands.migrate import Command as MigrateCommand
from django.db import transaction
from tuiuiu.tuiuiutenant.utils import get_public_schema_name
def run_migrations(args, options, executor_codename, schema_name, allow_atomic=True):
from django.core.management import color
... | 29.046154 | 86 | 0.692797 | import sys
from django.core.management.commands.migrate import Command as MigrateCommand
from django.db import transaction
from tuiuiu.tuiuiutenant.utils import get_public_schema_name
def run_migrations(args, options, executor_codename, schema_name, allow_atomic=True):
from django.core.management import color
... | true | true |
f7119983a202a347052dbee89c37d91f383faf43 | 904 | py | Python | qiskit_machine_learning/algorithms/distribution_learners/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | 1 | 2021-07-07T21:23:38.000Z | 2021-07-07T21:23:38.000Z | qiskit_machine_learning/algorithms/distribution_learners/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | null | null | null | qiskit_machine_learning/algorithms/distribution_learners/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | 1 | 2021-04-11T14:30:32.000Z | 2021-04-11T14:30:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 30.133333 | 77 | 0.670354 |
from .qgan import (DiscriminativeNetwork,
GenerativeNetwork,
NumPyDiscriminator,
PyTorchDiscriminator,
QuantumGenerator,
QGAN)
__all__ = [
'DiscriminativeNetwork',
'GenerativeNetwork',
'NumPyDiscriminator',
... | true | true |
f7119988b8ce9a26197da88008895fe3d1beeded | 908 | py | Python | image_converter/urls.py | dumrauf/web_tools | df2efff4c3435bfb2df131a6de572ecd50cc034d | [
"MIT"
] | null | null | null | image_converter/urls.py | dumrauf/web_tools | df2efff4c3435bfb2df131a6de572ecd50cc034d | [
"MIT"
] | null | null | null | image_converter/urls.py | dumrauf/web_tools | df2efff4c3435bfb2df131a6de572ecd50cc034d | [
"MIT"
] | null | null | null | """web_tools URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 34.923077 | 82 | 0.73348 | from django.conf.urls import url, include
from django.contrib import admin
from image_converter.views import upload_and_convert_image_file
__author__ = 'dominic'
urlpatterns = [
url(r'', upload_and_convert_image_file, name='upload_and_convert_image_file'),
]
| true | true |
f7119aad378282c16b985f4ad98bfd62252bbb62 | 22 | py | Python | builtinUI/__init__.py | BlackCatDevel0per/s2txt | fe1cf551057be5777eb8f27e9d56dd2ae3cbb514 | [
"Apache-2.0"
] | null | null | null | builtinUI/__init__.py | BlackCatDevel0per/s2txt | fe1cf551057be5777eb8f27e9d56dd2ae3cbb514 | [
"Apache-2.0"
] | null | null | null | builtinUI/__init__.py | BlackCatDevel0per/s2txt | fe1cf551057be5777eb8f27e9d56dd2ae3cbb514 | [
"Apache-2.0"
] | null | null | null | from .main import UIS
| 11 | 21 | 0.772727 | from .main import UIS
| true | true |
f7119b37d5164e1883c48596812221294dc20231 | 906 | py | Python | pws/asymmetric/rsa/helpers.py | pqlx/pws-crypto | 23dcf59d0b37d811d0a9bda995a3ea7d09051416 | [
"MIT"
] | 1 | 2020-12-10T01:14:29.000Z | 2020-12-10T01:14:29.000Z | pws/asymmetric/rsa/helpers.py | pqlx/pws-crypto | 23dcf59d0b37d811d0a9bda995a3ea7d09051416 | [
"MIT"
] | null | null | null | pws/asymmetric/rsa/helpers.py | pqlx/pws-crypto | 23dcf59d0b37d811d0a9bda995a3ea7d09051416 | [
"MIT"
] | null | null | null | from typing import Union
import math
AbstractText = Union[int, bytes]
def byte_length(i: int) -> int:
"""Returns the minimal amount of bytes needed to represent unsigned integer `i`."""
# we need to add 1 to correct the fact that a byte can only go up to 255, instead of 256:
# i.e math.log(0x100, 0x1... | 32.357143 | 96 | 0.677704 | from typing import Union
import math
AbstractText = Union[int, bytes]
def byte_length(i: int) -> int:
return math.ceil(math.log(i + 1, 0x100))
def bit_length(i: int) -> int:
return math.ceil(math.log(i + 1, 2))
def int_to_bytes(i: int, length: int=-1) -> bytes:
return i.to_bytes(byte_leng... | true | true |
f7119bbdc9310255f89817b25365b0356a1b07f4 | 960 | py | Python | lib/galaxy/jobs/runners/lwr_client/transport/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2016-08-17T06:36:03.000Z | 2016-08-17T06:36:03.000Z | lib/galaxy/jobs/runners/lwr_client/transport/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | lib/galaxy/jobs/runners/lwr_client/transport/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 3 | 2015-02-22T13:34:16.000Z | 2020-10-01T01:28:04.000Z | from .standard import Urllib2Transport
from .curl import PycurlTransport
import os
def get_transport(transport_type=None, os_module=os):
transport_type = __get_transport_type(transport_type, os_module)
if transport_type == 'urllib':
transport = Urllib2Transport()
else:
transport = PycurlTr... | 30 | 68 | 0.713542 | from .standard import Urllib2Transport
from .curl import PycurlTransport
import os
def get_transport(transport_type=None, os_module=os):
transport_type = __get_transport_type(transport_type, os_module)
if transport_type == 'urllib':
transport = Urllib2Transport()
else:
transport = PycurlTr... | true | true |
f7119cd11533daac3bec25c889502995c3aaed94 | 2,212 | py | Python | api/contests/migrations/0001_squashed_0003_auto_20200410_1511.py | selelab/contests | 5a239e306aeb84882fdee56ed8ba64721308cbb6 | [
"MIT"
] | null | null | null | api/contests/migrations/0001_squashed_0003_auto_20200410_1511.py | selelab/contests | 5a239e306aeb84882fdee56ed8ba64721308cbb6 | [
"MIT"
] | 6 | 2021-06-04T22:53:39.000Z | 2022-02-18T23:53:51.000Z | api/contests/migrations/0001_squashed_0003_auto_20200410_1511.py | selelab/contests | 5a239e306aeb84882fdee56ed8ba64721308cbb6 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-11 03:48
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
replaces = [('contests', '0001_initial'), ('contests', '0002_auto_20200410_1324'), ('contests', '0003_auto_20200410_1511')]
initial = ... | 34.5625 | 127 | 0.529385 |
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
replaces = [('contests', '0001_initial'), ('contests', '0002_auto_20200410_1324'), ('contests', '0003_auto_20200410_1511')]
initial = True
dependencies = [
]
operations... | true | true |
f7119d599e25a3f54a577d53867e596bb48c317c | 1,556 | py | Python | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 31.755102 | 76 | 0.568123 |
from msrest.serialization import Model
class Tag(Model):
_validation = {
'id': {'readonly': True},
'image_count': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'Id', 'type': 'str'},
'name': {'key': 'Name', 'type': 'str'},
'description': {'key': 'Descript... | true | true |
f7119d7c59ca6eac52878c1e416f7ea7327c9543 | 4,445 | py | Python | IOTSocket/IOTSocketClient.py | AbhijithAJ/IOTSocket | 1a27c12491edc31b1c4fab8bcda34c643a5ef21c | [
"MIT"
] | 51 | 2020-02-19T16:46:32.000Z | 2022-03-19T08:51:35.000Z | IOTSocket/IOTSocketClient.py | AbhijithAJ/IOTSocket | 1a27c12491edc31b1c4fab8bcda34c643a5ef21c | [
"MIT"
] | null | null | null | IOTSocket/IOTSocketClient.py | AbhijithAJ/IOTSocket | 1a27c12491edc31b1c4fab8bcda34c643a5ef21c | [
"MIT"
] | 6 | 2020-02-19T16:46:43.000Z | 2021-11-23T13:37:03.000Z | '''
Developed by Abhijith Boppe - linkedin.com/in/abhijith-boppe/
'''
import socket
import ssl
import time
data_maxLength = 65535
fields_maxLength =1024
sock = ''
device_id = ''
device_key = ''
time_stamps = []
def connectionSet(host, port, id_, key, Encrypt=1, cert_path=None):
global sock, device_id, device_key... | 36.434426 | 142 | 0.575928 | import socket
import ssl
import time
data_maxLength = 65535
fields_maxLength =1024
sock = ''
device_id = ''
device_key = ''
time_stamps = []
def connectionSet(host, port, id_, key, Encrypt=1, cert_path=None):
global sock, device_id, device_key, time_stamps
device_id = id_
device_key = key
time_stamps ... | true | true |
f7119ee2963ec0639fd70a9f4c454952354ead62 | 299 | py | Python | arrow/commands/cannedvalues/findAllValues.py | trstickland/python-apollo | 04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb | [
"MIT"
] | null | null | null | arrow/commands/cannedvalues/findAllValues.py | trstickland/python-apollo | 04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb | [
"MIT"
] | null | null | null | arrow/commands/cannedvalues/findAllValues.py | trstickland/python-apollo | 04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb | [
"MIT"
] | null | null | null | import click
from arrow.cli import pass_context
from arrow.decorators import custom_exception, dict_output
@click.command('findAllValues')
@pass_context
@custom_exception
@dict_output
def cli(ctx):
"""TODO: Undocumented
Output:
???
"""
return ctx.gi.cannedvalues.findAllValues()
| 16.611111 | 58 | 0.749164 | import click
from arrow.cli import pass_context
from arrow.decorators import custom_exception, dict_output
@click.command('findAllValues')
@pass_context
@custom_exception
@dict_output
def cli(ctx):
return ctx.gi.cannedvalues.findAllValues()
| true | true |
f7119f18095bc966c56c2eadd6c672d850c9ddfc | 828 | py | Python | tests/models/test_deployment.py | Hydrospheredata/mist-cli | 1eb6b2c660e5c1718ecaa5b58648821d9cacc6a9 | [
"Apache-2.0"
] | 3 | 2017-10-12T13:04:10.000Z | 2018-08-06T08:37:04.000Z | tests/models/test_deployment.py | Hydrospheredata/mist-cli | 1eb6b2c660e5c1718ecaa5b58648821d9cacc6a9 | [
"Apache-2.0"
] | 20 | 2017-10-05T13:40:36.000Z | 2019-09-05T13:56:01.000Z | tests/models/test_deployment.py | Hydrospheredata/mist-cli | 1eb6b2c660e5c1718ecaa5b58648821d9cacc6a9 | [
"Apache-2.0"
] | 5 | 2018-01-28T09:55:24.000Z | 2021-10-04T06:30:34.000Z | from unittest import TestCase
from pyhocon import ConfigTree
from mist.models import Deployment
class DeploymentTest(TestCase):
def test_create_deployment(self):
Deployment('test', 'Artifact', ConfigTree(), '0.0.1')
def test_get_name(self):
d = Deployment('test', 'Artifact', ConfigTree({
... | 29.571429 | 67 | 0.612319 | from unittest import TestCase
from pyhocon import ConfigTree
from mist.models import Deployment
class DeploymentTest(TestCase):
def test_create_deployment(self):
Deployment('test', 'Artifact', ConfigTree(), '0.0.1')
def test_get_name(self):
d = Deployment('test', 'Artifact', ConfigTree({
... | true | true |
f7119f62d7de298128757da8c1cef7e04a214f8c | 2,449 | py | Python | examples/AdafruitDHT.py | rewisyoung/Adafruit_Python_DHT | d3f525fea0ed2b5dc899eb1584015b6bd092a46a | [
"MIT"
] | null | null | null | examples/AdafruitDHT.py | rewisyoung/Adafruit_Python_DHT | d3f525fea0ed2b5dc899eb1584015b6bd092a46a | [
"MIT"
] | null | null | null | examples/AdafruitDHT.py | rewisyoung/Adafruit_Python_DHT | d3f525fea0ed2b5dc899eb1584015b6bd092a46a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# 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.508475 | 98 | 0.740302 |
import sys
import Adafruit_DHT
import time
sensor_args = { '11': Adafruit_DHT.DHT11,
'22': Adafruit_DHT.DHT22,
'2302': Adafruit_DHT.AM2302 }
if len(sys.argv) == 3 and sys.argv[1] in sensor_args:
sensor = sensor_args[sys.argv[1]]
pin = sys.argv[2]
else:
print('Usage: sudo... | true | true |
f7119fbceb12284f90eb8b90d388f4fb365e1026 | 510 | py | Python | leetcode/053/53.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | leetcode/053/53.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | leetcode/053/53.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | '''The thought follows a simple rule:
If the sum of a subarray is positive, it has possible to make the next value bigger, so we keep do it until it turn to negative.
If the sum is negative, it has no use to the next element, so we break.
it is a game of sum, not the elements.'''
nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4... | 26.842105 | 128 | 0.615686 |
nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
def Solution(nums):
for i in range(1, len(nums)):
if nums[i - 1] > 0:
nums[i] += nums[i - 1]
print(nums)
return max(nums)
print(Solution(nums))
| true | true |
f7119fd3687878f90fc548a161cfe2f3cf9d90a5 | 12,909 | py | Python | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/lsmr.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2021-02-05T13:19:58.000Z | 2021-02-05T13:19:58.000Z | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/lsmr.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2018-04-15T22:59:15.000Z | 2018-04-15T22:59:15.000Z | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/lsmr.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | null | null | null | """
Copyright (C) 2010 David Fong and Michael Saunders
LSMR uses an iterative method.
07 Jun 2010: Documentation updated
03 Jun 2010: First release version in Python
David Chin-lung Fong clfong@stanford.edu
Institute for Computational and Mathematical Engineering
Stanford University
Michael Saunders ... | 31.874074 | 79 | 0.539778 |
from __future__ import division, print_function, absolute_import
__all__ = ['lsmr']
from numpy import zeros, infty
from numpy.linalg import norm
from math import sqrt
from scipy.sparse.linalg.interface import aslinearoperator
from .lsqr import _sym_ortho
def lsmr(A, b, damp=0.0, atol=1e-6, btol=1e-6, conlim=1e8,
... | true | true |
f711a06a366032c815f82e1ea837be756e3e5b25 | 36,627 | py | Python | .modules/.sqlmap/lib/core/settings.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.sqlmap/lib/core/settings.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.sqlmap/lib/core/settings.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 161 | 2018-04-20T15:57:12.000Z | 2022-03-15T19:16:16.000Z | #!/usr/bin/env python
"""
Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import os
import random
import re
import subprocess
import string
import sys
import types
from lib.core.datatype import AttribDict
from lib.core.enums import DBMS
from lib.core.e... | 45.499379 | 1,450 | 0.72523 |
import os
import random
import re
import subprocess
import string
import sys
import types
from lib.core.datatype import AttribDict
from lib.core.enums import DBMS
from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
VERSION = "1.2.11.12"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.spl... | true | true |
f711a12e7e8fc99bda44beaafbb49fb25f011db0 | 1,975 | py | Python | lib/pios/recovery.py | creative-workflow/pi-setup | d6d28cb8d34ef71b1e8ac95dd94099bfad08837a | [
"MIT"
] | 1 | 2020-04-25T00:55:45.000Z | 2020-04-25T00:55:45.000Z | lib/pios/recovery.py | creative-workflow/pi-setup | d6d28cb8d34ef71b1e8ac95dd94099bfad08837a | [
"MIT"
] | 4 | 2015-05-28T23:20:13.000Z | 2015-05-28T23:24:01.000Z | lib/pios/recovery.py | creative-workflow/pi-setup | d6d28cb8d34ef71b1e8ac95dd94099bfad08837a | [
"MIT"
] | null | null | null | from fabric.operations import prompt
from loader import get_wrapper
from pios import run_local
import difflib, color
def print_diff(str1, str2):
diff = difflib.ndiff(str1.splitlines(1),
str2.splitlines(1))
for line in list(diff):
if line.startswith('+'):
with color.green():
... | 25.649351 | 131 | 0.672911 | from fabric.operations import prompt
from loader import get_wrapper
from pios import run_local
import difflib, color
def print_diff(str1, str2):
diff = difflib.ndiff(str1.splitlines(1),
str2.splitlines(1))
for line in list(diff):
if line.startswith('+'):
with color.green():
... | false | true |
f711a1707f5dbf4044a9357dbfc2ae691a4ada14 | 5,598 | py | Python | mechamodlearn/rigidbody.py | sisl/mechamodlearn | ed514b5d1193ce546b0221ba9222b0228d6c319a | [
"MIT"
] | 22 | 2019-02-22T00:11:55.000Z | 2022-01-01T22:13:17.000Z | mechamodlearn/rigidbody.py | sisl/mechamodlearn | ed514b5d1193ce546b0221ba9222b0228d6c319a | [
"MIT"
] | 2 | 2019-04-12T05:17:53.000Z | 2021-04-14T21:12:59.000Z | mechamodlearn/rigidbody.py | sisl/mechamodlearn | ed514b5d1193ce546b0221ba9222b0228d6c319a | [
"MIT"
] | 5 | 2019-06-10T14:28:26.000Z | 2019-12-06T02:03:21.000Z | # File: rigidbody.py
import abc
import torch
from mechamodlearn import nn, utils
from mechamodlearn.models import CholeskyMMNet, PotentialNet, GeneralizedForceNet
class AbstractRigidBody:
@property
@abc.abstractmethod
def thetamask(self):
"""Returns theta mask for configuration q.
These... | 30.096774 | 100 | 0.576099 |
import abc
import torch
from mechamodlearn import nn, utils
from mechamodlearn.models import CholeskyMMNet, PotentialNet, GeneralizedForceNet
class AbstractRigidBody:
@property
@abc.abstractmethod
def thetamask(self):
@abc.abstractmethod
def mass_matrix(self, q):
@abc.abstractmethod
d... | true | true |
f711a20ba72a69cc04b9b1a002911d1710c385ab | 9,423 | py | Python | fiftyone/core/validation.py | williamcorsel/fiftyone | 22e34e91deb1d2e2fe6316ec81714e0c55015523 | [
"Apache-2.0"
] | null | null | null | fiftyone/core/validation.py | williamcorsel/fiftyone | 22e34e91deb1d2e2fe6316ec81714e0c55015523 | [
"Apache-2.0"
] | null | null | null | fiftyone/core/validation.py | williamcorsel/fiftyone | 22e34e91deb1d2e2fe6316ec81714e0c55015523 | [
"Apache-2.0"
] | null | null | null | """
Validation utilities.
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import eta.core.utils as etau
import fiftyone.core.media as fom
import fiftyone.core.utils as fou
foc = fou.lazy_import("fiftyone.core.collections")
fov = fou.lazy_import("fiftyone.core.video")
def validate... | 30.299035 | 79 | 0.632495 | import eta.core.utils as etau
import fiftyone.core.media as fom
import fiftyone.core.utils as fou
foc = fou.lazy_import("fiftyone.core.collections")
fov = fou.lazy_import("fiftyone.core.video")
def validate_image_sample(sample):
if sample.media_type != fom.IMAGE:
raise ValueError(
"Expected ... | true | true |
f711a2afb6e9dd431868b09d890d7264429b6980 | 31,867 | py | Python | venv/lib/python3.6/tempfile.py | KorynLA/dwellinglyapi | 752d9aff1b203966df04de38caad2fd3e885a512 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | venv/lib/python3.6/tempfile.py | KorynLA/dwellinglyapi | 752d9aff1b203966df04de38caad2fd3e885a512 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | venv/lib/python3.6/tempfile.py | KorynLA/dwellinglyapi | 752d9aff1b203966df04de38caad2fd3e885a512 | [
"MIT"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'. 'mktemp' is subject to race conditions and
should not be used; it is provided f... | 33.438615 | 80 | 0.600151 |
__all__ = [
"NamedTemporaryFile", "TemporaryFile", "SpooledTemporaryFile", "TemporaryDirectory",
"mkstemp", "mkdtemp", "mktemp", "TMP_MAX", "gettempprefix", "tempdir", "gettempdir",
"gettempprefixb", "gettempdirb",
]
import func... | true | true |
f711a4bb1a6410ceb126fa5124c0048c868bc502 | 958 | py | Python | Records/admin.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-22T13:11:12.000Z | 2021-12-22T13:11:12.000Z | Records/admin.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 9 | 2020-10-28T07:07:05.000Z | 2021-06-28T20:05:37.000Z | Records/admin.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019-2021 Ramon van der Winkel.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.contrib import admin
from .models import IndivRecord, BesteIndivRecords
class IndivRecordAdmin(admin.ModelAdmin):
""" Admin configurat... | 28.176471 | 101 | 0.726514 |
from django.contrib import admin
from .models import IndivRecord, BesteIndivRecords
class IndivRecordAdmin(admin.ModelAdmin):
search_fields = ('naam', 'plaats', 'score', 'volg_nr')
list_filter = ('discipline', 'soort_record', 'geslacht', 'leeftijdscategorie', 'materiaalklasse',
'is... | true | true |
f711a541d5f2a2472a7bd1c4c91ceb34f392f93b | 8,449 | py | Python | extra-credit/Testing Room Locking System in Hotels/incorrect_impl_testlock_can_unlock_with_partially_matching_keycard.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | 11 | 2018-02-08T05:23:28.000Z | 2021-05-24T13:23:56.000Z | extra-credit/Testing Room Locking System in Hotels/incorrect_impl_testlock_can_unlock_with_partially_matching_keycard.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | null | null | null | extra-credit/Testing Room Locking System in Hotels/incorrect_impl_testlock_can_unlock_with_partially_matching_keycard.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | 2 | 2020-09-15T08:51:22.000Z | 2021-01-26T12:07:18.000Z | import re
class Key(object):
"Key used in keycards and locks"
pass
class KeyCard(object):
"Keycard used to open a lock"
def __init__(self, first_key, second_key):
"""
Constructs a KeyCard with the given keys
Args:
first_key: in the keycard to be created
... | 30.067616 | 80 | 0.590602 | import re
class Key(object):
pass
class KeyCard(object):
def __init__(self, first_key, second_key):
if not isinstance(first_key, Key):
raise ValueError("First key is not of Key type")
if not isinstance(second_key, Key):
raise ValueError("Second key is not of Key type"... | true | true |
f711a55112cb377c654e631988bd9f39095ca6c3 | 2,580 | py | Python | src/verstr/__init__.py | BRGM/verstr | 2a0fdd2bc359db94d0730824a07463bf23535e18 | [
"MIT"
] | 1 | 2021-12-02T08:02:21.000Z | 2021-12-02T08:02:21.000Z | src/verstr/__init__.py | BRGM/verstr | 2a0fdd2bc359db94d0730824a07463bf23535e18 | [
"MIT"
] | null | null | null | src/verstr/__init__.py | BRGM/verstr | 2a0fdd2bc359db94d0730824a07463bf23535e18 | [
"MIT"
] | null | null | null | """ Make comparing version strings super simple.
If you want codes using your package to be able to verify its version as easily as::
# user_code.py
import my_package
assert my_package.__version__ >= "1.1"
Just customize your package as follows::
# my_package/__init__.py
import verstr
__version__ = vers... | 21.864407 | 86 | 0.649225 |
import collections
import packaging.version
__all__ = ['verstr']
def verstr(str_version, mode="str"):
modes = dict(
str=VersionString,
userstr=VersionUserString,
interface=VersionInterface
)
try:
cls = modes[mode]
except KeyError:
raise ValueError(
... | true | true |
f711a59015e986f0a404d98866e778f8d9c0833f | 237,821 | py | Python | seleniumbase/fixtures/base_case.py | Forsaj1/SeleniumBase | a6db2e4866fa80f23738b1d9602915f4aefa50b1 | [
"MIT"
] | null | null | null | seleniumbase/fixtures/base_case.py | Forsaj1/SeleniumBase | a6db2e4866fa80f23738b1d9602915f4aefa50b1 | [
"MIT"
] | null | null | null | seleniumbase/fixtures/base_case.py | Forsaj1/SeleniumBase | a6db2e4866fa80f23738b1d9602915f4aefa50b1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The BaseCase class is the main gateway for using The SeleniumBase Framework.
It inherits Python's unittest.TestCase class, and runs with Pytest or Nose.
All tests using BaseCase automatically launch WebDriver browsers for tests.
Usage:
from seleniumbase import BaseCase
class MyTest... | 46.286687 | 79 | 0.587236 |
import codecs
import json
import logging
import math
import os
import re
import sys
import time
import urllib3
import unittest
import uuid
from selenium.common.exceptions import (StaleElementReferenceException,
MoveTargetOutOfBoundsException,
... | true | true |
f711a692c39f30b542a6842996b85b4cb4415fc1 | 2,095 | py | Python | checkov/common/util/suppression.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/common/util/suppression.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | checkov/common/util/suppression.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import re
from checkov.common.bridgecrew.integration_features.features.policy_metadata_integration import (
integration as metadata_integration,
)
from checkov.common.comment.enum import COMMENT_REGEX
from checkov.common.models.enums import CheckResult
from checkov.common.typing... | 40.288462 | 112 | 0.685442 | from __future__ import annotations
import re
from checkov.common.bridgecrew.integration_features.features.policy_metadata_integration import (
integration as metadata_integration,
)
from checkov.common.comment.enum import COMMENT_REGEX
from checkov.common.models.enums import CheckResult
from checkov.common.typing... | true | true |
f711a6a58c605dd7610cf6b3c4665eb78ee51dff | 1,823 | py | Python | src/tests/TestAccidental.py | ytyaru/Python.MusicTheory.Pitch.NoteNumber.201709171322 | 6b69d8f05c60b4b844c300114ac04023d4909f1e | [
"CC0-1.0"
] | null | null | null | src/tests/TestAccidental.py | ytyaru/Python.MusicTheory.Pitch.NoteNumber.201709171322 | 6b69d8f05c60b4b844c300114ac04023d4909f1e | [
"CC0-1.0"
] | null | null | null | src/tests/TestAccidental.py | ytyaru/Python.MusicTheory.Pitch.NoteNumber.201709171322 | 6b69d8f05c60b4b844c300114ac04023d4909f1e | [
"CC0-1.0"
] | null | null | null | import unittest
from MusicTheory.pitch.Accidental import Accidental
import Framework.ConstMeta
"""
Degreeのテスト。
"""
class TestAccidental(unittest.TestCase):
def test_Accidentals(self):
self.assertEqual(Accidental.Accidentals, {'♯': 1, '#': 1, '+': 1, '♭': -1, 'b': -1, '-': -1})
def test_Accidentals_NotSe... | 43.404762 | 101 | 0.667032 | import unittest
from MusicTheory.pitch.Accidental import Accidental
import Framework.ConstMeta
class TestAccidental(unittest.TestCase):
def test_Accidentals(self):
self.assertEqual(Accidental.Accidentals, {'♯': 1, '#': 1, '+': 1, '♭': -1, 'b': -1, '-': -1})
def test_Accidentals_NotSet(self):
wit... | true | true |
f711a8d72b834822ba5d3941177f22987ee79647 | 1,172 | py | Python | framework/parsers/ucXception_fi_parser.py | ucx-code/ucXception | 6b1f4fe4aa53a28e87584d07f540095c20ee50e9 | [
"BSD-3-Clause"
] | 2 | 2020-08-11T10:54:56.000Z | 2021-03-22T14:54:19.000Z | framework/parsers/ucXception_fi_parser.py | ucx-code/ucXception | 6b1f4fe4aa53a28e87584d07f540095c20ee50e9 | [
"BSD-3-Clause"
] | null | null | null | framework/parsers/ucXception_fi_parser.py | ucx-code/ucXception | 6b1f4fe4aa53a28e87584d07f540095c20ee50e9 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
def map_reg_to_text(reg_code):
reg_dict = ("rip", "rsp", "rax", "rbx", "rcx", "rdx", "cs", "ss", "eflags", "rbp", "r8", "r9",
"r10", "r11", "r12", "r13", "r14", "r15", "rsi", "rdi", "orig_rax", "fs_base", "gs_base",
"ds", "es", "fs", "gs")
return reg_dict[reg_code]
class ucXception_fi_p... | 31.675676 | 108 | 0.617747 | import numpy as np
def map_reg_to_text(reg_code):
reg_dict = ("rip", "rsp", "rax", "rbx", "rcx", "rdx", "cs", "ss", "eflags", "rbp", "r8", "r9",
"r10", "r11", "r12", "r13", "r14", "r15", "rsi", "rdi", "orig_rax", "fs_base", "gs_base",
"ds", "es", "fs", "gs")
return reg_dict[reg_code]
class ucXception_fi_p... | true | true |
f711aa1005ae5c787a4ebea5165a9b641bd45ab8 | 1,341 | py | Python | src/databricks/azext_databricks/__init__.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/databricks/azext_databricks/__init__.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/databricks/azext_databricks/__init__.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 40.636364 | 95 | 0.621178 |
from azure.cli.core import AzCommandsLoader
from azext_databricks._help import helps
class DatabricksClientCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_databricks._client_factory import cf_databricks
... | true | true |
f711aad73b54817b0d66ca271a5e4890b106d034 | 6,744 | py | Python | home/views.py | IkshulDureja/Book-Attic | 7c20e94a072012b5a89a5d231e8ae1e8d7732efe | [
"MIT"
] | 2 | 2020-11-10T04:51:37.000Z | 2020-12-25T12:21:56.000Z | home/views.py | IkshulDureja/Book-Attic | 7c20e94a072012b5a89a5d231e8ae1e8d7732efe | [
"MIT"
] | null | null | null | home/views.py | IkshulDureja/Book-Attic | 7c20e94a072012b5a89a5d231e8ae1e8d7732efe | [
"MIT"
] | null | null | null | from django.shortcuts import render,HttpResponse,redirect
from .models import books
from django.contrib.auth.models import User
from django.contrib.auth import login,logout,authenticate
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from . forms import sellbookform, Contac... | 36.852459 | 172 | 0.654953 | from django.shortcuts import render,HttpResponse,redirect
from .models import books
from django.contrib.auth.models import User
from django.contrib.auth import login,logout,authenticate
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from . forms import sellbookform, Contac... | true | true |
f711aba641513f7bce1193773cb3f004e8197fbf | 2,614 | py | Python | demo/predict.py | lyuyangh/Cross-Attention-VizWiz-VQA | 853bfe480dac5bd1363f60c6b17e25134acdc2fa | [
"MIT"
] | 10 | 2021-07-25T12:44:34.000Z | 2022-03-23T04:07:12.000Z | demo/predict.py | lyuyangh/Cross-Attention-VizWiz-VQA | 853bfe480dac5bd1363f60c6b17e25134acdc2fa | [
"MIT"
] | null | null | null | demo/predict.py | lyuyangh/Cross-Attention-VizWiz-VQA | 853bfe480dac5bd1363f60c6b17e25134acdc2fa | [
"MIT"
] | 5 | 2021-07-25T12:44:35.000Z | 2022-03-26T16:51:44.000Z | import datetime
import json
import os
import sys
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
from utils.flags import FLAGS
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from model.vqa_model import ModelParams... | 33.512821 | 76 | 0.662586 | import datetime
import json
import os
import sys
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.utils.data import DataLoader
from utils.flags import FLAGS
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from model.vqa_model import ModelParams... | true | true |
f711ad435cefa630d1bf8fbb0d00e964ba895374 | 1,568 | py | Python | chpt9/piechart.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | null | null | null | chpt9/piechart.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | 2 | 2018-05-21T09:39:00.000Z | 2018-05-27T15:59:15.000Z | chpt9/piechart.py | GDG-Buea/learn-python | 9dfe8caa4b57489cf4249bf7e64856062a0b93c2 | [
"Apache-2.0"
] | 2 | 2018-05-19T14:59:56.000Z | 2018-05-19T15:25:48.000Z |
# This program uses a pie chart to display the percentages of the overall grade represented by a project's,
# quizzes, the midterm exam, and the final exam, 20 percent of the grade and its value is displayed in red,
# quizzes are 10 percent and are displayed in blue, the midterm exam is 30 percent and is displayed ... | 37.333333 | 113 | 0.609694 |
# quizzes, the midterm exam, and the final exam, 20 percent of the grade and its value is displayed in red,
# quizzes are 10 percent and are displayed in blue, the midterm exam is 30 percent and is displayed in green and
# the final exam is 40 percent and is displayed in orange.
from tkinter import * # Import tkin... | true | true |
f711ad60a1c4f5370c2e0d7919222e6d32720773 | 3,308 | py | Python | app/auth.py | n0nvme/yatb | 3d2e7d7e3b2c694e4ae8a662becbe0984cf03210 | [
"Apache-2.0"
] | null | null | null | app/auth.py | n0nvme/yatb | 3d2e7d7e3b2c694e4ae8a662becbe0984cf03210 | [
"Apache-2.0"
] | null | null | null | app/auth.py | n0nvme/yatb | 3d2e7d7e3b2c694e4ae8a662becbe0984cf03210 | [
"Apache-2.0"
] | null | null | null | import uuid
from typing import Optional, Union
from datetime import datetime, timedelta
from fastapi import Request, HTTPException, status, Depends
from fastapi.security import OAuth2
from fastapi.openapi.models import OAuthFlows as OAuthFlowsModel
from fastapi.security.utils import get_authorization_scheme_param
from... | 34.103093 | 114 | 0.685006 | import uuid
from typing import Optional, Union
from datetime import datetime, timedelta
from fastapi import Request, HTTPException, status, Depends
from fastapi.security import OAuth2
from fastapi.openapi.models import OAuthFlows as OAuthFlowsModel
from fastapi.security.utils import get_authorization_scheme_param
from... | true | true |
f711aea97d18c0191ecb308c8e856ac112eecb8b | 511 | py | Python | algoexpert/branchSums.py | mahendra-rk/coding-interview-prep | 3b932d724846132a4560547809d63bd8ec67e123 | [
"MIT"
] | null | null | null | algoexpert/branchSums.py | mahendra-rk/coding-interview-prep | 3b932d724846132a4560547809d63bd8ec67e123 | [
"MIT"
] | null | null | null | algoexpert/branchSums.py | mahendra-rk/coding-interview-prep | 3b932d724846132a4560547809d63bd8ec67e123 | [
"MIT"
] | null | null | null | class BinaryTree:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def branchSums(root, sum=0, sumsList=None):
if root is None:
return
if sumsList is None: #refer https://stackoverflow.com/a/60202340/6699913
sumsList = []
sum += r... | 26.894737 | 76 | 0.639922 | class BinaryTree:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def branchSums(root, sum=0, sumsList=None):
if root is None:
return
if sumsList is None: sumsList = []
sum += root.value
if root.left is None and root.right is... | true | true |
f711b05eacbea0ffeb1d684c65680d31e02a5e89 | 27,154 | py | Python | nnunet/experiment_planning/experiment_planner_baseline_3DUNet.py | Janetteeeeeeee/nnUNet | db654c445aa5ced436dbf842d432dbbcdc01f4b5 | [
"Apache-2.0"
] | null | null | null | nnunet/experiment_planning/experiment_planner_baseline_3DUNet.py | Janetteeeeeeee/nnUNet | db654c445aa5ced436dbf842d432dbbcdc01f4b5 | [
"Apache-2.0"
] | null | null | null | nnunet/experiment_planning/experiment_planner_baseline_3DUNet.py | Janetteeeeeeee/nnUNet | db654c445aa5ced436dbf842d432dbbcdc01f4b5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 53.558185 | 147 | 0.653348 |
import shutil
from collections import OrderedDict
from copy import deepcopy
import nnunet
import numpy as np
from batchgenerators.utilities.file_and_folder_operations import *
from nnunet.configuration import default_num_threads
from nnunet.experiment_planning.DatasetAnalyzer import DatasetAnalyzer
from nnunet.experi... | true | true |
f711b083c504df10c30064706b2da45b8171ea7e | 2,438 | py | Python | zipline/data/dataset.py | michaeljohnbennett/zipline | 29321af1b472d72b759a71c9f5ba341109fc0e6d | [
"Apache-2.0"
] | 1 | 2015-10-22T03:38:19.000Z | 2015-10-22T03:38:19.000Z | zipline/data/dataset.py | michaeljohnbennett/zipline | 29321af1b472d72b759a71c9f5ba341109fc0e6d | [
"Apache-2.0"
] | null | null | null | zipline/data/dataset.py | michaeljohnbennett/zipline | 29321af1b472d72b759a71c9f5ba341109fc0e6d | [
"Apache-2.0"
] | null | null | null | """
dataset.py
"""
from six import (
iteritems,
with_metaclass,
)
from zipline.modelling.term import Term
class Column(object):
"""
An abstract column of data, not yet associated with a dataset.
"""
def __init__(self, dtype):
self.dtype = dtype
def bind(self, dataset, name):
... | 23.442308 | 74 | 0.586957 | from six import (
iteritems,
with_metaclass,
)
from zipline.modelling.term import Term
class Column(object):
def __init__(self, dtype):
self.dtype = dtype
def bind(self, dataset, name):
return BoundColumn(dtype=self.dtype, dataset=dataset, name=name)
class BoundColumn(Term):
... | true | true |
f711b087c93d9720507df164842f895b8535e578 | 1,165 | py | Python | setup.py | zhnlk/nbcrawler | 38152727d2e94f73392a8c0f392d118023072e2e | [
"MIT"
] | null | null | null | setup.py | zhnlk/nbcrawler | 38152727d2e94f73392a8c0f392d118023072e2e | [
"MIT"
] | null | null | null | setup.py | zhnlk/nbcrawler | 38152727d2e94f73392a8c0f392d118023072e2e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'zhnlk'
import os
from setuptools import setup
import cores
def getSubpackages(name):
"""获取该模块下所有的子模块名称"""
splist = []
for dirpath, _dirnames, _filenames in os.walk(name):
if os.path.isfile(os.path.join(dirpath, '__init__.py')):
splist.append("."... | 29.871795 | 79 | 0.619742 | __author__ = 'zhnlk'
import os
from setuptools import setup
import cores
def getSubpackages(name):
splist = []
for dirpath, _dirnames, _filenames in os.walk(name):
if os.path.isfile(os.path.join(dirpath, '__init__.py')):
splist.append(".".join(dirpath.split(os.sep)))
return splist
... | true | true |
f711b0bb3f6d53da7f1abb4833845da364b2fe94 | 40 | py | Python | rdkit/sping/Pyart/__init__.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 1,609 | 2015-01-05T02:41:13.000Z | 2022-03-30T21:57:24.000Z | rdkit/sping/Pyart/__init__.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 3,412 | 2015-01-06T12:13:33.000Z | 2022-03-31T17:25:41.000Z | rdkit/sping/Pyart/__init__.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 811 | 2015-01-11T03:33:48.000Z | 2022-03-28T11:57:49.000Z | # sping:: pyart
from pidPyart import *
| 10 | 22 | 0.7 |
from pidPyart import *
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.