Return our platform name 'win32', 'linux_x86_64
350528
def get_platform():
    """'"""
    # XXX remove distutils dependency
    result = distutils.util.get_platform().replace('.', '_').replace('-', '_')
    if result == "linux_x86_64" and sys.maxsize == 2147483647:
        # pip pull request #3497
        result = "linux_i686"
    return result
1347678
def Name(self):
    """"""
    return (self.name or self.device_path or self.windowsvolume.drive_letter or
            self.unixvolume.mount_point or None)
1277354
def get_bin(self, arch='x86'):
        
        bin_dir = os.path.join(self.vc_dir, 'bin')
        if arch == 'x86':
            arch = ''
        cl_path = os.path.join(bin_dir, arch, 'cl.exe')
        link_path = os.path.join(bin_dir, arch, 'link.exe')
        ml_name = 'ml.exe'
        if arch in ['x86_amd64', 'amd64']:
            ml_name = 'ml64.exe'
        ml_path = os.path.join(bin_dir, arch, ml_name)
        if os.path.isfile(cl_path) \
           and os.path.isfile(link_path) \
           and os.path.isfile(ml_path):
            logging.info(_('using cl.exe: %s'), cl_path)
            logging.info(_('using link.exe: %s'), link_path)
            logging.info(_('using %s: %s'), ml_name, ml_path)
            run_cl = partial(run_program, cl_path)
            run_link = partial(run_program, link_path)
            run_ml = partial(run_program, ml_path)
            return self.Bin(run_cl, run_link, run_ml)
        logging.debug(_('cl.exe not found: %s'), cl_path)
        logging.debug(_('link.exe not found: %s'), link_path)
        logging.debug(_('%s not found: %s'), ml_name, ml_path)
        return self.Bin(None, None, None)
1333461
private String getOsName() {
        // windows
        if (OS_NAME.contains("win")) {
            boolean is64bit = (System.getenv("ProgramFiles(x86)") != null);
            return "windows_" + (is64bit ? "x86_64" : "x86");
        } else if (OS_NAME.contains("mac")) {
            // mac osx
            return "mac_" + OS_ARCH;
        } else if (OS_NAME.contains("nix") || OS_NAME.contains("nux") || OS_NAME.indexOf("aix") > 0) {
            // unix
            return "amd64".equalsIgnoreCase(OS_ARCH) ? "linux_x86_64" : "linux_" + OS_ARCH;
        } else {
            throw new WebpIOException("Hi boy, Your OS is not support!!");
        }
    }
203330
def system_information():
    '''
    
    '''
    def system_version():
        '''
        Return host system version.
        '''
        lin_ver = linux_distribution()
        mac_ver = platform.mac_ver()
        win_ver = platform.win32_ver()

        if lin_ver[0]:
            return ' '.join(lin_ver)
        elif mac_ver[0]:
            if isinstance(mac_ver[1], (tuple, list)) and ''.join(mac_ver[1]):
                return ' '.join([mac_ver[0], '.'.join(mac_ver[1]), mac_ver[2]])
            else:
                return ' '.join([mac_ver[0], mac_ver[2]])
        elif win_ver[0]:
            return ' '.join(win_ver)
        else:
            return ''

    if platform.win32_ver()[0]:
        # Get the version and release info based on the Windows Operating
        # System Product Name. As long as Microsoft maintains a similar format
        # this should be future proof
        import win32api  # pylint: disable=3rd-party-module-not-gated
        import win32con  # pylint: disable=3rd-party-module-not-gated

        # Get the product name from the registry
        hkey = win32con.HKEY_LOCAL_MACHINE
        key = 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'
        value_name = 'ProductName'
        reg_handle = win32api.RegOpenKey(hkey, key)

        # Returns a tuple of (product_name, value_type)
        product_name, _ = win32api.RegQueryValueEx(reg_handle, value_name)

        version = 'Unknown'
        release = ''
        if 'Server' in product_name:
            for item in product_name.split(' '):
                # If it's all digits, then it's version
                if re.match(r'\d+', item):
                    version = item
                # If it starts with R and then numbers, it's the release
                # ie: R2
                if re.match(r'^R\d+$', item):
                    release = item
            release = '{0}Server{1}'.format(version, release)
        else:
            for item in product_name.split(' '):
                # If it's a number, decimal number, Thin or Vista, then it's the
                # version
                if re.match(r'^(\d+(\.\d+)?)|Thin|Vista$', item):
                    version = item
            release = version

        _, ver, sp, extra = platform.win32_ver()
        version = ' '.join([release, ver, sp, extra])
    else:
        version = system_version()
        release = platform.release()

    system = [
        ('system', platform.system()),
        ('dist', ' '.join(linux_distribution(full_distribution_name=False))),
        ('release', release),
        ('machine', platform.machine()),
        ('version', version),
        ('locale', __salt_system_encoding__),
    ]

    for name, attr in system:
        yield name, attr
        continue
158299
private function getSystem()
    {
        $uname = strtolower(php_uname());
        if (str_contains($uname, 'darwin')) {
            return 'macosx';
        } elseif (str_contains($uname, 'win')) {
            return 'windows';
        } elseif (str_contains($uname, 'linux')) {
            return PHP_INT_SIZE === 4 ? 'linux-i686' : 'linux-x86_64';
        } else {
            throw new RuntimeException('Unknown operating system.');
        }
    }
12362
def determine_hosts_path(platform=None):
        
        if not platform:
            platform = sys.platform
        if platform.startswith('win'):
            result = r"c:\windows\system32\drivers\etc\hosts"
            return result
        else:
            return '/etc/hosts'
147849
def get_os():
    
    if sys.platform == 'darwin':
        return 'mac'
    elif sys.platform.find('freebsd') != -1:
        return 'freebsd'
    elif sys.platform.find('linux') != -1:
        return 'linux'
    elif sys.platform.find('win32') != -1:
        return 'windows'
    elif sys.platform.find('sunos') != -1:
        return 'solaris'
    else:
        return sys.platform
1045838
def _osx_platform_data():
    '''
    
    '''
    cmd = 'system_profiler SPHardwareDataType'
    hardware = __salt__['cmd.run'](cmd)

    grains = {}
    for line in hardware.splitlines():
        field_name, _, field_val = line.partition(': ')
        if field_name.strip() == "Model Name":
            key = 'model_name'
            grains[key] = _clean_value(key, field_val)
        if field_name.strip() == "Boot ROM Version":
            key = 'boot_rom_version'
            grains[key] = _clean_value(key, field_val)
        if field_name.strip() == "SMC Version (system)":
            key = 'smc_version'
            grains[key] = _clean_value(key, field_val)
        if field_name.strip() == "Serial Number (system)":
            key = 'system_serialnumber'
            grains[key] = _clean_value(key, field_val)

    return grains
927005
def platform(cls):
        
        system_name = platform.system()
        if system_name == "Linux":
            libc = cls.libc()
            return "unknown-linux-{libc}".format(libc=libc)
        elif system_name == "Darwin":
            return "apple-darwin"
        else:
            return "unknown"
904050
def get_platform(self):
        
        command = const.CMD_OPTIONS_RRQ
        command_string = b'~Platform\x00'
        response_size = 1024

        cmd_response = self.__send_command(command, command_string, response_size)
        if cmd_response.get('status'):
            platform = self.__data.split(b'=', 1)[-1].split(b'\x00')[0]
            platform = platform.replace(b'=', b'')
            return platform.decode()
        else:
            raise ZKErrorResponse("Can't read platform name")
179348
def parse_bdist_wininst(name):
    """"""

    lower = name.lower()
    base, py_ver, plat = None, None, None

    if lower.endswith('.exe'):
        if lower.endswith('.win32.exe'):
            base = name[:-10]
            plat = 'win32'
        elif lower.startswith('.win32-py', -16):
            py_ver = name[-7:-4]
            base = name[:-16]
            plat = 'win32'
        elif lower.endswith('.win-amd64.exe'):
            base = name[:-14]
            plat = 'win-amd64'
        elif lower.startswith('.win-amd64-py', -20):
            py_ver = name[-7:-4]
            base = name[:-20]
            plat = 'win-amd64'
    return base, py_ver, plat
751771
def get_platform():
	""""""
	# Detect
	platform_str = platform.system()
	print 'Platform detected: {}'.format(platform_str)
	# Instantiate
	if platform_str == 'Windows':
		return WindowsPlatform()
	elif platform_str == 'Linux':
		return LinuxPlatform()
	else:
		raise NotImplementedError('This platform is not yet supported')
1209609
function detectPlatform(platform) {
    var name = platform.toLowerCase();
    var prefix = "", suffix = "";

    // Detect NuGet/Squirrel.Windows files
    if (name == 'releases' || hasSuffix(name, '.nupkg')) return platforms.WINDOWS_32;

    // Detect prefix: osx, widnows or linux
    if (_.contains(name, 'win')
        || hasSuffix(name, '.exe')) prefix = platforms.WINDOWS;

    if (_.contains(name, 'linux')
        || _.contains(name, 'ubuntu')
        || hasSuffix(name, '.deb')
        || hasSuffix(name, '.rpm')
        || hasSuffix(name, '.tgz')
        || hasSuffix(name, '.tar.gz')) {

        if (_.contains(name, 'linux_deb') || hasSuffix(name, '.deb')) {
            prefix = platforms.LINUX_DEB;
        }
        else if (_.contains(name, 'linux_rpm') || hasSuffix(name, '.rpm')) {
            prefix = platforms.LINUX_RPM;
        }
        else if (_.contains(name, 'linux') || hasSuffix(name, '.tgz') || hasSuffix(name, '.tar.gz')) {
            prefix = platforms.LINUX;
        }
    }

    if (_.contains(name, 'mac')
        || _.contains(name, 'osx')
        || name.indexOf('darwin') >= 0
        || hasSuffix(name, '.dmg')) prefix = platforms.OSX;

    // Detect suffix: 32 or 64
    if (_.contains(name, '32')
        || _.contains(name, 'ia32')
        || _.contains(name, 'i386')) suffix = '32';
    if (_.contains(name, '64') || _.contains(name, 'x64') || _.contains(name, 'amd64')) suffix = '64';

    suffix = suffix || (prefix == platforms.OSX? '64' : '32');
    return _.compact([prefix, suffix]).join('_');
}
917368
def get_binary_path(executable):
    """"""
    if sys.platform == 'win32':
        if executable == 'start':
            return executable
        executable = executable + '.exe'
        if executable in os.listdir('.'):
            binary = os.path.join(os.getcwd(), executable)
        else:
            binary = next((os.path.join(path, executable)
                           for path in os.environ['PATH'].split(os.pathsep)
                           if os.path.isfile(os.path.join(path, executable))), None)
    else:
        binary = Popen(['which', executable], stdout=PIPE).stdout.read().strip().decode('utf-8')
    return binary if binary else None
1018254
def get_bin_and_lib(self, x64=False, native=False):
        
        if x64:
            msvc = self.bin64
            paths = self.lib64
        else:
            msvc = self.bin32
            paths = self.lib
        if native:
            arch = 'x64' if x64 else 'x86'
            paths += self.sdk.get_lib(arch, native=True)
        else:
            attr = 'lib64' if x64 else 'lib'
            paths += getattr(self.sdk, attr)
        return msvc, paths
652308
def get_os(detailed=False):
    
    try:

        os_type = platform.system()

        if os_type == 'Linux':
            os_detail = platform.uname()
            distribution = platform.linux_distribution()
            HOME = os.environ['HOME']
            username = os.getenv('USER')
        elif os_type == 'Windows':
            username = os.getenv('username')
            HOME = 'C:\\Users\\' + username
        elif os_type == 'Java':
            logger.warning('Unsupported OS. No information')
    except OSError as e:
        raise e
    except Exception as e:
        logger.exception(
            '%s: problem determining local os environment %s' %
            (inspect.stack()[0][3], str(e))
            )
    if detailed and os_type == 'Linux':
        return {
                'os_type': os_type,
                'os_detail': os_detail,
                'linux_distribution': distribution,
                'HOME': HOME
            }
    elif detailed and os_type == 'Windows':
        return {
                'os_type': os_type,
                'platform': platform,
                'HOME': HOME
            }
    elif not detailed:
        return {'os_type': os_type}