index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
66,471 | PorterDalton1/Text_Adventure | refs/heads/master | /window_GUI.py | """
This file provides the GUI for the text adventure.
"""
import tkinter
class WindowBase:
def __init__(self, master):
self.master = master
self.master.configure(background = "black")
self.master.minsize(600, 400)
def main():
x = tkinter.Tk()
WindowBase(x)
x.mainloop()
if __... | {"/main.py": ["/window_GUI.py"]} |
66,488 | SameerJain901/CoronaVisualizer | refs/heads/master | /loader.py | import pandas as pd
import numpy as np
import json
import datetime
import geojson_rewind
import plotly.graph_objects as go
import plotly.io as pio
cdata=pd.read_csv('cdata.csv')
fdata=pd.read_csv('forecasts.csv')
final_data=pd.read_csv("final_data.csv")
map_json = json.load(open("out2.json"))
def prepare_mapviz(cdata... | {"/visualizer_heroku.py": ["/loader.py"]} |
66,489 | SameerJain901/CoronaVisualizer | refs/heads/master | /visualizer_heroku.py | import streamlit as st
import os
import os.path
import sys
import time
import pandas as pd
import numpy as np
import re
import requests as rq
from bs4 import BeautifulSoup
import json
import datetime
import logging
import plotly.graph_objects as go
import plotly.io as pio
import SessionState
from plotly.subplots impo... | {"/visualizer_heroku.py": ["/loader.py"]} |
66,507 | sanaynesargi/CarControlForPi | refs/heads/master | /arrow.py | import pygame
import requests
class Arrow:
def __init__(self, x, y, width, height, surface, img, name, ovverride):
self.x = x
self.y = y
self.img = img
self.surf = surface
self.pressed = False
self.name = name
self.width = width
self.height = height... | {"/main.py": ["/arrow.py"], "/v1.py": ["/arrow.py"]} |
66,508 | sanaynesargi/CarControlForPi | refs/heads/master | /main.py | import pygame, time, os
from arrow import Arrow
pygame.init()
# PYGAME VARIABLES
S_WIDTH, S_HEIGHT = 300, 300
DIMENSIONS = (S_WIDTH, S_HEIGHT)
win = pygame.display.set_mode(DIMENSIONS)
# COLORS
WHITE = (255, 255, 255)
RED = (255, 10, 10)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
BLACK = (0, 0, 0)
def load_images():
... | {"/main.py": ["/arrow.py"], "/v1.py": ["/arrow.py"]} |
66,509 | sanaynesargi/CarControlForPi | refs/heads/master | /v1.py | # import RPi.GPIO as GPIO
import pygame, time, os
from arrow import Arrow
pygame.init()
# GPIO.setwarnings(False)
# GPIO.setmode(GPIO.BCM)
# GLOBAL VARIBLES
FIRST_CONTROL_PINS = [5, 6, 19, 26]
SECOND_CONTOL_PINS = [21, 20, 16, 12]
# PYGAME VARIABLES
S_WIDTH, S_HEIGHT = 300, 300
DIMENSIONS = (S_WIDTH, S_HEIGHT)
win ... | {"/main.py": ["/arrow.py"], "/v1.py": ["/arrow.py"]} |
66,525 | cherylyli/botlikeme | refs/heads/master | /dictogram.py | # Make a dictionary to store all the tokens from the sentences
# Each key is associated with an array of dictionaries
# Key: a word
# Value: all the words that came after that word, with weights assigned to it
# TODO:
# count how many words in a sentence, use this to influence length of sentence
import re
class Di... | {"/parse_text.py": ["/dictogram.py"]} |
66,526 | cherylyli/botlikeme | refs/heads/master | /generate_with_seed.py | import sys
import json
from random import randint
import numpy as np
# takes seed from command ling
arguments = sys.argv[1:]
arguments = ' '.join(arguments)
sentence = '[START] '
sentence += arguments
print("seeding with: " + arguments + " ...")
dictionary = {}
# imports the dictionary
with open('data/dict.txt', '... | {"/parse_text.py": ["/dictogram.py"]} |
66,527 | cherylyli/botlikeme | refs/heads/master | /data/parse_messages.py | from bs4 import BeautifulSoup
import json
soup = BeautifulSoup(open("messages.htm"), "lxml")
message_threads = soup.find_all('p')
# get all the messages into an array object
messages = []
for message in message_threads:
messages = messages + message.contents
with open('input.txt', 'w') as fp:
json.dump('\n'.join(... | {"/parse_text.py": ["/dictogram.py"]} |
66,528 | cherylyli/botlikeme | refs/heads/master | /parse_text.py | from dictogram import Dictogram
import json
test_dict = Dictogram()
with open('data/input.txt', 'r') as fp:
file = fp.read()
test_sentence = test_dict.add_many_tokens(file)
with open('data/dict.txt', 'w') as output:
json.dump(test_sentence, output) | {"/parse_text.py": ["/dictogram.py"]} |
66,542 | Marck-G/IMTRA | refs/heads/master | /search_engine/reader.py | # MIT License
#
# Copyright (c) 2019 MARCK C. GUZMAN, UNAI DIAZ DE GARAYO
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,543 | Marck-G/IMTRA | refs/heads/master | /image_transfer/db_manager.py | # MIT License
#
# Copyright (c) 2019 MARCK C. GUZMAN, UNAI DIAZ DE GARAYO
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,544 | Marck-G/IMTRA | refs/heads/master | /search_engine/db_manager.py | # MIT License
#
# Copyright (c) 2019 MARCK C. GUZMAN, UNAI DIAZ DE GARAYO
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,545 | Marck-G/IMTRA | refs/heads/master | /conn.py |
class Test:
dic_col_tag = {
"EXIF CreationDate": "make_date",
"Image Make":"camera",
"Image CameraModel": "model",
"EXIF IsoSpeedRatio": "iso"}
strings = ["make_date", "model", "camera"]
def add_item(self, map):
insert_sql = "INSERT INTO {}({}) values({})"
... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,546 | Marck-G/IMTRA | refs/heads/master | /image_manager/backup_tools.py | import tarfile as tar
import os
class ImageBackup:
__instance__ = None
_dir = None
_out_file = None
# SINGLETON
def __new__(cls, *args, **kwargs):
if cls.__instance__ is None:
cls.__instance__ = object.__new__(cls)
return cls.__instance__
def set_dir(self, directo... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,547 | Marck-G/IMTRA | refs/heads/master | /__init__.py | import eel as app
| {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,548 | Marck-G/IMTRA | refs/heads/master | /search_engine/__init__.py | # MIT License
#
# Copyright (c) 2019 MARCK C. GUZMAN, UNAI DIAZ DE GARAYO
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,549 | Marck-G/IMTRA | refs/heads/master | /image_transfer/transfer.py | import os
import datetime
from search_engine import reader
from utils.logger import Logger
from image_transfer.data_interpreter import dir as DIR
class Transfer:
__name__ = 'Image Transfer Module'
__base_dir__ = None
__dest_dir__ = None
__ext_file__ = 'f.ext'
__extensions__ = None # list with allo... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,550 | Marck-G/IMTRA | refs/heads/master | /__main__.py | import eel as app
from gui import show_dir_chouser as select_dir
app.init('views')
@app.expose
def chouse_folder(targe, title='Selection', initialdir=False):
directory = select_dir(title=title, initialdir= None if not initialdir else initialdir )
set_by_id(targe, str(directory))
def set_by_id(id, content):... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,551 | Marck-G/IMTRA | refs/heads/master | /gui/__init__.py | # need Tkinter to install it sudo apt isntall python3-tk
from tkinter import Tk
from tkinter.filedialog import askdirectory
def show_dir_chouser(title, *args, initialdir = None):
"""
ask for user to select a folder
:param title: of the window
:param initialdir: folder to open
:return:
"""
... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,552 | Marck-G/IMTRA | refs/heads/master | /image_manager/__api__.py | from Crypto.Cipher import AES
def aes_key():
return '6pú2BÑq9pfI.Ú'
def api_key():
suit = AES.new(key=aes_key())
with open('api_key.k', "rb") as f:
key = f.read()
return suit.decrypt(key).decode('utf-8')
API_KEY = api_key()
| {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,553 | Marck-G/IMTRA | refs/heads/master | /image_manager/autotagger.py | from clarifai.rest import ClarifaiApp
from image_manager.__api__ import API_KEY
async def tags_from(img):
"""
get tags from image using an api rest
:param img:
:return: dictionary with the tags
"""
app = ClarifaiApp(api_key=API_KEY)
model = app.public_models.general_model
res = model.p... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,554 | Marck-G/IMTRA | refs/heads/master | /image_transfer/data_interpreter.py | import datetime
def dir(d, format = 'yyyy/MM/dd-MM-yy', sys_date=False):
"""
Generate a path string with the date and the format
:param d: date to make the tree dir
:param format: format of the tree dir
:return: string with the tree dir
"""
split_regex = '/'
if ':' in format: split_reg... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,555 | Marck-G/IMTRA | refs/heads/master | /image_transfer/__init__.py | from .transfer import Transfer
from .data_interpreter import * | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,556 | Marck-G/IMTRA | refs/heads/master | /api/__init__.py | from search_engine.reader import Reader
from image_transfer.transfer import Transfer
from image_manager.autotagger import tags_from as tag
def search(data):
pass
def read(petition: dict) -> dict:
assert petition is not None, "Not data found"
key_list = petition.keys()
assert 'image' in key_list, "Ima... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,557 | Marck-G/IMTRA | refs/heads/master | /utils/logger.py | from datetime import datetime
class Logger:
"""
Generate the log file with all the app info
"""
__instance__ = None
output_file = '.log'
prefix = None
# SINGLETON
def __new__(cls, *args, output_file=False, prefix=False):
if cls.__instance__ is None:
cls.__instance_... | {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,558 | Marck-G/IMTRA | refs/heads/master | /image_manager/__init__.py | from .__api__ import API_KEY
| {"/search_engine/db_manager.py": ["/utils/logger.py"], "/search_engine/__init__.py": ["/search_engine/reader.py", "/search_engine/db_manager.py"], "/image_transfer/transfer.py": ["/search_engine/__init__.py", "/utils/logger.py", "/image_transfer/data_interpreter.py"], "/__main__.py": ["/gui/__init__.py"], "/image_manag... |
66,560 | GraceDurham/Welp | refs/heads/master | /resturant_recommender.py | import weather_helper
import yelp_helper
def recommend_based_on_weather(state, city):
#get the temp
temp = weather_helper.fetch_weather(state, city);
str_temp = str(temp)
#based on the temp we are going to populate a search term for yelp
search_term = 'indoor seating'
headline = "It feels like " + str_temp +... | {"/resturant_recommender.py": ["/weather_helper.py", "/yelp_helper.py"], "/resturants.py": ["/resturant_recommender.py"]} |
66,561 | GraceDurham/Welp | refs/heads/master | /yelp_helper.py | from urllib2 import urlopen
from config_secret import*
from urllib import pathname2url
from yelp.client import Client
from yelp.oauth1_authenticator import Oauth1Authenticator
auth = Oauth1Authenticator(
consumer_key=YOUR_CONSUMER_KEY,
consumer_secret=YOUR_CONSUMER_SECRET,
token=YOUR_TOKEN,
token_sec... | {"/resturant_recommender.py": ["/weather_helper.py", "/yelp_helper.py"], "/resturants.py": ["/resturant_recommender.py"]} |
66,562 | GraceDurham/Welp | refs/heads/master | /weather_helper.py |
from config_secret import*
from urllib import pathname2url
from urllib2 import urlopen
from json import load
#takes a city and state and returns the wether
def fetch_weather(state, city):
url_base = 'http://api.wunderground.com/api/' + weather_underground_key
apiUrl = url_base+"/conditions/q/"+pathname2url(state... | {"/resturant_recommender.py": ["/weather_helper.py", "/yelp_helper.py"], "/resturants.py": ["/resturant_recommender.py"]} |
66,563 | GraceDurham/Welp | refs/heads/master | /resturants.py | from flask import Flask
from flask import render_template
from flask import request, url_for, redirect, session, g, flash
import resturant_recommender
app = Flask(__name__, static_url_path='')
@app.route('/recomendations', methods=['GET'])
def list_recomendations():
state = request.args.get("state")
city = request... | {"/resturant_recommender.py": ["/weather_helper.py", "/yelp_helper.py"], "/resturants.py": ["/resturant_recommender.py"]} |
66,618 | ckoppula199/Webcam-Motion-Detector-Logger | refs/heads/master | /Visualisation.py | from bokeh.plotting import show, figure, output_file
from bokeh.models import HoverTool, ColumnDataSource
from MotionDetector import df
#create new columns with strings representing times to be used when hovering over data
df["Start_string"]=df["Start"].dt.strftime("%Y-%m-%d %H:%M:%S")
df["End_string"]=df["End"].dt.st... | {"/Visualisation.py": ["/MotionDetector.py"]} |
66,619 | ckoppula199/Webcam-Motion-Detector-Logger | refs/heads/master | /MotionDetector.py | import cv2, time, pandas, imutils
from imutils.video import VideoStream
from datetime import datetime
# This is used to store the first image seen by the camaera and
# acts as a reference for following images to be compared against
reference_frame = None
status_list = [None, None] # list needs 2 initial items
times = ... | {"/Visualisation.py": ["/MotionDetector.py"]} |
66,626 | JMasekar/Triangle567 | refs/heads/master | /TestTriangle.py | # -*- coding: utf-8 -*-
"""
Updated Jan 21, 2018
The primary goal of this file is to demonstrate a simple unittest implementation
@author: jrr
@author: rk
"""
import unittest
from Triangle import classifyTriangle
# This code implements the unit test functionality
# https://docs.python.org/3/library/unittest.html ha... | {"/TestTriangle.py": ["/Triangle.py"]} |
66,627 | JMasekar/Triangle567 | refs/heads/master | /Triangle.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 13:44:00 2016
Updated Jan 21, 2018
The primary goal of this file is to demonstrate a simple python program to classify triangles
@author: jrr
@author: rk
"""
def classifyTriangle(a, b, c):
"""
Your correct code goes here... Fix the faulty logic below until ... | {"/TestTriangle.py": ["/Triangle.py"]} |
66,629 | AntoineCrb/Raspberry-Master-Device | refs/heads/master | /manual.py | from pynput import keyboard
from communication.control import Control
control = Control()
def on_press(key):
if key.char == 'z':
print('forward')
control.forward()
elif key.char == 's':
print('backward')
control.backward()
elif key.char == 'd':
print(... | {"/manual.py": ["/communication/control.py"], "/test.py": ["/algo.py"], "/autonomous.py": ["/communication/control.py", "/algo.py"]} |
66,630 | AntoineCrb/Raspberry-Master-Device | refs/heads/master | /accelerometer.py | import matplotlib.pyplot as plt
import numpy as np
from datetime import datetime
from mpu6050 import mpu6050
from pynput import keyboard
import scipy.integrate as integrate
import time
plt.style.use('ggplot')
accel_X = []
accel_Y = []
accel_Z = []
avg_x = 0
avg_y = 0
avg_z = 0
accel_time = []
mpu = mpu6050(0x68)
de... | {"/manual.py": ["/communication/control.py"], "/test.py": ["/algo.py"], "/autonomous.py": ["/communication/control.py", "/algo.py"]} |
66,631 | AntoineCrb/Raspberry-Master-Device | refs/heads/master | /algo.py | import cv2
import numpy as np
import math
# get lines
def canny(image):
gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
kernel = 15 # it's important here to have a high value to prevent the light reflection of the road to cause any problem
blur = cv2.GaussianBlur(gray, (kernel, kernel), 0)
canny = cv2... | {"/manual.py": ["/communication/control.py"], "/test.py": ["/algo.py"], "/autonomous.py": ["/communication/control.py", "/algo.py"]} |
66,632 | AntoineCrb/Raspberry-Master-Device | refs/heads/master | /test.py | import cv2
import numpy as np
import algo
import math
frame = cv2.imread('assets/testt.jpg')
frame = cv2.resize(frame, (640, 480))
frame_canny = algo.canny(frame)
cropped_canny = algo.region_of_interest(frame_canny)
lines = cv2.HoughLinesP(cropped_canny, 2, np.pi/180, 100, np.array([]), minLineLength=40, maxLineGap=5... | {"/manual.py": ["/communication/control.py"], "/test.py": ["/algo.py"], "/autonomous.py": ["/communication/control.py", "/algo.py"]} |
66,633 | AntoineCrb/Raspberry-Master-Device | refs/heads/master | /autonomous.py | import cv2
import numpy as np
from imutils.video import VideoStream, FPS
import time
from communication.control import Control
import algo
control = Control()
vs = VideoStream(usePiCamera=True, resolution=(640, 480), framerate=32, rotation=180)
fps = FPS()
def init():
vs.start()
time.sleep(2.0)
fps.start... | {"/manual.py": ["/communication/control.py"], "/test.py": ["/algo.py"], "/autonomous.py": ["/communication/control.py", "/algo.py"]} |
66,634 | AntoineCrb/Raspberry-Master-Device | refs/heads/master | /communication/control.py | import RPi.GPIO as GPIO
# rpi pins - GPIO BCM mode
a = 26
b = 19
c = 13
d = 6
class Control:
current=0
def __init__(self):
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(a, GPIO.OUT)
GPIO.setup(b, GPIO.OUT)
GPIO.setup(c, GPIO.OUT)
GPIO.setup(d, ... | {"/manual.py": ["/communication/control.py"], "/test.py": ["/algo.py"], "/autonomous.py": ["/communication/control.py", "/algo.py"]} |
66,638 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/__init__.py | # -*- coding: utf-8 -*-
from cloudmind.blueprint import apiv1
from cloudmind.config.config import Config
from flask import Flask
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from flask import url_for
from flask_mail import Mail
from flask_restful impor... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,639 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/blueprint.py | from flask import Blueprint
apiv1 = Blueprint('apiV1', __name__, url_prefix='/api/v1')
| {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,640 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/label.py | from cloudmind import db
class Label(db.Model):
__tablename__ = 'label'
id = db.Column(db.Integer, primary_key=True)
own_node_id = db.Column(db.Integer, db.ForeignKey('node.id'))
palette_id = db.Column(db.Integer, db.ForeignKey('label_palette.id'))
# relationship
own_node = db.relationship('No... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,641 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/restful/v1/root.py | from cloudmind import db
from cloudmind.mail import mail_send_invite
from cloudmind.model.node import Node
from cloudmind.model.participant import Participant
from cloudmind.model.user import User
from flask import request
from flask import session
from flask_restful import abort
from flask_restful import Resource
impo... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,642 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/contact.py | from cloudmind import db
class Contact(db.Model):
__tablename__ = 'contact'
id = db.Column(db.Integer, primary_key=True)
from_user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
to_user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
# relationship
from_user = db.relationship('User'... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,643 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/participant.py | from cloudmind import db
class Participant(db.Model):
__tablename__ = 'participant'
id = db.Column(db.Integer, primary_key=True)
is_accepted = db.Column(db.Boolean, default=False)
own_node_id = db.Column(db.Integer, db.ForeignKey('node.id'))
user_id = db.Column(db.Integer, db.ForeignKey('user.id')... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,644 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/restful/v1/label_palette.py | from cloudmind import db
from cloudmind.model.label_palette import LabelPalette
from cloudmind.model.node import Node
from flask import request
from flask import session
from flask_restful import abort
from flask_restful import Resource
import json
class PaletteList(Resource):
def get(self):
root_id = req... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,645 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/label_palette.py | from cloudmind import db
class LabelPalette(db.Model):
__tablename__ = 'label_palette'
id = db.Column(db.Integer, primary_key=True)
color = db.Column(db.Integer)
name = db.Column(db.String(20), default='')
root_node_id = db.Column(db.Integer, db.ForeignKey('node.id'))
# relationship
root_n... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,646 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/restful/v1/profile.py | from cloudmind.blueprint import apiv1
from cloudmind import db
from cloudmind.model.user import User
from flask import current_app
from flask import redirect
from flask import request
from flask import send_file
from flask import session
from flask_restful import abort
from flask_restful import Resource
import json
imp... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,647 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/mail.py | from cloudmind import mail
from flask.ext.mail import Message
from flask import url_for
def mail_send_invite(participant):
from_user = participant.from_user
to_user = participant.user
msg = Message(
'Hello',
sender='cloudmindswmaestro@gmail.com',
recipients=[to_user.email])
msg... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,648 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/__init__.py | __all__ = ['contact', 'label', 'label_palette', 'leaf', 'node', 'participant', 'user']
from cloudmind.model import contact
from cloudmind.model import label
from cloudmind.model import label_palette
from cloudmind.model import leaf
from cloudmind.model import node
from cloudmind.model import participant
from cloudmind... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,649 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/node.py | from cloudmind import db
from cloudmind.model.label import Label
from cloudmind.model.label_palette import LabelPalette
from cloudmind.model.leaf import Leaf
from cloudmind.model.participant import Participant
from cloudmind.model.user import User
import datetime
from sqlalchemy.sql.expression import true
class Node(... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,650 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/restful/v1/node.py | from cloudmind import db
from cloudmind.model.label_palette import LabelPalette
from cloudmind.model.node import Node
from cloudmind.model.participant import Participant
from cloudmind.model.user import User
from dateutil import parser as date_parser
from flask import request
from flask import session
from flask_restfu... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,651 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/user.py | from cloudmind import db
import datetime
from flask import url_for
class User(db.Model):
__tablename__ = 'user'
METHOD_GOOGLE = 0
id = db.Column(db.Integer, primary_key=True)
login_method = db.Column(db.Integer)
# 고유ID
oauth_id = db.Column(db.Integer)
name = db.Column(db.String(10))
e... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,652 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/model/leaf.py | from cloudmind import db
import datetime
import magic
import PIL
from PIL import Image
class Leaf(db.Model):
__tablename__ = 'leaf'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100))
creation_date = db.Column(db.DateTime, default=datetime.datetime.utcnow())
file_path = d... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,653 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/config/default_config.py | # -*- coding: utf-8 -*-
import os.path
import tempfile
class Config(object):
# Server
SERVER_NAME = 'yourdomain.com'
# Database
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(tempfile.gettempdir(), 'test.db')
# Path
UPLOAD_DIR = os.path.abspath(os.path.dirname(__file__) + '/../..') + ... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,654 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/restful/v1/label.py | from cloudmind import db
from cloudmind.model.label import Label
from cloudmind.model.node import Node
from flask import request
from flask import session
from flask_restful import abort
from flask_restful import Resource
import json
class LabelAdd(Resource):
def post(self):
args = json.loads(request.data... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,655 | CloudMind6-6/CloudMind | refs/heads/combine | /cloudmind/restful/v1/leaf.py | from cloudmind.blueprint import apiv1
from cloudmind import db
from cloudmind.model.leaf import Leaf
from cloudmind.model.node import Node
from cloudmind.model.user import User
from flask import current_app
from flask import request
from flask import send_file
from flask import session
from flask_restful import abort
f... | {"/cloudmind/__init__.py": ["/cloudmind/blueprint.py", "/cloudmind/model/user.py", "/cloudmind/model/participant.py"], "/cloudmind/model/label.py": ["/cloudmind/__init__.py"], "/cloudmind/restful/v1/root.py": ["/cloudmind/__init__.py", "/cloudmind/mail.py", "/cloudmind/model/node.py", "/cloudmind/model/participant.py",... |
66,656 | dnuwa/level-up | refs/heads/master | /test_signup.py | import unittest
from signup import Signup
class TestSignup(unittest.TestCase):
def setUp(self):
self.user1 = Signup('daniel', 'nuwa', 'daniel@gmail.com')
self.user2 = Signup('jose','bugingo', 'jose@gmail.com')
def test_class_created(self):
self.assertIsInstance(self.user1, Sign... | {"/test_signup.py": ["/signup.py"]} |
66,657 | dnuwa/level-up | refs/heads/master | /signup.py | import re
class Signup():
def __init__(self, first_name, last_name, email_address):
self.first_name = str(first_name)
self.last_name = str(last_name)
self.email_address = Signup.validate_email(email_address)
self.database= []
def combined_name(self):
if not (self.first_... | {"/test_signup.py": ["/signup.py"]} |
66,740 | Prabithapallat01/Bank_app | refs/heads/master | /bank/migrations/0002_auto_20210512_2009.py | # Generated by Django 3.1.7 on 2021-05-12 14:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bank', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='branch',
name='branch_code',
),... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,741 | Prabithapallat01/Bank_app | refs/heads/master | /bank/models.py | from django.db import models
# Create your models here
class Branch(models.Model):
branch_name=models.CharField(max_length=250)
account_number=models.IntegerField(default=True)
bank_name=models.CharField(max_length=250)
customer_name=models.CharField(max_length=250)
address=models.CharField(max_len... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,742 | Prabithapallat01/Bank_app | refs/heads/master | /bank/migrations/0001_initial.py | # Generated by Django 3.1.7 on 2021-05-12 05:41
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Branch',
fields=[
('id', models.AutoField(a... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,743 | Prabithapallat01/Bank_app | refs/heads/master | /bank/migrations/0004_bankstatement.py | # Generated by Django 3.1.7 on 2021-05-13 07:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bank', '0003_auto_20210512_2241'),
]
operations = [
migrations.CreateModel(
name='BankStatement... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,744 | Prabithapallat01/Bank_app | refs/heads/master | /bank/serializers.py | from rest_framework import serializers
from rest_framework.serializers import ModelSerializer
from django.contrib.auth.models import User
from .models import Branch
class BranchSerializer(ModelSerializer):
class Meta:
model=Branch
fields='__all__'
class UserRegisterSerializer(ModelSerializer):
... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,745 | Prabithapallat01/Bank_app | refs/heads/master | /bank/migrations/0003_auto_20210512_2241.py | # Generated by Django 3.1.7 on 2021-05-12 17:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bank', '0002_auto_20210512_2009'),
]
operations = [
migrations.AlterField(
model_name='branch',
name='account_number... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,746 | Prabithapallat01/Bank_app | refs/heads/master | /bank/migrations/0005_auto_20210514_1953.py | # Generated by Django 3.1.7 on 2021-05-14 14:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bank', '0004_bankstatement'),
]
operations = [
migrations.RemoveField(
model_name='bankstatement',
name='sender',
... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,747 | Prabithapallat01/Bank_app | refs/heads/master | /bank/views.py | from django.shortcuts import render
from rest_framework.utils.representation import serializer_repr
from .serializers import UserRegisterSerializer,LoginSerializer,BranchSerializer,WithdrawSerailizer,DepositeSerailizer
from .models import Branch
from rest_framework.views import APIView
from rest_framework.authtoken.mo... | {"/bank/serializers.py": ["/bank/models.py"], "/bank/views.py": ["/bank/serializers.py", "/bank/models.py"]} |
66,749 | immortalhope/work_for_you | refs/heads/master | /work/validation.py | import re
# функція повертає ціле число більше нуля до трьох знаків
def get_number(text):
while True:
number_str = input(text)
# if bool(re.match(r"\d{1,3}", number) ):
# correct = True
# else:
# correct = False
# correct = bool(re.match(r"\d{1,3}", number_s... | {"/task2.py": ["/work/validation.py", "/work/recurcion.py"]} |
66,750 | immortalhope/work_for_you | refs/heads/master | /task1.py | print('Толстуха Надія, КМ-82\nВаріант 23. Завдання 1.\nСформувати в програмі масив з цілих чисел від 2 до n. Підрахувати суму квадpатов парних і суму квадратів непарних чисел.')
correct = False
while not correct:
paired = []
unpaired = []
while True:
try:
n = int(input("Введіть число n. ... | {"/task2.py": ["/work/validation.py", "/work/recurcion.py"]} |
66,751 | immortalhope/work_for_you | refs/heads/master | /task2.py | print ("""Толстуха Надія. КМ-82
Варіант 23. Завдання 2.""")
import numpy as np
import random
# імпортуємо файл з валідацією
import work.validation
# імпортуємо файл з рекурсивними функціями
import work.recurcion
# початок циклу для виходу із програми
correct = False
while not correct:
# Виклик функції для валі... | {"/task2.py": ["/work/validation.py", "/work/recurcion.py"]} |
66,752 | immortalhope/work_for_you | refs/heads/master | /work/recurcion.py |
# Функція, що рекурсивно сумує елементи списку
def sum_list(data):
if data == []:
return 0
return data[0]+sum_list(data[1:])
#Функція, що рекурсивно множить елементи списка
def mult_list(data, end_of_list):
if end_of_list == 0:
return 1
return data[0]*mult_list(data[1:], end_of_list-1)... | {"/task2.py": ["/work/validation.py", "/work/recurcion.py"]} |
66,759 | nguyenquyet27/AR | refs/heads/master | /reference_plane.py | import cv2
import os
from process_func import image_proc
import config
class ReferencePlane(object):
def __init__(self, plane_path):
print('[INFO]Make reference surface ...')
self.orb = cv2.ORB_create()
self.ref_plane = cv2.imread(os.path.join(os.getcwd(), plane_path))
... | {"/reference_plane.py": ["/process_func.py", "/config.py"], "/config.py": ["/reference_plane.py"], "/ar_model.py": ["/config.py", "/process_func.py"], "/main.py": ["/config.py", "/process_func.py", "/ar_model.py"]} |
66,760 | nguyenquyet27/AR | refs/heads/master | /config.py | import os
import numpy as np
import cv2
from reference_plane import ReferencePlane
from objloader import OBJ
MIN_MATCHES = 80
image_plane_width = 720
image_plane_height = 480
# Estimate using ./cam-parameters/compute_calibration_matrix.py
camera_intrinsic = np.array(
[[900, 0, image_plane_width/2],
[0, 9... | {"/reference_plane.py": ["/process_func.py", "/config.py"], "/config.py": ["/reference_plane.py"], "/ar_model.py": ["/config.py", "/process_func.py"], "/main.py": ["/config.py", "/process_func.py", "/ar_model.py"]} |
66,761 | nguyenquyet27/AR | refs/heads/master | /ar_model.py | import cv2
import config
import numpy as np
import process_func as pf
class ARModel(object):
"""
with each card (hopefully), we make into an object so that we can project 3d model onto it
"""
def __init__(self, reference_plane, target_plane):
self.homography = None
# TODO: other ... | {"/reference_plane.py": ["/process_func.py", "/config.py"], "/config.py": ["/reference_plane.py"], "/ar_model.py": ["/config.py", "/process_func.py"], "/main.py": ["/config.py", "/process_func.py", "/ar_model.py"]} |
66,762 | nguyenquyet27/AR | refs/heads/master | /main.py | import cv2
import time
import argparse
import numpy as np
import config
import process_func as pf
from ar_model import ARModel
kt = 0
projection = None
homograp = np.ones((3, 3))
def project_3d_model_to_target_plane(ref, target):
global kt, projection, homograp
target.set_homography(ref)
if kt == 0:
... | {"/reference_plane.py": ["/process_func.py", "/config.py"], "/config.py": ["/reference_plane.py"], "/ar_model.py": ["/config.py", "/process_func.py"], "/main.py": ["/config.py", "/process_func.py", "/ar_model.py"]} |
66,763 | nguyenquyet27/AR | refs/heads/master | /process_func.py | import cv2
import math
import random
import numpy as np
def image_proc(img, scale_factor):
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
return img_gray
def projection_matrix(camera_parameters, homography):
# Compute rotation along the x and y axis as well as the translation
homography = homogra... | {"/reference_plane.py": ["/process_func.py", "/config.py"], "/config.py": ["/reference_plane.py"], "/ar_model.py": ["/config.py", "/process_func.py"], "/main.py": ["/config.py", "/process_func.py", "/ar_model.py"]} |
66,764 | samueldsr99/tictactoe | refs/heads/master | /state.py | class State:
def __init__(self, matrix: [] = None):
if matrix is None:
self.matrix = [0 for _ in range(9)]
self.turn = 1
else:
self.matrix = matrix
# Check player turn from matrix info
self.turn = 1
for row in matrix:
... | {"/main.py": ["/display.py", "/utils.py", "/state.py", "/agent.py"], "/display.py": ["/state.py", "/utils.py"], "/tests/test_state.py": ["/state.py"], "/agent.py": ["/state.py", "/utils.py"]} |
66,765 | samueldsr99/tictactoe | refs/heads/master | /main.py | from display import Screen
from utils import cprint, GREEN, RED, YELLOW
from state import State
from agent import Agent
from argparse import ArgumentParser
map_move = {
7: 0, 8: 1, 9: 2,
4: 3, 5: 4, 6: 5,
1: 6, 2: 7, 3: 8,
}
imap_move = {
0: 7, 1: 8, 2: 9,
3: 4, 4: 5, 5: 6,
6: 1, 7: 2, 8: 3,
}... | {"/main.py": ["/display.py", "/utils.py", "/state.py", "/agent.py"], "/display.py": ["/state.py", "/utils.py"], "/tests/test_state.py": ["/state.py"], "/agent.py": ["/state.py", "/utils.py"]} |
66,766 | samueldsr99/tictactoe | refs/heads/master | /display.py | from state import State
from utils import clear_screen, cprint
from utils import BLACK
class Screen:
def render(self, state: State):
clear_screen()
m = state.matrix
dmap = lambda c : 'X' if c == 1 else 'O' if c == 2 else ' '
for i in [0, 3, 6]:
line = [dmap(m[i]), dmap... | {"/main.py": ["/display.py", "/utils.py", "/state.py", "/agent.py"], "/display.py": ["/state.py", "/utils.py"], "/tests/test_state.py": ["/state.py"], "/agent.py": ["/state.py", "/utils.py"]} |
66,767 | samueldsr99/tictactoe | refs/heads/master | /tests/test_state.py | import unittest
from state import State
class TestStates(unittest.TestCase):
def test_initial_state(self):
s = State()
self.assertEqual(s.matrix, [0 for _ in range(9)])
def test_move(self):
s = State()
correct = [0 for _ in range(9)]
turn = 1
for i in [1, 0... | {"/main.py": ["/display.py", "/utils.py", "/state.py", "/agent.py"], "/display.py": ["/state.py", "/utils.py"], "/tests/test_state.py": ["/state.py"], "/agent.py": ["/state.py", "/utils.py"]} |
66,768 | samueldsr99/tictactoe | refs/heads/master | /utils.py | from os import system, name
import sys
# colors
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
def has_color(stream):
if not (hasattr(stream, "isatty") and stream.isatty):
return False
try:
import curses
curses.setupterm()
return curses.tigetnum("colors") > ... | {"/main.py": ["/display.py", "/utils.py", "/state.py", "/agent.py"], "/display.py": ["/state.py", "/utils.py"], "/tests/test_state.py": ["/state.py"], "/agent.py": ["/state.py", "/utils.py"]} |
66,769 | samueldsr99/tictactoe | refs/heads/master | /agent.py | from state import State
import random
from utils import cprint, clear_screen
from utils import (
BLACK,
RED,
GREEN,
YELLOW,
BLUE,
MAGENTA,
CYAN,
WHITE
)
class MiniMaxAgent:
"""
TicTacToe agent that implements Minimax choice criteria
"""
def choice(self, state: State, tur... | {"/main.py": ["/display.py", "/utils.py", "/state.py", "/agent.py"], "/display.py": ["/state.py", "/utils.py"], "/tests/test_state.py": ["/state.py"], "/agent.py": ["/state.py", "/utils.py"]} |
66,770 | krismaz/GW2Solver | refs/heads/main | /options.py | from utils import gold
budget = 10000 * gold # Maximum gold spend, slightly increases runtime
simplicity = 25 # How many lines of output / distinct operations, keep this low~ish for speed, or just very large for omegaspeed
days = 7 # How many days of buy/sell are you fetching?
days_tag = "7d" # How many days of bu... | {"/options.py": ["/utils.py"], "/solver.py": ["/utils.py", "/options.py"], "/main.py": ["/network.py", "/operations.py", "/solver.py", "/options.py"], "/operations.py": ["/options.py", "/utils.py"], "/network.py": ["/options.py", "/utils.py"]} |
66,771 | krismaz/GW2Solver | refs/heads/main | /utils.py | gold = 100 * 100
silver = 100
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
def coins(value):
result = ""
if value >= gold:
result += f"{value//gold}g"
if value >= silver:
result += f"{(value%gold)//s... | {"/options.py": ["/utils.py"], "/solver.py": ["/utils.py", "/options.py"], "/main.py": ["/network.py", "/operations.py", "/solver.py", "/options.py"], "/operations.py": ["/options.py", "/utils.py"], "/network.py": ["/options.py", "/utils.py"]} |
66,772 | krismaz/GW2Solver | refs/heads/main | /solver.py | from pulp import LpVariable, LpProblem, value, LpMaximize, lpSum, LpStatus, COIN_CMD
from collections import defaultdict
from time import time
import utils
import options
def solve(operations, budget, simplicity):
start = time()
if simplicity <= 0:
for operation in operations:
operation.li... | {"/options.py": ["/utils.py"], "/solver.py": ["/utils.py", "/options.py"], "/main.py": ["/network.py", "/operations.py", "/solver.py", "/options.py"], "/operations.py": ["/options.py", "/utils.py"], "/network.py": ["/options.py", "/utils.py"]} |
66,773 | krismaz/GW2Solver | refs/heads/main | /main.py | import network
import operations
import solver
import options
from datetime import datetime
import json
timestamp = datetime.now().isoformat().replace(':', '_').replace('.', '_')
print(f"Fetching Data...")
tp_items = network.tp_items()
special_recipes = network.cache(network.special_recipes)
recipes = network.cache... | {"/options.py": ["/utils.py"], "/solver.py": ["/utils.py", "/options.py"], "/main.py": ["/network.py", "/operations.py", "/solver.py", "/options.py"], "/operations.py": ["/options.py", "/utils.py"], "/network.py": ["/options.py", "/utils.py"]} |
66,774 | krismaz/GW2Solver | refs/heads/main | /operations.py | import options
import utils
import json
from collections import defaultdict
import glob
import csv
class Operation:
def __init__(self, cost, profit, inputs, outputs, limit, description, limiter, chunk_size, output_hint):
self.cost = cost
self.profit = profit
self.inputs = inputs
se... | {"/options.py": ["/utils.py"], "/solver.py": ["/utils.py", "/options.py"], "/main.py": ["/network.py", "/operations.py", "/solver.py", "/options.py"], "/operations.py": ["/options.py", "/utils.py"], "/network.py": ["/options.py", "/utils.py"]} |
66,775 | krismaz/GW2Solver | refs/heads/main | /network.py | import requests
import json
import options
import utils
from collections import defaultdict
headers = {'user-agent': 'GW2Tradz LPSolver Testing (Krismaz.1250)'}
def tp_items():
headers = {'user-agent': 'GW2Tradz LPSolver Testing (Krismaz.1250)'}
r = requests.get(
f'https://api.silveress.ie/gw2/v1/ite... | {"/options.py": ["/utils.py"], "/solver.py": ["/utils.py", "/options.py"], "/main.py": ["/network.py", "/operations.py", "/solver.py", "/options.py"], "/operations.py": ["/options.py", "/utils.py"], "/network.py": ["/options.py", "/utils.py"]} |
66,832 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /data.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/4 12:01
# @File : data.py
from config import config_dict
from dataset import SenseData, SenseDataTest
from torchvision import transforms
img_train = config_dict['data_dir_train']
img_val = config_dict['data_dir_val']
img_test = config_dict['data_dir... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,833 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /train.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/4 12:02
# @File : train.py
import torch, time
import torchvision.models as models
import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variab... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,834 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /config.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/4 12:01
# @File : config.py
config_dict = dict()
config_dict['name_to_id'] = 'ClsName2id.txt'
config_dict['data_dir'] = 'data'
config_dict['data_dir_train'] = 'data/train'
config_dict['data_dir_val'] = 'data/val'
config_dict['data_dir_test'] = 'data... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,835 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /preprocess.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/4 12:04
# @File : preprocess.py
import os
import utils
from config import config_dict
# transfrom cn_name to en_name
def transform_name(path):
cn_to_en, _ = utils.map_label()
for ro, di, fi in os.walk(path):
dirname = os.path.dirname... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,836 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /dataset.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/5 10:23
# @File : dataset.py
import torch
import glob
from torch.utils.data import Dataset,DataLoader
from torchvision import transforms
from config import config_dict
from utils import map_label
from PIL import Image
import cv2
class SenseData(Data... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,837 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /test.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/4 12:02
# @File : test.py
import torch
import argparse, os
import numpy as np
import torchvision.models as models
from torch.utils.data import DataLoader
from torch.autograd import Variable
from data import get_test_data, get_val_data
parser = argpa... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,838 | TqDavid/rssrai2019_scene_classification | refs/heads/master | /utils.py | # -*- coding: utf-8 -*-
# @Author : Magic
# @Time : 2019/7/4 10:49
# @File : utils.py
import os
import torch
import numpy as np
from config import config_dict
#file_path = 'F:\\ai_competition\\rssrai2019_scene_classification\\ClsName2id.txt'
file_path = config_dict['name_to_id']
def map_label(file_path=file... | {"/data.py": ["/config.py", "/dataset.py"], "/train.py": ["/data.py", "/utils.py"], "/preprocess.py": ["/utils.py", "/config.py"], "/dataset.py": ["/config.py", "/utils.py"], "/test.py": ["/data.py"], "/utils.py": ["/config.py"]} |
66,848 | drunkpig/django-background-job | refs/heads/main | /background_job/Trigger.py | from apscheduler.triggers.cron import CronTrigger
from datetime import datetime, timedelta
from tzlocal import get_localzone
from apscheduler.triggers.date import DateTrigger
from apscheduler.triggers.interval import IntervalTrigger
class CronJobTrigger(CronTrigger):
def get_next_fire_time(self):
now = da... | {"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage... |
66,849 | drunkpig/django-background-job | refs/heads/main | /background_job/migrations/0001_initial.py | # Generated by Django 2.2.13 on 2021-02-24 23:49
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ActionLog',
fields=[
... | {"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage... |
66,850 | drunkpig/django-background-job | refs/heads/main | /background_job/Scheduler.py | import json
import logging
import queue
import threading
import time
from queue import Queue
import sched, datetime
from django.db.models import Max
from background_job.models import DjangoJob, JobExecHistory
from background_job.utils import get_max_job_version, log_job_history, log_action
logger = logging.getLogge... | {"/background_job/Scheduler.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/utils.py": ["/background_job/models.py"], "/background_job/job.py": ["/background_job/models.py", "/background_job/utils.py"], "/background_job/models.py": ["/background_job/Trigger.py"], "/background_job/manage... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.