hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74a7066634bdf361306156bd299c604d2f03378 | 2,527 | py | Python | orders/src/get_order/main.py | hairychris/aws-serverless-ecommerce-platform | 5e8b4c78f4268a11edce4c2250fc55becfc83b04 | [
"MIT-0"
] | 1 | 2020-08-11T06:21:15.000Z | 2020-08-11T06:21:15.000Z | orders/src/get_order/main.py | juanlamadrid20/aws-serverless-ecommerce-platform | 5242ba90e8066672f4fe165421d8a4ee7b6148c8 | [
"MIT-0"
] | null | null | null | orders/src/get_order/main.py | juanlamadrid20/aws-serverless-ecommerce-platform | 5242ba90e8066672f4fe165421d8a4ee7b6148c8 | [
"MIT-0"
] | null | null | null | """
GetOrdersFunction
"""
import os
from typing import Optional
import boto3
from aws_lambda_powertools.tracing import Tracer # pylint: disable=import-error
from aws_lambda_powertools.logging import logger_setup, logger_inject_lambda_context # pylint: disable=import-error
from ecom.apigateway import iam_user_id, resp... | 29.045977 | 115 | 0.673922 |
import os
from typing import Optional
import boto3
from aws_lambda_powertools.tracing import Tracer
from aws_lambda_powertools.logging import logger_setup, logger_inject_lambda_context
from ecom.apigateway import iam_user_id, response
ENVIRONMENT = os.environ["ENVIRONMENT"]
TABLE_NAME = os.environ["TABLE_NAME"]
... | true | true |
f74a70e614f31d80ec542fb488ce102f6c0ef811 | 7,658 | py | Python | py/torch_tensorrt/fx/test/converters/acc_op/test_eq.py | NVIDIA/Torch-TensorRT | 1a22204fecec690bc3c2a318dab4f57b98c57f05 | [
"BSD-3-Clause"
] | 430 | 2021-11-09T08:08:01.000Z | 2022-03-31T10:13:45.000Z | py/torch_tensorrt/fx/test/converters/acc_op/test_eq.py | NVIDIA/Torch-TensorRT | 1a22204fecec690bc3c2a318dab4f57b98c57f05 | [
"BSD-3-Clause"
] | 257 | 2021-11-09T07:17:03.000Z | 2022-03-31T20:29:31.000Z | py/torch_tensorrt/fx/test/converters/acc_op/test_eq.py | NVIDIA/Torch-TensorRT | 1a22204fecec690bc3c2a318dab4f57b98c57f05 | [
"BSD-3-Clause"
] | 68 | 2021-11-10T05:03:22.000Z | 2022-03-22T17:07:32.000Z | import torch
import torch_tensorrt.fx.tracer.acc_tracer.acc_ops as acc_ops
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt.fx.tools.common_fx2trt import AccTestCase
class TestEqConverter(AccTestCase):
@parameterized.expand(
[
... | 30.879032 | 88 | 0.463176 | import torch
import torch_tensorrt.fx.tracer.acc_tracer.acc_ops as acc_ops
from parameterized import parameterized
from torch.testing._internal.common_utils import run_tests
from torch_tensorrt.fx.tools.common_fx2trt import AccTestCase
class TestEqConverter(AccTestCase):
@parameterized.expand(
[
... | true | true |
f74a71b228228363243249cd0bc711b2d6d95ecb | 8,973 | py | Python | Exec/RegTests/FlameSheet/pprocConvOrder.py | hbrunie/PeleLM | 8b8c07aa1770c07e087f8976b6e16a71de68f751 | [
"BSD-3-Clause-LBNL"
] | 70 | 2018-11-21T01:49:23.000Z | 2022-03-28T08:54:24.000Z | Exec/RegTests/FlameSheet/pprocConvOrder.py | hbrunie/PeleLM | 8b8c07aa1770c07e087f8976b6e16a71de68f751 | [
"BSD-3-Clause-LBNL"
] | 82 | 2018-11-29T02:21:08.000Z | 2022-03-03T20:04:27.000Z | Exec/RegTests/FlameSheet/pprocConvOrder.py | hbrunie/PeleLM | 8b8c07aa1770c07e087f8976b6e16a71de68f751 | [
"BSD-3-Clause-LBNL"
] | 40 | 2018-11-05T11:54:03.000Z | 2022-03-19T13:33:40.000Z | #!/usr/bin/env python3
# Template post-processing script for PeleLM convergence analysis
# Must be used after multirun.py script
# Input are limited by the regression framework.
# Usage:
# ./pprocConvOrder.py --pproc_exec prog.exe --test_name DummyTest
# Input:
# * --pproc_exec: the processing executable path
# ... | 41.541667 | 166 | 0.589881 |
# - The script will get a copy of the post-processing program (if not already there) in the testing folder. The name of this folder is assumed to be the TESTNAME.
# - The plt files naming convention is: ${TESTNAME}_plt_${resolution}_*****. It is used to get the first and last solution of... | true | true |
f74a721685507c10befa6572926dbed38cf35591 | 37,109 | py | Python | rotkehlchen/tests/db/test_db.py | Christofon/rotki | 7f7d4e32e03dadffde1f6a38a92330a0ac588992 | [
"BSD-3-Clause"
] | null | null | null | rotkehlchen/tests/db/test_db.py | Christofon/rotki | 7f7d4e32e03dadffde1f6a38a92330a0ac588992 | [
"BSD-3-Clause"
] | null | null | null | rotkehlchen/tests/db/test_db.py | Christofon/rotki | 7f7d4e32e03dadffde1f6a38a92330a0ac588992 | [
"BSD-3-Clause"
] | null | null | null | import os
import time
from copy import deepcopy
from shutil import copyfile
from unittest.mock import patch
import pytest
from pysqlcipher3 import dbapi2 as sqlcipher
from rotkehlchen.assets.asset import Asset, EthereumToken
from rotkehlchen.constants import YEAR_IN_SECONDS
from rotkehlchen.constants.assets import A_... | 35.443171 | 98 | 0.695357 | import os
import time
from copy import deepcopy
from shutil import copyfile
from unittest.mock import patch
import pytest
from pysqlcipher3 import dbapi2 as sqlcipher
from rotkehlchen.assets.asset import Asset, EthereumToken
from rotkehlchen.constants import YEAR_IN_SECONDS
from rotkehlchen.constants.assets import A_... | true | true |
f74a723f1b078dc23da6fc0f9ceb1e96b1933fab | 2,813 | py | Python | setup.py | cloudmesh/cloudmesh-mpi | 58479926da029967fc3b19892cbaff140ff77e9e | [
"Apache-2.0"
] | 1 | 2022-02-27T17:28:02.000Z | 2022-02-27T17:28:02.000Z | setup.py | cloudmesh/cloudmesh-mpi | 58479926da029967fc3b19892cbaff140ff77e9e | [
"Apache-2.0"
] | 45 | 2021-05-10T22:39:19.000Z | 2021-10-04T19:52:26.000Z | setup.py | cloudmesh/cloudmesh-mpi | 58479926da029967fc3b19892cbaff140ff77e9e | [
"Apache-2.0"
] | 4 | 2021-07-13T19:14:08.000Z | 2022-03-26T15:32:06.000Z | #!/usr/bin/env python
# ----------------------------------------------------------------------- #
# Copyright 2017, Gregor von Laszewski, Indiana University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you ... | 33.488095 | 75 | 0.562744 |
from setuptools import find_packages, setup
import io
def readfile(filename):
with io.open(filename, encoding="utf-8") as stream:
return stream.read().split()
requiers = """
cloudmesh-cmd5
cloudmesh-sys
cloudmesh-inventory
cloudmesh-configuration
pandoc-fignos
""".split("\n")
version = readfile(... | true | true |
f74a72c13cbb475285ab4f329fbc2187fe15ce2f | 1,133 | py | Python | rejuvenate.py | thecodinghyrax/Rejuvenate | 6169e82a12394071f3edff87d484c75aefff03b7 | [
"MIT"
] | null | null | null | rejuvenate.py | thecodinghyrax/Rejuvenate | 6169e82a12394071f3edff87d484c75aefff03b7 | [
"MIT"
] | null | null | null | rejuvenate.py | thecodinghyrax/Rejuvenate | 6169e82a12394071f3edff87d484c75aefff03b7 | [
"MIT"
] | null | null | null | from gui.rejuv_gui import RejuvGUI
from controller import Controller
'''
Program: Rejuvenate
Author: Drew Crawford
Last Date Modified: 12/14/21
Purpose: The is program will update installed addons
from the game The Elder Scrolls Online.
Input: The uesr... | 33.323529 | 73 | 0.644307 | from gui.rejuv_gui import RejuvGUI
from controller import Controller
root = RejuvGUI()
if Controller.is_initial():
root.create_setup_screen()
local_addon_path = Controller.find_local_addon_folder()
if local_addon_path == '':
root.create_not_found_screen()
else:
root.create_db_update_... | true | true |
f74a72d267bbed973fdecfba04ee51de5fbc3ffe | 5,396 | py | Python | models/ObjectDetection/FoveaBox.py | Dou-Yu-xuan/deep-learning-visal | 82978f454c7f2662d0eb972b5a4a1e5d5961b232 | [
"Apache-2.0"
] | 150 | 2021-12-10T01:21:06.000Z | 2022-03-30T08:13:42.000Z | models/ObjectDetection/FoveaBox.py | Curdboycc/torch-template-for-deep-learning | da1ebc527d44c8c5a524e757a1d784ba37ec2d5c | [
"Apache-2.0"
] | 2 | 2021-12-23T04:59:54.000Z | 2021-12-23T06:23:24.000Z | models/ObjectDetection/FoveaBox.py | Curdboycc/torch-template-for-deep-learning | da1ebc527d44c8c5a524e757a1d784ba37ec2d5c | [
"Apache-2.0"
] | 54 | 2021-12-10T03:36:27.000Z | 2022-03-22T11:57:12.000Z | import torch
import torch.nn as nn
import torchvision
def Conv3x3ReLU(in_channels,out_channels):
return nn.Sequential(
nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=3,stride=1,padding=1),
nn.ReLU6(inplace=True)
)
def locLayer(in_channels,out_channels):
return nn.S... | 42.15625 | 114 | 0.644922 | import torch
import torch.nn as nn
import torchvision
def Conv3x3ReLU(in_channels,out_channels):
return nn.Sequential(
nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=3,stride=1,padding=1),
nn.ReLU6(inplace=True)
)
def locLayer(in_channels,out_channels):
return nn.S... | true | true |
f74a73ed235fee6f6be7792ebdcaa8762726590d | 905 | py | Python | setup.py | paparent/pyforrst | 70147a33b333c68fd8a72b5b5c502c3783b62c43 | [
"MIT"
] | 2 | 2016-03-01T22:16:45.000Z | 2016-07-17T18:07:27.000Z | setup.py | paparent/pyforrst | 70147a33b333c68fd8a72b5b5c502c3783b62c43 | [
"MIT"
] | null | null | null | setup.py | paparent/pyforrst | 70147a33b333c68fd8a72b5b5c502c3783b62c43 | [
"MIT"
] | null | null | null | import os
from setuptools import setup
from pyforrst import __version__
setup(
name='pyforrst',
version=__version__,
author='PA Parent',
author_email='paparent@paparent.me',
description='Python interface to Forrst API',
long_description=file(
os.path.join(
os.path.dirname(_... | 26.617647 | 71 | 0.61768 | import os
from setuptools import setup
from pyforrst import __version__
setup(
name='pyforrst',
version=__version__,
author='PA Parent',
author_email='paparent@paparent.me',
description='Python interface to Forrst API',
long_description=file(
os.path.join(
os.path.dirname(_... | true | true |
f74a74d4ea33998812f74d44a5dc821a659b4352 | 37,177 | py | Python | python/mxnet/module/module.py | QimingZheng/incubator-mxnet | 365f9d97f31a2b70b46c1c28df09749c55fc04cc | [
"Apache-2.0"
] | null | null | null | python/mxnet/module/module.py | QimingZheng/incubator-mxnet | 365f9d97f31a2b70b46c1c28df09749c55fc04cc | [
"Apache-2.0"
] | null | null | null | python/mxnet/module/module.py | QimingZheng/incubator-mxnet | 365f9d97f31a2b70b46c1c28df09749c55fc04cc | [
"Apache-2.0"
] | 1 | 2019-12-12T06:06:54.000Z | 2019-12-12T06:06:54.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... | 42.439498 | 103 | 0.618528 |
import logging
import warnings
from .. import context as ctx
from .. import optimizer as opt
from .. import ndarray as nd
from .executor_group import DataParallelExecutorGroup
from ..model import _create_kvstore, _initialize_kvstore, _update_params, _update_params_on_kvstore
from ..model import lo... | true | true |
f74a74fb0d0e3c047c0bfa0f457c7c3150686e96 | 3,155 | py | Python | pkgs/openpyxl-2.3.2-py27_0/lib/python2.7/site-packages/openpyxl/utils/datetime.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/openpyxl-2.3.2-py27_0/lib/python2.7/site-packages/openpyxl/utils/datetime.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/openpyxl-2.3.2-py27_0/lib/python2.7/site-packages/openpyxl/utils/datetime.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
# Copyright (c) 2010-2015 openpyxl
"""Manage Excel date weirdness."""
# Python stdlib imports
import datetime
from datetime import timedelta, tzinfo
import re
from jdcal import (
gcal2jd,
jd2gcal,
MJD_0
)
from openpyxl.compat import ... | 26.07438 | 96 | 0.657686 | from __future__ import absolute_import
from __future__ import division
import datetime
from datetime import timedelta, tzinfo
import re
from jdcal import (
gcal2jd,
jd2gcal,
MJD_0
)
from openpyxl.compat import lru_cache
MAC_EPOCH = datetime.date(1904, 1, 1)
WINDOWS_EPOCH = datetime.date(1899, 12, 30... | true | true |
f74a76870662297d100404bd6d8d5944fe2570d3 | 1,197 | py | Python | xixi/public/forms.py | defbobo/xixi | c06ce48738f9843cf18db08c15e2e0bc0a6e9edb | [
"BSD-3-Clause"
] | null | null | null | xixi/public/forms.py | defbobo/xixi | c06ce48738f9843cf18db08c15e2e0bc0a6e9edb | [
"BSD-3-Clause"
] | null | null | null | xixi/public/forms.py | defbobo/xixi | c06ce48738f9843cf18db08c15e2e0bc0a6e9edb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Public forms."""
from flask_wtf import Form
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired
from xixi.user.models import User
class LoginForm(Form):
"""Login form."""
username = StringField('Username', validators=[DataRequired()])
pas... | 29.925 | 77 | 0.639098 |
from flask_wtf import Form
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired
from xixi.user.models import User
class LoginForm(Form):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
... | true | true |
f74a77565e6e83623f5d23e34a7a6a32f10683c8 | 1,201 | py | Python | pimonitor.py | Flodip/WaterMonitor | 5f7d8d6f266d35e7d4dd655e6e47933abb28c697 | [
"MIT"
] | null | null | null | pimonitor.py | Flodip/WaterMonitor | 5f7d8d6f266d35e7d4dd655e6e47933abb28c697 | [
"MIT"
] | null | null | null | pimonitor.py | Flodip/WaterMonitor | 5f7d8d6f266d35e7d4dd655e6e47933abb28c697 | [
"MIT"
] | null | null | null | from sense_hat import SenseHat
import psycopg2
import numpy as np
import time
sense = SenseHat()
sense.set_imu_config(True, False, False) # compass, not gyro, not accel
database = "watermonitor"
try:
try:
conn = psycopg2.connect(
user="pi",
password="piwater",
host="1... | 27.930233 | 112 | 0.562032 | from sense_hat import SenseHat
import psycopg2
import numpy as np
import time
sense = SenseHat()
sense.set_imu_config(True, False, False)
database = "watermonitor"
try:
try:
conn = psycopg2.connect(
user="pi",
password="piwater",
host="127.0.0.1",
port="5... | true | true |
f74a77b1fd266d6954cfbb02e42a3488c8a90bc3 | 623 | py | Python | setup.py | geaden/panvalidator | fc9aa55c5c391a73620a64423fafe3945117b124 | [
"Apache-2.0"
] | null | null | null | setup.py | geaden/panvalidator | fc9aa55c5c391a73620a64423fafe3945117b124 | [
"Apache-2.0"
] | 1 | 2020-09-13T18:54:01.000Z | 2020-09-13T18:54:01.000Z | setup.py | geaden/panvalidator | fc9aa55c5c391a73620a64423fafe3945117b124 | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="panvalidator",
version="0.0.2",
author="Gennady Denisov",
author_email="denisovgena@gmail.com",
description="Primary Account Number validation tool",
long_description=long_description,... | 25.958333 | 57 | 0.682183 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="panvalidator",
version="0.0.2",
author="Gennady Denisov",
author_email="denisovgena@gmail.com",
description="Primary Account Number validation tool",
long_description=long_description,... | true | true |
f74a78734fae0c5976d71b6fc8077359cd69409e | 2,500 | py | Python | tests/evaluation/conftest.py | russells-crockpot/roll-with-it | 09b386553a151e19194f48b9384f97953a90953a | [
"MIT"
] | 2 | 2020-08-28T13:27:37.000Z | 2020-09-28T03:36:44.000Z | tests/evaluation/conftest.py | russells-crockpot/rollit | 09b386553a151e19194f48b9384f97953a90953a | [
"MIT"
] | null | null | null | tests/evaluation/conftest.py | russells-crockpot/rollit | 09b386553a151e19194f48b9384f97953a90953a | [
"MIT"
] | null | null | null | # pylint: disable=missing-docstring
import copy
import itertools
import functools
import pathlib
from collections import namedtuple
from contextlib import suppress
import pytest
from rollit.runtime import Runner
from rollit.runtime.towers import IncrementalTower
from rollit.util import is_valid_iterable
try:
fro... | 30.864198 | 95 | 0.6336 |
import copy
import itertools
import functools
import pathlib
from collections import namedtuple
from contextlib import suppress
import pytest
from rollit.runtime import Runner
from rollit.runtime.towers import IncrementalTower
from rollit.util import is_valid_iterable
try:
from ruamel import yaml
except ImportE... | true | true |
f74a7932ae857773a380fb896c806c939a97d835 | 7,548 | py | Python | app/dashboard/views/index.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | app/dashboard/views/index.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | app/dashboard/views/index.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from flask import render_template, request, redirect, url_for, flash
from flask_login import login_required, current_user
from app import alias_utils
from app.api.serializer import get_alias_infos_with_pagination_v3, get_alias_info_v3
from app.config import ALIAS_LIMIT, PAGE_LIMIT
fr... | 32.25641 | 97 | 0.604399 | from dataclasses import dataclass
from flask import render_template, request, redirect, url_for, flash
from flask_login import login_required, current_user
from app import alias_utils
from app.api.serializer import get_alias_infos_with_pagination_v3, get_alias_info_v3
from app.config import ALIAS_LIMIT, PAGE_LIMIT
fr... | true | true |
f74a7abfe8f2a37b2211bdf2df86d24c84c8e51e | 35,258 | py | Python | release/scripts/addons/rigify/legacy/utils.py | noorbeast/BlenderSource | 65ebecc5108388965678b04b43463b85f6c69c1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2019-03-20T13:10:46.000Z | 2019-05-15T20:00:31.000Z | engine/2.80/scripts/addons/rigify/legacy/utils.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | engine/2.80/scripts/addons/rigify/legacy/utils.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | #====================== BEGIN GPL LICENSE BLOCK ======================
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later vers... | 36.051125 | 2,270 | 0.601254 |
import bpy
import importlib
import importlib
import math
import random
import time
from mathutils import Vector, Matrix
from rna_prop_ui import rna_idprop_ui_prop_get
RIG_DIR = "rigs"
METARIG_DIR = "metarigs"
ORG_PREFIX = "ORG-"
MCH_PREFIX = "MCH-"
DEF_PREFIX = "DEF-"
WGT_PREFIX = "WGT-"... | true | true |
f74a7c28ce7db7d0ee79af20d356155185f68a23 | 98 | py | Python | CQA_FRONTEND/apps.py | utkueray/CQA | 38f5957fb982845810a5f230f9ab18a171bc9fb7 | [
"MIT"
] | 1 | 2020-08-31T07:20:01.000Z | 2020-08-31T07:20:01.000Z | CQA_FRONTEND/apps.py | zseda/CQA | 38f5957fb982845810a5f230f9ab18a171bc9fb7 | [
"MIT"
] | 5 | 2021-03-30T13:40:28.000Z | 2021-09-22T19:09:19.000Z | CQA_FRONTEND/apps.py | zseda/CQA | 38f5957fb982845810a5f230f9ab18a171bc9fb7 | [
"MIT"
] | 2 | 2020-06-12T20:20:41.000Z | 2021-03-09T16:32:06.000Z | from django.apps import AppConfig
class CqaFrontendConfig(AppConfig):
name = 'CQA_FRONTEND'
| 16.333333 | 35 | 0.77551 | from django.apps import AppConfig
class CqaFrontendConfig(AppConfig):
name = 'CQA_FRONTEND'
| true | true |
f74a7cd96d8dcb64f6c333008be8da062d0bbaf5 | 7,674 | py | Python | hover/core/explorer/specialization.py | haochuanwei/hover | 53eb38c718e44445b18a97e391b7f90270802b04 | [
"MIT"
] | null | null | null | hover/core/explorer/specialization.py | haochuanwei/hover | 53eb38c718e44445b18a97e391b7f90270802b04 | [
"MIT"
] | null | null | null | hover/core/explorer/specialization.py | haochuanwei/hover | 53eb38c718e44445b18a97e391b7f90270802b04 | [
"MIT"
] | null | null | null | """
???+ note "Child classes which are `functionality`-by-`feature` products."
This could resemble template specialization in C++.
"""
from .functionality import (
BokehDataFinder,
BokehDataAnnotator,
BokehSoftLabelExplorer,
BokehMarginExplorer,
BokehSnorkelExplorer,
)
from .feature import Bokeh... | 31.195122 | 86 | 0.710451 | from .functionality import (
BokehDataFinder,
BokehDataAnnotator,
BokehSoftLabelExplorer,
BokehMarginExplorer,
BokehSnorkelExplorer,
)
from .feature import BokehForText, BokehForAudio, BokehForImage
from bokeh.layouts import column, row
from deprecated import deprecated
class BokehTextFinder(Bokeh... | true | true |
f74a7d17428afa8c2a4bda27c8b8a78dd5351598 | 183 | py | Python | src/mbi/__init__.py | 122689305/private-pgm | 557f0381cd8c31c6277ccc61ec66702a8bdfcacc | [
"Apache-2.0"
] | null | null | null | src/mbi/__init__.py | 122689305/private-pgm | 557f0381cd8c31c6277ccc61ec66702a8bdfcacc | [
"Apache-2.0"
] | null | null | null | src/mbi/__init__.py | 122689305/private-pgm | 557f0381cd8c31c6277ccc61ec66702a8bdfcacc | [
"Apache-2.0"
] | 1 | 2020-06-10T07:57:10.000Z | 2020-06-10T07:57:10.000Z | from mbi.domain import Domain
from mbi.dataset import Dataset
from mbi.factor import Factor
from mbi.graphical_model import GraphicalModel
from mbi.inference import FactoredInference
| 30.5 | 46 | 0.863388 | from mbi.domain import Domain
from mbi.dataset import Dataset
from mbi.factor import Factor
from mbi.graphical_model import GraphicalModel
from mbi.inference import FactoredInference
| true | true |
f74a7db6a27c0a8fddb572c24044b07973d6f2cc | 25,897 | py | Python | Katna/image.py | jibinmathew69/katna | d95b58b7474d368c432b480cae0f48baa4288033 | [
"MIT"
] | null | null | null | Katna/image.py | jibinmathew69/katna | d95b58b7474d368c432b480cae0f48baa4288033 | [
"MIT"
] | null | null | null | Katna/image.py | jibinmathew69/katna | d95b58b7474d368c432b480cae0f48baa4288033 | [
"MIT"
] | null | null | null | """
.. module:: Katna.image
:platform: OS X
:synopsis: This module has functions related to smart cropping
"""
import os
import cv2
import numpy as np
from Katna.decorators import FileDecorators
from Katna.feature_list import FeatureList
from Katna.filter_list import FilterList
from Katna.crop_extractor import ... | 38.309172 | 148 | 0.621269 | import os
import cv2
import numpy as np
from Katna.decorators import FileDecorators
from Katna.feature_list import FeatureList
from Katna.filter_list import FilterList
from Katna.crop_extractor import CropExtractor
from Katna.crop_selector import CropSelector
import Katna.config as config
from Katna.decorators import D... | true | true |
f74a7fffc52cdaba37e9c31d638913b4e9157026 | 41 | py | Python | python_vectors/sqrt.py | evs-dev/PythonVectors | 6901db06de0c4abece7031cff5781174fc254a2f | [
"MIT"
] | null | null | null | python_vectors/sqrt.py | evs-dev/PythonVectors | 6901db06de0c4abece7031cff5781174fc254a2f | [
"MIT"
] | 1 | 2020-06-22T21:19:45.000Z | 2020-07-12T18:09:57.000Z | python_vectors/sqrt.py | evs-dev/PythonVectors | 6901db06de0c4abece7031cff5781174fc254a2f | [
"MIT"
] | null | null | null | def sqrt(number):
return number**0.5
| 13.666667 | 22 | 0.658537 | def sqrt(number):
return number**0.5
| true | true |
f74a800d52c9a13f43d5c6338e09adcac2d5a38d | 37,714 | py | Python | instances/passenger_demand/pas-20210421-2109-int12e/36.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int12e/36.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int12e/36.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 2718
passenger_arriving = (
(5, 3, 5, 3, 2, 0, 8, 7, 6, 3, 0, 0), # 0
(3, 4, 8, 1, 1, 0, 3, 6, 9, 6, 1, 0), # 1
(6, 12, 2, 2, 1, 0, 5, 9, 1, 4, 4, 0), # 2
(3, 10, 4, 1, 2, 0, 11, 6, 5, 2, 0, 0), # 3
(3, 4, 9, 3, 4, 0, 5, 7, 4, 4, 1, 0), # 4
(5, 11, 7, 3, 0, 0, 4, 12, 3, ... | 112.579104 | 213 | 0.727846 |
numPassengers = 2718
passenger_arriving = (
(5, 3, 5, 3, 2, 0, 8, 7, 6, 3, 0, 0),
(3, 4, 8, 1, 1, 0, 3, 6, 9, 6, 1, 0),
(6, 12, 2, 2, 1, 0, 5, 9, 1, 4, 4, 0),
(3, 10, 4, 1, 2, 0, 11, 6, 5, 2, 0, 0),
(3, 4, 9, 3, 4, 0, 5, 7, 4, 4, 1, 0),
(5, 11, 7, 3, 0, 0, 4, 12, 3, 2, 0, 0),
(4, 7, 5, 3, 1, 0, 11, 6, 2... | true | true |
f74a81963781c17710a48841b22f16a4f18e0752 | 2,991 | py | Python | pygin/example_games/Balance/game_objects/controllers/items_controller/star_score_controller.py | CarlosMatheus/Engine | 1467a919ad4489d0d4cb041b5f02aa67c6be6664 | [
"MIT"
] | 22 | 2018-12-29T16:31:19.000Z | 2022-03-07T13:12:40.000Z | pygin/example_games/Balance/game_objects/controllers/items_controller/star_score_controller.py | CarlosMatheus/Engine | 1467a919ad4489d0d4cb041b5f02aa67c6be6664 | [
"MIT"
] | 3 | 2018-08-14T14:45:40.000Z | 2020-01-22T08:03:27.000Z | pygin/example_games/Balance/game_objects/controllers/items_controller/star_score_controller.py | CarlosMatheus/Engine | 1467a919ad4489d0d4cb041b5f02aa67c6be6664 | [
"MIT"
] | 6 | 2018-05-29T20:02:02.000Z | 2021-11-13T19:35:23.000Z | from pygame.math import Vector2
from Balance.game_objects.mesh_objects.star import Star
from pygame import mixer
from pygin.time import Time
from pygin.game_object import GameObject
from random import uniform as randfloat
from pygin.basic_objects.text import Text
from pygin.material import Material
from pygin.color imp... | 40.418919 | 110 | 0.68773 | from pygame.math import Vector2
from Balance.game_objects.mesh_objects.star import Star
from pygame import mixer
from pygin.time import Time
from pygin.game_object import GameObject
from random import uniform as randfloat
from pygin.basic_objects.text import Text
from pygin.material import Material
from pygin.color imp... | true | true |
f74a8196724126c43e940ea8166377286cd31e50 | 109 | py | Python | scarab/__init__.py | gonzoua/scarab | b86474527b7b2ec30710ae79ea3f1cf5b7a93005 | [
"BSD-2-Clause"
] | 5 | 2018-09-01T01:42:43.000Z | 2019-01-04T21:32:55.000Z | scarab/__init__.py | gonzoua/scarab | b86474527b7b2ec30710ae79ea3f1cf5b7a93005 | [
"BSD-2-Clause"
] | 1 | 2019-09-18T17:06:11.000Z | 2019-11-29T18:35:08.000Z | scarab/__init__.py | gonzoua/scarab | b86474527b7b2ec30710ae79ea3f1cf5b7a93005 | [
"BSD-2-Clause"
] | null | null | null | # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
"""
Top-level scarab module
"""
__version__ = '0.1.3'
| 15.571429 | 53 | 0.706422 |
__version__ = '0.1.3'
| true | true |
f74a82083275bf8e8e243993919c4a33c055ab76 | 852 | py | Python | QIIDcurvature.py | csbrasnett/lipid-md | 22ac04a01277da7e64e58ba10a1e7a9791393fcc | [
"MIT"
] | 2 | 2020-11-02T14:55:31.000Z | 2021-05-04T05:12:14.000Z | QIIDcurvature.py | csbrasnett/lipid-md | 22ac04a01277da7e64e58ba10a1e7a9791393fcc | [
"MIT"
] | null | null | null | QIIDcurvature.py | csbrasnett/lipid-md | 22ac04a01277da7e64e58ba10a1e7a9791393fcc | [
"MIT"
] | 1 | 2020-11-02T16:35:21.000Z | 2020-11-02T16:35:21.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
author: Chris Brasnett, University of Bristol, christopher.brasnett@bristol.ac.uk
"""
import numpy as np
from QIIDderivative import derivative
def nominator(F_x, F_y, F_z, F_xx, F_xy, F_yy, F_yz, F_zz, F_xz):
m = np.array([[F_xx, F_xy, F_xz, F_x],
... | 23.027027 | 90 | 0.549296 |
import numpy as np
from QIIDderivative import derivative
def nominator(F_x, F_y, F_z, F_xx, F_xy, F_yy, F_yz, F_zz, F_xz):
m = np.array([[F_xx, F_xy, F_xz, F_x],
[F_xy, F_yy, F_yz, F_y],
[F_xz, F_yz, F_zz, F_z],
[F_x, F_y, F_z, 0]])
d = np.linalg.d... | true | true |
f74a821e5b36b246747cd39ed903464abfc7bdc5 | 399 | py | Python | demo/wsgi.py | typonaut/django-classified-demo | 1418fcadb8d16f5294258ec83e5508d369a179eb | [
"MIT"
] | 2 | 2021-01-30T03:25:32.000Z | 2021-01-30T03:25:33.000Z | demo/wsgi.py | typonaut/django-classified-demo | 1418fcadb8d16f5294258ec83e5508d369a179eb | [
"MIT"
] | null | null | null | demo/wsgi.py | typonaut/django-classified-demo | 1418fcadb8d16f5294258ec83e5508d369a179eb | [
"MIT"
] | null | null | null | """
WSGI config for allauthdemo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "allauthdemo.settings")
application = get_wsgi_application()
| true | true |
f74a829174398af36759c975481bc3680c3cc16b | 46,900 | py | Python | run_squad_debug.py | rungjoo/KoreaBERT_description | ad35b14ac8fb65593c0fe987680c2759e47478ab | [
"Apache-2.0"
] | null | null | null | run_squad_debug.py | rungjoo/KoreaBERT_description | ad35b14ac8fb65593c0fe987680c2759e47478ab | [
"Apache-2.0"
] | null | null | null | run_squad_debug.py | rungjoo/KoreaBERT_description | ad35b14ac8fb65593c0fe987680c2759e47478ab | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 36.328428 | 87 | 0.676567 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import math
import os
import random
import modeling
import optimization
import tokenization
import six
import tensorflow as tf
flags = tf.flags
FLAGS = flags.FLAG... | true | true |
f74a82ee565ff6863eb4360bd1be473c8fd5f4fd | 959 | py | Python | tests/framework/hybridModel/logicalCode/control.py | rinelson456/raven | 1114246136a2f72969e75b5e99a11b35500d4eef | [
"Apache-2.0"
] | 159 | 2017-03-24T21:07:06.000Z | 2022-03-20T13:44:40.000Z | tests/framework/hybridModel/logicalCode/control.py | rinelson456/raven | 1114246136a2f72969e75b5e99a11b35500d4eef | [
"Apache-2.0"
] | 1,667 | 2017-03-27T14:41:22.000Z | 2022-03-31T19:50:06.000Z | tests/framework/hybridModel/logicalCode/control.py | rinelson456/raven | 1114246136a2f72969e75b5e99a11b35500d4eef | [
"Apache-2.0"
] | 95 | 2017-03-24T21:05:03.000Z | 2022-03-08T17:30:22.000Z | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 33.068966 | 79 | 0.719499 |
def evaluate(self):
model = None
if self.x > 0.5 and self.y > 1.5:
model = 'poly'
else:
model = 'exp'
return model
| true | true |
f74a83a74f831cc043513753c2865ccee0b98ab7 | 27,314 | py | Python | source/states/level.py | bjotho/SMBgen | 425102a7fe2fadd1c5ce42f4fe88ebd663a8ed44 | [
"Apache-2.0"
] | null | null | null | source/states/level.py | bjotho/SMBgen | 425102a7fe2fadd1c5ce42f4fe88ebd663a8ed44 | [
"Apache-2.0"
] | null | null | null | source/states/level.py | bjotho/SMBgen | 425102a7fe2fadd1c5ce42f4fe88ebd663a8ed44 | [
"Apache-2.0"
] | 1 | 2021-12-20T00:27:29.000Z | 2021-12-20T00:27:29.000Z | __author__ = 'marble_xu'
import os
import json
import pygame as pg
from source import setup, tools
from source import constants as c
from source.states import level_state
from source.components import info, stuff, brick, box, enemy, coin
if c.HUMAN_PLAYER:
from source.components import player
else:
from sourc... | 42.479005 | 115 | 0.579776 | __author__ = 'marble_xu'
import os
import json
import pygame as pg
from source import setup, tools
from source import constants as c
from source.states import level_state
from source.components import info, stuff, brick, box, enemy, coin
if c.HUMAN_PLAYER:
from source.components import player
else:
from sourc... | true | true |
f74a84220470f880c2cacda046c20e3cb17c54ca | 208 | py | Python | feature.py | Saad-K/snowflake-connector-python | 38d123700313690ef65103368007f1cff06d4318 | [
"Apache-2.0"
] | 1 | 2020-08-04T08:30:42.000Z | 2020-08-04T08:30:42.000Z | feature.py | Saad-K/snowflake-connector-python | 38d123700313690ef65103368007f1cff06d4318 | [
"Apache-2.0"
] | null | null | null | feature.py | Saad-K/snowflake-connector-python | 38d123700313690ef65103368007f1cff06d4318 | [
"Apache-2.0"
] | 1 | 2021-02-09T17:52:35.000Z | 2021-02-09T17:52:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
# Feature flags
feature_use_pyopenssl = True # use pyopenssl API or openssl command
| 20.8 | 70 | 0.711538 |
feature_use_pyopenssl = True
| true | true |
f74a84b99d665800ab4ade1d9a79c5b5f1e1e0c4 | 37,003 | py | Python | cannab-solution/models.py | Hulihrach/RoadDetector | 9fedd537d7d3a5c81a60562a185fc13370af9a99 | [
"Apache-2.0"
] | 180 | 2018-04-27T15:42:28.000Z | 2022-03-20T02:37:37.000Z | cannab-solution/models.py | avanetten/RoadDetector | 0a7391f546ab20c873dc6744920deef22c21ef3e | [
"Apache-2.0"
] | 6 | 2018-09-21T18:31:37.000Z | 2020-04-28T19:11:20.000Z | cannab-solution/models.py | avanetten/RoadDetector | 0a7391f546ab20c873dc6744920deef22c21ef3e | [
"Apache-2.0"
] | 82 | 2018-04-30T13:53:10.000Z | 2022-03-20T02:37:43.000Z | from keras.applications.vgg16 import VGG16
from keras import backend as K
from keras.models import Model
from keras.layers import Input, BatchNormalization, Conv2D, MaxPooling2D, AveragePooling2D, concatenate, Concatenate, UpSampling2D, Activation, SpatialDropout2D, RepeatVector, Reshape
from resnet50_padding_same ... | 40.352236 | 184 | 0.609788 | from keras.applications.vgg16 import VGG16
from keras import backend as K
from keras.models import Model
from keras.layers import Input, BatchNormalization, Conv2D, MaxPooling2D, AveragePooling2D, concatenate, Concatenate, UpSampling2D, Activation, SpatialDropout2D, RepeatVector, Reshape
from resnet50_padding_same ... | true | true |
f74a85a7bb897e292af6763a5707c5cb5f14b411 | 612 | py | Python | idfy_rest_client/models/canceled.py | dealflowteam/Idfy | fa3918a6c54ea0eedb9146578645b7eb1755b642 | [
"MIT"
] | null | null | null | idfy_rest_client/models/canceled.py | dealflowteam/Idfy | fa3918a6c54ea0eedb9146578645b7eb1755b642 | [
"MIT"
] | null | null | null | idfy_rest_client/models/canceled.py | dealflowteam/Idfy | fa3918a6c54ea0eedb9146578645b7eb1755b642 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
idfy_rest_client.models.canceled
This file was automatically generated for Idfy by APIMATIC v2.0 ( https://apimatic.io )
"""
class Canceled(object):
"""Implementation of the 'Canceled' enum.
TODO: type enum description here.
Attributes:
OFF: T... | 19.741935 | 92 | 0.601307 |
class Canceled(object):
OFF = 'off'
SENDSMS = 'sendSms'
SENDEMAIL = 'sendEmail'
SENDBOTH = 'sendBoth'
| true | true |
f74a85ee60d62c7319986133224dad08ca9d48b4 | 10,720 | py | Python | tests/openai/test_modeling_tf_openai.py | elusenji/transformers | af14c61973effd8b8077ac61b3f24bdd4a632f25 | [
"Apache-2.0"
] | 3 | 2022-01-15T08:06:07.000Z | 2022-03-10T07:13:18.000Z | tests/openai/test_modeling_tf_openai.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | 1 | 2022-03-26T12:10:11.000Z | 2022-03-26T12:10:11.000Z | tests/openai/test_modeling_tf_openai.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | 1 | 2022-01-12T14:45:41.000Z | 2022-01-12T14:45:41.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 37.482517 | 117 | 0.670056 |
import unittest
from transformers import OpenAIGPTConfig, is_tf_available
from transformers.testing_utils import require_tf, slow
from ..test_configuration_common import ConfigTester
from ..test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
if is_tf_available():
... | true | true |
f74a85f34463ea944d35177705dfbee9a6c7041b | 919 | py | Python | University-of-Toronto-The Fundamentals/week6/parallel_list_str.py | Sam-Gao-Xin/Courses- | 122810e56024e6e72d378317b4f98c5a9d97e5f8 | [
"Apache-2.0"
] | 622 | 2018-07-17T09:05:41.000Z | 2022-03-29T02:57:02.000Z | University-of-Toronto-The Fundamentals/week6/parallel_list_str.py | thientvse/Courses- | 263ff4680ed1dfd253be3652f7f13ad707af1a36 | [
"Apache-2.0"
] | 21 | 2019-11-10T02:06:09.000Z | 2022-01-22T23:54:11.000Z | University-of-Toronto-The Fundamentals/week6/parallel_list_str.py | thientvse/Courses- | 263ff4680ed1dfd253be3652f7f13ad707af1a36 | [
"Apache-2.0"
] | 906 | 2018-07-17T09:05:43.000Z | 2022-03-31T12:55:49.000Z | def count_matches(s1, s2):
''' (str, str) -> int
Return the number of positions in s1 that contain the
same character at the corresponding position of s2.
Precondition: len(s1) == len(s2)
>>> count_matches('ate', 'ape')
2
>>> count_matches('head', 'hard')
2
'''
nu... | 19.978261 | 71 | 0.560392 | def count_matches(s1, s2):
num_matches = 0
for i in range(len(s1)):
if s1[i] == s2[i]:
num_matches = num_matches + 1
return num_matches
def sum_items(list1, list2):
sum_list = []
for i in range(len(list1)):
sum_list.append(list1[i] + list2[i])
return sum_l... | true | true |
f74a870427674442943df49f462390a5cd8556ca | 8,752 | py | Python | servo/forms/checkin.py | ipwnosx/Servo | 3418ece690ca90d676a7d8ae654da7770ae312fb | [
"BSD-2-Clause"
] | null | null | null | servo/forms/checkin.py | ipwnosx/Servo | 3418ece690ca90d676a7d8ae654da7770ae312fb | [
"BSD-2-Clause"
] | null | null | null | servo/forms/checkin.py | ipwnosx/Servo | 3418ece690ca90d676a7d8ae654da7770ae312fb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import gsxws
import phonenumbers
from django import forms
from datetime import date
from django.conf import settings
from django_countries import countries
from django.core.validators import RegexValidator
from django.utils.safestring import mark_safe
from django.utils.translation import ugett... | 29.972603 | 131 | 0.621229 |
import gsxws
import phonenumbers
from django import forms
from datetime import date
from django.conf import settings
from django_countries import countries
from django.core.validators import RegexValidator
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from djan... | true | true |
f74a87118baf3375d22cc39cd35a6d6aee885e2e | 1,227 | py | Python | docs/source/examples/test_sync.py | safl/pychapel | 76243e750833213b8dbc1ae55b29c24c9cdf7322 | [
"Apache-2.0"
] | 1 | 2015-08-04T02:11:03.000Z | 2015-08-04T02:11:03.000Z | docs/source/examples/test_sync.py | safl/pychapel | 76243e750833213b8dbc1ae55b29c24c9cdf7322 | [
"Apache-2.0"
] | null | null | null | docs/source/examples/test_sync.py | safl/pychapel | 76243e750833213b8dbc1ae55b29c24c9cdf7322 | [
"Apache-2.0"
] | null | null | null | from pych.extern import Chapel
@Chapel()
def ex_sync():
"""
writeln("Starting!");
sync {
begin writeln("#1 line.");
begin writeln("#2 line.");
begin writeln("#3 line.");
begin writeln("#4 line.");
begin writeln("#5 line.");
}
writeln("DONE!");
"""
ret... | 29.214286 | 79 | 0.632437 | from pych.extern import Chapel
@Chapel()
def ex_sync():
return None
if __name__ == '__main__':
ex_sync()
import testcase
import os.path
def test_sync():
out = testcase.runpy(os.path.realpath(__file__))
# we can't use out.startswith
startLoc = out.find('Starting!\n')
... | true | true |
f74a89154d1a94a9f1a65a6ce222363357f91de5 | 6,761 | py | Python | fidesctl/src/fidesctl/core/annotate_dataset.py | sanders41/fides | 014b4e5f90dac4a0c04f28f656314abd9e00a6c4 | [
"Apache-2.0"
] | null | null | null | fidesctl/src/fidesctl/core/annotate_dataset.py | sanders41/fides | 014b4e5f90dac4a0c04f28f656314abd9e00a6c4 | [
"Apache-2.0"
] | null | null | null | fidesctl/src/fidesctl/core/annotate_dataset.py | sanders41/fides | 014b4e5f90dac4a0c04f28f656314abd9e00a6c4 | [
"Apache-2.0"
] | null | null | null | """
This script is a utility for interactively annotating data categories in the dataset manifest
"""
from typing import Union, List
import click
from fidesctl.core import parse as core_parse, api_helpers
from fidesctl.core.config import FidesctlConfig
from fidesctl.core.utils import get_all_level_fields
from fidesl... | 37.77095 | 145 | 0.624464 |
from typing import Union, List
import click
from fidesctl.core import parse as core_parse, api_helpers
from fidesctl.core.config import FidesctlConfig
from fidesctl.core.utils import get_all_level_fields
from fideslang import manifests
from fideslang.models import Dataset, DatasetCollection, DatasetField, FidesKey
f... | true | true |
f74a895d8b4e030175438982a327c6b2d8800f7b | 25,470 | py | Python | tests/unit/test_dataset_geo.py | mollysacks/unify-client-python | b6790896fbcc8ac95d03f206d758db1cef8b1d29 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_dataset_geo.py | mollysacks/unify-client-python | b6790896fbcc8ac95d03f206d758db1cef8b1d29 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_dataset_geo.py | mollysacks/unify-client-python | b6790896fbcc8ac95d03f206d758db1cef8b1d29 | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
from functools import partial
import json
from unittest import TestCase
import responses
from tamr_unify_client import Client
from tamr_unify_client.auth import UsernamePasswordAuth
from tamr_unify_client.models.dataset.resource import Dataset
class TestDatasetGeo(TestCase):
def setUp(... | 36.230441 | 88 | 0.425481 | from copy import deepcopy
from functools import partial
import json
from unittest import TestCase
import responses
from tamr_unify_client import Client
from tamr_unify_client.auth import UsernamePasswordAuth
from tamr_unify_client.models.dataset.resource import Dataset
class TestDatasetGeo(TestCase):
def setUp(... | true | true |
f74a8a5399cd854112f4ba04e915d4df1d3be358 | 6,005 | py | Python | scripts/sample_mesh.py | nihalsid/texture_fields | dcd091a5f40fe433dbc47f2055d1cd2d3d2a1b87 | [
"MIT"
] | null | null | null | scripts/sample_mesh.py | nihalsid/texture_fields | dcd091a5f40fe433dbc47f2055d1cd2d3d2a1b87 | [
"MIT"
] | null | null | null | scripts/sample_mesh.py | nihalsid/texture_fields | dcd091a5f40fe433dbc47f2055d1cd2d3d2a1b87 | [
"MIT"
] | null | null | null | import argparse
import trimesh
import numpy as np
import os
import glob
import sys
from multiprocessing import Pool
from functools import partial
# TODO: do this better
sys.path.append('..')
parser = argparse.ArgumentParser('Sample a watertight mesh.')
parser.add_argument('in_folder', type=str,
hel... | 36.615854 | 79 | 0.624147 | import argparse
import trimesh
import numpy as np
import os
import glob
import sys
from multiprocessing import Pool
from functools import partial
sys.path.append('..')
parser = argparse.ArgumentParser('Sample a watertight mesh.')
parser.add_argument('in_folder', type=str,
help='Path to input water... | true | true |
f74a8a756e0cd5375d47a7d501110502c84a1165 | 5,044 | py | Python | filebrowser_safe/fields.py | khadegd/filebrowser-safe | 30635bcce58987badd8b9e6528f4c600533e0a65 | [
"BSD-3-Clause"
] | null | null | null | filebrowser_safe/fields.py | khadegd/filebrowser-safe | 30635bcce58987badd8b9e6528f4c600533e0a65 | [
"BSD-3-Clause"
] | null | null | null | filebrowser_safe/fields.py | khadegd/filebrowser-safe | 30635bcce58987badd8b9e6528f4c600533e0a65 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from future.builtins import str, super
import os
import datetime
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage
from django.db.models.fields import Field
from django.db.models.fields.files import FileDescriptor
fr... | 37.641791 | 138 | 0.659596 | from __future__ import unicode_literals
from future.builtins import str, super
import os
import datetime
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage
from django.db.models.fields import Field
from django.db.models.fields.files import FileDescriptor
fr... | true | true |
f74a8b27e2e648d15d7d5ba392108a42291437b2 | 1,044 | py | Python | 02-run_estimation.py | p00ya/climbing_ratings | 3dc47f7af59eed5d80c5c0a0cbcc47d102745159 | [
"Apache-2.0"
] | 14 | 2019-12-06T10:47:07.000Z | 2022-02-27T09:21:01.000Z | 02-run_estimation.py | p00ya/climbing_ratings | 3dc47f7af59eed5d80c5c0a0cbcc47d102745159 | [
"Apache-2.0"
] | 1 | 2020-03-04T00:35:04.000Z | 2020-03-05T21:35:38.000Z | 02-run_estimation.py | p00ya/climbing_ratings | 3dc47f7af59eed5d80c5c0a0cbcc47d102745159 | [
"Apache-2.0"
] | 3 | 2020-03-04T00:27:29.000Z | 2022-02-27T09:20:53.000Z | #!/usr/bin/env python3
"""Reads a pre-processed table of ascents and iteratively runs a WHR model.
This is just a stub; see the documentation for the climbing_ratings.__main__
module instead.
"""
# Copyright Contributors to the Climbing Ratings project
#
# Licensed under the Apache License, Version 2.0 (the "License... | 32.625 | 97 | 0.748084 |
from climbing_ratings.__main__ import main
import sys
if __name__ == "__main__":
print(
'warning: 02-run_estimation.py is deprecated, use "python3 -m climbing_ratings" instead',
file=sys.stderr,
)
main(sys.argv)
| true | true |
f74a8b9880f4e5c4e6f45d54a88ac04c848443f0 | 8,913 | py | Python | table_line.py | chineseocr/table-detect | 92488f30ffaf486d29791aab63802beeb1eaca32 | [
"MIT"
] | 152 | 2020-09-10T00:27:15.000Z | 2022-03-31T09:58:54.000Z | table_line.py | solofive/table-detect | 92488f30ffaf486d29791aab63802beeb1eaca32 | [
"MIT"
] | 23 | 2020-09-18T10:30:48.000Z | 2021-12-28T09:44:43.000Z | table_line.py | solofive/table-detect | 92488f30ffaf486d29791aab63802beeb1eaca32 | [
"MIT"
] | 68 | 2020-09-10T03:23:22.000Z | 2022-03-18T21:30:06.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 9 23:11:51 2020
table line detect
@author: chineseocr
"""
from tensorflow.keras.layers import Input, concatenate, Conv2D, MaxPooling2D, BatchNormalization, UpSampling2D
from tensorflow.keras.layers import LeakyReLU
from tensorflow.keras.models impor... | 37.1375 | 110 | 0.626052 |
from tensorflow.keras.layers import Input, concatenate, Conv2D, MaxPooling2D, BatchNormalization, UpSampling2D
from tensorflow.keras.layers import LeakyReLU
from tensorflow.keras.models import Model
def table_net(input_shape=(512, 512, 3), num_classes=1):
inputs = Input(shape=input_shape)
use_bias = F... | true | true |
f74a8c64974386fc5b075471304cb0b6a2251a62 | 18,732 | py | Python | keras_retinanet/bin/train.py | OmerMughal31/RetinaNet_modified | 207ec4fba35ef390af42fa0266ae95b86ecb9b08 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/train.py | OmerMughal31/RetinaNet_modified | 207ec4fba35ef390af42fa0266ae95b86ecb9b08 | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/train.py | OmerMughal31/RetinaNet_modified | 207ec4fba35ef390af42fa0266ae95b86ecb9b08 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 applicabl... | 32.805604 | 141 | 0.646114 |
import argparse
import os
import sys
import warnings
import keras
import keras.preprocessing.image
import tensorflow as tf
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import keras_retinanet.bin
__package__ = "keras_retin... | true | true |
f74a8cf727c4c67763d44f6237d1fd84b8a0ee7f | 11,664 | py | Python | dohq_teamcity/models/change.py | DenKoren/teamcity | 69acb4d1402c316129b4602882a9cce2d55cf926 | [
"MIT"
] | 23 | 2018-10-19T07:28:45.000Z | 2021-11-12T12:46:09.000Z | dohq_teamcity/models/change.py | DenKoren/teamcity | 69acb4d1402c316129b4602882a9cce2d55cf926 | [
"MIT"
] | 31 | 2018-10-16T05:53:11.000Z | 2021-09-09T14:44:14.000Z | dohq_teamcity/models/change.py | DenKoren/teamcity | 69acb4d1402c316129b4602882a9cce2d55cf926 | [
"MIT"
] | 12 | 2018-10-28T23:00:17.000Z | 2021-09-07T12:07:13.000Z | # coding: utf-8
from dohq_teamcity.custom.base_model import TeamCityObject
# from dohq_teamcity.models.changes import Changes # noqa: F401,E501
# from dohq_teamcity.models.file_changes import FileChanges # noqa: F401,E501
# from dohq_teamcity.models.items import Items # noqa: F401,E501
# from dohq_teamcity.models... | 25.69163 | 309 | 0.583933 |
from dohq_teamcity.custom.base_model import TeamCityObject
'version': 'str',
'internal_version': 'str',
'username': 'str',
'_date': 'str',
'registration_date': 'str',
'personal': 'bool',
'href': 'str',
'web_url': 'str',
'comment': 'str',
'u... | true | true |
f74a8db4d1d6a517ae86949086e29e1bab16c808 | 8,404 | py | Python | addons/dropbox/tests/test_views.py | yuanyuan-deng/RDM-osf.io | e1c54e97c898d26406d71129db7e4baf82802224 | [
"Apache-2.0"
] | 1 | 2019-12-23T04:30:20.000Z | 2019-12-23T04:30:20.000Z | addons/dropbox/tests/test_views.py | yuanyuan-deng/RDM-osf.io | e1c54e97c898d26406d71129db7e4baf82802224 | [
"Apache-2.0"
] | 17 | 2016-01-27T03:26:00.000Z | 2019-10-30T13:49:15.000Z | addons/dropbox/tests/test_views.py | yuanyuan-deng/RDM-osf.io | e1c54e97c898d26406d71129db7e4baf82802224 | [
"Apache-2.0"
] | 1 | 2015-08-28T20:00:52.000Z | 2015-08-28T20:00:52.000Z | """Views tests for the Dropbox addon."""
import httplib as http
import unittest
from dropbox.exceptions import ApiError
from nose.tools import assert_equal
from tests.base import OsfTestCase
from urllib3.exceptions import MaxRetryError
import mock
import pytest
from addons.base.tests import views as views_testing
fro... | 40.796117 | 114 | 0.696216 | import httplib as http
import unittest
from dropbox.exceptions import ApiError
from nose.tools import assert_equal
from tests.base import OsfTestCase
from urllib3.exceptions import MaxRetryError
import mock
import pytest
from addons.base.tests import views as views_testing
from addons.dropbox.tests.utils import (
... | true | true |
f74a8e133a307de92a833f3b602b39f641c110cc | 2,600 | py | Python | diffractsim/diffractive_elements/diffractive_element.py | rafael-fuente/diffractsim | 7287635d2bfa76f8b1eb24c6208796f761dd6144 | [
"BSD-3-Clause"
] | 29 | 2022-01-01T01:16:29.000Z | 2022-03-31T00:42:52.000Z | diffractsim/diffractive_elements/diffractive_element.py | rafael-fuente/diffractsim | 7287635d2bfa76f8b1eb24c6208796f761dd6144 | [
"BSD-3-Clause"
] | 2 | 2022-01-02T17:33:00.000Z | 2022-01-03T17:51:39.000Z | diffractsim/diffractive_elements/diffractive_element.py | rafael-fuente/diffractsim | 7287635d2bfa76f8b1eb24c6208796f761dd6144 | [
"BSD-3-Clause"
] | 6 | 2022-02-07T22:44:42.000Z | 2022-03-23T12:34:54.000Z | from abc import ABC, abstractmethod
from ..util.scaled_FT import scaled_fourier_transform
"""
MPL 2.0 License
Copyright (c) 2022, Rafael de la Fuente
All rights reserved.
"""
class DOE(ABC):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def get_transmittance(self, xx, yy, λ):
... | 29.213483 | 132 | 0.609231 | from abc import ABC, abstractmethod
from ..util.scaled_FT import scaled_fourier_transform
class DOE(ABC):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def get_transmittance(self, xx, yy, λ):
pass
def __add__(self, DOE2):
return DOE_mix(self, DOE2)
def get... | true | true |
f74a8f7a92a10e1cc9ad694f2a0639b2d8eda627 | 105 | py | Python | python/Hello/Hello-Const.py | HenrikBach1/Python-VSC-dev-containers | 3a561d60b6298a2f4279518b5ce684aab400e259 | [
"MIT"
] | 1 | 2021-09-23T07:01:51.000Z | 2021-09-23T07:01:51.000Z | python/Hello/Hello-Const.py | HenrikBach1/Python-VSC-dev-containers | 3a561d60b6298a2f4279518b5ce684aab400e259 | [
"MIT"
] | null | null | null | python/Hello/Hello-Const.py | HenrikBach1/Python-VSC-dev-containers | 3a561d60b6298a2f4279518b5ce684aab400e259 | [
"MIT"
] | null | null | null | const={
'Pi':3.14
,'Hello':"World"
}
print("{} is {}".format(const['Hello'], const['Pi']))
| 15 | 53 | 0.47619 | const={
'Pi':3.14
,'Hello':"World"
}
print("{} is {}".format(const['Hello'], const['Pi']))
| true | true |
f74a90527c28f5aac59a22226861eaf4f19b1287 | 389 | py | Python | sokoapp/sokoapp/wsgi.py | Mercy-Nekesa/sokoapp | 6c7bc4c1278b7223226124a49fc33c5b8b6b617a | [
"MIT"
] | 1 | 2019-04-01T05:52:37.000Z | 2019-04-01T05:52:37.000Z | sokoapp/sokoapp/wsgi.py | Mercy-Nekesa/sokoapp | 6c7bc4c1278b7223226124a49fc33c5b8b6b617a | [
"MIT"
] | 1 | 2015-03-11T16:18:12.000Z | 2015-03-11T16:18:12.000Z | sokoapp/sokoapp/wsgi.py | Mercy-Nekesa/sokoapp | 6c7bc4c1278b7223226124a49fc33c5b8b6b617a | [
"MIT"
] | null | null | null | """
WSGI config for sokoapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sokoapp.settings")
from django.core.w... | 25.933333 | 78 | 0.789203 |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sokoapp.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| true | true |
f74a913cb81ca72ad00adf05dcde704f1cad7758 | 2,234 | py | Python | setup.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 1 | 2020-12-18T12:23:04.000Z | 2020-12-18T12:23:04.000Z | setup.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 60 | 2020-07-06T15:10:30.000Z | 2022-03-31T06:01:46.000Z | setup.py | edofullin/core | 106dc4d28ad59cb192c60fc7a354cafa86899ea4 | [
"Apache-2.0"
] | 4 | 2017-01-10T04:17:33.000Z | 2021-09-02T16:37:24.000Z | #!/usr/bin/env python3
"""Home Assistant setup script."""
from datetime import datetime as dt
from setuptools import find_packages, setup
import homeassistant.const as hass_const
PROJECT_NAME = "Home Assistant"
PROJECT_PACKAGE_NAME = "homeassistant"
PROJECT_LICENSE = "Apache License 2.0"
PROJECT_AUTHOR = "The Home A... | 29.012987 | 77 | 0.686213 |
from datetime import datetime as dt
from setuptools import find_packages, setup
import homeassistant.const as hass_const
PROJECT_NAME = "Home Assistant"
PROJECT_PACKAGE_NAME = "homeassistant"
PROJECT_LICENSE = "Apache License 2.0"
PROJECT_AUTHOR = "The Home Assistant Authors"
PROJECT_COPYRIGHT = f" 2013-{dt.now().y... | true | true |
f74a9165775780b95f578b2f3a4587d488b830c8 | 391 | py | Python | restful/asgi.py | julesc00/restful | 11b5312caf4affeaa06e3ceb5b86a7c73357eed1 | [
"MIT"
] | null | null | null | restful/asgi.py | julesc00/restful | 11b5312caf4affeaa06e3ceb5b86a7c73357eed1 | [
"MIT"
] | null | null | null | restful/asgi.py | julesc00/restful | 11b5312caf4affeaa06e3ceb5b86a7c73357eed1 | [
"MIT"
] | null | null | null | """
ASGI config for restful project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'restful.settings')
application = get_asgi_application()
| true | true |
f74a922dc964ac0fa0a62d31db69510b214e4f42 | 7,873 | py | Python | Scripts/generate_processor_docs.py | gkluoe/autopkg | 512ea55e552265d381a1c02a08b1e6bdacb41715 | [
"Apache-2.0"
] | null | null | null | Scripts/generate_processor_docs.py | gkluoe/autopkg | 512ea55e552265d381a1c02a08b1e6bdacb41715 | [
"Apache-2.0"
] | null | null | null | Scripts/generate_processor_docs.py | gkluoe/autopkg | 512ea55e552265d381a1c02a08b1e6bdacb41715 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2013 Greg Neagle
#
# 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 ag... | 33.7897 | 82 | 0.640036 |
from __future__ import print_function
import imp
import optparse
import os
import sys
from tempfile import mkdtemp
try:
CODE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../Code"))
sys.path.append(CODE_DIR)
from autopkglib import get_processor, processor_names
except Im... | true | true |
f74a936f5bd1d160fe1894a5f0302ea813e40fa3 | 4,661 | py | Python | leo/plugins/QNCalendarWidget.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 1,550 | 2015-01-14T16:30:37.000Z | 2022-03-31T08:55:58.000Z | leo/plugins/QNCalendarWidget.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 2,009 | 2015-01-13T16:28:52.000Z | 2022-03-31T18:21:48.000Z | leo/plugins/QNCalendarWidget.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 200 | 2015-01-05T15:07:41.000Z | 2022-03-07T17:05:01.000Z | #@+leo-ver=5-thin
#@+node:ekr.20160519123329.1: * @file ../plugins/QNCalendarWidget.py
#@@language python
"""
QNCalendarWidget.py - a QCalendarWidget which shows N months at a time.
Not a full QCalendarWidget implementation, just enough to work
with a QDateEdit (QNDateEdit) in a particular context.
Terry_N_Brown@yaho... | 28.950311 | 79 | 0.586569 |
import sys
import datetime
from leo.core import leoGlobals as g
from leo.core.leoQt import isQt6, QtCore, QtWidgets
g.assertUi('qt')
def init():
return True
class QNCalendarWidget(QtWidgets.QCalendarWidget):
def __init__(self, n=3, columns=3, year=None, month=None):
super().__init__()
... | true | true |
f74a955bc5b4cc904a7d859a872d80397c0fff60 | 22,079 | py | Python | cogs/moderation.py | Joystickplays/GoMod | f48af46b08e095136cb048d9dbb76a5f539f4ea1 | [
"Apache-2.0"
] | 1 | 2022-02-25T04:25:21.000Z | 2022-02-25T04:25:21.000Z | cogs/moderation.py | Joystickplays/GoMod | f48af46b08e095136cb048d9dbb76a5f539f4ea1 | [
"Apache-2.0"
] | null | null | null | cogs/moderation.py | Joystickplays/GoMod | f48af46b08e095136cb048d9dbb76a5f539f4ea1 | [
"Apache-2.0"
] | null | null | null | import discord
from discord.ext import commands
from discord.commands import slash_command, Option
import asyncio
from bot import GoModBot
from discord.ui import InputText, Modal
class Modal(Modal):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_item(InputText(label... | 48.525275 | 337 | 0.604602 | import discord
from discord.ext import commands
from discord.commands import slash_command, Option
import asyncio
from bot import GoModBot
from discord.ui import InputText, Modal
class Modal(Modal):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_item(InputText(label... | true | true |
f74a96e45852f8ee602a11beb37426eac98a1609 | 244 | py | Python | package/cloudshell/cp/aws/common/converters.py | QualiSystemsLab/AWS-Shell | bf7b62640d8d97a5e9199edb7a1ada0b98aac6fb | [
"0BSD"
] | 1 | 2021-05-28T13:55:54.000Z | 2021-05-28T13:55:54.000Z | package/cloudshell/cp/aws/common/converters.py | QualiSystemsLab/AWS-Shell-ext | bf7b62640d8d97a5e9199edb7a1ada0b98aac6fb | [
"0BSD"
] | null | null | null | package/cloudshell/cp/aws/common/converters.py | QualiSystemsLab/AWS-Shell-ext | bf7b62640d8d97a5e9199edb7a1ada0b98aac6fb | [
"0BSD"
] | null | null | null | def convert_to_bool(string):
"""
Converts string to bool
:param string: String
:str string: str
:return: True or False
"""
if isinstance(string, bool):
return string
return string in ['true', 'True', '1'] | 24.4 | 42 | 0.602459 | def convert_to_bool(string):
if isinstance(string, bool):
return string
return string in ['true', 'True', '1'] | true | true |
f74a97300bb7fbc44e5083096c171f20f426c168 | 6,878 | py | Python | direct/src/distributed/TimeManager.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | direct/src/distributed/TimeManager.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | direct/src/distributed/TimeManager.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 1 | 2020-03-11T17:38:45.000Z | 2020-03-11T17:38:45.000Z | from direct.showbase.DirectObject import *
from pandac.PandaModules import *
from direct.task import Task
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import globalClockDelta
class TimeManager(DistributedObject.DistributedObject)... | 36.585106 | 100 | 0.67098 | from direct.showbase.DirectObject import *
from pandac.PandaModules import *
from direct.task import Task
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import globalClockDelta
class TimeManager(DistributedObject.DistributedObject)... | true | true |
f74a9803287a16f10f14ecd6e02ba778c08e95e2 | 102 | py | Python | createTrend/Search_Keyword/apps.py | junkwon-dev/createTrend_backend | 8ec550c4c5d38f898ad0285045a57e50ad30fcdb | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | createTrend/Search_Keyword/apps.py | junkwon-dev/createTrend_backend | 8ec550c4c5d38f898ad0285045a57e50ad30fcdb | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | createTrend/Search_Keyword/apps.py | junkwon-dev/createTrend_backend | 8ec550c4c5d38f898ad0285045a57e50ad30fcdb | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class SearchKeywordConfig(AppConfig):
name = 'Search_Keyword'
| 17 | 37 | 0.784314 | from django.apps import AppConfig
class SearchKeywordConfig(AppConfig):
name = 'Search_Keyword'
| true | true |
f74a98a0e1c66b27275615d861ce2aef37b0f4fb | 1,784 | py | Python | aoc/event2016/day16/solve.py | rjbatista/AoC | 5c6ca4bcb376c24ec730eb12fd7044f5326ee473 | [
"MIT"
] | null | null | null | aoc/event2016/day16/solve.py | rjbatista/AoC | 5c6ca4bcb376c24ec730eb12fd7044f5326ee473 | [
"MIT"
] | null | null | null | aoc/event2016/day16/solve.py | rjbatista/AoC | 5c6ca4bcb376c24ec730eb12fd7044f5326ee473 | [
"MIT"
] | null | null | null | ########
# PART 1
def dragon_step(a):
"""
For example, after a single step of this process,
1 becomes 100.
0 becomes 001.
11111 becomes 11111000000.
111100001010 becomes 1111000010100101011110000
"""
b = [0 if x==1 else 1 for x in a]
b.reverse()
return a + [0] + b
def check... | 27.030303 | 124 | 0.598094 | b = [0 if x==1 else 1 for x in a]
b.reverse()
return a + [0] + b
def checksum(input):
calc = [1 if a == b else 0 for a, b in zip(input[::2], input[1::2])]
if len(calc) % 2 == 0:
calc = checksum(calc)
return calc
def generate_disc(disc, length):
while len(disc) < length:
di... | true | true |
f74a99b88f67d6d473a3e3524bc90a559f9dd4d9 | 96,636 | py | Python | runtime/python/Lib/site-packages/pyvisa/attributes.py | hwaipy/InteractionFreeNode | 88642b68430f57b028fd0f276a5709f89279e30d | [
"MIT"
] | null | null | null | runtime/python/Lib/site-packages/pyvisa/attributes.py | hwaipy/InteractionFreeNode | 88642b68430f57b028fd0f276a5709f89279e30d | [
"MIT"
] | null | null | null | runtime/python/Lib/site-packages/pyvisa/attributes.py | hwaipy/InteractionFreeNode | 88642b68430f57b028fd0f276a5709f89279e30d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Descriptor to access VISA attributes.
Not all descriptors are used but they provide a reference regarding the
possible values for each attributes.
This file is part of PyVISA.
:copyright: 2014-2020 by PyVISA Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details... | 24.243853 | 88 | 0.671158 |
import enum
import sys
from collections import defaultdict
from typing import (
TYPE_CHECKING,
Any,
Dict,
Generic,
List,
Optional,
Set,
SupportsBytes,
SupportsInt,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import ClassVar, DefaultDict
from... | true | true |
f74a99dacf69bb3e20e18fe7725f216fdf7fa6e0 | 112 | py | Python | src/papavisor/__init__.py | webmeisterei/papavisor | dafbe7b8d54f3519128db084249018ca9d4f8d11 | [
"BSD-3-Clause"
] | 2 | 2018-10-21T18:42:15.000Z | 2020-04-20T13:05:42.000Z | src/papavisor/__init__.py | webmeisterei/papavisor | dafbe7b8d54f3519128db084249018ca9d4f8d11 | [
"BSD-3-Clause"
] | null | null | null | src/papavisor/__init__.py | webmeisterei/papavisor | dafbe7b8d54f3519128db084249018ca9d4f8d11 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pkg_resources
__version__ = pkg_resources.get_distribution("papavisor").version
| 22.4 | 65 | 0.758929 |
import pkg_resources
__version__ = pkg_resources.get_distribution("papavisor").version
| true | true |
f74a9b4a286f7feb507bdb77a2c21066687fb3cf | 2,378 | py | Python | plugins/Time/__init__.py | MicrohexHQ/supybot_fixes | f14e51f0379eee641c8b9c80a9259628f509f832 | [
"BSD-3-Clause"
] | 40 | 2015-01-28T22:16:36.000Z | 2021-12-15T02:22:56.000Z | plugins/Time/__init__.py | prashantpawar/supybot-rothbot | dc04c133bec01574057a37d105c93c6076daccfc | [
"BSD-3-Clause"
] | 17 | 2015-01-05T21:06:22.000Z | 2015-12-07T20:45:44.000Z | plugins/Time/__init__.py | prashantpawar/supybot-rothbot | dc04c133bec01574057a37d105c93c6076daccfc | [
"BSD-3-Clause"
] | 28 | 2015-01-03T23:53:58.000Z | 2021-06-01T05:27:20.000Z | ###
# Copyright (c) 2005, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | 38.983607 | 79 | 0.768293 |
import supybot
import supybot.world as world
__version__ = "%%VERSION%%"
__author__ = supybot.authors.jemfinch
# This is a dictionary mapping supybot.Author instances to lists of
# contributions.
__contributors__ = {}
import config
import plugin
reload(plugin) # In case we're being reloade... | true | true |
f74a9c2c1f7f6d559015e06b4bfcb2342278aaec | 1,665 | py | Python | models/lr.py | Jie-Yuan/Torchappy | e722db1085fa2ff8e0267f7e6745875531c00f8b | [
"Apache-2.0"
] | 1 | 2018-12-18T15:48:02.000Z | 2018-12-18T15:48:02.000Z | models/lr.py | Jie-Yuan/Torchappy | e722db1085fa2ff8e0267f7e6745875531c00f8b | [
"Apache-2.0"
] | null | null | null | models/lr.py | Jie-Yuan/Torchappy | e722db1085fa2ff8e0267f7e6745875531c00f8b | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import tqdm, tqdm_notebook
from ml_metrics import auc
from sklearn.datasets import make_classification
class LogsticRegression(nn.Module):
def __init__(self, in_dim, n_class):
super().__init__()
self.fc1 = nn.Linear(in_di... | 30.833333 | 78 | 0.613814 | import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm import tqdm, tqdm_notebook
from ml_metrics import auc
from sklearn.datasets import make_classification
class LogsticRegression(nn.Module):
def __init__(self, in_dim, n_class):
super().__init__()
self.fc1 = nn.Linear(in_di... | true | true |
f74a9c3034fda1f4b94024dc286045ab295994b7 | 3,810 | py | Python | fixture/group.py | karlson35/python_training | 0626341c0d3060128e9cb50419cdef56b2b0d8e1 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | karlson35/python_training | 0626341c0d3060128e9cb50419cdef56b2b0d8e1 | [
"Apache-2.0"
] | null | null | null | fixture/group.py | karlson35/python_training | 0626341c0d3060128e9cb50419cdef56b2b0d8e1 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Igor Nikolaev'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
group_cache = None
def create(self, group):
wd = self.app.wd
self.open_groups_page()
wd.find_element_by_name("new").click()
self.fill_group_form(... | 33.130435 | 100 | 0.640945 | __author__ = 'Igor Nikolaev'
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
group_cache = None
def create(self, group):
wd = self.app.wd
self.open_groups_page()
wd.find_element_by_name("new").click()
self.fill_group_form(... | true | true |
f74a9cb915d2280787489e476d9c7686ccb36b3a | 360 | py | Python | wave_utils/scripts/plot_matrix.py | Jebediah/libwave | c04998c964f0dc7d414783c6e8cf989a2716ad54 | [
"MIT"
] | 2 | 2019-06-13T13:47:18.000Z | 2019-06-13T14:54:35.000Z | wave_utils/scripts/plot_matrix.py | Jebediah/libwave | c04998c964f0dc7d414783c6e8cf989a2716ad54 | [
"MIT"
] | null | null | null | wave_utils/scripts/plot_matrix.py | Jebediah/libwave | c04998c964f0dc7d414783c6e8cf989a2716ad54 | [
"MIT"
] | 1 | 2020-02-13T02:27:29.000Z | 2020-02-13T02:27:29.000Z | import sys
import numpy as np
import matplotlib.pylab as plt
if __name__ == "__main__":
file = open(sys.argv[1], "r")
X = np.loadtxt(file)
X = np.matrix(X)
print(X.shape)
fig, ax = plt.subplots()
cax = ax.matshow(X)
ax.set_xticks(range(0, X.shape[1]))
ax.set_yticks(range(0, X.shape[0]... | 20 | 39 | 0.611111 | import sys
import numpy as np
import matplotlib.pylab as plt
if __name__ == "__main__":
file = open(sys.argv[1], "r")
X = np.loadtxt(file)
X = np.matrix(X)
print(X.shape)
fig, ax = plt.subplots()
cax = ax.matshow(X)
ax.set_xticks(range(0, X.shape[1]))
ax.set_yticks(range(0, X.shape[0]... | true | true |
f74a9dae4223adce015554e42851cb46accf0be0 | 594 | py | Python | app/apps/coreExtend/context_processors.py | underlost/ulost.net | b0eb1cbb0923d9e7dd27f623fa1018e948760dcb | [
"MIT"
] | 1 | 2017-04-22T11:03:13.000Z | 2017-04-22T11:03:13.000Z | app/apps/coreExtend/context_processors.py | underlost/ulost.net | b0eb1cbb0923d9e7dd27f623fa1018e948760dcb | [
"MIT"
] | null | null | null | app/apps/coreExtend/context_processors.py | underlost/ulost.net | b0eb1cbb0923d9e7dd27f623fa1018e948760dcb | [
"MIT"
] | null | null | null | from django.conf import settings
import datetime
def template_settings(request):
return {
'site_name': settings.SITE_NAME,
'site_desc': settings.SITE_DESC,
'site_author': settings.SITE_AUTHOR,
'site_url': settings.SITE_URL,
'site_register': settings.ALLOW_NEW_REGISTRATIONS,
... | 29.7 | 69 | 0.643098 | from django.conf import settings
import datetime
def template_settings(request):
return {
'site_name': settings.SITE_NAME,
'site_desc': settings.SITE_DESC,
'site_author': settings.SITE_AUTHOR,
'site_url': settings.SITE_URL,
'site_register': settings.ALLOW_NEW_REGISTRATIONS,
... | true | true |
f74a9dd91d80adb86f7b1d3fd051707df8758eec | 6,915 | py | Python | client/client.py | Tortle6/wordle-racer | 3bb00e74e7a381bc55fd489def1086d928a65854 | [
"MIT"
] | null | null | null | client/client.py | Tortle6/wordle-racer | 3bb00e74e7a381bc55fd489def1086d928a65854 | [
"MIT"
] | null | null | null | client/client.py | Tortle6/wordle-racer | 3bb00e74e7a381bc55fd489def1086d928a65854 | [
"MIT"
] | null | null | null | # Import packages
import copy
import pickle
import socket
from string import ascii_lowercase
import enchant
from colorama import Fore, init
init(autoreset=True)
d = enchant.Dict("en_US")
# Read config file
SOLUTION_FILE = "solution_words.json"
SETTINGS_FILE = "settings.json"
EMPTY = "—"
HEADERSIZE ... | 30.065217 | 101 | 0.539262 |
import copy
import pickle
import socket
from string import ascii_lowercase
import enchant
from colorama import Fore, init
init(autoreset=True)
d = enchant.Dict("en_US")
SOLUTION_FILE = "solution_words.json"
SETTINGS_FILE = "settings.json"
EMPTY = "—"
HEADERSIZE = 10
while True:
IP = input(... | true | true |
f74a9e0e9d13e818dd8eb747bec738a2915bdfe2 | 357,961 | py | Python | feedback_pipeline.py | minimization/feedback-pipeline | ab93a27bcc5487993f942807a35d56c0f7284a32 | [
"MIT"
] | 3 | 2019-10-07T14:08:06.000Z | 2020-03-04T09:55:27.000Z | feedback_pipeline.py | minimization/feedback-pipeline | ab93a27bcc5487993f942807a35d56c0f7284a32 | [
"MIT"
] | 13 | 2019-09-06T13:27:08.000Z | 2020-04-22T13:20:39.000Z | feedback_pipeline.py | minimization/feedback-pipeline | ab93a27bcc5487993f942807a35d56c0f7284a32 | [
"MIT"
] | 5 | 2019-09-22T08:09:57.000Z | 2020-04-06T15:57:26.000Z | #!/usr/bin/python3
import argparse, yaml, tempfile, os, subprocess, json, jinja2, datetime, copy, re, dnf, pprint, urllib.request, sys, koji
import concurrent.futures
import rpm_showme as showme
from functools import lru_cache
import multiprocessing, asyncio
# Features of this new release
# - multiarch from the grou... | 42.487953 | 231 | 0.549546 |
import argparse, yaml, tempfile, os, subprocess, json, jinja2, datetime, copy, re, dnf, pprint, urllib.request, sys, koji
import concurrent.futures
import rpm_showme as showme
from functools import lru_cache
import multiprocessing, asyncio
[arch].append(pkg)
return config
def _load_config_buildroot(doc... | true | true |
f74a9e242d86139a48edc2de79fb7923231484ca | 779 | py | Python | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/threading/threading_local_defaults.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/threading/threading_local_defaults.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/threading/threading_local_defaults.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | #
"""Defaults for thread-local values
"""
# end_pymotw_header
import random
import threading
import logging
def show_value(data):
try:
val = data.value
except AttributeError:
logging.debug("No value yet")
else:
logging.debug("value=%s", val)
def worker(data):
show_value(data... | 19 | 82 | 0.662388 |
import random
import threading
import logging
def show_value(data):
try:
val = data.value
except AttributeError:
logging.debug("No value yet")
else:
logging.debug("value=%s", val)
def worker(data):
show_value(data)
data.value = random.randint(1, 100)
show_value(dat... | true | true |
f74a9e9b08cb1f8c919e8d1ca51905b2b548f308 | 1,663 | gyp | Python | tools/relocation_packer/relocation_packer.gyp | justremotephone/android_external_chromium_org | 246856e61da7acf5494076c74198f2aea894a721 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2020-01-25T10:18:18.000Z | 2021-01-23T15:29:56.000Z | tools/relocation_packer/relocation_packer.gyp | justremotephone/android_external_chromium_org | 246856e61da7acf5494076c74198f2aea894a721 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/relocation_packer/relocation_packer.gyp | justremotephone/android_external_chromium_org | 246856e61da7acf5494076c74198f2aea894a721 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:24:13.000Z | 2020-11-04T07:24:13.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'lib_relocation_packer',
'toolsets': ['host'],
'type': 'static_library',
'dependencies': [
... | 24.820896 | 72 | 0.51834 |
{
'targets': [
{
'target_name': 'lib_relocation_packer',
'toolsets': ['host'],
'type': 'static_library',
'dependencies': [
'../../third_party/elfutils/elfutils.gyp:libelf',
],
'sources': [
'src/debug.cc',
'src/elf_file.cc',
'src/leb128.cc',
... | true | true |
f74aa0199316432844928160edace21358d3b7fc | 2,730 | py | Python | dow/classes/SlideShow.py | Denkisen/um | 36821339d1f5fc7d4ebb12be84d70804da353e3c | [
"MIT"
] | null | null | null | dow/classes/SlideShow.py | Denkisen/um | 36821339d1f5fc7d4ebb12be84d70804da353e3c | [
"MIT"
] | null | null | null | dow/classes/SlideShow.py | Denkisen/um | 36821339d1f5fc7d4ebb12be84d70804da353e3c | [
"MIT"
] | null | null | null | import pathlib
from PySide6 import QtCore, QtWidgets, QtGui
import json
from ffpyplayer.player import MediaPlayer
from classes import DowConfig
from classes import DowDatabase
from classes import DowGlImage
from .SequenceScriptParser import DowSequenceScriptParser
class DowSlideShowManager(QtWidgets.QWidget):
def __... | 35.921053 | 120 | 0.736264 | import pathlib
from PySide6 import QtCore, QtWidgets, QtGui
import json
from ffpyplayer.player import MediaPlayer
from classes import DowConfig
from classes import DowDatabase
from classes import DowGlImage
from .SequenceScriptParser import DowSequenceScriptParser
class DowSlideShowManager(QtWidgets.QWidget):
def __... | true | true |
f74aa114cfd182f956c3bf3725d543c6f70b6d1e | 4,508 | py | Python | cogkge/modules/gnn/helper.py | jinzhuoran/CogKGE | b0e819a1d34cf61a7d70c33808da3377b73c8fd6 | [
"MIT"
] | 18 | 2022-01-22T09:52:57.000Z | 2022-03-22T15:02:12.000Z | cogkge/modules/gnn/helper.py | jinzhuoran/CogKGE | b0e819a1d34cf61a7d70c33808da3377b73c8fd6 | [
"MIT"
] | null | null | null | cogkge/modules/gnn/helper.py | jinzhuoran/CogKGE | b0e819a1d34cf61a7d70c33808da3377b73c8fd6 | [
"MIT"
] | null | null | null | import numpy as np, sys, os, random, pdb, json, uuid, time, argparse
from pprint import pprint
import logging, logging.config
from collections import defaultdict as ddict
# from ordered_set import OrderedSet
# PyTorch related imports
import torch
from torch.nn import functional as F
from torch.nn.init import xavier_no... | 30.666667 | 110 | 0.630878 | import numpy as np, sys, os, random, pdb, json, uuid, time, argparse
from pprint import pprint
import logging, logging.config
from collections import defaultdict as ddict
import torch
from torch.nn import functional as F
from torch.nn.init import xavier_normal_
from torch.utils.data import DataLoader
from torch.nn i... | true | true |
f74aa16bcbbe64cf11dada7ce248b0c66a7d6273 | 7,409 | py | Python | Tests.py | agamia/RegExpBuilder | 087231288d8a6d81b7152d3adbe8ab466710d347 | [
"MIT"
] | 1 | 2015-07-26T10:45:14.000Z | 2015-07-26T10:45:14.000Z | Tests.py | agamia/RegExpBuilder | 087231288d8a6d81b7152d3adbe8ab466710d347 | [
"MIT"
] | null | null | null | Tests.py | agamia/RegExpBuilder | 087231288d8a6d81b7152d3adbe8ab466710d347 | [
"MIT"
] | null | null | null | import unittest
from RegExpBuilder import RegExpBuilder
class Test(unittest.TestCase):
def test_startOfLine(self):
regex = RegExpBuilder()
regex.startOfLine()
regex.exactly(1).of("p")
regex = regex.getRegExp()
self.assertTrue(regex.match("p") is not None)
... | 34.621495 | 75 | 0.570792 | import unittest
from RegExpBuilder import RegExpBuilder
class Test(unittest.TestCase):
def test_startOfLine(self):
regex = RegExpBuilder()
regex.startOfLine()
regex.exactly(1).of("p")
regex = regex.getRegExp()
self.assertTrue(regex.match("p") is not None)
... | true | true |
f74aa1b59ab518f68440c6a11d7b2610814c4a01 | 48 | py | Python | my_pkg/file_module.py | Mr-Milk/python-hmr | 1a71f3413ea2374afc27919031db02e09f0f6b75 | [
"MIT"
] | 8 | 2021-01-20T13:28:23.000Z | 2021-08-20T21:35:46.000Z | my_pkg/file_module.py | Mr-Milk/python-hmr | 1a71f3413ea2374afc27919031db02e09f0f6b75 | [
"MIT"
] | 5 | 2022-02-07T14:54:50.000Z | 2022-03-01T20:19:19.000Z | my_pkg/file_module.py | Mr-Milk/python-hmr | 1a71f3413ea2374afc27919031db02e09f0f6b75 | [
"MIT"
] | null | null | null | def file_func():
return "Hi from file_func"
| 16 | 30 | 0.6875 | def file_func():
return "Hi from file_func"
| true | true |
f74aa208e39f06927765a9e96bbd5ab254b37a9e | 3,821 | py | Python | core/tests/task_test.py | Smarsh/norc | c3608c97f6d6c292689e3d693c2a3e211df24138 | [
"BSD-3-Clause"
] | null | null | null | core/tests/task_test.py | Smarsh/norc | c3608c97f6d6c292689e3d693c2a3e211df24138 | [
"BSD-3-Clause"
] | null | null | null | core/tests/task_test.py | Smarsh/norc | c3608c97f6d6c292689e3d693c2a3e211df24138 | [
"BSD-3-Clause"
] | null | null | null |
"""Module for testing CommandTasks."""
import os, sys
import time
from django.test import TestCase
from norc.core.models import CommandTask, Instance, Revision
from norc.core.constants import Status
from norc.norc_utils import log
class TestTask(TestCase):
"""Tests for Norc tasks."""
def run_task(self... | 36.390476 | 77 | 0.637529 |
import os, sys
import time
from django.test import TestCase
from norc.core.models import CommandTask, Instance, Revision
from norc.core.constants import Status
from norc.norc_utils import log
class TestTask(TestCase):
def run_task(self, task):
if type(task) == str:
task = CommandTask.o... | true | true |
f74aa55881452e7becf7106ac590ba01233b0c43 | 163 | py | Python | _solutions/advanced/generator/generator_builtin_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/advanced/generator/generator_builtin_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/advanced/generator/generator_builtin_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null |
result = (x for x in range(1, 34) if x % 3 == 0)
result = filter(odd, result)
result = map(cube, result)
result = list(result)
result = sum(result) / len(result)
| 23.285714 | 48 | 0.650307 |
result = (x for x in range(1, 34) if x % 3 == 0)
result = filter(odd, result)
result = map(cube, result)
result = list(result)
result = sum(result) / len(result)
| true | true |
f74aa66b217e18393ccacfae6f7ec8fbb8bfaa16 | 243 | py | Python | Vamei/decorator/decorator2.py | YangPhy/learnPython | 5507fa1a0d2878fc663d62509af8ff959955f822 | [
"MIT"
] | 5 | 2020-05-18T06:54:52.000Z | 2021-05-29T23:17:41.000Z | Vamei/decorator/decorator2.py | YangPhy/learnPython | 5507fa1a0d2878fc663d62509af8ff959955f822 | [
"MIT"
] | null | null | null | Vamei/decorator/decorator2.py | YangPhy/learnPython | 5507fa1a0d2878fc663d62509af8ff959955f822 | [
"MIT"
] | 1 | 2020-05-17T22:47:49.000Z | 2020-05-17T22:47:49.000Z | # modify : print input
# get square sum
def square_sum(a,b):
print('input:',a,b)
return a**2+b**2
# get square diff
def square_diff(a,b):
print('input:',a,b)
return a**2-b**2
print(square_sum(3,4))
print(square_diff(3,4))
| 16.2 | 23 | 0.621399 |
def square_sum(a,b):
print('input:',a,b)
return a**2+b**2
def square_diff(a,b):
print('input:',a,b)
return a**2-b**2
print(square_sum(3,4))
print(square_diff(3,4))
| true | true |
f74aa69b1ec1c8ec29154472cd3650135bbdf05b | 2,580 | py | Python | setup.py | alexandrebouayad/Cirq | 4ba730b17b6af6265ee6458eb40172b847bd5684 | [
"Apache-2.0"
] | null | null | null | setup.py | alexandrebouayad/Cirq | 4ba730b17b6af6265ee6458eb40172b847bd5684 | [
"Apache-2.0"
] | null | null | null | setup.py | alexandrebouayad/Cirq | 4ba730b17b6af6265ee6458eb40172b847bd5684 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.4 | 100 | 0.733333 |
import io
import os
from setuptools import setup
__version__ = ''
from dev_tools import modules
from dev_tools.requirements import explode
exec(open('cirq-core/cirq/_version.py').read())
name = 'cirq'
description = (
'A framework for creating, editing, and invoking '
'Noisy Intermediate Scal... | true | true |
f74aa7673c0ab0e026c3156607ae38914e059603 | 10,586 | py | Python | train_matchnet.py | chenxiaoyu523/FEAT3D | ba45ba7c26628a7cc0070b010f4f33893cdac926 | [
"MIT"
] | null | null | null | train_matchnet.py | chenxiaoyu523/FEAT3D | ba45ba7c26628a7cc0070b010f4f33893cdac926 | [
"MIT"
] | null | null | null | train_matchnet.py | chenxiaoyu523/FEAT3D | ba45ba7c26628a7cc0070b010f4f33893cdac926 | [
"MIT"
] | null | null | null | import argparse
import os.path as osp
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from feat.dataloader.samplers import CategoriesSampler
from feat.models.matchnet import MatchNet
from feat.utils import pprint, set_gpu, ensure_path, Averager, Timer, count_acc... | 43.03252 | 187 | 0.607784 | import argparse
import os.path as osp
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from feat.dataloader.samplers import CategoriesSampler
from feat.models.matchnet import MatchNet
from feat.utils import pprint, set_gpu, ensure_path, Averager, Timer, count_acc... | true | true |
f74aa85e52528d541d68d1ce40f9e123e6bbfebe | 509 | py | Python | packages/python/plotly/plotly/validators/layout/scene/annotation/_yanchor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/scene/annotation/_yanchor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/scene/annotation/_yanchor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yanchor", parent_name="layout.scene.annotation", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
p... | 33.933333 | 84 | 0.638507 | import _plotly_utils.basevalidators
class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yanchor", parent_name="layout.scene.annotation", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
p... | true | true |
f74aa9bcd28fcb4ed57382680b8de29ed82a0edc | 735 | py | Python | test/private.py | StocksDevelopment/python_client | babd93f82ce95da4f5bda5580a04c519e7521d1b | [
"MIT"
] | null | null | null | test/private.py | StocksDevelopment/python_client | babd93f82ce95da4f5bda5580a04c519e7521d1b | [
"MIT"
] | 1 | 2019-12-15T07:10:17.000Z | 2019-12-16T08:31:57.000Z | test/private.py | StocksDevelopment/python_client | babd93f82ce95da4f5bda5580a04c519e7521d1b | [
"MIT"
] | 3 | 2019-06-26T02:16:21.000Z | 2022-01-13T18:16:46.000Z | import os
import unittest
from stex_client.private import Private
class PrivateTestCase(unittest.TestCase):
def setUp(self):
self.option = {
'tokenObject': {
'access_token': os.environ.get('ENV_TOKEN'),
},
'accessTokenUrl': 'https://api3.stex.com/oauth/t... | 26.25 | 70 | 0.609524 | import os
import unittest
from stex_client.private import Private
class PrivateTestCase(unittest.TestCase):
def setUp(self):
self.option = {
'tokenObject': {
'access_token': os.environ.get('ENV_TOKEN'),
},
'accessTokenUrl': 'https://api3.stex.com/oauth/t... | true | true |
f74aaa10837b8ef433aee421b0bcc28dff84e7cc | 376 | py | Python | django_broadcast/users/apps.py | rkk09c/DjangoBroadcast | 65aa11bc969c24ed4ad5608725be2ee09662672c | [
"Apache-1.1"
] | null | null | null | django_broadcast/users/apps.py | rkk09c/DjangoBroadcast | 65aa11bc969c24ed4ad5608725be2ee09662672c | [
"Apache-1.1"
] | null | null | null | django_broadcast/users/apps.py | rkk09c/DjangoBroadcast | 65aa11bc969c24ed4ad5608725be2ee09662672c | [
"Apache-1.1"
] | null | null | null | from django.apps import AppConfig
class UsersAppConfig(AppConfig):
name = "django_broadcast.users"
verbose_name = "Users"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
try:
import users.signals #... | 22.117647 | 45 | 0.585106 | from django.apps import AppConfig
class UsersAppConfig(AppConfig):
name = "django_broadcast.users"
verbose_name = "Users"
def ready(self):
try:
import users.signals
except ImportError:
pass
| true | true |
f74aab046676bee8d0a742ae1059f6647d43c390 | 781 | py | Python | Modulo_3/Semana 4/matplotlib/practica4.py | AutodidactaMx/cocid_python | 11628f465ff362807a692c79ede26bf30dd8e26a | [
"MIT"
] | null | null | null | Modulo_3/Semana 4/matplotlib/practica4.py | AutodidactaMx/cocid_python | 11628f465ff362807a692c79ede26bf30dd8e26a | [
"MIT"
] | null | null | null | Modulo_3/Semana 4/matplotlib/practica4.py | AutodidactaMx/cocid_python | 11628f465ff362807a692c79ede26bf30dd8e26a | [
"MIT"
] | 1 | 2022-03-04T00:57:18.000Z | 2022-03-04T00:57:18.000Z | import tkinter as tk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
data = {
'Basquet': 11,
'Futbol': 222,
'Natacion': 121,
'Esqui': 321,
'Tenis': 44
}
clave = data.keys()
valor = ... | 26.033333 | 85 | 0.692702 | import tkinter as tk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
data = {
'Basquet': 11,
'Futbol': 222,
'Natacion': 121,
'Esqui': 321,
'Tenis': 44
}
clave = data.keys()
valor = ... | true | true |
f74aacdefefedb3259854e26a7d98ed3b02fc474 | 402 | py | Python | programming/dsame/trees/binary_search_trees/BSTOrNot.py | vamsitallapudi/Coderefer-Python-Projects | a7acc682251661e296c64533f4a85d47e6eedda2 | [
"Apache-2.0"
] | 1 | 2021-01-03T06:42:58.000Z | 2021-01-03T06:42:58.000Z | programming/dsame/trees/binary_search_trees/BSTOrNot.py | vamsitallapudi/Coderefer-Python-Projects | a7acc682251661e296c64533f4a85d47e6eedda2 | [
"Apache-2.0"
] | null | null | null | programming/dsame/trees/binary_search_trees/BSTOrNot.py | vamsitallapudi/Coderefer-Python-Projects | a7acc682251661e296c64533f4a85d47e6eedda2 | [
"Apache-2.0"
] | null | null | null | from dsame.trees.common.BinarySearchTreeNode import *
def is_bst(root: BinarySearchTreeNode):
if not root:
return True
if root.left and root.left.data > root.data:
return False
if root.right and root.right.data < root.data:
return False
if not is_bst(root.left) or not is_bst(ro... | 23.647059 | 55 | 0.679104 | from dsame.trees.common.BinarySearchTreeNode import *
def is_bst(root: BinarySearchTreeNode):
if not root:
return True
if root.left and root.left.data > root.data:
return False
if root.right and root.right.data < root.data:
return False
if not is_bst(root.left) or not is_bst(ro... | true | true |
f74aad7b7c397bd88fd35764c5a8fb65cc7f29aa | 44,548 | py | Python | tests/test_dimension.py | speglich/devito | b636f7694eb6a1e19b0f2c48f44ff63613029a7b | [
"MIT"
] | 1 | 2020-01-31T10:35:49.000Z | 2020-01-31T10:35:49.000Z | tests/test_dimension.py | speglich/devito | b636f7694eb6a1e19b0f2c48f44ff63613029a7b | [
"MIT"
] | 52 | 2020-10-12T19:29:09.000Z | 2022-03-10T14:05:22.000Z | tests/test_dimension.py | alisiahkoohi/devito | f535a44dff12de2837eb6e3217a65ffb2d371cb8 | [
"MIT"
] | 1 | 2020-06-02T03:31:11.000Z | 2020-06-02T03:31:11.000Z | from itertools import product
import numpy as np
from sympy import And
import pytest
from conftest import skipif
from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa
Eq, Operator, Constant, Dimension, SubDimension, switchconfig,
SubDom... | 37.945486 | 95 | 0.560878 | from itertools import product
import numpy as np
from sympy import And
import pytest
from conftest import skipif
from devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction,
Eq, Operator, Constant, Dimension, SubDimension, switchconfig,
SubDomain, L... | true | true |
f74aadb5852881f47bf6f6a242c1c4595068ba8f | 10,231 | py | Python | clients/kratos/python/ory_kratos_client/models/registration_flow.py | UkonnRa/sdk | 23ab5408a89cdf6ba7a6d8944f8d1b1cdc68aa4c | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/models/registration_flow.py | UkonnRa/sdk | 23ab5408a89cdf6ba7a6d8944f8d1b1cdc68aa4c | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/models/registration_flow.py | UkonnRa/sdk | 23ab5408a89cdf6ba7a6d8944f8d1b1cdc68aa4c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Ory Kratos
Welcome to the ORY Kratos HTTP API documentation! # noqa: E501
The version of the OpenAPI document: v0.5.4-alpha.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from ory_kratos_client.configuration import Configur... | 31.971875 | 204 | 0.609422 |
import pprint
import re
import six
from ory_kratos_client.configuration import Configuration
class RegistrationFlow(object):
openapi_types = {
'active': 'str',
'expires_at': 'datetime',
'id': 'str',
'issued_at': 'datetime',
'messages': 'list[Message]',
'met... | true | true |
f74aae95db0fa9798630726952da396a2ad06418 | 264 | py | Python | src/binaryedge/transforms/common/entities.py | Te-k/binaryedge-maltego-local-transform | 2b54b034bfe27a4af31e99bcedf1f74a8618fabd | [
"MIT"
] | 4 | 2019-01-14T11:17:48.000Z | 2021-08-01T00:56:17.000Z | src/binaryedge/transforms/common/entities.py | Te-k/binaryedge-maltego-local-transform | 2b54b034bfe27a4af31e99bcedf1f74a8618fabd | [
"MIT"
] | null | null | null | src/binaryedge/transforms/common/entities.py | Te-k/binaryedge-maltego-local-transform | 2b54b034bfe27a4af31e99bcedf1f74a8618fabd | [
"MIT"
] | 2 | 2020-01-14T10:14:51.000Z | 2022-02-26T02:52:57.000Z | from canari.maltego.message import *
__author__ = 'Tek'
__copyright__ = 'Copyright 2019, binaryedge Project'
__credits__ = []
__license__ = 'GPLv3'
__version__ = '0.1'
__maintainer__ = 'Tek'
__email__ = 'tek@randhome.io'
__status__ = 'Development'
__all__ = []
| 18.857143 | 52 | 0.731061 | from canari.maltego.message import *
__author__ = 'Tek'
__copyright__ = 'Copyright 2019, binaryedge Project'
__credits__ = []
__license__ = 'GPLv3'
__version__ = '0.1'
__maintainer__ = 'Tek'
__email__ = 'tek@randhome.io'
__status__ = 'Development'
__all__ = []
| true | true |
f74aaecf63a10c0b50020612500b3e3d1d1367c4 | 442 | py | Python | Symbol Patterns/symbolpattern81.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | null | null | null | Symbol Patterns/symbolpattern81.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 471 | 2022-01-15T07:07:18.000Z | 2022-02-28T16:01:42.000Z | Symbol Patterns/symbolpattern81.py | vaidehisinha1/Python-PatternHouse | 49f71bcc5319a838592e69b0e49ef1edba32bf7c | [
"MIT"
] | 2 | 2022-01-17T09:43:16.000Z | 2022-01-29T15:15:47.000Z | height = int(input())
for i in range(1,height+1):
for j in range(1,height+1):
if(i == 1 or j == 1 or i == height or j == height or i == j or i == height-j+1):
print("*",end=" ")
else:
print(end=" ")
print()
# Sample Input :- 7
# ... | 18.416667 | 88 | 0.307692 | height = int(input())
for i in range(1,height+1):
for j in range(1,height+1):
if(i == 1 or j == 1 or i == height or j == height or i == j or i == height-j+1):
print("*",end=" ")
else:
print(end=" ")
print()
| true | true |
f74aaf74e4748b3bf82a11281bc7ad8cefdc0f1b | 2,753 | py | Python | tests/python/relay/test_pass_dead_code_elimination.py | weberlo/tvm | e4b9f986dab8c48ba109a52106565fc4be6b67c4 | [
"Apache-2.0"
] | 4 | 2018-09-11T05:50:03.000Z | 2022-01-23T03:43:22.000Z | tests/python/relay/test_pass_dead_code_elimination.py | ganzhiliang/tvm | b076cad542524cb3744149d953c341b5815f6474 | [
"Apache-2.0"
] | 3 | 2018-09-14T05:27:13.000Z | 2021-01-06T17:27:58.000Z | tests/python/relay/test_pass_dead_code_elimination.py | ganzhiliang/tvm | b076cad542524cb3744149d953c341b5815f6474 | [
"Apache-2.0"
] | 4 | 2018-09-10T23:43:51.000Z | 2019-06-14T16:27:23.000Z | import tvm
from tvm import relay
from tvm.relay.ir_pass import dead_code_elimination, alpha_equal
from tvm.relay.op import log, add, equal, subtract
class env:
def __init__(self):
self.a = relay.Var("a")
self.b = relay.Var("b")
self.c = relay.Var("c")
self.d = relay.Var("d")
... | 28.677083 | 110 | 0.588086 | import tvm
from tvm import relay
from tvm.relay.ir_pass import dead_code_elimination, alpha_equal
from tvm.relay.op import log, add, equal, subtract
class env:
def __init__(self):
self.a = relay.Var("a")
self.b = relay.Var("b")
self.c = relay.Var("c")
self.d = relay.Var("d")
... | true | true |
f74ab08e9f1189840bb04a737873179f1cf082be | 7,497 | py | Python | kubernetes/client/models/com_coreos_monitoring_v1_pod_monitor_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/com_coreos_monitoring_v1_pod_monitor_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/com_coreos_monitoring_v1_pod_monitor_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 36.393204 | 312 | 0.65026 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class ComCoreosMonitoringV1PodMonitorList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[ComCoreosMonitoringV1PodMonitor]',
'kind': 'str',
'metadata': 'V1ListMeta'... | true | true |
f74ab0f4b46f53f74a7ec156efbdde35a80d3ab2 | 4,210 | py | Python | benchmark/startQiskit_noisy2660.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2660.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy2660.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=41
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.508197 | 140 | 0.653444 |
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
im... | true | true |
f74ab10f5ec32efdaea5c3f1b1f1bdf486d2e48b | 1,283 | py | Python | generic/time-calculator/time_calculator.py | dalamilla/programming-python | bf30ae752afff810d5cc0dda07694518a510a913 | [
"MIT"
] | null | null | null | generic/time-calculator/time_calculator.py | dalamilla/programming-python | bf30ae752afff810d5cc0dda07694518a510a913 | [
"MIT"
] | null | null | null | generic/time-calculator/time_calculator.py | dalamilla/programming-python | bf30ae752afff810d5cc0dda07694518a510a913 | [
"MIT"
] | null | null | null | def add_time(start, duration, day=""):
start_time = start.split()
dur_time = duration.split()
arr_days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
star_arr = start_time[0].split(":")
dur_arr = dur_time[0].split(":")
hour = int(star_arr[0]) + int(dur_arr[0])
min = int(... | 22.910714 | 91 | 0.55339 | def add_time(start, duration, day=""):
start_time = start.split()
dur_time = duration.split()
arr_days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
star_arr = start_time[0].split(":")
dur_arr = dur_time[0].split(":")
hour = int(star_arr[0]) + int(dur_arr[0])
min = int(... | true | true |
f74ab13373a4651680dd2ed424f2391aff734609 | 196 | py | Python | Python/factors.py | odddollar/Language-benchmarks | c51977dfd3b7b8543fe1de84360cd5d3d12b9d84 | [
"MIT"
] | 4 | 2021-02-14T07:09:35.000Z | 2021-02-16T07:58:56.000Z | Python/factors.py | odddollar/Language-benchmarks | c51977dfd3b7b8543fe1de84360cd5d3d12b9d84 | [
"MIT"
] | 3 | 2021-02-15T08:48:40.000Z | 2021-02-18T13:08:38.000Z | Python/factors.py | odddollar/Language-benchmarks | c51977dfd3b7b8543fe1de84360cd5d3d12b9d84 | [
"MIT"
] | 5 | 2021-02-13T16:38:29.000Z | 2021-02-18T12:53:55.000Z | from time import time
start = time()
num = 2000000000
for i in range(1, num+1):
if num % i == 0:
print(f"{i} is a factor of {num}")
print(f"Time taken: {round(time()-start, 3)}s")
| 16.333333 | 47 | 0.586735 | from time import time
start = time()
num = 2000000000
for i in range(1, num+1):
if num % i == 0:
print(f"{i} is a factor of {num}")
print(f"Time taken: {round(time()-start, 3)}s")
| true | true |
f74ab1405f8355111946260e5a548808341212c9 | 24,652 | py | Python | mitmproxy/console/flowview.py | dolfly/mitmproxy | 4604c25c6055a37e5f25a238d2a089759bd5d98a | [
"MIT"
] | null | null | null | mitmproxy/console/flowview.py | dolfly/mitmproxy | 4604c25c6055a37e5f25a238d2a089759bd5d98a | [
"MIT"
] | null | null | null | mitmproxy/console/flowview.py | dolfly/mitmproxy | 4604c25c6055a37e5f25a238d2a089759bd5d98a | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division
import os
import traceback
import sys
import math
import urwid
from netlib import odict
from netlib.http import CONTENT_MISSING, Headers
from . import common, grideditor, signals, searchable, tabs
from . import flowdetailview
from .. import utils, controller, contentvi... | 34.478322 | 96 | 0.478217 | from __future__ import absolute_import, division
import os
import traceback
import sys
import math
import urwid
from netlib import odict
from netlib.http import CONTENT_MISSING, Headers
from . import common, grideditor, signals, searchable, tabs
from . import flowdetailview
from .. import utils, controller, contentvi... | true | true |
f74ab2b8ece8d455d6b6ad83ca5c434e9c51a66d | 12,339 | py | Python | docs/conf.py | NextThought/nti.webhooks | 2015a02fba8d4ca1811a76872a2266c5e85d5728 | [
"Apache-2.0"
] | 1 | 2020-10-20T09:23:57.000Z | 2020-10-20T09:23:57.000Z | docs/conf.py | NextThought/nti.webhooks | 2015a02fba8d4ca1811a76872a2266c5e85d5728 | [
"Apache-2.0"
] | 7 | 2020-06-23T22:10:37.000Z | 2020-12-04T20:27:45.000Z | docs/conf.py | NextThought/nti.webhooks | 2015a02fba8d4ca1811a76872a2266c5e85d5728 | [
"Apache-2.0"
] | 1 | 2020-10-28T19:58:12.000Z | 2020-10-28T19:58:12.000Z | # -*- coding: utf-8 -*-
#
# nti.webhooks documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 2 08:43:18 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | 30.8475 | 80 | 0.702407 |
import sys
import os
import pkg_resources
sys.path.append(os.path.abspath('../src'))
sys.path.insert(0, os.path.abspath('.'))
rqmt = pkg_resources.require('nti.webhooks')[0]
needs_sphinx = "1.8"
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',... | true | true |
f74ab35c5f65393e69de314b1ab2e0582987377c | 7,264 | py | Python | tests/sai_qualify/sai_infra.py | sumukhatv/sonic-mgmt | 57c1512fcfe24ac27b409730ff87726933a63647 | [
"Apache-2.0"
] | 2 | 2020-07-03T01:16:27.000Z | 2020-10-09T05:38:07.000Z | tests/sai_qualify/sai_infra.py | sumukhatv/sonic-mgmt | 57c1512fcfe24ac27b409730ff87726933a63647 | [
"Apache-2.0"
] | null | null | null | tests/sai_qualify/sai_infra.py | sumukhatv/sonic-mgmt | 57c1512fcfe24ac27b409730ff87726933a63647 | [
"Apache-2.0"
] | 1 | 2020-07-02T02:49:56.000Z | 2020-07-02T02:49:56.000Z | """
SAI testing test bed setup.
Notes:
This test is used to setup the SAI testing environment, and start the SAI test cases
from the PTF.
For running this tests, please specify the sai test case folder via the parameters --sai_test_folder.
"""
import pytest, socket, sys, itertools, lo... | 30.016529 | 109 | 0.668778 |
import pytest, socket, sys, itertools, logging
from struct import pack, unpack
from ptf.mask import Mask
import ptf.packet as scapy
import tests.common.system_utils.docker as docker
import tests.common.fixtures.ptfhost_utils as ptfhost_utils
from conftest import *
from community_cases import *
logger = logging.getLog... | true | true |
f74ab4197806228409f799a0129a93fec16ef273 | 581 | py | Python | simp-py-code/factorial.py | Michaeloye/python-journey | ff8ce0e8796a129994f9a9a9dbb80340fa5790dc | [
"MIT"
] | null | null | null | simp-py-code/factorial.py | Michaeloye/python-journey | ff8ce0e8796a129994f9a9a9dbb80340fa5790dc | [
"MIT"
] | null | null | null | simp-py-code/factorial.py | Michaeloye/python-journey | ff8ce0e8796a129994f9a9a9dbb80340fa5790dc | [
"MIT"
] | null | null | null | #This is to get the factorial of a particular number]
num = int(input("Enter the number to calculate the factorial: "))
'''while i<5:
num = int(input("Enter the number to calculate the factorial: "))
def fact(num):
if num == 0:
return 1
return num * fact(num-1)
print(fact... | 22.346154 | 70 | 0.523236 |
num = int(input("Enter the number to calculate the factorial: "))
def fact(num):
if num < 0:
print("error")
elif num == 0:
return 1
else:
result = 1
for k in range(1,num+1):
result = result * (k)
return result
print(fact(num)) | true | true |
f74ab430dd076f3f5fc885c1897a8cba6d62f060 | 18,422 | py | Python | tests/reg_tests/cumulative_curl_regression_test.py | Bartdoekemeijer/FLORIS | be3c9fbb559354b5bf848792d84caff90606ed05 | [
"Apache-2.0"
] | null | null | null | tests/reg_tests/cumulative_curl_regression_test.py | Bartdoekemeijer/FLORIS | be3c9fbb559354b5bf848792d84caff90606ed05 | [
"Apache-2.0"
] | null | null | null | tests/reg_tests/cumulative_curl_regression_test.py | Bartdoekemeijer/FLORIS | be3c9fbb559354b5bf848792d84caff90606ed05 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distri... | 33.555556 | 113 | 0.640864 |
import numpy as np
from floris.simulation import Floris
from floris.simulation import Ct, power, axial_induction, average_velocity
from tests.conftest import N_TURBINES, N_WIND_DIRECTIONS, N_WIND_SPEEDS, print_test_values, assert_results_arrays
DEBUG = True
VELOCITY_MODEL = "cc"
DEFLECTION_MODEL = "gaus... | true | true |
f74ab460a4bebe57ae4834bbb3ff2008565bbddc | 712 | py | Python | mt_html/env_creator.py | purplecomputer/Mikrotik_HTML_Documentation | 679531d6d1b335aae68294e01c835620d002553d | [
"MIT"
] | null | null | null | mt_html/env_creator.py | purplecomputer/Mikrotik_HTML_Documentation | 679531d6d1b335aae68294e01c835620d002553d | [
"MIT"
] | null | null | null | mt_html/env_creator.py | purplecomputer/Mikrotik_HTML_Documentation | 679531d6d1b335aae68294e01c835620d002553d | [
"MIT"
] | null | null | null | #helps to create env file
#2021 - Angelo Poggi : angelo.poggi@webair.com
import click
@click.command()
@click.option('--createenv', '-c', help="""Helps you to create the .env file required to use this script.\n
mikrotikhtml --createenv <username> <password>""", required=True)
@click.argument(... | 47.466667 | 107 | 0.686798 |
import click
@click.command()
@click.option('--createenv', '-c', help="""Helps you to create the .env file required to use this script.\n
mikrotikhtml --createenv <username> <password>""", required=True)
@click.argument('username')
@click.argument('password')
def create_env_file(username, p... | true | true |
f74ab4737299a483cede8da523841de98e77dc6f | 49,913 | py | Python | tests/unit/mock.py | arossert/vncdotool | e133a8916efaa0f5ed421e0aa737196624635b0c | [
"MIT"
] | 2 | 2015-11-10T15:02:29.000Z | 2021-09-14T23:34:22.000Z | tests/unit/mock.py | arossert/vncdotool | e133a8916efaa0f5ed421e0aa737196624635b0c | [
"MIT"
] | 3 | 2021-03-19T16:01:36.000Z | 2021-09-08T02:58:53.000Z | tests/unit/mock.py | arossert/vncdotool | e133a8916efaa0f5ed421e0aa737196624635b0c | [
"MIT"
] | 1 | 2021-09-14T23:34:28.000Z | 2021-09-14T23:34:28.000Z | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2011 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.8.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts... | 31.650602 | 83 | 0.617094 |
__all__ = (
'Mock',
'MagicMock',
'mocksignature',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
)
__version__ = '0.8.0alpha1'
__unittest = True
import sys
try:
import inspect
except ImportError:
inspect = No... | true | true |
f74ab6cbc4d6514c26d3c75f6ddf73e62c5c5faa | 7,754 | py | Python | test/functional/test_framework/authproxy.py | ogfuncoin/ogfuncoin | 18d00bc1d93335c86ae6f2971321e93e627ae570 | [
"MIT"
] | null | null | null | test/functional/test_framework/authproxy.py | ogfuncoin/ogfuncoin | 18d00bc1d93335c86ae6f2971321e93e627ae570 | [
"MIT"
] | null | null | null | test/functional/test_framework/authproxy.py | ogfuncoin/ogfuncoin | 18d00bc1d93335c86ae6f2971321e93e627ae570 | [
"MIT"
] | null | null | null | # Copyright (c) 2011 Jeff Garzik
#
# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:
#
# Copyright (c) 2007 Jan-Klaas Kollhof
#
# This file is part of jsonrpc.
#
# jsonrpc is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# th... | 42.839779 | 155 | 0.644184 |
import base64
import decimal
import http.client
import json
import logging
import socket
import time
import urllib.parse
HTTP_TIMEOUT = 30
USER_AGENT = "AuthServiceProxy/0.1"
log = logging.getLogger("ogfuncoinRPC")
class JSONRPCException(Exception):
def __init__(self, rpc_error):
tr... | true | true |
f74ab73dede7ecec5c2750f9a73b52b857e4a0d8 | 396 | py | Python | python/poo_algoritmos/bokeh_1.py | lmonsalve22/Learning-to-Code | 2e32eba3fbd0bd63cc539e1e6d372ca346b765c9 | [
"MIT"
] | null | null | null | python/poo_algoritmos/bokeh_1.py | lmonsalve22/Learning-to-Code | 2e32eba3fbd0bd63cc539e1e6d372ca346b765c9 | [
"MIT"
] | null | null | null | python/poo_algoritmos/bokeh_1.py | lmonsalve22/Learning-to-Code | 2e32eba3fbd0bd63cc539e1e6d372ca346b765c9 | [
"MIT"
] | null | null | null | from bokeh.plotting import figure, output_file, show
if __name__ == '__main__':
output_file('graficado_simple.html')
fig = figure()
total_vals = int(input('Cuantos valores quieres graficar? '))
x_vals = list(range(total_vals))
y_vals = []
for x in x_vals:
val = int(input(f'Valor y para {x}'))
... | 22 | 63 | 0.674242 | from bokeh.plotting import figure, output_file, show
if __name__ == '__main__':
output_file('graficado_simple.html')
fig = figure()
total_vals = int(input('Cuantos valores quieres graficar? '))
x_vals = list(range(total_vals))
y_vals = []
for x in x_vals:
val = int(input(f'Valor y para {x}'))
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.