prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0],...
suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestFuncs)) return suite
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0],...
unittest.main(defaultTest='test_suite')
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def <|fim_middle|>(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0], ...
test_buildPaths
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0],...
test_recordInheritance
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0],...
test_recordsInfo
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0],...
test_classInfo
<|file_name|>test_funcs.py<|end_file_name|><|fim▁begin|>import unittest from libs.funcs import * class TestFuncs(unittest.TestCase): def test_buildPaths(self): recPaths, repPaths, rouPaths, corePaths = buildPaths() findTxt = lambda x, y: x.find(y) > -1 assert findTxt(recPaths["Task"][0],...
test_suite
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
elif scheme == 'postgresql': kwargs['user'] = username or 'postgres' kwargs['database'] = database if port:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
"""Parse a connection string and return the associated driver""" dsn = urlparse(dsn_string) scheme = dsn.scheme.split('+')[0] username = password = host = port = None host = dsn.netloc if '@' in host: username, host = host.split('@') if ':' in username: username, pass...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
driver, args, kwargs = parse_dsn(dsn_string) return driver(*args, **kwargs)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
username, host = host.split('@') if ':' in username: username, password = username.split(':') password = unquote(password) username = unquote(username)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
username, password = username.split(':') password = unquote(password)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
host, port = host.split(':') port = int(port)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
return SQLiteDriver, [dsn.path], {}
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['user'] = username or 'root' kwargs['db'] = database if port: kwargs['port'] = port if host: kwargs['host'] = host if password: kwargs['passwd'] = password return MySQLDriver, [], kwargs
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['port'] = port
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['host'] = host
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['passwd'] = password
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['user'] = username or 'postgres' kwargs['database'] = database if port: kwargs['port'] = port if 'unix_socket' in kwargs: kwargs['host'] = kwargs.pop('unix_socket') elif host: kwargs['host'] = host if password: kwargs...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['port'] = port
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['host'] = kwargs.pop('unix_socket')
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['host'] = host
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
kwargs['password'] = password
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
raise ValueError('Unknown driver %s' % dsn_string)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
parse_dsn
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <cohara87@gmail.com> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql ...
get_driver
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
child.expect(u"This test will print \"Slept for X sec...\" every 1, 5 and 10 seconds.\r\n")
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
pass
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
exp_diff1 = 1000000 exp_diff5 = 5000000 exp_diff10 = 10000000 child.expect(u"This test will print \"Slept for X sec...\" every 1, 5 and 10 seconds.\r\n") child.expect(u"\r\n") child.expect(u"<======== If using pyterm, this is the time when started.") child.expect(u"\r\n") m = 9 while...
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
exp_diff = exp_diff1
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
exp_diff = exp_diff5
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
exp_diff = exp_diff10
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
raise InvalidTimeout("Invalid timeout %d (expected %d)" % (diff, exp_diff));
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
print("Timed out correctly: %d (expected %d)" % (diff, exp_diff))
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
sys.exit(testrunner.run(testfunc))
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import o...
testfunc
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse<|fim▁hole|>from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons s...
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): <|fim_middle|> def set_datapath_arg(): parser.add_argument('--datapath', required=True, help...
parser.add_argument('--host', required=True, help='the url for the Materials Commons server')
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def...
parser.add_argument('--datapath', required=True, help='the path to the directory containing the files used by the build')
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def...
parser.add_argument('--apikey', required=True, help='rapikey for the user building the demo project')
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def...
print "Refreshed project with name = " + project.name
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def...
print "Built project with name = " + project.name
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def <|fim_middle|>(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def s...
set_host_url_arg
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def...
set_datapath_arg
<|file_name|>build_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import argparse from os import path as os_path import demo_project as demo import traceback def set_host_url_arg(): parser.add_argument('--host', required=True, help='the url for the Materials Commons server') def...
set_apikey_arg
<|file_name|>workspaceloader.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifi...
<|file_name|>workspaceloader.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifi...
@staticmethod def load_workspaces(directory, workspaces_to_load): """ The method that is called to load in workspaces. From the given directory and the workspace names provided. :param directory: String or string castable object; The project directory :param workspaces_to_load: L...
<|file_name|>workspaceloader.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifi...
""" The method that is called to load in workspaces. From the given directory and the workspace names provided. :param directory: String or string castable object; The project directory :param workspaces_to_load: List of Strings; of the workspaces to load """ if workspac...
<|file_name|>workspaceloader.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifi...
return
<|file_name|>workspaceloader.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifi...
load_workspaces
<|file_name|>0008_auto_20151224_1528.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-24 15:28 from __future__ import unicode_literals from django.db import migrations, models <|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('emailer', '0007...
<|file_name|>0008_auto_20151224_1528.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-24 15:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): <|fim_middle|> <|fim▁end|>
dependencies = [ ('emailer', '0007_auto_20150509_1922'), ] operations = [ migrations.AlterField( model_name='email', name='recipient', field=models.EmailField(db_index=True, max_length=254), ), ]
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import logging logging.basicConfig() <|fim▁hole|>logger.setLevel(logging.INFO) class Result(Enum): runfinished = 1 runerrored = 2 unrouted = 3 error = 4 # vim: set expandtab sw=4 sts=4 ts=4<|fim▁end|>
from enum import Enum logger = logging.getLogger('loopabull')
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import logging logging.basicConfig() from enum import Enum logger = logging.getLogger('loopabull') logger.setLevel(logging.INFO) class Result(Enum): <|fim_middle|> # vim: set expandtab sw=4 sts=4 ts=4 <|fim▁end|>
runfinished = 1 runerrored = 2 unrouted = 3 error = 4
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
input_file = open('./example-files/apache-site', 'r') input_file_text = input_file.read()
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
global environment environment = env while True: print("\nConfigure Websites\n") print("Please select an operation:") print(" 1. Restart Apache") print(" 2. Add a new website") print(" 3. Add SSL to website") print(" 0. Go Back") print(" -. Exit") operation = input(environment.prompt) if operati...
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
print("\nAttempting to restart Apache:") # TODO: Print an error when the user does not have permissions to perform the action. result = os.system("sudo service apache2 restart") print(result) return True
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
global environment print('\nAdd website.\n') input_file = open('./example-files/apache-site', 'r') input_file_text = input_file.read() input_file.close() site_name = input('Website name (without www or http)' + environment.prompt) new_filename = '/etc/apache2/sites-available/%s.conf' % (site_name,) tmp_filena...
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
global environment print("\nAdd SSL to website.\n") print("Please enter the URL of the website.\n") site_name = input(environment.prompt) print("Is this a wildcard certificate? (y/N)\n") wildcard = input(environment.prompt) if wildcard.lower()=='y': print("Generating wildcard cert for *.%s" % (site_name,)) ...
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
return True
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
sys.exit()
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
restart_apache()
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
add_website()
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
add_ssl()
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
print("Invalid input.")
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
print('\n\nError!') print('The current user does not have permission to perform this action.') #print('Please run Burton with elevated permissions to resolve this error.\n\n')
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
print("Generating wildcard cert for *.%s" % (site_name,)) wildcard = '*.'
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
print("Generating cert for %s" % (site_name,)) wildcard = ''
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
main
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
restart_apache
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
add_website
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os import re import sys """ * Perform initial configuration to ensure that the server is set up to work with Burton's format sudo chown -R ubuntu:ubuntu /var/www mkdir -p /var/www/default/public_html mv /var/www/html/index.html /var/www...
add_ssl
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
import lazylibrarian
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
consumer_key = "208JPTMMnZjtKWA4obcH8g" consumer_secret = "BKaHzaQRd5PK6EH8EqPZ1w8mz6NSk9KErArarinHutk" REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token' ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token' AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize...
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
if lazylibrarian.TWITTER_NOTIFY_ONSNATCH: self._notifyTwitter(common.notifyStrings[common.NOTIFY_SNATCH]+': '+title)
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
if lazylibrarian.TWITTER_NOTIFY_ONDOWNLOAD: self._notifyTwitter(common.notifyStrings[common.NOTIFY_DOWNLOAD]+': '+title)
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
return self._notifyTwitter("This is a test notification from LazyLibrarian / " + formatter.now(), force=True)
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
signature_method_hmac_sha1 = oauth.SignatureMethod_HMAC_SHA1() #@UnusedVariable oauth_consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret) oauth_client = oauth.Client(oauth_consumer) logger.info('Requesting temp token from Twitter')...
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
request_token = {} request_token['oauth_token'] = lazylibrarian.TWITTER_USERNAME request_token['oauth_token_secret'] = lazylibrarian.TWITTER_PASSWORD request_token['oauth_callback_confirmed'] = 'true' token = oauth.Token(request_token['oauth_token'], request_token['oaut...
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
username=self.consumer_key password=self.consumer_secret access_token_key=lazylibrarian.TWITTER_USERNAME access_token_secret=lazylibrarian.TWITTER_PASSWORD logger.info(u"Sending tweet: "+message) api = twitter.Api(username, password, access_token_key, access_tok...
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
prefix = lazylibrarian.TWITTER_PREFIX if not lazylibrarian.USE_TWITTER and not force: return False return self._send_tweet(prefix+": "+message)
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
self._notifyTwitter(common.notifyStrings[common.NOTIFY_SNATCH]+': '+title)
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
self._notifyTwitter(common.notifyStrings[common.NOTIFY_DOWNLOAD]+': '+title)
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
logger.info('Invalid respond from Twitter requesting temp token: %s' % resp['status'])
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
request_token = dict(parse_qsl(content)) lazylibrarian.TWITTER_USERNAME = request_token['oauth_token'] lazylibrarian.TWITTER_PASSWORD = request_token['oauth_token_secret'] return self.AUTHORIZATION_URL+"?oauth_token="+ request_token['oauth_token']
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
logger.error('The request for a token with did not succeed: '+str(resp['status'])) return False
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
logger.info('Your Twitter Access Token key: %s' % access_token['oauth_token']) logger.info('Access Token secret: %s' % access_token['oauth_token_secret']) lazylibrarian.TWITTER_USERNAME = access_token['oauth_token'] lazylibrarian.TWITTER_PASSWORD = access_token['oauth_tok...
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
return False
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
notify_snatch
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
notify_download
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
test_notify
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
_get_authorization
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
_get_credentials
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
_send_tweet
<|file_name|>tweet.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the...
_notifyTwitter
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
self.model.add(Flatten()) self.model.add(Dense(256,init='uniform'))
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
def __init__(self): self.model = Sequential() self.model.add(convolutional.Convolution2D(input_shape=(49, 19, 19), nb_filter=K, nb_row=5, nb_col=5, init='uniform', activation='relu', border_mode='same')) for i in range(2,13): self.mod...
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
self.model = Sequential() self.model.add(convolutional.Convolution2D(input_shape=(49, 19, 19), nb_filter=K, nb_row=5, nb_col=5, init='uniform', activation='relu', border_mode='same')) for i in range(2,13): self.model.add(convolutional.Con...
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
pass
<|file_name|>value.py<|end_file_name|><|fim▁begin|>from keras.models import Sequential from keras.layers import convolutional from keras.layers.core import Dense, Flatten from SGD_exponential_decay import SGD_exponential_decay as SGD ### Parameters obtained from paper ### K = 152 # depth of convo...
pass