Returns `True` when alias already in shell config.
519678
def _is_already_configured(configuration_details):
    """"""
    path = Path(configuration_details.path).expanduser()
    with path.open('r') as shell_config:
        return configuration_details.content in shell_config.read()
271369
def get_alias(self, alias):
        
        aliases = self.get_aliases()
        if alias in aliases.alias:
            settings = self.settings.copy()
            settings.alias = alias
            settings.index = alias
            return Index(read_only=True, kwargs=settings, cluster=self)
        Log.error("Can not find any index with alias {{alias_name}}",  alias_name= alias)
345773
def has_alias(self, header):
        """"""
        try:
            # Force to lower case (issue #1126)
            return self._limits[self.plugin_name + '_' + header.lower() + '_' + 'alias'][0]
        except (KeyError, IndexError):
            # logger.debug("No alias found for {}".format(header))
            return None
577970
def update_aliases(aliases,aonly,x):
    ""
    if isinstance(x,basestring): aliases[x]=x
    elif isinstance(x,sqparse2.AliasX):
      if not isinstance(x.alias,basestring): raise TypeError('alias not string',type(x.alias))
      if isinstance(x.name,sqparse2.NameX): aliases.update({x.alias:x.name.name,x.name.name:x.name.name})
      elif isinstance(x.name,sqparse2.SelectX):
        aliases.update({x.alias:x.alias})
        aonly[x.alias]=x.name
      else: raise TypeError('aliasx_unk_thing',type(x.name)) # pragma: no cover
    else: raise TypeError(type(x)) # pragma: no cover
891248
private function isJoinUnique($table, $alias)
    {
        foreach ($this->join as $join) {
            if ($join['table'] == $table && $join['alias'] == $alias) {
                return false;
            }
        }

        return true;
    }
746305
public function hasAlias($alias)
    {
        if ($this->name == $alias) {
            return true;
        }

        return in_array($alias, $this->aliases);
    }
166584
def exists(self, **kwargs):
        """"""
        kwargs.pop('partition', None)
        kwargs['transform_name'] = True
        return self._exists(**kwargs)
933075
def alias_exists(alias, keystore_path=None, keystore_password='changeit'):
    
    log = logging.getLogger(mod_logger + '.alias_exists')
    if not isinstance(alias, basestring):
        msg = 'alias arg must be a string'
        log.error(msg)
        raise OSError(msg)

    # Ensure JAVA_HOME is set
    log.debug('Determining JAVA_HOME...')
    try:
        java_home = os.environ['JAVA_HOME']
    except KeyError:
        msg = 'JAVA_HOME is required but not set'
        log.error(msg)
        raise OSError(msg)

    # Ensure keytool can be found
    keytool = os.path.join(java_home, 'bin', 'keytool')
    if not os.path.isfile(keytool):
        msg = 'keytool file not found: {f}'.format(f=keytool)
        log.error(msg)
        raise OSError(msg)

    # Find the cacerts file
    if keystore_path is None:
        keystore_path = os.path.join(java_home, 'lib', 'security', 'cacerts')

        # If the JRE cacerts location is not found, look for the JDK cacerts
        if not os.path .isfile(keystore_path):
            keystore_path = os.path.join(java_home, 'jre', 'lib', 'security', 'cacerts')
            if not os.path.isfile(keystore_path):
                msg = 'Unable to file cacerts file'
                log.error(msg)
                raise OSError(msg)

    log.info('Checking keystore {k} for alias: {a}...'.format(k=keystore_path, a=alias))

    # Build the keytool command
    command = [keytool, '-keystore', keystore_path, '-storepass', keystore_password, '-list']

    # Running the keytool list command
    log.debug('Running the keytool list command...')
    try:
        result = run_command(command)
    except CommandError:
        _, ex, trace = sys.exc_info()
        msg = 'There was a problem running keytool on keystore: {k}\n{e}'.format(k=keystore_path, e=str(ex))
        log.error(msg)
        raise OSError, msg, trace
    if result['code'] != 0:
        msg = 'keytool command exited with a non-zero code: {c}, and produced output: {o}'.format(
            c=result['code'], o=result['output'])
        log.error(msg)
        raise OSError(msg)

    # Check for the alias in the output
    if alias in result['output']:
        log.info('Found alias {a} in keystore: {k}'.format(a=alias, k=keystore_path))
        return True
    else:
        log.info('Alias {a} was not found in keystore: {k}'.format(a=alias, k=keystore_path))
        return False
906981
function alias(config) {
  var out = clone(config);

  aliasKeys.forEach(function(k){
    var v = aliases[k];
    // if config has the alias and no normal react name
    if (out[k] != null && out[v] == null) {
      out[v] = out[k];
      delete out[k];
    }
  });

  // always add a mixins array and alias them
  out.mixins = (out.mixins || []).map(alias);
  return out;
}
987299
public boolean aliasExists(String alias) {
        try {
            final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(alias).build());
            return result.isSucceeded() && !Iterators.contains(result.getJsonObject().fieldNames(), alias);
        } catch (IOException e) {
            throw new ElasticsearchException("Couldn't check existence of alias " + alias, e);
        }
    }
825811
def alias(self, maps):
        
        for k, v in maps.items():  # pylint: disable=invalid-name
            if self.verbose_mode:
                print(
                    " * Mapping a specified var as a alias:"
                    " {0} -> {1}".format(v, k))
            self.app.config[v] = self.app.config[k]
979746
def has_shell_command(self, command):
        
        try:
            output = self.shell(['command', '-v',
                                 command]).decode('utf-8').strip()
            return command in output
        except AdbError:
            # If the command doesn't exist, then 'command -v' can return
            # an exit code > 1.
            return False
883453
def run(self, name, *args):
        """"""
        assert isinstance(name, string_types)
        # Resolve the alias if it is an alias.
        name = self._aliases.get(name, name)
        # Get the action.
        action = self._actions_dict.get(name, None)
        if not action:
            raise ValueError("Action `{}` doesn't exist.".format(name))
        if not name.startswith('_'):
            logger.debug("Execute action `%s`.", name)
        return action.callback(*args)
154462
function aliasesTaken (arr) {
  var taken
  for (var ind in arr) {
    if (!arr.hasOwnProperty(ind)) continue;
    if (aliasTaken(arr[ind]) !== false) return arr[ind];
  }
  return false;
}
664843
def resolve_alias(self, path_str):
        """"""
        if path_str in self.aliases:
            return self.aliases[path_str]
        return path_str
1069956
public function hasConfig($aliasOrClass)
        {
            $key = ($this->hasAlias($aliasOrClass)) ? 'alias:' . $this->getBaseAlias($aliasOrClass) : $aliasOrClass;

            if (!isset($this->configurations[$key])) {
                return false;
            }

            if ($this->configurations[$key] === $this->configurationTemplate) {
                return false;
            }

            return true;
        }
378412
def _validate_alias_file_path(alias_file_path):
    
    if not os.path.exists(alias_file_path):
        raise CLIError(ALIAS_FILE_NOT_FOUND_ERROR)

    if os.path.isdir(alias_file_path):
        raise CLIError(ALIAS_FILE_DIR_ERROR.format(alias_file_path))