Return the canonicalized machine name.
439455
def defaultMachine(use_rpm_default=True):
    

    if use_rpm_default:
        try:
            # This should be the most reliable way to get the default arch
            rmachine = subprocess.check_output(['rpm', '--eval=%_target_cpu'], shell=False).rstrip()
            rmachine = SCons.Util.to_str(rmachine)
        except Exception as e:
            # Something went wrong, try again by looking up platform.machine()
            return defaultMachine(False)
    else:
        rmachine = platform.machine()

        # Try to lookup the string in the canon table
        if rmachine in arch_canon:
            rmachine = arch_canon[rmachine][0]

    return rmachine
1344350
def get_platform():
        """"""
        _sys_map = {'linux2': 'linux', 'linux': 'linux',
                    'darwin': 'osx', 'win32': 'win', 'openbsd5': 'openbsd'}

        non_x86_linux_machines = {'armv6l', 'armv7l', 'ppc64le'}
        sys_platform = _sys_map.get(sys.platform, 'unknown')
        bits = 8 * tuple.__itemsize__

        if (sys_platform == 'linux' and
                platform.machine() in non_x86_linux_machines):
            arch_name = platform.machine()
            subdir = 'linux-{0}'.format(arch_name)
        else:
            arch_name = {64: 'x86_64', 32: 'x86'}[bits]
            subdir = '{0}-{1}'.format(sys_platform, bits)

        return subdir
220986
def get_machine_id():
    '''
    
    '''
    # Provides:
    #   machine-id
    if platform.system() == 'AIX':
        return _aix_get_machine_id()

    locations = ['/etc/machine-id', '/var/lib/dbus/machine-id']
    existing_locations = [loc for loc in locations if os.path.exists(loc)]
    if not existing_locations:
        return {}
    else:
        with salt.utils.files.fopen(existing_locations[0]) as machineid:
            return {'machine_id': machineid.read().strip()}
96817
def get_processor_name():
    
    mxlen = 256
    length = ctypes.c_ulong()
    buf = ctypes.create_string_buffer(mxlen)
    _LIB.RabitGetProcessorName(buf, ctypes.byref(length), mxlen)
    return buf.value
320942
def __getStationName(name, id):
    """"""
    name = name.replace("Meetstation", "")
    name = name.strip()
    name += " (%s)" % id
    return name
915914
def get_filename(self, index):
        """"""
        if index:
            return osp.normpath(to_text_string(self.fsmodel.filePath(index)))
836243
def lookupProcessor(name):
    """"""
    if name in _proc_lookup:
        return _proc_lookup[name]
    else:
        error_string = 'If you are creating a new processor, please read the\
documentation on creating a new processor'
        raise LookupError("Unknown processor %s\n%s" % (name, error_string))
213471
def derive_resource_name(name):
    """"""
    if name.startswith("Anon"):
        name = name[4:]
    if name.endswith("Handler"):
        name = name[:-7]
    if name == "Maas":
        name = "MAAS"
    return name
767893
def getBoneName(self, action, nBoneIndex, pchBoneName, unNameBufferSize):
        """"""

        fn = self.function_table.getBoneName
        result = fn(action, nBoneIndex, pchBoneName, unNameBufferSize)
        return result
56827
def get_canonical_names(packages):
    """"""
    from .vendor.packaging.utils import canonicalize_name

    if not isinstance(packages, Sequence):
        if not isinstance(packages, six.string_types):
            return packages
        packages = [packages]
    return set([canonicalize_name(pkg) for pkg in packages if pkg])
808077
def canonical_name(sgf_name):
    """"""
    sgf_name = os.path.normpath(sgf_name)
    assert sgf_name.endswith('.sgf'), sgf_name
    # Strip off '.sgf'
    sgf_name = sgf_name[:-4]

    # Often eval is inside a folder with the run name.
    # include from folder before /eval/ if part of path.
    with_folder = re.search(r'/([^/]*/eval/.*)', sgf_name)
    if with_folder:
        return with_folder.group(1)

    # Return the filename
    return os.path.basename(sgf_name)
398977
function getVersionsKeys(machineName) {
        let manifest = getManifest();
        if (!manifest.machines[machineName]) {
            throw new Error("Machine does not exists");
        }
        return Object.keys(manifest.machines[machineName].versions);
    }
741704
def full_name(self):
        """"""
        if self.requested_version is not None:
            return '%s-%s' % (self.name, self.requested_version)
        return self.name
693500
public static String canonicalize(String target)
   {
      if (target.startsWith(Files.HOME_ALIAS))
      {
         String homePath = OperatingSystemUtils.getUserHomePath();
         target = homePath + target.substring(1, target.length());
      }

      return target;
   }
19498
def get_filename(self, index):
        """"""
        if index:
            path = self.fsmodel.filePath(self.proxymodel.mapToSource(index))
            return osp.normpath(to_text_string(path))
276734
def get_engine(self, name=None):
        """"""
        engine = self._engines.get(name)
        if not engine:
            raise PapermillException("No engine named '{}' found".format(name))
        return engine
1226314
def canonical
      c = self.local.canonical
      c += "@" + self.host.canonical if self.host.canonical && self.host.canonical > " "
      c
    end