index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
41,676 | lemonad/molnet-polls | refs/heads/master | /forms.py | # -*- coding: utf-8 -*-
from django.forms import (BooleanField, CharField, ChoiceField, Form,
ModelForm, MultiValueField, MultiWidget, RadioSelect,
Textarea, TextInput, ValidationError)
from django.utils.encoding import force_unicode
from django.utils.translation impo... | {"/tests.py": ["/models.py"], "/urls.py": ["/feeds.py"], "/forms.py": ["/models.py"], "/admin.py": ["/models.py"], "/feeds.py": ["/models.py"], "/views.py": ["/forms.py", "/models.py"]} |
41,677 | lemonad/molnet-polls | refs/heads/master | /migrations/0001_initial.py | # -*- coding: utf-8 -*-
from south.db import db
from django.db import models
from molnet.polls.models import *
class Migration:
def forwards(self, orm):
# Adding model 'Poll'
db.create_table('polls_poll', (
('id', orm['polls.Poll:id']),
('slug', orm['polls.Pol... | {"/tests.py": ["/models.py"], "/urls.py": ["/feeds.py"], "/forms.py": ["/models.py"], "/admin.py": ["/models.py"], "/feeds.py": ["/models.py"], "/views.py": ["/forms.py", "/models.py"]} |
41,678 | lemonad/molnet-polls | refs/heads/master | /models.py | # -*- coding: utf-8 -*-
import re
from autoslug import AutoSlugField
from django.contrib.auth.models import User
from django.db import connection
from django.db.models import (BooleanField, CharField, Count, DateField,
DateTimeField, ForeignKey, Manager, Model,
... | {"/tests.py": ["/models.py"], "/urls.py": ["/feeds.py"], "/forms.py": ["/models.py"], "/admin.py": ["/models.py"], "/feeds.py": ["/models.py"], "/views.py": ["/forms.py", "/models.py"]} |
41,679 | lemonad/molnet-polls | refs/heads/master | /admin.py | # -*- coding: utf-8 -*-
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from models import (Choice, Poll, Vote)
class ChoiceAdmin(admin.ModelAdmin):
fields... | {"/tests.py": ["/models.py"], "/urls.py": ["/feeds.py"], "/forms.py": ["/models.py"], "/admin.py": ["/models.py"], "/feeds.py": ["/models.py"], "/views.py": ["/forms.py", "/models.py"]} |
41,680 | lemonad/molnet-polls | refs/heads/master | /feeds.py | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.contrib.syndication.feeds import Feed
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.db.models import Count, Q
from django.utils.translation import ugettext_lazy as _
from models import Choice,... | {"/tests.py": ["/models.py"], "/urls.py": ["/feeds.py"], "/forms.py": ["/models.py"], "/admin.py": ["/models.py"], "/feeds.py": ["/models.py"], "/views.py": ["/forms.py", "/models.py"]} |
41,681 | lemonad/molnet-polls | refs/heads/master | /views.py | # -*- coding: utf-8 -*-
import datetime
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django... | {"/tests.py": ["/models.py"], "/urls.py": ["/feeds.py"], "/forms.py": ["/models.py"], "/admin.py": ["/models.py"], "/feeds.py": ["/models.py"], "/views.py": ["/forms.py", "/models.py"]} |
41,682 | jeff00seattle/pyfortified-datetime | refs/heads/master | /pyfortified_datetime/dates_range.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
def dates_range(date1, date2):
import datetime as dt
for n in range(int ((date2 - date1).days)+1):
yield date1 + dt.timedelta(n) | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,683 | jeff00seattle/pyfortified-datetime | refs/heads/master | /examples/example_dates_range_date.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from pprintpp import pprint
import datetime as dt
import pyfortified_datetime
start_dt = dt.date(2015, 12, 20)
end_dt = dt.date(2016, 1, 11)
print(type(pyfortified_datetime.dates_range(start_dt, end_dt)))
for dt in pyfortified_datetime.dates_range(start_dt, end_dt):
... | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,684 | jeff00seattle/pyfortified-datetime | refs/heads/master | /pyfortified_datetime/dates_month_first_last.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import datetime as dt
# requires python-dateutil (http://labix.org/python-dateutil)
from dateutil.relativedelta import relativedelta
def dates_month_first_last(month_date, date_format="%Y-%m-%d"):
if not (isinstance(month_date, str) or isinstance(month_date, dt.da... | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,685 | jeff00seattle/pyfortified-datetime | refs/heads/master | /pyfortified_datetime/__init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @copyright 2017 TUNE, Inc. (http://www.tune.com)
# @namespace tune_mv_integration
__title__ = 'pyfortified-datetime'
__version__ = '0.1.0'
__version_info__ = tuple(__version__.split('.'))
__author__ = 'jeff00seattle'
__license__ = 'MIT License'
__copyright__ = 'Copyr... | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,686 | jeff00seattle/pyfortified-datetime | refs/heads/master | /examples/example_dates_month_first_last.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from pprintpp import pprint
import datetime as dt
import pyfortified_datetime
month_first_date, month_last_date = pyfortified_datetime.dates_month_first_last(dt.date(2016, 12, 20))
pprint(month_first_date)
pprint(month_last_date)
month_first_date, month_last_date = py... | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,687 | jeff00seattle/pyfortified-datetime | refs/heads/master | /pyfortified_datetime/dates_months.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
def dates_months_list(start_date, end_date, date_format="%Y-%m"):
from dateutil.rrule import rrule, MONTHLY
return [dt.strftime(date_format) for dt in rrule(MONTHLY, dtstart=start_date, until=end_date)]
def dates_months_generator(start_date, end_date, date_form... | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,688 | jeff00seattle/pyfortified-datetime | refs/heads/master | /examples/example_dates_months_generator.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from pprintpp import pprint
import datetime as dt
import pyfortified_datetime
start_dt = dt.date(2016, 12, 20)
end_dt = dt.date(2018, 1, 11)
print(type(pyfortified_datetime.dates_months_generator(start_dt, end_dt)))
for dt in pyfortified_datetime.dates_months_generat... | {"/examples/example_dates_range_date.py": ["/pyfortified_datetime/__init__.py"], "/pyfortified_datetime/__init__.py": ["/pyfortified_datetime/dates_range.py", "/pyfortified_datetime/dates_month_first_last.py", "/pyfortified_datetime/dates_months.py"], "/examples/example_dates_month_first_last.py": ["/pyfortified_dateti... |
41,704 | MissionBit/MB_Portal | refs/heads/master | /staff/tasks.py | # Create your tasks here
from __future__ import absolute_import, unicode_literals
from celery import shared_task
"""
@shared_task
def hello():
print("It's a beautiful day in the neighborhood")
"""
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,705 | MissionBit/MB_Portal | refs/heads/master | /missionbit/azure_storage_backend.py | from django.utils.deconstruct import deconstructible
from azure.storage.blob.blockblobservice import BlockBlobService
from storages.backends.azure_storage import AzureStorage
from storages.utils import setting
@deconstructible
class CustomAzureStorage(AzureStorage):
# This is a workaround for AzureStorage to supp... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,706 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0005_userprofile_in_classroom.py | # Generated by Django 2.2.3 on 2019-08-02 02:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("home", "0004_auto_20190802_0126")]
operations = [
migrations.AddField(
model_name="userprofile",
name="in_classroom",
... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,707 | MissionBit/MB_Portal | refs/heads/master | /student/urls.py | from django.urls import path, include
from . import views
urlpatterns = [
path("", views.student, name="student"),
path("attendance_student/", views.attendance_student, name="attendance_student"),
path("my_class_student/", views.my_class_student, name="my_class_student"),
path(
"session_view_st... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,708 | MissionBit/MB_Portal | refs/heads/master | /attendance/urls.py | from django.urls import path
from . import views
urlpatterns = [
path("", views.attendance, name="attendance"),
path(
"take_attendance/<course_id>/<date>/",
views.take_attendance,
name="take_attendance",
),
path(
"notify_absent_students/",
views.notify_absent_stu... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,709 | MissionBit/MB_Portal | refs/heads/master | /home/generic_notifications.py | def get_generic_absence_notification(student, date):
return (
"Hello, our records indicate that %s %s was absent on %s, "
"please advise." % (student.first_name, student.last_name, date)
)
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,710 | MissionBit/MB_Portal | refs/heads/master | /attendance/views.py | from home.decorators import group_required_multiple
from django.contrib.auth.models import User as DjangoUser
from django.shortcuts import render, redirect
from home.models.models import Classroom, Attendance, Notification
from home.models.salesforce import ClassOffering
from staff.staff_views_helper import class_offer... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,711 | MissionBit/MB_Portal | refs/heads/master | /home/forms.py | from django import forms
from django.contrib.auth.forms import UserCreationForm, PasswordChangeForm
from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.models import Group
from home.models.models import (
Announcement,
Classroom,
Form,
Esign,
FormDistribution,
Noti... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,712 | MissionBit/MB_Portal | refs/heads/master | /tests/test_volunteer.py | from django.test import TestCase, RequestFactory
from volunteer.views import *
from django.contrib.auth.models import User, Group
from django.urls import reverse
from rest_framework import status
"""
class BaseTestCase(TestCase):
def create_authenticated_volunteer_user(self):
user = User.objects.create_use... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,713 | MissionBit/MB_Portal | refs/heads/master | /tests/test_staff.py | from django.test import TestCase, RequestFactory
from staff.views import *
from django.contrib.auth.models import User as DjangoUser
from home.models.models import Classroom, UserProfile, ClassroomMembership
from django.urls import reverse
from rest_framework import status
from home.models.salesforce import (
Conta... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,714 | MissionBit/MB_Portal | refs/heads/master | /tests/test_teacher.py | from django.test import TestCase, RequestFactory
from teacher.views import *
from django.contrib.auth.models import User, Group
from django.urls import reverse
from rest_framework import status
"""
class BaseTestCase(TestCase):
def create_authenticated_teacher_user(self):
user = User.objects.create_user(
... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,715 | MissionBit/MB_Portal | refs/heads/master | /home/models/salesforce.py | from salesforce import models
from home.choices import *
class Account(models.Model):
is_deleted = models.BooleanField(
verbose_name="Deleted", sf_read_only=models.READ_ONLY, default=False
)
master_record = models.ForeignKey(
"self",
models.DO_NOTHING,
related_name="account... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,716 | MissionBit/MB_Portal | refs/heads/master | /home/models/models.py | from time import strftime
from secrets import token_urlsafe
from django.db import models as mdls
from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.models import Group
from django.contrib.postgres.fields import JSONField
from django.db.models.signals import post_save
from django.dispatch... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,717 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0008_remove_userprofile_in_classroom.py | # Generated by Django 2.2.3 on 2019-08-04 20:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("home", "0007_auto_20190803_1930")]
operations = [migrations.RemoveField(model_name="userprofile", name="in_classroom")]
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,718 | MissionBit/MB_Portal | refs/heads/master | /donor/views.py | from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
@login_required
def donor(request):
if not request.user.groups.filter(name="donor").exists():
return HttpResponse("Unauthorized", status=401)
return render(request, "donor... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,719 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0002_add_groups.py | from django.db import models, migrations
from home.models.models import Group
from django.conf import settings
def add_groups(apps, schema_editor):
"""This migration guarantees that group IDs are generated correctly. See missionbit/settings.py
for group ID settings"""
Group.objects.get_or_create(name="st... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,720 | MissionBit/MB_Portal | refs/heads/master | /student/views.py | from django.shortcuts import render, redirect
from django.contrib.auth.models import Group
from home.decorators import group_required
from home.models.models import (
Announcement,
Form,
Notification,
Attendance,
Classroom,
Session,
Resource,
)
from attendance.views import (
get_average_... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,721 | MissionBit/MB_Portal | refs/heads/master | /home/views.py | from django.shortcuts import render, redirect, render_to_response
from django.contrib.auth import logout
from django.contrib.auth.models import Group
from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, ContactRegisterFo... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,722 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0010_auto_20190806_1917.py | # Generated by Django 2.2.3 on 2019-08-06 19:17
from django.db import migrations, models
import home.models.models
class Migration(migrations.Migration):
dependencies = [("home", "0009_auto_20190804_2253")]
operations = [
migrations.AlterField(
model_name="form",
name="form"... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,723 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0007_auto_20190803_1930.py | # Generated by Django 2.2.3 on 2019-08-03 19:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("home", "0006_session_title")]
operations = [
migrations.AddField(
model_name="classroom",
name="forum",
field=models.... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,724 | MissionBit/MB_Portal | refs/heads/master | /donor/urls.py | from django.urls import path
from . import views
urlpatterns = [path("", views.donor, name="donor")]
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,725 | MissionBit/MB_Portal | refs/heads/master | /home/decorators.py | from django.core.exceptions import PermissionDenied
def group_required(group):
def user_in_group(func):
def wrapper(request, *args, **kwargs):
if request.user.groups.filter(name=group).exists():
return func(request, *args, **kwargs)
else:
raise Permi... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,726 | MissionBit/MB_Portal | refs/heads/master | /context_processors.py | from staff.staff_views_helper import get_classroom_by_django_user
def user_groups(request):
user_groups = set(request.user.groups.all().values_list("name", flat=True))
return {"user_groups": user_groups}
def user_classroom(request):
classroom = get_classroom_by_django_user(request.user)
return {"cla... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,727 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0001_initial.py | # Generated by Django 2.2.3 on 2019-07-30 02:59
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import salesforce.backend.operations
import salesforce.fields
class Migration(migrations.Migration):
initial = Tr... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,728 | MissionBit/MB_Portal | refs/heads/master | /teacher/views.py | from django.shortcuts import render, redirect
from home.decorators import group_required
from home.models.models import (
Announcement,
Form,
Notification,
Classroom,
Session,
Resource,
)
from home.forms import AddResourceForm
from attendance.views import get_date_from_template_returned_string
f... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,729 | MissionBit/MB_Portal | refs/heads/master | /staff/urls.py | from django.urls import path
from . import views
urlpatterns = [
path("", views.staff, name="staff"),
path(
"classroom_management/", views.classroom_management, name="classroom_management"
),
path("create_staff_user/", views.create_staff_user, name="create_staff_user"),
path("create_teacher... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,730 | MissionBit/MB_Portal | refs/heads/master | /home/apps.py | from django.apps import AppConfig
from django.db.models.signals import pre_migrate
from azure.storage.blob import PublicAccess
def ensure_azure_container(sender, **kwargs):
"""
Ensure that the expected Azure Storage container exists when
running with an emulated service.
"""
from missionbit.azure_... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,731 | MissionBit/MB_Portal | refs/heads/master | /home/choices.py | RACE_CHOICES = (
("American Indian/Alaskan Native", "American Indian/Alaskan Native"),
("Asian", "Asian"),
("Black/African American", "Black/African American"),
(
"Native Hawaiian/Other Pacific Islander",
"Native Hawaiian/Other Pacific Islander",
),
("White", "White"),
(
... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,732 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0003_announcementdistribution.py | # Generated by Django 2.2.3 on 2019-07-31 18:32
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),
("home", "0002_add_groups"... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,733 | MissionBit/MB_Portal | refs/heads/master | /staff/staff_views_helper.py | from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.models import Group
from django.shortcuts import render
from home.models.salesforce import ClassEnrollment, Contact, ClassOffering
from home.models.models import (
Announcement,
UserProfile,
Classroom,
ClassroomMembership... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,734 | MissionBit/MB_Portal | refs/heads/master | /tests/test_home.py | from django.test import TestCase, RequestFactory, Client
from django.contrib.auth.models import User, AnonymousUser as DjangoUser, AnonymousUser
from django.contrib.auth import authenticate
from django.urls import reverse
from rest_framework import status
from django.contrib.messages.storage.fallback import FallbackSto... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,735 | MissionBit/MB_Portal | refs/heads/master | /tests/test_student.py | from django.test import TestCase, RequestFactory
from student.views import *
from django.contrib.auth.models import User, Group
from django.urls import reverse
from rest_framework import status
"""
class BaseTestCase(TestCase):
def create_authenticated_student_user(self):
user = User.objects.create_user(
... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,736 | MissionBit/MB_Portal | refs/heads/master | /home/urls.py | from django.urls import path, include
from . import views
urlpatterns = [
path("", views.landing_page, name="home-landing_page"),
path("logout/", views.logout_view, name="home-logout"),
path("home/", views.home, name="home-home"),
path(
"register_as_student/",
views.register_as_student... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,737 | MissionBit/MB_Portal | refs/heads/master | /staff/views.py | from django.template.defaulttags import register
from django.shortcuts import render, redirect
from home.decorators import group_required
from django.http import HttpResponse, Http404
from home.forms import (
CreateStaffForm,
CreateClassroomForm,
CreateTeacherForm,
CreateVolunteerForm,
CreateStudent... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,738 | MissionBit/MB_Portal | refs/heads/master | /volunteer/urls.py | from django.urls import path
from . import views
urlpatterns = [path("", views.volunteer, name="volunteer")]
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,739 | MissionBit/MB_Portal | refs/heads/master | /home/migrations/0004_auto_20190802_0126.py | # Generated by Django 2.2.3 on 2019-08-02 01:26
from django.db import migrations, models
import django.db.models.deletion
import salesforce.fields
class Migration(migrations.Migration):
dependencies = [("home", "0003_announcementdistribution")]
operations = [
migrations.AddField(
model_... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,740 | MissionBit/MB_Portal | refs/heads/master | /volunteer/views.py | from django.shortcuts import render
from home.decorators import group_required
@group_required("volunteer")
def volunteer(request):
return render(request, "volunteer.html")
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,741 | MissionBit/MB_Portal | refs/heads/master | /ci/rewrite_sources.py | #!/bin/python
"""
Rewrite the source code path in coverage.xml to a new value for use by CI.
In the container it's always: <sources><source>/code</source></sources>
However, the coverage tool for Azure Pipelines needs the path to match
the directory outside of the container.
"""
import sys
import xml.etree.ElementTr... | {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,742 | MissionBit/MB_Portal | refs/heads/master | /teacher/urls.py | from django.urls import path, include
from . import views
urlpatterns = [
path("", views.teacher, name="teacher"),
path("my_class_teacher/", views.my_class_teacher, name="my_class_teacher"),
path(
"session_view_teacher/", views.session_view_teacher, name="session_view_teacher"
),
]
| {"/attendance/views.py": ["/home/decorators.py", "/home/models/models.py", "/home/models/salesforce.py", "/staff/staff_views_helper.py", "/home/generic_notifications.py"], "/home/forms.py": ["/home/models/models.py", "/home/models/salesforce.py", "/home/choices.py"], "/tests/test_volunteer.py": ["/volunteer/views.py"],... |
41,925 | 1Jayso/Flask_Blog | refs/heads/master | /flaskblog/__init__.py | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
import flask_whooshalchemy
from flask_mail import Mail
app = Flask(__name__)
app.config['SECRET_KEY'] = 'c2cf55a7b26cf64dbe60700f89c74650'
# SQLAlchemy configuration
app.conf... | {"/flaskblog/routes.py": ["/flaskblog/__init__.py"], "/run.py": ["/flaskblog/__init__.py"]} |
41,926 | 1Jayso/Flask_Blog | refs/heads/master | /flaskblog/routes.py |
import os
import secrets
from PIL import Image
from flask import render_template, url_for, flash, redirect, request, abort
import flask_whooshalchemy
from flaskblog.forms import LoginForm, RegistrationForm, UpdateAccountForm, PostForm, RequestResetForm, ResetPasswordForm
from flaskblog import app, db, bcrypt, mail
fro... | {"/flaskblog/routes.py": ["/flaskblog/__init__.py"], "/run.py": ["/flaskblog/__init__.py"]} |
41,927 | 1Jayso/Flask_Blog | refs/heads/master | /run.py |
from flaskblog import app
# import secrets
# secrets.token_hex(16)
# The above code is use to generate a secret key(byte string)
#! /usr/bin/env python
from flask_script import Manager, prompt_bool
from flaskblog.models import User, Post
from flaskblog import app, db
from flask_migrate import Migrate, MigrateCommand... | {"/flaskblog/routes.py": ["/flaskblog/__init__.py"], "/run.py": ["/flaskblog/__init__.py"]} |
41,935 | hackaugusto/django_minifier | refs/heads/master | /minifier/handlers/comment.py | from __future__ import absolute_import
from minifier.handlers.base import MinifierBase
from minifier.minifier import Minifier
class ConditionalCommentMinifier(MinifierBase):
def minify(self, elements, name):
output = ''
minifier = Minifier()
for e in elements:
conditional = e.... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,936 | hackaugusto/django_minifier | refs/heads/master | /minifier/handlers/plain.py | from __future__ import absolute_import
from minifier.handlers.base import MinifierBase
class PlainMinifier(MinifierBase):
def minify(self, elements, name):
output = ''
for e in elements:
output += e.content()
return output
| {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,937 | hackaugusto/django_minifier | refs/heads/master | /minifier/parser/lxml.py | from __future__ import absolute_import, with_statement
import codecs
import lxml
from lxml import etree
from lxml.etree import tostring
from lxml.html import fromstring, soupparser
from django.core.exceptions import ImproperlyConfigured
from minifier.parser.base import ConditionalElementProxy, ElementProxy, ParserBas... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,938 | hackaugusto/django_minifier | refs/heads/master | /minifier/conf.py | import os
from django.conf import settings
from appconf import AppConf
class CompressorConf(AppConf):
DISABLED = settings.DEBUG
PARSER = 'minifier.parser.lxml.LxmlParser'
MINIFIER_MINIFIERS = (
('application/javascript', 'minifier.handlers.js.JsMinifier'),
('text/css', 'minifier.handlers.c... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,939 | hackaugusto/django_minifier | refs/heads/master | /minifier/minifier.py | from __future__ import absolute_import
import os
import urllib
from md5 import md5
import inspect
from django.utils.encoding import smart_unicode
from django.utils.importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from minifier.conf import settings
from minifier.utils.decorators i... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,940 | hackaugusto/django_minifier | refs/heads/master | /minifier/minifier/js.py | from itertools import groupby
from base import BaseMinifier
from minifier.minifier.tool.jsmin import jsmin
class Slimit(object):
def minify(self, content):
try:
minify = self._minify
except AttributeError:
from slimit import minify
self._minify = minify
... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,941 | hackaugusto/django_minifier | refs/heads/master | /minifier/parser/autoselect.py | from django.utils.functional import LazyObject
from django.utils.importlib import import_module
class AutoSelectParser(LazyObject):
options = ('minifier.parser.lxml.LxmlParser', 'minifier.parser.htmlparser')
def __init__(self):
self._wrapped = None
for parser in self.options:
try:... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,942 | hackaugusto/django_minifier | refs/heads/master | /minifier/templatetags/minify.py | from django import template
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from minifier.conf import settings
from minifier.minifier import Minifier
register = template.Library()
class MinifierNode(template.Node):
def __init__(self, nodelist, name=None):... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,943 | hackaugusto/django_minifier | refs/heads/master | /minifier/parser/base.py | from __future__ import absolute_import
import os.path
import urllib
import re
from django.core.files.storage import get_storage_class
try:
from staticfiles import finders
except ImportError:
from django.contrib.staticfiles import finders
from minifier.conf import settings
class ParserBase(object):
"""
... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,944 | hackaugusto/django_minifier | refs/heads/master | /minifier/handlers/base.py | import types
import re
from itertools import groupby
from django.core.files.base import ContentFile
from django.core.files.storage import get_storage_class
class MinifierBase(object):
def minify(self, elements):
raise NotImplementedError
def _call_minify(self, elements):
content = ''
... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,945 | hackaugusto/django_minifier | refs/heads/master | /minifier/handlers/css.py | from __future__ import absolute_import
from itertools import groupby
from minifier.handlers.base import MinifierBase
class Cssmin(object):
def minify(self, content):
try:
minify = self._minify
except AttributeError:
from cssmin import cssmin
self._minify = cssm... | {"/minifier/handlers/comment.py": ["/minifier/handlers/base.py", "/minifier/minifier.py"], "/minifier/handlers/plain.py": ["/minifier/handlers/base.py"], "/minifier/parser/lxml.py": ["/minifier/parser/base.py"], "/minifier/minifier.py": ["/minifier/conf.py"], "/minifier/templatetags/minify.py": ["/minifier/conf.py", "/... |
41,946 | DMOON510/TreeHacks2020 | refs/heads/master | /museum.py | import random
import numpy as np
def recommend(galleries, visitor):
for i in range(len(visitor.preference)):
visitor.score[i]= 0.5 * len(galleries[i].visitors) + visitor.preference[galleries[i].name]
visitor.score_np[i] = np.asarray(visitor.score[i])
visitor.recommendation = visitor.score_np.argmax()
def lik... | {"/museumcreate.py": ["/museum.py"]} |
41,947 | DMOON510/TreeHacks2020 | refs/heads/master | /museumcreate.py |
from museum import *
import pandas as pd
gallery1= gallery(0,100)
gallery2 = gallery(1,50)
gallery3 = gallery(2, 25)
gallery4 = gallery(3, 80)
gallery5 = gallery(4, 50)
galleries = [gallery1, gallery2, gallery3, gallery4, gallery5]
cols = ['preference','score','recommendation']
lst = []
visitors = {}
for i in rang... | {"/museumcreate.py": ["/museum.py"]} |
41,958 | rnaimehaom/deepmol | refs/heads/master | /model/mpnn.py | import tensorflow as tf
import numpy as np
from .message_passing import MatrixMessagePassing, VectorMessagePassing, ConvFilterGenerator
from .update_function import GRUUpdate
from .read_out import Set2Vec, ConcatReadOut
from .fc_nn import FullyConnectedNN
from .abstract_model import Model
class MPNN(Model):
"""Me... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,959 | rnaimehaom/deepmol | refs/heads/master | /model/molvae.py | from .mpnn import MPNN
import numpy as np
from scipy.special import comb
import tensorflow as tf
from .fc_nn import FullyConnectedNN
from data.molecules import TFMolBatch
class MolVAE:
"""A molecular geometry-based variational autoencoder.
Also usable as autoencoder by setting the hyperparameter "variational... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,960 | rnaimehaom/deepmol | refs/heads/master | /data/molecules.py | import numpy as np
import tensorflow as tf
import logging
import pybel
from sklearn.manifold import MDS
class AbstractMol:
"""Abstract class for geometry-encoded molecules that offer internal format conversion.
The geometry can be represented by coordinates, distance matrix or a flattened vector of the relev... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,961 | rnaimehaom/deepmol | refs/heads/master | /model/read_out.py | import tensorflow as tf
from .abstract_model import Model
from .fc_nn import FullyConnectedNN
class Set2Vec(Model):
"""Implements the Set2Vec read-out, mapping the hidden states to a vector embedding of the entire molecule.
Additionally, multi-head attention is possible by setting hparams.set2vec_num_attenti... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,962 | rnaimehaom/deepmol | refs/heads/master | /train_mpnn.py | import logging
import tensorflow as tf
import argparse
from train_util import QM9Trainer, read_configs_and_train
from model.mpnn import MPNN
from data.featurizer import DistanceNumHFeaturizer
logging.basicConfig(format='%(levelname)s - %(message)s', level=logging.INFO)
class MPNNTrainer(QM9Trainer):
"""Extend QM... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,963 | rnaimehaom/deepmol | refs/heads/master | /tests/test_read_out.py | import tensorflow as tf
import numpy as np
from model.read_out import Set2Vec
HParams = tf.contrib.training.HParams
class TestSet2Vec(tf.test.TestCase):
def test_permutation_invariance(self):
"""Test whether the set2vec output is invariant to permutation of the input mols"""
num_atoms, batch_size... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,964 | rnaimehaom/deepmol | refs/heads/master | /tests/test_qm9_loader.py | import os
from data.qm9_loader import QM9Loader
import tensorflow as tf
import numpy as np
from data.featurizer import DistanceNumHFeaturizer
import numpy.testing as npt
class TestQM9Loader(tf.test.TestCase):
def test_data_set_generation(self):
properties = ['mu', 'alpha', 'Cv']
implicit_hydrogen... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,965 | rnaimehaom/deepmol | refs/heads/master | /data/featurizer.py | import numpy as np
import rdkit.Chem as Chem
class FeaturizedMolecule:
"""Molecule object holding all the relevant features.
:param atom_features: atom representations of dimension [num_atoms, num_atom_features]
:param interaction_matrix: matrix of atomic interactions shaped [num_atoms, num_atoms, num_in... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,966 | rnaimehaom/deepmol | refs/heads/master | /train_vae.py | import logging
import os
import tensorflow as tf
import numpy as np
import argparse
from train_util import QM9Trainer, read_configs_and_train
from model.molvae import MolVAE
from data.featurizer import DistanceFeaturizer
from data.molecules import NPMol
import pybel
import openbabel
logging.basicConfig(format='%(level... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,967 | rnaimehaom/deepmol | refs/heads/master | /data/qm9_loader.py | import numpy as np
import os
import rdkit.Chem as Chem
import tensorflow as tf
from .standardization import Standardization
class QM9Loader:
"""Provide the QM9 data set as a tf.data.Dataset, given an sdf file for molecules and csv file for labels.
:param data_dir: The directory containing the QM9 files *.sdf... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,968 | rnaimehaom/deepmol | refs/heads/master | /tests/test_featurizer.py | import numpy.testing as npt
import unittest
import rdkit.Chem as Chem
import os
import numpy as np
from data.featurizer import DistanceFeaturizer, DistanceNumHFeaturizer
max_num_atoms, max_num_atoms_h = 9, 29 # implicit hydrogen, explicit hydrogen
class TestDistanceFeaturizer(unittest.TestCase):
def setUp(self)... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,969 | rnaimehaom/deepmol | refs/heads/master | /model/update_function.py | import tensorflow as tf
from .abstract_model import Model
class GRUUpdate(Model):
"""Implements the GRU Update function to update the hidden states based on their incoming messages.
:param hparams: hyperparameters, as a tf.contrib.training.HParams object
"""
def __init__(self, hparams):
supe... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,970 | rnaimehaom/deepmol | refs/heads/master | /train_util.py | import os
import logging
import tensorflow as tf
import numpy as np
import time
import copy
from datetime import timedelta
from data.qm9_loader import QM9Loader
from data.molecules import TFMolBatch
class CurveSmoother:
"""This class imitates the behavior of the TensorBoard smoothing slider by performing a runnin... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,971 | rnaimehaom/deepmol | refs/heads/master | /tests/test_standardization.py | import unittest
import numpy as np
import numpy.testing as npt
from data.standardization import Standardization
class TestStandardization(unittest.TestCase):
example_data = np.arange(12).reshape(3, 4) ** 2
example_data_2 = np.arange(1, 13).reshape(3, 4) ** 2
def test_initialization(self):
standar... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,972 | rnaimehaom/deepmol | refs/heads/master | /model/abstract_model.py | import tensorflow as tf
class Model:
"""Abstract superclass for reusable models using weight sharing with tf.make_template.
Subclasses implementing the _forward() method can then be called using .forward().
:param hparams: hyperparameters, as a tf.contrib.training.HParams object
"""
def __init__(... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,973 | rnaimehaom/deepmol | refs/heads/master | /model/message_passing.py | import tensorflow as tf
from .abstract_model import Model
import numpy as np
from .fc_nn import FullyConnectedNN
class ConvFilterGenerator(Model):
"""A model mapping each interatomic distance value to a matrix or vector as the basis for message generation.
Message generation works similar to regular convolut... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,974 | rnaimehaom/deepmol | refs/heads/master | /data/standardization.py | import numpy as np
class Standardization:
"""Define a standardization operation that can be applied to different data sets.
We would like to standardize our training data to zero mean and unit variance. This transformation defines the
scales of our data. After standardizing the training set, every furthe... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,975 | rnaimehaom/deepmol | refs/heads/master | /model/fc_nn.py | import tensorflow as tf
from .abstract_model import Model
class FullyConnectedNN(Model):
"""A simple fully connected neural network
:param hparams: hyperparameters, as a tf.contrib.training.HParams object
:param layer_dims: list specifying the dimensions of hidden layers and output
:param activation:... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,976 | rnaimehaom/deepmol | refs/heads/master | /tests/test_pos_acc.py | import unittest
import os
import numpy as np
from train_vae import VAETrainer
import rdkit.Chem as Chem
from data.featurizer import DistanceFeaturizer
from data.molecules import NPMol
class TestPositionAccuracy(unittest.TestCase):
def test_atom_features(self):
data_dir = os.path.join(os.path.dirname(__fil... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,977 | rnaimehaom/deepmol | refs/heads/master | /tests/test_molecules.py | import tensorflow as tf
import numpy as np
import numpy.testing as npt
from data.molecules import TFMolBatch, NPMol
# sample molecules
coordinates = np.array([[[0, 0, 0], [1, 0, 0], [-1, 0, 0]],
[[0, 0, 0], [1, 1, 1], [1, 0, 0]]])
distance_matrix = np.array([[[0, 1, 1], [1, 0, 2], [1, 2, 0]],
... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,978 | rnaimehaom/deepmol | refs/heads/master | /tests/test_train_util.py | import unittest
import numpy.testing as npt
import os
from train_util import CurveSmoother, ConfigReader
import tensorflow as tf
class TestCurveSmoother(unittest.TestCase):
def test_smoothing_factor_range(self):
with self.assertRaises(ValueError):
CurveSmoother(-12)
with self.assertRai... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,979 | rnaimehaom/deepmol | refs/heads/master | /tests/test_molvae.py | import tensorflow as tf
from model.molvae import MolVAE
import numpy as np
from data.molecules import TFMolBatch
hparams = MolVAE.default_hparams()
hparams.set_hparam('batch_size', 1)
hparams.set_hparam('geometric_penalty_weight', 0.0)
class TestGeometricPenalty(tf.test.TestCase):
def test_geometric_penalty(self... | {"/model/mpnn.py": ["/model/message_passing.py", "/model/update_function.py", "/model/read_out.py", "/model/fc_nn.py", "/model/abstract_model.py"], "/model/molvae.py": ["/model/mpnn.py", "/model/fc_nn.py", "/data/molecules.py"], "/model/read_out.py": ["/model/abstract_model.py", "/model/fc_nn.py"], "/train_mpnn.py": ["... |
41,980 | shuohan/espreso | refs/heads/master | /tests/test_loss.py | #!/usr/bin/env python
import numpy as np
import torch
from ssp.loss import GANLoss, SmoothnessLoss, CenterLoss, BoundaryLoss
def test_loss():
x = np.ones([10, 1, 1]) * (-1)
gan_loss_func = GANLoss().cuda()
gan_loss = gan_loss_func(torch.tensor(x).cuda(), False)
ref = -np.log(1 - 1 / (1 + np.exp(-x))... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,981 | shuohan/espreso | refs/heads/master | /ssp/train.py | """Functions and classes to train the algorithm.
"""
import numpy as np
import torch
import torch.nn.functional as F
from collections.abc import Iterable
import matplotlib.pyplot as plt
from pathlib import Path
from enum import Enum
from pytorch_trainer.observer import SubjectObserver
from pytorch_trainer.train impor... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,982 | shuohan/espreso | refs/heads/master | /isbi/get_phantom_pics.py | #!/usr/bin/env python
import nibabel as nib
import numpy as np
from pathlib import Path
from PIL import Image
from image_processing_3d import quantile_scale
from scipy.ndimage import zoom
dirname = '/data/phantom/data'
basename = 'SUPERRES-ADNIPHANTOM_20200830_PHANTOM-T2-TSE-2D-CORONAL-PRE-ACQ1-4mm-gapn2mm_resampled... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,983 | shuohan/espreso | refs/heads/master | /isbi/calc_simu_error.py | #!/usr/bin/env python
import numpy as np
import pandas as pd
import nibabel as nib
from pathlib import Path
from skimage.metrics import peak_signal_noise_ratio as calc_psnr
from skimage.metrics import structural_similarity as calc_ssim
import matplotlib.pyplot as plt
from collections import OrderedDict
from psf_est.u... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,984 | shuohan/espreso | refs/heads/master | /isbi/get_simu_profiles.py | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
import matplotlib
from psf_est.utils import calc_fwhm
def plot(est, ref, filename):
left = (len(est) - len(ref)) // 2
right = len(est) - len(ref) - left
ref = np.pad(ref, (left, right))
font = {'size... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,985 | shuohan/espreso | refs/heads/master | /tests/compare_conv1d_conv2d.py | #!/usr/bin/env python
import torch
class PermConv(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv = torch.nn.Conv1d(64, 256, 3, bias=False)
def forward(self, x):
nb, nc, nx, ny = x.shape
output = x.permute(0, 2, 1, 3)
output = output.reshape(nb * nx... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,986 | shuohan/espreso | refs/heads/master | /tests/test_networks.py | #!/usr/bin/env python
import torch
from pathlib import Path
from pytorchviz import make_dot
from ssp.network import KernelNet1d, KernelNet2d
from ssp.network import LowResDiscriminator1d, LowResDiscriminator2d
def test_networks():
dirname = Path('results_networks')
dirname.mkdir(exist_ok=True)
patch1d ... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,987 | shuohan/espreso | refs/heads/master | /ssp/utils.py | import torch
import numpy as np
from scipy.interpolate import interp1d
from torch.nn.functional import interpolate
def calc_patch_size(patch_size, scale_factor, nz):
"""Calculates the patch size.
Args:
patch_size (int): The size of the low-resolution patches.
scale_factor (float): The scale f... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,988 | shuohan/espreso | refs/heads/master | /scripts/compare_kernel.py | #!/usr/bin/env python
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input-kernel', help='Input image.')
parser.add_argument('-r', '--reference-kernel', help='Input image.')
parser.add_argument('-o', '--output-filename', help='Output directory.')
args = parser.parse_args()
import nu... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
41,989 | shuohan/espreso | refs/heads/master | /ssp/network.py | import torch
import numpy as np
from torch import nn
import torch.nn.functional as F
from .config import Config
class Clamp(nn.Module):
def __init__(self, min, max):
super().__init__()
self.min = min
self.max = max
def forward(self, x):
return torch.clamp(x, self.min, self.max... | {"/tests/test_loss.py": ["/ssp/loss.py"], "/ssp/train.py": ["/ssp/config.py", "/ssp/loss.py", "/ssp/utils.py"], "/tests/test_networks.py": ["/ssp/network.py"], "/scripts/compare_kernel.py": ["/ssp/utils.py"], "/ssp/network.py": ["/ssp/config.py"], "/tests/test_fwhm.py": ["/ssp/utils.py"], "/tests/test_kernel.py": ["/ss... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.