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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0fc917207e27b82f9f95bd908b31449427f8a5d4 | 17,042 | py | Python | marsyas-vamp/marsyas/scripts/Python/scheduler_libs.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/scheduler_libs.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/Python/scheduler_libs.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 1998-2007 George Tzanetakis <gtzan@cs.uvic.ca>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
... | 34.152305 | 110 | 0.51508 |
d798f6b9cf9af2b70c67f441f4759c5a3eef9eb4 | 1,026 | py | Python | priklad.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | priklad.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | priklad.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | from random import randint, choice
def priklad(a,b):
num0, num1 = randint(a,b), randint(a,b)
operation = choice(['//','+','*','-'])
return f"{num0 if num0 >= num1 else num1} {operation} {num1 if num1 < num0 else num0}", ((num0 if num0 >= num1 else num1) + (num1 if num1 <= num0 else num0)) if operation == "... | 54 | 476 | 0.610136 |
ad3efe94360d629d0ea213e7d7c36f81ca3548e0 | 6,924 | py | Python | intelligence/anthill/src/managers/Prod_Prod_Manager.py | FoxComm/highlander | 1aaf8f9e5353b94c34d574c2a92206a1c363b5be | [
"MIT"
] | 10 | 2018-04-12T22:29:52.000Z | 2021-10-18T17:07:45.000Z | intelligence/anthill/src/managers/Prod_Prod_Manager.py | FoxComm/highlander | 1aaf8f9e5353b94c34d574c2a92206a1c363b5be | [
"MIT"
] | null | null | null | intelligence/anthill/src/managers/Prod_Prod_Manager.py | FoxComm/highlander | 1aaf8f9e5353b94c34d574c2a92206a1c363b5be | [
"MIT"
] | 1 | 2018-07-06T18:42:05.000Z | 2018-07-06T18:42:05.000Z | from recommenders.Prod_Prod import Prod_Prod
from util.InvalidUsage import InvalidUsage
from util.response_utils import (
products_list_from_response,
zip_responses,
format_es_response
)
from util.neo4j_utils import (
add_purchase_event,
get_all_channels,
get_purchased_products,
get_declined... | 37.225806 | 93 | 0.644858 |
0e951142d175163d89ded69a3954c3c63779ef45 | 741 | py | Python | backend/python/django/rest/blog/serializer.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | 1 | 2021-02-08T17:07:54.000Z | 2021-02-08T17:07:54.000Z | backend/python/django/rest/blog/serializer.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | null | null | null | backend/python/django/rest/blog/serializer.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | 1 | 2021-02-08T17:08:01.000Z | 2021-02-08T17:08:01.000Z | from rest_framework import serializers
import sys, os
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/../../../dao/src"))
from Post import Post
class PostSerializer(serializers.BaseSerializer):
def to_representation(self, instance):
return {
'id': instance.id,
'title':... | 37.05 | 110 | 0.623482 |
38cd592ea722aa8b0b3fc4da1492b3f76124dd2b | 694 | py | Python | flipui/gui/settingsdialog.py | julianschick/flipdot-brose-code | b2caf2c52c55a0d5b80dbf3d5adbbf5aec1d79c2 | [
"MIT"
] | null | null | null | flipui/gui/settingsdialog.py | julianschick/flipdot-brose-code | b2caf2c52c55a0d5b80dbf3d5adbbf5aec1d79c2 | [
"MIT"
] | null | null | null | flipui/gui/settingsdialog.py | julianschick/flipdot-brose-code | b2caf2c52c55a0d5b80dbf3d5adbbf5aec1d79c2 | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QDialog
from PySide2.QtCore import QSettings
from gui.settingsdialog_ui import Ui_SettingsDialog
class SettingsDialog(QDialog):
def __init__(self):
super().__init__()
self._ui = Ui_SettingsDialog()
self._ui.setupUi(self)
self.accepted.connect(self.__a... | 31.545455 | 72 | 0.690202 |
2db8daa5700affbf3da62664cc96e7a80f615bd9 | 626 | py | Python | python/python_backup/PRAC_PYTHON/dd.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/dd.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/dd.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | class society:
def__init__(self):
self.society_name="surya apartment"
self.house_number="20"
self.income=25000
self flat="a type"
def inputdata(self,name,no,nom,):
self.society_name=nm
self.house_no=no
self.no_of_members=nom
self.income=ic
self.allocate_flat()
def allocate_flat(self):
... | 21.586207 | 47 | 0.678914 |
facdb786714b75ab38116a12bd3cd78d1f359f27 | 1,133 | py | Python | project/api/dump/schemas.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/dump/schemas.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/dump/schemas.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from marshmallow import fields
from project.api import marshmallow
from project.api.event.schemas import EventDumpSchema
from project.api.event_category.schemas import EventCategoryDumpSchema
from project.api.event_reference.schemas import EventReferenceDumpSchema
from project.api.image.schemas import ImageDumpSchema
... | 49.26087 | 75 | 0.835834 |
faf84d3ace88f8d66f04d6fb40d3f4c0d98fe72a | 1,126 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/khmer/tests/khmer_tst_utils.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/khmer/tests/khmer_tst_utils.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/khmer/tests/khmer_tst_utils.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import tempfile
import os
import shutil
from pkg_resources import Requirement, res... | 26.809524 | 76 | 0.685613 |
ea923edc9eb9bb6aa37571eba6b3ec52fc17a94c | 1,867 | py | Python | data/parquet-testing/lineitem-to-parquet.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | data/parquet-testing/lineitem-to-parquet.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | data/parquet-testing/lineitem-to-parquet.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import tempfile
import os
from pyspark.sql import SparkSession
from pyspark.sql.types import *
import glob
parquet_compression = 'snappy'
outdir = tempfile.mkdtemp()
parquet_folder = os.path.join(outdir, "out.parquet")
nthreads = 8
memory_gb = 10
spark = SparkSession.builder.master("local[%d]" % nthreads).config('sp... | 41.488889 | 310 | 0.684521 |
57934881090cbcc6954030700380de5e96fc26f1 | 1,707 | py | Python | resources/mechanics_lib/api/graphs/shapes.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/api/graphs/shapes.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/api/graphs/shapes.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z | from face import Face
from math import sin, cos, pi
class RegularNGon(Face):
def __init__(self, name, n, length, edgeNames=None, allEdges=None):
pts = []
lastpt = (0, 0)
dt = (2 * pi / n)
for i in range(n):
lastpt = (lastpt[0] + cos(i * dt), lastpt[1] + sin(i * dt))
pts.append(lastpt)
... | 34.836735 | 102 | 0.616872 |
aa3ecc781eff302254fd24495c7387348d079ecc | 2,539 | py | Python | main.py | Incompleteusern/Spork-Automation | b6d6b908443301c3c7c8c6983cceaeb316884dbe | [
"Apache-2.0"
] | 2 | 2020-11-24T16:07:47.000Z | 2020-11-24T16:07:50.000Z | main.py | Incompleteusern/Spork-Automation | b6d6b908443301c3c7c8c6983cceaeb316884dbe | [
"Apache-2.0"
] | null | null | null | main.py | Incompleteusern/Spork-Automation | b6d6b908443301c3c7c8c6983cceaeb316884dbe | [
"Apache-2.0"
] | 1 | 2020-11-20T20:14:44.000Z | 2020-11-20T20:14:44.000Z | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.common import exceptions
import json
def parse_json(json_file... | 43.033898 | 152 | 0.680977 |
a4ad6577353cb7d08273aba0f044aba46c9d5607 | 705 | py | Python | site_generation/pelicanconf.py | globalwatchpost/CloudRegionsList | f428b39fc797403cf6ed5d38196a5df29f59d8af | [
"MIT"
] | null | null | null | site_generation/pelicanconf.py | globalwatchpost/CloudRegionsList | f428b39fc797403cf6ed5d38196a5df29f59d8af | [
"MIT"
] | null | null | null | site_generation/pelicanconf.py | globalwatchpost/CloudRegionsList | f428b39fc797403cf6ed5d38196a5df29f59d8af | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'Global Watchpost LLC'
SITENAME = 'List Cloud Regions'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'UTC'
DEFAULT_LANG = 'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM... | 19.583333 | 77 | 0.751773 |
1066bbc68a180d11ac71ef3706f783f677b9a3f0 | 800 | py | Python | Lineare Regression/lineare_regression/drei_punkte_beispiel.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | Lineare Regression/lineare_regression/drei_punkte_beispiel.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | Lineare Regression/lineare_regression/drei_punkte_beispiel.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | points = [(1,1), (2,2), (2.5,1)]
print(points[2][0])
y=0
x=0
#point -> neue Variable für jeden Listeneintrag
for point in points:
print(point[1])
y = y+point[1]
x = x+point[0]
print(x,y)
avg_x = x / len(points)
avg_y = y / len(points)
print(avg_x,avg_y)
w_enumerator = 0
w_denominator = 0
for point... | 20 | 274 | 0.68125 |
f4d59d140e90d92aa8fcf71270fab5cc567e3bda | 176 | py | Python | python/python_backup/PRAC_PYTHON/ab12.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab12.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab12.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #sum of square root upto n
import math
n=input("Enter range:");
j=1
for i in range(1,n,1):
print "Number:",j,"SquareRoot",math.sqrt(j),
j=j+2
| 14.666667 | 51 | 0.545455 |
877792f6657423c040e4c6f5b8e1b958b9627700 | 449 | py | Python | LeetCode_problems/First_Unique_Character_in_a_String/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/First_Unique_Character_in_a_String/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/First_Unique_Character_in_a_String/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | from collections import Counter
class Solution:
def firstUniqChar(self, s: str) -> int:
ct=Counter(s)
for i in range(len(s)):
if ct[s[i]]==1:
return i
return -1
# Counter makes a frequency map of letters in string
# we iterate over the letters of the string and ch... | 34.538462 | 103 | 0.632517 |
8777fed7ecae5743a5d50ef386c96297ed0c37c1 | 1,073 | py | Python | distance.py | Kingpin007/SC-Lab | ba8fa9dfca4b950ebcb8c8d409f7e215c7971925 | [
"MIT"
] | null | null | null | distance.py | Kingpin007/SC-Lab | ba8fa9dfca4b950ebcb8c8d409f7e215c7971925 | [
"MIT"
] | null | null | null | distance.py | Kingpin007/SC-Lab | ba8fa9dfca4b950ebcb8c8d409f7e215c7971925 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 9 09:18:34 2018
@author: VP LAB
"""
import numpy
fuzzySet1 = list(tuple())
fuzzySet2 = list(tuple())
l1 = list()
l2 = list()
x = int(input("Enter the number of elements: "))
element = 1;
print("Enter elements for the set1: ")
for i in range(x):
a = float(input("Enter... | 26.170732 | 55 | 0.637465 |
21c6526d025492ba368ebcdd3366e667d2438a2f | 15,440 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/traci/_person.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/traci/_person.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/traci/_person.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.... | 39.287532 | 112 | 0.646049 |
df2c593ddd9ef3aebdacbb0478b893eabfe1dcaa | 2,611 | py | Python | backend/api/btb/api/schema/types/company.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 4 | 2020-04-30T16:11:24.000Z | 2020-06-02T10:08:07.000Z | backend/api/btb/api/schema/types/company.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 291 | 2020-04-20T13:11:13.000Z | 2022-02-10T21:54:46.000Z | backend/api/btb/api/schema/types/company.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 2 | 2020-04-19T14:56:01.000Z | 2020-04-19T18:09:34.000Z | from graphene import ID, String, ObjectType, List, Field, Float, Int, NonNull, Boolean
from btb.api.schema.resolvers import (
demands_by_company,
supplies_by_company,
company_by_id,
)
from .skills import Skill
from flask import g
from .industry import Industry
class CompanyContact(ObjectType):
id = ID(... | 27.197917 | 86 | 0.687476 |
df6479427b8d08154922a0b1dea90ac48e63fb48 | 331 | py | Python | exercises/en/test_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_02_05_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"from spacy.tokens import Doc" in __solution__
), "Are you importing the Doc class correctly?"
assert doc.text == "spaCy is cool!", "Are you sure you created the Doc correctly?"
assert "print(doc.text)" in __solution__, "Are you printing the Doc's text?"
__msg__.good("We... | 41.375 | 86 | 0.667674 |
10dc2b5ab9cd5868010c4d5edd939dd8d285be21 | 1,157 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex11_array_min_max_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex11_array_min_max_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex11_array_min_max_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch06_arrays.solutions.ex11_array_min_max_and_pos import find_min, find_max, find_min_pos, find_max_pos
def test_find_min_and_max():
values = [ 2, 3, 4, 5, 6, 7, 8, 9, 1, 10 ]
assert find_min(values) ==... | 30.447368 | 107 | 0.65255 |
10eebbaaaac06a8b84894140b3ab093624b4ca8b | 2,886 | py | Python | quark_core_api/data/storage/validation.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | quark_core_api/data/storage/validation.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | quark_core_api/data/storage/validation.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | from future.utils import viewitems
_schema = {
"$required" : ["id", "name", "dir"],
"$unique" : ["id", "name", "dir"],
"$fields": {
"id" : {
"$type" : int
},
"name" : {
"$type" : str
},
"dir" : {
"$type" : str
}
}
}
c... | 31.032258 | 120 | 0.581774 |
33c393d9f9c6c44d861c89e628fa2fd432646d1c | 1,171 | py | Python | easy/5/python/app.py | carlan/dailyprogrammer | f8448c6a35277c567d0f1ecab781d45b294c8d0f | [
"MIT"
] | 1 | 2019-02-26T16:34:06.000Z | 2019-02-26T16:34:06.000Z | easy/5/python/app.py | carlan/dailyprogrammer | f8448c6a35277c567d0f1ecab781d45b294c8d0f | [
"MIT"
] | null | null | null | easy/5/python/app.py | carlan/dailyprogrammer | f8448c6a35277c567d0f1ecab781d45b294c8d0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""app.py: challenge #4"""
__author__ = "Carlan Calazans"
__copyright__ = "Copyright 2016, Carlan Calazans"
__credits__ = ["Carlan Calazans"]
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = "Carlan Calazans"
__email__ = "carlancalazans at gmail dot com"
__status... | 26.022222 | 58 | 0.701964 |
d54e67750524efac03bb6fd2c25b5c9728d6d744 | 2,405 | py | Python | spo/utils/payrexx.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | null | null | null | spo/utils/payrexx.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/utils/payrexx.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import urllib.request
import requests
import hmac
import hashlib
import base64
import json
API_BASE = "https://api.payre... | 41.465517 | 119 | 0.701455 |
d555c1d98c79b5e5631ee28f4d125e73080c465a | 503 | py | Python | project/views/frontend.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/views/frontend.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/views/frontend.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from flask import Blueprint, request
from project import app
frontend = Blueprint(
"frontend", __name__, static_folder="../static/frontend", static_url_path="/"
)
@frontend.route("/")
def index(path=None): # pragma: no cover
return frontend.send_static_file("index.html")
@frontend.errorhandler(404)
def n... | 20.958333 | 81 | 0.713718 |
895a69cce0fa63c5d26f53bf65e1e851a1d94e0b | 27,891 | py | Python | Programm/nebenfunktionen.py | christopher-chandler/emoticon_emoji_recognizer | 4cc5ed3ab97fff320c75e7f3f5affb0d4be6d038 | [
"MIT"
] | null | null | null | Programm/nebenfunktionen.py | christopher-chandler/emoticon_emoji_recognizer | 4cc5ed3ab97fff320c75e7f3f5affb0d4be6d038 | [
"MIT"
] | null | null | null | Programm/nebenfunktionen.py | christopher-chandler/emoticon_emoji_recognizer | 4cc5ed3ab97fff320c75e7f3f5affb0d4be6d038 | [
"MIT"
] | null | null | null | '''
Hier sind zusaetzliche Funktionen gespeichert, die in das Hauptprogramm via Import importiert werden.
Die entsprechenden Beschreibung der Funktion sind bei der jeweiligen Funktionen.
'''
#########################
# Notwendige Pythonmodule
#########################
import re,os,shutil,tkinter
from datetime import ... | 47.113176 | 167 | 0.650353 |
98aba963ec6fdd466b1b18b9f660e46771e7d742 | 1,068 | py | Python | SurveyManager/survey/urls.py | javiervar/SurveyManager | bbe2ed356654c32586c587f58c609c8ce014e96b | [
"MIT"
] | null | null | null | SurveyManager/survey/urls.py | javiervar/SurveyManager | bbe2ed356654c32586c587f58c609c8ce014e96b | [
"MIT"
] | null | null | null | SurveyManager/survey/urls.py | javiervar/SurveyManager | bbe2ed356654c32586c587f58c609c8ce014e96b | [
"MIT"
] | null | null | null | from django.urls import path
from survey import views
from rest_framework import routers
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns=[
path('',views.index,name="index"),
path('constructor/',views.Constructor,name="constructor"),
path('egresados/',views.Egresados,name="egresados"),
pat... | 48.545455 | 84 | 0.764045 |
123bbab6612de06257016d7efa358b1547b9ba86 | 310 | py | Python | hidden_server_data.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | hidden_server_data.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | hidden_server_data.py | I4-Projektseminar-HHU-2016/seminar-project-marionline03 | ec2b2d2b588baa647c7a5e542e1d20a39cd0fc09 | [
"CC0-1.0"
] | null | null | null | # Name or IP of the machine running vocabulary pet server
HOST = 'localhost'
# Port Name of vocabulary pet server
PORT = '8080'
# Please fill into the brakets the root directory of vocabulary pet
# Example: STATIC_PATH = '/home/user/vocabulary_pet/static'
STATIC_PATH = '/<vocabulary_pet_directory>/static'
| 31 | 67 | 0.767742 |
89ed5857649315854f4f1a4da4d30b8de25ebaa3 | 7,776 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/output/generateMeanDataDefinitions.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/output/generateMeanDataDefinitions.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/output/generateMeanDataDefinitions.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 43.2 | 79 | 0.566615 |
14739674824a84726ddf0a80ac0466e61377c774 | 3,816 | py | Python | tools/legacy/veh-parser/readVeh.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 2 | 2020-03-18T18:23:27.000Z | 2020-08-02T15:59:16.000Z | tools/legacy/veh-parser/readVeh.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 5 | 2019-07-07T16:47:47.000Z | 2020-08-10T16:20:00.000Z | tools/legacy/veh-parser/readVeh.py | gifted-nguvu/darkstar-dts-converter | aa17a751a9f3361ca9bbb400ee4c9516908d1297 | [
"MIT"
] | 1 | 2022-02-16T14:59:12.000Z | 2022-02-16T14:59:12.000Z | import sys
import glob
import json
importFilenames = []
for importFilename in sys.argv[1:]:
files = glob.glob(importFilename)
importFilenames.extend(files)
def readDataFile(filename):
with open(filename, "r") as vehicleInfo:
return json.loads(vehicleInfo.read())
constants = readDataFile("vehFil... | 39.75 | 152 | 0.684748 |
1ad1c27a5e910ed8a34cb4341209c4d60c4682c3 | 651 | py | Python | Tutorials/10 Days of Statistics/Day 7/pearson_correlation1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Tutorials/10 Days of Statistics/Day 7/pearson_correlation1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Tutorials/10 Days of Statistics/Day 7/pearson_correlation1.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
from math import sqrt
def mean(arr, n):
return sum(arr)/n
def std(arr, mean, n):
s = 0
for i in range(n):
s += (arr[i]-mean)**2
return sqrt(s/n)
def pearson(arr1, arr2, n):
mu1 = mean(arr1, n)
mu2 = mean(arr2, n)
std1 = std(arr1, mu1, n)
std2 = std(arr2, mu2, n... | 19.727273 | 61 | 0.542243 |
214fbe3c866c71321edd80d1949933cb22634790 | 250 | py | Python | progressbar.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | progressbar.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | progressbar.py | ligang945/pyMisc | 3107c80f7f53ffc797b289ec73d1ef4db80f0b63 | [
"MIT"
] | null | null | null | from __future__ import division
import sys,time
j = '#'
if __name__ == '__main__':
for i in range(1,61):
j += '#'
sys.stdout.write(str(int((i/60)*100))+'% ||'+j+'->'+"\r")
sys.stdout.flush()
time.sleep(0.5)
print | 22.727273 | 66 | 0.532 |
b4e9cedcd2ad1fb55f6d4de8d7fcdc29fff40159 | 1,141 | py | Python | src/compgen2/testdata/manipulator.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | 1 | 2022-02-02T12:41:06.000Z | 2022-02-02T12:41:06.000Z | src/compgen2/testdata/manipulator.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | src/compgen2/testdata/manipulator.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | from typing import Callable
class Manipulator:
def __init__(self, m: Callable, type: str, chance: float) -> None:
self.m = m
self.type = self.set_type(type)
self.chance = self.set_chance(chance)
def set_type(self, type: str) -> str:
"""Read in a type and check on its correc... | 35.65625 | 96 | 0.576687 |
6ca41e7773404eb58e84e98c2f492425736ec014 | 13,759 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/visualization/helpers.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/visualization/helpers.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/visualization/helpers.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"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) 2013-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 40.587021 | 115 | 0.590232 |
9f07f56d60d263da7864b5cdddf5c4c4f37d96d9 | 1,482 | py | Python | python/en/_packages/scipy/scipy-scipy.signal.lfilter-example_01.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/scipy/scipy-scipy.signal.lfilter-example_01.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/scipy/scipy-scipy.signal.lfilter-example_01.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | """
scipy-scipy.signal.lfilter-example_01.py
This is an example code for scipy.signal.lfilter
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter.html
"""
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(-1,1,201)
x = ( np.sin( 2*np.pi*0.75*t*(... | 23.15625 | 84 | 0.667341 |
9f3abccb50ecbea2d6830f0cd555c4ebe804ed3c | 362 | py | Python | Algorithms/Implementation/sherlock_and_squares.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/sherlock_and_squares.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/sherlock_and_squares.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from math import sqrt
# I think +100 is too much though..
squares = [i ** 2 for i in range(1, int(sqrt(10 ** 9)) + 100)]
for _ in range(int(input().strip())):
cnt = 0
A, B = list(map(int, input().split()))
for s in squares:
if s >= A and s <= B:
cnt += 1
i... | 24.133333 | 62 | 0.51105 |
9819bac180513db9b09a39cbcfa679b0004af63a | 1,169 | py | Python | challenges/crossingSum/python3/crossingSum.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/crossingSum/python3/crossingSum.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/crossingSum/python3/crossingSum.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def crossingSum(matrix, a, b):
return sum(matrix[a]) + sum([x[b] for i, x in enumerate(matrix) if i != a])
if __name__ == '__main__':
input0 = [[[1,1,1,1], [2,2,2,2], [3,3,3,3]], [[1,1], [1,1]], [[1,1], [3,3], [1,1], [2,2]], [[100]], [[1,2], [3,4]], [[1,2,3,4]], [[1,2,3,4,5], [1,2,2,2,2], [1,2,2,2,2], [1,2,2,2,2], [... | 77.933333 | 222 | 0.59367 |
2cc1bb32e6f28ad30310ccc2fe1f5b5bf9b1460e | 2,704 | py | Python | easyp2p/ui/credentials_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/ui/credentials_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/ui/credentials_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""Module implementing CredentialsWindow."""
from typing import Optional
from PyQt5.QtCore import pyqtSlot, QCoreApplication
from PyQt5.QtWidgets import QDialog, QMessageBox
from easyp2p.ui.Ui_credentials_window import Ui_CredentialsWindow
_tran... | 32.97561 | 73 | 0.628328 |
394aca5543ae5400d7bce2655d11e4328aac1532 | 16,562 | py | Python | src/onegov/swissvotes/models/policy_area.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/models/policy_area.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/swissvotes/models/policy_area.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from decimal import Decimal
from onegov.swissvotes import _
class PolicyArea(object):
""" Helper class for handling of descriptors.
There are three levels of descriptors, each new level refining the
given category.
Policy areas are internally represented a... | 46.522472 | 79 | 0.47923 |
808a193ff68efa61f7aef67ad45ad7d43013f767 | 15,832 | py | Python | webserver/webserver.py | tarent/osm_service | 462f3d74d3ed16d307b65da6f24dcea5a982aacf | [
"Apache-2.0"
] | null | null | null | webserver/webserver.py | tarent/osm_service | 462f3d74d3ed16d307b65da6f24dcea5a982aacf | [
"Apache-2.0"
] | null | null | null | webserver/webserver.py | tarent/osm_service | 462f3d74d3ed16d307b65da6f24dcea5a982aacf | [
"Apache-2.0"
] | null | null | null | # Fix Cannot import name 'cached_property': https://stackoverflow.com/a/60157748/3593881
import werkzeug
werkzeug.cached_property = werkzeug.utils.cached_property
from flask import Flask
from flask.json import jsonify
from osm_service import OsmService
from flask_restplus import Api, Resource, reqparse
app = Flask(__n... | 54.405498 | 275 | 0.620958 |
aff5d1f9651ddccc73299c416733c510aa6ca2e6 | 3,610 | py | Python | Buchstabenraetsel_Summen_mini.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Buchstabenraetsel_Summen_mini.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Buchstabenraetsel_Summen_mini.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Buchstabenrätsel Summen
https://www.programmieraufgaben.ch/aufgabe/buchstabenraetsel-summen/mtt2cuwo
"""
# Programmieraufgabe:
#
# Schreiben Sie ein Programm, das Symbolrätsel der folgenden Art (Summen)
# löst:
# aab + bbc = dde.
# Dabei bedeuten ... | 34.056604 | 84 | 0.660111 |
b339ac12f7b339ab07d3b4da541129d4ffe4ee0c | 393 | py | Python | BIZa/2014/Tskipu_a_k/task_2_28.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Tskipu_a_k/task_2_28.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Tskipu_a_k/task_2_28.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 28.
#Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Эпикур. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Цкипуришвили Александр
# 25.05.2016
print("Каждый уходит из жизни так, словно только что ... | 43.666667 | 199 | 0.765903 |
2fbcad032b3dc344d842421b5220e7166d6668f4 | 2,127 | py | Python | results/xlights/city-backend/xlight/views.py | Rebstorm/dthack17 | 41cea4804fefe6a397114056c43d17c54b8e979d | [
"MIT"
] | null | null | null | results/xlights/city-backend/xlight/views.py | Rebstorm/dthack17 | 41cea4804fefe6a397114056c43d17c54b8e979d | [
"MIT"
] | null | null | null | results/xlights/city-backend/xlight/views.py | Rebstorm/dthack17 | 41cea4804fefe6a397114056c43d17c54b8e979d | [
"MIT"
] | null | null | null | """Django default module for view generation"""
from django.shortcuts import redirect, render
from django.http import HttpResponse, Http404
import json
from xlight.xlight_core import XLightHandler
from xlight.models import TrafficLight, ApiStatus
from re import sub
from django.core import serializers
de... | 30.826087 | 75 | 0.621533 |
6429607cbc5c38f9ec87bca03a26ad4ca5164497 | 10,935 | py | Python | scripts/extraction/postgisS2Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/extraction/postgisS2Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/extraction/postgisS2Extract.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Guido Lemoine
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
# Version :
""" postgisS2Extract_ext.py:
A routine to ext... | 30.630252 | 102 | 0.621948 |
ff4b7248e63cbc0bcfc0cf9fae33b3943466ff79 | 2,207 | py | Python | haas_lib_bundles/python/libraries/uln2003/uln2003.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/uln2003/uln2003.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/uln2003/uln2003.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2015-2021 Alibaba Group Holding Limited
MicroPython's driver for ULN2003
Author: HaaS
Date: 2022/03/15
"""
from driver import GPIO
from utime import sleep_ms
from micropython import const
import math
class ULN2003(object):
"""
This class implements uln2003 chip's defs.
"... | 23.231579 | 63 | 0.550974 |
440dcb7179b2021d1efe85cb1c9db8f0e166b4af | 1,935 | py | Python | src/test/tests/databases/lines.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/lines.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/databases/lines.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: lines.py
#
# Tests: mesh - 2D lines (unstructured), 3D lines (unstructured)
# plots - mesh
#
# Programmer: Alister Maguire
# Date: Tue Mar 17 08:50:32 PDT 2020
#
# Mod... | 24.493671 | 78 | 0.591214 |
9260876f2bc37b3b3bb06faa32efc9c91bfddb75 | 122 | py | Python | pyhton/modules/internal-module/src/main/python/main.py | NovaOrdis/playground | 6fe076b5d246ac5b492ab8d5de04eef43d797b62 | [
"Apache-2.0"
] | 5 | 2016-11-16T02:18:45.000Z | 2018-03-14T19:57:11.000Z | pyhton/modules/internal-module/src/main/python/main.py | NovaOrdis/playground | 6fe076b5d246ac5b492ab8d5de04eef43d797b62 | [
"Apache-2.0"
] | null | null | null | pyhton/modules/internal-module/src/main/python/main.py | NovaOrdis/playground | 6fe076b5d246ac5b492ab8d5de04eef43d797b62 | [
"Apache-2.0"
] | 10 | 2016-06-06T18:28:13.000Z | 2018-07-01T18:20:06.000Z | import os
import sys
sys.path.append(os.path.dirname(__file__) + "/my_module")
import my_module
my_module.some_function() | 20.333333 | 57 | 0.795082 |
2bcdff62c172ffd9dd109f55ecd5b831b173b082 | 337 | py | Python | app/models.py | Eggolt/Webdashboard | 440e7cda510d4adf559572636611cbecf1b0ffae | [
"MIT"
] | null | null | null | app/models.py | Eggolt/Webdashboard | 440e7cda510d4adf559572636611cbecf1b0ffae | [
"MIT"
] | null | null | null | app/models.py | Eggolt/Webdashboard | 440e7cda510d4adf559572636611cbecf1b0ffae | [
"MIT"
] | null | null | null | from sqlalchemy import Column, Float, String, Integer, Numeric
from .database import Base
class salary(Base):
__tablename__ = "salary"
id = Column(Integer, primary_key=True, index=True)
player = Column(String, unique=True, index=True)
fieldposition = Column(String)
team = Column(String)
salary=... | 30.636364 | 62 | 0.721068 |
92163257ab9f28ab64b7b2298398dc41f2c32b4d | 1,463 | py | Python | S4CTF/2021/misc/tom/tom.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | S4CTF/2021/misc/tom/tom.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | S4CTF/2021/misc/tom/tom.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import random, sys, os, signal, string, re
import inspect
from flag import flag
import primefac
def tom(n):
c = (n % 2) ^ 1
while True:
FU = list(primefac.primefac(n + c))
FD = list(primefac.primefac(n - c))
if len(FU) == 2:
return c, FU
elif len(FD) == 2:
... | 22.859375 | 97 | 0.561859 |
a65bcea6bd5e28400b4206fbdf0ae99572ee8bc2 | 561 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/utils/json.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/utils/json.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-client/utils/json.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import pathlib
import ntpath
import hash_
def _file_to_json(syspath):
systemname = str(ntpath.basename(syspath))
print(systemname)
data = []
jsondata = {}
pathlist = pathlib.Path(syspath).glob('**/*.*')
for path in pathlist:
dict = {}
dict['name'] = str(ntpath.basename(path))
... | 29.526316 | 110 | 0.622103 |
f37253245fe7a4af17c67be30ad2ee70e7ee32ee | 1,392 | py | Python | elements/python/8/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/8/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/8/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, x, nxt):
self.x = x
self.next = nxt
def splitmod(n, k):
"""
Split n into k lists containing the elements of n in positions i (mod k).
Return the heads of the lists and the tails.
"""
heads = [None]*k
tails = [None]*k
i = 0
whil... | 18.315789 | 77 | 0.529454 |
45ed0151a6bf3bb087533fc775f6977a8ab11e68 | 11,303 | py | Python | src/test/tests/hybrid/timelock.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/hybrid/timelock.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/hybrid/timelock.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: timelock.py
#
# Tests: mesh - 2D, 3D, curvilinear, single domain
# plots - FilledBoundary, Pseudocolor
# databases - PDB, Silo
#
# Purpose: This test case test... | 30.384409 | 85 | 0.654959 |
34674a397f3c619050184b148bc8cbc48ab91d72 | 891 | py | Python | books/PythonAutomate/webscrap/automate_2048.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/automate_2048.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/automate_2048.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """automate_2048.py
2048 게임 웹 페이지로 접속 해
게임 종료될 때까지 실행"""
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import time
url = "https://gabrielecirulli.github.... | 25.457143 | 68 | 0.754209 |
34807d22c299dce3817b3a3411675e1fdb07443c | 4,428 | py | Python | test/test_npu/test_pin_memory.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_pin_memory.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_pin_memory.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... | 35.142857 | 97 | 0.647245 |
942fae3ed46dbae0cca3dfd85152d354955d194f | 1,454 | py | Python | tests/test_zeitreihe.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_zeitreihe.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_zeitreihe.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import pytest # type:ignore[import]
from bo4e.bo.zeitreihe import Zeitreihe, ZeitreiheSchema
from bo4e.enum.medium import Medium
from bo4e.enum.mengeneinheit import Mengeneinheit
from bo4e.enum.messart import Messart
from bo4e.enum.messgroesse import Messgroesse
from bo4e.enum.wertermittlungsverfahren import Wertermi... | 36.35 | 92 | 0.652682 |
170352a340119d775fa03a5f227af62c44c28ed0 | 1,281 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/83criando_lendo_escrevendo_apagando_arquivos/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/83criando_lendo_escrevendo_apagando_arquivos/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/83criando_lendo_escrevendo_apagando_arquivos/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | # https://docs.python.org/3/library/functions.html#open
# Obs: 'w+' cria um arquivo do zero
# Obs: 'a+' vai add mais coisas ao arquivo
# Obs: 'r' vai ler o arquivo
# Começo do codigo
# file = open('abc.txt', 'w+')
# file.write('linha 1\n')
# file.write('linha 2\n')
# file.write('linha 3\n')
#
# file.seek(0, 0) # Mos... | 22.086207 | 72 | 0.587822 |
ca0dc592add60105317749c5655981e83a4511b6 | 417 | py | Python | src/onegov/core/orm/types/lowercase_text_type.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/types/lowercase_text_type.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/types/lowercase_text_type.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from sqlalchemy.types import TypeDecorator, TEXT
from sqlalchemy_utils.operators import CaseInsensitiveComparator
class LowercaseText(TypeDecorator):
""" Text column that forces all text to be lowercase. """
impl = TEXT
omparator_factory = CaseInsensitiveComparator
def process_bind_param(self, value... | 26.0625 | 64 | 0.726619 |
047910e708b43a859cabff80f6ec49bffed4791e | 1,830 | py | Python | src/balldetection/SimpleBall.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | 7 | 2015-11-27T09:53:32.000Z | 2021-01-13T17:35:54.000Z | src/balldetection/SimpleBall.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | src/balldetection/SimpleBall.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | # tmp
import cv
import numpy as np
from src.Util import getcolour
from src.balldetection.Ball import SimpleBall
class SimpleBallFilter(object):
def __init__(self):
self.balls = []
def filter(self, rgb, depth, ball_list, args={}):
# first call?
if not len(self.balls):
if l... | 37.346939 | 122 | 0.571585 |
edb44e83bc75b8818d94bce1a245c1303278ba56 | 476 | py | Python | Zh3r0/2021/crypto/import_numpy_as_MT/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Zh3r0/2021/crypto/import_numpy_as_MT/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Zh3r0/2021/crypto/import_numpy_as_MT/challenge.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import os
from numpy import random
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from secret import flag
def rand_32():
return int.from_bytes(os.urandom(4),'big')
flag = pad(flag,16)
for _ in range(2):
# hate to do it twice, but i dont want people bruteforcing it
random.seed(rand_32()... | 21.636364 | 65 | 0.703782 |
6123671b3f9a94a4d6659a1a60dd1b40794dc194 | 451 | py | Python | python/asyncio/async_http.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/async_http.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/async_http.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import httpx
# Traditional python
def do_stuff():
resp = httpx.get("https://www.example.com/")
return resp.json()
# With Async
async def do_stuff_async():
async with httpx.AsyncClient() as client:
resp = await client.get("https://www.example.com")
return resp.json
if __... | 20.5 | 59 | 0.620843 |
612cf541a873e0ea5aadee712f785ede8e9af48f | 141 | py | Python | 3.Python/aromalsanthosh.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | 8 | 2020-10-01T14:15:53.000Z | 2021-10-03T06:10:03.000Z | 3.Python/aromalsanthosh.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | null | null | null | 3.Python/aromalsanthosh.py | tresa2002/Learn-Coding | 2ad4c8948f77c421a97b58adc00a59bb85c37de0 | [
"MIT"
] | 29 | 2020-10-02T14:24:53.000Z | 2020-10-12T10:52:31.000Z | name, age = "Aromal S", 20
username = "aromalsanthosh"
print ('Hello!')
print("Name: {}\nAge: {}\nUsername: {}".format(name, age, username))
| 28.2 | 68 | 0.64539 |
fcd6135249e75ebce7f7a72f26fd53083cc883f6 | 289 | py | Python | Yakisizwe/views.py | NAL0/nalbt | c411ead60fac8923e960e67f4bbad5c7aeffc614 | [
"MIT"
] | null | null | null | Yakisizwe/views.py | NAL0/nalbt | c411ead60fac8923e960e67f4bbad5c7aeffc614 | [
"MIT"
] | null | null | null | Yakisizwe/views.py | NAL0/nalbt | c411ead60fac8923e960e67f4bbad5c7aeffc614 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'Yakisizwe/initiative.html')
def index2(request):
return render(request, 'Yakisizwe/dash.html')
def index3(request):
return render(request, 'Yakisizwe/Education.html')
| 22.230769 | 55 | 0.747405 |
bd86333e3c64ad680c6b914c23acf242c815fa73 | 5,327 | py | Python | PlaidCTF/2021/crypto/Fake_Medallion/carnival.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | PlaidCTF/2021/crypto/Fake_Medallion/carnival.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | PlaidCTF/2021/crypto/Fake_Medallion/carnival.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from bank import Bank
import random
from os import urandom
FLAG = "PCTF{REDACTED}"
# Game of Razzle
class RazzleGame:
def __init__(self):
self.welcome_message = (
"Welcome to our custom game of razzle! It takes one "
"medallion for each game. You roll 8 dies and take the "
... | 36.486301 | 78 | 0.56805 |
00f0dc5f82345fa2b5ac9b64dc1efa74948b2162 | 226 | py | Python | webinterface/tests/unit_tests/test_model_ScheduleGroup.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/tests/unit_tests/test_model_ScheduleGroup.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/tests/unit_tests/test_model_ScheduleGroup.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from django.test import TestCase
from webinterface.models import *
class ScheduleGroupTest(TestCase):
def test__str(self):
group = ScheduleGroup(name="test")
self.assertEqual(group.__str__(), group.name)
| 25.111111 | 53 | 0.725664 |
978f22e375467aa43164a00cf6d86426f674e41a | 217 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/55. highest number in a list.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/55. highest number in a list.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_3_List/55. highest number in a list.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that returns the highest number in a list.
input_list = [9,6,45,67,12]
Expected output = 67
"""
def high_num(input_list):
input_list.sort()
return input_list[-1]
| 14.466667 | 66 | 0.645161 |
c111cde960b3d308a8d427089d812347cc30b48c | 7,297 | py | Python | test/test_npu/test_allclose.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_allclose.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_allclose.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... | 48.324503 | 80 | 0.560641 |
c16e8cd8f2aa7de4c3a6b9bb3388a318ef32adbb | 781 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_command_install.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_command_install.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_command_install.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_distutils_command_install.py,v 1.1 2018/06/17 19:21:21 adam Exp $
Add a knob (enviroment variable) for disabling installation of egg metadata
in extensions until we have infrastructure in place for dealing w/ it.
--- Lib/distutils/command/install.py.orig 2014-12-10 15:59:34.000000000 +0000
+++ Lib/... | 43.388889 | 84 | 0.636364 |
e7858ec610bd27d93a6af538fd260e0a362086c2 | 5,936 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/game/DRT/randomRides.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/game/DRT/randomRides.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/game/DRT/randomRides.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 47.111111 | 120 | 0.612702 |
823f87d4e66e931a5dab0c15a9910e75d69e85ff | 38 | py | Python | src/d2py/analysis/numbers.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 3 | 2022-03-09T14:08:42.000Z | 2022-03-10T04:17:17.000Z | src/d2py/analysis/numbers.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 3 | 2021-11-07T13:11:26.000Z | 2022-03-19T03:28:48.000Z | src/d2py/analysis/numbers.py | xinetzone/d2py | 657362a0451921ef5a7b05b4a8378f7379063cdf | [
"Apache-2.0"
] | 1 | 2022-03-15T14:18:32.000Z | 2022-03-15T14:18:32.000Z | '''Number of abstract base classes
''' | 19 | 34 | 0.710526 |
68ed763b6c707d4b1c728d96c9755770fa8b98f7 | 482 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/094_metodos_de_classes/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/094_metodos_de_classes/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/094_metodos_de_classes/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | class Pessoa:
ano_atual = 2019
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
def get_ano_nascimento(self):
print(self.ano_atual - self.idade)
@classmethod #Eu nao entendi a logica aq, sem nexo
def por_ano_nascimento(cls, nome, ano_nascimento):
... | 20.956522 | 55 | 0.655602 |
2e7878e2f1e5215ba3150b0395451ae92c57e179 | 823 | py | Python | sakf/app/sakf/home.py | spdir/sakf | 9a07c5f90765201a42d524dc6d4554f4ccd3c750 | [
"Apache-2.0"
] | null | null | null | sakf/app/sakf/home.py | spdir/sakf | 9a07c5f90765201a42d524dc6d4554f4ccd3c750 | [
"Apache-2.0"
] | null | null | null | sakf/app/sakf/home.py | spdir/sakf | 9a07c5f90765201a42d524dc6d4554f4ccd3c750 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# HOME Handler
import tornado.web
from sakf.app.sakf import base
class IndexHandler(base.BaseHandlers):
@tornado.web.authenticated
@base.auth_url
def get(self):
return self.render('sakf/index.html', username=self.session['username'])
def post(self):
self.get()
class HomeHa... | 18.704545 | 76 | 0.692588 |
d8f190583d14a2ba69d60f46176ab3bebcda949f | 5,026 | py | Python | x2paddle/project_convertor/pytorch/api_mapper/utils.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/project_convertor/pytorch/api_mapper/utils.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/project_convertor/pytorch/api_mapper/utils.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.000Z | # Copyright (c) 2021 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 appl... | 32.012739 | 108 | 0.586152 |
41f3308c589ac65783a7b54b4b0ee3560b56b769 | 196 | py | Python | repo/script.tv.show.next.aired/default.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.tv.show.next.aired/default.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.tv.show.next.aired/default.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
script.tv.show.next.aired
TV Show - Next Aired
Main script entry point
'''
from resources.lib.main_module import MainModule
MainModule()
| 17.818182 | 48 | 0.668367 |
5ccec55fe2c8f0f2538f3c818a05e112c96a2ccb | 370 | py | Python | interactions/commands/ping.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | interactions/commands/ping.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | interactions/commands/ping.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | import time
import requests
from interactions.create import headers
def run(req, res_url=None, **kwargs):
time.sleep(3)
json = {
"content": "Meine CPU bedankt sich...und, achja:\nPong :ping_pong:",
"embeds": [],
"allowed_mentions": []
}
r = requests.patc... | 19.473684 | 80 | 0.589189 |
7a6adfde51eadb2584aead3fed9d735b0b65046f | 3,602 | py | Python | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/rendering_column_line_area_combi_using_json_example.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 30 | 2018-04-01T09:08:40.000Z | 2022-01-23T07:30:07.000Z | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/rendering_column_line_area_combi_using_json_example.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 14 | 2018-07-17T08:33:35.000Z | 2021-09-29T17:26:15.000Z | asset/integrations/django/samples/fusioncharts/samples/rendering_column_line_area_combi_using_json_example.py | Piusshungu/catherine-junior-school | 5356f4ff5a5c8383849d32e22a60d638c35b1a48 | [
"MIT"
] | 17 | 2016-05-19T13:16:34.000Z | 2021-04-30T14:38:42.000Z | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file which has required functions to embed the charts in html page
from ..fusioncharts import FusionCharts
# Loading Data from a Static JSON String
# It is a example to show a MsCombi 3D chart where data is passed... | 25.188811 | 129 | 0.41116 |
8f137644f2bda329ed7716f7c2439204022bee4b | 418 | py | Python | tests/monad_test.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | tests/monad_test.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | tests/monad_test.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | from abc import ABC, abstractmethod
from .functor_test import FunctorTest
class MonadTest(FunctorTest, ABC):
@abstractmethod
def test_right_identity_law(self, *args):
raise NotImplementedError()
@abstractmethod
def test_left_identity_law(self, *args):
raise NotImplementedError()
... | 23.222222 | 45 | 0.729665 |
56dc4737a7abbdee85ba033e37651ac54b6e2283 | 1,284 | py | Python | app/fichas/models.py | fxavier/abt-epts | 021a8140db32afba106a7a9e122b98452d88c225 | [
"MIT"
] | null | null | null | app/fichas/models.py | fxavier/abt-epts | 021a8140db32afba106a7a9e122b98452d88c225 | [
"MIT"
] | null | null | null | app/fichas/models.py | fxavier/abt-epts | 021a8140db32afba106a7a9e122b98452d88c225 | [
"MIT"
] | null | null | null | from django.db import models
from core.models import Provincia, Distrito, UnidadeSanitaria
from patients.models import Paciente
class SituacaoFamilia(models.Model):
nome = models.CharField(max_length=150)
parentesco = models.CharField(max_length=100)
idade = models.IntegerField()
teste_hiv = models.Ch... | 35.666667 | 85 | 0.750779 |
a457d313062987a2ec24c479f0b65d77195dcc28 | 1,158 | py | Python | ai-api-docker/main.py | Zeno-Paukner/cellarius | 904b88c6dc33cf4ec2f6d70d3e1acf175b11967a | [
"Unlicense"
] | 1 | 2021-12-06T20:29:28.000Z | 2021-12-06T20:29:28.000Z | ai-api-docker/main.py | Zeno-Paukner/cellarius | 904b88c6dc33cf4ec2f6d70d3e1acf175b11967a | [
"Unlicense"
] | null | null | null | ai-api-docker/main.py | Zeno-Paukner/cellarius | 904b88c6dc33cf4ec2f6d70d3e1acf175b11967a | [
"Unlicense"
] | null | null | null | from pydantic import BaseModel
from fastapi import FastAPI
import uvicorn
import time
from transformers import pipeline
app = FastAPI()
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-1.3B')
class Input_GPT_Neo_1_3B(BaseModel):
prompt: str
max_length: int
do_sample: bool
tempera... | 26.318182 | 130 | 0.710708 |
2d1f9034077a8a3d87604cfd7fe4cc8ac3816495 | 719 | pyde | Python | sketches/randomwalkturtle1/randomwalkturtle1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/randomwalkturtle1/randomwalkturtle1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/randomwalkturtle1/randomwalkturtle1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | add_library('Turtle')
from random import randint
turtles = []
colors = [color(18, 184, 116), color(200, 23, 223), color(95, 145, 40),
color(8, 124, 127)]
def setup():
size(400, 400)
this.surface.setTitle(u"Random Walk mit der Schildkröte")
background(232, 226, 7)
strokeWeight(2)
for _ in... | 22.46875 | 71 | 0.550765 |
247f8f9d05998f7566d2f457e5fac1935fa2b3f7 | 572 | py | Python | Chapter2_Python/11-MatplotlibIntro.py | olebause/TensorFlow2 | 70fcb7c85c7ead0dc4f88ffa35be5f2eb93e618e | [
"MIT"
] | 2 | 2021-02-10T19:50:27.000Z | 2021-12-30T06:15:55.000Z | Chapter3_Libraries/MatplotlibIntro.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 1 | 2020-12-21T15:29:20.000Z | 2022-01-15T12:06:09.000Z | Chapter3_Libraries/MatplotlibIntro.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 4 | 2020-11-08T17:07:53.000Z | 2022-02-07T06:40:55.000Z | import matplotlib.pyplot as plt
grades_jan = [56, 64, 78, 100]
grades_ben = [86, 94, 98, 90]
# Plot
plt.plot(range(len(grades_jan)), grades_jan, color="blue")
plt.plot(range(len(grades_ben)), grades_ben, color="red")
plt.legend(["Jan", "Ben"])
plt.xlabel("Course")
plt.ylabel("Grade in %")
plt.title("Jan vs. Ben")
pl... | 23.833333 | 61 | 0.687063 |
24ec72b7f2bf1b8f4a8bb6cdd9c0e844cb435c37 | 315 | py | Python | Licence 1/I11/TP5/ex2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP5/ex2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP5/ex2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def som_div_propres(n):
sum = 0
for div in range(1, n):
if n % div == 0: sum += div
return sum
def est_presque_parfait(n):
return som_div_propres(n) == n - 1
def affiche_presque_parfait(k):
for i in range(2**k):
if est_presque_parfait(i): print(i)
affiche_presque_parfait(10)
| 21 | 43 | 0.634921 |
8ea5b0fbe4dd165fd40c70460b51c5b568521a84 | 186 | py | Python | Pythonjunior2020/Woche2/Aufgabe_2_5_1.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche2/Aufgabe_2_5_1.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Pythonjunior2020/Woche2/Aufgabe_2_5_1.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | # 2.5.1, Woche 2, Block 5, Aufgabe 1
# Liste
schloss = ["rot","grün"]
# Elemente hinzufügen
schloss += ["gelb"]
# Elemente ausgeben
for i in range(len(schloss)):
print(schloss[i]) | 16.909091 | 36 | 0.650538 |
8ea5c8e8f535ec5973a0285d63daa71ba1e102a4 | 1,092 | py | Python | Scholien/migrations/0006_auto_20170531_1640.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Scholien/migrations/0006_auto_20170531_1640.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Scholien/migrations/0006_auto_20170531_1640.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-05-31 14:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Scholien', '0005_auto_20170510_1631'),
]
operations = [
migrations.RemoveFi... | 25.395349 | 49 | 0.550366 |
8ee2839b3858c88d6b5571491615519ce7e54556 | 1,222 | py | Python | constant.py | teastares/or_lab | c8fb5c22d31c1e2b93381397202be7b71a3fc796 | [
"MIT"
] | 1 | 2021-01-18T09:11:59.000Z | 2021-01-18T09:11:59.000Z | constant.py | teastares/or_lab | c8fb5c22d31c1e2b93381397202be7b71a3fc796 | [
"MIT"
] | null | null | null | constant.py | teastares/or_lab | c8fb5c22d31c1e2b93381397202be7b71a3fc796 | [
"MIT"
] | null | null | null | """
the Constant Variables.
"""
class ConstantSet(object):
"""
The class of constant number.
It doesn't follow the Pascal format since its speciality.
"""
class ConstError(TypeError):
pass
class ConstCaseError(ConstError):
pass
def __setattr__(self, key, value):
i... | 23.5 | 88 | 0.693944 |
d92c43b124b654105e5c30116385fb5180587500 | 1,294 | py | Python | python/fastcampus/chapter06_04_03.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter06_04_03.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter06_04_03.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """파이썬 심화
Asyncio
비동기 I/O Coroutine 작업
- Generator -> 반복적인 객체 Return(yield)
- 즉, 실행 stop -> 다른 작업으로 위임 -> stop 지점부터 재실행 원리
- Non-Blocking 비동기 처리에 적합
"""
# BlockIO -> Thread 사용
# 쓰레드 개수 및 GIL 문제 염두, 공유 메모리 문제 해결
import asyncio
import timeit
import threading
from concurrent.futures.thread import ThreadPoolExecutor
from ... | 22.701754 | 77 | 0.665379 |
5c23bf0522785a7c20eb1cd41f71bac55abb8625 | 567 | py | Python | 04_SQL/commerce/auctions/migrations/0010_auto_20201103_2318.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0010_auto_20201103_2318.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0010_auto_20201103_2318.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-03 23:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0009_auto_20201103_2037'),
]
operations = [
migrations.AlterField(
model_name='user',
name='first_name',... | 23.625 | 62 | 0.57672 |
5c4496e65947e19d10d9f92b8489cfec3b3c0f0c | 249 | py | Python | angstrom/2019/crypto/Lattice_ZKP/otp.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2019/crypto/Random_ZKP/otp.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2019/crypto/Random_ZKP/otp.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import numpy as np
from Crypto.Hash import SHAKE256
from Crypto.Util.strxor import strxor
def encrypt(s, flag):
raw = bytes(np.mod(s, 256).tolist())
shake = SHAKE256.new()
shake.update(raw)
pad = shake.read(len(flag))
return strxor(flag, pad) | 22.636364 | 37 | 0.726908 |
c606ff56a0a592a1d066c60eef9aa11c98015fbb | 464 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch07_recursion_advanced/ex02_edit_distance_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch07_recursion_advanced/ex02_edit_distance_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch07_recursion_advanced/ex02_edit_distance_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch07_recursion_advanced.solutions.ex02_edit_distance import edit_distance
@pytest.mark.parametrize("value1, value2, expected",
[("Micha", "Michael", 2),
("Anan... | 27.294118 | 78 | 0.672414 |
d68420461ad915da1b1a5e9de01f825757c53e82 | 4,861 | py | Python | qian_gua.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | qian_gua.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | qian_gua.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | import requests
import json
import time
import traceback
import CralwerSet.connect_mysql as connect_mysql
import datetime
class QianGua():
def __init__(self):
self.loginUrl = "http://api.qian-gua.com/login/Login?_="
self.apiUrl = "http://api.qian-gua.com/v1/Note/GetNoteHotList?_="
self.hea... | 31.980263 | 136 | 0.339436 |
06410df1a75b0e7f9b5721681799019949e270ab | 281 | py | Python | exercises/ja/exc_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_01_03_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # 日本語クラスをインポートし、nlpオブジェクトを作成
from ____ import ____
nlp = ____
# テキストを処理
doc = ____("私はツリーカンガルーとイルカが好きです。")
# 「ツリーカンガルー」のスライスを選択
tree_kangaroos = ____
print(tree_kangaroos.text)
# 「ツリーカンガルーとイルカ」のスライスを選択
tree_kangaroos_and_dolphins = ____
print(tree_kangaroos_and_dolphins.text)
| 17.5625 | 39 | 0.807829 |
232b5c2d0219808c315a2fafc062c6134b188a5a | 342 | py | Python | python/data_sutram/scraper/parallel_loop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/parallel_loop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/parallel_loop.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from multiprocessing import Process
a = 0
b = 0
def loop_a():
global a
while 1:
print("{} = {}".format("a",a))
a += 1
def loop_b():
global b
while 1:
print("{} = {}".format("b",b))
b += 1
if __name__ == '__main__':
Process(target=loop_a).start()
Process(... | 19 | 38 | 0.51462 |
88e5743050ca82c2d2fb4a1b2d7ddfe767fead96 | 542 | py | Python | tests/onegov/core/test_filters.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_filters.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/core/test_filters.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from io import StringIO
from onegov.core.filters import JsxFilter
def test_jsx_filter():
filter = JsxFilter()
filter.setup()
input = StringIO((
'var component = Rect.createClass({'
'render: function() { return <div />; }'
'});'
))
output = StringIO()
filter.input(input... | 22.583333 | 74 | 0.577491 |
aecb0d50eb08663ff9151f0fafbe49b7e960d298 | 32,954 | py | Python | Agent5_a_0_5_knots_512_d_0_02/No simulation forward kin/transformations.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent5_a_0_5_knots_512_d_0_02/No simulation forward kin/transformations.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent5_a_0_5_knots_512_d_0_02/No simulation forward kin/transformations.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | from __future__ import division
import warnings
import math
import numpy
# Documentation in HTML format can be generated with Epydoc
__docformat__ = "restructuredtext en"
def identity_matrix():
return numpy.identity(4, dtype=numpy.float64)
def translation_matrix(direction):
"""Return matrix to translate ... | 33.02004 | 85 | 0.558233 |
4e24eefa5ed95b15ce1d39b2d842ad8c412059e7 | 2,018 | py | Python | language/grammar.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 1 | 2021-03-05T07:44:05.000Z | 2021-03-05T07:44:05.000Z | language/grammar.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | 3 | 2017-06-04T03:01:31.000Z | 2017-08-04T04:04:37.000Z | language/grammar.py | dr-bigfatnoob/quirk | f5025d7139adaf06380c429b436ccbf1e7611a16 | [
"Unlicense"
] | null | null | null | from __future__ import print_function, division
import sys
import os
sys.path.append(os.path.abspath("."))
sys.dont_write_bytecode = True
__author__ = "bigfatnoob"
from parsimonious.grammar import Grammar
definition = """
program = (nl* stmt (nl+ stmt)* nl*)
stmt = comment / ((eq / expr ) sc)
comment = (hash s... | 30.119403 | 86 | 0.619921 |
9df03785a442ab15d416de2b0e5895fbea327702 | 2,122 | py | Python | TwoSum/twoSum.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | TwoSum/twoSum.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | TwoSum/twoSum.py | Themishau/Algorithmen | f31627f823eb86f8673e72c4998c9029e74097fb | [
"MIT"
] | null | null | null | from typing import List
import sys
import argparse
def convertList(l, dtype):
return list(map(dtype, l))
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
# number : index
index_seen = {}
for i, num in enumerate(nums, start=0): # i = index, num = value
... | 29.472222 | 85 | 0.504241 |
d18b29de6492d80182b53d0fe82db98f6999e9b6 | 184 | py | Python | backend/api/admin.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/api/admin.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/api/admin.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | from django.contrib import admin
from products.models import Product
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
list_display = ("title", "content", "price")
| 20.444444 | 48 | 0.76087 |
e12c18b64e4a6c614377848beeb9b4ab0026091e | 2,878 | py | Python | udacity course code/01-06-scatterplots.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 1 | 2021-03-22T22:25:54.000Z | 2021-03-22T22:25:54.000Z | udacity course code/01-06-scatterplots.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 6 | 2017-01-16T09:53:21.000Z | 2017-01-18T12:20:09.000Z | udacity course code/01-06-scatterplots.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | null | null | null | """Scatterplots."""
import pandas as pd
import matplotlib.pyplot as plt
from util import get_data, plot_data, compute_daily_returns
import numpy as np
def test_run():
# Read data
dates = pd.date_range('2009-01-01', '2012-12-31') # date range as index
symbols = ['SPY','XOM','GLD']
df = get_data(symbol... | 42.955224 | 98 | 0.701529 |
01792e44928053b7f0ed07eeff896423bc547e6e | 347 | py | Python | Licence 1/I11/TP4/ex2.2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP4/ex2.2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP4/ex2.2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | liste = []
entiers = 0
somme = 0
isZero = False
while not isZero:
number = float(input("Entrez un nombre: "))
if number == 0: isZero = True
elif number - int(number) == 0:
entiers += 1
somme += number
liste += [number]
print("Liste:", liste)
print("Nombre d'entiers:", entiers)
print("S... | 20.411765 | 47 | 0.602305 |
112d8d59da9ccdb144fce94170d0b8bd550ddc45 | 379 | py | Python | qmk_firmware/lib/python/qmk/cli/fileformat.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | qmk_firmware/lib/python/qmk/cli/fileformat.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/fileformat.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Format files according to QMK's style.
"""
from milc import cli
import subprocess
@cli.subcommand("Format files according to QMK's style.", hidden=True)
def fileformat(cli):
"""Run several general formatting commands.
"""
dos2unix = subprocess.run(['bash', '-c', 'git ls-files -z | xargs -0 dos2unix'],... | 27.071429 | 111 | 0.704485 |
3a9514c401ce62b23cfb5117230ce8e7945f0385 | 1,304 | py | Python | DiceCTF/2021/crypto/garbled/obtain_flag.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | DiceCTF/2021/crypto/garbled/obtain_flag.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | DiceCTF/2021/crypto/garbled/obtain_flag.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | """
once you've found the input labels which make the circuit return `true`,
then concatenate them together, hash them,
and xor with the provided string to obtain the flag
"""
import hashlib
import json
from yao import evaluate_circuit
from public_data import g_tables
from private_data import keys, flag
... | 22.101695 | 126 | 0.546012 |
3a985cb982d3c57f856a6fb9785c7e10acebeeb9 | 712 | py | Python | year_3/comppi_0/publication/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_0/publication/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_0/publication/views.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
import publication.scheduling
import tgbot.botsetup
def indexpublications(request):
return render(request, 'publicationindex.html')
def publishtext(request):
text = request.POST.get('publication_text', 'no text')
parse_mode = request.POST.get('parse_mode', '... | 30.956522 | 60 | 0.73736 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.