index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
92,171
HG2905/pythonProject1
refs/heads/master
/main.py
from saludos.despedida.despedida import despedida
{"/main.py": ["/saludos/despedida/despedida.py"]}
92,182
AlvinChiou/django_cloud_security
refs/heads/master
/handleui/views.py
# -*- coding: utf-8 -*- from django.shortcuts import render import urllib import urllib2,time import imaplib from django.utils import simplejson import MySQLdb import sys import os import codecs from django.contrib.auth.models import User from django.contrib.auth import login,authenticate,logout from handleui.model...
{"/handleui/admin.py": ["/handleui/models.py"]}
92,183
AlvinChiou/django_cloud_security
refs/heads/master
/handleui/admin.py
from django.contrib import admin from handleui.models import ihepip,ihepuser,ihepresults import os,sys class MyIPAdmin(admin.ModelAdmin): list_display=('ip','chinesename','email','dept') search_fields=['ip'] def find_all_ip(search_term): ans=[] mydir=os.path.join(os.path.dirname(os.path.dirname(__file_...
{"/handleui/admin.py": ["/handleui/models.py"]}
92,184
AlvinChiou/django_cloud_security
refs/heads/master
/handleui/models.py
from django.db import models from django.contrib.auth.models import User # Create your models here. class ihepip(models.Model): ip =models.IPAddressField(primary_key=True) mac =models.CharField(max_length=200) chinesename =models.CharField(max_length=200) worktype =models.CharField(max_length=200) ...
{"/handleui/admin.py": ["/handleui/models.py"]}
92,185
AlvinChiou/django_cloud_security
refs/heads/master
/cloudsafe/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'cloudsafe.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), # url(r'^$','handl...
{"/handleui/admin.py": ["/handleui/models.py"]}
92,186
AlvinChiou/django_cloud_security
refs/heads/master
/webui/views.py
from django.shortcuts import render # Create your views here. def index(request): return render(request,'webui/index.html') def faq(request): return render(request,'webui/faq.html') def about(request): return render(request,'webui/about.html')
{"/handleui/admin.py": ["/handleui/models.py"]}
92,187
AlvinChiou/django_cloud_security
refs/heads/master
/setup.py
from setuptools import setup, find_packages setup( name = 'cloudsafe', version = '0.0.1', keywords = ('cloudsafe', 'golismero'), description = 'cloudsafe', license = 'MIT License', install_requires = ['Django>=1.4'], author = 'wengcc', author_email = 'wengcc@ihep.ac.cn', packages ...
{"/handleui/admin.py": ["/handleui/models.py"]}
92,188
russelldavies/leapcardr
refs/heads/master
/leapcardr/forms.py
# -*- coding: utf-8 -*- from flask import flash from flask.ext.wtf import Form from wtforms import TextField, PasswordField, BooleanField from wtforms.validators import Required def flash_errors(form): for field, errors in form.errors.items(): for error in errors: flash(u"Error in the %s fiel...
{"/leapcardr/views.py": ["/leapcardr/__init__.py", "/leapcardr/forms.py", "/leapcardr/agent.py"]}
92,189
russelldavies/leapcardr
refs/heads/master
/leapcardr/views.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from functools import wraps import pickle from flask import ( request, session, g, redirect, url_for, abort, render_template, flash ) from . import app from .forms import flash_errors, LoginForm from .agent import Account @app.errorhandler(404)...
{"/leapcardr/views.py": ["/leapcardr/__init__.py", "/leapcardr/forms.py", "/leapcardr/agent.py"]}
92,190
russelldavies/leapcardr
refs/heads/master
/leapcardr/config.py
# -*- coding: utf-8 -*- import os SECRET_KEY = os.environ.get('SECRET_KEY', 'change on deploy')
{"/leapcardr/views.py": ["/leapcardr/__init__.py", "/leapcardr/forms.py", "/leapcardr/agent.py"]}
92,191
russelldavies/leapcardr
refs/heads/master
/leapcardr/endpoint.py
import requests import cookielib import re from bs4 import BeautifulSoup import datetime import time cj = cookielib.CookieJar() def save_cookies(cookiejar): expiry_mins = 15 for cookie in cookiejar: if cookie.discard: future = datetime.datetime.now() + datetime.timedelta(minutes=expiry_mi...
{"/leapcardr/views.py": ["/leapcardr/__init__.py", "/leapcardr/forms.py", "/leapcardr/agent.py"]}
92,192
russelldavies/leapcardr
refs/heads/master
/leapcardr/__init__.py
# -*- coding: utf-8 -*- from flask import Flask from . import config app = Flask(__name__) app.config.from_object(config) from . import views
{"/leapcardr/views.py": ["/leapcardr/__init__.py", "/leapcardr/forms.py", "/leapcardr/agent.py"]}
92,193
russelldavies/leapcardr
refs/heads/master
/leapcardr/agent.py
""" Agent that logs into the Leapcard website and scrapes data. """ from __future__ import unicode_literals from functools import wraps import mechanize from cookielib import CookieJar from bs4 import BeautifulSoup import datetime import time import re BASE_URL = "https://www.leapcard.ie" class Error(Exception): ...
{"/leapcardr/views.py": ["/leapcardr/__init__.py", "/leapcardr/forms.py", "/leapcardr/agent.py"]}
92,229
topogram/weibo-miner-deploy
refs/heads/master
/examples/fabfile_node/protobuf.py
from fabric.api import * from fabric.contrib import files import ubuntu def install_protobuf(): if not ubuntu.cmd_exists('protoc'): version="2.4.1" folder="protobuf-%s" % version filename="%s.tar.bz2" % folder source="http://protobuf.googlecode.com/files/%s" & filename with cd('/tmp'): run...
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,230
topogram/weibo-miner-deploy
refs/heads/master
/examples/fabfile_node/ubuntu.py
from fabric.api import * from fabric.contrib import files SOURCES_D="/etc/apt/sources.list.d" __all__= ['cmd_exists', 'apt', 'apt_upgrade'] def cmd_exists(cmd): #TODO: some sort of run test of the command perhaps return files.exists("/usr/bin/%s" % cmd) def apt(cmdline): if not cmd_exists('aptitude'): ...
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,231
topogram/weibo-miner-deploy
refs/heads/master
/debian.py
from fabric.api import * from fabric.contrib import files from config.settings import RUN_DIR SOURCES_D="/etc/apt/sources.list.d" __all__= ['cmd_exists', 'apt', 'apt_upgrade'] def cmd_exists(cmd): #TODO: some sort of run test of the command perhaps return files.exists("/usr/bin/%s" % cmd) def apt(cmdline): i...
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,232
topogram/weibo-miner-deploy
refs/heads/master
/nginx.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import StringIO from fabric.api import * from fabric.operations import get, put from fabric.contrib.files import upload_template,exists from jinja2 import Template from config.settings import * APP_ROOT = CODE_DIR NGINX_VHOST_DIR = '/etc/nginx/conf.d/' SUPERVISOR_DIR = ...
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,233
topogram/weibo-miner-deploy
refs/heads/master
/main.py
from fabric.api import * import os from fabric.contrib.console import confirm from fabric.contrib import files from fabvenv import virtualenv, make_virtualenv from config.settings import * def create_config_files(): if not files.exists(CONFIG_DIR): run("mkdir -p %s"%CONFIG_DIR) with cd(CONFIG_DIR...
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,234
topogram/weibo-miner-deploy
refs/heads/master
/examples/fabfile_node/fabfile.py
from __future__ import with_statement from fabric.api import env from fabric.api import * from fabric.contrib.console import confirm from fabric.contrib.project import upload_project import ubuntu import protobuf def staging(): env.hosts = ['10.100.0.70',] env.remote_admin = 'sysadmin' def ssh(): for ho...
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,235
topogram/weibo-miner-deploy
refs/heads/master
/fabfile.py
import os from fabric.api import * from fabric.contrib.console import confirm from fabric.contrib import files from config.servers import staging, prod import debian import main import nginx def uptime(): run('uptime') def ssh(): for host in env.hosts: local("ssh-copy-id -p %s %s@%s" % (env.port, env....
{"/fabfile.py": ["/debian.py", "/main.py", "/nginx.py"]}
92,236
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/preprocessing.py
from feature_engineering.features import * from feature_engineering.cv import * import os import os.path as osp from sklearn.preprocessing import LabelEncoder, StandardScaler import pickle class Preprocessing(): def __init__(self, param): # 先にcv/date/にわけたインデックスを保存しておく # 普通に特徴作る # train vali...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,237
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/Models/NN.py
from .base import BaseModel import torch import torch.nn as nn from torch.optim import Adam, AdamW, SGD from torch.optim.lr_scheduler import ReduceLROnPlateau, OneCycleLR from torch.nn import CrossEntropyLoss from torch.nn import BCELoss, BCEWithLogitsLoss from torch.nn.utils import weight_norm import pickle import nu...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,238
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/feature_engineering/features.py
import os.path as osp import numpy as np import pandas as pd from .base import Feature import datetime from sklearn.decomposition import LatentDirichletAllocation from bs4 import BeautifulSoup import re from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.decomposition import Trunca...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,239
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/utils_nn.py
import time import numpy as np import torch from torch.utils.data import DataLoader import os.path as osp def run_training(model, trainloader, validloader, epoch_, optimizer, scheduler, loss_fn, early_stopping_steps, verbose, device, fold, seed, path): early_step = 0 best_loss = np.inf best_epoch = 0 ...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,240
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/predicting.py
import pandas as pd import os import os.path as osp from Models.models import * from Models.Tabnet import * from Models.NN import * class Predicting(): def __init__(self, param): self.param = param self.ROOT = param["ROOT"] self.WORK_DIR = param["WORK_DIR"] self.pred_path = osp.joi...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,241
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/runner.py
from preprocessing import Preprocessing from learning import Learning from predicting import Predicting from _logging import Logging class Runner(): """ 全体の工程 ・特徴量作成 ・データの読み出し ・学習、weightと特徴量の名前の保存 ・ログ(mlflow, feature_importances, ) """ def __init__(self, param): self.exp_param ...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,242
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/feature_engineering/base.py
import re from abc import ABCMeta, abstractmethod from pathlib import Path import pandas as pd import sys, os sys.path.append("../") import os.path as osp from utils import trace, timer class Feature(metaclass=ABCMeta): def __init__(self, param): self.name = self.__class__.__name__ self.ROOT = pa...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,243
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/learning.py
import pandas as pd import os import os.path as osp from Models.models import * from Models.Tabnet import * from Models.NN import * from sklearn.metrics import mean_absolute_error from utils import seed_everything class Learning(): def __init__(self, param): self.param = param self.ROOT = param["R...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,244
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/_logging.py
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import os import os.path as osp import glob from sklearn.metrics import f1_score import pickle from utils import optimized_f1 import mlflow from google.cloud import storage TH = 0.389 class Logging(): def __init__(self, p...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,245
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/utils.py
import psutil import os import time import sys import math from contextlib import contextmanager import random import numpy as np import torch from scipy.optimize import minimize from sklearn.metrics import f1_score @contextmanager def trace(title): t0 = time.time() p = psutil.Process(os.getpid()) m0 = p.m...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,246
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/Models/models.py
from .base import BaseModel from catboost import Pool, CatBoostRegressor, CatBoostClassifier import lightgbm as lgb import pickle import numpy as np from sklearn.metrics import f1_score from utils import optimized_f1 def lgb_f1_score(y_hat, data): y_true = data.get_label() score, _ = optimized_f1(y_true, y_hat...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,247
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/feature_engineering/cv.py
import os.path as osp import numpy as np import pandas as pd from .base import Feature import datetime from sklearn.model_selection import KFold, StratifiedKFold class stratified_cv(Feature): def create_features(self): train_df, test_df = self.read_input() use_feats = [] for seed in self.s...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,248
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/Models/Tabnet.py
from .base import BaseModel import torch from torch.optim import Adam from torch.optim.lr_scheduler import ReduceLROnPlateau, OneCycleLR from pytorch_tabnet.pretraining import TabNetPretrainer from pytorch_tabnet.tab_model import TabNetRegressor, TabNetClassifier from torch.nn import L1Loss, MSELoss, CrossEntropyLoss ...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,249
mitsuhiko-nozawa/signate_student
refs/heads/main
/src/libs/Models/base.py
import re from abc import ABCMeta, abstractmethod import sys, os sys.path.append("../") import os.path as osp from utils import trace, timer class BaseModel(metaclass=ABCMeta): def __init__(self, model_param=None): self.model_param = model_param self.model = self.get_model() @abstractmet...
{"/src/libs/Models/NN.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/features.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/models.py": ["/src/libs/Models/base.py"], "/src/libs/feature_engineering/cv.py": ["/src/libs/feature_engineering/base.py"], "/src/libs/Models/Tabnet.py": ["/...
92,251
kupcimat/striker
refs/heads/master
/tasks.py
import datetime import os from typing import Any, Iterable import requests from invoke import task # TODO add tests @task(help={"tag": "Image name and tag (optional)"}) def build_image(ctx, tag="striker-backend"): """ Build docker image locally """ ctx.run(gradle("jibDockerBuild", f"-Djib.to.image={t...
{"/test_tasks.py": ["/tasks.py"]}
92,252
kupcimat/striker
refs/heads/master
/test_tasks.py
import pytest import tasks @pytest.mark.parametrize("arguments, expected", [ ([], ""), (["app"], "app"), (["app", "--opt"], "app --opt"), (["app", "--opt", "arg"], "app --opt arg") ]) def test_join(arguments, expected): assert tasks.join(arguments) == expected
{"/test_tasks.py": ["/tasks.py"]}
92,253
cockroachdb/examples-orms
refs/heads/master
/python/django/cockroach_example/views.py
from django.http import JsonResponse, HttpResponse from django.utils.decorators import method_decorator from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from django.db import Error, OperationalError from django.db.transaction import atomic from psycopg2 import errorcodes from f...
{"/python/django/cockroach_example/views.py": ["/python/django/cockroach_example/models.py"]}
92,254
cockroachdb/examples-orms
refs/heads/master
/python/sqlalchemy/models.py
# Copyright 2017 The Cockroach Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
{"/python/django/cockroach_example/views.py": ["/python/django/cockroach_example/models.py"]}
92,255
cockroachdb/examples-orms
refs/heads/master
/python/django/cockroach_example/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.25 on 2019-10-14 18:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Cre...
{"/python/django/cockroach_example/views.py": ["/python/django/cockroach_example/models.py"]}
92,256
cockroachdb/examples-orms
refs/heads/master
/python/django/cockroach_example/models.py
from django.db import models class Customers(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=250) class Products(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=250) price = models.DecimalField(max_digits=18, dec...
{"/python/django/cockroach_example/views.py": ["/python/django/cockroach_example/models.py"]}
92,257
cockroachdb/examples-orms
refs/heads/master
/python/sqlalchemy/server.py
#! /usr/bin/env python # Copyright 2017 The Cockroach Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
{"/python/django/cockroach_example/views.py": ["/python/django/cockroach_example/models.py"]}
92,258
AyaAbuRashed/game-of-greed
refs/heads/main
/game_of_greed/game_logic.py
from collections import Counter import random class GameLogic(): # def __init__(self,value): # self.value=value @staticmethod def calculate_score(diceRoll): score = 0 counting = Counter(diceRoll) dice_count = counting.most_common() if len(dice_count) == 6 : ...
{"/game_of_greed/game.py": ["/game_of_greed/game_logic.py"]}
92,259
AyaAbuRashed/game-of-greed
refs/heads/main
/game_of_greed/game.py
from game_of_greed.game_logic import GameLogic,Banker class Game: def __init__(self, roller=None): self.roller = roller or GameLogic.roll_dice game = GameLogic() banker = Banker() round = 1 remaining_dice = 6 score = 0 to_shelf = 0 stop = False def play(self): ...
{"/game_of_greed/game.py": ["/game_of_greed/game_logic.py"]}
92,269
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/data_loader_selfcap.py
# Based on: https://github.com/yunjey/seq2seq-dataloader/blob/master/data_loader.py import torch import torch.utils.data as data import os import numpy as np import json import h5py from logging import getLogger from tools.utils import Vocab logger = getLogger(__name__) ##########################################...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,270
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/arg_parser.py
import os from argparse import ArgumentParser def get_args(): parser = ArgumentParser() # dataset parser.add_argument("--corpus", default="ss", choices=["ss", "gcc"], type=str) parser.add_argument("--max_pos_dist", default=4, type=int) parser.add_argument("--auto_setting", default=False, action="...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,271
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/tools/run_spacy.py
import sys import spacy from spacy_conll import ConllFormatter from utils import trace IN_CORPUS = str(sys.argv[1]) KEEP_BOUND = int(sys.argv[2]) WORKERS = int(sys.argv[3]) OUT_CONLLU = ".".join(IN_CORPUS.split(".")[:-1] + ["conllu"]) model="en_core_web_lg" nlp = spacy.load(model) conllformatter = ConllFormatter(nl...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,272
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/nns/model.py
import torch import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self, args, embs, vocab): super(Model, self).__init__() # embedder self.embedder = nn.Embedding(embs.shape[0], embs.shape[1], padding_idx=0) embs = torch.from_numpy(embs)[1:] ...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,273
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/main_selfcap.py
import os import sys import random import json import itertools import numpy as np from logging import getLogger import torch from tools.utils import decorate_logger from arg_parser import get_args from data_loader_selfcap import get_dataloader from nns.initializer import init_model_ from nns.model import Model log...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,274
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/nns/rnns.py
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence as pack from torch.nn.utils.rnn import pad_packed_sequence as unpack class LSTM(nn.Module): def __init__(self, dim_in, dim_hid, nlayer, drop_rate=0., out_pad=0.): super(LSTM, se...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,275
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/data_loader.py
# Based on: https://github.com/yunjey/seq2seq-dataloader/blob/master/data_loader.py import torch import torch.utils.data as data import os import random import numpy as np import json import h5py from collections import Counter from logging import getLogger from tools.utils import Vocab logger = getLogger(__name__...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,276
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/main.py
import os import sys import random import json import itertools import numpy as np from logging import getLogger import torch import torch.nn as nn from speaksee import evaluation from tools.utils import decorate_logger, bow_eval from arg_parser import get_args from data_loader import get_dataloader from nns.initiali...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,277
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/tools/utils.py
import datetime from logging import INFO, DEBUG, Formatter, StreamHandler, FileHandler def trace(*args): """ Simple logging. """ print(datetime.datetime.now().strftime("%H:%M:%S"), " ".join(map(str, args))) def decorate_logger(args, logger): """ Decorate a root logger. Stream for debug and File...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,278
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/tools/preproc_parse.py
import sys import os import pickle import nltk from utils import trace GCC_FILE = str(sys.argv[1]) SS_FILE = str(sys.argv[2]) GCC_OUT = GCC_FILE.rstrip("tsv") + "proc" SS_OUT = SS_FILE.rstrip("pkl") + "proc" # PTB punctuations # https://github.com/aimagelab/speaksee/blob/master/speaksee/evaluation/tokenizer.py PUNCT...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,279
xixiareone/RemovingSpuriousAlignment
refs/heads/main
/tools/postproc_parse.py
import json import sys import os import itertools import statistics import random from multiprocessing import Pool from collections import Counter from utils import trace CORPUS = str(sys.argv[1]) DATA_PATH = str(sys.argv[2]) CORPUS_CONLLU = str(sys.argv[3]) MAX_SENT = int(sys.argv[4]) MIN_SENT_LEN = int(sys.argv[5])...
{"/data_loader_selfcap.py": ["/tools/utils.py"], "/nns/model.py": ["/nns/rnns.py"], "/main_selfcap.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader_selfcap.py", "/nns/model.py"], "/data_loader.py": ["/tools/utils.py"], "/main.py": ["/tools/utils.py", "/arg_parser.py", "/data_loader.py", "/nns/model.py"]}
92,295
pglushkov/pyladspa
refs/heads/main
/pyladspa/utils/common.py
import traceback import ctypes from pyladspa.utils import filesystem as fs from pyladspa.ladspa import dtypes, routines def find_plugins_in_path(path): res = {} dynamic_libs = fs.find_dynamic_libs_in_dir(path) for dl in dynamic_libs: res[dl] = find_plugins_in_lib(dl) return res def find_plugi...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,296
pglushkov/pyladspa
refs/heads/main
/pyladspa/utils/filesystem.py
import sys import os _extensions = { "linux" : [".so"], "win32" : [".dll"], "darwin" : [".dylib", ".so", "bundle"] } def find_dynamic_libs_in_dir(dirpath): extensions_list = _extensions.get(sys.platform, [".so"]) res = [ os.path.join(dirpath, e) for e in os.listdir(dirpath) if os.path.isf...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,297
pglushkov/pyladspa
refs/heads/main
/pyladspa/ladspa/dtypes.py
from ctypes import Structure, c_float, POINTER, c_char_p, c_ulong, c_void_p, c_int, pointer class LadspaConsts: LADSPA_PROPERTY_REALTIME = 0x1 LADSPA_PROPERTY_INPLACE_BROKEN = 0x2 LADSPA_PROPERTY_HARD_RT_CAPABLE = 0x4 @classmethod def is_realtime(cls, inp): return bool(inp & cls.LADSPA_...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,298
pglushkov/pyladspa
refs/heads/main
/pyladspa/ladspa/__init__.py
DEFAULT_LADSPA_ENV_VAR = "LADSPA_PATH" DEFAULT_LADSPA_PATH = "/usr/lib/ladspa/" # should be OS-dependent, but in LADSPA SDK it is hardcoded
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,299
pglushkov/pyladspa
refs/heads/main
/pyladspa/analyseplugin.py
import traceback import argparse import numpy import sys import os from ctypes import * if __name__ == "__main__": from ladspa.dtypes import LADSPA_Descriptor, LADSPA_PortRangeHint, LadspaConsts from ladspa.routines import calc_default_port_value from utils.common import find_plugins_in_lib else: from...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,300
pglushkov/pyladspa
refs/heads/main
/setup.py
import os import setuptools # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.dirname(__fil...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,301
pglushkov/pyladspa
refs/heads/main
/pyladspa/listplugins.py
import traceback import argparse import ctypes import sys import os if __name__ == "__main__": from ladspa.dtypes import LADSPA_Descriptor, LADSPA_PortRangeHint, LadspaConsts from ladspa import DEFAULT_LADSPA_ENV_VAR, DEFAULT_LADSPA_PATH from utils.common import find_plugins_in_lib, find_plugins_in_path el...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,302
pglushkov/pyladspa
refs/heads/main
/pyladspa/ladspa/routines.py
import ctypes import numpy from . import dtypes def ladspa_descriptor(ladspa_lib): res = ladspa_lib.ladspa_descriptor res.argtypes = [ctypes.c_ulong] res.restype = ctypes.POINTER(dtypes.LADSPA_Descriptor) return res def calc_default_port_value(hint): props = hint.HintDescriptor lbnd = hint.L...
{"/pyladspa/utils/common.py": ["/pyladspa/ladspa/__init__.py"], "/pyladspa/analyseplugin.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/routines.py", "/pyladspa/utils/common.py"], "/pyladspa/listplugins.py": ["/pyladspa/ladspa/dtypes.py", "/pyladspa/ladspa/__init__.py", "/pyladspa/utils/common.py"], "/pyladspa/l...
92,303
sonlinux/centro-pricetag
refs/heads/develop
/django_project/content/views/home.py
# coding: utf-8 from datetime import datetime __author__ = 'Alison Mukoma <AMukoma@brhc.com>' __revision__ = ':%H$' __date__ = ('%s' % (datetime.now())) __license__ = '' __copyright__ = 'Broadreach Corperation' import random from django.views.generic import TemplateView from ..models.success_story import SuccessStor...
{"/django_project/content/models/product.py": ["/django_project/content/models/location.py", "/django_project/content/models/manufacture.py", "/django_project/content/models/shop_owner.py"]}
92,304
sonlinux/centro-pricetag
refs/heads/develop
/django_project/content/models/location.py
# coding: utf-8 __author__ = 'Alison Mukoma <alison@devsbranch.com>' __license__ = 'GPL' __copyright__ = 'devsbranch.com' from django.db import models from django.utils.translation import ugettext_lazy as _ class Location(models.Model): name = models.CharField( _('Location Name'), max_length=255,...
{"/django_project/content/models/product.py": ["/django_project/content/models/location.py", "/django_project/content/models/manufacture.py", "/django_project/content/models/shop_owner.py"]}
92,305
sonlinux/centro-pricetag
refs/heads/develop
/django_project/content/models/shop_owner.py
import os from django.db import models from django.contrib.auth.models import User from django.conf.global_settings import MEDIA_ROOT from django.utils.translation import ugettext_lazy as _ from django.utils.timezone import datetime class ApprovedShopManager(models.Manager): """Custom shop manager that shows only...
{"/django_project/content/models/product.py": ["/django_project/content/models/location.py", "/django_project/content/models/manufacture.py", "/django_project/content/models/shop_owner.py"]}
92,306
sonlinux/centro-pricetag
refs/heads/develop
/django_project/content/models/product.py
# coding: utf-8 __author__ = 'Alison Mukoma <alison@devsbranch.com>' __license__ = 'GPL' __copyright__ = 'devsbranch.com' import os from datetime import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf.global_settings import MEDIA_ROOT from .category impor...
{"/django_project/content/models/product.py": ["/django_project/content/models/location.py", "/django_project/content/models/manufacture.py", "/django_project/content/models/shop_owner.py"]}
92,307
sonlinux/centro-pricetag
refs/heads/develop
/django_project/content/models/manufacture.py
# coding: utf-8 __author__ = 'Alison Mukoma <alison@devsbranch.com>' __license__ = 'GPL' __copyright__ = 'devsbranch.com' from django.db import models from django.utils.translation import ugettext_lazy as _ from django_countries.fields import CountryField class Manufacture(models.Model): name = models.CharField...
{"/django_project/content/models/product.py": ["/django_project/content/models/location.py", "/django_project/content/models/manufacture.py", "/django_project/content/models/shop_owner.py"]}
92,312
smetj/uplook
refs/heads/master
/tests/test_uplook.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # test_uplook.py # # Copyright 2015 Jelle Smet <development@smetj.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of ...
{"/tests/test_uplook.py": ["/uplook/__init__.py"]}
92,313
smetj/uplook
refs/heads/master
/setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # setup.py # # Copyright 2015 Jelle Smet <development@smetj.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Li...
{"/tests/test_uplook.py": ["/uplook/__init__.py"]}
92,314
smetj/uplook
refs/heads/master
/uplook/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # __init__.py # # Copyright 2015 Jelle Smet <development@smetj.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the...
{"/tests/test_uplook.py": ["/uplook/__init__.py"]}
92,315
alanjds/poc-ds-template
refs/heads/master
/tests.py
import json from app import app from app import load_model from flask_testing import TestCase TEST_REQUEST = { "sepal length": 5, "sepal width": 3, "petal length": 3, "petal width": 1, } class Tests(TestCase): def setUp(self): load_model() def create_app(self): return app ...
{"/tests.py": ["/app.py"]}
92,316
alanjds/poc-ds-template
refs/heads/master
/app.py
import pandas as pd from flask import Flask, request from flask.json import jsonify from train import Trainer from sklearn.externals import joblib app = Flask(__name__) trainer = Trainer() model = None TARGETS = {0: 'Setosa', 1: 'Versicolour', 2: 'Virginica'} def save_model(): global train...
{"/tests.py": ["/app.py"]}
92,330
ananth-pallaseni/Match3
refs/heads/master
/test.py
# Test import tkinter as tk import sys import random import math import os from custom_canvas import CustomCanvas # ALL GEMS ARE 3000x3000 GEM_SIDE = 3000 GEM_DIR = "gems" class MatchCanvas(CustomCanvas): """docstring for Canvas""" def __init__(self, parent, width, height, numCols, numRows): super(MatchCanvas,...
{"/test.py": ["/custom_canvas.py"], "/match3.py": ["/custom_canvas.py"]}
92,331
ananth-pallaseni/Match3
refs/heads/master
/match3.py
""" Match 3""" import tkinter as tk import sys import random import math import os from collections import deque from custom_canvas import CustomCanvas TYPES = ["RED", "BLUE", "GREEN", "PURPLE"] GEM_SIDE = 3000 GEM_DIR = "gems" WIDTH = 400 HEIGHT = 400 BOXES_PER_SIDE = 10 FRAMES_PER_SECOND = 30 MILLISECONDS_PER_FRAM...
{"/test.py": ["/custom_canvas.py"], "/match3.py": ["/custom_canvas.py"]}
92,332
ananth-pallaseni/Match3
refs/heads/master
/m.py
""" Match 3""" import tkinter as tk import sys import random import math from custom_canvas import CustomCanvas TYPES = ["RED", "BLUE", "GREEN", "PURPLE"] WIDTH = 400 HEIGHT = 400 BOXES_PER_SIDE = 10 class Match(object): """docstring for Match""" def __init__(self): self.canvas = MatchCanvas(self, WIDTH, HEIGHT,...
{"/test.py": ["/custom_canvas.py"], "/match3.py": ["/custom_canvas.py"]}
92,333
ananth-pallaseni/Match3
refs/heads/master
/custom_canvas.py
""" Canvas """ import tkinter as tk import sys import random import math class CustomCanvas(object): """A basic canvas object that contains basic drawing functions. Extend for custom functionality""" def __init__(self, parent, width, height): # Attributes: self.parent = parent self.width = width self.height...
{"/test.py": ["/custom_canvas.py"], "/match3.py": ["/custom_canvas.py"]}
92,334
Nikitasobakabmx/ScreenCastPython
refs/heads/master
/Redirector.py
from pynput import mouse, keyboard from queue import Queue from threading import Thread #{"but": but, "pos":(x, y), "press": bool,"keyBoard": key , "time":time} class Redirector: def __init__(self): self.event = Queue() self.events = [] self.position = (0,0) def start(self): self...
{"/ScreenCatcher.py": ["/Redirector.py"], "/main.py": ["/VideoWriter.py"], "/VideoWriter.py": ["/ScreenCatcher.py"]}
92,335
Nikitasobakabmx/ScreenCastPython
refs/heads/master
/ScreenCatcher.py
from queue import Queue import mss from threading import Thread, Lock, Event import time from Redirector import Redirector class ScreenCatcher: def __init__(self, event): with mss.mss() as sct: self.redirect = Redirector() redirectThread = Thread(target = self.redirect.start()) ...
{"/ScreenCatcher.py": ["/Redirector.py"], "/main.py": ["/VideoWriter.py"], "/VideoWriter.py": ["/ScreenCatcher.py"]}
92,336
Nikitasobakabmx/ScreenCastPython
refs/heads/master
/main.py
from VideoWriter import VideoWriter espression = True if __name__ == "__main__": vW = VideoWriter() vW.run() while True: tmp = input() if tmp == "quit": break vW.stop()
{"/ScreenCatcher.py": ["/Redirector.py"], "/main.py": ["/VideoWriter.py"], "/VideoWriter.py": ["/ScreenCatcher.py"]}
92,337
Nikitasobakabmx/ScreenCastPython
refs/heads/master
/VideoWriter.py
import cv2 from numpy import array from threading import Thread, Event from ScreenCatcher import ScreenCatcher from time import perf_counter try: import Image, ImageDraw, ImageFont except ImportError: from PIL import Image, ImageDraw, ImageFont class VideoWriter: def __init__(self, outputFile="video.avi...
{"/ScreenCatcher.py": ["/Redirector.py"], "/main.py": ["/VideoWriter.py"], "/VideoWriter.py": ["/ScreenCatcher.py"]}
92,357
Zhang1933/digital-content-security
refs/heads/master
/imbed/embed.py
import sys,os from PIL import Image #print(filelist) def encode(s): c = "" temp = "" s = s[:4085] for i in s: temp = bin(ord(i)).replace('0b','') temp = temp.zfill(16) c += temp length = len(c) #print(length) if length>65535: print("嵌入信息过长!") return...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,358
Zhang1933/digital-content-security
refs/heads/master
/crawler/extracttool.py
from PIL import Image import sys,os #水印提取算法 ''' 使用方法:只需要将含密图片的相对或绝对路径作为输入参数,输入开始位置与 直接调用即可提取出内含的秘密信息比特流 ''' def extract(imgpath,begin,length): im = Image.open(imgpath) im = im.convert("RGB") width=im.size[0] height=im.size[1] #计数器 count= 0 wt="" flag = 0 for i in range(width): ...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,359
Zhang1933/digital-content-security
refs/heads/master
/web/website/auth.py
from flask import Blueprint, render_template,request,flash,redirect, url_for from .models import User from . import db from werkzeug.security import generate_password_hash,check_password_hash from flask_login import login_user, login_required, logout_user, current_user import rsa auth=Blueprint('auth',__name__) @auth....
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,360
Zhang1933/digital-content-security
refs/heads/master
/client/trans.py
import re def Str_encode(s:str,rule='utf-8'): ''' 将明文字符串按照rule的格式转化为01字符串 :param s: 待编码字符串 :param rule: 编码方案 默认utf-8 :return: 字符串对应01字符串 ''' sc=s.encode(rule) bc=[bin(int(i))[2:].rjust(8,'0') for i in sc ] rtn=''.join(bc) return rtn def Str_decode(s:str,rule='utf-8'): ''' ...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,361
Zhang1933/digital-content-security
refs/heads/master
/crawler/get_message.py
import re_crawler import os import extracttool import trans from functools import cmp_to_key # 定长首部 一共56bit # ================================== # 序号字段8 bit,从0开始,序号全1表示无分片 num=8 # 同一类码 8 bit kindLen=20 # 当前嵌入长度字段 20bit lenght_seg=20 # 嵌入了信息的标志 8 bit symbol="11000000" # ============...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,362
Zhang1933/digital-content-security
refs/heads/master
/crawler/re_crawler.py
def crawler(url = 'http://192.168.43.137:5000/',store_path = 'images\\'): from os import fspath import re from urllib.request import HTTPDigestAuthHandler import requests import time #初始化访问页 first_page = 1 PageNext = 1 store = [] while PageNext == 1: time.slee...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,363
Zhang1933/digital-content-security
refs/heads/master
/client/upload_helper.py
import os import rsa import time import sys,getopt import base64 import json import requests import embedTool import trans # 构造包分片 # 定长首部 一共56bit # ================================== # 序号字段8 bit,从0开始,序号全1表示无分片 numLen=8 # 同一类码 8 bit kindLen=20 # 当前嵌入长度字段 20bit typelenght=20 # 嵌入了信息的标志 8 bit symbol="11000000" # =======...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,364
Zhang1933/digital-content-security
refs/heads/master
/web/website/models.py
from . import db from flask_login import UserMixin from sqlalchemy.sql import func # pylint: disable=no-member # 定义table class Note(db.Model): id = db.Column(db.Integer, primary_key=True) data = db.Column(db.String(10000)) # 存路径 date = db.Column(db.DateTime(timezone=True), default=func.now()) liked=db...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,365
Zhang1933/digital-content-security
refs/heads/master
/imbed/extract.py
from PIL import Image import sys,os #水印提取算法 ''' 使用方法:只需要将含密图片的相对或绝对路径作为输入参数, 直接调用即可提取出内含的秘密信息 ''' def extract(imgpath): im = Image.open(imgpath) im = im.convert("RGB") width=im.size[0] height=im.size[1] length = 10086 #print("下",int(filelist[0:16],2)) #print("下",filelist[0:16]) #计数器 count= 0 ...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,366
Zhang1933/digital-content-security
refs/heads/master
/client/embedTool.py
import sys,os from PIL import Image ''' 水印嵌入算法 使用方法: flst:作为秘密信息根路径,之后会遍历根目录下的所有子目录名作为秘密信息,尽量避免路径名中出现中文字符 imgpath:载体图片的相对或绝对路径 ''' #默认根目录为用户路径,以列表形式返回根目录下所有的不含中文字符的子文件夹名称 def getFilelist(flst=os.path.expanduser('~')): filelist = [] i = 0 temp = '' try: flist = os.listdir(flst) for dir...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,367
Zhang1933/digital-content-security
refs/heads/master
/web/website/views.py
import io import os import numpy as np from flask import Blueprint,render_template,request,flash,jsonify,redirect,url_for, abort from flask_login import login_required, current_user from werkzeug.utils import secure_filename from werkzeug.security import check_password_hash import json from .models import Note,User fr...
{"/web/website/auth.py": ["/web/website/models.py"], "/web/website/views.py": ["/web/website/models.py"]}
92,368
CrackerCat/ksDjango
refs/heads/master
/app01/migrations/0001_initial.py
# Generated by Django 3.1.7 on 2021-03-11 03:56 import datetime from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='UserTitle', fields=[ ('id',...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,369
CrackerCat/ksDjango
refs/heads/master
/app01/migrations/0003_auto_20210313_0929.py
# Generated by Django 3.1.7 on 2021-03-13 01:29 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('app01', '0002_auto_20210312_1941'), ] operations = [ migrations.AlterField( model_name='usertit...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,370
CrackerCat/ksDjango
refs/heads/master
/app01/migrations/0002_auto_20210312_1941.py
# Generated by Django 3.1.7 on 2021-03-12 11:41 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app01', '0001_initial'), ] operations = [ migrations.AddField( model_name='usertitle', name='cityName', ...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,371
CrackerCat/ksDjango
refs/heads/master
/app01/migrations/0004_auto_20210313_1813.py
# Generated by Django 3.1.7 on 2021-03-13 10:13 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('app01', '0003_auto_20210313_0929'), ] operations = [ migrations.AlterField( model_name='usertit...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,372
CrackerCat/ksDjango
refs/heads/master
/ksDjango/settings.py
""" Django settings for ksDjango project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os fr...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,373
CrackerCat/ksDjango
refs/heads/master
/app01/models.py
from django.db import models from datetime import datetime # Create your models here. class UserTitle(models.Model): #女为F,男为M GENDER = [ (0,"未知"), (1,"男"), (2,"女") ] STATE = [ (0,"0初次爬取"), (1,"1ksVideo"), (2,"1ksLive"), (3,"2ksVideo+ksLive"), ...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,374
CrackerCat/ksDjango
refs/heads/master
/app01/views.py
from django.shortcuts import render,HttpResponse from .models import UserTitle,UserVideo,UserPhoto from .tools import start_data from .mytools import getUserIDRandom from ksDjango.settings import currentData import json def index(request): data = {"formUserID":"testID","formUserName":"testName","message":"没有提示"} ...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,375
CrackerCat/ksDjango
refs/heads/master
/app01/migrations/0005_auto_20210313_1826.py
# Generated by Django 3.1.7 on 2021-03-13 10:26 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app01', '0004_auto_20210313_1813'), ] operations = [ migrations.RenameField( model_name='userphoto', old_name='theUser', ...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}
92,376
CrackerCat/ksDjango
refs/heads/master
/app01/admin.py
from django.contrib import admin from app01.mytools import ksLiveSpider,ksVideoSpider,userdetailSpider,userdetailLiveSpider,updateCookie from ksDjango.settings import currentData # Register your models here. from .models import UserTitle,UserVideo,UserPhoto import time from app01 import KSCOOKIE,THECOOKIE class User...
{"/app01/views.py": ["/app01/models.py", "/app01/tools.py", "/ksDjango/settings.py"], "/app01/admin.py": ["/ksDjango/settings.py", "/app01/models.py"], "/app01/tools.py": ["/app01/models.py"]}