index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
18,216
MinjiKim77/human_wea
refs/heads/master
/nalsiwoori/migrations/0001_initial.py
# Generated by Django 3.0.8 on 2020-07-21 09:21 import datetime from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
{"/account/views.py": ["/account/models.py"], "/nalsiwoori/admin.py": ["/nalsiwoori/models.py"], "/nalsiwoori/views.py": ["/nalsiwoori/models.py", "/account/models.py"], "/nalsiwoori/models.py": ["/account/models.py"]}
18,217
MinjiKim77/human_wea
refs/heads/master
/nalsiwoori/models.py
from django.db import models from django.utils import timezone from account.models import User class Users(models.Model): user_name= models.CharField(max_length=64) user_email= models.EmailField(max_length=64) user_nick= models.CharField(max_length=64) user_pw = models.CharField(max_length=64) class ...
{"/account/views.py": ["/account/models.py"], "/nalsiwoori/admin.py": ["/nalsiwoori/models.py"], "/nalsiwoori/views.py": ["/nalsiwoori/models.py", "/account/models.py"], "/nalsiwoori/models.py": ["/account/models.py"]}
18,218
MinjiKim77/human_wea
refs/heads/master
/account/models.py
from django.db import models class User(models.Model): nick = models.CharField(max_length=255) name = models.CharField(max_length=255) email = models.CharField(max_length=255) user_id = models.CharField(max_length=255) user_pw = models.CharField(max_length=255)
{"/account/views.py": ["/account/models.py"], "/nalsiwoori/admin.py": ["/nalsiwoori/models.py"], "/nalsiwoori/views.py": ["/nalsiwoori/models.py", "/account/models.py"], "/nalsiwoori/models.py": ["/account/models.py"]}
18,219
MinjiKim77/human_wea
refs/heads/master
/human_wea/urls.py
from django.contrib import admin from django.urls import path,include from nalsiwoori import views from account import views urlpatterns = [ path('admin/', admin.site.urls), path('', include('account.urls')), # path('account/',include('account.urls')), # path('nalsiwoori/',include('nalsiwo...
{"/account/views.py": ["/account/models.py"], "/nalsiwoori/admin.py": ["/nalsiwoori/models.py"], "/nalsiwoori/views.py": ["/nalsiwoori/models.py", "/account/models.py"], "/nalsiwoori/models.py": ["/account/models.py"]}
18,220
bids-standard/bids-validator
refs/heads/master
/tools/prep_zenodo.py
#!/usr/bin/env python3 import git import json from subprocess import run, PIPE from pathlib import Path def decommify(name): return ' '.join(name.split(', ')[::-1]) blacklist = { 'dependabot[bot]', } git_root = Path(git.Repo('.', search_parent_directories=True).working_dir) zenodo_file = git_root / '.ze...
{"/bids-validator/bids_validator/__init__.py": ["/bids-validator/bids_validator/bids_validator.py"]}
18,221
bids-standard/bids-validator
refs/heads/master
/bids-validator/bids_validator/__init__.py
"""BIDS validator common Python package.""" from .bids_validator import BIDSValidator __all__ = ['BIDSValidator'] from . import _version __version__ = _version.get_versions()['version']
{"/bids-validator/bids_validator/__init__.py": ["/bids-validator/bids_validator/bids_validator.py"]}
18,222
bids-standard/bids-validator
refs/heads/master
/bids-validator/bids_validator/test_bids_validator.py
"""Test BIDSValidator functionality. git-annex and datalad are used to download a test data structure without the actual file contents. """ import os import pytest import datalad.api from bids_validator import BIDSValidator HOME = os.path.expanduser('~') TEST_DATA_DICT = { 'eeg_matchingpennies': ( 'ht...
{"/bids-validator/bids_validator/__init__.py": ["/bids-validator/bids_validator/bids_validator.py"]}
18,223
bids-standard/bids-validator
refs/heads/master
/bids-validator/bids_validator/bids_validator.py
"""Validation class for BIDS projects.""" import re import os import json class BIDSValidator(): """Object for BIDS (Brain Imaging Data Structure) verification. The main method of this class is `is_bids()`. You should use it for checking whether a file path is compatible with BIDS. """ def __in...
{"/bids-validator/bids_validator/__init__.py": ["/bids-validator/bids_validator/bids_validator.py"]}
18,224
renukartamboli/assignment
refs/heads/main
/assignment.py
from cryptography.fernet import Fernet class Switcher(object): users = {} weatherInformation= {"goa":{"humidity":5,"Pressure":6,"Average Temperature":30,"Wind Speed":5,"Wind Degree":9,"UI index":12},"jaipur":{"humidity":5,"Pressure":6,"Average Temperature":30,"Wind Speed":5,"Wind Degree":9,"UI index":12},"ba...
{"/unitTests.py": ["/assignment.py"]}
18,225
renukartamboli/assignment
refs/heads/main
/unitTests.py
import unittest import builtins import pytest import io import unittest.mock from unittest.mock import patch from assignment import Switcher class TestMethods(unittest.TestCase): def testhelp(self): swicther = Switcher() self.assertEqual(swicther.Operation('helpCmd'), "P...
{"/unitTests.py": ["/assignment.py"]}
18,226
JRReynosa/metricadataanalysis
refs/heads/master
/modules/helper_methods.py
import pandas as pd import numpy as np def determine_outcome(row_type, row_subtype, rowahead_type, rowahead_subtype): lostball = rowahead_type == "BALL LOST" and rowahead_subtype != np.nan and \ not ("FORCED" or "THEFT" or "CLEARANCE" or "END HALF") in str(rowahead_subtype) outcome = { ...
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,227
JRReynosa/metricadataanalysis
refs/heads/master
/modules/data_visualization.py
from soccerutils.pitch import Pitch import numpy as np import pandas as pd import modules.helper_methods as helper import matplotlib as plt tracking_path = 'C:\\Users\\reynosaj\\PycharmProjects\\metrica_data_analysis\\data\\TrackingData.csv' trackingdf = helper.get_tracking_data(tracking_path) events_path = 'C:\\User...
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,228
JRReynosa/metricadataanalysis
refs/heads/master
/modules/clustering.py
import matplotlib.pylab as plt import matplotlib.patches as mpatches from sklearn.cluster import KMeans from soccerutils.pitch import Pitch import modules.helper_methods as helper url = 'https://raw.githubusercontent.com/metrica-sports/sample-data/master/data/Sample_Game_1/' \ 'Sample_Game_1_RawEventsData.csv' ...
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,229
JRReynosa/metricadataanalysis
refs/heads/master
/modules/data_extraction_and_transformation.py
import modules.helper_methods as helper url = 'https://raw.githubusercontent.com/metrica-sports/sample-data/master/data/Sample_Game_1/' \ 'Sample_Game_1_RawEventsData.csv' eventsdf = helper.get_events_dataframe(url) shotsdf = helper.get_all_shots(eventsdf) print(shotsdf)
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,230
JRReynosa/metricadataanalysis
refs/heads/master
/modules/logistic_regression.py
import matplotlib.pyplot as plt from scipy.interpolate import make_interp_spline, BSpline import modules.helper_methods as helper from sklearn.linear_model import LogisticRegression import numpy as np url = 'https://raw.githubusercontent.com/metrica-sports/sample-data/master/data/Sample_Game_1/' \ 'Sample_Game_1...
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,231
JRReynosa/metricadataanalysis
refs/heads/master
/modules/database_population_and_querying.py
import modules.helper_methods as helper from sqlalchemy import create_engine import pandas as pd url = 'https://raw.githubusercontent.com/metrica-sports/sample-data/master/data/Sample_Game_1/' \ 'Sample_Game_1_RawEventsData.csv' eventsdf = helper.get_events_dataframe(url) engine = create_engine('sqlite://') eve...
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,232
JRReynosa/metricadataanalysis
refs/heads/master
/modules/linear_regression.py
import matplotlib.pyplot as plt import numpy as np from sklearn.linear_model import LinearRegression import modules.helper_methods as helper url = 'https://raw.githubusercontent.com/metrica-sports/sample-data/master/data/Sample_Game_1/' \ 'Sample_Game_1_RawEventsData.csv' eventsdf = helper.get_events_dataframe(...
{"/modules/data_visualization.py": ["/modules/helper_methods.py"], "/modules/clustering.py": ["/modules/helper_methods.py"], "/modules/data_extraction_and_transformation.py": ["/modules/helper_methods.py"], "/modules/logistic_regression.py": ["/modules/helper_methods.py"], "/modules/database_population_and_querying.py"...
18,233
peverett/ImageCopy
refs/heads/master
/ImageCopy.py
#!/usr/bin/python """Copy Digital Camera IMages (DCIM) from a source Memory Card or USB to a specified destination folder. Allows image preview for selective copying, file renaming based on EXIF data such as Date and Time image was made.""" __version__ = "1.0" __author__ = "simon.peverett@gmail.com" __all__ = ['__...
{"/ImageCopy.py": ["/ImageScale.py"]}
18,234
peverett/ImageCopy
refs/heads/master
/ImageScale.py
import sys if sys.version_info[0] > 2: import tkinter.font as tkFont from tkinter import * from tkinter import messagebox, filedialog else: import tkFont from Tkinter import * from PIL import Image, ImageTk def invfrange(start, stop, step): """Inverted (reverse) range inclusive of the final sto...
{"/ImageCopy.py": ["/ImageScale.py"]}
18,321
vishaljain3991/reports2sql
refs/heads/master
/done/refiner.py
#========================== #PLEASE READ THE COMMENTS #========================== #Now we refine i.e. clean our database. In this file we open names.txt which contains the names of #analysts as mentioned in the analysts_YYYY-MM-YY.txt file and alongside that only first and last names #of the analysts. This file replac...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,322
vishaljain3991/reports2sql
refs/heads/master
/a_data.py
import os import re, nltk, psycopg2 fo = open("/home/finance/reports2sql/r_fil_date.txt", "wb+") root = '/home/finance/data' #print os.walk(root, topdown=False) for path, subdirs, files in os.walk(root, topdown=False): for name in files: w=os.path.join(path, name) if((re.search(r'^.*dates$', w))):...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,323
vishaljain3991/reports2sql
refs/heads/master
/comp_name.py
import os import re, nltk, psycopg2 import dates, a_name from a_name import analysts from dates import converter conn = psycopg2.connect(database="finance", user="finance", password="iof2014", host="127.0.0.1", port="5432") fo = open("/home/finance/comp_name.txt", "wb+") root = '/home/finance/data' #print os.walk(ro...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,324
vishaljain3991/reports2sql
refs/heads/master
/done/name_fetch.py
#========================== #PLEASE READ THE COMMENTS #========================== #In this file we fetch the names of the analysts and create a names.txt. This file contains the full names of the #analyst alongwith the first and last names of the analyst import psycopg2 import re conn = psycopg2.connect(database="fina...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,325
vishaljain3991/reports2sql
refs/heads/master
/extract_name.py
import os os.chdir('/home/finance/reports2sql') import re, nltk import dates, a_name import analysts_name from analysts_name import analysts from dates import converter import psycopg2 def extractor(root): u=0 fo = open(root, 'rb+') raw=fo.read() locations=nltk.word_tokenize(raw) conn = psycopg2.connect(databas...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,326
vishaljain3991/reports2sql
refs/heads/master
/done/extract_name.py
#========================== #PLEASE READ THE COMMENTS #========================== #This file serves as an auxilliary file for the executor.py file. In this file we have #defined a single function extractor that takes the location of the dates file of a company #id as input and extracts the relevant features from the a...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,327
vishaljain3991/reports2sql
refs/heads/master
/executor.py
#========================== #PLEASE READ THE COMMENTS #========================== #Upon execution of this python file you form a database named ratings1 #in which there are information stored about each report i.e. names of #analysts, their positions, their departments etc. #We import extractor function from extract_n...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,328
vishaljain3991/reports2sql
refs/heads/master
/analysts_name.py
import os import re, nltk def analysts(string): bo=open("/home/finance/reports2sql/types.txt","ab+") #print 'yes' foo=open(string) raw=foo.read() sents=raw.split('\n' ); words=nltk.word_tokenize(raw); #for splitting multiple lines foo.close() #foo=open(string1) #print words #raw=foo.read() #print raw #token...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,329
vishaljain3991/reports2sql
refs/heads/master
/a_data1.py
import os import re, nltk, psycopg2 import dates, a_name import extract_name from extract_name import extractor from a_name import analysts from dates import converter d=0 fo = open("/home/finance/reports2sql/r_fil_date.txt", "rb+") raw=fo.read() locs=nltk.word_tokenize(raw) #print locs """string='a' for t in locs: ...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,330
vishaljain3991/reports2sql
refs/heads/master
/f_error.py
import os import re, nltk import dates, a_name import extract_name from extract_name import extractor from a_name import analysts from dates import converter fo = open("/home/finance/r_fil_loc.txt", "rb+") raw=fo.read() locs=nltk.word_tokenize(raw) #print locs string='a' for t in locs: tokens=t.split('/') string=str...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,331
vishaljain3991/reports2sql
refs/heads/master
/done/analysts_name.py
#========================== #PLEASE READ THE COMMENTS #========================== #This is one of the most important file of the lot. In the file analysts function #is defined. With this function we extract analyst names, their designation, #departments and positions. import os import re, nltk def analysts(string):...
{"/executor.py": ["/extract_name.py"], "/a_data1.py": ["/extract_name.py"]}
18,350
HungrySpace/CallCenter
refs/heads/master
/call/api/views.py
from rest_framework import generics, permissions, status from rest_framework.response import Response from . import serializers from rest_framework import mixins from django.core.serializers import serialize from .models import Events, Clients, ClientPhones, EmployeesPhones from django.forms.models import model_to_dict...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,351
HungrySpace/CallCenter
refs/heads/master
/call/api/migrations/0005_events_sc.py
# Generated by Django 3.2.4 on 2021-07-13 10:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0004_auto_20210712_1058'), ] operations = [ migrations.AddField( model_name='events', name='sc', ...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,352
HungrySpace/CallCenter
refs/heads/master
/call/api/migrations/0006_remove_events_sc.py
# Generated by Django 3.2.4 on 2021-07-13 10:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0005_events_sc'), ] operations = [ migrations.RemoveField( model_name='events', name='sc', ), ]
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,353
HungrySpace/CallCenter
refs/heads/master
/call/api/migrations/0003_auto_20210712_1005.py
# Generated by Django 3.2.4 on 2021-07-12 07:05 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0002_alter_events_id_employee'), ] operations = [ migrations.AlterField( model_name='eve...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,354
HungrySpace/CallCenter
refs/heads/master
/call/appCallCentr/forms.py
from django import forms from django.utils.translation import ugettext as _ class AddContactForm(forms.Form): first_name = forms.CharField(label=_(u'first_name')) last_name = forms.CharField(label=_(u'last_name')) email = forms.EmailField(label=_(u'email')) number_0 = forms.CharField(label=_(u'number'...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,355
HungrySpace/CallCenter
refs/heads/master
/call/api/migrations/0007_auto_20210713_1731.py
# Generated by Django 3.2.4 on 2021-07-13 14:31 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('api', '0006_remove_events_sc'), ] operations = [ migrations.AlterField( model_name='clientphone...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,356
HungrySpace/CallCenter
refs/heads/master
/call/api/models.py
from django.db import models class GroupName(models.Model): name = models.CharField(max_length=50) class Position(models.Model): name = models.CharField(max_length=100) class Employee(models.Model): first_name = models.CharField(max_length=100, default='empty') last_name = models.CharField(max_len...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,357
HungrySpace/CallCenter
refs/heads/master
/call/appCallCentr/apps.py
from django.apps import AppConfig class AppcallcentrConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'appCallCentr'
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,358
HungrySpace/CallCenter
refs/heads/master
/call/appCallCentr/admin.py
from django.contrib import admin # class StatesAdmin(admin.ModelAdmin): # list_display = ("id", "state") # search_fields = ("id", "state") # list_filter = ("id", "state") # # # admin.site.register(States, StatesAdmin)
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,359
HungrySpace/CallCenter
refs/heads/master
/call/api/serializers.py
from rest_framework import serializers from .models import Events, ClientPhones, Clients, EmployeesPhones, Employee, Status, Position, GroupName, Group from rest_framework.response import Response # для сбора номеров из базы у определенной карточки def get_phones(instance): try: phones = [i["phone_number"...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,360
HungrySpace/CallCenter
refs/heads/master
/call/api/migrations/0001_initial.py
# Generated by Django 3.2.4 on 2021-07-09 09:37 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Clients', fields=[ ...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,361
HungrySpace/CallCenter
refs/heads/master
/call/api/urls.py
from rest_framework import routers # from .api import EventsViewSet, ClientNumberViewSet from . import views from django.urls import path # router = routers.DefaultRouter() # router.register('event', EventsViewSet, 'event') # router.register('ClientNumber', ArticleView, 'ClientNumber') urlpatterns = [ path('event...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,362
HungrySpace/CallCenter
refs/heads/master
/call/api/migrations/0004_auto_20210712_1058.py
# Generated by Django 3.2.4 on 2021-07-12 07:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0003_auto_20210712_1005'), ] operations = [ migrations.AlterField( model_name='clients', name='description', ...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,363
HungrySpace/CallCenter
refs/heads/master
/call/appCallCentr/urls.py
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'), path('contact_book', views.contact_book, name='contact_book'), path('contacts_book', views.contacts_book, name='contacts_book'), path('editing_contact/<pk>', views.editing_contact, name='load_layout'),...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,364
HungrySpace/CallCenter
refs/heads/master
/call/appCallCentr/views.py
from django.shortcuts import render from .forms import AddContactForm # from .models import Client, ClientNumber # from api.models import Events, States from django.http import HttpResponseRedirect def index(request): # data = Events.objects.all().values() # # for levent in data: # levent["state"]...
{"/call/api/views.py": ["/call/api/models.py"], "/call/api/serializers.py": ["/call/api/models.py"], "/call/appCallCentr/views.py": ["/call/appCallCentr/forms.py"]}
18,401
felipefrm/lexical-analyzer
refs/heads/master
/token_csmall.py
tokens = { "main": "MAIN", "int": "INT", "float": "FLOAT", "if": "IF", "else": "ELSE", "while": "WHILE", "for": "FOR", "read": "READ", "print": "PRINT", "(": "LBRACKET", ")": "RBRACKET", "{": "LBRACE", "}": "RBRACE", ",": "COMMA", ";": "PCOM...
{"/analyzer.py": ["/token_csmall.py"]}
18,402
felipefrm/lexical-analyzer
refs/heads/master
/analyzer.py
from token_csmall import tokens from tabulate import tabulate import argparse import re # Argumentos da linha de comandos: -i [arquivo de entrada .c] -o [arquivo de saida contendo os tokens] parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", help="insert the path and name of a .c file (DEFAULT: 'i...
{"/analyzer.py": ["/token_csmall.py"]}
18,403
alex-px/most-common
refs/heads/master
/helpers.py
from nltk import pos_tag def flat(_list): """ [(1,2), (3,4)] -> [1, 2, 3, 4]""" return sum([list(item) for item in _list], []) def is_verb(word): if not word: return False pos_info = pos_tag([word]) return pos_info[0][1] == 'VB' def split_snake_case_to_words(name): return [word for...
{"/most_common.py": ["/helpers.py"]}
18,404
alex-px/most-common
refs/heads/master
/most_common.py
from argparse import ArgumentParser import ast import collections import os from helpers import (is_verb, flat, split_snake_case_to_words, is_magic_name) def find_py_files_in_path(root): py_files = [] for current_dir, sub_dirs, files in os.walk(r...
{"/most_common.py": ["/helpers.py"]}
18,413
PTNobel/musicctl
refs/heads/master
/process.py
#!/usr/bin/python3 from os import listdir as _listdir from os.path import join as _join from typing import List, Dict __all__ = [ "is_comm_running", "get_comms_to_pids", "get_pids_to_comms", "get_pids_to_cmdlines", "get_pids_of_comm", "get_comm_of_pid", "get_pids", "get_comms", "g...
{"/player.py": ["/process.py"], "/musicctl.py": ["/player.py"]}
18,414
PTNobel/musicctl
refs/heads/master
/player.py
#!/usr/bin/python3 # A python3 port of musicctl.sh. import time import os import sys import re import subprocess import process # warning() functions like print, except it prefixes everything and prints to # stderr. def warning(*objs, prefix='WARNING: '): printed_list = str(prefix) for i in objs: pr...
{"/player.py": ["/process.py"], "/musicctl.py": ["/player.py"]}
18,415
PTNobel/musicctl
refs/heads/master
/musicctl.py
#!/usr/bin/python3 # A python3 port of musicctl.sh. import os import sys import player # warning() functions like print, except it prefixes everything and prints to # stderr. def warning(*objs, prefix='WARNING: '): printed_list = str(prefix) for i in objs: printed_list += str(i) print(printed_li...
{"/player.py": ["/process.py"], "/musicctl.py": ["/player.py"]}
18,420
vinaybana/djangoapp
refs/heads/master
/blog/serializers.py
from .models import Post,Category,Tag,Comment from rest_framework import serializers import json class PostSerializer(serializers.ModelSerializer): comments = serializers.SerializerMethodField() def get_comments(self,obj): comments = Comment.objects.filter(post = obj.id).all() data = [] for cmnt in comments: ...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,421
vinaybana/djangoapp
refs/heads/master
/blog/urls.py
from django.contrib import admin from django.urls import path from .import views app_name = 'blog' # urlpatterns = [ # path('post/<int:pk>/edit/', views.post_edit, name='post_edit'), # path('post/new/', views.post_new, name='post_new'), # path('blog/sign_up/',views.sign_up,name="sign-up"), # path('blog/logout/'...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,422
vinaybana/djangoapp
refs/heads/master
/blog/views.py
from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from .models import Post, Userprofile, Comment,Category,Tag from .forms import PostForm,ProfileForm, categoryForm,CommentForm from django.contrib.auth.models import User, auth from django.contrib.auth.forms import UserCre...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,423
vinaybana/djangoapp
refs/heads/master
/polls/serializers.py
from .models import Question,Choice from rest_framework import serializers class QuestionSerializer(serializers.ModelSerializer): choices = serializers.SerializerMethodField() def get_choices(self, obj): choices = Choice.objects.filter(question = obj.id).all() data = [] for opt in choices: data.append( ...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,424
vinaybana/djangoapp
refs/heads/master
/polls/api.py
from rest_framework import serializers, viewsets, status as status_code, generics, mixins from .serializers import * from .models import * from rest_framework.views import APIView from rest_framework import status from rest_framework.permissions import IsAuthenticated, AllowAny from django.contrib.auth import authentic...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,425
vinaybana/djangoapp
refs/heads/master
/polls/apiurls.py
from rest_framework import renderers from django.urls import path, include from rest_framework.routers import DefaultRouter from .import api, views router = DefaultRouter() router.register('question', api.QuestionViewSet), router.register('choice', api.ChoiceViewSet), urlpatterns = [ path('', include(router.urls)), ...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,426
vinaybana/djangoapp
refs/heads/master
/blog/apiurls.py
from rest_framework import renderers from django.urls import path, include from rest_framework.routers import DefaultRouter from .import api, views router = DefaultRouter() router.register('post', api.PostViewSet) router.register('category', api.CategoryViewSet) router.register('tag', api.TagViewSet) router.register(...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,427
vinaybana/djangoapp
refs/heads/master
/blog/admin.py
from django.contrib import admin from .models import Post,Userprofile, Category, Tag, Comment # class postAdmin(admin.ModelAdmin): # view_on_site = True # fieldsets = [ # (None, {'fields': ['title', 'text', 'author']}), # ('Date information', {'fields': ['published_date'], 'classes': ['collapse']}), # ] # ...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,428
vinaybana/djangoapp
refs/heads/master
/blog/api.py
from rest_framework import serializers, viewsets, status as status_code, generics, mixins from .serializers import * from .models import * from rest_framework.views import APIView from rest_framework import status from rest_framework.permissions import IsAuthenticated, AllowAny from django.contrib.auth import authentic...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,429
vinaybana/djangoapp
refs/heads/master
/blog/models.py
from django.conf import settings from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django_extensions.db.fields import AutoSlugField from autoslug import AutoSlugField class Category(models.Model): title= models.CharField(max_length=200) text=models.TextFi...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,430
vinaybana/djangoapp
refs/heads/master
/blog/forms.py
from django import forms from .models import Post, Userprofile, Category, Comment from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.forms import ModelForm class PostForm(forms.ModelForm): class Meta: model = Post fields = ('title', 'text...
{"/blog/serializers.py": ["/blog/models.py"], "/blog/views.py": ["/blog/models.py", "/blog/forms.py", "/blog/serializers.py"], "/polls/api.py": ["/polls/serializers.py"], "/blog/admin.py": ["/blog/models.py"], "/blog/api.py": ["/blog/serializers.py", "/blog/models.py"], "/blog/forms.py": ["/blog/models.py"]}
18,450
kul2002il/rkisQuestions
refs/heads/master
/main/urls.py
from django.urls import path from . import views from .views import BBLoginView, BBLogoutView, BBPasswordChangeView, RegisterDoneView, RegisterUserView app_name = 'main' urlpatterns = [ path('', views.index), path('accounts/login/', BBLoginView.as_view(), name="login"), path('accounts/register/', RegisterUserView....
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,451
kul2002il/rkisQuestions
refs/heads/master
/main/migrations/0006_auto_20201102_1214.py
# Generated by Django 3.1.2 on 2020-11-02 12:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0005_auto_20201102_1213'), ] operations = [ migrations.AlterField( model_name='question', name='datetime', ...
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,452
kul2002il/rkisQuestions
refs/heads/master
/main/migrations/0003_auto_20201102_1211.py
# Generated by Django 3.1.2 on 2020-11-02 12:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0002_auto_20201102_1210'), ] operations = [ migrations.AddField( model_name='question', name='datatime2', ...
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,453
kul2002il/rkisQuestions
refs/heads/master
/main/migrations/0005_auto_20201102_1213.py
# Generated by Django 3.1.2 on 2020-11-02 12:13 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('main', '0004_auto_20201102_1212'), ] operations = [ migrations.RenameField( model_name='question', old_name='datatime', ...
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,454
kul2002il/rkisQuestions
refs/heads/master
/main/models.py
from django.db import models from django.contrib.auth.models import AbstractUser class User(AbstractUser): def Meta(self): pass class Question(models.Model): title = models.CharField(max_length=255, verbose_name="Название", default='') datetime = models.DateTimeField(auto_now_add=True, null=True, verbose_name=...
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,455
kul2002il/rkisQuestions
refs/heads/master
/main/views.py
from django.shortcuts import render from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.views.generic import UpdateView, CreateView from django.views.generic.base import TemplateView from django.contrib.auth.views import LoginView, LogoutVi...
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,456
kul2002il/rkisQuestions
refs/heads/master
/main/migrations/0004_auto_20201102_1212.py
# Generated by Django 3.1.2 on 2020-11-02 12:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0003_auto_20201102_1211'), ] operations = [ migrations.RemoveField( model_name='question', name='datatime2',...
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,457
kul2002il/rkisQuestions
refs/heads/master
/main/admin.py
from django.contrib import admin from .models import User, Question, Voice, Answer admin.site.register(User) admin.site.register(Question) admin.site.register(Voice) admin.site.register(Answer)
{"/main/urls.py": ["/main/views.py"], "/main/views.py": ["/main/models.py"], "/main/admin.py": ["/main/models.py"]}
18,459
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/display.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Display data module @alexandru_grigoras """ # Libraries import operator import mplcursors import numpy as np import scipy import seaborn as sns from PyQt5.QtWidgets import QSizePolicy from matplotlib import ticker from matplotlib.backends.backend_qt5agg import Figu...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,460
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/analysis.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Data analysis module @alexandru_grigoras """ # Libraries from __future__ import print_function import time from nltk.probability import * from youtube_sentiment_analysis.modules.process import ProcessData from youtube_sentiment_analysis.modules.sentiment_module ...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,461
alexgrigoras/youtube_consumer_perception
refs/heads/master
/setup.py
from pip._internal.download import PipSession from pip._internal.req import parse_requirements from setuptools import setup, find_packages from youtube_sentiment_analysis import __version__ as version requirements = [ str(req.req) for req in parse_requirements('requirements.txt', session=PipSession()) ] setup( ...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,462
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/crawler.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Web crawler module @alexandru_grigoras """ # Libraries import json import multiprocessing import queue import time import urllib.request from urllib import robotparser import lxml.html import requests from bs4 import BeautifulSoup from lxml.cssselect import CSSSel...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,463
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/store.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Store data module @alexandru_grigoras """ # Libraries import pymongo # Constants __all__ = ['StoreData'] __version__ = '1.0' __author__ = 'Alexandru Grigoras' __email__ = 'alex_grigoras_10@yahoo.com' __status__ = 'release' DATABASE_NAME = "sentiment_analysis" c...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,464
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/__main__.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Youtube Sentiment Analysis - Main module @alexandru_grigoras """ # Libraries import sys from PyQt5.QtWidgets import QApplication from youtube_sentiment_analysis.modules.interface import SentimentAnalysisApplication # Constants __all__ = [] __version__ = '1.0' __...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,465
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/vote_classifier.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Voting system for classifiers @alexandru_grigoras """ # Libraries from statistics import mean from statistics import mode from nltk.sentiment import SentimentIntensityAnalyzer from youtube_sentiment_analysis.modules.sentiment_module import sentiment as anew # Cons...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,466
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/process.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Process data module @alexandru_grigoras """ # Libraries import re from nltk.corpus import stopwords # Constants __all__ = ['ProcessData'] __version__ = '1.0' __author__ = 'Alexandru Grigoras' __email__ = 'alex_grigoras_10@yahoo.com' __status__ = 'release' class ...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,467
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/interface.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ User interface @alexandru_grigoras """ # Libraries import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import QStandardItemModel, QStandardItem from PyQt5.QtWidgets import QMainWindow, QMessageBox, QAbstractItem...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,468
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/training.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Classifiers training @alexandru_grigoras """ # Libraries import glob import os import pickle import time import nltk from nltk.classify.scikitlearn import SklearnClassifier from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import Multino...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,469
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/sentiment_module/sentiment.py
#!/usr/bin/python #- SENTIMENT.PY ------------------------------------------------------------# # Routines to calulate average valence and arousal for one or more terms # # using the ANEW and Happiness sentiment dictionaries # # # #- Modification History: --------------------------------------...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,470
alexgrigoras/youtube_consumer_perception
refs/heads/master
/youtube_sentiment_analysis/modules/accuracy.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Classifiers accuracy @alexandru_grigoras """ # Libraries import time import numpy as np from nltk.sentiment import SentimentIntensityAnalyzer from sklearn import model_selection from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model ...
{"/youtube_sentiment_analysis/modules/analysis.py": ["/youtube_sentiment_analysis/modules/process.py", "/youtube_sentiment_analysis/modules/store.py", "/youtube_sentiment_analysis/modules/training.py", "/youtube_sentiment_analysis/modules/vote_classifier.py"], "/youtube_sentiment_analysis/modules/crawler.py": ["/youtub...
18,477
danghualong/stock
refs/heads/master
/src/cron/service/add_history_service.py
from ...constant import urls from ...db import dboper from ..parsers import historyParser from ...logger import currentLogger import datetime import requests def addHistoryDaily(days=300): stocks = dboper.getStocks() if (stocks is None or len(stocks)<=0): currentLogger.warn("no stock fetche...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,478
danghualong/stock
refs/heads/master
/src/stat/__init__.py
from flask import Blueprint stat_bp = Blueprint("stat", __name__, url_prefix="/stat") from .controller import break_point from .controller import stock_filter from .controller import stocks
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,479
danghualong/stock
refs/heads/master
/src/stat/view/trends.py
from ...db import dboper from . import table from ..service import trait_service as TraitService def showCurrentTrends(): stocks = dboper.getStocks() if (stocks is None or len(stocks)<=0): print("no stock fetched") return for stock in stocks: traits=TraitService.getTraits...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,480
danghualong/stock
refs/heads/master
/src/model/model.py
import time class Synchronizable(object): update_at = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) class Stock(Synchronizable): code = '' name = '' prefix = 'sh' class Daily(Synchronizable): code = "" date = "" open = "" last_close = "" current = "" high =...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,481
danghualong/stock
refs/heads/master
/app.py
from src import createApp import os from src.tools.response_factory import create_response app = createApp() @app.route("/") def index(): mode=os.getenv("FLASK_ENV", "---") items=[dict(path=i.rule,methods=list(i.methods),endpoint=i.endpoint) for i in app.url_map._rules] return create_response(...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,482
danghualong/stock
refs/heads/master
/src/model/__init__.py
from .model import Stock, Daily, Trait from .errors import *
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,483
danghualong/stock
refs/heads/master
/src/errorhandlers.py
from .model import APIException, ServerError from werkzeug.exceptions import HTTPException from .logger import currentLogger from flask import request def init_app(app): @app.errorhandler(Exception) def framework_error(e): currentLogger.error("url is {0},error info:{1}".format(request.path,e) if isinst...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,484
danghualong/stock
refs/heads/master
/src/tools/response_factory.py
from flask import make_response from .serializer import DHLEncoder import json def create_response(payload): result = dict(data=payload,error_code=0) content = json.dumps(result, cls=DHLEncoder, ensure_ascii=False, indent=4) resp = make_response(content) resp.mimetype = "application/json" return re...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,485
danghualong/stock
refs/heads/master
/src/stat/controller/stocks.py
from .. import stat_bp from ...db import dboper from ...tools.response_factory import create_response @stat_bp.route("/", methods=['GET']) def getStocks(): ''' 获取所有的股票代码信息 ''' stocks = dboper.getStocks() return create_response(stocks) @stat_bp.route("/<key>", methods=['GET']) def getStocksByKey(ke...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,486
danghualong/stock
refs/heads/master
/src/stat/service/atr_service.py
def calcATR(traits, N=20): ''' 计算N日平均波动幅度 traits:汇总特征数据集合 N:均值的天数 ''' result=[] total = 0.0 slowIndex = 0 fastIndex = 0 for fastIndex in range(len(traits)): trait=traits[fastIndex] if (fastIndex < N): total += trait.getTrueRange() ...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,487
danghualong/stock
refs/heads/master
/src/__init__.py
from flask import Flask import os from .settings import configs from . import cron, logger, db, routers,errorhandlers def createApp(configName=None): app = Flask(__name__) if configName == None: configName = os.getenv("FLASK_ENV", "production") app.config.from_object(configs[configName])...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,488
danghualong/stock
refs/heads/master
/src/stat/view/single_ma_view.py
from ..service import trait_service as TraitService from . import table def ShowSingleMA(stock): traits = TraitService.getTraits(stock.code) table.showMA(traits, stock, True)
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,489
danghualong/stock
refs/heads/master
/src/stat/view/single_atr_view.py
from ..service import trait_service as TraitService from . import table def ShowSingleATR(stock): traits = TraitService.getTraits(stock.code) table.showATR(traits, stock, True)
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,490
danghualong/stock
refs/heads/master
/src/db/dboper.py
import sqlite3 import os from ..model import Daily, Stock from ..settings import configs from ..logger import currentLogger DB_NAME = configs[os.getenv("FLASK_ENV", "production")].SQLALCHEMY_DATABASE_URI def insertStock(stock): try: conn = sqlite3.connect(DB_NAME) # print("insertStock...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,491
danghualong/stock
refs/heads/master
/src/constant/urls.py
DAILY_PRICE_URL = 'http://hq.sinajs.cn/list={0}' # sz表示深市,sh表示上市 HISTORY_PRICE_URL = 'https://q.stock.sohu.com/hisHq?code=cn_{0}&start={1}&end={2}&stat=0&order=A&period=d&callback=historySearchHandler&rt=jsonp' # appkey从个人管理后台获取:https://www.jisuapi.com/api/stock/ JISU_STOCK_URL='https://api.jisuapi.com/stock/list?c...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,492
danghualong/stock
refs/heads/master
/src/stat/view/table.py
import matplotlib.pyplot as plt plt.rcParams['font.family'] = ['sans-serif'] plt.rcParams['font.sans-serif'] = ['SimHei'] def showMAAndATR(traits, stock): plt.subplot(2, 1, 1) showMA(traits, stock) plt.subplot(2, 1, 2) showATR(traits, stock) plt.show() def showATR(traits, stock, autoSho...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...
18,493
danghualong/stock
refs/heads/master
/src/stat/service/trait_service.py
from ...db import dboper from ..util import trait_builder as TraitBuilder from . import atr_service as ATRService from . import ma_service as MAService import math def getTraits(code, days=50, N=120): ''' 计算股票的汇总特征 code:股票代码 days:观察数据数量 N:均值的天数 ''' dailys = dboper.getDailys(c...
{"/src/cron/service/add_history_service.py": ["/src/db/__init__.py", "/src/logger.py"], "/src/stat/view/trends.py": ["/src/db/__init__.py"], "/app.py": ["/src/__init__.py", "/src/tools/response_factory.py"], "/src/model/__init__.py": ["/src/model/model.py", "/src/model/errors.py"], "/src/errorhandlers.py": ["/src/model...