prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>check_key_import.py<|end_file_name|><|fim▁begin|>'''Manual check (not a discoverable unit test) for the key import, to identify problems with gnupg, gpg, gpg1, gpg2 and so on''' import os import shutil from gnupg import GPG def setup_keyring(keyring_name): '''Setup the keyring''' keyring_path ...
print("ERROR: Number of keys should be 1, not", NUM_KEYS)
<|file_name|>check_key_import.py<|end_file_name|><|fim▁begin|>'''Manual check (not a discoverable unit test) for the key import, to identify problems with gnupg, gpg, gpg1, gpg2 and so on''' import os import shutil from gnupg import GPG def <|fim_middle|>(keyring_name): '''Setup the keyring''' keyring_path...
setup_keyring
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
self._program = program self._timeOfDay = timeOfDay def run(self):
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
def __init__(self, program, timeOfDay): super().__init__() self._program = program self._timeOfDay = timeOfDay def run(self): now = datetime.datetime.now() secondsInCurrentDay = now.hour * 3600 + now.minute * 60 + now.second if secondsInCurrentDay < self._timeOfD...
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
super().__init__() self._program = program self._timeOfDay = timeOfDay
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
now = datetime.datetime.now() secondsInCurrentDay = now.hour * 3600 + now.minute * 60 + now.second if secondsInCurrentDay < self._timeOfDay: sleepDuration = self._timeOfDay - secondsInCurrentDay else: sleepDuration = self._timeOfDay + 3600 * 24 - secondsInCurrentD...
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
self.threadStopEvent = threadStopEvent self._program.setThreadStopEvent(threadStopEvent)
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
self._colorSetter = colorSetter self._program.setColorSetter(colorSetter)
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
return self._program.getCurrentColor()
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
self._program.setLastColor(lastColor)
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
sleepDuration = self._timeOfDay - secondsInCurrentDay
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
sleepDuration = self._timeOfDay + 3600 * 24 - secondsInCurrentDay
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
__init__
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
run
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
setThreadStopEvent
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
setColorSetter
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
getCurrentColor
<|file_name|>scheduledprogram.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Sebastian Kanis # This file is part of pi-led-control. # pi-led-control 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, eithe...
setLastColor
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): <|fim▁hole|> s3 = boto.connect_s3() s3.create_bucket("laterpay-ru...
@moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.create_application_version') @mock.patch('boto.beanstalk.layer1.Layer1.update_environment') def test_deploy(self, cav, ue):
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): <|fim_middle|> <|fim▁end|>
@moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.create_application_version') @mock.patch('boto.beanstalk.layer1.Layer1.update_environment') def test_deploy(self, cav, ue): s3 = boto.connect_s3() s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
s3 = boto.connect_s3() s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded bucket name with tempfile.NamedTemporaryFile() as tmp: result = CliRunner().invoke(rubberjack, ['deploy', tmp.name], catch_exceptions=False) self.assertEquals(result.exit_c...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
de.return_value = { 'DescribeEnvironmentsResponse': { 'DescribeEnvironmentsResult': { 'Environments': [ { 'EnvironmentName': 'laterpay-devnull-live', # FIXME Remove hardcoded EnvName ...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
de.return_value = { 'DescribeEnvironmentsResponse': { 'DescribeEnvironmentsResult': { 'Environments': [ { 'EnvironmentName': 'laterpay-devnull-live', # FIXME Remove hardcoded EnvName ...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
CliRunner().invoke(rubberjack, ['--sigv4-host', 'foo', 'deploy'], catch_exceptions=False)
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
s3 = boto.connect_s3() s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded bucket name with tempfile.NamedTemporaryFile() as tmp: result = CliRunner().invoke(rubberjack, ['deploy', '--environment', 'wibble', tmp.name], catch_exceptions=False) self...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
s3 = boto.connect_s3() s3.create_bucket("laterpay-rubberjack-ebdeploy") # FIXME Remove hardcoded bucket name with tempfile.NamedTemporaryFile() as tmp: result = CliRunner().invoke(rubberjack, ['deploy', '--no-update-environment', tmp.name], catch_exceptions=False) self...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
bucket_name = 'rbbrjck-test' s3 = boto.connect_s3() s3.create_bucket(bucket_name) with tempfile.NamedTemporaryFile() as tmp: result = CliRunner().invoke(rubberjack, ['--bucket', bucket_name, 'deploy', tmp.name], catch_exceptions=False) self.assertEquals(result.e...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
CUSTOM_TO_ENVIRONMENT = "loremipsum" de.return_value = { 'DescribeEnvironmentsResponse': { 'DescribeEnvironmentsResult': { 'Environments': [ { 'EnvironmentName': CUSTOM_TO_ENVIRONMENT, ...
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_deploy
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_promote
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_promoting_same_version
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_sigv4
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_deploy_to_custom_environment
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_deploy_without_updating_the_environment
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_deploy_to_custom_bucket
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.crea...
test_promote_to_custom_environment
<|file_name|>test_paralleltools.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 # -*- coding: utf-8 -*-<|fim▁hole|> import sys from src.paralleltools import Parallel #------------------------------------------------------------------------- # # conftools.py is a simple module to manage .xml configuration fil...
__author__ = """Co-Pierre Georg (co-pierre.georg@uct.ac.za)"""
<|file_name|>test_paralleltools.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- __author__ = """Co-Pierre Georg (co-pierre.georg@uct.ac.za)""" import sys from src.paralleltools import Parallel #------------------------------------------------------------------------- # # conftools.p...
""" VARIABLES """ args = sys.argv config_file_name = args[1] """ CODE """ parallel = Parallel() parallel.create_config_files(config_file_name)
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r = self.nr - 2 return self.indx(r, c)
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
def __init__(self, nr, nc): self.nr = nr self.nc = nc def inc_r(self, ind): r, c = self.row_col(ind) r += 1 if r == self.nr: r = 0 if r == (self.nr - 1) and c == (self.nc - 1): r = 0 return self.indx(r, c) def dec_r(self, ind)...
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
self.nr = nr self.nc = nc
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r, c = self.row_col(ind) r += 1 if r == self.nr: r = 0 if r == (self.nr - 1) and c == (self.nc - 1): r = 0 return self.indx(r, c)
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r, c = self.row_col(ind) r -= 1 if r < 0: r = self.nr - 1 if r == (self.nr - 1) and c == (self.nc - 1): r = self.nr - 2 return self.indx(r, c)
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r, c = self.row_col(ind) c += 1 if c == self.nc: c = 0 if r == (self.nr - 1) and c == (self.nc - 1): c = 0 return self.indx(r, c)
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r, c = self.row_col(ind) c -= 1 if c < 0: c = self.nc - 1 if r == (self.nr - 1) and c == (self.nc - 1): c = self.nc - 2 return self.indx(r, c)
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
i = 0 for r in range(self.nr): for c in range(self.nc): if i == ind: return r, c i += 1
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
return r * self.nc + c
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r = 0
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r = 0
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r = self.nr - 1
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
r = self.nr - 2
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
c = 0
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
c = 0
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
c = self.nc - 1
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
c = self.nc - 2
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
return r, c
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
__init__
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
inc_r
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
dec_r
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
inc_c
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
dec_c
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
row_col
<|file_name|>rc_skip_last.py<|end_file_name|><|fim▁begin|>""" Follow Me activity for Sugar Copyright (C) 2010 Peter Hewitt This program 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 ...
indx
<|file_name|>d6ae359ab0d6_add_tenant_id_to_lcm_subscriptions_and_.py<|end_file_name|><|fim▁begin|># Copyright 2022 OpenStack Foundation # # 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 a...
<|file_name|>d6ae359ab0d6_add_tenant_id_to_lcm_subscriptions_and_.py<|end_file_name|><|fim▁begin|># Copyright 2022 OpenStack Foundation # # 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 a...
op.add_column('vnf_lcm_subscriptions', sa.Column('tenant_id', sa.String(length=64), nullable=False)) op.add_column('vnf_lcm_op_occs', sa.Column('tenant_id', sa.String(length=64), nullable=False))
<|file_name|>d6ae359ab0d6_add_tenant_id_to_lcm_subscriptions_and_.py<|end_file_name|><|fim▁begin|># Copyright 2022 OpenStack Foundation # # 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 a...
upgrade
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def load_list(filein): d = dict() for l in filein: l = eval(l) d[l[0]] = l[1] ret...
topicstream = Tweetstream(jsonfilee=sys.argv[1], jsonformat=False, keywords=keywords)
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def load_list(filein): <|fim_middle|> if __name__ == "__main__": follow = load_list...
d = dict() for l in filein: l = eval(l) d[l[0]] = l[1] return d
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def load_list(filein): d = dict() for l in filein: l = eval(l) d[l[0]] = l[1] ret...
follow = load_list(open(sys.argv[5], 'r')) keywords = open(sys.argv[2], 'r').readline().strip("\n").split(",") userstream = Tweetstream(jsonfilee=sys.argv[3], jsonformat=False, keywords=keywords) topicstream = Tweetstream(jsonfilee=sys.argv[1], jsonformat=False, keywords=keywords) ua = UserAnalyser (sys.argv[4], k...
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def load_list(filein): d = dict() for l in filein: l = eval(l) d[l[0]] = l[1] ret...
c += 1 for fuser in follow[t['user_id']]: if fuser in ua.usersScore: rank[t['id']] += ua.usersScore[fuser] n += 1
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def load_list(filein): d = dict() for l in filein: l = eval(l) d[l[0]] = l[1] ret...
rank[t['id']] += ua.usersScore[fuser] n += 1
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def load_list(filein): d = dict() for l in filein: l = eval(l) d[l[0]] = l[1] ret...
rank[t['id']] /= n
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import * from Tweetstream import * from UserAnalyser import * from TimeAnalyser import * import math import sys import pickle #Frequency over the common def <|fim_middle|>(filein): d = dict() for l in filein: l = eval(l) d[l[0]] = l[1]...
load_list
<|file_name|>passphrases.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Blueprint<|fim▁hole|> @route(bp, '/') def get(): p = Passphrase.get_random() return {"results": p}<|fim▁end|>
from jotonce.api import route from jotonce.passphrases.models import Passphrase bp = Blueprint('passphrase', __name__, url_prefix='/passphrase')
<|file_name|>passphrases.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Blueprint from jotonce.api import route from jotonce.passphrases.models import Passphrase bp = Blueprint('passphrase', __name__, url_prefix='/passphrase') @route(bp, '/') def get(): <|fim_middle|> <|fim▁end|>
p = Passphrase.get_random() return {"results": p}
<|file_name|>passphrases.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from flask import Blueprint from jotonce.api import route from jotonce.passphrases.models import Passphrase bp = Blueprint('passphrase', __name__, url_prefix='/passphrase') @route(bp, '/') def <|fim_middle|>(): p = Passphrase.get_ra...
get
<|file_name|>messages.py<|end_file_name|><|fim▁begin|>import string import socket import base64<|fim▁hole|> if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self.decoded="" def set ( self, content=" " ): base6...
import sys class message: def __init__(self, name="generate" ):
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: <|fim_middle|> class shoutbox_message(message): def __init__(self, name="generate" ): message.__init__( self , name) self.type="sb" <|fim▁end|>
def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self.decoded="" def set ( self, content=" " ): base64content = base64.b64encode ( content ) self.decoded="pi...
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): <|fim_middle|> def set ( self, content=" " ): base64content = base64.b64encode ( content ) self.decoded="piratebox;"+ sel...
if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self.decoded=""
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
base64content = base64.b64encode ( content ) self.decoded="piratebox;"+ self.type + ";01;" + self.name + ";" + base64content
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
message_parts = string.split ( self.decoded , ";" ) if message_parts[0] != "piratebox": return None b64_content_part = message_parts[4] content = base64.b64decode ( b64_content_part ) return content
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
return self.name
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
return self.decoded
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
self.decoded = decoded
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
def __init__(self, name="generate" ): message.__init__( self , name) self.type="sb"
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
message.__init__( self , name) self.type="sb"
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": <|fim_middle|> else: self.name=name self.type="gc" self.dec...
self.name=socket.gethostname()
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: <|fim_middle|> self.type="gc" ...
self.name=name
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
return None
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def <|fim_middle|>(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" ...
__init__
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
set
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
get
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
get_sendername
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
get_message
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
set_message
<|file_name|>messages.py<|end_file_name|><|fim▁begin|> import string import socket import base64 import sys class message: def __init__(self, name="generate" ): if name == "generate": self.name=socket.gethostname() else: self.name=name self.type="gc" self....
__init__
<|file_name|>check.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*- from findbilibili import * #funtion name [checkinfo] #判断要输出的回答 #param array 抓取的文字 #return string 回答 def checkinfo2(content): content[1] = content[1].decode('gbk') key = content[1].encode('utf-8') if key == '节操': return '这种东西早...
<|file_name|>check.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*- from findbilibili import * #funtion name [checkinfo] #判断要输出的回答 #param array 抓取的文字 #return string 回答 def checkinfo2(content): content[1] = content[1].decode<|fim_middle|> return string 最后更新网址 def animation(name): url = bilibili(name) ...
('gbk') key = content[1].encode('utf-8') if key == '节操': return '这种东西早就没有了' result = animation(key) #搜动漫 return result #funtion name [animation] #搜索动漫 #param array 动漫名字 #
<|file_name|>check.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*- from findbilibili import * #funtion name [checkinfo] #判断要输出的回答 #param array 抓取的文字 #return string 回答 def checkinfo2(content): content[1] = content[1].decode('gbk') key = content[1].encode('utf-8') if key == '节操': return '这种东西早...
[1] return result except IndexError: return '什么都找不到!'
<|file_name|>check.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*- from findbilibili import * #funtion name [checkinfo] #判断要输出的回答 #param array 抓取的文字 #return string 回答 def checkinfo2(content): content[1] = content[1].decode('gbk') key = content[1].encode('utf-8') if key == '节操': return '这种东西早...
animation(key) #搜动漫 return re