Handles Aliases. No test cases yet
775951
def Alias(self, alias):
        """"""
        # FIXME
        if self.generate_comments:
            self.print_comment(alias)
        print("%s = %s # alias" % (alias.name, alias.alias), file=self.stream)
        self._aliases += 1
        return
327888
def as_alias_handler(alias_list):
    """"""
    list_ = list()
    for alias in alias_list:
        if alias.asname:
            list_.append(alias.asname)
        else:
            list_.append(alias.name)
    return list_
1249609
def set_aliases(self, new_value):
        ""
        try:
            self.aliases = new_value
        except Exception as err:
            raise ValueError("invalid value: {}".format(err))
1298172
def delete_alias(self, alias_name):
        """"""
        for aliases in self.key_to_aliases.values():
            if alias_name in aliases:
                aliases.remove(alias_name)
377795
def by_alias(cls, name: str) -> "TxType":
        """"""
        return {
            "get": TxType.Get,
            "check": TxType.Check,
            "delete": TxType.Delete,
            "save": TxType.Update,
        }[name]
398379
def import_aliases(alias_source):
    
    alias_table = get_alias_table()
    if is_url(alias_source):
        alias_source = retrieve_file_from_url(alias_source)
        alias_table.read(alias_source)
        os.remove(alias_source)
    else:
        alias_table.read(alias_source)
    _commit_change(alias_table)
1305228
def alias(self):
        
        if self._alias is None:
            if self.name in self.aliases_fix:
                self._alias = self.aliases_fix[self.name]
            else:
                self._alias = self.name.lower()\
                                  .replace(' ', '-')\
                                  .replace('(', '')\
                                  .replace(')', '')
        return self._alias
1242616
def get_alias(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.get_alias(index=self._name, **kwargs)
180784
def get_prototype(self, alias):
        
        output = sort([
            a.index
            for a in self.get_aliases()
            if re.match(re.escape(alias) + "\\d{8}_\\d{6}", a.index) and not a.alias
        ])
        return output
836512
def deprecated_alias(name, replacement)
      # Create a wrapped version
      define_method(name) do |*args, &block|
        warn "##{name} deprecated (please use ##{replacement})"
        send replacement, *args, &block
      end
    end
128433
def list_aliases():
    '''
    
    '''
    ret = dict((alias, target) for alias, target, comment in __parse_aliases() if alias)
    return ret
211675
def _validate_alias_command(alias_command):
    
    if not alias_command:
        raise CLIError(EMPTY_ALIAS_ERROR)

    split_command = shlex.split(alias_command)
    boundary_index = len(split_command)
    for i, subcommand in enumerate(split_command):
        if not re.match('^[a-z]', subcommand.lower()) or i > COLLISION_CHECK_LEVEL_DEPTH:
            boundary_index = i
            break

    # Extract possible CLI commands and validate
    command_to_validate = ' '.join(split_command[:boundary_index]).lower()
    for command in azext_alias.cached_reserved_commands:
        if re.match(r'([a-z\-]*\s)*{}($|\s)'.format(command_to_validate), command):
            return

    _validate_positional_arguments(shlex.split(alias_command))
1305456
function cloneAliases(trail) {
  var copy = {};

  Object.keys(trail.__aliases__).forEach(function (extension) {
    copy[extension] = [].concat(trail.__aliases__[extension]);
  });

  return copy;
}
267519
def process_alias_create_namespace(namespace):
    
    namespace = filter_alias_create_namespace(namespace)
    _validate_alias_name(namespace.alias_name)
    _validate_alias_command(namespace.alias_command)
    _validate_alias_command_level(namespace.alias_name, namespace.alias_command)
    _validate_pos_args_syntax(namespace.alias_name, namespace.alias_command)
921364
def process_alias_import_namespace(namespace):
    
    if is_url(namespace.alias_source):
        alias_source = retrieve_file_from_url(namespace.alias_source)

        _validate_alias_file_content(alias_source, url=namespace.alias_source)
    else:
        namespace.alias_source = os.path.abspath(namespace.alias_source)
        _validate_alias_file_path(namespace.alias_source)
        _validate_alias_file_content(namespace.alias_source)
157490
def do_get_aliases(name):
  
  metric_schemas = MetricSchemas()
  aliases = metric_schemas.get_aliases(name)
  for alias in aliases:
    do_print(alias)
1117807
function createGetAlias(aliases) {
    if (isPlainObject(aliases) && !Array.isArray(aliases)) {
        aliases = Object.keys(aliases).map((key) => { // eslint-disable-line
            let onlyModule = false;
            let obj = aliases[key];
            if (/\$$/.test(key)) {
                onlyModule = true;
                key = key.substr(0, key.length - 1); // eslint-disable-line
            }
            if (isString(obj)) {
                obj = {
                    alias: obj,
                };
            }
            return {
                name: key,
                onlyModule,
                ...obj,
            };
        });
    }

    return (request) => {
        for (const alias of aliases) {
            if ((!alias.onlyModule && request.indexOf(`${alias.name}/`) === 0) || request === alias.name) {
                if (request.indexOf(`${alias.alias}/`) !== 0 && request !== alias.alias) {
                    return alias.alias + request.substr(alias.name.length);
                }
            }
        }
        return request;
    };
}