repo_name stringclasses 100
values | file_path stringlengths 5 100 | file_content stringlengths 27 51.9k | imported_files_content stringlengths 45 239k | import_relationships dict |
|---|---|---|---|---|
shuishen112/pairwise-rnn | /models/__init__.py | from .QA_CNN_pairwise import QA_CNN_extend as CNN
from .QA_RNN_pairwise import QA_RNN_extend as RNN
from .QA_CNN_quantum_pairwise import QA_CNN_extend as QCNN
def setup(opt):
if opt["model_name"]=="cnn":
model=CNN(opt)
elif opt["model_name"]=="rnn":
model=RNN(opt)
elif opt['model_name']=='qcnn':
model=QCNN(opt... | #coding:utf-8
import tensorflow as tf
import numpy as np
from tensorflow.contrib import rnn
import models.blocks as blocks
# model_type :apn or qacnn
class QA_CNN_extend(object):
# def __init__(self,max_input_left,max_input_right,batch_size,vocab_size,embedding_size,filter_sizes,num_filters,hidden_size,
# dro... | {
"imported_by": [],
"imports": [
"/models/QA_CNN_pairwise.py"
]
} |
shuishen112/pairwise-rnn | /run.py | from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime,os
import models
import numpy as np
import evaluation
import sys
import logging
import time
now = int(time.time())
timeArray = time.localtime(now)
timeStamp = time.strftime("%Y%m%d%H%M%S", timeArray)... | #-*- coding:utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import string
from collections import Counter
import pandas as pd
from tqdm import tqdm
import random
from functools import wraps
import time
import pickle
def log_time_delta(func):
@wraps(func)
def _deco(*args, **kwargs):
star... | {
"imported_by": [],
"imports": [
"/data_helper.py",
"/config.py"
]
} |
shuishen112/pairwise-rnn | /test.py | # -*- coding: utf-8 -*-
from tensorflow import flags
import tensorflow as tf
from config import Singleton
import data_helper
import datetime
import os
import models
import numpy as np
import evaluation
from data_helper import log_time_delta,getLogger
logger=getLogger()
args = Singleton().get_rnn_flag()
#args... | #-*- coding:utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import string
from collections import Counter
import pandas as pd
from tqdm import tqdm
import random
from functools import wraps
import time
import pickle
def log_time_delta(func):
@wraps(func)
def _deco(*args, **kwargs):
star... | {
"imported_by": [],
"imports": [
"/data_helper.py",
"/config.py"
]
} |
Sssssbo/SDCNet | /SDCNet.py | import datetime
import os
import time
import torch
from torch import nn
from torch import optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision import transforms
import pandas as pd
import numpy as np
import joint_transforms
from config import msra10k_path, MTDD_train_path... | import torch
import torch.nn.functional as F
from torch import nn
from resnext import ResNeXt101
class R3Net(nn.Module):
def __init__(self):
super(R3Net, self).__init__()
res50 = ResNeXt101()
self.layer0 = res50.layer0
self.layer1 = res50.layer1
self.layer2 = res50.layer2
... | {
"imported_by": [],
"imports": [
"/model.py",
"/datasets.py",
"/misc.py"
]
} |
Sssssbo/SDCNet | /create_free.py | import numpy as np
import os
import torch
from PIL import Image
from torch.autograd import Variable
from torchvision import transforms
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
import cv2
import numpy as np
from config import ecssd_path, hkuis_pa... | import os
import os.path
import torch.utils.data as data
from PIL import Image
class ImageFolder_joint(data.Dataset):
# image and gt should be in the same folder and have same filename except extended name (jpg and png respectively)
def __init__(self, label_list, joint_transform=None, transform=None, target_... | {
"imported_by": [],
"imports": [
"/datasets.py",
"/misc.py"
]
} |
Sssssbo/SDCNet | /infer_SDCNet.py | import numpy as np
import os
import torch
import torch.nn.functional as F
from PIL import Image
from torch.autograd import Variable
from torchvision import transforms
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import pandas as pd
from tqdm import tqdm
from misc import check_mkdir, AvgMete... | import torch
import torch.nn.functional as F
from torch import nn
from resnext import ResNeXt101
class R3Net(nn.Module):
def __init__(self):
super(R3Net, self).__init__()
res50 = ResNeXt101()
self.layer0 = res50.layer0
self.layer1 = res50.layer1
self.layer2 = res50.layer2
... | {
"imported_by": [],
"imports": [
"/model.py",
"/datasets.py",
"/misc.py"
]
} |
Sssssbo/SDCNet | /model/make_model.py | import torch
import torch.nn as nn
from .backbones.resnet import ResNet, Comb_ResNet, Pure_ResNet, Jointin_ResNet, Jointout_ResNet, BasicBlock, Bottleneck, GDN_Bottleneck, IN_Bottleneck, IN2_Bottleneck, SNR_Bottleneck, SNR2_Bottleneck, SNR3_Bottleneck
from loss.arcface import ArcFace
from .backbones.resnet_ibn_a import... | import math
import torch
from torch import nn
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False)
class BasicBlock(nn.Module):
expansion = 1
def __init__(s... | {
"imported_by": [],
"imports": [
"/model/backbones/resnet.py"
]
} |
Sssssbo/SDCNet | /resnet/__init__.py | from .make_model import ResNet50, ResNet50_BIN, ResNet50_LowIN | from .resnet import ResNet, BasicBlock, Bottleneck
import torch
from torch import nn
from .config import resnet50_path
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'resnet50': 'https://downlo... | {
"imported_by": [],
"imports": [
"/resnet/make_model.py"
]
} |
riadghorra/whiteboard-oop-project | /src/client.py | import socket
import json
import sys
import math
from white_board import WhiteBoard, binary_to_dict
'''
Ouverture de la configuration initiale stockée dans config.json qui contient le mode d'écriture, la couleur et
la taille d'écriture.
Ces Paramètres sont ensuite à modifier par l'utisateur dans l'interface pygame
'... | import pygame
import pygame.draw
import json
import sys
from functools import reduce
import operator
from figures import TextBox, draw_line, draw_point, draw_textbox, draw_rect, draw_circle
from tools import Mode, ColorBox, Auth, Save, FontSizeBox, HandlePoint, HandleLine, HandleText, HandleRect, HandleCircle
import co... | {
"imported_by": [],
"imports": [
"/src/white_board.py"
]
} |
riadghorra/whiteboard-oop-project | /src/main.py | from white_board import WhiteBoard
import json
'''
This file is used to run locally or to debug
'''
with open('config.json') as json_file:
start_config = json.load(json_file)
def main():
board = WhiteBoard("client", start_config)
board.start_local()
if __name__ == '__main__':
main()
| import pygame
import pygame.draw
import json
import sys
from functools import reduce
import operator
from figures import TextBox, draw_line, draw_point, draw_textbox, draw_rect, draw_circle
from tools import Mode, ColorBox, Auth, Save, FontSizeBox, HandlePoint, HandleLine, HandleText, HandleRect, HandleCircle
import co... | {
"imported_by": [],
"imports": [
"/src/white_board.py"
]
} |
riadghorra/whiteboard-oop-project | /src/tools.py | """
Module contenant les differents outils de gestion du tableau
"""
import pygame
import pygame.draw
from datetime import datetime
from figures import Point, Line, TextBox, Rectangle, Circle
import time
# =============================================================================
# classes de gestion des changemen... | """
Module contenant toutes les figures et opérations de base
"""
import pygame
import pygame.draw
from datetime import datetime
def distance(v1, v2):
"""
Calcule la distance euclidienne entre deux vecteurs
"""
try:
return ((v1[0] - v2[0]) ** 2 + (v1[1] - v2[1]) ** 2) ** 0.5
except TypeEr... | {
"imported_by": [
"/src/white_board.py"
],
"imports": [
"/src/figures.py"
]
} |
riadghorra/whiteboard-oop-project | /src/white_board.py | import pygame
import pygame.draw
import json
import sys
from functools import reduce
import operator
from figures import TextBox, draw_line, draw_point, draw_textbox, draw_rect, draw_circle
from tools import Mode, ColorBox, Auth, Save, FontSizeBox, HandlePoint, HandleLine, HandleText, HandleRect, HandleCircle
import co... | """
Module contenant toutes les figures et opérations de base
"""
import pygame
import pygame.draw
from datetime import datetime
def distance(v1, v2):
"""
Calcule la distance euclidienne entre deux vecteurs
"""
try:
return ((v1[0] - v2[0]) ** 2 + (v1[1] - v2[1]) ** 2) ** 0.5
except TypeEr... | {
"imported_by": [
"/src/client.py",
"/src/main.py"
],
"imports": [
"/src/figures.py",
"/src/tools.py"
]
} |
pyfaddist/yafcorse | /tests/conftest.py | import pytest
from flask import Flask
from yafcorse import Yafcorse
@pytest.fixture()
def app():
app = Flask(__name__)
cors = Yafcorse({
'origins': '*',
'allowed_methods': ['GET', 'POST', 'PUT'],
'allowed_headers': ['Content-Type', 'X-Test-Header'],
'allow_credentials': True,... | import re
from typing import Callable, Iterable
from flask import Flask, Response, request
# Yet Another Flask CORS Extension
# --------------------------------
# Based on https://developer.mozilla.org/de/docs/Web/HTTP/CORS
# DEFAULT_CONFIGURATION = {
# 'origins': '*',
# 'allowed_methods': ['GET', 'HEAD', 'PO... | {
"imported_by": [],
"imports": [
"/src/yafcorse/__init__.py"
]
} |
pyfaddist/yafcorse | /tests/test_ceate_extensions.py | from flask.app import Flask
from yafcorse import Yafcorse
def test_extension(app: Flask):
assert app.extensions.get('yafcorse') is not None
assert isinstance(app.extensions.get('yafcorse'), Yafcorse)
| import re
from typing import Callable, Iterable
from flask import Flask, Response, request
# Yet Another Flask CORS Extension
# --------------------------------
# Based on https://developer.mozilla.org/de/docs/Web/HTTP/CORS
# DEFAULT_CONFIGURATION = {
# 'origins': '*',
# 'allowed_methods': ['GET', 'HEAD', 'PO... | {
"imported_by": [],
"imports": [
"/src/yafcorse/__init__.py"
]
} |
pyfaddist/yafcorse | /tests/test_origins_function.py | import pytest
from flask import Flask, Response
from flask.testing import FlaskClient
from yafcorse import Yafcorse
@pytest.fixture()
def local_app():
app = Flask(__name__)
cors = Yafcorse({
'allowed_methods': ['GET', 'POST', 'PUT'],
'allowed_headers': ['Content-Type', 'X-Test-Header'],
... | import re
from typing import Callable, Iterable
from flask import Flask, Response, request
# Yet Another Flask CORS Extension
# --------------------------------
# Based on https://developer.mozilla.org/de/docs/Web/HTTP/CORS
# DEFAULT_CONFIGURATION = {
# 'origins': '*',
# 'allowed_methods': ['GET', 'HEAD', 'PO... | {
"imported_by": [],
"imports": [
"/src/yafcorse/__init__.py"
]
} |
ericfourrier/auto-clean | /autoc/__init__.py | __all__ = ["explorer", "naimputer"]
from .explorer import DataExploration
from .naimputer import NaImputer
from .preprocess import PreProcessor
from .utils.getdata import get_dataset
# from .preprocess import PreProcessor
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : This is a framework for Modeling with pandas, numpy and skicit-learn.
The Goal of this module is to rely on a dataframe structure for modelling g
"""
#########################################################
# Import modules and global h... | {
"imported_by": [],
"imports": [
"/autoc/explorer.py",
"/autoc/naimputer.py",
"/autoc/preprocess.py",
"/autoc/utils/getdata.py"
]
} |
ericfourrier/auto-clean | /autoc/explorer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : This is a framework for Modeling with pandas, numpy and skicit-learn.
The Goal of this module is to rely on a dataframe structure for modelling g
"""
#########################################################
# Import modules and global h... | # -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : Create toolbox functions to use for the different pieces of code ot the package
"""
from numpy.random import normal
from numpy.random import choice
import time
import pandas as pd
import numpy as np
import functools
def print_section(section_name, width=120):... | {
"imported_by": [
"/test.py",
"/autoc/naimputer.py",
"/autoc/preprocess.py",
"/autoc/__init__.py",
"/autoc/outliersdetection.py"
],
"imports": [
"/autoc/utils/helpers.py",
"/autoc/exceptions.py"
]
} |
ericfourrier/auto-clean | /autoc/naimputer.py | from autoc.explorer import DataExploration, pd
from autoc.utils.helpers import cserie
import seaborn as sns
import matplotlib.pyplot as plt
#from autoc.utils.helpers import cached_property
from autoc.utils.corrplot import plot_corrmatrix
import numpy as np
from scipy.stats import ttest_ind
from scipy.stats.mstats impor... | # -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : Create toolbox functions to use for the different pieces of code ot the package
"""
from numpy.random import normal
from numpy.random import choice
import time
import pandas as pd
import numpy as np
import functools
def print_section(section_name, width=120):... | {
"imported_by": [
"/test.py",
"/autoc/__init__.py"
],
"imports": [
"/autoc/utils/helpers.py",
"/autoc/utils/corrplot.py",
"/autoc/explorer.py"
]
} |
ericfourrier/auto-clean | /autoc/outliersdetection.py | """
@author: efourrier
Purpose : This is a simple experimental class to detect outliers. This class
can be used to detect missing values encoded as outlier (-999, -1, ...)
"""
from autoc.explorer import DataExploration, pd
import numpy as np
#from autoc.utils.helpers import cserie
from exceptions import NotNumericC... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : This is a framework for Modeling with pandas, numpy and skicit-learn.
The Goal of this module is to rely on a dataframe structure for modelling g
"""
#########################################################
# Import modules and global h... | {
"imported_by": [
"/test.py"
],
"imports": [
"/autoc/explorer.py",
"/autoc/exceptions.py"
]
} |
ericfourrier/auto-clean | /autoc/preprocess.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : The purpose of this class is too automaticely transfrom a DataFrame
into a numpy ndarray in order to use an aglorithm
"""
#########################################################
# Import modules and global helpers
#####################... | # -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : Create toolbox functions to use for the different pieces of code ot the package
"""
from numpy.random import normal
from numpy.random import choice
import time
import pandas as pd
import numpy as np
import functools
def print_section(section_name, width=120):... | {
"imported_by": [
"/autoc/__init__.py"
],
"imports": [
"/autoc/utils/helpers.py",
"/autoc/explorer.py",
"/autoc/exceptions.py"
]
} |
ericfourrier/auto-clean | /test.py | # -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : Automated test suites with unittest
run "python -m unittest -v test" in the module directory to run the tests
The clock decorator in utils will measure the run time of the test
"""
#########################################################
# Import Packages an... | # -*- coding: utf-8 -*-
"""
@author: efourrier
Purpose : Create toolbox functions to use for the different pieces of code ot the package
"""
from numpy.random import normal
from numpy.random import choice
import time
import pandas as pd
import numpy as np
import functools
def print_section(section_name, width=120):... | {
"imported_by": [],
"imports": [
"/autoc/utils/helpers.py",
"/autoc/outliersdetection.py",
"/autoc/explorer.py",
"/autoc/naimputer.py",
"/autoc/utils/getdata.py"
]
} |
thinkAmi-sandbox/AWS_CDK-sample | /step_functions/app.py | #!/usr/bin/env python3
from aws_cdk import core
from step_functions.step_functions_stack import StepFunctionsStack
app = core.App()
# CFnのStack名を第2引数で渡す
StepFunctionsStack(app, 'step-functions')
app.synth()
| import pathlib
from aws_cdk import core
from aws_cdk.aws_iam import PolicyStatement, Effect, ManagedPolicy, ServicePrincipal, Role
from aws_cdk.aws_lambda import AssetCode, LayerVersion, Function, Runtime
from aws_cdk.aws_s3 import Bucket
from aws_cdk.aws_stepfunctions import Task, StateMachine, Parallel
from aws_cdk.... | {
"imported_by": [],
"imports": [
"/step_functions/step_functions/step_functions_stack.py"
]
} |
greenmato/slackline-spots | /spots-api/map/api.py | from abc import ABC, ABCMeta, abstractmethod
from django.forms.models import model_to_dict
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decor... | from django import forms
from django.forms import ModelForm, Textarea
from map.models import Spot, Rating, Vote
class SpotForm(ModelForm):
class Meta:
model = Spot
fields = ['name', 'description', 'latitude', 'longitude']
widgets = {
'latitude': forms.HiddenInput(),
... | {
"imported_by": [
"/spots-api/map/urls.py"
],
"imports": [
"/spots-api/map/forms.py",
"/spots-api/map/models.py"
]
} |
greenmato/slackline-spots | /spots-api/map/forms.py | from django import forms
from django.forms import ModelForm, Textarea
from map.models import Spot, Rating, Vote
class SpotForm(ModelForm):
class Meta:
model = Spot
fields = ['name', 'description', 'latitude', 'longitude']
widgets = {
'latitude': forms.HiddenInput(),
... | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
class Spot(models.Model):
name = models.CharField(max_length=50)
description = models.CharField(max_length=500)
latitude = models.DecimalField(max_digits=10, decimal_places=7)
longitude = models.Decim... | {
"imported_by": [
"/spots-api/map/api.py"
],
"imports": [
"/spots-api/map/models.py"
]
} |
greenmato/slackline-spots | /spots-api/map/urls.py | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from map.views import MapView
from map.api import SpotsApi, SpotApi, RatingsApi, VotesApi
app_name = 'map'
urlpatterns = [
path('', MapView.as_view(), name='index'),
path('spots/', ... | from abc import ABC, ABCMeta, abstractmethod
from django.forms.models import model_to_dict
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decor... | {
"imported_by": [],
"imports": [
"/spots-api/map/api.py",
"/spots-api/map/views.py"
]
} |
katrii/ohsiha | /ohjelma/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from ohjelma.models import Song
from ohjelma.models import Track
import json
impo... | from django.db import models
from django.urls import reverse
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('Date published')
class Choice(models.Model):
question = models.ForeignKey(Question, on_delete=models.CASCADE)
choice_text = mode... | {
"imported_by": [],
"imports": [
"/ohjelma/models.py"
]
} |
lukasld/Flask-Video-Editor | /app/api/VideoProcessing.py | from werkzeug.utils import secure_filename
from functools import partial
import subprocess as sp
import time
import skvideo.io
import numpy as np
import threading
import ffmpeg
import shlex
import cv2
import re
from PIL import Image
from werkzeug.datastructures import FileStorage as FStorage
from .. import VIDEO_EXT... | from flask import request, jsonify
from functools import wraps
from .errors import InvalidAPIUsage, InvalidFilterParams, IncorrectVideoFormat
"""
Almost like an Architect - makes decorations
"""
def decorator_maker(func):
def param_decorator(fn=None, does_return=None, req_c_type=None, req_type=None, arg=Non... | {
"imported_by": [
"/app/api/videoApi.py"
],
"imports": [
"/app/api/decorators.py",
"/app/api/errors.py"
]
} |
lukasld/Flask-Video-Editor | /app/api/decorators.py | from flask import request, jsonify
from functools import wraps
from .errors import InvalidAPIUsage, InvalidFilterParams, IncorrectVideoFormat
"""
Almost like an Architect - makes decorations
"""
def decorator_maker(func):
def param_decorator(fn=None, does_return=None, req_c_type=None, req_type=None, arg=Non... | import sys
import traceback
from flask import jsonify, request
from . import api
class InvalidAPIUsage(Exception):
status_code = 400
def __init__(self, message='', status_code=None):
super().__init__()
self.message = message
self.path = request.path
if status_code is None:
... | {
"imported_by": [
"/app/api/VideoProcessing.py"
],
"imports": [
"/app/api/errors.py"
]
} |
lukasld/Flask-Video-Editor | /app/api/videoApi.py | import os
from flask import Flask, request, redirect, \
url_for, session, jsonify, send_from_directory, make_response, send_file
from . import api
from . import utils
from .. import VIDEO_UPLOAD_PATH, FRAMES_UPLOAD_PATH, IMG_EXTENSION, VIDEO_EXTENSION, CACHE
from . VideoProcessing import Frame, Vide... | from werkzeug.utils import secure_filename
from functools import partial
import subprocess as sp
import time
import skvideo.io
import numpy as np
import threading
import ffmpeg
import shlex
import cv2
import re
from PIL import Image
from werkzeug.datastructures import FileStorage as FStorage
from .. import VIDEO_EXT... | {
"imported_by": [],
"imports": [
"/app/api/VideoProcessing.py",
"/app/api/errors.py"
]
} |
junprog/contrastive-baseline | /linear_eval.py | import os
import argparse
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
import torchvision.models as models
from datasets.cifar10 import get_simsiam_dataset
f... | import os
from collections import OrderedDict
import torch
import torch.nn as nn
import torchvision.models as models
class LinearEvalModel(nn.Module):
def __init__(self, arch='vgg19', dim=512, num_classes=10):
super().__init__()
if arch == 'vgg19':
self.features = models.vgg19().featu... | {
"imported_by": [],
"imports": [
"/models/create_linear_eval_model.py",
"/utils/visualizer.py",
"/datasets/cifar10.py"
]
} |
junprog/contrastive-baseline | /train.py | from utils.contrastive_trainer import CoTrainer
from utils.simsiam_trainer import SimSiamTrainer
import argparse
import os
import math
import torch
args = None
def parse_args():
parser = argparse.ArgumentParser(description='Train ')
parser.add_argument('--data-dir', default='/mnt/hdd02/process-ucf',
... | import os
import sys
import time
import logging
import numpy as np
import torch
from torch import optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
import torchvision.models as models
import torchvision.datasets as datasets
from models.siamese_net import SiameseNetwork
from models.l2... | {
"imported_by": [],
"imports": [
"/utils/contrastive_trainer.py",
"/utils/simsiam_trainer.py"
]
} |
junprog/contrastive-baseline | /utils/contrastive_trainer.py | import os
import sys
import time
import logging
import numpy as np
import torch
from torch import optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
import torchvision.models as models
import torchvision.datasets as datasets
from models.siamese_net import SiameseNetwork
from models.l2... | import os
import numpy as np
import torch
def worker_init_fn(worker_id):
np.random.seed(np.random.get_state()[1][0] + worker_id)
class Save_Handle(object):
"""handle the number of """
def __init__(self, max_num):
self.save_list = []
... | {
"imported_by": [
"/train.py"
],
"imports": [
"/utils/helper.py",
"/models/l2_contrastive_loss.py",
"/utils/visualizer.py",
"/datasets/spatial.py",
"/models/siamese_net.py",
"/datasets/cifar10.py"
]
} |
junprog/contrastive-baseline | /utils/simsiam_trainer.py | import os
import sys
import time
import logging
import numpy as np
import torch
from torch import optim
from torch.optim import lr_scheduler
from torch.utils.data import DataLoader
import torchvision.models as models
import torchvision.datasets as datasets
from models.simple_siamese_net import SiameseNetwork
from mo... | import os
import numpy as np
import torch
def worker_init_fn(worker_id):
np.random.seed(np.random.get_state()[1][0] + worker_id)
class Save_Handle(object):
"""handle the number of """
def __init__(self, max_num):
self.save_list = []
... | {
"imported_by": [
"/train.py"
],
"imports": [
"/utils/helper.py",
"/utils/visualizer.py",
"/datasets/spatial.py",
"/models/cosine_contrastive_loss.py",
"/datasets/cifar10.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/eval.py | from model.history_ import plot_metric_df
import pandas as pd
import matplotlib.pyplot as plt
import os
xx = os.getcwd()
path_root = '../report/result/'
task_name = 'ablation_time_all'
metric_list = []
metric_list_dir = ['metric_ablation_time_enh_10nrun_1Fold.csv',
'metric_ablation_time_vanilla_10nrun_1Fold.csv',
'me... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import math
plt.rc('font', family='Times New Roman')
font_size = 16
def plot_metric_df(history_list, task_name, val_flag='test_'):
if 'relapse_risk' in task_name:
metric_list = ['loss', 'f1']
else:
met... | {
"imported_by": [],
"imports": [
"/Regression/src/model/history_.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/learn_weight_main.py | # Copyright (c) 2017 - 2019 Uber Technologies, Inc.
#
# Licensed under the Uber Non-Commercial License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at the root directory of this project.
#
# See the License for the specific language governing... | import copy
import pandas as pd
import numpy as np
import lightgbm as lgb
from sklearn.linear_model import RidgeClassifierCV, LogisticRegressionCV, RidgeCV, LassoCV, LinearRegression
from keras.models import load_model
from keras import backend as K
from keras.optimizers import Adam, RMSprop, SGD
from keras.callbacks i... | {
"imported_by": [],
"imports": [
"/Regression/src/model/training_.py",
"/Regression/src/preprocess/get_dataset.py",
"/Regression/src/learn_rewieght/reweight.py",
"/Regression/src/preprocess/load_data.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/main.py | import numpy as np
import pandas as pd
import six
from tqdm import tqdm
from sklearn.model_selection import KFold
import matplotlib.pyplot as plt
from preprocess.load_data import load_data_
from preprocess.get_dataset import get_dataset_, data_preprocessing, anomaly_dectection
from model.training_ import training_model... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import math
plt.rc('font', family='Times New Roman')
font_size = 16
def plot_metric_df(history_list, task_name, val_flag='test_'):
if 'relapse_risk' in task_name:
metric_list = ['loss', 'f1']
else:
met... | {
"imported_by": [],
"imports": [
"/Regression/src/model/history_.py",
"/Regression/src/model/training_.py",
"/Regression/src/preprocess/get_dataset.py",
"/Regression/src/preprocess/load_data.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/model/training_.py | import copy
import pandas as pd
import numpy as np
import lightgbm as lgb
from sklearn.linear_model import RidgeClassifierCV, LogisticRegressionCV, RidgeCV, LassoCV, LinearRegression
from keras.models import load_model
from keras import backend as K
from keras.optimizers import Adam, RMSprop, SGD
from keras.callbacks i... | import numpy as np
import pandas as pd
from sklearn.metrics import mean_absolute_error, mean_squared_error, \
confusion_matrix, precision_score, recall_score, f1_score, r2_score, accuracy_score
from sklearn.preprocessing import MinMaxScaler
def evaluate_classification(model, train_sets, train_label, val_sets, val... | {
"imported_by": [
"/Regression/src/main.py",
"/Regression/src/learn_weight_main.py"
],
"imports": [
"/Regression/src/model/evaluate.py",
"/Regression/src/model/bulid_model.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/preprocess/plot_tabel.py | import copy
import pandas as pd
import matplotlib.pyplot as plt
from model.history_ import plot_history_df, plot_metric_df
import numpy as np
from scipy.stats import ttest_ind, levene
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
def mape(y_true, y_pred):
return np.mean(np.abs((y_t... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import math
plt.rc('font', family='Times New Roman')
font_size = 16
def plot_metric_df(history_list, task_name, val_flag='test_'):
if 'relapse_risk' in task_name:
metric_list = ['loss', 'f1']
else:
met... | {
"imported_by": [],
"imports": [
"/Regression/src/model/history_.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/useless/ave_logsit_baseline.py | import pandas as pd
import numpy as np
from tqdm import tqdm
import six
import tensorflow as tf
from keras import losses
from keras import backend as K
from keras import optimizers
from keras.models import Sequential
from keras.layers import Dense
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklear... | from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder, MinMaxScaler, StandardScaler
import pandas as pd
import numpy as np
from preprocess import plot_tabel
def get_dataset_(nor, train_data, test_data, clean_ratio, test_retio, se... | {
"imported_by": [],
"imports": [
"/Regression/src/preprocess/get_dataset.py",
"/Regression/src/preprocess/load_data.py"
]
} |
Peroxidess/Ablation-Time-Prediction-Model | /Regression/src/useless/keras_att.py | import pandas as pd
import numpy as np
from tqdm import tqdm
import six
import tensorflow as tf
from keras import losses
from keras import backend as K
from keras import optimizers
from keras.models import Sequential, Model
from keras.callbacks import EarlyStopping
from keras.layers import Input, Dense, Multiply, Activ... | from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import LabelEncoder, MinMaxScaler, StandardScaler
import pandas as pd
import numpy as np
from preprocess import plot_tabel
def get_dataset_(nor, train_data, test_data, clean_ratio, test_retio, se... | {
"imported_by": [],
"imports": [
"/Regression/src/preprocess/get_dataset.py",
"/Regression/src/preprocess/load_data.py"
]
} |
shashi/phosphene | /src/apps/devices/cube.py | import serial
import numpy
import math
from device import Device
from cubelib import emulator
from cubelib import mywireframe as wireframe
from animations import *
import time
import threading
# A class for the cube
class Cube(Device):
def __init__(self, port, dimension=10, emulator=False):
Device.__init__... | import serial
import numpy
from threading import Thread
class Device:
def __init__(self, name, port):
self.array = []
try:
self.port = serial.Serial(port)
self.isConnected = True
print "Connected to", name
except Exception as e:
self.port = No... | {
"imported_by": [
"/src/apps/psychroom.py"
],
"imports": [
"/src/apps/devices/device.py"
]
} |
shashi/phosphene | /src/apps/devices/waterfall.py | import device
from phosphene.signal import *
import scipy, numpy
from phosphene.graphs import barGraph
class Waterfall(device.Device):
def __init__(self, port):
device.Device.__init__(self, "Waterfall", port)
def setupSignal(self, signal):
def waterfall(s):
lights = [s.avg8[i] * 15... | import pdb
import scipy
import numpy
import pygame
from pygame import display
from pygame.draw import *
from pygame import Color
import math
def barGraph(data):
"""
drawing contains (x, y, width, height)
"""
def f(surface, rectangle):
x0, y0, W, H = rectangle
try:
l = l... | {
"imported_by": [
"/src/apps/psychroom.py"
],
"imports": [
"/src/phosphene/graphs.py"
]
} |
shashi/phosphene | /src/apps/psychroom.py | #
# This script plays an mp3 file and communicates via serial.Serial
# with devices in the Technites psychedelic room to visualize the
# music on them.
#
# It talks to 4 devices
# WaterFall -- tubes with LEDs and flying stuff fanned to music
# DiscoBall -- 8 60 watt bulbs wrapped in colored paper
# LEDWall -- a... | from devices.cubelib import emulator
from devices.cubelib import mywireframe as wireframe
from devices.animations import *
pv = emulator.ProjectionViewer(640,480)
wf = wireframe.Wireframe()
def cubeProcess(cube, signal, count):
pv.createCube(wf)
start = (0, 0, 0)
point = (0,0)
#planeBounce(cube,(count... | {
"imported_by": [],
"imports": [
"/src/apps/cube.py",
"/src/apps/devices/ledwall.py",
"/src/apps/devices/waterfall.py",
"/src/apps/devices/discoball.py",
"/src/apps/devices/cube.py"
]
} |
shashi/phosphene | /src/demo.py | import sys
import pdb
import pygame
from pygame import display
from pygame.draw import *
import scipy
import time
from phosphene import audio, util, signalutil, signal
from phosphene.graphs import barGraph, boopGraph, graphsGraphs
from threading import Thread
if len(sys.argv) < 2:
print "Usage: %s file.mp3" % sy... | import pdb
import scipy
import numpy
import pygame
from pygame import display
from pygame.draw import *
from pygame import Color
import math
def barGraph(data):
"""
drawing contains (x, y, width, height)
"""
def f(surface, rectangle):
x0, y0, W, H = rectangle
try:
l = l... | {
"imported_by": [],
"imports": [
"/src/phosphene/graphs.py"
]
} |
shashi/phosphene | /src/phosphene/signal.py | import time
import numpy
from util import indexable
__all__ = [
'Signal',
'lift',
'foldp',
'perceive'
]
class lift:
""" Annotate an object as lifted """
def __init__(self, f, t_indexable=None):
self.f = f
if hasattr(f, '__call__'):
self._type = 'lambda'
e... | import numpy
from threading import Thread # this is for the repl
__all__ = ['memoize', 'memoizeBy', 'numpymap', 'indexable', 'reverse']
# Helper functions
def memoize(f, key=None):
mem = {}
def g(*args):
k = str(args)
if mem.has_key(k):
return mem[k]
else:
r = f(... | {
"imported_by": [],
"imports": [
"/src/phosphene/util.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/build/lib/io_stockx/models/__init__.py | # coding: utf-8
# flake8: noqa
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swag... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [],
"imports": [
"/sdk/python/lib/io_stockx/models/customer_object_merchant.py",
"/sdk/python/lib/build/lib/io_stockx/models/portfolio_id_del_request.py",
"/sdk/python/lib/build/lib/io_stockx/models/portfolio_id_del_response_portfolio_item_product_shipping.py",
"/sdk/python/lib/io_s... |
stvncrn/stockx_api_ref | /sdk/python/lib/build/lib/io_stockx/models/billing_object.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [
"/sdk/python/lib/build/lib/io_stockx/models/__init__.py",
"/sdk/python/lib/io_stockx/models/customer_object.py"
],
"imports": [
"/sdk/python/lib/io_stockx/models/address_object.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/build/lib/io_stockx/models/portfolio_id_del_response_portfolio_item.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [
"/sdk/python/lib/build/lib/io_stockx/models/__init__.py"
],
"imports": [
"/sdk/python/lib/io_stockx/models/portfolio_id_del_response_portfolio_item_merchant.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/build/lib/io_stockx/models/portfolioitems_id_get_response_portfolio_item_product.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [
"/sdk/python/lib/build/lib/io_stockx/models/__init__.py"
],
"imports": [
"/sdk/python/lib/build/lib/io_stockx/models/portfolio_id_del_response_portfolio_item_product_shipping.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/build/lib/io_stockx/models/search_results.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [
"/sdk/python/lib/build/lib/io_stockx/models/__init__.py"
],
"imports": [
"/sdk/python/lib/io_stockx/models/search_hit.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/io_stockx/models/customer_object.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [
"/sdk/python/lib/build/lib/io_stockx/models/__init__.py"
],
"imports": [
"/sdk/python/lib/io_stockx/models/customer_object_merchant.py",
"/sdk/python/lib/build/lib/io_stockx/models/billing_object.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/io_stockx/models/search_hit.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [
"/sdk/python/lib/build/lib/io_stockx/models/__init__.py",
"/sdk/python/lib/build/lib/io_stockx/models/search_results.py"
],
"imports": [
"/sdk/python/lib/build/lib/io_stockx/models/search_hit_searchable_traits.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/lib/test/test_stock_x_api.py | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | # coding: utf-8
"""
StockX API
PRERELEASE API - Subject to change before release. Provides access to StockX's public services, allowing end users to query for product and order information. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git... | {
"imported_by": [],
"imports": [
"/sdk/python/lib/build/lib/io_stockx/api/stock_x_api.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/src/login.py | from __future__ import print_function
import time
import io_stockx
from example_constants import ExampleConstants
from io_stockx.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = io_stockx.Configuration()
configuration.host = "https://gateway.stockx.com/stag... | from __future__ import print_function
import time
import io_stockx
from io_stockx.rest import ApiException
from pprint import pprint
class ExampleConstants:
AWS_API_KEY = "<API Key>"
STOCKX_USERNAME = "<StockX Username>"
STOCKX_PASSWORD = "<StockX Password>"
DEMO_PRODUCT_ID = "air-jordan-1-retro-hi... | {
"imported_by": [],
"imports": [
"/sdk/python/src/example_constants.py"
]
} |
stvncrn/stockx_api_ref | /sdk/python/src/place_new_lowest_ask_example.py | from __future__ import print_function
import time
import io_stockx
from example_constants import ExampleConstants
from io_stockx.rest import ApiException
from pprint import pprint
# Configure API key authorization: api_key
configuration = io_stockx.Configuration()
configuration.host = "https://gateway.stockx.com/sta... | from __future__ import print_function
import time
import io_stockx
from io_stockx.rest import ApiException
from pprint import pprint
class ExampleConstants:
AWS_API_KEY = "<API Key>"
STOCKX_USERNAME = "<StockX Username>"
STOCKX_PASSWORD = "<StockX Password>"
DEMO_PRODUCT_ID = "air-jordan-1-retro-hi... | {
"imported_by": [],
"imports": [
"/sdk/python/src/example_constants.py"
]
} |
jlamonade/splitteroni | /splitter/admin.py | from django.contrib import admin
from .models import Bill, Person, Item
# Register your models here.
admin.site.register(Bill)
admin.site.register(Person)
admin.site.register(Item)
| import uuid
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
from decimal import Decimal
from .utils import _check_tip_tax_then_add
# Create your models here.
class Bill(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid... | {
"imported_by": [],
"imports": [
"/splitter/models.py"
]
} |
jlamonade/splitteroni | /splitter/forms.py | from django.forms import forms, ModelForm
from django.utils.translation import gettext_lazy as _
from .models import Bill
class BillCreateForm(ModelForm):
class Meta:
model = Bill
fields = ('title', 'tax_percent', 'tip_percent',)
labels = {
'title': _('Name'),
}
... | import uuid
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
from decimal import Decimal
from .utils import _check_tip_tax_then_add
# Create your models here.
class Bill(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid... | {
"imported_by": [
"/splitter/views.py"
],
"imports": [
"/splitter/models.py"
]
} |
jlamonade/splitteroni | /splitter/models.py | import uuid
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
from decimal import Decimal
from .utils import _check_tip_tax_then_add
# Create your models here.
class Bill(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid... | from decimal import Decimal
def _check_tip_tax_then_add(self):
# Checks to see if tip or tax is null before adding them to total else it returns 0
total = 0
tip = self.get_tip_amount()
tax = self.get_tax_amount()
if tip:
total += tip
if tax:
total += tax
return Decimal(tota... | {
"imported_by": [
"/splitter/admin.py",
"/splitter/forms.py",
"/splitter/tests.py",
"/splitter/views.py"
],
"imports": [
"/splitter/utils.py"
]
} |
jlamonade/splitteroni | /splitter/tests.py | from django.test import TestCase, RequestFactory
from django.urls import reverse
from django.contrib.auth import get_user_model
from decimal import Decimal
from .models import Bill, Person, Item
# Create your tests here.
class SplitterTests(TestCase):
def setUp(self):
self.user = get_user_model().object... | import uuid
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
from decimal import Decimal
from .utils import _check_tip_tax_then_add
# Create your models here.
class Bill(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid... | {
"imported_by": [],
"imports": [
"/splitter/models.py"
]
} |
jlamonade/splitteroni | /splitter/urls.py | from django.urls import path
from .views import (
BillCreateView,
BillDetailView,
PersonCreateView,
PersonDeleteView,
BillListView,
ItemCreateView,
ItemDeleteView,
SharedItemCreateView,
BillUpdateView,
BillUpdateTaxPercentView,
BillUpdateTaxAmountView,
BillUpdateTipAmoun... | from django.views.generic import CreateView, DetailView, DeleteView, ListView, UpdateView
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.http import Http404
from decimal import Decimal
from .models import Bill, Person, Item
from .forms import (BillCreateForm,
... | {
"imported_by": [],
"imports": [
"/splitter/views.py"
]
} |
jlamonade/splitteroni | /splitter/views.py | from django.views.generic import CreateView, DetailView, DeleteView, ListView, UpdateView
from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy
from django.http import Http404
from decimal import Decimal
from .models import Bill, Person, Item
from .forms import (BillCreateForm,
... | import uuid
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
from decimal import Decimal
from .utils import _check_tip_tax_then_add
# Create your models here.
class Bill(models.Model):
id = models.UUIDField(
primary_key=True,
default=uuid... | {
"imported_by": [
"/splitter/urls.py"
],
"imports": [
"/splitter/models.py",
"/splitter/forms.py"
]
} |
trineary/TradeTestingEngine | /TTE.py | # --------------------------------------------------------------------------------------------------------------------
#
# Patrick Neary
# Date: 9/21/2016
#
# Fin 5350 / Dr. Tyler J. Brough
# Trade Testing Engine:
#
# tte.py
#
# This file handles the interface to most of the code in this project.
#
# ------------------... | # --------------------------------------------------------------------------------------------------------------------
# Patrick Neary
# Fin5350
# Project
# 10/6/2016
#
# TradeHistory.py
#
# This file
# --------------------------------------------------------------------------------------------------------------------
... | {
"imported_by": [],
"imports": [
"/TradeTracking/TradeHistory.py"
]
} |
trineary/TradeTestingEngine | /TTEBootstrapTests/MonteCarloBootstrap.py | # --------------------------------------------------------------------------------------------------------------------
#
# Patrick Neary
# Date: 11/12/2016
#
# Fin 5350 / Dr. Tyler J. Brough
# Trade Testing Engine:
#
# kWhiteRealityCheck.py
#
# This file is an implementation of White's Reality Check for evaluating the ... | # --------------------------------------------------------------------------------------------------------------------
#
# Patrick Neary
# Date: 11/12/2016
#
# Fin 5350 / Dr. Tyler J. Brough
# Trade Testing Engine:
#
# BootstrapCalcTools.py
#
# This file contains tools common to the bootstrap processes.
#
# -----------... | {
"imported_by": [],
"imports": [
"/TTEBootstrapTests/BootstrapCalcTools.py",
"/TTEBootstrapTests/BootstrapABC.py"
]
} |
trineary/TradeTestingEngine | /TTEBootstrapTests/WhiteBootstrap.py | # --------------------------------------------------------------------------------------------------------------------
#
# Patrick Neary
# Date: 11/12/2016
#
# Fin 5350 / Dr. Tyler J. Brough
# Trade Testing Engine:
#
# kWhiteRealityCheck.py
#
# This file is an implementation of White's Reality Check for evaluating the ... | # --------------------------------------------------------------------------------------------------------------------
#
# Patrick Neary
# Date: 11/12/2016
#
# Fin 5350 / Dr. Tyler J. Brough
# Trade Testing Engine:
#
# BootstrapCalcTools.py
#
# This file contains tools common to the bootstrap processes.
#
# -----------... | {
"imported_by": [],
"imports": [
"/TTEBootstrapTests/BootstrapCalcTools.py",
"/TTEBootstrapTests/BootstrapABC.py"
]
} |
trineary/TradeTestingEngine | /TradeTracking/TradeHistory.py | # --------------------------------------------------------------------------------------------------------------------
# Patrick Neary
# Fin5350
# Project
# 10/6/2016
#
# TradeHistory.py
#
# This file
# --------------------------------------------------------------------------------------------------------------------
... | # --------------------------------------------------------------------------------------------------------------------
# Patrick Neary
# CS 6110
# Project
# 10/6/2016
#
# TradeDetails.py
#
# This file
# --------------------------------------------------------------------------------------------------------------------
... | {
"imported_by": [
"/TTE.py"
],
"imports": [
"/TradeTracking/TradeDetails.py"
]
} |
Tadaboody/good_smell | /docs/generate_smell_doc.py | from tests.test_collection import collect_tests, test_case_files
def generate_smell_docs():
for example_test in [list(collect_tests(file))[0] for file in test_case_files]:
desc, symbols, before, after = example_test
symbol = list(symbols)[0]
print(
f"""### {desc} ({symbol})
```... | import ast
import itertools
from os import PathLike
from pathlib import Path
from typing import Iterator, NamedTuple, Set
import astor
import black
import pytest
from good_smell import fix_smell, smell_warnings
FILE_DIR = Path(__file__).parent
EXAMPLES_DIR = FILE_DIR / "examples"
def normalize_formatting(code: str... | {
"imported_by": [],
"imports": [
"/tests/test_collection.py"
]
} |
Tadaboody/good_smell | /good_smell/__init__.py | # flake8:noqa
try:
from importlib import metadata
except ImportError:
# Running on pre-3.8 Python; use importlib-metadata package
import importlib_metadata as metadata
__version__ = metadata.version("good-smell")
from .smell_warning import SmellWarning
from .lint_smell import LintSmell
from .ast_smell impo... | import abc
import ast
import os
from typing import List, Optional
from good_smell import SmellWarning
class LintSmell(abc.ABC):
"""Abstract Base class to represent the sniffing instructions for the linter"""
def __init__(
self,
transform: bool,
path: Optional[str] = None,
tree... | {
"imported_by": [],
"imports": [
"/good_smell/lint_smell.py",
"/good_smell/flake8_ext.py",
"/good_smell/ast_smell.py",
"/good_smell/main.py",
"/good_smell/smell_warning.py"
]
} |
Tadaboody/good_smell | /good_smell/ast_smell.py | import abc
import ast
from typing import List, Optional, Type, TypeVar
import astor
from good_smell import LintSmell, SmellWarning
class LoggingTransformer(ast.NodeTransformer, abc.ABC):
"""A subclass of transformer that logs the nodes it transforms"""
def __init__(self, transform):
self.transformed... | import abc
import ast
import os
from typing import List, Optional
from good_smell import SmellWarning
class LintSmell(abc.ABC):
"""Abstract Base class to represent the sniffing instructions for the linter"""
def __init__(
self,
transform: bool,
path: Optional[str] = None,
tree... | {
"imported_by": [
"/good_smell/__init__.py",
"/good_smell/smells/filter.py",
"/good_smell/smells/join_literal.py",
"/good_smell/smells/nested_for.py",
"/good_smell/smells/range_len_fix.py",
"/good_smell/smells/yield_from.py"
],
"imports": [
"/good_smell/lint_smell.py",
"/good_smel... |
Tadaboody/good_smell | /good_smell/flake8_ext.py | import ast
from typing import Generator, Tuple
from good_smell import SmellWarning, implemented_smells, __version__
class LintingFlake8:
"""Entry point good smell to be used as a flake8 linting plugin"""
name = "good-smell"
version = __version__
def __init__(self, tree: ast.AST, filename: str):
... | from typing import NamedTuple
FLAKE8_FORMAT = "{path}:{row}:{col} {symbol} {msg}"
PYLINT_FORMAT = "{path}:{line}:{column}: {msg} ({symbol})"
def to_dict(namedtuple: NamedTuple) -> dict:
return dict(zip(namedtuple._fields, list(namedtuple)))
class SmellWarning(NamedTuple):
"""Class to represent a warning me... | {
"imported_by": [
"/good_smell/__init__.py"
],
"imports": [
"/good_smell/smell_warning.py"
]
} |
Tadaboody/good_smell | /good_smell/lint_smell.py | import abc
import ast
import os
from typing import List, Optional
from good_smell import SmellWarning
class LintSmell(abc.ABC):
"""Abstract Base class to represent the sniffing instructions for the linter"""
def __init__(
self,
transform: bool,
path: Optional[str] = None,
tree... | from typing import NamedTuple
FLAKE8_FORMAT = "{path}:{row}:{col} {symbol} {msg}"
PYLINT_FORMAT = "{path}:{line}:{column}: {msg} ({symbol})"
def to_dict(namedtuple: NamedTuple) -> dict:
return dict(zip(namedtuple._fields, list(namedtuple)))
class SmellWarning(NamedTuple):
"""Class to represent a warning me... | {
"imported_by": [
"/good_smell/__init__.py",
"/good_smell/ast_smell.py",
"/good_smell/main.py"
],
"imports": [
"/good_smell/smell_warning.py"
]
} |
Tadaboody/good_smell | /good_smell/main.py | from pathlib import Path
from typing import Iterable, Type
from fire import Fire
from good_smell import LintSmell, SmellWarning, implemented_smells
def print_smell_warnings(path: str):
"""Prints any warning messages about smells"""
print(
"\n".join(
warning.warning_string()
f... | import abc
import ast
import os
from typing import List, Optional
from good_smell import SmellWarning
class LintSmell(abc.ABC):
"""Abstract Base class to represent the sniffing instructions for the linter"""
def __init__(
self,
transform: bool,
path: Optional[str] = None,
tree... | {
"imported_by": [
"/good_smell/__init__.py",
"/tests/test_collection.py",
"/tests/test_enumerate_fix.py"
],
"imports": [
"/good_smell/lint_smell.py",
"/good_smell/smell_warning.py"
]
} |
Tadaboody/good_smell | /good_smell/smells/__init__.py | from .filter import FilterIterator
from .join_literal import JoinLiteral
from .nested_for import NestedFor
from .range_len_fix import RangeLenSmell
from .yield_from import YieldFrom
implemented_smells = (RangeLenSmell, NestedFor, FilterIterator, YieldFrom, JoinLiteral)
| import ast
import typing
from good_smell import AstSmell, LoggingTransformer
class NameInNode(LoggingTransformer):
def __init__(self, name: ast.Name):
self.name = name
super().__init__(transform=False)
def is_smelly(self, node: ast.AST) -> bool:
return isinstance(node, ast.Name) and ... | {
"imported_by": [],
"imports": [
"/good_smell/smells/nested_for.py",
"/good_smell/smells/range_len_fix.py",
"/good_smell/smells/join_literal.py",
"/good_smell/smells/filter.py",
"/good_smell/smells/yield_from.py"
]
} |
Tadaboody/good_smell | /good_smell/smells/filter.py | from typing import TypeVar
import ast
from typing import cast
from good_smell import AstSmell, LoggingTransformer
class NameReplacer(ast.NodeTransformer):
def __init__(self, old: ast.Name, new: ast.AST):
self.old = old
self.new = new
def visit_Name(self, node: ast.Name) -> ast.AST:
i... | import abc
import ast
from typing import List, Optional, Type, TypeVar
import astor
from good_smell import LintSmell, SmellWarning
class LoggingTransformer(ast.NodeTransformer, abc.ABC):
"""A subclass of transformer that logs the nodes it transforms"""
def __init__(self, transform):
self.transformed... | {
"imported_by": [
"/good_smell/smells/__init__.py"
],
"imports": [
"/good_smell/ast_smell.py"
]
} |
Tadaboody/good_smell | /good_smell/smells/join_literal.py | import ast
from good_smell import AstSmell, LoggingTransformer
try:
# ast.Str is deprecated in py3.8 and will be removed
StrConst = (ast.Constant, ast.Str)
except AttributeError:
StrConst = (ast.Constant,)
class JoinLiteral(AstSmell):
"""Checks if joining a literal of a sequence."""
@property
... | import abc
import ast
from typing import List, Optional, Type, TypeVar
import astor
from good_smell import LintSmell, SmellWarning
class LoggingTransformer(ast.NodeTransformer, abc.ABC):
"""A subclass of transformer that logs the nodes it transforms"""
def __init__(self, transform):
self.transformed... | {
"imported_by": [
"/good_smell/smells/__init__.py"
],
"imports": [
"/good_smell/ast_smell.py"
]
} |
Tadaboody/good_smell | /good_smell/smells/nested_for.py | import ast
import typing
from good_smell import AstSmell, LoggingTransformer
class NameInNode(LoggingTransformer):
def __init__(self, name: ast.Name):
self.name = name
super().__init__(transform=False)
def is_smelly(self, node: ast.AST) -> bool:
return isinstance(node, ast.Name) and ... | import abc
import ast
from typing import List, Optional, Type, TypeVar
import astor
from good_smell import LintSmell, SmellWarning
class LoggingTransformer(ast.NodeTransformer, abc.ABC):
"""A subclass of transformer that logs the nodes it transforms"""
def __init__(self, transform):
self.transformed... | {
"imported_by": [
"/good_smell/smells/__init__.py",
"/tests/test_no_transform.py"
],
"imports": [
"/good_smell/ast_smell.py"
]
} |
Tadaboody/good_smell | /good_smell/smells/range_len_fix.py | import ast
from good_smell import AstSmell, LoggingTransformer
from typing import Union, Container
class RangeLenSmell(AstSmell):
@property
def transformer_class(self):
return EnumerateFixer
@property
def symbol(self):
return "range-len"
@property
def warning_message(self) -... | import abc
import ast
from typing import List, Optional, Type, TypeVar
import astor
from good_smell import LintSmell, SmellWarning
class LoggingTransformer(ast.NodeTransformer, abc.ABC):
"""A subclass of transformer that logs the nodes it transforms"""
def __init__(self, transform):
self.transformed... | {
"imported_by": [
"/good_smell/smells/__init__.py"
],
"imports": [
"/good_smell/ast_smell.py"
]
} |
Tadaboody/good_smell | /good_smell/smells/yield_from.py | from good_smell import AstSmell, LoggingTransformer
import ast
class YieldFrom(AstSmell):
"""Checks for yields inside for loops"""
@property
def transformer_class(self):
return YieldFromTransformer
@property
def warning_message(self):
return "Consider using yield from instead of ... | import abc
import ast
from typing import List, Optional, Type, TypeVar
import astor
from good_smell import LintSmell, SmellWarning
class LoggingTransformer(ast.NodeTransformer, abc.ABC):
"""A subclass of transformer that logs the nodes it transforms"""
def __init__(self, transform):
self.transformed... | {
"imported_by": [
"/good_smell/smells/__init__.py"
],
"imports": [
"/good_smell/ast_smell.py"
]
} |
Tadaboody/good_smell | /tests/test_collection.py | import ast
import itertools
from os import PathLike
from pathlib import Path
from typing import Iterator, NamedTuple, Set
import astor
import black
import pytest
from good_smell import fix_smell, smell_warnings
FILE_DIR = Path(__file__).parent
EXAMPLES_DIR = FILE_DIR / "examples"
def normalize_formatting(code: str... | from pathlib import Path
from typing import Iterable, Type
from fire import Fire
from good_smell import LintSmell, SmellWarning, implemented_smells
def print_smell_warnings(path: str):
"""Prints any warning messages about smells"""
print(
"\n".join(
warning.warning_string()
f... | {
"imported_by": [
"/docs/generate_smell_doc.py"
],
"imports": [
"/good_smell/main.py"
]
} |
Tadaboody/good_smell | /tests/test_enumerate_fix.py | from good_smell import fix_smell
from re import match
import pytest
valid_sources = ["""
a = [0]
for i in range(len(a)):
print(a[i])
""",
"""
b = [1]
for i in range(len(a + b)):
print(i)
"""]
@pytest.mark.parametrize("source", valid_sources)
def test_range_len_fix(source):
assert not mat... | from pathlib import Path
from typing import Iterable, Type
from fire import Fire
from good_smell import LintSmell, SmellWarning, implemented_smells
def print_smell_warnings(path: str):
"""Prints any warning messages about smells"""
print(
"\n".join(
warning.warning_string()
f... | {
"imported_by": [],
"imports": [
"/good_smell/main.py"
]
} |
Tadaboody/good_smell | /tests/test_no_transform.py | import itertools
import ast
from good_smell.smells import NestedFor
def compare_ast(node1, node2):
"""Compare two ast, adapted from https://stackoverflow.com/a/30581854 to py3"""
if type(node1) is not type(node2):
return False
if isinstance(node1, ast.AST):
for k, v in vars(node1).items():... | import ast
import typing
from good_smell import AstSmell, LoggingTransformer
class NameInNode(LoggingTransformer):
def __init__(self, name: ast.Name):
self.name = name
super().__init__(transform=False)
def is_smelly(self, node: ast.AST) -> bool:
return isinstance(node, ast.Name) and ... | {
"imported_by": [],
"imports": [
"/good_smell/smells/nested_for.py"
]
} |
EricHughesABC/T2EPGviewer | /simple_pandas_plot.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 20 10:29:38 2017
@author: neh69
"""
import os
import sys
import numpy as np
import pandas as pd
import lmfit as lm
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from PyQt5 import QtCore, QtWidgets
import visionplot_widgets
... | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 6 14:55:05 2018
@author: ERIC
"""
import os
import numpy as np
import pandas as pd
import nibabel
class T2imageData():
def __init__(self):
self.currentSlice = None
self.currentEcho = None
self.T2imagesDirpath = None
... | {
"imported_by": [],
"imports": [
"/ImageData.py"
]
} |
EricHughesABC/T2EPGviewer | /visionplot_widgets.py | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 13:11:07 2018
@author: neh69
"""
import sys
import numpy as np
#import matplotlib
import pandas as pd
#import mplcursors
from uncertainties import ufloat
import t2fit
import lmfit as lm
from matplotlib import pyplot as plt
#import seaborn as sns
f... | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 6 14:55:05 2018
@author: ERIC
"""
import os
import numpy as np
import pandas as pd
import nibabel
class T2imageData():
def __init__(self):
self.currentSlice = None
self.currentEcho = None
self.T2imagesDirpath = None
... | {
"imported_by": [],
"imports": [
"/ImageData.py"
]
} |
DiegoArcelli/BlocksWorld | /launch.py | import tkinter as tk
from tkinter.filedialog import askopenfilename
from PIL import Image, ImageTk
from load_state import prepare_image
from utils import draw_state
from blocks_world import BlocksWorld
from search_algs import *
# file che contiene l'implementazione dell'interfaccia grafica per utilizzare il programma
... | import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import glob
from tensorflow import keras
from math import ceil
deteced = [np.array([]) for x in range(6)] # lista che contiene le immagini delle cifre
poisitions = [None for x in range(6)] # lista che contiene la posizione delle cifre nell'immagine
de... | {
"imported_by": [],
"imports": [
"/load_state.py",
"/utils.py",
"/blocks_world.py"
]
} |
DiegoArcelli/BlocksWorld | /main.py | from PIL import Image, ImageTk
from load_state import prepare_image
from utils import draw_state
from blocks_world import BlocksWorld
from search_algs import *
import argparse
from inspect import getfullargspec
# file che definisce lo script da linea di comando per utilizzare il programma
if __name__ == "__main__":
... | import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import glob
from tensorflow import keras
from math import ceil
deteced = [np.array([]) for x in range(6)] # lista che contiene le immagini delle cifre
poisitions = [None for x in range(6)] # lista che contiene la posizione delle cifre nell'immagine
de... | {
"imported_by": [],
"imports": [
"/load_state.py",
"/utils.py",
"/blocks_world.py"
]
} |
DiegoArcelli/BlocksWorld | /search_algs.py | from aima3.search import *
from utils import *
from collections import deque
from blocks_world import BlocksWorld
import sys
# file che contiene le implementazioni degli algoritmi di ricerca
node_expanded = 0 # numero di nodi espansi durante la ricerca
max_node = 0 # massimo numero di nodi presenti nella frontiera ... | from aima3.search import *
from utils import *
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
# file che contine l'implementazione del problema basata con AIMA
class BlocksWorld(Problem):
def __init__(self, initial, goal):
super().__init__(initial, goal)
# restituisce il numero... | {
"imported_by": [],
"imports": [
"/blocks_world.py"
]
} |
viaacode/status | /src/viaastatus/server/wsgi.py | from flask import Flask, abort, Response, send_file, request, flash, session, render_template
from flask import url_for, redirect
from viaastatus.prtg import api
from viaastatus.decorators import cacher, templated
from os import environ
import logging
from configparser import ConfigParser
import re
import hmac
from has... | import os
from flask import jsonify, Response
import flask
class FileResponse(Response):
default_mimetype = 'application/octet-stream'
def __init__(self, filename, **kwargs):
if not os.path.isabs(filename):
filename = os.path.join(flask.current_app.root_path, filename)
with open... | {
"imported_by": [],
"imports": [
"/src/viaastatus/server/response.py",
"/src/viaastatus/decorators.py"
]
} |
digital-sustainability/swiss-procurement-classifier | /runIterations.py | from learn import ModelTrainer
from collection import Collection
import pandas as pd
import logging
import traceback
import os
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# === THESIS ===
anbieter_config = {
'Construction': [
'Alpiq AG',
'KIBAG',
... | import pandas as pd
import numpy as np
import math
import re
from datetime import datetime
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.tree import DecisionTreeClassifi... | {
"imported_by": [],
"imports": [
"/learn.py",
"/collection.py"
]
} |
digital-sustainability/swiss-procurement-classifier | /runOldIterations.py | from train import ModelTrainer
from collection import Collection
import pandas as pd
import logging
import traceback
import os
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# === THESIS ===
anbieter_config = {
'Construction': [
'Alpiq AG',
'Swisscom',
... | import pandas as pd
import math
from datetime import datetime
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics impor... | {
"imported_by": [],
"imports": [
"/train.py",
"/collection.py"
]
} |
badgerlordy/smash-bros-reader | /smash_reader/smash.py | from datetime import datetime
import json
from logger import log_exception
import numpy as np
import os
from PIL import Image, ImageTk
import platform
from queue import Queue, Empty
import requests
import smash_game
import smash_utility as ut
import smash_watcher
from sys import argv, excepthook
import time
i... | from datetime import datetime
import os
from sys import __excepthook__
from time import time
from traceback import format_exception
BASE_DIR = os.path.realpath(os.path.dirname(__file__))
def log_exception(type, value, tb):
error = format_exception(type, value, tb)
filepath = os.path.join(BASE_DIR, 'e... | {
"imported_by": [],
"imports": [
"/smash_reader/logger.py"
]
} |
badgerlordy/smash-bros-reader | /smash_reader/smash_game.py | import copy
import difflib
import json
from logger import log_exception
import numpy as np
import os
from PIL import Image
import re
import smash_utility as ut
import sys
import threading
import time
sys.excepthook = log_exception
character_name_debugging_enabled = False
output = True
def _print(*args, **kwargs... | from datetime import datetime
import os
from sys import __excepthook__
from time import time
from traceback import format_exception
BASE_DIR = os.path.realpath(os.path.dirname(__file__))
def log_exception(type, value, tb):
error = format_exception(type, value, tb)
filepath = os.path.join(BASE_DIR, 'e... | {
"imported_by": [],
"imports": [
"/smash_reader/logger.py"
]
} |
badgerlordy/smash-bros-reader | /smash_reader/smash_utility.py | import cv2
from datetime import datetime
import json
from logger import log_exception
import matplotlib.pyplot as plt
import mss
import numpy as np
from PIL import Image, ImageChops, ImageDraw
import pytesseract
import random
import requests
from skimage.measure import compare_ssim
import string
import subproce... | from datetime import datetime
import os
from sys import __excepthook__
from time import time
from traceback import format_exception
BASE_DIR = os.path.realpath(os.path.dirname(__file__))
def log_exception(type, value, tb):
error = format_exception(type, value, tb)
filepath = os.path.join(BASE_DIR, 'e... | {
"imported_by": [],
"imports": [
"/smash_reader/logger.py"
]
} |
badgerlordy/smash-bros-reader | /smash_reader/smash_watcher.py | import json
from logger import log_exception
import os
from queue import Empty
import re
import requests
import smash_game
import smash_utility as ut
import sys
import threading
import time
sys.excepthook = log_exception
output = True
def _print(*args, **kwargs):
if output:
args = list(args)
... | from datetime import datetime
import os
from sys import __excepthook__
from time import time
from traceback import format_exception
BASE_DIR = os.path.realpath(os.path.dirname(__file__))
def log_exception(type, value, tb):
error = format_exception(type, value, tb)
filepath = os.path.join(BASE_DIR, 'e... | {
"imported_by": [],
"imports": [
"/smash_reader/logger.py"
]
} |
radrumond/hidra | /archs/fcn.py | # ADAPTED BY Rafael Rego Drumond and Lukas Brinkmeyer
# THIS IMPLEMENTATION USES THE CODE FROM: https://github.com/dragen1860/MAML-TensorFlow
import os
import numpy as np
import tensorflow as tf
from archs.maml import MAML
class Model(MAML):
def __init__(self,train_lr,meta_lr,image_shape,isMIN, label_size=2):
... | # ADAPTED BY Rafael Rego Drumond and Lukas Brinkmeyer
# THIS IMPLEMENTATION USES THE CODE FROM: https://github.com/dragen1860/MAML-TensorFlow
import os
import numpy as np
import tensorflow as tf
class MAML:
def __init__(self,train_lr,meta_lr,image_shape, isMIN, label_size=2):
self.train_lr = train_lr
... | {
"imported_by": [
"/main.py"
],
"imports": [
"/archs/maml.py"
]
} |
radrumond/hidra | /main.py | ## Created by Rafael Rego Drumond and Lukas Brinkmeyer
# THIS IMPLEMENTATION USES THE CODE FROM: https://github.com/dragen1860/MAML-TensorFlow
from data_gen.omni_gen import unison_shuffled_copies,OmniChar_Gen, MiniImgNet_Gen
from archs.fcn import Model as mfcn
from archs.hydra import Model as mhyd
from train import ... | """
Command-line argument parsing.
"""
import argparse
#from functools import partial
import time
import tensorflow as tf
import json
import os
def boolean_string(s):
if s not in {'False', 'True'}:
raise ValueError('Not a valid boolean string')
return s == 'True'
def argument_parser():
"""
G... | {
"imported_by": [],
"imports": [
"/args.py",
"/data_gen/omni_gen.py",
"/archs/fcn.py",
"/archs/hydra.py"
]
} |
radrumond/hidra | /test.py | import numpy as np
import tensorflow as tf
from data_gen.omni_gen import unison_shuffled_copies,OmniChar_Gen, MiniImgNet_Gen
def test(m, data_sampler,
eval_step,
min_classes,
max_classes,
train_shots,
test_shots,
meta_batch,
meta_iters,
na... | import numpy as np
import os
import cv2
import pickle
class MiniImgNet_Gen:
def __init__(self,path="/tmp/data/miniimagenet",data_path=None):
if data_path is None:
self.path = path
self.train_paths = ["train/"+x for x in os.listdir(path+"/train")]
... | {
"imported_by": [],
"imports": [
"/data_gen/omni_gen.py"
]
} |
radrumond/hidra | /train.py | import numpy as np
import tensorflow as tf
from data_gen.omni_gen import unison_shuffled_copies,OmniChar_Gen, MiniImgNet_Gen
import time
def train( m, mt, # m is the model foir training, mt is the model for testing
data_sampler, # Creates the data generator for training and testing
min_classe... | import numpy as np
import os
import cv2
import pickle
class MiniImgNet_Gen:
def __init__(self,path="/tmp/data/miniimagenet",data_path=None):
if data_path is None:
self.path = path
self.train_paths = ["train/"+x for x in os.listdir(path+"/train")]
... | {
"imported_by": [],
"imports": [
"/data_gen/omni_gen.py"
]
} |
sebastianden/alpaca | /src/alpaca.py | import warnings
warnings.simplefilter(action='ignore')
import pickle
import pandas as pd
import numpy as np
from utils import TimeSeriesScalerMeanVariance, Flattener, Featuriser, plot_dtc
from sklearn.pipeline import Pipeline
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import Grid... | import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
from scipy.stats import kurtosis, skew
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn import tree
import graphviz
# Load the tes... | {
"imported_by": [
"/src/test_time.py",
"/src/test_use_case.py",
"/src/main.py",
"/src/test_voting.py"
],
"imports": [
"/src/utils.py"
]
} |
sebastianden/alpaca | /src/cam.py | import tensorflow.keras.backend as K
import tensorflow.keras
from tensorflow.keras.layers import Lambda
from tensorflow.keras.models import Model, load_model
tensorflow.compat.v1.disable_eager_execution()
import tensorflow as tf
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from utils import ... | import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
from scipy.stats import kurtosis, skew
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn import tree
import graphviz
# Load the tes... | {
"imported_by": [],
"imports": [
"/src/utils.py"
]
} |
sebastianden/alpaca | /src/main.py | import numpy as np
import pandas as pd
from utils import split_df, TimeSeriesResampler, plot_confusion_matrix, Differentiator
from alpaca import Alpaca
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
import matplotlib.pyplot as plt
if __name__ == "__main__":
"""
... | import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
from scipy.stats import kurtosis, skew
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn import tree
import graphviz
# Load the tes... | {
"imported_by": [],
"imports": [
"/src/utils.py",
"/src/alpaca.py"
]
} |
sebastianden/alpaca | /src/test_time.py | from alpaca import Alpaca
from utils import to_time_series_dataset, to_dataset, split_df, TimeSeriesResampler
import time
import numpy as np
import pandas as pd
from sklearn.pipeline import Pipeline
max_sample = 20
for dataset in ['uc2']:
if dataset == 'uc1':
X, y = split_df(pd.read_pickle('..\\data\\df_... | import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
from scipy.stats import kurtosis, skew
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn import tree
import graphviz
# Load the tes... | {
"imported_by": [],
"imports": [
"/src/utils.py",
"/src/alpaca.py"
]
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.