nodes: 0, module; 1, function_definition; 2, function_name:by_image_seq; 3, parameters; 4, block; 5, identifier:blocks; 6, identifier:image_seq; 7, expression_statement; 8, return_statement; 9, comment:"""Filter blocks to return only those associated with the provided image_seq number.
  
      Argument:
      List:blocks       -- List of block objects to sort.
      Int:image_seq    -- image_seq number found in ec_hdr.
      
      Returns:
      List        -- List of block indexes matching image_seq number.
      """; 10, call; 11, identifier:list; 12, argument_list; 13, call; 14, identifier:filter; 15, argument_list; 16, lambda; 17, identifier:blocks; 18, lambda_parameters; 19, comparison_operator:blocks[block].ec_hdr.image_seq == image_seq; 20, identifier:block; 21, attribute; 22, identifier:image_seq; 23, attribute; 24, identifier:image_seq; 25, subscript; 26, identifier:ec_hdr; 27, identifier:blocks; 28, identifier:block
code: def by_image_seq(blocks, image_seq):
      """Filter blocks to return only those associated with the provided image_seq number.
  
      Argument:
      List:blocks       -- List of block objects to sort.
      Int:image_seq    -- image_seq number found in ec_hdr.
      
      Returns:
      List        -- List of block indexes matching image_seq number.
      """
      return list(filter(lambda block: blocks[block].ec_hdr.image_seq == image_seq, blocks))