hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
836b544ef97ee52b85e350d3ae34234983a279c0 | 497 | py | Python | dbxlogger/args.py | vladvelici/dbxlogger | 75fc34d5fe7479727c37eb22e80cdd4e5917bb6b | [
"Apache-2.0"
] | 2 | 2020-01-16T17:39:30.000Z | 2020-02-05T13:22:54.000Z | dbxlogger/args.py | vladvelici/dbxlogger | 75fc34d5fe7479727c37eb22e80cdd4e5917bb6b | [
"Apache-2.0"
] | 2 | 2020-02-24T23:55:20.000Z | 2020-02-25T12:36:48.000Z | dbxlogger/args.py | vladvelici/dbxlogger | 75fc34d5fe7479727c37eb22e80cdd4e5917bb6b | [
"Apache-2.0"
] | null | null | null | def add_arguments_to(parser):
"""Add dbx arguments to the given argparse.ArgumentParser.
The arguments are:
--repo the path of the repository where experiments are saved
--name the name of the experiment
"""
parser.add_argument("--repo", type=str, default=None,
help="... | 35.5 | 84 | 0.67002 |
5c79bf82401b65c97f2cb9eec857791952dc6c7d | 1,344 | py | Python | test/functional/feature_reindex.py | bvbfan/ain | 71e3b3456f90a858d1325f612bd44393789d74d2 | [
"MIT"
] | null | null | null | test/functional/feature_reindex.py | bvbfan/ain | 71e3b3456f90a858d1325f612bd44393789d74d2 | [
"MIT"
] | null | null | null | test/functional/feature_reindex.py | bvbfan/ain | 71e3b3456f90a858d1325f612bd44393789d74d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running defid with -reindex and -reindex-chainstate options.
- Start a single node and generate 3... | 35.368421 | 106 | 0.709077 |
156fe69566b3165070b75096ebe426523b5e5e42 | 1,141 | py | Python | cjaasPythonClient/test/test_object.py | futurethang/cjaas-sdk | be6a4908bb4597717b47abf1d9b99ccc17952a4c | [
"Apache-2.0"
] | null | null | null | cjaasPythonClient/test/test_object.py | futurethang/cjaas-sdk | be6a4908bb4597717b47abf1d9b99ccc17952a4c | [
"Apache-2.0"
] | null | null | null | cjaasPythonClient/test/test_object.py | futurethang/cjaas-sdk | be6a4908bb4597717b47abf1d9b99ccc17952a4c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Customer Journey as a Service (CJaaS)
Something amazing, something special - the Customer Journey as a Service (CJaaS) is a core data layer to enable Journeys across products built upon serverless multi-cloud architecture, to be available as a SaaS service for applications inside and outsi... | 28.525 | 332 | 0.714286 |
9e3fb41fdb711929a79d3d76defdabee1d63a583 | 1,533 | py | Python | match_adjacent_elements.py | exachixkitsune/mazegame | fc6fc9923e0cd2ed98fc1c7d5c97f5f5bd079629 | [
"MIT"
] | null | null | null | match_adjacent_elements.py | exachixkitsune/mazegame | fc6fc9923e0cd2ed98fc1c7d5c97f5f5bd079629 | [
"MIT"
] | null | null | null | match_adjacent_elements.py | exachixkitsune/mazegame | fc6fc9923e0cd2ed98fc1c7d5c97f5f5bd079629 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Finds, given a particular center location in a grid, if adjoining
elements are a 'target number'
"""
import numpy
# Process for analysing a grid and looking at the ones around it
# Using curses's yx orientation
# that is, first value is y, second is x.
def match_adja... | 25.55 | 72 | 0.578604 |
0e9627d9acfd7cbd6b09bdd80e933cc59f7ba58b | 4,529 | py | Python | nfv/nfv-vim/nfv_vim/strategy/__init__.py | starlingx/nfv | 849c386e84911af0ac8d0df815f911347b39f8d6 | [
"Apache-2.0"
] | 2 | 2020-02-07T19:01:36.000Z | 2022-02-23T01:41:46.000Z | nfv/nfv-vim/nfv_vim/strategy/__init__.py | starlingx/nfv | 849c386e84911af0ac8d0df815f911347b39f8d6 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:02:25.000Z | 2021-01-14T12:02:25.000Z | nfv/nfv-vim/nfv_vim/strategy/__init__.py | starlingx/nfv | 849c386e84911af0ac8d0df815f911347b39f8d6 | [
"Apache-2.0"
] | 2 | 2021-01-13T08:39:21.000Z | 2022-02-09T00:21:55.000Z | #
# Copyright (c) 2015-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common.strategy import * # noqa: F401,F403
from nfv_vim.strategy._strategy import FwUpdateStrategy # noqa: F401
from nfv_vim.strategy._strategy import KubeRootcaUpdateStrategy # noqa: F401
from nfv_vim.strategy._s... | 74.245902 | 95 | 0.847648 |
5c4d3e281db1145fa8e2f4b72f2b82670727ef7f | 1,884 | py | Python | setup.py | ifurusato/letterbox-robot | 2d50002144dd40402ed1991788a3c1216bd5f0ce | [
"MIT"
] | null | null | null | setup.py | ifurusato/letterbox-robot | 2d50002144dd40402ed1991788a3c1216bd5f0ce | [
"MIT"
] | null | null | null | setup.py | ifurusato/letterbox-robot | 2d50002144dd40402ed1991788a3c1216bd5f0ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 by Murray Altheim. All rights reserved. This file is part
# of the Robot Operating System project, released under the MIT License. Please
# see the LICENSE file included as part of this package.
#
# author: Murray Altheim
# created: 2019-12-23
# ... | 30.387097 | 79 | 0.638004 |
b94cd77c9ec24f49a6b6d89c51c16cff4d6e2cb9 | 2,529 | py | Python | examples/wireframe_terrain.py | einarf/ModernGL | e4a7f53289043a0ac06130c67edc75b878484a0e | [
"MIT"
] | 1 | 2019-10-18T03:23:16.000Z | 2019-10-18T03:23:16.000Z | examples/wireframe_terrain.py | einarf/ModernGL | e4a7f53289043a0ac06130c67edc75b878484a0e | [
"MIT"
] | null | null | null | examples/wireframe_terrain.py | einarf/ModernGL | e4a7f53289043a0ac06130c67edc75b878484a0e | [
"MIT"
] | null | null | null | import os
import moderngl
import numpy as np
from PIL import Image
from pyrr import Matrix44
import data
from window import Example, run_example
def terrain(size):
vertices = np.dstack(np.mgrid[0:size, 0:size][::-1]) / size
temp = np.dstack([np.arange(0, size * size - size), np.arange(size, size * size)])
... | 27.193548 | 102 | 0.532622 |
876ad86214e7501a3ee9249bc9c63ddfa2abe192 | 1,974 | py | Python | blog/views.py | zebestd/soryabebegim | 01fa9f7d11994683c0ade4fd4e2c1d258c9c59c3 | [
"MIT"
] | null | null | null | blog/views.py | zebestd/soryabebegim | 01fa9f7d11994683c0ade4fd4e2c1d258c9c59c3 | [
"MIT"
] | null | null | null | blog/views.py | zebestd/soryabebegim | 01fa9f7d11994683c0ade4fd4e2c1d258c9c59c3 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from .forms import *
from .models import *
from django.utils.text import slugify
'''
random_string_generator is located here:
http://joincfe.com/blog/random-string-generator-in-python/
'''
from django.utils.crypto import get_random_string
def frontpage(request):
post... | 27.416667 | 81 | 0.625633 |
b90aae90749c8618c4dd8cb313595a37f488de8a | 1,360 | py | Python | examples/pong/systems/network.py | en0/pyecs | 500e241b4cd647c520faff85225238c8c3875b4a | [
"MIT"
] | null | null | null | examples/pong/systems/network.py | en0/pyecs | 500e241b4cd647c520faff85225238c8c3875b4a | [
"MIT"
] | null | null | null | examples/pong/systems/network.py | en0/pyecs | 500e241b4cd647c520faff85225238c8c3875b4a | [
"MIT"
] | null | null | null | import pygame
from pyecs.typing import ISystem, IEntityManager
from pyecs import Entity
from ..components import flags, queries, NetSyncIn, NetSyncOut
from ..providers import NetworkInput, NetworkOutput
class NetworkSystem(ISystem):
def update(self):
self.counter += 1
for net_entity in self.net_i... | 37.777778 | 89 | 0.602206 |
e8a6d05abb2d740aaff4c2ae39d0aac2a044e423 | 727 | py | Python | algospot/lec9_DP/[cutz]numbergame.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | 3 | 2019-11-26T14:31:01.000Z | 2020-01-10T18:19:46.000Z | algospot/lec9_DP/[cutz]numbergame.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | algospot/lec9_DP/[cutz]numbergame.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | import sys
empty = -987654321
dp_dict = {}
def play(numbers):
# basis
length = len(numbers)
case1 = empty
case2 = empty
if length == 0:
return 0
if dp_dict.get((tuple(numbers)), -1) != -1:
return dp_dict[(tuple(numbers))]
if length >= 2:
case1 = -play(numbers[... | 19.648649 | 47 | 0.540578 |
14fe05a3f31b7d6e224068692bb170c1eccec673 | 50,685 | py | Python | pypy/translator/stackless/transform.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | pypy/translator/stackless/transform.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | null | null | null | pypy/translator/stackless/transform.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.lltypesystem.lloperation import LL_OPERATIONS
from pypy.rlib import rarithmetic
from pypy.rpython import rclass, rmodel
from pypy.translator.backendopt import support
from pypy.objspace.flow import model
from pypy.translator import unsimplify, sim... | 43.431877 | 132 | 0.615705 |
cb1e68885e293b87c698a0cc3b5d4f798e1b2eef | 1,001 | py | Python | idaes/surrogate/alamopy_depr/almerror.py | eslickj/idaes-pse | 328ed07ffb0b4d98c03e972675ea32c41dd2531a | [
"RSA-MD"
] | 112 | 2019-02-11T23:16:36.000Z | 2022-03-23T20:59:57.000Z | idaes/surrogate/alamopy_depr/almerror.py | eslickj/idaes-pse | 328ed07ffb0b4d98c03e972675ea32c41dd2531a | [
"RSA-MD"
] | 621 | 2019-03-01T14:44:12.000Z | 2022-03-31T19:49:25.000Z | idaes/surrogate/alamopy_depr/almerror.py | eslickj/idaes-pse | 328ed07ffb0b4d98c03e972675ea32c41dd2531a | [
"RSA-MD"
] | 154 | 2019-02-01T23:46:33.000Z | 2022-03-23T15:07:10.000Z | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 38.5 | 81 | 0.629371 |
8ef7db6fd91f83df844a82b1571deaf1baa84576 | 131 | py | Python | src/crypto_candlesticks/exchanges/__init__.py | miohtama/crypto-candlesticks | fd8741365fbc94e5bec6707ea125b91582ac3713 | [
"MIT"
] | null | null | null | src/crypto_candlesticks/exchanges/__init__.py | miohtama/crypto-candlesticks | fd8741365fbc94e5bec6707ea125b91582ac3713 | [
"MIT"
] | null | null | null | src/crypto_candlesticks/exchanges/__init__.py | miohtama/crypto-candlesticks | fd8741365fbc94e5bec6707ea125b91582ac3713 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Crypto candlesticks supported exchanges."""
from crypto_candlesticks.exchanges.bitfinex import Bitfinex
| 32.75 | 59 | 0.763359 |
2b43aa3eb5cd09aade3044aaeb8456f09393529b | 3,287 | py | Python | esmvaltool/cmorizers/obs/cmorize_obs_hadcrut5.py | cffbots/ESMValTool | a9b6592a02f2085634a214ff5f36a736fa18ff47 | [
"Apache-2.0"
] | 148 | 2017-02-07T13:16:03.000Z | 2022-03-26T02:21:56.000Z | esmvaltool/cmorizers/obs/cmorize_obs_hadcrut5.py | cffbots/ESMValTool | a9b6592a02f2085634a214ff5f36a736fa18ff47 | [
"Apache-2.0"
] | 2,026 | 2017-02-03T12:57:13.000Z | 2022-03-31T15:11:51.000Z | esmvaltool/cmorizers/obs/cmorize_obs_hadcrut5.py | cffbots/ESMValTool | a9b6592a02f2085634a214ff5f36a736fa18ff47 | [
"Apache-2.0"
] | 113 | 2017-01-27T13:10:19.000Z | 2022-02-03T13:42:11.000Z | """ESMValTool CMORizer for HadCRUT5 data.
Tier
Tier 2: other freely-available dataset.
Source
https://crudata.uea.ac.uk/cru/data/temperature
Last access
20210113
Download and processing instructions
Download the following files:
infilling
[Source]/HadCRUT.5.0.0.0.analysis.anomali... | 31.009434 | 78 | 0.627928 |
6417d93e4733182b54b1eaad93de93eee0ed3434 | 167 | py | Python | problem0111.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0111.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0111.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #111 Primes with runs - Project Euler
# https://projecteuler.net/problem=111
#
# Code by Kevin Marciniak
#
###########################
| 18.555556 | 39 | 0.473054 |
a8eeb8cab5a803658658b30489764fbaf8d4489a | 9,043 | py | Python | jnpr/openclos/ztp.py | moloyc/OpenClos | d776559f89e67c3e1ade252df014887c54b3cce4 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | jnpr/openclos/ztp.py | moloyc/OpenClos | d776559f89e67c3e1ade252df014887c54b3cce4 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | jnpr/openclos/ztp.py | moloyc/OpenClos | d776559f89e67c3e1ade252df014887c54b3cce4 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | '''
Created on Sep 10, 2014
@author: moloyc
'''
import os
import logging
from jinja2 import Environment, PackageLoader
from netaddr import IPNetwork
import util
import loader
from model import Pod
from dao import Dao
from writer import DhcpConfWriter
from loader import OpenClosProperty, loadLoggingConfig
from sqlal... | 41.292237 | 145 | 0.602787 |
b676d6034ccd2889069b8fb85656481003d62fdc | 26 | py | Python | ncv/tests/__init__.py | fuzzyklein/gcv-lab | 9d2c552b8226350dd6f4d5c38a42d1b90d3c3ca7 | [
"MIT"
] | null | null | null | ncv/tests/__init__.py | fuzzyklein/gcv-lab | 9d2c552b8226350dd6f4d5c38a42d1b90d3c3ca7 | [
"MIT"
] | null | null | null | ncv/tests/__init__.py | fuzzyklein/gcv-lab | 9d2c552b8226350dd6f4d5c38a42d1b90d3c3ca7 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3.8
| 13 | 25 | 0.653846 |
03ee58edab34c397b6719fd6c2fd654c0c786c3e | 550 | py | Python | emulator/definitions.py | gnudeb/fisk16 | ce5451e51ae4fd6e1b877e34a958e4439b2b0dee | [
"MIT"
] | null | null | null | emulator/definitions.py | gnudeb/fisk16 | ce5451e51ae4fd6e1b877e34a958e4439b2b0dee | [
"MIT"
] | null | null | null | emulator/definitions.py | gnudeb/fisk16 | ce5451e51ae4fd6e1b877e34a958e4439b2b0dee | [
"MIT"
] | null | null | null | from enum import IntEnum
class Opcode(IntEnum):
PUSH = 0
POP = 1
STORE = 2
LOAD = 3
BOOLEAN = 4
JUMP_IF_BIT = 5
ALU = 6
CALL = 7
ADD_IMMEDIATE = 8
MOVE_IMMEDIATE = 9
class BoolMode(IntEnum):
SET_IF_EQUAL = 0
SET_IF_NEGATIVE = 1
SET_IF_LESS_THAN = 2
SET_IF_LESS... | 13.095238 | 28 | 0.547273 |
3bba04353b6a57efa775d616812edeb730d650d7 | 3,595 | py | Python | src/python/pants/backend/jvm/tasks/scalafmt.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 94 | 2015-01-15T21:24:20.000Z | 2022-02-16T16:55:43.000Z | src/python/pants/backend/jvm/tasks/scalafmt.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 5 | 2020-07-18T01:04:43.000Z | 2021-05-10T08:40:56.000Z | src/python/pants/backend/jvm/tasks/scalafmt.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 47 | 2015-02-25T02:20:07.000Z | 2022-03-21T00:59:16.000Z | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from abc import abstractproperty
from pants.backend.jvm.tasks.rewrite_base import Rewrit... | 32.681818 | 97 | 0.682058 |
c69b6c68c19d0dc3c8295583c80b1e110cbf85fe | 6,740 | py | Python | zerver/lib/fix_unreads.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-03-17T14:58:50.000Z | 2020-03-17T14:58:50.000Z | zerver/lib/fix_unreads.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 3 | 2020-06-06T00:25:00.000Z | 2021-05-08T14:30:56.000Z | zerver/lib/fix_unreads.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2019-12-23T05:51:08.000Z | 2019-12-23T05:51:08.000Z | import time
import logging
from typing import Callable, List, TypeVar
from psycopg2.extensions import cursor
CursorObj = TypeVar('CursorObj', bound=cursor)
from django.db import connection
from zerver.models import UserProfile
'''
NOTE! Be careful modifying this library, as it is used
in a migration, and it needs ... | 27.85124 | 105 | 0.587537 |
d196db712503e4a3260b18a612c931d8c2989d37 | 2,874 | py | Python | h2o-py/tests/testdir_algos/kmeans/pyunit_baddataKmeans.py | kyoren/https-github.com-h2oai-h2o-3 | 77b27109c84c4739f9f1b7a3078f8992beefc813 | [
"Apache-2.0"
] | 1 | 2016-09-30T05:58:18.000Z | 2016-09-30T05:58:18.000Z | h2o-py/tests/testdir_algos/kmeans/pyunit_baddataKmeans.py | kyoren/https-github.com-h2oai-h2o-3 | 77b27109c84c4739f9f1b7a3078f8992beefc813 | [
"Apache-2.0"
] | null | null | null | h2o-py/tests/testdir_algos/kmeans/pyunit_baddataKmeans.py | kyoren/https-github.com-h2oai-h2o-3 | 77b27109c84c4739f9f1b7a3078f8992beefc813 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.insert(1, "../../../")
import h2o, tests
import random
import string
def baddataKmeans():
# Connect to a pre-existing cluster
# connect to localhost:54321
rows = 100
cols = 10
rawdata = [[random.random() for c in range(cols)] for r in range(rows)]
# Row elements that are None will ... | 31.582418 | 95 | 0.67119 |
9c1490345b9248b8042512456bf4d709347e8e5d | 595 | py | Python | Co1/C2.py | Abhilash2015mca/Programming-Lab-Python- | d0148d613c4af271b127bbad874e25f23470a540 | [
"Adobe-Glyph"
] | null | null | null | Co1/C2.py | Abhilash2015mca/Programming-Lab-Python- | d0148d613c4af271b127bbad874e25f23470a540 | [
"Adobe-Glyph"
] | null | null | null | Co1/C2.py | Abhilash2015mca/Programming-Lab-Python- | d0148d613c4af271b127bbad874e25f23470a540 | [
"Adobe-Glyph"
] | null | null | null | #display future leap year From current year to a final year entered by user
from datetime import date
today = date.today()
current_year = today.year
input_year = int(input("enter the year : "))
if (current_year > input_year):
print("invalid_entry")
else:
print("Leap year are :")
input_year = input_year + 1... | 31.315789 | 75 | 0.519328 |
f7af45071e9bed75bca6f3ff9ee48ed46e03012e | 1,479 | py | Python | recipe_modules/firebase/api.py | yjbanov/flutter-recipes | c54fa704ca199cf519272b4bbfd310e1831dff23 | [
"BSD-3-Clause"
] | 2 | 2021-04-09T06:07:28.000Z | 2021-04-10T01:42:23.000Z | recipe_modules/firebase/api.py | yjbanov/flutter-recipes | c54fa704ca199cf519272b4bbfd310e1831dff23 | [
"BSD-3-Clause"
] | null | null | null | recipe_modules/firebase/api.py | yjbanov/flutter-recipes | c54fa704ca199cf519272b4bbfd310e1831dff23 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T16:26:46.000Z | 2021-09-28T16:26:46.000Z | # Copyright 2020 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.
from recipe_engine import recipe_api
class FirebaseApi(recipe_api.RecipeApi):
"""Provides utilities to upload docs to Firebase.
This API only works on... | 36.975 | 78 | 0.705206 |
12e21ca221de9f36b235bbf7634288c20ccfe032 | 751 | py | Python | src/grpc-secure-server/python/client.py | d-iii-s/teaching-introduction-middleware | 6d1129571c33059ca0c6ace8df18d3865e6205a0 | [
"Apache-2.0"
] | 2 | 2020-10-14T19:01:17.000Z | 2021-09-13T12:08:31.000Z | src/grpc-secure-server/python/client.py | d-iii-s/teaching-introduction-middleware | 6d1129571c33059ca0c6ace8df18d3865e6205a0 | [
"Apache-2.0"
] | 1 | 2021-01-07T08:32:05.000Z | 2021-01-07T08:32:05.000Z | src/grpc-secure-server/python/client.py | d-iii-s/teaching-introduction-middleware | 6d1129571c33059ca0c6ace8df18d3865e6205a0 | [
"Apache-2.0"
] | 4 | 2020-10-15T13:26:43.000Z | 2021-10-07T11:07:30.000Z | #!/usr/bin/env python3
import grpc
from shared import *
from example_pb2 import *
from example_pb2_grpc import *
# Create the channel used to connect to the server.
crt_data = open ('server.crt', 'rb').read ()
credentials = grpc.ssl_channel_credentials (root_certificates = crt_data)
with grpc.secure_channel (SERVE... | 25.033333 | 73 | 0.720373 |
cd289213668f7d86df046a304b9262c7b260d8fa | 11,218 | py | Python | generated/intermediate/ansible-module-sdk/azure_rm_cosmosdbcollectionpartitionregion_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/intermediate/ansible-module-sdk/azure_rm_cosmosdbcollectionpartitionregion_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/intermediate/ansible-module-sdk/azure_rm_cosmosdbcollectionpartitionregion_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 30.903581 | 122 | 0.518185 |
01e505baceb42e04eb243a36c668aa558808beea | 62,477 | py | Python | skbio/io/tests/test_registry.py | squirrelo/scikit-bio | f9016283638ef49ffccb3bb5f79e5a421462cfd1 | [
"BSD-3-Clause"
] | null | null | null | skbio/io/tests/test_registry.py | squirrelo/scikit-bio | f9016283638ef49ffccb3bb5f79e5a421462cfd1 | [
"BSD-3-Clause"
] | null | null | null | skbio/io/tests/test_registry.py | squirrelo/scikit-bio | f9016283638ef49ffccb3bb5f79e5a421462cfd1 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | 32.676255 | 79 | 0.600045 |
e37184210d2e0a9f22dce9456fa848fe7e4b55cf | 19,400 | py | Python | esp-link/flash-tool/esptool-master/esptool-master/espressif/efuse/base_operations.py | km-tek/stm32_iot_link | 4791dd6cdd544f145e1de9750a63918183b15dba | [
"MIT"
] | null | null | null | esp-link/flash-tool/esptool-master/esptool-master/espressif/efuse/base_operations.py | km-tek/stm32_iot_link | 4791dd6cdd544f145e1de9750a63918183b15dba | [
"MIT"
] | null | null | null | esp-link/flash-tool/esptool-master/esptool-master/espressif/efuse/base_operations.py | km-tek/stm32_iot_link | 4791dd6cdd544f145e1de9750a63918183b15dba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# This file includes the common operations with eFuses for chips
#
# Copyright (C) 2020 Espressif Systems (Shanghai) PTE LTD
#
# 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
# Foundatio... | 49.871465 | 152 | 0.622835 |
9b192dd5501fd11e9f0bff20b77754d63204ba2e | 7,385 | py | Python | torch/_fx/symbolic_trace.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 206 | 2020-11-28T22:56:38.000Z | 2022-03-27T02:33:04.000Z | torch/_fx/symbolic_trace.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 19 | 2020-12-09T23:13:14.000Z | 2022-01-24T23:24:08.000Z | torch/_fx/symbolic_trace.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 28 | 2020-11-29T15:25:12.000Z | 2022-01-20T02:16:27.000Z | import inspect
from types import CodeType, FunctionType
from typing import Any, Optional, List
import torch
from .node import Argument
from .graph import Graph
from .graph_module import GraphModule
from .proxy import Proxy, _create_proxy, TracerBase
HAS_VARSTUFF = inspect.CO_VARARGS | inspect.CO_VARKEYWORDS
def _fin... | 43.698225 | 95 | 0.622749 |
5a0dd0da6d846d18db9803fca7f66f3811c06812 | 5,403 | py | Python | src/rosetta/modules/admin/series/commands.py | Zi-SH/rosetta | 8a6896248d4c7f967b0f40a818ff8b156f4f5bee | [
"MIT"
] | null | null | null | src/rosetta/modules/admin/series/commands.py | Zi-SH/rosetta | 8a6896248d4c7f967b0f40a818ff8b156f4f5bee | [
"MIT"
] | 2 | 2020-10-15T03:02:48.000Z | 2020-11-17T03:22:57.000Z | src/rosetta/modules/admin/series/commands.py | Zi-SH/rosetta | 8a6896248d4c7f967b0f40a818ff8b156f4f5bee | [
"MIT"
] | 1 | 2020-11-17T01:17:46.000Z | 2020-11-17T01:17:46.000Z | from typing import TYPE_CHECKING
from asgiref.sync import sync_to_async
import click
from playthrough.models import Series, Alias
from rosetta.utils import ask
from .utils import series_list_to_embed, series_to_embed
if TYPE_CHECKING:
from typing import Union, Tuple
from click import Context
@sync_to_async... | 33.147239 | 88 | 0.643716 |
65ede70871845160c1eeb3ce10a4fcd228771730 | 14,540 | py | Python | tests/unit/test_factory.py | nikromen/ogr | 7305c19fd1c8e72d844245aeb4f5939b127c91fc | [
"MIT"
] | null | null | null | tests/unit/test_factory.py | nikromen/ogr | 7305c19fd1c8e72d844245aeb4f5939b127c91fc | [
"MIT"
] | 4 | 2021-05-27T21:44:37.000Z | 2021-07-21T21:13:41.000Z | tests/unit/test_factory.py | nikromen/ogr | 7305c19fd1c8e72d844245aeb4f5939b127c91fc | [
"MIT"
] | null | null | null | from typing import Set
import pytest
from flexmock import Mock
from flexmock import flexmock
from urllib3.util import Retry
from ogr import PagureService, GitlabService, GithubService
from ogr.exceptions import OgrException
from ogr.factory import get_service_class, get_project, get_instances_from_dict
from ogr.serv... | 31.336207 | 88 | 0.489546 |
c4c1266b1efc769095a1812d6aeb5885697fe213 | 9,943 | py | Python | papermill/iorw.py | gogasca/papermill | 65f8c827302511658ba03a9c78d1b7752cc042ee | [
"BSD-3-Clause"
] | null | null | null | papermill/iorw.py | gogasca/papermill | 65f8c827302511658ba03a9c78d1b7752cc042ee | [
"BSD-3-Clause"
] | null | null | null | papermill/iorw.py | gogasca/papermill | 65f8c827302511658ba03a9c78d1b7752cc042ee | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import json
import yaml
import fnmatch
import nbformat
import requests
import warnings
import entrypoints
import retry
from contextlib import contextmanager
from . import __version__
from .log import logger
from .utils import chdi... | 27.929775 | 98 | 0.63341 |
273ec71591e67b24fe7b0dfee456d50d26406dca | 80 | py | Python | claims_to_quality/lib/util/__init__.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 13 | 2018-09-28T14:02:59.000Z | 2021-12-07T21:31:54.000Z | claims_to_quality/lib/util/__init__.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 1 | 2018-10-01T17:49:05.000Z | 2018-10-09T01:10:56.000Z | claims_to_quality/lib/util/__init__.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 1 | 2021-02-08T18:32:16.000Z | 2021-02-08T18:32:16.000Z | """Package containing utility functions which are shared across the project."""
| 40 | 79 | 0.7875 |
75802a8e709d08e8d1edfa64a2b7f022f8f1261f | 5,155 | py | Python | xiaohan_dcnn.py | bmaulana/nlp-media | 5612fc7b7d5639056256bc0104222721cfb08db6 | [
"MIT"
] | null | null | null | xiaohan_dcnn.py | bmaulana/nlp-media | 5612fc7b7d5639056256bc0104222721cfb08db6 | [
"MIT"
] | null | null | null | xiaohan_dcnn.py | bmaulana/nlp-media | 5612fc7b7d5639056256bc0104222721cfb08db6 | [
"MIT"
] | null | null | null | """
Numpy version of DCNN, used for prediction, instead of training
"""
import numpy as np
from xiaohan_numpy_impl import (conv2d, LogisticRegression)
_MODEL_PATH = "xiaohan_models/filter_widths=10,7,,batch_size=10,,ks=20,5,,fold=1,1,,conv_layer_n=2,,ebd_dm=48,,nkerns=6,12,,dr=0.5,0.5,,l2_regs=1e-06,0.0001,1e-05,1e-0... | 30.323529 | 173 | 0.521048 |
db859aeb0c9fd18668ed42f439771a133e2d3346 | 792 | py | Python | edkrepo/commands/arguments/squash_args.py | iberkun/edk2-edkrepo | f925099497dea2584612c47e42a7fe75b4c64255 | [
"BSD-2-Clause-Patent"
] | 4 | 2021-04-18T22:04:59.000Z | 2022-03-31T03:59:17.000Z | edkrepo/commands/arguments/squash_args.py | iberkun/edk2-edkrepo | f925099497dea2584612c47e42a7fe75b4c64255 | [
"BSD-2-Clause-Patent"
] | 19 | 2021-04-06T21:07:29.000Z | 2022-03-25T17:17:25.000Z | edkrepo/commands/arguments/squash_args.py | iberkun/edk2-edkrepo | f925099497dea2584612c47e42a7fe75b4c64255 | [
"BSD-2-Clause-Patent"
] | 9 | 2021-03-16T23:13:09.000Z | 2021-11-20T09:19:38.000Z | #!/usr/bin/env python3
#
## @file
# squash_args.py
#
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
''' Contains the help and description strings for arguments in the
squash command meta data.
'''
COMMAND_DESCRIPTION = 'Convert multiple ... | 39.6 | 131 | 0.751263 |
72d3b35570ddcf39390d3899057b26757ffc8059 | 2,364 | py | Python | PDF to PNG.py | PictorSomni/Image_manipulations | 7b91dd8514a2bb4383308c199e03e26539cef430 | [
"MIT"
] | null | null | null | PDF to PNG.py | PictorSomni/Image_manipulations | 7b91dd8514a2bb4383308c199e03e26539cef430 | [
"MIT"
] | null | null | null | PDF to PNG.py | PictorSomni/Image_manipulations | 7b91dd8514a2bb4383308c199e03e26539cef430 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#############################################################
# IMPORTS #
#############################################################
import sys
import os
import fitz
#############################################################
#... | 41.473684 | 139 | 0.38198 |
f23c8f555ff2c42e129e0e300274a02b5e1ff204 | 1,643 | py | Python | application/models/patient.py | tafowocedric/icarehealthcenterapi | f9c74adc3db1b9b0e2bb0e66d1f7fb2bfffef512 | [
"MIT"
] | null | null | null | application/models/patient.py | tafowocedric/icarehealthcenterapi | f9c74adc3db1b9b0e2bb0e66d1f7fb2bfffef512 | [
"MIT"
] | null | null | null | application/models/patient.py | tafowocedric/icarehealthcenterapi | f9c74adc3db1b9b0e2bb0e66d1f7fb2bfffef512 | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.orm.session import Session
from sqlalchemy.sql import func
from application import Base_Model
from application.database.connection import session_hook
from application.models.schema import patient as PatientSchema
class Patient(Base_Model):
... | 29.872727 | 96 | 0.686549 |
b3e4737cb1751ae40086c4b573c51cb16889b41c | 4,113 | py | Python | Types/Calibration_Parameter.py | SBCV/PythonUtility | 0062e1e60dc151776b963d13bc4c1763eb90d333 | [
"MIT"
] | 2 | 2019-02-20T14:56:13.000Z | 2020-05-19T12:31:53.000Z | Types/Calibration_Parameter.py | SBCV/PythonUtility | 0062e1e60dc151776b963d13bc4c1763eb90d333 | [
"MIT"
] | null | null | null | Types/Calibration_Parameter.py | SBCV/PythonUtility | 0062e1e60dc151776b963d13bc4c1763eb90d333 | [
"MIT"
] | 1 | 2021-01-07T08:32:07.000Z | 2021-01-07T08:32:07.000Z | from Utility.Types.Enums.Camera_Model_Types import CameraModelTypes
from Utility.Classes.Frozen_Class import FrozenClass
class CalibrationParameter(object):
def assert_float_or_int(self, value):
assert type(value) == float or type(value) == int
def __init__(self, sc, camera_model_type, f, fx, fy, cx,... | 36.723214 | 120 | 0.574763 |
c3f1ff40c44281e1d32d4c51222772acef318b6c | 17,421 | py | Python | electrum_cadex/rsakey.py | cadexproject/electrum-cadex | 5f8b80feee8be2c4f6f7a3245f896aadd966777c | [
"MIT"
] | null | null | null | electrum_cadex/rsakey.py | cadexproject/electrum-cadex | 5f8b80feee8be2c4f6f7a3245f896aadd966777c | [
"MIT"
] | 1 | 2021-11-15T17:48:24.000Z | 2021-11-15T17:48:24.000Z | electrum_cadex/rsakey.py | cadexproject/electrum-cadex | 5f8b80feee8be2c4f6f7a3245f896aadd966777c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including... | 32.082873 | 90 | 0.544974 |
960166d3fdc6eff0b0b1a36eeb6c769c54e905ed | 17,012 | py | Python | hata/ext/solarlink/node.py | albertopoljak/hata | 96d0b3182eb4f5291eaf36bd23d521787c6b01f1 | [
"0BSD"
] | null | null | null | hata/ext/solarlink/node.py | albertopoljak/hata | 96d0b3182eb4f5291eaf36bd23d521787c6b01f1 | [
"0BSD"
] | null | null | null | hata/ext/solarlink/node.py | albertopoljak/hata | 96d0b3182eb4f5291eaf36bd23d521787c6b01f1 | [
"0BSD"
] | 1 | 2020-09-17T20:10:15.000Z | 2020-09-17T20:10:15.000Z | __all__ = ('SolarNode', )
from scarletio.web_common import ConnectionClosed, WebSocketProtocolError, InvalidHandshake
from scarletio import sleep, Task, future_or_timeout, Future, to_json, from_json, repeat_timeout
from ...discord.core import KOKORO
from ...discord.guild import VoiceRegion
from .constants import HEA... | 32.652591 | 117 | 0.505232 |
269b202f47f6a6c6e1a155cfa047a97997e7c6c6 | 750 | py | Python | cellpack/mgl_tools/upy/cinema4d/__init__.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | cellpack/mgl_tools/upy/cinema4d/__init__.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | 21 | 2021-10-02T00:07:05.000Z | 2022-03-30T00:02:10.000Z | cellpack/mgl_tools/upy/cinema4d/__init__.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | """
Copyright (C) <2010> Autin L. TSRI
This file git_upy/cinema4d/__init__.py is part of upy.
upy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | 39.473684 | 76 | 0.718667 |
0bb5316292395f46860136279f25e63766e93eb0 | 16,733 | py | Python | functions/observatory/http-observatory/httpobs/scanner/grader/grade.py | radon-h2020/radon-function-lib | 2737e006a194021f2c8e4f793f9b99abda966175 | [
"MIT"
] | null | null | null | functions/observatory/http-observatory/httpobs/scanner/grader/grade.py | radon-h2020/radon-function-lib | 2737e006a194021f2c8e4f793f9b99abda966175 | [
"MIT"
] | 4 | 2021-02-12T09:50:38.000Z | 2021-06-17T10:33:09.000Z | functions/observatory/http-observatory/httpobs/scanner/grader/grade.py | radon-h2020/radon-function-lib | 2737e006a194021f2c8e4f793f9b99abda966175 | [
"MIT"
] | 2 | 2021-02-22T09:29:28.000Z | 2021-06-12T13:54:18.000Z | GRADE_CHART = {
100: 'A+',
95: 'A',
90: 'A',
85: 'A-',
80: 'B+',
75: 'B',
70: 'B',
65: 'B-',
60: 'C+',
55: 'C',
50: 'C',
45: 'C-',
40: 'D+',
35: 'D',
30: 'D',
25: 'D-',
20: 'F',
15: 'F',
10: 'F',
5: 'F',
0: 'F'
}
# See https://wiki.moz... | 38.913953 | 119 | 0.616207 |
53e6114a12444578b232b65a665d91e25cd3db5e | 1,050 | py | Python | xlsxwriter/test/comparison/test_button10.py | timgates42/XlsxWriter | 129044ed821de67895b4562c6b71f90eba5be6b4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_button10.py | timgates42/XlsxWriter | 129044ed821de67895b4562c6b71f90eba5be6b4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_button10.py | timgates42/XlsxWriter | 129044ed821de67895b4562c6b71f90eba5be6b4 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 24.418605 | 79 | 0.621905 |
39f2414f7bb5352b66c461558e66338bb85cd8b2 | 9,057 | py | Python | colossalai/builder/pipeline.py | xdjiangkai/ColossalAI | 4a3d3446b04065fa1c89b78cba673e96115c6325 | [
"Apache-2.0"
] | null | null | null | colossalai/builder/pipeline.py | xdjiangkai/ColossalAI | 4a3d3446b04065fa1c89b78cba673e96115c6325 | [
"Apache-2.0"
] | null | null | null | colossalai/builder/pipeline.py | xdjiangkai/ColossalAI | 4a3d3446b04065fa1c89b78cba673e96115c6325 | [
"Apache-2.0"
] | 1 | 2022-01-06T17:16:32.000Z | 2022-01-06T17:16:32.000Z | import copy
import heapq
from colossalai.builder import build_model, build_layer
from colossalai.context.parallel_mode import ParallelMode
from colossalai.core import global_context as gpc
from colossalai.logging import get_dist_logger
import torch.nn as nn
def _binary_partition(weights, st, ed):
"""Returns the... | 33.921348 | 123 | 0.642045 |
2fe861bdc2b5c629ecf5bfa30a5ce2d247ec39af | 30 | py | Python | pyjector/__init__.py | nomike/pyjector | 5a50fb2f0ab7f84d582925c0adf0c4d099b7e64a | [
"MIT"
] | 37 | 2015-03-27T22:07:41.000Z | 2021-09-21T16:04:55.000Z | pyjector/__init__.py | nomike/pyjector | 5a50fb2f0ab7f84d582925c0adf0c4d099b7e64a | [
"MIT"
] | 14 | 2015-07-06T10:59:37.000Z | 2020-07-01T22:16:43.000Z | pyjector/__init__.py | nomike/pyjector | 5a50fb2f0ab7f84d582925c0adf0c4d099b7e64a | [
"MIT"
] | 19 | 2015-10-15T08:08:11.000Z | 2022-03-02T15:16:42.000Z | from pyjector import Pyjector
| 15 | 29 | 0.866667 |
faec3397d10b2901b3fb9b20dda02dd5c5832e85 | 341 | py | Python | learn.py | liuzl/db2 | 9102ef4e82e4de0f3cc3688451f7c0b01fbba96c | [
"OLDAP-2.2.1"
] | 2 | 2018-08-08T03:49:58.000Z | 2018-09-27T08:35:15.000Z | learn.py | liuzl/db2 | 9102ef4e82e4de0f3cc3688451f7c0b01fbba96c | [
"OLDAP-2.2.1"
] | null | null | null | learn.py | liuzl/db2 | 9102ef4e82e4de0f3cc3688451f7c0b01fbba96c | [
"OLDAP-2.2.1"
] | null | null | null | import ibm_db
conn = ibm_db.connect("DATABASE=sample;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=db2inst1;PWD=db2inst1;", "", "")
sql = "SELECT * FROM STAFF"
stmt = ibm_db.exec_immediate(conn, sql)
#result = ibm_db.fetch_both(stmt)
result = ibm_db.fetch_assoc(stmt)
while result:
print(result)
result = ibm_... | 34.1 | 120 | 0.747801 |
f60b1fc15eb694a24809fb1fcee6c55ec1d004d9 | 474 | py | Python | office365/sharepoint/tenant/administration/secondary_administrators_info.py | rikeshtailor/Office365-REST-Python-Client | ca7bfa1b22212137bb4e984c0457632163e89a43 | [
"MIT"
] | 544 | 2016-08-04T17:10:16.000Z | 2022-03-31T07:17:20.000Z | office365/sharepoint/tenant/administration/secondary_administrators_info.py | rikeshtailor/Office365-REST-Python-Client | ca7bfa1b22212137bb4e984c0457632163e89a43 | [
"MIT"
] | 438 | 2016-10-11T12:24:22.000Z | 2022-03-31T19:30:35.000Z | office365/sharepoint/tenant/administration/secondary_administrators_info.py | rikeshtailor/Office365-REST-Python-Client | ca7bfa1b22212137bb4e984c0457632163e89a43 | [
"MIT"
] | 202 | 2016-08-22T19:29:40.000Z | 2022-03-30T20:26:15.000Z | from office365.runtime.client_value import ClientValue
class SecondaryAdministratorsInfo(ClientValue):
def __init__(self, email=None, loginName=None, userPrincipalName=None):
"""
:param str email:
:param str loginName:
:param str userPrincipalName:
"""
super(Secon... | 27.882353 | 75 | 0.681435 |
fb46c6a242510f7d1ecbf57a6eb930242772b8f5 | 1,450 | py | Python | cirq-core/cirq/contrib/paulistring/convert_gate_set.py | Saibaba-Alapati/Cirq | 782efcd04c3bbf73a0d630306a3d1cfd9966521d | [
"Apache-2.0"
] | 3,326 | 2018-07-18T23:17:21.000Z | 2022-03-29T22:28:24.000Z | cirq-core/cirq/contrib/paulistring/convert_gate_set.py | resduo/Cirq | 680f897345eb1c71c9242515edda8f04b8594319 | [
"Apache-2.0"
] | 3,443 | 2018-07-18T21:07:28.000Z | 2022-03-31T20:23:21.000Z | cirq-core/cirq/contrib/paulistring/convert_gate_set.py | resduo/Cirq | 680f897345eb1c71c9242515edda8f04b8594319 | [
"Apache-2.0"
] | 865 | 2018-07-18T23:30:24.000Z | 2022-03-30T11:43:23.000Z | # Copyright 2018 The ops 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 w... | 37.179487 | 96 | 0.766897 |
293a6ff984939f9ce3b55fef381073ff437b9e4a | 2,733 | py | Python | python_modules/dagster/dagster/core/types/python_set.py | johannkm/dagster-okteto | 7ad30528a4a92945967d68e59e27727a1e839c2b | [
"Apache-2.0"
] | 1 | 2020-08-10T23:03:37.000Z | 2020-08-10T23:03:37.000Z | python_modules/dagster/dagster/core/types/python_set.py | johannkm/dagster-okteto | 7ad30528a4a92945967d68e59e27727a1e839c2b | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/types/python_set.py | johannkm/dagster-okteto | 7ad30528a4a92945967d68e59e27727a1e839c2b | [
"Apache-2.0"
] | 1 | 2020-08-20T14:20:31.000Z | 2020-08-20T14:20:31.000Z | from dagster import check
from dagster.config.config_type import Array
from dagster.core.types.dagster_type import DagsterTypeKind
from .config_schema import DagsterTypeLoader
from .dagster_type import DagsterType, PythonObjectDagsterType, resolve_dagster_type
PythonSet = PythonObjectDagsterType(
set, 'PythonSet'... | 30.366667 | 93 | 0.683132 |
5ce0472da85f35753ce118d22c8eb563d6225463 | 56,237 | py | Python | parsl/dataflow/dflow.py | Parsl/Parsl | ccd787e285123aba61b279aeedf77f154e35e856 | [
"Apache-2.0"
] | null | null | null | parsl/dataflow/dflow.py | Parsl/Parsl | ccd787e285123aba61b279aeedf77f154e35e856 | [
"Apache-2.0"
] | 3 | 2017-02-28T23:34:26.000Z | 2017-02-28T23:36:02.000Z | parsl/dataflow/dflow.py | Parsl/Parsl | ccd787e285123aba61b279aeedf77f154e35e856 | [
"Apache-2.0"
] | null | null | null | import atexit
import logging
import os
import pathlib
import pickle
import random
import time
import typeguard
import inspect
import threading
import sys
import datetime
from getpass import getuser
from typing import Any, Dict, List, Optional, Sequence
from uuid import uuid4
from socket import gethostname
from concurre... | 42.603788 | 151 | 0.581681 |
20e86f7dd26ef595aefc98f95ce3ff0718e0b738 | 28,558 | py | Python | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py | alexryndin/ambari | 478eeb02ebecef1f7f0506885a041d2070d2bccb | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py | alexryndin/ambari | 478eeb02ebecef1f7f0506885a041d2070d2bccb | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py | alexryndin/ambari | 478eeb02ebecef1f7f0506885a041d2070d2bccb | [
"Apache-2.0"
] | null | null | null | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 50.366843 | 175 | 0.799321 |
887599a81ae2631e0b7f77ace29b23d71c74482d | 4,073 | py | Python | raiden_contracts/tests/test_token.py | RaidenZeroNetwork/raiden-contracts | 0ba9f9a07627366b0dfed4683c1469266b037955 | [
"MIT"
] | null | null | null | raiden_contracts/tests/test_token.py | RaidenZeroNetwork/raiden-contracts | 0ba9f9a07627366b0dfed4683c1469266b037955 | [
"MIT"
] | null | null | null | raiden_contracts/tests/test_token.py | RaidenZeroNetwork/raiden-contracts | 0ba9f9a07627366b0dfed4683c1469266b037955 | [
"MIT"
] | null | null | null | from typing import Callable
import pytest
from eth_tester.exceptions import TransactionFailed
from web3 import Web3
from web3.contract import Contract
from raiden_contracts.constants import CONTRACT_CUSTOM_TOKEN, CONTRACT_HUMAN_STANDARD_TOKEN
from raiden_contracts.contract_manager import ContractManager
from raiden_c... | 43.795699 | 98 | 0.747361 |
53b2f1d07a203217dbcfea646e57f87ab5dde2e0 | 2,265 | py | Python | meditorch/nn/segmentation/models/deeplab_components/decoder.py | jinglescode/meditorch | 8e55b11bb0c4c40b3b31b621c0d4656c8dfaa3e2 | [
"MIT"
] | 9 | 2020-01-04T10:40:18.000Z | 2021-08-06T08:45:10.000Z | meditorch/nn/segmentation/models/deeplab_components/decoder.py | jinglescode/meditorch | 8e55b11bb0c4c40b3b31b621c0d4656c8dfaa3e2 | [
"MIT"
] | null | null | null | meditorch/nn/segmentation/models/deeplab_components/decoder.py | jinglescode/meditorch | 8e55b11bb0c4c40b3b31b621c0d4656c8dfaa3e2 | [
"MIT"
] | 2 | 2019-12-09T09:18:34.000Z | 2020-02-25T06:37:15.000Z | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
class Decoder(nn.Module):
def __init__(self, num_classes, backbone, BatchNorm):
super(Decoder, self).__init__()
if backbone == 'resnet' or backbone == 'drn':
... | 39.051724 | 107 | 0.548344 |
0421c6a1d35561e55bdb3aa497635f2b1c605d70 | 334 | py | Python | test/glamod/test_settings.py | glamod/glamod-cdm-lite | 026d87d499feaf7ee3611cf1c112384f3819e653 | [
"BSD-2-Clause"
] | 1 | 2020-06-16T14:29:26.000Z | 2020-06-16T14:29:26.000Z | test/glamod/test_settings.py | glamod/glamod-cdm-lite | 026d87d499feaf7ee3611cf1c112384f3819e653 | [
"BSD-2-Clause"
] | 75 | 2020-01-17T12:25:58.000Z | 2021-04-29T14:48:52.000Z | test/glamod/test_settings.py | glamod/glamod-cdm-lite | 026d87d499feaf7ee3611cf1c112384f3819e653 | [
"BSD-2-Clause"
] | 2 | 2020-07-03T11:11:04.000Z | 2020-08-03T14:19:54.000Z | from glamod.settings import get
def test_settings():
assert(get('r2.0:full:land:incoming:source_configuration') == \
'/gws/nopw/j04/c3s311a_lot2/data/level2/land/r202005/source_configuration')
assert(get('r2.0:full:land:incoming:source_configuration') == \
get(':full:land::source_configu... | 25.692308 | 86 | 0.697605 |
99e0dd56e3ea2d24f5272814718cb16e9449a47f | 1,284 | py | Python | dht/storage.py | ZigmundVonZaun/little-bird | bfc674f9474b66ea44be32063791d8191d1cd404 | [
"MIT"
] | 4 | 2018-06-07T07:10:38.000Z | 2018-10-11T16:04:10.000Z | dht/storage.py | 49e94b8f256530dc0d41f740dfe8a4c1/little-bird | bfc674f9474b66ea44be32063791d8191d1cd404 | [
"MIT"
] | 11 | 2018-06-06T20:40:37.000Z | 2018-06-29T20:08:33.000Z | dht/storage.py | ZigmundVonZaun/little-bird | bfc674f9474b66ea44be32063791d8191d1cd404 | [
"MIT"
] | 1 | 2018-11-08T10:53:56.000Z | 2018-11-08T10:53:56.000Z | import shelve
class Shelve:
"""
It works like Python 2s pickle
"""
def __init__(self, f):
"""
Initialises a shelf for object persistence against instances
:param f: file path pointing to external file shelf should use
"""
self.shelve = shelve.open(f)
def du... | 27.319149 | 70 | 0.567757 |
20591620874657d7a25cf4eb960edf266490d8e8 | 1,962 | py | Python | tests/unit/bokeh/sampledata/test_us_cities.py | timgates42/bokeh | fb8b07b838f4d07d520cfe899779a11bc89f3c77 | [
"BSD-3-Clause"
] | 1 | 2015-01-31T14:42:39.000Z | 2015-01-31T14:42:39.000Z | tests/unit/bokeh/sampledata/test_us_cities.py | timgates42/bokeh | fb8b07b838f4d07d520cfe899779a11bc89f3c77 | [
"BSD-3-Clause"
] | 1 | 2021-05-08T06:24:26.000Z | 2021-05-08T06:24:26.000Z | tests/unit/bokeh/sampledata/test_us_cities.py | timgates42/bokeh | fb8b07b838f4d07d520cfe899779a11bc89f3c77 | [
"BSD-3-Clause"
] | 1 | 2021-03-04T05:23:36.000Z | 2021-03-04T05:23:36.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 35.672727 | 84 | 0.259939 |
b1bf48931487f231ac4f958c099303d1cb4f0903 | 4,071 | py | Python | tfx/orchestration/portable/importer_node_handler.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/importer_node_handler.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/importer_node_handler.py | Shunpoco/tfx | 85c365cd31943c32a7f3189ed34ad5c18b9b71fd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.524272 | 79 | 0.742078 |
20e64152d0407e7186de24753e399bb5bb3cee2c | 30,398 | py | Python | trax/tf_numpy/extensions/extensions_test.py | antooc/Trax | 0a6781370bd0a1635aeb423386864222fc49e2f9 | [
"Apache-2.0"
] | 1 | 2021-03-09T10:47:00.000Z | 2021-03-09T10:47:00.000Z | trax/tf_numpy/extensions/extensions_test.py | antooc/Trax | 0a6781370bd0a1635aeb423386864222fc49e2f9 | [
"Apache-2.0"
] | null | null | null | trax/tf_numpy/extensions/extensions_test.py | antooc/Trax | 0a6781370bd0a1635aeb423386864222fc49e2f9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.099261 | 100 | 0.613626 |
6ea2b4bc1d185a461c995d7176919c1d2fb124a1 | 378 | py | Python | blitz_api/tests/tests_model_Organization.py | Jerome-Celle/Blitz-API | 7dfb7b837ed47b11afcfaa5f5aee831c1aa4e5e0 | [
"MIT"
] | 3 | 2019-10-22T00:16:49.000Z | 2021-07-15T07:44:43.000Z | blitz_api/tests/tests_model_Organization.py | Jerome-Celle/Blitz-API | 7dfb7b837ed47b11afcfaa5f5aee831c1aa4e5e0 | [
"MIT"
] | 1,183 | 2018-04-19T18:40:30.000Z | 2022-03-31T21:05:05.000Z | blitz_api/tests/tests_model_Organization.py | Jerome-Celle/Blitz-API | 7dfb7b837ed47b11afcfaa5f5aee831c1aa4e5e0 | [
"MIT"
] | 12 | 2018-04-17T19:16:42.000Z | 2022-01-27T00:19:59.000Z | from rest_framework.test import APITestCase
from ..models import Organization
class OrganizationTests(APITestCase):
def test_create(self):
"""
Ensure that we can create a organization.
"""
org = Organization.objects.create(
name="random_organization",
)
... | 22.235294 | 62 | 0.653439 |
2b3b75a9f9ca1bff50f3c17b4a8ccd6b63a26d49 | 253 | py | Python | pywincffi/ws2_32/__init__.py | opalmer/pycffiwin32 | 39210182a92e93c37a9f1c644fd5fcc1aa32f6d1 | [
"MIT"
] | 10 | 2015-11-19T12:39:50.000Z | 2021-02-21T20:15:29.000Z | pywincffi/ws2_32/__init__.py | opalmer/pycffiwin32 | 39210182a92e93c37a9f1c644fd5fcc1aa32f6d1 | [
"MIT"
] | 109 | 2015-06-15T05:03:33.000Z | 2018-01-14T10:18:48.000Z | pywincffi/ws2_32/__init__.py | opalmer/pycffiwin32 | 39210182a92e93c37a9f1c644fd5fcc1aa32f6d1 | [
"MIT"
] | 8 | 2015-07-29T04:18:27.000Z | 2018-11-02T17:15:40.000Z | """
Ws2_32 Sub-Package
==================
Provides functions, constants and utilities that wrap functions provided by
``ws3_32.dll``.
"""
from pywincffi.ws2_32.events import (
WSAEventSelect, WSACreateEvent, WSAGetLastError, WSAEnumNetworkEvents)
| 23 | 75 | 0.727273 |
8815b90fa5cb567a6da6cdd586d8b055e0b8bc66 | 6,160 | py | Python | federatedml/statistic/union/union.py | lbenwong/FATE | 5d6f1862915b3d9a8c579e6cddadd9b5d98db28f | [
"Apache-2.0"
] | 32 | 2020-06-12T08:39:58.000Z | 2022-03-20T06:57:08.000Z | federatedml/statistic/union/union.py | lbenwong/FATE | 5d6f1862915b3d9a8c579e6cddadd9b5d98db28f | [
"Apache-2.0"
] | 10 | 2020-11-13T18:55:48.000Z | 2022-02-10T02:00:12.000Z | federatedml/statistic/union/union.py | lbenwong/FATE | 5d6f1862915b3d9a8c579e6cddadd9b5d98db28f | [
"Apache-2.0"
] | 16 | 2020-06-12T06:51:46.000Z | 2022-03-29T10:23:42.000Z | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 41.066667 | 137 | 0.644643 |
f24654a53fd77f87557542ba5975e7fd09c185ac | 40 | py | Python | extension.py | Mat001/fs_rest_customer | 736bd2ca23bba8fcd2d8883c1008e477903632a6 | [
"Apache-2.0"
] | 1 | 2020-08-04T06:06:50.000Z | 2020-08-04T06:06:50.000Z | extension.py | Mat001/fs_rest_customer | 736bd2ca23bba8fcd2d8883c1008e477903632a6 | [
"Apache-2.0"
] | 1 | 2019-05-09T14:51:28.000Z | 2019-05-13T12:59:05.000Z | extension.py | Mat001/fs_rest_customer | 736bd2ca23bba8fcd2d8883c1008e477903632a6 | [
"Apache-2.0"
] | 3 | 2018-11-29T04:36:17.000Z | 2021-02-11T10:52:26.000Z | # Extensions don't work for Full Stack. | 40 | 40 | 0.75 |
b56a79b4362a6d787de9e9b9e9ba5f64b9e02454 | 750 | py | Python | src/exports/migrations/0004_move_exports_dir.py | Talengi/phase | 60ff6f37778971ae356c5b2b20e0d174a8288bfe | [
"MIT"
] | 8 | 2016-01-29T11:53:40.000Z | 2020-03-02T22:42:02.000Z | src/exports/migrations/0004_move_exports_dir.py | Talengi/phase | 60ff6f37778971ae356c5b2b20e0d174a8288bfe | [
"MIT"
] | 289 | 2015-03-23T07:42:52.000Z | 2022-03-11T23:26:10.000Z | src/exports/migrations/0004_move_exports_dir.py | Talengi/phase | 60ff6f37778971ae356c5b2b20e0d174a8288bfe | [
"MIT"
] | 7 | 2015-12-08T09:03:20.000Z | 2020-05-11T15:36:51.000Z | # -*- coding: utf-8 -*-
import os
from django.db import migrations
from django.conf import settings
def move_exports_dir(*args):
protected_root = settings.PROTECTED_ROOT
if not os.path.exists(protected_root):
os.makedirs(protected_root)
private_root = settings.PRIVATE_ROOT
if not os.path.e... | 21.428571 | 57 | 0.689333 |
f619892ee7221e588934a945fd3f849e532e655b | 18,775 | py | Python | api/lambda_function.py | cloudkommand/foundation | 00a80aa2f8080722425130101bcc0a82d2ae75ca | [
"Apache-2.0"
] | null | null | null | api/lambda_function.py | cloudkommand/foundation | 00a80aa2f8080722425130101bcc0a82d2ae75ca | [
"Apache-2.0"
] | null | null | null | api/lambda_function.py | cloudkommand/foundation | 00a80aa2f8080722425130101bcc0a82d2ae75ca | [
"Apache-2.0"
] | null | null | null | import boto3
import botocore
# import jsonschema
import json
import traceback
from extutil import remove_none_attributes, account_context, ExtensionHandler, \
ext, component_safe_name
from util import get_default_cors_configuration, generate_openapi_definition
eh = ExtensionHandler()
# def validate_state(state):
... | 37.031558 | 391 | 0.633768 |
5ce1332481285fc27cee81d31a173ae027ebb643 | 266 | py | Python | sbi/recruitment/doctype/employment_application_form/employment_application_form.py | vhrspvl/sbi | a73a8198cb443e3db8a70734e493ae31183fed83 | [
"MIT"
] | null | null | null | sbi/recruitment/doctype/employment_application_form/employment_application_form.py | vhrspvl/sbi | a73a8198cb443e3db8a70734e493ae31183fed83 | [
"MIT"
] | null | null | null | sbi/recruitment/doctype/employment_application_form/employment_application_form.py | vhrspvl/sbi | a73a8198cb443e3db8a70734e493ae31183fed83 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, VHRS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class EmploymentApplicationForm(Document):
pass
| 24.181818 | 49 | 0.789474 |
7d1f94f12a593504161781e8453906842aa7cdff | 913 | py | Python | nodes/pose_publisher.py | peterpolidoro/zaber_device_ros | 0a7be54e51a559df16f901b5d74b98b23161ed6e | [
"BSD-3-Clause"
] | 1 | 2020-06-26T17:03:40.000Z | 2020-06-26T17:03:40.000Z | nodes/pose_publisher.py | peterpolidoro/zaber_device_ros | 0a7be54e51a559df16f901b5d74b98b23161ed6e | [
"BSD-3-Clause"
] | null | null | null | nodes/pose_publisher.py | peterpolidoro/zaber_device_ros | 0a7be54e51a559df16f901b5d74b98b23161ed6e | [
"BSD-3-Clause"
] | 1 | 2015-09-02T12:51:21.000Z | 2015-09-02T12:51:21.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import roslib; roslib.load_manifest('zaber_stage')
import rospy
import actionlib
from geometry_msgs.msg import Pose
from zaber_stage.srv import GetPose,GetPoseResponse
def pose_publisher():
rospy.init_node('zaber_stage_pose_publisher')
rospy.loginfo('zaber_sta... | 28.53125 | 71 | 0.687842 |
67ea85f92900cd9bf0d2974b7416341f1051e943 | 2,396 | py | Python | Lib/site-packages/socket_proxy/connection.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 1 | 2021-05-18T02:28:37.000Z | 2021-05-18T02:28:37.000Z | src/socket_proxy/connection.py | fkantelberg/socket-proxy | 4fc971cfef29282f30299f40106263b53463cdd3 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/socket_proxy/connection.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | import asyncio
import logging
import time
from typing import TypeVar
from . import base, package
_logger = logging.getLogger(__name__)
class Connection:
""" Wrapper class to handle StreamReader and StreamWriter """
def __init__(
self,
reader: asyncio.StreamReader,
writer: asyncio.St... | 27.54023 | 69 | 0.598915 |
4fca33860577d3f39360d76ef2ac5e5804b52b77 | 22,321 | py | Python | AO_modules/Telescope.py | cheritier/OOPAO | fa4b4ddd4c1209250272cc0ef116bb7b0b0f2173 | [
"MIT"
] | 1 | 2021-10-19T10:51:04.000Z | 2021-10-19T10:51:04.000Z | AO_modules/Telescope.py | cheritier/OOPAO | fa4b4ddd4c1209250272cc0ef116bb7b0b0f2173 | [
"MIT"
] | null | null | null | AO_modules/Telescope.py | cheritier/OOPAO | fa4b4ddd4c1209250272cc0ef116bb7b0b0f2173 | [
"MIT"
] | 1 | 2021-11-02T17:14:52.000Z | 2021-11-02T17:14:52.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 19 10:23:18 2020
@author: cheritie
"""
import matplotlib.pyplot as plt
import numpy as np
import numexpr as ne
import inspect
from AO_modules.Source import Source
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS INITIALI... | 56.366162 | 229 | 0.510864 |
39dee003280210951444fe989118ece787f4f3de | 35,117 | py | Python | LNCE/python/IndexNeighborhoodChangebySelectedTractid_v2.py | spatialucr/lne | 951df7334c1495a133f6fc982eaa1d366f08a68b | [
"BSD-3-Clause"
] | null | null | null | LNCE/python/IndexNeighborhoodChangebySelectedTractid_v2.py | spatialucr/lne | 951df7334c1495a133f6fc982eaa1d366f08a68b | [
"BSD-3-Clause"
] | 1 | 2019-06-05T21:56:14.000Z | 2019-06-05T21:56:14.000Z | LNCE/python/IndexNeighborhoodChangebySelectedTractid_v2.py | spatialucr/lne | 951df7334c1495a133f6fc982eaa1d366f08a68b | [
"BSD-3-Clause"
] | 2 | 2018-12-20T23:11:17.000Z | 2019-06-05T21:36:56.000Z | # -*- coding: utf-8 -*-
import sys, getopt
#import csv
import cgitb, cgi, json, sys, re
import json
#import subprocess
import os
import time
import datetime
from datetime import datetime
from datetime import timedelta
#from pytz import timezone
#import pytz
#import math
from operator import itemgetter, attrgetter
#impo... | 32.881086 | 951 | 0.620212 |
3daaf24dc4443c05611029285202e2132295d0a2 | 972 | py | Python | menu/models.py | taylorculver/Django_Project_Improvement | a03eb076eb170c0ec74d9edac515f826cf2ee30e | [
"Unlicense"
] | null | null | null | menu/models.py | taylorculver/Django_Project_Improvement | a03eb076eb170c0ec74d9edac515f826cf2ee30e | [
"Unlicense"
] | null | null | null | menu/models.py | taylorculver/Django_Project_Improvement | a03eb076eb170c0ec74d9edac515f826cf2ee30e | [
"Unlicense"
] | null | null | null | from django.db import models
from django.utils import timezone
class Menu(models.Model):
season = models.CharField(max_length=20)
items = models.ManyToManyField('Item', related_name='items')
# created_date = models.DateTimeField( # Removed created date
# default=timezone.now)
expiration_d... | 27.771429 | 66 | 0.687243 |
f9c553fba3555e8103742b6d9c57aa124522701f | 5,309 | py | Python | examples/pytorch/DROCC/data_process_scripts/process_mnist.py | cw18-coder/EdgeML | 557e8a5e76411255b4aa2f90b6e64f9be90822c0 | [
"MIT"
] | 719 | 2019-05-10T00:31:30.000Z | 2022-03-30T23:04:23.000Z | examples/pytorch/DROCC/data_process_scripts/process_mnist.py | cw18-coder/EdgeML | 557e8a5e76411255b4aa2f90b6e64f9be90822c0 | [
"MIT"
] | 119 | 2019-05-14T10:50:15.000Z | 2022-03-01T22:01:09.000Z | examples/pytorch/DROCC/data_process_scripts/process_mnist.py | cw18-coder/EdgeML | 557e8a5e76411255b4aa2f90b6e64f9be90822c0 | [
"MIT"
] | 235 | 2019-05-07T13:55:37.000Z | 2022-03-20T04:07:38.000Z | '''
Code borrowed from https://github.com/lukasruff/Deep-SVDD-PyTorch
'''
from PIL import Image
import numpy as np
from random import sample
from abc import ABC, abstractmethod
import torch
from torch.utils.data import Subset
from torchvision.datasets import MNIST
import torchvision.transforms as transforms
from torc... | 37.921429 | 118 | 0.655679 |
4562deb6caf83ceea7b269e7aea6906835efbfb6 | 13,262 | py | Python | tests/test_cli.py | this-is-r-gaurav/httpie | 3e414d731c1f24797fd17e5bea29b7a8eeef30f4 | [
"BSD-3-Clause"
] | 8,454 | 2020-08-13T10:50:14.000Z | 2022-03-31T21:20:51.000Z | tests/test_cli.py | this-is-r-gaurav/httpie | 3e414d731c1f24797fd17e5bea29b7a8eeef30f4 | [
"BSD-3-Clause"
] | 415 | 2020-08-13T11:23:54.000Z | 2022-03-31T15:23:42.000Z | tests/test_cli.py | Tiamat-Tech/httpie | 7500912be172e3d7713446e75a2b57a077f1b37f | [
"BSD-3-Clause"
] | 591 | 2020-08-13T19:38:58.000Z | 2022-03-28T20:44:19.000Z | """CLI argument parsing related tests."""
import argparse
import pytest
from requests.exceptions import InvalidSchema
import httpie.cli.argparser
from httpie.cli import constants
from httpie.cli.definition import parser
from httpie.cli.argtypes import KeyValueArg, KeyValueArgType
from httpie.cli.requestitems import R... | 37.357746 | 90 | 0.603378 |
5caaa06031e394dcf74322e85a2449762a1077fd | 3,309 | py | Python | posts/tests/test_views.py | YaroslavChyhryn/Djangogram | 2de402eedbc9a77d6bd2ba06cc8b7ad966adff2c | [
"MIT"
] | null | null | null | posts/tests/test_views.py | YaroslavChyhryn/Djangogram | 2de402eedbc9a77d6bd2ba06cc8b7ad966adff2c | [
"MIT"
] | null | null | null | posts/tests/test_views.py | YaroslavChyhryn/Djangogram | 2de402eedbc9a77d6bd2ba06cc8b7ad966adff2c | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from posts.models import Post
from django.contrib.auth.models import User
from django.test.utils import override_settings
from allauth.account import app_settings as account_settings
from django.urls import reverse
import uuid
@override_settings(
SOCIALACCOUNT_AUTO_SIGNUP=T... | 35.202128 | 93 | 0.648837 |
a8006fe48719f01ea4f9ebb496cdcdb64fbaf2ab | 7,132 | py | Python | built-in/PyTorch/Official/cv/image_classification/DenseNet169_ID0454_for_Pytorch/torchvision/models/squeezenet.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/PyTorch/Official/cv/image_classification/DenseNet161_ID0455_for_Pytorch/torchvision/models/squeezenet.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/PyTorch/Official/cv/image_classification/DenseNet169_ID0454_for_Pytorch/torchvision/models/squeezenet.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | #
# BSD 3-Clause License
#
# Copyright (c) 2017 xxxx
# All rights reserved.
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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 ... | 41.952941 | 86 | 0.62507 |
e4be20d64b5ff07d321f43998d1e313bf0d0ca2d | 2,057 | py | Python | src/ethereum_spec_tools/patch_tool.py | petertdavies/execution-specs | fabda289c747f535f1d2851ec7ebd0caa89f423f | [
"CC0-1.0"
] | 1 | 2022-01-04T12:35:57.000Z | 2022-01-04T12:35:57.000Z | src/ethereum_spec_tools/patch_tool.py | petertdavies/execution-specs | fabda289c747f535f1d2851ec7ebd0caa89f423f | [
"CC0-1.0"
] | null | null | null | src/ethereum_spec_tools/patch_tool.py | petertdavies/execution-specs | fabda289c747f535f1d2851ec7ebd0caa89f423f | [
"CC0-1.0"
] | null | null | null | """
Simple patching tool
"""
import argparse
import subprocess
from sys import stderr, stdout
DESCRIPTION = """
Apply the unstaged changes in SOURCE_FORK to each TARGET_FORK. If some of the
change didn't apply, '.rej' files listing the unapplied changes will be left in
TARGET_FORK.
"""
parser = argparse.ArgumentPars... | 26.037975 | 79 | 0.60282 |
8a97cca3df5759b67fb42a6eb53f559c9e494a47 | 275 | py | Python | titanic_classification/relatives_column_creator.py | Bartosz-D3V/ml-dataset-analysis | cb2458dcb7cecba01f52be5b12e816ca00ce7da4 | [
"MIT"
] | null | null | null | titanic_classification/relatives_column_creator.py | Bartosz-D3V/ml-dataset-analysis | cb2458dcb7cecba01f52be5b12e816ca00ce7da4 | [
"MIT"
] | null | null | null | titanic_classification/relatives_column_creator.py | Bartosz-D3V/ml-dataset-analysis | cb2458dcb7cecba01f52be5b12e816ca00ce7da4 | [
"MIT"
] | null | null | null | from sklearn.base import BaseEstimator, TransformerMixin
class RelativesColumnCreator(BaseEstimator, TransformerMixin):
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
X['Relatives'] = X['SibSp'] + X['Parch']
return X
| 25 | 62 | 0.665455 |
27c5a42fe1f79cac667f5ade227e4c02da5589e6 | 1,165 | py | Python | coqconn/call.py | liyi-david/coqconn | 859e7219dc28e80b3e37d373366f55dcf4e317a9 | [
"MIT"
] | null | null | null | coqconn/call.py | liyi-david/coqconn | 859e7219dc28e80b3e37d373366f55dcf4e317a9 | [
"MIT"
] | null | null | null | coqconn/call.py | liyi-david/coqconn | 859e7219dc28e80b3e37d373366f55dcf4e317a9 | [
"MIT"
] | null | null | null | from xml.etree import ElementTree
from abc import abstractclassmethod
from .value import Pair, String, Bool, Int
class Call:
def __init__(self):
self.conn = None
def to_element(self):
call_name = self.__class__.__name__
assert call_name != 'Call', 'cannot serialize an abstract call'
... | 25.888889 | 83 | 0.522747 |
2225dc00c58ae61fe5bc5a15500ee60445cb3768 | 7,158 | py | Python | data.py | larrabyte/boggler | ed883c1e82133cb3426e7075d577f60f530546ec | [
"MIT"
] | 1 | 2021-03-09T07:42:22.000Z | 2021-03-09T07:42:22.000Z | data.py | larrabyte/boggler | ed883c1e82133cb3426e7075d577f60f530546ec | [
"MIT"
] | null | null | null | data.py | larrabyte/boggler | ed883c1e82133cb3426e7075d577f60f530546ec | [
"MIT"
] | null | null | null | header = ("---------------------------------------------\n"
"larrabyte/boggler: a text-adventure RPG game.\n"
"---------------------------------------------")
initial = (" ()-()\n"
".-(___)-. freelsd development kernel\n"
" _< >_ kermit says guten tag\n"
" \\/ ... | 77.804348 | 176 | 0.647248 |
36e8bb2f2f822ada62131b6d86b241f7ce28e622 | 3,537 | py | Python | girder/smqtk_worker/smqtk_worker/utils.py | cdeepakroy/SMQTK | ef5cec7399e9766f95ff06fe122471a51fc4b2d8 | [
"BSD-3-Clause"
] | 1 | 2021-04-10T10:51:26.000Z | 2021-04-10T10:51:26.000Z | girder/smqtk_worker/smqtk_worker/utils.py | cdeepakroy/SMQTK | ef5cec7399e9766f95ff06fe122471a51fc4b2d8 | [
"BSD-3-Clause"
] | 3 | 2021-06-08T22:19:14.000Z | 2022-03-12T00:46:44.000Z | girder/smqtk_worker/smqtk_worker/utils.py | DigitalCompanion/SMQTK | fc9404b69150ef44f24423844bc80735c0c2b669 | [
"BSD-3-Clause"
] | null | null | null | import itertools
import json
import os
from smqtk.utils.image_utils import is_valid_element
from smqtk.utils import parallel
from smqtk.representation.descriptor_index.postgres import PostgresDescriptorIndex
from smqtk.representation.data_element.girder import GirderDataElement
from girder_client import HttpError
se... | 32.75 | 84 | 0.613514 |
7a32258216016715f42132c7923bacf6fa27e655 | 5,956 | py | Python | models/object_detection_2.py | aby03/Geometric-Reconstruction | aea05fec0332530ecb2986201223b05f3d91633e | [
"MIT"
] | null | null | null | models/object_detection_2.py | aby03/Geometric-Reconstruction | aea05fec0332530ecb2986201223b05f3d91633e | [
"MIT"
] | null | null | null | models/object_detection_2.py | aby03/Geometric-Reconstruction | aea05fec0332530ecb2986201223b05f3d91633e | [
"MIT"
] | null | null | null | import sys
import cv2
import numpy as np
import tensorflow as tf
from copy import deepcopy
sys.path.append("..")
import lib.label_map_util
import datetime
'''
x1,y1 ------
| |
| |
| |
--------x2,y2
'''
class Net:
def __init__(self, graph_fp, labels_fp, num_classes=90, threshold=0.6):
... | 37.459119 | 149 | 0.553727 |
d60dfccd9272a41c95b8c2d489965eca13215c19 | 280 | py | Python | rdmo/tasks/validators.py | cbittner/rdmo | 1d6885ad2a69f6d24c9fca6446536e0c06de5486 | [
"Apache-2.0"
] | null | null | null | rdmo/tasks/validators.py | cbittner/rdmo | 1d6885ad2a69f6d24c9fca6446536e0c06de5486 | [
"Apache-2.0"
] | null | null | null | rdmo/tasks/validators.py | cbittner/rdmo | 1d6885ad2a69f6d24c9fca6446536e0c06de5486 | [
"Apache-2.0"
] | null | null | null | from rdmo.core.validators import UniqueURIValidator
class TaskUniqueURIValidator(UniqueURIValidator):
app_label = 'tasks'
model_name = 'task'
def get_uri(self, model, data):
uri = model.build_uri(data.get('uri_prefix'), data.get('key'))
return uri
| 23.333333 | 70 | 0.696429 |
217f8e2eddb606dc59bb82b97fefc38fc023d770 | 1,071 | py | Python | setup.py | ihakh/sseclient | a59411431415586db8a46ad9fb8c398a37ee0543 | [
"MIT"
] | null | null | null | setup.py | ihakh/sseclient | a59411431415586db8a46ad9fb8c398a37ee0543 | [
"MIT"
] | null | null | null | setup.py | ihakh/sseclient | a59411431415586db8a46ad9fb8c398a37ee0543 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""Installer script sseclient package."""
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
import sys
from setuptools import setup
needs_pytest = set(['pytest', 'test']).intersection(sys.argv)
pytest_runner = ['pytest_runner>=2.1'] if needs_pytest else []... | 30.6 | 72 | 0.664799 |
73d4b5b002715e2e995ffe13f4711674eb0d9ed4 | 1,656 | py | Python | examples/trackers/2D/tips_2d_tracker.py | ArsOkenov/Finitewave | 14274d74be824a395b47a5c53ba18188798ab70d | [
"MIT"
] | null | null | null | examples/trackers/2D/tips_2d_tracker.py | ArsOkenov/Finitewave | 14274d74be824a395b47a5c53ba18188798ab70d | [
"MIT"
] | null | null | null | examples/trackers/2D/tips_2d_tracker.py | ArsOkenov/Finitewave | 14274d74be824a395b47a5c53ba18188798ab70d | [
"MIT"
] | null | null | null |
#
# The example of Spiral2DTracker usage to record the spiral wave trajectory.
# Keep in mind that yu can use this tracker with fibrotic tissue.
#
from finitewave.cpuwave2D.tissue import CardiacTissue2D
from finitewave.cpuwave2D.model import AlievPanfilov2D
from finitewave.cpuwave2D.stimulation import StimVoltageCoo... | 28.551724 | 78 | 0.789251 |
2cbaf2413625adf479e54c6cc35e94c0d3f1fc67 | 1,046 | py | Python | tests/test_plugin.py | 20c/pluginmgr | c57e3755cfcdaef9898b1c5b4128ab2553c4e5f7 | [
"Apache-2.0"
] | 2 | 2017-09-04T19:02:11.000Z | 2018-09-27T14:34:40.000Z | tests/test_plugin.py | 20c/pluginmgr | c57e3755cfcdaef9898b1c5b4128ab2553c4e5f7 | [
"Apache-2.0"
] | 6 | 2016-07-23T05:18:11.000Z | 2022-03-21T14:48:07.000Z | tests/test_plugin.py | 20c/pluginmgr | c57e3755cfcdaef9898b1c5b4128ab2553c4e5f7 | [
"Apache-2.0"
] | null | null | null | import pytest
import pluginmgr
config = {
"plugin": [
{
"name": "fancy_probe",
"type": "probe0",
"var0": 24,
"str0": "reeb",
"interval": "5s",
},
{
"name": "emit0",
"type": "emit0",
"var0": 42,
... | 17.147541 | 63 | 0.503824 |
aa8ae9dc526a000bf4828d75a2188903c129bdc8 | 1,974 | py | Python | test/abs_test_class.py | kbelova/catcher | 90c8ae02fbd8841b2786bb757e56749e26bb78c3 | [
"Apache-2.0"
] | 84 | 2018-03-03T21:11:06.000Z | 2022-02-19T14:50:20.000Z | test/abs_test_class.py | kbelova/catcher | 90c8ae02fbd8841b2786bb757e56749e26bb78c3 | [
"Apache-2.0"
] | 131 | 2019-01-08T18:49:23.000Z | 2022-03-29T04:00:30.000Z | test/abs_test_class.py | kbelova/catcher | 90c8ae02fbd8841b2786bb757e56749e26bb78c3 | [
"Apache-2.0"
] | 11 | 2019-01-10T10:47:12.000Z | 2021-09-24T05:13:40.000Z | import os
import unittest
from os.path import join
from shutil import copyfile
import test
from catcher.modules.log_storage import EmptyLogStorage
from catcher.utils import logger
from catcher.utils.file_utils import ensure_empty, remove_dir, ensure_dir
from catcher.utils.singleton import Singleton
from test import re... | 32.360656 | 105 | 0.696049 |
fe535484b36fa0a885dfa781a0e91df10e6d9e0e | 55 | py | Python | openprocurement/archivarius/core/storages/__init__.py | ProzorroUKR/openprocurement.archivarius.core | 6aaeadeaf1fa686c7e2294e14d5ba4946b97f881 | [
"Apache-2.0"
] | null | null | null | openprocurement/archivarius/core/storages/__init__.py | ProzorroUKR/openprocurement.archivarius.core | 6aaeadeaf1fa686c7e2294e14d5ba4946b97f881 | [
"Apache-2.0"
] | 1 | 2018-10-02T05:54:09.000Z | 2018-10-02T05:54:09.000Z | openprocurement/archivarius/core/storages/__init__.py | ProzorroUKR/openprocurement.archivarius.core | 6aaeadeaf1fa686c7e2294e14d5ba4946b97f881 | [
"Apache-2.0"
] | null | null | null | from .storages import S3Storage
__all__ = [S3Storage]
| 13.75 | 31 | 0.781818 |
806fa05ff22fe39ef2ffd9dcd50a11192ec878ca | 2,628 | py | Python | config.py | xhlulu/dash-regression | bff1f9ef4cb5ee054aded4388787f26713d156f6 | [
"MIT"
] | 24 | 2018-07-23T16:42:05.000Z | 2021-06-14T15:10:52.000Z | config.py | xhlulu/dash-regression | bff1f9ef4cb5ee054aded4388787f26713d156f6 | [
"MIT"
] | 2 | 2020-07-18T09:01:41.000Z | 2021-05-10T15:42:52.000Z | config.py | xhlulu/dash-regression | bff1f9ef4cb5ee054aded4388787f26713d156f6 | [
"MIT"
] | 16 | 2019-05-17T07:18:03.000Z | 2020-09-26T04:59:04.000Z | import os
# Replace with the name of your Dash app
# This will end up being part of the URL of your deployed app,
# so it can't contain any spaces, capitalizations, or special characters
#
# This name MUST match the name that you specified in the
# Dash App Manager
DASH_APP_NAME = 'dash-regression'
# Set to 'private'... | 43.081967 | 89 | 0.699011 |
dbd4adec62570b422d6ff7f35c7edc04e2483a19 | 7,395 | py | Python | plgitcallback/__init__.py | cheind/pl-git-callback | f6b34341cef7d0c4d9024947e56a116735ab26ff | [
"MIT"
] | 1 | 2021-07-26T06:34:57.000Z | 2021-07-26T06:34:57.000Z | plgitcallback/__init__.py | cheind/pl-git-callback | f6b34341cef7d0c4d9024947e56a116735ab26ff | [
"MIT"
] | null | null | null | plgitcallback/__init__.py | cheind/pl-git-callback | f6b34341cef7d0c4d9024947e56a116735ab26ff | [
"MIT"
] | null | null | null | import json
import logging
import time
import warnings
from contextlib import contextmanager
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import Any, Dict, Literal, Optional, Union
import git
import pytorch_lightning as pl
class GitCommitCallbackError(Exception):
"""Error thrown... | 34.556075 | 137 | 0.673022 |
287460f777099dd0624c49830e3c97b8e74afd9a | 5,512 | py | Python | tests/test_page.py | T4rk1n/dazzler | 69c49422dc19c910445ab265b1d3481041de8f43 | [
"MIT"
] | 15 | 2019-12-19T11:57:30.000Z | 2021-11-15T23:34:41.000Z | tests/test_page.py | T4rk1n/dazzler | 69c49422dc19c910445ab265b1d3481041de8f43 | [
"MIT"
] | 196 | 2019-09-21T15:10:14.000Z | 2022-03-31T11:07:48.000Z | tests/test_page.py | T4rk1n/dazzler | 69c49422dc19c910445ab265b1d3481041de8f43 | [
"MIT"
] | 7 | 2019-10-30T19:38:15.000Z | 2021-12-01T04:54:16.000Z | """Page system specifics tests."""
import asyncio
import json
import pytest
from aiohttp import web
from dazzler import Dazzler
from dazzler.errors import PageConflictError
from dazzler.system import Page
from dazzler.components import core
@pytest.mark.async_test
async def test_page_meta_attributes(start_page, br... | 30.622222 | 78 | 0.682511 |
fcff9ec4f41fad158344ecd77313dc14564f3682 | 1,497 | py | Python | configs/_base_/models/pspnet_unet_s5-d16.py | weiyx16/mmsegmentation | 6d35d76195f173fbc6b119a7d7815e67d78024c6 | [
"Apache-2.0"
] | 903 | 2021-06-13T04:45:03.000Z | 2022-03-31T13:21:50.000Z | configs/_base_/models/pspnet_unet_s5-d16.py | weiyx16/mmsegmentation | 6d35d76195f173fbc6b119a7d7815e67d78024c6 | [
"Apache-2.0"
] | 72 | 2021-06-13T13:01:49.000Z | 2022-03-30T09:19:34.000Z | configs/_base_/models/pspnet_unet_s5-d16.py | weiyx16/mmsegmentation | 6d35d76195f173fbc6b119a7d7815e67d78024c6 | [
"Apache-2.0"
] | 159 | 2021-04-13T01:23:15.000Z | 2022-03-31T18:56:09.000Z | # model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained=None,
backbone=dict(
type='UNet',
in_channels=3,
base_channels=64,
num_stages=5,
strides=(1, 1, 1, 1, 1),
enc_num_convs=(2, 2, 2, 2, 2),
... | 29.352941 | 74 | 0.57515 |
b2d928f27beedb3b5d9677d16fab058ea1f65d4e | 7,711 | py | Python | samples/storage_sample/downloads_test.py | tomp61/apitools | d0bfc7a39d8dc7b716c0107fbf37775b85370f63 | [
"Apache-2.0"
] | null | null | null | samples/storage_sample/downloads_test.py | tomp61/apitools | d0bfc7a39d8dc7b716c0107fbf37775b85370f63 | [
"Apache-2.0"
] | null | null | null | samples/storage_sample/downloads_test.py | tomp61/apitools | d0bfc7a39d8dc7b716c0107fbf37775b85370f63 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 38.944444 | 79 | 0.686422 |
0b87aac9cb992cd74c498fe434ab366fc8b6706a | 499 | py | Python | pylings/ex_for_beginner/sum_of_range10.py | magiskboy/pylings | 6639107925b3cb8710403c4381027be894a043c2 | [
"MIT"
] | null | null | null | pylings/ex_for_beginner/sum_of_range10.py | magiskboy/pylings | 6639107925b3cb8710403c4381027be894a043c2 | [
"MIT"
] | null | null | null | pylings/ex_for_beginner/sum_of_range10.py | magiskboy/pylings | 6639107925b3cb8710403c4381027be894a043c2 | [
"MIT"
] | null | null | null | """
DESCRIPTION:
Given a range of the first 10 numbers, Iterate from the start number to the end number,
and In each iteration print the sum of the current number and previous number
REFERRENCE
- https://pynative.com/python-range-function/
- https://pynative.com/python-program-to-calculate-sum-and-average-of-numbers... | 21.695652 | 87 | 0.717435 |
74bdc55fbe713b61880bd236b83bdaa2bccd375a | 948 | py | Python | dev/ei38_imports.py | aleksandra-kim/bigFOODdb | bbfc15a295c13eafdc18fc3b52fa7c311b0bdfc0 | [
"MIT"
] | 1 | 2021-12-22T13:52:27.000Z | 2021-12-22T13:52:27.000Z | dev/ei38_imports.py | aleksandra-kim/bigFOODdb | bbfc15a295c13eafdc18fc3b52fa7c311b0bdfc0 | [
"MIT"
] | null | null | null | dev/ei38_imports.py | aleksandra-kim/bigFOODdb | bbfc15a295c13eafdc18fc3b52fa7c311b0bdfc0 | [
"MIT"
] | null | null | null | import bw2io as bi
import bw2data as bd
# import sys
# sys.path.append("/Users/akim/PycharmProjects/bigfood_db")
# Local files
from bigfood_db.import_databases import import_ecoinvent
from bigfood_db.importers import Agribalyse13Importer
from bigfood_db.utils import create_location_mapping, modify_exchanges
if __name... | 32.689655 | 105 | 0.755274 |
bba7cfb8d91dec89d30956873308d55158a2b0c0 | 7,427 | py | Python | mtp_api/apps/credit/serializers.py | ministryofjustice/mtp-api | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | [
"MIT"
] | 5 | 2016-01-05T12:21:35.000Z | 2020-10-28T17:06:02.000Z | mtp_api/apps/credit/serializers.py | ministryofjustice/mtp-api | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | [
"MIT"
] | 209 | 2015-06-12T09:39:41.000Z | 2022-03-21T16:01:19.000Z | mtp_api/apps/credit/serializers.py | ministryofjustice/mtp-api | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | [
"MIT"
] | 1 | 2021-04-11T06:19:23.000Z | 2021-04-11T06:19:23.000Z | from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from credit.models import Credit, Comment, ProcessingBatch, PrivateEstateBatch
from payment.serializers import BillingAddressSerializer
from prison.models import Prison, PrisonBa... | 32.718062 | 92 | 0.676451 |
6877b7a423674988e5d3156fae80f68f5a5eceae | 542 | py | Python | k2mosaic/tests/test_core.py | amcody/k2mosaic | 79733ab86249825868d5d6f6362a98656b8482f0 | [
"MIT"
] | 6 | 2016-11-18T22:07:50.000Z | 2021-12-06T15:05:25.000Z | k2mosaic/tests/test_core.py | amcody/k2mosaic | 79733ab86249825868d5d6f6362a98656b8482f0 | [
"MIT"
] | 14 | 2017-07-26T19:51:04.000Z | 2020-10-10T19:36:46.000Z | k2mosaic/tests/test_core.py | amcody/k2mosaic | 79733ab86249825868d5d6f6362a98656b8482f0 | [
"MIT"
] | 6 | 2017-07-25T17:58:02.000Z | 2020-10-10T18:28:10.000Z | import pytest
import k2mosaic
from k2mosaic import ui
def test_commands():
"""Check if the command-line tools can be run without crash."""
# If a command runs successfully it will raise a SystemExit at the end
with pytest.raises(SystemExit):
ui.k2mosaic()
# Also check the sub-commands:
wi... | 23.565217 | 74 | 0.686347 |
12d7ac18f9f81bdd027a8e9b92088156ec031395 | 4,783 | py | Python | setup.py | jlaska/pytest-trello | 82f5e59eec82660d16cb209bf533863d7c4493ef | [
"MIT"
] | 2 | 2016-02-10T16:27:35.000Z | 2021-03-19T09:18:36.000Z | setup.py | jlaska/pytest-trello | 82f5e59eec82660d16cb209bf533863d7c4493ef | [
"MIT"
] | null | null | null | setup.py | jlaska/pytest-trello | 82f5e59eec82660d16cb209bf533863d7c4493ef | [
"MIT"
] | 2 | 2020-02-22T17:00:57.000Z | 2021-03-19T06:45:20.000Z | import os
import sys
import glob
import shutil
from setuptools import setup, Command
from setuptools.command.test import test as TestCommand
from pytest_trello import __version__, __author__, __author_email__
if sys.version_info < (3, 0):
from ConfigParser import ConfigParser
else:
from configparser import Con... | 29.708075 | 88 | 0.595442 |
c5eda88b854017d27d256c1d17169a79a7404fd1 | 404 | py | Python | tests/conftest.py | albertomh/Nacar | bd8e33ff7afb0cd5a90f175c5b1287070c3fe3e9 | [
"MIT"
] | null | null | null | tests/conftest.py | albertomh/Nacar | bd8e33ff7afb0cd5a90f175c5b1287070c3fe3e9 | [
"MIT"
] | null | null | null | tests/conftest.py | albertomh/Nacar | bd8e33ff7afb0cd5a90f175c5b1287070c3fe3e9 | [
"MIT"
] | null | null | null | # Nacar
# Copyright 2022 Alberto Morón Hernández
# [github.com/albertomh/Nacar]
#
# Global test fixtures
# ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
# The test fixtures defined in this file are available
# to all test methods in the suite.
from os import path as os_path
import pytest
@pytest.fixture(scope='module')
def test_data_dir() ... | 22.444444 | 75 | 0.710396 |
748d99baaf03fcbd87637b169e142b45512cfb03 | 265 | py | Python | demo/model.py | eumis/tkviews | d4765602d08e48d8eb14f2019c0a78dbf0b9ee14 | [
"MIT"
] | 5 | 2018-04-12T20:30:48.000Z | 2021-01-03T19:11:06.000Z | demo/model.py | eumis/tkviews | d4765602d08e48d8eb14f2019c0a78dbf0b9ee14 | [
"MIT"
] | null | null | null | demo/model.py | eumis/tkviews | d4765602d08e48d8eb14f2019c0a78dbf0b9ee14 | [
"MIT"
] | 2 | 2021-01-03T19:11:22.000Z | 2021-01-31T12:26:59.000Z | """Demo view model"""
class Demo:
"""View model for demo item"""
def __init__(self, section: str, name: str, view: str = None):
self.section: str = section
self.name: str = name
self.view = view if view else f'{name.lower()}/view'
| 26.5 | 66 | 0.592453 |
b122b23f8e486fc3f1c96d74e11be65cf066cda0 | 1,295 | py | Python | venv/lib/python3.8/site-packages/azureml/_restclient/models/log_config_output_dto.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/_restclient/models/log_config_output_dto.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azureml/_restclient/models/log_config_output_dto.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 2.3.3... | 35 | 85 | 0.592278 |
6e7665bb88583088e1b7789536c4f9d7b92c8f88 | 1,748 | py | Python | rasa/nlu/emulators/dialogflow.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 3,603 | 2017-05-21T18:34:55.000Z | 2019-04-16T11:58:09.000Z | rasa/nlu/emulators/dialogflow.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 2,782 | 2017-05-21T20:36:15.000Z | 2019-04-16T14:35:20.000Z | rasa/nlu/emulators/dialogflow.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 1,337 | 2017-05-21T18:10:33.000Z | 2019-04-16T09:14:42.000Z | import uuid
from collections import defaultdict
from typing import Any, Dict, Text
from rasa.shared.nlu.constants import (
INTENT_NAME_KEY,
ENTITIES,
ENTITY_ATTRIBUTE_TYPE,
ENTITY_ATTRIBUTE_VALUE,
INTENT,
TEXT,
PREDICTED_CONFIDENCE_KEY,
)
from rasa.nlu.emulators.emulator import Emulator
c... | 31.214286 | 121 | 0.600114 |
7e56e7f34c5be3aac9dab727a7302f9d6f00f69e | 7,351 | py | Python | dcgan/utils.py | dannyqnguyen/eyewash | b9fccc5f7ab8eccfc36d46e95da7083b307ecaff | [
"MIT"
] | 1 | 2019-06-30T19:20:29.000Z | 2019-06-30T19:20:29.000Z | dcgan/utils.py | dannyqnguyen/eyewash | b9fccc5f7ab8eccfc36d46e95da7083b307ecaff | [
"MIT"
] | 3 | 2019-06-14T17:36:38.000Z | 2022-02-11T03:43:44.000Z | dcgan/utils.py | dannyqnguyen/eyewash | b9fccc5f7ab8eccfc36d46e95da7083b307ecaff | [
"MIT"
] | null | null | null | # Original Version: Taehoon Kim (http://carpedm20.github.io)
# + Source: https://github.com/carpedm20/DCGAN-tensorflow/blob/e30539fb5e20d5a0fed40935853da97e9e55eee8/utils.py
# + License: MIT
"""
Some codes from https://github.com/Newmu/dcgan_code
"""
from __future__ import division
import math
import json
import r... | 36.211823 | 123 | 0.533805 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.