repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
Paul-Verardi/nipyapi
nipyapi/registry/__init__.py
# coding: utf-8 """ NiFi Registry REST API The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components. OpenAPI spec version: 0.2.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future_...
Paul-Verardi/nipyapi
nipyapi/nifi/models/search_results_dto.py
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
Paul-Verardi/nipyapi
nipyapi/nifi/models/bulletin_entity.py
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
Paul-Verardi/nipyapi
nipyapi/nifi/models/status_history_dto.py
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
Paul-Verardi/nipyapi
nipyapi/nifi/models/versioned_remote_process_group.py
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
Paul-Verardi/nipyapi
nipyapi/nifi/models/controller_dto.py
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
Paul-Verardi/nipyapi
nipyapi/nifi/models/system_diagnostics_snapshot_dto.py
# coding: utf-8 """ NiFi Rest Api The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ...
arsalhuda24/pedestrian-data-visualization
test.py
<gh_stars>0 from toolkit.loaders.loader_sdd import load_sdd, load_sdd_dir import os, yaml from toolkit.loaders.loader_sdd import load_sdd, load_sdd_dir scene_name = 'quad' scene_video_id = 'video3' # fixme: replace OPENTRAJ_ROOT with the address to root folder of OpenTraj sdd_root = os.path.join("/home/asyed/OpenTraj...
mastersign/prochestra
prochestra/__main__.py
<gh_stars>0 from . import command_line exit(command_line())
mastersign/prochestra
prochestra/__init__.py
import subprocess import datetime import os import argparse import json import shlex import yaml __version__ = "1.1.2" class Prochestra(object): def __init__(self, log=None, log_prefix="PROCHESTRA ", silent=False): self.log_file = log self.log_prefix = log_prefix self.silent = silent ...
mastersign/prochestra
setup.py
#!/usr/bin/env python import re from setuptools import setup import fastentrypoints with open('prochestra/__init__.py') as source_file: source_text = source_file.read() version = re.compile(r'^__version__\s*=\s*"(.*)"', re.M).search(source_text).group(1) setup(name='Prochestra', packages=['prochestra'], ...
mastersign/prochestra
bin/prochestra-cli.py
#!/usr/bin/env python import os import sys source_path = os.path.join(os.path.dirname(__file__), '..') sys.path.append(source_path) if __name__ == '__main__': from prochestra import command_line exit(command_line())
rexgamer945/instagram-bot
instabot.py
bot = InstaBot('login', 'password', like_per_day=1000, more_than_likes=10, tag_list = ['love', 'coding', 'dev'], max_like_for_one_tag=5, log_mod = 0)
aaronamk/my-purchase.online
purchase.py
#!/usr/bin/python import sys import pyrebase from getpass import getpass config = { "apiKey": "<KEY>", "authDomain": "my-purchases-bb5f8.firebaseapp.com", "databaseURL": "https://my-purchases-bb5f8.firebaseio.com", "storageBucket": "my-purchases-bb5f8.appspot.com", "serviceAccount": "my-purchases-bb5f8-firebase-...
oasys/checkov
checkov/common/util/docs_generator.py
<gh_stars>0 #!/usr/bin/env python import re from tabulate import tabulate from checkov.arm.registry import arm_registry from checkov.cloudformation.checks.resource.registry import cfn_registry as cfn_registry from checkov.kubernetes.registry import registry as k8_registry from checkov.serverless.registry import sls_...
oasys/checkov
checkov/version.py
<reponame>oasys/checkov version = '1.0.514'
oasys/checkov
checkov/terraform/checks/resource/aws/LaunchConfigurationEBSEncryption.py
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck class LaunchConfigurationEBSEncryption(BaseResourceValueCheck): def __init__(self): name = "Ensure all data stored in the Launch configuration...
Thigos/Detector-de-Carros-OpenCV
Driver.py
<filename>Driver.py import os import cv2 import pyautogui import mahotas #Local do video video_original = cv2.VideoCapture('teste.wmv') #O local aonde os arquivos estão diret = os.path.dirname(os.path.abspath(__file__)) while True: #Frame do video ret, frame = video_original.read() #Converte para escala...
SBonnietheoneandonly/MalaBot
thesaurus.py
import random _words = { 'moved to': [ 'teleported to', 'slinked away to', 'sneaked to', 'hopped to', 'ran away to' ], 'Hello': [ 'Hello', 'Bonjour', 'Hola', 'Zdravstvuyte', 'Nǐn hǎo', 'Salve', 'Konnichiwa', ...
SBonnietheoneandonly/MalaBot
main.py
import os import discord from dotenv import load_dotenv from thesaurus import get_synonym from tts import text_to_pcm from io import BytesIO load_dotenv() TOKEN = os.getenv('TOKEN') client = discord.Client() voice_client = None message_queue = [] def after_play_finished(err): # If another message has been queued...
SBonnietheoneandonly/MalaBot
tts.py
<reponame>SBonnietheoneandonly/MalaBot<filename>tts.py from dotenv import load_dotenv from google.cloud import texttospeech load_dotenv() client = texttospeech.TextToSpeechClient() voice = texttospeech.VoiceSelectionParams(language_code="en-GB", name="en-GB-Wavenet-F") # NO...
bscott711/LLSpy
tests/test_gui.py
<gh_stars>0 import os from llspy.gui.mainwindow import main_GUI from PyQt5 import QtWidgets, QtCore from pytestqt import qtbot from llspy.llsdir import LLSdir def test_basic_processing(qtbot): testdata = os.path.join(os.path.dirname(__file__), 'testdata', 'sample') LLSdir(testdata).reduce_to_raw(keepmip=False...
bscott711/LLSpy
llspy/gui/watcher.py
import fnmatch import logging import os import os.path as osp import time import numpy as np from PyQt5 import QtCore import llspy from llspy.gui import workers from llspy.gui.helpers import ( newWorkerThread, shortname, wait_for_file_close, wait_for_folder_finished, ) _watchdog = False ActiveWatcher...
bscott711/LLSpy
llspy/otf.py
<gh_stars>0 from .exceptions import OTFError from .util import load_lib from datetime import datetime, timedelta import numpy as np import re import ctypes import os import logging logger = logging.getLogger(__name__) try: import pathlib as plib plib.Path() except (ImportError, AttributeError): import ...
bscott711/LLSpy
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from codecs import open from os import path import sys with open('llspy/version.py') as f: exec(f.read()) INCLUDELIBS = False HERE = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(HERE, '...
bscott711/LLSpy
llspy/gui/mainwindow.py
<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import division, print_function import json import logging import os import os.path as osp import numpy as np from PyQt5 import QtCore, QtGui from PyQt5 import QtWidgets as QtW import llspy import llspy.gui.exceptions as err from fiducialreg.fiduc...
xugangwu95/stellargraph
demos/link-prediction/random-walks/utils/cl_arguments_parser.py
<reponame>xugangwu95/stellargraph # -*- coding: utf-8 -*- # # Copyright 2017-2018 Data61, CSIRO # # 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 ...
xugangwu95/stellargraph
tests/mapper/test_directed_node_generator.py
# -*- coding: utf-8 -*- # # Copyright 2017-2019 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
xugangwu95/stellargraph
stellargraph/version.py
<reponame>xugangwu95/stellargraph # Global version information __version__ = "0.9.0b"
xugangwu95/stellargraph
tests/core/test_utils.py
<reponame>xugangwu95/stellargraph # -*- coding: utf-8 -*- # # Copyright 2018-2019 Data61, CSIROß # # 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...
xugangwu95/stellargraph
stellargraph/globalvar.py
# This file contains global attributes used throughout stellargraph FEATURE_ATTR_NAME = "feature" TARGET_ATTR_NAME = "target" TYPE_ATTR_NAME = "label" UNKNOWN_TARGET_ATTRIBUTE = "-1" NODE_TYPE_DEFAULT = "default" EDGE_TYPE_DEFAULT = "default"
xugangwu95/stellargraph
tests/layer/test_ppnp.py
<reponame>xugangwu95/stellargraph from stellargraph.layer import PPNP from stellargraph.mapper import FullBatchNodeGenerator from stellargraph import StellarGraph from stellargraph.core.utils import PPNP_Aadj_feats_op import networkx as nx import pandas as pd import numpy as np from tensorflow import keras import pyte...
xugangwu95/stellargraph
tests/mapper/test_link_mappers.py
# -*- coding: utf-8 -*- # # Copyright 2018 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
xugangwu95/stellargraph
demos/link-prediction/hinsage/utils.py
# -*- coding: utf-8 -*- # # Copyright 2018 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
xugangwu95/stellargraph
stellargraph/layer/ppnp.py
<filename>stellargraph/layer/ppnp.py<gh_stars>1-10 from tensorflow.keras.layers import Dense, Lambda, Layer, Dropout, Input import tensorflow.keras.backend as K import tensorflow as tf import numpy as np from .misc import SqueezedSparseConversion from ..mapper import FullBatchNodeGenerator from .preprocessing_layer im...
xugangwu95/stellargraph
demos/link-prediction/random-walks/utils/metapath2vec_feature_learning.py
# -*- coding: utf-8 -*- # # Copyright 2017-2018 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
xugangwu95/stellargraph
stellargraph/layer/hinsage.py
# -*- coding: utf-8 -*- # # Copyright 2018 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
pletzer/crush
sum_forces.py
<filename>sum_forces.py import vtk from argparse import ArgumentParser from glob import glob import numpy import os.path def main(vtk_file_patterns): for filename in glob(vtk_file_patterns): print(f'file: {filename}') reader = vtk.vtkPolyDataReader() reader.SetFileName(filename) ...
devangi2000/coding-concepts
Coding Questions with Solutions/arrayAsHill.py
<gh_stars>0 /* Array of integers is a hill, if: it is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The first block (increasing) and the last block (decreasing) may be absent. It is allowed that both of this blocks are absent. For example, the following t...
Maddin-619/dotfiles
.config/qtile/config.py
<gh_stars>0 # Copyright (c) 2010 <NAME> # Copyright (c) 2010, 2014 dequis # Copyright (c) 2012 <NAME> # Copyright (c) 2012-2014 <NAME> # Copyright (c) 2012 <NAME> # Copyright (c) 2013 horsik # Copyright (c) 2013 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software a...
Maddin-619/dotfiles
.config/qtile/custom_widgets.py
import os import shlex from libqtile.widget import base from typing import Dict # noqa: F401 class Backlight(base.InLoopPollText): """A simple widget to show the current brightness of a monitor""" orientations = base.ORIENTATION_HORIZONTAL defaults = [ ('get_brightness_cmd', "xrandr -...
lukemerrett/PythonPet
Helpers/datehelper.py
__author__ = '<NAME>' from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta def add_seconds_to_date(date, seconds): return date + timedelta(seconds=seconds) def is_date_earlier_than_today(date): return date <= todays_date() def get_difference_as_relative_delta(latest_date...
lukemerrett/PythonPet
PetObjects/pet.py
<filename>PetObjects/pet.py __author__ = '<NAME>' from PetObjects.status import PetStatus from PetObjects.age import Age from PetObjects.bladder import Bladder from PetObjects.hunger import HungerLevel class Pet: Age = None HungerLevel = None Name = None Bladder = None def __init__(self): ...
lukemerrett/PythonPet
pythonpet.py
<reponame>lukemerrett/PythonPet __author__ = '<NAME>' from EnvironmentObjects.environment import Environment from PetObjects.pet import Pet console_options = None environment = None myPet = None def run_option(x): if x in console_options: console_options[x]() else: print("You didn\'t enter an...
lukemerrett/PythonPet
PetObjects/age.py
__author__ = '<NAME>' from random import randint from Helpers import datehelper class Age: __minimum_potential_lifespan_in_seconds = 86400 # 1 day __total_potential_lifespan_in_seconds = 31536000 # 1 year __birth_date = None __lifespan_in_seconds = None def __init__(self): self.__birth_...
lukemerrett/PythonPet
EnvironmentObjects/environment.py
__author__ = '<NAME>' class Environment: __poop_level = None def __init__(self): self.__poop_level = 0 def current_poop_level(self): return self.__poop_level def pet_has_pooped(self): self.__poop_level += 1 def clean_up_poop(self): self.__poop_level = 0
lukemerrett/PythonPet
PetObjects/hunger.py
<gh_stars>0 __author__ = '<NAME>' from Helpers import datehelper class HungerLevel: __seconds_until_hungry = 120 # 2 minutes __last_fed = None __bladder = None def __init__(self, bladder): self.__last_fed = datehelper.todays_date() self.__bladder = bladder def is_hungry(self): ...
lukemerrett/PythonPet
PetObjects/status.py
__author__ = '<NAME>' class PetStatus: has_reached_its_lifespan = None is_hungry = None needs_the_toilet = None name = None def __init__(self, has_reached_its_lifespan, is_hungry, needs_the_toilet, name): self.has_reached_its_lifespan = has_reached_its_lifespan self.is_hungry = is_...
lukemerrett/PythonPet
PetObjects/bladder.py
__author__ = '<NAME>' class Bladder: __bladder_level = None __bursting_level = 5 __environment = None def __init__(self, environment): self.__bladder_level = 0 self.__environment = environment def has_been_fed(self): self.__bladder_level += 1 def needs_the_toilet(sel...
araAxelFT/QRgen
src/main.py
<filename>src/main.py from email.mime import image import tkinter import qrcode from tkinter import * from tkinter import ttk import platform import os from PIL import ImageTk, Image if(platform.system() == "Darwin"): save_path = "../images/" files = os.listdir(save_path) else: save_path = "../...
CoryK8nn8dy/clist-dashboard
post.py
<gh_stars>0 class Post: def __init__(self, title, price, date, time): self.title = title self.price = price self.date = date self.time = time def display(self): print('Title:', self.title) print('Price:', self.price) print('Date:', self.date) prin...
CoryK8nn8dy/clist-dashboard
clist.py
from requests import get from bs4 import BeautifulSoup from post import Post def read_posts(url_filename): posts_file = open(url_filename, "r") post_urls = posts_file.readlines() posts = [] for post_url in post_urls: # remove new line from URL post_url = post_url.rstrip('\n') ...
parroit/editablejqgrid
models/plugin_editable_jqgrid.py
from gluon.storage import Storage class plugin_editable_jqgrid_Description(object): def __init__(self,table_name,field_name): self.table_name=table_name self.field_name=field_name def description(self): try: description=self.__getattribute__(self.table_name)[self.field_name] ...
parroit/editablejqgrid
controllers/plugin_editable_jqgrid.py
<filename>controllers/plugin_editable_jqgrid.py import cgi def contains_html(field): return field.__dict__.has_key('contains_html') and field.contains_html def non_textfield(field): return field.type!="string" and field.type!="text" def call(): """ exposes services. for example: http://..../[app]/...
visr/Py2Jl.jl
ast_to_json.py
<gh_stars>10-100 import ast import typing as t import numbers import json from wisepy.talking import Talking from Redy.Tools.PathLib import Path talking = Talking() def to_dict(node: t.Union[ast.AST, str, numbers.Number, list]): if isinstance(node, complex): return {"class": "complex", "real": node.real,...
Svenskithesource/Streamable-finder
main.py
<reponame>Svenskithesource/Streamable-finder # Made by svenskithesource#2815 import requests, time, random, string, os def find(): with open("streamable_failed.txt", "r") as f: lines = [line.rstrip() for line in f.readlines() if line != "\n"] random_code = "".join(random.choices(string.ascii_lowercas...
ids1024/cannon-bluetooth-remote
remote.py
#!/usr/bin/env python3 import sys from subprocess import Popen, PIPE DEVICE_NAME = "PY" BUTTON_RELEASE = 0b10000000 BUTTON_FOCUS = 0b01000000 BUTTON_TELE = 0b00100000 BUTTON_WIDE = 0b00010000 MODE_IMMEDIATE = 0b00001100 MODE_DELAY = 0b00000100 MODE_MOVIE = 0b00001000 device = sys.argv[1] cmd = sys.a...
rwgardner/reconchess-strangefish
strangefish/strangefish.py
<filename>strangefish/strangefish.py import multiprocessing as mp import os from collections import defaultdict from functools import partial from time import time from tqdm import tqdm from typing import Optional, List, Tuple, Set, Callable import chess.engine from reconchess import Player, Color, GameHistory, WinRea...
rwgardner/reconchess-strangefish
strangefish/strategies/multiprocessing_strategies.py
<gh_stars>1-10 import json import multiprocessing as mp import random from collections import defaultdict from dataclasses import dataclass from time import sleep, time from typing import List, Set, Callable, Tuple import chess.engine import numpy as np from reconchess import Square from tqdm import tqdm from strange...
rwgardner/reconchess-strangefish
strangefish/utilities/modified_rc_connect.py
<reponame>rwgardner/reconchess-strangefish<gh_stars>1-10 import multiprocessing import signal import sys import time import traceback import yaml import click import requests import chess from reconchess import Player, RemoteGame, play_turn, ChessJSONDecoder from reconchess.scripts.rc_connect import RBCServer, ranked_...
rwgardner/reconchess-strangefish
strangefish/strategies/auxiliary_strategies.py
import random def _choose_randomly(_, __, choices, *args, **kwargs): return random.choice(choices) def _do_nothing(*args, **kwargs): pass def random_strategy(): choose_sense = _choose_randomly choose_move = _choose_randomly while_we_wait = _do_nothing end_game = _do_nothing return choo...
rwgardner/reconchess-strangefish
strangefish/utilities/player_logging.py
<filename>strangefish/utilities/player_logging.py<gh_stars>1-10 import logging import sys import os TAGS = [ '\N{four leaf clover}', '\N{skull}', '\N{bacon}', '\N{spouting whale}', '\N{fire}', '\N{eagle}', '\N{smiling face with sunglasses}', '\N{beer mug}', '\N{rocket}', '\N{sna...
rwgardner/reconchess-strangefish
strangefish/utilities/rbc_move_score.py
<reponame>rwgardner/reconchess-strangefish<filename>strangefish/utilities/rbc_move_score.py<gh_stars>1-10 from dataclasses import dataclass import chess.engine from reconchess import is_psuedo_legal_castle from reconchess.utilities import capture_square_of_move from strangefish.utilities import simulate_move @datac...
rwgardner/reconchess-strangefish
strangefish/utilities/timing.py
from time import time class Timer: def __init__(self, log_func, message: str): self.log_func = log_func self.message = message self.start = None def __enter__(self): self.start = time() # self.log_func('Starting ' + self.message) def __exit__(self, exc_type, exc_...
rwgardner/reconchess-strangefish
strangefish/__init__.py
<filename>strangefish/__init__.py from .strangefish import StrangeFish
rwgardner/reconchess-strangefish
strangefish/utilities/stockfish.py
<filename>strangefish/utilities/stockfish.py import os import chess.engine # make sure stockfish environment variable exists if "STOCKFISH_EXECUTABLE" not in os.environ: raise KeyError('This bot requires an environment variable called "STOCKFISH_EXECUTABLE"' ' pointing to the Stockfish executab...
rwgardner/reconchess-strangefish
scripts/example.py
<filename>scripts/example.py import traceback from datetime import datetime import chess from reconchess import LocalGame, play_local_game from reconchess.bots.trout_bot import TroutBot from strangefish import StrangeFish from strangefish.strategies import multiprocessing_strategies def main(): white_bot_name, ...
rwgardner/reconchess-strangefish
strangefish/utilities/__init__.py
from functools import partial from typing import Iterable, Optional, Set from collections import defaultdict from tqdm import tqdm import signal import chess from reconchess.utilities import without_opponent_pieces, is_illegal_castle, is_psuedo_legal_castle, slide_move, \ moves_without_opponent_pieces, pawn_captu...
rwgardner/reconchess-strangefish
strangefish/defaults.py
<gh_stars>1-10 import random def _choose_randomly(_, __, choices, *args, **kwargs): return random.choice(choices) def _do_nothing(*args, **kwargs): pass choose_move = _choose_randomly choose_sense = _choose_randomly while_we_wait = _do_nothing end_game = _do_nothing
rwgardner/reconchess-strangefish
scripts/cache_warmup.py
<gh_stars>1-10 import json from typing import Set from tqdm import tqdm import chess.engine from reconchess.utilities import moves_without_opponent_pieces, pawn_capture_moves_on from strangefish.utilities import stockfish, populate_next_board_set, simulate_move from strangefish.utilities.rbc_move_score import calcula...
moshe742/weight
weight/db/queries.py
<gh_stars>1-10 from datetime import datetime from sqlalchemy import desc from weight.db import SessionScope from weight.db.models import WeightData def get_weight_data(session, id): return session.query(WeightData).filter_by(id=id).first() def get_weights_data(session): return session.query(WeightData).or...
moshe742/weight
weight/home.py
<reponame>moshe742/weight import logging from datetime import date from flask import request, render_template, jsonify, redirect, url_for from weight import app from weight.db import SessionScope from weight.forms import WeightForm from weight.db.queries import ( add_weight_data, edit_weight_data, delete_w...
moshe742/weight
weight/db/models.py
<filename>weight/db/models.py from weight.db import Base from sqlalchemy import Column, Integer, Date, Float class WeightData(Base): __tablename__ = 'weight_data' id = Column(Integer, primary_key=True) date = Column(Date) old_weight = Column(Float) new_weight = Column(Float, nullable=True) d...
moshe742/weight
weight/db/__init__.py
from sqlalchemy import create_engine from sqlalchemy.orm import Session from sqlalchemy.ext.declarative import declarative_base class SessionScope: def __init__(self): pass def __enter__(self): self.session = Session(engine) return self.session def __exit__(self, exc_type, exc_va...
moshe742/weight
weight/forms.py
from flask_wtf import FlaskForm from wtforms import DateField, FloatField, SubmitField from wtforms.validators import DataRequired class WeightForm(FlaskForm): date = DateField('date', validators=[DataRequired()]) old_weight = FloatField('old weight') new_weight = FloatField('new weight') submit = Sub...
moshe742/weight
weight/db/create_db.py
<gh_stars>1-10 import os from weight.db import Base, engine from weight.db.models import WeightData Base.metadata.create_all(engine) BASE_PATH = os.path.dirname(os.path.abspath(__file__)) # from alembic.config import Config # from alembic import command # alembic_cfg = Config(f"{BASE_PATH}/alembic.ini") # command....
DivinaThomas/dropBoxReplica_CloudComputing
sharefile.py
import webapp2 import jinja2 from google.appengine.api import users from google.appengine.ext import ndb import os from user import User from directory import Directory import random JINJA_ENVIRONMENT = jinja2.Environment( loader = jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions = ['jinja2.ext.autoes...
DivinaThomas/dropBoxReplica_CloudComputing
main.py
<gh_stars>0 import webapp2 import jinja2 from google.appengine.api import users from google.appengine.ext import ndb import os from user import User from directory import Directory JINJA_ENVIRONMENT = jinja2.Environment( loader = jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions = ['jinja2.ext.autoesc...
DivinaThomas/dropBoxReplica_CloudComputing
restore.py
<reponame>DivinaThomas/dropBoxReplica_CloudComputing from google.appengine.ext import ndb class Restore(ndb.Model): user = ndb.StringProperty() file_name = ndb.StringProperty() blob_key = ndb.BlobKeyProperty()
DivinaThomas/dropBoxReplica_CloudComputing
user.py
from google.appengine.ext import ndb from directory import Directory class User(ndb.Model): email = ndb.StringProperty() #directory_info = ndb.StructuredProperty(Directory, repeated=True)
DivinaThomas/dropBoxReplica_CloudComputing
uploadfilehandler.py
from google.appengine.ext import blobstore from google.appengine.ext import ndb from google.appengine.ext.webapp import blobstore_handlers from directory import Directory import webapp2 import jinja2 import os from google.appengine.api import users JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader...
DivinaThomas/dropBoxReplica_CloudComputing
restorefile.py
import webapp2 import jinja2 import os from google.appengine.ext import ndb from google.appengine.ext import blobstore from directory import Directory from uploadfilehandler import UploadFileHandler from directory import Directory from restore import Restore from google.appengine.api import users import random from dow...
DivinaThomas/dropBoxReplica_CloudComputing
login.py
import webapp2 import jinja2 from google.appengine.api import users from google.appengine.ext import ndb import os from user import User from main import Main from adddirectory import AddDirectory from deletedirectory import DeleteDirectory from uploadfilehandler import UploadFileHandler from addfile import AddFile fro...
DivinaThomas/dropBoxReplica_CloudComputing
addfile.py
import webapp2 import jinja2 import os from google.appengine.ext import ndb from google.appengine.ext import blobstore from google.appengine.api import users from directory import Directory from uploadfilehandler import UploadFileHandler from directory import Directory import random from downloadfilehandler import Down...
DivinaThomas/dropBoxReplica_CloudComputing
downloadfilehandler.py
import webapp2 import jinja2 from google.appengine.ext import ndb from google.appengine.ext import blobstore from google.appengine.ext.webapp import blobstore_handlers from directory import Directory class DownloadFileHandler(blobstore_handlers.BlobstoreDownloadHandler): def post(self): self.response.headers['Conten...
DivinaThomas/dropBoxReplica_CloudComputing
sharedfiles.py
<gh_stars>0 import webapp2 import jinja2 from google.appengine.api import users from google.appengine.ext import ndb import os from user import User from directory import Directory JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.autoes...
DivinaThomas/dropBoxReplica_CloudComputing
deletefile.py
import webapp2 import jinja2 import os from google.appengine.ext import ndb from google.appengine.ext import blobstore from directory import Directory from google.appengine.api import users from uploadfilehandler import UploadFileHandler from directory import Directory import random from downloadfilehandler import Down...
DivinaThomas/dropBoxReplica_CloudComputing
directory.py
<reponame>DivinaThomas/dropBoxReplica_CloudComputing from google.appengine.ext import ndb class Directory(ndb.Model): prev_directory = ndb.StringProperty() directory_name = ndb.StringProperty() directory_path = ndb.StringProperty() list_of_directories = ndb.StringProperty(repeated=True) list_of_files = ndb.Strin...
DivinaThomas/dropBoxReplica_CloudComputing
adddirectory.py
<reponame>DivinaThomas/dropBoxReplica_CloudComputing<gh_stars>0 import webapp2 import jinja2 from google.appengine.api import users from google.appengine.ext import ndb import os from user import User from directory import Directory import random JINJA_ENVIRONMENT = jinja2.Environment( loader = jinja2.FileSystemLoad...
DivinaThomas/dropBoxReplica_CloudComputing
deletedirectory.py
import webapp2 import jinja2 from google.appengine.api import users from google.appengine.ext import ndb import os from user import User from directory import Directory import random JINJA_ENVIRONMENT = jinja2.Environment( loader = jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions = ['jinja2.ext.autoes...
dutitello/parAnsys
paransys/__init__.py
<gh_stars>1-10 # -*- coding: UTF-8 -*- #----------------------------------------------------------------------------# # PARANSYS docs are also available in https://dutitello.github.io/parAnsys/ # #----------------------------------------------------------------------------# from paransys.ansys import * from paransys...
dutitello/parAnsys
setup.py
<filename>setup.py import setuptools try: import numpy except: raise Exception('Please install NumPy first.') try: import scipy except: raise Exception('Please install SciPy first.') with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="paransys", versi...
dutitello/parAnsys
examples/AngTang_FORM_67-Implicit.py
""" Running example 6.7 from Ang & Tang 1984 with an Implicit limit state function """ import paransys # Call ParAnsys form = paransys.FORM() # Console log On form.Info(True) # Create random variables form.CreateVar('y', 'gauss', 40, cv=0.125) form.CreateVar('z', 'gauss', 50, cv=0.050) form.CreateVar('m', 'gauss', ...
dutitello/parAnsys
examples/AngTang_FORM_69.py
""" Running example 6.9 from Ang & Tang 1984 """ import paransys # Call ParAnsys form = paransys.FORM() # Console log On form.Info(True) # Create random variables form.CreateVar('y', 'gauss', 40, cv=0.125) form.CreateVar('z', 'gauss', 50, cv=0.050) form.CreateVar('m', 'gauss', 1000, cv=0.200) form.CreateVar('c', 'c...
dutitello/parAnsys
examples/BeckCantilever.py
<reponame>dutitello/parAnsys """ This is and PARANSYS-ANSYS problem that is really quick to run, just for validation. Example 1 from <NAME>. and <NAME>., 2006, "Structural Reliability Analysis Using Deterministic Finite Element Programs", Latin American Journal of Solids and Structures, 3, pp. 197-222. - https://www....
dutitello/parAnsys
examples/AngTang_MCAI_69-Implicit.py
<reponame>dutitello/parAnsys<filename>examples/AngTang_MCAI_69-Implicit.py """ Running example 6.9 from Ang & Tang 1984 """ import paransys import numpy as np # Call ParAnsys mc = paransys.MonteCarlo() # Console log On mc.Info(True) # Create random variables mc.CreateVar('y', 'gauss', 40, cv=0.125) mc.CreateVar('z'...
dutitello/parAnsys
examples/AngTang_MCAI_610.py
<filename>examples/AngTang_MCAI_610.py """ Running example 6.10 from Ang & Tang 1984 """ import paransys import numpy as np # Call ParAnsys mc = paransys.MonteCarlo() # Console log On mc.Info(True) # Create random variables mc.CreateVar('y', 'logn', 40, cv=0.125) mc.CreateVar('z', 'logn', 50, cv=0.050) mc.CreateVar...
dutitello/parAnsys
paransys/montecarlo.py
# -*- coding: UTF-8 -*- """ This module performns Monte Carlo simulations using Python. Please read the class docstring for more. Docs are available at https://dutitello.github.io/parAnsys/ """ import os import time from paransys.ansys import ANSYS import numpy as np import scipy.stats import math from math import ...
dutitello/parAnsys
examples/AngTang_FORM_610.py
<reponame>dutitello/parAnsys """ Running example 6.10 from Ang & Tang 1984 """ import paransys # Call ParAnsys form = paransys.FORM() # Console log On form.Info(True) # Create random variables form.CreateVar('y', 'logn', 40, cv=0.125) form.CreateVar('z', 'logn', 50, cv=0.050) form.CreateVar('m', 'gumbel', 1000, cv=...
dutitello/parAnsys
examples/ANSYS-Cantilever.py
<reponame>dutitello/parAnsys """ In this example we just connect ANSYS to Python by PARANSYS. Here some parameters need to be set: - form.ANSYS: - exec_loc = ansys executable location - run_location = where ansys will work (an empty dir) - form.SetANSYSModel: - directory = where is the file BeckCantileverAP...