import os
import sys
from typing import Union, Tuple
import subprocess
import platform
import chardet

# Define constants.
READ: int
WRITE: int
RUN: int

# Hints about the function type.
def getcwd() -> str: ...
def remove(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> None: ...
def removedir(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> None: ...
def cmd(command: str) -> int: ...
def psshell(command: str) -> subprocess.CompletedProcess[str]: ...
def chdir(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> None: ...
def mkdir(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> None: ...
def get_encoding(file_path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> Tuple[str, float]: ...
def moencoding(input_file_path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"], 
               output_file_path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"], 
               new_encoding: str = 'utf-8') -> None: ...
def exists(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> bool: ...
def abspath(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> str: ...
def join(*paths: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> str: ...
def txprint(*objects: object, sep: str = ' ', end: str = '\n', file: object = sys.stdout) -> None: ...
def cwdbytes() -> bytes: ...
def dirlist(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> list[str]: ...
def name(oldpath: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"], 
         newpath: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> None: ...
def file(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> bool: ...
def idir(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"]) -> bool: ...
def pathq(filepath: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"], r: int) -> bool: ...
def permissions(path: Union[str, bytes, "os.PathLike[str]", "os.PathLike[bytes]"], r: int) -> None: ...