@staticmethod
def include_stream_from_metadata(metadata):
    """
        Should this stream be sync'd - as described in the meta data

        There are two different formats
        1. As found in the documentation
        https://github.com/singer-io/getting-started/blob/master/docs/SYNC_MODE.md#streamfield-selection
        "metadata": [
        {
          "breadcrumb": [],
          "metadata": {
            "selected": "false"
          }
        }]

        2. As found in the catalog.json file created during --discovery
            "metadata": {
                "selected": true,
                "is_view": false,
                "schema-name": "orders"
            },

        Both formats are handled here
        """
    if isinstance(metadata, dict):
        return metadata.get('selected')
    for item in metadata:
        if item.get('breadcrumb') == []:
            if item.get('metadata') and item['metadata'].get('selected'
                ) == 'false':
                return False
    return True
