(path_or_buffer)
Return True if path (or buffer) points to an Avro file. This will only
    work for avro files that contain the normal avro schema header like those
    create from :func:`~fastavro._write_py.writer`. This function is not intended
    to be used with binary data created from
    :func:`~fastavro._write_py.schemaless_writer` since that does not include the
    avro header.

    Parameters
    ----------
    path_or_buffer: path to file or file-like object
        Path to file
Return True if path (or buffer) points to an Avro file. This will only
    work for avro files that contain the normal avro schema header like those
    create from :func:`~fastavro._write_py.writer`. This function is not intended
    to be used with binary data created from
    :func:`~fastavro._write_py.schemaless_writer` since that does not include the
    avro header.
Return True if path ( or buffer ) points to an Avro file . This will only work for avro files that contain the normal avro schema header like those create from : func : ~fastavro . _write_py . writer . This function is not intended to be used with binary data created from : func : ~fastavro . _write_py . schemaless_writer since that does not include the avro header .
def is_avro(path_or_buffer):
    """Return True if path (or buffer) points to an Avro file. This will only
    work for avro files that contain the normal avro schema header like those
    create from :func:`~fastavro._write_py.writer`. This function is not intended
    to be used with binary data created from
    :func:`~fastavro._write_py.schemaless_writer` since that does not include the
    avro header.

    Parameters
    ----------
    path_or_buffer: path to file or file-like object
        Path to file
    """
    if isinstance(path_or_buffer, str):
        fp = open(path_or_buffer, "rb")
        close = True
    else:
        fp = path_or_buffer
        close = False

    try:
        header = fp.read(len(MAGIC))
        return header == MAGIC
    finally:
        if close:
            fp.close()
def is_avro ( path_or_buffer ) : if isinstance ( path_or_buffer , str ) : fp = open ( path_or_buffer , "rb" ) close = True else : fp = path_or_buffer close = False try : header = fp . read ( len ( MAGIC ) ) return header == MAGIC finally : if close : fp . close ( )