parameters: (text, prefix, predicate=None)
return_statement: return ''.join(prefixed_lines())
docstring: Adds 'prefix' to the beginning of selected lines in 'text'.
      If 'predicate' is provided, 'prefix' will only be added to the lines
      where 'predicate(line)' is True. If 'predicate' is not provided,
      it will default to adding 'prefix' to all non-empty lines that do not
      consist solely of whitespace characters.
docstring_summary: Adds 'prefix' to the beginning of selected lines in 'text'.
      If 'predicate' is provided, 'prefix' will only be added to the lines
      where 'predicate(line)' is True. If 'predicate' is not provided,
      it will default to adding 'prefix' to all non-empty lines that do not
      consist solely of whitespace characters.
docstring_tokens: Adds prefix to the beginning of selected lines in text . If predicate is provided prefix will only be added to the lines where predicate ( line ) is True . If predicate is not provided it will default to adding prefix to all non - empty lines that do not consist solely of whitespace characters .
function: def indent(text, prefix, predicate=None):
      """Adds 'prefix' to the beginning of selected lines in 'text'.
      If 'predicate' is provided, 'prefix' will only be added to the lines
      where 'predicate(line)' is True. If 'predicate' is not provided,
      it will default to adding 'prefix' to all non-empty lines that do not
      consist solely of whitespace characters.
      """
      if predicate is None:
          def predicate(line):
              return line.strip()
  
      def prefixed_lines():
          for line in text.splitlines(True):
              yield (prefix + line if predicate(line) else line)
      return ''.join(prefixed_lines())
function_tokens: def indent ( text , prefix , predicate = None ) : if predicate is None : def predicate ( line ) : return line . strip ( ) def prefixed_lines ( ) : for line in text . splitlines ( True ) : yield ( prefix + line if predicate ( line ) else line ) return '' . join ( prefixed_lines ( ) )