# Path: filetracker/utils.py
# def split_name(name):
#     """Splits a (possibly versioned) name into unversioned name and version.
# 
#     Returns a tuple ``(unversioned_name, version)``, where ``version`` may
#     be ``None``.
#     """
#     s = name.rsplit('@', 1)
#     if len(s) == 1:
#         return s[0], None
#     else:
#         try:
#             return s[0], int(s[1])
#         except ValueError:
#             raise ValueError(
#                 "Invalid Filetracker filename: version must " "be int, not %r" % (s[1],)
#             )
# 
# def mkdir(name):
#     try:
#         os.makedirs(name, 0o700)
#     except OSError as e:
#         if e.errno != errno.EEXIST:
#             raise


import collections
import os
import shutil
from filetracker.utils import split_name, mkdir
        """
        raise NotImplementedError

    def file_size(self, name):
        """Returns the size of the file.

        Raises an (unspecified) exception if file is not found.
        """
        raise NotImplementedError

    def get_stream(self, name):
        """Retrieves a file as a binary stream.

        Returns a pair (binary stream, versioned name).
        """
        raise NotImplementedError

    def get_file(self, name, filename):
        """Saves the content of file named ``name`` to ``filename``.

        Works like :meth:`get_stream`, but ``filename`` is the name of
        a file which will be created (or overwritten).

        Returns the full versioned name of the retrieved file.
        """
        stream, vname = self.get_stream(name)
        path, version = split_name(vname)

        dir_path = os.path.dirname(filename)
        if dir_path:

# Path: filetracker/utils.py
# def split_name(name):
#     """Splits a (possibly versioned) name into unversioned name and version.
# 
#     Returns a tuple ``(unversioned_name, version)``, where ``version`` may
#     be ``None``.
#     """
#     s = name.rsplit('@', 1)
#     if len(s) == 1:
#         return s[0], None
#     else:
#         try:
#             return s[0], int(s[1])
#         except ValueError:
#             raise ValueError(
#                 "Invalid Filetracker filename: version must " "be int, not %r" % (s[1],)
#             )
# 
# def mkdir(name):
#     try:
#         os.makedirs(name, 0o700)
#     except OSError as e:
#         if e.errno != errno.EEXIST:
#             raise


# Path: filetracker/client/data_store.py
import collections
import os
import shutil
from filetracker.utils import split_name, mkdir

        """
        raise NotImplementedError

    def file_size(self, name):
        """Returns the size of the file.

        Raises an (unspecified) exception if file is not found.
        """
        raise NotImplementedError

    def get_stream(self, name):
        """Retrieves a file as a binary stream.

        Returns a pair (binary stream, versioned name).
        """
        raise NotImplementedError

    def get_file(self, name, filename):
        """Saves the content of file named ``name`` to ``filename``.

        Works like :meth:`get_stream`, but ``filename`` is the name of
        a file which will be created (or overwritten).

        Returns the full versioned name of the retrieved file.
        """
        stream, vname = self.get_stream(name)
        path, version = split_name(vname)

        dir_path = os.path.dirname(filename)
        if dir_path:

            mkdir(dir_path)