repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
rushkii/maid_manga_id
maid_manga_id/types/chapter.py
from typing import List, Dict from dataclasses import dataclass from bs4 import BeautifulSoup as bsoup from datetime import datetime from humanfriendly import format_size import re, img2pdf, os from maid_manga_id.object import Object from maid_manga_id import http @dataclass class Chapters(Object): title: Dict[s...
rushkii/maid_manga_id
old_version/maid_manga/api.py
from bs4 import BeautifulSoup as bSoup from urllib.parse import quote import requests, lxml, re class MaidMangaID(object): def __init__(self): self.base_url = "https://maid.my.id" def ch_html_parse(self, title='', chapter='01'): if chapter == '0': chapter = '01' if len(chap...
rushkii/maid_manga_id
maid_manga_id/scaffold.py
<gh_stars>1-10 class Maid(object): pass
rushkii/maid_manga_id
old_version/setup.py
<reponame>rushkii/maid_manga_id from setuptools import setup def readme(): with open('README.md') as f: return f.read() setup( name='maid_manga_id', version='1.0', description='Maid Manga Indonesia API Using Python Web Scraper.', long_description=readme(), long_description_content_type...
rushkii/maid_manga_id
maid_manga_id/__init__.py
<gh_stars>1-10 __version__ = '1.1' __author__ = 'Kee' __copyright__ = "Copyright (C) 2021 Kee <https://github.com/rushkii/maid_manga_id>" from .maid_client import MaidManga
sarvex/tpu
models/official/unet3d/data_preprocess/convert_lits.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
sarvex/tpu
models/official/unet3d/unet_config.py
<filename>models/official/unet3d/unet_config.py # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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/lic...
sarvex/tpu
models/official/detection/configs/classification_config.py
<reponame>sarvex/tpu # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 # # Unles...
sarvex/tpu
models/official/efficientnet/lite/efficientnet_lite_model_qat_test.py
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
sarvex/tpu
models/official/unet3d/data_preprocess/convert_lits_nii_to_npy.py
<filename>models/official/unet3d/data_preprocess/convert_lits_nii_to_npy.py # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 # # ...
sarvex/tpu
models/official/detection/projects/vild/modeling/vild_head.py
<filename>models/official/detection/projects/vild/modeling/vild_head.py<gh_stars>10-100 # Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
sarvex/tpu
models/official/detection/projects/vild/preprocessing/create_lvis_tf_record.py
<gh_stars>10-100 # Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # 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 re...
sarvex/tpu
tools/data_converter/image_classification/simple_example.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
sarvex/tpu
models/official/efficientnet/lite/efficientnet_lite_model_qat.py
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
sarvex/tpu
tools/data_converter/image_utils.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
sarvex/tpu
models/official/detection/projects/vild/modeling/vild_losses.py
<gh_stars>10-100 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 re...
sarvex/tpu
models/official/detection/projects/vild/configs/vild_config.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
sarvex/tpu
models/official/unet3d/input_reader.py
<reponame>sarvex/tpu # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # 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 # # Unles...
crowdbotics-apps/nftlink-33254
backend/modules/privacy_policy/serializers.py
<gh_stars>0 from rest_framework import serializers from .models import PrivacyPolicy class PrivacyPolicySerializer(serializers.ModelSerializer): class Meta: model = PrivacyPolicy fields = [ "id", "body", "author", "is_active", "created_...
crowdbotics-apps/nftlink-33254
backend/modules/privacy_policy/apps.py
<reponame>crowdbotics-apps/nftlink-33254<filename>backend/modules/privacy_policy/apps.py from django.apps import AppConfig class PrivacyPolicyConfig(AppConfig): name = "modules.privacy_policy" verbose_name = "Privacy Policy"
crowdbotics-apps/nftlink-33254
backend/modules/payments/admin.py
from django.contrib import admin from .models import StripeUserProfile admin.site.register(StripeUserProfile)
crowdbotics-apps/nftlink-33254
backend/modules/terms_and_conditions/urls.py
<reponame>crowdbotics-apps/nftlink-33254<filename>backend/modules/terms_and_conditions/urls.py from django.urls import path, include from rest_framework.routers import DefaultRouter from .viewsets import TermAndConditionViewSet router = DefaultRouter() # because we are using a custom queryset for our viewset, the bas...
crowdbotics-apps/nftlink-33254
backend/modules/privacy_policy/__init__.py
default_app_config = "modules.privacy_policy.apps.PrivacyPolicyConfig"
crowdbotics-apps/nftlink-33254
backend/modules/terms_and_conditions/models.py
<reponame>crowdbotics-apps/nftlink-33254 from django.db import models from django.conf import settings # Create your models here. class TermAndCondition(models.Model): body = models.TextField() author = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.PROTECT, ) is_active = models.BooleanField(...
crowdbotics-apps/nftlink-33254
backend/modules/payments/services/StripeService.py
<filename>backend/modules/payments/services/StripeService.py<gh_stars>0 import stripe import environ env = environ.Env() class StripeService: stripe.api_key = env.str("STRIPE_SECRET_KEY") @classmethod def create_payment_intent_sheet(cls, cus_id, cents): ephemeralKey = stripe.EphemeralKey.create( ...
crowdbotics-apps/nftlink-33254
backend/modules/terms_and_conditions/apps.py
from django.apps import AppConfig class TermsAndConditionsConfig(AppConfig): name = "modules.terms_and_conditions" verbose_name = "Terms and Conditions"
crowdbotics-apps/nftlink-33254
backend/modules/payments/urls.py
from django.urls import re_path from .viewsets import PaymentSheetView, GetStripePaymentsView, GetPaymentMethodsView urlpatterns = [ re_path(r'payment_sheet/?', PaymentSheetView.as_view()), re_path(r'get_payments_history/?', GetStripePaymentsView.as_view()), re_path(r'get_payments_methods/?', GetPaymentMe...
crowdbotics-apps/nftlink-33254
backend/modules/terms_and_conditions/__init__.py
default_app_config = "modules.terms_and_conditions.apps.TermsAndConditionsConfig"
crowdbotics-apps/nftlink-33254
backend/modules/payments/models.py
<gh_stars>0 from django.db import models from django.conf import settings from django.db.models.signals import post_save from django.utils.translation import ugettext_lazy as _ class StripeUserProfile(models.Model): user = models.OneToOneField( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, ...
crowdbotics-apps/nftlink-33254
backend/modules/payments/viewsets.py
<filename>backend/modules/payments/viewsets.py from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import authentication, permissions, status from django.contrib.auth.models import User import stripe from .services.StripeService import StripeService class PaymentSh...
crowdbotics-apps/nftlink-33254
backend/modules/terms_and_conditions/admin.py
<reponame>crowdbotics-apps/nftlink-33254<gh_stars>1-10 from django.contrib import admin from .models import TermAndCondition admin.site.register(TermAndCondition)
hiro877/SparseSincnet
speaker_id_evaluate.py
<filename>speaker_id_evaluate.py # speaker_id.py # <NAME> # Mila - University of Montreal # July 2018 # Description: # This code performs a speaker_id experiments with SincNet. # How to run it: # python speaker_id.py --cfg=cfg/SincNet_TIMIT.cfg import os #import scipy.io.wavfile import soundfile as sf import to...
pranshu28/cnn-viz
utils.py
<gh_stars>1-10 import numpy as np import cv2 from keras import backend as K # Normalize the input and clip between (0,1) def normalize_clip(x): x -= x.mean() x /= (x.std() + 1e-5) x *= 0.1 x += 0.5 x = np.clip(x, 0, 1) return x # Normalize and Convert to RGB image def deprocess_image(x): ...
pranshu28/cnn-viz
viz_occlusion.py
<filename>viz_occlusion.py import argparse import math import time import matplotlib.pylab as plt import seaborn as sns from model import * from utils import * def get_occ_imgs(img, img_size, occ_size, occ_pixel, occ_stride, classes): # Get original image image = cv2.imread(img) image = cv2.resize(image...
pranshu28/cnn-viz
viz_gradient_ascent.py
import argparse import random from model import * from utils import * def gradient_ascent_iteration(loss_function, syn_img): # Update image with the gradient loss_value, grads_value = loss_function([syn_img]) gradient_ascent_step = syn_img + grads_value * 0.9 # grads_row_major = np.transpose(grads_v...
pranshu28/cnn-viz
model.py
from keras.models import Sequential from keras.layers import Conv2D, MaxPool2D, ZeroPadding2D from keras.layers.core import Flatten, Dense, Dropout from keras.applications.mobilenet import preprocess_input, decode_predictions from keras import backend as K from keras.utils.conv_utils import convert_kernel import tensor...
adulbrich/arousal-dynamics-model
models.py
from numpy import sqrt, exp, pi, power, tanh, vectorize # time constants for model: Postnova et al. 2018 - Table 1 tau_v = 50.0 #s tau_m = tau_v tau_H = 59.0*3600.0 #s tau_X = (24.0*3600.0) / (2.0*pi) #s tau_Y = tau_X tau_C = 24.2*3600.0 #s tau_A = 1.5*3600.0 #s # 1.5 hours # Tekieh et al. 2020 - Section 2.3.2, after...
rekmarks/solidity-metadata
src/get_metadata.py
''' Author: <NAME> (github.com/rekmarks) Script for retrieving entity (contract, library, interface) names and dependencies from the OpenZeppelin Solidity library. ''' from os import walk, remove, path, makedirs import json import sys def main(): ''' Gets takes a directory path and two output paths and retur...
IgorPetra/pyspeckit
pyspeckit/spectrum/models/formaldehyde.py
<gh_stars>0 """ =========================== Formaldehyde cm-line fitter =========================== This is a formaldehyde 1_11-1_10 / 2_12-2_11 fitter. It includes hyperfine components of the formaldehyde lines and has both LTE and RADEX LVG based models Module API ^^^^^^^^^^ """ from __future__ import print_functi...
leontrolski/immerframe
immerframe/__init__.py
from copy import copy from dataclasses import dataclass, fields, is_dataclass from typing import TypeVar, Any, Generic, List, Optional, Tuple, Union, cast T = TypeVar("T") class Empty: def __repr__(self) -> str: return "<empty>" empty = Empty() class ImmerframeError(RuntimeError): pass class No...
leontrolski/immerframe
setup.py
<reponame>leontrolski/immerframe<filename>setup.py<gh_stars>10-100 # -*- coding: utf-8 -*- from setuptools import setup, find_packages classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "P...
leontrolski/immerframe
tests/test_immerframe.py
from dataclasses import dataclass import attr from immerframe import Proxy, produce def test_list(): l = [1, 2, 3, 4] proxy = Proxy() proxy[1] = "foo" proxy.pop() new_l = produce(proxy, l) assert new_l == [1, "foo", 3] assert l == [1, 2, 3, 4] def test_set(): l = {1, 2, 3} pr...
leontrolski/immerframe
tests/test_core.py
import pytest from immerframe import El, Path, Proxy, produce, NoAttributeToCallError # TODO: split up these tests def test_current_path(): proxy = Proxy() proxy.foo assert proxy._current_path == [ El(type="getattr", key="foo"), ] assert proxy._paths == [] proxy = Proxy() proxy[0...
5voltsgc/EOLT_R6
realTimePlotting.py
<filename>realTimePlotting.py import sys import time import serial import matplotlib.pyplot as plt def getdata(): arduino.write(str.encode("getdata?\n")) resposta=arduino.readline() decoded_bytes = str(resposta[0:len(resposta)-2].decode("utf-8")) resposta=decoded_bytes #print (resposta) return ...
5voltsgc/EOLT_R6
listSerialPorts.py
import serial.tools.list_ports import serial # import time windowsPort = "COM1" ports = list(serial.tools.list_ports.comports()) for port in ports: # print(p) if "Arduino" in port.description: # print("This is an Arduino!") windowsPort = port.name arduino = serial.Serial(windowsPort, baudrate...
5voltsgc/EOLT_R6
arduino_serial.py
<gh_stars>0 # https://gist.github.com/Marzogh/723c137a402be7f06dfc1ba0b8517d09 import serial import csv import re import matplotlib.pyplot as plt import pandas as pd portPath = "/dev/ttyACM0" # Must match value shown on Arduino IDE baud = 115200 # Must match Arduino baud rate timeout = 5 ...
5voltsgc/EOLT_R6
readSerial.py
<gh_stars>0 import serial import time import datetime import csv ser = serial.Serial('COM27') fileName = ("EOLT-" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + ".csv") ser.flushInput() while True: try: ser_bytes = ser.readline() print(ser_bytes) with open(fileName, "a...
5voltsgc/EOLT_R6
map.py
# https://github.com/marceloprates/prettymaps
5voltsgc/EOLT_R6
gz_gui_EOLT.py
<filename>gz_gui_EOLT.py from guizero import App, Text, TextBox, Combo, PushButton, Box, Picture import numpy as np import csv from time import sleep, strftime import RPi.GPIO as GPIO import board import busio import adafruit_ads1x15.ads1015 as ADS from adafruit_ads1x15.analog_in import AnalogIn from fpdf import FPDF i...
5voltsgc/EOLT_R6
testCSV.py
import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv('C:\\Users\\a6384\\Dropbox\\python\\EOLT\\121250_example.CSV') # plt.figure() df.plot() plt.legend(loc='best') plt.savefig('121250_example.png') plt.show() print(df.describe(percentiles=None,)) # df.info() # print(df.shape) count...
5voltsgc/EOLT_R6
icecream_tutorial.py
<reponame>5voltsgc/EOLT_R6<filename>icecream_tutorial.py # https://towardsdatascience.com/do-not-use-print-for-debugging-in-python-anymore-6767b6f1866d from icecream import ic from datetime import datetime ic.disable() ic.enable() def now(): return f'[{datetime.now()}] ' ic.configureOutput(prefix=now) # ic('test'...
5voltsgc/EOLT_R6
directory.py
<gh_stars>0 # https://stackoverflow.com/questions/51877124/how-to-select-a-directory-and-store-it-into-a-variable-in-tkinter/51877299 # from tkinter import* from tkinter import StringVar from tkinter import Label from tkinter import Entry from tkinter import ttk from tkinter import Tk from tkinter import filedialog gu...
5voltsgc/EOLT_R6
combined.py
<reponame>5voltsgc/EOLT_R6 import tkinter as tk from tkinter.ttk import Combobox from PIL import Image, ImageTk import numpy as np from tkinter.font import Font from time import sleep import RPi.GPIO as GPIO import board import busio import adafruit_ads1x15.ads1015 as ADS from adafruit_ads1x15.analog_in import AnalogI...
ilexistools/Kitconc-examples
08_ngrams.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') ngrams = corpus.ngrams(size=3,pos='NN IN NN',show_progress=True) print(ngrams.df.head(10)) ngrams.save_excel(corpus.output_path + 'ngrams.xlsx')
ilexistools/Kitconc-examples
02_wordlist.py
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus # reference to the corpus corpus = Corpus('kitconc-examples/workspace','ads','english') # make wordlist wordlist = corpus.wordlist(show_progress=True) # print the top 10 print(wordlist.df....
ilexistools/Kitconc-examples
04_kwic.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') kwic = corpus.kwic('experience',show_progress=True) kwic.sort('R1','R2','R3') print(kwic.df.head(10)) kwic.save_excel(corpus.output_path + 'kwi...
ilexistools/Kitconc-examples
12_collgraph.py
<reponame>ilexistools/Kitconc-examples # -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') collocates = corpus.collocates('skills',left_span=3,right_span=3,coll_pos='NN JJ',show_progress=True) prin...
ilexistools/Kitconc-examples
10_keywords_dispersion.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') wordlist = corpus.wordlist(show_progress=True) keywords = corpus.keywords(wordlist,show_progress=True) keywords_dispersion = corpus.keywords_dis...
ilexistools/Kitconc-examples
06_collocates.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') collocates = corpus.collocates('experience',left_span=2,right_span=2,coll_pos='IN NN JJ VBN VBD',show_progress=True) print(collocates.df.head(10)...
ilexistools/Kitconc-examples
11_collocations.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') kwic = corpus.kwic('skills',show_progress=True) collocations = corpus.collocations(kwic,show_progress=True) print(collocations.df.head(10)) col...
ilexistools/Kitconc-examples
05_concordances.py
<reponame>ilexistools/Kitconc-examples<filename>05_concordances.py # -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') concordances = corpus.concordance('experience',show_progress=True) print(conco...
ilexistools/Kitconc-examples
03_keywords.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') wordlist = corpus.wordlist(show_progress=True) keywords = corpus.keywords(wordlist,show_progress=True) print(keywords.df.head(10)) keywords.sav...
ilexistools/Kitconc-examples
07_clusters.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') clusters = corpus.clusters('experience',size=3,show_progress=True) print(clusters.df.head(10)) clusters.save_excel(corpus.output_path + 'cluster...
ilexistools/Kitconc-examples
00_download_examples.py
<filename>00_download_examples.py # -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.core import Examples Examples().download()
ilexistools/Kitconc-examples
09_dispersion.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus corpus = Corpus('kitconc-examples/workspace','ads','english') dispersion = corpus.dispersion('salary') print(dispersion.df.head(10)) dispersion.save_excel(corpus.output_path + 'dispersion.xlsx')
ilexistools/Kitconc-examples
01_create_corpus.py
# -*- coding: utf-8 -*- """ Kitconc examples @author: <EMAIL> """ from kitconc.kit_corpus import Corpus # reference to the corpus corpus = Corpus('kitconc-examples/workspace','ads','english') # add texts from source folder corpus.add_texts('kitconc-examples/ads',show_progress=True)
Hiroaki-Tanaka-0606/Photoelectron_refraction
Python/Config_example.py
# Photoelectron_refraction # Config # For Gui fontFamilies=["Segoe UI", "Yu Gothic UI"] fontSize_normal=16 ContentsMargins=[5,5,5,5] # For graph ## Color of horizontal and vertical guide lines pen1=(0, 255, 0) ## length of tickes tickLength=-30 # Physical constants ## 1 Bohr (Angstrom) Bohr_ang=0.529...
Hiroaki-Tanaka-0606/Photoelectron_refraction
Python/Calculation_GUI.py
# Photoelectron_refraction # GUI # libraries from pip from pyqtgraph.Qt import QtGui, QtCore, QtWidgets import pyqtgraph as pg import numpy as np import math import h5py from datetime import datetime # libraries in this package import lib import Config # MainWindow: a class for the window class MainWindow(QtGui.QMai...
Hiroaki-Tanaka-0606/Photoelectron_refraction
Python/lib.py
<filename>Python/lib.py<gh_stars>0 # Photoelectron_refraction # Calculation library import math import numpy as np import Config import random # gauss function def gauss(x, s): return 1.0/(math.sqrt(2*math.pi)*s)*math.exp(-x*x/(s*s*2)) # broadening profile def profileCube(dkx, dky, de, sigmak, sigmae, sigmaMax):...
efflicto/DomainListToHohser
hohser.py
<filename>hohser.py #!/usr/bin/env python3 import json import urllib.request def get_urls(url): urls = [] response = urllib.request.urlopen(url) for url in response.readlines(): decoded_url = url.decode('utf-8').replace('\n', '') if not decoded_url.startswith('#'): urls.append(...
junqili259/DatabaseDemo
main.py
import os import logging from flask import Flask, render_template, url_for, redirect, request, Response from forms import PersonForm, SearchForm from datetime import date,timedelta import requests, random import sqlalchemy # Cloud SQL database db_user = os.environ.get("CLOUD_SQL_USERNAME") db_pass = os.environ.get...
junqili259/DatabaseDemo
forms.py
<gh_stars>0 from flask_wtf import FlaskForm from wtforms import StringField, TextField, SubmitField, IntegerField, RadioField, DateField, SelectField from wtforms.validators import DataRequired, Length, EqualTo, Optional states = [('AL','AL'),('AK','AK'),('AZ','AZ'),('AR','AR'),('CA','CA'),('CO','CO'),('CT','CT'), ('D...
krishnakesari/Graph-and-Network-Analysis
test.py
a = 2 b = a ** 5 print(b)
nilaya123/interview-scheduler-app-automation
page_objects/index_object.py
""" This class models the form on the Selenium tutorial page The form consists of some input fields, a dropdown, a checkbox and a button """ from .Base_Page import Base_Page import conf.locators_conf as locators from utils.Wrapit import Wrapit class Index_Object: "Page object for the Form" #locators ...
nilaya123/interview-scheduler-app-automation
tests/test_index_page.py
""" This is an example automated test to help you learn Qxf2's framework Our automated test will do the following: #Open Qxf2 selenium-tutorial-main page. #Fill the example form. #Click on Click me! button and check if its working fine. """ import os,sys,time,pytest sys.path.append(os.path.dirname(os.path.d...
nilaya123/interview-scheduler-app-automation
conf/login_conf.py
<filename>conf/login_conf.py<gh_stars>0 user_name = "nilaya" password = "<PASSWORD>"
nilaya123/interview-scheduler-app-automation
conf/base_url_conf.py
""" Conf file for base_url """ base_url = "http://3.219.215.68/"
nilaya123/interview-scheduler-app-automation
tests/test_login_page.py
<reponame>nilaya123/interview-scheduler-app-automation """ This is an example automated test to help you learn Qxf2's framework Our automated test will do the following: #Open Qxf2 selenium-tutorial-main page. #Fill the example form. #Click on Click me! button and check if its working fine. """ import os,sy...
nilaya123/interview-scheduler-app-automation
page_objects/form_object.py
<gh_stars>0 """ This class models the form on the Selenium tutorial page The form consists of some input fields, a dropdown, a checkbox and a button """ from .Base_Page import Base_Page import conf.locators_conf as locators from utils.Wrapit import Wrapit class Form_Object: "Page object for the Form" #l...
quang2705/arc_project
populate_users.py
<filename>populate_users.py import os os.environ.setdefault('DJANGO_SETTINGS_MODULE','arc_project.settings') import django django.setup() from arc_app.models import UserProfile, Contract, Session, ContractMeeting, Subject from django.db import models from django.contrib.auth.models import User from datetime import da...
quang2705/arc_project
arc_app/views.py
<gh_stars>1-10 #Django class from django.contrib.auth.models import User from django.db.models import Q from django.http import JsonResponse from django.shortcuts import render #custom Database, Serializer Permission and Utilities class from arc_app.models import UserProfile, Contract, Session, ContractMeeting, Subjec...
quang2705/arc_project
arc_app/models.py
<gh_stars>1-10 from django.db import models from django.contrib.auth.models import User from django.contrib.auth.models import BaseUserManager #TODO: Gives contrains for all the CharField and IntegerField #TODO: Write test for database on contrain and relationship class UserProfile(models.Model): user = models.OneT...
quang2705/arc_project
arc_app/permissions.py
from rest_framework import permissions #This permission checks if the user is tutor or admin # if the user is tutor: gives them all access # if the user is admin: gives them readonly access: GIVE, OPTIONS and HEAD class IsTutorOrIsAdminAndHeadTutorReadOnly(permissions.BasePermission): def has_permission(self, requ...
quang2705/arc_project
populate_contracts_sessions.py
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE','arc_project.settings') import django django.setup() from arc_app.models import UserProfile, Contract, Session, ContractMeeting, Subject import datetime def create_subject(): print("Creating subject...") subject_name_list = ['Astronomy', 'Biology', 'Chemistry...
quang2705/arc_project
arc_app/urls.py
<filename>arc_app/urls.py from arc_app import views from rest_framework import renderers from rest_framework.routers import DefaultRouter from django.urls import path, include from django.conf.urls import url #Create a router and register our viewsets router = DefaultRouter() router.register(r'userprofiles', views.Use...
quang2705/arc_project
arc_app/tests.py
from django.test import TestCase from rest_framework import status from rest_framework.test import APITestCase from rest_framework.test import APIRequestFactory from rest_framework.test import force_authenticate from django.contrib.auth.models import User from arc_app.models import UserProfile, Contract, Session, Con...
quang2705/arc_project
arc_app/serializers.py
<filename>arc_app/serializers.py<gh_stars>1-10 from rest_framework import serializers from arc_app.models import UserProfile, Contract from arc_app.models import Session, ContractMeeting, Subject from django.contrib.auth.models import User #TODO: need testing class MiniSessionSerializer(serializers.ModelSerializer): ...
quang2705/arc_project
arc_app/apps.py
<reponame>quang2705/arc_project from django.apps import AppConfig class ArcAppConfig(AppConfig): name = 'arc_app'
quang2705/arc_project
arc_app/admin.py
<reponame>quang2705/arc_project from django.contrib import admin from arc_app.models import UserProfile, Contract, Session, ContractMeeting, Subject # Register your models here. admin.site.register(UserProfile) admin.site.register(Contract) admin.site.register(Session) admin.site.register(ContractMeeting) admin.site.re...
quang2705/arc_project
arc_app/utils.py
<reponame>quang2705/arc_project<filename>arc_app/utils.py from arc_app.models import UserProfile from django.db.models import Q from rest_framework.response import Response #python class import base64 #create a user profile for user if user doesn't have any user profile def create_userprofile(user): try: userprof...
quang2705/arc_project
arc_app/migrations/0001_initial.py
# Generated by Django 2.2.10 on 2020-05-07 01:49 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] op...
phaticusthiccy/Carbon-API
app.py
# Author: Phaticusthiccy # Telegram: t.me/phaticusthiccy from flask import Flask, send_file, jsonify, request import utility, carbon from flask_cors import CORS import asyncio import os import json app = Flask(__name__) app.secret_key = '<KEY>' loop = asyncio.get_event_loop() CORS(app) @app.route('/', methods=['GET...
david-gpu/deep-makeover
dm_flags.py
import tensorflow as tf FLAGS = tf.app.flags.FLAGS def define_flags(): # Configuration (alphabetically) tf.app.flags.DEFINE_integer('annealing_half_life', 10000, "Number of batches until annealing temperature is halved") tf.app.flags.DEFINE_string('attribute_file', 'list_...
david-gpu/deep-makeover
dm_show.py
import numpy as np import os.path import scipy.misc import tensorflow as tf import time import dm_arch import dm_input import dm_utils FLAGS = tf.app.flags.FLAGS
david-gpu/deep-makeover
dm_arch.py
<filename>dm_arch.py import math import numpy as np import tensorflow as tf import dm_utils FLAGS = tf.app.flags.FLAGS # Global switch to enable/disable training of variables _glbl_is_training = tf.Variable(initial_value=True, trainable=False, name='glbl_is_training') # Global variable dictionary. This is how we ca...
david-gpu/deep-makeover
dm_train.py
import numpy as np import os.path import tensorflow as tf import time import dm_arch import dm_input import dm_utils FLAGS = tf.app.flags.FLAGS def _save_image(train_data, feature, gene_output, batch, suffix, max_samples=None): """Saves a picture showing the current progress of the model""" if max_samp...
david-gpu/deep-makeover
dm_input.py
<gh_stars>100-1000 import tensorflow as tf import dm_celeba FLAGS = tf.app.flags.FLAGS def input_data(sess, mode, filenames, capacity_factor=3): # Separate training and test sets # TBD: Use partition given by dataset creators assert mode == 'inference' or len(filenames) >= FLAGS.test_vectors if...
david-gpu/deep-makeover
dm_model.py
<gh_stars>100-1000 import math import numpy as np import tensorflow as tf import dm_arch import dm_utils FLAGS = tf.app.flags.FLAGS def _residual_block(model, num_units, mapsize, nlayers=2): """Adds a residual block similar to Arxiv 1512.03385, Figure 3. """ # TBD: Try pyramidal block as per arXiv 1610....
david-gpu/deep-makeover
dm_celeba.py
<reponame>david-gpu/deep-makeover<gh_stars>100-1000 import numpy as np import os.path import random import tensorflow as tf FLAGS = tf.app.flags.FLAGS # For convenience, here are the available attributes in the dataset: # 5_o_Clock_Shadow Arched_Eyebrows Attractive Bags_Under_Eyes Bald Bangs Big_Lips \ # Big_Nose Bla...
david-gpu/deep-makeover
dm_infer.py
import numpy as np import tensorflow as tf import dm_utils FLAGS = tf.app.flags.FLAGS def inference(infer_data): sess = infer_data.sess idm = infer_data.infer_model image = sess.run(idm.gene_out) image = np.squeeze(image, axis=0) dm_utils.save_image(image, FLAGS.outfile)