index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
16,198 | rongliangzi/CrowdCountingBaseline | refs/heads/master | /utils/functions.py | import torch
import logging
import torch.nn as nn
import numpy as np
import math
from .pytorch_ssim import *
import torch.nn.functional as F
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
... | {"/modeling/__init__.py": ["/modeling/utils.py", "/modeling/m_vgg.py", "/modeling/Res50_C3.py", "/modeling/sanet.py", "/modeling/csrnet.py", "/modeling/u_vgg.py"], "/modeling/csrnet.py": ["/modeling/utils.py"], "/modeling/Res50_C3.py": ["/modeling/utils.py"], "/modeling/u_vgg.py": ["/modeling/utils.py"], "/train_generi... |
16,199 | rongliangzi/CrowdCountingBaseline | refs/heads/master | /modeling/sanet.py | import torch.nn as nn
import torch.nn.functional as F
def ConvINReLU(cfg, in_planes):
layers = []
for c in cfg:
if len(c)==2:
plane, k = c
layers += [nn.Conv2d(in_planes, plane, k, padding=(k-1)//2), nn.InstanceNorm(plane, affine=True), nn.ReLU(True)]
in_planes = pla... | {"/modeling/__init__.py": ["/modeling/utils.py", "/modeling/m_vgg.py", "/modeling/Res50_C3.py", "/modeling/sanet.py", "/modeling/csrnet.py", "/modeling/u_vgg.py"], "/modeling/csrnet.py": ["/modeling/utils.py"], "/modeling/Res50_C3.py": ["/modeling/utils.py"], "/modeling/u_vgg.py": ["/modeling/utils.py"], "/train_generi... |
16,200 | rongliangzi/CrowdCountingBaseline | refs/heads/master | /modeling/Res50_C3.py | import torch.nn as nn
import torch
from torchvision import models
from .utils import *
import torch.nn.functional as F
def initialize_weights(models):
for model in models:
real_init_weights(model)
def real_init_weights(m):
if isinstance(m, list):
for mini_m in m:
real_init_wei... | {"/modeling/__init__.py": ["/modeling/utils.py", "/modeling/m_vgg.py", "/modeling/Res50_C3.py", "/modeling/sanet.py", "/modeling/csrnet.py", "/modeling/u_vgg.py"], "/modeling/csrnet.py": ["/modeling/utils.py"], "/modeling/Res50_C3.py": ["/modeling/utils.py"], "/modeling/u_vgg.py": ["/modeling/utils.py"], "/train_generi... |
16,201 | rongliangzi/CrowdCountingBaseline | refs/heads/master | /modeling/u_vgg.py | import torch.nn as nn
import torch
import numpy as np
import torch.nn.functional as F
from .utils import *
class U_VGG(nn.Module):
def __init__(self, load_model='', downsample=1, bn=False, NL='swish', objective='dmp', sp=False, se=True, pyramid=''):
super(U_VGG, self).__init__()
self.downsample = ... | {"/modeling/__init__.py": ["/modeling/utils.py", "/modeling/m_vgg.py", "/modeling/Res50_C3.py", "/modeling/sanet.py", "/modeling/csrnet.py", "/modeling/u_vgg.py"], "/modeling/csrnet.py": ["/modeling/utils.py"], "/modeling/Res50_C3.py": ["/modeling/utils.py"], "/modeling/u_vgg.py": ["/modeling/utils.py"], "/train_generi... |
16,202 | rongliangzi/CrowdCountingBaseline | refs/heads/master | /train_generic.py | import torch
import torchvision
import torch.nn as nn
import os
import glob
from modeling import *
import torchvision.transforms as transforms
from torch.optim import lr_scheduler
from dataset import *
import torch.nn.functional as F
from utils.functions import *
from utils import pytorch_ssim
import argparse
from tqdm... | {"/modeling/__init__.py": ["/modeling/utils.py", "/modeling/m_vgg.py", "/modeling/Res50_C3.py", "/modeling/sanet.py", "/modeling/csrnet.py", "/modeling/u_vgg.py"], "/modeling/csrnet.py": ["/modeling/utils.py"], "/modeling/Res50_C3.py": ["/modeling/utils.py"], "/modeling/u_vgg.py": ["/modeling/utils.py"], "/train_generi... |
16,203 | rongliangzi/CrowdCountingBaseline | refs/heads/master | /modeling/m_vgg.py | import torch.nn as nn
import torch
import numpy as np
import torch.nn.functional as F
from .utils import *
class M_VGG(nn.Module):
def __init__(self, load_model='', downsample=1, bn=False, NL='swish', objective='dmp', sp=False, se=True, pyramid=''):
super(M_VGG, self).__init__()
self.downsample = ... | {"/modeling/__init__.py": ["/modeling/utils.py", "/modeling/m_vgg.py", "/modeling/Res50_C3.py", "/modeling/sanet.py", "/modeling/csrnet.py", "/modeling/u_vgg.py"], "/modeling/csrnet.py": ["/modeling/utils.py"], "/modeling/Res50_C3.py": ["/modeling/utils.py"], "/modeling/u_vgg.py": ["/modeling/utils.py"], "/train_generi... |
16,215 | rdarekar/selenium-python-framework | refs/heads/master | /tests/conftest.py | import pytest
from selenium import webdriver
from base.webdriverfactory import WebDriverFactory
from pages.home.login_page import LoginPage
@pytest.yield_fixture()
def setUp():
print("Running method level setUp")
yield
print("Running method level tearDown")
@pytest.yield_fixture(scope="class")
def oneTime... | {"/tests/courses/register_courses_csv_data.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_multiple_data_set.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_tests.py": ["/pages/courses/register_courses_page.py"]} |
16,216 | rdarekar/selenium-python-framework | refs/heads/master | /tests/courses/register_courses_csv_data.py | from pages.home.login_page import LoginPage
from pages.courses.register_courses_page import RegisterCoursesPage
from utilities.teststatus import TestStatus
import unittest
import pytest
from ddt import ddt, data, unpack
from utilities.read_data import getCSVData
from pages.home.navigation_page import NavigationPage
@p... | {"/tests/courses/register_courses_csv_data.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_multiple_data_set.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_tests.py": ["/pages/courses/register_courses_page.py"]} |
16,217 | rdarekar/selenium-python-framework | refs/heads/master | /tests/courses/register_courses_multiple_data_set.py | from pages.home.login_page import LoginPage
from pages.courses.register_courses_page import RegisterCoursesPage
from utilities.teststatus import TestStatus
import unittest
import pytest
from ddt import ddt, data, unpack
@pytest.mark.usefixtures("oneTimeSetUp", "setUp")
@ddt
class RegisterMultipleCoursesTests(unittest.... | {"/tests/courses/register_courses_csv_data.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_multiple_data_set.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_tests.py": ["/pages/courses/register_courses_page.py"]} |
16,218 | rdarekar/selenium-python-framework | refs/heads/master | /pages/courses/register_courses_page.py | import utilities.custom_logger as cl
import logging
from base.basepage import BasePage
import time
class RegisterCoursesPage(BasePage):
log = cl.customLogger(logging.DEBUG)
def __init__(self, driver):
super().__init__(driver)
self.driver = driver
# Locators
_search_box = "//input[@id=... | {"/tests/courses/register_courses_csv_data.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_multiple_data_set.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_tests.py": ["/pages/courses/register_courses_page.py"]} |
16,219 | rdarekar/selenium-python-framework | refs/heads/master | /tests/courses/register_courses_tests.py | from pages.home.login_page import LoginPage
from pages.courses.register_courses_page import RegisterCoursesPage
from utilities.teststatus import TestStatus
import unittest
import pytest
@pytest.mark.usefixtures("oneTimeSetUp", "setUp")
class RegisterCoursesTests(unittest.TestCase):
@pytest.fixture(autouse=True)
... | {"/tests/courses/register_courses_csv_data.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_multiple_data_set.py": ["/pages/courses/register_courses_page.py"], "/tests/courses/register_courses_tests.py": ["/pages/courses/register_courses_page.py"]} |
16,221 | sukhpreetn/QuizApp | refs/heads/master | /AIP/migrations/0007_auto_20200403_2152.py | # Generated by Django 3.0.3 on 2020-04-03 21:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('AIP', '0006_trainee_attendance'),
]
operations = [
migrations.RenameField(
model_name='attendance',
old_name='register_time'... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,222 | sukhpreetn/QuizApp | refs/heads/master | /AIP/migrations/0004_result_c_email.py | # Generated by Django 3.0.3 on 2020-03-25 17:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AIP', '0003_auto_20200325_1353'),
]
operations = [
migrations.AddField(
model_name='result',
name='c_email',
... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,223 | sukhpreetn/QuizApp | refs/heads/master | /AIP/migrations/0003_auto_20200325_1353.py | # Generated by Django 3.0.3 on 2020-03-25 13:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AIP', '0002_result_c_quiz_name'),
]
operations = [
migrations.AddField(
model_name='result',
name='c_total_ans_corre... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,224 | sukhpreetn/QuizApp | refs/heads/master | /AIP/forms.py | from django.db import models
from django import forms
from .models import Question
class QuestionForm(forms.ModelForm):
class Meta:
model = Question
labels = {
'q_subject' : 'Subject',
'q_cat' : 'Category',
'q_rank' ... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,225 | sukhpreetn/QuizApp | refs/heads/master | /AIP/urls.py | from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.urls import path , include
from . import views
from django.views.generic.base import TemplateView # new
app_name = 'AIP'
urlpatterns = [
path('', views.index, name='index'),
path('pickskill... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,226 | sukhpreetn/QuizApp | refs/heads/master | /AIP/admin.py | from django.contrib import admin
from . models import Question , Answer,Result,Quiz,Attendance,Trainee_Attendance
# Register your models here.
admin.site.register(Question)
admin.site.register(Answer)
admin.site.register(Result)
admin.site.register(Quiz)
admin.site.register(Attendance)
admin.site.register(Trainee_Att... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,227 | sukhpreetn/QuizApp | refs/heads/master | /AIP/migrations/0006_trainee_attendance.py | # Generated by Django 3.0.3 on 2020-04-03 21:07
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AIP', '0005_attendance'),
]
operations = [
migrations.CreateModel(
name='Trainee_Attendance',
fields... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,228 | sukhpreetn/QuizApp | refs/heads/master | /AIP/models.py | from django.db import models
from datetime import datetime
# Create your models here.
class Attendance(models.Model):
trainer_name = models.CharField(max_length=200,default='')
trainee_emails = models.TextField(null=True)
expire_time = models.DateT... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,229 | sukhpreetn/QuizApp | refs/heads/master | /AIP/views.py | import datetime
from datetime import timedelta
import os
import pprint
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from smtplib import SMTP
from django.db.models import Count
import pandas as pd
from django.conf import settings
from django.http import HttpResponse,... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,230 | sukhpreetn/QuizApp | refs/heads/master | /AIP/migrations/0005_attendance.py | # Generated by Django 3.0.3 on 2020-04-03 18:25
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AIP', '0004_result_c_email'),
]
operations = [
migrations.CreateModel(
name='Attendance',
fields=[
... | {"/AIP/forms.py": ["/AIP/models.py"], "/AIP/admin.py": ["/AIP/models.py"], "/AIP/views.py": ["/AIP/models.py", "/AIP/forms.py"]} |
16,241 | jsharples/usgs_nwis | refs/heads/master | /usgs_nwis/usgs_nwis.py |
__all__ = ['SitesQuery', 'BaseQuery', 'DataBySites']
from urllib import parse, request
import json
from datetime import datetime, timedelta
import gzip
import io
class pyUSGSError(Exception):
pass
class BaseQuery(object):
"""
The basic query class to access the USGS water data service
Par... | {"/usgs_nwis/__init__.py": ["/usgs_nwis/usgs_nwis.py"]} |
16,242 | jsharples/usgs_nwis | refs/heads/master | /usgs_nwis/__init__.py |
from .usgs_nwis import *
| {"/usgs_nwis/__init__.py": ["/usgs_nwis/usgs_nwis.py"]} |
16,243 | Anarchid/uberserver | refs/heads/master | /server.py | #!/usr/bin/env python
# coding=utf-8
try:
import thread
except:
# thread was renamed to _thread in python 3
import _thread
import traceback, signal, socket, sys
try:
from urllib2 import urlopen
except:
# The urllib2 module has been split across several modules in Python 3.0
from urllib.request import urlopen
... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,244 | Anarchid/uberserver | refs/heads/master | /SayHooks.py | import inspect, sys, os, types, time, string
_permissionlist = ['admin', 'adminchan', 'mod', 'modchan', 'chanowner', 'chanadmin', 'chanpublic', 'public', 'battlehost', 'battlepublic']
_permissiondocs = {
'admin':'Admin Commands',
'adminchan':'Admin Commands (channel)',
'mod':'Moderator Commands',
... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,245 | Anarchid/uberserver | refs/heads/master | /ip2country.py | from pygeoip import pygeoip
import traceback
dbfile = 'GeoIP.dat'
def update():
gzipfile = dbfile + ".gz"
f = open(gzipfile, 'w')
dburl = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz'
import urllib2
import gzip
print("Downloading %s ..." %(dburl))
response = urllib2.urlopen(d... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,246 | Anarchid/uberserver | refs/heads/master | /protocol/Channel.py | from AutoDict import AutoDict
import time
class Channel(AutoDict):
def __init__(self, root, name, id = 0, users=[], admins=[],
ban={}, allow=[], autokick='ban', chanserv=False,
owner='', mutelist={}, antispam=False,
censor=False, antishock=False, topic=None,
key=None, history=False, **kwargs):... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,247 | Anarchid/uberserver | refs/heads/master | /protocol/Battle.py | from AutoDict import AutoDict
class Battle(AutoDict):
def __init__(self, root, id, type, natType, password, port, maxplayers,
hashcode, rank, maphash, map, title, modname,
passworded, host, users, spectators=0,
startrects={}, disabled_units=[], pending_users=set(),
authed_users=set(), bots={},... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,248 | Anarchid/uberserver | refs/heads/master | /XmlRpcServer.py | #
# xmlrpc class for auth of replays.springrts.com
#
# TODO:
# - remove dependency to Protocol.py
# - move SQLAlchemy calls to SQLUsers.py
# -> remove _FakeClient
import BaseHTTPServer
from SimpleXMLRPCServer import SimpleXMLRPCServer
from base64 import b64encode
import os.path
import logging
from logging.handlers ... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,249 | Anarchid/uberserver | refs/heads/master | /pygeoip/__init__.py | # pygeoip from https://code.google.com/p/python-geoip/
| {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,250 | Anarchid/uberserver | refs/heads/master | /Multiplexer.py | import time
from select import * # eww hack but saves the other hack of selectively importing constants
class EpollMultiplexer:
def __init__(self):
self.filenoToSocket = {}
self.socketToFileno = {}
self.sockets = set([])
self.output = set([])
self.inMask = EPOLLIN | EPOLLPRI
self.outMask = EPOLLOUT
se... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,251 | Anarchid/uberserver | refs/heads/master | /Client.py | import socket, time, sys, thread, ip2country, errno
from collections import defaultdict
from BaseClient import BaseClient
import CryptoHandler
from CryptoHandler import encrypt_sign_message
from CryptoHandler import decrypt_auth_message
from CryptoHandler import int32_to_str
from CryptoHandler import str_to_int32
f... | {"/server.py": ["/Client.py", "/XmlRpcServer.py", "/ip2country.py"], "/ip2country.py": ["/pygeoip/__init__.py"]} |
16,262 | IvannLovich/todoList-API | refs/heads/master | /todo/tests.py | from django.test import TestCase
from django.test import Client
from .models import Folder
client = Client()
class MainEndpointsTestCase(TestCase):
def test_folder_endpoint(self):
response = client.get('/api/todo/folders/')
self.assertEqual(response.status_code, 200)
self.assertEqual(resp... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,263 | IvannLovich/todoList-API | refs/heads/master | /users/urls.py | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import UserViewSet
router = DefaultRouter()
router.register('', UserViewSet, basename='users')
urlpatterns = router.urls
urlpatterns = [
path('', include(router.urls)),
]
| {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,264 | IvannLovich/todoList-API | refs/heads/master | /users/tests.py | from django.test import TestCase
from django.test import Client
from .models import User
client = Client()
class UserEndpointTestCase(TestCase):
def test_user_endpoint(self):
response = client.get('/api/users/')
self.assertEqual(response.status_code, 200)
self.assertEqual(response['conten... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,265 | IvannLovich/todoList-API | refs/heads/master | /todo/views.py | from rest_framework import serializers
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from .serializers import TaskSerializer, FolderSerializer
from .models import Task, Folder
class FolderViewSet(viewsets.ModelViewSet):
serializer_class = FolderSerializer
qu... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,266 | IvannLovich/todoList-API | refs/heads/master | /todo/serializers.py | from rest_framework import serializers
from .models import Task, Folder
from users.models import User
from users.serializers import UserSerializer
class FolderSerializer(serializers.ModelSerializer):
user = UserSerializer(read_only=True)
user_id = serializers.PrimaryKeyRelatedField(
write_only=True, q... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,267 | IvannLovich/todoList-API | refs/heads/master | /todo/urls.py | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import TaskViewSet, FolderViewSet
router = DefaultRouter()
router.register('folders', FolderViewSet, basename='folders')
router.register('tasks', TaskViewSet, basename='tasks')
urlpatterns = router.urls
urlpatterns ... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,268 | IvannLovich/todoList-API | refs/heads/master | /users/models.py | from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
email = models.EmailField(
'email address',
unique=True,
error_messages={
'unique': 'A user with that email is already exists.'
}
)
... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,269 | IvannLovich/todoList-API | refs/heads/master | /todo/models.py | from django.db import models
class Folder(models.Model):
name = models.TextField(max_length=100)
user = models.ForeignKey('users.User', related_name='folders', on_delete=models.CASCADE)
def __repr__(self):
return self.name
class Task(models.Model):
title = models.CharField(max_length=100)
... | {"/todo/tests.py": ["/todo/models.py"], "/users/tests.py": ["/users/models.py"], "/todo/views.py": ["/todo/serializers.py", "/todo/models.py"], "/todo/serializers.py": ["/todo/models.py", "/users/models.py"], "/todo/urls.py": ["/todo/views.py"]} |
16,275 | ATOM1Z3R/Mp3Player | refs/heads/master | /Models.py | try:
from sqlalchemy import Integer, String, Column, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker, backref
from sqlalchemy import create_engine
except ImportError:
print("sqlalchemy module is required")
exit()
Base = de... | {"/audiolib.py": ["/settingslib.py"], "/settingslib.py": ["/Models.py"], "/playlistlib.py": ["/Models.py"], "/AtomPlayer.py": ["/Models.py", "/playlistlib.py", "/audiolib.py", "/settingslib.py"]} |
16,276 | ATOM1Z3R/Mp3Player | refs/heads/master | /audiolib.py | try:
from pydub import AudioSegment
from pydub.playback import play
except ImportError:
print("pydub and simpleaudio module is required")
print("ffmpeg app is required")
exit()
try:
from tqdm import tqdm
except ImportError:
print("tqdm module is required")
exit()
try:
import keyboard... | {"/audiolib.py": ["/settingslib.py"], "/settingslib.py": ["/Models.py"], "/playlistlib.py": ["/Models.py"], "/AtomPlayer.py": ["/Models.py", "/playlistlib.py", "/audiolib.py", "/settingslib.py"]} |
16,277 | ATOM1Z3R/Mp3Player | refs/heads/master | /settingslib.py | from Models import *
session = dbconnect()
def getVolume():
volume = session.query(Settings).first()
return volume.volume
def setVolume(value):
if value < 101 and value > 0:
if value == 50:
vol = 0
else:
vol = value - 50
volume = session.query(Settings).fir... | {"/audiolib.py": ["/settingslib.py"], "/settingslib.py": ["/Models.py"], "/playlistlib.py": ["/Models.py"], "/AtomPlayer.py": ["/Models.py", "/playlistlib.py", "/audiolib.py", "/settingslib.py"]} |
16,278 | ATOM1Z3R/Mp3Player | refs/heads/master | /playlistlib.py | from Models import *
from os.path import isfile, join
from os import listdir
session = dbconnect()
def listPlayList():
list_pl = session.query(PlayList).all()
return list_pl
def createPlayList(plname):
playList = PlayList(name=plname)
session.add(playList)
session.commit()
added = session.que... | {"/audiolib.py": ["/settingslib.py"], "/settingslib.py": ["/Models.py"], "/playlistlib.py": ["/Models.py"], "/AtomPlayer.py": ["/Models.py", "/playlistlib.py", "/audiolib.py", "/settingslib.py"]} |
16,279 | ATOM1Z3R/Mp3Player | refs/heads/master | /AtomPlayer.py | # simpleaudio and ffmpeg required
from Models import *
from playlistlib import *
from audiolib import *
from settingslib import setVolume
from os import listdir, system
from os.path import isdir
import sys
import getopt
def usage():
print("""AtomPlayer
Usage: atomplayer.py -p [playlist_id/catalog/audio_file]
... | {"/audiolib.py": ["/settingslib.py"], "/settingslib.py": ["/Models.py"], "/playlistlib.py": ["/Models.py"], "/AtomPlayer.py": ["/Models.py", "/playlistlib.py", "/audiolib.py", "/settingslib.py"]} |
16,280 | ckw1140/bert | refs/heads/main | /tests/test_bert.py | import torch
from model.bert import BERT, BERTPretrain
from model.config import Config
def test_bert():
config = Config.load("./tests/config.json")
batch_size = 8
inputs = torch.randint(config.vocab_size, (batch_size, config.sequence_length))
segments = torch.randint(2, (batch_size, config.sequence_l... | {"/tests/test_bert.py": ["/model/bert.py"], "/model/bert.py": ["/model/layers.py"], "/model/layers.py": ["/model/utils.py"], "/tests/test_layers.py": ["/model/layers.py", "/model/utils.py"]} |
16,281 | ckw1140/bert | refs/heads/main | /model/bert.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from model.layers import Encoder
class BERT(nn.Module):
def __init__(self, config):
super(BERT, self).__init__()
self.config = config
self.encoder = Encoder(config)
self.linear = nn.Linear(config.hidden_dim, confi... | {"/tests/test_bert.py": ["/model/bert.py"], "/model/bert.py": ["/model/layers.py"], "/model/layers.py": ["/model/utils.py"], "/tests/test_layers.py": ["/model/layers.py", "/model/utils.py"]} |
16,282 | ckw1140/bert | refs/heads/main | /model/layers.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from model.utils import gelu, get_attention_pad_mask
class ScaledDotProductAttention(nn.Module):
def __init__(self, config):
super(ScaledDotProductAttention, self).__init__()
self.config = config
self.dropout = nn.Dropout(... | {"/tests/test_bert.py": ["/model/bert.py"], "/model/bert.py": ["/model/layers.py"], "/model/layers.py": ["/model/utils.py"], "/tests/test_layers.py": ["/model/layers.py", "/model/utils.py"]} |
16,283 | ckw1140/bert | refs/heads/main | /tests/test_layers.py | import torch
from model.config import Config
from model.layers import (
ScaledDotProductAttention,
MultiHeadAttention,
FeedForward,
EncoderLayer,
Encoder,
)
from model.utils import get_attention_pad_mask
def test_scaled_dot_product_attention():
config = Config.load("./tests/config.json")
... | {"/tests/test_bert.py": ["/model/bert.py"], "/model/bert.py": ["/model/layers.py"], "/model/layers.py": ["/model/utils.py"], "/tests/test_layers.py": ["/model/layers.py", "/model/utils.py"]} |
16,284 | ckw1140/bert | refs/heads/main | /model/utils.py | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def gelu(inputs: torch.Tensor):
"""
https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_tf_gpt2.py
를 참고하여 작성하였습니다.
"""
cdf = 0.5 * (1.0 + torch.tanh((np.sqrt(2 / np.pi) * (inputs + 0... | {"/tests/test_bert.py": ["/model/bert.py"], "/model/bert.py": ["/model/layers.py"], "/model/layers.py": ["/model/utils.py"], "/tests/test_layers.py": ["/model/layers.py", "/model/utils.py"]} |
16,285 | Teszko/dlfninja | refs/heads/master | /dlfninja/audio.py |
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst
player = None
playing = False
def on_tag(bus, msg):
taglist = msg.parse_tag()
print('on_tag:')
for key in taglist.keys():
print('\t%s = %s' % (key, taglist[key]))
def init_player():
global player
Gst.init([])
... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,286 | Teszko/dlfninja | refs/heads/master | /dlfninja/helpers.py | # coding=utf-8
import pickle
import requests
XPATH_URL_OVERVIEW = '//ul/li/a[text()="Nachhören"]/@href'
XPATH_DATE_OVERVIEW = '//span[@class="date"]/text()'
XPATH_NAME_OVERVIEW = '//h3/text()'
def write_page_content_to_file(file, page_content):
with open(file, 'wb') as f:
pickle.dump(page_content, f)... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,287 | Teszko/dlfninja | refs/heads/master | /dlfninja/core.py | import os.path
from lxml import html, etree
from dlfninja.episode import Episode
from dlfninja.helpers import xpath_query, query_url_overview, query_date_overview, \
query_name_overview, get_page_from_file, request_page_content, write_page_content_to_file, \
query_name_episode, query_url_episode
from dlfninja... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,288 | Teszko/dlfninja | refs/heads/master | /dlfninja/program.py | class Program:
name = 'unknown'
url = None
date = None
details = None
id = None
episodes = []
disabled = False
def __init__(self, name=None, id=None):
if name is not None:
self.name = name
self.id = id
def __str__(self):
return "<id=\"%d\" name=\... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,289 | Teszko/dlfninja | refs/heads/master | /dlfninja.py | import curses
import dlfninja.core as dlf
import dlfninja.curses as dlfcurses
import dlfninja.audio as audio
def main(stdscr):
stdscr.keypad(True)
curses.init_pair(1, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
stdscr.clear()
scr_height = ... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,290 | Teszko/dlfninja | refs/heads/master | /dlfninja/curses.py | import curses
from dlfninja.core import get_page_tree, update_episode_list
import dlfninja.audio as audio
BANNER = """
______ _____ ________ ____ _____ _____ ____ _____ _____ _
|_ _ `.|_ _| |_ __ | |_ \|_ _||_ _||_ \|_ _| |_ _| / \
| | `. \ | | | |_ \_... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,291 | Teszko/dlfninja | refs/heads/master | /dlfninja/episode.py | class Episode:
name = None
date = None
url = None
id = None
length = None
author = None
available_until = None
program = None
def __init__(self, name=None, id=None):
if name is not None:
self.name = name
self.id = id
def __str__(self):
return... | {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,292 | Teszko/dlfninja | refs/heads/master | /dlfninja/input.py | def handle_input(c):
pass
| {"/dlfninja/core.py": ["/dlfninja/episode.py", "/dlfninja/helpers.py", "/dlfninja/program.py"], "/dlfninja.py": ["/dlfninja/core.py", "/dlfninja/curses.py", "/dlfninja/audio.py"], "/dlfninja/curses.py": ["/dlfninja/core.py", "/dlfninja/audio.py"]} |
16,303 | filwaitman/jinja2-standalone-compiler | refs/heads/master | /jinja2_standalone_compiler/__init__.py | from __future__ import unicode_literals, print_function
import argparse
import fnmatch
import imp
import os
import re
import sys
from jinja2 import Environment, FileSystemLoader, StrictUndefined, defaults
try:
from colorama import init, Fore, Style
init(autoreset=True)
using_colorama = True
style_JIN... | {"/tests/test_jinja_standalone_compiler.py": ["/jinja2_standalone_compiler/__init__.py"]} |
16,304 | filwaitman/jinja2-standalone-compiler | refs/heads/master | /tests/test_jinja_standalone_compiler.py | from __future__ import unicode_literals
from collections import namedtuple
import fnmatch
import os
import unittest
from jinja2 import UndefinedError
from jinja2_standalone_compiler import main
fixtures_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fixtures')
class MainTestCase(unittest.TestCase... | {"/tests/test_jinja_standalone_compiler.py": ["/jinja2_standalone_compiler/__init__.py"]} |
16,305 | filwaitman/jinja2-standalone-compiler | refs/heads/master | /setup.py | from setuptools import setup
VERSION = '1.3.1'
setup(
name='jinja2_standalone_compiler',
packages=['jinja2_standalone_compiler', ],
version=VERSION,
author='Filipe Waitman',
author_email='filwaitman@gmail.com',
install_requires=[x.strip() for x in open('requirements.txt').readlines()],
ur... | {"/tests/test_jinja_standalone_compiler.py": ["/jinja2_standalone_compiler/__init__.py"]} |
16,306 | filwaitman/jinja2-standalone-compiler | refs/heads/master | /settings_example.py | # -*- coding: utf-8 -*-
# Which templates don't you want to generate? (You can use regular expressions here!)
# Use strings (with single or double quotes), and separate each template/regex in a line terminated with a comma.
IGNORE_JINJA_TEMPLATES = [
'.*base.jinja',
'.*tests/.*'
]
# Here you can override the ... | {"/tests/test_jinja_standalone_compiler.py": ["/jinja2_standalone_compiler/__init__.py"]} |
16,322 | LuennyEvelly/Projeto_Flask | refs/heads/master | /venv/views.py | from flask import render_template, request, redirect, session, flash, url_for
from models import Carro
from venv.carro import app, db
from dao import CarroDao, UsuarioDao
carro_dao = CarroDao(db)
usuario_dao = UsuarioDao(db)
@app.route('/')
def index():
return render_template('lista.html',titulo='carro', carros=c... | {"/venv/views.py": ["/venv/carro.py"]} |
16,323 | LuennyEvelly/Projeto_Flask | refs/heads/master | /venv/models.py | class Carro:
def _init_(self, marca, modelo, cor, combustivel, ano, id = None):
self.id = id
self.marca = marca
self.modelo = modelo
self.cor = cor
self.combustivel = combustivel
self.ano = ano
class Usuario:
def _init_(self, id, nome, senha):
self.id = i... | {"/venv/views.py": ["/venv/carro.py"]} |
16,324 | LuennyEvelly/Projeto_Flask | refs/heads/master | /venv/dao.py | from models import Carro, Usuario
import psycopg2.extras
SQL_DELETA_CARRO = 'delete from carro where id = %s'
SQL_CARRO_POR_ID = 'SELECT id,marca, modelo, cor, combustivel, ano from carro where id = %s'
SQL_USUARIO_POR_ID = 'SELECT id, nome, senha from usuario where id = %s'
SQL_ATUALIZA_CARRO = 'UPDATE carro SET mar... | {"/venv/views.py": ["/venv/carro.py"]} |
16,325 | LuennyEvelly/Projeto_Flask | refs/heads/master | /venv/carro.py | from flask import Flask
import psycopg2
app = Flask(_name_)
app.secret_key = '4intin'
db = psycopg2.connect(database='carros', user='postgres', password='postgres', host='127.0.0.1')
from views import *
if _name_ == '_main_':
app.run(debug=True) | {"/venv/views.py": ["/venv/carro.py"]} |
16,326 | he-xu/TransferRNN | refs/heads/master | /run_rnn_in_ctxctl.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 14 22:23:18 2019
@author: dzenn
"""
#import TransferRNN.run_rnn_in_ctxctl
import sys
sys.path.append('/home/dzenn/anaconda3/envs/ctxctl/lib/python3.7/site-packages')
from TransferRNN.MainRNNLoop import MainRNNLoop
from TransferRNN.bias_tuning_too... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,327 | he-xu/TransferRNN | refs/heads/master | /force.py | def ternarize(w_new, cam_num):
w_order = np.argsort(np.abs(w_new.T), axis=0)
w_sorted = w_new.T[w_order, np.arange(w_order.shape[1])]
w_sorted[:-cam_num, :]=0
w_order_order = np.argsort(w_order, axis=0)
w_undone = w_sorted[w_order_order, np.arange(w_order_order.shape[1])].T
w_undone[w_undone>0] ... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,328 | he-xu/TransferRNN | refs/heads/master | /NeuronNeuronConnector.py | import CtxDynapse
class DynapseConnector:
"""
Connector for DYNAP-se chip
"""
def __init__(self):
"""
Initialize the class with empty connections
sending_connections_to: map of (key, value), where key is the neuron sending connection and value is a list of all connections that... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,329 | he-xu/TransferRNN | refs/heads/master | /MainRNNLoop.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 15:21:22 2019
@author: dzenn
"""
#exec(open("MainRNNLoop.py").read())
try:
from DynapseRNN import DynapseRNN
from matplotlib import pyplot as plt
from random import sample
from IPython import get_ipython
get_ipython().run_l... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,330 | he-xu/TransferRNN | refs/heads/master | /bias_tuning_tools.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 22 12:51:51 2018
Set of tools to simplify the bias tuning process of the DYNAP-SE chip
using aiCTX's cortexcontrol.
Load and instantiate Bias Tuning Tools (BiTTs) in cortexcontrol console:
>>> import bias_tuning_tools
>>> bt = bias_tuning_t... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,331 | he-xu/TransferRNN | refs/heads/master | /run_rnn_with_rpyc.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 14 23:45:13 2019
@author: dzenn
"""
#import PyCtxUtils; PyCtxUtils.start_rpyc_server()
import MainRNNLoop
import rpyc
print("Successful import")
self_path = MainRNNLoop.__file__
self_path = self_path[0:self_path.rfind('/')]
execute_bias_load_str... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,332 | he-xu/TransferRNN | refs/heads/master | /ctxctl_rate_tracker.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 5 19:14:16 2019
@author: dzenn
"""
import CtxDynapse
from time import time
class RateTracker(object):
def __init__(self, neuron_ids, lookup, timesteps, debug = False):
self.timesteps = timesteps
self.neuron_ids = neu... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,333 | he-xu/TransferRNN | refs/heads/master | /DynapseRNN.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 22 16:09:09 2019
@author: dzenn
"""
from time import clock, sleep, time
from math import exp
try:
import CtxDynapse
import NeuronNeuronConnector
from CtxDynapse import DynapseCamType as SynapseType
except ModuleNotFoundError:
impo... | {"/MainRNNLoop.py": ["/DynapseRNN.py"], "/bias_tuning_tools.py": ["/NeuronNeuronConnector.py"], "/run_rnn_with_rpyc.py": ["/MainRNNLoop.py"], "/DynapseRNN.py": ["/NeuronNeuronConnector.py"]} |
16,334 | maeof/ScrapeNewsAgencies | refs/heads/master | /ContentScraper.py | import abc
import ScraperHelper as helper
from bs4 import BeautifulSoup
import json
from urllib.parse import urlparse
from datetime import date, datetime
import re
class ContentScraperAbstract(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def getArticleDatePublished(self):
"""Requi... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,335 | maeof/ScrapeNewsAgencies | refs/heads/master | /Scripts/ScrapeIt.py | from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from bs4 import BeautifulSoup
import urllib3 as urllib
import sys
import os
from datetime import datetime
def getCurrentDateTime():
now = datetime.now()
return now.strftime("%d_%m_%Y_%H_%M_%S")
def createW... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,336 | maeof/ScrapeNewsAgencies | refs/heads/master | /ParallelTest.py | import multiprocessing
from joblib import Parallel, delayed
from tqdm import tqdm
import time
def myfunction(i, parameters):
time.sleep(4)
print(i)
return i
num_cores = multiprocessing.cpu_count()
print(num_cores)
myList = ["a", "b", "c", "d"]
parameters = ["param1", "param2"]
inputs = tqdm(myList)
if _... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,337 | maeof/ScrapeNewsAgencies | refs/heads/master | /driverWrapper.py | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time
service = Service('c:\\data\\chromedriver\\chromedriver.exe')
service.start()
cdi = webdriver.Remote(service.service_url)
cdi.get('http://www.google.com/');
time.sleep(5) # Let the user actually see something!
cdi.quit() | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,338 | maeof/ScrapeNewsAgencies | refs/heads/master | /AnalyzeLinks.py | import ScraperHelper as helper
from ContentFetcher import FileContentFetcher, HttpContentFetcher
from ContentScraper import ContentScraperAbstract, FifteenContentScraper, DelfiContentScraper, LrytasContentScraper
import os
import multiprocessing
from joblib import Parallel, delayed
from tqdm import tqdm
import csv
im... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,339 | maeof/ScrapeNewsAgencies | refs/heads/master | /test.py | from urllib.parse import urlparse
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
import os
from datetime import datetime
from bs4 import BeautifulSoup
def httpget(url):
"""
Attempts to get the content at `url` by making an HTTP GET request.
If the c... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,340 | maeof/ScrapeNewsAgencies | refs/heads/master | /ContentFetcher.py | import abc
from urllib.parse import urlparse
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from os import listdir
from os.path import isfile, join
class ContentFetcherAbstract(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def getWor... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,341 | maeof/ScrapeNewsAgencies | refs/heads/master | /LinkScraper.py | import abc
from datetime import date, timedelta
import time
from urllib.parse import urlparse
from bs4 import BeautifulSoup
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import ... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,342 | maeof/ScrapeNewsAgencies | refs/heads/master | /GetLinks.py | from LinkScraper import FifteenLinkScraper, DelfiLinkScraper, LrytasLinkScraper
import ScraperHelper as helper
from datetime import date
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import multiprocessing
from joblib import Parallel, delayed
from tqdm import tqdm
class Si... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,343 | maeof/ScrapeNewsAgencies | refs/heads/master | /ScraperHelper.py | import os
from datetime import datetime
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
def getCurrentDateTime():
now = datetime.now()
return now.strftime("%d_%m_%Y_%H_%M_%S")
def createWorkSessionFolder(createInPath):
createdFolder = createInPat... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,344 | maeof/ScrapeNewsAgencies | refs/heads/master | /regex.py | import re
print(re.findall( r'all (.*?) are', 'all cats are smarter than dogs, all dogs are dumber than cats'))
# Output: ['cats', 'dogs']
print([x.group() for x in re.finditer( r'all (.*?) are', 'all cats are smarter than dogs, all dogs are dumber than cats')])
# Output: ['all cats are', 'all dogs are']
print("stri... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,345 | maeof/ScrapeNewsAgencies | refs/heads/master | /Dictionary.py | import ScraperHelper as helper
from AnalyzeLinks import SimpleContentScraper
from ContentFetcher import FileContentFetcher
from ContentScraper import FifteenContentScraper, DelfiContentScraper, LrytasContentScraper
from bs4 import BeautifulSoup
import multiprocessing
from joblib import Parallel, delayed
from tqdm imp... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,346 | maeof/ScrapeNewsAgencies | refs/heads/master | /oldGetLinks2.py | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
import time
chrome_options = Options()
chrome_options.add_argument("--headless")
#service = Service('c:\\data\\chromedriver\\chromedriver.exe')
#service.start()
cdi = webdriver.Ch... | {"/ContentScraper.py": ["/ScraperHelper.py"], "/AnalyzeLinks.py": ["/ScraperHelper.py", "/ContentFetcher.py", "/ContentScraper.py"], "/LinkScraper.py": ["/ScraperHelper.py"], "/GetLinks.py": ["/LinkScraper.py", "/ScraperHelper.py"], "/Dictionary.py": ["/ScraperHelper.py", "/AnalyzeLinks.py", "/ContentFetcher.py", "/Con... |
16,348 | Swetha-14/opinion-mining | refs/heads/master | /network/models.py | from django.contrib.auth.models import AbstractUser
from django.db import models
from django.core.validators import MinValueValidator, MaxLengthValidator
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from profanity.validators import validate_is_profane
class ... | {"/network/views.py": ["/network/models.py"]} |
16,349 | Swetha-14/opinion-mining | refs/heads/master | /network/migrations/0010_auto_20210606_1750.py | # Generated by Django 3.2.3 on 2021-06-06 12:20
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('network', '0009_auto_20210519_1336'),
]
operations =... | {"/network/views.py": ["/network/models.py"]} |
16,350 | Swetha-14/opinion-mining | refs/heads/master | /network/migrations/0014_alter_comment_comment.py | # Generated by Django 3.2.3 on 2021-07-23 08:09
from django.db import migrations, models
import profanity.validators
class Migration(migrations.Migration):
dependencies = [
('network', '0013_alter_post_image'),
]
operations = [
migrations.AlterField(
model_name='comment',
... | {"/network/views.py": ["/network/models.py"]} |
16,351 | Swetha-14/opinion-mining | refs/heads/master | /network/migrations/0009_auto_20210519_1336.py | # Generated by Django 3.2.3 on 2021-05-19 08:06
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('network', '0008_alter_post_image'),
]
operations = [
migrations.AddField(
model_name='post',
... | {"/network/views.py": ["/network/models.py"]} |
16,352 | Swetha-14/opinion-mining | refs/heads/master | /network/views.py | import json
import csv
from django.contrib.auth import authenticate, login, logout
from django.db import IntegrityError
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import render, redirect
from django.urls import reverse
from django.contrib.auth.decorators import login_... | {"/network/views.py": ["/network/models.py"]} |
16,366 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/utils.py | #
# Nimish Nayak
# 10-06-2017
#
#
# Utils
#
# Basic Utilities File
#
# required libraries
import logging
import os
class Utils():
# Function to process the string to boolean
@staticmethod
def str_to_bool(string_val):
logging.debug("str_to_bool received string: %s"%string_val)
i... | {"/main.py": ["/modules/utils.py"]} |
16,367 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/utils_test.py | #
# Nimish Nayak
# 10-06-2017
#
#
# Utils Unit Test
#
from utils import Utils
import os
# Test the str_to_bool function
def test_str_to_bool_with_no_args():
assert(Utils.str_to_bool(None) == None)
assert(Utils.str_to_bool("") == None)
def test_str_to_bool_with_incorrect_args():
assert(Utils.str_to_bool("Tes... | {"/main.py": ["/modules/utils.py"]} |
16,368 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/csv_parser_test.py | #
# Nimish Nayak
# 10-06-2017
#
#
# Csv Parser - Class Tests
#
from csv_parser import CsvParser
import os
test_file = os.path.join(os.getcwd(),"Test.csv")
def test_csv_parser_with_missing_values():
global test_file
# value missing
with open(test_file,"w")as f:
f.write("""name,active... | {"/main.py": ["/modules/utils.py"]} |
16,369 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/file_handler_test.py | #
# Nimish Nayak
# 10-06-2017
#
# required libraries
from file_handler import FileHandler
# File Hander
# This module will handle all the file handling operations
def test_file_handler_non_std_file_types():
try:
fh = FileHandler("Data/Test.psv")
fh.process_file()
assert(False)
excep... | {"/main.py": ["/modules/utils.py"]} |
16,370 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/parser_test.py | #
# Nimish Nayak
# 10-06-2017
#
#
# Parser - Base Class Tests
#
from parser import Parser
def test_parser_if_abstract():
try:
p = Parser()
assert(False)
except TypeError:
assert(True)
def test_parser_process_file_function():
class B(Parser):
def parse_file(self):... | {"/main.py": ["/modules/utils.py"]} |
16,371 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/yml_parser_test.py | #
# Nimish Nayak
# 10-06-2017
#
#
# Yml Parser - Class Tests
#
from yml_parser import YmlParser
import os
test_file = os.path.join(os.getcwd(),"Test.yml")
def test_yml_parser_with_missing_values():
global test_file
# value missing
with open(test_file,"w")as f:
f.write("""users:
- ... | {"/main.py": ["/modules/utils.py"]} |
16,372 | wordwarrior01/MultiFileReader | refs/heads/master | /main.py | #
# Nimish Nayak
# 10-06-2017
#
# Create a command line tool
# which reads data from a file (csv, yml, xml), but they contain the same data
# performs simple operation on this data
# stores or prints a result. The result could be stored in a plain text file or printed on stdout
# Note: Developed using Python 2.7.... | {"/main.py": ["/modules/utils.py"]} |
16,373 | wordwarrior01/MultiFileReader | refs/heads/master | /modules/yml_parser.py | #
# Nimish Nayak
# 10-06-2017
#
#
# YAML Parser
#
# required libraries
import logging
import yaml
from parser import Parser
class YmlParser(Parser):
# initialize the instance variables
def __init__(self, input_file):
# call the base class constructor
Parser.__init__(self, input_file)
log... | {"/main.py": ["/modules/utils.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.