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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a132bc8621dc628200b03baaf76ae13038733b66 | 287 | py | Python | 2015/05/hist-jobs-select-gain/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/05/hist-jobs-select-gain/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/05/hist-jobs-select-gain/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
# COPY_GOOGLE_DOC_KEY = '1GtziTUWxm18K7go_5IB60sToZHB1saCKBMphmh3eZ2A'
COPY_GOOGLE_DOC_KEY = '1eUNUWh7rHHtggbpXHrXY39x8kzVgIJ-dx4DaKx1ooTU'
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
| 35.875 | 77 | 0.829268 |
1a2c54f0490ac4a059b8e833684806fda1db0ff7 | 474 | py | Python | INBa/2015/ORSHONOVA_E_G/task_3_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/ORSHONOVA_E_G/task_3_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/ORSHONOVA_E_G/task_3_17.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 3. Вариант 17.
#Напишите программу, которая выводит имя "Симона Руссель", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
#Orshonova. E. G.
#23.05.2016
print("Сегодня речь пойдёт про Симона Руссель")
print("Под каким и... | 52.666667 | 199 | 0.772152 |
c5145aa0c37c08208ce2952a6155787ea16b4eda | 1,471 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_10_Definition_eigener_Klassen/08_Programmierstil.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_10_Definition_eigener_Klassen/08_Programmierstil.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_10_Definition_eigener_Klassen/08_Programmierstil.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: 08_Programmierstil.py
# Project: Kapitel_10_Definition_eigener_Klassen
#-----
# Created Date: Wednesday 07.10.2020, 16:30
# Author: Apop85
#-----
# Last Modified: Wednesday 07.10.2020, 16:30
#-----
# Copyright (c) 2020 Apop85
# This software is published un... | 26.745455 | 89 | 0.698844 |
9a7c00f69e36060f181640aaf9c5521e8324157c | 15,032 | py | Python | CompilerTheory_exp/exp3/gui.py | DolorHunter/hfut-exp-archived | c67e26c1f4fba550c8974eaba10dfa302b928868 | [
"BSD-2-Clause"
] | 12 | 2020-12-07T05:49:05.000Z | 2022-03-25T09:09:36.000Z | CompilerTheory_exp/exp3/gui.py | DolorHunter/hfut-exp | c67e26c1f4fba550c8974eaba10dfa302b928868 | [
"BSD-2-Clause"
] | null | null | null | CompilerTheory_exp/exp3/gui.py | DolorHunter/hfut-exp | c67e26c1f4fba550c8974eaba10dfa302b928868 | [
"BSD-2-Clause"
] | 1 | 2021-01-08T08:53:53.000Z | 2021-01-08T08:53:53.000Z | # coding: utf-8
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
import slr1
# 主窗口
class MainWindows:
def __init__(self, master):
self.init_input = StringVar()
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++... | 43.319885 | 120 | 0.600253 |
9a8ad468bd7aab19047121f0f8caac23789b4f9c | 4,002 | py | Python | sysadminscripts/ftp-upload.py | cdecu/SysAdmin-Scripts | 14de6deac872c2b5e0be3ea0b1adf85af164427e | [
"MIT"
] | null | null | null | sysadminscripts/ftp-upload.py | cdecu/SysAdmin-Scripts | 14de6deac872c2b5e0be3ea0b1adf85af164427e | [
"MIT"
] | null | null | null | sysadminscripts/ftp-upload.py | cdecu/SysAdmin-Scripts | 14de6deac872c2b5e0be3ea0b1adf85af164427e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Doc !
"""
import argparse
import os.path
import pysftp
__author__ = 'cdc'
__email__ = 'cdc@xpertbilling.com'
__version__ = '0.1.9'
cinfo = {'host': '', 'username': '', 'password': '', 'port': 2222}
def sftpConnect():
"""
Just Test connection to host
"""... | 31.761905 | 120 | 0.577961 |
490e083fd8e422b0026783f68502076777c58b96 | 103 | py | Python | .circleci/checklhe/test.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 3 | 2015-06-08T13:09:28.000Z | 2020-09-04T19:59:36.000Z | .circleci/checklhe/test.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 64 | 2015-06-24T15:08:17.000Z | 2022-01-25T04:59:32.000Z | .circleci/checklhe/test.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 19 | 2015-05-04T22:15:41.000Z | 2021-07-06T10:04:40.000Z | import momentum
if __name__ == "__main__":
a = momentum.Momentum(3, 2, 1, 1)
print a.vector()
| 17.166667 | 37 | 0.631068 |
62133c8046bfb685ff738f0fac439cc2bfba6a05 | 27,239 | py | Python | rbac/server/api/roles.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | rbac/server/api/roles.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | rbac/server/api/roles.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 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 ... | 32.897343 | 114 | 0.639231 |
62334c61e4aaa5072f669205143027e0cb1c3a09 | 615 | py | Python | apps/principal/models.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | apps/principal/models.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | apps/principal/models.py | Cesar0510/lbzproject | c197875488cfb10cd35890bcdc0dcc60adf8af76 | [
"Apache-2.0"
] | null | null | null | from django.db import models
# Create your models here.
class Person(models.Model):
primer_nombre = models.CharField(max_length=80)
segundo_nombre = models.CharField(max_length=80,blank=True)
primer_apellido = models.CharField(max_length=80)
segundo_apellido = models.CharField(max_length=80)
ident... | 26.73913 | 63 | 0.733333 |
6551fd25c3fd505b890ae923278fe75841600a56 | 2,612 | py | Python | src/onegov/election_day/views/election_compound/lists.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/election_compound/lists.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/election_compound/lists.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import ElectionCompound
from onegov.core.security import Public
from onegov.election_day import ElectionDayApp
from onegov.election_day.layouts import DefaultLayout, ElectionCompoundLayout
from onegov.election_day.utils import add_last_modified_header
from onegov.election_day.utils import get_paramet... | 25.607843 | 77 | 0.696784 |
655c3a08f78b03e5097c21ae906f01aed2d1f8c9 | 2,316 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/sumolib/sensors/inductive_loop.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | sumolib/sensors/inductive_loop.py | KhalidHALBA-GR-NIST/UCEFSUMOV2V | 4eb7ac761303a171718a10e4131184746bded9fd | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | sumolib/sensors/inductive_loop.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) 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.eclipse.org/legal/epl-2.... | 33.085714 | 98 | 0.659326 |
65980f72b8cec2a4f19988c09a05502543527775 | 1,395 | py | Python | api/wsgi/src/project/urls.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 2 | 2020-06-08T19:17:10.000Z | 2020-06-08T20:45:07.000Z | api/wsgi/src/project/urls.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | 14 | 2015-10-07T09:31:50.000Z | 2022-02-23T07:34:10.000Z | api/wsgi/src/project/urls.py | easyCZ/SLIP-A-2015 | ad386df9c438d93ec89f68c63d3deda12d27d1ed | [
"MIT"
] | null | null | null | """myproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 38.75 | 98 | 0.709677 |
0294969658720c184d71ee8b5ab3cf21945212ad | 424 | py | Python | algorithms/ar-msrt/python3/merge_sort.py | NuclearCactus/FOSSALGO | eb66f3bdcd6c42c66e8fc7110a32ac021596ca66 | [
"MIT"
] | 59 | 2018-09-11T17:40:25.000Z | 2022-03-03T14:40:39.000Z | algorithms/ar-msrt/python3/merge_sort.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 468 | 2018-08-28T17:04:29.000Z | 2021-12-03T15:16:34.000Z | algorithms/ar-msrt/python3/merge_sort.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 253 | 2018-08-28T17:08:51.000Z | 2021-11-01T12:30:39.000Z | def merge_sort(arr_a, arr_b):
a = len(arr_a)
b = len(arr_b)
res = []
i, j = 0, 0
while i < a and j < b:
if arr_a[i] < arr_b[j]:
res.append(arr_a[i])
i += 1
else:
res.append(arr_b[j])
j += 1
res = res + arr_a[i:] + arr_b[j:]
... | 16.96 | 37 | 0.438679 |
b89dc3baf0f68087b19eb8cc6b87ad678288e5e1 | 4,694 | py | Python | wz/template_engine/coversheet.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/template_engine/coversheet.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/template_engine/coversheet.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
template_engine/coversheet.py
Last updated: 2021-05-22
Build the outer sheets (cover sheets) for the text reports.
User fields in template files are replaced by the report information.
=+LICENCE=============================
Copyright 2021 Michael Towers
Licensed under the Apache Lic... | 32.825175 | 75 | 0.594802 |
b8a5e91de3d94f15455624594aef4be3854ff966 | 11,992 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/keycloak_group.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/keycloak_group.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/keycloak_group.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Adam Goossens <adam.goossens@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata... | 32.32345 | 124 | 0.636424 |
a29974cc94895cb89619937f8fcd0de8ee3ceedc | 510 | py | Python | nz_crawl_demo/day5/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day5/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day5/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from selenium import webdriver
from lxml import etree
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome()
driver.get("https://www.baidu.com/")
inputTag = driver.find_element_by_id('kw')
subTag = driver.find_element_by_id('s... | 30 | 64 | 0.821569 |
ac1eb23be32556803cd66d294f40e6841ce2a915 | 9,106 | py | Python | ShellCode-main/shellcode.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ShellCode-main/shellcode.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ShellCode-main/shellcode.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os
os.system("clear")
os.system("cowsay ShellC0de - Tegal1337 | lolcat")
# Take users TCP port as input
port = raw_input("Enter TCP Port Number: ")
# Convert input string to an integer
deciPort = int(port)
# Format the integer to Hex Integer
hexPort = "{:02x}".format(deciPort)
#print "Hex value of Decimal Numbe... | 59.51634 | 113 | 0.621239 |
5a1b9f59347918703e37202fc82609f454b06408 | 687 | py | Python | 2-resources/__DATA-Structures/Code-Challenges/cc74doublyLinkedList/cc74doublyLinkedList.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc74doublyLinkedList/cc74doublyLinkedList.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc74doublyLinkedList/cc74doublyLinkedList.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # cc74 doublyLinkedList https://repl.it/student/submissions/1895354
'''
Implement a doubly-linked list, where each node points to both the node after it
in the list, as well as the node that came before it.
This challenge is difficult, but please put your best foot forward,
as with every morning code challenge, to at ... | 45.8 | 80 | 0.793304 |
5a35306d1e3db360c6e1eef3ae00932b2a123eba | 1,239 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOscale.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOscale.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOscale.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
from qgis.core import QgsProject
class run(object):
def __init__(self, id, gtoTool, config, debug):
super(run, self).__init__()
try:
#references
self.result = None
self.debug = debug
sel... | 33.486486 | 80 | 0.545601 |
ce698c743c4d04421ff866190e48ba187eae6a8e | 6,161 | py | Python | usgs_quake/__init__.py | josefmtd/usgs-quake | 10c6573b5e63bd20294dce29aafbbf27b07096e6 | [
"MIT"
] | null | null | null | usgs_quake/__init__.py | josefmtd/usgs-quake | 10c6573b5e63bd20294dce29aafbbf27b07096e6 | [
"MIT"
] | null | null | null | usgs_quake/__init__.py | josefmtd/usgs-quake | 10c6573b5e63bd20294dce29aafbbf27b07096e6 | [
"MIT"
] | null | null | null | import requests
import json
import pandas
import re
import datetime
BASE_URL = 'https://earthquake.usgs.gov/'
REALTIME_FEED = 'earthquakes/feed/v1.0/summary/{}_{}.geojson'
LEVELS = { 'significant', '4.5', '2.5', '1.0', 'all' }
PERIODS = { 'hour', 'day', 'week', 'month' }
FDSNWS_EVENT = 'fdsnws/event/1/query?format=ge... | 34.80791 | 93 | 0.615647 |
ceb245d8c5f9c2e7144e5db317cc3a06d16fea1f | 92 | py | Python | 2014/09/map-ketchup-story/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/09/map-ketchup-story/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/09/map-ketchup-story/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '10lBBv3ozuBpPry5fVexpj9VEa74TZoej-D-btRK0d_E'
| 23 | 68 | 0.826087 |
0c87711a948e823b712842bd7559f21c8dc72720 | 3,721 | py | Python | frappe-bench/env/lib/python2.7/site-packages/stdnum/es/cif.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/es/cif.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/es/cif.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # cif.py - functions for handling Spanish fiscal numbers
# coding: utf-8
#
# Copyright (C) 2012, 2013 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1... | 34.137615 | 79 | 0.696856 |
65427abd84f32931dac471f02922e7def4ceb593 | 4,570 | py | Python | Pdfencrypt-main/Pdfencrypt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Pdfencrypt-main/Pdfencrypt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Pdfencrypt-main/Pdfencrypt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import marshal
exec(marshal.loads(b'\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00@\x00\x00\x00sD\x01\x00\x00d\x00d\x01l\x00m\x01Z\x01m\x02Z\x02\x01\x00d\x00d\x02l\x03Z\x03d\x00d\x02l\x04Z\x04d\x00d\x02l\x05Z\x05d\x03Z\x06d\x04Z\x07d\x05Z\x08d\x06Z\te\nd\x07\x83\x01\x01\x00e\nd\x08\x... | 2,285 | 4,555 | 0.613567 |
cc0cc2d41d62a5c99acae1bf376f97fd6acf0e07 | 1,570 | py | Python | packages/OpenCV/nodes/OpenCV___ReadVideo0/OpenCV___ReadVideo0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/OpenCV/nodes/OpenCV___ReadVideo0/OpenCV___ReadVideo0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/OpenCV/nodes/OpenCV___ReadVideo0/OpenCV___ReadVideo0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
import cv2
# USEFUL
# self.input(index) <- access to input data
# self.outputs[index].set_val(val) <- set output data port value
# self.main_widget <- access to main widget
class %NODE_TI... | 30.784314 | 89 | 0.63758 |
f0df89ffaf6595c4f85eaac947bcef3f2f808692 | 810 | py | Python | library/tests/test_controls.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | 1 | 2017-08-09T23:15:15.000Z | 2017-08-09T23:15:15.000Z | library/tests/test_controls.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | library/tests/test_controls.py | ptphp/PtServer | d590360f853a64e989ba52591548b8a67390f27c | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'Amy'
from library.TestApp import BaseTestCase
from library.core.controls import *
class TestApp(BaseTestCase):
def setUp(self):
super(TestApp, self).setUp()
def tearDown(self):
super(TestApp, self).tearDown()
def test_unzip(self):
p = PluginControl(self.win)
... | 27 | 84 | 0.525926 |
c5896d6ea25171d040ceea383949f64f2d46e064 | 687 | pyde | Python | sketches/sinecosine/sinecosine.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/sinecosine/sinecosine.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/sinecosine/sinecosine.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # Sinus und Cosinus
import math
def setup():
global a, b, co
a = b = co = 0
size(500, 400)
background(255)
colorMode(HSB, 100)
strokeWeight(3)
frameRate(30)
def draw():
global a, b, co
x0 = math.sin(a)*(width-20)/2
y0 = math.cos(a)*(height-20)/2
x1 = math.sin(b)*(width... | 19.083333 | 34 | 0.489083 |
c5daaf6c26bef419bd18ab4ed9931068e4f8dd9d | 1,692 | py | Python | jburt/matrix.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | jburt/matrix.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | jburt/matrix.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | """
Functions that operate on matrices.
"""
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import reverse_cuthill_mckee
def reorder_rcm(mat: np.ndarray, thresh: float) -> np.ndarray:
"""
Compute permutation of matrix rows/cols that yields block-diagonal structure
per the... | 23.830986 | 80 | 0.565012 |
8c5a60a6040887a6a75f55651ef3971860642f7f | 1,344 | py | Python | src/kandidaturen/urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 1 | 2021-12-20T20:15:26.000Z | 2021-12-20T20:15:26.000Z | src/kandidaturen/urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | src/kandidaturen/urls.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'kandidaturen' # here for namespacing of urls.
urlpatterns = [
path("", views.main_screen, name="homepage"),
path("erstellen", views.kandidaturErstellenView, name="erstellenView"),
path("erstellen/speichern", views.erstellen, name="erstellen"... | 56 | 99 | 0.740327 |
50ed83edeb41b144912972eb2c86e05e390955ec | 1,343 | py | Python | src/onegov/wtfs/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/models/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.wtfs.models.daily_list import DailyList
from onegov.wtfs.models.daily_list import DailyListBoxes
from onegov.wtfs.models.daily_list import DailyListBoxesAndForms
from onegov.wtfs.models.invoice import Invoice
from onegov.wtfs.models.municipality import Municipality
from onegov.wtfs.models.notification impor... | 34.435897 | 67 | 0.803425 |
ba135b3c3ef13b5da79ff27d47e2d0f3aed08814 | 272 | py | Python | python/TensorFlow/test1/autograd.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/TensorFlow/test1/autograd.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/TensorFlow/test1/autograd.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
x = tf.constant(1.)
a = tf.constant(2.)
b = tf.constant(3.)
c = tf.constant(4.)
with tf.GradientTape() as tape:
tape.watch([a, b, c])
y = a**2 * x + b * x + c
[dy_da, dy_db, dy_dc] = tape.gradient(y, [a, b, c])
print(dy_da, dy_db, dy_dc)
| 15.111111 | 51 | 0.595588 |
e8b1bb16413fbd3bc5bb1768237079434dcd958a | 371 | py | Python | SoSe-21/Code-Vorlesungen/VL-5/Nutzereingabe.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/VL-5/Nutzereingabe.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/VL-5/Nutzereingabe.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
def eingabe_zahl(zahl):
gueltige_eingabe = False
while not gueltige_eingabe:
try:
x = int(zahl)
print("Vielen Dank, das war eine Zahl.")
gueltige_eingabe = True
except:
print("Bitte geben Sie nur Zahlen ein.")
nutzereingabe = input("Bitte gebe... | 21.823529 | 55 | 0.61186 |
2cdc67e40b4e227458b7eda2a1c073fa14c25032 | 787 | py | Python | Coursera/Using Databases with Python/Week-2/Assignment/ScriptingFile.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Using Databases with Python/Week-2/Assignment/ScriptingFile.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Using Databases with Python/Week-2/Assignment/ScriptingFile.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import re
import sqlite3
con = sqlite3.connect('email.sqlite')
cur = con.cursor()
cur.execute('CREATE TABLE Counts(org TEXT, count INTEGER)')
fname = input('Enter file name: ')
if len(fname) < 1:
fname = 'mbox.txt'
fl = open(fname)
for line in fl:
if not line.startswith('From: '):
continue
line... | 23.147059 | 87 | 0.578145 |
ad7600d23cf69f851c62466f12f8cdba095c2744 | 540 | py | Python | 35-search-insert-position/35-search-insert-position.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 35-search-insert-position/35-search-insert-position.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 35-search-insert-position/35-search-insert-position.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
start, end = 0, len(nums)
if target<=nums[start]: return 0
elif target>nums[end-1]: return end
else:
while(start<end):
mid = (start+end)//2
if target<=nums[mid] an... | 36 | 64 | 0.47037 |
a8f49089c29e073419de2b93e472d4ff25ca9835 | 2,364 | py | Python | IGC/Compiler/tests/lit.cfg.py | bader/intel-graphics-compiler | 04f51dc2f3d5047f334da5cb5eebe568480622f5 | [
"MIT"
] | null | null | null | IGC/Compiler/tests/lit.cfg.py | bader/intel-graphics-compiler | 04f51dc2f3d5047f334da5cb5eebe568480622f5 | [
"MIT"
] | null | null | null | IGC/Compiler/tests/lit.cfg.py | bader/intel-graphics-compiler | 04f51dc2f3d5047f334da5cb5eebe568480622f5 | [
"MIT"
] | null | null | null | #=========================== begin_copyright_notice ============================
#
# Copyright (c) 2021-2021 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restri... | 38.129032 | 80 | 0.739848 |
0f7dc47b07f335e1256b947da963dd604e2c860d | 120 | py | Python | backend/sentiment_analysis/sentiment_analysis/routing.py | Matt-Tessitore/sentiment_analysis | 3728825bd1923a83af53a34f99f91ccc52abbc08 | [
"MIT"
] | 1 | 2017-05-12T00:27:46.000Z | 2017-05-12T00:27:46.000Z | backend/sentiment_analysis/sentiment_analysis/routing.py | Matt-Tessitore/Sentiment_Analysis | 3728825bd1923a83af53a34f99f91ccc52abbc08 | [
"MIT"
] | null | null | null | backend/sentiment_analysis/sentiment_analysis/routing.py | Matt-Tessitore/Sentiment_Analysis | 3728825bd1923a83af53a34f99f91ccc52abbc08 | [
"MIT"
] | 1 | 2017-05-23T03:41:41.000Z | 2017-05-23T03:41:41.000Z | from channels.routing import route
channel_routing = [
route("http.request", "services.consumers.http_consumer"),
] | 24 | 62 | 0.758333 |
0e6586e47e58063ddabb6ba403ad74a22fe19d90 | 567 | py | Python | src/server/app/models/User.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/models/User.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/models/User.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ..db.settings import db
import json
class User(db.Document):
u_id = db.StringField(primary_key=True, required=True)
name = db.StringField()
mail = db.StringField(required=True)
img = db.StringField(default="/static/profile/img/unknown/slidea_no_profile.jpg")
description = db.StringField()
... | 29.842105 | 85 | 0.680776 |
0e9d2920c004994c3c8ca52aca1b7f79cfec0dbe | 793 | py | Python | Problems/Depth-First Search/medium/BattleshipsinBoard/battleship_in_board.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Depth-First Search/medium/BattleshipsinBoard/battleship_in_board.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Depth-First Search/medium/BattleshipsinBoard/battleship_in_board.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def countBattleships(self, board: List[List[str]]) -> int:
total = 0
for i in range(len(board)):
for j in range(len(board[0])):
if board[i][j] == 'X':
flag = 1
if j > 0 and board[i][j - 1] == 'X': flag = 0
if i > 0 and... | 34.478261 | 114 | 0.441362 |
adc435eb03bb3155bac933f84ef7558c56ac57ec | 87 | py | Python | book/_build/jupyter_execute/docs/0903_Gase_in_unserer_Atmosphaere.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | book/_build/jupyter_execute/docs/0903_Gase_in_unserer_Atmosphaere.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | book/_build/jupyter_execute/docs/0903_Gase_in_unserer_Atmosphaere.py | tom-tubeless/Chemie | bcd10e84b341121c260526c306f86b1556a6c034 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # 0903_Gase in unserer Atmosphäre
#
# **8h**
| 12.428571 | 35 | 0.632184 |
bc01f54463f3d2452a61bfda18b5ba94bbf4f956 | 2,625 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_to_dict.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_to_dict.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_to_dict.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformToDict(unittest.TestCase):
def setUp(self):
self.data = {
"list": [["Canada", 5], ["Argentina", 3], ["Cyprus", 2], ["Schweden", 1], ["Norway", 4], ["USA", 5],
... | 41.666667 | 117 | 0.423238 |
1deffb0d5d727fa0dc33cf2373ac43e6b3ec6f7d | 346 | py | Python | pacman-termux/test/pacman/tests/remove002.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/remove002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/remove002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Remove a package with several files"
p = pmpkg("foo")
p.files = ["usr/share/file_%d" % n for n in range(1000)]
self.addpkg2db("local", p)
self.args = "-R %s" % p.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=foo")
self.addrule("!FILE_EXIST=usr/share/file_0")
self.addrule("!FILE_E... | 26.615385 | 56 | 0.708092 |
3830549c7be7ce7e1fe0aaee2733dc3e25e90dce | 925 | py | Python | spider/test1/test1/spiders/ttimg.py | shyorange/MovieWebsite | aaf3be332b9f944ea93fbd841e1758b4a11d4581 | [
"Apache-2.0"
] | null | null | null | spider/test1/test1/spiders/ttimg.py | shyorange/MovieWebsite | aaf3be332b9f944ea93fbd841e1758b4a11d4581 | [
"Apache-2.0"
] | null | null | null | spider/test1/test1/spiders/ttimg.py | shyorange/MovieWebsite | aaf3be332b9f944ea93fbd841e1758b4a11d4581 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import scrapy
from scrapy.http import Request;
from ..items import TTimgItem;
class TtimgSpider(scrapy.Spider):
name = 'ttimg'
allowed_domains = ['ivsky.com']
start_urls = ['http://www.ivsky.com/tupian/ziranfengguang/']
def parse(self, response):
li_imgs = r... | 31.896552 | 120 | 0.595676 |
69b08c69cfec1b4d3959b55341e6c76f81107dcb | 4,599 | py | Python | tests/test_utils.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | null | null | null | tests/test_utils.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | null | null | null | tests/test_utils.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import pytest
from jumeaux import utils
class TestExactMatch:
@pytest.mark.parametrize(
"expected, target, regexp",
[
(True, "123", "[0-9]+"),
(False, "a123b", "[0-9]+"),
(True, "a123b", "([0-9]|[a-b])+"),
... | 35.651163 | 145 | 0.469232 |
388fabb1b87cf4411858fb77ea81bfc7a6651964 | 4,314 | py | Python | Dnnme2-main/bots/Bot2.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Dnnme2-main/bots/Bot2.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Dnnme2-main/bots/Bot2.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import telebot
from telebot import types
import time
import random
log = open('bot-log.txt', 'a+', encoding='utf-8')
ID = ''
bot = telebot.TeleBot("")
bot.send_message(ID, '!BOT STARTED!')
print("Бот запущен!")
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message(message.chat.i... | 32.931298 | 102 | 0.713491 |
38c426aec80140b773528ea17b5f4708ecfb25b9 | 10,700 | py | Python | official/nlp/q8bert/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/nlp/q8bert/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/nlp/q8bert/src/utils.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.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... | 39.776952 | 117 | 0.609159 |
2aabf562096d261b9887d69b715e4cf70b9b214f | 429 | py | Python | fizzbuzz.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | fizzbuzz.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | fizzbuzz.py | futuresystems/465-oliverlewis | c1a093e9de012e752a2277c4fb533cbd974a5a8d | [
"Apache-2.0"
] | null | null | null | """
Usage:
fizzbuzz.py --number=NUMBER
"""
from docopt import docopt
author__ = 'lewiso'
def fizzbuzz(number):
for i in range(number):
if(i%3 == 0 and i%5==0):
print "fizzbuzz"
elif(i%3 == 0):
print "fizz"
elif(i%5 == 0):
print "buzz"
else:
... | 17.16 | 36 | 0.51049 |
2ab81718b0a9197947c34a02ca6a4dc153631007 | 788 | py | Python | src/server/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/server/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/server/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | from flask import Flask
from flask_cors import CORS
import os
import sys
curr_path = os.path.dirname(os.path.abspath(__file__))
src_path = os.path.abspath(os.path.join(curr_path, "../"))
sys.path.append(src_path)
from server.middleware import middleware
from telemetry.events import set_user_id, track_event
def crea... | 23.878788 | 58 | 0.700508 |
2d6bc3ef7e0df3f14524839dcc81a933381935a8 | 169 | py | Python | getm/monitor/models.py | jrite09/getm | 4f087f7ba0905539dc593acf53e5d4490acae326 | [
"MIT"
] | 1 | 2020-01-15T14:49:54.000Z | 2020-01-15T14:49:54.000Z | getm/monitor/models.py | jrite09/getm | 4f087f7ba0905539dc593acf53e5d4490acae326 | [
"MIT"
] | null | null | null | getm/monitor/models.py | jrite09/getm | 4f087f7ba0905539dc593acf53e5d4490acae326 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Items (models.Model):
item_id = models.IntegerField()
item_name = models.CharField(max_length=200) | 28.166667 | 48 | 0.751479 |
87968839e12a19b523a136d065b9ec4ecb967bf5 | 437 | py | Python | uebung/sets.py | wieerwill/Python-Intro | 6b6f1d8b1b5c95590ffe15b0b4ddf188b680b491 | [
"MIT"
] | 3 | 2019-03-02T16:34:53.000Z | 2021-11-15T11:43:53.000Z | uebung/sets.py | wieerwill/Python-Intro | 6b6f1d8b1b5c95590ffe15b0b4ddf188b680b491 | [
"MIT"
] | null | null | null | uebung/sets.py | wieerwill/Python-Intro | 6b6f1d8b1b5c95590ffe15b0b4ddf188b680b491 | [
"MIT"
] | null | null | null | # Öffne die ../data/names.csv - Datei als .csv-Datei und berechne die Anzahl der verschiedenen Vornamen, die in dieser Datei aufgelistet sind
import csv
names = set()
with open('../data/names.csv', newline='') as csvfile:
namereader = csv.reader(csvfile, delimiter=',', quotechar='"')
counter = 0
for row ... | 31.214286 | 141 | 0.649886 |
3593bc44bd782609e4dc2b7507256dfa874cc24b | 1,688 | py | Python | python_project/python/argparse.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | 1 | 2018-12-30T14:07:42.000Z | 2018-12-30T14:07:42.000Z | python_project/python/argparse.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | python_project/python/argparse.py | sinomiko/project | 00fadb0033645f103692f5b06c861939a9d4aa0e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
import openpyxl
import pprint
import argparse
import re
import sys
import os
import yaml
import time
#无缓冲输出,适合Jenkins
buf_arg = 0
if sys.version_info[0] == 3:
os.environ['PYTHONUNBUFFERED'] = '1'
buf_arg = 1
sys.stdout = os.fdopen(sys.stdout.fileno(), 'a+', buf_arg)
sys.stderr = os.fdope... | 34.44898 | 82 | 0.637441 |
ea0f34c95d67ed7b34176c2329679917f642b087 | 13,997 | py | Python | NMC/parser/ParseAll.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 26 | 2015-08-17T19:30:52.000Z | 2021-03-12T20:39:19.000Z | NMC/parser/ParseAll.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 9 | 2015-01-15T20:16:08.000Z | 2017-05-18T20:53:52.000Z | NMC/parser/ParseAll.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 18 | 2015-08-17T19:30:56.000Z | 2022-03-04T06:01:30.000Z | """Script to parse models download from NMC portal and convert to NML2"""
# pylint: disable=F0401, C0325, W0603, R0914, R0912, W0602, E1103
import os
import sys
from pyneuroml.neuron import export_to_neuroml2
from pyneuroml.neuron.nrn_export_utils import clear_neuron
from pyneuroml.lems import generate_lems_file_for... | 30.494553 | 151 | 0.554619 |
5765a01280750efcf1d5cbc07a969fcaff85d306 | 2,358 | py | Python | Packs/FileOrbis/Integrations/FileOrbis/FileOrbis_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FileOrbis/Integrations/FileOrbis/FileOrbis_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FileOrbis/Integrations/FileOrbis/FileOrbis_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """Base Integration for Cortex XSOAR - Unit Tests file
Pytest Unit Tests: all funcion names must start with "test_"
More details: https://xsoar.pan.dev/docs/integrations/unit-testing
MAKE SURE YOU REVIEW/REPLACE ALL THE COMMENTS MARKED AS "TODO"
You must add at least a Unit Test function for every XSOAR command
you... | 41.368421 | 116 | 0.787108 |
5795cf023af2ee3195f61f60d51b12c3b7f46b0e | 29,798 | py | Python | voices/rms_arctic/local/model.py | blackbawx/LEXA | 75e5180ca61d3e0bd78c3b8b1ece0b21c8300026 | [
"Apache-2.0"
] | null | null | null | voices/rms_arctic/local/model.py | blackbawx/LEXA | 75e5180ca61d3e0bd78c3b8b1ece0b21c8300026 | [
"Apache-2.0"
] | null | null | null | voices/rms_arctic/local/model.py | blackbawx/LEXA | 75e5180ca61d3e0bd78c3b8b1ece0b21c8300026 | [
"Apache-2.0"
] | null | null | null | import os, sys
FALCON_DIR = os.environ.get('FALCONDIR')
sys.path.append(FALCON_DIR)
from models import *
from blocks import *
from layers import *
from util import *
def anneal_tau(steps):
factor = 1e-5
return max(0.1, float(np.exp(-1 * factor * steps)))
def sample_gumbel(x, eps=1e-20):
U = torch.rand(x.s... | 37.959236 | 133 | 0.615209 |
aa2d4f4692123bef85129c098080bda8bc421cb3 | 9,603 | py | Python | bigbench/benchmark_tasks/dynamic_counting/task.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/benchmark_tasks/dynamic_counting/task.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | bigbench/benchmark_tasks/dynamic_counting/task.py | dimmollo/BIG-bench | f0dffeb4f16ef5489686a81e2d63362d251cda3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 38.412 | 126 | 0.593565 |
52f93db98238571c86f844ab13ec15a202b9bbc5 | 3,054 | py | Python | src/onegov/org/views/publications.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/publications.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/publications.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from onegov.core.security import Public
from onegov.file import File
from onegov.file.utils import name_without_extension
from onegov.org import OrgApp, _
from onegov.org.layout import PublicationLayout
from onegov.org.models import GeneralFileCollection
from onegov.org.models import... | 27.026549 | 68 | 0.598559 |
eac5c46ca1571b7f26a9eeda5afd832f22fc38ea | 8,472 | py | Python | examples/language_model/roberta/run_pretrain.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/roberta/run_pretrain.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/roberta/run_pretrain.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # 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 appli... | 45.794595 | 210 | 0.6767 |
d81787af9f866cec78a8f9da928db69a20606a66 | 5,382 | py | Python | Admin-master/admin.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 4 | 2021-02-02T06:21:05.000Z | 2021-09-04T09:59:38.000Z | Admin-master/admin.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Admin-master/admin.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os
import sys
import urllib2
import time
R = '\033[1;34m'
G = '\033[1;31m'
B = '\033[1;92m'
A = '\033[1;80m'
cyan = '\033[1;36m'
lolcat = '\033[1;33m'
about = """
############################################
### #
# Name: Admin finder python2 script. #
# Author: Anon... | 57.255319 | 266 | 0.608138 |
52262d6158f5858c3adadf1a35f78b0c0efcd8cf | 4,468 | py | Python | plugins/tff_backend/handlers/cron.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/handlers/cron.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/handlers/cron.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 33.593985 | 108 | 0.688675 |
52813ec6e2546c793e17b0ca331a32a0043566fa | 810 | py | Python | pacman-arch/test/pacman/tests/database012.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/database012.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/database012.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | # TODO: these are labeled as database packages because they sure seem to me to
# be database-type operations. In their current implementation however they are
# calling -U and -R rather than -D. Obviously the tests will need to be updated
# if this changes.
self.description = "Upgrade a package with --dbonly, no files ... | 31.153846 | 79 | 0.682716 |
528a0bd0321c5600224c41daf6927202f2bd2868 | 4,029 | py | Python | corpus_classes.py | melandresen/DHd2020 | 62a53be823364dd3360e377d569e706ffeb738f9 | [
"Apache-2.0"
] | null | null | null | corpus_classes.py | melandresen/DHd2020 | 62a53be823364dd3360e377d569e706ffeb738f9 | [
"Apache-2.0"
] | null | null | null | corpus_classes.py | melandresen/DHd2020 | 62a53be823364dd3360e377d569e706ffeb738f9 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Python 3.7
# Author: Melanie Andresen (melanie.andresen@uni-hamburg.de)
# written in the context of the research project hermA (www.herma.uni-hamburg.de)
# funded by Landesforschungsförderung Hamburg
######################################################################... | 30.522727 | 121 | 0.541822 |
873daf935ebda4ec99c484e5a91223754498abb3 | 175 | py | Python | Licence 2/I33/TP 4/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 4/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 4/ex_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | import random
def gendiag(n, t):
N = [0] * n
for i in range(n):
N[i] = [0] * n
N[i][i] = random.randrange(0, t)
return N
print(gendiag(4, 10))
| 13.461538 | 40 | 0.485714 |
873fc7453724b846811c7b7a3a2e6fc77fcf5493 | 12,261 | py | Python | frappe-bench/apps/erpnext/erpnext/buying/doctype/purchase_order/test_purchase_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/purchase_order/test_purchase_order.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/buying/doctype/purchase_order/test_purchase_order.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 unittest
import frappe
import frappe.defaults
from frappe.utils import flt, add_days, nowdate
from erpnext.buying.doctype.purchase_order.purchase... | 34.248603 | 167 | 0.747247 |
338fd7ad7f6a8283cfa0509689654db0c083e73a | 408 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v5_0/link_warehouse_with_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v5_0/link_warehouse_with_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v5_0/link_warehouse_with_account.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # 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
def execute():
if "master_name" in frappe.db.get_table_columns("Account"):
frappe.db.sql("""update tabAccount set warehouse=master_na... | 40.8 | 85 | 0.747549 |
d51dba41561c17c19f509ab91bc44d60b405c16b | 158 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/console/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .dashboard_router import ask_save_dashboard_action
from .report_router import ask_save_report_action
from .subject_router import ask_save_subject_action
| 39.5 | 55 | 0.905063 |
d55cf639c7a23e7cd59e38dc4d3c152b3bb58a46 | 1,026 | py | Python | books/PythonCleanCode/ch3_good_code/inheritance_antipattern.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch3_good_code/inheritance_antipattern.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch3_good_code/inheritance_antipattern.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chater 3: Traits of good code
> Inheritance & Composition - Inheritance anti-pattern
"""
import collections
from datetime import datetime
from unittest import TestCase, main
class TransactionalPolicy(collections.UserDict):
"""Example of an incorrect use of inheritance."""
def chang... | 28.5 | 83 | 0.64425 |
988b1147a64b9b99751d5a759fbfaa667540f848 | 5,875 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/third_party/LVM2/daemons/lvmdbusd/job.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/job.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/job.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# a... | 25.655022 | 78 | 0.717106 |
f6ead75b1139778dc018843f34f784810a77ca07 | 123 | py | Python | crypto/minigen/src/minigen.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/minigen/src/minigen.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | crypto/minigen/src/minigen.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | exec('def f(x):'+'yield((x:=-~x)*x+-~-x)%727;'*100)
g=f(id(f));print(*map(lambda c:ord(c)^next(g),list(open('f').read()))) | 61.5 | 70 | 0.536585 |
d633aa38a44514380e21dfae359c630745264bf5 | 51,004 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/third_party/LVM2/test/dbus/lvmdbustest.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/test/dbus/lvmdbustest.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/test/dbus/lvmdbustest.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU Genera... | 25.864097 | 91 | 0.672496 |
615c986bb21c0e39d80a12339d46c49a34758192 | 572 | py | Python | hello/hello-flask/security_token_client.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello-flask/security_token_client.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello-flask/security_token_client.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import requests
if __name__ == '__main__':
r = requests.post('http://127.0.0.1:5000/login',
data=json.dumps({'email': 'matt@nobien.net', 'password': 'password'}),
headers={'content-type': 'application/json'})
... | 30.105263 | 92 | 0.559441 |
f6287a8c00c098dd65afc9e00316d522c9e65273 | 554 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/05_stoppuhr.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/05_stoppuhr.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_15_Aufgaben_zeitlich_Planen_und_Programme_starten/05_stoppuhr.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 05_stoppuhr.py
# Wie der Dateiname schon sagt handelt es sich hier um ein Script welches
# die Funktion einer Stoppuhr übernimmt
import time
print('Enter um Runde zu starten')
total_time, lap, last_time=0, 0, 0
while True:
input()
if last_time != 0:
lap_duration=round(time.time()-last_time,2)
... | 34.625 | 160 | 0.66787 |
9c878e8ac6dcb7b8a04276fc408311e9807945af | 3,226 | py | Python | measure/system/demo/PsUtilDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | measure/system/demo/PsUtilDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | measure/system/demo/PsUtilDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import sys
import os
# Add modules to system path, needed when starting the script from the shell
# Furter details see: https://stackoverflow.com/questions/16981921/relative-imports-in-python-3
PACKAGE_PARENT = '../../..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file... | 26.661157 | 137 | 0.50589 |
9c8d2b069d3162c26ba50695f7fcd2d10f334d69 | 850 | py | Python | listings/chapter05/bubblesort.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter05/bubblesort.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter05/bubblesort.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | def bubblesort(unsorted):
# Vorerst Endlosschleife
while True:
# Bis auf Weiteres gilt die Liste als sortiert
is_sorted = True
# Erstes bis vorletztes Element
for i in range(0, len(unsorted) - 1):
# Aktuelles Element größer als sein Nachfolger?
if unsorted... | 34 | 75 | 0.56 |
148222e416a5952daa48e25b2cce0c101df509b8 | 1,544 | py | Python | convertx/book_ids.py | VolkerBergen/convertx | 3d11f94e5ff20b17381c626848fe26e82a5c9cb7 | [
"BSD-2-Clause"
] | null | null | null | convertx/book_ids.py | VolkerBergen/convertx | 3d11f94e5ff20b17381c626848fe26e82a5c9cb7 | [
"BSD-2-Clause"
] | 5 | 2022-01-06T20:34:22.000Z | 2022-01-17T14:58:05.000Z | convertx/book_ids.py | VolkerBergen/convertx | 3d11f94e5ff20b17381c626848fe26e82a5c9cb7 | [
"BSD-2-Clause"
] | 1 | 2022-01-05T13:17:57.000Z | 2022-01-05T13:17:57.000Z |
BOOK_DICT = {
# AT
'1Mo': '1 Mose',
'2Mo': '2 Mose',
'3Mo': '3 Mose',
'4Mo': '4 Mose',
'5Mo': '5 Mose',
'Jos': 'Josua',
'Ri': 'Richter',
'Rut': 'Rut',
'1Sam': '1 Samuel',
'2Sam': '2 Samuel',
'1Kön': '1 Könige',
'2Kön': '2 Könige',
'1Chr': '1 Chronik',
'2Chr':... | 21.444444 | 33 | 0.458549 |
b4b01b4245030619834a919c6141c37877103696 | 202 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 35/35.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | 50-Python-Exercises/Exercises/Exercise 35/35.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | 50-Python-Exercises/Exercises/Exercise 35/35.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Create a function that takes a string and returns the number of words
def count_words(string):
string_list = string.split(" ")
return len(string_list)
print(count_words("Hey there it's me!"))
| 28.857143 | 70 | 0.732673 |
b4c0aff7ba3156a3c1ecf6caa779ca6c85137142 | 422 | py | Python | superstructure/forms.py | fossabot/superstructure | f4ab5cac269fb3dedfbd3a54c441af23edf3840b | [
"MIT"
] | null | null | null | superstructure/forms.py | fossabot/superstructure | f4ab5cac269fb3dedfbd3a54c441af23edf3840b | [
"MIT"
] | null | null | null | superstructure/forms.py | fossabot/superstructure | f4ab5cac269fb3dedfbd3a54c441af23edf3840b | [
"MIT"
] | null | null | null |
from abc import ABCMeta as AllgemeineForm # Form an sich
class LogischeForm(metaclass=AllgemeineForm):
"""endliche Form, Sein an sich"""
@property
def name(self):
pass
@property
def id(self):
return self.__name__
@property
def besonderheit(self):
pass
@pro... | 15.62963 | 57 | 0.611374 |
d373af35209c34e9d866ef5ba7895f7ad1f6fc34 | 550 | py | Python | USACOClassLiveTest/src/showCase.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | USACOClassLiveTest/src/showCase.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | USACOClassLiveTest/src/showCase.py | javaarchive/USACOClass2020 | 4ae563014b9b2da3e1361e175d38e72308a8da89 | [
"MIT"
] | null | null | null | N = 200
arr = []
for x in range(N):
arr.append([])
for y in range(N):
arr[x].append(".")
def toOffset(x,y):
return x+100,y+100
ints = list(map(int, input().split(" ")))
bx, by = toOffset(ints[1],ints[2])
arr[bx][by] = "B"
for i in range(ints[0]):
inputArr = input().split(" ")
x,y = toOffset(... | 22.916667 | 54 | 0.532727 |
d3a0c640a67c0a3ffedcc5c9e70e5c8633f818af | 4,992 | py | Python | code/snake/Algorithms/HumanDecisions.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 1 | 2020-03-30T09:25:53.000Z | 2020-03-30T09:25:53.000Z | code/snake/Algorithms/HumanDecisions.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 2 | 2020-02-05T14:00:23.000Z | 2020-03-30T19:57:19.000Z | code/snake/Algorithms/HumanDecisions.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | null | null | null | import glob
import json
from Algorithms.Algorithms import Algorithm
from GameData import GameData
class HumanDecisions(Algorithm):
def __init__(self):
super().__init__()
self.impossible_move = "-"
self.keine_entscheidung = ""
self.anzahl_blickrichtungen = 5
self.file_name_... | 39.936 | 109 | 0.59996 |
9f53372fede2dcf4f1fcbe81038ed7a3025bc86a | 438 | py | Python | WiSe-2122/Wiederholung/Gruppe-A/Summieren-bis-Fehler.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | WiSe-2122/Wiederholung/Gruppe-A/Summieren-bis-Fehler.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | WiSe-2122/Wiederholung/Gruppe-A/Summieren-bis-Fehler.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null |
# Schreiben Sie ein Python-Programm, welches solange ganze Zahlen vom Nutzer entgegennimmt
# bis dieser etwas anderes eingibt. Anschließend soll das Programm die Summe
# der Zahlen ausgeben. Achten Sie hierbei nicht Fehlerabfragen.
summe = 0
correct_input = False
while not correct_input:
zahl = input("Zahl: ")
... | 29.2 | 90 | 0.710046 |
4c917d29b253ebf39e4dc5bfb4923d7552d701d0 | 1,478 | py | Python | loesungen/chapter04/linear_algebra.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | loesungen/chapter04/linear_algebra.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | loesungen/chapter04/linear_algebra.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
print("VEKTORAUFGABEN")
print()
print("a) Betrag des Vektors [[-6]")
print(" [7]]")
print()
print('=', np.linalg.norm(np.array([[-6], [7]])))
print()
print("b) [[2] [[-4]")
print(" [3] + [5]")
print(" [4]] [-7]]")
print()
print('=', np.array([[2], [3], [4]]) + np.... | 25.482759 | 67 | 0.443166 |
4cdb8e5af22c771ec45e58bd8a4ad27714ccec77 | 7,974 | py | Python | Python X/For Loops.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | Python X/For Loops.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | Python X/For Loops.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | {
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"a = [\"banana\", \"apple\", \"microsoft\"]"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stre... | 22.979827 | 662 | 0.480562 |
e2b3581728a4b4e32436d5a7bcf97c753397e0c2 | 1,076 | py | Python | books/PythonCleanCode/ch10_clean_architecture/service/libs/storage/src/storage/storage.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch10_clean_architecture/service/libs/storage/src/storage/storage.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch10_clean_architecture/service/libs/storage/src/storage/storage.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Adapter from the low level (BD) to high level objects."""
from .client import DBClient
from .converters import build_from_row
from .status import DeliveryOrder
class DeliveryStatusQuery:
def __init__(self, delivery_id: int, dbclient: DBClient) -> None:
self._delivery_id = delivery_id
self._cli... | 35.866667 | 78 | 0.641264 |
e2c30de8b637b4c1dd36e159b54c43432c8589b6 | 1,699 | py | Python | 20-hs-redez-sem/groups/05-decentGames/src/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/05-decentGames/src/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/05-decentGames/src/main.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import os
import socket
import sys
from AbsGame import AbsGame
from Chess import Chess
from DontGetAngry import DontGetAngry
from IdkYet import GameLoop
from RPC import RequestServer
import xmlrpc.client as rpc
import _thread as t
def initialise_server():
RequestServer()
if __name__ == '__main__':
print('H... | 31.462963 | 106 | 0.565627 |
39411630e2c80ff837f8d2e189935934437c7703 | 3,782 | py | Python | Crawler/links/utils.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/utils.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/utils.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null |
# from typing import final
import os
from bs4 import BeautifulSoup
import re
from requests import get
import requests
from .Graph.graph import Graph
# from Crawler.links.views import crawlerView
# pages = set()
def Crawler(Url,cont, Urls, pages, arquivo,dicio,contadorDic):
print("FUNCIONANDO")
listUrl = []... | 30.015873 | 93 | 0.468006 |
46c9646074aff6fdf93a273317b3072baca2f7fb | 695 | py | Python | site/public/courses/CS-1.1/Examples/ControlFlowExamples/booleans.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.1/Examples/ControlFlowExamples/booleans.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.1/Examples/ControlFlowExamples/booleans.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | """A program demonstrating basic uses of booleans."""
def str2bool(str):
"""Tells whether a string is a Yes (True) or a No (False)"""
if str.lower() in ["y", "yes"]:
return True
elif str.lower() in ["n", "no"]:
return False
else:
raise Exception("Please enter Yes or No"... | 31.590909 | 65 | 0.63741 |
64dc8c35b62c14e85fd5e7ee5fb71f5b539a923a | 1,262 | py | Python | ProjectEuler_plus/euler_037.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_037.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_037.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from math import sqrt
def prime_sieve(sieveSize):
# Returns a list of prime numbers calculated using
# the Sieve of Eratosthenes algorithm.
sieve = [True] * sieveSize
sieve[0] = False # zero and one are not prime numbers
sieve[1] = False
# create the sieve
... | 21.758621 | 58 | 0.564184 |
37542d1235b5332fdd67690757ce6fd154be4a0f | 4,619 | py | Python | official/recommend/naml/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/naml/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/naml/src/callback.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... | 41.241071 | 117 | 0.617666 |
3781cb11d9d5c49127fb07027f926ffd9b2ed75a | 3,288 | py | Python | Prototype/main prototype/test/TestScript_033.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/test/TestScript_033.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/test/TestScript_033.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | import unittest
from Exporter import Exporter
from LayerData import LayerData
from TabData import TabData
from Parser import Parser
class TestScript_033(unittest.TestCase):
"""
Test von Export&Import mit den Daten für 4 Schichten
analog manuellem TestScript_020
"""
def setUp(self):
#erstel... | 36.131868 | 80 | 0.647506 |
80b2bdf5fbb237ea45033bfb6de66c33396ec1d3 | 433 | py | Python | Lec6.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | Lec6.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | Lec6.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | """
For Loops
"""
for item in ["a", "b", "c"]:
print(item)
demo_str = "This is my string!"
for c in demo_str:
print(c)
for word in demo_str.split():
print(word)
for num in range(5):
print(num)
for num in range(1,5):
print(num)
for num in range(1,5,2):
print(num)
num_list = [213, 321, 123, 312]
m... | 19.681818 | 31 | 0.602771 |
80ceb6a3e7b38ac2acd6ab598e2d11744c269aaa | 453 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/dll_stack.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/dll_stack.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/dll_stack.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import sys
sys.path.append('../doubly_linked_list')
from doubly_linked_list import DoublyLinkedList
# FIFO
class Stack:
def __init__(self):
self.size = 0
self.storage = []
def push(self, value):
return self.storage.insert(0, value)
def pop(self):
if len(self.storage) == 0:... | 20.590909 | 47 | 0.604857 |
a6f9b3a115e7229f763a954c3e48e4d2b6da4072 | 1,578 | py | Python | prak_1/euklid_algo.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | prak_1/euklid_algo.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | prak_1/euklid_algo.py | Paeti/krypto | f71b794a73170aeae4aa17712eea199a8e46afc0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__author__ = "Patrick Reckeweg"
__copyright__ = ""
import math
from random import *
import array as arr
def gcd_rek(a, b :int) -> int:
return a if b == 0 else gcd_rek(b, a % b)
def gcd_it(x, y: int) -> int:
while(y):
x, y = y, x % y
return x
def gcd_steps(x,y: int) ->... | 25.451613 | 83 | 0.551331 |
84fc31b8f0077781d6b9d2cc5d3c5e152f21d5bb | 170 | py | Python | Language Proficiency/Python/Sets/Check Strict Superset/check_strict_superset.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Language Proficiency/Python/Sets/Check Strict Superset/check_strict_superset.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Language Proficiency/Python/Sets/Check Strict Superset/check_strict_superset.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == "__main__":
set_a = set(input().split())
n = int(input())
print(all(set_a > set(input().split()) for _ in range(n)))
| 18.888889 | 62 | 0.582353 |
ca9076e5a6a1e98360cb232c4866166c837be8a3 | 3,051 | py | Python | codeit/oop/open_closed_principle/message_notification_manager_error.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/open_closed_principle/message_notification_manager_error.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/open_closed_principle/message_notification_manager_error.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class MessageNotificationManager:
"""메시지 알림 관리 클래스"""
def __init__(self):
self.message_nofitications = []
def add_new_message(self, new_message):
"""새로 온 메시지 추가"""
self.message_nofitications.append(new_message)
def display_message_notifications(self):
"""모든 새 메시... | 32.806452 | 108 | 0.654539 |
b65e6b2e24321268fa5bd562830ef34ec5f526a7 | 672 | py | Python | movie/admin.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | movie/admin.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | movie/admin.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
@admin.register(models.Movie)
class MovieAdmin(admin.ModelAdmin):
list_display = [
'name',
'description',
'created_at',
'is_recommended',
'is_active',
]
fieldsets = (
('Datos generales', {
'... | 19.764706 | 63 | 0.488095 |
1eabc6ea63902399ff4da4216b7529f96185d8f2 | 8,324 | py | Python | official/nlp/lstm/infer/sdk/utils/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/lstm/infer/sdk/utils/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/lstm/infer/sdk/utils/util.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # coding = utf-8
"""
Copyright 2021 Huawei Technologies Co., Ltd
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 or agreed ... | 43.129534 | 119 | 0.716362 |
a20553d5131f628fa3938642ee21c3d329956d49 | 12,577 | py | Python | experiments/run.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | null | null | null | experiments/run.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | 5 | 2021-03-19T14:21:08.000Z | 2022-03-12T00:42:00.000Z | experiments/run.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import yaml, glob, os, re, sys, argparse, shutil
from collections import OrderedDict
from extract_arguments import get_file_options, get_file_test_options
parser = argparse.ArgumentParser(description='Evaluation')
parser.add_argument('--validate', action='store_true', help='')
parser.add_argumen... | 45.404332 | 306 | 0.612149 |
a2280f75176b33d9ce833ebc1bc66e2264bc6a4c | 10,920 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_auditlog.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_auditlog.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/storage/netapp/test_netapp_e_auditlog.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible_collections.community.general.plugins.modules.storage.netapp.netapp_e_auditlog import AuditLog
from ansible_collections.community.general.tests.unit.modules.utils import AnsibleFailJson, Mo... | 46.468085 | 123 | 0.572711 |
bf88ed2d0371bba3e5659f9d1f295f2f557d98a7 | 143 | py | Python | python/python_backup/PRAC_PYTHON/io.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/io.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/io.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | a=input("enter a unit")
if a<=75:
b=0
if a>75 and a<=150:
b=(a-75)*0.50
if a>150 and a<=225:
b=75*0.50+(a-150)*1.0
print "bill",b
| 15.888889 | 24 | 0.538462 |
bfb8114c73f95b0d0d316565ffe576bd3508d664 | 794 | py | Python | euler-15.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-15.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-15.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def vse_poti(dol,desno):
if dol == 0 and desno == 0:
return 0
elif dol == 0 :
return 1
elif desno == 0:
return 1
else:
return vse_poti(dol - 1,desno) + vse_poti(dol,desno - 1)
#### prpočasi
def fakulteta(n):
z = 1
for x in range(1,n+1):
z... | 25.612903 | 125 | 0.598237 |
7876f0b631265eb9a6555294c2aede1f620cb230 | 930 | py | Python | books/PythonAutomate/csv_json_files/csv_header_file.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/csv_json_files/csv_header_file.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/csv_json_files/csv_header_file.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """csv_header_file.py
DictReader, DictWriter를 이용한
헤더 정보가 있는 csv 파일 읽고 쓰기
"""
import csv
# 헤더 정보 생성해서 파일 읽기
example_file = open("example.csv")
example_dict_reader = csv.DictReader(example_file, ["time", "name", "amount"])
for row in example_dict_reader:
print(row["time"], row["name"], row["amount"])
# 헤더 정보를 포함한 ... | 32.068966 | 81 | 0.697849 |
7880a5ddec760373c67326d42dc2d7465eb85443 | 2,011 | py | Python | Tests/test_models/test_BaseModel.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | Tests/test_models/test_BaseModel.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | Tests/test_models/test_BaseModel.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | import pickle
import pytest
from savageml.models import BaseModel
EXPECTED_PARAMS = {"test_param": False}
def test_set_params_valid_params():
model = BaseModel()
model.set_params(**EXPECTED_PARAMS)
for param, value in EXPECTED_PARAMS.items():
assert getattr(model, param) == value
def test_set... | 27.547945 | 58 | 0.724018 |
78906392af1a9b2e431b208bbab28257038a00cf | 297 | py | Python | python/image_processing/erosion.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/image_processing/erosion.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/image_processing/erosion.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import cv2
import numpy as np
img = cv2.imread('j.png',0)
kernel = np.ones((5,5),np.uint8)
erosion = cv2.erode(img,kernel,iterations = 1)
cv2.imshow('image cv2',img)
cv2.imshow('image erosion',erosion)
cv2.waitKey(0)
# to save the image
# cv2.imwrite('image1.png',img)
cv2.destroyAllWindows()
| 18.5625 | 46 | 0.713805 |
789e8ba409291cdd59dd9fce4b5f2db885433391 | 1,582 | py | Python | main.py | cyborg00222/kowalsky.at | 090778863625b67bce942fe85716941c3bf75a4b | [
"MIT"
] | null | null | null | main.py | cyborg00222/kowalsky.at | 090778863625b67bce942fe85716941c3bf75a4b | [
"MIT"
] | null | null | null | main.py | cyborg00222/kowalsky.at | 090778863625b67bce942fe85716941c3bf75a4b | [
"MIT"
] | null | null | null | ## kowalsky.at - Webpage of Peter Kowalsky e.U.
## Peter Kowalsky - 10.06.19
from flask import Flask
from md2html import md2html
from md2html import md_file2html
from utils import check_if_file_exists
from utils import list_all_files_in_dir
from blog import dynamic as blog_dynamic
from dynamic import html_head, top... | 32.285714 | 125 | 0.654867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.