code: def _security_check(self, fp, default_netrc, login):
      if os.name == "posix" and default_netrc and login != "anonymous":
          prop = os.fstat(fp.fileno())
          if prop.st_uid != os.getuid():
              import pwd
  
              try:
                  fowner = pwd.getpwuid(prop.st_uid)[0]
              except KeyError:
                  fowner = "uid %s" % prop.st_uid
              try:
                  user = pwd.getpwuid(os.getuid())[0]
              except KeyError:
                  user = "uid %s" % os.getuid()
              raise NetrcParseError(
                  (
                      f"~/.netrc file owner ({fowner}, {user}) does not match"
                      " current user"
                  )
              )
          if prop.st_mode & (stat.S_IRWXG | stat.S_IRWXO):
              raise NetrcParseError(
                  "~/.netrc access too permissive: access"
                  " permissions must restrict access to only"
                  " the owner"
              )
  
file_path: catboost/contrib/tools/python3/src/Lib/netrc.py
imports: import os, shlex, stat
label_desc: Use image node_id 3 for calling the netrc obj's underlying member method code with example usage: obj._security_check(fp, default_netrc, login) without return types