parameters: ()
return_statement: return True
docstring: Check if user site directory is safe for inclusion
  
      The function tests for the command line flag (including environment var),
      process uid/gid equal to effective uid/gid.
  
      None: Disabled for security reasons
      False: Disabled by user (command line option)
      True: Safe and enabled
docstring_summary: Check if user site directory is safe for inclusion
docstring_tokens: Check if user site directory is safe for inclusion
function: def check_enableusersite():
      """Check if user site directory is safe for inclusion
  
      The function tests for the command line flag (including environment var),
      process uid/gid equal to effective uid/gid.
  
      None: Disabled for security reasons
      False: Disabled by user (command line option)
      True: Safe and enabled
      """
      if sys.flags.no_user_site:
          return False
  
      if hasattr(os, "getuid") and hasattr(os, "geteuid"):
          # check process uid == effective uid
          if os.geteuid() != os.getuid():
              return None
      if hasattr(os, "getgid") and hasattr(os, "getegid"):
          # check process gid == effective gid
          if os.getegid() != os.getgid():
              return None
  
      return True
function_tokens: def check_enableusersite ( ) : if sys . flags . no_user_site : return False if hasattr ( os , "getuid" ) and hasattr ( os , "geteuid" ) : # check process uid == effective uid if os . geteuid ( ) != os . getuid ( ) : return None if hasattr ( os , "getgid" ) and hasattr ( os , "getegid" ) : # check process gid == effective gid if os . getegid ( ) != os . getgid ( ) : return None return True