# Path: mom/builtins.py
# def byte(number):
# def bytes_leading(raw_bytes, needle=_compat.ZERO_BYTE):
# def bytes_trailing(raw_bytes, needle=_compat.ZERO_BYTE):
# def bin(number, prefix="0b"):
# def hex(number, prefix="0x"):
# def is_sequence(obj):
# def is_unicode(obj):
# def is_bytes(obj):
# def is_bytes_or_unicode(obj):
# def is_integer(obj):
# def integer_byte_length(number):
# def integer_byte_size(number):
# def integer_bit_length(number):
# def integer_bit_size(number):
# def integer_bit_count(number):
# def is_even(num):
# def is_odd(num):
# def is_positive(num):
# def is_negative(num):


import functools
import os
from mom import builtins
__all__ = [
    "absolute_path",
    "get_dir_walker",
    "list_directories",
    "list_files",
    "listdir",
    "parent_dir_path",
    "real_absolute_path",
    "walk",
    ]


def get_dir_walker(recursive, topdown=True, followlinks=False):
  """
  Returns a recursive or a non-recursive directory walker.

  :param recursive:
      ``True`` produces a recursive walker; ``False`` produces a non-recursive
      walker.
  :returns:
      A walker function.
  """
  if recursive:
    walker = functools.partial(os.walk,
                               topdown=topdown,
                               followlinks=followlinks)
  else:

    def walker(path, topdown=topdown, followlinks=followlinks):
      """Alternative walker."""

# Path: mom/builtins.py
# def byte(number):
# def bytes_leading(raw_bytes, needle=_compat.ZERO_BYTE):
# def bytes_trailing(raw_bytes, needle=_compat.ZERO_BYTE):
# def bin(number, prefix="0b"):
# def hex(number, prefix="0x"):
# def is_sequence(obj):
# def is_unicode(obj):
# def is_bytes(obj):
# def is_bytes_or_unicode(obj):
# def is_integer(obj):
# def integer_byte_length(number):
# def integer_byte_size(number):
# def integer_bit_length(number):
# def integer_bit_size(number):
# def integer_bit_count(number):
# def is_even(num):
# def is_odd(num):
# def is_positive(num):
# def is_negative(num):


# Path: mom/os/path.py
import functools
import os
from mom import builtins

__all__ = [
    "absolute_path",
    "get_dir_walker",
    "list_directories",
    "list_files",
    "listdir",
    "parent_dir_path",
    "real_absolute_path",
    "walk",
    ]


def get_dir_walker(recursive, topdown=True, followlinks=False):
  """
  Returns a recursive or a non-recursive directory walker.

  :param recursive:
      ``True`` produces a recursive walker; ``False`` produces a non-recursive
      walker.
  :returns:
      A walker function.
  """
  if recursive:
    walker = functools.partial(os.walk,
                               topdown=topdown,
                               followlinks=followlinks)
  else:

    def walker(path, topdown=topdown, followlinks=followlinks):
      """Alternative walker."""

      yield builtins.next(os.walk(path,