index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
92,377
CrackerCat/ksDjango
refs/heads/master
/app01/tools.py
import requests import json import os import time from app01.models import UserTitle # 爬取个人主页关注用户的id和naame URL = "https://video.kuaishou.com/graphql" headers = { "accept":"*/*", "Content-Length":"<calculated when request is sent>", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "co...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,386
gnd/polobot
refs/heads/main
/polobot/ticker_collector.py
import urllib.request import json class ticker_collector(): def __init__(self, api_url): self.api_url = api_url def get_url(self, url): conn = urllib.request.urlopen(url) if (conn.getcode() == 200): data = conn.read() jsonData = json.loads(data) else: ...
{"/collect.py": ["/polobot/ticker_collector.py", "/polobot/graph_generator.py", "/polobot/data_processor.py", "/polobot/db_class.py"]}
92,387
gnd/polobot
refs/heads/main
/polobot/graph_generator.py
class graph_generator(): def __init__(self, debug): print("Starting Graph Generator") self.debug = debug self.files = {} def initialize_source(self, file, file_handle): # create empty array named "file_handle" f = open(file, 'w') f.write('{} = {{}};\n'.fo...
{"/collect.py": ["/polobot/ticker_collector.py", "/polobot/graph_generator.py", "/polobot/data_processor.py", "/polobot/db_class.py"]}
92,388
gnd/polobot
refs/heads/main
/collect.py
#!/usr/bin/env python3 from polobot.ticker_collector import ticker_collector from polobot.graph_generator import graph_generator from polobot.data_processor import data_processor from polobot.db_class import db_class import configparser import sys import os ### load config settings_file = os.path.join(os.path.dirnam...
{"/collect.py": ["/polobot/ticker_collector.py", "/polobot/graph_generator.py", "/polobot/data_processor.py", "/polobot/db_class.py"]}
92,389
gnd/polobot
refs/heads/main
/polobot/data_processor.py
# returns average value of any array def get_avg(data): sum = 0 for line in data: sum += line return sum / len(data) class data_processor(): def __init__(self, debug): print("Starting Data Processor") self.debug = debug def process_rows(self, rows): ...
{"/collect.py": ["/polobot/ticker_collector.py", "/polobot/graph_generator.py", "/polobot/data_processor.py", "/polobot/db_class.py"]}
92,390
gnd/polobot
refs/heads/main
/polobot/db_class.py
import MySQLdb class db_class(): def __init__(self, db_host, db_user, db_pass, db_name): self.db_host = db_host self.db_user = db_user self.db_pass = db_pass self.db_name = db_name def open_db(self): self.db = MySQLdb.connect(host=self.db_host, user=self.db_user, passwd...
{"/collect.py": ["/polobot/ticker_collector.py", "/polobot/graph_generator.py", "/polobot/data_processor.py", "/polobot/db_class.py"]}
92,391
Dipkiran/locationname
refs/heads/master
/majorproject/tree/admin.py
from django.contrib import admin # Register your models here. # Register your models here. from .models import * #model admin options class PostModelAdmin(admin.ModelAdmin): list_display = ["id","mainlocation","othername",] #list_display_links = ["updated"] class Meta: model = tree admin.site.reg...
{"/majorproject/tree/admin.py": ["/majorproject/tree/models.py"], "/majorproject/tree/forms.py": ["/majorproject/tree/models.py"], "/majorproject/tree/views.py": ["/majorproject/tree/models.py", "/majorproject/tree/forms.py"]}
92,392
Dipkiran/locationname
refs/heads/master
/majorproject/tree/models.py
from django.conf import settings from django.db import models from django.urls import reverse #image table class tree(models.Model): mainlocation = models.CharField(max_length=120) othername = models.CharField(max_length=120) class information(models.Model): location = models.CharField(max_length=120) ...
{"/majorproject/tree/admin.py": ["/majorproject/tree/models.py"], "/majorproject/tree/forms.py": ["/majorproject/tree/models.py"], "/majorproject/tree/views.py": ["/majorproject/tree/models.py", "/majorproject/tree/forms.py"]}
92,393
Dipkiran/locationname
refs/heads/master
/majorproject/tree/forms.py
from django import forms from .models import * class LocationForm(forms.ModelForm): location = forms.CharField(max_length=120) death = forms.CharField(max_length=120) class Meta: model = information fields = ('location','death' )
{"/majorproject/tree/admin.py": ["/majorproject/tree/models.py"], "/majorproject/tree/forms.py": ["/majorproject/tree/models.py"], "/majorproject/tree/views.py": ["/majorproject/tree/models.py", "/majorproject/tree/forms.py"]}
92,394
Dipkiran/locationname
refs/heads/master
/majorproject/project/views.py
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render, get_object_or_404, redirect #upload display page def index(request): return render(request,"index.html")
{"/majorproject/tree/admin.py": ["/majorproject/tree/models.py"], "/majorproject/tree/forms.py": ["/majorproject/tree/models.py"], "/majorproject/tree/views.py": ["/majorproject/tree/models.py", "/majorproject/tree/forms.py"]}
92,395
Dipkiran/locationname
refs/heads/master
/majorproject/tree/migrations/0002_auto_20180515_1501.py
# Generated by Django 2.0.5 on 2018-05-15 15:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tree', '0001_initial'), ] operations = [ migrations.CreateModel( name='information', fields=[ ('id',...
{"/majorproject/tree/admin.py": ["/majorproject/tree/models.py"], "/majorproject/tree/forms.py": ["/majorproject/tree/models.py"], "/majorproject/tree/views.py": ["/majorproject/tree/models.py", "/majorproject/tree/forms.py"]}
92,396
Dipkiran/locationname
refs/heads/master
/majorproject/tree/views.py
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render, get_object_or_404, redirect #upload display page from .models import * from .forms import * #upload display page def index(request): queryset_list = tree.objects.all() form = LocationForm(request.POST or ...
{"/majorproject/tree/admin.py": ["/majorproject/tree/models.py"], "/majorproject/tree/forms.py": ["/majorproject/tree/models.py"], "/majorproject/tree/views.py": ["/majorproject/tree/models.py", "/majorproject/tree/forms.py"]}
92,407
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/generators/__init__.py
from pydantic import HttpUrl from fanficfare import exceptions, adapters from fanficfare.configurable import Configuration from feed_generator.generators import royalroad, aoa from feed_generator.generators import fanficfare as fanficfare_generator mapping = { 'www.royalroad.com': royalroad, 'royalroad.com':...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,408
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/metadata.py
import fanficfare from fanficfare import adapters, writers, exceptions from fanficfare.configurable import Configuration def fetch_metadata(url: str, chapters = True) -> bytes: configuration = Configuration(adapters.getConfigSectionsFor(url), 'epub') adapter = adapters.getAdapter(configuration, url) adapte...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,409
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/generators/royalroad.py
from datetime import datetime from datetime import timezone import typing from urllib.request import urlopen, Request from urllib.parse import urljoin from bs4 import BeautifulSoup from feedgen.feed import FeedGenerator from feed_generator.config import FeedModel UA = 'Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,410
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/feed.py
from bs4 import BeautifulSoup import logging import toml import os from pathlib import Path from urllib.request import urlopen from urllib.parse import urljoin import typer from pydantic import HttpUrl, BaseModel from feed_generator.config import Settings, FeedModel from feed_generator import generators from feed_gen...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,411
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/config.py
import os from typing import Any, List, Dict import toml from pydantic import ( BaseSettings, BaseModel, HttpUrl, DirectoryPath, FilePath ) def toml_config_settings_source(settings: BaseSettings) -> Dict[str, Any]: """ A simple settings source that loads variables from a TOML file """ ...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,412
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/__init__.py
from feed_generator.feed import generate_feed
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,413
buckley-w-david/feed-generator
refs/heads/master
/setup.py
from setuptools import find_packages, setup setup( name='feed_generator', version='0.1.0', author='David Buckley', author_email='david@davidbuckley.ca', packages=find_packages(), install_requires=[ 'beautifulsoup4', 'toml', 'feedgen', 'lxml', 'typer', ...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,414
buckley-w-david/feed-generator
refs/heads/master
/feed_generator/generators/fanficfare.py
from datetime import datetime from datetime import timezone import typing from urllib.request import urlopen, Request from urllib.parse import urljoin from bs4 import BeautifulSoup from feedgen.feed import FeedGenerator from feed_generator.config import FeedModel from feed_generator.metadata import fetch_metadata de...
{"/feed_generator/generators/royalroad.py": ["/feed_generator/config.py"], "/feed_generator/feed.py": ["/feed_generator/config.py", "/feed_generator/__init__.py", "/feed_generator/metadata.py"], "/feed_generator/__init__.py": ["/feed_generator/feed.py"], "/feed_generator/generators/fanficfare.py": ["/feed_generator/con...
92,425
tanosugi/public_panta_watch
refs/heads/master
/server/api/admin.py
from django.contrib import admin from .models import DataItem # , PriceData admin.site.register(DataItem) # admin.site.register(PriceData)
{"/server/api/admin.py": ["/server/api/models.py"], "/server/api/schema.py": ["/server/api/models.py"]}
92,426
tanosugi/public_panta_watch
refs/heads/master
/server/api/schema.py
from datetime import datetime import graphene # type:ignore import graphql_jwt # , import, login_required from django.contrib.auth.models import User from graphene import relay # type:ignore from graphene_django import DjangoObjectType # type:ignore from graphene_django.filter import DjangoFilterConnectionField #...
{"/server/api/admin.py": ["/server/api/models.py"], "/server/api/schema.py": ["/server/api/models.py"]}
92,427
tanosugi/public_panta_watch
refs/heads/master
/server/project/settings.py
""" Django settings for project project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from datetim...
{"/server/api/admin.py": ["/server/api/models.py"], "/server/api/schema.py": ["/server/api/models.py"]}
92,428
tanosugi/public_panta_watch
refs/heads/master
/server/api/models.py
# from datetime import date import environ import pandas_datareader as pdr import pandas_datareader.data as web import yfinance as yf from django.contrib.auth.models import User from django.db import models from pandas.core.frame import DataFrame from pandas_datareader import wb from pandas_datareader.nasdaq_trader im...
{"/server/api/admin.py": ["/server/api/models.py"], "/server/api/schema.py": ["/server/api/models.py"]}
92,448
Thalaivar/roslab
refs/heads/master
/image_processing.py
import cv2 import imutils import numpy as np from copy import deepcopy def image_processing(image): # convert black squares to white THRESH = 40 idx = np.where((image <= [THRESH, THRESH, THRESH]).all(axis=2)) thresh_image = deepcopy(image) thresh_image[idx] = [255, 255, 255] # threshold image to make bgd black...
{"/explore.py": ["/image_processing.py"]}
92,449
Thalaivar/roslab
refs/heads/master
/explore.py
#!/usr/bin/env python import cv2 import math import yaml import rospy from std_msgs.msg import Float64 from sensor_msgs.msg import Image from image_processing import image_processing from cv_bridge import CvBridge class Explore: def __init__(self, n_joints=3, update_freq=100, rps=2 * math.pi / 60): rospy.init_no...
{"/explore.py": ["/image_processing.py"]}
92,456
aselvais/pyqt-experiment
refs/heads/master
/libs/logmanagement/Analyzer.py
""" \defgroup Logging This is a standalone tool for reading and interpreting the json log files generated by the logger. It puts the json data into a Pandas dataframe for easy anaylisis. """ import pandas as pd import os from math import floor class Analyzer: """ Class for analyzing the log files in JSON form...
{"/libs/ui/MainWindow.py": ["/libs/logmanagement/Analyzer.py"]}
92,457
aselvais/pyqt-experiment
refs/heads/master
/libs/ui/MainWindow.py
""" For tabular data check https://www.learnpyqt.com/courses/model-views/qtableview-modelviews-numpy-pandas/ for tech talk project :) """ # from typeguard import typechecked from PyQt5 import QtWidgets, uic from PyQt5.QtGui import QImage from PyQt5.QtWidgets import QGraphicsView, QProgressBar, QCommandLinkButton, QTab...
{"/libs/ui/MainWindow.py": ["/libs/logmanagement/Analyzer.py"]}
92,458
Antoine-marchais/scalia
refs/heads/master
/components/customWidgets.py
import tkinter as tk bigFont = ("Fixedsys",16,"bold") mediumFont = ("Fixedsys",12,"bold") smallFont = ("Fixedsys",10) smallItalic = ("Fixedsys",10,"italic") class Button(tk.Button): def __init__(self,parent,text,command): super().__init__(parent,text=text,command=command,font=smallFont) class InField(t...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,459
Antoine-marchais/scalia
refs/heads/master
/randomSequence.py
import random def combine(sequences,sequence): """ a help function that returns a list of all the combinations of the list sequences with the list sequence """ combined = [] for eltA in sequences : for eltB in sequence : comb = eltA + [eltB] combined.append(comb)...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,460
Antoine-marchais/scalia
refs/heads/master
/sequencePersistence.py
import json class PersistSequence : def __init__(self,path) : self.path = path with open(path,"r") as f: self.sequences = json.load(f) def getSequences(self) : return self.sequences["sequences"] def getSequence(self,name) : for seq in self.sequences["sequences...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,461
Antoine-marchais/scalia
refs/heads/master
/components/selectionUI.py
import tkinter as tk from components import customWidgets as cw class SelectionUI(tk.Frame): """ Selection menu where the user sets up his next game """ def __init__(self,parent): """ pack the Gamemode menu, the sequence menu and a start button """ super().__init__(paren...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,462
Antoine-marchais/scalia
refs/heads/master
/components/welcomeUI.py
import tkinter as tk class WelcomeUI(tk.Frame): """ title screen for the Scalia App """ def __init__(self,parent,w,h): super().__init__(parent.master,width=w,height=h) title = tk.Label(self,text="Welcome to the scalia App",font=("Fixedsys",20,"bold")) title.place(relx=0.5,rely=0...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,463
Antoine-marchais/scalia
refs/heads/master
/shellApp.py
import cmd from randomSequence import * import prompts import gameStrategy from sequencePersistence import * class RandomShell(cmd.Cmd): """ Command line shell for the scalia App """ def __init__(self): super().__init__() self.started = False self.saved = PersistSequence("./asse...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,464
Antoine-marchais/scalia
refs/heads/master
/guiApp.py
import tkinter as tk from randomSequence import * import prompts import gameStrategy from sequencePersistence import * from components.welcomeUI import WelcomeUI from components.selectionUI import SelectionUI from components.gameUI import GameUI class ScaliaGUI : """ graphical interface for the scalia App ...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,465
Antoine-marchais/scalia
refs/heads/master
/gameStrategy.py
def startGame(randomizer,mode,args): if mode=="complete": return CompleteGame(randomizer) else: return ArcadeGame(randomizer) class ArcadeGame : def __init__(self,rd): self.rd = rd def next(self): return self.rd.pickReturn() class CompleteGame : def __init__(self,rd...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,466
Antoine-marchais/scalia
refs/heads/master
/components/gameUI.py
import tkinter as tk from components import customWidgets as cw import gameStrategy class GameUI(tk.Frame): """ game UI where the user is shown sequences according to its previous selection """ def __init__(self,parent): """ initialize the frame with a display for the randomized sequen...
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,467
Antoine-marchais/scalia
refs/heads/master
/prompts.py
def parse(promptList) : parsed = {} currentPromptName = "" currentPrompt = "" for line in promptList : if not(line[0] in ["\n","\t"]): parsed[currentPromptName] = stripNewLine(currentPrompt) currentPrompt = "" currentPromptName = "".join(e for e in line if e....
{"/shellApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py"], "/guiApp.py": ["/randomSequence.py", "/prompts.py", "/gameStrategy.py", "/sequencePersistence.py", "/components/welcomeUI.py", "/components/selectionUI.py", "/components/gameUI.py"], "/components/gameUI.py": ["/gameSt...
92,468
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/config.py
"""Provide gludb configuration. This consists mainly of a mapping from Storable classes to a database configuration. It also includes a default mapping for classes not specifically mapped to a database. We check for a mapping for a class in MRO (Method Resolution Order). Suppose a class Busy derives from the thre...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,469
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/dict_data_tests.py
"""Testing gludb.simple classes with complex data (dictionaries) """ import unittest from gludb.simple import DBObject, Field from utils import compare_data_objects @DBObject(table_name='SetupTest') class ComplexData(object): name = Field('') complex_data = Field(dict) class ComplexDataTesting(unittest.T...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,470
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/testpkg/module.py
from gludb.simple import DBObject, Field @DBObject(table_name='TopData') class TopData(object): name = Field('name')
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,471
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/gcd_tests.py
"""Testing for Google Cloud Datastore backend""" import sys import gludb.config if sys.version_info < (3, 0): from simple_data_tests import SimpleStorage, DefaultStorageTesting from index_tests import IndexReadWriteTesting, IndexedData class SpecificStorageTesting(DefaultStorageTesting): def setU...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,472
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/backup.py
"""Supply backup functionality for gludb. Note that we mainly provide a way for users to create a small script that backs up their data to S3. We are assuming that the S3 bucket used will be configured for archival (either deletion or archival to Glacier) """ import sys import os import pkgutil import tarfile from im...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,473
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/index_tests.py
"""Testing all the functionality in gludb.simple *except* for actual data storage (that's in simple_data_tests.py) """ import unittest import gludb.config from gludb.simple import DBObject, Field, Index from utils import compare_data_objects @DBObject(table_name='IndexTest') class IndexedData(object): name = ...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,474
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/dynamodb_tests.py
"""Testing for dynamodb backend""" import gludb.config from simple_data_tests import SimpleStorage, DefaultStorageTesting from index_tests import IndexReadWriteTesting, IndexedData class SpecificStorageTesting(DefaultStorageTesting): def setUp(self): gludb.config.default_database(None) # no default dat...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,475
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/examples/backup_demo.py
"""This is a VERY simple backup demo. Generally this file would be split across 3 different places: 1. The DBObject classes would be defined as part of your model/biz/etc classes 2. The database config would be part of your config/startup code 3. The actual backup script would import all of the above and then run ...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,476
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/versioning_tests.py
"""Insure that we handle versioning OK """ import unittest import json import gludb.config from gludb.simple import DBObject, Field from gludb.versioning import ( _isstr, record_diff, record_patch, append_diff_hist, parse_diff_hist, VersioningTypes ) from utils import compare_data_objects ...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,477
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/backends/sqlite.py
"""gludb.backends.sqlite - backend sqlite database module """ import sqlite3 from ..utils import uuid class Backend(object): def __init__(self, **kwrds): self.filename = kwrds.get('filename', '') if not self.filename: raise ValueError('sqlite backend requires a filename parameter') ...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,478
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/mongodb_tests.py
"""Testing for mongodb backend""" import unittest import gludb.config from simple_data_tests import SimpleStorage, DefaultStorageTesting from index_tests import IndexReadWriteTesting, IndexedData def delete_test_colls(): gludb.backends.mongodb.delete_collection( 'gludb_testing', SimpleStorage.g...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,479
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/simple_tests.py
"""Testing all the functionality in gludb.simple *except* for actual data storage (that's in simple_data_tests.py) """ import unittest from gludb.simple import DBObject, Field from gludb.data import Storable from gludb.versioning import VersioningTypes from utils import compare_data_objects @DBObject(table_name='S...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,480
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/backends/gcd.py
"""gludb.backends.gcd - backend Google Cloud Datastore module """ import sys from ..utils import uuid if sys.version_info >= (3, 0): raise ImportError("GLUDB GCD Backend only supports Python 2.7") import googledatastore as datastore # TODO: one day use this instead (when it has Python3 support) # from gcloud im...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,481
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/utils_tests.py
"""Testing gludb.utils functionality """ import unittest import datetime from gludb.utils import uuid, now_field, parse_now_field class UtilsTesting(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_uuid(self): # Tough to test UUID, but we'll at least ...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,482
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/utils.py
"""Central place for misc utilities """ import datetime from uuid import uuid4 def uuid(): """Return a decent UUID as a string""" return uuid4().hex def now_field(): """Return a string we use for storing our date time values""" return 'UTC:' + datetime.datetime.utcnow().isoformat() def parse_now...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,483
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/data.py
"""gludb.data The "core" functionality. If you're unsure what to use, you should look into gludb.simple. This module is for those needing advanced functionality or customization """ from abc import ABCMeta, abstractmethod from .config import get_mapping # A little magic for using metaclasses with both Python 2 and...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,484
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/setup.py
from codecs import open from os import path # Always prefer setuptools over distutils from setuptools import setup here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file # Note that we are using README.rst - it is generated from README.md in # build.sh with open(path.join(here,...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,485
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/simple_data_tests.py
"""Testing data storage functionality in gludb.simple (see simple_tests.py for testing of the rest of gludb.simple functionality)""" import unittest import datetime import time import gludb.config from gludb.versioning import VersioningTypes from gludb.data import orig_version from gludb.simple import DBObject, Fiel...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,486
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/backends/__init__.py
"""This sub-package contains all backends available in gludb. In general, you shouldn't need to directly use any of the classes here since they will be created and managed for you via the mappings available in gludb.config """
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,487
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/simple.py
"""gludb.simple Provides the simplest possible interface to our functionality. We provide a simple annotation to create classes with fields (with optional default values), parameterized constructors, persistence, and data operations. You are free to derive from any object you wish. See gludb.data if you need custom o...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,488
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/versioning.py
"""versioning.py GLUDB versioning implementation """ import json import datetime import json_delta # External dependency from .utils import now_field # Yes, this could be an enum, but we're supporting Python 2.7 class VersioningTypes(object): NONE = "ver:none" DELTA_HISTORY = "ver:delta" # Python 2&3 c...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,489
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/testpkg/subpkg1/module.py
from gludb.simple import DBObject, Field @DBObject(table_name='MidDataOne') class MidData1(object): name = Field('name')
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,490
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/utils.py
"""Some simple utilities for testing """ import json S3_DIR = '/tmp/s3' BACKUP_BUCKET_NAME = 'backup-testing-bucket' def compare_data_objects(obj1, obj2): def get_dict(o): d = json.loads(o.to_data()) for k in [k for k, _ in d.items() if k.startswith('_')]: del d[k] return d ...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,491
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/backup_tests.py
"""Testing backup functionality """ import unittest import tarfile import os.path as pth from itertools import chain import gludb.config from gludb.simple import DBObject, Field from gludb.backup import Backup, is_backup_class, backup_name, strip_line # Note that we expect our s3server.py mock server to be running,...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,492
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/testpkg/subpkg2/module.py
from gludb.simple import DBObject, Field @DBObject(table_name='MidDataTwo') class MidData2(object): name = Field('name')
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,493
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/backends/dynamodb.py
"""gludb.backends.dynamodb - backend dynamodb database module """ import os import boto.exception import boto.dynamodb2 # NOQA from boto.dynamodb2.layer1 import DynamoDBConnection from boto.dynamodb2.table import Table from boto.dynamodb2.fields import HashKey, GlobalIncludeIndex from boto.dynamodb2.items import It...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,494
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/__init__.py
"""GLUDB provides a fairly simple way to read/write data to some popular datastores like Amazon's DynamoDB and Google Cloud Datastore. We provide: * A simple abstraction layer for annotating classes that should be stored in the database * Support for versioning by automatically storing change history with the data *...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,495
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/testpkg/subpkg1/subsubpkg/module.py
from gludb.simple import DBObject, Field @DBObject(table_name='BottomData') class BottomData(object): name = Field('name')
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,496
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/gludb/backends/mongodb.py
"""MongoDB backend """ import json from pymongo import MongoClient from pymongo.errors import CollectionInvalid from ..utils import uuid def delete_collection(db_name, collection_name, host='localhost', port=27017): """Almost exclusively for testing""" client = MongoClient("mongodb://%s:%d" % (host, port))...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,497
GeneralizedLearningUtilities/GLUDB
refs/heads/master
/tests/map_mro_tests.py
"""Insure that we handle derived classes OK """ import unittest import sys import inspect import random import gludb.config from gludb.simple import DBObject, Field from gludb.data import Storable from gludb.config import get_mapping from utils import compare_data_objects @DBObject(table_name='BaseClass') class B...
{"/tests/dict_data_tests.py": ["/gludb/simple.py"], "/tests/testpkg/module.py": ["/gludb/simple.py"], "/tests/gcd_tests.py": ["/gludb/config.py"], "/gludb/backup.py": ["/gludb/utils.py", "/gludb/config.py", "/gludb/data.py", "/gludb/simple.py"], "/tests/index_tests.py": ["/gludb/config.py", "/gludb/simple.py"], "/tests...
92,534
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/views/password.py
from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from authentication.models import User class ResetPassword(APIView): # /resetpassword def post(self, request, format=None): email=request.data.get("...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,535
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/urls.py
from django.urls import path from .views.login import Login,Logout from .views.password import ResetPassword,ForgetPassword from .views.signup import Signup urlpatterns = [ path('login/',Login.as_view()), path('login/',Logout.as_view()), path('reset_password/',ResetPassword.as_view()), path('forget_pas...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,536
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/views/login.py
from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from common_utils.utils import validate_jwt from authentication.serializer import UserSerializer from authentication.models import User from common_utils.utils import g...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,537
khannashivangi99/UserAuthentication
refs/heads/master
/common_utils/models.py
from django.db import models import uuid from datetime import datetime # Create your models here. class BaseModel(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) created = models.DateTimeField(default=datetime.now(), null=True) is_active = models.BooleanField(def...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,538
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/models.py
from django.db import models from common_utils.models import BaseModel # Create your models here. class User(BaseModel): f_name=models.CharField(max_length=20) l_name=models.CharField(max_length=20) email=models.EmailField(max_length=30,unique=True) country_code = models.CharField(max_length=3) ...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,539
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/migrations/0001_initial.py
# Generated by Django 3.0 on 2020-11-15 14:56 import datetime from django.db import migrations, models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ (...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,540
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/views/signup.py
from django.http import Http404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from common_utils.utils import validate_jwt from authentication.serializer import UserSerializer from authentication.models import User import json from django.forms.mo...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,541
khannashivangi99/UserAuthentication
refs/heads/master
/common_utils/utils.py
import jwt from rest_framework.response import Response from authentication.models import User def validate_jwt(func): def func_wrapper(view, request): auth_token = request.META["HTTP_AUTHORIZATION"] print(auth_token) try: payload=jwt.decode(auth_token,'some',algorithms=['HS256']...
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,542
khannashivangi99/UserAuthentication
refs/heads/master
/authentication/serializer.py
from rest_framework import serializers from authentication.models import User class UserSerializer(serializers.ModelSerializer): class Meta: model=User fields=['id','f_name','l_name','email','country_code','phone','password']
{"/authentication/views/password.py": ["/authentication/models.py"], "/authentication/urls.py": ["/authentication/views/login.py", "/authentication/views/password.py", "/authentication/views/signup.py"], "/authentication/views/login.py": ["/common_utils/utils.py", "/authentication/serializer.py", "/authentication/model...
92,543
FX-Wood/python-data-structures
refs/heads/master
/binary_search_tree/test_binary_search_tree.py
import pytest from BinarySearchTree import BinarySearchTree from TreeNode import TreeNode @pytest.fixture def tree(): tree = BinarySearchTree() tree.insert(5) tree.insert(10) tree.insert(1) return tree class TestTree(): def test_defined(self, tree): assert tree != None def test_lef...
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,544
FX-Wood/python-data-structures
refs/heads/master
/queue_test.py
import pytest from queue import Queue queue = Queue() def has_a_data_attribute(): assert queue.data == []
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,545
FX-Wood/python-data-structures
refs/heads/master
/stack_test.py
from stack import Stack print(Stack) stack = Stack() # add two ints to the stack stack.push(5) stack.push(13) print( stack.peek() ) # prints 5 stack.pop() # returns 5 print( stack.peek() ) # prints 13 # these lines will empty the stack and return an index error # stack.pop() # print( stack.peek() )
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,546
FX-Wood/python-data-structures
refs/heads/master
/stack.py
class Stack(): def __init__(self): self.data = [] def push(self, element): self.data.append(element) def pop(self): return self.data.pop(len(self.data) -1) def peek(self): return self.data[-1]
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,547
FX-Wood/python-data-structures
refs/heads/master
/linked_list/test_linked_list.py
import pytest from linked_list import LinkedList @pytest.fixture def l_list(): l = LinkedList() return l @pytest.fixture def list_4(): l = LinkedList() l.add('I am the HEAD') l.add('I am index 1') l.add('I am index 2') l.add('I am index 3') return l # Makes a list def test_defined(l_l...
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,548
FX-Wood/python-data-structures
refs/heads/master
/hash_table.py
import hashlib class HashTable(): def __init__(self, size=128): self.size = size self.data = [ [] for i in range(self.size)] def hash_key_to_index(self, key): return int(hashlib.md5( key.encode() ).hexdigest(), 16) % self.size def print_table(self): for item in self.da...
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,549
FX-Wood/python-data-structures
refs/heads/master
/linked_list/linked_list.py
from list_node import ListNode class LinkedList(): def __init__(self): self.head = None def add(self, data): if self.head == None: self.head = ListNode(data) else: current = self.head while current.pointer != None: current = curre...
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,550
FX-Wood/python-data-structures
refs/heads/master
/binary_search_tree/BinarySearchTree.py
from TreeNode import TreeNode class BinarySearchTree(): def __init__(self): self.root = None def insert(self, data, node=None): if not node: node = TreeNode(data) # if no root if not self.root: # make new node at root self.root = node ...
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,551
FX-Wood/python-data-structures
refs/heads/master
/test_hash_table.py
import hashlib from hash_table import HashTable def hash_example(string): hash_key = hashlib.md5( string.encode() ) hash_hex = hash_key.hexdigest() hash_int = int(hash_hex, 16) return {'hash_key': hash_key, 'hash_hex': hash_hex, 'hash_int': hash_int } for item in hash_example('Hello World'): print...
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,552
FX-Wood/python-data-structures
refs/heads/master
/queue.py
class Queue(): def __init__(self): self.data = [] def enqueue(self, element): return self.data.append(element) def dequeue(self): return self.data.pop(0)
{"/queue_test.py": ["/queue.py"], "/stack_test.py": ["/stack.py"], "/test_hash_table.py": ["/hash_table.py"]}
92,559
KIPAC/NWayMatch
refs/heads/main
/setup.py
from setuptools import setup from python.nway import version setup( name="nway", version=version.get_git_version(), author="", author_email="", url = "https://github.com/KIPAC/NWayMatch", package_dir={"":"python"}, packages=["nway"], description="=Matching algorithm for multiple input ...
{"/setup.py": ["/python/nway/__init__.py"], "/python/nway/__init__.py": ["/python/nway/nway.py"]}
92,560
KIPAC/NWayMatch
refs/heads/main
/python/nway/__init__.py
""" Matching algorithm for multiple input source catalogs """ from .nway import *
{"/setup.py": ["/python/nway/__init__.py"], "/python/nway/__init__.py": ["/python/nway/nway.py"]}
92,561
KIPAC/NWayMatch
refs/heads/main
/python/nway/nway.py
""" Proof of concept for n-way matching using footprint detection Some terminology: cell : A small area, used to find matches, The size should be about the same as the maximum match radius. source : As per DM, per-catalog detection matchWcs : The WCS used to define the cells subRegion : A square sub-...
{"/setup.py": ["/python/nway/__init__.py"], "/python/nway/__init__.py": ["/python/nway/nway.py"]}
92,605
anhuiyu/myblog
refs/heads/master
/blog/templatetags/my_tags.py
from django import template from blog import models from django.db.models import Count register=template.Library() @register.inclusion_tag("left_menu.html") def get_left_menu(username): user=models.UserInfo.objects.filter(username=username).first() blog=user.blog category_list=models.Category.objects.filt...
{"/blog/views.py": ["/blog/forms.py"]}
92,606
anhuiyu/myblog
refs/heads/master
/blog/views.py
from django.shortcuts import render,HttpResponse,redirect from django.contrib import auth from .forms import RegForm from .models import UserInfo from blog import models from django.http import JsonResponse from PIL import Image,ImageDraw,ImageFont from io import BytesIO from django.db.models import Count import rando...
{"/blog/views.py": ["/blog/forms.py"]}
92,607
anhuiyu/myblog
refs/heads/master
/blog/migrations/0002_userinfo_avatar.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2020-09-03 06:35 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.AddField( m...
{"/blog/views.py": ["/blog/forms.py"]}
92,608
anhuiyu/myblog
refs/heads/master
/blog/forms.py
""" bbs 用到的form类 """ #定义一个注册用的form类 from django import forms from django.forms import widgets from django.core.exceptions import ValidationError from blog import models #定义一个注册的form类 class RegForm(forms.Form): username=forms.CharField( max_length=16, label="用户名", error_messages={ ...
{"/blog/views.py": ["/blog/forms.py"]}
92,611
kimmo1019/scDEC
refs/heads/master
/model.py
import tensorflow as tf import tensorflow.contrib as tc import tensorflow.contrib.layers as tcl #the default is relu function def leaky_relu(x, alpha=0.2): return tf.maximum(tf.minimum(0.0, alpha * x), x) #return tf.maximum(0.0, x) #return tf.nn.tanh(x) #return tf.nn.elu(x) def conv_cond_concat(x, y):...
{"/main_clustering.py": ["/util.py"]}
92,612
kimmo1019/scDEC
refs/heads/master
/util.py
from __future__ import division import scipy.sparse as sp import scipy.io import numpy as np import copy from scipy import pi import sys import pandas as pd from os.path import join import gzip from scipy.io import mmwrite,mmread from sklearn.decomposition import PCA,TruncatedSVD from sklearn.metrics.pairwise import c...
{"/main_clustering.py": ["/util.py"]}
92,613
kimmo1019/scDEC
refs/heads/master
/main_clustering.py
from __future__ import division import os,sys import time import dateutil.tz import datetime import argparse import importlib import tensorflow as tf import numpy as np import random import copy import math import util import metric from sklearn.cluster import KMeans from sklearn.metrics.cluster import normalized_mutua...
{"/main_clustering.py": ["/util.py"]}
92,614
kimmo1019/scDEC
refs/heads/master
/eval.py
import argparse import metric from sklearn.cluster import KMeans from sklearn.metrics.cluster import normalized_mutual_info_score, adjusted_rand_score from sklearn.metrics.cluster import homogeneity_score, adjusted_mutual_info_score import numpy as np import random import sys,os from scipy.io import loadmat from sklear...
{"/main_clustering.py": ["/util.py"]}
92,618
tiru1930/text-recognition
refs/heads/master
/models/crnn.py
import torch.nn as nn import torch.nn.functional as F class BidirectionalLSTM(nn.Module): def __init__(self, nIn, nHidden, nOut): super(BidirectionalLSTM, self).__init__() self.rnn = nn.LSTM(nIn, nHidden, bidirectional=True) self.embedding = nn.Linear(nHidden * 2, nOut) def forward(s...
{"/demo.py": ["/models/crnn.py"]}
92,619
tiru1930/text-recognition
refs/heads/master
/prepare_lmdb_data_for_IIIT5k.py
import scipy.io from create_lmdb_dataset import createDataset class prepareData(object): """docstring for DataLodaer""" def __init__(self): super(prepareData, self).__init__() self.train_data_mat = "./data/IIIT5K/traindata.mat" self.test_data_mat = "./data/IIIT5K/testdata.mat" self.loaded_train_data_mat = ...
{"/demo.py": ["/models/crnn.py"]}