index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
81,346
claha/suunto
refs/heads/main
/suunto/exceptions.py
class SuuntoException(Exception): pass class SuuntoDurationException(SuuntoException): pass
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,347
claha/suunto
refs/heads/main
/suunto/__init__.py
from .workout import Workout from .duration import Time from .duration import Distance
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,348
claha/suunto
refs/heads/main
/suunto/duration/distance.py
# Import from ..exceptions import SuuntoDurationException from .duration import Duration # Distance class Distance(Duration): def __init__(self, km=None, m=None): if (km,m) == (None,None): raise SuuntoDurationException('ERROR: Must provide km and/or m when creating Distance object') se...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,349
claha/suunto
refs/heads/main
/suunto/duration/duration.py
# Import from ..exceptions import SuuntoDurationException # Duration class Duration(object): def __str__(self): return '<{0}: {1}{2}>'.format(self.__class__.__name__, self.getDuration(), self.getUnit()) def __repr__(self): return self.__str__() def __add__(self, other): if isinst...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,350
claha/suunto
refs/heads/main
/suunto/workout/repeat.py
# Import from .step import Step # Repeat class Repeat(object): def __init__(self, names, durations, count): self.steps = [] for (name,duration) in zip(names,durations): self.steps.append(Step(name,duration)) self.count = count def generateHeader(self,step): ...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,351
claha/suunto
refs/heads/main
/example.py
# Import from suunto import Workout from suunto import Time from suunto import Distance from suunto.constants import * # Define workout # Warmup - 10min # For 5 rounds repeat # Work - 100M # Rest - 30s # Cooldown - 5min # # Use the predefined times/distances or create your own using: # Time(h=hours,m=minutes,s=secon...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,352
claha/suunto
refs/heads/main
/suunto/duration/time.py
# Import from ..exceptions import SuuntoDurationException from .duration import Duration # Time class Time(Duration): def __init__(self, h=None, m=None, s=None): if (h,m,s) == (None,None,None): raise SuuntoDurationException('ERROR: Must provide h, m and/or s when creating Time object') ...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,353
claha/suunto
refs/heads/main
/suunto/workout/step.py
# Step class Step(object): def __init__(self, name, duration): self.name = name self.duration = duration def generateHeader(self): return '/* %s - %s */\n' % (self.name, self.duration) def generateCode(self, file, step, postfixEnabled): file.write(self.generateHead...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,354
claha/suunto
refs/heads/main
/suunto/workout/workout.py
# Import import sys from .step import Step from .repeat import Repeat # Workout class Workout(object): def __init__(self): self.workout = [] self.steps = [] self.postfixEnabled = True # TODO: check that len(name) <= 6 def addStep(self, name, duration): self.workout.append(...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,355
claha/suunto
refs/heads/main
/suunto/duration/__init__.py
from .time import Time from .distance import Distance
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,356
claha/suunto
refs/heads/main
/suunto/constants.py
# Import from .duration import Time from .duration import Distance # Predefined times T5S = Time(s=5) T10S = Time(s=10) T20S = Time(s=20) T30S = Time(s=30) T40S = Time(s=40) T50S = Time(s=50) T60S = Time(s=60) T70S = Time(s=70) T80S = Time(s=80) T90S = Time(s=90) T1M = Time(m=1) T2M = Time(m=2) T3M = Time(m=3) T4M = ...
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,357
claha/suunto
refs/heads/main
/suunto/workout/__init__.py
from .workout import Workout
{"/suunto/__init__.py": ["/suunto/workout/__init__.py", "/suunto/duration/__init__.py"], "/suunto/duration/distance.py": ["/suunto/exceptions.py", "/suunto/duration/duration.py"], "/suunto/duration/duration.py": ["/suunto/exceptions.py"], "/suunto/workout/repeat.py": ["/suunto/workout/step.py"], "/example.py": ["/suunt...
81,394
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_class/normalizer.py
import maru import pymorphy2 from datetime import datetime import time class Normalizer(object): def __init__(self): self.morph = pymorphy2.MorphAnalyzer() self.analyzer = maru.get_analyzer(tagger='crf', lemmatizer='pymorphy') def pymorphy2(self, words): normal_words = [] print...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,395
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_class/compatibility_analysis.py
from analyzer.analyzer_class.thesaurus import Thesaurus class CalculateTheProbability(object): def __call__(self, one_keys, two_keys): common_keywords = [] for word in two_keys: if word in one_keys: common_keywords.append(word) results = round(len(common_keyword...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,396
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_class/tokenizer.py
from natasha import ( Segmenter, MorphVocab, NewsEmbedding, NewsMorphTagger, NewsSyntaxParser, NewsNERTagger, NamesExtractor, Doc) from rutermextract import TermExtractor class Tokenizer(object): def __init__(self): self.segmenter = Segmenter() self.morph_vocab = M...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,397
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_class/read_file.py
import os import docx import unicodedata from django.core.files.storage import FileSystemStorage from django.http import HttpResponseRedirect from subprocess import Popen, PIPE from mysite2 import settings class ReadFile(object): def __init__(self): self.file_system_storage = FileSystemStorage() s...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,398
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/tests/test_views.py
from django.test import TestCase from analysis_material.models import Document from django.urls import reverse from django.contrib.auth.models import User # Необходимо для представления User как borrower class DocumentByUserListViewTest(TestCase): def setUp(self): # Создание двух пользователей te...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,399
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/thesaurus.py
# from analyzer.analyzer_cla.text_preprocessing import TextPreprocessing # from analyzer.analyzer_cla.tf_idf import TFIDF # # # class Thesaurus(object): # def __init__(self): # self.text_preprocessing = TextPreprocessing() # self.tf_idf = TFIDF() # self.alpha = 0.1 # self.betta = 0.6...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,400
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/admin.py
from django.contrib import admin from .models import Document, AnalysisDocument, Relation_Document_Analysis, Keyword admin.site.register(Document)
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,401
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/migrations/0001_initial.py
# Generated by Django 3.0.6 on 2020-06-08 06:20 import autoslug.fields from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,402
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/views.py
from django.shortcuts import render from analyzer.analyzer_class.read_file import ReadFile from analyzer.analyzer_class.compatibility_analysis import CompatibilityAnalysis # Create your views here. def index(request): return render(request, 'html/index.html') def analize_one(request): retur...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,403
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/normalizer.py
# import pymorphy2 # # # class Normalizer(object): # def __init__(self): # self.morph = pymorphy2.MorphAnalyzer() # # def lemma_pymorphy2(self, words): # normal_words = [] # for word in words: # p = self.morph.parse(word)[0] # normal_words.append(p.normal_form) # ...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,404
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/tests/test_models.py
from django.test import TestCase from analysis_material.models import Document class DocumentModelTest(TestCase): @classmethod def setUpTestData(cls): Document.objects.create(name_document='История', path_file='documents/1_2_главы.docx') def test_name_document_label(self): document = Doc...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,405
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/key_words.py
# # from analyzer.analyzer_cla.cleaner import Cleaner # from analyzer.analyzer_cla.tokenizer import Tokenizer # from analyzer.analyzer_cla.text_preprocessing import TextPreprocessing # from analyzer.analyzer_cla.tf_idf import TFIDF # # import pandas as pd # from nltk.util import ngrams # # from sklearn.feature_extracti...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,406
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/models.py
from django.db import models from django.urls import reverse from django.contrib.auth.models import User class Document(models.Model): user = models.ForeignKey(User, verbose_name="Пользователь", on_delete=models.SET_NULL, null=True, blank=True) name_document = models.CharField("Учебный материал", max_length=20...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,407
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/apps.py
from django.apps import AppConfig class AnalysisMaterialConfig(AppConfig): name = 'analysis_material'
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,408
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/tf_idf.py
# import math # from collections import Counter # import matplotlib.pyplot as plt # import numpy as np # # # class IDF(object): # def __call__(self, word, text): # return math.log10(len(text) / sum([1.0 for i in text if word in i])) # # # class TF(object): # def __call__(self, text): # tf_text =...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,409
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/views.py
from django.shortcuts import render, redirect from django.views.generic import View, ListView, DetailView, CreateView, DeleteView from analyzer.analyzer_class.read_file import ReadFile from analyzer.analyzer_class.compatibility_analysis import CompatibilityAnalysis from analyzer.analyzer_class.thesaurus import Thesauru...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,410
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/text_preprocessing.py
# from analyzer.analyzer_cla.cleaner import Cleaner # from analyzer.analyzer_cla.tokenizer import Tokenizer # from analyzer.analyzer_cla.normalizer import Normalizer # from analyzer.analyzer_cla.abbreviations import Abbreviations # # # class TextPreprocessing(object): # def __init__(self): # self.cleaner = ...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,411
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/ner.py
from natasha import ( Segmenter, MorphVocab, NewsEmbedding, NewsMorphTagger, NewsSyntaxParser, NewsNERTagger, PER, NamesExtractor, Doc ) class NER(object): def __init__(self): self.segmenter = Segmenter() self.morph_vocab = MorphVocab() s...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,412
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/tests/test_forms.py
from django.test import TestCase import datetime from django.utils import timezone from analysis_material.forms import DocumentForm class DocumentFormTest(TestCase): def test_document_form_name_field_label(self): form = DocumentForm() self.assertTrue(form.fields['name_document'].label == None or f...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,413
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_cla/cleaner.py
# from nltk.corpus import stopwords # import re # # # class Cleaner(object): # def __init__(self): # self.stop_words = stopwords.words('russian') # # def delete_stop_words(self, words): # filtered_words = [word for word in words if word not in self.stop_words] # return filtered_words # #...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,414
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analysis_material/urls.py
from django.urls import path from . import views urlpatterns = [ path('', views.HomeViews.as_view(), name="home"), # главная страница path('calculation_compatibility/', views.AnalysisMaterialViews.as_view(), name="calculation_compatibility"), path('result_analize_two/', views.result_analize_two, name="r...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,415
ViolettaOverchenko/Diplom2
refs/heads/master
/mysite2/analyzer/analyzer_class/abbreviations.py
import re class Abbreviations(object): def __init__(self): self.re_str_abbr = r"\b[0-9]*[-]*[A-ZА-Я]{1,}[a-zа-я]*[A-ZА-Я]{1,}[-]*[a-zA-Zа-яА-Я0-9]*\b" def __call__(self, text): abbr = re.findall(self.re_str_abbr, text) for word in abbr: text = text.replace(word, '') ...
{"/mysite2/analysis_material/admin.py": ["/mysite2/analysis_material/models.py"], "/mysite2/analysis_material/views.py": ["/mysite2/analysis_material/models.py"]}
81,422
lcshell/sql_inject_fuzz
refs/heads/master
/error_blind/error_Inject.py
# Get型 # 报错注入 # 传递的url需要digit_char_Inject.py脚本测试后的payload,因为有可能是字符型的报错注入 import requests from termcolor import cprint import re from urllib.parse import urlparse class Fuzz: def __init__(self, url, cookie): self.url = url self.headers = {"cookie": cookie} self.Notes = ['--+', '-- ', '%23']...
{"/scan.py": ["/Libs/func.py"]}
81,423
lcshell/sql_inject_fuzz
refs/heads/master
/demo.py
# # 测试脚本 import requests # # url = "http://demo.dvwa.com/vulnerabilities/sqli/?id=1' and 1=1&Submit=Submit#" # # data1 = "uname=admin' and 1=1 --+&passwd=123&submit=Submit" # # data2 = "uname=admin' and 1=2 #&passwd=admin&submit=Submit" # # headers = {'Content-Type': 'application/x-www-form-urlencoded'} # headers = {"c...
{"/scan.py": ["/Libs/func.py"]}
81,424
lcshell/sql_inject_fuzz
refs/heads/master
/scan.py
#-*- coding:utf-8 -*- from optparse import OptionParser from Libs.func import * import threading from queue import Queue event = threading.Event() event.set() q_urls = Queue(-1) col = Color() init = FuzzFunction() # 多线程类 class multi_thread(threading.Thread): def __init__(self, q_urls, num): threading.Th...
{"/scan.py": ["/Libs/func.py"]}
81,425
lcshell/sql_inject_fuzz
refs/heads/master
/Libs/waf.py
# 检测waf class Waf: def __init__(self): self.wafName = {'name': None} def detect(self, text): aliyun = self.aliyun(text) Ddun = self.Ddun(text) safeDog = self.safeDog(text) if aliyun: return {'Flag': 'True', 'wafName': '[阿里云盾]', 'payload': '?x=1 and 1 like 1 ...
{"/scan.py": ["/Libs/func.py"]}
81,426
lcshell/sql_inject_fuzz
refs/heads/master
/error_blind/blind_Inject.py
# GET型 # Mysql延时注入 import requests from termcolor import cprint import time blind_mysql_payloads = [" and sleep( if( (select length(database()) >0) , 5, 0 ) )", " and If(ascii(substr(database(),1,1))=115,1,sleep(5))", " or sleep(ord(substr(password,1,1)))" ...
{"/scan.py": ["/Libs/func.py"]}
81,427
lcshell/sql_inject_fuzz
refs/heads/master
/Fuzz/get/GET_digit_char_Inject.py
# GET型 # 先用特殊字符检测,然后判断是数字型还是字符型注入 # 用/***/替换空格,用like替换= 具体案例看漏洞集合\骚姿势漏洞\绕Waf注入 import requests from termcolor import cprint from urllib.parse import urlparse from Libs.fuzzClass import FuzzFather class Fuzz(FuzzFather): def __init__(self, url, cookie, postPath=None): FuzzFather.__init__(self) sel...
{"/scan.py": ["/Libs/func.py"]}
81,428
lcshell/sql_inject_fuzz
refs/heads/master
/Fuzz/post/POST_digit_char_Inject.py
# post注入 # 先用特殊字符检测,然后判断是数字型还是字符型注入 # 用/***/替换空格,用like替换= 具体案例看漏洞集合\骚姿势漏洞\绕Waf注入 import requests from termcolor import cprint import threading from queue import Queue from Libs.fuzzClass import FuzzFather event = threading.Event() event.set() q = Queue(-1) class Fuzz(FuzzFather): def __init__(self, postPath, u...
{"/scan.py": ["/Libs/func.py"]}
81,429
lcshell/sql_inject_fuzz
refs/heads/master
/Libs/func.py
import os import sys from Libs.color import * from urllib.parse import urlparse import os col = Color() root_path = os.getcwd() # 定义Fuzz文件夹各个功能的类 class FuzzFunction(): def __init__(self): self.path = os.getcwd() + '/Fuzz/' # 跳到根目录 # 列出Fuzz文件夹内的所有注入类型文件夹名字 def FuzzFloderList(self): Fol...
{"/scan.py": ["/Libs/func.py"]}
81,431
lonewolf045/grid_backend
refs/heads/master
/dbcomm/views.py
from django.shortcuts import render from dbcomm.prediction import SmartBagRecommendations,FrontPage from django.http.response import JsonResponse from rest_framework.parsers import JSONParser from rest_framework import status from dbcomm.models import User,Products,Orders from dbcomm.serializer import UserSerializer...
{"/dbcomm/views.py": ["/dbcomm/prediction.py", "/dbcomm/models.py", "/dbcomm/serializer.py"], "/dbcomm/migrations/0001_initial.py": ["/dbcomm/models.py"], "/dbcomm/serializer.py": ["/dbcomm/models.py"]}
81,432
lonewolf045/grid_backend
refs/heads/master
/dbcomm/migrations/0001_initial.py
# Generated by Django 3.2.7 on 2021-09-28 06:05 import dbcomm.models from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Orders', fields=[ ('id...
{"/dbcomm/views.py": ["/dbcomm/prediction.py", "/dbcomm/models.py", "/dbcomm/serializer.py"], "/dbcomm/migrations/0001_initial.py": ["/dbcomm/models.py"], "/dbcomm/serializer.py": ["/dbcomm/models.py"]}
81,433
lonewolf045/grid_backend
refs/heads/master
/dbcomm/urls.py
from django.conf.urls import url from django.urls import path from dbcomm import views urlpatterns = [ url(r'^api/signup$',views.signup_user), url(r'^api/login$',views.login_user), path('api/products/<str:cat>/',views.products), path('api/smartbag/<int:id>/',views.smartbag_products), path('api/pro...
{"/dbcomm/views.py": ["/dbcomm/prediction.py", "/dbcomm/models.py", "/dbcomm/serializer.py"], "/dbcomm/migrations/0001_initial.py": ["/dbcomm/models.py"], "/dbcomm/serializer.py": ["/dbcomm/models.py"]}
81,434
lonewolf045/grid_backend
refs/heads/master
/dbcomm/serializer.py
from django.db.models import fields from rest_framework import serializers from dbcomm.models import User,Products,Orders class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('user_id','email_id','password') #extra_kwargs = {'password': {'write_only' : True}...
{"/dbcomm/views.py": ["/dbcomm/prediction.py", "/dbcomm/models.py", "/dbcomm/serializer.py"], "/dbcomm/migrations/0001_initial.py": ["/dbcomm/models.py"], "/dbcomm/serializer.py": ["/dbcomm/models.py"]}
81,435
lonewolf045/grid_backend
refs/heads/master
/dbcomm/models.py
from django.db import models import random def random_string(): return str(random.randint(1000, 1999)) class User(models.Model): email_id = models.EmailField(max_length=254,blank=False,default='') password = models.CharField(max_length=25,blank=False,default='password') user_id = models.CharField(prim...
{"/dbcomm/views.py": ["/dbcomm/prediction.py", "/dbcomm/models.py", "/dbcomm/serializer.py"], "/dbcomm/migrations/0001_initial.py": ["/dbcomm/models.py"], "/dbcomm/serializer.py": ["/dbcomm/models.py"]}
81,436
lonewolf045/grid_backend
refs/heads/master
/dbcomm/prediction.py
# -*- coding: utf-8 -*- import pandas as pd import numpy as np import tempfile import tensorflow as tf import os dir = os.path.dirname(os.path.abspath(__file__)) def SmartBagRecommendations(user_number): with tempfile.TemporaryDirectory() as tmp: path = os.path.abspath(dir+'/Flipkart Grid/TFRS_model') # Lo...
{"/dbcomm/views.py": ["/dbcomm/prediction.py", "/dbcomm/models.py", "/dbcomm/serializer.py"], "/dbcomm/migrations/0001_initial.py": ["/dbcomm/models.py"], "/dbcomm/serializer.py": ["/dbcomm/models.py"]}
81,442
oriphi/PrettyTrace
refs/heads/master
/menu.py
import shutil import sys import tty from os import system class MenuItem(): def __init__(self, item, subItems = []): self.item = item self.sub = subItems self.w, self.h = shutil.get_terminal_size() self.collapsed = True self.selected = u"\u001b[1;30;43m{}\u001b[0m" ...
{"/prettyTrace.py": ["/menu.py"]}
81,443
oriphi/PrettyTrace
refs/heads/master
/prettyTrace.py
#!/usr/bin/python3 from sys import argv from menu import * import sys import re import re functionRegex = r'^([0-9,a-f]{8}) <(.*)>:\n$' lineRegex = r'^([0-9,a-f]{8}):\t+([0-9,a-f]*)\s*\t*(.*)\n$' # Time -Cycles - PC - Instr -Mnemo traceRegex = r'^\s*(\d+)\s*(\d+)\s*([0-9,a-f]+)\s*([0-9,a-f]+)\s*(.+)\n$' def makeD...
{"/prettyTrace.py": ["/menu.py"]}
81,444
PhungXuanAnh/django-vuejs-crud-app
refs/heads/master
/backend/catalog/models.py
from django.db import models class Product(models.Model): sku = models.CharField(max_length=13,help_text="Enter Stock Keeping Unit") name = models.CharField(max_length=200, help_text="Enter product name") description = models.TextField(help_text="Enter product description") buyPrice = models.Deci...
{"/backend/catalog/serializers.py": ["/backend/catalog/models.py"]}
81,445
PhungXuanAnh/django-vuejs-crud-app
refs/heads/master
/backend/catalog/serializers.py
from rest_framework import serializers from .models import Product class ProductSerializer(serializers.ModelSerializer): class Meta: model = Product fields = ('pk','sku', 'name', 'description', 'buyPrice','sellPrice','unit','quantity')
{"/backend/catalog/serializers.py": ["/backend/catalog/models.py"]}
81,446
PhungXuanAnh/django-vuejs-crud-app
refs/heads/master
/backend/catalog/migrations/0001_initial.py
# Generated by Django 2.0.6 on 2018-06-13 09:02 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Product', fields=[ ('id', models.AutoField(...
{"/backend/catalog/serializers.py": ["/backend/catalog/models.py"]}
81,447
PhungXuanAnh/django-vuejs-crud-app
refs/heads/master
/backend/catalog/migrations/0002_auto_20180613_0903.py
from django.db import migrations from django.conf import settings def create_data(apps, schema_editor): Product = apps.get_model('catalog', 'Product') Product(sku='sku1',name='Product 1', description='Product 1', buyPrice=100 , sellPrice=100,unit='kilogram', quantity=100).save() Product(sku='sku2',name='Pr...
{"/backend/catalog/serializers.py": ["/backend/catalog/models.py"]}
81,463
hnforwk/WechatPublicHistoryInfoSpider
refs/heads/master
/WechatHistorySpider/test.py
# -*- encoding:utf-8 -*- from urllib import parse import urllib.request # params = parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) params_ = parse.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) ###自动转化成下面url的参数形式 params = 'eggs=2&bacon=0&spam=1' # f = urllib.request.urlopen("http://www.musi-cal.com/cgi-bin/query...
{"/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py": ["/WechatHistorySpider/WechatHistorySpider/items.py"]}
81,464
hnforwk/WechatPublicHistoryInfoSpider
refs/heads/master
/WechatHistorySpider/WechatHistorySpider/spiders/dian_zan.py
# -*- coding: utf-8 -*- import scrapy from urllib import parse class DianZanSpider(scrapy.Spider): name = 'dian_zan' allowed_domains = ['weixin.qq.com'] # start_urls = ['https://mp.weixin.qq.com/mp/getappmsgext'] def start_requests(self): yield scrapy.FormRequest( url='https://mp...
{"/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py": ["/WechatHistorySpider/WechatHistorySpider/items.py"]}
81,465
hnforwk/WechatPublicHistoryInfoSpider
refs/heads/master
/WechatHistorySpider/WechatHistorySpider/items.py
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class WechathistoryspiderItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() pass class HistoryItem(scr...
{"/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py": ["/WechatHistorySpider/WechatHistorySpider/items.py"]}
81,466
hnforwk/WechatPublicHistoryInfoSpider
refs/heads/master
/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py
# -*- coding: utf-8 -*- import scrapy import json import re from ..items import HistoryItem class WechatHistorySpider(scrapy.Spider): name = 'wechat_history' allowed_domains = ['mp.weixin.qq.com'] # start_urls = ['http://mp.weixin.qq.com/mp/getmasssendmsg?__biz=MzA3MjEzNDYxMg==#wechat_webview_type=1&wecha...
{"/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py": ["/WechatHistorySpider/WechatHistorySpider/items.py"]}
81,467
hnforwk/WechatPublicHistoryInfoSpider
refs/heads/master
/WechatHistorySpider/WechatHistorySpider/pipelines.py
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from pymysql import cursors from twisted.enterprise import adbapi class WechathistoryspiderPipeline(object): def process_i...
{"/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py": ["/WechatHistorySpider/WechatHistorySpider/items.py"]}
81,468
hnforwk/WechatPublicHistoryInfoSpider
refs/heads/master
/WechatHistorySpider/1.py
# -*- coding:utf-8 -*- import time import requests import json # 目标url url = "http://mp.weixin.qq.com/mp/getappmsgext" # 添加Cookie避免登陆操作,这里的"User-Agent"最好为手机浏览器的标识 headers = { "cookie": 'pvid=7494844460; rewardsn=; wxtokenkey=10e9fdcc172142741602222ce7ee61691237ecb657567c116e42d5ca51b3749c; wxuin=2646451627; devi...
{"/WechatHistorySpider/WechatHistorySpider/spiders/wechat_history.py": ["/WechatHistorySpider/WechatHistorySpider/items.py"]}
81,486
Francesco-Prandini/birdlogger
refs/heads/master
/lib/authomatic/providers/persona.py
from authomatic import providers from authomatic.exceptions import FailureError import authomatic.core as core import authomatic.settings as settings class MozillaPersona(providers.AuthenticationProvider): pass
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,487
Francesco-Prandini/birdlogger
refs/heads/master
/lib/eightbit/client/client.py
import os import logging import requests import json from StringIO import StringIO try: from PIL import Image CAN_RESIZE = True except ImportError: CAN_RESIZE = False print ('It is recommended to install PIL/Pillow with the desired image format support so that ' 'image resizing to the correct dimesion...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,488
Francesco-Prandini/birdlogger
refs/heads/master
/main.py
from google.appengine.ext.webapp import template import os.path import webapp2 import logging import DataLayer import json import geojson import forms import time import datetime from decimal import * #authentication imports import authentication from webapp2_extras import sessions from webapp2_extras.auth imp...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,489
Francesco-Prandini/birdlogger
refs/heads/master
/lib/eightbit/client/__init__.py
from __future__ import absolute_import from .client import EightbitApi
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,490
Francesco-Prandini/birdlogger
refs/heads/master
/DataLayer.py
from google.appengine.ext import ndb from webapp2_extras.appengine.auth import models from webapp2_extras import security class BaseModel(ndb.Model): @property def id(self): return str(self.key.id()) pass class User(BaseModel, models.User): userName=ndb.StringProperty() email=ndb.Str...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,491
Francesco-Prandini/birdlogger
refs/heads/master
/lib/BirdRecognition.py
import requests import requests_toolbelt.adapters.appengine #import webapp2 from os.path import basename class Client: token = None def __init__(self, client_id=None, client_secret=None): '''Initialize the 'Blippar Vision API' Client object, ''' ''' if id and secret parameters are not passed,''' ''' default ...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,492
Francesco-Prandini/birdlogger
refs/heads/master
/authomatic_config.py
# -*- coding: utf-8 -*- """ Keys with leading underscore are our custom provider-specific data. """ from authomatic.providers import oauth2, oauth1 import authomatic import copy DEFAULT_MESSAGE = 'Have you got a bandage?' SECRET = '###########' DEFAULTS = { 'popup': True, } OAUTH2 = { 'facebook': { ...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,493
Francesco-Prandini/birdlogger
refs/heads/master
/forms.py
from wtforms import form, fields, validators, widgets from wtforms.validators import ValidationError class TagListField(fields.Field): widget = widgets.TextInput() def _value(self): if self.data: return ' '.join(self.data) else: return '' def process_formdata(sel...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,494
Francesco-Prandini/birdlogger
refs/heads/master
/authentication.py
#authentication imports from webapp2_extras import auth class Authentication(auth.Auth): def login(self, auth_id, remember=False, save_session=True, silent=False): """Returns a user based on password credentials. :param auth_id: Authentication id. ...
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,495
Francesco-Prandini/birdlogger
refs/heads/master
/appengine_config.py
from google.appengine.ext import vendor vendor.add('lib') vendor.add('lib/geojson')
{"/main.py": ["/DataLayer.py", "/forms.py", "/authentication.py", "/authomatic_config.py"], "/lib/eightbit/client/__init__.py": ["/lib/eightbit/client/client.py"]}
81,496
digideskio/munchkin
refs/heads/master
/player.py
import logging log = logging.getLogger("MunchkinServer") class Player(object): def __init__(self, name, connection): self.level = 1 self.bonus = 0 self.id = 0 self.hand = [] self.carried = [] self.name = name self.connected = True self.connection = connection self.ready = False s...
{"/cards.py": ["/enums.py"], "/ai.py": ["/player.py"]}
81,497
digideskio/munchkin
refs/heads/master
/cards.py
import json from enums import Moves, Phases IMAGE_ROOT = 'res/' class Card(object): def __init__(self, game, deck, id): self.id = id self.in_hand = True self.deck = deck self.game = game def discard(self): self.game.discard(self) def can_play(self, move, target, phase, in_turn): retur...
{"/cards.py": ["/enums.py"], "/ai.py": ["/player.py"]}
81,498
digideskio/munchkin
refs/heads/master
/temp.py
import tornado.web import mimetypes import os.path class FileHandler(tornado.web.RequestHandler): def get(self, path): if not path: path = 'index.html' if not os.path.exists(path): raise tornado.web.HTTPError(404) mime_type = mimetypes.guess_type(path) ...
{"/cards.py": ["/enums.py"], "/ai.py": ["/player.py"]}
81,499
digideskio/munchkin
refs/heads/master
/ai.py
import json from player import Player import logging log = logging.getLogger("MunchkinServer") class AI(Player): def __init__(self, name, connection): super().__init__(name, AIConnection(self)) class AIConnection(object): def __init__(self, player): self.player = player def write_message(self...
{"/cards.py": ["/enums.py"], "/ai.py": ["/player.py"]}
81,500
digideskio/munchkin
refs/heads/master
/server.py
import random import cards import logging import threading import json import time from enums import Moves, Phases from collections import defaultdict from ai import AI from player import Player log = logging.getLogger("MunchkinServer") log.setLevel(logging.DEBUG) #placeholder for gettext def gettext(s...
{"/cards.py": ["/enums.py"], "/ai.py": ["/player.py"]}
81,501
digideskio/munchkin
refs/heads/master
/enums.py
def enum(*sequential, **named): enums = dict(zip(sequential, map(str, sequential)), **named) return type('Enum', (), enums) Phases = enum( 'SETUP', 'BEGIN', 'PRE_DRAW', 'KICK_DOOR', 'COMBAT', 'POST_COMBAT', 'LOOT_ROOM', 'CHARITY', 'END', ) Moves = enum( 'DRAW', 'CARRY', 'PLAY', 'F...
{"/cards.py": ["/enums.py"], "/ai.py": ["/player.py"]}
81,511
priscilacortez/y2-demoproject
refs/heads/master
/web_app.py
from flask import Flask, render_template, url_for, redirect, request, jsonify from flask_googlemaps import GoogleMaps from flask_googlemaps import Map, icons from queries import get_comments_in_region, get_demographics_in_region, get_demographics_who_agree app = Flask(__name__) # Google Maps Config app.config['GOOGLE...
{"/web_app.py": ["/queries.py", "/database_setup.py"]}
81,512
priscilacortez/y2-demoproject
refs/heads/master
/database_setup.py
from sqlalchemy import Column, Date, Float, ForeignKey, Integer, String, Boolean from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy import create_engine Base = declarative_base() #PLACE YOUR TABLE SETUP INFORMATION HERE class Commenter(Base):...
{"/web_app.py": ["/queries.py", "/database_setup.py"]}
81,513
priscilacortez/y2-demoproject
refs/heads/master
/queries.py
# SQLAlchemy stuff from database_setup import Base, Comment, Commenter, Vote from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker engine = create_engine('sqlite:///comments.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() def get_comments_in_region(la...
{"/web_app.py": ["/queries.py", "/database_setup.py"]}
81,514
priscilacortez/y2-demoproject
refs/heads/master
/generate_data.py
import random import sys import string import numpy as np from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from database_setup import Base, Commenter, Comment, Vote MEAN = [31.779457, 35.22052] def mixture_sample(side): if np.random.random() > .5: return side_sample(MEAN, side...
{"/web_app.py": ["/queries.py", "/database_setup.py"]}
81,519
luisfmcalado/coinoxr
refs/heads/master
/tests/test_client.py
import pytest from coinoxr.client import RequestsClient from coinoxr.response import Response class TestRequestsClient: @pytest.fixture def requests_mock(self, mocker): def requests_mock(response): return mocker.patch("requests.get", return_value=response, autospec=True,) return ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,520
luisfmcalado/coinoxr
refs/heads/master
/tests/test_requestor.py
import pytest from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.stub_client import StubHttpClient from coinoxr.error import AppIdError class TestRequestor: @pytest.fixture def http_client(self, mocker): return mocker.Mock(StubHttpClient) @pytest.fixture ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,521
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/currency.py
from coinoxr.requestor import Requestor class Currency: def __init__(self, requestor=None): self._requestor = requestor if requestor is None: self._requestor = Requestor(skip_app_id=True) def get( self, pretty_print=False, show_alternative=False, show_inactive=False, )...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,522
luisfmcalado/coinoxr
refs/heads/master
/tests/test_timeseries.py
from coinoxr import TimeSeries from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.fixtures import content class TestTimeSeries: def test_get_timeseries(self, requestor): result = TimeSeries(requestor).get("2012-07-10", "2012-07-12") assert isinstance(result, R...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,523
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/time_series.py
from coinoxr.requestor import Requestor class TimeSeries: def __init__(self, requestor=None): self._requestor = requestor if requestor is None: self._requestor = Requestor() def get( self, start, end, base=None, pretty_print=False, s...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,524
luisfmcalado/coinoxr
refs/heads/master
/tests/test_usage.py
from coinoxr import Usage from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.fixtures import content class TestUsage: def test_get_usage(self, requestor): result = Usage(requestor).get() assert isinstance(result, Response) assert result.code == 200 ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,525
luisfmcalado/coinoxr
refs/heads/master
/tests/test_ohlc.py
from coinoxr import Ohlc from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.fixtures import content class TestHistorical: def test_get_ohlc(self, requestor): result = Ohlc(requestor).get("2017-07-17T11:00:00Z", "30m") assert isinstance(result, Response) ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,526
luisfmcalado/coinoxr
refs/heads/master
/tests/stub_client.py
from os import path import json import datetime from coinoxr.response import Response from coinoxr.client import HttpClient from urllib.parse import urlparse class StubHttpClient(HttpClient): def __init__(self): self._app_ids = [] self._dates = [] def get(self, url, params): route = ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,527
luisfmcalado/coinoxr
refs/heads/master
/tests/test_historical.py
from coinoxr import Historical from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.fixtures import content class TestHistorical: def test_get_historical(self, requestor): result = Historical(requestor).get("2012-07-10") assert isinstance(result, Response) ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,528
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/requestor.py
import coinoxr from coinoxr.error import AppIdError class Requestor: def __init__(self, app_id=None, client=None, skip_app_id=False): self._client = coinoxr.default_http_client self._skip_app_id = skip_app_id if client is not None: self._client = client self._app_id = ...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,529
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/convert.py
from coinoxr.requestor import Requestor class Convert: def __init__(self, requestor=None): self._requestor = requestor if requestor is None: self._requestor = Requestor() def get(self, amount, from_currency, to_currency, pretty_print=False): path = "convert/%s/%s/%s" % (am...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,530
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/__init__.py
from coinoxr.client import RequestsClient default_http_client = RequestsClient() default_url = "https://openexchangerates.org/api/" app_id = None def base_url(path): return default_url + path from coinoxr.usage import Usage # noqa from coinoxr.latest import Latest # noqa from coinoxr.historical import Histo...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,531
luisfmcalado/coinoxr
refs/heads/master
/tests/test_currency.py
from coinoxr import Currency from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.fixtures import content class TestCurrency: def test_get_currencies(self, requestor): result = Currency(requestor).get() assert isinstance(result, Response) assert result.c...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,532
luisfmcalado/coinoxr
refs/heads/master
/tests/fixtures.py
import pytest from tests.stub_client import StubHttpClient from coinoxr.requestor import Requestor from coinoxr.response import Response def content(file): return StubHttpClient.json(file)["content"] @pytest.fixture def client(): client = StubHttpClient() client.add_app_id("fake_app_id") client.add...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,533
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/usage.py
from coinoxr.requestor import Requestor class Usage: def __init__(self, requestor=None): self._requestor = requestor if requestor is None: self._requestor = Requestor() def get(self, pretty_print=False): params = {"prettyprint": pretty_print} return self._requestor...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,534
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/client.py
import requests from coinoxr.response import Response class HttpClient: def get(self, url, params): return Response(200, None) class RequestsClient(HttpClient): def get(self, url, params): response = requests.get(url, params=params) try: return Response(response.status_co...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,535
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/error.py
class AppIdError(Exception): pass
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,536
luisfmcalado/coinoxr
refs/heads/master
/tests/test_latest.py
from coinoxr import Latest from coinoxr.requestor import Requestor from coinoxr.response import Response from tests.fixtures import content class TestLatest: def test_get_latest(self, requestor): result = Latest(requestor).get() assert isinstance(result, Response) assert result.code == 200...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,537
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/response.py
from dataclasses import dataclass @dataclass class Response: code: int body: dict or None
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...
81,538
luisfmcalado/coinoxr
refs/heads/master
/coinoxr/ohlc.py
from coinoxr.requestor import Requestor class Ohlc: def __init__(self, requestor=None): self._requestor = requestor if requestor is None: self._requestor = Requestor() def get( self, start_time, period, base=None, pretty_print=False, symbols=None, ): params = {...
{"/tests/test_client.py": ["/coinoxr/client.py", "/coinoxr/response.py"], "/tests/test_requestor.py": ["/coinoxr/requestor.py", "/coinoxr/response.py", "/tests/stub_client.py", "/coinoxr/error.py", "/coinoxr/__init__.py"], "/coinoxr/currency.py": ["/coinoxr/requestor.py"], "/tests/test_timeseries.py": ["/coinoxr/__init...