7:3
  5  Aˆl–Ðz¾”ªC]Šq@¿q§®6Ú˜´o�þ\~Eœl¸ã¯Èë¤óÜƒ�³ÛÃØ �   A# generated from /usr/share/base-passwd/{passwd,group}.master
g adm        4     -
g tty        5     -
g disk       6     -
g man        12    -
g kmem       15    -
g dialout    20    -
g fax        21    -
g voice      22    -
g cdrom      24    -
g floppy     25    -
g tape       26    -
g sudo       27    -
g audio      29    -
g dip        30    -
g operator   37    -
g src        40    -
g shadow     42    -
g utmp       43    -
g video      44    -
g sasl       45    -
g plugdev    46    -
g staff      50    -
g games      60    -
g users      100   -
g nogroup    65534 -

u root       0       - /root                /bin/bash
u daemon     1       - /usr/sbin            /usr/sbin/nologin
u bin        2       - /bin                 /usr/sbin/nologin
u sys        3       - /dev                 /usr/sbin/nologin
u sync       4:65534 - /bin                 /bin/sync
u games      5:60    - /usr/games           /usr/sbin/nologin
u man        6:12    - /var/cache/man       /usr/sbin/nologin
u lp         7       - /var/spool/lpd       /usr/sbin/nologin
u mail       8       - /var/mail            /usr/sbin/nologin
u news       9       - /var/spool/news      /usr/sbin/nologin
u uucp       10      - /var/spool/uucp      /usr/sbin/nologin
u proxy      13      - /bin                 /usr/sbin/nologin
u www-data   33      - /var/www             /usr/sbin/nologin
u backup     34      - /var/backups         /usr/sbin/nologin
u list       38      - /var/list            /usr/sbin/nologin
u irc        39      - /run/ircd            /usr/sbin/nologin
u _apt       42:65534 - /nonexistent         /usr/sbin/nologin
u nobody     65534:65534 - /nonexistent         /usr/sbin/nologin
    CˆÝ�þet8ÜŒÊÛÍÇ#DóÜƒeöÅÛÚÃØ p   C"""Recognize image file formats based on their first few bytes."""

from os import PathLike
import warnings

__all__ = ["what"]


warnings._deprecated(__name__, remove=(3, 13))


#-------------------------#
# Recognize image headers #
#-------------------------#

def what(file, h=None):
    f = None
    try:
        if h is None:
            if isinstance(file, (str, PathLike)):
                f = open(file, 'rb')
                h = f.read(32)
            else:
                location = file.tell()
                h = file.read(32)
                file.seek(location)
        for tf in tests:
            res = tf(h, f)
            if res:
                return res
    finally:
        if f: f.close()
    return None


#---------------------------------#
# Subroutines per image file type #
#---------------------------------#

tests = []

def test_jpeg(h, f):
    """JPEG data with JFIF or Exif markers; and raw JPEG"""
    if h[6:10] in (b'JFIF', b'Exif'):
        return 'jpeg'
    elif h[:4] == b'\xff\xd8\xff\xdb':
        return 'jpeg'

tests.append(test_jpeg)

def test_png(h, f):
    if h.startswith(b'\211PNG\r\n\032\n'):
        return 'png'

tests.append(test_png)

def test_gif(h, f):
    """GIF ('87 and '89 variants)"""
    if h[:6] in (b'GIF87a', b'GIF89a'):
        return 'gif'

tests.append(test_gif)

def test_tiff(h, f):
    """TIFF (can be in Motorola or Intel byte order)"""
    if h[:2] in (b'MM', b'II'):
        return 'tiff'

tests.append(test_tiff)

def test_rgb(h, f):
    """SGI image library"""
    if h.startswith(b'\001\332'):
        return 'rgb'

tests.append(test_rgb)

def test_pbm(h, f):
    """PBM (portable bitmap)"""
    if len(h) >= 3 and \
        h[0] == ord(b'P') and h[1] in b'14' and h[2] in b' \t\n\r':
        return 'pbm'

tests.append(test_pbm)

def test_pgm(h, f):
    """PGM (portable graymap)"""
    if len(h) >= 3 and \
        h[0] == ord(b'P') and h[1] in b'25' and h[2] in b' \t\n\r':
        return 'pgm'

tests.append(test_pgm)

def test_ppm(h, f):
    """PPM (portable pixmap)"""
    if len(h) >= 3 and \
        h[0] == ord(b'P') and h[1] in b'36' and h[2] in b' \t\n\r':
        return 'ppm'

tests.append(test_ppm)

def test_rast(h, f):
    """Sun raster file"""
    if h.startswith(b'\x59\xA6\x6A\x95'):