index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
26,029 | Beartime234/whos-that-pokemon-s3gallery | refs/heads/master | /src/img_transform.py | from PIL import Image
transparent_color = (255, 255, 255, 0)
black_color = (0, 0, 0, 255)
def create_silhouette_of_img(input_image_path: str, output_image_path: str) -> None:
"""Creates a silhouette image
Args:
input_image_path: The name of the image you want to create a silhouette
output_im... | {"/tests/test_util.py": ["/src/util.py"], "/src/pokemon_assets.py": ["/src/img_transform.py", "/src/s3.py", "/src/util.py", "/src/dynamo.py", "/src/__init__.py"], "/tests/test_pokemon_assets.py": ["/src/pokemon_assets.py"], "/src/dynamo.py": ["/src/__init__.py"], "/src/handler.py": ["/src/pokemon_assets.py"], "/tests/t... |
26,030 | Beartime234/whos-that-pokemon-s3gallery | refs/heads/master | /tests/test_pokemon_assets.py | import os
import shutil
from typing import Tuple
import src.pokemon_assets
from src.pokemon_assets import output_dir, saved_file_type, silhouette_image_suffix, original_image_suffix, \
original_image_s3_path, silhouette_image_s3_path
def test_pad_pokemon_id():
assert src.pokemon_assets.pad_pokemon_id(1) == "... | {"/tests/test_util.py": ["/src/util.py"], "/src/pokemon_assets.py": ["/src/img_transform.py", "/src/s3.py", "/src/util.py", "/src/dynamo.py", "/src/__init__.py"], "/tests/test_pokemon_assets.py": ["/src/pokemon_assets.py"], "/src/dynamo.py": ["/src/__init__.py"], "/src/handler.py": ["/src/pokemon_assets.py"], "/tests/t... |
26,031 | Beartime234/whos-that-pokemon-s3gallery | refs/heads/master | /src/dynamo.py | from src import dynamo_table
import json
import decimal
import boto3
dynamodb = boto3.resource("dynamodb")
table = dynamodb.Table(dynamo_table)
# Helper class to convert a DynamoDB item to JSON.
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
i... | {"/tests/test_util.py": ["/src/util.py"], "/src/pokemon_assets.py": ["/src/img_transform.py", "/src/s3.py", "/src/util.py", "/src/dynamo.py", "/src/__init__.py"], "/tests/test_pokemon_assets.py": ["/src/pokemon_assets.py"], "/src/dynamo.py": ["/src/__init__.py"], "/src/handler.py": ["/src/pokemon_assets.py"], "/tests/t... |
26,032 | Beartime234/whos-that-pokemon-s3gallery | refs/heads/master | /src/handler.py | import src.pokemon_assets
import logging
import datetime
def run(event, context):
current_date = datetime.datetime.now()
logging.debug(f"Running whos_that_pokemon_s3gallery: {current_date}")
src.pokemon_assets.multi_download_all_pokemon_img()
logging.debug(f"Successfully completed; {current_date}")
... | {"/tests/test_util.py": ["/src/util.py"], "/src/pokemon_assets.py": ["/src/img_transform.py", "/src/s3.py", "/src/util.py", "/src/dynamo.py", "/src/__init__.py"], "/tests/test_pokemon_assets.py": ["/src/pokemon_assets.py"], "/src/dynamo.py": ["/src/__init__.py"], "/src/handler.py": ["/src/pokemon_assets.py"], "/tests/t... |
26,033 | Beartime234/whos-that-pokemon-s3gallery | refs/heads/master | /src/__init__.py | import os
import yaml
module_dir = os.path.dirname(__file__)
s3_bucket = os.environ["S3_BUCKET"]
dynamo_table = os.environ["DYNAMO_TABLE"]
config = {}
# Loads the config
with open(f"{module_dir}/config.yml", 'r') as stream:
try:
config = yaml.safe_load(stream)
except yaml.YAMLError as exc:
... | {"/tests/test_util.py": ["/src/util.py"], "/src/pokemon_assets.py": ["/src/img_transform.py", "/src/s3.py", "/src/util.py", "/src/dynamo.py", "/src/__init__.py"], "/tests/test_pokemon_assets.py": ["/src/pokemon_assets.py"], "/src/dynamo.py": ["/src/__init__.py"], "/src/handler.py": ["/src/pokemon_assets.py"], "/tests/t... |
26,034 | Beartime234/whos-that-pokemon-s3gallery | refs/heads/master | /tests/test_img_transform.py | import os
import src.img_transform
from tests import test_dir
test_input_image_orig = f"{test_dir}/sneasel.png"
test_output_image_silhouette = f"{test_dir}/sneasel-bw.png"
def test_create_silhouette_of_img():
src.img_transform.create_silhouette_of_img(test_input_image_orig, test_output_image_silhouette)
os... | {"/tests/test_util.py": ["/src/util.py"], "/src/pokemon_assets.py": ["/src/img_transform.py", "/src/s3.py", "/src/util.py", "/src/dynamo.py", "/src/__init__.py"], "/tests/test_pokemon_assets.py": ["/src/pokemon_assets.py"], "/src/dynamo.py": ["/src/__init__.py"], "/src/handler.py": ["/src/pokemon_assets.py"], "/tests/t... |
26,035 | pierfied/nnacc | refs/heads/main | /nnacc/sampler.py | import torch
from tqdm.auto import tqdm
from .HMCSampler import HMCSampler
class Sampler:
def __init__(self, lnp, x0=None, m=None, transform=None, device='cpu'):
self.lnp = lnp
self.transform = transform
self.device=device
if x0 is None:
self.x0 = torch.randn(self.npara... | {"/nnacc/predictor.py": ["/nnacc/nn.py"], "/nnacc/__init__.py": ["/nnacc/predictor.py", "/nnacc/nn.py", "/nnacc/sampler.py"]} |
26,036 | pierfied/nnacc | refs/heads/main | /setup.py | from setuptools import setup
setup(
name='nnacc',
version='',
packages=['nnacc'],
url='https://github.com/pierfied/nnacc',
license='',
author='Pier Fiedorowicz',
author_email='pierfied@email.arizona.edu',
description='NNACC - Neural Network Accelerator for Cosmology Codes'
)
| {"/nnacc/predictor.py": ["/nnacc/nn.py"], "/nnacc/__init__.py": ["/nnacc/predictor.py", "/nnacc/nn.py", "/nnacc/sampler.py"]} |
26,037 | pierfied/nnacc | refs/heads/main | /nnacc/predictor.py | import torch
from torch import nn
from .nn import ResBlock
from tqdm.auto import tqdm
class Predictor(nn.Module):
def __init__(self, in_size, out_size, model=None, optim=None, X_transform=None,
y_transform=None, device='cpu'):
super(Predictor, self).__init__()
self.in_size = in_s... | {"/nnacc/predictor.py": ["/nnacc/nn.py"], "/nnacc/__init__.py": ["/nnacc/predictor.py", "/nnacc/nn.py", "/nnacc/sampler.py"]} |
26,038 | pierfied/nnacc | refs/heads/main | /nnacc/nn.py | from torch import nn
import torch.nn.functional as F
class ResBlock(nn.Module):
def __init__(self, in_size, out_size):
super(ResBlock, self).__init__()
self.layer1 = nn.Linear(in_size, out_size)
self.layer2 = nn.Linear(out_size, out_size)
if in_size == out_size:
self.... | {"/nnacc/predictor.py": ["/nnacc/nn.py"], "/nnacc/__init__.py": ["/nnacc/predictor.py", "/nnacc/nn.py", "/nnacc/sampler.py"]} |
26,039 | pierfied/nnacc | refs/heads/main | /nnacc/__init__.py | from .predictor import *
from .HMCSampler import *
from .nn import *
from .sampler import * | {"/nnacc/predictor.py": ["/nnacc/nn.py"], "/nnacc/__init__.py": ["/nnacc/predictor.py", "/nnacc/nn.py", "/nnacc/sampler.py"]} |
26,040 | rpeace/contagion | refs/heads/master | /HeadlineGrabber.py | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 13:01:05 2015
@author: rob
"""
import random
from bs4 import BeautifulSoup
import urllib2
import datetime
import calendar
class HeadlineGrabber:
def __init__(self):
return
def get_headline(self, date):
month = calendar.month_nam... | {"/Collector.py": ["/connection.py"]} |
26,041 | rpeace/contagion | refs/heads/master | /dbtest.py | import mysql.connector
# Connection
connection = mysql.connector.connect(user='rpeace', password='3Q5CmaE7',
host='99.254.1.29',
database='Stocks')
# Cursor
cursor = connection.cursor()
# Execute Query
cursor.execute("SELECT * FROM Region;")
# Close Connect... | {"/Collector.py": ["/connection.py"]} |
26,042 | rpeace/contagion | refs/heads/master | /connection.py | #!/usr/bin/python
import sys
import datetime
import _mysql
# Main
def main():
print("[STOCKS]")
print(get_stocks("TSE", "T", datetime.datetime(2014, 01, 01), datetime.datetime(2014, 12, 31), "", "", ""))
print("REGIONS]")
print(get_regions())
print("[COUNTRIES]")
print(get_countries(""))
print("[SE... | {"/Collector.py": ["/connection.py"]} |
26,043 | rpeace/contagion | refs/heads/master | /Collector.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 23 10:15:44 2015
@author: rob
"""
import pandas.io.data as web
import pandas as pd
import datetime
from datetime import timedelta
from dateutil import parser as dateparser
import connection
class Collector:
def __init__(self):
return
def get_stock_data... | {"/Collector.py": ["/connection.py"]} |
26,044 | rpeace/contagion | refs/heads/master | /Main.py | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 23 10:43:18 2015
@author: rob
"""
from Collector import *
import connection
from HeadlineGrabber import *
import pandas as pd
import sys
from PyQt4 import QtGui
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.ba... | {"/Collector.py": ["/connection.py"]} |
26,045 | kkthaker/python-project | refs/heads/master | /Detection/detect2.py | from __future__ import print_function
#==================================================================================================================
#Importing Necessarry or Required APIS or Packages:-
#================================================================================================================... | {"/Main.py": ["/Detection/detect2.py"]} |
26,046 | kkthaker/python-project | refs/heads/master | /Main.py | from __future__ import division
#=======================================================================================
#Importing Necessarry or Required APIS or Packages:-
#=======================================================================================
#To read the Video:-
import cv2
#For GUI Generation and F... | {"/Main.py": ["/Detection/detect2.py"]} |
26,048 | vakhov/timetable-of-classes | refs/heads/master | /init_lessons.py |
"""Заполнение таблицы данными о занятиях"""
from datetime import datetime, timedelta
from app import db, Lesson
now = datetime.utcnow()
def td(days=1, hours=0):
return now + timedelta(days=days, hours=hours)
def init_lessons():
db.create_all()
lessons = [
dict(subject='Физика', datetime=td(1),... | {"/init_lessons.py": ["/app.py"]} |
26,049 | vakhov/timetable-of-classes | refs/heads/master | /bot.py | """Telegram Bot - Расписание занятий преподователя"""
from datetime import datetime
import telegram
from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'
db = SQLAlchemy(app)
TOKEN = '<TELEGRAM BOT TOKEN>'
bot =... | {"/init_lessons.py": ["/app.py"]} |
26,050 | vakhov/timetable-of-classes | refs/heads/master | /app.py | """Расписание занятий преподователя"""
from datetime import datetime
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'
db = SQLAlchemy(app)
class Lesson(db.Model):
__tablename__ = 'lessons'
id = db.Column(db.... | {"/init_lessons.py": ["/app.py"]} |
26,063 | yarickprih/django-word-frequency-analizer | refs/heads/master | /word_analizer/services.py | import math
from typing import Any, Dict, List
import nltk
from nltk import RegexpTokenizer, pos_tag
from nltk.corpus import stopwords
from nltk.probability import FreqDist
from nltk.stem import SnowballStemmer, WordNetLemmatizer
from nltk.tokenize import word_tokenize
nltk.download("stopwords")
stop_words = set(sto... | {"/word_analizer/forms.py": ["/word_analizer/models.py", "/word_analizer/services.py"], "/word_analizer/views.py": ["/word_analizer/forms.py", "/word_analizer/models.py"], "/word_analizer/urls.py": ["/word_analizer/views.py"]} |
26,064 | yarickprih/django-word-frequency-analizer | refs/heads/master | /word_analizer/models.py | from django.db import models
from django.urls import reverse_lazy
from word_analizer import services
# Create your models here.
class Text(models.Model):
"""Model definition for raw text and it's word frequncies."""
text = models.TextField(
verbose_name="Text",
blank=False,
null=Fal... | {"/word_analizer/forms.py": ["/word_analizer/models.py", "/word_analizer/services.py"], "/word_analizer/views.py": ["/word_analizer/forms.py", "/word_analizer/models.py"], "/word_analizer/urls.py": ["/word_analizer/views.py"]} |
26,065 | yarickprih/django-word-frequency-analizer | refs/heads/master | /word_analizer/forms.py | from django import forms
from .models import Text
import word_analizer.services as services
class TextForm(forms.ModelForm):
text = forms.CharField(
widget=forms.Textarea(attrs={"rows": "5", "class": "form-control"})
)
class Meta:
model = Text
fields = ("text",) | {"/word_analizer/forms.py": ["/word_analizer/models.py", "/word_analizer/services.py"], "/word_analizer/views.py": ["/word_analizer/forms.py", "/word_analizer/models.py"], "/word_analizer/urls.py": ["/word_analizer/views.py"]} |
26,066 | yarickprih/django-word-frequency-analizer | refs/heads/master | /word_analizer/views.py | from django.shortcuts import render
from django.urls import reverse_lazy
from django.views.generic import CreateView, DetailView, ListView
from .forms import TextForm
from .models import Text
class TextListView(ListView):
"""List View of analized texts."""
model = Text
template_name = "word_analizer/tex... | {"/word_analizer/forms.py": ["/word_analizer/models.py", "/word_analizer/services.py"], "/word_analizer/views.py": ["/word_analizer/forms.py", "/word_analizer/models.py"], "/word_analizer/urls.py": ["/word_analizer/views.py"]} |
26,067 | yarickprih/django-word-frequency-analizer | refs/heads/master | /word_analizer/urls.py | from django.urls import path
from .views import TextDetailView, TextListView, TextCreateView
urlpatterns = [
path("", TextCreateView.as_view(), name="text_create_view"),
path("texts/", TextListView.as_view(), name="text_list_view"),
path("<pk>/", TextDetailView.as_view(), name="text_detail_view"),
] | {"/word_analizer/forms.py": ["/word_analizer/models.py", "/word_analizer/services.py"], "/word_analizer/views.py": ["/word_analizer/forms.py", "/word_analizer/models.py"], "/word_analizer/urls.py": ["/word_analizer/views.py"]} |
26,080 | marcellamartns/agenda | refs/heads/master | /conexao.py | # -*- coding: utf-8 -*-
from usuario import Usuario
from contato import Contato
from pymongo import MongoClient
from bson.objectid import ObjectId
class Conexao(object):
def __init__(self, banco):
conexao_banco = MongoClient('mongodb://localhost:27017/')
nome_banco = conexao_banco[banco]
... | {"/conexao.py": ["/usuario.py", "/contato.py"], "/agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"], "/main_agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"]} |
26,081 | marcellamartns/agenda | refs/heads/master | /agenda.py | # -*- coding: utf-8 -*-
from usuario import Usuario
from contato import Contato
from conexao import Conexao
contato = Contato(nome_contato="Joana", telefone="9988721341",
email="joana@123.com", complemento="trabalho")
usuario = Usuario(nome_usuario="marcella", senha="123", contatos=contato)
conex... | {"/conexao.py": ["/usuario.py", "/contato.py"], "/agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"], "/main_agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"]} |
26,082 | marcellamartns/agenda | refs/heads/master | /usuario.py | # -*- coding: utf-8 -*-
from bson.objectid import ObjectId
class Usuario(object):
def __init__(self, id_=None, nome_usuario=None, senha=None, contatos=None):
self._id = id_ if id_ else ObjectId()
self._nome_usuario = nome_usuario
self._senha = senha
self._contatos = contatos
... | {"/conexao.py": ["/usuario.py", "/contato.py"], "/agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"], "/main_agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"]} |
26,083 | marcellamartns/agenda | refs/heads/master | /main_agenda.py | # -*- coding: utf-8 -*-
from usuario import Usuario
from contato import Contato
from conexao import Conexao
import json
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
if not self.get_cookie("cookieagenda"):
self.redirect("/autenticar")... | {"/conexao.py": ["/usuario.py", "/contato.py"], "/agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"], "/main_agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"]} |
26,084 | marcellamartns/agenda | refs/heads/master | /contato.py | # -*- coding: utf-8 -*-
from bson.objectid import ObjectId
class Contato(object):
def __init__(self, id_=None, nome_contato=None, telefone=None, email=None,
complemento=None):
self._id = id_ if id_ else ObjectId()
self._nome_contato = nome_contato
self._telefone = telef... | {"/conexao.py": ["/usuario.py", "/contato.py"], "/agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"], "/main_agenda.py": ["/usuario.py", "/contato.py", "/conexao.py"]} |
26,104 | TVSjoberg/gan-dump | refs/heads/master | /data/load_data.py | import pandas as pd
import os
import json
import shutil
import numpy as np
from gan_thesis.data.datagen import *
from definitions import DATA_DIR, ROOT_DIR
from dataset_spec import *
# from params import mvn_test1_highfeature, mvn_test2_highfeature
class Dataset:
def __init__(self, train, test, data, info, sample... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,105 | TVSjoberg/gan-dump | refs/heads/master | /models/general/testbed.py |
import shutil
from gan_thesis.evaluation.pMSE import *
from gan_thesis.evaluation.association import plot_all_association
from gan_thesis.evaluation.machine_learning import *
from gan_thesis.evaluation.plot_marginals import *
from gan_thesis.data.load_data import load_data
import os
import pandas as pd
#import gan_the... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,106 | TVSjoberg/gan-dump | refs/heads/master | /models/wgan/synthesizer.py | from gan_thesis.evaluation.machine_learning import plot_predictions_by_dimension
from gan_thesis.evaluation.plot_marginals import plot_marginals
from gan_thesis.evaluation.association import plot_association
from gan_thesis.evaluation.pMSE import *
from gan_thesis.data.load_data import *
from gan_thesis.models.general.... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,107 | TVSjoberg/gan-dump | refs/heads/master | /evaluation/pMSE.py | import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from gan_thesis.evaluation.machine_learning import *
from gan_thesis.data.load_data import load_data
N_... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,108 | TVSjoberg/gan-dump | refs/heads/master | /definitions.py | import os
TEST_IDENTIFIER = ''
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.path.join(ROOT_DIR, 'datasets', TEST_IDENTIFIER)
RESULT_DIR = os.path.join(ROOT_DIR, 'results', TEST_IDENTIFIER)
| {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,109 | TVSjoberg/gan-dump | refs/heads/master | /evaluation/plot_marginals.py | import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
from scipy.stats import kde
import os
from definitions import RESULT_DIR
from gan_thesis.data.load_data import *
def plot_marginals(real, synthetic, dataset, model, force=True):
cols = synthetic.columns
i_cont = real... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,110 | TVSjoberg/gan-dump | refs/heads/master | /models/wgan/data.py | import tensorflow as tf
import pandas as pd
from sklearn import preprocessing
def df_to_dataset(dataframe_in, shuffle=True, batch_size=32):
dataframe = dataframe_in.copy()
ds = tf.data.Dataset.from_tensor_slices(dataframe.values)
ds = ds.batch(batch_size)
return ds
def train_test(dataframe_in, fract... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,111 | TVSjoberg/gan-dump | refs/heads/master | /models/general/utils.py | import os
import sys
import pickle
import json
import csv
def load_model(path):
"""Loads a previous model from the given path"""
if not os.path.isfile(path):
print('No model is saved at the specified path.')
return
with open(path, 'rb') as f:
model = pickle.load(f)
return model... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,112 | TVSjoberg/gan-dump | refs/heads/master | /dataset_spec.py | import numpy as np
from gan_thesis.data.datagen import r_corr, rand_prop
from itertools import chain
unif = np.random.uniform # Shorthand
rint = np.random.randint
seed = 123
np.random.seed(seed)
n_samples = 10000
mvn_test1 = {
# 3 INDEPENDENT features
# 1 standard normal, 1 high mean, 1 high var
#
'... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,113 | TVSjoberg/gan-dump | refs/heads/master | /models/wgan/main.py | from gan_thesis.models.wgan.data import load_credit_data
from gan_thesis.models.wgan.wgan import *
def main():
"""params:
output_dim: integer dimension of the output variables.
Note that this includes the one-hot encoding of the categorical varibles
latent_dim: integer dimension of rando... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,114 | TVSjoberg/gan-dump | refs/heads/master | /evaluation/machine_learning.py | import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.ensemble import AdaBoostClassifier, AdaBoostRegressor
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.linear_model import LogisticRegression, LinearRegression
from ... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,115 | TVSjoberg/gan-dump | refs/heads/master | /models/tgan/synthesizer.py | from tgan.model import TGANModel
from gan_thesis.evaluation.machine_learning import plot_predictions_by_dimension
from gan_thesis.evaluation.plot_marginals import plot_marginals
from gan_thesis.evaluation.association import plot_association
from gan_thesis.evaluation.pMSE import *
from gan_thesis.data.load_data import ... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,116 | TVSjoberg/gan-dump | refs/heads/master | /params.py | import numpy as np
from scipy.stats import random_correlation
mvn_test1 = {
# 3 INDEPENDENT features
# 1 standard normal, 1 high mean, 1 high var
#
'n_samples' : 10000,
'mean' : [0 ,3, 0],
'var' : [1, 1, 5],
'corr' : np.eye(3).tolist()
}
mvn_test2 = {
#medium positive
#medium negat... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,117 | TVSjoberg/gan-dump | refs/heads/master | /models/wgan/wgan_mod.py | import os
import pickle
import time
from functools import partial
import numpy as np
import datetime
import pandas as pd
from tensorflow.keras import layers
from tensorflow.keras.metrics import Mean
from gan_thesis.models.wgan.utils import *
from gan_thesis.models.wgan.data import *
class WGAN:
def __init__(... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,118 | TVSjoberg/gan-dump | refs/heads/master | /models/general/optimization.py | from hyperopt import STATUS_OK, hp, tpe, Trials, fmin
import os
from gan_thesis.models.general.utils import save_json, HiddenPrints
def optimize(space, file_path=None, max_evals=5):
if space.get('model') == 'ctgan':
from gan_thesis.models.ctgan.synthesizer import build_and_train, sampler, optim_loss
e... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,119 | TVSjoberg/gan-dump | refs/heads/master | /models/ctgan/synthesizer.py | from ctgan import CTGANSynthesizer
from gan_thesis.evaluation.machine_learning import plot_predictions_by_dimension
from gan_thesis.evaluation.plot_marginals import plot_marginals
from gan_thesis.evaluation.association import plot_association
from gan_thesis.evaluation.pMSE import *
from gan_thesis.data.load_data impor... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,120 | TVSjoberg/gan-dump | refs/heads/master | /models/wgan/utils.py | import tensorflow as tf
from tensorflow import keras
import tensorflow_probability as tfp
class ClipConstraint(keras.constraints.Constraint):
# Enforces clipping constraints in WGAN
def __init__(self, clip_value):
self.clip_value = clip_value
def __call__(self, weights):
return keras.bac... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,121 | TVSjoberg/gan-dump | refs/heads/master | /data/datagen.py |
import numpy as np
import pandas as pd
from scipy.stats import random_correlation
def multivariate_df(n_samples, mean, var, corr, seed=False, name = 'c'):
if seed:
np.random.seed(seed)
cov = corr_var_to_cov(corr, var)
if (len(mean) == 1):
data = np.random.normal(mean, cov[0]**2, ... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,122 | TVSjoberg/gan-dump | refs/heads/master | /evaluation/association.py | from sklearn.metrics import mutual_info_score, normalized_mutual_info_score
from scipy.stats import spearmanr, pearsonr
from scipy.spatial.distance import euclidean
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import os
from definitions import RESULT_DIR
from gan_thesis.d... | {"/data/load_data.py": ["/definitions.py", "/dataset_spec.py"], "/models/general/testbed.py": ["/definitions.py"], "/models/wgan/synthesizer.py": ["/definitions.py"], "/evaluation/plot_marginals.py": ["/definitions.py"], "/evaluation/machine_learning.py": ["/definitions.py"], "/models/tgan/synthesizer.py": ["/definitio... |
26,123 | amomorning/dodecahedron-calendar | refs/heads/master | /gen_calendar.py | # -*- coding: UTF-8 -*-
import calendar
import ezdxf
import io
import json
import numpy as np
import time
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.patches import Polygon
from matplotlib.backends.backend_pdf import PdfPages
def dxf_init():
doc = ezdxf.readfile("template.dxf")... | {"/http_server.py": ["/gen_calendar.py"]} |
26,124 | amomorning/dodecahedron-calendar | refs/heads/master | /http_server.py | from flask import Flask, render_template, jsonify, send_file, request
from random import *
from flask_cors import CORS
import requests
import gen_calendar
import time
import json
app = Flask(__name__, static_folder="calendar-web\dist", template_folder="calendar-web\dist")
cors = CORS(app, resources={r"/api/*": {"origi... | {"/http_server.py": ["/gen_calendar.py"]} |
26,133 | hexod0t/classifier-bert | refs/heads/master | /preprocessor.py | import torch
from transformers import BertTokenizerFast
class Preprocessor():
def __init__(self):
self.tokenizer = BertTokenizerFast.from_pretrained('./models')
"""
Function tokenize_data
Params: input_text -> sentence that could be true or fake
"""
def tokenize_data(self, text):
... | {"/app.py": ["/preprocessor.py"]} |
26,134 | hexod0t/classifier-bert | refs/heads/master | /app.py | # Imports
from flask import Flask, request, render_template
import numpy as np
import pandas as pd
import torch
from classifier import Classifier
from preprocessor import Preprocessor
from transformers import BertTokenizerFast
#import torch.nn as nn
#from sklearn.model_selection import train_test_split
#from sklearn.m... | {"/app.py": ["/preprocessor.py"]} |
26,135 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /homebrewStopwords.py | from nltk.corpus import stopwords
from sklearn.feature_extraction._stop_words import ENGLISH_STOP_WORDS
stopwords = set(stopwords.words('english')).union(set(ENGLISH_STOP_WORDS))
#words to remove from stopwords
removedWords = set([
"wouldn't", 'hasn', "doesn't", 'weren', 'wasn',
"weren't", 'didn', 'mightn', "... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,136 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /evaluate.py | import json
f = open('userDefinedParameters.json','r')
param = json.load(f)
f.close()
# will come from json file later
model_name=param['model_name']
sequence_length = param['sequence_length']
#end
import matplotlib.pyplot as plt
import numpy as np
def visualizeTraining(hist):
h=hist.history
# L... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,137 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /preprocess.py | import json
f = open('userDefinedParameters.json','r')
param = json.load(f)
f.close()
# will come from json file later
vocabSize=param['vocabSize']
sequence_length=param['sequence_length']
#end
train_path = "../train/" # source data
test_path = "../test/" # test data for evaluation.
#Creating "imdb_train.cs... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,138 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /model_architecture.py | import json
f = open('userDefinedParameters.json','r')
param = json.load(f)
f.close()
# will come from json file later
vocabSize=param['vocabSize']
sequence_length=param['sequence_length']
#end
# Working great
def classification_model_1(vocabSize,sequence_length,dropout_rate=0.2):
from tensorflow.keras.... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,139 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /modelTraining.py | import json
f = open('userDefinedParameters.json','r')
param = json.load(f)
f.close()
# will come from json file later
batch_size=param['batch_size']
model_name=param['model_name']
num_of_epochs=param['num_of_epochs']
#end
#Defining Our Deep Learning Model
from model_architecture import model_framework
fro... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,140 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /prepareJSON.py | # will come from json file later
'''
vocabSize=5000
batch_size=1000
sequence_length=120
train=True
model_name=best_model.h5
num_of_epochs=15
'''
import json
user_defined_parameters={
'vocabSize':5000,
'batch_size':1000,
'sequence_length':120,
'train':1,
'model_name':"best_model.h5",
... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,141 | sixthkrum/IMDB-sentiment-analysis | refs/heads/master | /main.py | import json
f = open('userDefinedParameters.json','r')
param = json.load(f)
f.close()
# will come from json file later
train=param['train']==1
processData=param['processData']==1
user_test = param['userTest'] == 1
from evaluate import userTest
if user_test:
userTest()
exit()
# Loading Datset
fr... | {"/evaluate.py": ["/model_architecture.py", "/preprocess.py"], "/preprocess.py": ["/homebrewStopwords.py"], "/modelTraining.py": ["/model_architecture.py", "/evaluate.py"], "/main.py": ["/evaluate.py", "/preprocess.py", "/modelTraining.py"]} |
26,152 | Hady-Taha/Twitx | refs/heads/main | /profiles/signals.py | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Profile,RelationShip,Notification
from django.contrib.auth.models import User
@receiver(post_save, sender=User)
def post_save_create_profile(sender, created, instance, *args, **kwargs):
if created:
Prof... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,153 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0005_auto_20210215_1433.py | # Generated by Django 3.1.5 on 2021-02-15 12:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0004_relationship'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='bio',
... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,154 | Hady-Taha/Twitx | refs/heads/main | /profiles/context_processors.py | from .models import Notification , Profile
from django.shortcuts import redirect
def noteF(request):
if request.user.is_authenticated == False or request.user.username != request.user.profile.slug:
return {'data':False}
profile = Profile.objects.get(slug=request.user.profile.slug)
not_f = Notifica... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,155 | Hady-Taha/Twitx | refs/heads/main | /posts/views.py | from django.shortcuts import render,redirect
from .models import Post, Like
from profiles.models import Profile,Notification
from .forms import AddPost
from django.http import JsonResponse
from django.db.models import Q
# Create your views here.
def twitx(request):
posts = Post.objects.all().order_by('?')
con... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,156 | Hady-Taha/Twitx | refs/heads/main | /profiles/views.py | from django.shortcuts import render,redirect
from .models import Profile,RelationShip,Notification
from .forms import ProfileSetting
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth import login, logout, authenticate
from posts.models import Post
# Create your views he... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,157 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0009_auto_20210216_0029.py | # Generated by Django 3.1.5 on 2021-02-15 22:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0008_notfiction_user'),
]
operations = [
migrations.RenameModel(
old_name='Notfiction',
new_name='Notification',... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,158 | Hady-Taha/Twitx | refs/heads/main | /profiles/models.py | from django.db import models
from django.contrib.auth.models import User
from django.utils.text import slugify
# Create your models here.
class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
firstName=models.CharField(max_length=50, blank=True, null=True)
lastName=models.C... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,159 | Hady-Taha/Twitx | refs/heads/main | /posts/admin.py | from django.contrib import admin
from .models import Post, Like
# Register your models here.
admin.site.register(Post)
admin.site.register(Like)
# {% for post in request.user.profile.get_all_following %}
# {% for posts in post.receiver.user_post.all %}
# <p>{{posts}}</p>
# {% endfor %}
# {% endfor %} | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,160 | Hady-Taha/Twitx | refs/heads/main | /posts/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.twitx, name='twitx'),
path('home/', views.home, name='home'),
path('like_unlike/', views.like_unlike, name='like_unlike')
]
| {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,161 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0010_auto_20210216_0040.py | # Generated by Django 3.1.5 on 2021-02-15 22:40
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('profiles', '0009_auto_20210216_0029'),
]
operations = [
migrations.AddField(
model_name='notificati... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,162 | Hady-Taha/Twitx | refs/heads/main | /profiles/forms.py | from django import forms
from .models import Profile
class ProfileSetting(forms.ModelForm):
class Meta:
model = Profile
fields = ('photo','firstName','lastName','bio',)
pass
pass
| {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,163 | Hady-Taha/Twitx | refs/heads/main | /profiles/admin.py | from django.contrib import admin
from .models import Profile, RelationShip, Notification
# Register your models here.
admin.site.register(Profile)
admin.site.register(RelationShip)
admin.site.register(Notification)
| {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,164 | Hady-Taha/Twitx | refs/heads/main | /posts/models.py | from django.db import models
from profiles.models import Profile
# Create your models here.
class Post(models.Model):
user = models.ForeignKey(Profile, related_name='user_post', on_delete=models.CASCADE)
liked = models.ManyToManyField(Profile, blank=True, null=True)
body = models.TextField(max_length=750)... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,165 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0012_auto_20210216_1311.py | # Generated by Django 3.1.5 on 2021-02-16 11:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0011_auto_20210216_1301'),
]
operations = [
migrations.RemoveField(
model_name='notification',
name='not... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,166 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0013_auto_20210216_1315.py | # Generated by Django 3.1.5 on 2021-02-16 11:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('profiles', '0012_auto_20210216_1311'),
]
operations = [
migrations.RemoveField(
model_name='not... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,167 | Hady-Taha/Twitx | refs/heads/main | /profiles/urls.py | from django.urls import path
from . import views
urlpatterns = [
path('profile/<slug:slug>', views.profiles, name='profile'),
path('register/', views.register, name='register'),
path('login/', views.authentication, name='login'),
path('settings/<slug:slug>', views.settings, name='settings'),
path('n... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,168 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0011_auto_20210216_1301.py | # Generated by Django 3.1.5 on 2021-02-16 11:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0010_auto_20210216_0040'),
]
operations = [
migrations.RenameField(
model_name='notification',
old_name='clear',... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,169 | Hady-Taha/Twitx | refs/heads/main | /profiles/migrations/0007_notfiction.py | # Generated by Django 3.1.5 on 2021-02-15 22:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0006_profile_slug'),
]
operations = [
migrations.CreateModel(
name='Notfiction',
fields=[
... | {"/profiles/signals.py": ["/profiles/models.py"], "/profiles/context_processors.py": ["/profiles/models.py"], "/posts/views.py": ["/posts/models.py", "/profiles/models.py"], "/profiles/views.py": ["/profiles/models.py", "/profiles/forms.py", "/posts/models.py"], "/posts/admin.py": ["/posts/models.py"], "/profiles/forms... |
26,175 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /database/ops.py | # This module contains operations you may need to interact with DB
# Simply put there functions like add/get user
from peewee import DoesNotExist
from database.db import User
def get_user(tg_user_id: int) -> (User, None):
try:
return User.get(User.tg_user_id == tg_user_id)
except DoesNotExist:
... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,176 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /config.py | # This module contains config class
class Config:
TOKEN = "" # Token of your bot
LIST_OF_ADMINS = [] # List of administrators. Decorator @restricted uses this list to chek if user admin
LOG_LEVEL = 10 # 10 == logging.DEBUG
LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
DB... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,177 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /manage.py | # For now this file only creates tables in your DB
# You can add anything DB-related here, e.g. migrations
from peewee import *
from database.db import MODELS, db_handle, stop_db
def main():
try:
db_handle.connect()
except Exception as px:
print(px)
return
print("Creating tables..... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,178 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /internals/bot.py | # Implementation of bot with message queue
import telegram.bot
from telegram.ext import messagequeue
class MQBot(telegram.bot.Bot):
def __init__(self, *args, is_queued_def=True, mqueue=None, **kwargs):
super(MQBot, self).__init__(*args, **kwargs)
self._is_messages_queued_default = is_queued_def
... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,179 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /database/db.py | # This module contains models of your DB
import datetime
from peewee import *
from playhouse.sqliteq import SqliteQueueDatabase
from config import Config
__sp = r"-\|/-\|/" # this thingie used as spinner
# You can choose other types of DB, supported by peewee
db_handle = SqliteQueueDatabase(Config.DB_FILENAME,
... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,180 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /main.py | # This is entry point of your bot
from config import Config
import logging
import bot_frame
import atexit
logging.basicConfig(level=Config.LOG_LEVEL, format=Config.LOG_FORMAT)
def main():
bot_frame.run()
@atexit.register
def _stop_worker_threads():
bot_frame.stop()
if __name__ == "__main__":
main()
| {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,181 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /internals/actions.py | # This module contains decorators, which will automatically send bot's action to user
from functools import wraps
from telegram import ChatAction
def send_action(action):
"""Sends `action` while processing func command."""
def decorator(func):
@wraps(func)
def command_func(update, context, *a... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,182 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /internals/utils.py | # This module contains different things you may need
from functools import wraps
from config import Config
def restricted(func):
@wraps(func)
def wrapped(update, context, *args, **kwargs):
user_id = update.effective_user.id
if user_id not in Config.LIST_OF_ADMINS:
print("Unauthoriz... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,183 | NuarkNoir/python-telegram-bot-template | refs/heads/master | /bot_frame.py | # This module contains all your bot action handlers definition
# Also there is run() and stop() functions to start and
# stop bot, but you are not really gonna call them by hand
import sys
import traceback
from telegram import Update, ParseMode
from telegram.ext import Updater, CommandHandler
from telegram.ext.message... | {"/database/ops.py": ["/database/db.py"], "/manage.py": ["/database/db.py"], "/database/db.py": ["/config.py"], "/main.py": ["/config.py", "/bot_frame.py"], "/internals/utils.py": ["/config.py"], "/bot_frame.py": ["/config.py", "/internals/bot.py", "/database/db.py", "/internals/actions.py"]} |
26,184 | thomasverweij/hue_spotify | refs/heads/master | /hue_spotify/__init__.py | from .app import app
__version__ = '0.1.0'
app.run(host='0.0.0.0', port=8080) | {"/hue_spotify/__init__.py": ["/hue_spotify/app.py"]} |
26,185 | thomasverweij/hue_spotify | refs/heads/master | /hue_spotify/app.py | from flask import Flask, render_template, redirect
import phue
from phue import Bridge
import spotipy
import spotipy.util as util
import os
import sys
hue_ip = os.getenv('HUE_IP')
username = os.getenv('SPOTIFY_USERNAME')
client_id=os.getenv('SPOTIFY_CLIENT_ID')
client_secret=os.getenv('SPOTIFY_SECRET')
redirect_uri='h... | {"/hue_spotify/__init__.py": ["/hue_spotify/app.py"]} |
26,216 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /app/view.py | from flask import render_template, jsonify,request
from app.models import BlessForm
from app import db
def index():
return render_template("Index.htm")
def timeMan():
return render_template("lovetree.htm")
def story():
return render_template("story.htm")
def letter():
return render_template("Let... | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,217 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /app/static/images/img_suofang.py | import os
from PIL import Image
ext = ['jpg', 'jpeg', 'png']
files = os.listdir('./index/home-setion')
def process_image(filename, mwidth=300, mheight=400):
image = Image.open('./index/home-setion/' + filename)
w, h = image.size
if w <= mwidth and h <= mheight:
print(filename, 'is OK.')
r... | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,218 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /app/__init__.py | from flask_sqlalchemy import SQLAlchemy
import pymysql
from flask import Flask
runapp = Flask(__name__)
#uri统一资源匹配符
#SQLALCHEMY_DATABASE_URI配置数据库连接的参数
# 格式为app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://数据库用户:密码@127.0.0.1/数据库名称'
runapp.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:zhaohang@12... | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,219 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /app/main.py | from flask import Flask
from view import *
app = Flask(__name__)
app.add_url_rule(rule='/', endpoint='index', view_func=index)
app.add_url_rule(rule='/timeMan/', endpoint='timeMan', view_func=timeMan)
app.add_url_rule(rule='/story/', endpoint='story', view_func=story)
app.add_url_rule(rule='/letter/', endpoint='letter... | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,220 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /main.py | from app import runapp
if __name__ == "__main__":
runapp.debug = True
runapp.run(host='0.0.0.0', port=5000) | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,221 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /app/models.py | from app import db
#存放数据模型
class BlessForm(db.Model): #继承BaseModel中的方法
"""
祝福表
"""
__tablename__ = 'blessform' #设置数据表的名称
id = db.Column(db.Integer, primary_key=True, index=True) #mysql创建的表必须包含一个主键,以上orm模型中,缺少主键,故创建失败
name = db.Column(db.String(32)) #设置对应的字段
bless = db.Colum... | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,222 | Nereus-Minos/flaskLoveWeb | refs/heads/master | /app/urls.py | from app import runapp
from app.view import *
runapp.add_url_rule(rule='/', endpoint='index', view_func=index)
runapp.add_url_rule(rule='/timeMan/', endpoint='timeMan', view_func=timeMan)
runapp.add_url_rule(rule='/story/', endpoint='story', view_func=story)
runapp.add_url_rule(rule='/letter/', endpoint='letter', view... | {"/app/view.py": ["/app/models.py", "/app/__init__.py"], "/main.py": ["/app/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/urls.py": ["/app/__init__.py", "/app/view.py"]} |
26,228 | HyXFR/ss-tool | refs/heads/main | /ppaw/__init__.py | """
Python Pastebin API Wrapper.
PPAW, an acronym for "Python Pastebin API Wrapper", is a Python package that
allows for simple access to pastebin's API. PPAW aims to be as easy to use as
possible.
developed based on official documentation here: http://pastebin.com/api
"""
__author__ = "James \"clug\" <clug@clug.xyz... | {"/ppaw/__init__.py": ["/ppaw/pastebin.py"], "/ppaw/pastebin.py": ["/ppaw/__init__.py"], "/sstool.py": ["/ppaw/__init__.py"], "/ppaw/ppaw/request.py": ["/ppaw/__init__.py"]} |
26,229 | HyXFR/ss-tool | refs/heads/main | /ppaw/pastebin.py | """
Python Pastebin API Wrapper.
Provide an object for easily accessible pastes and functions to
fetch existing pastes or create new ones.
"""
from ppaw import definitions, request
from ppaw.errors import PPAWBaseException
class Paste(object):
def __init__(self, key, date=None, title=None, size=None, expire_date... | {"/ppaw/__init__.py": ["/ppaw/pastebin.py"], "/ppaw/pastebin.py": ["/ppaw/__init__.py"], "/sstool.py": ["/ppaw/__init__.py"], "/ppaw/ppaw/request.py": ["/ppaw/__init__.py"]} |
26,230 | HyXFR/ss-tool | refs/heads/main | /ppaw/ppaw/errors.py | """
Python Pastebin API Wrapper.
Provide custom exception for Pastebin errors using similar handling to
IOError by allowing error numbers and error descriptions.
"""
class PPAWBaseException(Exception):
def __init__(self, msg="", code=None):
"""
Set up the exception with an optional error code and ... | {"/ppaw/__init__.py": ["/ppaw/pastebin.py"], "/ppaw/pastebin.py": ["/ppaw/__init__.py"], "/sstool.py": ["/ppaw/__init__.py"], "/ppaw/ppaw/request.py": ["/ppaw/__init__.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.