hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70f30524d2ea3db3d0c2d21c37371abadb27d9cb | 28,873 | py | Python | src/onegov/user/auth/provider.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/auth/provider.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/user/auth/provider.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import time
from abc import ABCMeta, abstractmethod
from uuid import uuid4
import morepath
from attr import attrs, attrib, validators
from sedate import utcnow
from onegov.core.crypto import random_token
from onegov.core.utils import rchop
from onegov.user import _, log, UserCollection, Auth
from onegov.user.auth.cl... | 31.486369 | 79 | 0.620095 |
cb40f9a03add4a417f87f9be2df640a1c8bbe42e | 222 | py | Python | src/onegov/agency/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/collections/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.agency.collections.agencies import ExtendedAgencyCollection
from onegov.agency.collections.people import ExtendedPersonCollection
__all__ = (
'ExtendedAgencyCollection',
'ExtendedPersonCollection',
)
| 24.666667 | 71 | 0.824324 |
cb8340226beab38c10cf40c617f89d974fe7b2a2 | 12,781 | py | Python | tests/onegov/election_day/collections/test_subscriber_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/collections/test_subscriber_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/collections/test_subscriber_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.collections import EmailSubscriberCollection
from onegov.election_day.collections import SmsSubscriberCollection
from onegov.election_day.collections import SubscriberCollection
from tests.onegov.election_day.common import DummyRequest
from unittest.mock import Mock
def test_subscriber_collec... | 39.816199 | 78 | 0.690087 |
cbe6b9e5216a39b0924958af4acaa4ab98fcfa92 | 421 | py | Python | SoftUni-Projects/cookbook/recipe/models.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | SoftUni-Projects/cookbook/recipe/models.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | SoftUni-Projects/cookbook/recipe/models.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | from django.db import models
class Recipe(models.Model):
title = models.CharField(max_length=90)
def __str__(self):
return self.title
class Ingredient(models.Model):
recipe = models.ForeignKey(Recipe, related_name='ingredients', on_delete=models.CASCADE)
title = models.CharField(max_length=... | 22.157895 | 92 | 0.714964 |
2a2a59a7db5beac5ba472fe7cf4d1943a2fc3ab0 | 1,627 | py | Python | ___Python/Michael/p01_kennenlernern/m01_kennenlernen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p01_kennenlernern/m01_kennenlernen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Michael/p01_kennenlernern/m01_kennenlernen.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import statistics
from datetime import date
from p01_kennenlernern import meinebibliothek
torsten = ["Torsten", "Aachen", date(1967, 1, 1), ["C"]]
michael = ["Michael", "Moormerland", date(1981, 1, 10), ["Javascript"]]
karpoo = ["Karpoo", "Düsseldorf", date(1969, 1, 1), ["ABAP"]]
carsten = ["Carsten", "Aachen... | 28.051724 | 100 | 0.654579 |
aa7222a182875b82a67da294608f2e1828aed9c3 | 2,391 | py | Python | tests/test_01_setup.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 1 | 2020-03-12T09:49:53.000Z | 2020-03-12T09:49:53.000Z | tests/test_01_setup.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 1 | 2020-03-25T00:47:12.000Z | 2020-03-30T23:32:00.000Z | tests/test_01_setup.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 5 | 2020-02-20T01:04:24.000Z | 2020-05-05T14:36:30.000Z | ###############################################################
# pytest -v --capture=no tests/test_01_setup.py
###############################################################
# TODO: start this with cloud init, e.g, empty mongodb
# TODO: assertuons need to be added
import pytest
import json
import os
from time impor... | 26.865169 | 76 | 0.593476 |
aa8e25ed05acbe759559c791e0d64833324c4ec5 | 4,956 | py | Python | main.py | Miguel-331/Proyecto-SUN | 104afd03e05616a297fbda976d377f49a1f905ec | [
"Unlicense"
] | null | null | null | main.py | Miguel-331/Proyecto-SUN | 104afd03e05616a297fbda976d377f49a1f905ec | [
"Unlicense"
] | null | null | null | main.py | Miguel-331/Proyecto-SUN | 104afd03e05616a297fbda976d377f49a1f905ec | [
"Unlicense"
] | null | null | null | #Importamos sqlite3 para poder trabajar con bases de Datos de manera mas efectiva.
import sqlite3
import FuncionesSQL as funciones
import Graficador as graficar
import FuncionesGraficas as graficos
import os
database = sqlite3.connect("SUN.db")
lector = database.cursor()
# Con estas funciones se crean tablas en la ba... | 30.975 | 202 | 0.608757 |
2abf45ef4e2d2d1c0249382a7bd5bbddaf96db70 | 1,700 | py | Python | research/nlp/dscnn/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/dscnn/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/dscnn/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 37.777778 | 100 | 0.681765 |
2afad6bc4e89a45d476c398f2ed6ffda441bef9c | 1,837 | py | Python | python/oneflow/compatible/single_client/autograd/autograd.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/autograd/autograd.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/autograd/autograd.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 32.803571 | 74 | 0.743059 |
93110b33cbdd467d652f7690483845ecf3ddd242 | 2,943 | py | Python | my_music_app/my_music_app/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | my_music_app/my_music_app/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | my_music_app/my_music_app/web/views.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from my_music_app.web.forms import CreateProfileForm, CreateAlbumForm, EditAlbumForm, DeleteAlbumForm, DeleteProfileForm
from my_music_app.web.helpers import get_profile
from my_music_app.web.models import Album
def show_home(request):
profile = get_profile()
if... | 22.992188 | 120 | 0.607204 |
93358d74dd4da75c980ed5176a9f2ca50d0e9407 | 249 | py | Python | Online-Judges/LeetCode/1672.Richest_Customer_Wealth.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/LeetCode/1672.Richest_Customer_Wealth.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/LeetCode/1672.Richest_Customer_Wealth.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | class Solution:
def maximumWealth(self, accounts: List[List[int]]) -> int:
mx = 0
for ith in accounts:
i_mx = 0
for jth in ith:
i_mx += jth
mx = max(i_mx, mx)
return mx
| 24.9 | 62 | 0.465863 |
4f09ca97004776d06f6f94f844b1a4f5c826a280 | 7,072 | py | Python | Mob-Droid-master/mob-droid.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Mob-Droid-master/mob-droid.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Mob-Droid-master/mob-droid.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python
#-*- coding: utf-8 -*-
#Author Mohit Saran
#YouTube Hacker's King
#Instagram Kinghacker0
#Website hackersking.in
import os, platform
from SimpleHTTPServer import test
from sys import exit
from time import sleep
red= '\033[91m'
orange= '\33[38;5;208m'
green= '\033[92m'
c... | 39.954802 | 295 | 0.555288 |
35bb9c2c3d081abc278a967b5a49e153262c24a9 | 1,288 | py | Python | tools/tar.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | tools/tar.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | tools/tar.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding : utf8 -*-
import os
import tarfile
def dir_to_tar(src_path, dst_path, dst_name=None):
"""
将目录打包为tar.gz文件
:param src_path: 被打包目录
:param dst_path: tar文件存放目录
:param dst_name: tar文件名
:return: tar.gz生成路径
"""
if not os.path.exists(src_path):
return "... | 24.769231 | 61 | 0.613354 |
ea689cbcef99356c98457fe6d098353227521def | 8,763 | py | Python | tests/integration/providers/ldap/delta_outbound_sync_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/integration/providers/ldap/delta_outbound_sync_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/integration/providers/ldap/delta_outbound_sync_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | 36.819328 | 106 | 0.620107 |
ea89ef5fdce36db93cfae6371b33aac9dd38ceab | 827 | py | Python | Packs/ExifRead/Scripts/ExifRead/ExifRead.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExifRead/Scripts/ExifRead/ExifRead.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExifRead/Scripts/ExifRead/ExifRead.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
import exifread
from CommonServerPython import * # noqa: F401
def get_exif_tags(file_entry_id):
res = demisto.getFilePath(file_entry_id)
f = open(res['path'], 'rb')
tags = exifread.process_file(f)
arr = []
for tag in tags.keys():
arr.append({'t... | 24.323529 | 62 | 0.628779 |
57a461ed40c84d1e345c45a868857e45d40ac166 | 6,487 | py | Python | modules/andes-core/common/genutil.py | akalankapagoda/andes | 37f3d9a527bf22de5b8ab5d0138bc4d7d104c346 | [
"Apache-2.0"
] | null | null | null | modules/andes-core/common/genutil.py | akalankapagoda/andes | 37f3d9a527bf22de5b8ab5d0138bc4d7d104c346 | [
"Apache-2.0"
] | null | null | null | modules/andes-core/common/genutil.py | akalankapagoda/andes | 37f3d9a527bf22de5b8ab5d0138bc4d7d104c346 | [
"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... | 25.241245 | 103 | 0.606752 |
17d08489385754531af5b8184a19526edc30b260 | 257 | py | Python | savageml/utility/__init__.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | savageml/utility/__init__.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | savageml/utility/__init__.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | from .loss_functions import LossFunctions, LossFunctionDerivatives
from .activation_functions import ActivationFunctions, ActivationFunctionsDerivatives
from .generic_functions import get_sample_from_iterator, batch_iterator, batch_np_array, binary_search
| 51.4 | 102 | 0.898833 |
8776dbc9b35558c1b2c3fb02bffeb4c30b8bae3e | 1,459 | py | Python | scripts/fuzzing/test/cipd_mock.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/fuzzing/test/cipd_mock.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/fuzzing/test/cipd_mock.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import subprocess
import test_env
from lib.cipd import Cipd
from lib.corpus import Corpus
from lib.fuzzer import Fuzzer
from device... | 31.717391 | 75 | 0.60658 |
0defe54067e981676c34b052ee4e29b5639bdfe9 | 3,397 | py | Python | src/handlers/displayhandler.py | kevinxin90/bte_schema_web | 6ed8d2673e82ff5122e1ccbef290d3ea6c82ad66 | [
"Apache-2.0"
] | 2 | 2018-12-11T21:47:42.000Z | 2019-02-17T23:39:50.000Z | src/handlers/displayhandler.py | kevinxin90/bte_schema_web | 6ed8d2673e82ff5122e1ccbef290d3ea6c82ad66 | [
"Apache-2.0"
] | 49 | 2017-05-25T22:34:18.000Z | 2019-03-22T04:36:54.000Z | src/handlers/displayhandler.py | kevinxin90/bte_schema_web | 6ed8d2673e82ff5122e1ccbef290d3ea6c82ad66 | [
"Apache-2.0"
] | 3 | 2017-04-17T18:31:57.000Z | 2019-11-18T22:31:33.000Z | import tornado.web
import tornado.template
from networkx.readwrite import json_graph
import json
from biothings_explorer.registry import Registry
from biothings_explorer.connect import ConnectTwoConcepts
reg = Registry()
colors = {1: 'green', 2: 'red', 3: 'rgba(255,168,7)'}
class DisplayHandler(tornado.web.Request... | 39.5 | 81 | 0.549603 |
803da3b7112c9706cc15de1e43f1341b9ba129fc | 261 | py | Python | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/prime.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 3 | 2021-04-25T20:07:31.000Z | 2021-08-31T00:57:44.000Z | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/prime.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 28 | 2021-04-06T06:17:02.000Z | 2021-05-07T10:03:43.000Z | 7-assets/_SNIPPETS/bryan-guner-gists/pypractice/prime.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # if a number is prime or not
def prime_num():
value = int(input('please type a number: '))
for num in range(2,value):
if value % num == 0:
return f'{value} is not a prime number'
return f'{value} is a prime number'
print(prime_num()) | 23.727273 | 48 | 0.62069 |
d5007a87cae5cea092afd357d8475e732392dc96 | 1,549 | py | Python | src/onegov/ballot/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot.collections import BallotCollection
from onegov.ballot.collections import CandidateCollection
from onegov.ballot.collections import ElectionCollection
from onegov.ballot.collections import ElectionCompoundCollection
from onegov.ballot.collections import ListCollection
from onegov.ballot.collections i... | 32.270833 | 64 | 0.795997 |
d5186d554e70f8eb28dcce5f52410009ca0b587e | 821 | py | Python | python_gui_tkinter/KALU/GARBAGE1/side_side.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE1/side_side.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE1/side_side.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import tkinter as tk
from tkinter import *
# create the main sections of the layout,
# and lay them out
root = Tk()
top = Frame(root)
bottom = Frame(root)
top.pack(side=TOP)
bottom.pack(side=BOTTOM, fill=BOTH, expand=True)
# create the widgets for the top part of the GUI,
# and lay them out
b = Button(root, text="Ent... | 29.321429 | 67 | 0.733252 |
d52b18429c9710ddea1146257aad1abd6c4d709e | 7,167 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #! /usr/bin/env python
#
# BitBake Toaster Implementation
#
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2013-2016 Intel Corporation
#
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from tests.browser.selenium_help... | 35.835 | 77 | 0.656202 |
63ca0db8efe4ff53708638f1b53c4805ad620c38 | 56 | py | Python | app/auth/__init__.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/auth/__init__.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/auth/__init__.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from . import main
from . import views | 14 | 19 | 0.732143 |
f6822ccf072b2414f1f06e902fac3ff6eb020dde | 3,627 | py | Python | balanceamento.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | balanceamento.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | balanceamento.py | andrevictor17/aulasRenzoEd | 931d73f5d20e7a3c837f175131bf3a271c7f375f | [
"MIT"
] | null | null | null | import unittest
class PilhaVaziaErro(Exception):
pass
class Pilha():
def __init__(self):
self.pilha = []
def topo(self):
try:
return self.pilha[-1]
except:
raise PilhaVaziaErro()
def vazia(self):
if len(self.pilha) == 0:
return Tru... | 30.737288 | 121 | 0.625862 |
63e975766fc0877fbeba0d972c72343d1ec5fd97 | 2,577 | py | Python | lab2/tspparse.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | 1 | 2018-04-18T19:55:42.000Z | 2018-04-18T19:55:42.000Z | lab2/tspparse.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | null | null | null | lab2/tspparse.py | B0mM3L6000/CI | 3b55ef8e6017a596e7b22e20a16ca7659bc73204 | [
"MIT"
] | null | null | null | from collections import deque
from city import GeoCoord, GeoCity, Euc_2D
def minimal_tsp():
return { "COMMENT" : ""
, "DIMENSION" : None
, "TYPE" : None
, "EDGE_WEIGHT_TYPE" : None
, "CITIES" : []}
def scan_keywords(tsp,tspfi... | 33.038462 | 79 | 0.596818 |
12079dc3c93d12adb1ce698be0ea676fa134ec39 | 1,337 | py | Python | top/clearlight/base/liaoxuefeng/function/DefineFunction.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/function/DefineFunction.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/function/DefineFunction.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import math
def my_abs(x):
if x >= 0:
return x
else:
return -x
print(my_abs(-12))
# 空函数
def nop():
# pass: 作为占位符, 先让代码可以运行起来
pass
# isinstance(): 数据类型检查
def m_abs(x):
if not isinstance(x, (int, float)):
raise TypeError('bad operand type')
if x >= 0:
return... | 16.924051 | 59 | 0.503366 |
12668a045cd173304f1e152cfbf92430793afdbd | 1,744 | py | Python | MiniProjects/Projects/Twitter Bot/twitter_bot.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Projects/Twitter Bot/twitter_bot.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | MiniProjects/Projects/Twitter Bot/twitter_bot.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | # Username = BitBot97561591
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class TwitterBot() :
username , password = '' , ''
bot = webdriver.Firefox()
def __init__ (self , username , password) :
self.username = username
self.password = pa... | 39.636364 | 82 | 0.586583 |
c387f8ad9a153736693eed355270a1f19f996e68 | 1,056 | py | Python | day35/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day35/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day35/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | import requests
from twilio.rest import Client
#Twilo Account information
account_sid = "ACe835130e6debbb55xxxxxxxxxx"
auth_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# OpenWeatherMap
OWM_Endpoint = "https://api.openweathermap.org/data/2.5/onecall"
params = {
"lat": 53.11,
"lon": 8.46,
"exclude": "curre... | 27.789474 | 66 | 0.695076 |
2ed19eae77fc41200036c9d8158dea886a9b2f42 | 669 | py | Python | Beginner/03. Python/Computer Graphics Algos/Bresenham.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 3 | 2021-03-16T16:44:04.000Z | 2021-06-07T17:32:51.000Z | Beginner/03. Python/Computer Graphics Algos/Bresenham.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/Computer Graphics Algos/Bresenham.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 2 | 2020-10-12T15:58:02.000Z | 2020-10-20T05:31:11.000Z | #Bresenham Algo
#from graphics import *
win = GraphWin("CG Algorithms", 600, 600)
#text
label = Text(Point(290, 24), 'Bresenham Line Algo')
label.setSize(24)
label.draw(win)
#Input points
print("Enter x1, y1, x2, y2 - ")
x0 = int(input())
y0 = int(input())
x1 = int(input())
y1 = int(input())
dx = abs(x1 - x0)
dy = ... | 14.234043 | 51 | 0.521674 |
6ce91d7b0fec63adfaba0927ba74284a27f98ee7 | 5,143 | py | Python | top/clearlight/reptile/bilibili/bj_tech_mooc/wmz_spider_4_thread.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/reptile/bilibili/bj_tech_mooc/wmz_spider_4_thread.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/reptile/bilibili/bj_tech_mooc/wmz_spider_4_thread.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import json
import re
import traceback
from threading import Thread
from queue import Queue
from lxml import etree
import requests
from bs4 import BeautifulSoup
def get_html_text(url):
try:
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gec... | 31.944099 | 144 | 0.487264 |
1a4ebf9c3855019d20cd9482a2f17a4a83695ed3 | 192 | py | Python | sandbox/target/locationselector.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | sandbox/target/locationselector.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | 1 | 2022-03-22T23:50:32.000Z | 2022-03-22T23:50:32.000Z | sandbox/target/locationselector.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | import abc
from sandbox.location.location import Location
class LocationSelector:
@abc.abstractmethod
def check(self, location: Location) -> bool:
raise NotImplementedError
| 19.2 | 48 | 0.75 |
1aca41a22203d327a2117dc57658e393817c60e5 | 1,896 | py | Python | test/test_npu/test_network_ops/test_to.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_to.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_to.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 33.857143 | 78 | 0.672468 |
6488c8a86c4a585a078d2ebbff57e51ea80c0501 | 2,522 | py | Python | cogs/commands.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | 1 | 2021-04-21T09:01:26.000Z | 2021-04-21T09:01:26.000Z | cogs/commands.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | cogs/commands.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
from botlibrary import constants
class Commands(commands.Cog):
def __init__(self, client):
self.client = client
def ist_gepinnt(self, message):
return not message.pinned
@commands.command(name="ping")
async def ping_command(self, ctx):
... | 39.40625 | 185 | 0.657018 |
64ca5b242e27bca4fc8d75b8e8d971f442ccf470 | 449 | py | Python | torch/ao/sparsity/_mappings.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | torch/ao/sparsity/_mappings.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | torch/ao/sparsity/_mappings.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | import torch
import torch.ao.nn
def get_static_sparse_quantized_mapping():
_static_sparse_quantized_mapping = dict({
torch.nn.Linear: torch.ao.nn.sparse.quantized.Linear,
})
return _static_sparse_quantized_mapping
def get_dynamic_sparse_quantized_mapping():
_dynamic_sparse_quantized_mapping = ... | 29.933333 | 69 | 0.770601 |
b3bfb1b23f7ddd23f7e9563b7e8313776987f064 | 2,157 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/center_crop_metric.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 883 | 2020-11-12T11:46:46.000Z | 2022-03-31T18:27:10.000Z | paddlevideo/metrics/center_crop_metric.py | arkofgalaxy/PaddleVideo | 64251233c83b7eb681061b454da198a9082309a6 | [
"Apache-2.0"
] | 233 | 2020-12-09T06:04:59.000Z | 2022-03-28T08:16:51.000Z | paddlevideo/metrics/center_crop_metric.py | arkofgalaxy/PaddleVideo | 64251233c83b7eb681061b454da198a9082309a6 | [
"Apache-2.0"
] | 225 | 2020-11-13T06:21:55.000Z | 2022-03-31T05:36:11.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 36.559322 | 75 | 0.656467 |
37c67c1928486e135cbc97bbb4fd9c5191494a03 | 2,431 | py | Python | app/static/imgs/Print.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/static/imgs/Print.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/static/imgs/Print.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | import os
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import date
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
from reportlab.lib.styles import getSampleStyleS... | 32.413333 | 145 | 0.689017 |
037eb810bdf11e5dee46000d8a394005dab4269e | 2,089 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/intro/intro.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/intro/intro.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/intro/intro.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def extract_digits(number):
remaining_value = number
while remaining_value > 0:
digit = remaining_value % 10
remaining_value = remaining_value // 10
print(digit, end=' ')
print()
def extract_di... | 20.480392 | 66 | 0.62853 |
4573f644fa9d949176b527002b3ebc028f655925 | 594 | py | Python | bazzell/config/bazzell.py | libracore/bazzell | f4cf4ec5b9f264f68d853e7b946fd49bd0d5e4d9 | [
"MIT"
] | null | null | null | bazzell/config/bazzell.py | libracore/bazzell | f4cf4ec5b9f264f68d853e7b946fd49bd0d5e4d9 | [
"MIT"
] | null | null | null | bazzell/config/bazzell.py | libracore/bazzell | f4cf4ec5b9f264f68d853e7b946fd49bd0d5e4d9 | [
"MIT"
] | 1 | 2021-08-14T22:25:24.000Z | 2021-08-14T22:25:24.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017-2020, libracore and contributors
# License: AGPL v3. See LICENCE
from __future__ import unicode_literals
from frappe import _
def get_data():
return[
{
"label": _("Settings"),
"icon": "octicon octicon-tools",
"items": [
... | 27 | 59 | 0.446128 |
2fa48bfd118c3abf6e0bf6fbd7900facd620532c | 613 | py | Python | PMIa/2014/danilov_d_a/task_3_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_3_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2014/danilov_d_a/task_3_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 3. Вариант 6.
#Напишите программу, которая выводит имя "Сэмюэл Ленгхорн Клеменс", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
#Данилов Д.А.
#20.05.2016
print("Герой программы на этот раз - Сэмюэл Ленгхорн Кле... | 40.866667 | 209 | 0.732463 |
2faa8e2382dcbfd59543788eed05fbf65d49d02e | 8,525 | py | Python | CS303/project/work/Board.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | CS303/project/work/Board.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | CS303/project/work/Board.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from collections import deque
import numpy as np
class Board(object):
"""
board for the game
"""
def __init__(self, **kwargs):
self.width = int(kwargs.get('width', 11))
self.height = int(kwargs.get('height', 11))
self.states = {}
# board states stored as a dict,
... | 40.402844 | 116 | 0.547801 |
2fc3fffc737d92b39f9bef5bb465a737a68390af | 559 | py | Python | Curso-Em-Video-Python/2Exercicios/043-IMC.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/043-IMC.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/043-IMC.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | print('Indice de massa corporal')
print('-' * 20)
peso = float(input('Digite seu peso: '))
altura = float(input('Digite sua altura: '))
imc = peso/(altura ** 2)
if imc < 18.5:
print('Seu imc é {:.2f}. ABAIXO DO PESO!!'.format(imc))
elif imc >=18.5 and imc <= 25:
print('Seu imc é {:.2f}. PESO IDEAL!!'.format(imc... | 37.266667 | 62 | 0.60644 |
44658f7195284107a1a41f4e7cd8f3a6918a1977 | 36,365 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
import frappe.defaults
from frappe.utils import cint, flt
from frappe import _, msgprint, throw
from erpnext.accounts.party impor... | 36.547739 | 153 | 0.738897 |
a6f80ed0b9bf0c5b08dd8b5980cd4d8655e3b1f2 | 444 | py | Python | WD/Cwiczenia/dzielenie.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | 1 | 2020-02-29T14:38:33.000Z | 2020-02-29T14:38:33.000Z | WD/Cwiczenia/dzielenie.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | WD/Cwiczenia/dzielenie.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | import sys
try:
print("Dzięlę liczby przez siebie")
print("Proszę podać pierwszą liczbę: ")
licz1=sys.stdin.readline()
print("Proszę podać drugą liczbę: ")
licz2=sys.stdin.readline()
licz1=float(licz1)
licz2=float(licz2)
wynik=licz1/licz2
print(str(wynik))
except ZeroDivis... | 27.75 | 44 | 0.671171 |
1b7eb58d600ed7e113ed2571a89d6358377cb055 | 1,198 | py | Python | utilities/driver_factory.py | WETESTERR/Mehwish-Peter | 1b6beb5352683243dfd5667e0749d07ce119254f | [
"MIT"
] | null | null | null | utilities/driver_factory.py | WETESTERR/Mehwish-Peter | 1b6beb5352683243dfd5667e0749d07ce119254f | [
"MIT"
] | 1 | 2020-06-23T07:25:39.000Z | 2020-06-23T07:25:39.000Z | utilities/driver_factory.py | WETESTERR/Mehwish-Peter | 1b6beb5352683243dfd5667e0749d07ce119254f | [
"MIT"
] | null | null | null | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.microsoft import IEDriverManager
from webdriver_manager.opera import OperaDriverManager
from webdriver_manager.microsoft import EdgeChromiumDriverManage... | 39.933333 | 86 | 0.710351 |
1bba91806425aa1eb796349edfc2333b95d24117 | 267 | py | Python | custom_user/serializers.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/serializers.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/serializers.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from custom_user.models import CustomUser
class CustomUserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = CustomUser
fields = ('url', 'username', 'first_name', 'last_name', 'email')
| 29.666667 | 72 | 0.745318 |
1bd3cd33a95a0f6d0c93a052b632a13e8b8d147d | 3,230 | py | Python | research/cv/SRGAN/src/loss/gan_loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/SRGAN/src/loss/gan_loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/SRGAN/src/loss/gan_loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 36.704545 | 83 | 0.64613 |
94037e150e98c9b44b662fbb065a73ef7584e666 | 358 | py | Python | Theories/Algorithms/Recursion1/SwapNodesInPairs/swap_pairs.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Theories/Algorithms/Recursion1/SwapNodesInPairs/swap_pairs.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Theories/Algorithms/Recursion1/SwapNodesInPairs/swap_pairs.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
def swapPairs(head: Optional[ListNode]) -> Optional[ListNode]:
if not head:
return
if head.next:
head.val, head.next.val = head.next.val, head.val
swap... | 22.375 | 62 | 0.631285 |
b6dc396a941fcb9e433534fbd1e0c2e568e71f9a | 302 | py | Python | forge/lib/logs.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | forge/lib/logs.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | forge/lib/logs.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
import logging
import logging.config
def getLogger(config, name, suffix=''):
logFile = config.get('Logging', 'logfile')
logging.config.fileConfig('logging.cfg', defaults=dict(
logfile=logFile % dict(timestamp=suffix)
))
return logging.getLogger(name)
| 23.230769 | 59 | 0.675497 |
8e1abc5626b05f941137acea63ba987b536c86f8 | 296 | py | Python | ZDT1.py | jmorenov/BBOMO | 572965579928b532b6ae70e4dd468fcc734019da | [
"MIT"
] | null | null | null | ZDT1.py | jmorenov/BBOMO | 572965579928b532b6ae70e4dd468fcc734019da | [
"MIT"
] | null | null | null | ZDT1.py | jmorenov/BBOMO | 572965579928b532b6ae70e4dd468fcc734019da | [
"MIT"
] | null | null | null | import math
def F1(x):
return x[0]
def F2(x):
def g(x2m):
sum = 0
for i in x2m:
sum = sum + (i / (len(x2m) - 1))
return 1 + 9 * sum
def h(f1, g):
return 1 - math.sqrt(f1 / g)
x2m = x[1:len(x)]
return g(x2m) * h(F1(x), g(x2m)) | 14.8 | 44 | 0.429054 |
8e2c8960a3bebedfb72251234ffa9810c956eb51 | 450 | py | Python | Produkte/migrations/0008_auto_20170921_1717.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Produkte/migrations/0008_auto_20170921_1717.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Produkte/migrations/0008_auto_20170921_1717.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-09-21 17:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Produkte', '0007_kauf_kommentar'),
]
operations = [
migrations.AlterField(
... | 21.428571 | 50 | 0.615556 |
bfd87677309d79b49780eb274cb41277d77547d6 | 206 | py | Python | webapp/wine_dash/database/transforms.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/wine_dash/database/transforms.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/wine_dash/database/transforms.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sqlite3
import pandas as pd
conn = sqlite3.connect('database/wine_data.sqlite')
df = pd.read_sql('SELECT * FROM wine_data', conn)
conn.close()
if __name__ == '__main__':
[print(i) for i in df] | 20.6 | 51 | 0.708738 |
78073c215885104cb97e39a5b249bb7cf0ce1bcc | 5,857 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/edgeswitch/edgeswitch.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/edgeswitch/edgeswitch.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/edgeswitch/edgeswitch.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 34.656805 | 112 | 0.705993 |
156b9f015a76b76c114d5b70f5079dd1ce4fd452 | 3,563 | py | Python | DatabaseSetup/toQuery.py | qiaw99/DBS_Project | c22e1395dfa528b01bd65ac8266b10ac93b0f36b | [
"Apache-2.0"
] | null | null | null | DatabaseSetup/toQuery.py | qiaw99/DBS_Project | c22e1395dfa528b01bd65ac8266b10ac93b0f36b | [
"Apache-2.0"
] | null | null | null | DatabaseSetup/toQuery.py | qiaw99/DBS_Project | c22e1395dfa528b01bd65ac8266b10ac93b0f36b | [
"Apache-2.0"
] | null | null | null | import json
import urllib.request
#data = 0
#with urllib.request.urlopen('https://opendata.ecdc.europa.eu/covid19/casedistribution/json') as url:
# data = json.loads(url.read().decode())
# with open('euData.json', 'w') as out:
# json.dump(data, out)
data = json.load(open('EU_Dataset.json'))['records']
l... | 61.431034 | 1,346 | 0.642717 |
15a0ce0d52a294d415055e715b38be6cfb812b9c | 338 | py | Python | asteroid/masknn/blocks.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 3 | 2020-09-30T02:32:08.000Z | 2021-02-05T04:48:01.000Z | asteroid/masknn/blocks.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-09-17T08:55:12.000Z | 2020-09-17T08:55:12.000Z | asteroid/masknn/blocks.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2021-02-05T04:48:05.000Z | 2021-02-05T04:48:05.000Z | import warnings
from ..utils.deprecation_utils import VisibleDeprecationWarning
warnings.warn(
"`blocks` has been splited between `convolutional` and "
"`recurrent` since asteroid v0.2.0 and will be removed "
"in v0.3.0",
VisibleDeprecationWarning,
)
from .convolutional import * # NOQA
from .recurrent... | 28.166667 | 63 | 0.736686 |
15aa4cc6b446da80f7a2e8022438cf81b6944b05 | 4,535 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/misc.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/misc.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/agilepy/lib_base/misc.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 32.163121 | 113 | 0.63925 |
1739b7395f195712a78789a97de524597c4ddd85 | 27,966 | py | Python | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
from CommonServerPython import *
ORGANIZATION = "XSOAR"
BASE_URL = F'https://dev.azure.com/{ORGANIZATION}'
CLIENT_ID = "XXXX"
def load_mock_response(file_name: str) -> str:
"""
Load mock file that simulates an API response.
Args:
file_name (str): Name of the mock response JSON file... | 36.509138 | 120 | 0.657298 |
bd828928b1ea46c45d6222b8ddd8ee1d67e006ed | 1,070 | py | Python | tag_1/p_4_7_euro_stueckelung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_4_7_euro_stueckelung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | tag_1/p_4_7_euro_stueckelung.py | techrabbit58/uebung_informatik_vorkurs | e99312ae66ccccd6bfe45bfd3c3f43c01690659c | [
"Unlicense"
] | null | null | null | """
4 Listen (Tag 1)
4.6 Schreibe ein Programm, das als Eingabe einen Geldbetrag in EUR entgegen nimmt und daraus
die Art und Anzahl an Geldscheinen und/oder Münzen ermittelt, die erforderlich sind, um den
gegebenen Betrag in Bar zu begleichen.
"""
from hilfprogramme import float_number_input
s_werte = [20000, 10000, ... | 33.4375 | 92 | 0.639252 |
e53c42406acc571b6e5d2c3a1832c5d5384a2fd1 | 730 | py | Python | modules/ac_drgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | modules/ac_drgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | modules/ac_drgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from modules.drgn import DRGNNetwork
CriticDRGNNetwork = DRGNNetwork
class ActorDRGNNetwork(DRGNNetwork):
def __init__(self, in_dim, hidden_dim, action_dim, num_head=4, skip_connect=False):
super(ActorDRGNNetwork, self).__init__(in_dim, h... | 38.421053 | 102 | 0.732877 |
e5b15aff89404149f786c2544a2f7712decbc3ea | 2,755 | py | Python | scripts/open_cv/ball-tracking/ball_tracking_edited.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/open_cv/ball-tracking/ball_tracking_edited.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/open_cv/ball-tracking/ball_tracking_edited.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | # ball_tracking_edited.py
# ------------------------------------------
# original from
# https://github.com/jonathanfoster/ball-tracking
# edited by OJ for robotik.bocholt@w-hs.de
# 8.11.2019
# ------------------------------------------
# $ python ball_tracking_edited.py -i Prof_mit_Kugel.jpeg
import argparse
... | 31.666667 | 121 | 0.611615 |
f927c5fc1e47654bf1eacbb276d953a2e71baff6 | 3,104 | py | Python | AssetPreperation.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-03-28T11:50:45.000Z | 2020-12-08T13:36:26.000Z | AssetPreperation.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | 2 | 2020-04-20T11:12:59.000Z | 2020-05-11T05:37:36.000Z | AssetPreperation.py | FrieAT/MD_CompressedWavelet | 82bd10edd611485cd5f0b81da744e07a3b7c98eb | [
"MIT"
] | null | null | null |
from ImageData import PipelineManager, ScanAssets, WaveletPic, FVExtraction
import pickle
import os.path
'''
This class is just for compatibility reasons still here.
It has been refactored to use the new style pipelining, as a PipelineManager.
It is just a wrapper for all jupyter notebook's, which have used AssetPre... | 37.853659 | 132 | 0.741624 |
00679f5d8704fbe396bd5d6b472ed38628e52aa3 | 2,177 | py | Python | oneflow/python/test/onnx/nodes/test_reduction.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/onnx/nodes/test_reduction.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/onnx/nodes/test_reduction.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 29.026667 | 78 | 0.783647 |
8218b05aa7b081ead63293912d22b2719741d7d6 | 21,311 | py | Python | Packs/EclecticIQ/Integrations/EclecticIQ/EclecticIQ.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/EclecticIQ/Integrations/EclecticIQ/EclecticIQ.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/EclecticIQ/Integrations/EclecticIQ/EclecticIQ.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | ''' IMPORTS '''
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import json
import requests
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS/PARAMS '''
USERNAME = demisto.params().get('credentials').get('identifier')
PASSWORD = d... | 26.941846 | 117 | 0.614284 |
8236bbaeac591e18ff781fb3d5609bda10b52f98 | 1,235 | py | Python | ProjectEuler_plus/euler_066.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_066.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_066.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from math import sqrt
def is_square(n):
s = sqrt(n)
return s.is_integer()
def continued_frac_list(S):
ret = []
if is_square(S):
return None
m, d, a = 0, 1, sqrt(S)
duration = 0
ret.append(int(a))
while duration == 0 or d != 1:
m = int(d... | 22.454545 | 67 | 0.476113 |
823bf19b5a5fed9816c2edb21a28da03067b6501 | 229 | py | Python | Contests/Mock CCC '19 Contest 1 J2 - Pusheen OCR.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/Mock CCC '19 Contest 1 J2 - Pusheen OCR.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/Mock CCC '19 Contest 1 J2 - Pusheen OCR.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | a = input()
e = 0
if (a[0] != "p"):
e += 1
if (a[1] != "u"):
e += 1
if (a[2] != "s"):
e += 1
if (a[3] != "h"):
e += 1
if (a[4] != "e"):
e += 1
if (a[5] != "e"):
e += 1
if (a[6] != "n"):
e += 1
print(e) | 13.470588 | 17 | 0.275109 |
41bdb5b44a3195fefe7f392ca021954456b6eab4 | 859 | py | Python | UFV---Python/Trabalho Mat. Disc/teste.py | Vith-MCB/UFV | 9d96fecdc9ffde2563f9f397bcdb39d95aaf7e69 | [
"MIT"
] | 1 | 2022-01-25T16:52:26.000Z | 2022-01-25T16:52:26.000Z | UFV---Python/Trabalho Mat. Disc/teste.py | Vith-MCB/UFV | 9d96fecdc9ffde2563f9f397bcdb39d95aaf7e69 | [
"MIT"
] | null | null | null | UFV---Python/Trabalho Mat. Disc/teste.py | Vith-MCB/UFV | 9d96fecdc9ffde2563f9f397bcdb39d95aaf7e69 | [
"MIT"
] | null | null | null | n = int(input())
c1 = int(input())
lista = input().split()
g = [[0 for i in range(n)] for j in range(n)]
cont = 0
for i in range(n):
for j in range(n):
g[i][j] = int(lista[cont])
cont += 1
contaminados = []
listaMemoria = [[] for i in range(2)]
vendo = c1
contaminados.append(c1)
listaMemoria[1].app... | 24.542857 | 56 | 0.537835 |
ec0f46f39f767bc719a17a923f95997d78eabbda | 474 | py | Python | update.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | 1 | 2021-04-21T09:01:26.000Z | 2021-04-21T09:01:26.000Z | update.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | update.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | import subprocess
import time
VERSION = subprocess.check_output(["git", "describe", "--tags", "--always"]).decode('ascii').strip()
print("Checke auf Updates...")
def updaten():
command = subprocess.check_output("git pull ", shell=True)
if str("Already up to date.") in str(command):
print(f"Der Bot i... | 23.7 | 100 | 0.662447 |
6b7791a10137134c0cddec25814216e770ac0b01 | 663 | py | Python | More-DL/Transfer_Learning.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | More-DL/Transfer_Learning.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | More-DL/Transfer_Learning.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | # ...
# Define the CNN
def model_vgg(optimizer, learning_rate, activation_str):
# Input
input_img = Input(shape=x_train.shape[1:])
# VGG base
conv_base = VGG19(weights='imagenet', include_top=False)(input_img)
# Dense Part
x = GlobalAveragePooling2D()(conv_base)
x = Activation(acti... | 27.625 | 82 | 0.6727 |
6bdb00d0f33ddba14ef82037fbf1ea5d01ed559a | 20,313 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/httpapi/test_ftd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/httpapi/test_ftd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/httpapi/test_ftd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# This file is part of Ansible
#
# Ansible 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... | 49.065217 | 134 | 0.693448 |
d485a1d94a244a6c311f20dd0d28b4d9cefeab93 | 321 | py | Python | Crashkurs TensorFlow/01_Tensor und Flow.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | 2 | 2020-03-23T14:57:50.000Z | 2021-03-24T18:12:07.000Z | Crashkurs TensorFlow/01_Tensor und Flow.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs TensorFlow/01_Tensor und Flow.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | # Unterdrückt die AVX2 Warnung
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
number1 = tf.constant(13.)
sum = tf.add(number1, 37.)
print(sum)
sum_py = sum.numpy() # toString/ToString in Java/C#
print(sum_py)
s1 = 'hello'
res = tf.strings.join([s1, 'world'])
print(res)
print(res.numpy())... | 16.05 | 51 | 0.70405 |
2e02228a8e8b6026283652bd520a3c979585f42a | 176 | py | Python | synchroload/plugins/u6656.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 3 | 2020-07-08T08:58:46.000Z | 2020-12-01T20:23:30.000Z | synchroload/plugins/u6656.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 1 | 2020-12-30T12:49:43.000Z | 2021-01-04T11:05:48.000Z | synchroload/plugins/u6656.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 2 | 2018-06-21T17:45:11.000Z | 2020-12-30T00:30:45.000Z | HOSTER_NAME = "u6656"
HOSTER_HAS_DIRECT_LINKS = True
HOSTER_KEEP_UNAVAILABLE_UPLOADS = True
def linkFromId(id):
return "https://unknown6656.com/harrypotter/videos/" + id
| 22 | 61 | 0.778409 |
2e785cb7d4b4ba1d28cc0b731103e636cdfe3fa0 | 8,329 | py | Python | deprecated/examples/simnet_bow/model.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/examples/simnet_bow/model.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/examples/simnet_bow/model.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | #!/usr/bin/python
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 45.513661 | 111 | 0.498019 |
d879e36cc3cb689171182c8e9e3bb8a279c421f0 | 1,823 | py | Python | python/fastcampus/chapter04_01.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter04_01.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter04_01.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """
파이썬 함수 특징
1. 런타임 초기화
2. 변수 등에 할당 가능
3. 함수 인수 전달 가능
4. 함수 결과로 반환 가능
"""
# function vs class
def factorial(n: int) -> int:
"""Factorial"""
if n <= 1:
return 1
return n * factorial(n - 1)
class A:
pass
print(factorial(5))
print(factorial.__doc__)
print(factorial.__code__)
print(sorted(set(... | 17.872549 | 79 | 0.662095 |
d8f1d473e3888cc415629db36104822545c59074 | 561 | py | Python | OxoCard/I2CScan.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-03-22T18:38:43.000Z | 2021-03-22T18:38:43.000Z | OxoCard/I2CScan.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | null | null | null | OxoCard/I2CScan.py | ckuehnel/MicroPython | c57d0df744fe5301e755bd139b6cc56d69c442fd | [
"MIT"
] | 1 | 2021-02-06T10:07:36.000Z | 2021-02-06T10:07:36.000Z | '''
File: I2CScan.py
needs: machine, oxocard
Scans I2C bus of OxoCard and prints connected devices
2021-03-27 Claus Kühnel info@ckuehnel.ch
'''
from oxocard import *
from machine import Pin, I2C
i2c = I2C(scl = Pin(22), sda = Pin(21))
def printResult():
if len(devices) == 0:
print("No I2C device found!")
el... | 23.375 | 84 | 0.661319 |
2b11e8a0c55762fcc0b7e772df9660c7194a62b1 | 127 | py | Python | AFluentPython/tools/utils.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | AFluentPython/tools/utils.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null | AFluentPython/tools/utils.py | RoboCuper-hujinlei/AI-Job | cf7a081d59700d75f0f2dc73b6d5130863796f01 | [
"Apache-2.0"
] | null | null | null |
from datetime import datetime
def current_time():
dt = datetime(2015, 4, 19, 12, 20) # 用指定日期时间创建datetime
print(dt)
| 14.111111 | 58 | 0.677165 |
8fbb920ab12d39ffb0109b5a95fa37d6e08aed08 | 447 | py | Python | nz_crawl_demo/day2/requests/auth.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/requests/auth.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/requests/auth.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | import requests
auth = ('test','123456')
headers = {
'User-Agent':"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0"
}
res = requests.get("https://api.github.com/user",headers=headers,verify=False,auth=auth)
print(res.text)
#encoding: utf-8
import requests
resp = requests.get('http://www.... | 29.8 | 91 | 0.697987 |
f169f0161693367ec8929bfb9afdc13d1a0b7fd3 | 2,174 | py | Python | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/assets/doctype/asset_maintenance_log/asset_maintenance_log.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.utils import nowdate, getdate
from erpnext.ass... | 46.255319 | 138 | 0.798068 |
bb53e4f810d9990c68c0707e4641879f68bd849f | 8,424 | py | Python | scheduleSynchronizer/web_scraper1111/search.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/web_scraper1111/search.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | scheduleSynchronizer/web_scraper1111/search.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from scheduleSynchronizer.web_scraper1111.scraper import *
import requests
import re
import string
import datetime
import time
import random
import os
import multiprocessing as mul
from time import sleep
from bs4 import BeautifulSoup
from dateutil.parser import parse
class Session:
def __init_... | 29.25 | 535 | 0.623575 |
5c2986fd3fd2a98c34c92430db4f8240a34c2e15 | 7,467 | py | Python | monitor modules (to be imported)/# example of usage/parking lot manager.py | m-a-rahal/monitor-sync-python | 4ef5a777bd22c7aa9b3b47a98609b173bbb81830 | [
"MIT"
] | 1 | 2020-12-11T01:23:28.000Z | 2020-12-11T01:23:28.000Z | monitor modules (to be imported)/# example of usage/parking lot manager.py | m-a-rahal/monitor-sync-python | 4ef5a777bd22c7aa9b3b47a98609b173bbb81830 | [
"MIT"
] | 1 | 2020-12-11T14:45:03.000Z | 2020-12-13T13:00:06.000Z | monitor modules (to be imported)/# example of usage/parking lot manager.py | m-a-rahal/monitor-sync-python | 4ef5a777bd22c7aa9b3b47a98609b173bbb81830 | [
"MIT"
] | null | null | null | #==================================================================================================
#=== Parking lot example ==================================================================================================
#===============================================================================================... | 50.795918 | 170 | 0.436989 |
30dfb2c4fb0b267271a5d923e378fe2ee1c2475f | 1,597 | py | Python | utest/api.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | utest/api.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | utest/api.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
import sys
import traceback
print("api.py")
sys.path.insert(0, "..")
print("import")
try:
print("import zenframe")
import zenframe
print("import traceback")
import traceback
print("import unittest")
import unittest
print("import PyQt5")
import... | 20.474359 | 67 | 0.69881 |
eb833c3f1cf99ff7848f794b786572261bc39e95 | 1,654 | py | Python | etl/data_enhancement/enhancement_duplicates/enhancement_exact_duplicates.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 7 | 2020-04-23T20:16:11.000Z | 2022-01-04T14:57:16.000Z | etl/data_enhancement/enhancement_duplicates/enhancement_exact_duplicates.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 361 | 2020-04-23T17:20:14.000Z | 2022-03-02T11:29:45.000Z | etl/data_enhancement/enhancement_duplicates/enhancement_exact_duplicates.py | Betadinho/einander-helfen | 272f11397d80ab5267f39a7b36734495f1c00b0c | [
"MIT"
] | 1 | 2021-11-29T06:02:52.000Z | 2021-11-29T06:02:52.000Z | from data_enhancement.enhancement_duplicates.json_post import JsonPost
from shared.logger_factory import LoggerFactory
from shared.stats_collector import StatsCollector
logger = LoggerFactory.get_enhancement_logger()
def remove_duplicates(data, domain):
"""Removes exact duplicates from the json list.
The URL... | 32.431373 | 72 | 0.668682 |
6920c846840959182a6a6b27bac4261fecc6d05f | 1,380 | py | Python | prolog.py | UweKrause/haw-lb-a3 | 8d236ccf8993ab50090038c13f4e5a4887f611a7 | [
"MIT"
] | null | null | null | prolog.py | UweKrause/haw-lb-a3 | 8d236ccf8993ab50090038c13f4e5a4887f611a7 | [
"MIT"
] | null | null | null | prolog.py | UweKrause/haw-lb-a3 | 8d236ccf8993ab50090038c13f4e5a4887f611a7 | [
"MIT"
] | null | null | null | from pyswip import Prolog
prolog = Prolog()
prolog.consult("src/familie.pl")
prolog.consult("src/teil1.pl")
prolog.consult("src/test.pl")
# Tests, executed by prolog
for result in prolog.query("test(allfamilie)"):
print(result)
# Example from prolog code
"""
test(nachkomme) :-
%positiv
write('nachkomme ... | 23.793103 | 52 | 0.692029 |
692b58d38e0d804729f1794ee348e07b5743839e | 561 | py | Python | 30 Days of Code/30DoC-day-26/30DoC_day_26.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | 30 Days of Code/30DoC-day-26/30DoC_day_26.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | 30 Days of Code/30DoC-day-26/30DoC_day_26.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | actual = str(input()).split(" ")
actualDay = int(actual[0])
actualMonth = int(actual[1])
actualYear = int(actual[2])
expected = str(input()).split(" ")
expectedDay = int(expected[0])
expectedMonth = int(expected[1])
expectedYear = int(expected[2])
fine = 0
if actualYear > expectedYear:
fine = 10000
elif actualYe... | 25.5 | 70 | 0.675579 |
d664652ec74f2329ab4984a6e3b5bc57b3895109 | 3,338 | py | Python | src/001_download.py | nakamura196/wax | b452d9ee7d480afc5e9bd7273014a5d06daf3427 | [
"MIT"
] | null | null | null | src/001_download.py | nakamura196/wax | b452d9ee7d480afc5e9bd7273014a5d06daf3427 | [
"MIT"
] | null | null | null | src/001_download.py | nakamura196/wax | b452d9ee7d480afc5e9bd7273014a5d06daf3427 | [
"MIT"
] | null | null | null | import json
import argparse
import yaml
import requests
import datetime
import os
import requests
import shutil
def download_img(url, file_name):
r = requests.get(url, stream=True)
if r.status_code == 200:
with open(file_name, 'wb') as f:
r.raw.decode_content = True
shutil.copy... | 23.673759 | 99 | 0.576693 |
d677759510a0c94448ff71920241bd2cd91e1e04 | 433 | py | Python | 0_homeworks/Python/Console/3/dictionary.py | Team-on/works | 16978b61c0d6bcb37e910efb4b5b80e9a2460230 | [
"MIT"
] | 10 | 2018-11-12T19:43:28.000Z | 2020-09-09T18:48:30.000Z | 0_homeworks/Python/Console/3/dictionary.py | Team-on/works | 16978b61c0d6bcb37e910efb4b5b80e9a2460230 | [
"MIT"
] | null | null | null | 0_homeworks/Python/Console/3/dictionary.py | Team-on/works | 16978b61c0d6bcb37e910efb4b5b80e9a2460230 | [
"MIT"
] | null | null | null | '''
# Dictionary test.
sqr = {0:0, 1:1, 2:4}
print(sqr.keys()[2])
for x in sqr.keys():
print(x)
'''
'''
a,b,c = 1,2,3
a,b=b,a
print(a)
print(b)
print(c)
'''
#Simple phonebook
phonebook = {}
for _ in range(input("Number: ")):
n = raw_input("Abonent name: ")
t = input("Abonent number: ")
phonebook[n]... | 13.967742 | 35 | 0.575058 |
baf74ecf0d2fae350bd407ec1164b97b373cb837 | 2,669 | py | Python | tests/onegov/election_day/layouts/test_default_layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/layouts/test_default_layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/layouts/test_default_layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Vote
from onegov.election_day.layouts import DefaultLayout
from tests.onegov.election_day.common import DummyRequest
def test_default_layout():
layout_de = DefaultLayout(None, DummyRequest(locale='de'))
layout_en = DefaultLayout(None, DummyRequest(locale='en'))
layout_fr = Defaul... | 34.217949 | 75 | 0.694642 |
cef8cf9f9ae347088e0399e2c6b3b0e6f7c3fdc5 | 870 | py | Python | tests/onegov/quill/test_integration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/quill/test_integration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/quill/test_integration.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
from onegov.core import Framework
from onegov.core import filters # noqa -> registers webasset filters
from onegov.core.utils import scan_morepath_modules
from onegov.quill import QuillApp
from webtest import TestApp as Client
def test_integration(temporary_directory, redis_url):
class App(Fram... | 23.513514 | 69 | 0.698851 |
307c21ab5b03089eb9da99cb3c17e63b7faf158d | 394 | py | Python | nz_django/day3/db_relation_demo/cms/migrations/0006_auto_20200220_1530.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day3/db_relation_demo/cms/migrations/0006_auto_20200220_1530.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day3/db_relation_demo/cms/migrations/0006_auto_20200220_1530.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # Generated by Django 2.0 on 2020-02-20 07:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cms', '0005_tag'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='articles',
field=models... | 20.736842 | 80 | 0.588832 |
0661b3de26f008d055177bb023750fac56fcc1ee | 1,188 | py | Python | Computerorietierte_Mathematik/U6/U6.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | Computerorietierte_Mathematik/U6/U6.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | Computerorietierte_Mathematik/U6/U6.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | __author__ = "Qianli und Nazar"
__copyright__ = "Copyright (c) 2019 qiaw99"
# https://github.com/qiaw99/WS2019-20/blob/master/LICENSE
import math
import sys
import os
class Logger(object):
def __init__(self, filename = "daten.txt"):
self.terminal = sys.stdout
self.log = open(filename, "a")
def write(self, mes... | 22.415094 | 73 | 0.596801 |
236a6047074a494d464e53925a89cd2953699086 | 2,423 | py | Python | research/cv/SiamFC/src/create_lmdb.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/SiamFC/src/create_lmdb.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/SiamFC/src/create_lmdb.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.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... | 35.115942 | 80 | 0.660751 |
aeda7eeb8e5415435c5d8f6723fad340ec53799d | 196 | py | Python | code/1/wang.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/1/wang.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/1/wang.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | import utest
__name__ = "Peng Wang"
def is_equal(x, y):
return x == y
@utest.ok
def _okwho():
"""test case is from wang.py"""
assert is_equal("Peng Wang", __name__), "test failed in wang.py"
| 17.818182 | 65 | 0.673469 |
ae4f4d20076cc1ab96b123ae7997cdd7de419574 | 3,118 | py | Python | chillow/service/data_loader.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | chillow/service/data_loader.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | chillow/service/data_loader.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import json
import iso8601
from datetime import datetime, timedelta
from abc import ABCMeta, abstractmethod
from chillow.model.direction import Direction
from chillow.model.game import Game
from chillow.model.player import Player
from chillow.model.cell import Cell
class DataLoader(metaclass=ABCMeta):
"""Class ... | 33.891304 | 113 | 0.563823 |
115025018348560901802733d48353402695128d | 106 | py | Python | Exercicios/ex07.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex07.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | Exercicios/ex07.py | BoltzBit/LP | f84d36d1bdee9a20c197cebec2810234c5311fb8 | [
"MIT"
] | null | null | null | print(bool(0))
print(bool('0'))
print(int(float('5.67')))
_nome = 'teste'
false = '6'
print(str(True)))
| 11.777778 | 25 | 0.603774 |
6e5a11f66bbbe7a720537b7edacad28f960f9f78 | 8,227 | py | Python | src/onegov/org/initial_content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/initial_content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/initial_content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import codecs
import os
import yaml
from datetime import datetime, timedelta
from onegov.core.cache import lru_cache
from onegov.core.utils import module_path
from onegov.event import EventCollection
from onegov.file import FileSetCollection, FileCollection
from onegov.form import FormCollection
from onegov.org import... | 29.593525 | 79 | 0.594384 |
6e225bb20fc76d1cc6cfb9ecddbbc0259fec761e | 362 | py | Python | 121-best-time-to-buy-and-sell-stock/121-best-time-to-buy-and-sell-stock.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def maxProfit(self, prices: List[int]) -> int:
buy_dp, sell_dp, output = prices[0],prices[0], {0}
for val in prices:
if val < buy_dp:
buy_dp=val
sell_dp=val
elif val > sell_dp:
sell_dp=val
output.add(... | 32.909091 | 58 | 0.508287 |
281f10e3c6cac75b9d4344bff34d4e0c980a0e9e | 3,582 | py | Python | test/test_npu/test_network_ops/test_pixel_shuffle.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_pixel_shuffle.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_pixel_shuffle.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 37.705263 | 77 | 0.639028 |
2852b8f07d053657ed9ce66e55d5ab8d29c4eeb0 | 1,482 | py | Python | Packs/ModulesManagement/Scripts/GetInstances/GetInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ModulesManagement/Scripts/GetInstances/GetInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ModulesManagement/Scripts/GetInstances/GetInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Dict, Iterator
import demistomock as demisto
from CommonServerPython import *
INTERNAL_MODULES_BRANDS = ['Scripts', 'Builtin', 'testmodule']
def filter_config(module: Dict, filter_brand: Optional[List[str]] = None, instance_status: str = 'active'):
brand = module.get('brand')
if brand in ... | 28.5 | 107 | 0.660594 |
dd31594bb2dd57c39313883831f55da0e5c79d60 | 16,601 | py | Python | src/test/tests/operators/explode.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/explode.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/operators/explode.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: explode.py
#
# Tests: mesh - 3D rectilinear, single domain,
# multi domain
# 3D unstructured, single domain
# 3D cur... | 28.622414 | 78 | 0.670562 |
af0171f837e2ad468d95d81bfcfcb213f1b5c292 | 25,489 | py | Python | test/test_npu/test_network_ops/test_max.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_max.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_max.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 44.639229 | 118 | 0.590529 |
af4b747e08e26a56b9c717b8ed199674ed5f60b8 | 480 | py | Python | python/coursera_python/SEC/sc.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/SEC/sc.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/SEC/sc.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # to decrypt a msg
msg = input("Enter the encrypted message :")
en_msg = msg.upper()
#print(en_msg)
key = 1
for i in range(27):
str1 = ""
#key = 1
for letter in en_msg:
l = ord(letter) + key
if l > 90:
l = l - 90 + 64
str1 = str1 + chr(l)
key = key + 1
print(str1)
key = 1
'''for i in range(27):
str1 =... | 12.972973 | 44 | 0.5375 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.