original_docstring: 
      Filter json stream using jmespath
  
      `expression` is a jmespath query string
  
      `stream` a text stream or file (default to stdin)
      
docstring: Filter json stream using jmespath
  `expression` is a jmespath query string
  
  `stream` a text stream or file (default to stdin)
docstring_tokens: Filter json stream using jmespath ` expression ` is a jmespath query string ` stream ` a text stream or file ( default to stdin )
code: def apply_filter(expression, stream, indent):
      '''
      Filter json stream using jmespath
  
      `expression` is a jmespath query string
  
      `stream` a text stream or file (default to stdin)
      '''
      if not stream:
          stream = click.get_text_stream('stdin')
  
      with stream:
          try:
              data = json.load(stream)
          except json.decoder.JSONDecodeError:
              click.echo('read data are not a json, :-(', err=True)
              return
  
      try:
          results = json_filter(expression, data)
      except FilterError as exc:
          click.echo('{}'.format(exc), err=True)
          return
  
      click.echo('{}'.format(json.dumps(results, indent=indent)))
      return results or []
code_tokens: def apply_filter ( expression , stream , indent ) : if not stream : stream = click . get_text_stream ( 'stdin' ) with stream : try : data = json . load ( stream ) except json . decoder . JSONDecodeError : click . echo ( 'read data are not a json, :-(' , err = True ) return try : results = json_filter ( expression , data ) except FilterError as exc : click . echo ( '{}' . format ( exc ) , err = True ) return click . echo ( '{}' . format ( json . dumps ( results , indent = indent ) ) ) return results or [ ]
short_docstring: Filter json stream using jmespath
  `expression` is a jmespath query string
short_docstring_tokens: Filter json stream using jmespath ` expression ` is a jmespath query string
comment: '''
      Filter json stream using jmespath
  
      `expression` is a jmespath query string
  
      `stream` a text stream or file (default to stdin)
      '''