original_docstring: Returns whether Python is being translated by Rosetta.
  
    Returns:
      True if the Python interpreter is being run as an x86_64 binary on an arm64
      macOS machine. False if it is running as an arm64 binary, or if it is
      running on an Intel machine.
    
docstring: Returns whether Python is being translated by Rosetta.
docstring_tokens: Returns whether Python is being translated by Rosetta .
code: def is_running_rosetta():
    """Returns whether Python is being translated by Rosetta.
  
    Returns:
      True if the Python interpreter is being run as an x86_64 binary on an arm64
      macOS machine. False if it is running as an arm64 binary, or if it is
      running on an Intel machine.
    """
    translated = subprocess.check_output(
        ['sysctl', '-i', '-b', 'sysctl.proc_translated'])
    # "sysctl -b" is expected to return a 4-byte integer response. 1 means the
    # current process is running under Rosetta, 0 means it is not. On x86_64
    # machines, this variable does not exist at all, so "-i" is used to return a
    # 0-byte response instead of throwing an error.
    if len(translated) != 4:
      return False
    return struct.unpack('i', translated)[0] > 0
code_tokens: def is_running_rosetta ( ) : translated = subprocess . check_output ( [ 'sysctl' , '-i' , '-b' , 'sysctl.proc_translated' ] ) if len ( translated ) != 4 : return False return struct . unpack ( 'i' , translated ) [ 0 ] > 0
short_docstring: Returns whether Python is being translated by Rosetta.
short_docstring_tokens: Returns whether Python is being translated by Rosetta .
comment: """Returns whether Python is being translated by Rosetta.
  
    Returns:
      True if the Python interpreter is being run as an x86_64 binary on an arm64
      macOS machine. False if it is running as an arm64 binary, or if it is
      running on an Intel machine.
    """$SEP$# "sysctl -b" is expected to return a 4-byte integer response. 1 means the$SEP$# current process is running under Rosetta, 0 means it is not. On x86_64$SEP$# machines, this variable does not exist at all, so "-i" is used to return a$SEP$# 0-byte response instead of throwing an error.