def formatFromExtension(fname):
    """Tries to infer a protocol from the file extension."""
    _base, ext = os.path.splitext(fname)
    if not ext:
        return None
    try:
        format = known_extensions[ext.replace('.', '')]
    except __HOLE__:
        format = None
    return format
dataset/ETHPy150Open pybrain/pybrain/pybrain/utilities.py/formatFromExtension