(meta_fn, metadata=None)
return None
Parse provided metadata and return the expected data filename. In the case of
    a metadata only distribution, or if the file does not exist, this will return
    'None'. The priority for conflicting:
      1. The file named <METAFILE_BASENAME>.sigmf-meta if it exists
      2. The file in the `core:dataset` field (Non-Compliant Dataset) if it exists
      3. None (may be a metadata only distribution)
Parse provided metadata and return the expected data filename. In the case of
    a metadata only distribution, or if the file does not exist, this will return
    'None'. The priority for conflicting:
      1. The file named <METAFILE_BASENAME>.sigmf-meta if it exists
      2. The file in the `core:dataset` field (Non-Compliant Dataset) if it exists
      3. None (may be a metadata only distribution)
Parse provided metadata and return the expected data filename . In the case of a metadata only distribution or if the file does not exist this will return None . The priority for conflicting : 1 . The file named <METAFILE_BASENAME > . sigmf - meta if it exists 2 . The file in the core : dataset field ( Non - Compliant Dataset ) if it exists 3 . None ( may be a metadata only distribution )
def get_dataset_filename_from_metadata(meta_fn, metadata=None):
    '''
    Parse provided metadata and return the expected data filename. In the case of
    a metadata only distribution, or if the file does not exist, this will return
    'None'. The priority for conflicting:
      1. The file named <METAFILE_BASENAME>.sigmf-meta if it exists
      2. The file in the `core:dataset` field (Non-Compliant Dataset) if it exists
      3. None (may be a metadata only distribution)
    '''
    compliant_data_fn = get_sigmf_filenames(meta_fn)['data_fn']
    noncompliant_data_fn = metadata['global'].get("core:dataset", None)

    if path.isfile(compliant_data_fn):
        if noncompliant_data_fn:
            warnings.warn(f'Compliant Dataset `{compliant_data_fn}` exists but '
                    f'"core:dataset" is also defined; using `{compliant_data_fn}`')
        return compliant_data_fn

    elif noncompliant_data_fn:
        if path.isfile(noncompliant_data_fn):
            if metadata['global'].get("core:metadata_only", False):
                warnings.warn('Schema defines "core:dataset" but "core:meatadata_only" '
                        f'also exists; using `{noncompliant_data_fn}`')
            return noncompliant_data_fn
        else:
            warnings.warn(f'Non-Compliant Dataset `{noncompliant_data_fn}` is specified '
                    'in "core:dataset" but does not exist!')

    return None
def get_dataset_filename_from_metadata ( meta_fn , metadata = None ) : compliant_data_fn = get_sigmf_filenames ( meta_fn ) [ 'data_fn' ] noncompliant_data_fn = metadata [ 'global' ] . get ( "core:dataset" , None ) if path . isfile ( compliant_data_fn ) : if noncompliant_data_fn : warnings . warn ( f'Compliant Dataset `{compliant_data_fn}` exists but ' f'"core:dataset" is also defined; using `{compliant_data_fn}`' ) return compliant_data_fn elif noncompliant_data_fn : if path . isfile ( noncompliant_data_fn ) : if metadata [ 'global' ] . get ( "core:metadata_only" , False ) : warnings . warn ( 'Schema defines "core:dataset" but "core:meatadata_only" ' f'also exists; using `{noncompliant_data_fn}`' ) return noncompliant_data_fn else : warnings . warn ( f'Non-Compliant Dataset `{noncompliant_data_fn}` is specified ' 'in "core:dataset" but does not exist!' ) return None