append an alias for the given user@host with the options passed
161488
def add(alias_name, user, host, options)
      begin
        PRINTER.verbose_print "Adding\n"
        config_append = form(alias_name, user, host, options)
        PRINTER.verbose_print config_append
        unless options.test
          file = File.open(FILE_PATH, 'a+')
          file.write(config_append)
          file.close

          # causes a bug in fedore if permission was not updated to 0600
          File.chmod(0600, FILE_PATH)
          # system "chmod 600 #{FILE_PATH}"
        end
      rescue
        return permission_error
      end
      PRINTER.verbose_print "to #{FILE_PATH}"
      PRINTER.print "Successfully added `#{alias_name}` as an alias for `#{user}@#{host}`"
      PRINTER.print "Try sshez connect #{alias_name}"

      finish_exec
    end
277384
def init(cnf):
    '''
    
    '''
    CONFIG['host'] = cnf.get('proxy', {}).get('host')
    if not CONFIG['host']:
        raise MinionError(message="Cannot find 'host' parameter in the proxy configuration")

    CONFIG['user'] = cnf.get('proxy', {}).get('user')
    if not CONFIG['user']:
        raise MinionError(message="Cannot find 'user' parameter in the proxy configuration")

    CONFIG['uri'] = "/api/{0}".format(CONFIG['user'])
1236521
def add_alias(agent, prefix, alias):
    """"""
    return _broadcast(agent, AddMappingManager, RecordType.record_CNAME,
                      prefix, alias)
73826
function createUrlFromEndpointAndOptions (endpoint, options) {
  const query = qs.stringify(options);
  const baseURL = `${host}${endpoint}`;
  return query ? `${baseURL}?${query}` : baseURL;
}
1141069
def create(options = {})
      request(:put) do |req|
        req.body = {
          actions: [
            add: options.merge(:alias => @name)
          ]
        }
      end
    end
1219267
def _generateAlias(self):
        """"""
        for i in range(1000):
            alias = 'cust%d' % (i, )
            if alias not in self.auth_level_aliases:
                return alias

        raise RuntimeError('Could not find an unused alias (tried 1000!)')
81188
private void appendFieldCriteria(TableAlias alias, PathInfo pathInfo, FieldCriteria c, StringBuffer buf)
    {
        appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
        buf.append(c.getClause());

        if (c.isTranslateField())
        {
			appendColName((String) c.getValue(), false, c.getUserAlias(), buf);
        }
        else
        {
            buf.append(c.getValue());
        }
    }
88671
def hosts
      @hosts ||= begin
                   hosts = ENV['ROUTEMASTER_DRAIN_HOSTS'].split(',')
                   hosts.inject({}) do |res, host|
                     key, val = host.split(':')
                     res.merge(key => val)
                   end
                 end
    end
755026
def rename(name, options={})
      result = @session.rename(path, name, options)
      @path = result.path.gsub(/^\//, '')
      return result
    end
86559
public void addHostAlias(String virtualHost, String alias)
    {
        log.warn("addHostAlias is deprecated. Use HttpContext.addVirtualHost");
        Object contextMap=_virtualHostMap.get(virtualHost);
        if (contextMap==null)
            throw new IllegalArgumentException("No Such Host: "+virtualHost);
        _virtualHostMap.put(alias,contextMap);
    }
197526
def make_alias_redirect_url(self, path, endpoint, values, method, query_args):
        """"""
        url = self.build(endpoint, values, method, append_unknown=False,
                         force_external=True)
        if query_args:
            url += '?' + self.encode_query_args(query_args)
        assert url != path, 'detected invalid alias setting.  No canonical ' \
               'URL found'
        return url
1107934
def build_http(host, port)
      params = [host, port]
      params += @proxy_options.values_at(:host, :port, :user, :pass) unless @proxy_options.empty?
      add_ssl(Net::HTTP.new(*params))
    end
825372
def add_exec_to_user(
        self, 
        name,
        env,
        command,
        args,
        **attrs
        ):
        """"""
        # Add exec option.
        exec_options = {
            'command': command,
            'env': env,
            'args': args,
        }
        exec_options.update(attrs)
        # Add exec to user.
        self.add_to_user(name=name, exec=exec_options)
1296120
def put_alias(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.put_alias(index=self._name, **kwargs)
1024476
def addHost(self, name=None):
        '''
        
        '''
        if name is None:
            while True:
                name = 'h' + str(self.__hnum)
                self.__hnum += 1
                if name not in self.__nxgraph:
                    break
        self.__addNode(name, Host)
        return name
850608
def handle_aliases_in_calls(name, import_alias_mapping):
    
    for key, val in import_alias_mapping.items():
        # e.g. Foo == Foo
        # e.g. Foo.Bar startswith Foo.
        if name == key or \
                name.startswith(key + '.'):

            # Replace key with val in name
            # e.g. StarbucksVisitor.Tea -> Eataly.Tea because
            #   "from .nested_folder import StarbucksVisitor as Eataly"
            return name.replace(key, val)
    return None
234105
static function create($user, $host)
    {
        $user_name  = '';
        $user_email = '';
        $rcube      = rcube::get_instance();
        $dbh        = $rcube->get_dbh();

        // try to resolve user in virtuser table and file
        if ($email_list = self::user2email($user, false, true)) {
            $user_email = is_array($email_list[0]) ? $email_list[0]['email'] : $email_list[0];
        }

        $data = $rcube->plugins->exec_hook('user_create', array(
            'host'       => $host,
            'user'       => $user,
            'user_name'  => $user_name,
            'user_email' => $user_email,
            'email_list' => $email_list,
            'language'   =>  $_SESSION['language'],
        ));

        // plugin aborted this operation
        if ($data['abort']) {
            return false;
        }

        $insert = $dbh->query(
            "INSERT INTO ".$dbh->table_name('users', true).
            " (`created`, `last_login`, `username`, `mail_host`, `language`)".
            " VALUES (".$dbh->now().", ".$dbh->now().", ?, ?, ?)",
            $data['user'],
            $data['host'],
            $data['language']);

        if ($dbh->affected_rows($insert) && ($user_id = $dbh->insert_id('users'))) {
            // create rcube_user instance to make plugin hooks work
            $user_instance = new rcube_user($user_id, array(
                'user_id'   => $user_id,
                'username'  => $data['user'],
                'mail_host' => $data['host'],
                'language'  => $data['language'],
            ));
            $rcube->user = $user_instance;
            $mail_domain = $rcube->config->mail_domain($data['host']);
            $user_name   = $data['user_name'];
            $user_email  = $data['user_email'];
            $email_list  = $data['email_list'];

            if (empty($email_list)) {
                if (empty($user_email)) {
                    $user_email = strpos($data['user'], '@') ? $user : sprintf('%s@%s', $data['user'], $mail_domain);
                }
                $email_list[] = $user_email;
            }
            // identities_level check
            else if (count($email_list) > 1 && $rcube->config->get('identities_level', 0) > 1) {
                $email_list = array($email_list[0]);
            }

            if (empty($user_name)) {
                $user_name = $data['user'];
            }

            // create new identities records
            $standard = 1;
            foreach ($email_list as $row) {
                $record = array();

                if (is_array($row)) {
                    if (empty($row['email'])) {
                        continue;
                    }
                    $record = $row;
                }
                else {
                    $record['email'] = $row;
                }

                if (empty($record['name'])) {
                    $record['name'] = $user_name != $record['email'] ? $user_name : '';
                }

                $record['user_id']  = $user_id;
                $record['standard'] = $standard;

                $plugin = $rcube->plugins->exec_hook('identity_create',
                    array('login' => true, 'record' => $record));

                if (!$plugin['abort'] && $plugin['record']['email']) {
                    $rcube->user->insert_identity($plugin['record']);
                }
                $standard = 0;
            }
        }
        else {
            rcube::raise_error(array(
                'code' => 500,
                'type' => 'php',
                'line' => __LINE__,
                'file' => __FILE__,
                'message' => "Failed to create new user"), true, false);
        }

        return $user_id ? $user_instance : false;
    }