index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
59,437 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/views.py | from django.shortcuts import render
from rest_framework.schemas import get_schema_view
from rest_framework_swagger.renderers import SwaggerUIRenderer, OpenAPIRenderer
# Create your views here.
# View for accessing the Swagger interface.
schema_view = get_schema_view(title='InfoMe API', renderer_classes=[OpenAPIRendere... | {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,438 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/call/serializers.py | # -*- coding: utf-8 -*-
from rest_framework import serializers
from django.db import transaction
from infome.models import Call, Location
from infome.location.serializers import LocationSerializer
class CallSerializer(serializers.ModelSerializer):
location = LocationSerializer(many=False)
class Meta:
... | {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,439 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/apps.py | from django.apps import AppConfig
class InfomeConfig(AppConfig):
name = 'infome'
| {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,440 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/models.py | # -*- coding: utf-8 -*-
from django.db import models
class Call(models.Model):
DEFAULT_STATUS = (1, 'Aberta')
STATUS = (
DEFAULT_STATUS,
(2, 'Resolvida'),
(3, 'Cancelada')
)
description = models.TextField(max_length=300, default='')
tags = models.ManyToManyField('Tag')
... | {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,441 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/call/endpoints.py | # -*- coding: utf-8 -*-
"""Call Endpoints."""
from rest_framework import permissions, viewsets, status
from infome.models import Call
from infome.call.serializers import CallSerializer
class CallViewSet(viewsets.ModelViewSet):
"""
A simple ViewSet for viewing creating and editing Calls.
Filter fields s... | {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,442 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/hand/endpoints.py | # -*- coding: utf-8 -*-
"""Call Endpoints."""
from rest_framework import permissions, viewsets, status
from infome.models import Hand
from infome.hand.serializers import HandSerializer
class HandViewSet(viewsets.ModelViewSet):
"""
A simple ViewSet for viewing creating and editing Hands.
Filter fields s... | {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,443 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/call/urls.py | # -*- coding: utf-8 -*-
from rest_framework import routers
from infome.call.endpoints import CallViewSet
call_router = routers.SimpleRouter(trailing_slash=False)
call_router.register(r'calls', CallViewSet)
| {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,444 | fpwanderley/InfoMe-Backend | refs/heads/master | /infome/hand/urls.py | # -*- coding: utf-8 -*-
from rest_framework import routers
from infome.hand.endpoints import HandViewSet
hand_router = routers.SimpleRouter(trailing_slash=False)
hand_router.register(r'hands', HandViewSet)
| {"/infome/admin.py": ["/infome/models.py"], "/test_db.py": ["/infome/models.py"], "/infome/hand/serializers.py": ["/infome/models.py"], "/infome/call/serializers.py": ["/infome/models.py"], "/infome/call/endpoints.py": ["/infome/models.py", "/infome/call/serializers.py"], "/infome/hand/endpoints.py": ["/infome/models.p... |
59,446 | mohamed-aziz/realworld-flask | refs/heads/master | /conduit/extensions.py | # -*- coding: utf-8 -*-
"""Extensions module. Each extension is initialized in the app factory located in app.py."""
from flask_bcrypt import Bcrypt
from flask_caching import Cache
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from flask_jwt import JWT
from flask_cors import CORS
bcrypt =... | {"/conduit/extensions.py": ["/conduit/utils.py"], "/conduit/user/views.py": ["/conduit/utils.py", "/conduit/extensions.py"], "/conduit/app.py": ["/conduit/extensions.py"]} |
59,447 | mohamed-aziz/realworld-flask | refs/heads/master | /tests/test_articles.py | # coding: utf-8
from flask import url_for
class TestArticleViews:
def test_get_articles_by_author(self, testapp, user):
user = user.get()
resp = testapp.post_json(url_for('user.login_user'), {'user': {
'email': user.email,
'password': 'myprecious'
}})
tok... | {"/conduit/extensions.py": ["/conduit/utils.py"], "/conduit/user/views.py": ["/conduit/utils.py", "/conduit/extensions.py"], "/conduit/app.py": ["/conduit/extensions.py"]} |
59,448 | mohamed-aziz/realworld-flask | refs/heads/master | /conduit/user/views.py | # -*- coding: utf-8 -*-
"""User views."""
from flask import Blueprint
from .serializers import user_schema
from .models import User
from conduit.profile.models import UserProfile
from flask_jwt import current_identity, jwt_required
from flask_apispec import use_kwargs, marshal_with
from sqlalchemy.exc import IntegrityE... | {"/conduit/extensions.py": ["/conduit/utils.py"], "/conduit/user/views.py": ["/conduit/utils.py", "/conduit/extensions.py"], "/conduit/app.py": ["/conduit/extensions.py"]} |
59,449 | mohamed-aziz/realworld-flask | refs/heads/master | /conduit/app.py | # -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask
from conduit.extensions import bcrypt, cache, db, migrate, jwt
from conduit import commands, user, profile, articles
from conduit.settings import ProdConfig
from conduit.exceptions import InvalidUsage
def creat... | {"/conduit/extensions.py": ["/conduit/utils.py"], "/conduit/user/views.py": ["/conduit/utils.py", "/conduit/extensions.py"], "/conduit/app.py": ["/conduit/extensions.py"]} |
59,450 | mohamed-aziz/realworld-flask | refs/heads/master | /conduit/utils.py | # -*- coding: utf-8 -*-
"""Helper utilities and decorators."""
from flask import flash, _request_ctx_stack
from functools import wraps
from flask_jwt import _jwt
import jwt
def jwt_optional(realm=None):
def wrapper(fn):
@wraps(fn)
def decorator(*args, **kwargs):
token = _jwt.request_ca... | {"/conduit/extensions.py": ["/conduit/utils.py"], "/conduit/user/views.py": ["/conduit/utils.py", "/conduit/extensions.py"], "/conduit/app.py": ["/conduit/extensions.py"]} |
59,454 | jacobandreas/unnatural-language | refs/heads/master | /exp/overnight/collate.py | #!/usr/bin/env python3
import os
results = {}
for dataset in os.listdir("."):
if not os.path.isdir(dataset):
continue
results[dataset] = {}
for experiment in os.listdir(dataset):
result_line = None
result_filename = os.path.join(dataset, experiment, "predict.log")
if not os... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,455 | jacobandreas/unnatural-language | refs/heads/master | /predict_interactive.py | #!/usr/bin/env python3
import common
from common import _model
from absl import app, flags
import numpy as np
import os
import sexpdata
import sys
FLAGS = flags.FLAGS
def main(argv):
model = _model()
model.load(FLAGS.write_model)
for line in sys.stdin:
utterance = line.strip()
pred_lf = ... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,456 | jacobandreas/unnatural-language | refs/heads/master | /train.py | #!/usr/bin/env python3
import common
from common import _model
from absl import app, flags
import os
import sexpdata
FLAGS = flags.FLAGS
def main(argv):
model = _model()
fake_utts = []
real_utts = []
lfs = []
train_file = os.path.join(FLAGS.data_dir, "data", "{}.paraphrases.train.examples"... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,457 | jacobandreas/unnatural-language | refs/heads/master | /preproc.py | #!/usr/bin/env python3
import common
from common import _sent_representer, _word_representer, _device
import util
from absl import app, flags
import json
import numpy as np
import os
import sexpdata
import torch
from tqdm import tqdm
FLAGS = flags.FLAGS
def _pad_cat(reps):
max_len = max(rep.shape[1] for rep in ... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,458 | jacobandreas/unnatural-language | refs/heads/master | /predict.py | #!/usr/bin/env python3
import common
from common import _model
from absl import app, flags
import numpy as np
import os
import sexpdata
FLAGS = flags.FLAGS
def main(argv):
model = _model()
model.load(FLAGS.write_model)
test_file = os.path.join(FLAGS.data_dir, "data", "{}.paraphrases.test.examples".form... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,459 | jacobandreas/unnatural-language | refs/heads/master | /models/sim.py | from util import lf_detokenize
from absl import flags
import numpy as np
import torch
from torch import nn, optim
from tqdm import tqdm
import sys
FLAGS = flags.FLAGS
flags.DEFINE_enum("sim__scorer", "bilinear", ["", "linear", "bilinear", "rnn"], "scoring function to use")
flags.DEFINE_integer("sim__hidden_size", 102... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,460 | jacobandreas/unnatural-language | refs/heads/master | /rep_service.py | #!/usr/bin/env python3
import common
from common import _representer
from absl import app, flags
import numpy as np
import os
import sexpdata
import sys
FLAGS = flags.FLAGS
def main(argv):
rep = _representer(vocab=dict())
for line in sys.stdin:
utterance = line.strip()
pred_rep = rep(utteran... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,461 | jacobandreas/unnatural-language | refs/heads/master | /models/seq2seq.py | from models.torchdec import Vocab, Encoder, Decoder, SimpleAttention, batch_seqs
import util
import sexpdata
from absl import flags
import numpy as np
import torch
from torch import nn, optim
import sys
FLAGS = flags.FLAGS
flags.DEFINE_boolean("seq2seq__pretrained_enc", False, "use pretrained representations for enco... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,462 | jacobandreas/unnatural-language | refs/heads/master | /common.py | from models.sim import SimModel
from models.seq2seq import Seq2SeqModel
import util
from absl import flags
import json
import numpy as np
from pytorch_transformers import BertModel, BertTokenizer, GPT2Model, GPT2Tokenizer
import torch
import torch.nn.functional as F
FLAGS = flags.FLAGS
flags.DEFINE_string("data_dir",... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,463 | jacobandreas/unnatural-language | refs/heads/master | /util.py | import spacy
NLP = spacy.load("en_core_web_sm")
def word_tokenize(utt):
analyzed_utt = NLP(utt)
return [token.lemma_ for token in analyzed_utt]
def lf_tokenize(lf):
tokens = lf.replace("(", "( ").replace(")", " )").split()
return tokens
def lf_detokenize(tokens):
lf = " ".join(tokens).replace("(... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,464 | jacobandreas/unnatural-language | refs/heads/master | /models/torchdec.py | from collections import namedtuple
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
#_VF = torch._C._VariableFunctions
EPS = 1e-7
def batch_seqs(seqs):
max_len = max(len(s) for s in seqs)
data = np.zeros((max_len, len(seqs)))
for i, s in enumerate(seqs):
for j i... | {"/predict_interactive.py": ["/common.py"], "/train.py": ["/common.py"], "/preproc.py": ["/common.py", "/util.py"], "/predict.py": ["/common.py"], "/models/sim.py": ["/util.py"], "/rep_service.py": ["/common.py"], "/models/seq2seq.py": ["/models/torchdec.py", "/util.py"], "/common.py": ["/models/sim.py", "/models/seq2s... |
59,466 | polesonair/task_5_1 | refs/heads/main | /dirty_main.py | from main import *
# Доступные функции
application.db.people.get_employees()
application.salary.calculate_salary()
| {"/dirty_main.py": ["/main.py"], "/main.py": ["/application/salary.py", "/application/db/people.py"]} |
59,467 | polesonair/task_5_1 | refs/heads/main | /application/db/people.py | def get_employees():
print('Сотрудники') | {"/dirty_main.py": ["/main.py"], "/main.py": ["/application/salary.py", "/application/db/people.py"]} |
59,468 | polesonair/task_5_1 | refs/heads/main | /main.py | from datetime import date
import application.salary
import application.db.people
def main():
application.salary.calculate_salary()
application.db.people.get_employees()
print(date.today().strftime("%m.%d.%Y"))
if __name__ == '__main__':
main() | {"/dirty_main.py": ["/main.py"], "/main.py": ["/application/salary.py", "/application/db/people.py"]} |
59,469 | polesonair/task_5_1 | refs/heads/main | /application/salary.py | def counting_salary():
print('Подсчет зарплаты') | {"/dirty_main.py": ["/main.py"], "/main.py": ["/application/salary.py", "/application/db/people.py"]} |
59,475 | chooyee/pdfocr | refs/heads/master | /models/intepret.py | import pandas as pd
import csv
import spacy
from infra.logger import Logger
# print(dataframe)
# for ind in dataframe.index:
# print(dataframe[3][ind])
# find_name(dataframe[3][ind])
# # data = dataframe.style.set_properties(align="left")
# #Converting it in a excel-file
# dataframe.to_csv("output.csv")
def r... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,476 | chooyee/pdfocr | refs/heads/master | /controllers/conlist.py | from db.sqlite import ConMan
def GetConList(uuid):
with ConMan() as con:
sql = '''select * from conlist where uuid=?'''
rows = con.Select(sql, (uuid,))
return rows | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,477 | chooyee/pdfocr | refs/heads/master | /infra/logger.py | import logging
import datetime
# logging.debug('This message should go to the log file')
# logging.info('So should this')
# logging.warning('And this, too')
# logging.error('And non-ASCII stuff, too, like Øresund and Malmö')
class Logger:
def __init__(self):
now = datetime.datetime.now()
filename =... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,478 | chooyee/pdfocr | refs/heads/master | /db/sqlite.py | import sqlite3
from sqlite3 import Error
from dotenv import load_dotenv
from infra.logger import Logger
import os
class ConMan:
def __init__(self):
root = os.getcwd()
load_dotenv(root + '/config.env')
print(os.environ.get("dbname"))
self.database = root + '/' + os.environ.get("dbnam... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,479 | chooyee/pdfocr | refs/heads/master | /main.py | from controllers.comprehend import Comprehend
from db.sqlite import ConMan
import os
import sys
# unique_filename = str(uuid.uuid4())
# folderPath = './temp/'
# decryptedPdfFileName = folderPath+ unique_filename + ' _decrypted.pdf'
# decrypt_pdf('Laporan-CCIS-Akaun-Mule-Bank23-07-2020.pdf', decryptedPdfFileName, 'CC... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,480 | chooyee/pdfocr | refs/heads/master | /app.py | import imghdr
import os
from flask import Flask, render_template, request, redirect, url_for, abort, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from controllers.comprehend import Comprehend
from db.sqlite import ConMan
from controllers.conlist import GetConList
from waitress import serve
... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,481 | chooyee/pdfocr | refs/heads/master | /controllers/comprehend.py | from models.pdf import decrypt_pdf, convert_img
from db.sqlite import ConMan
from models.ocr import ocr_table
from models.intepret import read_text
from infra.logger import Logger
import uuid
import os
import datetime
class Comprehend:
def __init__(self):
pass
def Start(self, filename, password=... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,482 | chooyee/pdfocr | refs/heads/master | /models/pdf.py | import pikepdf
# import module
from pdf2image import convert_from_path
def decrypt_pdf(input_path, output_path, password):
with pikepdf.open(input_path, password=password) as pdf:
pdf.save(output_path)
def convert_img(decrypted_pdf, unique_filename):
# Store Pdf with convert_from_path function
ima... | {"/models/intepret.py": ["/infra/logger.py"], "/controllers/conlist.py": ["/db/sqlite.py"], "/db/sqlite.py": ["/infra/logger.py"], "/main.py": ["/controllers/comprehend.py", "/db/sqlite.py"], "/app.py": ["/controllers/comprehend.py", "/db/sqlite.py", "/controllers/conlist.py"], "/controllers/comprehend.py": ["/models/p... |
59,483 | gregplechaty/homepage | refs/heads/main | /manage.py | ### Site Generator created 1/24 ###
### refactored 2/3/21 ###
### jinja2 added 2/13/21###
import sys
import utils
#print if no argument provided
if len(sys.argv) == 1:
print("Please specify ’build’ or ’new’ as an argument")
quit()
command = sys.argv[1]
if command == "build":
print("Build was specified")... | {"/manage.py": ["/utils.py"]} |
59,484 | gregplechaty/homepage | refs/heads/main | /utils.py | ### Site Generator created 1/24 ###
### refactored 2/3/21 ###
### jinja2 added 2/13/21###
import datetime
import glob
import os
from jinja2 import Template
import re
##########################################################
### Create dictionaries - pages and blog_posts
def create_page_list():
all_html_files = ... | {"/manage.py": ["/utils.py"]} |
59,485 | gregplechaty/homepage | refs/heads/main | /old blog_posts list of dictionaries.py |
blog_posts = [
{
"filename": "blog/1_too_many_pieces.html",
"date": "January 15th, 2021",
"title": "Too Many Pieces?",
"subtitle": "When the quantity of tools is immense, and your skills are not, how do you know where to start?",
"output": "./docs/1_too_many_pieces.html",
... | {"/manage.py": ["/utils.py"]} |
59,491 | wangxiaojiani/learning_excise_ui | refs/heads/master | /test_case/Conftest.py | # -*- coding: utf-8 -*-
#@Time :2019/10/10 0:31
#@Author :xj
#@Email :1027867874@qq.com
#@File :Conftest.py
#@Software :PyCharm
import pytest
from page.login_page import LoginPage
from page.home_oage import HomePage
from selenium.webdriver import Firefox
@pytest.fixture(scope='class')
def init_driv... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,492 | wangxiaojiani/learning_excise_ui | refs/heads/master | /common/screen_shot.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 11:00
#@Author :xj
#@Email :1027867874@qq.com
#@File :screen_shot.py
#@Software :PyCharm
from selenium import webdriver
import random
import time,os
from common.path import project_path
from common import mylog
logger=mylog.MyLog('WJ')
def insert_img(driver... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,493 | wangxiaojiani/learning_excise_ui | refs/heads/master | /main.py | # -*- coding: utf-8 -*-
#@Time :2019/10/10 1:06
#@Author :xj
#@Email :1027867874@qq.com
#@File :main.py
#@Software :PyCharm
import pytest
import pytest_rerunfailures
if __name__=='__main__':
# pytest.main(['-s','-m sm','--reruns=2','--reruns-delay=5',r'--html=result\report\test.html'])
pyt... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,494 | wangxiaojiani/learning_excise_ui | refs/heads/master | /test_data/login_data.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 16:00
#@Author :xj
#@Email :1027867874@qq.com
#@File :login_data.py
#@Software :PyCharm
login_info_error=[{'account':'','pwd':'123213','expect_result':'请输入手机号'},
{'account':'1234','pwd':'32424','expect_result':'请输入正确的手机号'},{'account':'13296... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,495 | wangxiaojiani/learning_excise_ui | refs/heads/master | /runner.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 16:17
#@Author :xj
#@Email :1027867874@qq.com
#@File :runner.py
#@Software :PyCharm
import unittest
from test_case import login_sta
from HTMLTestRunnerNew import HTMLTestRunner
import time
from common.path import current_report_path
#创建测试套件的对象
suit=unittes... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,496 | wangxiaojiani/learning_excise_ui | refs/heads/master | /common/path.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 10:45
#@Author :xj
#@Email :1027867874@qq.com
#@File :path.py
#@Software :PyCharm
import os
#获取当前目录路径
current_dir_path=os.path.dirname(__file__)
#获取项目工程路径
project_path=os.path.split(current_dir_path)[0]
#日志输出目录
current_log_path=os.path.join(project_path,... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,497 | wangxiaojiani/learning_excise_ui | refs/heads/master | /common/mylog.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 10:12
#@Author :xj
#@Email :1027867874@qq.com
#@File :mylog.py
#@Software :PyCharm
import logging
from common.path import current_log_path
class MyLog:
def __init__(self,name):
self.name=name
def mylog(self,levelname,msg):
#设置日志收集器的... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,498 | wangxiaojiani/learning_excise_ui | refs/heads/master | /page/login_page.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 15:06
#@Author :xj
#@Email :1027867874@qq.com
#@File :login_page.py
#@Software :PyCharm
"登录页面交互细节的封装(元素以及行为)"
from common.base import Page
from page.home_oage import HomePage
class LoginPage(Page):
def __init__(self,selenium_driver):
super(Logi... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,499 | wangxiaojiani/learning_excise_ui | refs/heads/master | /test_case/login_sta_test.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 15:37
#@Author :xj
#@Email :1027867874@qq.com
#@File :login_sta.py
#@Software :PyCharm
import unittest,pytest
from selenium.webdriver import Firefox
from ddt import ddt,data
from page.home_oage import HomePage
from page.login_page import LoginPage
from test... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,500 | wangxiaojiani/learning_excise_ui | refs/heads/master | /page/home_oage.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 15:23
#@Author :xj
#@Email :1027867874@qq.com
#@File :home_oage.py
#@Software :PyCharm
from common.base import Page
class HomePage(Page):
# 登录按钮
login_button = "//a[text()='登录']"
username = "//img[@class='mr-5']/parent::a"
def click_login_b... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,501 | wangxiaojiani/learning_excise_ui | refs/heads/master | /common/base.py | # -*- coding: utf-8 -*-
#@Time :2019/10/9 11:46
#@Author :xj
#@Email :1027867874@qq.com
#@File :base.py
#@Software :PyCharm
"""所有页面的基类"""
from selenium import webdriver
from selenium.webdriver import Chrome
from common.mylog import MyLog
from selenium.webdriver.common.by import By
from selenium.com... | {"/test_case/Conftest.py": ["/page/login_page.py", "/page/home_oage.py"], "/common/screen_shot.py": ["/common/path.py"], "/runner.py": ["/common/path.py"], "/common/mylog.py": ["/common/path.py"], "/page/login_page.py": ["/common/base.py", "/page/home_oage.py"], "/test_case/login_sta_test.py": ["/page/home_oage.py", "/... |
59,509 | weihengSu/basketApp | refs/heads/master | /login_check.py | import psycopg2
def create_user(username, email, password):
conn = psycopg2.connect(database="basketball", user="postgres", password="password")
cur = conn.cursor()
#cur.execute("INSERT INTO basket_user(user_id, user_email, user_password) VALUES ('" + username + "', '"+ email + "', '" + password+ "');")
... | {"/app.py": ["/login_check.py", "/models.py"]} |
59,510 | weihengSu/basketApp | refs/heads/master | /app.py | from flask import Flask, render_template,json, request, redirect, url_for, request, get_flashed_messages
from login_check import *
from flask.ext.login import LoginManager, UserMixin, current_user, login_user, logout_user, login_required
from models import *
from flask import session
from nocache import *
#The web app... | {"/app.py": ["/login_check.py", "/models.py"]} |
59,511 | weihengSu/basketApp | refs/heads/master | /models.py | from flask.ext.login import UserMixin
import psycopg2
# Take care of User model
class UserNotFoundException(Exception):
pass
class User(UserMixin):
CONN = psycopg2.connect("dbname='basketball' user='postgres' "
"host='localhost' password='password'")
CUR = CONN.cursor()
CUR.execute('SELECT user_... | {"/app.py": ["/login_check.py", "/models.py"]} |
59,513 | Eelviny/ticksys | refs/heads/master | /codereader.py | #!/usr/bin/env python3
# Code Reader Module
from checksum import sumRead
from dbinterface import *
# Find the corresponding database record by submitting a query
def codeRead(ticketID):
listID = codeConv(ticketID)
# Check the checksum first before continuing onto the database
if not sumRead(listID):
raise ValueE... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,514 | Eelviny/ticksys | refs/heads/master | /codegenerator.py | #!/usr/bin/env python3
# Code Generator Module
import random
from checksum import *
from dbinterface import *
def randomCode():
# Generate a 4-digit random hexadecimal string
randomauth = []
# values 0 to 15 for hexadecimal
for i in range(0,4):
randomauth.append(random.randint(0,15))
return randomauth
# The ... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,515 | Eelviny/ticksys | refs/heads/master | /createevent.py | #!/usr/bin/env python3
# Create Event Module
| {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,516 | Eelviny/ticksys | refs/heads/master | /statistics.py | #!/usr/bin/env python3
# Statistics Modules
| {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,517 | Eelviny/ticksys | refs/heads/master | /reader.py | #!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import codereader
import dbinterface
import fileaccess
# Start the reader program class
class Reader():
def __init__(self):
# use Gtk Builder to build the UI from file
self.builder = Gtk.Builder()
self.builder.add_f... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,518 | Eelviny/ticksys | refs/heads/master | /dbinterface.py | #!/usr/bin/env python3
# Database Interface Module
import sqlite3
# File access will initialise the class
class Database():
def __init__(self, path=":memory:"):
if path == ":memory:":
print("WARNING: Database is in memory! Nothing will be saved")
# Connect to database
self.conn = sqlite3.connect(path)
sel... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,519 | Eelviny/ticksys | refs/heads/master | /editor.py | #!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import locale # Used for formatting strings to local currency
locale.setlocale( locale.LC_ALL, 'en_GB.UTF-8' )
import codereader
import dbinterface
import fileaccess
# Start the reader program class
class Editor():
def __... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,520 | Eelviny/ticksys | refs/heads/master | /validation.py | #!/usr/bin/env python3
# Validation Module
| {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,521 | Eelviny/ticksys | refs/heads/master | /checksum.py | #!/usr/bin/env python3
# Checksum Module
# Generate a checksum
def sumGen(ticketID):
idno = 0
# Multiply each value by its position, and add them together
for i in range(7):
idno += ticketID[i] * i+1
hexno = format(idno, 'x')
# Take first and last values if the hex is larger than 2 digits
if len(hexno) > 2:
... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,522 | Eelviny/ticksys | refs/heads/master | /fileaccess.py | #!/usr/bin/env python3
# File Access Module
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from dbinterface import *
#from shutil import copyfile
def setFile(path):
# Validate that it is a database file if the last 3 characters are .db
if path[-3:] != '.db':
raise TypeError
# Try openi... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,523 | Eelviny/ticksys | refs/heads/master | /creator.py | #!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import locale # Used for formatting strings to local currency
locale.setlocale( locale.LC_ALL, 'en_GB.UTF-8' )
import codegenerator
import dbinterface
import fileaccess
# Start the reader program class
class Creator():
de... | {"/codereader.py": ["/checksum.py", "/dbinterface.py"], "/codegenerator.py": ["/checksum.py", "/dbinterface.py"], "/reader.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/editor.py": ["/codereader.py", "/dbinterface.py", "/fileaccess.py"], "/fileaccess.py": ["/dbinterface.py"], "/creator.py": ["/codegen... |
59,527 | russab0/distractor_generation | refs/heads/master | /src/__init__.py | import sys
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
print('dir', dir_path)
sys.path.append(os.path.abspath(os.path.join(dir_path, os.pardir)))
from src.model import *
from src.utility import *
import src.dump
import src.train
import src.eval
| {"/src/__init__.py": ["/src/utility/__init__.py"], "/src/utility/__init__.py": ["/src/utility/eval_metric.py"]} |
59,528 | russab0/distractor_generation | refs/heads/master | /setup.py | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='A short description of the project.',
author='Ruslan Sabirov - student, Vladimir Ivanov - superviser (Innopolis University)',
license='',
)
| {"/src/__init__.py": ["/src/utility/__init__.py"], "/src/utility/__init__.py": ["/src/utility/eval_metric.py"]} |
59,529 | russab0/distractor_generation | refs/heads/master | /src/utility/__init__.py | from .dataset import *
from .eval_metric import *
from .logger import *
from .loss import *
from .model_loader import *
from .tok import * | {"/src/__init__.py": ["/src/utility/__init__.py"], "/src/utility/__init__.py": ["/src/utility/eval_metric.py"]} |
59,530 | russab0/distractor_generation | refs/heads/master | /src/model/once/__init__.py | from .dataloader import get_data_from_file, get_feature_from_data, preprocessing_data
from .model import Model
| {"/src/__init__.py": ["/src/utility/__init__.py"], "/src/utility/__init__.py": ["/src/utility/eval_metric.py"]} |
59,531 | russab0/distractor_generation | refs/heads/master | /src/utility/eval_metric.py | from collections import defaultdict
import string
import re
from collections import Counter
def _normalize_answer(s):
"""Lower text and remove punctuation, articles and extra whitespace."""
def remove_articles(text):
if len(text) > 1:
return re.sub(r'\b(a|an|the)\b', ' ', text)
el... | {"/src/__init__.py": ["/src/utility/__init__.py"], "/src/utility/__init__.py": ["/src/utility/eval_metric.py"]} |
59,535 | wanzhaohong/graphical_password_crafting_system | refs/heads/master | /sql_connect.py | import sqlite3
from sqlite3 import Error
#connect to the database
def connect():
conn = None
try:
#connect to the database
conn = sqlite3.connect("mydb")
except Error as e:
print(e)
return conn
#insert the username into the tables, and make the username as the primary key
def insert_username(info_name):
#i... | {"/program.py": ["/sql_connect.py", "/password.py"]} |
59,536 | wanzhaohong/graphical_password_crafting_system | refs/heads/master | /program.py | import Tkinter as tk
from Tkinter import *
import datetime
from sql_connect import *
from password import *
LARGE_FONT = ("Verdana", 12)
#create the GUI window of the application
class first(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
first_page = tk.Frame(self)
first_pag... | {"/program.py": ["/sql_connect.py", "/password.py"]} |
59,537 | wanzhaohong/graphical_password_crafting_system | refs/heads/master | /password.py | import Tkinter as tk
from Tkinter import *
import random
import time
#the function to create the assigned password
def random_colour():
colours = ["red", "blue", "green", "pink", "yellow", "black", "white"]
hair = random.choice(colours)
face = random.choice(colours)
nose = random.choice(colours)
leftc = random.ch... | {"/program.py": ["/sql_connect.py", "/password.py"]} |
59,547 | ngoiz/model-sharpy-hale | refs/heads/main | /aircraft.py | #! /usr/bin/env python3
import h5py as h5
import configobj
import numpy as np
from structure import HaleStructure
from aero import HaleAero
import os
import sharpy.sharpy_main
class Hale:
def __init__(self, case_name, case_route, output_route):
self.case_name = case_name
self.case_route = case_ro... | {"/aircraft.py": ["/structure.py", "/aero.py"], "/aero.py": ["/structure.py"]} |
59,548 | ngoiz/model-sharpy-hale | refs/heads/main | /structure.py | #! /usr/bin/env python3
import h5py as h5
import numpy as np
# MODEL GEOMETRY
# beam
span_main = 16.0
lambda_main = 0.25
lambda_dihedral = 20*np.pi/180
ea_main = 0.3
length_fuselage = 10
offset_fuselage = 1.25*0
sigma_fuselage = 10
m_bar_fuselage = 0.3
j_bar_fuselage = 0.1
ea = 1e4
ga = 1e4
gj = 1e4
eiy = 2e4
eiz = 7... | {"/aircraft.py": ["/structure.py", "/aero.py"], "/aero.py": ["/structure.py"]} |
59,549 | ngoiz/model-sharpy-hale | refs/heads/main | /aero.py | #! /usr/bin/env python3
import h5py as h5
import numpy as np
from structure import span_main
from sharpy.utils.geo_utils import generate_naca_camber
chord_main = 1.0
chord_tail = 0.5
chord_fin = 0.5
ea_main = 0.3
ea_fin = 0.5
ea_tail = 0.5
# reference area
area_ref = chord_main * 2 * span_main
class HaleAero:
... | {"/aircraft.py": ["/structure.py", "/aero.py"], "/aero.py": ["/structure.py"]} |
59,609 | bpiktel/tile_map_generator | refs/heads/main | /gui.py | from tkinter import (
Frame, Canvas, Scrollbar, Label, Tk, Button, Toplevel, Entry, colorchooser,
messagebox, Menu, filedialog)
import tkinter as tk
from PIL import ImageTk
from src.tile_map_io import TileMapIO
from src.visualisation import TileMapVisualisation
from src.tile_map import TileMap
from src.genera... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,610 | bpiktel/tile_map_generator | refs/heads/main | /tests/test_generator.py | import numpy as np
from src.generator import BorderGeneration as BG
def test_searching_for_coordinates():
sample_raw_map = [[0, 0, 1, 2],
[3, 4, 1, 3],
[8, 3, 4, 1]]
sample_map = BG(sample_raw_map, 1)
searched_coord_tuples = sample_map.get_coordinate_tuples(1)
... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,611 | bpiktel/tile_map_generator | refs/heads/main | /src/tile_map_io.py | import pickle
import os
import src.visualisation as tmv
class TileMapIO:
"""
TileMapIO class contains methods of loading and saving map in different
forms (image, string, serialization)
"""
@staticmethod
def save_map_image(image, path):
if len(path) == 0:
return
i... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,612 | bpiktel/tile_map_generator | refs/heads/main | /src/tile.py | class Tile:
"""
Tile object contains data used to generate and visualize tile map.
:param id: Unique number that TileMap class uses to store maps, must be
positive or 0
:type id: int
:param name: Name of tile type
:type name: str
:param color: Color of tile when exported to im... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,613 | bpiktel/tile_map_generator | refs/heads/main | /tests/test_tile.py | import pytest
from src.tile import Tile, TileTreeNode
def test_ttn_structure():
sample_ttn = TileTreeNode(Tile(0, '0', 'red'),
[TileTreeNode(Tile(1, '1', 'green', 0.3, 2)),
TileTreeNode(Tile(2, '2', 'blue'),
... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,614 | bpiktel/tile_map_generator | refs/heads/main | /tests/test_tile_map.py | import pytest
import numpy as np
from src.tile_map import TileMap
from src.tile import Tile
from src.tile import TileTreeNode
def test_constructor():
tm = TileMap(3, 5, TileTreeNode(Tile(0, "", "")))
assert tm.get_map().shape == (3, 5)
assert np.count_nonzero(tm.get_map()) == 0
def test_wrong_data():
... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,615 | bpiktel/tile_map_generator | refs/heads/main | /src/visualisation.py | from PIL import Image, ImageDraw
class TileMapVisualisation():
"""
TileMapVisualisation class containing methods of string or
image representation of tile map
"""
@staticmethod
def get_string_map_representation(t_map):
"""Method used get map representation to show in terminal"""
... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,616 | bpiktel/tile_map_generator | refs/heads/main | /src/generator.py | from random import choice, randrange
from math import floor
import numpy as np
class TileMapGenerator:
"""
TileMapGenerator class contains methods of splitting tile map generation
into steps of generating single tile type.
"""
def generate_map(self, tile_map):
"""Splits map into map of i... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,617 | bpiktel/tile_map_generator | refs/heads/main | /src/tile_map.py | import numpy as np
from src.tile import TileTreeNode
class TileMap:
"""
TileMap object stores 2D array of ids and tiles data corresponding to it.
:param tiles:
:type tiles: :class:'tile.Tile'
:param map:
:type map: :class:'numpy.ndarray'
"""
def __init__(self, size_y, size_x, tiles):... | {"/gui.py": ["/src/tile_map_io.py", "/src/visualisation.py", "/src/tile_map.py", "/src/generator.py", "/src/tile.py"], "/tests/test_generator.py": ["/src/generator.py"], "/src/tile_map_io.py": ["/src/visualisation.py"], "/tests/test_tile.py": ["/src/tile.py"], "/tests/test_tile_map.py": ["/src/tile_map.py", "/src/tile.... |
59,618 | zhuokaizhao/artifice | refs/heads/master | /artifice/sharedobjects/__init__.py | from .shared import * # noqa
| {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,619 | zhuokaizhao/artifice | refs/heads/master | /artifice/docs.py | description = "Artifice."
commands = "Artifice command to run. Can be multiple."
# file settings
data_root = "todo"
model_root = "todo"
overwrite = "Overwrite existing models."
deep = "todo"
figs_dir = "todo"
# data settings
convert_mode = "todo"
transformation = "todo"
identity_prob = "todo"
priority_mode = "todo"
l... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,620 | zhuokaizhao/artifice | refs/heads/master | /artifice/img.py | """
Util functions for manipulating images in artifice.
"""
import numpy as np
from PIL import Image
from skimage import draw
from artifice.log import logger # noqa: F401
"""
Basic image utilities.
"""
def grayscale(image):
"""Convert an n-channel, 3D image to grayscale.
Use the[luminosity weighted average]... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,621 | zhuokaizhao/artifice | refs/heads/master | /artifice/windows/annotator_window.py | """Create the annotator window for use by ann.py."""
from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow, QWidget
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtCore import Qt
class AnnotatorWindow(QWidget):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindo... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,622 | zhuokaizhao/artifice | refs/heads/master | /batch/make_scripts.py | """Make all the scripts for training and analysis.
Unlike most artifice scripts, this should be run from ROOT/batch."""
import os
import itertools
train_template = """#!/bin/bash
#SBATCH --job-name={mode}
#SBATCH --output={out_name}
#SBATCH --error={err_name}
#SBATCH -p gpu2
#SBATCH --gres=gpu:1
#SBATCH --time=24:0... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,623 | zhuokaizhao/artifice | refs/heads/master | /artifice/tform.py | """Transformation utils, used to build up augmentations.
Note that these transformations are expected to adjust not just the image but
also the label to match. This is easily done for translation, where the
corresponding label dimension (position) is known, but less so for other pose
dimensions. Custom code may be wri... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,624 | zhuokaizhao/artifice | refs/heads/master | /artifice/mod.py | """Implements artifice's detection scheme from end to end.
"""
import os
from time import time
import itertools
import numpy as np
from stringcase import snakecase
import tensorflow as tf
from tensorflow import keras
from artifice.log import logger
from artifice import dat
from artifice import utils
from artifice imp... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,625 | zhuokaizhao/artifice | refs/heads/master | /artifice/__init__.py | from .logger import logger, set_verbosity
__all__ = [logger, set_verbosity]
| {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,626 | zhuokaizhao/artifice | refs/heads/master | /artifice/lay.py | import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.python.ops import array_ops
from artifice.log import logger # noqa
from artifice import utils
from artifice import sparse
from artifice import conv_utils
from artifice import img, vis
NEG_INF = np.finfo(np.float32).min
class P... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,627 | zhuokaizhao/artifice | refs/heads/master | /artifice/sparse/sparse.py | """The implementations in this file rely on SBNet, a project from
uber-research. The original repository containing this code can be found
[here](https://github.com/uber-research/sbnet), and the paper describing it
[here](https://arxiv.org/abs/1801.02108). Documentation for my wrapper
functions comes mostly from the gi... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,628 | zhuokaizhao/artifice | refs/heads/master | /data/disks/view.py | from sys import argv
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
im = Image.open(argv[1])
image = np.array(im).reshape(im.size[0], im.size[1])
plt.imshow(image, cmap='gray')
plt.show()
| {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,629 | zhuokaizhao/artifice | refs/heads/master | /scripts/coupled_spheres.py | """Create a dataset of two spheres coupled by an invisible spring, floating
without gravity. Outputs a tfrecord in data/coupled_spheres. (Should be run from
$ARTIFICE)
# TODO: add realistic physics simulation as in
https://gist.github.com/Zulko/f828b38421dfbee59daf, using package 'ode'.
"""
import vapory
import nump... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,630 | zhuokaizhao/artifice | refs/heads/master | /scripts/parse_log.py | import re
import numpy as np
import matplotlib.pyplot as plt
logfiles = [(f"/Users/Benjamin/projects/artifice/batch/train/"
f"augmented-active_harper_spheres_tethered_subset100/train.err", 10),
(f"/Users/Benjamin/projects/artifice/batch/train/"
f"augmented-active_harper_spheres_te... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,631 | zhuokaizhao/artifice | refs/heads/master | /scripts/arcing_sphere.py | """Create a (test) dataset of a single sphere flying in a parabolic arc.
Outputs a tfrecord in data/arcing_sphere. (Should be run from $ARTIFICE)
"""
import vapory
import numpy as np
import matplotlib.pyplot as plt
from test_utils import experiment
from artifice.utils import dataset
debug = False
# helpers
color =... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,632 | zhuokaizhao/artifice | refs/heads/master | /scripts/two_spheres.py | """Create a dataset of scenes with two spheres, red and blue. Vary the position
and radius of these spheres randomly within the image frame.
Outputs a tfrecord in current data/two_spheres. (Should be run from $ARTIFICE)
"""
import vapory
import numpy as np
from test_utils import experiment
from artifice.utils import... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
59,633 | zhuokaizhao/artifice | refs/heads/master | /data/disks_100x100/fix.py | """Fix world-space coords from glk.
"""
from os.path import join, basename
from glob import glob
import numpy as np
shape = [100,100]
miny = 1 # index 0
maxy = -1
minx = -1
maxx = 1
def lerp(omin, omax, imin, xx, imax):
alpha = (xx - imin) / (imax - imin)
return (1. - alpha)*omin + alpha*o... | {"/artifice/sharedobjects/__init__.py": ["/artifice/sharedobjects/shared.py"], "/artifice/tform.py": ["/artifice/__init__.py"], "/artifice/mod.py": ["/artifice/__init__.py"], "/artifice/lay.py": ["/artifice/__init__.py"], "/artifice/sparse/sparse.py": ["/artifice/__init__.py", "/artifice/sparse/__init__.py"], "/scripts... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.