index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
86,215 | ethanwang27/Proxy-Pool | refs/heads/master | /fetcher/proxyFecther.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/22 11:47
@File: proxyFetcher.py
@Project: Proxy-Pool
@Description: None
"""
import time
from utils.WebRequest import WebRequest
from helper.logHepler import LogHelper
class ProxyFetcher(object):
def __init__(self):
... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,216 | ethanwang27/Proxy-Pool | refs/heads/master | /handler/fetcherHandler.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/22 14:54
@File: fetcherHandler.py
@Project: Proxy-Pool
@Description: None
"""
from helper.logHepler import LogHelper
from handler.proxyHandler import ProxyHandler
from fetcher.proxyFecther import ProxyFetcher
import config
clas... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,217 | ethanwang27/Proxy-Pool | refs/heads/master | /helper/proxyHelper.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/22 11:48
@File: proxyHelper.py
@Project: Proxy-Pool
@Description: None
"""
import json
from helper.logHepler import LogHelper
class Proxy(object):
def __init__(self, proxy, fail_count=0, region='', proxy_type='',
... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,218 | ethanwang27/Proxy-Pool | refs/heads/master | /falsk_api/proxy_pool_interface.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/22 18:39
@File: proxy_pool_interface.py
@Project: Proxy-Pool
@Description: None
"""
from abc import ABC
from werkzeug.wrappers import Response
from flask import Flask, jsonify, request
import gunicorn.app.base
from handler.proxy... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,219 | ethanwang27/Proxy-Pool | refs/heads/master | /handler/proxyCheckerHandler.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/22 12:47
@File: proxyCheckerHandler.py
@Project: Proxy-Pool
@Description: None
"""
from threading import Thread
from datetime import datetime
from helper.logHepler import LogHelper
from helper.proxyHelper import Proxy
from utils... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,220 | ethanwang27/Proxy-Pool | refs/heads/master | /utils/__init__.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/14 11:07
@File: __init__.py
@Project: Proxy-Pool
@Description: None
"""
| {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,221 | ethanwang27/Proxy-Pool | refs/heads/master | /helper/mongoDbHelper.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/15 20:41
@File: mongoDbHelper.py
@Project: Proxy-Pool
@Description: None
"""
from pymongo import MongoClient
import config
class MongodbHelper(object):
def __init__(self):
self.name = config.DB_COLLECTION
s... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,222 | ethanwang27/Proxy-Pool | refs/heads/master | /handler/schedulerHandler.py | # -*-coding:utf-8-*-
"""
@Author: ethan
@Email: ethanwang279@gmail.com
@Datetime: 2020/8/22 16:16
@File: schedulerHandler.py
@Project: Proxy-Pool
@Description: None
"""
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.executors.pool import ProcessPoolExecutor
from queue import Empty, Que... | {"/handler/proxyHandler.py": ["/helper/proxyHelper.py", "/helper/mongoDbHelper.py"], "/handler/fetcherHandler.py": ["/handler/proxyHandler.py", "/fetcher/proxyFecther.py", "/config.py"], "/falsk_api/proxy_pool_interface.py": ["/handler/proxyHandler.py", "/helper/proxyHelper.py"], "/handler/proxyCheckerHandler.py": ["/h... |
86,223 | dylanbuchi/crack-the-code-game | refs/heads/main | /main.py | import sys
from crack_the_code import CrackTheCodeGame
def play_again():
res = input("Do you want to play again ? (y/n)").strip().lower()[0:1]
play_game() if res == 'y' else sys.exit()
def play_game():
game = CrackTheCodeGame()
game.play()
play_again()
def main():
play_game()
if __name_... | {"/main.py": ["/crack_the_code.py"], "/crack_the_code.py": ["/code_generator.py"]} |
86,224 | dylanbuchi/crack-the-code-game | refs/heads/main | /code_generator.py | import random
class CodeGenerator:
"""Class to generate a secret code of integers"""
def __init__(self, total_digits: int = 4):
self.total_digits = total_digits
def create_digits_code_list(self):
digits = []
for _ in range(self.total_digits):
digits.append(random.randi... | {"/main.py": ["/crack_the_code.py"], "/crack_the_code.py": ["/code_generator.py"]} |
86,225 | dylanbuchi/crack-the-code-game | refs/heads/main | /crack_the_code.py | from player import Player
from code_generator import CodeGenerator
class CrackTheCodeGame:
"""4 digits guessing game || hard mode: 5 digits || easy mode: shows the user which position they guessed correctly"""
def __init__(self):
self.hard_mode = False
self.easy_mode = False
self.eas... | {"/main.py": ["/crack_the_code.py"], "/crack_the_code.py": ["/code_generator.py"]} |
86,251 | slugalisk/bdgg_service | refs/heads/master | /destinygg/users.py | import json
from tornado.httpclient import AsyncHTTPClient
import bdgg.config as config
_allusers = {}
_change_handlers = set()
def _wrap_user_cb(func):
def handle_response(response):
if response.error:
print "Error: ", response.error
else:
user_json = json.loads(response.... | {"/bdgg/handlers.py": ["/bdgg/config.py", "/destinygg/users.py"]} |
86,252 | slugalisk/bdgg_service | refs/heads/master | /main.py | # server backend for better destiny.gg
import time
import datetime
import httplib
import json
import os
import re
from StringIO import StringIO
import sys
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import bdgg.config as config
import bdgg.handlers
import destinygg.users
... | {"/bdgg/handlers.py": ["/bdgg/config.py", "/destinygg/users.py"]} |
86,253 | slugalisk/bdgg_service | refs/heads/master | /bdgg/handlers.py | import datetime
import json
import re
import tornado.websocket
import bdgg.config as config
import bdgg.crypto as crypto
import bdgg.wordgen as wordgen
import destinygg.users
allowedremaining = {}
ipident = {}
banned = set()
def TimeStr():
return '['+str(datetime.datetime.now()).split('.',1)[0]+'] '
class Socke... | {"/bdgg/handlers.py": ["/bdgg/config.py", "/destinygg/users.py"]} |
86,254 | slugalisk/bdgg_service | refs/heads/master | /bdgg/config.py | import json
CONFIG_KEYS = [
'filepath', #local log directory
'port', #listening port
'linelimit', #hard limit on lines sent
'connectionlimit', #limit on how many active sessions an IP is allowed. not implemented
'rebuildinterval', #how often to refre... | {"/bdgg/handlers.py": ["/bdgg/config.py", "/destinygg/users.py"]} |
86,255 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/migrations/0003_auto_20210319_1936.py | # Generated by Django 3.1.7 on 2021-03-20 00:36
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('Cuarto', '0002_reservas'),
]
operations = [
migr... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,256 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/apps.py | from django.apps import AppConfig
class CuartoConfig(AppConfig):
name = 'Cuarto'
| {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,257 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/forms.py | from django import forms
class DisponibilidadForm(forms.Form):
CATEGORIAS_CUARTO = (
('SC','SENCILLA'),
('DBL','DOBLE'),
('KG','KING'),
('QN','QUEEN'),
('LJ','LUJO'),
)
categoria_cuarto = forms.ChoiceField(choices = CATEGORIAS_CUARTO, required=True)
Entrada ... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,258 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/migrations/0001_initial.py | # Generated by Django 3.1.7 on 2021-03-19 22:24
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Cuarto',
fields=[
('id', models.AutoField(a... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,259 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/urls.py | from django.urls import path
from .views import ListaHabitacion, ListaReserva, VistaReserva, Reserva_delete
urlpatterns=[
path('lista_habitacion/', ListaHabitacion.as_view(), name='ListaHabitacion'),
path('lista_reserva/', ListaReserva.as_view(), name='ListaReserva'),
path('vista_reserva/', VistaReserva.... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,260 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/models.py | from django.db import models
from django.db import models
from django.conf import settings
# Create your models here.
class Cuarto(models.Model):
CATEGORIAS_CUARTO = (
('SC','SENCILLA'),
('DBL','DOBLE'),
('KG','KING'),
('QN','QUEEN'),
('LJ','LUJO'),
)
numero_hab... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,261 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/admin.py | from django.contrib import admin
from .models import Cuarto, Reserva
# Register your models here.
admin.site.register(Cuarto)
admin.site.register(Reserva) | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,262 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/funciones_reserva/disponibilidad.py | import datetime
from Cuarto.models import Cuarto, Reserva
def check_disponibilidad(Cuarto, check_in, check_out):
dispon_list = []
lista_reservas = Reserva.objects.filter(cuarto=Cuarto)
for reserva in lista_reservas:
if reserva.check_in > check_out or reserva.check_out < check_in:
dispon... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,263 | MiguelA449/proyecto_hotel | refs/heads/master | /HotelSoft/Cuarto/views.py | from django.shortcuts import render, HttpResponse
from django.views.generic import ListView, FormView
from .models import Cuarto, Reserva
from .forms import DisponibilidadForm
from Cuarto.funciones_reserva.disponibilidad import check_disponibilidad
# Create your views here.
class ListaHabitacion(ListView):
model=C... | {"/HotelSoft/Cuarto/urls.py": ["/HotelSoft/Cuarto/views.py"], "/HotelSoft/Cuarto/admin.py": ["/HotelSoft/Cuarto/models.py"], "/HotelSoft/Cuarto/views.py": ["/HotelSoft/Cuarto/models.py", "/HotelSoft/Cuarto/forms.py"]} |
86,265 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /loss.py | #!/usr/bin/python3
"""
Loss class
Provides different loss functions to be used by keras
"""
from keras import losses
from config import config
class Loss(object):
def __init__(self):
self.config = config
self.loss = self.config.loss
def get(self):
return getattr(self, self.loss)
... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,266 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /vocal_isolation.py | #!/usr/bin/python3
"""
VocalIsolation class
Main entry point of the application
Two main usages:
python3 vocal_isolation.py
=> executes a training using the configurations in Config
python3 vocal_isolation.py song.wav
=> isolates vocal from 'song.wav'
"""
import random
import string
import os
impor... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,267 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /config.py | #!/usr/bin/python3
"""
Config class (singleton)
Provides all the configurations to be used by the application
=> use environment variables or set the values directly
"""
import os
from hashlib import md5
import datetime
class Config(object):
def __init__(self):
self._values = {}
# Size of ... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,268 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /analysis.py | #!/usr/bin/python3
"""
Analysis class
Provides analysis functionalities
"""
import argparse
import os
import numpy as np
from config import config
import h5py
import matplotlib
# The default tk backend does not work without X server
matplotlib.use('Agg')
import matplotlib.pyplot as plt # noqa: E402
import convers... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,269 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /modeler.py | #!/usr/bin/python3
"""
Modeler class
Provides keras models to be trained
"""
from keras.models import Model
from keras.layers import Input, Dropout, Conv2D, BatchNormalization, \
UpSampling2D, Concatenate, LeakyReLU
from config import config
class Modeler(object):
def __init__(self):
self.confi... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,270 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /normalizer.py | #!/usr/bin/python3
"""
Normalizer class
Providides normalization functionalities to be used for data preparation
"""
import numpy as np
import copy
from hashlib import md5
from config import config
class Normalizer(object):
def __init__(self):
self.config = config
self.normalizer = self.config... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,271 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /metrics.py | #!/usr/bin/python3
"""
Metrics class
Provides different metrics to be used by keras
"""
import keras.backend as K
from config import config
class Metrics(object):
def __init__(self):
self.config = config
self.metrics = self.config.metrics
def get(self):
if not self.metrics:
... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,272 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /data.py | #!/usr/bin/python3
"""
Data class
Utility class for data preparation
"""
import sys
import os
import numpy as np
import h5py
import console
import conversion
from config import config
from chopper import Chopper
from normalizer import Normalizer
def remove_track_boundaries(tracks):
slices = []
for track in... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,273 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /conversion.py | #!/usr/bin/python3
"""
Utilities to convert wav files to spectrograms and back
"""
import librosa
import numpy as np
import warnings
import skimage.io as io
from os.path import basename
from math import ceil
import argparse
from matplotlib.cm import get_cmap
import console
def load_audio_file(file_path):
audio,... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,274 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /optimizer.py | #!/usr/bin/python3
"""
Optimizer class
Provides different optimizers to be used by keras
"""
from config import config
from keras.optimizers import Adam, RMSprop
class Optimizer(object):
def __init__(self):
self.config = config
self.optimizer = self.config.optimizer
self.params = self.c... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,275 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /chopper.py | #!/usr/bin/python3
from hashlib import md5
from config import config
from inspect import signature
import numpy as np
import random
class Chopper(object):
def __init__(self):
self.config = config
self.name = self.config.chopname
self.params = self.config.chopparams
def get(self, both=... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,276 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /grid_search.py | #!/usr/bin/python3
"""
GridSearch class
Provides the possibility to run multiple configurations from a .yml file
"""
import yaml
import csv
import sys
import os
import matplotlib
# The default tk backend does not work without X server
matplotlib.use('Agg')
import matplotlib.pyplot as plt # noqa: E402
import console... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,277 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /checkpointer.py | #!/usr/bin/python3
"""
Checkpointer class
Provides checkpoint hooks to be used by keras
"""
import datetime
from keras.callbacks import ModelCheckpoint, TensorBoard, \
Callback, EarlyStopping
from matplotlib.cm import get_cmap
from PIL import Image
import numpy as np
import os
from config import config
class ... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,278 | ehsaanhridoy/deep-vocal-isolation | refs/heads/master | /batch.py | #!/usr/bin/python3
"""
Batch class
Provides different batch generation methods
"""
import numpy as np
import random
from config import config
from data import remove_track_boundaries
from chopper import Chopper
class Batch(object):
def __init__(self):
self.config = config
self.batch_generator =... | {"/loss.py": ["/config.py"], "/vocal_isolation.py": ["/conversion.py", "/data.py", "/config.py", "/metrics.py", "/checkpointer.py", "/modeler.py", "/loss.py", "/optimizer.py", "/chopper.py", "/normalizer.py", "/batch.py"], "/analysis.py": ["/config.py", "/conversion.py", "/vocal_isolation.py", "/data.py", "/normalizer.... |
86,314 | jacobtomlinson/dask-mpi | refs/heads/master | /dask_mpi/core.py | import asyncio
import atexit
import sys
import dask
from dask.distributed import Client, Nanny, Scheduler, Worker
from tornado import gen
from tornado.ioloop import IOLoop
def initialize(
interface=None,
nthreads=1,
local_directory="",
memory_limit="auto",
nanny=False,
dashboard=True,
das... | {"/dask_mpi/__init__.py": ["/dask_mpi/core.py"]} |
86,315 | jacobtomlinson/dask-mpi | refs/heads/master | /dask_mpi/__init__.py | from ._version import get_versions
from .core import initialize
__version__ = get_versions()["version"]
del get_versions
| {"/dask_mpi/__init__.py": ["/dask_mpi/core.py"]} |
86,316 | jacobtomlinson/dask-mpi | refs/heads/master | /dask_mpi/cli.py | import asyncio
import click
from dask.distributed import Nanny, Scheduler, Worker
from distributed.cli.utils import check_python_3
from mpi4py import MPI
@click.command()
@click.option(
"--scheduler-file",
type=str,
default="scheduler.json",
help="Filename to JSON encoded scheduler information.",
)
@... | {"/dask_mpi/__init__.py": ["/dask_mpi/core.py"]} |
86,343 | Zabarobot/kursKozaczko | refs/heads/master | /biblio/shelf/admin.py | from django.contrib import admin
from .models import Author, Publisher, Book
#dokumentacja The Admin - opcje konfiguracji
## klasa administracyjna - z modulu admin
class AuthorAdmin(admin.ModelAdmin):
search_fields = ['last_name', 'first_name'] # search_fiels - dodanie wyszukiwarki
ordering = ['l... | {"/biblio/shelf/admin.py": ["/biblio/shelf/models.py"]} |
86,344 | Zabarobot/kursKozaczko | refs/heads/master | /biblio/shelf/models.py | from django.db import models ##co to
class Author(models.Model):
first_name = models.CharField(max_length=20)
last_name = models.CharField(max_length=50)
def __str__(self): ##zwraca nam stringa - nazw; ustawia nazwa w bazie
return "{first_name} {last_name}".format(first_name=self.first_na... | {"/biblio/shelf/admin.py": ["/biblio/shelf/models.py"]} |
86,346 | tonicbupt/yoggsaron | refs/heads/master | /app.py | #!/usr/bin/python
# encoding: UTF-8
import logging
import config
from flask import Flask, redirect, url_for
from sheep.api.sessions import SessionMiddleware, FilesystemSessionStore
from models import init_db
from models.topic import *
logger = logging.getLogger(__name__)
app = Flask(__name__)
app.debug = config.DE... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,347 | tonicbupt/yoggsaron | refs/heads/master | /models/food.py | # -*- coding:utf-8 -*-
from sheep.api.cache import cache, backend
from models import db
from models.base import BaseObject
_FOOD_KEY = 'food:%s'
class Food(db.Model, BaseObject):
price = db.Column('price', db.Integer, nullable=True)
__tablename__ = 'food'
type = 'food'
def __init__(self, name, desc,... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,348 | tonicbupt/yoggsaron | refs/heads/master | /models/restaurant.py | # -*- coding:utf-8 -*-
from sheep.api.cache import cache, backend
from models import db
from models.base import BaseObject
from models.mixin.comment import CommentMixin
_RESTAURANT_KEY = 'rest:%s'
class Restaurant(db.Model, BaseObject, CommentMixin):
addr = db.Column('addr', db.String(255), nullable=False)
p... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,349 | tonicbupt/yoggsaron | refs/heads/master | /utils/__init__.py | # -*- coding:utf-8 -*-
from functools import wraps
def service_exception(f):
@wraps(f)
def _(*a, **kw):
try:
c = f(*a, **kw)
except Exception, e:
c = {}
return c
return _
| {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,350 | tonicbupt/yoggsaron | refs/heads/master | /models/mixin/comment.py | # -*- coding:utf-8 -*-
from sheep.api.service import get_service
from utils import service_exception
COMMENT_SERVICE_NAME = 'service.api'
# TODO unix = ?
comment_service = get_service(COMMENT_SERVICE_NAME, unix='')
class CommentMixin(object):
comment_type = ''
@service_exception
def add_comment(self, a... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,351 | tonicbupt/yoggsaron | refs/heads/master | /models/base.py | # -*- coding:utf-8 -*-
from datetime import datetime
from models import db
class BaseObject(object):
id = db.Column('id', db.Integer, primary_key=True, autoincrement=True)
name = db.Column('name', db.String(255), nullable=False, index=True)
desc = db.Column('desc', db.Text, nullable=True)
time = db.Col... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,352 | tonicbupt/yoggsaron | refs/heads/master | /models/topic.py | # -*- coding:utf-8 -*-
from sheep.api.cache import cache, backend
from models import db
from models.base import BaseTopic
from models.like import LikeItem
from models.mixin.comment import CommentMixin
from models.consts import KIND_TOPIC
_TOPIC_KEY = 'topic:%s'
class Topic(db.Model, BaseTopic, CommentMixin):
__t... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,353 | tonicbupt/yoggsaron | refs/heads/master | /models/consts.py | # -*- coding:utf-8 -*-
LIKE = 'l'
DISLIKE = 'd'
KIND_TOPID = 't'
| {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,354 | tonicbupt/yoggsaron | refs/heads/master | /models/like.py | # -*- coding:utf-8 -*-
from sheep.api.cache import cache, backend
from models import db, IntegrityError
from models.base import BaseLikeObject
from models.consts import LIKE, DISLIKE
_LIKE_NUM_TARGET = 'like:target:%s:%s'
_DISLIKE_NUM_TARGET = 'hate:target:%s:%s'
class LikeItem(db.Model, BaseLikeObject):
__tabl... | {"/app.py": ["/models/topic.py"], "/models/food.py": ["/models/base.py"], "/models/restaurant.py": ["/models/base.py", "/models/mixin/comment.py"], "/models/mixin/comment.py": ["/utils/__init__.py"], "/models/topic.py": ["/models/base.py", "/models/like.py", "/models/mixin/comment.py", "/models/consts.py"], "/models/li... |
86,356 | groowe/PWD | refs/heads/master | /test.py | #!/usr/bin/env python3
import unittest
import hashlib
import base64
import random
import time
import sys
from string import punctuation, digits
from string import ascii_lowercase, ascii_uppercase
from os import remove
from cryptography.fernet import Fernet
from pwtools import hash_it, validatepass, extrachars, genpa... | {"/test.py": ["/pwtools.py", "/new_gen.py"], "/new_gen.py": ["/pwtools.py", "/css_tools.py"], "/passwordmanager.py": ["/pwtools.py"]} |
86,357 | groowe/PWD | refs/heads/master | /new_gen.py | #!/usr/bin/env python3
"""Gtk gui for password manager."""
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Gdk
from pwtools import validate_password, uncode, newpass
from pwtools import newrandompass, hash_it, extrachars
from css_tools import read_saved_css
FILENAME = 'safepasswords' ... | {"/test.py": ["/pwtools.py", "/new_gen.py"], "/new_gen.py": ["/pwtools.py", "/css_tools.py"], "/passwordmanager.py": ["/pwtools.py"]} |
86,358 | groowe/PWD | refs/heads/master | /css_tools.py | """CSS styling management for new_pass Gtk GUI."""
CSS_FILE = 'pm.css' # for saving / loading settings
# default css settings
LATTICED = ", ".join(["#262626", "#626262"]*40)
DEFAULT_CSS = """
* { font-size : 20px;
background : #000000;
background-image: linear-gradient(#000000, #222222);
color : grey;
... | {"/test.py": ["/pwtools.py", "/new_gen.py"], "/new_gen.py": ["/pwtools.py", "/css_tools.py"], "/passwordmanager.py": ["/pwtools.py"]} |
86,359 | groowe/PWD | refs/heads/master | /pwtools.py | #!/usr/bin/env python3
"""Common use functions for password management."""
import hashlib # for hashing main password
# from getpass import getpass # for hidden input
import base64
from os import remove # for ability to delete file in newpasss
import random # for random gen pass
from string import punctuation, dig... | {"/test.py": ["/pwtools.py", "/new_gen.py"], "/new_gen.py": ["/pwtools.py", "/css_tools.py"], "/passwordmanager.py": ["/pwtools.py"]} |
86,360 | groowe/PWD | refs/heads/master | /passwordmanager.py | #!/usr/bin/env python
"""
Terminal based password manager.
needs pwtools in same directory
"""
# ask for password
# hash sha512 it
# import hashlib # for hashing main password # moved to pwtools
from getpass import getpass # for hidden input
import base64
from string import punctuation
from string import digits, as... | {"/test.py": ["/pwtools.py", "/new_gen.py"], "/new_gen.py": ["/pwtools.py", "/css_tools.py"], "/passwordmanager.py": ["/pwtools.py"]} |
86,361 | samastur/pyimagediet | refs/heads/master | /tests/balloon.py | #!/usr/bin/env python
import sys
def main(filename, content, *args):
with open(filename, 'a') as f:
f.write(content)
f.write('\n')
if __name__ == '__main__':
main(*sys.argv[1:])
| {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,362 | samastur/pyimagediet | refs/heads/master | /pyimagediet/process.py | # -*- coding: utf-8 -*-
"""
pyimagediet
~~~~~~~~~~~~
:copyright: (c) 2015 by Marko Samastur
:license: MIT, see LICENSE for more details.
"""
import copy
import filecmp
import magic
import os
from os.path import exists, isfile
from os.path import abspath, dirname, join, exists, isfile
import shutil
from subprocess impo... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,363 | samastur/pyimagediet | refs/heads/master | /setup.py | import codecs
import os
import re
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
HERE = os.path.abspath(os.path.dirname(__file__))
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
Te... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,364 | samastur/pyimagediet | refs/heads/master | /pyimagediet/cli.py | import click
import pyimagediet.process as process
from pyimagediet.helpers import get_config
CONFIGURE_HELP = '''\
Inspect and print configuration customisation for your environment.'''
def get_configuration(ctx, param, value):
if value:
click.echo(get_config())
ctx.exit()
@click.command()
@c... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,365 | samastur/pyimagediet | refs/heads/master | /tests/test_scripts.py | from click.testing import CliRunner
import filecmp
import os
from os.path import abspath, dirname, join
import shutil
import pyimagediet.cli as diet
import pyimagediet.process as process
import pyimagediet.helpers as helpers
TOOLS_DIR = os.getenv('DIET_TOOLS_DIR', '/usr/local/bin')
TEST_DIR = abspath(dirname(__file__... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,366 | samastur/pyimagediet | refs/heads/master | /tests/test_helpers.py | import os
import pyimagediet.helpers as helpers
TOOLS_DIR = os.getenv('DIET_TOOLS_DIR', '/usr/local/bin')
def test_find_tools_returns_empty_dict_if_no_tools_are_found():
tools = ('fakeoptipng',)
cmds = helpers.find_tools(tools)
assert cmds == {}
def test_find_tools_finds_them():
tools = ('optipng'... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,367 | samastur/pyimagediet | refs/heads/master | /tests/test_process.py | import copy
import filecmp
import os
from os.path import abspath, dirname, join, exists
import pytest
import shutil
import pyimagediet.process as diet
TEST_DIR = abspath(dirname(__file__))
TEST_FILES_DIR = join(TEST_DIR, 'test_files')
TEST_CONFIG = {
'commands': {
'advpng': '/usr/local/bin/advpng',
... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,368 | samastur/pyimagediet | refs/heads/master | /pyimagediet/__init__.py | from .process import (
DietException, NotFileDietException, ConfigurationErrorDietException,
CompressFileDietException,
read_yaml_configuration, parse_configuration, update_configuration,
check_configuration, diet
)
__author__ = ("Marko Samastur <markos@gaivo.net>")
__version__ = "1.1.1"
__all__ = [... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,369 | samastur/pyimagediet | refs/heads/master | /pyimagediet/helpers.py | from distutils.spawn import find_executable
import yaml
# List of popular external tools to search for
TOOLS = (
'jpegoptim',
'jpegtran',
'gifsicle',
'optipng',
'advpng',
'pngcrush',
)
# Preferred pipelines. Feels like they (as tools) should be saved in
# external file, but can't think of a b... | {"/pyimagediet/cli.py": ["/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_scripts.py": ["/pyimagediet/cli.py", "/pyimagediet/process.py", "/pyimagediet/helpers.py"], "/tests/test_helpers.py": ["/pyimagediet/helpers.py"], "/tests/test_process.py": ["/pyimagediet/process.py"], "/pyimagediet/__init__.py... |
86,387 | kevinlin6543/SaveTheWorld | refs/heads/master | /GUI.py | import kivy
from kivy.app import App
from kivy.uix.dropdown import DropDown
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.image import Image
from kivy.uix.button import Button
from kivy.base import runTouchApp
from kivy.uix.textinput import TextInput
from kivy.lang imp... | {"/GUI.py": ["/api.py"]} |
86,388 | kevinlin6543/SaveTheWorld | refs/heads/master | /api.py | import requests
import json
def get_recipe(recipe_id):
request = "https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/" + str(recipe_id) + \
"/information?includeNutrition=false"
return request
def convert_units(unit, name, amt):
unit_resp = requests.get("https://spoonacular... | {"/GUI.py": ["/api.py"]} |
86,397 | sword865/recsysPlatform | refs/heads/master | /recsys/algorithm/svd.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
import divisi2
from numpy import loads, mean, sum, nan
from operator import itemgetter
from recsys.datamodel.matrix import SimilarityMatrix
from recsys.algorithm.baseclass import MatrixAlgorithm
class SVD(MatrixAlgorithm):
def __init__(self, file... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,398 | sword865/recsysPlatform | refs/heads/master | /recsys/evaluation/baseclass.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from operator import itemgetter
from numpy import nan
class Evaluation(object):
def __init__(self, data=None):
#data is a list of tuples. E.g: [(3, 2.3), (1, 0.9), (5, 4.9), (2, 0.9), (3, 1.5)]
if data:
self._ground_truth, self._test = map... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,399 | sword865/recsysPlatform | refs/heads/master | /recsys/evaluation/rmse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from recsys.evaluation.baseclass import Evaluation
from recsys.evaluation import ROUND_FLOAT
from math import sqrt
class RMSE(Evaluation):
def __init__(self, data=None):
super(RMSE, self).__init__(data)
def compute(self, r=None, r_pred=None):
if r... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,400 | sword865/recsysPlatform | refs/heads/master | /recsys/datamodel/data.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import codecs
from numpy.random import shuffle
class Data(object):
def __init__(self):
self._data = list([])
self._user2extra= {}
self._item2extra = {}
def __repr__(self):
s = '%d rows.' % len(self.get())
if len(s... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,401 | sword865/recsysPlatform | refs/heads/master | /recsys/algorithm/itembased.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from recsys.algorithm.baseclass import Algorithm,MatrixAlgorithm
from divisi2.sparse import SparseVector
from recsys.datamodel.matrix import SparseMatrix
import math
from divisi2.sparse import SparseMatrix as divisiSparseMatrix
class ItemBased(Algorithm):
def __init_... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,402 | sword865/recsysPlatform | refs/heads/master | /testcases/testcase.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from recsys.algorithm.svd import SVD
from recsys.algorithm.itembased import ItemBased
from recsys.datamodel.data import Data
from recsys.evaluation.rmse import RMSE
#col is user , row is item
def test_svd(train,test,data):
svd = SVD()
svd.set_data(train)
print... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,403 | sword865/recsysPlatform | refs/heads/master | /recsys/algorithm/baseclass.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
from scipy.cluster.vq import kmeans2 #for kmeans method
from random import randint #for kmeans++ (_kinit method)
#from scipy.linalg import norm #for kmeans++ (_kinit method)
from scipy import array #for kmeans method
from numpy import sum
from numpy.linalg import... | {"/recsys/evaluation/rmse.py": ["/recsys/evaluation/baseclass.py"], "/recsys/algorithm/itembased.py": ["/recsys/algorithm/baseclass.py"], "/recsys/algorithm/baseclass.py": ["/recsys/datamodel/data.py"]} |
86,422 | fecub/cookiecutter-python-qt-live-coding | refs/heads/master | /{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/tests/test_calculator.py | # -*- coding: utf-8 -*-
import pytest
from {{cookiecutter.module_name}} import Calculator
@pytest.fixture
def calc():
return Calculator()
@pytest.mark.parametrize("a,b,expected", [(1, 1, 2), (-1, 2, 1)])
def test_sum_is_calculated_correctly(calc, a, b, expected):
calc.a = a
calc.b = b
assert calc.s... | {"/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/__init__.py": ["/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/calculator.py"]} |
86,423 | fecub/cookiecutter-python-qt-live-coding | refs/heads/master | /{{cookiecutter.project_slug}}/main.py | # -*- coding: utf-8 -*-
import os
import sys
import signal
import argparse
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtCore import QObject, QTimer
from PyQt5.QtQml import QQmlApplicationEngine
from livecoding import start_livecoding_gui, recursively_register_types
PROJECT_PATH = os.path.dirname(os.path.real... | {"/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/__init__.py": ["/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/calculator.py"]} |
86,424 | fecub/cookiecutter-python-qt-live-coding | refs/heads/master | /{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/__init__.py | # -*- coding: utf-8 -*-
from python_qt_binding.QtQml import qmlRegisterType
from .calculator import Calculator
MODULE_NAME = "{{cookiecutter.module_name}}"
def register_types():
qmlRegisterType(Calculator, MODULE_NAME, 1, 0, Calculator.__name__)
| {"/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/__init__.py": ["/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/calculator.py"]} |
86,425 | fecub/cookiecutter-python-qt-live-coding | refs/heads/master | /{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/calculator.py | # -*- coding: utf-8 -*-
from python_qt_binding.QtCore import QObject, pyqtSignal, pyqtProperty
class Calculator(QObject):
aChanged = pyqtSignal(float)
bChanged = pyqtSignal(float)
sumChanged = pyqtSignal(float)
def __init__(self, parent=None):
super(Calculator, self).__init__(parent)
... | {"/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/__init__.py": ["/{{cookiecutter.project_slug}}/{{cookiecutter.module_name}}/calculator.py"]} |
86,426 | zach-/cisc_230_project | refs/heads/master | /netfilter/parser.py | import re
try:
from UserDict import UserDict
except ImportError:
from collections import UserDict
import netfilter.rule
"""
parser.py Author: Zach Bricker
(Description)
"""
# define useful regexps
re_chain = re.compile(r'^:*([^\s]+) ([^\s]+) \[([0-9]+):([0-9]+)\]$... | {"/netfilter/parser.py": ["/netfilter/rule.py"], "/netfilter/table.py": ["/netfilter/parser.py"], "/netfilter/rule.py": ["/netfilter/parser.py"], "/tests/test_netfilter.py": ["/netfilter/table.py", "/netfilter/rule.py", "/netfilter/parser.py"]} |
86,427 | zach-/cisc_230_project | refs/heads/master | /netfilter/gui.py | from firewall import Firewall
import sys
import os
"""
gui.py Author: Rowland DePree
A command console UI(user interface) design to interact with the firewall file to make it more user friendly.
"""
def main():
"""
Main method.
:return None
"""
firew... | {"/netfilter/parser.py": ["/netfilter/rule.py"], "/netfilter/table.py": ["/netfilter/parser.py"], "/netfilter/rule.py": ["/netfilter/parser.py"], "/tests/test_netfilter.py": ["/netfilter/table.py", "/netfilter/rule.py", "/netfilter/parser.py"]} |
86,428 | zach-/cisc_230_project | refs/heads/master | /netfilter/table.py | import os
import re
import subprocess
import netfilter.parser
"""
table.py Author: Zach Bricker
A program to directly interface with IPTables
"""
class IptablesError(Exception):
def __init__(self, command, message):
"""
Cons... | {"/netfilter/parser.py": ["/netfilter/rule.py"], "/netfilter/table.py": ["/netfilter/parser.py"], "/netfilter/rule.py": ["/netfilter/parser.py"], "/tests/test_netfilter.py": ["/netfilter/table.py", "/netfilter/rule.py", "/netfilter/parser.py"]} |
86,429 | zach-/cisc_230_project | refs/heads/master | /netfilter/rule.py | import logging
import re
import netfilter.parser
"""
rule.py Author: Zach Bricker
A set of classes to allow the creation of rules to be used with IPTables
"""
re_extension_opt = re.compile(r'^--(.*)$')
class Extension:
def __init__(self, na... | {"/netfilter/parser.py": ["/netfilter/rule.py"], "/netfilter/table.py": ["/netfilter/parser.py"], "/netfilter/rule.py": ["/netfilter/parser.py"], "/tests/test_netfilter.py": ["/netfilter/table.py", "/netfilter/rule.py", "/netfilter/parser.py"]} |
86,430 | zach-/cisc_230_project | refs/heads/master | /tests/test_netfilter.py | import unittest
import logging
import netfilter.table
from netfilter.rule import Rule, Target, Match
import netfilter.parser
iptables_data = """# Generated by iptables-save v1.4.8
*filter
:INPUT DROP [556:75796]
:FORWARD DROP [204:11510]
:OUTPUT ACCEPT [1884:214582]
:firewall_forward_filter - [0:0]
:firewall_input_fi... | {"/netfilter/parser.py": ["/netfilter/rule.py"], "/netfilter/table.py": ["/netfilter/parser.py"], "/netfilter/rule.py": ["/netfilter/parser.py"], "/tests/test_netfilter.py": ["/netfilter/table.py", "/netfilter/rule.py", "/netfilter/parser.py"]} |
86,431 | zach-/cisc_230_project | refs/heads/master | /setup.py | #!/usr/bin/env python
from setuptools import setup
setup(
name='firewall',
version='0.1',
description='Python firewall using iptables',
url='https://github.com/',
author='Zach Bricker',
author_email='zbricker@my.harrisburgu.edu',
license='GPLv3+',
packages=['netfilter'],
classifier... | {"/netfilter/parser.py": ["/netfilter/rule.py"], "/netfilter/table.py": ["/netfilter/parser.py"], "/netfilter/rule.py": ["/netfilter/parser.py"], "/tests/test_netfilter.py": ["/netfilter/table.py", "/netfilter/rule.py", "/netfilter/parser.py"]} |
86,455 | CZFork/esp32 | refs/heads/master | /esp32_1/1/libs.py | import time # библиотека для прерываний
from machine import Pin, PWM # импортируем класс Пин и ШИМ
from onewire import OneWire # импортируем класс OneWire
from ds18x20 import DS18X20 # импортируем класс датчика ds18b20
import network # импортируем класс подключения к сети вай-фай
from mqtt import MQTTClient # для реали... | {"/test.py": ["/logg.py"]} |
86,456 | CZFork/esp32 | refs/heads/master | /esp32_1/1/main.py | from libs import *
import time
import urequests
import machine
# подключение пищалки
buz = ActiveBuzzer(17)
# подключение кнопки
but = Button(15)
# подключение вай фай
wifi = WiFi("WiFi-DOM.ru-6285", "Nastya26042015")
# подключение датчика температуры
temp = Temperature(2)
# подключение светодиода
rgb = RGBLed(pin_r, ... | {"/test.py": ["/logg.py"]} |
86,457 | CZFork/esp32 | refs/heads/master | /lcd_base.py | from machine import Pin
import time
class LCD():
def __init__(self, rs_pin, e_pin, d4_pin, d5_pin, d6_pin, d7_pin):
self.RS = Pin(rs_pin, Pin.OUTPUT) #0 -команды/ 1 - данные
self.E = Pin(e_pin, Pin.OUTPUT) #стобирующий сигнал
self.D4 = Pin(d4_pin, Pin.OUTPUT) #байты данных/команды 1
... | {"/test.py": ["/logg.py"]} |
86,458 | CZFork/esp32 | refs/heads/master | /logg.py | import time
import traceback
import urequests
class Logfile():
filename = "log.txt"
def __init__(self):
self.file = open(Logfile.filename, "a")
def log(self, text):
self.file.write(str(time.strftime("%Y-%m-%d %H:%M:%S"))+" "+ str("[INFO]") +" "+ str(text) + "\n")
def ... | {"/test.py": ["/logg.py"]} |
86,459 | CZFork/esp32 | refs/heads/master | /temperature.py | class Temperature():
#Класс для датчика температуры DS18B20
def __init__(self, port):
"""Иницилизация класса"""
self.port = port
self.addr = []
self.get_addr()
def get_addr(self):
"""Функция получения адреса датчика"""
self.dat = DS18B20(OneWire(... | {"/test.py": ["/logg.py"]} |
86,460 | CZFork/esp32 | refs/heads/master | /esp32_1/libs.py | import time #библиотека для прерываний
from machine import Pin, PWM #импортируем класс Пин и ШИМ
from onewire import OneWire #импортируем класс OneWire
from ds18b20 import DS18B20 #импортируем класс датчика ds18b20
from network import WLAN #импортируем класс подключения к сети вай-фай
from mqtt import MQTTClient #для ... | {"/test.py": ["/logg.py"]} |
86,461 | CZFork/esp32 | refs/heads/master | /pwm.py | class Pwm():
def __init__(self, pin_mode, time_mode, freq_mode, energy):
self.pin_mode = pin_mode
self.freq_mode = freq_mode #частота
self.energy = int(energy) # from 0 to 1023
self.obj = machine.PWM(machine.Pin(self.pin_mode), freq=self.freq_mode)
def pulse(self):
... | {"/test.py": ["/logg.py"]} |
86,462 | CZFork/esp32 | refs/heads/master | /UndegroundWeather.py | # coding: utf-8
import requests
from Adafruit_IO import *
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
import time
broker = '127.0.0.1'
state_topic = 'home-assistant/temp/temp_on_street'
client = mqtt.Client("ha-client")
client.connect(broker)
client.loop_start()
def get_temp_street():
ur... | {"/test.py": ["/logg.py"]} |
86,463 | CZFork/esp32 | refs/heads/master | /test.py | from logg import Logfile
import time
l=Logfile()
try:
z = 0
for y in range(0, 10):
summa = z/y
l.log(summa)
time.sleep(1)
except Exception as err:
l.log_err(err)
finally:
l.end() | {"/test.py": ["/logg.py"]} |
86,464 | CZFork/esp32 | refs/heads/master | /esp32_1/main_no_wifi.py | from libs import *
buz = ActiveBuzzer(17) #подключение пищалки
temp = Temperature(18) #подключение датчика температуры
but = Button(2) #Подключение кнопки
buz.beep(50, 2) #после завершениыя настройки звуковой сигнал
while True:
n_t = temp.get_temp() #проверка температуры
if n_t < 17:
buz.on()
... | {"/test.py": ["/logg.py"]} |
86,465 | CZFork/esp32 | refs/heads/master | /main.py | #Файл служит для автоматического выполнения скриптов на плате
from machine import ADC, Pin, PWM
import dht
import time
temp = ADC(Pin(33)) #Температура - аналоговый датчик
temp_d = dht.DHT11(Pin(17)) #Температура - цифровой датчик
pot = ADC(Pin(32)) #Потенциометр
pwm12 = PWM(Pin(12)) #ШИМ
while 1:
reg = pot.read(... | {"/test.py": ["/logg.py"]} |
86,466 | CZFork/esp32 | refs/heads/master | /esp32_1/main.py | from libs import *
import time
buz = ActiveBuzzer(17) #подключение пищалки
wifi = WiFi("WiFi-DOM.ru-6285", "Nastya26042015") #подключение вай фай
buz.beep(50, 1) #после подключения вай-фай один звуковой сигнал
temp = Temperature(18) #подключение датчика температуры
buz.beep(50, 1) #после подключения датчика температур... | {"/test.py": ["/logg.py"]} |
86,467 | CZFork/esp32 | refs/heads/master | /example.py | # coding: utf-8
from WunderWeather import weather
from Adafruit_IO import *
import time
from datetime import datetime
def get_temp():
extractor = weather.Extract("0acd2cbb929b017c")
[location,current] = extractor.features("RU/Tyumen",(('geolookup',''),('now','')))
temp = float(current.temp_c)
print(tem... | {"/test.py": ["/logg.py"]} |
86,468 | CZFork/esp32 | refs/heads/master | /esp32_1/test.py | from libs import *
import _thread
import time
buz = ActiveBuzzer(17) #подключение пищалки
but = Button(2) #подключение кнопки
wifi = WiFi("WiFi-DOM.ru-6285", "Nastya26042015") #подключение вай фай
buz.beep(50, 1) #после подключения вай-фай один звуковой сигнал
temp = Temperature(18) #подключение датчика температуры
bu... | {"/test.py": ["/logg.py"]} |
86,469 | CZFork/esp32 | refs/heads/master | /ConnectWifFi.py | #TO-DO
#Сделать обработку ошибок при неправильном вводе пароля
class WiFi():
def __init__(self, ssid, password):
self.ssid = ssid
self.password = password
def connect(self):
"""Функция для подключения к вай-фай сети"""
station = network.WLAN(network.STA_IF)
if stat... | {"/test.py": ["/logg.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.