original_docstring: Return pretty-formatted item.
docstring: Return pretty-formatted item.
docstring_tokens: Return pretty - formatted item .
code: def format(item):
          """Return pretty-formatted item."""
          def _hostname_from_tags(tags):
              """Get hostname from tags."""
              for tag in tags:
                  if tag['Key'] == 'Name':
                      return tag['Value']
              return None
  
          item_schema = [
              ('hostname', 'Tags', _hostname_from_tags),
              ('id', 'InstanceId', None),
              ('arch', 'Architecture', None),
              ('image', 'ImageId', None),
              ('type', 'InstanceType', None),
              ('key', 'KeyName', None),
              ('launch', 'LaunchTime', None),
              ('status', 'Status', None),
              ('vpc', 'VpcId', None),
              ('subnet', 'SubnetId', None),
              ('tags', 'Tags', _fmt_tags()),
          ]
  
          list_schema = [
              ('hostname', 'Tags', _hostname_from_tags),
              ('id', 'InstanceId', None),
              ('image', 'ImageId', None),
              ('type', 'InstanceType', None),
              ('key', 'KeyName', None),
              ('vpc', 'VpcId', None),
              ('subnet', 'SubnetId', None),
              ('tags', 'Tags', _fmt_tags()),
          ]
  
          format_item = tablefmt.make_dict_to_table(item_schema)
          format_list = tablefmt.make_list_to_table(list_schema)
  
          if isinstance(item, list):
              return format_list(item)
          else:
              return format_item(item)
code_tokens: def format ( item ) : def _hostname_from_tags ( tags ) : """Get hostname from tags.""" for tag in tags : if tag [ 'Key' ] == 'Name' : return tag [ 'Value' ] return None item_schema = [ ( 'hostname' , 'Tags' , _hostname_from_tags ) , ( 'id' , 'InstanceId' , None ) , ( 'arch' , 'Architecture' , None ) , ( 'image' , 'ImageId' , None ) , ( 'type' , 'InstanceType' , None ) , ( 'key' , 'KeyName' , None ) , ( 'launch' , 'LaunchTime' , None ) , ( 'status' , 'Status' , None ) , ( 'vpc' , 'VpcId' , None ) , ( 'subnet' , 'SubnetId' , None ) , ( 'tags' , 'Tags' , _fmt_tags ( ) ) , ] list_schema = [ ( 'hostname' , 'Tags' , _hostname_from_tags ) , ( 'id' , 'InstanceId' , None ) , ( 'image' , 'ImageId' , None ) , ( 'type' , 'InstanceType' , None ) , ( 'key' , 'KeyName' , None ) , ( 'vpc' , 'VpcId' , None ) , ( 'subnet' , 'SubnetId' , None ) , ( 'tags' , 'Tags' , _fmt_tags ( ) ) , ] format_item = tablefmt . make_dict_to_table ( item_schema ) format_list = tablefmt . make_list_to_table ( list_schema ) if isinstance ( item , list ) : return format_list ( item ) else : return format_item ( item )
short_docstring: Return pretty-formatted item.
short_docstring_tokens: Return pretty - formatted item .
comment: """Return pretty-formatted item."""$SEP$"""Get hostname from tags."""