index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
3,302 | supasate/FBPCS | refs/heads/main | /onedocker/env.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# This is the repository path that OneDocker downloads binaries from
ONEDOCKER_REPOSITORY_PATH = "ONEDOCKER_REPOSITORY_... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,303 | supasate/FBPCS | refs/heads/main | /fbpcs/entity/instance_base.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import abc
class InstanceBase(abc.ABC):
@abc.abstractmethod
def get_instance_id(self) -> str:
... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,304 | supasate/FBPCS | refs/heads/main | /fbpcs/mapper/aws.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
from functools import reduce
from typing import Any, Dict, List
from fbpcs.entity.cluster_instance impo... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,305 | supasate/FBPCS | refs/heads/main | /tests/gateway/test_ecs.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import MagicMock, patch
from fbpcs.entity.cluster_instance import ClusterStatus, Cl... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,306 | supasate/FBPCS | refs/heads/main | /fbpcs/gateway/cloudwatch.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
from typing import Any, Dict, Optional
import boto3
from fbpcs.decorator.error_handler import error_han... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,307 | supasate/FBPCS | refs/heads/main | /tests/repository/test_instance_s3.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pickle
import unittest
import uuid
from unittest.mock import MagicMock
from fbpcs.entity.mpc_instance import MP... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,308 | supasate/FBPCS | refs/heads/main | /fbpcs/error/mapper/aws.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
from botocore.exceptions import ClientError
from fbpcs.error.pcs import PcsError
from fbpcs.error.thrott... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,309 | supasate/FBPCS | refs/heads/main | /tests/mapper/test_aws.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from fbpcs.entity.cluster_instance import ClusterStatus, Cluster
from fbpcs.entity.container_instance ... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,310 | supasate/FBPCS | refs/heads/main | /fbpcs/service/storage_s3.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import os
from os import path
from os.path import join, normpath, relpath
from typing import Any, Dict, ... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,311 | supasate/FBPCS | refs/heads/main | /fbpcs/service/container_aws.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import asyncio
from typing import Any, Dict, List, Optional, Tuple
from fbpcs.entity.container_instance... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,312 | supasate/FBPCS | refs/heads/main | /tests/service/test_log_cloudwatch.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import MagicMock, patch
from fbpcs.service.log_cloudwatch import CloudWatchLogServi... | {"/tests/util/test_yaml.py": ["/fbpcs/util/yaml.py"], "/tests/error/mapper/test_aws.py": ["/fbpcs/error/mapper/aws.py"], "/fbpcs/gateway/ec2.py": ["/fbpcs/decorator/error_handler.py", "/fbpcs/entity/vpc_instance.py", "/fbpcs/mapper/aws.py"], "/tests/service/test_container_aws.py": ["/fbpcs/service/container_aws.py"], "... |
3,421 | Zed-chi/dvmn_frontend_ch3 | refs/heads/master | /utils.py | import json
import os
import re
import urllib
from bs4 import BeautifulSoup
from pathvalidate import sanitize_filepath
import requests
BASE_URL = "https://tululu.org"
""" helper errors """
class EmptyBookError(ValueError):
pass
class EmptyDetailsError(ValueError):
pass
class EmptyImageError(ValueErr... | {"/app.py": ["/parse_tululu_category.py", "/utils.py"], "/parse_tululu_category.py": ["/utils.py"]} |
3,422 | Zed-chi/dvmn_frontend_ch3 | refs/heads/master | /app.py | import argparse
import logging
import os
from xml.etree.ElementTree import ParseError
from parse_tululu_category import get_links_from_pages
from requests import HTTPError
from utils import (
EmptyBookError,
EmptyDetailsError,
EmptyHTMLError,
EmptyImageError,
URLParseError,
download_image,
... | {"/app.py": ["/parse_tululu_category.py", "/utils.py"], "/parse_tululu_category.py": ["/utils.py"]} |
3,423 | Zed-chi/dvmn_frontend_ch3 | refs/heads/master | /parse_tululu_category.py | import urllib
from bs4 import BeautifulSoup
from utils import get_text_from_url
SFICTION_URL = "https://tululu.org/l55/"
def get_all_book_links_on_page(html):
soup = BeautifulSoup(html, "lxml")
hrefs = soup.select(
"div#content table.d_book tr:first-child td:first-child a"
)
links = [urllib... | {"/app.py": ["/parse_tululu_category.py", "/utils.py"], "/parse_tululu_category.py": ["/utils.py"]} |
3,428 | youngmoon-kang/kiwoomApi_practice | refs/heads/master | /__init__.py | from ui.ui import *
from kiwoom.kiwoom import *
class Main():
def __init__(self):
print("실행할 메인 클래스")
Ui_class()
if __name__ == "__main__":
m = Main()
| {"/__init__.py": ["/kiwoom/kiwoom.py"]} |
3,429 | youngmoon-kang/kiwoomApi_practice | refs/heads/master | /kiwoom/kiwoom.py | from PyQt5.QAxContainer import *
from PyQt5.QtCore import *
from config.errorCode import *
from PyQt5.QtTest import *
class Kiwoom(QAxWidget):
def __init__(self):
super().__init__()
print("kiwoom클래스 입니다.")
########event loop 모음
self.login_event_loop = None
self.detail_acco... | {"/__init__.py": ["/kiwoom/kiwoom.py"]} |
3,450 | diego1castroo/paralelismo-python | refs/heads/main | /funcionesquenoocuerrenenelinterpretedepython.py | from time import sleep, time
from threading import Thread
start = time()
for _ in range(10):
sleep(1)
print('Tomó {} segundos.'.format(time() - start))
threads = []
start = time()
for _ in range(10):
t = Thread(target=sleep, args=(1,))
t.start()
threads.append(t)
for t in threads:
... | {"/testpi2.py": ["/ccalcpi.py"]} |
3,451 | diego1castroo/paralelismo-python | refs/heads/main | /ccalcpi.py | from cython.parallel import parallel, prange
import openmp
from libc.stdlib import malloc, free
import cython
def calcpi(int n):
cdef double result = 0.0
cdef int num_threads
cdef int i, si
with nogil,parallel(num_threads = 6):
for i in prange (2, n * 2, 2):
si = 1 if ((i... | {"/testpi2.py": ["/ccalcpi.py"]} |
3,452 | diego1castroo/paralelismo-python | refs/heads/main | /testpi2.py | from ccalcpi import calcpi
nPoints = 50000000
pi = calcpi(nPoints)
print('OpenMP pi = ', pi, ' for ', nPoints)
| {"/testpi2.py": ["/ccalcpi.py"]} |
3,453 | diego1castroo/paralelismo-python | refs/heads/main | /setup2.py | from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules=[
Extension("ccalcpi",
["ccalcpi.pyx"],
extra_compile_args = ["-03", "-ffast-math", "-march-nativ"],
ex... | {"/testpi2.py": ["/ccalcpi.py"]} |
3,457 | marbibu/myCad | refs/heads/master | /Point.py | from Sender import Sender
class Point(Sender):
def __init__(s,x,y):
#Dane:
Sender.__init__(s)
s.__x,s.__y=x,y
s.__X,s.__Y=x,y
s.__visible=1
s.__exist=1
s.__selected=0
#Definicje:
s.create()
s.sh... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,458 | marbibu/myCad | refs/heads/master | /Main.py | from Window import Window
from Desk import Desk
from Point import Point
from Path import Path
class Main:
def __init__(s):
#Dane:
win=Window("Point",0,0,600,600)
master=win.getMaster()
desk=Desk(master)
C=desk.getC()
... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,459 | marbibu/myCad | refs/heads/master | /PointGUI.py | class PointGUI:
__r=6
def __init__(s,C,point):
#Dane:
s.__C=C
s.__point=point
#Definicje:
s.__draw()
def __draw(s):#Rysuje punkt:
x,y=s.__point.getXY()
s.__tag=s.__C.create_oval(x-s.__r,y-s.__r,x+s.__r,y+s.__r,fill="go... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,460 | marbibu/myCad | refs/heads/master | /Desk.py | from PointGUI import PointGUI
from PathGUI import PathGUI
from Tkinter import Canvas
class Desk:
def __init__(s,master):
#Dane:
s.__master=master
#Definicje:
s.__draw()
def __draw(s):#Rysuje kontrolke
s.__C=Canvas(s.__master,highlightthickness=0,b... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,461 | marbibu/myCad | refs/heads/master | /Listener.py | class Listener:
#Klasa, ktora umozliwia odbieranie sygnalow od nadawcy
def __init__(s):
#Dane:
pass
def receiveSignal(s,sender):
print "Nie zaimplementowano odbierania sygnalow"
def listen2(s,sender):#Rozpoczyna nasluchiwanie wskazanego nadawcy
sen... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,462 | marbibu/myCad | refs/heads/master | /Sender.py | class Sender:
#Klasa, ktora rozsyla info do odbiorcow
def __init__(s):
#Dane:
s.__listeners=[]
def addListener(s,listener):#Dodaje sluchacza
s.__listeners.append(listener)
def delListener(s,listener):#Usuwa sluchacza
s.__listeners.remove(listener)
... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,463 | marbibu/myCad | refs/heads/master | /PathGUI.py | class PathGUI:
def __init__(s,C,path):
#Dane:
s.__C=C
s.__path=path
#Definicje:
s.__draw()
def __draw(s):#Rysuje sciezke
coords=s.__path.getCoords()
s.__C.create_line(*coords)#zalezy od warstwy | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,464 | marbibu/myCad | refs/heads/master | /Path.py | from Sender import Sender
class Path(Sender):
def __init__(s):
#Dane:
Sender.__init__(s)
s.__points=[]
s.__current=None
def selectPoint(s,point):#Zaznacza punkt
if s.__current==None:
pass
else:
s.__cu... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,465 | marbibu/myCad | refs/heads/master | /Window.py | from Tkinter import Tk
class Window:
def __init__(s,title,x,y,w,h):
#Dane:
s.__title=title
s.__x,s.__y=x,y
s.__w,s.__h=w,h
#Definicje:
s.__draw()
def __draw(s):#Rysuje okno
s.__master=Tk()
s.__master.geometry("%s... | {"/Point.py": ["/Sender.py"], "/Main.py": ["/Window.py", "/Desk.py", "/Point.py", "/Path.py"], "/Desk.py": ["/PointGUI.py", "/PathGUI.py"], "/Path.py": ["/Sender.py"]} |
3,508 | Mi7ai/Django | refs/heads/master | /accounts/urls.py | from django.urls import path, include
from django.contrib.auth import views as auth_views
from .views import ProfileView, SignupView, SignupDoneView
from django.views.generic import base as generic_views
# app_name = 'accounts'
urlpatterns = [
path('', include('django.contrib.auth.urls')),
path('profile/', Pr... | {"/accounts/urls.py": ["/accounts/views.py"]} |
3,509 | Mi7ai/Django | refs/heads/master | /accounts/views.py | from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic import TemplateView, CreateView
# from django.views.generic import CreateView
from .forms import UserSignUpForm
# Create your views here.
class ProfileView(TemplateView):
template_name = 'accounts/profile.html'
clas... | {"/accounts/urls.py": ["/accounts/views.py"]} |
3,510 | datosh/PyEngine | refs/heads/master | /mace_runner.py | import math
import pygame
import game
from pygame.locals import *
class Player(pygame.sprite.Sprite):
"""A player that is going to run around in the maze."""
def __init__(self, x, y, width, height):
super(Player, self).__init__()
# Set the visuals and the position
self.width = widt... | {"/mace_runner.py": ["/game.py"], "/gestrandet.py": ["/game.py"], "/brick_buster.py": ["/game.py"]} |
3,511 | datosh/PyEngine | refs/heads/master | /game.py | import pygame
import sys
from pygame.locals import *
def terminate():
pygame.quit()
sys.exit()
class Game(object):
"""This represents the abstract base class for any new game. Every new
game should extend this calss"""
def __init__(self, width=640, height=480):
"""Initializes the Game... | {"/mace_runner.py": ["/game.py"], "/gestrandet.py": ["/game.py"], "/brick_buster.py": ["/game.py"]} |
3,512 | datosh/PyEngine | refs/heads/master | /gestrandet.py | import game
import pygame
from pygame.locals import *
class SpriteSheet(object):
"""Helper class to load single images from a sprite sheet"""
# This points to the sprite sheet image
sprite_sheet = None
def __init__(self, file_name):
super(SpriteSheet, self).__init__()
self.file_na... | {"/mace_runner.py": ["/game.py"], "/gestrandet.py": ["/game.py"], "/brick_buster.py": ["/game.py"]} |
3,513 | datosh/PyEngine | refs/heads/master | /brick_buster.py | import math
import game
import random
import pygame
from pygame.locals import *
class Block(pygame.sprite.Sprite):
"""Implements a basic block in the game using pygames Sprite class"""
def __init__(self, x=0, y=0):
super(Block, self).__init__()
self.image = pygame.Surface([32, 16])
... | {"/mace_runner.py": ["/game.py"], "/gestrandet.py": ["/game.py"], "/brick_buster.py": ["/game.py"]} |
3,618 | KatherineSeng/CECS450-Group3-Project1 | refs/heads/master | /parse.py | import codecs
import re
import nltk
def stripExtra(name):
"""This function removes paranthesis from a string
*Can later be implemented for other uses like removing other characters from string
Args:
name (string): character's name
Returns:
string: character's name without paranthesis
"""
... | {"/wordcloud.py": ["/parse.py"]} |
3,619 | KatherineSeng/CECS450-Group3-Project1 | refs/heads/master | /beemovie.py |
import codecs
import re
def reduceLine(dialogue):
keepReducing = True
spokenTxt = ""
while(keepReducing):
space=dialogue.find(" ",34)
newDialogue = dialogue[:space]
spokenTxt+="\n " + newDialogue.strip()
dialogue=dialogue[space:]
if(len(dialogue)>34):
keepReducin... | {"/wordcloud.py": ["/parse.py"]} |
3,620 | KatherineSeng/CECS450-Group3-Project1 | refs/heads/master | /wordcloud.py | import tkinter as tk
import random
import parse
from tkinter import simpledialog
colors = ["blue","red","orange","green","purple"]
#word:[label,place]
labelDic = {}
#label placement coordinates
placements = []
class Text(tk.Label):
"""This class is used to generate the words in the word cloud. A... | {"/wordcloud.py": ["/parse.py"]} |
3,640 | ashaychangwani/AILearnsSnake | refs/heads/master | /PlayGameAI.py | import pygame
import pickle
from snake import Environment, snake
from nn import NeuralNet
import time
import copy
from params import *
file = open('saved/model.pickle', "rb")
snake_generations = pickle.load(file)
file.close()
pygame.init()
pygame.font.init()
myfont = pygame.font.SysFont('Bitstream Vera Serif', 20)... | {"/PlayGameAI.py": ["/snake.py", "/nn.py", "/params.py"], "/ga.py": ["/snake.py", "/params.py"], "/snake.py": ["/nn.py"], "/PlayGameHuman.py": ["/snake.py", "/nn.py", "/params.py"]} |
3,641 | ashaychangwani/AILearnsSnake | refs/heads/master | /params.py | display_width = 540
display_height = 440
unit = 10
NN_shape = [24, 16, 3]
init_NN = True
population_size = 50
no_of_generations = 100
percentage_best_performers = 20.0
percentage_worst_performers = 2.0
mutation_percent = 7.0
mutation_intensity = 0.1
cherry = (150, 0, 0)
blue = (106, 133, 164)
pink = (171, 54, 81)
g... | {"/PlayGameAI.py": ["/snake.py", "/nn.py", "/params.py"], "/ga.py": ["/snake.py", "/params.py"], "/snake.py": ["/nn.py"], "/PlayGameHuman.py": ["/snake.py", "/nn.py", "/params.py"]} |
3,642 | ashaychangwani/AILearnsSnake | refs/heads/master | /ga.py | import random
import pickle
import time
from snake import Environment, snake
import numpy as np
import matplotlib.pyplot as plt
from params import *
class GeneticAlgo:
def __init__(self, display_width, display_height, unit, NN_shape, init_NN, population_size, no_of_generations,
percentage_best_pe... | {"/PlayGameAI.py": ["/snake.py", "/nn.py", "/params.py"], "/ga.py": ["/snake.py", "/params.py"], "/snake.py": ["/nn.py"], "/PlayGameHuman.py": ["/snake.py", "/nn.py", "/params.py"]} |
3,643 | ashaychangwani/AILearnsSnake | refs/heads/master | /snake.py | from pygame import draw, image, transform
from nn import NeuralNet
import random
class Environment:
def __init__(self, display_height, display_width, unit_size):
"""Creates an object of type Environment.
Args:
display_height (int): Height of display in pixels.
display_widt... | {"/PlayGameAI.py": ["/snake.py", "/nn.py", "/params.py"], "/ga.py": ["/snake.py", "/params.py"], "/snake.py": ["/nn.py"], "/PlayGameHuman.py": ["/snake.py", "/nn.py", "/params.py"]} |
3,644 | ashaychangwani/AILearnsSnake | refs/heads/master | /nn.py | import numpy as np
import random
class NeuralNet:
def __init__(self, NN_shape, display_width, display_height, unit, init_NN=True):
"""Initializes a class of type NeuralNet.
Args:
NN_shape (list): Shape of the neural network architecure
display_width (int): Width of display... | {"/PlayGameAI.py": ["/snake.py", "/nn.py", "/params.py"], "/ga.py": ["/snake.py", "/params.py"], "/snake.py": ["/nn.py"], "/PlayGameHuman.py": ["/snake.py", "/nn.py", "/params.py"]} |
3,645 | ashaychangwani/AILearnsSnake | refs/heads/master | /PlayGameHuman.py | import pygame
import pickle
from snake import Environment, snake
from nn import NeuralNet
import time
import copy
from params import *
file = open('saved/test.pickle', "rb")
snake_generations = pickle.load(file)
file.close()
best_snake = snake_generations[len(snake_generations)-1][0]
clock = pygame.time.Clock()
py... | {"/PlayGameAI.py": ["/snake.py", "/nn.py", "/params.py"], "/ga.py": ["/snake.py", "/params.py"], "/snake.py": ["/nn.py"], "/PlayGameHuman.py": ["/snake.py", "/nn.py", "/params.py"]} |
3,647 | hdodenhof/NuimoSonosController | refs/heads/master | /sonos.py | import logging
import threading
from Queue import Empty
import soco
from soco.events import event_listener
class SonosAPI:
STATE_PLAYING = 'PLAYING'
STATE_PAUSED = 'PAUSED_PLAYBACK'
STATE_TRANSITIONING = 'TRANSITIONING'
def __init__(self):
self.players = soco.discover()
for player ... | {"/controller.py": ["/nuimo.py", "/sonos.py"], "/nuimo.py": ["/gatt.py"]} |
3,648 | hdodenhof/NuimoSonosController | refs/heads/master | /controller.py | #!/usr/bin/python
from __future__ import division
import logging
import math
import signal
import sys
import time
from threading import Timer
import led_configs
from nuimo import Nuimo, NuimoDelegate
from sonos import SonosAPI
nuimo_sonos_controller = None
class NuimoSonosController(NuimoDelegate):
def __in... | {"/controller.py": ["/nuimo.py", "/sonos.py"], "/nuimo.py": ["/gatt.py"]} |
3,649 | hdodenhof/NuimoSonosController | refs/heads/master | /nuimo.py | from __future__ import division
import threading
from bled112 import Bled112Com
from gatt import BleManager, BleRemoteTimeout, BleLocalTimeout
import logging
import time
SERVICE_UUIDS = [
'180f', # Battery
'f29b1525-cb19-40f3-be5c-7241ecb82fd2', # Sensors
'f29b1523-cb19-40f3-be5c-7241ecb82fd1' # LED Ma... | {"/controller.py": ["/nuimo.py", "/sonos.py"], "/nuimo.py": ["/gatt.py"]} |
3,650 | hdodenhof/NuimoSonosController | refs/heads/master | /gatt.py | from bled112 import *
DEBUG = True
INFO = True
def macString(mac):
return '%02X:%02X:%02X:%02X:%02X:%02X' % (mac[5], mac[4], mac[3], mac[2], mac[1], mac[0])
class Timeout:
"""Simplify timeout interval management"""
def __init__(self, interval):
self.start = time.time()
self.interval = int... | {"/controller.py": ["/nuimo.py", "/sonos.py"], "/nuimo.py": ["/gatt.py"]} |
3,651 | jcfellers/DSP539_pyExam | refs/heads/master | /Jfellers_kmers.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 21 13:34:17 2021
@author: Justin
"""
from collections import Counter
import pandas as pd
import sys
# function for possible kmers
def possible_kmers(string, k):
'''
Parameters
----------
string :
Type: string
Description: Any string of ch... | {"/test_Jfellers_kmers.py": ["/Jfellers_kmers.py"]} |
3,652 | jcfellers/DSP539_pyExam | refs/heads/master | /test_Jfellers_kmers.py | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 29 09:45:29 2021
@author: Justin
"""
from Jfellers_kmers import *
# Setup: decisions for testing environment
file = 'strings.txt'
open_file = open(file, 'r')
# Testing Parameters: use first string in file & k = 7
line = open_file.readline()[:-1]
k_test = 7
# Expect... | {"/test_Jfellers_kmers.py": ["/Jfellers_kmers.py"]} |
3,653 | aaronn/django-rest-framework-passwordless | refs/heads/master | /tests/test_verification.py | from rest_framework import status
from rest_framework.authtoken.models import Token
from django.utils.translation import gettext_lazy as _
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from drfpasswordless.settings import api_settings, DEFAULT... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,654 | aaronn/django-rest-framework-passwordless | refs/heads/master | /tests/models.py | from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import BaseUserManager
from django.core.validators import RegexValidator
from django.db import models
phone_regex = RegexValidator(regex=r'^\+[1-9]\d{1,14}$',
message="Mobile number must be entered in t... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,655 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/serializers.py | import logging
from django.utils.translation import gettext_lazy as _
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from django.core.validators import RegexValidator
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from drf... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,656 | aaronn/django-rest-framework-passwordless | refs/heads/master | /tests/test_authentication.py | from rest_framework import status
from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from drfpasswordless.settings import api_settings, DEFAULTS
from drfpasswordless.utils import CallbackToken
Use... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,657 | aaronn/django-rest-framework-passwordless | refs/heads/master | /tests/urls.py | from django.urls import path, include
from rest_framework.urlpatterns import format_suffix_patterns
from drfpasswordless.settings import api_settings
from drfpasswordless.views import (ObtainEmailCallbackToken,
ObtainMobileCallbackToken,
ObtainAuthTo... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,658 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/__init__.py | # -*- coding: utf-8 -*-
__title__ = 'drfpasswordless'
__version__ = '1.5.8'
__author__ = 'Aaron Ng'
__license__ = 'MIT'
__copyright__ = 'Copyright 2022 Aaron Ng'
# Version synonym
VERSION = __version__
default_app_config = 'drfpasswordless.apps.DrfpasswordlessConfig'
| {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,659 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/services.py | from django.utils.module_loading import import_string
from drfpasswordless.settings import api_settings
from drfpasswordless.utils import (
create_callback_token_for_user,
)
class TokenService(object):
@staticmethod
def send_token(user, alias_type, token_type, **message_payload):
token = create_ca... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,660 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/signals.py | import logging
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.dispatch import receiver
from django.db.models import signals
from drfpasswordless.models import CallbackToken
from drfpasswordless.models import generate_numeric_token
from drfpasswordless.setti... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,661 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class DrfpasswordlessConfig(AppConfig):
name = 'drfpasswordless'
verbose = _("DRF Passwordless")
def ready(self):
import drfpasswordless.signals
| {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,662 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/migrations/0004_auto_20200125_0853.py | # Generated by Django 3.0.2 on 2020-01-25 08:53
from django.db import migrations, models
import drfpasswordless.models
class Migration(migrations.Migration):
dependencies = [
('drfpasswordless', '0003_callbacktoken_type'),
]
operations = [
migrations.AlterField(
model_name='... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,663 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/utils.py | import logging
import os
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from django.core.mail import send_mail
from django.template import loader
from django.utils import timezone
from rest_framework.authtoken.models import Token
from drfpasswordless.models import Cal... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,664 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/admin.py | from django.contrib import admin
from django.urls import reverse
from drfpasswordless.models import CallbackToken
class UserLinkMixin(object):
"""
A mixin to add a linkable list_display user field.
"""
LINK_TO_USER_FIELD = 'link_to_user'
def link_to_user(self, obj):
link = reverse('admin:... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,665 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/urls.py | from drfpasswordless.settings import api_settings
from django.urls import path
from drfpasswordless.views import (
ObtainEmailCallbackToken,
ObtainMobileCallbackToken,
ObtainAuthTokenFromCallbackToken,
VerifyAliasFromCallbackToken,
ObtainEmailVerificationCallbackToken,
ObtainMobileVerifica... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,666 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/views.py | import logging
from django.utils.module_loading import import_string
from rest_framework import parsers, renderers, status
from rest_framework.response import Response
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.views import APIView
from drfpasswordless.models import CallbackTo... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,667 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/migrations/0003_callbacktoken_type.py | # Generated by Django 3.0.2 on 2020-01-22 08:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('drfpasswordless', '0002_auto_20200122_0424'),
]
operations = [
migrations.AddField(
model_name='callbacktoken',
name... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,668 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/settings.py | from django.conf import settings
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'PASSWORDLESS_AUTH', None)
DEFAULTS = {
# Allowed auth types, can be EMAIL, MOBILE, or both.
'PASSWORDLESS_AUTH_TYPES': ['EMAIL'],
# URL Prefix for Authentication Endpoints
'PASSWORDLES... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,669 | aaronn/django-rest-framework-passwordless | refs/heads/master | /drfpasswordless/models.py | import uuid
from django.db import models
from django.conf import settings
import string
from django.utils.crypto import get_random_string
def generate_hex_token():
return uuid.uuid1().hex
def generate_numeric_token():
"""
Generate a random 6 digit string of numbers.
We use this formatting to allow le... | {"/tests/test_verification.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/drfpasswordless/serializers.py": ["/drfpasswordless/models.py", "/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "/tests/test_authentication.py": ["/drfpasswordless/settings.py", "/drfpasswordless/utils.py"], "... |
3,681 | mrpal39/ev_code | refs/heads/master | /awssam/django-blog/src/django_blog/blogroll.py | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: blogroll
Description :
Author : JHao
date: 2020/10/9
-------------------------------------------------
Change Activity:
2020/10/9:
----------------------------------------------... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,682 | mrpal39/ev_code | refs/heads/master | /tc_zufang/tc_zufang-slave/tc_zufang/spiders/testip.py | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
class testSpider(RedisSpider):
name = 'testip'
redis_key = 'testip'
def parse(self,response):
response_selector = Selector(response)
code=response_selector.xpath(r'//div[contains(@class,... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,683 | mrpal39/ev_code | refs/heads/master | /awssam/ideablog/core/models.py | from django.db import models
from tinymce.models import HTMLField
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Post(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
description =HTMLField()
date... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,684 | mrpal39/ev_code | refs/heads/master | /Web-UI/scrapyproject/scrapy_packages/rabbitmq/scheduler.py | import connection
import queue
from scrapy.utils.misc import load_object
from scrapy.utils.job import job_dir
SCHEDULER_PERSIST = False
QUEUE_CLASS = 'queue.SpiderQueue'
IDLE_BEFORE_CLOSE = 0
class Scheduler(object):
def __init__(self, server, persist,
queue_key, queue_cls, idle_before_close,
... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,685 | mrpal39/ev_code | refs/heads/master | /scrap/tutorial/scrap/spiders/testing.py | import scrapy
class MySpider(scrapy.Spider):
name = 'myspider'
start_urls = ['http://example.com']
def parse(self, response):
print(f"Existing settings: {self.settings.attributes.keys()}")
class MyExtension:
def __init__(self, log_is_enabled=False):
if log_is_enabled:
print... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,686 | mrpal39/ev_code | refs/heads/master | /tc_zufang/tc_zufang/tc_zufang/spiders/tczufang_detail_spider.py | # -*- coding: utf-8 -*-
from scrapy_redis.spiders import RedisSpider
from scrapy.selector import Selector
from tc_zufang.utils.result_parse import list_first_item
from scrapy.http import Request
from tc_zufang.utils.InsertRedis import inserintotc,inserintota
import re
defaultencoding = 'utf-8'
'''
58同城的爬虫
'''
#继承自Redis... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,687 | mrpal39/ev_code | refs/heads/master | /scrap/properties/properties/pipelines.py | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
class PropertiesPipeline(object):
def process_item(self, item, spider):
return item
ITEM_PIPELINES = {
'scrapy... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,688 | mrpal39/ev_code | refs/heads/master | /Web-UI/scrapyproject/forms.py | from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django.contrib.auth.forms import PasswordChangeForm
class CreateProject(forms.Form):
projectname = forms.SlugField(label="Enter project name", max_length=50, required=True)
helper = FormHelper()
... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,689 | mrpal39/ev_code | refs/heads/master | /awssam/ideablog/core/migrations/0004_auto_20201113_0633.py | # Generated by Django 3.1.3 on 2020-11-13 06:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20201113_0620'),
]
operations = [
migrations.AddField(
model_name='feeds',
name='description',
... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,690 | mrpal39/ev_code | refs/heads/master | /awssam/iam/users/urls.py | from django.conf.urls import url, include
import oauth2_provider.views as oauth2_views
from django.conf import settings
from .views import ApiEndpoint
from django.urls import include, path
# OAuth2 provider endpoints
oauth2_endpoint_views = [
path('authorize/', oauth2_views.AuthorizationView.as_view(), name="autho... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,691 | mrpal39/ev_code | refs/heads/master | /Web-UI/mysite/views.py | from django.http import HttpResponse, Http404
from django.shortcuts import render
import datetime
from django.http import HttpResponseRedirect
from django.core.mail import send_mail
from django.contrib.auth.views import login as loginview
from registration.backends.simple import views
from django.contrib.auth import au... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,692 | mrpal39/ev_code | refs/heads/master | /Web-UI/scrapyproject/migrations/0005_auto_20170213_1053.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scrapyproject', '0004_pipeline_pipeline_function'),
]
operations = [
migrations.RemoveField(
model_name='project... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,693 | mrpal39/ev_code | refs/heads/master | /awssam/ideablog/core/migrations/0006_auto_20201114_0452.py | # Generated by Django 3.1.3 on 2020-11-14 04:52
from django.db import migrations, models
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_feeds_content'),
]
operations = [
migrations.CreateModel(
name='MyModel',
fields=... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,694 | mrpal39/ev_code | refs/heads/master | /Web-UI/examples/link_generator.py | # This script is written under the username admin, with project name Retrofm
# Change the class name AdminRetrofmSpider accordingly
import datetime
_start_date = datetime.date(2012, 12, 25)
_initial_date = datetime.date(2012, 12, 25)
_priority = 0
start_urls = ['http://retrofm.ru']
def parse(self, response):
whi... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,695 | mrpal39/ev_code | refs/heads/master | /myapi/devfile/core/forms.py | from django import forms
#Building a search view
class SearchForm(forms.Form):
query =forms.CharField()
class uploadForm(forms.ModelForm):
images=forms.ImageField()
# # from .forms import EmailPostForm, CommentForm , SearchForm
# User Repositories='https://libraries.io/api/github/:login/repositories?... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,696 | mrpal39/ev_code | refs/heads/master | /tc_zufang/tc_zufang-slave/tc_zufang/utils/result_parse.py | # -*- coding: utf-8 -*-
#如果没有下一页的地址则返回none
list_first_item = lambda x:x[0] if x else None
| {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,697 | mrpal39/ev_code | refs/heads/master | /myapi/fullfeblog/blog/forms.py | from django import forms
from core.models import Comment
#Building a search view
class SearchForm(forms.Form):
query =forms.CharField()
class EmailPostForm(forms.Form):
name = forms.CharField(max_length=25)
email = forms.EmailField()
to = forms.EmailField()
comments = forms.CharField(required=... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,698 | mrpal39/ev_code | refs/heads/master | /awssam/django-blog/src/blog/views.py | # -*- coding: utf-8 -*-
# Create your views here.
import json
from django.http import JsonResponse
from django_blog.util import PageInfo
from blog.models import Article, Comment
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, get_object_or_404
def get_page(request):
page... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,699 | mrpal39/ev_code | refs/heads/master | /myapi/fullfeblog/blog/models.py |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from taggit.managers import TaggableManager
from django.urls import reverse
import logging
from abc import ABCMeta, abstractmethod, abstractproperty
from django.db import models
from django.urls import reverse
f... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,700 | mrpal39/ev_code | refs/heads/master | /awssam/wikidj/wikidj/settings.py |
import os
from django.urls import reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'vsfygxju9)=k8qxmc9!__ng%dooyn-w7il_z+w)grvkz4ks!)u'
# SECURITY WARNING: don't run with debug turned on in produ... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,701 | mrpal39/ev_code | refs/heads/master | /awssam/fullfeblog/core/models.py | from django.db import models
from blog.models import Post
# Creating a comment systems
class Comment(models.Model):
post = models.ForeignKey(Post,
on_delete=models.CASCADE,
related_name='comments')
name=models.CharField(max_length=200)
email=models.EmailField()
body... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,702 | mrpal39/ev_code | refs/heads/master | /tc_zufang/django_web/datashow/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from mongoengine import *
from django.db import models
# Create your models here.
class ItemInfo(Document):
# 帖子名称
title = StringField()
# 租金
money = StringField()
# 租赁方式
method = StringField()
# 所在区域
area = StringField()
... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,703 | mrpal39/ev_code | refs/heads/master | /myapi/devfile/gitapi/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.api, name='api'),
path('t/', views.simple_upload, name='test'),
]
| {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,704 | mrpal39/ev_code | refs/heads/master | /tc_zufang/tc_zufang-slave/tc_zufang/items.py | # -*- coding: utf-8 -*-
#定义需要抓取存进数据库的字段
from scrapy.item import Item,Field
class TcZufangItem(Item):
#帖子名称
title=Field()
#租金
money=Field()
#租赁方式
method=Field()
#所在区域
area=Field()
#所在小区
community=Field()
#帖子详情url
targeturl=Field()
#帖子发布时间
pub_time=Field()
#所在城市... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,705 | mrpal39/ev_code | refs/heads/master | /scrap/properties/properties/spiders/basictest.py | from scrapy.loader.processors import MapCompose, Join
from scrapy.loader import ItemLoader
from properties.items import PropertiesItem
import datetime
from urllib.parse import urlparse
import socket
import scrapy
class BasicSpider(scrapy.Spider):
name = "basictest"
allowed_domains = ["web"]
start_urls=(
... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,706 | mrpal39/ev_code | refs/heads/master | /eswork/articles/articles/pipelines.py | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
import logging
# import MySQLdb
# import MySQLdb.cursors
import copy
import pymysql
from twisted.enterprise import adbapi
#... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,707 | mrpal39/ev_code | refs/heads/master | /myapi/devfile/request/api.py | # import requests
# url = "https://proxy-orbit1.p.rapidapi.com/v1/"
# headers = {
# 'x-rapidapi-key': "b188eee73cmsha4c027c9ee4e2b7p1755ebjsn1e0e0b615bcf",
# 'x-rapidapi-host': "proxy-orbit1.p.rapidapi.com"
# }
# # response = requests.request("GET", url, headers=headers)
# print(response.text)
import reque... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,708 | mrpal39/ev_code | refs/heads/master | /awssam/devfile/core/urls.py | from django.urls import path
from . import views
from django.conf.urls import include, url
from django.views import generic
from material.frontend import urls as frontend_urls
urlpatterns = [
path('', views.home, name='home'),
path('$/', generic.RedirectView.as_view(url='/workflow/', permanent=False)),
pat... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,709 | mrpal39/ev_code | refs/heads/master | /Web-UI/examples/scraper.py | # You need to create an Item name 'played' for running this script
# item['ack_signal'] = int(response.meta['ack_signal']) - this line is used for sending ack signal to RabbitMQ
def parse(self, response):
item = played()
songs = response.xpath('//li[@class="player-in-playlist-holder"]')
indexr = response.ur... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,710 | mrpal39/ev_code | refs/heads/master | /awssam/myscrapyproject/scrapyapi/srp/models.py | # from __future__ import unicode_literals
# from django.utils.encoding import python_2_unicode_compatible
# from django.db import models
# from django.db.models.signals import pre_delete
# from django.dispatch import receiver
# from scrapy_djangoitem import DjangoItem
# from dynamic_scraper.models import Scraper, Sched... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,711 | mrpal39/ev_code | refs/heads/master | /myapi/devfile/core/views.py | from django.shortcuts import render
from .forms import SearchForm
import requests
def base(request):
# import requests
# # url = "https://gplaystore.p.rapidapi.com/newFreeApps"
# url="https://libraries.io/api/"
# querystring = {"platforms":"NPM/base62"}
# headers = {'x-rapidapi-key': "?api_key=30... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,712 | mrpal39/ev_code | refs/heads/master | /myapi/devfile/gitapi/views.py | from django.http import response
from django.shortcuts import render
from .forms import DocumentForm
import requests
from django.shortcuts import render
from django.conf import settings
from django.core.files.storage import FileSystemStorage
def simple_upload(request):
if request.method == 'POST':
myfile... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
3,713 | mrpal39/ev_code | refs/heads/master | /Web-UI/scrapyproject/views.py | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth import update_session_auth_hash
from .forms import CreateProject, DeleteProject, ItemName, FieldName, CreatePipeline, LinkGenerator, Scraper, Settings, ShareDB, ChangePass, ShareProject
from django.htt... | {"/awssam/iam/users/urls.py": ["/awssam/iam/users/views.py"], "/myapi/devfile/core/views.py": ["/myapi/devfile/core/forms.py"], "/Web-UI/scrapyproject/views.py": ["/Web-UI/scrapyproject/forms.py", "/Web-UI/scrapyproject/models.py"], "/awssam/ideablog/core/admin.py": ["/awssam/ideablog/core/models.py"], "/awssam/wikidj/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.