def make_stat(
        mode=DEFAULT_MODE,
        inode=None,
        dev=None,
        nlinks=1,
        gid=None,
        uid=None,
        size=0,
        atime=None,
        mtime=None,
        ctime=None,
        blocks=1,
        blksize=None,
        rdev=stat.S_IFREG,
        flags=0,
):
    """helper function to generate os.stat results."""
    if inode is None:
        inode = random.randint(1000, 9999999)
    if dev is None:
        dev = os.makedev(64, random.randint(1, 100))
    if uid is None:
        uid = os.getuid()
    if gid is None:
        uid2 = os.getuid()
        gid = pwd.getpwuid(uid2).pw_gid
    if atime is None:
        atime = time.time()
    if mtime is None:
        mtime = time.time()
    if ctime is None:
        ctime = time.time()
    if os.stat_float_times():
        ctime = float(ctime)
        mtime = float(mtime)
        atime = float(atime)
    else:
        ctime = int(ctime)
        atime = int(atime)
        mtime = int(mtime)
    if blksize is None:
        blksize = max(size, 2048)
    s = os.stat_result(
        (
            mode,
            inode,
            dev,
            nlinks,
            gid,
            uid,
            size,
            atime,
            mtime,
            ctime,
        ),
        {
            "st_blocks": blocks,
            "st_blksize": blksize,
            "st_rdev": rdev,
            "st_flags": flags,
        }
    )
    return s
helper function to generate os.stat results.
lib/stashutils/fsi/base.py