index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
85,055 | irjkf129/site | refs/heads/master | /mysite/views.py | from django.shortcuts import render,redirect
def asd(request):
return redirect('main_url') | {"/f/urls.py": ["/f/views.py"]} |
85,081 | SkorikFA/conv | refs/heads/main | /control.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os,random
import cv2
import torch
import torch.nn as nn
from networks.network import Convolutional
class NetworksControl:
def __init__(self,path_to_src, path_to_save_dir):
self.path_to_letters_src=path_to_src
self.path_to_save=path_to_save_dir
... | {"/control.py": ["/networks/network.py"], "/__init__.py": ["/control.py"]} |
85,082 | SkorikFA/conv | refs/heads/main | /__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from control import NetworksControl
def main():
mode = 1 # 0 - train 1 - run
network_name = 'conv_s0'
path_to_save = os.getcwd() + '/saved/' + network_name
path_to_src = os.getcwd() + '/src/'
if mode==0:
num_epochs=20
nc=Netwo... | {"/control.py": ["/networks/network.py"], "/__init__.py": ["/control.py"]} |
85,083 | SkorikFA/conv | refs/heads/main | /networks/network.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import torch.nn as nn
class Convolutional(nn.Module):
def __init__(self,outputs_count):
super(Convolutional, self).__init__()
self.layer1 = nn.Sequential(
nn.Conv2d(1, 16, kernel_size=3, stride=1, padding=0),
nn.LeakyReLU(),
... | {"/control.py": ["/networks/network.py"], "/__init__.py": ["/control.py"]} |
85,085 | locuslab/ase | refs/heads/master | /agents/ase_agent.py | # Python imports.
# Other imports.=
from agents.safe_agent import SafeAgent
from constants import *
from dynamic_programming import value_iteration
class ASEAgent(SafeAgent):
def __init__(self, actions, states, reward_func, initial_safe_states, initial_safe_actions,
similarity_function, analago... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,086 | locuslab/ase | refs/heads/master | /environments/discrete_platformer.py | """
Sample Python/Pygame Programs
Simpson College Computer Science
http://programarcadegames.com/
http://simpson.edu/computer-science/
From:
http://programarcadegames.com/python_examples/f.php?file=platform_scroller.py
Explanation video: http://youtu.be/QplXBw_NK5Y
Part of a series:
http://programarcadegames.com/pyt... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,087 | locuslab/ase | refs/heads/master | /agents/unsafe_agent.py | ''' QLearningAgentClass.py: Class for a basic QLearningAgent '''
# Python imports.
import random
import numpy as np
# Other imports.
from simple_rl.agents.AgentClass import Agent
from dynamic_programming.transition_table import TransitionTable
from dynamic_programming import value_iteration
class UnsafeAgent(Agent... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,088 | locuslab/ase | refs/heads/master | /constants.py | import numpy as np
DTYPE = np.float32
FLOAT_TOLERANCE = 10 ** -5
| {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,089 | locuslab/ase | refs/heads/master | /agents/mbie_agent.py | # Python imports.
# Other imports.=
from simple_rl.agents.AgentClass import Agent
from constants import *
from dynamic_programming.ase_transition_table import AnalogousStateTransitionTable
from dynamic_programming import value_iteration
class MBIEAgent(Agent):
def __init__(self, actions, states, reward_fun... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,090 | locuslab/ase | refs/heads/master | /plots.py | import os
import pickle
from scipy.sparse import lil_matrix
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import cv2
from scipy import interpolate
from tqdm import tqdm
from constants import *
from environments import discrete_platformer, unsafe_grid_world
from dynamic_programming import value_... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,091 | locuslab/ase | refs/heads/master | /dynamic_programming/value_iteration.py | import numpy as np
from scipy import sparse
from scipy.sparse import csr_matrix
from constants import *
from value_iteration_cy import optimize_T_sparse, next_values_sparse
def value_iteration(transition_matrix, reward_matrix, terminal_states, horizon=100, gamma=0.9, action_mask=None, q_default=-1, use_sparse_matric... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,092 | locuslab/ase | refs/heads/master | /agents/safe_rmax_agent.py | # Python imports.
# Other imports.=
from agents.safe_agent import SafeAgent
from constants import *
from dynamic_programming import value_iteration
class SafeRMaxAgent(SafeAgent):
def __init__(self, actions, states, reward_func, initial_safe_states, initial_safe_actions,
similarity_functio... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,093 | locuslab/ase | refs/heads/master | /agents/safe_epsilon_greedy.py | # Python imports.
# Other imports.
from agents.safe_agent import SafeAgent
from constants import *
from dynamic_programming import value_iteration
class SafeEGreedyAgent(SafeAgent):
def __init__(self, actions, states, reward_func, initial_safe_states, initial_safe_actions,
similarity_functi... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,094 | locuslab/ase | refs/heads/master | /dynamic_programming/ase_transition_table.py | import os
import pickle
from scipy.sparse import csr_matrix
from dynamic_programming.transition_table import TransitionTable
from constants import *
class AnalogousStateTransitionTable(TransitionTable):
def __init__(self, states, actions, similarity_function, analagous_state_function, initial_safe_sa,
... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,095 | locuslab/ase | refs/heads/master | /dynamic_programming/vi_tests.py | import unittest
import scipy.sparse as sp
from constants import *
from dynamic_programming import value_iteration
import value_iteration_cy
class TestSparseVI(unittest.TestCase):
def test_optimize_T(self):
num_states = 1000
num_actions = 10
transition_matrix = construct_transiti... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,096 | locuslab/ase | refs/heads/master | /main.py | import os
import numpy as np
import pickle
from multiprocessing import Pool
import argparse
import yaml
from environments import discrete_platformer, unsafe_grid_world
from agents.ase_agent import ASEAgent
from agents.safe_rmax_agent import SafeRMaxAgent
from agents.safe_epsilon_greedy import SafeEGreedyAgent
from age... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,097 | locuslab/ase | refs/heads/master | /dynamic_programming/dynamic_transition_table.py | import numpy as np
class TransitionTable:
def __init__(self, actions, num_states=None, predefined_rewards=False, reward_func=None, states=None):
self.sa_counts = dict()
self.transition_counts = dict()
self.reward_sums = dict()
self.terminal_states = set() # stores all terminal st... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,098 | locuslab/ase | refs/heads/master | /dynamic_programming/transition_table.py | import numpy as np
from scipy.sparse import csr_matrix, lil_matrix
DTYPE = np.float32
class TransitionTable:
def __init__(self, states, actions, reward_func=None, use_sparse_matrices=False):
self.states = list(states)
self.num_states = len(states)
self.state_to_id = dict()
for s_i... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,099 | locuslab/ase | refs/heads/master | /agents/safe_agent.py | # Python imports.
# Other imports.
from simple_rl.agents.AgentClass import Agent
from constants import *
from dynamic_programming.ase_transition_table import AnalogousStateTransitionTable
class SafeAgent(Agent):
def __init__(self, actions, states, reward_func, initial_safe_states, initial_safe_actions,
... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,100 | locuslab/ase | refs/heads/master | /environments/unsafe_grid_world.py | import random
import numpy as np
import os
from scipy.sparse import csr_matrix, lil_matrix
import pygame
from simple_rl.tasks import GridWorldMDP
from simple_rl.tasks.grid_world.GridWorldStateClass import GridWorldState
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 1000
class UnsafeGridWorldMDP(GridWorldMDP):
# Static c... | {"/agents/ase_agent.py": ["/agents/safe_agent.py", "/constants.py"], "/agents/unsafe_agent.py": ["/dynamic_programming/transition_table.py"], "/agents/mbie_agent.py": ["/constants.py", "/dynamic_programming/ase_transition_table.py"], "/plots.py": ["/constants.py"], "/dynamic_programming/value_iteration.py": ["/constant... |
85,101 | austinekrash/Sports-betting-1 | refs/heads/master | /sportsbetting/__init__.py | """
initialisation du module
"""
import chromedriver_autoinstaller
import collections
import queue
import re
from fake_useragent import UserAgent
ALL_ODDS_COMBINE = {}
ODDS = {}
TEAMS_NOT_FOUND = []
PROGRESS = 0
SUB_PROGRESS_LIMIT = 1
SITE_PROGRESS = collections.defaultdict(int)
QUEUE_TO_GUI = queue.Queue()
QUEUE_FR... | {"/sportsbetting/selenium_init.py": ["/sportsbetting/__init__.py"]} |
85,102 | austinekrash/Sports-betting-1 | refs/heads/master | /sportsbetting/selenium_init.py | """
Initialisation de selenium
"""
import colorama
import os
import selenium
import selenium.webdriver
import selenium.common
import sportsbetting
import stopit
import termcolor
import time
PATH_DRIVER = os.path.dirname(sportsbetting.__file__) + "/resources/chromedriver"
DRIVER = {}
@stopit.threading_timeoutable(ti... | {"/sportsbetting/selenium_init.py": ["/sportsbetting/__init__.py"]} |
85,112 | gustavooquinteiro/domino-game | refs/heads/master | /constants.py |
HOST = '127.0.0.1'
PORT = 5000
TUPLE = (HOST, PORT)
| {"/jogo.py": ["/pecas.py"], "/player.py": ["/constants.py"], "/__init__.py": ["/jogo.py", "/player.py", "/constants.py"]} |
85,113 | gustavooquinteiro/domino-game | refs/heads/master | /jogo.py | import collections
from pecas import Peca
import random
class Tabuleiro():
def __init__(self):
numeros = [0, 1, 2, 3, 4, 5, 6]
self.pieces = []
for numerador in numeros:
for denominador in numeros:
nova_peca = Peca(numerador, denominador)
if nov... | {"/jogo.py": ["/pecas.py"], "/player.py": ["/constants.py"], "/__init__.py": ["/jogo.py", "/player.py", "/constants.py"]} |
85,114 | gustavooquinteiro/domino-game | refs/heads/master | /player.py | from multiprocessing.connection import Client
from constants import TUPLE
from random import randint
import time
class Player():
def __init__(self, nome):
self.nome = nome
self.pecas = []
self.move = None
self.passed = False
def set_pecas(self, peca):
self.pecas.ap... | {"/jogo.py": ["/pecas.py"], "/player.py": ["/constants.py"], "/__init__.py": ["/jogo.py", "/player.py", "/constants.py"]} |
85,115 | gustavooquinteiro/domino-game | refs/heads/master | /__init__.py | from multiprocessing.connection import Listener
from jogo import Jogo
from jogo import Tabuleiro
from player import Player
from constants import TUPLE
class Server():
def __init__(self, board, quantidade_players=2, where_to_listen=TUPLE):
self.server = Listener(where_to_listen)
self.quantidade_pla... | {"/jogo.py": ["/pecas.py"], "/player.py": ["/constants.py"], "/__init__.py": ["/jogo.py", "/player.py", "/constants.py"]} |
85,116 | gustavooquinteiro/domino-game | refs/heads/master | /pecas.py | class Peca():
def __init__(self, first, second):
self.first = first
self.second = second
def __repr__(self):
return "[{}|{}]" .format(self.first, self.second)
def __contains__(self, key):
return key == self.first or key == self.second
def __del__(self):
del sel... | {"/jogo.py": ["/pecas.py"], "/player.py": ["/constants.py"], "/__init__.py": ["/jogo.py", "/player.py", "/constants.py"]} |
85,132 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/set_transformer.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from torch_geometric.nn import GCNConv, GraphConv
from torch_geometric.utils import to_dense_batch
def attention_visualize(A):
import seaborn as sns
import matplotlib.pyplot as plt
A = A.squeeze(0).cpu().numpy()
# ax = sns.... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,133 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /SparseGCNConv.py | import torch
import torch.nn as nn
from torch.nn import Parameter
from torch_geometric.nn.inits import glorot, zeros
from torch_scatter import scatter_add
from torch_sparse import spspmm, coalesce
from torch_geometric.utils import remove_self_loops
from torch_geometric.utils import add_remaining_self_loops
from torch_g... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,134 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/autoencoder.py | import os
import torch
import torch.nn as nn
import argparse
import matplotlib.pyplot as plt
import random
import numpy as np
from tqdm import tqdm
from pygsp import graphs
from torch_geometric.utils import to_dense_adj, dense_to_sparse, to_dense_batch
from torch_geometric.nn import GCNConv, dense_mincut_pool
import ... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,135 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /other_models.py | import torch
import torch.nn as nn
from torch.nn import Linear
from torch_geometric.utils import to_dense_adj, dense_to_sparse, to_dense_batch
from torch_geometric.nn import GCNConv, DenseGCNConv, dense_diff_pool, TopKPooling, SAGPooling, GINConv
# from ASAP import ASAPooling
from DenseGCNConv import DenseGCNConv as DG... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,136 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/layers.py | from torch.nn import Parameter
import torch
from torch import nn
from set_transformer import SAB, PMA
from torch_geometric.utils import to_dense_batch
class P(nn.Module):
def __init__(self, dim_input, dim_output, dim_hidden=128, num_heads=4, num_keys=[4, 1], ln=False, args=None):
super(P, self).__init__()
... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,137 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/CapsulePool.py | import torch
import torch.nn.functional as F
import torch.nn as nn
from torch_scatter import scatter_add, scatter_max, scatter_mean
from torch_geometric.utils import add_remaining_self_loops, remove_self_loops, softmax
from torch_geometric.nn.pool.topk_pool import topk
from utils import squash_1, squash_2, graph_connec... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,138 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /utils.py | import torch
import torch.nn.functional as F
from torch_geometric.utils import add_remaining_self_loops, remove_self_loops
from torch_sparse import coalesce
from torch_sparse import transpose
from torch_sparse import spspmm
from torch_scatter import scatter_mean, scatter_max, scatter_add
def dense_readout(x):
# x.... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,139 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /helper.py | import os
import torch
def makeDirectory(dirpath):
if not os.path.exists(dirpath):
os.makedirs(dirpath)
def set_gpu(gpus):
if torch.cuda.is_available():
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = gpus
torch.cuda.set_device(int(gpus)) | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,140 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /draw_graph.py | from other_models import *
from torch_geometric.data import DataLoader, DenseDataLoader as DenseLoader
from LocalCapsulePoolingNetwork import LocalCapsulePoolingNetwork
from data_processing import get_dataset
import numpy as np
import random
import argparse
import matplotlib.pyplot as plt
import networkx as nx
from tor... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,141 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /disentangle.py | """
Disentangle function
"""
import torch
from torch.nn import Parameter
from torch_geometric.nn.inits import glorot, zeros
# linearly disentangle node representations
class LinearDisentangle(torch.nn.Module):
def __init__(self, in_channels, out_channels):
super(LinearDisentangle, self).__init__()
... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,142 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /main.py | import math, random, argparse, time, uuid
import os, os.path as osp
from helper import makeDirectory, set_gpu
import numpy as np
import torch
from torch.nn import functional as F
from sklearn.model_selection import KFold
from torch_geometric.data import DataLoader, DenseDataLoader as DenseLoader
from torch_geometric.d... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,143 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/draw_CapsulePool.py | import sys
from pygsp import graphs
import numpy as np
from models import *
import argparse
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import random
parser = argparse.ArgumentParser(description='CapsulePool with different Pool Ratio')
parser.add_argument('--data', default='grid', type=str,
... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,144 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/draw_different_ratio.py | import sys
from pygsp import graphs
import numpy as np
from models import *
import argparse
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser(description='ASAP and CapsulePool with different Pool Ratio')
parser.add_argument('--data', default='grid', type=str,
... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,145 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /LocalCapsulePoolingNetwork.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.nn import GCNConv
from LocalCapsulePooling import LocalCapsulePooling
from torch_scatter import scatter_mean, scatter_max, scatter_add, scatter_softmax
from utils import squash_1, squash_2, common_readout... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,146 | imSeaton/LocalCapsulePoolingNetwork | refs/heads/master | /GST-recon/models.py | # MODEL DEFINITION
import torch
import torch.nn as nn
from torch_geometric.utils import to_dense_adj, dense_to_sparse, to_dense_batch
from torch_geometric.nn import GCNConv, DenseGCNConv, dense_diff_pool, TopKPooling, SAGPooling
# from ASAP import ASAPooling
from asap_pool import ASAP_Pooling
from CapsulePool import ... | {"/other_models.py": ["/utils.py"], "/GST-recon/CapsulePool.py": ["/utils.py"], "/draw_graph.py": ["/other_models.py", "/LocalCapsulePoolingNetwork.py"], "/main.py": ["/helper.py", "/LocalCapsulePoolingNetwork.py", "/utils.py", "/other_models.py"], "/LocalCapsulePoolingNetwork.py": ["/utils.py", "/disentangle.py"]} |
85,148 | sourander/selfiebooth | refs/heads/master | /selfie-generator.py | # USAGE
# python selfie-generator.py
# Press SPACEBAR to toggle RECORD ON/OFF.
# Red rectangle means that RECORD is on.
# Press Q to quit.
# import the necessary packages
from modules import ImageDataHandler
from modules import Conf
import argparse
import cv2
import imutils
ap = argparse.ArgumentP... | {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,149 | sourander/selfiebooth | refs/heads/master | /selfiebooth.py | # USAGE
# python selfiebooth.py --conf conf/selfienet.conf
# python selfiebooth.py --conf conf/lbph.conf
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
# import the necessary packages
from imutils.video import WebcamVideoStream
from imutils.video import FPS
from modules import Conf
fro... | {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,150 | sourander/selfiebooth | refs/heads/master | /modules/nn/__init__.py |
from modules.nn.selfienet import SelfieNet
| {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,151 | sourander/selfiebooth | refs/heads/master | /modules/imagedatahandler.py | import numpy as np
import cv2
import os
from imutils import paths
from skimage import feature
import glob
import random
class ImageDataHandler:
def __init__(self, bdir=None, n=None, d=None, sample=80, size=64):
# Default 'output', comes from idhconfig.conf
self.base_dir = bdir
# T... | {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,152 | sourander/selfiebooth | refs/heads/master | /train.py | # USAGE
# python train.py --conf conf/selfienet.conf
# python train.py --conf conf/lbph.conf
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
# import the necessary packages
from keras.optimizers import SGD
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selec... | {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,153 | sourander/selfiebooth | refs/heads/master | /modules/haar_helpers.py | import cv2
import os
import numpy as np
from skimage import feature
def get_face_coords(detector, image):
# HAAR Cascade detection in Open CV. Keeps only the largest.
faceRects = detector.detectMultiScale(image, scaleFactor=1.05, minNeighbors=9,
minSize=(50, 50), flags=cv2.CASCADE_SCALE... | {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,154 | sourander/selfiebooth | refs/heads/master | /modules/nn/selfienet.py | # import the necessary packages
from keras.models import Sequential
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
from keras.layers.core import Dense
from keras import backend as K
class S... | {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,155 | sourander/selfiebooth | refs/heads/master | /modules/__init__.py |
from modules.conf import Conf
from modules.imagedatahandler import ImageDataHandler
| {"/selfie-generator.py": ["/modules/__init__.py"], "/selfiebooth.py": ["/modules/__init__.py"], "/modules/nn/__init__.py": ["/modules/nn/selfienet.py"], "/train.py": ["/modules/nn/__init__.py", "/modules/__init__.py"], "/modules/__init__.py": ["/modules/imagedatahandler.py"]} |
85,159 | henryhenrychen/Multi-CTC | refs/heads/master | /src/generate_vocab_file.py | import pandas as pd
from pathlib import Path
metas = [
('meta/French.txt', 'fr'),
('meta/German.txt', 'de'),
('meta/Czech.txt', 'cs'),
('meta/English.txt', 'en'),
('meta/Spanish.txt', 'sp')
]
def generate_vocab(metas, target, output_dir):
name = '_'.join(map(lambda x: x[1], metas)) + f'.{targe... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,160 | henryhenrychen/Multi-CTC | refs/heads/master | /scripts/run_mono.py | import yaml
import os
import argparse
from pathlib import Path
import math
MAX_EPOCH =
# Arguments
parser = argparse.ArgumentParser(description='Training E2E asr.')
parser.add_argument('--base_config', type=str)
parser.add_argument('--output_path', type=str, default='ckpt/')
paras = parser.parse_args()
def run(outp... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,161 | henryhenrychen/Multi-CTC | refs/heads/master | /bin/test_asr.py | import copy
import torch
from tqdm import tqdm
from functools import partial
from joblib import Parallel, delayed
from src.solver import BaseSolver
from src.asr import ASR
from src.data import load_dataset
from src.util import cal_er
import editdistance as ed
from tqdm import tqdm
from pathlib import Path
import pdb
... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,162 | henryhenrychen/Multi-CTC | refs/heads/master | /src/solver.py | import os
import sys
import abc
import math
import yaml
from src.comet_marco import *
import comet_ml
from comet_ml import Experiment, ExistingExperiment
import torch
#from torch.utils.tensorboard import SummaryWriter
from src.option import default_hparas
from src.util import human_format, Timer
from src.text import ... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,163 | henryhenrychen/Multi-CTC | refs/heads/master | /preprocess/preprocess_libri.py | from pathlib import Path
import os
from tqdm import tqdm
from phonemizer.phonemize import phonemize
from joblib import Parallel, delayed
from functools import partial
langs = [
("English", 'en-us'),
]
root = '/home/henryhenrychen/DATA/corpus/LibriSpeech/LibriSpeech'
meta_dir = 'data'
def get_g2p_fn(code):
ret... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,164 | henryhenrychen/Multi-CTC | refs/heads/master | /src/asr.py | import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from src.util import init_weights, init_gate
from src.module import VGGExtractor, CNNExtractor, RNNLayer
from src.text import load_text_encoder
import json
import pdb
class ASR(nn.Module):
''' ASR CTC model '''
... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,165 | henryhenrychen/Multi-CTC | refs/heads/master | /src/summarize_test.py | import yaml
import os
import argparse
from pathlib import Path
import pandas as pd
import torch
import math
from pathlib import Path
from itertools import groupby
import torch
# Arguments
parser = argparse.ArgumentParser(description='Training E2E asr.')
parser.add_argument('--result_root', type=str)
parser.add_argu... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,166 | henryhenrychen/Multi-CTC | refs/heads/master | /bin/train_asr.py | import torch
from src.solver import BaseSolver
from src.asr import ASR
from src.optim import Optimizer
from src.data import load_dataset
from src.util import human_format, cal_er, feat_to_fig
import pdb
import math
SAVE_EVERY = True
class Solver(BaseSolver):
''' Solver for training'''
def __init__(self, con... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,167 | henryhenrychen/Multi-CTC | refs/heads/master | /preprocess/czi.py | # Reference: http://homepage.ntu.edu.tw/~karchung/ChineseIPAJimmyrev.pdf
table = [
('ㄧㄚ', 'jɑ', None, 'iɑ'),
('ㄧㄠ', 'jɑu', None, 'iɑu'),
('ㄧㄝ', 'jɛ', None, 'iɛ'),
('ㄧㄡ', 'jou', None, 'iou'),
('ㄧㄛ', 'jɔ', None, None), # add
('ㄧㄢ', 'jɛn', None, 'iɛn'),
('ㄧㄞ', 'jai', None, None), ... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,168 | henryhenrychen/Multi-CTC | refs/heads/master | /preprocess/preprocess_ner.py | from pathlib import Path
import os
from tqdm import tqdm
from joblib import Parallel, delayed
from functools import partial
import random
import re
root = '/home/henryhenrychen/DATA/corpus/NER-Trs-Vol1'
meta_dir = 'data'
from opencc import OpenCC
from dragonmapper import hanzi
from czi import Converter_zh_ipa
UNWANT... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,169 | henryhenrychen/Multi-CTC | refs/heads/master | /scripts/split_bash_script.py | import yaml
import os
import argparse
from pathlib import Path
import pandas as pd
import torch
import math
# Arguments
parser = argparse.ArgumentParser(description='Training E2E asr.')
parser.add_argument('--script', type=str)
parser.add_argument('--device_num', type=int)
paras = parser.parse_args()
def exec(args... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,170 | henryhenrychen/Multi-CTC | refs/heads/master | /scripts/run_adapt.py | import yaml
import os
import argparse
from pathlib import Path
import pandas as pd
import torch
import math
VALID_EVERY_EPOCH = 5
TOTAL_EPOCH = 800
frac_discount = {1:2}
# Arguments
parser = argparse.ArgumentParser(description='Training E2E asr.')
parser.add_argument('--pretrain_path', type=str)
parser.add_argument... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,171 | henryhenrychen/Multi-CTC | refs/heads/master | /preprocess/preprocess_gp.py | from pathlib import Path
import os
from tqdm import tqdm
from phonemizer import phonemize
from joblib import Parallel, delayed
from functools import partial
langs = [
#("German", 'de'),
("French", 'fr-fr'),
#("Czech", 'cs'),
#("Spanish", 'es')
]
root = 'GlobalPhone'
meta_dir = 'data'
def get_g2p_fn(co... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,172 | henryhenrychen/Multi-CTC | refs/heads/master | /scripts/run_test.py | import yaml
import os
import argparse
from pathlib import Path
import pandas as pd
import torch
import math
# Arguments
parser = argparse.ArgumentParser(description='Training E2E asr.')
parser.add_argument('--model_path', type=str)
parser.add_argument('--output_path', type=str, default='result/')
parser.add_argument... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,173 | henryhenrychen/Multi-CTC | refs/heads/master | /src/comet_marco.py | COMET_PROJECT_NAME="multi-ctc"
# COMET_PROJECT_NAME="test"
COMET_WORKSPACE="henryhenrychen"
| {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,174 | henryhenrychen/Multi-CTC | refs/heads/master | /corpus/globalphone.py | from tqdm import tqdm
from pathlib import Path
from torch.utils.data import Dataset
import pandas as pd
import pdb
import math
code2weight = {
'FR': 25,
'GE': 15,
'SP': 17.5,
'CZ': 27
}
code2path = {
'FR': 'French',
'GE': 'German',
'SP': 'Spanish',
'CZ': 'Czech'
}
# TODO
LIBRI_... | {"/bin/test_asr.py": ["/src/solver.py", "/src/asr.py"], "/src/solver.py": ["/src/comet_marco.py"], "/bin/train_asr.py": ["/src/solver.py", "/src/asr.py"]} |
85,175 | mareksapota-lyft/awspricing | refs/heads/master | /awspricing/offers.py | from collections import defaultdict
import logging
from typing import Any, Dict, List, Optional, Set, Type # noqa
import six
from .constants import (
REGION_SHORTS,
EC2_LEASE_CONTRACT_LENGTH,
EC2_OFFERING_CLASS,
EC2_PURCHASE_OPTION,
RDS_LEASE_CONTRACT_LENGTH,
RDS_OFFERING_CLASS,
RDS_PURC... | {"/tests/unit/test_offers.py": ["/awspricing/offers.py", "/tests/data/ec2_offer.py"], "/awspricing/__init__.py": ["/awspricing/offers.py", "/awspricing/cache.py"]} |
85,176 | mareksapota-lyft/awspricing | refs/heads/master | /tests/data/ec2_offer.py |
BASIC_EC2_OFFER_SKU = '4C7N4APU9GEUZ6H6'
# Includes one variation of the c4.xlarge product and just Partial Upfront RIs.
BASIC_EC2_OFFER_DATA = {
'offerCode': 'AmazonEC2',
'version': '20161213014831',
'products': {
'4C7N4APU9GEUZ6H6' : {
'sku' : '4C7N4APU9GEUZ6H6',
'product... | {"/tests/unit/test_offers.py": ["/awspricing/offers.py", "/tests/data/ec2_offer.py"], "/awspricing/__init__.py": ["/awspricing/offers.py", "/awspricing/cache.py"]} |
85,177 | mareksapota-lyft/awspricing | refs/heads/master | /tests/unit/test_offers.py | import copy
import pytest
from awspricing.offers import AWSOffer, EC2Offer
from awspricing.constants import EC2_PURCHASE_OPTION, EC2_LEASE_CONTRACT_LENGTH
from tests.data.ec2_offer import BASIC_EC2_OFFER_DATA, BASIC_EC2_OFFER_SKU
class TestAWSOffer(object):
@pytest.fixture(name='offer')
def basic_offer(se... | {"/tests/unit/test_offers.py": ["/awspricing/offers.py", "/tests/data/ec2_offer.py"], "/awspricing/__init__.py": ["/awspricing/offers.py", "/awspricing/cache.py"]} |
85,178 | mareksapota-lyft/awspricing | refs/heads/master | /awspricing/__init__.py | import requests
from requests.adapters import HTTPAdapter
from typing import Dict, Type # noqa
from .offers import AWSOffer, get_offer_class # noqa
from .cache import maybe_read_from_cache, maybe_write_to_cache
__version__ = "1.1.1"
session = requests.Session()
session.mount('http://', HTTPAdapter(max_retries=5)... | {"/tests/unit/test_offers.py": ["/awspricing/offers.py", "/tests/data/ec2_offer.py"], "/awspricing/__init__.py": ["/awspricing/offers.py", "/awspricing/cache.py"]} |
85,179 | mareksapota-lyft/awspricing | refs/heads/master | /tests/data/rds_offer.py | BASIC_RDS_W_EDITION_SKU = "UHQB4SMCY7W62UNV"
BASIC_RDS_WO_EDITION_SKU = "RYXYA7XK2PDKTNV4"
# One with databaseEdition and one without
BASIC_RDS_OFFER_DATA = {
"offerCode": "AmazonRDS",
"version": "20170419200300",
"products": {
"UHQB4SMCY7W62UNV": {
"sku": "UHQB4SMCY7W62UNV",
"productFamily": "D... | {"/tests/unit/test_offers.py": ["/awspricing/offers.py", "/tests/data/ec2_offer.py"], "/awspricing/__init__.py": ["/awspricing/offers.py", "/awspricing/cache.py"]} |
85,180 | mareksapota-lyft/awspricing | refs/heads/master | /awspricing/cache.py | import os
import json
import logging
import re
import time
_USE_CACHE = None
_CACHE_PATH = None
_CACHE_MINUTES = None
DEFAULT_USE_CACHE = '0' # False
DEFAULT_CACHE_PATH = os.path.join('/tmp', 'awspricing')
DEFAULT_CACHE_MINUTES = '1440' # 1 day
logger = logging.getLogger(__name__)
def use_cache():
global ... | {"/tests/unit/test_offers.py": ["/awspricing/offers.py", "/tests/data/ec2_offer.py"], "/awspricing/__init__.py": ["/awspricing/offers.py", "/awspricing/cache.py"]} |
85,186 | knyghty/bord | refs/heads/master | /accounts/tests/test_user.py | """Tests for the User model."""
from django.contrib.auth import get_user_model
import pytest
@pytest.fixture(scope='module')
def user():
"""Create a user to test with."""
return get_user_model().objects.create_user(username='Test', password='correcthorsebatterystaple')
@pytest.mark.django_db
def test_get_... | {"/accounts/views.py": ["/accounts/forms.py"]} |
85,187 | knyghty/bord | refs/heads/master | /accounts/models.py | from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager
from django.contrib.auth.validators import ASCIIUsernameValidator
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class User(AbstractBaseUser, PermissionsMixin)... | {"/accounts/views.py": ["/accounts/forms.py"]} |
85,188 | knyghty/bord | refs/heads/master | /accounts/forms.py | from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm
class UserCreationForm(UserCreationForm):
"""A form that creates a user."""
class Meta(UserCreationForm.Meta):
model = get_user_model()
fields = ('username', 'email')
| {"/accounts/views.py": ["/accounts/forms.py"]} |
85,189 | knyghty/bord | refs/heads/master | /accounts/urls.py | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
url(r'^login/$', auth_views.login, name='login'),
url(r'^register/$', views.RegistrationView.as_view(), name='register'),
]
| {"/accounts/views.py": ["/accounts/forms.py"]} |
85,190 | knyghty/bord | refs/heads/master | /accounts/views.py | from registration.backends.simple.views import RegistrationView
from .forms import UserCreationForm
class RegistrationView(RegistrationView):
form_class = UserCreationForm
| {"/accounts/views.py": ["/accounts/forms.py"]} |
85,191 | knyghty/bord | refs/heads/master | /bord/settings.py | """Settings for BORD."""
import os
import dj_database_url
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Useful constants.
_TRUTHY_STRINGS = ('true', 'yes', 'on')
# Useful functions.
def _getenv_bool(key):
va... | {"/accounts/views.py": ["/accounts/forms.py"]} |
85,192 | knyghty/bord | refs/heads/master | /core/views.py | from django.views import generic
class HomeView(generic.TemplateView):
"""Home page."""
# TODO: For now we just show a different template, but in future we need to do some logic:
# If user is not logged in, we just show the template with links to login and register.
# Otherwise:
# If user is rekt... | {"/accounts/views.py": ["/accounts/forms.py"]} |
85,193 | knyghty/bord | refs/heads/master | /bord/urls.py | """Root URL definitions."""
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^accounts/', include('accounts.urls', namespace='accounts')),
url(r'^admin/', admin.site.urls),
url(r'^'... | {"/accounts/views.py": ["/accounts/forms.py"]} |
85,195 | CodeLabClub/lively.py | refs/heads/master | /lively/completions.py | import inspect
import jedi
from lively.eval import run_eval
async def get_completions(source, row, column, file="<completions>"):
compl_data = []
# try jedi
script = jedi.Script(source, row, column, file)
completions = script.completions()
if (len(completions) > 0):
compl_attrs = ["module_... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,196 | CodeLabClub/lively.py | refs/heads/master | /lively/command_line.py | # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# main
import argparse
import asyncio
from lively.ws_server import (start, default_host, default_port)
def main():
parser = argparse.ArgumentParser(description='Starts a websocket or epc server for eval requests')
parser.add_argument('--hostname', dest=... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,197 | CodeLabClub/lively.py | refs/heads/master | /lively/ast_helper.py | import ast
def print_ast(node):
def __print__(node, path):
if len(path) > 0:
print(path[-1])
path_from_parent = path[-1] if len(path) > 0 else []
return "{}{} ({})".format(
" " * len(path),
node.__class__.__name__,
".".join(map(str, path_from... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,198 | CodeLabClub/lively.py | refs/heads/master | /lively/epc_server.py | """
Server for epc / emacs connections.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Client code:
(require 'epc)
(setq epc:debug-out t)
;; (setq my-epc (epc:start-epc "python" '("lively/epc-server.py")))
(setq my-epc
(epc:init-epc-layer
(make-epc:manager :server-process nil
... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,199 | CodeLabClub/lively.py | refs/heads/master | /lively/tests/test_interface.py | # nodemon -x python -- -m unittest lively/tests/test_interface.py
import sys
from unittest import TestCase
import json
from lively.eval import sync_eval, run_eval
from lively.completions import get_completions
from lively.code_formatting import code_format
from lively.tests.helper import async_test
# runner = unit... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,200 | CodeLabClub/lively.py | refs/heads/master | /lively/tests/some-test-module.py | global_var = 23
| {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,201 | CodeLabClub/lively.py | refs/heads/master | /lively/eval.py | import sys
import io
import asyncio
import json
import ast
from sexpdata import SExpBase
from logging import warning
class EvalResult(SExpBase):
"""result of run_eval"""
def __init__(self, value, stdout="", stderr="", is_error=False):
super().__init__(value)
self.value = value
self.st... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,202 | CodeLabClub/lively.py | refs/heads/master | /lively/inspect_helpers.py | import math
from collections import Iterable
import pprint
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# tree printing
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
def print_tree(node, print_fn, child_fn, depth=0):
printed = print_fn(node)
children = child_fn(node)
if children a... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,203 | CodeLabClub/lively.py | refs/heads/master | /setup.py | from setuptools import setup, find_packages
from os import path
import unittest
here = path.abspath(path.dirname(__file__))
version = "0.1.1"
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def tests():
# return unittest.findTestCases("lively.tests.test_interface")... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,204 | CodeLabClub/lively.py | refs/heads/master | /lively/ws_server.py | import asyncio
from multiprocessing import Process
import json
import traceback
import websockets
from lively.eval import run_eval
from lively.completions import get_completions
from lively.code_formatting import code_format
def test():
loop = asyncio.get_event_loop()
start("0.0.0.0", 9942, loop)
debug = Tru... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,205 | CodeLabClub/lively.py | refs/heads/master | /lively/code_formatting.py | from yapf.yapflib.yapf_api import FormatCode
# see https://github.com/google/yapf
def code_format(source, lines=None, file="<formatted>", config=None):
formatted_code, success = FormatCode(source,
filename=file,
style_config=config... | {"/lively/completions.py": ["/lively/eval.py"], "/lively/command_line.py": ["/lively/ws_server.py"], "/lively/epc_server.py": ["/lively/eval.py", "/lively/code_formatting.py", "/lively/completions.py"], "/lively/tests/test_interface.py": ["/lively/eval.py", "/lively/completions.py", "/lively/code_formatting.py"], "/liv... |
85,207 | avishayil/pysnyk | refs/heads/master | /snyk/test_models.py | import re
import pytest # type: ignore
from snyk.client import SnykClient
from snyk.errors import SnykError, SnykNotFoundError, SnykNotImplementedError
from snyk.models import Integration, Member, Organization, Project
class TestModels(object):
@pytest.fixture
def organization(self):
org = Organiza... | {"/snyk/test_models.py": ["/snyk/models.py"]} |
85,208 | avishayil/pysnyk | refs/heads/master | /snyk/models.py | import base64
from dataclasses import InitVar, dataclass, field
from typing import Any, Dict, List, Optional, Union
import requests
from mashumaro import DataClassJSONMixin # type: ignore
from .errors import SnykError, SnykNotImplementedError
from .managers import Manager
@dataclass
class Vulnerability(DataClassJS... | {"/snyk/test_models.py": ["/snyk/models.py"]} |
85,209 | xuxuehua/flask_api | refs/heads/main | /operators.py | import subprocess
query_port = 'firewall-cmd --permanent --add-port={src_port}/tcp'
add_port = '''
firewall-cmd --permanent --add-masquerade
firewall-cmd --permanent --add-port={src_port}/tcp
firewall-cmd --permanent --add-port={src_port}/udp
firewall-cmd --permanent --add-forward-port=port={src_port}:proto=tcp:toaddr... | {"/main.py": ["/api_response.py", "/operators.py"]} |
85,210 | xuxuehua/flask_api | refs/heads/main | /main.py | from flask import Flask, request, Blueprint
from flask_restful import reqparse, Api, Resource
import json
from api_response import http201
from operators import firewalld_configuration
app = Flask(__name__)
api = Api(app)
class ApiRequestArgs(Resource):
def post_request(self, **all_args):
if isinstance... | {"/main.py": ["/api_response.py", "/operators.py"]} |
85,211 | xuxuehua/flask_api | refs/heads/main | /api_response.py | from enum import Enum
class ApiResult(Enum):
SUCCESS = "SUCCESS"
FAILED = "FAILED"
class ApiResponse:
def __init__(self, result, message=None, data=None):
self.result = result
self.message = message
self.data = data
def json_output(self):
return {
... | {"/main.py": ["/api_response.py", "/operators.py"]} |
85,232 | hareshkat/pan_ocr | refs/heads/master | /test.py | import unittest
from app import app
import io
class PanOcrTests(unittest.TestCase):
def test_site_access(self):
tester = app.test_client(self)
response = tester.get('/', content_type='html/text')
self.assertEqual(response.status_code, 200)
def test_upload_text_file(self):
teste... | {"/test.py": ["/app.py"], "/app.py": ["/pan_ocr.py"], "/pan_ocr.py": ["/validation.py"]} |
85,233 | hareshkat/pan_ocr | refs/heads/master | /app.py | from flask import Flask, request, jsonify, render_template, flash
from pan_ocr import get_pan_details, face_detect
import os
ALLOWED_EXTENSIONS = {'jpg', 'png', 'jpeg'}
app = Flask(__name__)
app.config['SECRET_KEY'] = 'as%#$5YTfg&^*jg97&(&VJ&'
app.config["UPLOAD_FOLDER"] = 'static'
#set the cache control max age to ... | {"/test.py": ["/app.py"], "/app.py": ["/pan_ocr.py"], "/pan_ocr.py": ["/validation.py"]} |
85,234 | hareshkat/pan_ocr | refs/heads/master | /validation.py | """
validate the name, father name and PAN number data either by reguler expression
or by replcaing the similar visible characters/numbers to numbers/characters.
"""
import re
def validate_name(name):
name=name.upper()
name=name.strip()
name = name.replace("8", "B")
name = name.replace("0", "O")
n... | {"/test.py": ["/app.py"], "/app.py": ["/pan_ocr.py"], "/pan_ocr.py": ["/validation.py"]} |
85,235 | hareshkat/pan_ocr | refs/heads/master | /pan_ocr.py | import pytesseract
import numpy as np
import cv2
import re
import validation
from PIL import Image, ImageEnhance
from datetime import datetime
import ftfy
import base64
from image_morphing import process_image
from flask import flash
import os
#provide ull path to your tesseract executable.
pytesseract.pytesseract.tes... | {"/test.py": ["/app.py"], "/app.py": ["/pan_ocr.py"], "/pan_ocr.py": ["/validation.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.