index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
47,236
emojipeach/djangur
refs/heads/master
/users/models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from django.contrib.auth.models import AbstractUser from django.core import validators from django.db import models from django.utils.translation import ugettext_lazy as _ class CustomUser(AbstractUser): username = models.CharField(_('use...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,237
emojipeach/djangur
refs/heads/master
/pmessaging/urls.py
# -*- coding: utf-8 -*- """ Contains all url patterns for imageapp app.""" from __future__ import unicode_literals from django.urls import path from . import views app_name = 'imageapp' urlpatterns = [ # Home page path( '', views.index, name='index' ), # Upload page path( ...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,238
emojipeach/djangur
refs/heads/master
/imageapp/models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import os import requests from datetime import datetime from datetime import timedelta from hashlib import sha256 from io import BytesIO from PIL import ExifTags from PIL import Image from time import localtime from time import strftime fr...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,239
emojipeach/djangur
refs/heads/master
/imageapp/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import codecs import logging import os from time import time from uuid import uuid4 from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.contrib.auth.dec...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,240
emojipeach/djangur
refs/heads/master
/pmessaging/settings.py
# Detetmines the frequency at which old messages are checked and deleted. MESSAGE_REMOVAL_FREQUENCY = 3600 # Determines the numbet of days back old messages are kept in the db. After this time messages are deleted. OLD_MESSAGES_DELETED_IN = -30
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,241
emojipeach/djangur
refs/heads/master
/users/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib import admin from django.contrib.auth.admin import UserAdmin User = get_user_model() class CustomUserAdmin(UserAdmin): model = User list_display = ['username'] fieldsets = ...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,242
emojipeach/djangur
refs/heads/master
/imageapp/startup.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import os import threading from time import time from django.db.models import F from imageapp.models import ImageUpload from imageapp.settings import EXPIRY_REMOVAL_FREQUENCY logging.basicConfig(level=logging.DEBUG, format=' %(asctime)...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,243
emojipeach/djangur
refs/heads/master
/imageapp/forms.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from .models import ImageUpload class ImageUploadForm(forms.ModelForm): """ Main image upload form - supports direct file and url upload.""" def __init__(self, *args, **kwargs): super(ImageUploadForm, self).__ini...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,244
emojipeach/djangur
refs/heads/master
/imageapp/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from imageapp.models import ImageUpload admin.site.register(ImageUpload)
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,245
emojipeach/djangur
refs/heads/master
/users/forms.py
from django import forms from django.contrib.auth import get_user_model from django.contrib.auth.forms import UserCreationForm from django.utils.translation import ugettext_lazy as _ User = get_user_model() class CustomUserCreationForm(UserCreationForm): def clean_username(self): """ Ensures a unique u...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,246
emojipeach/djangur
refs/heads/master
/pmessaging/cleanup.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import logging import threading from pmessaging.models import Message from pmessaging.settings import MESSAGE_REMOVAL_FREQUENCY from pmessaging.settings import OLD_MESSAGES_DELETED_IN logging.basicConfig(level=logging.DEBUG, format=' %(a...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,247
emojipeach/djangur
refs/heads/master
/users/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import messages from django.contrib.auth import authenticate from django.contrib.auth import get_user_model from django.contrib.auth import login from django.contrib.auth import update_session_auth_hash from django.contrib.auth.decorat...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,248
emojipeach/djangur
refs/heads/master
/users/urls.py
from django.urls import path from django.contrib.auth.views import LoginView from django.contrib.auth.views import LogoutView from . import views app_name = 'users' urlpatterns = [ # user signup path( 'signup/', views.signup, name='signup' ), # user login path( ...
{"/imageapp/views.py": ["/imageapp/forms.py", "/imageapp/models.py"], "/imageapp/startup.py": ["/imageapp/models.py"], "/imageapp/forms.py": ["/imageapp/models.py"], "/imageapp/admin.py": ["/imageapp/models.py"], "/pmessaging/cleanup.py": ["/pmessaging/settings.py"], "/users/views.py": ["/users/forms.py"]}
47,249
Lyxf3/Books_Shop
refs/heads/main
/user/views.py
from django.shortcuts import render from rest_framework import viewsets from rest_framework import permissions # from rest_framework.decorators import action, list_route # from rest_framework.response import Response from user.serializers import UserSerializer from user.models import User class UserViewSet(viewsets.V...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,250
Lyxf3/Books_Shop
refs/heads/main
/book/migrations/0002_initial.py
# Generated by Django 3.2.7 on 2021-10-06 10:21 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('book', '0001_initial'), migrations.swappable_dependency(setting...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,251
Lyxf3/Books_Shop
refs/heads/main
/user/models.py
from django.db import models from django.contrib.auth.models import AbstractBaseUser from user.manager import CustomAccountManager from django.utils import timezone from django.contrib.auth.models import PermissionsMixin class User(AbstractBaseUser, PermissionsMixin): name = models.CharField(max_length=100, blank...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,252
Lyxf3/Books_Shop
refs/heads/main
/book/models.py
from django.db import models from django.utils import timezone import uuid class Category(models.Model): title = models.CharField(max_length=100, blank=False, null=True, verbose_name="Title") def __str__(self): ret...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,253
Lyxf3/Books_Shop
refs/heads/main
/user/urls.py
from django.urls import path from rest_framework.routers import DefaultRouter from django.conf.urls import include from user import views as user_views router = DefaultRouter() router.register(r'user', user_views.UserViewSet, basename='user') urlpatterns = [ path('', include(router.urls)), ]
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,254
Lyxf3/Books_Shop
refs/heads/main
/user/serializers.py
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer from rest_framework_simplejwt.views import TokenObtainPairView from user.models import User from rest_framework import serializers class MyTokenObtainPairSerializer(TokenObtainPairSerializer): @classmethod def get_token(cls, us...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,255
Lyxf3/Books_Shop
refs/heads/main
/book/admin.py
from django.contrib import admin from django.db.models import OuterRef from django.utils.html import mark_safe from book.models import ( Book, Category, Contract, Author, Publisher, DiscountShop, Market, PBook, EBook, ABook, Types, BBook, PromoCode ) from django.utils.html import format_html @admin.register(Bo...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,256
Lyxf3/Books_Shop
refs/heads/main
/purchase/models.py
from django.db import models from django.utils import timezone from user.models import User from book.models import Book from django.utils import timezone class Statuses(models.IntegerChoices): PROCESSED = 1 CANCELED = 2 ACCEPTED = 3 class Purchase(models.Model): user_id = models.ForeignKey(to=User,...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,257
Lyxf3/Books_Shop
refs/heads/main
/book/views.py
from django.shortcuts import render from rest_framework import viewsets from rest_framework import permissions from rest_framework.decorators import action from rest_framework.response import Response from book.serializers import ( CategorySerializer, AuthorSerializer, BookSerializer, PromoCodeSerializer ) from boo...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,258
Lyxf3/Books_Shop
refs/heads/main
/purchase/admin.py
from django.contrib import admin from django.utils.html import mark_safe from purchase.models import Purchase @admin.register(Purchase) class PurchaseAdmin(admin.ModelAdmin): list_display = ('user_id', 'books', 'amount', 'created_at', 'status') search_fields = ('user_id',) list_filter...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,259
Lyxf3/Books_Shop
refs/heads/main
/book/migrations/0006_auto_20211008_1958.py
# Generated by Django 3.2.7 on 2021-10-08 16:58 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('book', '0005_author_perc...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,260
Lyxf3/Books_Shop
refs/heads/main
/tmp/purchase.py
from book.modals import ( Book, Category, Author, Publisher, Contract, Market, DiscountShop ) from random import randint, choice from string import ascii_lowercase from django.utils import timezone # # def create_purchase(count): # def get_random_obf(model): # random_idx = randint(0, model....
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,261
Lyxf3/Books_Shop
refs/heads/main
/purchase/urls.py
from django.urls import path from rest_framework.routers import DefaultRouter from django.conf.urls import include from purchase import views as purchase_views router = DefaultRouter() router.register(r'purchase', purchase_views.PurchaseViewSet, basename='purchase') urlpatterns = [ path('', include(route...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,262
Lyxf3/Books_Shop
refs/heads/main
/purchase/serializers.py
from purchase.models import Purchase from rest_framework import serializers class PurchaseSerializer(serializers.ModelSerializer): class Meta: model = Purchase fields = ('user_id', 'books', 'issued', 'amount', 'created_at', 'status')
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,263
Lyxf3/Books_Shop
refs/heads/main
/tmp/book.py
from book.models import ( Book, Category, Author, Publisher, Contract, Market, DiscountShop, BBook, PBook, EBook, ABook, Types ) from random import randint, choice, choices from string import ascii_lowercase from django.utils import timezone CATEGORIES_COUNT = 1500 AUTHORS_COUNT = 1500 PUBLISHER_CO...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,264
Lyxf3/Books_Shop
refs/heads/main
/book/mixins/aggregation.py
from book.models import ( DiscountShop, Author, Book, Publisher ) from django.db.models import FloatField, OuterRef from django.db.models.functions import Cast from django.db.models import Avg, Max, F, Sum, Min # Средняя скидка от автора Avg int def get_avg_discount(): author = Author.objects.first(...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,265
Lyxf3/Books_Shop
refs/heads/main
/book/migrations/0005_author_percent.py
# Generated by Django 3.2.7 on 2021-10-08 12:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('book', '0004_auto_20211008_1340'), ] operations = [ migrations.AddField( model_name='author', name='percent', ...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,266
Lyxf3/Books_Shop
refs/heads/main
/book/serializers.py
from book.models import ( Book, Author, Publisher, PromoCode, Category ) from rest_framework import serializers class BookSerializer(serializers.ModelSerializer): class Meta: model = Book fields = ('title', 'price', 'issued', 'categories', 'authors', 'publisher', 'm...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,267
Lyxf3/Books_Shop
refs/heads/main
/purchase/migrations/0001_initial.py
# Generated by Django 3.2.7 on 2021-10-06 10:21 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('book', '0002_initial'), migrations...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,268
Lyxf3/Books_Shop
refs/heads/main
/book/migrations/0003_alter_ebook_source.py
# Generated by Django 3.2.7 on 2021-10-06 14:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('book', '0002_initial'), ] operations = [ migrations.AlterField( model_name='ebook', name='source', field...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,269
Lyxf3/Books_Shop
refs/heads/main
/book/migrations/0001_initial.py
# Generated by Django 3.2.7 on 2021-10-06 10:21 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( nam...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,270
Lyxf3/Books_Shop
refs/heads/main
/purchase/views.py
from django.shortcuts import render from rest_framework import viewsets from rest_framework import permissions from rest_framework.decorators import action from rest_framework.response import Response from purchase.serializers import PurchaseSerializer from purchase.models import Purchase class PurchaseViewSet(viewse...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,271
Lyxf3/Books_Shop
refs/heads/main
/user/admin.py
from django.contrib import admin from django.utils.html import mark_safe from user.models import User @admin.register(User) class UserAdmin(admin.ModelAdmin): list_display = ('name', 'email', 'is_staff', 'is_superuser', 'is_active', 'balance', 'date_joined') search_fields = ('email', 'nam...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,272
Lyxf3/Books_Shop
refs/heads/main
/book/urls.py
from django.urls import path from rest_framework.routers import DefaultRouter from django.conf.urls import include from book import views as book_views router = DefaultRouter() router.register(r'book', book_views.BookViewSet, basename='book') router.register(r'promo-code', book_views.PromoCodeViewSet, basename=...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,273
Lyxf3/Books_Shop
refs/heads/main
/user/migrations/0001_initial.py
# Generated by Django 3.2.7 on 2021-10-06 10:21 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('book', '0001_initial'), ] operations = [ migrations.CreateModel( name='User', fields=[ ...
{"/user/views.py": ["/user/serializers.py", "/user/models.py"], "/user/serializers.py": ["/user/models.py"], "/book/admin.py": ["/book/models.py"], "/purchase/models.py": ["/user/models.py", "/book/models.py"], "/book/views.py": ["/book/serializers.py", "/book/models.py"], "/purchase/admin.py": ["/purchase/models.py"],...
47,280
antoniolopes/bootstrap-bottle
refs/heads/master
/routes/static.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Static routes Created by: Rui Carmo License: MIT (see LICENSE for details) """ import os, sys, logging from bottle import route, static_file log = logging.getLogger() @route('/static/<path:path>') def send_static(path): """Static file handler""" return stat...
{"/app.py": ["/api/__init__.py", "/routes/__init__.py"]}
47,281
antoniolopes/bootstrap-bottle
refs/heads/master
/app.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Main application script Created by: Rui Carmo """ import os, sys, logging # Make sure our bundled libraries take precedence sys.path.insert(0,os.path.join(os.path.dirname(os.path.abspath(__file__)),'lib')) from bottle import run from config import settings log = l...
{"/app.py": ["/api/__init__.py", "/routes/__init__.py"]}
47,282
antoniolopes/bootstrap-bottle
refs/heads/master
/routes/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Main routes Created by: Rui Carmo (Updated by: António Lopes - bootstrap-bottle) License: MIT (see LICENSE for details) """ import os, sys, logging from bottle import view, route log = logging.getLogger() @route('/') @view('home') def index(): return { "t...
{"/app.py": ["/api/__init__.py", "/routes/__init__.py"]}
47,283
antoniolopes/bootstrap-bottle
refs/heads/master
/api/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Application routes Created by: Rui Carmo License: MIT (see LICENSE for details) """ import os, sys, logging log = logging.getLogger() version = '1' prefix = '/v%s' % version # import route submodules here
{"/app.py": ["/api/__init__.py", "/routes/__init__.py"]}
47,284
ewurman/LA2Project
refs/heads/master
/GameB.py
''' M = money I have (integer) if M is div by 3 we toss coin 1; else we toss coin 2 Coin1: I win 9/10 + e Coin2: I win 1/4 + e Winner wins 1 dollar from loser ''' import random import numpy as np import matplotlib.pyplot as plt class GameB: def __init__(self, epsilon = 0.005, chance1 = 0.9, chance2 = 0.25): ...
{"/Parrondo3.py": ["/GameA.py", "/GameB.py"]}
47,285
ewurman/LA2Project
refs/heads/master
/Parrondo3.py
from GameA import * from GameB import * import numpy as np def alternate_games(money, turns): '''returns the money after playing the game turns times each''' ga = GameA() gb = GameB() money_list = [] i = 0 turns_2 = turns countsA = [0,0,0] countsB = [0,0,0] while i < turns_2: ...
{"/Parrondo3.py": ["/GameA.py", "/GameB.py"]}
47,286
ewurman/LA2Project
refs/heads/master
/GameA.py
''' I Lose with 1/2 - e chance, I win with 1/2 + e chance Winner wins $1 ''' import random import numpy as np import matplotlib.pyplot as plt class GameA: def __init__(self, epsilon = 0.005, chance = 0.5): self.epsilon = epsilon self.chance = chance def play_once(self): '''return Tru...
{"/Parrondo3.py": ["/GameA.py", "/GameB.py"]}
47,290
klausfmh/pypeman-jsonrpc-adm
refs/heads/master
/vendor/jsonrpc_adm/server.py
from inspect import iscoroutinefunction from aiohttp import web from vendor.jsonrpc_adm.rpc_methods import RPCMethods class RPCHandler: def __init__(self, rpc_methods): self.rpc_methods = rpc_methods # identify all coroutine functions or callables self.method_dict = methods = {} ...
{"/vendor/jsonrpc_adm/server.py": ["/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/plugin.py": ["/vendor/jsonrpc_adm/server.py", "/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/sample_srv.py": ["/vendor/jsonrpc_adm/server.py"]}
47,291
klausfmh/pypeman-jsonrpc-adm
refs/heads/master
/vendor/jsonrpc_adm/plugin.py
# import asyncio import logging # from inspect import getmembers # from inspect import isfunction # from ajsonrpc import __version__ as ajsonrpc_version # from ajsonrpc.dispatcher import Dispatcher # from ajsonrpc.manager import AsyncJSONRPCResponseManager # from ajsonrpc.core import JSONRPC20Request from pypeman.co...
{"/vendor/jsonrpc_adm/server.py": ["/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/plugin.py": ["/vendor/jsonrpc_adm/server.py", "/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/sample_srv.py": ["/vendor/jsonrpc_adm/server.py"]}
47,292
klausfmh/pypeman-jsonrpc-adm
refs/heads/master
/vendor/jsonrpc_adm/http_client.py
from functools import partial import requests class Client: def __init__(self, url): if "://" not in url: url = "http://" + url if not url.endswith("/"): url += "/" self.url = url self.ses = None self.cnt = 1 def connect(self): self.ses...
{"/vendor/jsonrpc_adm/server.py": ["/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/plugin.py": ["/vendor/jsonrpc_adm/server.py", "/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/sample_srv.py": ["/vendor/jsonrpc_adm/server.py"]}
47,293
klausfmh/pypeman-jsonrpc-adm
refs/heads/master
/vendor/jsonrpc_adm/sample_srv.py
from aiohttp import web from vendor.jsonrpc_adm.server import server_app class RPCMethods: def ping(self): return "pong" async def aping(self): return "ponga" if __name__ == "__main__": methods = RPCMethods() app = server_app(methods) web.run_app(app)
{"/vendor/jsonrpc_adm/server.py": ["/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/plugin.py": ["/vendor/jsonrpc_adm/server.py", "/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/sample_srv.py": ["/vendor/jsonrpc_adm/server.py"]}
47,294
klausfmh/pypeman-jsonrpc-adm
refs/heads/master
/vendor/jsonrpc_adm/rpc_methods.py
import importlib from pypeman import channels from pypeman import nodes from pypeman.conf import settings from pypeman.graph import mk_graph class RPCMethods: def ping(self): """ ping function (mostly for debug) """ return "pong" async def pinga(self): """ asy...
{"/vendor/jsonrpc_adm/server.py": ["/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/plugin.py": ["/vendor/jsonrpc_adm/server.py", "/vendor/jsonrpc_adm/rpc_methods.py"], "/vendor/jsonrpc_adm/sample_srv.py": ["/vendor/jsonrpc_adm/server.py"]}
47,345
towrig/marvelcoop
refs/heads/master
/tracker.py
import os import time import math import tkinter.filedialog as filedialog import schedule import threading import random import exporter as exp from tkinter import * import numpy as np from PIL import Image, ImageTk, ImageDraw from marvelmind import MarvelmindHedge # whole app requires: pyserial, crcmod, matplotlib...
{"/tracker.py": ["/exporter.py"]}
47,346
towrig/marvelcoop
refs/heads/master
/exporter.py
from zipfile import ZipFile from datetime import date import io from PIL import Image, ImageTk def import_file(filename): d = {} with ZipFile(filename, 'r') as zip: floor_plan_name = "" with io.TextIOWrapper(zip.open("meta.txt"), encoding="utf-8") as f: d["date"] = f.readline() ...
{"/tracker.py": ["/exporter.py"]}
47,349
Dhakshan/webm_converter
refs/heads/main
/controller.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ try: import Tkinter as Tk except ModuleNotFoundError: import tkinter as Tk from pathlib import Path from consts import * from view import View from model import Model class Controller: d...
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,350
Dhakshan/webm_converter
refs/heads/main
/consts.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ import os from pathlib import Path VERSION = "v0.3" NAME = "WebM Converter" FILE_NAME = "webm_converter" IMAGES_DIR = str(os.path.dirname(os.path.realpath(__file__))) + "/images"
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,351
Dhakshan/webm_converter
refs/heads/main
/main_window.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ try: import Tkinter as Tk from tkinter import ttk from Tkinter import messagebox from Tkinter.filedialog import askopenfilename, askdirectory import Tkinter.scrolledtext as st excep...
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,352
Dhakshan/webm_converter
refs/heads/main
/included_software_dialog.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ try: import Tkinter as Tk from Tkinter import ttk except ModuleNotFoundError: import tkinter as Tk from tkinter import ttk class IncludedSoftwareDialog(Tk.Toplevel): def __init__(se...
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,353
Dhakshan/webm_converter
refs/heads/main
/webm_converter.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ from controller import Controller if __name__ == '__main__': c = Controller() c.run()
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,354
Dhakshan/webm_converter
refs/heads/main
/view.py
""" Author: Konstantin (k0nze) Lübeck Copyright (c) 2020 Konstantin (k0nze) Lübeck """ try: import Tkinter as Tk from Tkinter import ttk except ModuleNotFoundError: import tkinter as Tk from tkinter import ttk from main_window import MainWindow class View: def __init__(self, model, controller): ...
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,355
Dhakshan/webm_converter
refs/heads/main
/model.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ import json import os import subprocess import threading import time import time import shlex from consts import * from pathlib import Path from subprocess import check_output class JsonFileCreateExce...
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,356
Dhakshan/webm_converter
refs/heads/main
/about_dialog.py
""" Author: Konstantin (k0nze) Lübeck License: BSD 3-Clause License Copyright (c) 2021 Konstantin (k0nze) Lübeck """ try: import Tkinter as Tk from Tkinter import ttk import Tkinter.font as TkFont except ModuleNotFoundError: import tkinter as Tk from tkinter import ttk import tkinter.font as Tk...
{"/controller.py": ["/consts.py", "/view.py", "/model.py"], "/main_window.py": ["/consts.py", "/about_dialog.py", "/included_software_dialog.py"], "/webm_converter.py": ["/controller.py"], "/view.py": ["/main_window.py"], "/model.py": ["/consts.py"], "/about_dialog.py": ["/consts.py"]}
47,363
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/tasks.py
from celery import Celery from smc_tools import SMCSession app = Celery('tasks') app.config_from_object('celeryconfig') @app.task def add_to_blacklist(source, destination, duration): # Create SMC Session and add to blacklist session = SMCSession() session.add_to_blacklist(source=source, destination=d...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,364
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/celeryconfig.py
broker_url = 'pyamqp://guest@broker' task_annotations = { 'tasks.add_to_blacklist': { 'rate_limit': '12/m' } }
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,365
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/main.py
import logging from config import Config from logs import Logger from server import app if __name__ == "__main__": # Load in config config = Config() config.load() # Create logger logger = Logger(config) # Get required configuration items host = config.get('host') if not host: ...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,366
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/test.py
from tasks import add_to_blacklist add_to_blacklist.delay('any', '1.1.1.1', 3600) add_to_blacklist.delay('any', '1.2.2.2', 3600) add_to_blacklist.delay('any', '1.3.3.3', 3600) add_to_blacklist.delay('any', '1.4.4.4', 3600) add_to_blacklist.delay('any', '1.5.5.5', 3600) add_to_blacklist.delay('any', '1.6.6.6', 3600) ad...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,367
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/smc_tools.py
import ipaddress import logging from config import Config from smc import session from smc.core.engine import Engine from smc.elements.other import Blacklist from time import sleep class SMCSession: api_key = '' api_version = "6.7" config = Config() endpoint = '' engines = [] port = 0 def...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,368
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/config.py
import os import requests import yaml class Config: """ Class representing configuration for the program. """ data = {} def load(self): # Check if config file exists, download if not. if not os.path.isfile('config.yaml'): self.download() # Load in config file...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,369
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/lambda/lambda_function.py
import os import requests def lambda_handler(event, context): # Get environment variables url = os.environ['NGFW_ENDPOINT'] # Get values from event event_type = event.get('type', None) if not event_type: return { 'statusCode': 404, 'message': 'No event type was ass...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,370
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/server.py
import logging from config import Config from flask import Flask, request from tasks import add_to_blacklist app = Flask(__name__) # Get config config = Config() config.load() # Disable Flask logs log = logging.getLogger('werkzeug') log.disabled = True app.logger.disabled = True @app.route('/') @app.route('/api/',...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,371
Forcepoint/fp-bd-ngfw-aws-guardduty
refs/heads/master
/logs.py
import logging levels = { 'info': logging.INFO, 'debug': logging.DEBUG, 'warn': logging.WARN, 'fatal': logging.FATAL, 'error': logging.ERROR } class Logger(): """ Class representing the logger. """ def __init__(self, config): """ Initialise the logger. :pa...
{"/tasks.py": ["/smc_tools.py"], "/main.py": ["/config.py", "/logs.py", "/server.py"], "/test.py": ["/tasks.py"], "/smc_tools.py": ["/config.py"], "/server.py": ["/config.py", "/tasks.py"]}
47,393
dagopian/Island
refs/heads/master
/multi.py
from multiprocessing import Process, Pipe import time as t import os import argparse import numpy as np import pandas as pd from rdkit import Chem from rdkit import rdBase import cfg_util import score_util import zinc_grammar import optimize_J rdBase.DisableLog('rdApp.error') GCFG = zinc_grammar.GCFG def f(i): ...
{"/multi.py": ["/optimize_J.py"]}
47,394
dagopian/Island
refs/heads/master
/optimize_J.py
from __future__ import print_function import argparse import copy import nltk import threading import time as t import numpy as np import pandas as pd from rdkit import Chem from rdkit import rdBase import cfg_util import score_util import zinc_grammar rdBase.DisableLog('rdApp.error') GCFG = zinc_grammar.GCFG def C...
{"/multi.py": ["/optimize_J.py"]}
47,395
dagopian/Island
refs/heads/master
/diversity.py
from rdkit import Chem, DataStructs from rdkit.Chem.Fingerprints import FingerprintMols import pandas as pd import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument('-i', type=int, default=0, help='Number of islands') parser.add_argument('-m', type=int, help='Migration Interval') ...
{"/multi.py": ["/optimize_J.py"]}
47,397
backslash112/subtitle_adjustment
refs/heads/master
/subtitle_adjustment.py
#with open('subtitle.txt') as subtitle: # for line in subtitle: # timer = float(line[6:])+0.01 # with open('subtitle_result.txt', 'a') as result_file: # result_file.write(line[0:6]+"%.2f"%timer+'\n') class SubtitleAdjustment(object): def __init__(self): print("myclass init") ...
{"/main.py": ["/subtitle_adjustment.py"]}
47,398
backslash112/subtitle_adjustment
refs/heads/master
/main.py
from subtitle_adjustment import SubtitleAdjustment def main(): print("starting") SubtitleAdjustment.test() sa = SubtitleAdjustment() sa.test2() sa.run() if __name__ == "__main__": main()
{"/main.py": ["/subtitle_adjustment.py"]}
47,401
alvarozamora/1DP
refs/heads/master
/postsim.py
import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import struct import sod reals = range(1) t = range(10) boxes = 200 L = 10**6 w = 30875045135703220*50 w = 3087504513.570322036743164*50 w = 3087504513.570322036743164*boxes/2 grid = 0 h = np.zeros((len(t),boxes)) for i in real...
{"/Python/1DP.py": ["/utils.py"]}
47,402
alvarozamora/1DP
refs/heads/master
/Python/1DP.py
from utils import * import numpy as np import matplotlib import pdb #matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns import argparse import h5py import time import torch sns.set_context("talk") #darkgrid, whitegrid, dark, white, ticks sns.set_style("white") parser = argparse.ArgumentParser...
{"/Python/1DP.py": ["/utils.py"]}
47,403
alvarozamora/1DP
refs/heads/master
/hdf2.py
import numpy as np import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns import argparse import h5py import pdb sns.set_context("talk") #darkgrid, whitegrid, dark, white, ticks parser = argparse.ArgumentParser(description='HDF5 Initial Condition Pipeline') parser.add_argument('--...
{"/Python/1DP.py": ["/utils.py"]}
47,404
alvarozamora/1DP
refs/heads/master
/gif.py
import imageio as imo import os import glob import re import numpy as np import torch import torch.nn.functional as F import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt #from torchvision.utils import save_image import io import struct def tryint(s): try: return int(s) except: ...
{"/Python/1DP.py": ["/utils.py"]}
47,405
alvarozamora/1DP
refs/heads/master
/utils.py
import numpy as np import matplotlib #matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns import argparse import h5py #import pdb; pdb.set_trace() def InitialConditions(x, rho, v, Pressure, args, p): N = args.n dx = np.gradient(x) # Cell Sizes (UNIFORM GRID ONLY) M = ...
{"/Python/1DP.py": ["/utils.py"]}
47,406
alvarozamora/1DP
refs/heads/master
/Python/gif.py
import imageio as io import os import glob import re import numpy as np import torch import torch.nn.functional as F #from torchvision.utils import save_image def tryint(s): try: return int(s) except: return s def alphanum_key(s): """ Turn a string into a list of string and number chunks. ...
{"/Python/1DP.py": ["/utils.py"]}
47,407
alvarozamora/1DP
refs/heads/master
/hdf.py
import numpy as np import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt import seaborn as sns import argparse import h5py sns.set_context("talk") #darkgrid, whitegrid, dark, white, ticks parser = argparse.ArgumentParser(description='HDF5 Initial Condition Pipeline') parser.add_argument('--file', type...
{"/Python/1DP.py": ["/utils.py"]}
47,408
katehrkim/budget
refs/heads/master
/classes/budget.py
from classes.savings import Savings from classes.expenses import Expenses import os import csv class Budget: def __init__(self, name, amount): self.name = name self.amount = amount self.spendings = [] self.deposits = [] def list_expenses(self): for object in self.spe...
{"/classes/budget.py": ["/classes/savings.py", "/classes/expenses.py"], "/runner.py": ["/classes/expenses.py", "/classes/budget.py"]}
47,409
katehrkim/budget
refs/heads/master
/runner.py
# After you write all your classes, use this file to call them all together and run your program from classes.expenses import Expenses from classes.budget import Budget jon = Budget('Jon', 500) while True: user_input = input('\nWhat would you like to do?\nOptions:\n1 view amount of money left\n2 record a spending...
{"/classes/budget.py": ["/classes/savings.py", "/classes/expenses.py"], "/runner.py": ["/classes/expenses.py", "/classes/budget.py"]}
47,410
katehrkim/budget
refs/heads/master
/classes/expenses.py
class Expenses: def __init__(self, date, type, amount): self.date_spent = date self.type = type self.amount = amount
{"/classes/budget.py": ["/classes/savings.py", "/classes/expenses.py"], "/runner.py": ["/classes/expenses.py", "/classes/budget.py"]}
47,411
katehrkim/budget
refs/heads/master
/classes/savings.py
class Savings: def __init__(self, date, type='income', amount=100): self.date_deposited = date self.type = type self.amount = amount
{"/classes/budget.py": ["/classes/savings.py", "/classes/expenses.py"], "/runner.py": ["/classes/expenses.py", "/classes/budget.py"]}
47,419
AkumaEX/MAC0317-EP1
refs/heads/master
/main.py
import sys import wave import numpy as np from synthesizer import Synthesizer # preparando a estrutura de dados adsr = open(sys.argv[1], 'r').readlines() freq = int(sys.argv[2]) part = sys.stdin.readlines() # amostragem da melodia synt = Synthesizer(adsr, freq, part) melody = synt.get_melody() # estruturando a amost...
{"/main.py": ["/synthesizer.py"]}
47,420
AkumaEX/MAC0317-EP1
refs/heads/master
/synthesizer.py
import re import numpy as np class Synthesizer: def __init__(self, adsr, freq, part): self._adsr = adsr self._freq = freq self._part = part def C(octave): return 16.352*2**int(octave) def Db(octave): return 17.324*2**int(octave) def D(oct...
{"/main.py": ["/synthesizer.py"]}
47,422
TomHuix/fine_tuning
refs/heads/master
/main_train.py
from fine_tuning_bert import main from fine_tune_sbert import train_sbert ############################################# corpus_input_file = 'data/corpus.txt' bert_output_dir = 'output/bert' model_type = 'bert' model_name_or_path = 'bert-base-uncased' sbert_output_dir = 'output/sbert' ################################...
{"/main_train.py": ["/fine_tune_sbert.py"], "/make_test_sick.py": ["/cleaner.py", "/encoders.py"]}
47,423
TomHuix/fine_tuning
refs/heads/master
/encoders.py
###This file represents all encoders used in this projet, ## An encoder uses 2 functions, encode: transform e string into encoded vector ## Train: train the model ## For the moment: tfidf, Doc2vec, skip-thoughts, Quick-thoughts, Word2Vec moyenne, Sbert from nltk.tokenize import word_tokenize from gensim.models.doc2v...
{"/main_train.py": ["/fine_tune_sbert.py"], "/make_test_sick.py": ["/cleaner.py", "/encoders.py"]}
47,424
TomHuix/fine_tuning
refs/heads/master
/fine_tune_sbert.py
from torch.utils.data import DataLoader import math from sentence_transformers import models, losses from sentence_transformers import SentencesDataset, LoggingHandler, SentenceTransformer from sentence_transformers.evaluation import EmbeddingSimilarityEvaluator from sentence_transformers.readers import * import loggi...
{"/main_train.py": ["/fine_tune_sbert.py"], "/make_test_sick.py": ["/cleaner.py", "/encoders.py"]}
47,425
TomHuix/fine_tuning
refs/heads/master
/cleaner.py
import swifter import pandas as pd import string import functools import re from nltk.corpus import stopwords from nltk.tokenize import word_tokenize import timeit import nltk from nltk.corpus import stopwords, wordnet from nltk.tokenize import word_tokenize import string from sklearn.feature_extraction.text import C...
{"/main_train.py": ["/fine_tune_sbert.py"], "/make_test_sick.py": ["/cleaner.py", "/encoders.py"]}
47,426
TomHuix/fine_tuning
refs/heads/master
/make_test_sick.py
import pandas as pd import swifter from cleaner import simple_clean from encoders import encoder_Doc2vec, encoder_tfidf, mean_word2vec, encoder_sbert import numpy as np from sklearn.metrics.pairwise import cosine_similarity import plotly import plotly.graph_objects as go from reducer_dim import reduce_dim def load(): ...
{"/main_train.py": ["/fine_tune_sbert.py"], "/make_test_sick.py": ["/cleaner.py", "/encoders.py"]}
47,506
yvson18/Imobiliaria-fastapi-Postsql-crud
refs/heads/main
/Modelos.py
from pydantic import BaseModel class Endereco(BaseModel): rua: str = None cidade: str = None estado: str = None pais: str = None cep: str = None numero: str = None complemento: str = None class Imobiliaria(BaseModel): endereco: Endereco anuncio: str = None area_construida: str ...
{"/main.py": ["/Modelos.py", "/PgDb.py"]}
47,507
yvson18/Imobiliaria-fastapi-Postsql-crud
refs/heads/main
/PgDb.py
import databases, sqlalchemy usuario_posgre = "userimob" senha = "userimob1337" ip = "localhost" # deixa localhost para ficar nao dar ruim porta = "5432" DATABASE_URL = f"postgresql://{usuario_posgre}:{senha}@{ip}:{porta}/dbproimob" database = databases.Database(DATABASE_URL) #Acho que se usa a url para fazer as devi...
{"/main.py": ["/Modelos.py", "/PgDb.py"]}
47,508
yvson18/Imobiliaria-fastapi-Postsql-crud
refs/heads/main
/main.py
from fastapi import FastAPI, HTTPException from Modelos import Imobiliaria,Imobiliaria_User_Entry,Imovel_Delete,Imovel_Update from PgDb import database,users import uuid import datetime app = FastAPI() #-------------------------------on_vent faz uma func rodar antes da app iniciar, porem n sei a utilidade aqui -----...
{"/main.py": ["/Modelos.py", "/PgDb.py"]}
47,511
RushikeshGholap/Projects
refs/heads/master
/Django/django_sinha/imagepred/core/models.py
from django.db import models # Create your models here. class Document(models.Model): des = models.CharField(max_length=100) image = models.ImageField(upload_to='media/')
{"/Django/django_sinha/imagepred/core/forms.py": ["/Django/django_sinha/imagepred/core/models.py"], "/Django/django_sinha/imagepred/core/views.py": ["/Django/django_sinha/imagepred/core/forms.py"]}
47,512
RushikeshGholap/Projects
refs/heads/master
/Django/Code/mysite/polls/views.py
from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import nltk def index(request): return HttpResponse("Hello, world. You're at the polls index.") @csrf_exempt def caps(request): inputtext = request.POST['inputtext'] return HttpResponse(inputtext)
{"/Django/django_sinha/imagepred/core/forms.py": ["/Django/django_sinha/imagepred/core/models.py"], "/Django/django_sinha/imagepred/core/views.py": ["/Django/django_sinha/imagepred/core/forms.py"]}
47,513
RushikeshGholap/Projects
refs/heads/master
/Random/Optimization.py
# -*- coding: utf-8 -*- """ Created on Tue Jul 11 14:52:17 2017 @author: Akshay """ #Optimization problems # MIN -> x1*x4*(x1+x2+x3)+x3 # x1x2x3x4 >=25 # Sum of squares of all x1 to x4 is 40 import numpy as np from scipy.optimize import minimize #Objective def objective(x): return x[0]*x[3]*(x[...
{"/Django/django_sinha/imagepred/core/forms.py": ["/Django/django_sinha/imagepred/core/models.py"], "/Django/django_sinha/imagepred/core/views.py": ["/Django/django_sinha/imagepred/core/forms.py"]}
47,514
RushikeshGholap/Projects
refs/heads/master
/Random/sentiment_analysis.py
# -*- coding: utf-8 -*- """ Created on Mon Aug 7 01:31:29 2017 @author: Akshay """ import requests from bs4 import BeautifulSoup import pandas as pd url = 'http://www.moneycontrol.com/news/world/' z = requests.get(url) htmltext = z.text soup = BeautifulSoup(z.text,'lxml') newsfeed=soup.find(class_="f...
{"/Django/django_sinha/imagepred/core/forms.py": ["/Django/django_sinha/imagepred/core/models.py"], "/Django/django_sinha/imagepred/core/views.py": ["/Django/django_sinha/imagepred/core/forms.py"]}
47,515
RushikeshGholap/Projects
refs/heads/master
/Django/django_sinha/imagepred/core/forms.py
from django import forms from .models import * class DocumentForm(forms.ModelForm): class Meta: model = Document fields = ['image','des']
{"/Django/django_sinha/imagepred/core/forms.py": ["/Django/django_sinha/imagepred/core/models.py"], "/Django/django_sinha/imagepred/core/views.py": ["/Django/django_sinha/imagepred/core/forms.py"]}