def size(pathname):
    """ Returns size of a file or folder in Bytes

    :param pathname: path to file or folder to be sized
    :type pathname: str
    :return: size of file or folder in Bytes
    :rtype: int
    :raises: os.error if file is not accessible
    """
    if os.path.isfile(pathname):
        return os.path.getsize(pathname)
    return sum([size('{}/{}'.format(pathname, name)) for name in get_content_list(pathname)])
Returns size of a file or folder in Bytes

    :param pathname: path to file or folder to be sized
    :type pathname: str
    :return: size of file or folder in Bytes
    :rtype: int
    :raises: os.error if file is not accessible