Returns .SAFE format structure in form of nested dictionaries. Either ``product_id`` or ``tile`` must be specified.

    :param product_id: original ESA product identification string. Default is ``None``
    :type product_id: str
    :param tile: tuple containing tile name and sensing time/date. Default is ``None``
    :type tile: (str, str)
    :param entire_product: in case tile is specified this flag determines if it will be place inside a .SAFE structure
                           of the product. Default is ``False``
    :type entire_product: bool
    :param bands: list of bands to download. If ``None`` all bands will be downloaded. Default is ``None``
    :type bands: list(str) or None
    :param data_source: In case of tile request the source of satellite data has to be specified. Default is Sentinel-2
                        L1C data.
    :type data_source: constants.DataSource
    :return: Nested dictionaries representing .SAFE structure.
    :rtype: dict

def get_safe_format(product_id=None, tile=None, entire_product=False, bands=None, data_source=DataSource.SENTINEL2_L1C):
    """
    Returns .SAFE format structure in form of nested dictionaries. Either ``product_id`` or ``tile`` must be specified.

    :param product_id: original ESA product identification string. Default is ``None``
    :type product_id: str
    :param tile: tuple containing tile name and sensing time/date. Default is ``None``
    :type tile: (str, str)
    :param entire_product: in case tile is specified this flag determines if it will be place inside a .SAFE structure
                           of the product. Default is ``False``
    :type entire_product: bool
    :param bands: list of bands to download. If ``None`` all bands will be downloaded. Default is ``None``
    :type bands: list(str) or None
    :param data_source: In case of tile request the source of satellite data has to be specified. Default is Sentinel-2
                        L1C data.
    :type data_source: constants.DataSource
    :return: Nested dictionaries representing .SAFE structure.
    :rtype: dict
    """
    entire_product = entire_product and product_id is None
    if tile is not None:
        safe_tile = SafeTile(tile_name=tile[0], time=tile[1], bands=bands, data_source=data_source)
        if not entire_product:
            return safe_tile.get_safe_struct()
        product_id = safe_tile.get_product_id()
    if product_id is None:
        raise ValueError('Either product_id or tile must be specified')
    safe_product = SafeProduct(product_id, tile_list=[tile[0]], bands=bands) if entire_product else \
        SafeProduct(product_id, bands=bands)
    return safe_product.get_safe_struct()