repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
felipezago/ControleEstoque | View/cadastro_usuario.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/cadastro_usuario.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import ... |
felipezago/ControleEstoque | View/cadastro_fornecedor.py | <reponame>felipezago/ControleEstoque<filename>View/cadastro_fornecedor.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/cadastro_fornecedor.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. D... |
felipezago/ControleEstoque | Model/Venda_Itens.py | from Funcoes.banco import conexao
class Vendas:
def __init__(self, id_v="", id_venda="", id_prod_serv="", tipo="", qtd="", valor="", desconto="", data_hora=""):
self.id = id_v
self.id_venda = id_venda
self.id_prod_serv = id_prod_serv
self.tipo = tipo
self.qtd = qtd
... |
felipezago/ControleEstoque | Controller/cadastro_finalizadoras.py | <filename>Controller/cadastro_finalizadoras.py
from PyQt5 import QtGui
from PyQt5.QtWidgets import QMainWindow
class CadastroFinalizadoras(QMainWindow):
def __init__(self, parent=None):
super(CadastroFinalizadoras, self).__init__(parent)
from View.cadastro_finalizadoras import Ui_ct_FormProdutos
... |
felipezago/ControleEstoque | Funcoes/utils.py | <filename>Funcoes/utils.py<gh_stars>0
# -*- coding: utf-8 -*-
import os
import sys
from datetime import datetime
from PIL.ImageQt import ImageQt
from PyQt5.QtPrintSupport import QPrinter, QPrintDialog
from PyQt5.QtCore import QSize
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QIcon, QPainter
import bcr... |
felipezago/ControleEstoque | Model/Produtos.py | import psycopg2
from Funcoes.utils import gravar_logs
from Model.Categoria import Categoria
from Model.Fornecedor import Fornecedor
from Funcoes.banco import conexao
class Produtos:
def __init__(self, prod_id="", fornecedor: Fornecedor = "", estoque="", codbarras="", descricao="", marca="",
prec... |
felipezago/ControleEstoque | Model/Categoria.py | from Funcoes.banco import conexao
class Categoria:
def __init__(self, cat_id="", descricao=""):
self.id = cat_id
self.descricao = descricao
def get_categoria_by_id(self):
conn = conexao()
cur = conn.cursor()
cur.execute(f'SELECT * FROM categoria WHERE cat_id = \'{self.... |
felipezago/ControleEstoque | Controller/cadastro_categoria.py | from PyQt5 import QtGui
from PyQt5.QtWidgets import QMainWindow
class CadastroCategoria(QMainWindow):
def __init__(self, parent=None):
super(CadastroCategoria, self).__init__(parent)
from View.cadastro_categoria import Ui_ct_FormCategoria
from PyQt5 import QtCore
# setando View
... |
felipezago/ControleEstoque | View/relatorio_movimento.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/relatorio_movimento.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 impo... |
felipezago/ControleEstoque | Controller/cadastro_usuario.py | from PyQt5.QtWidgets import QMainWindow
from PyQt5 import QtCore, QtGui
class EventFilter(QtCore.QObject):
def __init__(self, parent=None):
QtCore.QObject.__init__(self, parent)
def eventFilter(self, obj, event):
if event.type() == QtCore.QEvent.ActivationChange:
if self.parent()... |
felipezago/ControleEstoque | Controller/lista_usuario.py | <filename>Controller/lista_usuario.py<gh_stars>0
from PyQt5 import QtGui
from PyQt5.QtWidgets import QMessageBox, QTableWidgetItem, QMainWindow
from Model.Usuario import Usuario
from Model.Pessoa import Pessoa
from PyQt5.QtCore import Qt
class ListaUsuario(QMainWindow):
def __init__(self, parent=None):
su... |
felipezago/ControleEstoque | Model/Finalizadoras.py | <filename>Model/Finalizadoras.py
from Funcoes.banco import conexao
class Finalizadoras:
def __init__(self, fin_id="", descricao=""):
self.id = fin_id
self.descricao = descricao
def get_finalizadora_by_id(self):
conn = conexao()
cur = conn.cursor()
cur.execute(f'SELECT ... |
felipezago/ControleEstoque | Controller/lista_finalizadoras.py | <gh_stars>0
from PyQt5.QtWidgets import QMainWindow, QMessageBox, QTableWidgetItem
from Model.Finalizadoras import Finalizadoras
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
class EventFilter(QtCore.QObject):
def __init__(self, parent=None):
QtCore.QObject.__init__(self, parent)
def e... |
felipezago/ControleEstoque | View/venda_copia.py | <filename>View/venda_copia.py<gh_stars>0
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'venda.ui'
#
# Created by: PyQt5 View code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Frame(object):
def setup... |
felipezago/ControleEstoque | Model/Pessoa.py | from Model.Endereco import Endereco
class Pessoa(Endereco):
def __init__(self, cpf="", nome="", fone="", email="", rg="", celular="", tipo=""):
super().__init__()
self.nome = nome
self.email = email
self.cpf = cpf
self.fone = fone
self.rg = rg
self.tipo = ti... |
felipezago/ControleEstoque | Controller/lista_servicos.py | <reponame>felipezago/ControleEstoque<gh_stars>0
from PyQt5.QtWidgets import QMainWindow, QMessageBox, QTableWidgetItem
from Model.Servicos import Servicos
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
class EventFilter(QtCore.QObject):
def __init__(self, parent=None):
QtCore.QObject.__init_... |
felipezago/ControleEstoque | Controller/lista_categorias.py | <gh_stars>0
from PyQt5.QtWidgets import QMainWindow, QMessageBox, QTableWidgetItem
from Model.Categoria import Categoria
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
class EventFilter(QtCore.QObject):
def __init__(self, parent=None):
QtCore.QObject.__init__(self, parent)
def eventFilt... |
felipezago/ControleEstoque | View/lista_compras.py | <gh_stars>0
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/lista_compras.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt... |
felipezago/ControleEstoque | Controller/lista_produtos.py | <reponame>felipezago/ControleEstoque
import os
from PyQt5.QtWidgets import QMessageBox, QTableWidgetItem, QMainWindow
from Model.Compra_Itens import Compra_Itens
from Model.Produtos import Produtos
from Model.Categoria import Categoria
from Model.Fornecedor import Fornecedor
from PyQt5 import QtCore, QtGui
from PyQt5.Q... |
felipezago/ControleEstoque | Controller/login.py | <reponame>felipezago/ControleEstoque
from PyQt5 import QtGui
from PyQt5.QtWidgets import QMainWindow, QApplication
from Funcoes.utils import centralizar
class Login(QMainWindow):
def __init__(self, parent=None):
super(Login, self).__init__(parent)
from View import login
from Model.Usuario ... |
felipezago/ControleEstoque | Model/Fornecedor.py | from Funcoes.banco import conexao
from Model.Endereco import Endereco
class Fornecedor(Endereco):
def __init__(self, id_forn="", nome="", cnpj="", email="", fone=""):
super().__init__()
self.id = id_forn
self.nome = nome
self.cnpj = cnpj
self.email = email
self.fone... |
felipezago/ControleEstoque | Controller/lista_fornecedores.py | <reponame>felipezago/ControleEstoque
from PyQt5.QtWidgets import QMessageBox, QTableWidgetItem, QMainWindow
from PyQt5.QtCore import Qt
from Model.Fornecedor import Fornecedor
from PyQt5 import QtCore, QtGui
from Funcoes.utils import formatar_cnpj, retirar_formatacao
class EventFilter(QtCore.QObject):
def __init... |
felipezago/ControleEstoque | Model/Servicos.py | from Funcoes.banco import conexao
class Servicos:
def __init__(self, serv_id="", descricao="", preco=""):
self.id = serv_id
self.descricao = descricao
self.preco = preco
def get_servico_by_id(self):
conn = conexao()
cur = conn.cursor()
cur.execute(f'SELECT * FR... |
felipezago/ControleEstoque | View/cadastro_produtos.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\UI\cadastro_produtos.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 impo... |
felipezago/ControleEstoque | main.py | <filename>main.py<gh_stars>0
if __name__ == '__main__':
from Model.Operador import Operador
from Funcoes.configdb import Banco
import sys
from PyQt5.QtWidgets import QApplication
from Funcoes.criar_tabelas import create_tables
from Controller.tela_principal import exec_main
from Controller.l... |
felipezago/ControleEstoque | View/lista_servicos.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'lista_servicos.ui'
#
# Created by: PyQt5 View code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Frame(object):
def setupUi(self, Frame):
Frame.s... |
felipezago/ControleEstoque | Funcoes/exceptions.py | <filename>Funcoes/exceptions.py
from psycopg2 import OperationalError
class OperationalError(OperationalError):
pass
|
ryadav88/LearningPython | 02_Rename_Files.py | <reponame>ryadav88/LearningPython
import os
# remove numbers in the filenames of all the files in a folder
def rename_files():
# Get filenames from a given folder
file_list = os.listdir(r"/Users/path_to_file/prank")
print (file_list)
saved_path = os.getcwd()
print (saved_path)
os.chdir(r"/Use... |
ryadav88/LearningPython | 06_Movies/06_01_entertainmentcenter.py | <filename>06_Movies/06_01_entertainmentcenter.py
import media
import fresh_tomatoes
black_mirror = media.Movie("Black Mirror", "A satire on humans and technology", "https://upload.wikimedia.org/wikipedia/en/2/24/BlackMirrorTitleCard.jpg", "https://www.youtube.com/watch?v=jROLrhQkK78")
sherlock_holmes = media.Movie("<... |
ryadav88/LearningPython | 05_Check_profanity.py | import urllib
def read_text():
# open is a built-in function in Python and returns an object of the file type
quotes = open("/Users/path_to_file/movie_quotes.txt")
contents_of_file = quotes.read()
print (contents_of_file)
check_profanity(contents_of_file)
quotes.close()
def check_profanity(... |
ryadav88/LearningPython | 07_Inheritance.py | class Parent():
def __init__(self, last_name, eye_color):
print ("Parent constructor called")
self.last_name = last_name
self.eye_color = eye_color
class Child(Parent):
def __init__(self, last_name, eye_color, number_of_toys):
print ("Child Constructor called")
Parent.... |
ryadav88/LearningPython | 03_MindStorms.py | <reponame>ryadav88/LearningPython<gh_stars>0
import turtle
# Draw a circle out of a square
def draw_square(some_turtle):
for i in range(1, 5):
some_turtle.forward(100)
some_turtle.right(90)
def draw_art():
window = turtle.Screen()
window.bgcolor("red")
# Draw a square
brad = tur... |
ryadav88/LearningPython | 01_TakeABreak.py | import webbrowser
import time
total_breaks = 3
break_count = 0
print ("This program started on "+time.ctime())
while break_count < total_breaks:
time.sleep(10)
webbrowser.open("https://www.youtube.com/watch?v=4-PZqOLUKjM")
break_count += 1 |
aivclab/multicam | setup.py | #from distutils.core import setup, Extension
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
import subprocess
with open("README.md", "r") as fh:
long_description = fh.read()
backend = Extension('multicam.backend',
define_macros = [('HAVE_JPEG',), ('NP... |
aivclab/multicam | multicam/__init__.py | from .multicam import Multicam, Camera, list_cams
from .backend import is_valid_device, get_formats
__all__ = ["Multicam", "Camera", "get_formats", "is_valid_device", "list_cams"]
|
aivclab/multicam | multicam/multicam.py | from .backend import v4l2cam, camsys_read, is_valid_device, get_formats
from pathlib import Path
import numpy as np
__all__ = ["Multicam", "Camera", "list_cams"]
class Camera():
'''
Set up a camera.
Parameters
----------
dev : str, Path or int
Video capture device path or ... |
hwatheod/clobber | clobber.py | # Python 2 only
"""
This code calculates atomic weights for near-alternating Clobber positions. A near-alternating Clobber position
has the form X...Y where X and Y are one of B,W,BB,WW, and ... denotes an alternating sequence of black and white
stones that begins with the opposite color of X and ends with the opposit... |
1davidmichael/sen-grassley-schedule-notifier | schedule_tracker/app.py | <reponame>1davidmichael/sen-grassley-schedule-notifier
import boto3
import os
import requests
from botocore.exceptions import ClientError
from bs4 import BeautifulSoup
from datetime import date
def lambda_handler(event, context):
response = requests.get("https://www.grassley.senate.gov/news/events")
soup = B... |
vasilyakonov/gdpddraft | sorting.py | <gh_stars>0
# -*- coding: utf-8 -*-
import os
import requests
import random
import flask
import shutil
import bs4
import jinja2
import subprocess
import json
from bs4 import BeautifulSoup
"""markup = <div class="object_one"> <h1>Journal For Raw Visual Data</h1>
Praesent efficitur, nibh vitae fringilla scele... |
vasilyakonov/gdpddraft | server.py | # -*- coding: utf-8 -*-
import os
import requests
import random
import flask
import shutil
import bs4
import jinja2
import subprocess
import json
import uuid
import datetime
u = uuid.uuid1()
from bs4 import BeautifulSoup
"""markup = <div class="object_one"> <h1>Journal For Raw Visual Data</h1>
Praesent e... |
HIT-ICES/AL-NER | utils/arg_parser.py | <reponame>HIT-ICES/AL-NER
# Python Standard Modules
import argparse
import os
def get_pipeline_arg_parser(epilog):
argparser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog, conflict_handler='resolve')
# Common options for all pipelines
argparser.add_argument... |
HIT-ICES/AL-NER | modules/data_preprocess/data_loader.py | from .DataPool import DataPool
import os
import numpy as np
class Preprocessor(object):
def __init__(self, vocab, tags):
self.vocab = vocab
self.vocab.insert(0, "[PAD]")
if '[CLS]' not in self.vocab:
self.vocab.append('[CLS]')
if '[SEP]' not in self.vocab:
se... |
HIT-ICES/AL-NER | utils/logger.py | # Python Standard Modules
import time
import logging.config
import os.path
from colorama import Fore, Style
class Logger(object):
def __init__(self, logger_name=__name__, config=None):
"""
Configure log through LOGGING_DIC
it supports printing to terminals and files
"""
st... |
HIT-ICES/AL-NER | utils/utils.py | # Python Standard Modules
import os
def create_dir_if_not_exits(dir_path, logger):
"""
confirm whether dir_path is a directory
If it is a file, an error is reported.
If the directory does not exist, create a new one
:param dir_path
:param logger
"""
if os.path.exists(dir_path):
... |
HIT-ICES/AL-NER | pipelines/Word2VecBiLSTMCRFALPipeline.py | import os
import sys
sys.path.append("..")
import torch
import pickle
import numpy as np
from tqdm import tqdm
from torch.utils.data import TensorDataset, DataLoader
import torch.optim as optim
# AL-NER-DEMO Modules
from utils.logger import Logger
from utils.utils import vec_to_tags
from core.pipeline import Pipeline... |
HIT-ICES/AL-NER | modules/assessment/sample_metrics.py | <reponame>HIT-ICES/AL-NER<gh_stars>10-100
import numpy as np
from utils.utils import tagseq_to_entityseq
class SampleMetrics(object):
@classmethod
def _reading_cost(cls, selected_samples: list) -> float:
"""
calculate average reading cost of selected samples
"""
avg_reading_cos... |
HIT-ICES/AL-NER | modules/model_train/Model.py | import torch.nn as nn
class Model(object):
def __init__(self, model: nn.Module):
self.model = model
def train(self, config_file, x=None, y=None):
pass
def evaluate(self, config_file, x=None, y=None):
pass
def predict(self, config_file, x=None):
pass |
HIT-ICES/AL-NER | modules/select_strategy/ALStrategy.py | from typing import List
import numpy as np
from abc import ABCMeta, abstractmethod
class ActiveLearningStrategy(metaclass=ABCMeta):
@classmethod
@abstractmethod
def select_idx(cls, choices_number: int, probs: np.ndarray = None, scores: np.ndarray = None,
best_path: List[List[int]] = No... |
HIT-ICES/AL-NER | test/DataPoolTest.py | import unittest
import numpy as np
import random
from modules.data_preprocess.DataPool import DataPool
class DataPoolTestCase(unittest.TestCase):
def setUp(self) -> None:
self.annotated_texts = [''.join(random.choices(list("abcdefghijklmn"), k=10)) for i in range(10)]
self.annotated_labels = [rand... |
HIT-ICES/AL-NER | modules/model_train/bilstm_crf.py | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from .crf import CRF
class BiLSTMCRF(nn.Module):
def __init__(self, vocab_size, tag_to_ix, embedding_dim, hidden_dim, pre_word_embed=None, num_rnn_layers=1):
super(BiLSTMCRF, self).__init__()
... |
HIT-ICES/AL-NER | modules/data_preprocess/Reports.py | <reponame>HIT-ICES/AL-NER
from typing import Callable, Any
import pandas as pd
class DatasetStatistics(dict):
def statistics(self, texts, labels, func: Callable[[Any, Any], dict]) -> None:
pass
|
HIT-ICES/AL-NER | core/pipeline.py | import os
import re
import sys
import textwrap
import datetime
sys.path.append("..")
# AL-NER-DEMO Modules
from core.config import Config
from core.task import Task
from utils.logger import Logger
from utils.arg_parser import get_pipeline_arg_parser
class Pipeline(object):
"""
Pipeline
==================... |
HIT-ICES/AL-NER | core/task.py | <reponame>HIT-ICES/AL-NER
import re
class Task:
def __init__(self, task_def, logger):
task_name = task_def.__name__
if re.search("^[a-zA-Z]\w+$", task_name):
self._name = task_name
else:
error_tips = f"[task.py]--[ERROR]: task name \" {task_name} \" is invalid (shou... |
HIT-ICES/AL-NER | modules/model_train/train_bilstm.py | <filename>modules/model_train/train_bilstm.py
import sys
sys.path.append("../..")
import os
import torch
import pickle
import numpy as np
from tqdm import tqdm
import torch.optim as optim
from torch.utils.data import TensorDataset, DataLoader
from modules.model_train.bilstm_crf import BiLSTMCRF
from modules.data_prepr... |
HIT-ICES/AL-NER | core/config.py | import os
import configparser
class Config(configparser.SafeConfigParser):
def __init__(self):
configparser.SafeConfigParser.__init__(self)
def parse_files(self, config_files):
"""
Parse configuration file
:params config_files:
"""
self.optionxform = st... |
HIT-ICES/AL-NER | test/evalindexTest.py | import sys
sys.path.append("..")
import unittest
from modules.assessment.eval_index import EvaluationIndex
from utils.logger import Logger
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
self.evaluator = EvaluationIndex(Logger(__name__))
def test_sentence_level_accuracy(self):
... |
HIT-ICES/AL-NER | modules/data_preprocess/DataPool.py | <filename>modules/data_preprocess/DataPool.py
import numpy as np
from typing import Tuple
class DataPool(object):
"""
DataPool is used to store all datas, including annotated and unannotated data.
DataPool also provide a unified data acquisition interface.
"""
def __init__(self, annotated_texts: ... |
HIT-ICES/AL-NER | modules/assessment/eval_index.py | <gh_stars>10-100
import sys
sys.path.append("../..")
from seqeval import metrics as entity_metrics
from sklearn import metrics as sk_metrics
# AL-NER-DEMO Modules
from utils.logger import Logger
from utils.utils import flatten_lists
class EvaluationIndex(object):
def __init__(self, logger):
self.logger... |
splunk-soar-connectors/phishlabs | phishlabs_consts.py | # File: phishlabs_consts.py
#
# Copyright (c) 2018-2022 Splunk Inc.
#
# 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 a... |
rashmigottipati/POC-Phase2-Plugins | test.py | import sys
import argparse
import json
import os
class PluginRequest(json.JSONDecoder):
def __init__(self):
self.command = ''
self.args = []
self.universe = {}
def decode(self, s):
dct = json.loads(s)
if 'command' in dct:
self.command = dct['command']
self.args = dct['args']
... |
sipg-isr/smartbike-vbrac | RiskPerception/Objects.py | <reponame>sipg-isr/smartbike-vbrac
#!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "mncosta(at)isr(dot)tecnico(dot)ulisboa(dot)pt"
from __future__ import print_function
import numpy as np
import os
from timeit import default_timer as timer
from RiskPerception.CONFIG import OBJECT_MINIMUM_SCORE
def readObjec... |
sipg-isr/smartbike-vbrac | RiskPerception/FocusOfExpansion.py | #!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "mncosta(at)isr(dot)tecnico(dot)ulisboa(dot)pt"
import numpy as np
from sklearn.linear_model import HuberRegressor
import math
from random import randint
import cvxopt as cvx
from RiskPerception.OpticalFlow import getWeightFromOFDistance, calcDistance
from RiskP... |
sipg-isr/smartbike-vbrac | RiskPerception/OpticalFlow.py | #!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "mncosta(at)isr(dot)tecnico(dot)ulisboa(dot)pt"
from __future__ import print_function
import cv2
import numpy as np
import math
import argparse
import json
from RiskPerception.CONFIG import CLAHE_clipLimit, \
CLAHE_tileGridSize,\
... |
sipg-isr/smartbike-vbrac | RiskPerception/RiskClassifier.py | #!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "mncosta(at)isr(dot)tecnico(dot)ulisboa(dot)pt"
from __future__ import print_function
import numpy as np
import os
import cv2
from timeit import default_timer as timer
from pyemd import emd
from RiskPerception.CONFIG import DISTANCE_MATRIX_PATH_OCCUPATION,\
... |
sipg-isr/smartbike-vbrac | RiskPerception/CONFIG.py | #!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "mncosta(at)isr(dot)tecnico(dot)ulisboa(dot)pt"
import numpy as np
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# General
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #... |
sipg-isr/smartbike-vbrac | RiskPerception/PerceptionOfRisk.py | from __future__ import print_function
import argparse
import cv2
import sys
import numpy as np
import os
import json
import subprocess
import re
from timeit import default_timer as timer
from RiskPerception.Objects import readObjectsCSV
from RiskPerception.RiskClassifier import train_classifier,\
... |
dcap0/anemone-monitor | anemone-monitor.py | <filename>anemone-monitor.py
#!/bin/python3
import subprocess
import discord
from discord.ext import commands
ane = commands.Bot(command_prefix="Ane:")
@ane.command("cpustats")
async def cpustats(ctx):
stats = subprocess.check_output(['mpstat','-P','ALL'], universal_newlines=True)
await ctx.send(stats)
@ane... |
UCU-programming-tasks/puzzle_command_line_project | puzzle.py | """Python module for validating a board of symbols.
Functions
---------
add_cell - add cell to a set of visited set
validate_corner - check if a given corner is valid
validate_column - check if a given column is valid
validate_row - check if a given row is valid
validate... |
Sl0v3C/PYtools | compound_interest/compound_interest.py | # encoding:utf-8
#!/usr/bin/python3
def cal(base, year, rate):
return float(base * ((1.0 + rate) ** year))
def calAll(base, year, rate):
if (year == 1):
return cal(base, 1, rate)
else:
return cal(base, year, rate) + calAll(base, year - 1, rate)
YEAR = [6, 10, 15, 20, 25, 30, 35, 40, 45, 5... |
Sl0v3C/PYtools | get_excel_data/get_excel_data.py | # encoding: utf-8
# coding: utf-8
"""
Dump excel file to excel_data_Sheet1, ...
excel_data_Sheet1 will contains the data which in Sheet1, and split by "\t"
So you can just copy then into another excel file, it will keep the original format.
"""
from pyexcel_xls import get_data
import sys
reload(sys)
sys.setdefaultencod... |
Sl0v3C/PYtools | compound_interest/pingan_pension_schema.py | <reponame>Sl0v3C/PYtools
# coding:utf-8
# !/usr/bin/python3
def cal_month(base, rate):
return float(base * (1.0 + rate))
def cal(base, year, rate):
return float(base * ((1.0 + rate) ** year))
def cal_all(base, year, rate):
if year == 1:
return cal(base, 1, rate)
else:
return cal(ba... |
maftkd/BonJournal | bonjournal.py | import sys
import os
from datetime import date
from datetime import datetime
import glob
import shutil
from threading import Thread
fg_colors = ["\033[30m","\033[31m","\033[32m","\033[33m","\033[34m","\033[35m","\033[36m","\033[37m"]
fg_color = fg_colors[7];
bg_colors = ["\033[40m","\033[41m","\033[42m","\033[43m","\0... |
pvgupta24/inout | speakInOut/generateQuestions/nlpNER.py | import spacy
def nerTagger(nlp, tokenize):
doc = nlp(tokenize)
finalList = []
array = [[]]
for word in doc:
array[0] = 0
for ner in doc.ents:
if (ner.text == word.text):
finalList.append((word.text, ner.label_))
array[0] = 1
... |
pvgupta24/inout | fillerWordAnalyzer/analyze_text.py |
import sys
import os
from filler_words import filler_words
def read_file(filename):
''' Takes in a file name and reads it in as a list of words
'''
with open(filename, 'r') as f:
return f.read().lower().split()
def filler_percentage(segments, filler=[]):
''' Takes in a list of segments and an... |
pvgupta24/inout | speakInOut/eyeTrack/track.py | <gh_stars>0
import cv2
from .gaze_tracking import GazeTracking
def analyzeFrames(videoPath=0):
gaze = GazeTracking()
video_stream = cv2.VideoCapture(videoPath)
frame_count = 0
looking_down = 0
while True:
# We get a new frame from the video_stream
frame_captured, frame = video... |
pvgupta24/inout | speakInOut/generateQuestions/aqgFunction.py | <filename>speakInOut/generateQuestions/aqgFunction.py
import spacy
from .clause import *
from .nonClause import *
from .identification import *
from .questionValidation import *
from .nlpNER import nerTagger
class AutomaticQuestionGenerator():
# AQG Parsing & Generate a question
def aqgParse(self, s... |
pvgupta24/inout | speakInOut/autho/models.py | from django.db import models
from django.contrib.auth.models import User
from uuid import uuid4
import slugify
def generateUUID():
return str(uuid4())
class Speech(models.Model):
name = models.CharField(blank=True, max_length=50, unique=True)
slug = models.SlugField(unique=True, default=generateUUID)
user = ... |
pvgupta24/inout | speakInOut/autho/urls.py | <reponame>pvgupta24/inout
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
from . import views, views_dashboard
app_name = 'auth'
urlpatterns = [
path('login/', views.login_view, name='index'),
path('setup/', views.setup_view, name='setup'),
path('register/',... |
pvgupta24/inout | speakInOut/autho/views.py | <reponame>pvgupta24/inout<gh_stars>0
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from speakInOut.helper import parse_session, authentication_check, register_user
from .forms impor... |
pvgupta24/inout | speakInOut/generateQuestions/main.py | <gh_stars>0
from .aqgFunction import *
# Main Function
def getAnswers(inputText):
# Create AQG object
aqg = AutomaticQuestionGenerator()
# inputTextPath = "/Users/anumehaagrawal/Documents/Hacks/InOut/sample.txt"
# readFile = open(inputTextPath, 'r+', encoding="utf8")
# #readFile = open(... |
pvgupta24/inout | speakInOut/autho/apps.py | <reponame>pvgupta24/inout
from django.apps import AppConfig
class AuthoConfig(AppConfig):
name = 'autho'
|
pvgupta24/inout | speakInOut/autho/views_dashboard.py | from django.shortcuts import render
from django.http import HttpResponseRedirect, JsonResponse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from speakInOut.helper import parse_session, authentication_check, register_user
from .forms import LoginForm, AccountReg... |
pvgupta24/inout | speakInOut/autho/templatetags/app_filters.py | <gh_stars>0
from django import template
register = template.Library()
@register.filter(name='isAuthenticated')
def isAuthenticated(user):
return user.is_authenticated |
pvgupta24/inout | speakInOut/autho/forms.py | from datetime import date
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
def validate_username_available(username):
""" validator that throws an error if the given username already exists."""
if User.objects.filter(username__icontains=userna... |
pvgupta24/inout | speakInOut/fillerWordAnalyzer/filler_words.py | <reponame>pvgupta24/inout
filler_words = [
"absolutely",
"actual",
"actually",
"amazing",
"anyway",
"apparently",
"approximately",
"badly",
"basically",
"begin",
"certainly",
"clearly",
"completely",
"definitely",
"easily",
"effectively",
"entirely",
"especially",
"essentially",
... |
pvgupta24/inout | speakInOut/textCompare.py | import paralleldots
import azure.cognitiveservices.speech as speechsdk
from generateQuestions import main
import os
from dotenv import load_dotenv
load_dotenv()
#import configparser
# Semantic similarity of two texts
def compareTranscripts(text1, text2):
API_KEY = os.getenv('TRANSCRIPT_API')
paralleldots.set_... |
pvgupta24/inout | speakInOut/speakInOut/helper.py | <filename>speakInOut/speakInOut/helper.py
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
import datetime
def parse_session(request, template_data=None):
"""
Checks the session f... |
serdtsekol1/django-modeltranslation | modeltranslation/tests/urls.py | <reponame>serdtsekol1/django-modeltranslation
# -*- coding: utf-8 -*-
try:
from django.conf.urls import include, patterns, url
# Workaround for pyflakes issue #13
assert (include, patterns, url) # noqa
except ImportError: # Django 1.3 fallback
from django.conf.urls.defaults import include, patterns, ... |
serdtsekol1/django-modeltranslation | modeltranslation/tests/tests.py | <reponame>serdtsekol1/django-modeltranslation
# -*- coding: utf-8 -*-
from decimal import Decimal
from unittest import skipUnless
import datetime
import fnmatch
import imp
import io
import os
import shutil
import django
import six
from django import forms
from django.conf import settings as django_settings
from django... |
serdtsekol1/django-modeltranslation | modeltranslation/tests/settings.py | <filename>modeltranslation/tests/settings.py
# -*- coding: utf-8 -*-
"""
Settings overrided for test time
"""
from django.conf import settings
INSTALLED_APPS = tuple(settings.INSTALLED_APPS) + ('modeltranslation.tests',)
LANGUAGES = (('de', 'Deutsch'), ('en', 'English'))
LANGUAGE_CODE = 'de'
MODELTRANSLATION_DEFAULT... |
serdtsekol1/django-modeltranslation | modeltranslation/decorators.py | def register(model_or_iterable, **options):
"""
Registers the given model(s) with the given translation options.
The model(s) should be Model classes, not instances.
Fields declared for translation on a base class are inherited by
subclasses. If the model or one of its subclasses is already
re... |
serdtsekol1/django-modeltranslation | modeltranslation/translator.py | <filename>modeltranslation/translator.py
# -*- coding: utf-8 -*-
from functools import partial
import django
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Manager, ForeignKey, OneToOneField, options
from django.db.models.base import ModelBase
from django.db.models.signals import ... |
serdtsekol1/django-modeltranslation | modeltranslation/utils.py | <filename>modeltranslation/utils.py
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import six
from django.utils.encoding import force_str
from django.utils.translation import get_language as _get_language
from django.utils.translation import get_language_info
from django.utils.functional import lazy
fr... |
serdtsekol1/django-modeltranslation | runtests.py | <filename>runtests.py
#!/usr/bin/env python
import os
import sys
import warnings
from optparse import OptionParser
import django
from django.conf import settings
from django.core.management import call_command
def runtests(test_path='modeltranslation'):
if not settings.configured:
# Choose database for s... |
ika-rwth-aachen/RoadGeneration | test/cmp.py | <filename>test/cmp.py
#!/usr/bin/python
import sys
import xml.etree.ElementTree as ET
threshold = 0.0001
print("testing with", threshold, "margin..\n" )
def tree_to_list(tree):
x = []
return parse_tree_to_list(tree, x)
def parse_tree_to_list(tree, x):
x.append(tree.tag)
elem = tree.attrib
for ... |
ika-rwth-aachen/RoadGeneration | variation/variation/runner.py | <reponame>ika-rwth-aachen/RoadGeneration
import numpy as np
import numexpr as ne
import argparse
import re
import xml.etree.ElementTree as ET
import copy
import os
import glob
import shutil
from variation import dependencySolver as ds
from ctypes import *
args = None #global args object
def is_var(arg... |
ika-rwth-aachen/RoadGeneration | variation/variation/dependencySolver.py | <filename>variation/variation/dependencySolver.py
import sympy as sy
def getVarLists(varDict, n):
"""This function returns a list containing lists that can be used for the solve method
Parameters
----------
varDict : dict
a dict that contains all variables that need to be generated for all n r... |
ika-rwth-aachen/RoadGeneration | variation/setup.py | <reponame>ika-rwth-aachen/RoadGeneration
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="roadvariation",
version="0.1",
author="<NAME>",
author_email="<EMAIL>",
description="Vary logical road network input format",
long_d... |
ika-rwth-aachen/RoadGeneration | variation/variation/__main__.py | <gh_stars>0
from variation import runner
# main function that runs the whole road network variation
if __name__ == '__main__':
runner.run()
|
silentsignal/eazfuscator.net-symbol-decrypter | deobf.py | <gh_stars>10-100
#!/usr/bin/env python
from base64 import b64decode
from contextlib import closing
from mmap import mmap, ACCESS_READ
import re
from Crypto.Cipher import AES
from Crypto.Util.strxor import strxor
from pbkdf2 import PBKDF2
PWD = '<PASSWORD>'
IV = PBKDF2(PWD, b64decode('HIgb2FOTjM88mSlrdaQlnV7pMzCSbH+... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.