Beispiel #1
0
 def on_config_and_run(self):
     self.file_config_run = open("config.py")
     data_config_run = self.file_config_run.read().split("\n")
     self.url = data_config_run[7].split("=")[1][1:-1]
     # print self.url
     self.file_config_run.close()
     self.write_in_config()
     __init__.main()
def main():
    primitiveInput = __init__.main()

    # Defigning base URLS
    primitiveInput.cowinAllStatesURL = 'https://cdn-api.co-vin.in/api/v2/admin/location/states'
    primitiveInput.cowinAllDistrictsURL = f"https://cdn-api.co-vin.in/api/v2/admin/location/districts/{primitiveInput.stateID}"
    primitiveInput.cowinSearchByDistrictURL = f'https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id={primitiveInput.districtID}&date={primitiveInput.searchDate}'

    # Creating Telegram Bot
    primitiveInput.telegramToken = credentials.TELEGRAM_TOKEN
    primitiveInput.telegramBot = telegram.Bot(
        token=primitiveInput.telegramToken)
    primitiveInput.telegramChatID = credentials.TELEGRAM_CHAT_ID

    # Creating Heroku App
    primitiveInput.herokuApp = 'https://a5ef161f052e.ngrok.io/'

    # Creating Flask App
    primitiveInput.flaskApp = Flask(__name__)

    # Defigning Database
    os.environ[
        'DATABASE_URL'] = 'postgres://*****:*****@ec2-54-164-22-242.compute-1.amazonaws.com:5432/d6o7alcv0mq3lj'

    # Setting Default Variables

    return primitiveInput
Beispiel #3
0
def test_response_with_param():
    req = Request()
    req.params['name'] = "Bill"
    response = __init__.main(req)
    assert response.status_code == 200
    assert response.get_body() == b"Hello Bill! Welcome to Azure Functions!"
Beispiel #4
0
#!/usr/bin/env python
import __init__

__init__.main()
Beispiel #5
0
#!/usr/bin/env python2

# Author: echel0n <*****@*****.**>
# URL: http://www.github.com/sickragetv/sickrage/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SickRage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SickRage.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import print_function, unicode_literals

from __init__ import main
if __name__ == '__main__':
    main()
import argparse
import logging
import pprint

import config

from __init__ import main
from lexicon import create_dictionary_from_lexicon, create_dictionary_from_punctuation_marks
from stream import get_tr_stream, get_dev_stream

logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.INFO)

# Get the arguments
parser = argparse.ArgumentParser()
parser.add_argument("--proto",  default="get_config", help="Prototype config to use for config")
parser.add_argument("--bokeh",  default=False, action="store_true", help="Use bokeh server for plotting")
args = parser.parse_args()


if __name__ == "__main__":
    config = getattr(config, args.proto)()
    #logger.info("Model options:\n{}".format(pprint.pformat(config)))

    data_path = "%s/data_global_cmvn_with_phones_alignment_pitch_features.h5" % config["data_dir"]
    tr_stream = get_tr_stream(data_path, config["src_eos_idx"], config["phones"]["sil"], config["trg_eos_idx"], seq_len=config["seq_len"], batch_size=config["batch_size"], sort_k_batches=config["sort_k_batches"])
    dev_stream = get_dev_stream(data_path)
    main(config, tr_stream, dev_stream, args.bokeh)
Beispiel #7
0
        layout.addWidget(leftright1)

        self.exTextLbl = QLineEdit()
        gridAction2 = QGridLayout()
        gridAction2.setColumnStretch(1, 2)
        gridAction2.addWidget(QLabel("Text Expected"))
        gridAction2.addWidget(self.exTextLbl)
        leftright2 = QWidget()
        leftright2.setLayout(gridAction2)
        layout.addWidget(leftright2)

        self.exElementLbl = QLineEdit()
        gridAction3 = QGridLayout()
        gridAction3.setColumnStretch(1, 2)
        gridAction3.addWidget(QLabel("Element Expected"))
        gridAction3.addWidget(self.exElementLbl)
        leftright3 = QWidget()
        leftright3.setLayout(gridAction3)
        layout.addWidget(leftright3)

        central = QWidget()
        central.setLayout(layout)
        self.setCentralWidget(central)
        self.resize(600, 500)
        self.setWindowTitle("Input Manager")
        self.statusBar().showMessage("Active")


if __name__ == "__main__":
    __init__.main()
Beispiel #8
0
from __init__ import main, read_commandline

main(**read_commandline())
Beispiel #9
0
import sys
import __init__ as ToyRobot

ToyRobot.main(sys.argv)
Beispiel #10
0
#!/usr/bin/env python3

from sys import argv, stdin, stdout
from json import loads

from __init__ import main

if len(argv) == 1:
    program = stdin.read()
    print()
elif len(argv) == 2:
    with open(argv[1]) as f:
        program = f.read()

print(main(loads(program)))
Beispiel #11
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""This is a script for comparing different possible transcriptions of the same
sentences and for tallying up which differences are the most common.
"""

from __init__ import main

if __name__ == '__main__':
    import sys
    main(sys.argv)
Beispiel #12
0
import sys
from __init__ import main

if __name__ == '__main__':
    file_name_with_path = (sys.path[0] + '\\last_saved_se_data.txt').replace(
        '\\', '/')
    rss_link = 'https://bitcoin.stackexchange.com/feeds'
    main(rss_link, file_name_with_path)
Beispiel #13
0
    if cv is True:
        cv_cs = cfg.get('CROSSVALIDATION', 'Cs', fallback='0,1,10,100')
        cv_cs = list(map(float, cv_cs.split(',')))
        cv_round = cfg.getint('CROSSVALIDATION', 'cv', fallback=3)
        modelcv = LogisticRegressionCV(Cs=cv_cs,
                                       scoring='accuracy',
                                       cv=cv_round)
        modelcv.fit(X, y)
        logger.info("Cross validation completed. The max cv score is - \n %s",
                    modelcv.scores_[1].max())
    is_validate = cfg.getboolean('VALIDATION', 'genstats', fallback=False)
    if is_validate is True:
        logger.info("Generating the score for Training data")
        val_metrictype = cfg.get('VALIDATION',
                                 'metrictype',
                                 fallback='classification')
        val_results = modelValidate(model_lr.predict(X), y, val_metrictype)
        logger.info("Training set classification results are - \n %s",
                    val_results)
    is_modelsave = cfg.getboolean('MODELSAVING', 'savemodel', fallback=False)
    if is_modelsave is True:
        logger.info("Serializing and Saving the model")
        saveloc = cfg.get('MODELSAVING', 'saveloc', fallback=os.getcwd())
        savename = cfg.get('MODELSAVING', 'savename', fallback='model.pk')
        modelSave(saveloc, savename, pipe)
        logger.info("Model Serialized and Saved successfully")


if __name__ == '__main__':
    main(modelTrain)
Beispiel #14
0
def test_response_without_param():
    req = Request()
    response = __init__.main(req)
    assert response.status_code == 200
    assert response.get_body() == b"Hello! Welcome to Azure Functions!"
Beispiel #15
0
import sys
from __init__ import main

main(sys.argv[1:])

Beispiel #16
0
"""
command-line toy ShellServer
"""

from __init__ import main

if __name__ == "__main__":
    main()
Beispiel #17
0
import argparse
import logging
import pprint
import sys

import configurations

from __init__ import main
from stream import get_tr_stream, get_dev_stream

logger = logging.getLogger(__name__)

# Get the arguments
parser = argparse.ArgumentParser()
parser.add_argument("--proto",  default="get_config_cs2en",
                    help="Prototype config to use for config")
parser.add_argument("--bokeh",  default=False, action="store_true",
                    help="Use bokeh server for plotting")
args = parser.parse_args()


if __name__ == "__main__":
    # Get configurations for model
    configuration = getattr(configurations, args.proto)()
    logger.info("Model options:\n{}".format(pprint.pformat(configuration)))
    # Get data streams and call main

    #sys.exit(0)
    main(configuration, get_tr_stream(**configuration),
         get_dev_stream(**configuration), args.bokeh)