import re


def natural_key(string):
  """Key to use for "natural sorting".

  Based on https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

  Args:
    string: The input string to produce key for

  Returns:
    key to use for natural sorting in conjunction with Python's built-in sort.
  """
  return [int(c) if c.isdigit() else c for c in re.split(r'(\d+)', string)]