prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | for file in each_file:
date_stamp = datetime.strptime(file, '%Y%m%d%H%M%S.html')
unix_time = time.mktime(date_stamp.timetuple())
full_file_path = each_dir + '/' + file
source = open(full_file_path,'r').read()
try:
try:
value = float(source.split(gather... |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | starting_stock_value = stock_price |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | starting_sp500_value = sp500_value |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | status = "outperform" |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | status = "underperform" |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | color = 'r' |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | color = 'g' |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time<|fim▁hole|>from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X files :)
# if git clone'ed th... | from datetime import datetime
import re |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | Key_Stats |
<|file_name|>p10.py<|end_file_name|><|fim▁begin|>import pandas as pd
import os
import time
from datetime import datetime
import re
from time import mktime
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import style
style.use("dark_background")
# path = "X:/Backups/intraQuarter" # for Windows with X ... | statspath = path+'/_KeyStats'
stock_list = [x[0] for x in os.walk(statspath)]
df = pd.DataFrame(
columns = [
'Date',
'Unix',
'Ticker',
'DE Ratio',
'Price',
'stock_p_change',
'SP500',
'sp500_p_change',
'Difference',
'Status'
]
)
sp500_df = pd... |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | self.set_address(host, port) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | return |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | stats = [stats] |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | if random.random() <= sample_rate:
for stat, value in data.items():
sampled_data[stat] = "%s|@%s" % (value, sample_rate) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | for stat, value in data.items():
sampled_data[stat] = "%s|@%s" % (value, sample_rate) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | sampled_data = data |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | sd = StatsD()
for i in range(1, 100):
sd.increment('test') |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | def __init__(self, host='localhost', port=8125, enabled=True, prefix=''):
self.addr = None
self.enabled = enabled
if enabled:
self.set_address(host, port)
self.prefix = prefix
self.udp_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def set_address(se... |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | self.addr = None
self.enabled = enabled
if enabled:
self.set_address(host, port)
self.prefix = prefix
self.udp_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | try:
self.addr = (socket.gethostbyname(host), port)
except socket.gaierror:
self.addr = None
self.enabled = False |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | log.debug('Entering timed context for %r' % (stat,))
start = time.time()
yield
duration = int((time.time() - start) * 1000)
log.debug('Exiting timed context for %r' % (stat,))
self.timing(stat, duration, sample_rate) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | """
Log timing information
"""
unit = 'ms'
log.debug('%r took %s %s' % (stats, time, unit))
self.update_stats(stats, "%s|%s" % (time, unit), sample_rate) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | """
Increments one or more stats counters
"""
self.update_stats(stats, 1, sample_rate) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | """
Decrements one or more stats counters
"""
self.update_stats(stats, -1, sample_rate) |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | """
Updates one or more stats counters by arbitrary amounts
"""
if not self.enabled or self.addr is None:
return
if type(stats) is not list:
stats = [stats]
data = {}
for stat in stats:
data["%s%s" % (self.prefix, stat)] = "%s|... |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | sampled_data = {}
if sample_rate < 1:
if random.random() <= sample_rate:
for stat, value in data.items():
sampled_data[stat] = "%s|@%s" % (value, sample_rate)
else:
sampled_data = data
try:
for stat, value in sampl... |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | """
Updates one or more stats counters by arbitrary amounts
""" |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | __init__ |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | set_address |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | timed |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | timing |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | increment |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | decrement |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | update_stats |
<|file_name|>statsd.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals
# Statsd client. Loosely based on the version by Steve Ivy <[email protected]>
import logging
import random
import socket
import time
from contextlib import contextmanager
log = log... | send |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | init |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | loadPlugin |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | unLoadPlugin |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | registerPlugin |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | getPlugins |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | getPluginsWithStatus |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | getLoadedPlugins |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | findPlugin |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | saveConfig |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | pass
# registerPlugin(plugin_instance) |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | """
@type plugin_name: str
"""
pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | """
@type plugin_name: str
"""
pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | """
@type plugin_instance: L{amsn2.plugins.developers.aMSNPlugin}
"""
pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | """
@type plugin_name: str
"""
pass |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | """
@type plugin_name: str
@type data: object
"""
pass |
<|file_name|>0014_auto_20171203_1316.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-12-03 13:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | ('length', models.SmallIntegerField()),
('trip_headsign', models.CharField(blank=True, max_length=200, null=True)),
('trip_short_name', models.CharField(blank=True, max_length=200, null=True)),
('direction', models.SmallIntegerField()), |
<|file_name|>0014_auto_20171203_1316.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-12-03 13:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
<|fim_middle|>
<... | dependencies = [
('busshaming', '0013_auto_20170917_0502'),
]
operations = [
migrations.CreateModel(
name='StopSequence',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('seq... |
<|file_name|>0005_news_image.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-23 15:47
from __future__ import unicode_literals
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('oktansite', '0004_news_attachment'),
]
operations = [
... | from django.db import migrations, models
import oktansite.models
|
<|file_name|>0005_news_image.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-23 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import oktansite.models
class Migration(migrations.Migration):
<|fim_middle|>
<|fim▁end|> | dependencies = [
('oktansite', '0004_news_attachment'),
]
operations = [
migrations.AddField(
model_name='news',
name='image',
field=models.ImageField(null=True, upload_to=oktansite.models.get_upload_path_news_attachment),
),
] |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
<|fim▁hole|>
def teardown(self):
shutil.rmtree(self.tmpdir)
def test_snapshot_fsm(self):
... | class TestSnapshot(object):
def setup(self):
self.tmpdir = tempfile.mkdtemp() |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
<|fim_middle|>
<|fim▁end|> | def setup(self):
self.tmpdir = tempfile.mkdtemp()
def teardown(self):
shutil.rmtree(self.tmpdir)
def test_snapshot_fsm(self):
lv = LogicalVolume.lookup('%s/%s' % (TEST_VG, TEST_LV))
name = lv.lv_name + '_snapshot'
size = 1 # extent
snapshot = Snapshot(name... |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
def setup(self):
<|fim_middle|>
def teardown(self):
shut... | self.tmpdir = tempfile.mkdtemp() |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
def setup(self):
self.tmpdir = tempfile.mkdtemp()
def teardown(se... | shutil.rmtree(self.tmpdir) |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
def setup(self):
self.tmpdir = tempfile.mkdtemp()
def teardown(se... | lv = LogicalVolume.lookup('%s/%s' % (TEST_VG, TEST_LV))
name = lv.lv_name + '_snapshot'
size = 1 # extent
snapshot = Snapshot(name, size, self.tmpdir)
snapshot.start(lv) |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
def setup(self):
self.tmpdir = tempfile.mkdtemp()
def teardown(se... | lv = LogicalVolume.lookup('%s/%s' % (TEST_VG, TEST_LV))
name = lv.lv_name + '_snapshot'
size = 1 # extent
snapshot = Snapshot(name, size, self.tmpdir)
def handle_event(event, *args, **kwargs):
pass
snapshot.register('pre-mount', handle_event)
snapsho... |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
def setup(self):
self.tmpdir = tempfile.mkdtemp()
def teardown(se... | pass |
<|file_name|>test_snapshot.py<|end_file_name|><|fim▁begin|>import shutil
from nose.tools import *
from holland.lib.lvm import LogicalVolume
from holland.lib.lvm.snapshot import *
from tests.constants import *
class TestSnapshot(object):
def setup(self):
self.tmpdir = tempfile.mkdtemp()
def teardown(se... | lv = LogicalVolume.lookup('%s/%s' % (TEST_VG, TEST_LV))
name = lv.lv_name + '_snapshot'
size = 1 # extent
snapshot = Snapshot(name, size, self.tmpdir)
def bad_callback(event, *args, **kwargs):
raise Exception("Oooh nooo!")
for evt in ('initialize', 'pre-sna... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 15