index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
77,086 | yiskylee/dmref_analyzer | refs/heads/master | /dmref_analyzer/FeatureSelection.py | from sklearn.feature_selection import RFE
from dmref_analyzer import ModelSelection
from dmref_analyzer import PlotGenerator
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import Ridge
import ... | {"/dmref_analyzer/__init__.py": ["/dmref_analyzer/DataMatrix.py"], "/dmref_analyzer/ModelSelection.py": ["/dmref_analyzer/PlotGenerator.py"]} |
77,087 | yiskylee/dmref_analyzer | refs/heads/master | /dmref_analyzer/DataMatrix.py | import pandas as pd
import os
import sys
import dmref_analyzer.util as util
import numpy as np
import math
from sklearn.preprocessing import scale
default_param_rule = pd.read_csv(
os.path.expanduser('~/Dropbox/DMREF/parameter_rules.csv'), index_col=1)
experiment_types = default_param_rule.ix['experimentType', 'opti... | {"/dmref_analyzer/__init__.py": ["/dmref_analyzer/DataMatrix.py"], "/dmref_analyzer/ModelSelection.py": ["/dmref_analyzer/PlotGenerator.py"]} |
77,088 | yiskylee/dmref_analyzer | refs/heads/master | /dmref_analyzer/RegressionModel.py | import os
import pandas as pd
import numpy as np
from pyearth import Earth
from sklearn.preprocessing import scale
from dmref_analyzer.PlotGenerator import plot_learning_curve
from sklearn.model_selection import ShuffleSplit
def gen_v(df):
voltages = df.v
times = df.time
v = voltages.max()
loopLen =... | {"/dmref_analyzer/__init__.py": ["/dmref_analyzer/DataMatrix.py"], "/dmref_analyzer/ModelSelection.py": ["/dmref_analyzer/PlotGenerator.py"]} |
77,089 | yiskylee/dmref_analyzer | refs/heads/master | /dmref_analyzer/ModelSelection.py | from sklearn.model_selection import validation_curve
import numpy as np
import dmref_analyzer.PlotGenerator as pg
def tune_param(estimator_name, estimator, param_name, param_range,
repetition, cv, data_matrix, features, outcome, sample_rng,
plot=True):
train_scores_concat = None
te... | {"/dmref_analyzer/__init__.py": ["/dmref_analyzer/DataMatrix.py"], "/dmref_analyzer/ModelSelection.py": ["/dmref_analyzer/PlotGenerator.py"]} |
77,090 | yiskylee/dmref_analyzer | refs/heads/master | /dmref_analyzer/util.py | import os
import re
import sys
import pandas as pd
from sklearn.preprocessing import scale
import numpy as np
def skewness(x):
n = len(x)
x_mean = np.mean(x)
x_centered = x - x_mean
v = np.sum(np.square(x_centered)) / (n - 1)
return np.max(x) / np.min(x), \
np.sum(np.power(x_centered, 3)... | {"/dmref_analyzer/__init__.py": ["/dmref_analyzer/DataMatrix.py"], "/dmref_analyzer/ModelSelection.py": ["/dmref_analyzer/PlotGenerator.py"]} |
77,091 | yiskylee/dmref_analyzer | refs/heads/master | /dmref_analyzer/PlotGenerator.py | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from sklearn.preprocessing import scale
from sklearn.model_selection import learning_curve
from scipy.cluster.hierarchy import linkage
from scipy.cluster.hierarchy import dendrogram
from sklearn.pipe... | {"/dmref_analyzer/__init__.py": ["/dmref_analyzer/DataMatrix.py"], "/dmref_analyzer/ModelSelection.py": ["/dmref_analyzer/PlotGenerator.py"]} |
77,096 | cpe202spring2019/lab1-fjvaldiv | refs/heads/master | /lab1.py |
def max_list_iter(int_list): # must use iteration not recursion
"""finds the max of a list of numbers and returns the value (not the index)
If int_list is empty, returns None. If list is None, raises ValueError"""
if int_list == None:
raise ValueError
elif len(int_list) == 0:
return None
el... | {"/lab1_test_cases.py": ["/lab1.py"]} |
77,097 | cpe202spring2019/lab1-fjvaldiv | refs/heads/master | /location_tests.py | import unittest
from location import Location
class TestLab1(unittest.TestCase):
def test_init(self):
loc1 = Location("SLO", 35.3, -120.7)
self.assertEqual(loc1.name, 'SLO')
self.assertEqual(loc1.lat, 35.3)
self.assertEqual(loc1.lon, -120.7) #Test Case 1
loc2 = Locatio... | {"/lab1_test_cases.py": ["/lab1.py"]} |
77,098 | cpe202spring2019/lab1-fjvaldiv | refs/heads/master | /lab1_test_cases.py | import unittest
from lab1 import *
# A few test cases. Add more!!!
class TestLab1(unittest.TestCase):
def test_max_list_iter(self):
"""testing the max_list_iter function"""
tlist = None
with self.assertRaises(ValueError): # used to check for exception
max_list_iter(tlist) #T... | {"/lab1_test_cases.py": ["/lab1.py"]} |
77,105 | djangosporti/django-colorful | refs/heads/master | /colorful/forms.py | from __future__ import unicode_literals, absolute_import
import re
from django.forms import RegexField
from .widgets import ColorFieldWidget
RGB_REGEX = re.compile('^#?((?:[0-F]{3}){1,2})$', re.IGNORECASE)
class RGBColorField(RegexField):
"""Form field for regular forms"""
widget = ColorFieldWidget
... | {"/colorful/forms.py": ["/colorful/widgets.py"]} |
77,106 | djangosporti/django-colorful | refs/heads/master | /colorful/widgets.py | from __future__ import unicode_literals
import json
from django.forms.widgets import TextInput
from django.utils.safestring import mark_safe
class ColorFieldWidget(TextInput):
class Media:
css = {
'all': ("colorful/colorPicker.css",)
}
js = ("colorful/jQuery.colorPicker.js",)... | {"/colorful/forms.py": ["/colorful/widgets.py"]} |
77,124 | Eagleheardt/lenderBot | refs/heads/master | /data/backup/unusedCommands.py | ############################
### !updateMediaType ###
############################
# if command.startswith("!updateMediaType".lower()):
# if adapter.isAdmin(aUser):
# if adapter.isDirect(channel):
# mediaInfo = command[len("!updateMediaType")+1:].strip().title()
# if mediaInfo:
# typeID, newT... | {"/libraryInsert.py": ["/lendingLibraryAdapter.py"], "/runLenderBot.py": ["/lendingLibraryAdapter.py"], "/timedEvents.py": ["/lendingLibraryAdapter.py"]} |
77,125 | Eagleheardt/lenderBot | refs/heads/master | /lendingLibraryAdapter.py | import databaseProvider as sql
import sqlite3
import datetime
DATABASE = "/home/ubuntu/lenderBot/data/lendingLibrary.db" # prod location
sql.MAIN_CONNECTION = sqlite3.connect(DATABASE) # set DB connection
#######################
### Users Table ###
#######################
# CREATE TABLE `Users` (
# ... | {"/libraryInsert.py": ["/lendingLibraryAdapter.py"], "/runLenderBot.py": ["/lendingLibraryAdapter.py"], "/timedEvents.py": ["/lendingLibraryAdapter.py"]} |
77,126 | Eagleheardt/lenderBot | refs/heads/master | /slackbot2x.py | import asyncio
import schedule
from slack import RTMClient, WebClient
__self_user_id = '' # Bot's user ID here
def send_simple_message(web_client, channel, text, thread_ts=None): ## not sure if this is in the right place...
if web_client is not None and len(text) > 0:
message_args = {
'channe... | {"/libraryInsert.py": ["/lendingLibraryAdapter.py"], "/runLenderBot.py": ["/lendingLibraryAdapter.py"], "/timedEvents.py": ["/lendingLibraryAdapter.py"]} |
77,127 | Eagleheardt/lenderBot | refs/heads/master | /libraryInsert.py | import lendingLibraryAdapter as adapter
import sys
def longGame(word):
if word.lower() == "long":
return 1
return 0
def addToDB(someFile):
fileOBJ = None
try:
fileOBJ = open(someFile,"r")
except:
print("no")
sys.exit()
i = 0
err = 0
errList = []... | {"/libraryInsert.py": ["/lendingLibraryAdapter.py"], "/runLenderBot.py": ["/lendingLibraryAdapter.py"], "/timedEvents.py": ["/lendingLibraryAdapter.py"]} |
77,128 | Eagleheardt/lenderBot | refs/heads/master | /runLenderBot.py | import decode as de
import lendingLibraryAdapter as adapter
import sqlite3
from sqlite3 import Error
import time
import datetime
import random
import os
from datetime import datetime
from slackclient import SlackClient
#####################
### TODO List ###
#####################
# update to th... | {"/libraryInsert.py": ["/lendingLibraryAdapter.py"], "/runLenderBot.py": ["/lendingLibraryAdapter.py"], "/timedEvents.py": ["/lendingLibraryAdapter.py"]} |
77,129 | Eagleheardt/lenderBot | refs/heads/master | /timedEvents.py | import schedule
import sched
import lendingLibraryAdapter as adapter
| {"/libraryInsert.py": ["/lendingLibraryAdapter.py"], "/runLenderBot.py": ["/lendingLibraryAdapter.py"], "/timedEvents.py": ["/lendingLibraryAdapter.py"]} |
77,225 | gmkarthik64/complexity-estimator | refs/heads/master | /complexity.py | from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
import cProfile
import pstats
import trace
def exp_func(x, a, b, c):
return a * np.exp(b * x) + c
def timeGraph(f,b,e,s):
xlist = range(b,e,s)
ylist = []
for i in xlist:
a = d... | {"/complexityUI.py": ["/complexity.py"]} |
77,226 | gmkarthik64/complexity-estimator | refs/heads/master | /complexityUI.py | from Tkinter import *
from tkFileDialog import askopenfilename
import complexity
import importlib
import sys
import os
class Application(Frame):
def __init__(self,master, filename):
Frame.__init__(self,master)
self.filename = filename
self.grid()
self.create_widgets()
... | {"/complexityUI.py": ["/complexity.py"]} |
77,228 | easherma/json_API | refs/heads/master | /test.py | import json
import unittest
import pandas as pd
from pprint import pprint
from app import app
class MatchDataTestCase(unittest.TestCase):
@classmethod
def setUpClass(self):
"""
fetch the list of ids and sample a random client_id
use that id to test the route, also query Socrata direct... | {"/test.py": ["/app.py"]} |
77,229 | easherma/json_API | refs/heads/master | /app.py | import pandas as pd
from flask import Flask, jsonify, json, render_template, url_for, make_response
import folium
app = Flask(__name__)
app.config.from_object(__name__)
def get_stats(client_id):
"""
Use Socrata API to query data, aggregate with pandas
"""
url = 'https://data.pa.gov/resource/vsaj-gjez.... | {"/test.py": ["/app.py"]} |
77,236 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/feedbackpart/migrations/0001_initial.py | # Generated by Django 2.1.2 on 2018-11-01 14:10
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Userlog',
fields=[
('id', models.AutoField(... | {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,237 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/registration/migrations/0002_auto_20181116_2331.py | # Generated by Django 2.1.3 on 2018-11-16 18:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='photo',
... | {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,238 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/seller/migrations/0002_remove_products_selling_seller.py | # Generated by Django 2.1.3 on 2018-11-16 12:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('seller', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='products_selling',
name='Seller',
),
... | {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,239 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/seller/admin.py | from django.contrib import admin
from .models import Products_Selling
# Register your models here.
admin.site.register(Products_Selling)
| {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,240 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/feedbackpart/views.py | from django.shortcuts import render,redirect
from . models import Userlog
# Create your views here.
def home(request):
if request.method=='POST':
name = request.POST['name']
email = request.POST['email']
comments = request.POST['comments']
Userlog.objects.create(name=name, email=ema... | {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,241 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/seller/migrations/0003_auto_20181116_1822.py | # Generated by Django 2.1.3 on 2018-11-16 12:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('seller', '0002_remove_products_selling_seller'),
]
operations = [
migrations.RemoveField(
model_name='products_selling',
nam... | {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,242 | saisreenithya2107/ASE1-Project | refs/heads/master | /collegemart/seller/models.py | from django.db import models
# Create your models here.
class Category(models.Model):
CATEGORY_CHOICES = (
('Hostel', 'Hostel'),
('Lab', 'Lab'),
('Books', 'Books'),
)
category = models.CharField(max_length=50, choices=CATEGORY_CHOICES)
def __str__(self):
return self.cat... | {"/collegemart/seller/admin.py": ["/collegemart/seller/models.py"]} |
77,247 | zaplon/shop | refs/heads/master | /amsoil/admin.py | from django.contrib import admin
from amsoil.models import *
from modeltranslation.admin import TranslationAdmin
from shop.settings import ADMIN_TEMPLATES_ROOT
from django.forms import ModelChoiceField, ModelForm
from django.contrib.admin.widgets import FilteredSelectMultiple
from django import forms
# Register your ... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,248 | zaplon/shop | refs/heads/master | /amsoil/views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response, RequestContext, HttpResponse, HttpResponseRedirect, render
from amsoil.models import Page, Product, Cart, User, CartProduct, ProductVariation, Post, \
ShippingMethod, PaymentMethod, Order, Invoice, Shipment, Category, At... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,249 | zaplon/shop | refs/heads/master | /setup.py | from distutils.core import setup
setup(
name='shop',
version='1.0',
packages=['shop', 'amsoil', 'amsoil.management', 'amsoil.management.commands', 'amsoil.migrations',
'amsoil.templatetags'],
url='',
license='',
author='jan',
author_email='janek.zapal@gmail.com',
descripti... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,250 | zaplon/shop | refs/heads/master | /amsoil/dashboard.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file was generated with the customdashboard management command and
contains the class for the main dashboard.
To activate your index dashboard add the following to your settings.py::
GRAPPELLI_INDEX_DASHBOARD = 'shop.dashboard.CustomIndexDashboard'
"""
from d... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,251 | zaplon/shop | refs/heads/master | /amsoil/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import ckeditor.fields
import markitup.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,252 | zaplon/shop | refs/heads/master | /reviews/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from shop.settings import REVIEWS_SETTINGS
# Create your models here.
class Opinion(models.Model):
class Meta:
verbose_name = 'Opinia'
verbose_name_plural = 'Opinie'
service = models.ForeignKey(REVIEWS_SETTINGS['model'],... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,253 | zaplon/shop | refs/heads/master | /amsoil/tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.test import TestCase
from models import Product, ProductVariation, Attribute, AttributeGroup
from payments import paypal_step_1, paypal_step_2
class AttributeGroupTestCase(TestCase):
def setUp(self):
ag1 = AttributeGroup(name='Lepkość')
ag... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,254 | zaplon/shop | refs/heads/master | /amsoil/templatetags/tags.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from amsoil.models import MenuItem, Category, CartProduct, Cart, Invoice, Shipment, Order, Slider, Slide, \
Attribute, AttributeGroup, ProductVariation, UserMeta, Product, Template
from amsoil.models import getProductAttributesByGroupName
fro... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,255 | zaplon/shop | refs/heads/master | /amsoil/management/commands/income.py | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from amsoil.models import Order
class Command(BaseCommand):
def handle(self,*args,**options):
for o in Order.objects.all():
o.get_income()
o.save() | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,256 | zaplon/shop | refs/heads/master | /amsoil/management/commands/sync.py | # -*- coding: utf-8 -*-
import MySQLdb, sqlsoup, json, datetime
from MySQLdb.cursors import DictCursor
from sqlalchemy import or_, and_, desc
from phpserialize import *
from xml.sax.saxutils import escape
import urllib, os
from django.core.management.base import BaseCommand, CommandError
from amsoil.models import Pro... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,257 | zaplon/shop | refs/heads/master | /authentication/urls.py | from django.conf.urls import url
from authentication import views
urlpatterns = [
url(r'^password-reset/$', views.password_reset, name='password_reset'),
url(r'^password-reset-done/$', views.password_reset_done, name='password_reset_done'),
] | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,258 | zaplon/shop | refs/heads/master | /amsoil/migrations/0002_auto_20150713_2034.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('amsoil', '0001_initial'),
]
oper... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,259 | zaplon/shop | refs/heads/master | /authentication/views.py | import json
from django.shortcuts import redirect
from django.views.generic import CreateView
from django.contrib.auth import authenticate, login, logout
from .admin import UserCreationForm
from authentication.models import User
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.views import ... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,260 | zaplon/shop | refs/heads/master | /reviews/serializers.py | from rest_framework import serializers
from .models import Mark, Opinion
class MarkSerializer(serializers.ModelSerializer):
class Meta:
model = Mark
class OpinionSerializer(serializers.ModelSerializer):
class Meta:
model = Opinion
| {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,261 | zaplon/shop | refs/heads/master | /authentication/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from django.db import models
class UserManager(BaseUserManager):
def create_user(self, email, password, **kwargs):
user = self.model(
email=self.normalize_ema... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,262 | zaplon/shop | refs/heads/master | /shop/settings.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Django settings for shop project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the proje... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,263 | zaplon/shop | refs/heads/master | /amsoil/management/commands/import.py | # -*- coding: utf-8 -*-
import MySQLdb, sqlsoup, json, datetime
from MySQLdb.cursors import DictCursor
from sqlalchemy import or_, and_, desc
from phpserialize import *
from xml.sax.saxutils import escape
import urllib, os
from django.core.management.base import BaseCommand, CommandError
from amsoil.models import Pro... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,264 | zaplon/shop | refs/heads/master | /amsoil/models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime, re, json
from django.db import models, connection
from shop.settings import MEDIA_ROOT, MEDIA_URL
from ckeditor.fields import RichTextField
from django.dispatch import receiver
from django.db.models.signals import pre_save, pre_delete, post_save
from django... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,265 | zaplon/shop | refs/heads/master | /amsoil/forms.py | # -*- coding: utf-8 -*-
from django.forms import ModelForm, Form
from amsoil.models import Order, Shipment, Invoice, User
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.shortcuts import render_to_response, RequestContext
from django.core.mail import send_mail
from crispy_for... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,266 | zaplon/shop | refs/heads/master | /reviews/urls.py | from django.conf.urls import patterns, include, url
from rest_framework.routers import DefaultRouter
from .views import MarkViewSet, OpinionViewSet
from shop.urls import router
#router.register(r'marks', MarkViewSet)
#router.register(r'opinions', OpinionViewSet)
#urlpatterns = patterns(url(r'', include(router.urls))) | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,267 | zaplon/shop | refs/heads/master | /amsoil/serializers.py | from rest_framework import serializers
from amsoil.models import *
class ProductVariationSerializer(serializers.ModelSerializer):
attributesString = serializers.CharField(source='getAttributesString',read_only=True)
name = serializers.CharField(source='product.name', read_only=True)
class Meta:
mod... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,268 | zaplon/shop | refs/heads/master | /utils.py |
def markdown(markup):
return markup.replace('\n','').replace('\r','') | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,269 | zaplon/shop | refs/heads/master | /amsoil/management/commands/makedata.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from amsoil.models import PaymentMethod, ShippingMethod, Page, Slider
class Command(BaseCommand):
def makeMethods(self):
p1 = PaymentMethod(name='Gotówka', instructions='Zapłać gotówką przy odbiorz... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,270 | zaplon/shop | refs/heads/master | /reviews/views.py | from django.shortcuts import render
from rest_framework import viewsets
from .models import Mark, Opinion
from .serializers import MarkSerializer, OpinionSerializer
from django.shortcuts import render_to_response, RequestContext
class MarkViewSet(viewsets.ModelViewSet):
queryset = Mark.objects.all()
serializer... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,271 | zaplon/shop | refs/heads/master | /shop/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from amsoil import views, mails
from shop.settings import MEDIA_URL, MEDIA_ROOT
from django.conf.urls.static import static
from authentication.views import loginView, logoutView, register
from amsoil.views import ProductVariationViewS... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,272 | zaplon/shop | refs/heads/master | /reviews/admin.py | from django.contrib import admin
from .models import Opinion
# Register your models here.
class OpinionAdmin(admin.ModelAdmin):
pass
admin.site.register(Opinion,OpinionAdmin) | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,273 | zaplon/shop | refs/heads/master | /amsoil/mails.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from django.core.mail import send_mail
from django.utils import translation
from django.shortcuts import render
from django.template.loader import get_template
from django.template import Context
from shop.settings import FROM_MAIL, CHECKOUT_THANK_YOU
from djang... | {"/amsoil/admin.py": ["/amsoil/models.py", "/shop/settings.py"], "/amsoil/views.py": ["/amsoil/models.py", "/amsoil/serializers.py", "/amsoil/forms.py", "/amsoil/templatetags/tags.py", "/shop/settings.py", "/amsoil/mails.py"], "/amsoil/dashboard.py": ["/amsoil/models.py"], "/reviews/models.py": ["/shop/settings.py"], "... |
77,281 | trollingrainhunter/crypto-discord-bot | refs/heads/master | /config.py | #bot configuration
bot_prefix = "!" # Enter your desired prefix here (e.g. !)
bot_token = "" # Enter bot token here
bot_channel_id = "" # Enter a channel id here to specify which channel the bot goes to
#wallet configuration
rpc_user = '' # Enter rpcuser here
rpc_password = '' # Enter rpc... | {"/bot.py": ["/config.py"]} |
77,282 | trollingrainhunter/crypto-discord-bot | refs/heads/master | /bot.py | import discord
import logging
from config import *
from discord.ext import commands
from bitcoinrpc.authproxy import AuthServiceProxy
from datetime import datetime
logging.basicConfig(filename='errors.log', level=logging.INFO)
# Creating the client object
client = commands.Bot(command_prefix=bot_prefix)
def getcon... | {"/bot.py": ["/config.py"]} |
77,422 | memst/MinuteMail | refs/heads/master | /MinuteMail/__init__.py | from MinuteMail.MinuteMail import mailbox | {"/MinuteMail/__init__.py": ["/MinuteMail/MinuteMail.py"]} |
77,423 | memst/MinuteMail | refs/heads/master | /MinuteMail/MinuteMail.py | # pip install websocket-client
from websocket import create_connection
import json
class mailbox(object):
def __init__(self):
super(mailbox, self).__init__()
self.ws = create_connection("wss://dropmail.me/websocket")
self.close = self.ws.close
self.email_hashes = []
self.id = json.loads(self.ws.recv()[1:])[... | {"/MinuteMail/__init__.py": ["/MinuteMail/MinuteMail.py"]} |
77,428 | IslaWoof/PikaBot | refs/heads/master | /cogs/mod.py | import discord
from discord.ext import commands
import datetime
class mod:
'''Moderation commands!'''
def __init__(self, bot):
self.bot = bot
now = datetime.datetime.utcnow()
@commands.command()
@commands.has_permissions(kick_members=True)
async def kick(self, ctx ,... | {"/bot.py": ["/ext/utility.py"]} |
77,429 | IslaWoof/PikaBot | refs/heads/master | /cogs/info.py | import discord
from discord.ext import commands
from ext.paginator import PaginatorSession
class info:
'''Info related commands!'''
def __init__(self, bot):
self.bot = bot
@commands.command()
async def paginate(self, ctx):
pages = []
embed = discord.Embed(color... | {"/bot.py": ["/ext/utility.py"]} |
77,430 | IslaWoof/PikaBot | refs/heads/master | /cogs/cr.py | import discord
from discord.ext import commands
from ext.paginator import PaginatorSession
import clashroyale
import os
class Clash_Royale:
'''Clash Royale commands to get your fancy stats here!'''
def __init__(self, bot):
self.bot = bot
@commands.command()
async def crprofile(self, c... | {"/bot.py": ["/ext/utility.py"]} |
77,431 | IslaWoof/PikaBot | refs/heads/master | /cogs/fortnite.py | import discord
from discord.ext import commands
import pynite
from ext.paginator import PaginatorSession
class Fortnite:
'''Get Fortnite stats by name'''
def __init__(self, bot):
self.bot = bot
@commands.command()
async def fnprofile(self, ctx, name=None, *, plat=None):
... | {"/bot.py": ["/ext/utility.py"]} |
77,432 | IslaWoof/PikaBot | refs/heads/master | /cogs/misc.py | import discord
from discord.ext import commands
import random
from random import randint
class misc:
'''Miscellaneous commands that are fun!'''
def __init__(self, bot):
self.bot = bot
@commands.command()
async def hug(self, ctx, user: discord.Member=None):
"""hugs a us... | {"/bot.py": ["/ext/utility.py"]} |
77,433 | IslaWoof/PikaBot | refs/heads/master | /ext/utility.py | import discord
from discord.ext import commands
import random
import json
def developer():
def wrapper(ctx):
with open('data/devlist.json') as f:
devs = json.load(f)
if ctx.author.id in devs:
return True
raise commands.MissingPermissions('Sorry, this command is only ... | {"/bot.py": ["/ext/utility.py"]} |
77,434 | IslaWoof/PikaBot | refs/heads/master | /cogs/pokedex.py | import discord
from discord.ext import commands
from pokedex import pokedex
pokedex = pokedex.Pokedex()
class Pokedex:
'''Pokemon info related commands!'''
def __init__(self, bot):
self.bot = bot
@commands.command()
async def pokemon(self, ctx, poke: str=None):
'''Get A Poke... | {"/bot.py": ["/ext/utility.py"]} |
77,435 | IslaWoof/PikaBot | refs/heads/master | /bot.py | import discord
from discord.ext import commands
import pickle
import random
import io
import os
import sys
import traceback
import datetime
import pynite
import textwrap
from contextlib import redirect_stdout
from ext.utility import developer
import asyncio
import json
bot = commands.Bot(command_prefix="$", descriptio... | {"/bot.py": ["/ext/utility.py"]} |
77,461 | SoundarBalaji/shopbridge | refs/heads/master | /ShopBridge/backend/backend/test.py | from rest_framework.test import APITestCase
from inventory.models import Inventory
class ItemsAPI_testcase(APITestCase):
def setUp(self):
Inventory.objects.create(name='book', description='long textbook', price=100)
def test_get_method(self):
url = 'http://127.0.0.1/api/inventory/'
... | {"/ShopBridge/backend/inventory/views.py": ["/ShopBridge/backend/inventory/serializers.py", "/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/serializers.py": ["/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/admin.py": ["/ShopBridge/backend/inventory/models.py"]} |
77,462 | SoundarBalaji/shopbridge | refs/heads/master | /ShopBridge/backend/inventory/views.py | from django.shortcuts import render
from rest_framework import viewsets # add this
from .serializers import InventorySerializer # add this
from .models import Inventory # add this
class InventoryView(viewsets.ModelViewSet): # add this
serializer_class = InventorySerializer # add this
queryset = I... | {"/ShopBridge/backend/inventory/views.py": ["/ShopBridge/backend/inventory/serializers.py", "/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/serializers.py": ["/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/admin.py": ["/ShopBridge/backend/inventory/models.py"]} |
77,463 | SoundarBalaji/shopbridge | refs/heads/master | /ShopBridge/backend/inventory/tests.py | from django.test import TestCase
from inventory.models import Inventory
# Create your tests here.
class InventoryTestCase(TestCase):
def setUp(self):
print('setup activity')
Inventory.objects.create(name='book',description='long textbook', price=100)
Inventory.objects.create(name='pen... | {"/ShopBridge/backend/inventory/views.py": ["/ShopBridge/backend/inventory/serializers.py", "/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/serializers.py": ["/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/admin.py": ["/ShopBridge/backend/inventory/models.py"]} |
77,464 | SoundarBalaji/shopbridge | refs/heads/master | /ShopBridge/backend/inventory/models.py | from django.db import models
# Create your models here.
class Inventory(models.Model):
name=models.CharField(max_length=100, null=False)
description=models.CharField(max_length=1000, null=True)
price=models.IntegerField(null=False)
product_image=models.ImageField(null=True)
def __str__(se... | {"/ShopBridge/backend/inventory/views.py": ["/ShopBridge/backend/inventory/serializers.py", "/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/serializers.py": ["/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/admin.py": ["/ShopBridge/backend/inventory/models.py"]} |
77,465 | SoundarBalaji/shopbridge | refs/heads/master | /ShopBridge/backend/inventory/serializers.py | from rest_framework import serializers
from .models import Inventory
class InventorySerializer(serializers.ModelSerializer):
class Meta:
model=Inventory
fields=('id','name','description','price','product_image')
| {"/ShopBridge/backend/inventory/views.py": ["/ShopBridge/backend/inventory/serializers.py", "/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/serializers.py": ["/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/admin.py": ["/ShopBridge/backend/inventory/models.py"]} |
77,466 | SoundarBalaji/shopbridge | refs/heads/master | /ShopBridge/backend/inventory/admin.py | from django.contrib import admin
from .models import Inventory
# Register your models here.
class InventoryAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'price', 'product_image')
admin.site.register(Inventory, InventoryAdmin)
| {"/ShopBridge/backend/inventory/views.py": ["/ShopBridge/backend/inventory/serializers.py", "/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/serializers.py": ["/ShopBridge/backend/inventory/models.py"], "/ShopBridge/backend/inventory/admin.py": ["/ShopBridge/backend/inventory/models.py"]} |
77,468 | RoyalStorm/gazprombank-hackathon | refs/heads/main | /src/atm_geolocation.py | from geopy.geocoders import Nominatim
def get_atm_addresses_by_coords(lat_lon_2d_array):
geolocator = Nominatim(user_agent='gazprombank-atm-geolocation-app')
return [
'\n'.join((
f'Банкомат №{index}',
f'ШИРОТА: {lat} ; ДОЛГОТА: {lon}',
'АДРЕС: ' + geolocator.revers... | {"/src/gazprombank_atm_geolocation_app.py": ["/src/atm_geolocation.py", "/src/cluster_tools.py", "/src/plot_tools.py"]} |
77,469 | RoyalStorm/gazprombank-hackathon | refs/heads/main | /src/plot_tools.py | import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
def plot_current_atm(atm_json, axes):
axes.scatter(
*np.array([
np.float64([*obj['geolocation'].values()])[::-1]
for obj in atm_json
]).T,
marker="2",
s=250,
c='red',
... | {"/src/gazprombank_atm_geolocation_app.py": ["/src/atm_geolocation.py", "/src/cluster_tools.py", "/src/plot_tools.py"]} |
77,470 | RoyalStorm/gazprombank-hackathon | refs/heads/main | /src/gazprombank_atm_geolocation_app.py | import json
import math
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from src.atm_geolocation import get_atm_addresses_by_coords
from src.cluster_tools import cluster
from src.plot_tools import plot_full_map, plot_clusters_and_atm
def print_new_atm_addresses(lat_lon_2d_array):
for addr... | {"/src/gazprombank_atm_geolocation_app.py": ["/src/atm_geolocation.py", "/src/cluster_tools.py", "/src/plot_tools.py"]} |
77,471 | RoyalStorm/gazprombank-hackathon | refs/heads/main | /src/cluster_tools.py | from hdbscan import HDBSCAN
def cluster(vertexes, min_cluster_size=15, min_samples=15):
return HDBSCAN(
metric='manhattan',
min_cluster_size=min_cluster_size,
min_samples=min_samples
).fit(vertexes)
| {"/src/gazprombank_atm_geolocation_app.py": ["/src/atm_geolocation.py", "/src/cluster_tools.py", "/src/plot_tools.py"]} |
77,477 | LEDODO99/ProyGraficas | refs/heads/master | /Textura.py | import struct
from SR1 import *
class Textura(object):
def __init__(self, path):
self.path = path
self.read()
def read(self):
image = open(self.path, "rb")
image.seek(10)
HS = struct.unpack("=l", image.read(4))[0]
image.seek(18)
self.width = struct.u... | {"/Textura.py": ["/SR1.py"], "/Modelobj.py": ["/SR1.py", "/Textura.py"]} |
77,478 | LEDODO99/ProyGraficas | refs/heads/master | /Modelobj.py | from SR1 import *
from Textura import *
from math import *
import copy
from collections import namedtuple
#width = 1920
width = 800
x = 0.1
y = 0.1
#height =1080
height = 800
V2 = namedtuple('Vertex2', ['x', 'y'])
V3 = namedtuple('Vertex3', ['x', 'y', 'z'])
zbuffer = [[-99999999999 for x in range(width+1)] for y in ra... | {"/Textura.py": ["/SR1.py"], "/Modelobj.py": ["/SR1.py", "/Textura.py"]} |
77,479 | LEDODO99/ProyGraficas | refs/heads/master | /SR1.py | """
Universidad del Valle de Guatemala
Josue David Lopez Florian
17081
Graficas por computadora
seccion 10
"""
import struct
from collections import namedtuple
#from random import randint as random
def char(c):
return struct.pack("=c",c.encode('ascii'))
def word(c):
return struct.pack("=h",c)
def dword(c):
return ... | {"/Textura.py": ["/SR1.py"], "/Modelobj.py": ["/SR1.py", "/Textura.py"]} |
77,480 | bencottier/classic-rl | refs/heads/master | /state.py | import random
class State(object):
def __init__(self, accessible, terminal):
self.accessible = accessible
self.terminal = terminal
self.reward = 0.0
def transition(self, change):
pass
class Cell(State):
def __init__(self, x, y, accessible=True, terminal=False):
s... | {"/agent.py": ["/state.py"], "/environment.py": ["/state.py"], "/run.py": ["/state.py", "/agent.py", "/environment.py", "/simulator.py"]} |
77,481 | bencottier/classic-rl | refs/heads/master | /agent.py | from state import Cell, CellGrid2D
import random
class Agent(object):
def __init__(self, policy, discount):
self.policy = policy
self.utilities =[(0.0, 0)] * len(self.policy)
self.discount = discount
self.reset()
def reset(self):
self.state = None
self.actio... | {"/agent.py": ["/state.py"], "/environment.py": ["/state.py"], "/run.py": ["/state.py", "/agent.py", "/environment.py", "/simulator.py"]} |
77,482 | bencottier/classic-rl | refs/heads/master | /environment.py | from state import Cell, CellGrid2D
class Environment(object):
def __init__(self):
pass
def available_actions(self, s):
"""
Return a list of actions that can be taken from the state s
"""
pass
class GridWorld(Environment):
R = Cell(1, 0)
U = Cell(0, 1)
L... | {"/agent.py": ["/state.py"], "/environment.py": ["/state.py"], "/run.py": ["/state.py", "/agent.py", "/environment.py", "/simulator.py"]} |
77,483 | bencottier/classic-rl | refs/heads/master | /simulator.py | import time
class Simulator(object):
def __init__(self, env, agent, do_print):
self.env = env
self.agent = agent
self.rep = None
self.indexer = 0
self.do_print = do_print
def run(self, episodes=100, pause=0.0, max_moves=100):
for i in range(episodes):
... | {"/agent.py": ["/state.py"], "/environment.py": ["/state.py"], "/run.py": ["/state.py", "/agent.py", "/environment.py", "/simulator.py"]} |
77,484 | bencottier/classic-rl | refs/heads/master | /run.py | from state import Cell, CellGrid2D
from agent import *
from environment import GridWorld
from simulator import GridWorldSimulator
import random
xsize = 4
ysize = 3
goal = Cell(3, 2)
trap = Cell(3, 1)
r_norm = -0.04
r_goal = 1.0
r_trap = -1.0
def main():
env = GridWorld(Cell(0, 0), Cell(xsize-1, ysize-1))
f... | {"/agent.py": ["/state.py"], "/environment.py": ["/state.py"], "/run.py": ["/state.py", "/agent.py", "/environment.py", "/simulator.py"]} |
77,494 | sckott/habanero | refs/heads/main | /habanero/filterhandler.py | import re
def filter_handler(x=None):
if x.__class__.__name__ == "NoneType":
return None
else:
# lowercase bools
for k, v in x.items():
if v.__class__ == bool:
x[k] = str(v).lower()
# combine
nn = x.keys()
if any([i in others for i i... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,495 | sckott/habanero | refs/heads/main | /test/test-workscontainer.py | import pytest
from habanero import Crossref, WorksContainer
cr = Crossref()
@pytest.mark.vcr
def test_workscontainer_with_one_id():
"""WorksContainer: one DOI"""
res = cr.works(ids="10.1371/journal.pone.0033693")
x = WorksContainer(res)
assert isinstance(x, WorksContainer)
assert isinstance(x.wo... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,496 | sckott/habanero | refs/heads/main | /test/test-pagination_params.py | import pytest
import yaml
from habanero import Crossref
cr = Crossref()
# see https://github.com/sckott/habanero/issues/91
@pytest.mark.vcr
def test_limit_of_zero_with_id():
"""param: limit - zero limit works"""
res = cr.members(ids=2984, works=True, facet="issn:*", limit=0)
assert 0 == len(res["messag... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,497 | sckott/habanero | refs/heads/main | /habanero/response.py | class Works(object):
"""
Habanero: response class
This is the response wrapper for any works data responses
"""
def __init__(self, result):
self.result = result
def status(self):
return self.result["status"]
def message_type(self):
return self.result["message-type... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,498 | sckott/habanero | refs/heads/main | /habanero/counts/counts.py | from typing import Any
from xml.dom import minidom
import requests
from ..habanero_utils import make_ua
def citation_count(
doi: str,
url: str = "http://www.crossref.org/openurl/",
key: str = "cboettig@ropensci.org",
**kwargs
) -> int:
"""
Get a citation count with a DOI
:param doi: DOI... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,499 | sckott/habanero | refs/heads/main | /habanero/noworks.py | class NoWorks(object):
"""
Habanero: agency class
"""
def __init__(self, result):
self.result = result
def status(self):
return self.result["status"]
def message_type(self):
return self.result["message-type"]
def message_version(self):
return self.result["... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,500 | sckott/habanero | refs/heads/main | /habanero/counts/__init__.py | # -*- coding: utf-8 -*-
# counts
"""
citation counts
~~~~~~~~~~~~~~~
Get citation count data
Usage::
from habanero import counts
cr = Crossref()
counts.citation_count(doi = "10.1371/journal.pone.0042793"
"""
from .counts import citation_count
| {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,501 | sckott/habanero | refs/heads/main | /test/test-licenses.py | import pytest
from habanero import Crossref
cr = Crossref()
@pytest.mark.vcr
def test_licenses():
"""licenses - basic test"""
res = cr.licenses(limit=2)
assert dict == res.__class__
assert 2 == len(res["message"]["items"])
@pytest.mark.vcr
def test_licenses_query():
"""licenses - param: query ... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,502 | sckott/habanero | refs/heads/main | /test/test-types.py | import pytest
from requests.exceptions import HTTPError
from habanero import Crossref
cr = Crossref()
a = {
"items": [
{"id": "book-section", "label": "Book Section"},
{"id": "monograph", "label": "Monograph"},
{"id": "report-component", "label": "Report Component"},
{"id": "repor... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,503 | sckott/habanero | refs/heads/main | /habanero/exceptions.py | class Error(Exception):
"""Base class for exceptions in this module."""
pass
class RequestError(Error):
"""
Exception raised for request errors.
This error occurrs when a request sent to the Crossref API
results in an error. We give back:
- HTTP status code
- Error message
"""
... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,504 | sckott/habanero | refs/heads/main | /test/test-cursor.py | import pytest
from requests import exceptions as ex
from habanero import Crossref
cr = Crossref()
@pytest.mark.vcr
def test_cursor():
"""cursor works - basic test"""
res = cr.works(query="widget", cursor="*", cursor_max=10)
assert dict == res.__class__
assert dict == res["message"].__class__
ass... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,505 | sckott/habanero | refs/heads/main | /habanero/cnrequest.py | import warnings
import requests
from .cn_formats import cn_format_headers
from .habanero_utils import make_ua
def CNRequest(url, ids, format=None, style=None, locale=None, **kwargs):
if not isinstance(ids, (str, list)):
raise TypeError("'ids' must be a str or list of str's")
if isinstance(ids, list)... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,506 | sckott/habanero | refs/heads/main | /test/test-filters.py | import pytest
from habanero import Crossref
cr = Crossref()
def test_filter_names():
"""filter_names"""
res_works = cr.filter_names()
res_members = cr.filter_names("members")
res_funders = cr.filter_names("funders")
assert list == res_works.__class__
assert str == res_works[0].__class__
... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,507 | sckott/habanero | refs/heads/main | /habanero/__init__.py | # -*- coding: utf-8 -*-
# habanero
"""
habanero library
~~~~~~~~~~~~~~~~~~~~~
habanero is a low level client for the Crossref search API.
Usage::
from habanero import Crossref
cr = Crossref()
# setup a different base URL
Crossref(base_url = "http://some.other.url")
# setup an api key
Crossref(a... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
77,508 | sckott/habanero | refs/heads/main | /habanero/habanero_utils.py | import json
import re
import requests
from . import __version__
from .exceptions import RequestError
from .noworks import NoWorks
from .response import Works
# helpers ----------
def converter(x):
if x.__class__.__name__ == "str":
return [x]
else:
return x
def sub_str(x, n=3):
if x.__c... | {"/test/test-workscontainer.py": ["/habanero/__init__.py"], "/test/test-pagination_params.py": ["/habanero/__init__.py"], "/habanero/counts/counts.py": ["/habanero/habanero_utils.py"], "/habanero/counts/__init__.py": ["/habanero/counts/counts.py"], "/test/test-licenses.py": ["/habanero/__init__.py"], "/test/test-types.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.