prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
max_depth = 2
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
max_depth = 1
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
os.rmdir(delete_path)
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
can_write
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
can_delete
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
__unicode__
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
extension_allowed
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
upload_path
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
get_filename
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
get_size
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
save
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
__unicode__
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings as django_settings from django.db.models import signals from know.plugins.attachments import settings from know...
on_revision_delete
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL <|fim▁hole|> def get_mesg(self,byte_array): ...
Gammu-smsd will send the record Using command line will cause smsd stop for a while '''
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): <|fim_middle|> <|fim▁end|>
''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command line will cause smsd stop for a while ''' def get_mesg(self,byte_array): mesg = "" for byte in byte_array: if byte < 16 : ...
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
mesg = "" for byte in byte_array: if byte < 16 : val = hex(byte) if val == "0x0" : val = "00" else : val = val.lstrip("0x") val = "{0}{1}".format('0', val) else :...
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
sEng = SQLEng() sEng.exeSQL(sEng.getInsetSentBox(to, self.get_mesg(byte_array)))
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
''' Constructor ''' pass
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
val = hex(byte) if val == "0x0" : val = "00" else : val = val.lstrip("0x") val = "{0}{1}".format('0', val)
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
val = "00"
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
val = val.lstrip("0x") val = "{0}{1}".format('0', val)
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
val = hex(byte) val = val.lstrip("0x")
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
get_mesg
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
send
<|file_name|>GammuSender.py<|end_file_name|><|fim▁begin|>''' Created on Jan 18, 2010 @author: Paul ''' from SQLEng import SQLEng class PduSender(object): ''' classdocs This class is designed for Gammu-smsd Inserting a record into MySQL Gammu-smsd will send the record Using command...
__init__
<|file_name|>pyunit_mnist_manyCols_gbm_large.py<|end_file_name|><|fim▁begin|>import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator def mnist_many_cols_gbm_large(): train = h2o.import_file(path=pyunit_utils.locate("bigdata/lapto...
min_rows=10,
<|file_name|>pyunit_mnist_manyCols_gbm_large.py<|end_file_name|><|fim▁begin|>import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator def mnist_many_cols_gbm_large(): <|fim_middle|> if __name__ == "__main__": pyunit_utils.sta...
train = h2o.import_file(path=pyunit_utils.locate("bigdata/laptop/mnist/train.csv.gz")) train.tail() gbm_mnist = H2OGradientBoostingEstimator(ntrees=1, max_depth=1, min_rows=10, learn_...
<|file_name|>pyunit_mnist_manyCols_gbm_large.py<|end_file_name|><|fim▁begin|>import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator def mnist_many_cols_gbm_large(): train = h2o.import_file(path=pyunit_utils.locate("bigdata/lapto...
pyunit_utils.standalone_test(mnist_many_cols_gbm_large)
<|file_name|>pyunit_mnist_manyCols_gbm_large.py<|end_file_name|><|fim▁begin|>import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator def mnist_many_cols_gbm_large(): train = h2o.import_file(path=pyunit_utils.locate("bigdata/lapto...
mnist_many_cols_gbm_large()
<|file_name|>pyunit_mnist_manyCols_gbm_large.py<|end_file_name|><|fim▁begin|>import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.gbm import H2OGradientBoostingEstimator def <|fim_middle|>(): train = h2o.import_file(path=pyunit_utils.locate("bigdata/laptop/mnist/tra...
mnist_many_cols_gbm_large
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window.<|fim▁hole|>This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import un...
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
def update(self): # move, check bounds p = self.properties self.x += p['dx'] self.y += p['dy'] if self.left < 0: self.left = 0 p['dx'] = -p['dx'] elif self.right > 320: self.right = 320 p['dx'] = -p['dx'] if self...
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
p = self.properties self.x += p['dx'] self.y += p['dy'] if self.left < 0: self.left = 0 p['dx'] = -p['dx'] elif self.right > 320: self.right = 320 p['dx'] = -p['dx'] if self.bottom < 0: self.bottom = 0 ...
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
def test_sprite(self): w = pyglet.window.Window(width=320, height=320) image = Image2d.load(ball_png) ball1 = BouncySprite(0, 0, 64, 64, image, properties=dict(dx=10, dy=5)) ball2 = BouncySprite(288, 0, 64, 64, image, properties=dict(dx=-10, dy=5)) ...
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
w = pyglet.window.Window(width=320, height=320) image = Image2d.load(ball_png) ball1 = BouncySprite(0, 0, 64, 64, image, properties=dict(dx=10, dy=5)) ball2 = BouncySprite(288, 0, 64, 64, image, properties=dict(dx=-10, dy=5)) view = FlatView(0, 0, 32...
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
self.left = 0 p['dx'] = -p['dx']
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
self.right = 320 p['dx'] = -p['dx']
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
self.bottom = 0 p['dy'] = -p['dy']
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
self.top = 320 p['dy'] = -p['dy']
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
if 'overlap' not in ball2.properties: ball2.properties['overlap'] = e ball2.add_effect(e)
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
ball2.properties['overlap'] = e ball2.add_effect(e)
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
ball2.remove_effect(e) del ball2.properties['overlap']
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
update
<|file_name|>SPRITE_OVERLAP.py<|end_file_name|><|fim▁begin|># !/usr/bin/env python """Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. """ __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest fr...
test_sprite
<|file_name|>version.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms.<|fim▁hole|><|fim▁end|>
__version__ = "1.2.0.11"
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#coding=utf-8 import unittest import HTMLTestRunner import time from config import globalparam from public.common import sendmail def run(): test_dir = './testcase' suite = unittest.defaultTestLoader.discover(start_dir=test_dir,pattern='test*.py') now = ti...
run()
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#coding=utf-8 import unittest import HTMLTestRunner import time from config import globalparam from public.common import sendmail def run(): <|fim_middle|> __main__': run()<|fim▁end|>
test_dir = './testcase' suite = unittest.defaultTestLoader.discover(start_dir=test_dir,pattern='test*.py') now = time.strftime('%Y-%m-%d_%H_%M_%S') reportname = globalparam.report_path + '\\' + 'TestResult' + now + '.html' with open(reportname,'wb') as f: runner = HTMLTestRunner.HTMLTestRun...
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#coding=utf-8 import unittest import HTMLTestRunner import time from config import globalparam from public.common import sendmail def run(): test_dir = './testcase' suite = unittest.defaultTestLoader.discover(start_dir=test_dir,pattern='test*.py') now = ti...
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#coding=utf-8 import unittest import HTMLTestRunner import time from config import globalparam from public.common import sendmail def <|fim_middle|>(): test_dir = './testcase' suite = unittest.defaultTestLoader.discover(start_dir=test_dir,pattern='test*.py') ...
run
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
self.ExecOpCode(self.op) def testExportRemoveInstance(self): op = self.CopyOpCode(self.op, remove_instance=True)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
@patchUtils("instance_utils") def testPrepareLocalExport(self, utils): utils.ReadOneLineFile.return_value = "cluster_secret" inst = self.cfg.AddNewInstance() op = opcodes.OpBackupPrepare(instance_name=inst.name, mode=constants.EXPORT_MODE_LOCAL) self.ExecOpCode(op) ...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
utils.ReadOneLineFile.return_value = "cluster_secret" inst = self.cfg.AddNewInstance() op = opcodes.OpBackupPrepare(instance_name=inst.name, mode=constants.EXPORT_MODE_LOCAL) self.ExecOpCode(op)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
utils.ReadOneLineFile.return_value = "cluster_secret" inst = self.cfg.AddNewInstance() self.rpc.call_x509_cert_create.return_value = \ self.RpcResultsBuilder() \ .CreateSuccessfulNodeResult(inst.primary_node, ("key_name", ...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
def setUp(self): super(TestLUBackupExportBase, self).setUp() self.rpc.call_instance_start.return_value = \ self.RpcResultsBuilder() \ .CreateSuccessfulNodeResult(self.master, True) self.rpc.call_blockdev_assemble.return_value = \ self.RpcResultsBuilder() \ .CreateSuccessfulNo...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
super(TestLUBackupExportBase, self).setUp() self.rpc.call_instance_start.return_value = \ self.RpcResultsBuilder() \ .CreateSuccessfulNodeResult(self.master, True) self.rpc.call_blockdev_assemble.return_value = \ self.RpcResultsBuilder() \ .CreateSuccessfulNodeResult(self.maste...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
return self.RpcResultsBuilder() \ .CreateSuccessfulNodeResult(node_uuid, [objects.ImportExportStatus( exit_status=0 )])
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
return self.RpcResultsBuilder() \ .CreateSuccessfulNodeResult(node_uuid)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
inst = self.cfg.AddNewInstance(admin_state=constants.ADMINST_UP) op = opcodes.OpBackupExport(instance_name=inst.name, target_node=self.master.name, shutdown=False, remove_instance=True) self.ExecOpCodeExpectOpPre...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
inst = self.cfg.AddNewInstance(disk_template=constants.DT_FILE) op = opcodes.OpBackupExport(instance_name=inst.name, target_node=self.master.name) self.ExecOpCodeExpectOpPrereqError( op, "Export not supported for instances with file-based disks")
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
def setUp(self): super(TestLUBackupExportLocalExport, self).setUp() self.inst = self.cfg.AddNewInstance() self.target_node = self.cfg.AddNewNode() self.op = opcodes.OpBackupExport(mode=constants.EXPORT_MODE_LOCAL, instance_name=self.inst.name, ...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
super(TestLUBackupExportLocalExport, self).setUp() self.inst = self.cfg.AddNewInstance() self.target_node = self.cfg.AddNewNode() self.op = opcodes.OpBackupExport(mode=constants.EXPORT_MODE_LOCAL, instance_name=self.inst.name, ta...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
inst = self.cfg.AddNewInstance(admin_state=constants.ADMINST_UP) op = self.CopyOpCode(self.op, instance_name=inst.name, shutdown=True) self.ExecOpCode(op)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
self.ExecOpCode(self.op)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
op = self.CopyOpCode(self.op, remove_instance=True) self.ExecOpCode(op)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
op = self.CopyOpCode(self.op, compress="lzop") self.cfg.SetCompressionTools(["gzip", "lzop"]) self.ExecOpCode(op)
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
op = self.CopyOpCode(self.op, compress="invalid") self.cfg.SetCompressionTools(["gzip", "lzop"]) self.ExecOpCodeExpectOpPrereqError(op, "Compression tool not allowed")
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
def setUp(self): super(TestLUBackupExportRemoteExport, self).setUp() self.inst = self.cfg.AddNewInstance() self.op = opcodes.OpBackupExport(mode=constants.EXPORT_MODE_REMOTE, instance_name=self.inst.name, target_node=[], ...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
super(TestLUBackupExportRemoteExport, self).setUp() self.inst = self.cfg.AddNewInstance() self.op = opcodes.OpBackupExport(mode=constants.EXPORT_MODE_REMOTE, instance_name=self.inst.name, target_node=[], ...
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
op = self.CopyOpCode(self.op, x509_key_name=self.REMOVE) self.ExecOpCodeExpectOpPrereqError(op, "Missing X509 key name for encryption")
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
op = self.CopyOpCode(self.op, destination_x509_ca=self.REMOVE) self.ExecOpCodeExpectOpPrereqError(op, "Missing destination X509 CA")
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testutils.GanetiTestProgram()
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testPrepareLocalExport
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testPrepareRemoteExport
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
setUp
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
ImpExpStatus
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
ImpExpCleanup
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testRemoveRunningInstanceWithoutShutdown
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testUnsupportedDiskTemplate
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
setUp
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testExportWithShutdown
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testExportDeactivatedDisks
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testExportRemoveInstance
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testValidCompressionTool
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testInvalidCompressionTool
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
setUp
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testRemoteExportWithoutX509KeyName
<|file_name|>backup_unittest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (C) 2013 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
testRemoteExportWithoutX509DestCa
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
if isinstance(minute, int): return "%d:%02d" % (divmod(minute, 60)) return None
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
params['url'] = base_url + '?' + urlencode({ 'search': query, 'start': (params['pageno'] - 1) * 10, 'count': 10, 'sort': '-match', 'nsfw': safesearch_table[params['safesearch']] }) language = params['language'].split('-')[0] if language in supported_languages: ...
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
results = [] search_results = loads(resp.text) if 'data' not in search_results: return [] for result in search_results['data']: title = result['name'] content = result['description'] thumbnail = result['thumbnailUrl'] publishedDate = parser.parse(result['publis...
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
return "%d:%02d" % (divmod(minute, 60))
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
params['url'] += '&languageOneOf[]=' + language
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
time = datetime.now().date() + time_range_table[params['time_range']] params['url'] += '&startDate=' + time.isoformat()
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
return []
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
minute_to_hm
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
request
<|file_name|>sepiasearch.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later """ SepiaSearch (Videos) """ from json import loads from dateutil import parser, relativedelta from urllib.parse import urlencode from datetime import datetime # about about = { "website": 'https://sepiasearch.o...
response
<|file_name|>test.py<|end_file_name|><|fim▁begin|># coding=utf-8 from __future__ import absolute_import from .base import * # ######### IN-MEMORY TEST DATABASE DATABASES = {<|fim▁hole|> "NAME": ":memory:", }, }<|fim▁end|>
"default": { "ENGINE": "django.db.backends.sqlite3",
<|file_name|>dcf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys sys.path.append('/var/www/html/valumodel.com/scripts/dcf')<|fim▁hole|> try: assumptions['Tax Rate'] = float(tax_rate)/100.0 assumptions['Growth Rate 1 year out'] = float(growth_rate_1_year_out)/100.0 assumptions['SGA % of...
from calc_dcf import calc_dcf def create_dcf(req, tax_rate, growth_rate_1_year_out, sga_of_sales, da_of_sales, capex_of_sales, nwc_of_sales, levered_beta, current_yield, exit_multiple, ticker): assumptions = {}