<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_hidden(path):
 """Check if file is hidden."""


    hidden = False
    f = os.path.basename(path)
    if f[:1] in ('.', b'.'):
        # Count dot file as hidden on all systems
        hidden = True
    elif _PLATFORM == 'windows':
        # On Windows, look for `FILE_ATTRIBUTE_HIDDEN`
        FILE_ATTRIBUTE_HIDDEN = 0x2
        if PY35:
            results = os.lstat(path)
            hidden = bool(results.st_file_attributes & FILE_ATTRIBUTE_HIDDEN)
        else:
            if isinstance(path, bytes):
                attrs = ctypes.windll.kernel32.GetFileAttributesA(path)
            else:
                attrs = ctypes.windll.kernel32.GetFileAttributesW(path)
            hidden = attrs != -1 and attrs & FILE_ATTRIBUTE_HIDDEN
    elif _PLATFORM == "osx":  # pragma: no cover
        # On macOS, look for `UF_HIDDEN`
        results = os.lstat(path)
        hidden = bool(results.st_flags & stat.UF_HIDDEN)
    return hidden