index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
35,486
open-pythons/lottedfs
refs/heads/master
/com/proxies.py
# !/usr/bin/env python3 # -*- coding: utf-8 -*- from bs4 import BeautifulSoup import threading import requests import sqlite3 import asyncio import aiohttp import random import atexit import yaml import time import sys import os sem = asyncio.Semaphore(50) # 信号量,控制协程数,防止爬的过快 yamlPath = 'config.yaml' _yaml = open(yam...
{"/com/processxlsx.py": ["/com/ConnectSqlite.py"], "/com/processdata.py": ["/com/ConnectSqlite.py"], "/com/proxies.py": ["/com/ConnectSqlite.py"], "/com/test.py": ["/com/ConnectSqlite.py"]}
35,487
open-pythons/lottedfs
refs/heads/master
/com/main.py
# !/usr/bin/env python3 # -*- coding: utf-8 -*- import requests import threading from bs4 import BeautifulSoup import random import sys import os import re import sqlite3 from openpyxl import Workbook from openpyxl import load_workbook from openpyxl.styles import Alignment import yaml import atexit import time import ...
{"/com/processxlsx.py": ["/com/ConnectSqlite.py"], "/com/processdata.py": ["/com/ConnectSqlite.py"], "/com/proxies.py": ["/com/ConnectSqlite.py"], "/com/test.py": ["/com/ConnectSqlite.py"]}
35,488
open-pythons/lottedfs
refs/heads/master
/com/test.py
# !/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os import re sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '..')) sys.path.append("..") from com.headers import getheaders from com.ConnectSqlite import ConnectSqlite if __name__ == "__main__": conn = ConnectSqlite('./.SqliteDat...
{"/com/processxlsx.py": ["/com/ConnectSqlite.py"], "/com/processdata.py": ["/com/ConnectSqlite.py"], "/com/proxies.py": ["/com/ConnectSqlite.py"], "/com/test.py": ["/com/ConnectSqlite.py"]}
35,490
Thomas-Nexus/Django_Image_API
refs/heads/main
/api/urls.py
from .views import * from django.urls import path urlpatterns = [ path('id/<id>', ImageAPI.as_view()), ]
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,491
Thomas-Nexus/Django_Image_API
refs/heads/main
/images/views.py
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth import authenticate, login, logout from django.views.generic import ListView, View from django.contrib import messages from django.urls import reverse from .models import * from .forms import * class all_(View): de...
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,492
Thomas-Nexus/Django_Image_API
refs/heads/main
/images/admin.py
from django.contrib import admin from .models import * from . import models admin.site.register(Images) class Author(admin.ModelAdmin): list_display = ('title', 'id', 'status', 'slug', 'author') prepopulated_fields = {'slug': 'title'} admin.site.register(Category)
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,493
Thomas-Nexus/Django_Image_API
refs/heads/main
/images/forms.py
from .models import * from django import forms from django.forms import ModelForm from django.contrib.auth.forms import UserCreationForm class UploadForm(forms.ModelForm): class Meta: model = Images fields = ['title', 'category', 'image'] class RegisterUserForm(UserCreationForm): er...
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,494
Thomas-Nexus/Django_Image_API
refs/heads/main
/images/urls.py
from .views import * from django.urls import path, reverse from django.views.generic import TemplateView, View app_name = 'images' urlpatterns = [ path('', TemplateView.as_view(template_name='home.html')), path('images/all', all_.as_view(), name='all'), path('likes/<int:pk>', likes, name='likes...
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,495
Thomas-Nexus/Django_Image_API
refs/heads/main
/api/views.py
from .custom import * from images.models import * from django.shortcuts import render from rest_framework import generics from rest_framework.response import Response class ImageAPI(generics.RetrieveAPIView): renderer_classes = [JPEGRenderer] def get(self, request, *args, **kwargs): querys...
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,496
Thomas-Nexus/Django_Image_API
refs/heads/main
/images/models.py
from django.db import models from django.utils import timezone from django.contrib.auth.models import User def dir_path(instance, filename): return 'images/{0}/'.format(filename) class Category(models.Model): name = models.CharField(max_length=100) def __str__(self): return self.name ...
{"/api/urls.py": ["/api/views.py"], "/images/views.py": ["/images/models.py", "/images/forms.py"], "/images/admin.py": ["/images/models.py"], "/images/forms.py": ["/images/models.py"], "/images/urls.py": ["/images/views.py"], "/api/views.py": ["/images/models.py"]}
35,497
selimfirat/ocfpad
refs/heads/master
/plot_helpers.py
# Reference: https://gitlab.idiap.ch/biometric-resources/lab-pad/blob/master/notebook/plot.py import numpy import bob.measure from matplotlib import pyplot def plot_scores_distributions(scores_dev, scores_eval, path, title='Score Distribution', n_bins=50, threshold_height=1, legend_loc='...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,498
selimfirat/ocfpad
refs/heads/master
/num_frames_hist.py
import numpy as np import h5py import os import seaborn as sns import matplotlib.pyplot as plt from h5py import Dataset import pandas as pd sns.set(style="white", palette="muted", color_codes=True) rs = np.random.RandomState(10) # Set up the matplotlib figure f, axes = plt.subplots(1, 1, figsize=(7, 7), sharex=True)...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,499
selimfirat/ocfpad
refs/heads/master
/convlstm_autoencoder.py
import argparse import numpy as np import os import pandas as pd import torch from pyod.models.base import BaseDetector from pyod.utils import invert_order from sklearn.metrics import roc_curve, roc_auc_score from torch import nn from torch.autograd import Variable from torch.optim import Adam from tqdm import tqdm i...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,500
selimfirat/ocfpad
refs/heads/master
/extract_openface.py
import os from tqdm import tqdm input_path = "/mnt/storage2/pad/videos" output_path = "/mnt/storage2/pad/frames" docker_path = "/home/openface-build/build/bin" videos_path = "/home/openface-build/videos" for root, dirs, files in tqdm(os.walk(input_path)): hpath = root.replace(input_path, "").strip("/") pri...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,501
selimfirat/ocfpad
refs/heads/master
/convlstm_cell.py
import torch from torch import nn from torch import tanh, sigmoid, zeros from torch.autograd import Variable class ConvLSTMCell(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, cuda_idx): super().__init__() padding = int((kernel_size - 1) / 2) self.Wxi = nn.Conv2d(...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,502
selimfirat/ocfpad
refs/heads/master
/extract_features.py
import h5py import PIL import argparse import skvideo.io import torch import torchvision.models as models import torchvision.transforms as transforms from torch.utils.data import Dataset from tqdm import tqdm from bob.ip.qualitymeasure import galbally_iqm_features as iqm import numpy as np import os class VideoFrame...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,503
selimfirat/ocfpad
refs/heads/master
/boxplots.py
import pandas as pd import matplotlib.pyplot as plt import matplotlib matplotlib.use("pgf") matplotlib.rcParams.update({ "pgf.texsystem": "pdflatex", 'font.family': 'serif', 'text.usetex': True, 'pgf.rcfonts': False, }) df = pd.read_csv("results.csv") ax = df[(df["data"]=="replay_mobile") & (df["feat...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,504
selimfirat/ocfpad
refs/heads/master
/do_evaluation.py
import bob import numpy as np import os import pickle from bob.measure import eer, eer_threshold, plot from sklearn.metrics import roc_curve, roc_auc_score import matplotlib.pyplot as plt from plot_helpers import plot_scores_distributions, compare_dets pkl_path = "/mnt/storage2/pad/pkl/" def plot_far_frr(negativ...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,505
selimfirat/ocfpad
refs/heads/master
/convlstm_main.py
import argparse import pickle import numpy as np import os from sklearn.metrics import roc_curve, roc_auc_score from torch.autograd import Variable from tqdm import tqdm import h5py import torch from convlstm_autoencoder import ConvLSTMAutoencoder def calculate_metrics(y, y_pred, threshold=None, test_videos=None):...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,506
selimfirat/ocfpad
refs/heads/master
/faces_to_video.py
import os from tqdm import tqdm input_path = "/mnt/storage2/pad/frames" videos_path = "/mnt/storage2/pad/videos" output_path = "/mnt/storage2/pad/faces" for root, dirs, files in tqdm(os.walk(videos_path)): hpath = root.replace(videos_path, "").strip("/") print(hpath) if "replay_mobile" in hpath: ...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,507
selimfirat/ocfpad
refs/heads/master
/normalized_model.py
from pyod.models.base import BaseDetector from pyod.utils import invert_order from sklearn.base import BaseEstimator from sklearn.preprocessing import StandardScaler # A normalization detector_ constructed due to the feedback of Prof. Arashloo during presentation. # This class Takes detector_ in constructor and perfo...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,508
selimfirat/ocfpad
refs/heads/master
/generate_tables.py
import numpy as np import os import pickle import pandas as pd from bob.measure._library import eer_threshold from sklearn.metrics import roc_auc_score from bob.measure import eer, eer_threshold df = pd.read_csv("results.csv") df = df[df["normalize"] == "True"] model_names = { "iforest": "iForest", "ocsvm":...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,509
selimfirat/ocfpad
refs/heads/master
/print_best_models.py
import json import numpy as np import os import pickle from bob.measure import eer from bob.measure._library import eer_threshold from sklearn.metrics import roc_auc_score from do_evaluation import plot_det_comparison def get_best_models(): pkl_path = "/mnt/storage2/pad/pkl" models = { "replay_att...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,510
selimfirat/ocfpad
refs/heads/master
/main.py
import argparse import pickle import numpy as np import os from normalized_model import NormalizedModel os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = "" np.random.seed(1) def get_training_frames(f, dims=4096): split = "train" num_reals = sum(f[split...
{"/convlstm_autoencoder.py": ["/convlstm_cell.py"], "/do_evaluation.py": ["/plot_helpers.py"], "/convlstm_main.py": ["/convlstm_autoencoder.py"], "/print_best_models.py": ["/do_evaluation.py"], "/main.py": ["/normalized_model.py"]}
35,511
ehapsamy0/test1_dashbordToLearnWebScraping
refs/heads/master
/notepad/urls.py
from django.urls import path from .views import ( create_view, list_view, delete_view, update_view) app_name = 'notes' urlpatterns = [ path('create/',create_view,name='creat_view'), path('list/',list_view,name='list'), path('<int:id>/delete/',delete_view,name='delete'), #url(r'^(?P<id>\d+)/delete/',delete_vi...
{"/notepad/urls.py": ["/notepad/views.py"], "/news/admin.py": ["/news/models.py"]}
35,512
ehapsamy0/test1_dashbordToLearnWebScraping
refs/heads/master
/notepad/views.py
from django.shortcuts import render,redirect,get_object_or_404 from .models import Note from .forms import NoteModelForm # Create your views here. #CRUD #CREATE UPDATE DELETE RETRIEVE def create_view(request): form = NoteModelForm(request.POST or None ,request.FILES or None ) if form.is_valid(): form.instance.u...
{"/notepad/urls.py": ["/notepad/views.py"], "/news/admin.py": ["/news/models.py"]}
35,513
ehapsamy0/test1_dashbordToLearnWebScraping
refs/heads/master
/news/admin.py
from django.contrib import admin from .models import Headline,UserProfile # Register your models here. admin.site.register(Headline) admin.site.register(UserProfile)
{"/notepad/urls.py": ["/notepad/views.py"], "/news/admin.py": ["/news/models.py"]}
35,514
ehapsamy0/test1_dashbordToLearnWebScraping
refs/heads/master
/news/models.py
from django.db import models from django.conf import settings # Create your models here. class Headline(models.Model): title = models.CharField(max_length=150) image = models.ImageField() url = models.TextField() def __str__(self): return serlf.title class UserProfile(models.Model): user = models.OneTo...
{"/notepad/urls.py": ["/notepad/views.py"], "/news/admin.py": ["/news/models.py"]}
35,517
Sean858/ForumApp
refs/heads/master
/forum/model.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/14 下午3:32 # @Author : Gaoxiang Chen # @Site : # @File : model.py # @Software: PyCharm # --------------------- from datetime import datetime from flask._compat import text_type from flask_login import UserMixin from forum import login_manager, db ...
{"/forum/model.py": ["/forum/__init__.py"], "/forum/api.py": ["/forum/__init__.py"]}
35,518
Sean858/ForumApp
refs/heads/master
/forum/api.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/14 下午4:10 # @Author : Gaoxiang Chen # @Site : # @File : api.py # @Software: PyCharm # --------------------- from datetime import datetime from flask import render_template, request, redirect, url_for, flash from flask_login import login_required, cu...
{"/forum/model.py": ["/forum/__init__.py"], "/forum/api.py": ["/forum/__init__.py"]}
35,519
Sean858/ForumApp
refs/heads/master
/forum/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/14 下午8:44 # @Author : Gaoxiang Chen # @Site : # @File : run.py.py # @Software: PyCharm # --------------------- from flask import Flask from flask_bcrypt import Bcrypt from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy app ...
{"/forum/model.py": ["/forum/__init__.py"], "/forum/api.py": ["/forum/__init__.py"]}
35,520
SanjayJohn21358/AudioClassifier
refs/heads/master
/graph_examples.py
import glob import os import librosa import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from matplotlib.pyplot import specgram %matplotlib inline def load_sound_files(file_paths): raw_sounds = [] for fp in file_paths: X,sr = librosa.load(fp) raw_sounds.append(X) retu...
{"/main.py": ["/parser.py", "/model.py"]}
35,521
SanjayJohn21358/AudioClassifier
refs/heads/master
/parser.py
import glob import os import librosa import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from matplotlib.pyplot import specgram def extract_feature(file_name): """ extract mel-frequency cepstral coefficients, chromagraph, spectral contrast, tonal centroid features from file :f...
{"/main.py": ["/parser.py", "/model.py"]}
35,522
SanjayJohn21358/AudioClassifier
refs/heads/master
/model.py
import glob import os import librosa import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import sklearn.metrics from matplotlib.pyplot import specgram def create(tr_features,tr_labels,ts_features,ts_labels): """ define neural network through TensorFlow :tr_features: input, features o...
{"/main.py": ["/parser.py", "/model.py"]}
35,523
SanjayJohn21358/AudioClassifier
refs/heads/master
/main.py
import glob import os import librosa import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from matplotlib.pyplot import specgram import parser import model #set dataset directory parent_dir = 'UrbanSound8k/audio' #set training and testing directories #tr_sub_dirs = ["fold1","fold2","fold3","fold4...
{"/main.py": ["/parser.py", "/model.py"]}
35,524
spudtrooper/arduino-office-communicator
refs/heads/master
/repl.py
#!/usr/bin/env python # # Sends what you type to the serial port. For testing. # import sys import re import os from common import * def main(argv): serialInit() while True: str = raw_input('[0-9|q]> ') if re.match(r'q',str): break try: serialSend(int(str)) ...
{"/repl.py": ["/common.py"]}
35,525
spudtrooper/arduino-office-communicator
refs/heads/master
/server.py
#!/usr/bin/env python # # Communicates with the arduino and responds to changes in Office # Communicator. You can pass in an optional port, default is 8123. # # Examples: # # server.py # port 8123 # server.py 8181 # port 8181 # import BaseHTTPServer import urlparse import urllib import string import cgi impo...
{"/repl.py": ["/common.py"]}
35,526
spudtrooper/arduino-office-communicator
refs/heads/master
/common.py
# Requirements: # # http://pypi.python.org/pypi/pyserial import serial import glob import os # Global serial port serialPort = None def serialInit(serialPortStr=None): """ Sets up serial connection and returns the device name """ global serialPort if serialPortStr is None: serialPortStr ...
{"/repl.py": ["/common.py"]}
35,528
lechdo/flow_application_example
refs/heads/master
/main.py
# encoding:utf-8 from datetime import datetime, timedelta from dummy import Flow, Dummy, steps, get_out_queue flow = Flow() # temps de travail Working_time = 30 class MakeMyCodeDreamsTrue: def __enter__(self): """ quand tu utilise le context manager, tu permet une initialisation, tu peux modif...
{"/main.py": ["/dummy.py"], "/dummy.py": ["/utils/meta.py"]}
35,529
lechdo/flow_application_example
refs/heads/master
/utils/meta.py
# encoding:utf-8 class Singleton(type): """ Meta class, permet d'isoler le principe du singleton à toutes les classes qui hériterons. """ _instances = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: cls._instances[cls] = super(Singleton, cls).__call__(*arg...
{"/main.py": ["/dummy.py"], "/dummy.py": ["/utils/meta.py"]}
35,530
lechdo/flow_application_example
refs/heads/master
/dummy.py
# encoding:utf-8 from utils.meta import Singleton from queue import Queue from collections import namedtuple from time import sleep Step = namedtuple("Step", "one two three four") # pour gérer l'identité d'un marqueur on peut utiliser une instance de base object. Cette instance a sa # propre identité mémoire, et on...
{"/main.py": ["/dummy.py"], "/dummy.py": ["/utils/meta.py"]}
35,542
jintwo/cfgen
refs/heads/master
/cfgen/utils.py
# -*- coding: utf-8 -*- from os import getenv import re def walk(dict_, fn=lambda value: value): result = {} for key, value in dict_.iteritems(): if isinstance(value, dict): result[key] = walk(value, fn) elif isinstance(value, list): result[key] = map(fn, value) ...
{"/cfgen/cli.py": ["/cfgen/utils.py", "/cfgen/renderer.py", "/cfgen/parser.py"]}
35,543
jintwo/cfgen
refs/heads/master
/setup.py
#!/usr/bin/env python from setuptools import setup, find_packages import cfgen setup( name='CFGen', author='Eugeny Volobuev', author_email='qulert@gmail.com', version=cfgen.__version__, url='http://github.com/jintwo/cfgen', install_requires=[ 'Jinja2>=2.6', 'pyrsistent>=0.6.3'...
{"/cfgen/cli.py": ["/cfgen/utils.py", "/cfgen/renderer.py", "/cfgen/parser.py"]}
35,544
jintwo/cfgen
refs/heads/master
/cfgen/parser.py
# -*- coding: utf-8 -*- import json import warnings def _get_parser_map(): result = {'json': JSONConfigParser} try: import yaml except ImportError: warnings.warn('PyYAML not found.') else: result['yaml'] = YAMLConfigParser return result def get_parser(config_type): pa...
{"/cfgen/cli.py": ["/cfgen/utils.py", "/cfgen/renderer.py", "/cfgen/parser.py"]}
35,545
jintwo/cfgen
refs/heads/master
/cfgen/renderer.py
# -*- coding: utf-8 -*- from jinja2 import Environment, FileSystemLoader, Template class BaseRenderer(object): def __init__(self, templates_path): self.templates_path = templates_path def render(self, buf, data): raise NotImplementedError() def render_file(self, filename, data): ...
{"/cfgen/cli.py": ["/cfgen/utils.py", "/cfgen/renderer.py", "/cfgen/parser.py"]}
35,546
jintwo/cfgen
refs/heads/master
/cfgen/cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import codecs from glob import glob import warnings from os import path from pyrsistent import pmap from .utils import walk, env, subst from .renderer import get_renderer from .parser import get_parser def _create_ar...
{"/cfgen/cli.py": ["/cfgen/utils.py", "/cfgen/renderer.py", "/cfgen/parser.py"]}
36,054
DanWertheimer/pyJDBCConnector
refs/heads/master
/pyjdbcconnector/__init__.py
# Version __version__ = '0.2.1'
{"/setup.py": ["/pyjdbcconnector/__init__.py"], "/tests/test_config.py": ["/pyjdbcconnector/connectors.py"]}
36,055
DanWertheimer/pyJDBCConnector
refs/heads/master
/setup.py
import setuptools from pyjdbcconnector import __version__ # read the contents of your README file from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setuptools.setup( name='pyjdbcconne...
{"/setup.py": ["/pyjdbcconnector/__init__.py"], "/tests/test_config.py": ["/pyjdbcconnector/connectors.py"]}
36,056
DanWertheimer/pyJDBCConnector
refs/heads/master
/tests/test_config.py
import configparser import pytest from pyjdbcconnector.connectors import DenodoConnector, HiveConnector def test_denodo(): dc = DenodoConnector() dc.from_config("./tests/utils/denodo_config.ini") assert dc.connection_url == 'test_url' assert dc.username == 'test_username' assert dc.password == '...
{"/setup.py": ["/pyjdbcconnector/__init__.py"], "/tests/test_config.py": ["/pyjdbcconnector/connectors.py"]}
36,057
DanWertheimer/pyJDBCConnector
refs/heads/master
/pyjdbcconnector/connectors.py
import configparser from abc import ABC, abstractmethod from typing import Any, Optional, Union import jaydebeapi import jpype from pyhive import hive Connection = Union[jaydebeapi.Connection, hive.Connection] Connector = Union['DenodoConnector', 'HiveConnector'] class BaseConnector(ABC): @abstractmethod de...
{"/setup.py": ["/pyjdbcconnector/__init__.py"], "/tests/test_config.py": ["/pyjdbcconnector/connectors.py"]}
36,062
rembold-cs151-master/HW08
refs/heads/master
/test_hw8.py
# IMPORTANT! # You don't need to do anything with this file # It is only to provide some automated testing # to give you feedback on if your code is working # correctly! Please do not change! import pytest import os import Prob2 import Prob3 def numcheck(num, ans, tol=0.02): return (ans*(1-tol) < num < ans*(1+t...
{"/test_hw8.py": ["/Prob2.py", "/Prob3.py"]}
36,063
rembold-cs151-master/HW08
refs/heads/master
/Prob3.py
################################################## # Name: # Collaborators: # Est Time Spent (hrs): ################################################## # Class definition class Fraction: def __init__(): pass def __str__(): ''' Returns the string numerator/denominator (with no spaces) ...
{"/test_hw8.py": ["/Prob2.py", "/Prob3.py"]}
36,064
rembold-cs151-master/HW08
refs/heads/master
/Prob2.py
################################################## # Name: # Collaborators: # Est Time Spent (hrs): ################################################## # Class definition class Queue: pass #<-- remove once you've defined your methods # Define your init method # Define your add method # Define your re...
{"/test_hw8.py": ["/Prob2.py", "/Prob3.py"]}
36,083
hanguyenhant/do-an-3
refs/heads/master
/LDA.py
import gensim from gensim import corpora class LDA: def load_data(self, path): self._data = [] with open(path, encoding="utf-8") as f: lines = f.read().splitlines() for line in lines: content = line.split('<fff>')[1] self._data.append([word for word in content.split()]) def create_dictionary(self): ...
{"/main.py": ["/DataCollection.py", "/DataReader.py"]}
36,084
hanguyenhant/do-an-3
refs/heads/master
/main.py
from DataCollection import DataCollection from DataReader import DataReader # data_collection = DataCollection() # data_collection.connect_database() # data_collection.collect_data_from_vnexpress() # data_collection.collect_data_from_vietnamnet() # data_collection.collect_data_from_tuoitre() # data_collection.collect_...
{"/main.py": ["/DataCollection.py", "/DataReader.py"]}
36,085
hanguyenhant/do-an-3
refs/heads/master
/DataCollection.py
import pymysql.cursors import feedparser from urllib.request import urlopen from urllib.request import build_opener from bs4 import BeautifulSoup from http.client import IncompleteRead class DataCollection: def __init__(self): self._baivietList = list() def connect_database(self): #1. Kết nối vào database ...
{"/main.py": ["/DataCollection.py", "/DataReader.py"]}
36,086
hanguyenhant/do-an-3
refs/heads/master
/DataReader.py
import re, string from pyvi import ViTokenizer, ViPosTagger import pymysql.cursors class DataReader: def connect_database(self): #1. Kết nối vào database self._connection = pymysql.connect(host='127.0.0.1', user='root', password='123456', ...
{"/main.py": ["/DataCollection.py", "/DataReader.py"]}
36,089
andrekos/satflow
refs/heads/main
/satflow/data/datasets.py
from typing import Tuple, Union, List, Optional import numpy as np from nowcasting_dataset.dataset.datasets import NetCDFDataset from nowcasting_dataset.config.model import Configuration from nowcasting_dataset.consts import ( SATELLITE_DATA, SATELLITE_X_COORDS, SATELLITE_Y_COORDS, SATELLITE_DATETIME_...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,090
andrekos/satflow
refs/heads/main
/tests/test_models.py
from satflow.models import LitMetNet, Perceiver from nowcasting_utils.models.base import list_models, create_model from nowcasting_dataset.consts import ( SATELLITE_DATA, SATELLITE_X_COORDS, SATELLITE_Y_COORDS, SATELLITE_DATETIME_INDEX, NWP_DATA, NWP_Y_COORDS, NWP_X_COORDS, TOPOGRAPHIC_D...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,091
andrekos/satflow
refs/heads/main
/satflow/version.py
__version__ = "0.3.26"
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,092
andrekos/satflow
refs/heads/main
/satflow/models/gan/common.py
import functools import torch from torch.nn import init def get_norm_layer(norm_type="instance"): """Return a normalization layer Parameters: norm_type (str) -- the name of the normalization layer: batch | instance | none For BatchNorm, we use learnable affine parameters and track running statis...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,093
andrekos/satflow
refs/heads/main
/satflow/models/conv_lstm.py
from typing import Any, Dict, Union import pytorch_lightning as pl import torch import torch.nn as nn import numpy as np from nowcasting_utils.models.base import register_model from nowcasting_utils.models.loss import get_loss from satflow.models.layers.ConvLSTM import ConvLSTMCell import torchvision @register_mod...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,094
andrekos/satflow
refs/heads/main
/satflow/models/__init__.py
from nowcasting_utils.models.base import get_model, create_model from .conv_lstm import EncoderDecoderConvLSTM, ConvLSTM from .pl_metnet import LitMetNet from .runet import R2U_Net, RUnet from .attention_unet import R2AttU_Net, AttU_Net from .perceiver import Perceiver
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,095
andrekos/satflow
refs/heads/main
/satflow/models/pix2pix.py
import torch import torchvision import numpy as np from collections import OrderedDict from torch.optim import lr_scheduler import pytorch_lightning as pl from nowcasting_utils.models.base import register_model from satflow.models.gan.discriminators import define_discriminator, GANLoss from satflow.models.gan import de...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,096
andrekos/satflow
refs/heads/main
/satflow/models/perceiver.py
from perceiver_pytorch import MultiPerceiver from perceiver_pytorch.modalities import InputModality from perceiver_pytorch.encoders import ImageEncoder from perceiver_pytorch.decoders import ImageDecoder from perceiver_pytorch.queries import LearnableQuery from perceiver_pytorch.utils import encode_position import torc...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,097
andrekos/satflow
refs/heads/main
/satflow/models/pl_metnet.py
import einops import numpy as np import torch import torch.nn as nn from typing import Any, Dict from nowcasting_utils.models.base import register_model, BaseModel from nowcasting_utils.models.loss import get_loss from pl_bolts.optimizers.lr_scheduler import LinearWarmupCosineAnnealingLR from metnet import MetNet from...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,098
andrekos/satflow
refs/heads/main
/satflow/models/runet.py
import antialiased_cnns from satflow.models.layers.RUnetLayers import * import pytorch_lightning as pl import torchvision from typing import Union from nowcasting_utils.models.base import register_model from nowcasting_utils.models.loss import get_loss import numpy as np @register_model class RUnet(pl.LightningModule...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,099
andrekos/satflow
refs/heads/main
/satflow/models/attention_unet.py
from typing import Union from satflow.models.layers.RUnetLayers import * import pytorch_lightning as pl import torchvision import numpy as np from nowcasting_utils.models.loss import get_loss from nowcasting_utils.models.losses.FocalLoss import FocalLoss from nowcasting_utils.models.base import register_model @regist...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,100
andrekos/satflow
refs/heads/main
/satflow/data/datamodules.py
import os from nowcasting_dataset.dataset.datasets import worker_init_fn from nowcasting_dataset.config.load import load_yaml_configuration from satflow.data.datasets import SatFlowDataset from typing import Union, List, Tuple, Optional from nowcasting_dataset.consts import ( SATELLITE_DATA, SATELLITE_X_COORDS,...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,101
andrekos/satflow
refs/heads/main
/satflow/models/deeplabv3.py
import torch import torch.nn.functional as F import pytorch_lightning as pl from nowcasting_utils.models.base import register_model from torchvision.models.segmentation import deeplabv3_resnet50, deeplabv3_resnet101 import numpy as np from typing import Union from nowcasting_utils.models.losses.FocalLoss import FocalLo...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,102
andrekos/satflow
refs/heads/main
/satflow/examples/metnet_example.py
from satflow.models import LitMetNet import torch import urllib.request def get_input_target(number: int): url = f"https://github.com/openclimatefix/satflow/releases/download/v0.0.3/input_{number}.pth" filename, headers = urllib.request.urlretrieve(url, filename=f"input_{number}.pth") input_data = torch.l...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,103
andrekos/satflow
refs/heads/main
/satflow/models/layers/Attention.py
import torch import torch.nn as nn from torch.nn import functional as F from torch.nn import init class SeparableAttn(nn.Module): def __init__( self, in_dim, activation=F.relu, pooling_factor=2, padding_mode="constant", padding_value=0 ): super().__init__() self.model = nn.Sequential( ...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,104
andrekos/satflow
refs/heads/main
/satflow/models/gan/discriminators.py
import functools import torch from torch import nn as nn from satflow.models.utils import get_conv_layer from satflow.models.gan.common import get_norm_layer, init_net import antialiased_cnns def define_discriminator( input_nc, ndf, netD, n_layers_D=3, norm="batch", init_type="normal", ini...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,105
andrekos/satflow
refs/heads/main
/satflow/models/unet.py
import torch import pytorch_lightning as pl from nowcasting_utils.models.base import register_model from pl_bolts.models.vision import UNet import numpy as np from typing import Union import torchvision from nowcasting_utils.models.loss import get_loss @register_model class Unet(pl.LightningModule): def __init__(...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,106
andrekos/satflow
refs/heads/main
/satflow/models/gan/generators.py
import functools import torch from torch import nn as nn from typing import Union from satflow.models.gan.common import get_norm_layer, init_net from satflow.models.utils import get_conv_layer import antialiased_cnns def define_generator( input_nc, output_nc, ngf, netG: Union[str, torch.nn.Module], ...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,107
andrekos/satflow
refs/heads/main
/satflow/models/layers/Generator.py
import torch import torch.nn as nn from torch.nn import functional as F from tensorboardX import SummaryWriter from satflow.models.layers.GResBlock import GResBlock from satflow.models.layers.Normalization import SpectralNorm from satflow.models.layers.ConvGRU import ConvGRU from satflow.models.layers.Attention impor...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,108
andrekos/satflow
refs/heads/main
/satflow/models/pixel_cnn.py
import torch import torch.nn.functional as F import pytorch_lightning as pl from nowcasting_utils.models.base import register_model from pl_bolts.models.vision import PixelCNN as Pixcnn @register_model class PixelCNN(pl.LightningModule): def __init__( self, future_timesteps: int, input_cha...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,109
andrekos/satflow
refs/heads/main
/satflow/models/cloudgan.py
import pytorch_lightning as pl import torch from torch.optim import lr_scheduler import torchvision from collections import OrderedDict from satflow.models import R2U_Net, ConvLSTM from satflow.models.gan import GANLoss, define_generator, define_discriminator from satflow.models.layers import ConditionTime from nowcast...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,110
andrekos/satflow
refs/heads/main
/setup.py
from distutils.core import setup from pathlib import Path this_directory = Path(__file__).parent install_requires = (this_directory / "requirements.txt").read_text().splitlines() long_description = (this_directory / "README.md").read_text() exec(open("satflow/version.py").read()) setup( name="satflow", versio...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,111
andrekos/satflow
refs/heads/main
/satflow/models/layers/ConditionTime.py
import torch from torch import nn as nn def condition_time(x, i=0, size=(12, 16), seq_len=15): "create one hot encoded time image-layers, i in [1, seq_len]" assert i < seq_len times = (torch.eye(seq_len, dtype=x.dtype, device=x.device)[i]).unsqueeze(-1).unsqueeze(-1) ones = torch.ones(1, *size, dtype=...
{"/tests/test_models.py": ["/satflow/models/__init__.py"], "/satflow/models/__init__.py": ["/satflow/models/conv_lstm.py", "/satflow/models/pl_metnet.py", "/satflow/models/runet.py", "/satflow/models/attention_unet.py", "/satflow/models/perceiver.py"], "/satflow/models/pix2pix.py": ["/satflow/models/gan/discriminators....
36,113
Meffest/vk_to_telegram
refs/heads/master
/bot.py
import config import json from time import sleep from requests import get from vk_wall_listener import get_data_from_last_wall_record def send_message(message_text): url = 'https://api.telegram.org/bot' + config.telegram_token + '/sendMessage' parameters = {'chat_id': config.chat_id, 'text'...
{"/bot.py": ["/config.py"]}
36,114
Meffest/vk_to_telegram
refs/heads/master
/config.py
telegram_token = chat_id = vk_token = vk_group_ids =
{"/bot.py": ["/config.py"]}
36,117
yoavweiss/Sizer-Soze
refs/heads/master
/downloadr.py
#!/usr/bin/python import os import sys from urllib2 import HTTPError, URLError, urlopen, Request from slugify import slugify import hashlib from Queue import Queue from threading import Thread def resourceSlug(url, dir): hash = hashlib.md5() hash.update(url) digest = hash.hexdigest()[:2] slug = slugif...
{"/resizeBenefits.py": ["/downloadr.py"]}
36,118
yoavweiss/Sizer-Soze
refs/heads/master
/resizeBenefits.py
from downloadr import resourceSlug from subprocess import call, check_output import magic import os from shutil import copyfile def analyzeResult(result): arr = result.split() url = arr[0] width = arr[1] height = arr[2] return (url, width, height) def fileSize(name): return...
{"/resizeBenefits.py": ["/downloadr.py"]}
36,119
yoavweiss/Sizer-Soze
refs/heads/master
/slug.py
#!/usr/bin/env python from slugify import slugify import settings import sys import os if len(sys.argv) <= 1: print >> sys.stderr, "Usage:", sys.argv[0], "<URL>" quit() url = sys.argv[1] slugged_dir = os.path.join(settings.output_dir, slugify(url)) print slugged_dir
{"/resizeBenefits.py": ["/downloadr.py"]}
36,120
yoavweiss/Sizer-Soze
refs/heads/master
/settings.py
# The output directory to which the results will be written output_dir = "/tmp/sizer" # The viewport values on which sizer will run viewports = [360, 720, 1260]
{"/resizeBenefits.py": ["/downloadr.py"]}
36,121
yoavweiss/Sizer-Soze
refs/heads/master
/sizer_json.py
#!/usr/bin/env python import sys import os from sizer import sizer import json import requests if __name__ == "__main__": # Check input if len(sys.argv) <= 4: print >> sys.stderr, "Usage:", sys.argv[0], "<URL> <viewport> <ignore display:none> <postback_url>" quit() url = sys.argv[1] vi...
{"/resizeBenefits.py": ["/downloadr.py"]}
36,122
yoavweiss/Sizer-Soze
refs/heads/master
/sizer.py
#!/usr/bin/env python from slugify import slugify import sys import os from subprocess import Popen, PIPE from downloadr import downloadFiles import resizeBenefits import settings def col(value, length=16): return str(value).ljust(length + 1) def sizer(url, viewport, ignore_invisibles, toFile): # Prepare the...
{"/resizeBenefits.py": ["/downloadr.py"]}
36,127
kjona/limesurveyrc2api
refs/heads/master
/limesurveyrc2api/tests/tests.py
import os import unittest from operator import itemgetter from limesurveyrc2api import LimeSurveyRemoteControl2API from configparser import ConfigParser class TestBase(unittest.TestCase): def setUp(self): # Read config.ini file current_dir = os.path.dirname(os.path.realpath(__file__)) ...
{"/limesurveyrc2api/tests/tests.py": ["/limesurveyrc2api/__init__.py"], "/limesurveyrc2api/__init__.py": ["/limesurveyrc2api/limesurveyrc2api.py"]}
36,128
kjona/limesurveyrc2api
refs/heads/master
/limesurveyrc2api/__init__.py
from .limesurveyrc2api import LimeSurveyRemoteControl2API, LimeSurveyError # Lifts the class into the package namespace instead of package.module # Otherwise you'd need from limesurveyrc2api.limesurveyrc2api import Lime...
{"/limesurveyrc2api/tests/tests.py": ["/limesurveyrc2api/__init__.py"], "/limesurveyrc2api/__init__.py": ["/limesurveyrc2api/limesurveyrc2api.py"]}
36,129
kjona/limesurveyrc2api
refs/heads/master
/limesurveyrc2api/limesurveyrc2api.py
import requests import json from collections import OrderedDict class LimeSurveyError(Exception): """Base class for exceptions in LimeSurvey.""" pass class LimeSurveyRemoteControl2API(object): def __init__(self, url): self.url = url self.headers = {"content-type": "application/json"} ...
{"/limesurveyrc2api/tests/tests.py": ["/limesurveyrc2api/__init__.py"], "/limesurveyrc2api/__init__.py": ["/limesurveyrc2api/limesurveyrc2api.py"]}
36,131
kaizen123/Left-Ventricle-Segmentation
refs/heads/master
/preprocessing.py
import pydicom, cv2, re import os, fnmatch, sys import numpy as np from keras.preprocessing.image import ImageDataGenerator from keras import backend as K from itertools import izip from utils import center_crop, lr_poly_decay, get_SAX_SERIES SAX_SERIES = get_SAX_SERIES() SUNNYBROOK_ROOT_PATH = '../Data/' TEST_CONTOUR...
{"/preprocessing.py": ["/utils.py"]}
36,132
kaizen123/Left-Ventricle-Segmentation
refs/heads/master
/cnn_model.py
import keras from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten, Reshape from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D from keras.preprocessing.image import ImageDataGenerator from keras import regul...
{"/preprocessing.py": ["/utils.py"]}
36,133
kaizen123/Left-Ventricle-Segmentation
refs/heads/master
/StackedAeModel.py
import keras from keras.models import Model,Sequential from keras.layers import Input,Dense, Dropout, Activation, Flatten, Reshape, Conv2D, MaxPooling2D, AveragePooling2D from keras import regularizers from keras.losses import mean_squared_error from keras import losses import matplotlib.patches as patches import numpy...
{"/preprocessing.py": ["/utils.py"]}
36,134
kaizen123/Left-Ventricle-Segmentation
refs/heads/master
/utils.py
#!/usr/bin/env python2.7 import numpy as np import cv2 from keras import backend as K import os from sklearn.metrics import confusion_matrix import itertools import numpy as np import matplotlib.pyplot as plt def get_SAX_SERIES(): SAX_SERIES = {} with open('SAX_series.txt', 'r') as f: for line in f: ...
{"/preprocessing.py": ["/utils.py"]}
36,145
hartescout/Malware-Lake
refs/heads/master
/main.py
import module_db as mldb if __name__ == "__main__": """ Create a new database object This object is for the Malware Bazaar Database Please set your API key """ db_bazaar = mldb.Database("Bazaar", "API-KEY-BAZAAR", "https://bazaar.abuse.ch/ex...
{"/main.py": ["/module_db.py"], "/module_db.py": ["/module_api_parser.py"]}
36,146
hartescout/Malware-Lake
refs/heads/master
/module_db.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 27 15:59:40 2020 @author: Danus """ import os import requests import pandas import module_api_parser as api_parser from zipfile import ZipFile from datetime import date """ A const dictionary containing extraction settings for each database type """ const...
{"/main.py": ["/module_db.py"], "/module_db.py": ["/module_api_parser.py"]}
36,147
hartescout/Malware-Lake
refs/heads/master
/module_api_parser.py
# -*- coding: utf-8 -*- """ Created on Fri Mar 27 17:27:42 2020 @author: Danus """ import requests from datetime import datetime """ Constant dictionary that defines all possible repsonses that can return from AP calls that can return from Malware Bazaar """ const_dict_resposne_bazzar = { "ok": Tr...
{"/main.py": ["/module_db.py"], "/module_db.py": ["/module_api_parser.py"]}
36,148
sevberg/prefect_playground
refs/heads/main
/workflow/flow_generator.py
from os import environ, path from prefect import Flow, unmapped, Parameter from prefectplayground.tasks import add_matrix, generate_list def BasicFlow() -> Flow: with Flow( name="basic_flow", ) as flow: # Simple list generation task generate_list_n_members = Parameter("generate_list_...
{"/workflow/flow_generator.py": ["/prefectplayground/tasks.py"]}
36,149
sevberg/prefect_playground
refs/heads/main
/workflow/k8s_dask_executor.py
from prefect.storage import Docker from prefect.run_configs import KubernetesRun from prefect.executors.dask import DaskExecutor from os import path import flow_generator # Fetch flow flow = flow_generator.BasicFlow() # Build and push image module_dir = path.dirname(path.dirname(path.abspath(__file__))) def get_re...
{"/workflow/flow_generator.py": ["/prefectplayground/tasks.py"]}