hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
512bbffd3ae93c223279f63e30c884c82fca6363 | 1,522 | py | Python | common/zip_utils.py | SigalHu/jenkins-pipeline | 332e76cf53cd8d8f3d64d5cc5e60a2435961b513 | [
"Apache-2.0"
] | null | null | null | common/zip_utils.py | SigalHu/jenkins-pipeline | 332e76cf53cd8d8f3d64d5cc5e60a2435961b513 | [
"Apache-2.0"
] | null | null | null | common/zip_utils.py | SigalHu/jenkins-pipeline | 332e76cf53cd8d8f3d64d5cc5e60a2435961b513 | [
"Apache-2.0"
] | null | null | null | # encoding=utf-8
"""
@author huxujun
@date 2019-06-03
"""
import os
import shutil
import tarfile
def tar_dir(tar_name: str, target_dir: str, delete_target=False):
if not os.path.exists(os.path.dirname(tar_name)):
os.makedirs(os.path.dirname(tar_name))
target_dir = os.path.abspath(target_dir)
root... | 29.269231 | 91 | 0.654402 |
8446b45b51fbe664954c388d603279305f259ea5 | 13,553 | py | Python | MCP23017_R1/MCP23017_R1.py | jcksnvllxr80/Looper | 28108c15024e57949c6c78af391d4ec577fc5afd | [
"MIT"
] | 1 | 2021-06-06T15:36:27.000Z | 2021-06-06T15:36:27.000Z | MCP23017_R1/MCP23017_R1.py | jcksnvllxr80/Looper | 28108c15024e57949c6c78af391d4ec577fc5afd | [
"MIT"
] | 1 | 2021-06-06T15:37:42.000Z | 2021-06-06T15:37:42.000Z | MCP23017_R1/MCP23017_R1.py | jcksnvllxr80/Looper | 28108c15024e57949c6c78af391d4ec577fc5afd | [
"MIT"
] | null | null | null | import math
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.I2C as I2C
class MCP230xxBase(GPIO.BaseGPIO):
"""Base class to represent an MCP230xx series GPIO extender. Is compatible
with the Adafruit_GPIO BaseGPIO class so it can be used as a custom GPIO
class for interacting with device.
"""
def __i... | 34.662404 | 82 | 0.677119 |
5d1563065b2635547aa1fac76cd84ea520a6eea1 | 1,605 | py | Python | panelapp/panels/migrations/0018_auto_20170621_1254.py | genomicsengland/panelapp | f72537ae1e5ddf13eda74dd91d8018aba1890d32 | [
"Apache-2.0"
] | 7 | 2019-04-03T12:57:17.000Z | 2021-11-16T12:53:14.000Z | panelapp/panels/migrations/0018_auto_20170621_1254.py | genomicsengland/panelapp | f72537ae1e5ddf13eda74dd91d8018aba1890d32 | [
"Apache-2.0"
] | 6 | 2019-04-11T01:55:22.000Z | 2019-08-19T10:50:11.000Z | panelapp/panels/migrations/0018_auto_20170621_1254.py | genomicsengland/panelapp | f72537ae1e5ddf13eda74dd91d8018aba1890d32 | [
"Apache-2.0"
] | 5 | 2019-04-11T00:28:26.000Z | 2019-05-15T13:03:07.000Z | ##
## Copyright (c) 2016-2019 Genomics England Ltd.
##
## This file is part of PanelApp
## (see https://panelapp.genomicsengland.co.uk).
##
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional informati... | 33.4375 | 63 | 0.689097 |
3f4017afee7b016f6c3412f759410f48f5748b83 | 895 | py | Python | experiments.py | HardlySoftly/FAF-AI-Autorun | 7a9480250f8201980c89721c73b6e6ed3ffb52e2 | [
"Unlicense"
] | null | null | null | experiments.py | HardlySoftly/FAF-AI-Autorun | 7a9480250f8201980c89721c73b6e6ed3ffb52e2 | [
"Unlicense"
] | 3 | 2021-06-11T10:44:02.000Z | 2021-08-10T13:00:18.000Z | experiments.py | HardlySoftly/FAF-AI-Autorun | 7a9480250f8201980c89721c73b6e6ed3ffb52e2 | [
"Unlicense"
] | 2 | 2021-06-04T03:20:21.000Z | 2021-09-30T15:48:53.000Z | """
Set up your experiment configuration here.
Some AI keys for your convenience:
"rush" - Rush AI
"sorianrush" - Sorian AI Rush
"RNGStandard" - RNG Standard AI
"DalliConstAIKey" - Dalli AI
"uvesorush" - Uveso Rush AI
"swarmterror" - Swarm Terror AI
To find the AI key of any given AI, look in ... | 21.309524 | 77 | 0.615642 |
0b6e0516cae8fbe47a991dde7be0c33a564bc06f | 991 | py | Python | PropelRapp/migrations/0018_auto_20200512_0900.py | Adi1222/PropelR | 453196cb8ad7c251b650c6bd147a8be5ee8eed50 | [
"MIT"
] | 1 | 2021-12-03T11:24:57.000Z | 2021-12-03T11:24:57.000Z | PropelRapp/migrations/0018_auto_20200512_0900.py | Adi1222/PropelR | 453196cb8ad7c251b650c6bd147a8be5ee8eed50 | [
"MIT"
] | null | null | null | PropelRapp/migrations/0018_auto_20200512_0900.py | Adi1222/PropelR | 453196cb8ad7c251b650c6bd147a8be5ee8eed50 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2020-05-12 09:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('PropelRapp', '0017_auto_... | 30.96875 | 124 | 0.641776 |
53aff3f399030e4eef41e411dc01af766bb206f4 | 6,600 | py | Python | mythril/laser/ethereum/state/account.py | RainOfPhone/mythril | 53886999de82e587ad3782e1b0083a62e83684f7 | [
"MIT"
] | 1 | 2022-03-27T22:07:57.000Z | 2022-03-27T22:07:57.000Z | mythril/laser/ethereum/state/account.py | RainOfPhone/mythril | 53886999de82e587ad3782e1b0083a62e83684f7 | [
"MIT"
] | null | null | null | mythril/laser/ethereum/state/account.py | RainOfPhone/mythril | 53886999de82e587ad3782e1b0083a62e83684f7 | [
"MIT"
] | 1 | 2022-01-10T00:51:07.000Z | 2022-01-10T00:51:07.000Z | """This module contains account-related functionality.
This includes classes representing accounts and their storage.
"""
import logging
from copy import copy, deepcopy
from typing import Any, Dict, Union, Set
from mythril.laser.smt import Array, K, BitVec, simplify, BaseArray, If, Bool
from mythril.disassembler.dis... | 31.132075 | 111 | 0.580606 |
d802c1e3b5395434abc6e3429059a45b9f7bb457 | 1,290 | py | Python | new_price_server.py | nengchibawanfan/PriceServer | b8ea95fa60ca5b940417f56c45a757c661d83e27 | [
"Apache-2.0"
] | null | null | null | new_price_server.py | nengchibawanfan/PriceServer | b8ea95fa60ca5b940417f56c45a757c661d83e27 | [
"Apache-2.0"
] | null | null | null | new_price_server.py | nengchibawanfan/PriceServer | b8ea95fa60ca5b940417f56c45a757c661d83e27 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: zhangchao
# Date: 2019-04-10
# Desc: 报价服务入口,Flask-app
import json
import os
import time
from flask import Flask, request
from flask_graphql import GraphQLView
from werkzeug.contrib.fixers import ProxyFix
from priceserver.schema import schema
from priceserver.common.db_connection impo... | 26.326531 | 108 | 0.724806 |
efa0bbc44e269fd8636c364db7b9e766596e03f9 | 6,526 | py | Python | tests/cache/test_memcached_backend.py | SandySalvatore/dogpile_cache_release | 863b35becbf741bba89ddbf2700b7667298bf3d3 | [
"BSD-3-Clause"
] | null | null | null | tests/cache/test_memcached_backend.py | SandySalvatore/dogpile_cache_release | 863b35becbf741bba89ddbf2700b7667298bf3d3 | [
"BSD-3-Clause"
] | null | null | null | tests/cache/test_memcached_backend.py | SandySalvatore/dogpile_cache_release | 863b35becbf741bba89ddbf2700b7667298bf3d3 | [
"BSD-3-Clause"
] | null | null | null | from ._fixtures import _GenericBackendTest, _GenericMutexTest
from . import eq_, winsleep
from unittest import TestCase
from threading import Thread
import time
from nose import SkipTest
from dogpile.cache import compat
class _TestMemcachedConn(object):
@classmethod
def _check_backend_available(cls, backend):... | 30.638498 | 77 | 0.634079 |
e83311c76660f9c76c2a63aba270d81bbbe6c4da | 1,806 | py | Python | lib/googlecloudsdk/third_party/apis/dns/v1beta2/resources.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/dns/v1beta2/resources.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/dns/v1beta2/resources.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2015 Google Inc. 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 ag... | 29.129032 | 77 | 0.672757 |
f9784a85eb77ba54e748b40ea53aab31c82777c0 | 51,613 | py | Python | userbot/modules/google_drive.py | painakatsuki88/OUBnew | 5581691c0ec07c18067c395c65fe00569b5fdaaf | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2020-05-15T18:15:06.000Z | 2021-05-18T02:43:48.000Z | userbot/modules/google_drive.py | painakatsuki88/OUBnew | 5581691c0ec07c18067c395c65fe00569b5fdaaf | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/google_drive.py | painakatsuki88/OUBnew | 5581691c0ec07c18067c395c65fe00569b5fdaaf | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-04-16T07:34:47.000Z | 2021-04-16T07:34:47.000Z | # Copyright (C) 2020 Adek Maulana
#
# SPDX-License-Identifier: GPL-3.0-or-later
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | 37.895007 | 79 | 0.485149 |
1a0b74470c0a3ef7dcf7ce4eff2bcd0d42888ee6 | 357 | py | Python | atcoder/other/lang_update_202001/abc049_c.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/other/lang_update_202001/abc049_c.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/other/lang_update_202001/abc049_c.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | def main() -> None:
S = input()
idx = len(S)
while idx > 0:
for s in ["dreamer", "eraser", "dream", "erase"]:
if idx - len(s) >= 0 and s == S[idx-len(s):idx]:
idx -= len(s)
break
else:
print("NO")
return
print("YES")
i... | 21 | 60 | 0.408964 |
3bd3cc6632ff6527704be2e27d3e7e3aeca80b4e | 4,445 | py | Python | src/network/proxy.py | kdcis/PyBitmessage | 2ef6463439b21d662cfe0360f8df9a165909d63e | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 1,583 | 2015-01-01T13:03:20.000Z | 2022-03-31T23:10:00.000Z | src/network/proxy.py | kdcis/PyBitmessage | 2ef6463439b21d662cfe0360f8df9a165909d63e | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 841 | 2015-01-01T14:51:48.000Z | 2022-03-25T06:45:14.000Z | src/network/proxy.py | g1itch/PyBitmessage | 5bc92987c02cf41fecfe118e6d2ab148f7ddea21 | [
"MIT",
"BSD-2-Clause-FreeBSD"
] | 482 | 2015-01-07T00:53:25.000Z | 2022-03-24T15:58:12.000Z | """
Set proxy if avaiable otherwise exception
"""
# pylint: disable=protected-access
import logging
import socket
import time
import asyncore_pollchoose as asyncore
from advanceddispatcher import AdvancedDispatcher
from bmconfigparser import BMConfigParser
from node import Peer
logger = logging.getLogger('default')
... | 29.832215 | 72 | 0.607649 |
5c3362434987cc1d392ae6ae055d078ef3b814a8 | 1,375 | py | Python | pygame/cv2-stream/main-1-full-window.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | pygame/cv2-stream/main-1-full-window.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | pygame/cv2-stream/main-1-full-window.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z |
# date: 2019.04.06
#
# This version displays directly on screen so window must have the same size as stream
import pygame
import cv2
# --- local (built-in) camera ---
#stream = 0
# --- local file ---
#stream = '2019-03-26_08-43-15.mkv'
# --- http stream ---
# doesn't work any more
#stream = 'http://media.dumpert.... | 22.177419 | 117 | 0.652364 |
a8503251df5bc06d8a95a66acc859b68bed2f625 | 226 | py | Python | pyball/models/sport.py | glirios/PyBall | 7b537bebb1cbf84dd30da16aac45d89c4516b43e | [
"MIT"
] | null | null | null | pyball/models/sport.py | glirios/PyBall | 7b537bebb1cbf84dd30da16aac45d89c4516b43e | [
"MIT"
] | null | null | null | pyball/models/sport.py | glirios/PyBall | 7b537bebb1cbf84dd30da16aac45d89c4516b43e | [
"MIT"
] | null | null | null | from dataclasses import dataclass
@dataclass
class Sport:
id: int = None
code: str = None
link: str = None
name: str = None
abbreviation: str = None
sortOrder: str = None
activeStatus: bool = None | 18.833333 | 33 | 0.646018 |
870d0bc02c92e765475044826ccd1c0f49e5b27f | 2,246 | py | Python | discord/ext/voice_recv/common/utils.py | regulad/discord-ext-voice_recv | cb0e33ddadb65b2d4832c2fc7d7ebc6fdc1a81ed | [
"MIT"
] | 1 | 2022-02-24T17:10:49.000Z | 2022-02-24T17:10:49.000Z | discord/ext/voice_recv/common/utils.py | regulad/discord-ext-voice_recv | cb0e33ddadb65b2d4832c2fc7d7ebc6fdc1a81ed | [
"MIT"
] | null | null | null | discord/ext/voice_recv/common/utils.py | regulad/discord-ext-voice_recv | cb0e33ddadb65b2d4832c2fc7d7ebc6fdc1a81ed | [
"MIT"
] | 1 | 2022-02-24T19:45:33.000Z | 2022-02-24T19:45:33.000Z | # -*- coding: utf-8 -*-
# May not even be needed if i don't use the dict subclasses
from collections import defaultdict
class Bidict(dict):
"""A bi-directional dict"""
_None = object()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
super().update({v: k for k, v ... | 23.395833 | 83 | 0.508014 |
af661e5960433434bd08b7f66e0adaec1ddb3a1a | 30 | py | Python | tests/__init__.py | awelzel/pycommunityid | 8b823e0f82cd075f6481e22ef84a026ceac73f83 | [
"BSD-3-Clause"
] | 19 | 2019-07-11T18:19:03.000Z | 2022-03-01T11:50:34.000Z | tests/__init__.py | awelzel/pycommunityid | 8b823e0f82cd075f6481e22ef84a026ceac73f83 | [
"BSD-3-Clause"
] | 3 | 2019-08-19T15:03:28.000Z | 2021-03-08T21:12:07.000Z | tests/__init__.py | awelzel/pycommunityid | 8b823e0f82cd075f6481e22ef84a026ceac73f83 | [
"BSD-3-Clause"
] | 5 | 2019-07-11T19:07:15.000Z | 2021-04-10T21:55:12.000Z | import tests.communityid_test
| 15 | 29 | 0.9 |
d81a5b1a37b6dbc7610e6d9597f83699e68ead74 | 14,111 | py | Python | Configuration/Skimming/test/tier1/skim_TauPlusX.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Skimming/test/tier1/skim_TauPlusX.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Skimming/test/tier1/skim_TauPlusX.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # Auto generated configuration file
# using:
# Revision: 1.303.2.7
# Source: /cvs/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v
# with command line options: skim -s SKIM:LogError --data --conditions None --python_filenam skim_TauPlusX.py --magField AutoFromDBCurrent --no_exec
import FWCore.Par... | 220.484375 | 11,938 | 0.80292 |
29aa69e6807a1d049c4384e7d2187b81c43efd88 | 104 | py | Python | 01_basic/exercise_005.py | sideroff/python-exercises | 6a9cc55735d977a71697204c734b3ade84a0c4fd | [
"MIT"
] | null | null | null | 01_basic/exercise_005.py | sideroff/python-exercises | 6a9cc55735d977a71697204c734b3ade84a0c4fd | [
"MIT"
] | 4 | 2020-03-24T18:00:07.000Z | 2021-06-02T00:51:22.000Z | 01_basic/exercise_005.py | sideroff/python-exercises | 6a9cc55735d977a71697204c734b3ade84a0c4fd | [
"MIT"
] | null | null | null | first_name = input("First name: ")
last_name = input("Last name: ")
print(last_name + " " + first_name) | 26 | 35 | 0.673077 |
2f0f85b604f7dc965f16ee5a89b423b631f83d9e | 97 | py | Python | renovations/apps.py | MarcinSzyc/andzy-calc | 0a44c66c0adb844918c4bd0e22a3db4588220612 | [
"MIT"
] | null | null | null | renovations/apps.py | MarcinSzyc/andzy-calc | 0a44c66c0adb844918c4bd0e22a3db4588220612 | [
"MIT"
] | 7 | 2019-12-04T23:04:22.000Z | 2021-06-10T18:04:21.000Z | renovations/apps.py | MarcinSzyc/andzy-calc | 0a44c66c0adb844918c4bd0e22a3db4588220612 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class RenovationsConfig(AppConfig):
name = 'renovations'
| 16.166667 | 35 | 0.773196 |
b303945858724807f1f3c95b417ed18b8b8779fe | 307 | py | Python | submissions/arc067/b.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/arc067/b.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/arc067/b.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
n, a, b = map(int, readline().split())
x = list(map(int, readline().split()))
ans = 0
for bf, af in zip(x, x[1:]):
ans += min((af - bf) * a, b)
print(ans)
| 23.615385 | 38 | 0.654723 |
3cf38c358bc76fe113c0079e3a3ee6e096e39775 | 10,328 | py | Python | homeassistant/components/smartthings/__init__.py | fkwp/home-assistant | 539d24dd60d7d0d17ddc287995ef57f728d8eeab | [
"Apache-2.0"
] | 1 | 2019-02-18T03:16:32.000Z | 2019-02-18T03:16:32.000Z | homeassistant/components/smartthings/__init__.py | bwz3891923/home-assistant | ce7f678b9b505e25ab6d995bedd2fc6544e294f8 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:29:36.000Z | 2022-03-12T00:59:48.000Z | homeassistant/components/smartthings/__init__.py | bwz3891923/home-assistant | ce7f678b9b505e25ab6d995bedd2fc6544e294f8 | [
"Apache-2.0"
] | null | null | null | """Support for SmartThings Cloud."""
import asyncio
import importlib
import logging
from typing import Iterable
from aiohttp.client_exceptions import (
ClientConnectionError, ClientResponseError)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassist... | 38.394052 | 77 | 0.628679 |
a374cde62eba22b17cab741a609d24e89bff1192 | 3,080 | py | Python | tfwss/segment.py | dshahrokhian/tfwss | e21d655a1a9a2aff5c0db4d86501778af16e5f50 | [
"MIT"
] | 235 | 2018-02-12T21:05:08.000Z | 2022-03-15T07:27:54.000Z | tfwss/segment.py | dshahrokhian/tfwss | e21d655a1a9a2aff5c0db4d86501778af16e5f50 | [
"MIT"
] | 5 | 2018-03-06T21:30:57.000Z | 2019-07-29T00:10:45.000Z | tfwss/segment.py | dshahrokhian/tfwss | e21d655a1a9a2aff5c0db4d86501778af16e5f50 | [
"MIT"
] | 55 | 2018-02-13T13:58:28.000Z | 2022-02-27T23:45:14.000Z | """
segment.py
Segmentation utility functions.
Written by Phil Ferriere
Licensed under the MIT License (see LICENSE for details)
"""
# TODO The SDI paper uses Grabcut+ (Grabcut on HED boundaries). How difficult is it to implement?
# TODO Try this version of Grabcut: https://github.com/meng-tang/KernelCut_ICCV15 ?
#... | 42.191781 | 120 | 0.655195 |
a9292e14a9b6e4aa04ec3e28098156f1a60869e0 | 14,997 | py | Python | sdk/python/pulumi_azure_nextgen/synapse/v20190601preview/get_big_data_pool.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/synapse/v20190601preview/get_big_data_pool.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/synapse/v20190601preview/get_big_data_pool.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 42.126404 | 530 | 0.68167 |
3eafb1e3eec1c102ba0866c1672c1d4726aeeab6 | 1,998 | py | Python | sqlalchemy_utils/__init__.py | kelvinhammond/sqlalchemy-utils | 64714c9a0ca44594e00ea70c31aa25269172f6f6 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/__init__.py | kelvinhammond/sqlalchemy-utils | 64714c9a0ca44594e00ea70c31aa25269172f6f6 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/__init__.py | kelvinhammond/sqlalchemy-utils | 64714c9a0ca44594e00ea70c31aa25269172f6f6 | [
"BSD-3-Clause"
] | null | null | null | from .aggregates import aggregated # noqa
from .asserts import ( # noqa
assert_max_length,
assert_max_value,
assert_min_value,
assert_non_nullable,
assert_nullable
)
from .exceptions import ImproperlyConfigured # noqa
from .expression_parser import ExpressionParser # noqa
from .functions import ... | 22.2 | 68 | 0.717217 |
4ba9263c8fb46b8d6a9786e2a1f9c4d8f6a50502 | 9,928 | py | Python | python_modules/dagster-test/dagster_test/test_project/__init__.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-test/dagster_test/test_project/__init__.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-test/dagster_test/test_project/__init__.py | ericct/dagster | dd2c9f05751e1bae212a30dbc54381167a14f6c5 | [
"Apache-2.0"
] | null | null | null | import base64
import os
import subprocess
import sys
from dagster import check
from dagster.core.code_pointer import FileCodePointer
from dagster.core.definitions.reconstructable import (
ReconstructablePipeline,
ReconstructableRepository,
)
from dagster.core.host_representation import (
ExternalPipeline,
... | 36.634686 | 98 | 0.674557 |
627e4a6974f6adf42eb346c22134bcf5dac9865c | 1,443 | py | Python | NumerosAleatorios/aula134.py | pinheirogus/Curso-Python-Udemy | d6d52320426172e924081b9df619490baa8c6016 | [
"MIT"
] | 1 | 2021-09-01T01:58:13.000Z | 2021-09-01T01:58:13.000Z | NumerosAleatorios/aula134.py | pinheirogus/Curso-Python-Udemy | d6d52320426172e924081b9df619490baa8c6016 | [
"MIT"
] | null | null | null | NumerosAleatorios/aula134.py | pinheirogus/Curso-Python-Udemy | d6d52320426172e924081b9df619490baa8c6016 | [
"MIT"
] | null | null | null | import random
import string
# inteiro = random.randint(10, 20)
# inteiro = random.randrange(3, 74, 1)
# flutuante = random.uniform(10, 20)
# flutuante = random.random()
#
# print(inteiro)
# print(flutuante)
#
# lista = ['Luiz', 'Otávio', 'Maria', 'Rose', 'Jenny', 'Danilo', 'Felipe']
#
# sorteio = random.choice(lista)... | 26.722222 | 166 | 0.72973 |
3f3a21ad9664f130e03f1d2036c4edb8554dac54 | 2,196 | py | Python | portafolio/parametros/models.py | breinerGiraldo/python | 89603d7ce0be8e2bb20817ee3c845fdb26a1b54a | [
"bzip2-1.0.6"
] | null | null | null | portafolio/parametros/models.py | breinerGiraldo/python | 89603d7ce0be8e2bb20817ee3c845fdb26a1b54a | [
"bzip2-1.0.6"
] | null | null | null | portafolio/parametros/models.py | breinerGiraldo/python | 89603d7ce0be8e2bb20817ee3c845fdb26a1b54a | [
"bzip2-1.0.6"
] | null | null | null | from django.db import models
#from ckeditor.fields import RichTextField
#importamos la liosta de tipos de mensaje
from .pqrsf import PQRSF_CHOICES
class Contact(models.Model):
email=models.EmailField( max_length=50, verbose_name="correo electronico")
tipom=models.CharField( max_length=50, choices=PQRSF_CHOIC... | 26.780488 | 109 | 0.694444 |
1b078726e414664f9d4ceecc48be598474bb6103 | 1,240 | py | Python | smart2.py | GARVIT-KAUSHIK/Smart-Attendence-System | 6eb9d052bf3f989fcf4d74ec87c3e2d8dd299ca8 | [
"Apache-2.0"
] | null | null | null | smart2.py | GARVIT-KAUSHIK/Smart-Attendence-System | 6eb9d052bf3f989fcf4d74ec87c3e2d8dd299ca8 | [
"Apache-2.0"
] | null | null | null | smart2.py | GARVIT-KAUSHIK/Smart-Attendence-System | 6eb9d052bf3f989fcf4d74ec87c3e2d8dd299ca8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
df=pd.read_csv("C:/Users/Administrator/Desktop/at1.csv")
import cv2
cam = cv2.VideoCapture(0)
detector = cv2.CascadeClassifier('C:/Users/Administrator/Desktop/haarcascade_frontalface_default.xml')
Id = input('Enter your id:')
Name=input('Enter your name:')
df2 = pd.DataFrame({"Id":[Id],"Nam... | 37.575758 | 126 | 0.63629 |
5c6590339eee958bd83bdaaaf3106c430bbdfe95 | 416 | py | Python | indenter.py | Johan-Mi/ScratchCompiler | 0ae449c95e9254c92daabee59083e6c8391a0ff1 | [
"WTFPL"
] | 2 | 2020-06-24T10:51:32.000Z | 2021-05-08T01:16:54.000Z | indenter.py | Johan-Mi/ScratchCompiler | 0ae449c95e9254c92daabee59083e6c8391a0ff1 | [
"WTFPL"
] | null | null | null | indenter.py | Johan-Mi/ScratchCompiler | 0ae449c95e9254c92daabee59083e6c8391a0ff1 | [
"WTFPL"
] | null | null | null | """This module contains the ScratchIndenter class, which handles indentation for the parser."""
from lark.indenter import Indenter
class ScratchIndenter(Indenter):
"""The indenter used for the scratch parser."""
NL_type = "_NEWLINE"
OPEN_PAREN_types = ["LPAR", "LSQB", "LBRACE"]
CLOSE_PAREN_types = ["R... | 32 | 95 | 0.692308 |
80195f9b18e75c69b58f81a144f2760c516f6a8a | 6,702 | py | Python | tests/integration-tests/tests/scaling/test_scaling.py | Chen188/aws-parallelcluster | 5e5f9025fe58fdb5c696f100858da1948561b888 | [
"Apache-2.0"
] | 415 | 2018-11-13T15:02:15.000Z | 2022-03-31T15:26:06.000Z | tests/integration-tests/tests/scaling/test_scaling.py | Chen188/aws-parallelcluster | 5e5f9025fe58fdb5c696f100858da1948561b888 | [
"Apache-2.0"
] | 2,522 | 2018-11-13T16:16:27.000Z | 2022-03-31T13:57:10.000Z | tests/integration-tests/tests/scaling/test_scaling.py | lukeseawalker/aws-parallelcluster | 16d427429dae8e638f4350fc3369b751afeeb69b | [
"Apache-2.0"
] | 164 | 2018-11-14T22:47:46.000Z | 2022-03-22T11:33:22.000Z | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file acc... | 50.390977 | 116 | 0.777977 |
89c53f5755c258416eba3eec5bbf20c81a922e4b | 2,077 | py | Python | config.py | cyy0523xc/chineseocr | 09616e976a58ef4339098a77446993d7e1cca705 | [
"MIT"
] | 5,049 | 2018-05-02T06:58:34.000Z | 2022-03-31T14:41:55.000Z | config.py | cyy0523xc/chineseocr | 09616e976a58ef4339098a77446993d7e1cca705 | [
"MIT"
] | 527 | 2018-05-15T04:13:45.000Z | 2022-03-09T02:11:14.000Z | config.py | cyy0523xc/chineseocr | 09616e976a58ef4339098a77446993d7e1cca705 | [
"MIT"
] | 1,696 | 2018-05-14T10:04:16.000Z | 2022-03-31T18:34:07.000Z | import os
pwd = os.getcwd()
########################文字检测################################################
##文字检测引擎
IMGSIZE = (608,608)## yolo3 输入图像尺寸
yoloTextFlag = 'keras' ##keras,opencv,darknet,模型性能 keras>darknet>opencv
############## keras yolo ##############
keras_anchors = '8,11, 8,16, 8,23, 8,33, 8,48, 8,97, 8,1... | 37.089286 | 81 | 0.569571 |
63928e767ed4fe15aee9d0d4ee17e7cc15c075dc | 2,374 | py | Python | Assignment_2/src/task_3_3.py | thealphadollar/ML-Assignments | 547c115d0d62c770aa673bf98fd56ff184bcfbd6 | [
"MIT"
] | null | null | null | Assignment_2/src/task_3_3.py | thealphadollar/ML-Assignments | 547c115d0d62c770aa673bf98fd56ff184bcfbd6 | [
"MIT"
] | 1 | 2021-02-02T23:14:05.000Z | 2021-02-02T23:14:05.000Z | Assignment_2/src/task_3_3.py | thealphadollar/CS60050-ML-Assignments | 547c115d0d62c770aa673bf98fd56ff184bcfbd6 | [
"MIT"
] | null | null | null | from sklearn.model_selection import cross_validate
from sklearn.tree import DecisionTreeClassifier
from os import path
import pandas as pd
# ignore warnings of uncovergence because we are not setting convergence criteria
import warnings
warnings.filterwarnings('ignore')
from task_3_1 import DTClassifier
def main():
... | 46.54902 | 123 | 0.701769 |
29b93e662643d4abc389bea5833c041918fe370d | 2,410 | py | Python | progress_checkpoint/common.py | peper0/progress-checkpoint | 2bafe39c6a8fb8b823fbdf5ff8b17506b874def9 | [
"MIT"
] | null | null | null | progress_checkpoint/common.py | peper0/progress-checkpoint | 2bafe39c6a8fb8b823fbdf5ff8b17506b874def9 | [
"MIT"
] | null | null | null | progress_checkpoint/common.py | peper0/progress-checkpoint | 2bafe39c6a8fb8b823fbdf5ff8b17506b874def9 | [
"MIT"
] | null | null | null | import sys
from typing import Callable, Optional, Sequence, Coroutine, Generator, Iterable
if sys.version_info >= (3, 8):
from typing import Protocol
else:
Protocol = object
ProgressFraction = float # from 0 to 1
StatusMessage = str
class Checkpoint(Protocol):
def __call__(self, progress: ProgressFract... | 31.710526 | 114 | 0.620747 |
19e46c909036e19487ac4ba047a5499d65d3c4d2 | 1,236 | py | Python | cnstd/utils/common_types.py | breezedeus/cnstd | 57a8171ea706c9e8f665bffc640d90022d43ab8e | [
"Apache-2.0"
] | 266 | 2020-06-02T12:33:50.000Z | 2022-03-31T06:12:46.000Z | cnstd/utils/common_types.py | breezedeus/cnstd | 57a8171ea706c9e8f665bffc640d90022d43ab8e | [
"Apache-2.0"
] | 37 | 2020-06-04T13:34:35.000Z | 2022-03-25T07:43:21.000Z | cnstd/utils/common_types.py | breezedeus/cnstd | 57a8171ea706c9e8f665bffc640d90022d43ab8e | [
"Apache-2.0"
] | 66 | 2020-06-02T12:33:33.000Z | 2022-03-24T14:22:09.000Z | # coding: utf-8
# Copyright (C) 2021, [Breezedeus](https://github.com/breezedeus).
# 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 f... | 39.870968 | 75 | 0.7589 |
edbbb8970bc3e56ed8444300c4904b8a051d03e5 | 3,273 | py | Python | Accounts/models.py | oluwex/quizApp | 069fbc85f1be8768d121728017d07b2c5b17a3c7 | [
"MIT"
] | null | null | null | Accounts/models.py | oluwex/quizApp | 069fbc85f1be8768d121728017d07b2c5b17a3c7 | [
"MIT"
] | null | null | null | Accounts/models.py | oluwex/quizApp | 069fbc85f1be8768d121728017d07b2c5b17a3c7 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser
)
def user_directory_path(instance, filename):
ext = filename.split(".")[-1]
return "user_{0}/{1}".format(instance.user.id, ext)
class UserManager(BaseUserManager):
def create_user(... | 25.372093 | 116 | 0.723801 |
75668d8f2cb0a438c75b05209d9ff91da417b885 | 1,983 | py | Python | bookbot/filters.py | rundoom/BookingBot | d70fd8407f124f597f9e1ba05dc8df681c8766c3 | [
"WTFPL"
] | 1 | 2018-02-13T10:50:11.000Z | 2018-02-13T10:50:11.000Z | bookbot/filters.py | rundoom/BookingBot | d70fd8407f124f597f9e1ba05dc8df681c8766c3 | [
"WTFPL"
] | 8 | 2018-02-11T19:20:10.000Z | 2018-02-15T20:26:32.000Z | bookbot/filters.py | rundoom/BookingBot | d70fd8407f124f597f9e1ba05dc8df681c8766c3 | [
"WTFPL"
] | 1 | 2018-02-08T14:28:46.000Z | 2018-02-08T14:28:46.000Z | from telegram.ext import BaseFilter
from bookbot import datacore
class CommitPick(BaseFilter):
def filter(self, callback_query):
return datacore.data_as_json(
callback_query.data).type == datacore.consts.COMMITTED\
and (resolve_stance_for_callback(callback_query, datacore.const... | 36.722222 | 139 | 0.740797 |
89a85fb4851db13856febe06564d5e32a3361e80 | 16,152 | py | Python | tornado_demo/web2py/gluon/contrib/rss2.py | ls-2018/tips | 1f5f5195d7181b5dd4616db02166f7f92c97f1cd | [
"MIT"
] | 2 | 2019-05-07T03:08:25.000Z | 2020-05-22T10:10:00.000Z | tornado_demo/web2py/gluon/contrib/rss2.py | ls-2018/tips | 1f5f5195d7181b5dd4616db02166f7f92c97f1cd | [
"MIT"
] | 7 | 2020-05-22T13:29:42.000Z | 2021-09-23T23:30:25.000Z | tornado_demo/web2py/gluon/contrib/rss2.py | ls-2018/py | 1f5f5195d7181b5dd4616db02166f7f92c97f1cd | [
"MIT"
] | null | null | null | """
PyRSS2Gen - A Python library for generating RSS 2.0 feeds.
(This is the BSD license, based on the template at
http://www.opensource.org/licenses/bsd-license.php )
Copyright (c) 2003, Dalke Scientific Software, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modific... | 30.360902 | 72 | 0.613918 |
ac3ee266243ae16865d355ef1c90c782d70b2276 | 23,861 | py | Python | aiohttp/web_response.py | adamko147/aiohttp | 3250c5d75a54e19e2825d0a609f9d9cd4bf62087 | [
"Apache-2.0"
] | 1 | 2021-01-19T09:47:03.000Z | 2021-01-19T09:47:03.000Z | aiohttp/web_response.py | mochengyanyu/aiohttp | 3014db406268ff74cabbee75ca5fbc23ffe0dd1c | [
"Apache-2.0"
] | 199 | 2020-11-01T08:02:46.000Z | 2022-03-31T07:05:31.000Z | aiohttp/web_response.py | mochengyanyu/aiohttp | 3014db406268ff74cabbee75ca5fbc23ffe0dd1c | [
"Apache-2.0"
] | null | null | null | import asyncio
import collections.abc
import datetime
import enum
import json
import math
import time
import warnings
import zlib
from concurrent.futures import Executor
from email.utils import parsedate
from http.cookies import Morsel
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterator,
Mapping... | 33.18637 | 91 | 0.587989 |
b444c1df62303f1be610037c86b35188d3c03263 | 13,477 | py | Python | display_stats_ddi.py | rionbr/ddi-blumenau | 394e3cb983f90079c9bc3b5a96dd7cbd86b1b524 | [
"MIT"
] | 1 | 2019-07-28T19:28:12.000Z | 2019-07-28T19:28:12.000Z | display_stats_ddi.py | rionbr/ddi-blumenau | 394e3cb983f90079c9bc3b5a96dd7cbd86b1b524 | [
"MIT"
] | null | null | null | display_stats_ddi.py | rionbr/ddi-blumenau | 394e3cb983f90079c9bc3b5a96dd7cbd86b1b524 | [
"MIT"
] | null | null | null | #dd coding=utf-8
# Author: Rion B Correia
# Date: Nov 16, 2014
#
# Description: Plot DDI timelines
#
#
from __future__ import division
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', 50)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1500)
pd.set_option('display.max_co... | 44.923333 | 204 | 0.684796 |
322cad9a47ee8ed9215d586e11f04f8698d00d68 | 2,172 | py | Python | algoritmosEstruturaDeDados/ficha02/fila.py | paulojosejr/Istec-Codes | ed248654e42d59fda55ab02f7c2c5c0bd88a16bd | [
"MIT"
] | null | null | null | algoritmosEstruturaDeDados/ficha02/fila.py | paulojosejr/Istec-Codes | ed248654e42d59fda55ab02f7c2c5c0bd88a16bd | [
"MIT"
] | null | null | null | algoritmosEstruturaDeDados/ficha02/fila.py | paulojosejr/Istec-Codes | ed248654e42d59fda55ab02f7c2c5c0bd88a16bd | [
"MIT"
] | null | null | null | class Fila:
#2.1. Crie uma estrutura de dados tipo “fila”
def __init__(self):
self.fila = []
#2.2. Crie uma função para ver se a “fila” está vazia
def vazia(self):
return self.tamanho() == 0
def tamanho(self):
return len(self.fila)
#2.3. Crie uma função para adicionar um ... | 35.606557 | 77 | 0.61372 |
3cc580dd09bb95c1c4b90d0385a35d95fb07d6c9 | 901 | py | Python | accounts/views.py | VitoMinheere/obey_testing_goat | f503115789190672a8c6d96e13737bf1206ff86b | [
"CC0-1.0"
] | null | null | null | accounts/views.py | VitoMinheere/obey_testing_goat | f503115789190672a8c6d96e13737bf1206ff86b | [
"CC0-1.0"
] | null | null | null | accounts/views.py | VitoMinheere/obey_testing_goat | f503115789190672a8c6d96e13737bf1206ff86b | [
"CC0-1.0"
] | null | null | null | from django.shortcuts import render, redirect
from django.core.mail import send_mail
from django.contrib import messages, auth
from django.core.urlresolvers import reverse
from accounts.models import Token
def send_login_email(request):
email = request.POST['email']
token = Token.objects.create(email=email)
... | 26.5 | 72 | 0.659267 |
78b0077d8e2492aa913d1ab56d49adbd9cbf4af1 | 39,034 | py | Python | src/transformers/modeling_tf_albert.py | haqishen/transformers | d38bbb225f7b847e8be4e969cb9b40e7e4d798a6 | [
"Apache-2.0"
] | 107 | 2020-06-09T14:44:29.000Z | 2022-03-02T18:44:11.000Z | src/transformers/modeling_tf_albert.py | haqishen/transformers | d38bbb225f7b847e8be4e969cb9b40e7e4d798a6 | [
"Apache-2.0"
] | 6 | 2020-10-07T16:35:29.000Z | 2022-03-10T03:30:15.000Z | src/transformers/modeling_tf_albert.py | haqishen/transformers | d38bbb225f7b847e8be4e969cb9b40e7e4d798a6 | [
"Apache-2.0"
] | 13 | 2020-06-11T03:16:56.000Z | 2021-11-19T21:49:07.000Z | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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... | 47.142512 | 159 | 0.678434 |
7298cc64c286e56fb7d99cf95dd46fc77cf94d38 | 13,055 | py | Python | appengine/components/tests/auth_tokens_test.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/components/tests/auth_tokens_test.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | null | null | null | appengine/components/tests/auth_tokens_test.py | pombreda/swarming | c70f311f3db8f25752c793a0d7b36cf537d95580 | [
"Apache-2.0"
] | 1 | 2021-12-06T03:37:36.000Z | 2021-12-06T03:37:36.000Z | #!/usr/bin/env python
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
import datetime
import string
import sys
import unittest
import test_env
test_env.setup_test_env()
from support import test_case
... | 34.086162 | 80 | 0.681348 |
007bfb61ec7129593145d68443aadbfa767fb84a | 2,786 | py | Python | app/recipe/tests/test_ingredients_api.py | gabrigcl/recipes-app-api | 59f2ad759b0e5089606253c292c1ac087c2bf2f5 | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | gabrigcl/recipes-app-api | 59f2ad759b0e5089606253c292c1ac087c2bf2f5 | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredients_api.py | gabrigcl/recipes-app-api | 59f2ad759b0e5089606253c292c1ac087c2bf2f5 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingred... | 32.022989 | 78 | 0.678033 |
f33417d5b6c984d744be4aeb6ed0ecaa2a5c09a1 | 1,372 | py | Python | setup.py | HappyFacade/nbQA | e6542669a255c80ec8b3f16864d55a885fad30fb | [
"MIT"
] | null | null | null | setup.py | HappyFacade/nbQA | e6542669a255c80ec8b3f16864d55a885fad30fb | [
"MIT"
] | null | null | null | setup.py | HappyFacade/nbQA | e6542669a255c80ec8b3f16864d55a885fad30fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from pathlib import Path
from setuptools import find_packages, setup
readme = Path("README.md").read_text(encoding="utf8")
requirements = ["toml"]
setup_requirements = []
test_requirements = []
setup(
author="Marco Gorelli, Girish Pasupathy",
python_requires=... | 29.191489 | 74 | 0.655248 |
55dd5b5662b83c91cab46e16a5715bfd082aa36b | 2,741 | py | Python | main.py | mannynarang/coffeemachine_py | ad009cf3045547f0bf90c7396882e16adedd65ce | [
"MIT"
] | null | null | null | main.py | mannynarang/coffeemachine_py | ad009cf3045547f0bf90c7396882e16adedd65ce | [
"MIT"
] | null | null | null | main.py | mannynarang/coffeemachine_py | ad009cf3045547f0bf90c7396882e16adedd65ce | [
"MIT"
] | null | null | null |
import menu
user_money = {"quarters": 0,
"dimes": 0,
"nickles": 0,
"pennies": 0
}
def report():
print(f"Water: {menu.resources['water']}ml")
print(f"Milk: {menu.resources['milk']}ml")
print(f"Coffee: {menu.resources['coffee']}g")
print(f"Money:... | 30.797753 | 103 | 0.608902 |
3a05bb73d465930fa3c657d752317f93db1ee7db | 192 | py | Python | htmlparser/helpers/get.py | weblit/html-parser | 9fa9cc97ff1a747fd742397ad6b2d65d10aeba50 | [
"MIT"
] | null | null | null | htmlparser/helpers/get.py | weblit/html-parser | 9fa9cc97ff1a747fd742397ad6b2d65d10aeba50 | [
"MIT"
] | 3 | 2022-01-12T14:51:20.000Z | 2022-02-01T05:14:39.000Z | htmlparser/helpers/get.py | weblit/html-parser | 9fa9cc97ff1a747fd742397ad6b2d65d10aeba50 | [
"MIT"
] | null | null | null | """
A simple function to get raw string data response from a specific url
"""
import requests
def get(url: str) -> str:
r = requests.get(url)
r.close()
return r.content.decode() | 17.454545 | 69 | 0.661458 |
c1b2b8f405091d804b484c7c4a0fa9c500f09d73 | 21,663 | py | Python | vcenter2itop.py | JulienNauroy/python-itop-api | 2927a557d767acc1925c3c429fd72dd27170e6db | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2017-02-10T23:02:48.000Z | 2019-06-06T08:10:25.000Z | vcenter2itop.py | JulienNauroy/python-itop-api | 2927a557d767acc1925c3c429fd72dd27170e6db | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | vcenter2itop.py | JulienNauroy/python-itop-api | 2927a557d767acc1925c3c429fd72dd27170e6db | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-06-06T08:10:30.000Z | 2019-06-06T08:10:30.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-fr
# pylint: disable=invalid-name
"""
vcenter2itop is a basic CLI interface to export vcenter data into iTop.
requires pyVmomi
"""
__version__ = '1.0'
__authors__ = ['Julien Nauroy <julien.nauroy@u-psud.fr>']
from itopapi import ItopapiController, ItopapiConfig, Unsupported... | 38.89228 | 130 | 0.647233 |
582385eafa6e8a0b77571b3286bf0cb1111c4cb1 | 3,742 | py | Python | napari_brainreg_standard/brainreg_standard.py | brainglobe/napari-brainreg-standard | d3a44391708e02f842fa5f3cf108dfea1c754d85 | [
"MIT"
] | null | null | null | napari_brainreg_standard/brainreg_standard.py | brainglobe/napari-brainreg-standard | d3a44391708e02f842fa5f3cf108dfea1c754d85 | [
"MIT"
] | null | null | null | napari_brainreg_standard/brainreg_standard.py | brainglobe/napari-brainreg-standard | d3a44391708e02f842fa5f3cf108dfea1c754d85 | [
"MIT"
] | null | null | null | import os
import json
import tifffile
from pathlib import Path
from napari_plugin_engine import napari_hook_implementation
from bg_atlasapi.bg_atlas import BrainGlobeAtlas
@napari_hook_implementation
def napari_get_reader(path):
"""A basic implementation of the napari_get_reader hook specification.
Paramete... | 28.348485 | 82 | 0.61705 |
098d2e26328391eef4b251922fdce130026e97fe | 977 | py | Python | Geometry/CSCGeometryBuilder/python/cscGeometryDB_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Geometry/CSCGeometryBuilder/python/cscGeometryDB_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Geometry/CSCGeometryBuilder/python/cscGeometryDB_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
#
# This cfi should be included to build the CSC geometry model.
#
# modelling flags (for completeness - internal defaults are already sane)
# GF would like to have a shorter name (e.g. CSCGeometry), but since originally
# there was no name, replace statements in other configs ... | 36.185185 | 82 | 0.763562 |
ed5de2556803ee74752384171b18a2afed0ad448 | 954 | py | Python | isi_sdk_8_1_1/test/test_ntp_server_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_ntp_server_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_ntp_server_create_params.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 23.268293 | 101 | 0.721174 |
94a48a62165155d9a8eab9ec13288db12dafd5fb | 574 | py | Python | apps/oob/context_processors/user_context.py | dbjennings/order-of-business | 8f424bd36b323e4c102b3d8704bb576c150d585a | [
"MIT"
] | null | null | null | apps/oob/context_processors/user_context.py | dbjennings/order-of-business | 8f424bd36b323e4c102b3d8704bb576c150d585a | [
"MIT"
] | null | null | null | apps/oob/context_processors/user_context.py | dbjennings/order-of-business | 8f424bd36b323e4c102b3d8704bb576c150d585a | [
"MIT"
] | null | null | null | from apps.oob.forms.task_forms import TaskForm
from apps.oob.models import Project, Task
from apps.oob.forms import TaskSearchForm
def user_context(request):
context = {}
if request.user.is_authenticated:
context = {
'user_projects': Project.objects.filter(user=request.user).exclude(pa... | 38.266667 | 107 | 0.684669 |
5a446db2115d3d166ff22f99d0016b2f7b43e729 | 1,784 | py | Python | venv/lib/python2.7/site-packages/pychart/pychart_types.py | Christian-Castro/castro_odoo8 | 8247fdb20aa39e043b6fa0c4d0af509462ab3e00 | [
"Unlicense"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | venv/lib/python2.7/site-packages/pychart/pychart_types.py | Christian-Castro/castro_odoo8 | 8247fdb20aa39e043b6fa0c4d0af509462ab3e00 | [
"Unlicense"
] | null | null | null | venv/lib/python2.7/site-packages/pychart/pychart_types.py | Christian-Castro/castro_odoo8 | 8247fdb20aa39e043b6fa0c4d0af509462ab3e00 | [
"Unlicense"
] | null | null | null | #
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
#
# Jockey 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, or (at your option) any
# later version.
#
# Jockey is distr... | 31.298246 | 71 | 0.682175 |
f468fdf70fa23f69437284e62353152b398c2a36 | 1,223 | py | Python | cirq/optimizers/__init__.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/__init__.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/__init__.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"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 ... | 25.479167 | 74 | 0.774325 |
f410426405eed3caf676b53097250d1a84e002db | 470 | py | Python | src/sort_kernels.py | BorgwardtLab/graphkernels-review | 3dfc2fad64d4159722f06db11b555fc568997fcf | [
"BSD-3-Clause"
] | 3 | 2021-02-27T07:21:30.000Z | 2021-07-30T21:10:05.000Z | src/sort_kernels.py | BorgwardtLab/graphkernels-review | 3dfc2fad64d4159722f06db11b555fc568997fcf | [
"BSD-3-Clause"
] | null | null | null | src/sort_kernels.py | BorgwardtLab/graphkernels-review | 3dfc2fad64d4159722f06db11b555fc568997fcf | [
"BSD-3-Clause"
] | 3 | 2021-01-20T14:03:52.000Z | 2021-08-23T08:36:25.000Z | #!/usr/bin/env python3
#
# sort_kernels.py: sorts kernels according to their *average* predictive
# performance over all benchmark data sets.
import pandas as pd
import sys
from collections import Counter
if __name__ == '__main__':
df = pd.read_csv(sys.argv[1], header=0, index_col=0)
df['mean'] = df.mean(... | 21.363636 | 72 | 0.665957 |
d1bb96f359491ac9f1c739e1c8706cafd99505aa | 98 | py | Python | instagram_api/exceptions/invalid_sms_code.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | instagram_api/exceptions/invalid_sms_code.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | instagram_api/exceptions/invalid_sms_code.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | from .request import RequestException
class InvalidSmsCodeException(RequestException):
pass
| 16.333333 | 48 | 0.826531 |
6ccb7a5148a5ea6e6daaed73f2007fdbd96d30f7 | 710 | py | Python | ABC/202/d_ans.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/202/d_ans.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | ABC/202/d_ans.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | def main():
# input
A, B, K = map(int, input().split())
# compute
dp = [[0]*B for _ in range(A)]
## define function find_kth
def find_kth(A: int, B: int, K: int) -> str:
if A == 0:
return 'b' * B
elif B == 0:
return 'a' * A
elif K <= dp[A-1][B]:
... | 21.515152 | 55 | 0.402817 |
a766957bf0b4dadb8cdaa19dd6e5fe6620965837 | 1,177 | py | Python | GTC/nodes.py | MSLNZ/GTC2 | f73714a3efe6f9ce3d3f1e0925c94d774d12c80a | [
"MIT"
] | 9 | 2018-11-21T23:02:08.000Z | 2021-11-13T11:19:25.000Z | GTC/nodes.py | MSLNZ/GTC | e446fcf1e2f378a477e28af6182dcb083b7ee732 | [
"MIT"
] | 12 | 2018-11-06T21:32:19.000Z | 2022-03-06T20:19:06.000Z | GTC/nodes.py | MSLNZ/GTC2 | f73714a3efe6f9ce3d3f1e0925c94d774d12c80a | [
"MIT"
] | 2 | 2020-05-14T12:43:21.000Z | 2021-06-10T16:07:27.000Z | """
Copyright (c) 2018, Measurement Standards Laboratory of New Zealand.
"""
__all__ = (
'Leaf',
'Node'
)
#----------------------------------------------------------------------------
class Node(object):
"""
A `Node` holds information about an intermediate uncertain real number
... | 21.4 | 78 | 0.425658 |
f523f814239d4d1f129e14adacfe086e565e481a | 546 | py | Python | tests/unit_tests/model_utils/test_persistence.py | exasol/data-science-utils-python | 44f4019b30f4945e14a8ee19c1a4f6bed68692d9 | [
"MIT"
] | null | null | null | tests/unit_tests/model_utils/test_persistence.py | exasol/data-science-utils-python | 44f4019b30f4945e14a8ee19c1a4f6bed68692d9 | [
"MIT"
] | 27 | 2021-06-04T15:45:21.000Z | 2022-02-14T12:16:34.000Z | tests/unit_tests/model_utils/test_persistence.py | exasol/data-science-utils-python | 44f4019b30f4945e14a8ee19c1a4f6bed68692d9 | [
"MIT"
] | null | null | null | from exasol_data_science_utils_python.model_utils.persistence import dump_to_base64_string, load_from_base64_string
class MyClass:
def __init__(self, a, b, c):
self.c = c
self.b = b
self.a = a
def test_persistence():
obj = MyClass("a", 2, {"c": 4})
b64_string = dump_to_base64_str... | 30.333333 | 115 | 0.666667 |
9af3bfa23ebf0337d65942896f3cc89f9cde729a | 989 | py | Python | utils/restful.py | Mhh123/django | d5c607102bbfa5274895766a134388f379ea0da4 | [
"Apache-2.0"
] | null | null | null | utils/restful.py | Mhh123/django | d5c607102bbfa5274895766a134388f379ea0da4 | [
"Apache-2.0"
] | null | null | null | utils/restful.py | Mhh123/django | d5c607102bbfa5274895766a134388f379ea0da4 | [
"Apache-2.0"
] | null | null | null | #encoding: utf-8
from django.http import JsonResponse, HttpResponse
class HttpCode(object):
ok = 200
paramserror = 400
unauth = 401
methoderror = 405
servererror = 500
# {"code":400,"message":"","data":{}}
def result(code=HttpCode.ok,message="",data=None,kwargs=None):
json_dict =... | 26.72973 | 71 | 0.689585 |
952491231443528b1cc8134bf96116b626aca01d | 586 | py | Python | test/test_modify_some_group.py | evgeniy-shorgin/python_training | 2926618243bebc66c61a425f32890e325885c85c | [
"Apache-2.0"
] | null | null | null | test/test_modify_some_group.py | evgeniy-shorgin/python_training | 2926618243bebc66c61a425f32890e325885c85c | [
"Apache-2.0"
] | null | null | null | test/test_modify_some_group.py | evgeniy-shorgin/python_training | 2926618243bebc66c61a425f32890e325885c85c | [
"Apache-2.0"
] | null | null | null | from model.group import Group
import random
def test_modify_some_group_name(app, db, json_groups, check_ui):
group = json_groups
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
old_groups = db.get_group_list()
group_to_modify = random.choice(old_groups)
app.group.mod... | 34.470588 | 71 | 0.728669 |
b55e2ce4ceda7a300a1882913e5586fbbbd0cc67 | 3,724 | py | Python | Screens/GameOverScreen.py | EpicTofuu/Froggers | 0395ef801fe11a7881fd32fd570bf3135a4a761f | [
"MIT"
] | 1 | 2020-11-17T04:32:55.000Z | 2020-11-17T04:32:55.000Z | Screens/GameOverScreen.py | EpicTofuu/Froggers | 0395ef801fe11a7881fd32fd570bf3135a4a761f | [
"MIT"
] | null | null | null | Screens/GameOverScreen.py | EpicTofuu/Froggers | 0395ef801fe11a7881fd32fd570bf3135a4a761f | [
"MIT"
] | null | null | null | from Screen import *
from Screens.MainMenuScreen import *
import Screens.MainMenuScreen
from Stats import GameStats
from UI.FroggerButton import *
import pygame
import datetime
import os
from tkinter import messagebox, simpledialog
from GameObjects.Entities.Player import *
import logging
class GameOverScreen (Screen)... | 36.15534 | 115 | 0.611171 |
a6bebbbf6885099b1858ab7f0088b929b5059765 | 756 | py | Python | app.py | kpjhg0124/neis_code_finder | ff775b13e496f6e2cb966962fa32945f32348f2f | [
"MIT"
] | null | null | null | app.py | kpjhg0124/neis_code_finder | ff775b13e496f6e2cb966962fa32945f32348f2f | [
"MIT"
] | null | null | null | app.py | kpjhg0124/neis_code_finder | ff775b13e496f6e2cb966962fa32945f32348f2f | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, jsonify
import modules.get_code
app = Flask(__name__)
@app.route('/')
def get_page():
query = request.args.get('q')
page = request.args.get('page')
return render_template(
'index.html',
school_infos = query and get_code.get(query, page),
... | 29.076923 | 75 | 0.626984 |
e230b98654945b7878e419453030ad6f626b7bb5 | 1,034 | py | Python | src/gqa/data_sort_big.py | esteng/vagueness | 6c9627575188b325cfb72181931c95b774ca18b0 | [
"MIT"
] | null | null | null | src/gqa/data_sort_big.py | esteng/vagueness | 6c9627575188b325cfb72181931c95b774ca18b0 | [
"MIT"
] | null | null | null | src/gqa/data_sort_big.py | esteng/vagueness | 6c9627575188b325cfb72181931c95b774ca18b0 | [
"MIT"
] | null | null | null | import json
import re
with open('/home/jgualla1/vagueness/src/GQA_Data/output_FINAL.json') as f:
total_question_dict = json.load(f)
predicate = "overcast"
dictionary_list = []
count = 0
order_count = 0
for key in total_question_dict:
question_dict = total_question_dict[str(order_count)]
question = ques... | 27.945946 | 141 | 0.667311 |
80dc0469a40116d501a241d1c8fd6a81a7be21c8 | 1,577 | py | Python | test/test_gaeb_conversion_api.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | 1 | 2019-01-12T18:10:24.000Z | 2019-01-12T18:10:24.000Z | test/test_gaeb_conversion_api.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | test/test_gaeb_conversion_api.py | Dangl-IT/avacloud-client-python | 66f555096bbbc87d02d02e4e2dfb0c6accb18f95 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import avacloud_client_python
from avacloud_client_python.... | 25.031746 | 116 | 0.699429 |
b1c1c899b2b38d2826b98285e84c5726b6421166 | 221 | py | Python | Day2/Python/String_and_pallindrome.py | Grace0Hud/dailycodebase | 3c48b376f0acd2a65605d601b6b09996b725045b | [
"MIT"
] | 249 | 2018-12-17T16:13:06.000Z | 2022-03-31T04:39:14.000Z | Day2/Python/String_and_pallindrome.py | Grace0Hud/dailycodebase | 3c48b376f0acd2a65605d601b6b09996b725045b | [
"MIT"
] | 203 | 2018-12-19T11:03:27.000Z | 2021-06-09T16:10:30.000Z | Day2/Python/String_and_pallindrome.py | Grace0Hud/dailycodebase | 3c48b376f0acd2a65605d601b6b09996b725045b | [
"MIT"
] | 211 | 2018-12-19T10:08:20.000Z | 2022-03-22T20:01:28.000Z | """
* @author Shashank
* @date 21/12/2018
"""
a=input("Enter the input string:")
d=a.replace(" ","")
c=list(d)
c.reverse()
e="".join(c)
if d==e:
print("String is pallindrome")
else:
print("Not a pallindrome")
| 13.8125 | 34 | 0.597285 |
f8aa88dc020f0b66e62ae5907f48516abf0232a1 | 11,258 | py | Python | examples/stein_dmm.py | karm-patel/numpyro | 34e0cdf4fa0ab9a0300a0d894d6758419fb46f40 | [
"Apache-2.0"
] | null | null | null | examples/stein_dmm.py | karm-patel/numpyro | 34e0cdf4fa0ab9a0300a0d894d6758419fb46f40 | [
"Apache-2.0"
] | null | null | null | examples/stein_dmm.py | karm-patel/numpyro | 34e0cdf4fa0ab9a0300a0d894d6758419fb46f40 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
Example: Deep Markov Model inferred using SteinVI
=================================================
In this example we infer a deep Markov model (DMM) using SteinVI for generating music
(chorales by Johan Sebastian Bach).
The mode... | 32.443804 | 107 | 0.618849 |
4663b824531715532709490839c4e2ffb68d3f18 | 239 | py | Python | lang/py/pylib/code/fractions/fractions_create_strings.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | lang/py/pylib/code/fractions/fractions_create_strings.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | lang/py/pylib/code/fractions/fractions_create_strings.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
import fractions
for s in [ '1/2', '2/4', '3/6' ]:
f = fractions.Fraction(s)
print '%s = %s' % (s, f)
| 15.933333 | 55 | 0.594142 |
be56641b399375cc93a587adbf22ec4d03445626 | 1,748 | py | Python | RobotFlask/RobotFlask/ioThubMsgSender.py | Microshak/iotil-RobotAPI | 1e545d352a360dd99345fb657f0cb37a8b6146d6 | [
"Apache-2.0"
] | null | null | null | RobotFlask/RobotFlask/ioThubMsgSender.py | Microshak/iotil-RobotAPI | 1e545d352a360dd99345fb657f0cb37a8b6146d6 | [
"Apache-2.0"
] | null | null | null | RobotFlask/RobotFlask/ioThubMsgSender.py | Microshak/iotil-RobotAPI | 1e545d352a360dd99345fb657f0cb37a8b6146d6 | [
"Apache-2.0"
] | null | null | null | import base64
import hmac
import hashlib
import time
import requests
import urllib
import urllib.parse
class IoThubMsgSender(object):
API_VERSION = '2016-02-03'
TOKEN_EXPIRES = 100
def __init__(self, connectionString=None):
if connectionString != None:
iotHost, deviceid, deviceKe... | 38 | 123 | 0.628719 |
57d47a472682f830e75e3ba1a204934ee207fef7 | 29,358 | py | Python | modules/pymol/wizard/mutagenesis.py | kingdavid72/pymol-OpenSource | 8068af8b53a4ae16657b536e83bfd5310e58a8bd | [
"CNRI-Python"
] | 2 | 2019-05-23T22:17:29.000Z | 2020-07-03T14:36:22.000Z | modules/pymol/wizard/mutagenesis.py | kingdavid72/pymol-OpenSource | 8068af8b53a4ae16657b536e83bfd5310e58a8bd | [
"CNRI-Python"
] | null | null | null | modules/pymol/wizard/mutagenesis.py | kingdavid72/pymol-OpenSource | 8068af8b53a4ae16657b536e83bfd5310e58a8bd | [
"CNRI-Python"
] | null | null | null |
from __future__ import print_function
from pymol.wizard import Wizard
from pymol import cmd,editor
from chempy import io
from copy import deepcopy
import pymol
import os
import traceback
src_sele = "_mutate_sel"
bump_name = "_bump_check"
obj_name = "mutation"
frag_name = "_tmp_mut"
mut_sele = "_tmp_mut_sele"
tmp_o... | 40.493793 | 122 | 0.459023 |
8c790753693fb3c3a14f32a2d68dcdba9dee7011 | 661 | py | Python | coursepro/coursepro/backends.py | PyExplorer/coursepro | 7e4675c62a31e484afd20cc528cc495d0b3787c1 | [
"MIT"
] | null | null | null | coursepro/coursepro/backends.py | PyExplorer/coursepro | 7e4675c62a31e484afd20cc528cc495d0b3787c1 | [
"MIT"
] | null | null | null | coursepro/coursepro/backends.py | PyExplorer/coursepro | 7e4675c62a31e484afd20cc528cc495d0b3787c1 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
class EmailBackend(object):
def authenticate(self, username=None, password=None, **kwargs):
try:
user = User.objects.get(email=username)
except User.MultipleObjectsReturned:
user = User.objects.filter(email=username).order_by('id... | 27.541667 | 77 | 0.626324 |
df52896985f8b6bb7167eb570f88cc8b02f36fee | 6,277 | py | Python | tests/st/numpy_native/utils.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/numpy_native/utils.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/numpy_native/utils.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 34.489011 | 82 | 0.666879 |
3a9c08911ba38aec1df99189566b400cf45b5f51 | 1,710 | py | Python | AstroSeminar2019Spring/Data_analysis_recipe/LinearRegression/ex6/sample_wishart.py | bhishanpdl/AstroSeminar_OU | 3181fb74b3ac67a86c37683ddb0d48355a084495 | [
"MIT"
] | null | null | null | AstroSeminar2019Spring/Data_analysis_recipe/LinearRegression/ex6/sample_wishart.py | bhishanpdl/AstroSeminar_OU | 3181fb74b3ac67a86c37683ddb0d48355a084495 | [
"MIT"
] | null | null | null | AstroSeminar2019Spring/Data_analysis_recipe/LinearRegression/ex6/sample_wishart.py | bhishanpdl/AstroSeminar_OU | 3181fb74b3ac67a86c37683ddb0d48355a084495 | [
"MIT"
] | null | null | null | import scipy as sc
import scipy.stats as stats
import scipy.linalg as linalg
import math as m
def sample_wishart(n,V,nsamples=1):
"""sample_wishart: Sample a matrix from a Wishart distribution given
by a shape paramter n and a scale matrix V
Based on: W. B. Smith and R. R. Hocking, Algorithm AS 53: Wishart... | 30.535714 | 121 | 0.569591 |
23b77b33a69d500dbce271f17563fb064161dbbc | 1,375 | py | Python | test/control_test.py | kaeff/python-rover | cf7af12ae6ee3f63c15978347082a70c094c4e8a | [
"MIT"
] | null | null | null | test/control_test.py | kaeff/python-rover | cf7af12ae6ee3f63c15978347082a70c094c4e8a | [
"MIT"
] | null | null | null | test/control_test.py | kaeff/python-rover | cf7af12ae6ee3f63c15978347082a70c094c4e8a | [
"MIT"
] | null | null | null | import unittest
from rover import control
class ControlTest(unittest.TestCase):
def test_example(self):
input = """5 5
1 2 N
LMLMLMLMM
3 3 E
MMRMMRMRRM"""
expected = """1 3 N
5 1 E"""
actual = control.launch_mission(input)
self.assertEqual(actual, expected)
def test_simple... | 29.891304 | 65 | 0.618909 |
7f6432ecbfab610c1070c120c88063dfd12b089a | 9,913 | py | Python | docs/conf.py | jayvdb/test_server | e46b5f4c0b38b9c98d90625407c91855f725ed5a | [
"MIT"
] | 2 | 2019-11-04T07:17:02.000Z | 2021-02-11T06:33:57.000Z | docs/conf.py | jayvdb/test_server | e46b5f4c0b38b9c98d90625407c91855f725ed5a | [
"MIT"
] | 8 | 2018-04-17T01:14:42.000Z | 2022-02-19T22:17:01.000Z | docs/conf.py | jayvdb/test_server | e46b5f4c0b38b9c98d90625407c91855f725ed5a | [
"MIT"
] | 8 | 2015-05-12T19:34:27.000Z | 2020-04-10T06:28:01.000Z | # -*- coding: utf-8 -*-
#
# test_server documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 25 22:55:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | 28.98538 | 80 | 0.702714 |
796f73260b764512fdcd2d6aa289fbb82ccea7cb | 2,902 | py | Python | sampledb/frontend/markdown_images.py | NicolasCARPi/sampledb | d6fd0f4d28d05010d7e0c022fbf2576e25435077 | [
"MIT"
] | null | null | null | sampledb/frontend/markdown_images.py | NicolasCARPi/sampledb | d6fd0f4d28d05010d7e0c022fbf2576e25435077 | [
"MIT"
] | null | null | null | sampledb/frontend/markdown_images.py | NicolasCARPi/sampledb | d6fd0f4d28d05010d7e0c022fbf2576e25435077 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
There are several Markdown editors built into the SampleDB frontend, which
need to be able to upload images. This module allows uploading images which
are then assigned a random file name and can be used in the Markdown editors
using that name.
"""
import base64
import os
import flask
import flask... | 33.744186 | 125 | 0.719159 |
be77ca8b937f6722cfe97edcc5f2b79c00f0dc0c | 8,487 | py | Python | project_2/main.py | Tarabyte/pirple-python-assignments | abb2e693c27619e385b37c945c635e294fbf5eaf | [
"MIT"
] | null | null | null | project_2/main.py | Tarabyte/pirple-python-assignments | abb2e693c27619e385b37c945c635e294fbf5eaf | [
"MIT"
] | null | null | null | project_2/main.py | Tarabyte/pirple-python-assignments | abb2e693c27619e385b37c945c635e294fbf5eaf | [
"MIT"
] | null | null | null | """
Project #2: Hangman
Have you ever played hangman? It's a children's game, normally played by kids when they're supposed to be doing homework instead. If you've never played here are the rules:
https://www.youtube.com/watch?v=cGOeiQfjYPk
https://www.wikihow.com/Play-Hangman
For this assignment, we want to play h... | 24.110795 | 194 | 0.543537 |
3008eebbe561a75746e564518bfd346f3146e945 | 1,097 | py | Python | preprocess_videos_for_syncnet.py | ankurbhatia24/syncnet_python2 | c6f499add92904ab669894a0028fa2f245981b3f | [
"MIT"
] | null | null | null | preprocess_videos_for_syncnet.py | ankurbhatia24/syncnet_python2 | c6f499add92904ab669894a0028fa2f245981b3f | [
"MIT"
] | null | null | null | preprocess_videos_for_syncnet.py | ankurbhatia24/syncnet_python2 | c6f499add92904ab669894a0028fa2f245981b3f | [
"MIT"
] | null | null | null | def normalize_sampling_rate_aac_mono(file_path, out_file_path):
# Change to 22050 for all the videos
cmd = f"ffmpeg -hide_banner -loglevel error -i {file_path} -ac 1 -ar 16000 -c:a aac -q:a 1.3 {out_file_path} -y"
proc = subprocess.Popen(cmd, shell=True)
returncode = proc.wait()
if returncode != 0:
... | 39.178571 | 135 | 0.682771 |
3e4673c890bef4e1389f0578efc1361249176e00 | 162,374 | py | Python | pandas/io/pytables.py | rebecca-palmer/pandas | 7c94949dc89c62cae1bc647acd87266d6c3a0468 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-01-21T17:05:14.000Z | 2020-01-21T17:05:14.000Z | pandas/io/pytables.py | rebecca-palmer/pandas | 7c94949dc89c62cae1bc647acd87266d6c3a0468 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/io/pytables.py | rebecca-palmer/pandas | 7c94949dc89c62cae1bc647acd87266d6c3a0468 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-01-19T09:48:37.000Z | 2021-01-19T09:48:37.000Z | """
High level interface to PyTables for reading and writing pandas data structures
to disk
"""
import copy
from datetime import date, tzinfo
import itertools
import os
import re
from typing import (
TYPE_CHECKING,
Any,
Dict,
Hashable,
List,
Optional,
Tuple,
Type,
Union,
)
import wa... | 31.719867 | 104 | 0.559166 |
6c55a326a502b96e25615faeb9829ff7c3632a72 | 775 | py | Python | garmin/auto_sync.py | agent87/Garmin | 70bc1ccb228e13e3554d90b806b48f6045714d21 | [
"Apache-2.0"
] | 2 | 2020-04-11T04:07:46.000Z | 2021-04-28T16:41:38.000Z | garmin/auto_sync.py | agent87/Garmin | 70bc1ccb228e13e3554d90b806b48f6045714d21 | [
"Apache-2.0"
] | null | null | null | garmin/auto_sync.py | agent87/Garmin | 70bc1ccb228e13e3554d90b806b48f6045714d21 | [
"Apache-2.0"
] | null | null | null |
from pyudev import Context, Monitor, MonitorObserver
import pyudev
import time
import configparser
from subprocess import Popen, PIPE
import os
from sync import synchronise
config = configparser.ConfigParser()
config.read('config.ini')
context = pyudev.Context()
monitor = pyudev.Monitor.from_netlink(context)
monitor... | 29.807692 | 113 | 0.665806 |
26f79081eba170eae83267daa975220428a5f31f | 4,403 | py | Python | test/terra/backends/test_qasm_simulator.py | zachschoenfeld33/qiskit-aer | f5e854f428f07e06b17828e1abf5fbfa42eaf123 | [
"Apache-2.0"
] | 1 | 2019-12-12T07:58:14.000Z | 2019-12-12T07:58:14.000Z | test/terra/backends/test_qasm_simulator.py | BryceFuller/qiskit-aer | abd418e37359210e809a94e74db33f08ad053fd6 | [
"Apache-2.0"
] | null | null | null | test/terra/backends/test_qasm_simulator.py | BryceFuller/qiskit-aer | abd418e37359210e809a94e74db33f08ad053fd6 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 51.197674 | 97 | 0.750625 |
a9bc2c278dd9ef86fef7b968518e3ca025ab6ba8 | 850 | py | Python | hardhat/recipes/python/hg_zipdoc.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/hg_zipdoc.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/hg_zipdoc.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | import os
import shutil
from ..base import Downloader, Extractor, Recipe
class HgZipDocRecipe(Downloader, Extractor, Recipe):
def __init__(self, *args, **kwargs):
super(HgZipDocRecipe, self).__init__(*args, **kwargs)
self.sha256 = '0de7075c9be80856f3a1c8968f42cfa0' \
'9c44d09... | 34 | 76 | 0.614118 |
0e09539d477e4c27ab68c7ec62855bb997bc22a1 | 6,259 | py | Python | CIM14/CPSM/Equipment/Wires/MutualCoupling.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 58 | 2015-04-22T10:41:03.000Z | 2022-03-29T16:04:34.000Z | CIM14/CPSM/Equipment/Wires/MutualCoupling.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 12 | 2015-08-26T03:57:23.000Z | 2020-12-11T20:14:42.000Z | CIM14/CPSM/Equipment/Wires/MutualCoupling.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 35 | 2015-01-10T12:21:03.000Z | 2020-09-09T08:18:16.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | 54.903509 | 308 | 0.723758 |
a45f29255a6d375c895af9fa3eab287675b02bb7 | 8,486 | py | Python | mobilenetV3-large_RetinaFace/test_widerface_pad.py | zhongtb/insightface | ab7e30998666f92f84a9830c95fe105b73cda335 | [
"MIT"
] | null | null | null | mobilenetV3-large_RetinaFace/test_widerface_pad.py | zhongtb/insightface | ab7e30998666f92f84a9830c95fe105b73cda335 | [
"MIT"
] | null | null | null | mobilenetV3-large_RetinaFace/test_widerface_pad.py | zhongtb/insightface | ab7e30998666f92f84a9830c95fe105b73cda335 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import sys
import os
import time
import numpy as np
os.environ['PYTHONUNBUFFERED'] = '1'
os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
os.environ['MXNET_ENABLE_GPU_P2P'] = '0'
import mxnet as mx
from mxnet import ndarray as nd
import cv2
from rcnn.logger impor... | 37.38326 | 121 | 0.644709 |
6c24d747692f4ff2b34ec5475a7e3be4e702bd7e | 49,018 | py | Python | src/transformers/models/gptj/modeling_tf_gptj.py | yhl48/transformers | b320d87eceb369ea22d5cd73866499851cb2cca3 | [
"Apache-2.0"
] | 1 | 2022-03-28T15:28:54.000Z | 2022-03-28T15:28:54.000Z | src/transformers/models/gptj/modeling_tf_gptj.py | yhl48/transformers | b320d87eceb369ea22d5cd73866499851cb2cca3 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/gptj/modeling_tf_gptj.py | yhl48/transformers | b320d87eceb369ea22d5cd73866499851cb2cca3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The EleutherAI and HuggingFace Teams. 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
#... | 42.366465 | 160 | 0.646579 |
f591d47ea543b539dd702bc9854f259ddbef8355 | 4,459 | py | Python | configs/example/ruby_direct_test.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | null | null | null | configs/example/ruby_direct_test.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | null | null | null | configs/example/ruby_direct_test.py | volnxebec/CC_Fused | e2b805e3475bd275409379c41eaeeb1a565cbdef | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, Inc.
# 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 co... | 35.388889 | 77 | 0.718995 |
dbb9315074bf1f92aa1129380818c2104ecbb6b2 | 2,704 | py | Python | osbs/exceptions.py | lkolacek/osbs-client | 90c6db9a414214c681c777468079bcbe7dd7c809 | [
"BSD-3-Clause"
] | 32 | 2015-09-17T18:30:20.000Z | 2018-12-29T18:10:14.000Z | osbs/exceptions.py | lkolacek/osbs-client | 90c6db9a414214c681c777468079bcbe7dd7c809 | [
"BSD-3-Clause"
] | 624 | 2015-07-13T14:12:06.000Z | 2019-05-29T14:43:48.000Z | osbs/exceptions.py | lkolacek/osbs-client | 90c6db9a414214c681c777468079bcbe7dd7c809 | [
"BSD-3-Clause"
] | 29 | 2015-09-18T10:06:48.000Z | 2019-04-10T10:19:41.000Z | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Exceptions raised by OSBS
"""
from __future__ import print_function, absolute_import, unicode_literals
import json
from requests.utils import g... | 30.727273 | 80 | 0.631287 |
982a4434221ceeefdb41cb6f840ea7020cbe91ec | 625 | py | Python | setup.py | phdye/docopt_attr | e511b5051e263df1f465b7f07077cc68234bac71 | [
"MIT"
] | null | null | null | setup.py | phdye/docopt_attr | e511b5051e263df1f465b7f07077cc68234bac71 | [
"MIT"
] | null | null | null | setup.py | phdye/docopt_attr | e511b5051e263df1f465b7f07077cc68234bac71 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from setuptools.command.install import install
from src.version import __version__
from pprint import PrettyPrinter
pp = PrettyPrinter(indent=4).pprint
setup(
name='docopt_attr',
version=__version__,
description="docopt with options as attributes rather than di... | 27.173913 | 84 | 0.7264 |
c7762447c9a424fa16063038dea2ef1f599f3ef9 | 1,955 | py | Python | TestMarker.py | DosennooB/homing_algorithm | f7bd96b912a45da34482d37fc4842b102b144987 | [
"MIT"
] | null | null | null | TestMarker.py | DosennooB/homing_algorithm | f7bd96b912a45da34482d37fc4842b102b144987 | [
"MIT"
] | null | null | null | TestMarker.py | DosennooB/homing_algorithm | f7bd96b912a45da34482d37fc4842b102b144987 | [
"MIT"
] | null | null | null |
from Retina import Retina
import matplotlib.pyplot as plt
import statistics
from Punktvector import PunktVector, coord
from Raytrays import see
res = 80 #Auflösug der Retina
dim = 34 #für Raytrays gibt an wie weit der Strahl in den Raum zeigt
landmarks = [[[3.5, 2], 0.5],
[[3.5, -2], 0.5],
... | 34.298246 | 81 | 0.582609 |
1c57645f747360a362986e8952f21254c4a8a9b8 | 10,712 | py | Python | accounts/views.py | j-windsor/cs3240-f15-team21-v2 | ec95c6629b84e7e0f52d34990ec8bec863d90a7b | [
"MIT"
] | null | null | null | accounts/views.py | j-windsor/cs3240-f15-team21-v2 | ec95c6629b84e7e0f52d34990ec8bec863d90a7b | [
"MIT"
] | null | null | null | accounts/views.py | j-windsor/cs3240-f15-team21-v2 | ec95c6629b84e7e0f52d34990ec8bec863d90a7b | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from .forms import UserForm
from django.contrib.auth.decorators import login_required, user_passes_test
from django.contrib import messages
from django.core.urlresol... | 41.680934 | 239 | 0.64087 |
40dc01fd59f2d2579dadc16e3e298f5004216f00 | 28,039 | py | Python | ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
"""
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"); yo... | 39.659123 | 194 | 0.698991 |
ae9274a98a2f4cd693b061c7b7f931e63e8408db | 587 | py | Python | lesson1/quiz_softmax2.py | andreyf/udacity-deep-learning | 22992ab2fca7fdde41583667b254a25ba2775614 | [
"Apache-2.0"
] | null | null | null | lesson1/quiz_softmax2.py | andreyf/udacity-deep-learning | 22992ab2fca7fdde41583667b254a25ba2775614 | [
"Apache-2.0"
] | null | null | null | lesson1/quiz_softmax2.py | andreyf/udacity-deep-learning | 22992ab2fca7fdde41583667b254a25ba2775614 | [
"Apache-2.0"
] | null | null | null | """Softmax."""
import numpy as np
import matplotlib.pyplot as plt
scores = [3.0, 1.0, 0.2]
# scores = np.array([[1, 2, 3, 6],
# [2, 4, 5, 6],
# [3, 8, 7, 6]])
def softmax(x):
"""Compute softmax values for each sets of scores in x."""
return np.exp(x) / np.sum(np.exp(x), ... | 20.241379 | 63 | 0.575809 |
f24657f1fbc1396d283bc1323763f0d09d24b61d | 4,498 | py | Python | examples/python/gui/multiple-windows.py | xkaraman/Open3D | a1d65eca537a2b099fc3b6d08edb26e45b717e40 | [
"MIT"
] | 8 | 2021-03-17T14:24:12.000Z | 2022-03-30T15:35:27.000Z | examples/python/gui/multiple-windows.py | moonwonlee/Open3D | dda9b3a0129fa6c60f913672a70ff02483dcd0f3 | [
"MIT"
] | 1 | 2021-11-04T09:22:25.000Z | 2022-02-14T01:32:31.000Z | examples/python/gui/multiple-windows.py | moonwonlee/Open3D | dda9b3a0129fa6c60f913672a70ff02483dcd0f3 | [
"MIT"
] | 2 | 2021-08-24T18:06:55.000Z | 2021-12-17T10:48:34.000Z | #!/usr/bin/env python
import numpy as np
import open3d as o3d
import os
import threading
import time
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CLOUD_NAME = "points"
def main():
MultiWinApp().run()
class MultiWinApp:
def __init__(self):
self.is_done = False
self.n_snapshots ... | 37.798319 | 81 | 0.578702 |
57f7b6bdb2a7b9a4d778ecf14aa7aed691382427 | 3,772 | py | Python | indy_client/test/cli/test_merge_invitation.py | sergeykupryushin/indy-node | 3162c5750e99af3512218d5843ba065c7d0f07db | [
"Apache-2.0"
] | 1 | 2018-07-05T19:34:29.000Z | 2018-07-05T19:34:29.000Z | indy_client/test/cli/test_merge_invitation.py | sergeykupryushin/indy-node | 3162c5750e99af3512218d5843ba065c7d0f07db | [
"Apache-2.0"
] | null | null | null | indy_client/test/cli/test_merge_invitation.py | sergeykupryushin/indy-node | 3162c5750e99af3512218d5843ba065c7d0f07db | [
"Apache-2.0"
] | 1 | 2021-06-06T15:48:30.000Z | 2021-06-06T15:48:30.000Z | from indy_client.client.wallet.connection import Connection
from indy_client.client.wallet.wallet import Wallet
from indy_client.agent.walleted_agent import WalletedAgent
from plenum.common.constants import NAME, VERSION, ATTRIBUTES, VERIFIABLE_ATTRIBUTES, NONCE
def test_merge_invitation():
nonce = "12345"
wa... | 55.470588 | 100 | 0.537116 |
0b0db35f91d70e470ed4c0c46165d0e1269a031b | 180 | py | Python | Python/URI PROBLEMAS/AluraEstruturaDadosex2.py | guimaraesalves/material-python | d56b6b24ae35a67d394b43cb1ef4420805c7bd9b | [
"MIT"
] | null | null | null | Python/URI PROBLEMAS/AluraEstruturaDadosex2.py | guimaraesalves/material-python | d56b6b24ae35a67d394b43cb1ef4420805c7bd9b | [
"MIT"
] | null | null | null | Python/URI PROBLEMAS/AluraEstruturaDadosex2.py | guimaraesalves/material-python | d56b6b24ae35a67d394b43cb1ef4420805c7bd9b | [
"MIT"
] | null | null | null | num = str(input('Digite o seu nome: ')).strip()
snum = str(input('Digite o sobrenome: ')).strip()
idade = int(input('Digite a sua idade:'))
lista = [num, snum, idade]
print(lista) | 30 | 49 | 0.655556 |
eb6451d78651ddc7b06f8703e43ef1d6f3b742ca | 9,831 | py | Python | sumo/tools/sumolib/xml.py | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | null | null | null | sumo/tools/sumolib/xml.py | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | null | null | null | sumo/tools/sumolib/xml.py | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | 2 | 2017-12-14T16:41:59.000Z | 2020-10-16T17:51:27.000Z | # -*- coding: utf-8 -*-
"""
@file xml.py
@author Michael Behrisch
@author Jakob Erdmann
@date 2011-06-23
@version $Id$
Python interface to SUMO especially for parsing output files.
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2011-2017 DLR (http://www.dlr.de/) and contributors
Th... | 40.9625 | 113 | 0.637677 |
ad1e1802d39a99850247d902564688a943cd1fae | 3,492 | py | Python | python/ctranslate2/specs/transformer_spec.py | yywing/CTranslate2 | 0459171ee16ca6896633340218d4577845afab64 | [
"MIT"
] | null | null | null | python/ctranslate2/specs/transformer_spec.py | yywing/CTranslate2 | 0459171ee16ca6896633340218d4577845afab64 | [
"MIT"
] | null | null | null | python/ctranslate2/specs/transformer_spec.py | yywing/CTranslate2 | 0459171ee16ca6896633340218d4577845afab64 | [
"MIT"
] | null | null | null | """Declares specification of the Transformer model."""
import numpy as np
from ctranslate2.specs import attention_spec
from ctranslate2.specs import common_spec
from ctranslate2.specs import model_spec
class TransformerSpec(model_spec.SequenceToSequenceModelSpec):
"""Describes a Transformer model.
The spec... | 34.574257 | 88 | 0.703322 |
3c2c7658f91cf9bf07f830a8df8d39705ff704d2 | 229 | py | Python | deui/html/attribute/srcdoc_attr.py | urushiyama/DeUI | 14530d2dae7d96a3dee30759f85e02239fb433c5 | [
"MIT"
] | 1 | 2021-10-17T01:54:18.000Z | 2021-10-17T01:54:18.000Z | deui/html/attribute/srcdoc_attr.py | urushiyama/DeUI | 14530d2dae7d96a3dee30759f85e02239fb433c5 | [
"MIT"
] | null | null | null | deui/html/attribute/srcdoc_attr.py | urushiyama/DeUI | 14530d2dae7d96a3dee30759f85e02239fb433c5 | [
"MIT"
] | null | null | null | from .attribute_builder import AttributeBuilder
class SourceDocument(AttributeBuilder):
"""
Represents 'srcdoc' attribute.
"""
def __init__(self):
super().__init__()
self.attributes = ["srcdoc"]
| 20.818182 | 47 | 0.659389 |
a05cef43f1fc11b01e3fbf71814010acf933658b | 14,569 | py | Python | pennylane/circuit_drawer/circuit_drawer.py | hsim13372/pennylane | 1fae4c3412d60e1a792836551d7071f0ffd0fae0 | [
"Apache-2.0"
] | null | null | null | pennylane/circuit_drawer/circuit_drawer.py | hsim13372/pennylane | 1fae4c3412d60e1a792836551d7071f0ffd0fae0 | [
"Apache-2.0"
] | 1 | 2020-04-30T15:48:44.000Z | 2020-04-30T15:48:44.000Z | pennylane/circuit_drawer/circuit_drawer.py | hsim13372/pennylane | 1fae4c3412d60e1a792836551d7071f0ffd0fae0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 Xanadu Quantum Technologies 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... | 38.850667 | 155 | 0.626879 |
81404282f7d16514699e89d6f6691a64316a03d1 | 36,632 | py | Python | fhirclient/r4models/valueset_tests.py | cspears-mitre/CapStatement | 2390566ed75d420e0615e3a0aacb77e8c030fdcc | [
"Apache-2.0"
] | 1 | 2021-12-24T11:14:38.000Z | 2021-12-24T11:14:38.000Z | fhirclient/r4models/valueset_tests.py | cspears-mitre/CapStatement | 2390566ed75d420e0615e3a0aacb77e8c030fdcc | [
"Apache-2.0"
] | null | null | null | fhirclient/r4models/valueset_tests.py | cspears-mitre/CapStatement | 2390566ed75d420e0615e3a0aacb77e8c030fdcc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.6.0-bd605d07 on 2018-12-20.
# 2018, SMART Health IT.
import os
import io
import unittest
import json
from . import valueset
from .fhirdate import FHIRDate
class ValueSetTests(unittest.TestCase):
def instantiate_from(self, filename):
... | 70.854932 | 219 | 0.700016 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.