code: def all_substrings(s):
      """Generate all substrings of `s`, in order of length then occurrence.
      Includes the empty string (first), and any duplicates that are present.
  
      >>> list(all_substrings('010'))
      ['', '0', '1', '0', '01', '10', '010']
      """
      yield s[:0]
      for n, _ in enumerate(s):
          for i in range(len(s) - n):
              yield s[i : i + n + 1]
  
file_path: catboost/contrib/python/hypothesis/py2/hypothesis/strategies/_internal/attrs.py
imports: from __future__ import absolute_import, division, print_function
  from functools import reduce
  from itertools import chain
  import attr
  import hypothesis.strategies
  from hypothesis.errors import ResolutionFailed
  from hypothesis.internal.compat import get_type_hints, string_types
  from hypothesis.strategies._internal.types import is_a_type, type_sorting_key
  from hypothesis.utils.conventions import infer
label_desc: Use image node_id 5 for calling a global function with example usage: all_substrings(s) without return types