docs: def get_variables(text):
      """Extracts variables that can be used in templating engines.
  
      Each variable is defined on a single line in the following way:
  
          ~ var: text
  
      The ~ must be at the start of a newline, followed by at least one
      space. var can be any sequence of characters that does not contain
      a ":". text can be any sequence of characters.
  
      RETURNS:
      text      -- str; text with all variable definitions removed
      variables -- dict; variable to value mappings
      """
      variables = {var: value for var, value in re_vars.findall(text)}
      text = re_vars.sub('', text)
      return text, variables