# Path: nptdms/tdms.py
# class TdmsFile(object):
# class TdmsGroup(object):
# class TdmsChannel(object):
# class DataChunk(object):
# class GroupDataChunk(object):
# class ChannelDataChunk(object):
#     def read(file, raw_timestamps=False, memmap_dir=None):
#     def open(file, raw_timestamps=False, memmap_dir=None):
#     def read_metadata(file, raw_timestamps=False):
#     def __init__(self, file, raw_timestamps=False, memmap_dir=None, read_metadata_only=False, keep_open=False):
#     def groups(self):
#     def tdms_version(self):
#     def properties(self):
#     def as_dataframe(self, time_index=False, absolute_time=False, scaled_data=True):
#     def as_hdf(self, filepath, mode='w', group='/'):
#     def data_chunks(self):
#     def close(self):
#     def __len__(self):
#     def __iter__(self):
#     def __getitem__(self, group_name):
#     def _ipython_key_completions_(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def _read_file(self, tdms_reader, read_metadata_only, keep_open):
#     def _read_data(self, tdms_reader):
#     def _convert_properties(self, properties):
#         def convert_prop(val):
#     def __init__(self, path, properties, channels):
#     def __repr__(self):
#     def path(self):
#     def name(self):
#     def channels(self):
#     def as_dataframe(self, time_index=False, absolute_time=False, scaled_data=True):
#     def __len__(self):
#     def __iter__(self):
#     def __getitem__(self, channel_name):
#     def _ipython_key_completions_(self):
#     def __init__(
#             self, path, data_type, scaler_data_types, number_values,
#             properties, group_properties, file_properties,
#             tdms_reader, raw_timestamps, memmap_dir):
#     def __repr__(self):
#     def __len__(self):
#     def __iter__(self):
#     def __getitem__(self, index):
#     def path(self):
#     def name(self):
#     def group_name(self):
#     def dtype(self):
#     def _raw_data_dtype(self):
#     def data(self):
#     def raw_data(self):
#     def raw_scaler_data(self):
#     def data_chunks(self):
#     def read_data(self, offset=0, length=None, scaled=True):
#     def time_track(self, absolute_time=False, accuracy='ns'):
#     def as_dataframe(self, time_index=False, absolute_time=False, scaled_data=True):
#     def _read_data_values(self):
#     def _read_slice(self, start, stop, step):
#     def _read_at_index(self, index):
#     def _scale_data(self, raw_data):
#     def _scaling(self):
#     def _read_channel_data_chunks(self):
#     def _read_channel_data_chunk_for_index(self, index):
#     def _read_channel_data(self, offset=0, length=None):
#     def _set_raw_data(self, data):
#     def __init__(self, tdms_file, raw_data_chunk, channel_offsets):
#     def __getitem__(self, group_name):
#     def groups(self):
#     def __init__(self, tdms_file, group, raw_data_chunk, channel_offsets):
#     def __getitem__(self, channel_name):
#     def channels(self):
#     def __init__(self, channel, raw_data_chunk, offset):
#     def __len__(self):
#     def __getitem__(self, index):
#     def __iter__(self):
#     def _data(self):
# def _convert_data_chunk(chunk, raw_timestamps):
# def _convert_channel_data_chunk(channel_chunk, raw_timestamps):


import binascii
import os
import struct
import tempfile
import numpy as np
from contextlib import contextmanager
from io import BytesIO
from nptdms import tdms
        self._content.append((lead_in, metadata_bytes, data_bytes))

    def get_tempfile(self, **kwargs):
        named_file = tempfile.NamedTemporaryFile(suffix=".tdms", **kwargs)
        file = named_file.file
        file.write(self._get_contents())
        file.seek(0)
        return named_file

    @contextmanager
    def get_tempfile_with_index(self):
        directory = tempfile.mkdtemp()
        tdms_path = os.path.join(directory, 'test_file.tdms')
        tdms_index_path = os.path.join(directory, 'test_file.tdms_index')
        with open(tdms_path, 'wb') as file:
            file.write(self._get_contents())
        with open(tdms_index_path, 'wb') as file:
            file.write(self._get_index_contents())
        try:
            yield tdms_path
        finally:
            os.unlink(tdms_path)
            os.unlink(tdms_index_path)
            os.rmdir(directory)

    def load(self, *args, **kwargs):
        with tempfile.NamedTemporaryFile(suffix=".tdms") as named_file:
            file = named_file.file
            file.write(self._get_contents())
            file.seek(0)

# Path: nptdms/tdms.py
# class TdmsFile(object):
# class TdmsGroup(object):
# class TdmsChannel(object):
# class DataChunk(object):
# class GroupDataChunk(object):
# class ChannelDataChunk(object):
#     def read(file, raw_timestamps=False, memmap_dir=None):
#     def open(file, raw_timestamps=False, memmap_dir=None):
#     def read_metadata(file, raw_timestamps=False):
#     def __init__(self, file, raw_timestamps=False, memmap_dir=None, read_metadata_only=False, keep_open=False):
#     def groups(self):
#     def tdms_version(self):
#     def properties(self):
#     def as_dataframe(self, time_index=False, absolute_time=False, scaled_data=True):
#     def as_hdf(self, filepath, mode='w', group='/'):
#     def data_chunks(self):
#     def close(self):
#     def __len__(self):
#     def __iter__(self):
#     def __getitem__(self, group_name):
#     def _ipython_key_completions_(self):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def _read_file(self, tdms_reader, read_metadata_only, keep_open):
#     def _read_data(self, tdms_reader):
#     def _convert_properties(self, properties):
#         def convert_prop(val):
#     def __init__(self, path, properties, channels):
#     def __repr__(self):
#     def path(self):
#     def name(self):
#     def channels(self):
#     def as_dataframe(self, time_index=False, absolute_time=False, scaled_data=True):
#     def __len__(self):
#     def __iter__(self):
#     def __getitem__(self, channel_name):
#     def _ipython_key_completions_(self):
#     def __init__(
#             self, path, data_type, scaler_data_types, number_values,
#             properties, group_properties, file_properties,
#             tdms_reader, raw_timestamps, memmap_dir):
#     def __repr__(self):
#     def __len__(self):
#     def __iter__(self):
#     def __getitem__(self, index):
#     def path(self):
#     def name(self):
#     def group_name(self):
#     def dtype(self):
#     def _raw_data_dtype(self):
#     def data(self):
#     def raw_data(self):
#     def raw_scaler_data(self):
#     def data_chunks(self):
#     def read_data(self, offset=0, length=None, scaled=True):
#     def time_track(self, absolute_time=False, accuracy='ns'):
#     def as_dataframe(self, time_index=False, absolute_time=False, scaled_data=True):
#     def _read_data_values(self):
#     def _read_slice(self, start, stop, step):
#     def _read_at_index(self, index):
#     def _scale_data(self, raw_data):
#     def _scaling(self):
#     def _read_channel_data_chunks(self):
#     def _read_channel_data_chunk_for_index(self, index):
#     def _read_channel_data(self, offset=0, length=None):
#     def _set_raw_data(self, data):
#     def __init__(self, tdms_file, raw_data_chunk, channel_offsets):
#     def __getitem__(self, group_name):
#     def groups(self):
#     def __init__(self, tdms_file, group, raw_data_chunk, channel_offsets):
#     def __getitem__(self, channel_name):
#     def channels(self):
#     def __init__(self, channel, raw_data_chunk, offset):
#     def __len__(self):
#     def __getitem__(self, index):
#     def __iter__(self):
#     def _data(self):
# def _convert_data_chunk(chunk, raw_timestamps):
# def _convert_channel_data_chunk(channel_chunk, raw_timestamps):


# Path: nptdms/test/util.py
import binascii
import os
import struct
import tempfile
import numpy as np
from contextlib import contextmanager
from io import BytesIO
from nptdms import tdms

        self._content.append((lead_in, metadata_bytes, data_bytes))

    def get_tempfile(self, **kwargs):
        named_file = tempfile.NamedTemporaryFile(suffix=".tdms", **kwargs)
        file = named_file.file
        file.write(self._get_contents())
        file.seek(0)
        return named_file

    @contextmanager
    def get_tempfile_with_index(self):
        directory = tempfile.mkdtemp()
        tdms_path = os.path.join(directory, 'test_file.tdms')
        tdms_index_path = os.path.join(directory, 'test_file.tdms_index')
        with open(tdms_path, 'wb') as file:
            file.write(self._get_contents())
        with open(tdms_index_path, 'wb') as file:
            file.write(self._get_index_contents())
        try:
            yield tdms_path
        finally:
            os.unlink(tdms_path)
            os.unlink(tdms_index_path)
            os.rmdir(directory)

    def load(self, *args, **kwargs):
        with tempfile.NamedTemporaryFile(suffix=".tdms") as named_file:
            file = named_file.file
            file.write(self._get_contents())
            file.seek(0)

            return tdms.TdmsFile(file, *args, **kwargs)