index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
1,976 | Tarun-yadav777/Djanjo-Project-Schemer- | refs/heads/master | /schemegen/migrations/0002_delete_genre.py | # Generated by Django 3.0.8 on 2020-11-13 11:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('schemegen', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='Genre',
),
]
| {"/schemegen/views.py": ["/schemegen/models.py"], "/schemegen/admin.py": ["/schemegen/models.py"]} |
1,977 | Tarun-yadav777/Djanjo-Project-Schemer- | refs/heads/master | /schemegen/urls.py | from django.urls import path
from schemegen import views
urlpatterns = [
path('', views.index, name='index'),
path('adhaar', views.adhaar, name='adhaar'),
path('requirements', views.requirements, name='requirements'),
path('detail', views.detail, name='detail'),
path('adhaar-hindi', views.adhaar_h... | {"/schemegen/views.py": ["/schemegen/models.py"], "/schemegen/admin.py": ["/schemegen/models.py"]} |
1,978 | Tarun-yadav777/Djanjo-Project-Schemer- | refs/heads/master | /schemegen/views.py | from django.shortcuts import render
from django.http import HttpResponse
from .models import Schemegen
def index(request):
return render(request, 'Index.html')
def adhaar(request):
return render(request, 'Adhaar.html')
def requirements(request):
return render(request, 'Requirements.html')
def detail(... | {"/schemegen/views.py": ["/schemegen/models.py"], "/schemegen/admin.py": ["/schemegen/models.py"]} |
1,979 | Tarun-yadav777/Djanjo-Project-Schemer- | refs/heads/master | /schemegen/migrations/0001_initial.py | # Generated by Django 3.0.8 on 2020-11-13 11:23
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Genre',
fields=[
('id', models.AutoField(au... | {"/schemegen/views.py": ["/schemegen/models.py"], "/schemegen/admin.py": ["/schemegen/models.py"]} |
1,980 | Tarun-yadav777/Djanjo-Project-Schemer- | refs/heads/master | /schemegen/admin.py | from django.contrib import admin
from .models import Schemegen, User_info
admin.site.register(Schemegen)
admin.site.register(User_info)
| {"/schemegen/views.py": ["/schemegen/models.py"], "/schemegen/admin.py": ["/schemegen/models.py"]} |
2,032 | Zuoway/redfin_crawler | refs/heads/master | /Redfin/pipelines.py | # -*- coding: utf-8 -*-
'''Can use pymysql client to upload item directly to MySQL DB.
Or simply take stored json file into mysql within mysql shell
As a proof of concept project, not implemented yet.
For coding challenge purposes, currently exporting file into .csv format
'''
# from scrapy.exporters import JsonItem... | {"/Redfin/spiders/redfin_crawler.py": ["/Redfin/items.py"]} |
2,033 | Zuoway/redfin_crawler | refs/heads/master | /Redfin/spiders/redfin_crawler.py | # -*- coding: utf-8 -*-
import scrapy
import csv
import re
import random
from Redfin.items import RedfinItem
class RedfinCrawlerSpider(scrapy.Spider):
name = 'redfin_crawler'
allowed_domains = ['redfin.com']
'''start requests by looping through all valid zipcodes on redfin,
generate links by zipcode''... | {"/Redfin/spiders/redfin_crawler.py": ["/Redfin/items.py"]} |
2,034 | Zuoway/redfin_crawler | refs/heads/master | /Redfin/items.py | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class RedfinItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
sold_date = scrapy.Field()
property_... | {"/Redfin/spiders/redfin_crawler.py": ["/Redfin/items.py"]} |
2,035 | Zuoway/redfin_crawler | refs/heads/master | /Redfin/main.py | import scrapy.cmdline
import requests
from lxml.html import fromstring
'''
A method to scrape free publicly available proxies used to crawl. Unutilized at the moment due
to unreliability of public proxies sources (retrying dead proxies and abandoning them slows down
crawling speed drastically)
'''
def get_proxies():... | {"/Redfin/spiders/redfin_crawler.py": ["/Redfin/items.py"]} |
2,042 | wbolster/earnest | refs/heads/master | /earnest/__init__.py |
from .earnest import ( # noqa: unused imports
lookup_path,
walk,
)
| {"/earnest/__init__.py": ["/earnest/earnest.py"], "/test_earnest.py": ["/earnest/__init__.py"]} |
2,043 | wbolster/earnest | refs/heads/master | /setup.py | from setuptools import setup
setup(
name='earnest',
version='0.0.1a',
packages=['earnest'],
)
| {"/earnest/__init__.py": ["/earnest/earnest.py"], "/test_earnest.py": ["/earnest/__init__.py"]} |
2,044 | wbolster/earnest | refs/heads/master | /earnest/earnest.py | try:
# Python 3
from functools import reduce
STRING_TYPE = str
except ImportError:
# Python 2
STRING_TYPE = basestring # noqa
_SENTINEL = object()
def walk(obj, parent_first=True):
# Top down?
if parent_first:
yield (), obj
# For nested objects, the key is the path compone... | {"/earnest/__init__.py": ["/earnest/earnest.py"], "/test_earnest.py": ["/earnest/__init__.py"]} |
2,045 | wbolster/earnest | refs/heads/master | /test_earnest.py |
import pytest
import earnest
@pytest.fixture()
def sample_object():
return dict(
a=1,
b=2,
c=['c1', 'c2'],
d=dict(nested=[1, dict(foo='bar', baz={})]),
)
def test_walk(sample_object):
import pprint
pprint.pprint(sample_object)
print()
for path, obj in earn... | {"/earnest/__init__.py": ["/earnest/earnest.py"], "/test_earnest.py": ["/earnest/__init__.py"]} |
2,049 | RainGod6/SDET11-LY | refs/heads/master | /test_appium/test_xueqiu.py | # This sample code uses the Appium python client
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
from time import sleep
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.support import expected_conditions
from s... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,050 | RainGod6/SDET11-LY | refs/heads/master | /test_appium_page_object/page/main.py | from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from test_appium_page_object.page.apply_etc_card.apply_credit_card import ApplyCreditCard
from test_appium_page_object.page.base_page import BasePag... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,051 | RainGod6/SDET11-LY | refs/heads/master | /test_appium_page_object/testcase/test_apply_credit_card.py | from test_appium_page_object.page.app import App
class TestApplyCreditCard:
def setup(self):
self.main = App().start().main()
def test_apply_credit_card(self):
self.main.goto_etc_home().apply_credit_card() | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,052 | RainGod6/SDET11-LY | refs/heads/master | /test_appium_page_object/page/apply_etc_card/apply_credit_card.py | from appium.webdriver.common.mobileby import MobileBy
from test_appium_page_object.page.base_page import BasePage
class ApplyCreditCard(BasePage):
_name_apply_card_element = (MobileBy.ID, "com.wlqq.phantom.plugin.etc:id/tv_online_open_card")
_name_nfc_element = (MobileBy.ID, "com.wlqq:id/btn_back")
def ... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,053 | RainGod6/SDET11-LY | refs/heads/master | /test_appium_page_object/page/app.py | from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from test_appium_page_object.page.base_page import BasePage
from test_appium_page_object.page.main import Main
class A... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,054 | RainGod6/SDET11-LY | refs/heads/master | /test_appium/hcb_app/test_hcb_home.py | from time import sleep
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
class TestHcb:
def setup(self):
caps = {}
caps['platformName'] = 'android'
caps['deviceName'] = '28d6f388'
caps['appPackage'] = 'com.wlqq'
caps['appActivity'] = 'com.... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,055 | RainGod6/SDET11-LY | refs/heads/master | /test_appium/YMM_APP/TestYmmPY.py | # This sample code uses the Appium python client
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
from time import sleep
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.common.touch_action import TouchAction
fro... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,056 | RainGod6/SDET11-LY | refs/heads/master | /leetcode/Solution.py | """
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。
示例:
给定 nums = [2, 7, 11, 15], target = 9
因为 nums[0] + nums[1] = 2 + 7 = 9
所以返回 [0, 1]
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/two-sum
"""
from typing import List
class Solution(object):
def two... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,057 | RainGod6/SDET11-LY | refs/heads/master | /test_appium/YMM_APP/TestYmm.py | # This sample code uses the Appium python client
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
caps = {}
caps["platformName"] = "android"
caps["deviceName"] = "xiaomi5"
caps["appPac... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,058 | RainGod6/SDET11-LY | refs/heads/master | /test_appium/hcb_app/test_hcb_demo.py | from time import sleep
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
class TestHcbDemo:
def setup(self):
c... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,059 | RainGod6/SDET11-LY | refs/heads/master | /test_yaml/test_yaml.py | import pytest
import yaml
class TestYaml:
def test_yaml(self):
print(yaml.load("""
- Hesperiidae
- Papilionidae
- Apatelodidae
- Epiplemidae
"""))
@pytest.mark.parametrize("a,b", yaml.safe_load(open("testyaml.yaml", encoding='utf-8')))
d... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,060 | RainGod6/SDET11-LY | refs/heads/master | /test_appium/testApiDemo.py | from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
class TestApiDemo:
def setup(self):
caps = {}
caps['platformName'] = "android"
caps['deviceName'] = "小米5"
caps['appPackage'] = "io.appium.android.apis"
caps['appActivity'] = ".ApiDemos"
... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,061 | RainGod6/SDET11-LY | refs/heads/master | /test_appium_page_object/page/base_page.py | import yaml
from appium.webdriver import WebElement
from appium.webdriver.webdriver import WebDriver
import logging
class BasePage:
logging.basicConfig(level=logging.INFO) # 使用logging
_driver: WebDriver
_black_list = []
_error_max = 5
_error_count = 0
def __init__(self, driver: WebDriver = N... | {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,062 | RainGod6/SDET11-LY | refs/heads/master | /unit/test_unit.py | import unittest
class TestSum(unittest.TestCase):
def test_sum(self):
assert 1 + 2 == 3
| {"/test_appium_page_object/page/main.py": ["/test_appium_page_object/page/apply_etc_card/apply_credit_card.py", "/test_appium_page_object/page/base_page.py"], "/test_appium_page_object/testcase/test_apply_credit_card.py": ["/test_appium_page_object/page/app.py"], "/test_appium_page_object/page/apply_etc_card/apply_cred... |
2,075 | mafrasiabi/Bayesian-GLM-for-Classification | refs/heads/master | /pp3.py | #!/usr/local/bin/python3
import sys
import numpy as np
import pandas as pd
import random
import math
import matplotlib.pyplot as plt
import pprint
import timeit
#Function to read dataset based on name and randomly split into training and testing set
def read_csv(dataset_name):
features = pd.read_cs... | {"/model_selection.py": ["/pp3.py"]} |
2,076 | mafrasiabi/Bayesian-GLM-for-Classification | refs/heads/master | /model_selection.py | #!/usr/local/bin/python3
import sys
import numpy as np
import pandas as pd
import random
import math
import matplotlib.pyplot as plt
import pprint
import timeit
from numpy import linalg as LA
import pp3
#Function to perform cross validation for model selection. Based on my code in Assignment 2
def mod... | {"/model_selection.py": ["/pp3.py"]} |
2,081 | cmontemuino/dbschools | refs/heads/master | /stusched/app/models.py | from django.db import models
class Course(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
def __str__(self):
return self.name.__str__()
PROPOSED = 1
ACCEPTING = 2
SCHEDULED = 3
statuses = {
PROPOSED: 'proposed',
ACCEPTING: 'accepting',
SCHED... | {"/stusched/app/admin.py": ["/stusched/app/models.py"], "/stusched/app/views.py": ["/stusched/app/models.py"]} |
2,082 | cmontemuino/dbschools | refs/heads/master | /stusched/app/admin.py | from django.contrib import admin
from .models import *
class StudentInline(admin.TabularInline):
model = Student
extra = 0
class ParentAdmin(admin.ModelAdmin):
inlines = [StudentInline]
admin.site.register(Course)
admin.site.register(Section)
admin.site.register(Parent, ParentAdmin)
admin.site.register(S... | {"/stusched/app/admin.py": ["/stusched/app/models.py"], "/stusched/app/views.py": ["/stusched/app/models.py"]} |
2,083 | cmontemuino/dbschools | refs/heads/master | /stusched/app/views.py | from django.shortcuts import render
from .models import Course, Section, Parent
class ScheduledCourse(object):
def __init__(self, name, description, sections):
self.name = name
self.description = description
self.sections = sections
def __str__(self, *args, **kwargs):
return se... | {"/stusched/app/admin.py": ["/stusched/app/models.py"], "/stusched/app/views.py": ["/stusched/app/models.py"]} |
2,084 | LasseJacobs/std_unordered_map_py_wrapper | refs/heads/master | /map.py | from ctypes import *
lib = cdll.LoadLibrary('./libmap.so')
class c_result(Structure):
_fields_ = [('value', c_char_p), ('found', c_bool)]
###################
# __init__(self):
lib.new_map.restype = c_void_p;
###################
# empty(self):
lib.m_empty.argtypes = [c_void_p]
# size(self):
lib.m_size.a... | {"/main.py": ["/map.py"]} |
2,085 | LasseJacobs/std_unordered_map_py_wrapper | refs/heads/master | /main.py | from map import std_map
m = std_map()
m.set("demo", "Hello World")
print(m.get("demo"))
| {"/main.py": ["/map.py"]} |
2,109 | PI2-Estufa/iluminationServer | refs/heads/master | /db.py | import datetime
import os
from sqlalchemy import create_engine, Column, Integer, Boolean, Unicode, Sequence, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
engine = create_engine(os.environ.get("POSTGRES_URL"), echo=True)
Session = sessionmaker(bind=engine)
se... | {"/ilumination_server.py": ["/db.py"]} |
2,110 | PI2-Estufa/iluminationServer | refs/heads/master | /ilumination_server.py | from nameko.rpc import rpc
import db
from db import Ilumination
from psycopg2 import OperationalError
class IluminationServer():
name = "ilumination_server"
@rpc
def receive_ilumination(self, ilumination):
i = Ilumination()
i.value = ilumination
try:
db.session.add(i)
... | {"/ilumination_server.py": ["/db.py"]} |
2,111 | 3toe/DojosWithTemplates | refs/heads/main | /dojo_ninjas_app/models.py | from django.db import models
class Dojo(models.Model):
name = models.CharField(max_length=255)
city = models.CharField(max_length=255)
state = models.CharField(max_length=2)
desc = models.CharField(max_length=255, null=True)
def __repr__(self):
return f"<{self.name} ({self.id})>"
class Ninja(mod... | {"/dojo_ninjas_app/views.py": ["/dojo_ninjas_app/models.py"]} |
2,112 | 3toe/DojosWithTemplates | refs/heads/main | /dojo_ninjas_app/views.py | from django.db import reset_queries
from django.shortcuts import render, redirect
from .models import Dojo, Ninja
def index(request):
context = {
"Dojos" : Dojo.objects.all(),
"Ninjas" : Ninja.objects.all()
}
return render(request, "index.html", context)
def process(request):
if "DojoButton" i... | {"/dojo_ninjas_app/views.py": ["/dojo_ninjas_app/models.py"]} |
2,116 | grantsrb/simple_autoencoder | refs/heads/master | /encoder.py | import torch
from torch.autograd import Variable
import torch.nn as nn
import numpy as np
class Encoder(nn.Module):
def cuda_if(self, tobj):
if torch.cuda.is_available():
tobj = tobj.cuda()
return tobj
def __init__(self, obs_size, n_classes, emb_size=256, bnorm=True):
"""
... | {"/main.py": ["/trainer.py", "/encoder.py"]} |
2,117 | grantsrb/simple_autoencoder | refs/heads/master | /trainer.py | import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
class Trainer():
def cuda_if(self, tobj):
if torch.cuda.is_available():
tobj = tobj.cuda()
return tobj
def __init__(self, net, lr=1e-3, pred_coef=.1):
... | {"/main.py": ["/trainer.py", "/encoder.py"]} |
2,118 | grantsrb/simple_autoencoder | refs/heads/master | /main.py | import torch
import torchvision
from torch.autograd import Variable
from trainer import Trainer
from encoder import Encoder
import matplotlib.pyplot as plt
import numpy as np
import sys
def cuda_if(tobj):
if torch.cuda.is_available():
tobj = tobj.cuda()
return tobj
def preprocess(imgs, mean, std):
... | {"/main.py": ["/trainer.py", "/encoder.py"]} |
2,130 | Formalin564/VM | refs/heads/master | /Vm/models.py | from django.db import models
class address_info(models.Model):
name = models.TextField()
longitude = models.FloatField()
latitude = models.FloatField()
data = models.CharField(max_length=200)
| {"/Vm/view.py": ["/Vm/models.py"]} |
2,131 | Formalin564/VM | refs/heads/master | /Vm/view.py | from django.shortcuts import render
import json
from .models import address_info
def hello(request):
address_point = address_info.objects.all()
address_longitude = []
address_latitude = []
address_data = []
for i in range(len(address_point)):
address_longitude.append(address_point[i].longitu... | {"/Vm/view.py": ["/Vm/models.py"]} |
2,132 | Formalin564/VM | refs/heads/master | /Vm/urls.py | from .import view
from django.urls import path
urlpatterns = [
path('', view.hello),
]
| {"/Vm/view.py": ["/Vm/models.py"]} |
2,133 | Formalin564/VM | refs/heads/master | /Vm/sn.py | # -*- coding: utf-8 -*-
import urllib.parse
import urllib.request
import json
key = 'iq9mhXfEXPYMlLyn070A3uvFFx968kpq'
#属性名1:x 用于存储经度 类型 float
#属性名2:y 用于存储纬度 类型 float
#逆地址编码的方法
class locationXY:
def __init__(self,x,y):
self.x=x
self.y=y
#正/逆地理编码
def getLocation(address):
data = urllib.pars... | {"/Vm/view.py": ["/Vm/models.py"]} |
2,134 | Formalin564/VM | refs/heads/master | /vm_notice/apps.py | from django.apps import AppConfig
class VmNoticeConfig(AppConfig):
name = 'vm_notice'
| {"/Vm/view.py": ["/Vm/models.py"]} |
2,137 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/writer.py | '''
Created on Sep 24, 2012
@author: shawn
'''
from lib.options.config import configuration as config
import __builtin__
class FileWrapper(object):
def __init__(self,obj):
self._obj = obj
def close(self,*args,**kwargs):
print "Closing file..."
self._obj.close(*args,**kwargs)
def __getattr__(self, attr):
... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,138 | shawntan/predict-forum-pgm | refs/heads/master | /lib/training/test.py | import lda
from utils.reader import windowed,filter_tokenise
import sys
import matplotlib.pyplot as plt
from collections import defaultdict
def plot_hist(bin_size,bin_list, upper =None):
for bins in bin_list:
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
up_bound = upper or max(bins)
x = [i for i in range(up_... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,139 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/pickled_globals.py | import cPickle as pickle
class pickled_globals(object):
def __init__(self,pg_dir):
self.pg_dir = pg_dir
def __getattr__(self, attr_name):
"""
Loads the file from pg_dir into an object,
then caches the object in memory.
"""
obj = pickle.load(open('%s/%s'%(self.pg_dir,attr_name),'rb'))
self.__setattr__(a... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,140 | shawntan/predict-forum-pgm | refs/heads/master | /lib/training/trainer.py | from utils.reader import windowed
from utils.reporting import *
from utils.util import *
from regression_performance import performance
import pickle,math,getopt
def train(model,extractor,filenames,window_size,iterations = 1):
for _ in range(iterations):
for f in filenames:
try:
model.train(extracted... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,141 | shawntan/predict-forum-pgm | refs/heads/master | /lib/evaluation/evaluate_window.py | #!/usr/bin/python2
from lib.io.reader import windowed
from lib.io.reporting import reporting_init,timestamp_log
from lib.io.util import *
from lib.options import *
from lib.interfaces.model_utils import unpickle_model
def evaluate(threadfile, model, extractor, window_size = 1, bandwidth = 1000000, LAG_TIM... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,142 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/__init__.py | import pickled_globals
import writer
| {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,143 | shawntan/predict-forum-pgm | refs/heads/master | /lib/training/trainer_test.py | from utils.reader import windowed
from utils.reporting import *
from utils.util import *
import pickle,math,getopt
from evaluate_window import evaluate as evaluate_window
from utils.options import read_options, read_model_extractor_options
def train(model,extractor,iterator,window_size,iterations = 1):
for _ i... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,144 | shawntan/predict-forum-pgm | refs/heads/master | /lib/graphs.py | import os
def plot_hist(bin_size, bin_list, directory=None, upper=None):
if not os.path.exists(directory): os.makedirs(directory)
import matplotlib.pyplot as plt
count = 1
for bins in bin_list:
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
up_bound = upper or max(bins)
x = [i for i in range(up_bound+1)]
... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,145 | shawntan/predict-forum-pgm | refs/heads/master | /lib/evaluation/evaluate.py | #!/usr/bin/python2
from lib.io.reader import windowed
from lib.io.reporting import reporting_init,timestamp_log
from lib.io.util import *
from lib.options import *
from lib.interfaces.model_utils import unpickle_model
from lib.evaluation.sliding_window import SlidingWindow
from lib.evaluation.pairwise imp... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,146 | shawntan/predict-forum-pgm | refs/heads/master | /lib/options/options.py | from optparse import OptionParser
from random import random
opts,args = None,None
p_opts = None
def read_options():
global opts,args
p = OptionParser()
p.add_option("-M","--model",metavar = "MODEL_PATH.py",
action = "store",
dest = "model_name",
help = "Model to be used for current experiment"... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,147 | shawntan/predict-forum-pgm | refs/heads/master | /predictor.py | import cPickle as pickle
import sys
import lib.io.pickled_globals
import lib.graphs as graphs
from hist_to_probdist import time_dist
from lib.io.reader import windowed,filter_tokenise
window_size = 15
time_bin = 20
def load_model(topics):
timdist = pickle.load(open('graphs/prob_dist/dist_t%03d'%topics,'rb'))
lda =... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,148 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/util.py | from reader import windowed
import sys, imp, traceback, md5, pickle
def load_from_file(filepath,class_name,*params):
class_inst = None
"""
mod_name,file_ext = os.path.splitext(os.path.split(filepath)[-1])
if file_ext.lower() == '.py':
py_mod = imp.load_source(mod_name, filepath)
elif file_ext.lower() == '.pyc'... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,149 | shawntan/predict-forum-pgm | refs/heads/master | /lib/evaluation/play.py | from lib.io.reporting import set_directory
from lib.io.util import load_from_file
from lib.options import *
from lib.interfaces.model_utils import unpickle_model
import os
import glob
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import pyplot
import numpy as np
def plot(values,output,
x_axis = 'Values',
... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,150 | shawntan/predict-forum-pgm | refs/heads/master | /preamble.py | import cPickle as pickle
import lib.io.pickled_globals
import lib.graphs as graphs
| {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,151 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/reader.py | #!/usr/bin/python2
import nltk,re
from nltk.stem.porter import PorterStemmer
import time
bin_size = 10
users = set()
def text_tdelta(input_file):
prev_tup = None
for line in open(input_file):
tup = line.split('\t')
if prev_tup: yield (
(float(tup[0])-float(prev_tup[0]))/60,
tup[1].strip(),
tup[2].st... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,152 | shawntan/predict-forum-pgm | refs/heads/master | /lib/options/config.py | import ConfigParser
from collections import namedtuple
sections = ['dirs','filename_formats']
def subconf(section):
Conf = namedtuple(section,(k for k,_ in c.items(section)))
conf = Conf(**dict(c.items(section)))
return conf
c = ConfigParser.RawConfigParser()#allow_no_value=True)
c.readfp(open('config','r'))
PConf =... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,153 | shawntan/predict-forum-pgm | refs/heads/master | /lib/evaluation/sliding_window.py | class SlidingWindow():
def __init__(self,K = 60, alpha = 0.5):
self.window = []
self.low = 0
self.window_size = K
self.alpha = alpha
self.phi_count = 0
self.psi_count = 0
self.ref_count = 0
self.all_count = 0
def event(self,event_type,time):
time = int(time)
if time >= self.low + self.window_siz... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,154 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/dataset.py | import numpy as np
from sklearn import linear_model
from itertools import permutations
from lang_model import Extractor
from utils.reader import *
import csv,sys
count = 0
clf = linear_model.LinearRegression()
filenames = [sys.argv[1]]
filename_x = "X"
filename_y = "Y"
window_size = 15
e = Extractor()
count = sum(1 ... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,155 | shawntan/predict-forum-pgm | refs/heads/master | /lib/interfaces/model_utils.py | '''
Created on Jul 19, 2012
@author: shawn
'''
from lib.io.reporting import get_directory
import pickle
def save_model(filename,model):
fullpath = "%s/%s"%(get_directory(),filename)
f = open(fullpath,'wb')
pickle.dump(model,f)
f.close()
return fullpath
def unpickle_model(filepath):
return pickle.load(filepath)... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,156 | shawntan/predict-forum-pgm | refs/heads/master | /lib/options/__init__.py | import options,config
| {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,157 | shawntan/predict-forum-pgm | refs/heads/master | /lib/interfaces/generic_model.py | '''
Created on Jul 17, 2012
@author: shawn
'''
import md5
from model_utils import save_model
from collections import defaultdict
class GenericModel(object):
epsilon = 0.1
def __init__(self,o):
self.options = o
self.experiments = defaultdict(list)
def predict(self,feature_vec = None, d_t = None, current_d_t =... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,158 | shawntan/predict-forum-pgm | refs/heads/master | /lib/evaluation/pairwise.py | import math
class PairwiseScoring():
def __init__(self,scoring = {
('visit','visit') : lambda e1,e2: math.exp(0.01*(e1-e2)),
('post', 'visit') : lambda e1,e2: 1-math.exp(0.01*(e1-e2)),
('post', 'post' ) : lambda e1,e2: 0 ,
('visit','post' ) : lambda e1,e2: 0}):
self.total_score = 0
self.count = 0
... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,159 | shawntan/predict-forum-pgm | refs/heads/master | /hist_to_probdist.py | #!/usr/bin/python2
import os
import numpy as np
import cPickle as pickle
from collections import defaultdict
import lib.io.pickled_globals
import lib.graphs as graphs
def main():
directory = 'graphs/prob_dist'
if not os.path.exists(directory): os.makedirs(directory)
for i in range(1,10):
hist = pickle.load(open(... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,160 | shawntan/predict-forum-pgm | refs/heads/master | /lib/interfaces/extractor_utils.py | '''
Created on Jul 19, 2012
@author: shawn
'''
from lib.io.reporting import get_directory
from lib.options import read_options
from lib.io.reader import windowed
from lib.io.util import load_from_file
import pickle
def save_model(filename,model):
f = open("%s/%s"%(get_directory(),filename),'wb')
pickle.dump(mode... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,161 | shawntan/predict-forum-pgm | refs/heads/master | /lib/evaluation/analyse_bins.py | import sys,operator
import shelve
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import bsddb3
from collections import defaultdict
K = int(sys.argv[1])
output_file = sys.argv[2]
transit_file = sys.argv[3]
bins = shelve.BsdDbShelf(bsddb3.hashopen('bins.data', 'r'))
#bins = shelve.open('b... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,162 | shawntan/predict-forum-pgm | refs/heads/master | /lib/io/reporting.py | REPORTS = None
SUBDIR = None
import sys,os
from datetime import datetime
def set_directory(directory):
global SUBDIR
SUBDIR = directory
def get_directory():
global SUBDIR
return SUBDIR
def reporting_init(options,directory):
global SUBDIR,REPORTS
REPORTS = directory
SUBDIR = '%s/%s'%(directory,datetime.now().st... | {"/preamble.py": ["/lib/io/pickled_globals.py", "/lib/graphs.py"], "/lib/interfaces/model_utils.py": ["/lib/io/reporting.py"]} |
2,168 | doublepi123/demo | refs/heads/master | /mgr/views.py | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
from common.models import Student
def liststudent(request):
qs = Student.objects.values()
retStr = ''
for student in qs:
for name, value in student.items():
retStr += f'{name} : {value}... | {"/mgr/views.py": ["/common/models.py"]} |
2,169 | doublepi123/demo | refs/heads/master | /model/Student.py | class Student:
name = ''
id = ''
age = ''
homeIncome = ''
costForFood = ''
costForOther = ''
| {"/mgr/views.py": ["/common/models.py"]} |
2,170 | doublepi123/demo | refs/heads/master | /common/models.py | from django.db import models
from django.contrib import admin
# Create your models here.
class Student(models.Model):
# 姓名
name = models.CharField(max_length=20)
# 学号
stu_id = models.CharField(max_length=20, primary_key=True)
# 电话号码
phone = models.CharField(max_length=20)
# 出生日期
birthd... | {"/mgr/views.py": ["/common/models.py"]} |
2,191 | gouravsaini021/maruti | refs/heads/master | /maruti/imports/__init__.py | from . import general
from . import ml
| {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,192 | gouravsaini021/maruti | refs/heads/master | /maruti/deepfake/dataset.py | import pathlib
from warnings import warn
import subprocess
import maruti
import os
from os.path import join
from PIL import Image
import torch
import shlex
import time
from collections import defaultdict
from ..vision.video import get_frames_from_path, get_frames
import random
from ..utils import unzip, read_json
from ... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,193 | gouravsaini021/maruti | refs/heads/master | /maruti/vision/video.py | import cv2
import numpy as np
from .. import vision as mvis
from facenet_pytorch import MTCNN
import torch
from PIL import Image
from collections import defaultdict
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
class Video(cv2.VideoCapture):
def __enter__(self):
return self
def __exit__(s... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,194 | gouravsaini021/maruti | refs/heads/master | /maruti/deepfake/__init__.py | from . import dataset
from . import models
from .dataset import VideoDataset, DeepfakeDataset, ImageReader
from .dataset import transform, group_transform
| {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,195 | gouravsaini021/maruti | refs/heads/master | /maruti/torch/callback.py | import os
from datetime import datetime, timezone, timedelta
from torch.utils.tensorboard import SummaryWriter
from copy import deepcopy
class Callback:
def on_epoch_end(self, losses, metrics, extras, epoch):
"""
extras-> dict ['time']['model']
"""
pass
def on_epoch_start(self... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,196 | gouravsaini021/maruti | refs/heads/master | /maruti/deepfake/models.py | import torch.nn as nn
import torchvision
from ..torch.utils import freeze
from torch.nn.utils.rnn import PackedSequence, pack_sequence
import itertools
from .dataset import group_transform
def resnext50(feature=False, pretrained=False):
model = torchvision.models.resnext50_32x4d(pretrained)
if feature:
... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,197 | gouravsaini021/maruti | refs/heads/master | /tests/test_utils.py | import maruti
import unittest
import tempfile
from maruti import utils
import os
class UtilsTests(unittest.TestCase):
def test_read_write_json(self):
with tempfile.TemporaryDirectory() as dir:
# creating dictionary
sample = {'h': 3, 'd': {'j': 4}}
path = os.path.join(d... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,198 | gouravsaini021/maruti | refs/heads/master | /tests/torch/test_utils.py | import unittest
import tempfile
import os
import torchvision
import torch
from maruti.torch import utils
class TorchUtilsTest(unittest.TestCase):
def setUp(self):
self.model = torchvision.models.resnet18(False)
def tearDown(self):
self.model = None
def test_freeze_unfreeze(self):
... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,199 | gouravsaini021/maruti | refs/heads/master | /setup.py | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="maruti",
version="1.3.4",
author="Ankit Saini",
author_email="ankitsaini100205@gmail.com",
description="Maruti Library",
long_description=long_description,
long_description_content... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,200 | gouravsaini021/maruti | refs/heads/master | /maruti/imports/ml.py | from .general import *
from .general import __all__ as gen_all
import torch
import torch.nn as nn
import torchvision.transforms as torch_transforms
import torchvision
import maruti.torch as mtorch
import maruti.deepfake.dataset as mdata
import maruti
import maruti.deepfake as mfake
import numpy as np
import cv2
import ... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,201 | gouravsaini021/maruti | refs/heads/master | /maruti/imports/general.py | import os
import shutil
from glob import glob
from tqdm.auto import tqdm
import itertools
import random
import time
from functools import partial
__all__ = ['time','random','os', 'shutil', 'glob', 'tqdm', 'itertools', 'partial']
| {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,202 | gouravsaini021/maruti | refs/heads/master | /maruti/utils.py | import json
import zipfile
import time
from tqdm.auto import tqdm
__all__ = ['rep_time', 'read_json', 'write_json', 'unzip']
def rep_time(seconds):
if seconds >= 3600:
return time.strftime('%H:%M:%S', time.gmtime(seconds))
else:
return time.strftime('%M:%S', time.gmtime(seconds))
def read_j... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,203 | gouravsaini021/maruti | refs/heads/master | /maruti/torch/utils.py | # from torch_lr_finder import LRFinder
from tqdm.auto import tqdm
from functools import partial
import torch
import time
import numpy as np
from collections import Counter
from torchvision import transforms as torch_transforms
from . import callback as mcallback
tqdm_nl = partial(tqdm, leave=False)
__all__ = ['unfreez... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,204 | gouravsaini021/maruti | refs/heads/master | /maruti/deepfake/utils.py | # from torch_lr_finder import LRFinder
from tqdm.auto import tqdm
from functools import partial
import torch
import time
tqdm_nl = partial(tqdm, leave=False)
class Callback:
pass
def _limit_string(string, length):
string = str(string)
if length > len(string):
return string
else:
ret... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,205 | gouravsaini021/maruti | refs/heads/master | /maruti/vision/__init__.py | from . import image
from . import video
from .image import make_grid
from .video import *
| {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,206 | gouravsaini021/maruti | refs/heads/master | /tests/vision/test_image.py | import unittest
import cv2
from cv2 import dnn_Net
from maruti.vision import image
import os
TEST_DATA_PATH = 'test_data'
class ImageTests(unittest.TestCase):
def setUp(self):
self.img_path = os.path.join(TEST_DATA_PATH, 'img1.jpeg')
self.img = cv2.imread(self.img_path)
def test_create_net(s... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,207 | gouravsaini021/maruti | refs/heads/master | /maruti/__init__.py | from . import utils
from . import sizes
from . import vision
from . import deepfake
from . import kaggle
from . import torch
from .utils import *
from .sizes import *
from .deepfake import ImageReader
from .torch import Learner
| {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,208 | gouravsaini021/maruti | refs/heads/master | /maruti/torch/__init__.py | from . import utils
from . import metrics
from .utils import *
| {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,209 | gouravsaini021/maruti | refs/heads/master | /maruti/kaggle.py | import os
import subprocess
from pathlib import Path
import zipfile
def set_variables(credentials: 'lists[str,str]=[username, token]'):
os.environ['KAGGLE_USERNAME'] = credentials[0]
os.environ['KAGGLE_KEY'] = credentials[1]
def update_dataset(path, slug, message='new version', clean=False):
folder = os... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,210 | gouravsaini021/maruti | refs/heads/master | /maruti/vision/image.py | import numpy as np
import cv2
from functools import lru_cache
from functools import partial
from os.path import join
import os
from PIL import Image
import torch
__all__ = ['brightness_score', 'adjust_brightness',
'crop_around_point', 'make_grid']
DATA_PATH = join(os.path.dirname(__file__), 'data')
def ... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,211 | gouravsaini021/maruti | refs/heads/master | /tests/test_sizes.py | import unittest
import tempfile
import os
from maruti import sizes
class DeepfakeTest(unittest.TestCase):
def test_byte_to_mb(self):
self.assertEqual(sizes.byte_to_mb(1024*1024), 1)
self.assertAlmostEqual(sizes.byte_to_mb(1024),
0.0009765624, delta=1e-8)
def te... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,212 | gouravsaini021/maruti | refs/heads/master | /maruti/sizes.py | from sys import getsizeof
import os
__all__ = ['dir_size','file_size','var_size']
def byte_to_mb(size):
return size/(1024**2)
def dir_size(start_path='.'):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
... | {"/maruti/deepfake/dataset.py": ["/maruti/__init__.py", "/maruti/vision/video.py", "/maruti/utils.py", "/maruti/sizes.py", "/maruti/torch/utils.py"], "/maruti/vision/video.py": ["/maruti/__init__.py"], "/maruti/deepfake/__init__.py": ["/maruti/deepfake/dataset.py"], "/maruti/deepfake/models.py": ["/maruti/torch/utils.p... |
2,217 | lbarchive/b.py | refs/heads/master | /tests/test_bpy_handlers_text.py | # Copyright (C) 2013, 2014 Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, di... | {"/tests/test_bpy_handlers_text.py": ["/bpy/handlers/text.py"], "/bpy/handlers/mkd.py": ["/bpy/handlers/__init__.py"], "/b.py": ["/bpy/handlers/__init__.py", "/bpy/services/__init__.py"], "/tests/test_bpy_handlers_mkd.py": ["/bpy/handlers/mkd.py"], "/bpy/handlers/rst.py": ["/bpy/handlers/__init__.py"], "/bpy/handlers/t... |
2,218 | lbarchive/b.py | refs/heads/master | /bpy/handlers/mkd.py | # Copyright (C) 2013, 2014 Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, di... | {"/tests/test_bpy_handlers_text.py": ["/bpy/handlers/text.py"], "/bpy/handlers/mkd.py": ["/bpy/handlers/__init__.py"], "/b.py": ["/bpy/handlers/__init__.py", "/bpy/services/__init__.py"], "/tests/test_bpy_handlers_mkd.py": ["/bpy/handlers/mkd.py"], "/bpy/handlers/rst.py": ["/bpy/handlers/__init__.py"], "/bpy/handlers/t... |
2,219 | lbarchive/b.py | refs/heads/master | /b.py | #!/usr/bin/env python
# Copyright (C) 2013-2016 by Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | {"/tests/test_bpy_handlers_text.py": ["/bpy/handlers/text.py"], "/bpy/handlers/mkd.py": ["/bpy/handlers/__init__.py"], "/b.py": ["/bpy/handlers/__init__.py", "/bpy/services/__init__.py"], "/tests/test_bpy_handlers_mkd.py": ["/bpy/handlers/mkd.py"], "/bpy/handlers/rst.py": ["/bpy/handlers/__init__.py"], "/bpy/handlers/t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.