index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
1,025 | Tadaboody/good_smell | refs/heads/master | /good_smell/smells/filter.py | from typing import TypeVar
import ast
from typing import cast
from good_smell import AstSmell, LoggingTransformer
class NameReplacer(ast.NodeTransformer):
def __init__(self, old: ast.Name, new: ast.AST):
self.old = old
self.new = new
def visit_Name(self, node: ast.Name) -> ast.AST:
i... | {"/good_smell/__init__.py": ["/good_smell/smell_warning.py", "/good_smell/lint_smell.py", "/good_smell/ast_smell.py", "/good_smell/smells/__init__.py", "/good_smell/main.py", "/good_smell/flake8_ext.py"], "/good_smell/smells/range_len_fix.py": ["/good_smell/__init__.py"], "/docs/generate_smell_doc.py": ["/tests/test_co... |
1,026 | Tadaboody/good_smell | refs/heads/master | /good_smell/flake8_ext.py | import ast
from typing import Generator, Tuple
from good_smell import SmellWarning, implemented_smells, __version__
class LintingFlake8:
"""Entry point good smell to be used as a flake8 linting plugin"""
name = "good-smell"
version = __version__
def __init__(self, tree: ast.AST, filename: str):
... | {"/good_smell/__init__.py": ["/good_smell/smell_warning.py", "/good_smell/lint_smell.py", "/good_smell/ast_smell.py", "/good_smell/smells/__init__.py", "/good_smell/main.py", "/good_smell/flake8_ext.py"], "/good_smell/smells/range_len_fix.py": ["/good_smell/__init__.py"], "/docs/generate_smell_doc.py": ["/tests/test_co... |
1,027 | Tadaboody/good_smell | refs/heads/master | /tests/examples/filter.py | #: Move if to iterator
# filter-iterator
for i in range(10):
if i == 2:
print(1)
print(2)
# ==>
for i in (x for x in range(10) if x == 2):
print(1)
print(2)
# END
#: Don't move if there's code before
# None
for i in range(10):
print(1)
if pred(i):
print(2)
# ==>
for i in rang... | {"/good_smell/__init__.py": ["/good_smell/smell_warning.py", "/good_smell/lint_smell.py", "/good_smell/ast_smell.py", "/good_smell/smells/__init__.py", "/good_smell/main.py", "/good_smell/flake8_ext.py"], "/good_smell/smells/range_len_fix.py": ["/good_smell/__init__.py"], "/docs/generate_smell_doc.py": ["/tests/test_co... |
1,028 | Tadaboody/good_smell | refs/heads/master | /tests/test_enumerate_fix.py | from good_smell import fix_smell
from re import match
import pytest
valid_sources = ["""
a = [0]
for i in range(len(a)):
print(a[i])
""",
"""
b = [1]
for i in range(len(a + b)):
print(i)
"""]
@pytest.mark.parametrize("source", valid_sources)
def test_range_len_fix(source):
assert not mat... | {"/good_smell/__init__.py": ["/good_smell/smell_warning.py", "/good_smell/lint_smell.py", "/good_smell/ast_smell.py", "/good_smell/smells/__init__.py", "/good_smell/main.py", "/good_smell/flake8_ext.py"], "/good_smell/smells/range_len_fix.py": ["/good_smell/__init__.py"], "/docs/generate_smell_doc.py": ["/tests/test_co... |
1,031 | tagplay/django-uuid-pk | refs/heads/master | /django_uuid_pk/tests/settings.py | import os
SITE_ID = 1
STATIC_URL = '/static/'
SECRET_KEY =';pkj;lkj;lkjh;lkj;oi'
db = os.environ.get('DBENGINE', None)
if db == 'pg':
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'django_uuid_pk',
'HOST': '127.0.0.1',
... | {"/django_uuid_pk/tests/tests.py": ["/django_uuid_pk/tests/models.py"]} |
1,032 | tagplay/django-uuid-pk | refs/heads/master | /conftest.py | import os
import sys
from django.conf import settings
def pytest_configure(config):
if not settings.configured:
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_uuid_pk.tests.settings'
def runtests(args=None):
import pytest
if not args:
args = []
if not any(a for a in args[1:] if no... | {"/django_uuid_pk/tests/tests.py": ["/django_uuid_pk/tests/models.py"]} |
1,033 | tagplay/django-uuid-pk | refs/heads/master | /django_uuid_pk/tests/__init__.py | # from __future__ import absolute_import
# from .tests import *
# from .models import *
| {"/django_uuid_pk/tests/tests.py": ["/django_uuid_pk/tests/models.py"]} |
1,034 | tagplay/django-uuid-pk | refs/heads/master | /django_uuid_pk/tests/models.py | import uuid
from django.db import models
from django_uuid_pk.fields import UUIDField
class ModelUUIDField(models.Model):
uuid1 = UUIDField(version=1, auto=True)
uuid3 = UUIDField(namespace=uuid.NAMESPACE_URL, version=3, auto=True)
uuid4 = UUIDField(version=4, auto=True)
uuid5 = UUIDField(namespace=uui... | {"/django_uuid_pk/tests/tests.py": ["/django_uuid_pk/tests/models.py"]} |
1,035 | tagplay/django-uuid-pk | refs/heads/master | /django_uuid_pk/tests/tests.py | import json
import uuid
from django.core.serializers import serialize
from django.db import IntegrityError
from django.test import TestCase
import pytest
from django_uuid_pk.fields import StringUUID
from django_uuid_pk.tests.models import (AutoUUIDFieldModel, ManualUUIDFieldModel, NamespaceUUIDFieldModel,
... | {"/django_uuid_pk/tests/tests.py": ["/django_uuid_pk/tests/models.py"]} |
1,036 | ddward/ansible | refs/heads/master | /user.py | from db import insert, exists, select_one, update
from werkzeug.security import check_password_hash, generate_password_hash
import logging
import traceback
def create_user(username,password):
try:
formattedUsername = format_username(username)
hashedPassword = generate_password_hash(password)
... | {"/user.py": ["/db.py"], "/app.py": ["/build_dir.py", "/sanitize_path.py", "/db.py", "/user.py"]} |
1,037 | ddward/ansible | refs/heads/master | /sanitize_path.py | import re
def sanitize(path):
# escape nasty double-dots
path = re.sub(r'\.\.', '', path)
# then remove any duplicate slashes
path = re.sub(r'(/)\1+', r'\1', path)
# then remove any leading slashes and dots
while(path and (path[0] == '/' or path[0] == '.')):
path = path[1:]
return p... | {"/user.py": ["/db.py"], "/app.py": ["/build_dir.py", "/sanitize_path.py", "/db.py", "/user.py"]} |
1,038 | ddward/ansible | refs/heads/master | /penetrationTesting.py | from bs4 import BeautifulSoup
import getpass
import requests
import os
def pTest(attack_string, attack_url, password):
payload = {'password': password}
with requests.Session() as s:
p = s.post(attack_url + 'login', data=payload)
r = requests.Request('GET', attack_url)
prepared = s.prepa... | {"/user.py": ["/db.py"], "/app.py": ["/build_dir.py", "/sanitize_path.py", "/db.py", "/user.py"]} |
1,039 | ddward/ansible | refs/heads/master | /build_dir.py | # build_dir.py
import os
def build_dir(curPath):
directoryDict = {}
with os.scandir(curPath) as directory:
for entry in directory:
#dont include shortcuts and hidden files
if not entry.name.startswith('.'):
#stat dict reference:
#https://docs.pyt... | {"/user.py": ["/db.py"], "/app.py": ["/build_dir.py", "/sanitize_path.py", "/db.py", "/user.py"]} |
1,040 | ddward/ansible | refs/heads/master | /db.py | from getpass import getpass
import os
import sqlite3
from werkzeug.security import generate_password_hash
from flask import g
import traceback
import logging
path = os.getcwd()
DATABASE = os.path.join(path, 'ansible.db')
def init_db():
with app.app_context():
db = sqlite3.connect(DATABASE)
with ap... | {"/user.py": ["/db.py"], "/app.py": ["/build_dir.py", "/sanitize_path.py", "/db.py", "/user.py"]} |
1,041 | ddward/ansible | refs/heads/master | /app.py | from cryptography.fernet import Fernet
import datetime
from flask import (flash, Flask, g, Markup, redirect, render_template, request,
send_from_directory, session, url_for)
import functools
import logging
import os
from secrets import token_urlsafe
import sqlite3
import sys
from werkzeug.utils import secure_filena... | {"/user.py": ["/db.py"], "/app.py": ["/build_dir.py", "/sanitize_path.py", "/db.py", "/user.py"]} |
1,070 | DSGDSR/pykedex | refs/heads/master | /main.py | import sys, requests, json
from io import BytesIO
from PIL import Image
from pycolors import *
from funcs import *
print( pycol.BOLD + pycol.HEADER + "Welcome to the pokedex, ask for a pokemon: " + pycol.ENDC, end="" )
pokemon = input()
while True:
response = getPokemon(pokemon)
if response.status_code =... | {"/main.py": ["/funcs.py"]} |
1,071 | DSGDSR/pykedex | refs/heads/master | /funcs.py | import requests, math
def getPokemon(pokemon):
return requests.get("http://pokeapi.co/api/v2/pokemon/"+pokemon)
def getEvolChain(id):
url = "http://pokeapi.co/api/v2/pokemon-species/" + str(id)
resp = requests.get(url)
data = resp.json()
evol = requests.get(data["evolution_chain"]["url"]).json()["... | {"/main.py": ["/funcs.py"]} |
1,127 | Terfno/tdd_challenge | refs/heads/master | /test/calc_price.py | import sys
import io
import unittest
from calc_price import Calc_price
from di_sample import SomeKVSUsingDynamoDB
class TestCalculatePrice(unittest.TestCase):
def test_calculater_price(self):
calc_price = Calc_price()
assert 24 == calc_price.calculater_price([10, 12])
assert 62 == calc_pri... | {"/test/calc_price.py": ["/calc_price.py"], "/test/stack.py": ["/stack.py"]} |
1,128 | Terfno/tdd_challenge | refs/heads/master | /stack.py | class STACK():
def isEmpty(self):
return True
def top(self):
return 1
| {"/test/calc_price.py": ["/calc_price.py"], "/test/stack.py": ["/stack.py"]} |
1,129 | Terfno/tdd_challenge | refs/heads/master | /calc_price.py | import sys
class Calc_price():
def calculater_price(self, values):
round=lambda x:(x*2+1)//2
sum = 0
for value in values:
sum += int(value)
ans = sum * 1.1
ans = int(round(ans))
return ans
def input_to_data(self, input):
result = []
l... | {"/test/calc_price.py": ["/calc_price.py"], "/test/stack.py": ["/stack.py"]} |
1,130 | Terfno/tdd_challenge | refs/heads/master | /test/stack.py | import unittest
from stack import STACK
class TestSTACK(unittest.TestCase):
@classmethod
def setUpClass(cls):
stack=STACK()
def test_isEmpty(self):
self.assertEqual(stack.isEmpty(), True)
def test_push_top(self):
self.assertEqual(stack.top(),1)
| {"/test/calc_price.py": ["/calc_price.py"], "/test/stack.py": ["/stack.py"]} |
1,133 | paolapilar/juegos | refs/heads/master | /collectables.py |
import pygame
import base
class Apple( base.Entity ) :
def __init__( self, i, j, cellSize, canvasWidth, canvasHeight ) :
super( Apple, self ).__init__( i, j, 1, 1, cellSize, canvasWidth, canvasHeight )
self._color = ( 255, 255, 0 )
self._alive = True
def draw( self, canvas ) :
... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,134 | paolapilar/juegos | refs/heads/master | /snake.py |
import pygame
import base
from collections import deque
class SnakePart( base.Entity ) :
def __init__( self, i, j, color, cellSize, canvasWidth, canvasHeight ) :
super( SnakePart, self ).__init__( i, j, 1, 1, cellSize, canvasWidth, canvasHeight )
self.color = color
self.lasti = i
... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,135 | paolapilar/juegos | refs/heads/master | /screen.py |
import pygame
import world
class Text( object ) :
def __init__( self, x, y, message, size, color ) :
super( Text, self).__init__()
self._message = message
self._textFont = pygame.font.Font( None, size )
self._textSurface = self._textFont.render( message, True, color )
sel... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,136 | paolapilar/juegos | refs/heads/master | /world.py |
import math
import random
import pygame
from base import Entity
from snake import Snake
from collectables import Apple
class Obstacle( Entity ) :
def __init__( self, i, j, di, dj, cellSize, canvasWidth, canvasHeight ) :
super( Obstacle, self ).__init__( i, j, di, dj, cellSize, canvasWidth, canvasHeight ... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,137 | paolapilar/juegos | refs/heads/master | /main.py |
import pygame
import random
import time
from snake import Snake
from collectables import Apple
import screen
class Game :
def __init__( self ) :
pygame.init()
self._canvasWidth = 800
self._canvasHeight = 600
self._canvas = pygame.display.set_mode( ( self._canvasWidth, self._canv... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,138 | paolapilar/juegos | refs/heads/master | /utils.py |
import math
def grid2screen( i, j, cellSize, canvasWidth, canvasHeight ) :
x = ( i + 0.5 ) * cellSize
y = canvasHeight - ( j + 0.5 ) * cellSize
return x, y
def screen2grid( x, y, cellSize, canvasWidth, canvasHeight ) :
i = math.floor( x / cellSize - 0.5 )
j = math.floor( ( canvasHeight - y ) / ce... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,139 | paolapilar/juegos | refs/heads/master | /base.py |
import math
import utils
class Entity( object ) :
def __init__( self, i, j, di, dj, cellSize, canvasWidth, canvasHeight ) :
super( Entity, self ).__init__()
self.i = i
self.j = j
self._cellSize = cellSize
self._canvasWidth = canvasWidth
self._canvasHeight = canva... | {"/collectables.py": ["/base.py"], "/snake.py": ["/base.py"], "/screen.py": ["/world.py"], "/world.py": ["/base.py", "/snake.py", "/collectables.py"], "/main.py": ["/snake.py", "/collectables.py", "/screen.py"], "/base.py": ["/utils.py"]} |
1,167 | MatheusLealAquino/meuCanal | refs/heads/master | /conteudo/views.py | from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.shortcuts import render, redirect, get_object_or_404
from conteudo.models import Video, Categoria
def exibir_catalogo(request):
categorias = Categoria.objects.all()
return render(request, 'conteudo/catalogo_videos.html', {'ca... | {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,168 | MatheusLealAquino/meuCanal | refs/heads/master | /conteudo/urls.py | from django.urls import path
from conteudo import views
app_name = 'conteudo'
urlpatterns = [
path('', views.exibir_catalogo, name='catalogo'),
path('cadastro_video/', views.cadastro_video, name='cadastro_video'),
path('editar_video/<int:id>/', views.editar_video, name='editar_video'),
path('<int:id>/... | {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,169 | MatheusLealAquino/meuCanal | refs/heads/master | /conteudo/forms.py | from django import forms
from conteudo.models import Video, Categoria
class VideoForm(forms.ModelForm):
error_messages = {
'campo invalido' : "Campo inválido"
}
class Meta:
model = Video
fields = ('video_id','categoria', 'nome', 'url', 'capa', 'visualizacao', 'nota', 'sinopse')
... | {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,170 | MatheusLealAquino/meuCanal | refs/heads/master | /conteudo/models.py | from django.db import models
class Categoria(models.Model):
nome = models.CharField(max_length=255, db_index=True)
slug = models.SlugField(max_length=200)
class Meta:
ordering = ('nome',)
verbose_name = 'categoria'
verbose_name_plural = 'categorias'
def __str__(self):
... | {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,171 | MatheusLealAquino/meuCanal | refs/heads/master | /projeto/views.py | from django.shortcuts import render
def pagina_inicial(request):
return render(request, 'index.html') | {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,172 | MatheusLealAquino/meuCanal | refs/heads/master | /login/urls.py | from django.urls import path
from login import views
app_name = 'login'
urlpatterns = [
path('', views.pagina_login, name='pagina_login'),
] | {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,173 | MatheusLealAquino/meuCanal | refs/heads/master | /login/views.py | from django.shortcuts import render
def pagina_login(request):
return render(request, 'login/pagina_login.html')
| {"/conteudo/views.py": ["/conteudo/models.py"], "/conteudo/forms.py": ["/conteudo/models.py"]} |
1,193 | Cryptek768/MacGyver-Game | refs/heads/master | /Maze.py | import pygame
import random
from Intel import *
#Classe du Niveau(placement des murs)
class Level:
#Preparation de la classe
def __init__(self, map_pool):
self.map_pool = map_pool
self.map_structure = []
self.position_x = 0
self.position_y = 0
self.sprite... | {"/Maze.py": ["/Intel.py"], "/Items.py": ["/Intel.py"], "/Characters.py": ["/Intel.py"], "/Main.py": ["/Maze.py", "/Intel.py", "/Characters.py", "/Items.py"]} |
1,194 | Cryptek768/MacGyver-Game | refs/heads/master | /Items.py | import pygame
import random
from Intel import *
#Classe des placements d'objets
class Items:
#Preparation de la classe
def __init__(self, map_pool):
self.item_needle = pygame.image.load(Object_N).convert_alpha()
self.item_ether = pygame.image.load(Object_E).convert_alpha()
... | {"/Maze.py": ["/Intel.py"], "/Items.py": ["/Intel.py"], "/Characters.py": ["/Intel.py"], "/Main.py": ["/Maze.py", "/Intel.py", "/Characters.py", "/Items.py"]} |
1,195 | Cryptek768/MacGyver-Game | refs/heads/master | /Intel.py | # Information des variables Global et des images
Sprite_Size_Level = 15
Sprite_Size = 30
Size_Level = Sprite_Size_Level * Sprite_Size
Background = 'images/Background.jpg'
Wall = 'images/Wall.png'
MacGyver = 'images/MacGyver.png'
Guardian = 'images/Guardian.png'
Object_N = 'images/Needle.png'
Object_E = 'im... | {"/Maze.py": ["/Intel.py"], "/Items.py": ["/Intel.py"], "/Characters.py": ["/Intel.py"], "/Main.py": ["/Maze.py", "/Intel.py", "/Characters.py", "/Items.py"]} |
1,196 | Cryptek768/MacGyver-Game | refs/heads/master | /Characters.py | import pygame
from Intel import *
class Characters:
def __init__(self, map_pool):
self.map_pool = map_pool
self.position_x = 0
self.position_y = 0
self.sprite_x = int(0 /30)
self.sprite_y = int(0 /30)
self.image_Macgyver = pyga... | {"/Maze.py": ["/Intel.py"], "/Items.py": ["/Intel.py"], "/Characters.py": ["/Intel.py"], "/Main.py": ["/Maze.py", "/Intel.py", "/Characters.py", "/Items.py"]} |
1,197 | Cryptek768/MacGyver-Game | refs/heads/master | /Main.py | import pygame
from Maze import *
from Intel import *
from Characters import *
from Items import *
from pygame import K_DOWN, K_UP, K_LEFT, K_RIGHT
#Classe Main du jeux avec gestion des movements et l'affichage
class Master:
def master():
pygame.init()
screen = pygame.display.set_mode((... | {"/Maze.py": ["/Intel.py"], "/Items.py": ["/Intel.py"], "/Characters.py": ["/Intel.py"], "/Main.py": ["/Maze.py", "/Intel.py", "/Characters.py", "/Items.py"]} |
1,198 | alan-valenzuela93/port-scanner | refs/heads/main | /port-scanner.py | import socket
import argparse
from grabber import banner_grabbing
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--target', help='Enter your target address', required=True)
parser = parser.parse_args()
ports = [21, 22, 25, 53, 66, 80, 88, 110, 139, 443, 445, 8080, 9050] # These are some of the m... | {"/port-scanner.py": ["/grabber.py"]} |
1,199 | alan-valenzuela93/port-scanner | refs/heads/main | /grabber.py | import socket
def banner_grabbing(addr, port):
print("Getting service information for open TCP/IP port: ", port + "...")
socket.setdefaulttimeout(10)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((addr, port))
data = ''
headers = \
"GET / HTTP/1.1\r\n" \
... | {"/port-scanner.py": ["/grabber.py"]} |
1,225 | marioxe301/ParserDR | refs/heads/master | /Lexer.py | from pyparsing import (Regex, White, Literal ,
ZeroOrMore, OneOrMore, Group , Combine ,
Word , alphanums, Suppress)
import sys
class Tokens(object):
def __init__(self,tag,token):
self.tag = tag
self.token = token
#esta clase permitira guardar en la lista
class Lexer(object):
def __init__(sel... | {"/ParserSimpleExample.py": ["/Lexer.py"], "/Parser.py": ["/Lexer.py"]} |
1,226 | marioxe301/ParserDR | refs/heads/master | /ParserSimpleExample.py | from Lexer import Lexer
from treelib import Node, Tree
#verifica unicamente la declaracion de un int int <ID> := <NUMERO>
class ParserExample(object):
def __init__(self,path):
lex = Lexer(path)
lex.tokenize()
self.TOKENS = lex.tokenList
self.INDEX = 0
tree = Tree()
s... | {"/ParserSimpleExample.py": ["/Lexer.py"], "/Parser.py": ["/Lexer.py"]} |
1,227 | marioxe301/ParserDR | refs/heads/master | /Parser.py | from Lexer import Lexer
from treelib import Node, Tree
import re
from termcolor import colored,cprint
class Parser(object):
def __init__(self,path):
lex = Lexer(path)
lex.tokenize()
self.TOKENS = lex.tokenList
self.TYPES= re.compile(".*-TY")
def nextToken(self):
... | {"/ParserSimpleExample.py": ["/Lexer.py"], "/Parser.py": ["/Lexer.py"]} |
1,228 | flinteller/unit_eleven | refs/heads/master | /paddle.py | import pygame
import random
class Paddle(pygame.sprite.Sprite):
def __init__(self, main_surface, color, height, width):
"""
This function creates creates a surface using each other params
:param main_surface:
:param color:
:param height:
:param width:
"""
... | {"/breakout.py": ["/ball.py", "/paddle.py"]} |
1,229 | flinteller/unit_eleven | refs/heads/master | /ball.py | import pygame
class Ball(pygame.sprite.Sprite):
def __init__(self, color, window_width, window_height, radius):
# initialize sprite super class
super().__init__()
# finish setting the class variables to the parameters
self.color = color
self.radius = radius
self.w... | {"/breakout.py": ["/ball.py", "/paddle.py"]} |
1,230 | flinteller/unit_eleven | refs/heads/master | /breakout.py | import pygame
import sys
from pygame.locals import *
import brick
import ball
import paddle
def main():
# Constants that will be used in the program
APPLICATION_WIDTH = 400
APPLICATION_HEIGHT = 600
PADDLE_Y_OFFSET = 30
BRICKS_PER_ROW = 10
BRICK_SEP = 4 # The space between each brick
BRICK... | {"/breakout.py": ["/ball.py", "/paddle.py"]} |
1,231 | folmez/Handsfree-KGS | refs/heads/master | /play_handsfree_GO.py | from pynput.mouse import Button, Controller
import cv2
import imageio
import matplotlib.pyplot as plt
import threading
import time
import queue
import os
import numpy as np
import src
frames = queue.Queue(maxsize=10)
class frameGrabber(threading.Thread):
def __init__(self):
# Constructor
threading... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,232 | folmez/Handsfree-KGS | refs/heads/master | /tests/test_screenshot_actions.py | import imageio
import pytest
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import src
def test_get_digital_goban_state():
rgb_pix = imageio.imread('images/digital_goban.png')
# Process KGS goban grayscale and find the stones
assert src.get_digital_goban_... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,233 | folmez/Handsfree-KGS | refs/heads/master | /src/mouse_actions.py | from pynput.mouse import Button, Controller
import src
import time
def get_goban_corners():
# Obtain mouse controller
mouse = Controller()
# Ask the user to define goban corners
print('Move cursor to upper-left (A19) corner of Goban and keep it there five seconds')
time.sleep(5)
(UL_x, UL_y) =... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,234 | folmez/Handsfree-KGS | refs/heads/master | /src/cam_actions.py | import imageio
def get_pyhsical_goban_state(rgb_pix):
pass
def picture_to_rgb(path):
return misc.imageio(path)
| {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,235 | folmez/Handsfree-KGS | refs/heads/master | /make_goban_speak.py | import src
import time
UL_x, UL_y, goban_step = src.get_goban_corners()
prev_stone_set = set()
print("Started scanning the board for moves every 5 seconds...")
while True:
# wait between screenshots
time.sleep(5)
# get board screenshot
board_rgb_screenshot = src.KGS_goban_rgb_screenshot(UL_x, UL_y, go... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,236 | folmez/Handsfree-KGS | refs/heads/master | /src/screenshot_actions.py | import pyscreeze
import numpy as np
import matplotlib.pyplot as plt
import src
def get_digital_goban_state(rgb_pix, plot_stuff=False):
# RGB of Black = [ 0, 0, 0]
# RGB of White = [255, 255, 255]
# RGB of Orange = [255, 160, 16]
# Use red scale to find out black stones, blue scale to find out whit... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,237 | folmez/Handsfree-KGS | refs/heads/master | /temp/plot_save_coordinates_on_click.py | import matplotlib.pyplot as plt
xy=[]
def onclick(event):
print(event.xdata, event.ydata)
xy.append((event.xdata, event.ydata))
fig = plt.figure()
plt.plot(range(10))
fig.canvas.mpl_connect('button_press_event', onclick)
plt.show()
print(xy)
| {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,238 | folmez/Handsfree-KGS | refs/heads/master | /auto_goban_detection.py | import matplotlib.pyplot as plt
import imageio
import numpy as np
import src
IMG_PATH = 'images/empty_pyshical_goban1.png'
board_corners = []
def onclick(event):
print(event.xdata, event.ydata)
board_corners.append((event.xdata, event.ydata))
# Get RGB matrix of the picture with goban
rgb = imageio.imread(IM... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,239 | folmez/Handsfree-KGS | refs/heads/master | /tests/test_play_handsfree_GO.py | import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pynput.mouse import Button, Controller
import pytest
import imageio
import src
# Write a test of play_handsfree_GO.py using already existing frames
img_name = []
folder_name = 'images/sample_game_log/ex1/'
# empty b... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,240 | folmez/Handsfree-KGS | refs/heads/master | /tests/test_mouse_actions.py | from pynput.mouse import Button, Controller
import time
import sys
import os
import pytest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import src
def test_str_to_integer_coordinates():
assert src.str_to_integer_coordinates('A19') == (1, 1)
assert src.str_to_integer_coord... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,241 | folmez/Handsfree-KGS | refs/heads/master | /setup.py | from setuptools import setup, find_packages
setup( name='Handsfree-KGS',
version='0.0',
description='Pay Handsfree Go on KGS',
author='Fatih Olmez',
author_email='folmez@gmail.com',
packages=find_packages())
| {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,242 | folmez/Handsfree-KGS | refs/heads/master | /src/picture_actions.py | import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import argrelmin
import imageio
import src
def play_next_move_on_digital_board(mouse, color, i, j, bxy, wxy, \
UL_x, UL_y, goban_step):
if color is not None:
print(f"New move: {color} playe... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,243 | folmez/Handsfree-KGS | refs/heads/master | /src/__init__.py | from .mouse_actions import get_goban_corners, str_to_integer_coordinates
from .mouse_actions import int_coords_to_screen_coordinates, make_the_move
from .mouse_actions import int_coords_to_str
from .screenshot_actions import KGS_goban_rgb_screenshot, get_digital_goban_state
from .picture_actions import plot_goban_rgb, ... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,244 | folmez/Handsfree-KGS | refs/heads/master | /tests/test_picture_actions.py | import pytest
import imageio
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import src
# stones - upper-left corner is (1,1), lower-left corner is (19,1)
IMG_PATH = ['images/pyshical_goban_pic1.png', 'images/pyshical_goban_pic2.png', \
'images/pyshical_gob... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,245 | folmez/Handsfree-KGS | refs/heads/master | /temp/process_pyhsical_goban_pic.py | import matplotlib.pyplot as plt
import imageio
import numpy as np
import src
IMG_PATH = 'images/pyshical_goban_pic1.png'
#IMG_PATH = 'images/pyshical_goban_pic2.png'
#IMG_PATH = 'images/pyshical_goban_pic3.png'
UL_outer_x, UL_outer_y = 315, 24
UR_outer_x, UR_outer_y = 999, 40
BL_outer_x, BL_outer_y = 3, 585
BR_outer_x... | {"/play_handsfree_GO.py": ["/src/__init__.py"], "/tests/test_screenshot_actions.py": ["/src/__init__.py"], "/src/mouse_actions.py": ["/src/__init__.py"], "/make_goban_speak.py": ["/src/__init__.py"], "/src/screenshot_actions.py": ["/src/__init__.py"], "/auto_goban_detection.py": ["/src/__init__.py"], "/tests/test_play_... |
1,249 | KAcee77/django_sputnik_map | refs/heads/main | /django_sputnik_maps/apps.py | from django.apps import AppConfig
class DjangoSputnikMapsConfig(AppConfig):
name = 'django_sputnik_maps'
| {"/sample/models.py": ["/django_sputnik_maps/fields.py"], "/django_sputnik_maps/__init__.py": ["/django_sputnik_maps/widgets.py"], "/sample/admin.py": ["/django_sputnik_maps/fields.py", "/django_sputnik_maps/widgets.py", "/sample/models.py"]} |
1,250 | KAcee77/django_sputnik_map | refs/heads/main | /django_sputnik_maps/widgets.py | from django.conf import settings
from django.forms import widgets
class AddressWidget(widgets.TextInput):
'''a map will be drawn after the address field'''
template_name = 'django_sputnik_maps/widgets/mapwidget.html'
class Media:
css = {
'all': ('https://unpkg.com/leaflet@1.0.1/dist/l... | {"/sample/models.py": ["/django_sputnik_maps/fields.py"], "/django_sputnik_maps/__init__.py": ["/django_sputnik_maps/widgets.py"], "/sample/admin.py": ["/django_sputnik_maps/fields.py", "/django_sputnik_maps/widgets.py", "/sample/models.py"]} |
1,251 | KAcee77/django_sputnik_map | refs/heads/main | /sample/models.py | from django.db import models
from django_sputnik_maps.fields import AddressField
# all fields must be present in the model
class SampleModel(models.Model):
region = models.CharField(max_length=100)
place = models.CharField(max_length=100)
street = models.CharField(max_length=100)
house = models.Integer... | {"/sample/models.py": ["/django_sputnik_maps/fields.py"], "/django_sputnik_maps/__init__.py": ["/django_sputnik_maps/widgets.py"], "/sample/admin.py": ["/django_sputnik_maps/fields.py", "/django_sputnik_maps/widgets.py", "/sample/models.py"]} |
1,252 | KAcee77/django_sputnik_map | refs/heads/main | /django_sputnik_maps/fields.py | from django.db import models
class AddressField(models.CharField):
pass | {"/sample/models.py": ["/django_sputnik_maps/fields.py"], "/django_sputnik_maps/__init__.py": ["/django_sputnik_maps/widgets.py"], "/sample/admin.py": ["/django_sputnik_maps/fields.py", "/django_sputnik_maps/widgets.py", "/sample/models.py"]} |
1,253 | KAcee77/django_sputnik_map | refs/heads/main | /django_sputnik_maps/__init__.py | from .widgets import AddressWidget | {"/sample/models.py": ["/django_sputnik_maps/fields.py"], "/django_sputnik_maps/__init__.py": ["/django_sputnik_maps/widgets.py"], "/sample/admin.py": ["/django_sputnik_maps/fields.py", "/django_sputnik_maps/widgets.py", "/sample/models.py"]} |
1,254 | KAcee77/django_sputnik_map | refs/heads/main | /sample/admin.py | # from django.db import models
from django.contrib import admin
from django_sputnik_maps.fields import AddressField
from django_sputnik_maps.widgets import AddressWidget
from .models import SampleModel
@admin.register(SampleModel)
class SampleModelAdmin(admin.ModelAdmin):
formfield_overrides = {
AddressF... | {"/sample/models.py": ["/django_sputnik_maps/fields.py"], "/django_sputnik_maps/__init__.py": ["/django_sputnik_maps/widgets.py"], "/sample/admin.py": ["/django_sputnik_maps/fields.py", "/django_sputnik_maps/widgets.py", "/sample/models.py"]} |
1,255 | liuchao012/myPythonWeb | refs/heads/master | /listsss/apps.py | from django.apps import AppConfig
class ListsssConfig(AppConfig):
name = 'listsss'
| {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,256 | liuchao012/myPythonWeb | refs/heads/master | /test/listsss/tests_views.py | from django.test import TestCase
from django.urls import resolve
from django.http import HttpRequest
from django.template.loader import render_to_string
from django.utils.html import escape
from listsss.models import Item, List
from listsss.views import home_page
import unittest
# Create your tests here.
class HomePa... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,257 | liuchao012/myPythonWeb | refs/heads/master | /functional_tests/base.py | # -*- coding: utf-8 -*-
# @Time : 2018/6/25 20:15
# @Author : Mat
# @Email : mat_wu@163.com
# @File : functional_tests1.py
# @Software: PyCharm
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
from django.contrib.staticfiles.testing impo... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,258 | liuchao012/myPythonWeb | refs/heads/master | /test/listsss/tests_models.py | from django.test import TestCase
from django.urls import resolve
from django.http import HttpRequest
from django.template.loader import render_to_string
from listsss.models import Item, List
from listsss.views import home_page
import unittest
from django.core.exceptions import ValidationError
class ListAndItemModelsTe... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,259 | liuchao012/myPythonWeb | refs/heads/master | /listsss/views.py | from django.shortcuts import render, redirect # redirect是python的重定向方法
from django.http import HttpResponse
from listsss.models import Item, List
from django.core.exceptions import ValidationError
# Create your views here.
def home_page(request):
# return HttpResponse("<html><title>To-Do lists</title></html>")
... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,260 | liuchao012/myPythonWeb | refs/heads/master | /functional_tests/test_simple_list_creation.py | # -*- coding: utf-8 -*-
# @Time : 2018/6/25 20:15
# @Author : Mat
# @Email : mat_wu@163.com
# @File : functional_tests1.py
# @Software: PyCharm
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
from django.contrib.staticfiles.testing impo... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,261 | liuchao012/myPythonWeb | refs/heads/master | /functional_tests/tests_layout_and_styling.py | # -*- coding: utf-8 -*-
# @Time : 2018/6/25 20:15
# @Author : Mat
# @Email : mat_wu@163.com
# @File : functional_tests1.py
# @Software: PyCharm
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
from django.contrib.staticfiles.testing impo... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,262 | liuchao012/myPythonWeb | refs/heads/master | /functional_tests/tests_list_item_validation.py | # -*- coding: utf-8 -*-
# @Time : 2018/6/25 20:15
# @Author : Mat
# @Email : mat_wu@163.com
# @File : functional_tests1.py
# @Software: PyCharm
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
from django.contrib.staticfiles.testing impo... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,263 | liuchao012/myPythonWeb | refs/heads/master | /functional_tests/__init__.py | # -*- coding: utf-8 -*-
# @Time : 2018/6/28 17:06
# @Author : Mat
# @Email : mat_wu@163.com
# @File : __init__.py.py
# @Software: PyCharm
'''
functional_tests,中的文件需要已tests开头系统命令才能读取到测试用例并执行测试
测试执行命令python manage.py test functional_tests,来完成功能测试
如果执行 python manage.py test 那么django 将会执行 功能测试和单元测试
如果想只运行单元测... | {"/test/listsss/tests_views.py": ["/listsss/views.py"], "/test/listsss/tests_models.py": ["/listsss/views.py"], "/functional_tests/test_simple_list_creation.py": ["/functional_tests/base.py"], "/functional_tests/tests_layout_and_styling.py": ["/functional_tests/base.py"], "/functional_tests/tests_list_item_validation.p... |
1,265 | strawberryblackhole/hippopotamus | refs/heads/master | /fillWithWiki.py | from htmlParser import getFormatedArticle
from chunkGenerator import *
from ZIMply.zimply import ZIMFile
from os import path
import math
import time
import argparse
from amulet.world_interface import load_world
def generateChunkList(totalArticleCount, chunkBookCapacity, target_pos, outputForceload = False):
#gene... | {"/fillWithWiki.py": ["/htmlParser.py", "/chunkGenerator.py"], "/chunkGenerator.py": ["/htmlParser.py"], "/parserTester.py": ["/fillWithWiki.py"]} |
1,266 | strawberryblackhole/hippopotamus | refs/heads/master | /chunkGenerator.py | from amulet.api.block import Block
import amulet_nbt
from amulet.api.block_entity import BlockEntity
from htmlParser import getFormatedArticle
from functools import partial
import multiprocessing
from multiprocessing.pool import Pool
from multiprocessing.pool import ThreadPool
from ZIMply.zimply import ZIMFile
import t... | {"/fillWithWiki.py": ["/htmlParser.py", "/chunkGenerator.py"], "/chunkGenerator.py": ["/htmlParser.py"], "/parserTester.py": ["/fillWithWiki.py"]} |
1,267 | strawberryblackhole/hippopotamus | refs/heads/master | /htmlParser.py | from html.parser import HTMLParser
from bs4 import BeautifulSoup
import json
class MyHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
def feed(self, in_html, zimFile, barrelPositionList, booksPerBarrel, chunkList, target_pos):
self._data = [""]
self._formats = [[[]... | {"/fillWithWiki.py": ["/htmlParser.py", "/chunkGenerator.py"], "/chunkGenerator.py": ["/htmlParser.py"], "/parserTester.py": ["/fillWithWiki.py"]} |
1,268 | strawberryblackhole/hippopotamus | refs/heads/master | /parserTester.py | from amulet.api.selection import SelectionGroup
from amulet.api.block import Block
from amulet.api.data_types import Dimension
from amulet import log
import amulet_nbt
from amulet.api.block_entity import BlockEntity
from ZIMply.zimply import ZIMFile
import os
import math
import time
from fillWithWiki import getFormate... | {"/fillWithWiki.py": ["/htmlParser.py", "/chunkGenerator.py"], "/chunkGenerator.py": ["/htmlParser.py"], "/parserTester.py": ["/fillWithWiki.py"]} |
1,279 | gausszh/sae_site | refs/heads/master | /utils/filters.py | # coding=utf8
"""
jinja2的过滤器
"""
import markdown
def md2html(md):
"""
@param {unicode} md
@return {unicode html}
"""
return markdown.markdown(md, ['extra', 'codehilite', 'toc', 'nl2br'], safe_mode="escape")
JINJA2_FILTERS = {
'md2html': md2html,
}
| {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,280 | gausszh/sae_site | refs/heads/master | /models/base.py | #coding=utf8
"""
基础类--用户信息
"""
from sqlalchemy import (
MetaData, Table, Column, Integer, BigInteger, Float, String, Text, DateTime,
ForeignKey, Date, UniqueConstraint)
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from models import sae_engine
from models im... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,281 | gausszh/sae_site | refs/heads/master | /views/base.py | #coding=utf8
import datetime
from flask import Blueprint, request, jsonify, render_template, redirect
import flask_login
import weibo as sinaweibo
from models.base import create_session, User
from utils import user_cache
from configs import settings
bp_base = Blueprint('base', __name__, url_prefix='/base')
@bp_b... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,282 | gausszh/sae_site | refs/heads/master | /flask_app.py | #!/usr/bin/python
# coding=utf8
from flask import Flask, render_template, g
import flask_login
from configs import settings
from utils.filters import JINJA2_FILTERS
from utils import user_cache
from views import blog, base, security
def create_app(debug=settings.DEBUG):
app = Flask(__name__)
... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,283 | gausszh/sae_site | refs/heads/master | /models/__init__.py | #coding=utf-8
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from configs import settings
sae_engine = create_engine(settings.DB_SAE_URI+'?charset=utf8', encoding='utf-8',
convert_unicode=True, pool_recycle=settings.DB_POOL_RECYC... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,284 | gausszh/sae_site | refs/heads/master | /utils/__init__.py | #coding=utf8
import datetime
import redis
import flask_login
from models.base import User, create_session
from utils import user_cache
from configs import settings
def AnonymousUserMixin():
'''
This is the default object for representing an anonymous user.
'''
session = create_session()
user = ... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,285 | gausszh/sae_site | refs/heads/master | /utils/blog_cache.py | # coding=utf8
from configs import settings
from utils import redis_connection
APP = "blog"
def set_draft_blog(uid, markdown):
_cache = redis_connection()
key = str("%s:draft:blog:%s" % (APP, uid))
_cache.set(key, markdown, settings.DRAFT_BLOG_TIMEOUT)
| {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,286 | gausszh/sae_site | refs/heads/master | /configs/settings_dev.py | #coding=utf8
import os
# system setting
DEBUG = True
APP_HOST = '127.0.0.1'
APP_PORT = 7020
STORAGE_BUCKET_DOMAIN_NAME = 'blogimg'
# database
if os.environ.get('SERVER_SOFTWARE'):#线上
import sae
DB_SAE_URI = 'mysql://%s:%s@%s:%s/database_name' % (sae.const.MYSQL_USER,
sae.const.MYSQL_PASS, sae.const.MYSQL... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,287 | gausszh/sae_site | refs/heads/master | /utils/user_cache.py | # coding=utf8
try:
import simplejson as json
except Exception:
import json
import datetime
from sqlalchemy.sql import or_
from models.base import create_session, User
from models.blog import BlogArticle
from configs import settings
from utils import redis_connection
# import sae.kvdb
APP = "base"
def get_u... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,288 | gausszh/sae_site | refs/heads/master | /views/security.py | # coding=utf8
"""
学web安全用到的一些页面
"""
from flask import Blueprint, render_template
from sae.storage import Bucket
from configs import settings
bp_security = Blueprint('security', __name__, url_prefix='/security')
bucket = Bucket(settings.STORAGE_BUCKET_DOMAIN_NAME)
bucket.put()
@bp_security.route('/wanbo/video/')
de... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,289 | gausszh/sae_site | refs/heads/master | /views/blog.py | # coding=utf8
import datetime
import urllib
from flask import Blueprint, request, jsonify, render_template, g
import flask_login
from sae.storage import Bucket
from models.blog import create_session, BlogArticle
from utils.blog_cache import set_draft_blog
from configs import settings
bp_blog = Blueprin... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,290 | gausszh/sae_site | refs/heads/master | /models/blog.py | #!/usr/bin/python
#coding=utf8
import datetime
from sqlalchemy import (
MetaData, Table, Column, Integer, BigInteger, Float, String, Text, DateTime,
ForeignKey, Date, UniqueConstraint)
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from models import sae_engin... | {"/models/base.py": ["/models/__init__.py"], "/flask_app.py": ["/utils/filters.py", "/utils/__init__.py"], "/utils/__init__.py": ["/models/base.py"], "/utils/blog_cache.py": ["/utils/__init__.py"], "/utils/user_cache.py": ["/models/base.py", "/models/blog.py", "/utils/__init__.py"], "/views/blog.py": ["/models/blog.py"... |
1,291 | Garlinsk/Password-Locker | refs/heads/main | /passlock_test.py | import unittest #Importing the unittest module
from passlock import User #Importing the user class
from passlock import Credentials
import pyperclip
class TestCredentials(unittest.Testcase):
"""
Test class that defines test cases for the User class.
Args:
unittest.TestCase: TestCase class that he... | {"/passlock_test.py": ["/passlock.py"], "/run.py": ["/passlock.py"]} |
1,292 | Garlinsk/Password-Locker | refs/heads/main | /run.py | #!/usr/bin/env python3.9
from os import name
from passlock import User
def create_contact(fname,lname,phone,email):
'''
Function to create a new user
'''
new_user = User(fname,lname,phone,email)
return new_user
def save_users(user):
'''
Function to save user
'''
user.save_user()
d... | {"/passlock_test.py": ["/passlock.py"], "/run.py": ["/passlock.py"]} |
1,293 | Garlinsk/Password-Locker | refs/heads/main | /passlock.py | from os import name
import pyperclip
class User:
"""
Class that generates new instances of user.
"""
user_list = [] # Empty user list
def __init__(self, username, password, email):
# docstring removed for simplicity
self.username = username
self.password = password
... | {"/passlock_test.py": ["/passlock.py"], "/run.py": ["/passlock.py"]} |
1,310 | AlexsandroMO/Bitcoin | refs/heads/master | /Write_SQL.py | import pandas as pd
import pandasql as pdsql
import sqlite3
from datetime import date
from datetime import datetime
import CreateTable_SQL
#--------------------------------------------
#Adicionar dados no banco - VarBitcoin
def add_var_bitcoin(btc_last,btc_buy,btc_sell,date_btc):
# CreateTable_SQL.crea... | {"/Write_SQL.py": ["/CreateTable_SQL.py"]} |
1,311 | AlexsandroMO/Bitcoin | refs/heads/master | /coin/admin.py |
from django.contrib import admin
from .models import TypeWallet, MYWallet
class ListaMYWallet(admin.ModelAdmin):
list_display = ('name_wallet','var_wallet','type_wallet','log_create')
admin.site.register(TypeWallet)
admin.site.register(MYWallet, ListaMYWallet)
| {"/Write_SQL.py": ["/CreateTable_SQL.py"]} |
1,312 | AlexsandroMO/Bitcoin | refs/heads/master | /CreateTable_SQL.py | import pandas as pd
import pandasql as pdsql
import sqlite3
from datetime import date
from datetime import datetime
import os
def verify():
directory = 'DB'
dir = directory
if not os.path.exists(directory):
os.makedirs(dir)
#-------------------------------------------------------
... | {"/Write_SQL.py": ["/CreateTable_SQL.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.