Add an AP profile for connecting to afterward.
540850
def add_network_profile(self, obj, params):
        """"""

        network_id = self._send_cmd_to_wpas(obj['name'], 'ADD_NETWORK', True)
        network_id = network_id.strip()

        params.process_akm()

        self._send_cmd_to_wpas(
                obj['name'],
                'SET_NETWORK {} ssid \"{}\"'.format(network_id, params.ssid))

        key_mgmt = ''
        if params.akm[-1] in [AKM_TYPE_WPAPSK, AKM_TYPE_WPA2PSK]:
            key_mgmt = 'WPA-PSK'
        elif params.akm[-1] in [AKM_TYPE_WPA, AKM_TYPE_WPA2]:
            key_mgmt = 'WPA-EAP'
        else:
            key_mgmt = 'NONE'

        if key_mgmt:
            self._send_cmd_to_wpas(
                    obj['name'],
                    'SET_NETWORK {} key_mgmt {}'.format(
                        network_id,
                        key_mgmt))

        proto = ''
        if params.akm[-1] in [AKM_TYPE_WPAPSK, AKM_TYPE_WPA]:
            proto = 'WPA'
        elif params.akm[-1] in [AKM_TYPE_WPA2PSK, AKM_TYPE_WPA2]:
            proto = 'RSN'

        if proto:
            self._send_cmd_to_wpas(
                    obj['name'],
                    'SET_NETWORK {} proto {}'.format(
                        network_id,
                        proto))

        if params.akm[-1] in [AKM_TYPE_WPAPSK, AKM_TYPE_WPA2PSK]:
            self._send_cmd_to_wpas(
                    obj['name'],
                    'SET_NETWORK {} psk \"{}\"'.format(network_id, params.key))

        return params
781132
def load_profile(self, profile_name):
        """"""
        data = self.storage.get_user_profiles(profile_name)

        for x in data.get_user_views():
            self._graph.add_edge(int(x[0]), int(x[1]), {'weight': float(x[2])})
            self.all_records[int(x[1])] += 1

        return self._graph
623430
def add_port_profile(self, profile_name, vlan_id, device_id):
        """"""
        if not self.get_port_profile_for_vlan(vlan_id, device_id):
            port_profile = ucsm_model.PortProfile(profile_id=profile_name,
                                                  vlan_id=vlan_id,
                                                  device_id=device_id,
                                                  created_on_ucs=False)
            with self.session.begin(subtransactions=True):
                self.session.add(port_profile)
            return port_profile
987466
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # async not supported yet
        lpar_oid = uri_parms[0]
        lpar_uri = '/api/logical-partitions/' + lpar_oid
        try:
            lpar = hmc.lookup_by_uri(lpar_uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        cpc = lpar.manager.parent
        assert not cpc.dpm_enabled

        status = lpar.properties.get('status', None)
        force = body.get('force', False) if body else False
        if status == 'operating' and not force:
            raise ServerError(method, uri, reason=263,
                              message="LPAR {!r} could not be activated "
                              "because the LPAR is in status {} "
                              "(and force was not specified).".
                              format(lpar.name, status))

        act_profile_name = body.get('activation-profile-name', None)
        if not act_profile_name:
            act_profile_name = lpar.properties.get(
                'next-activation-profile-name', None)
        if act_profile_name is None:
            act_profile_name = ''

        # Perform the check between LPAR name and profile name
        if act_profile_name != lpar.name:
            raise ServerError(method, uri, reason=263,
                              message="LPAR {!r} could not be activated "
                              "because the name of the image activation "
                              "profile {!r} is different from the LPAR name.".
                              format(lpar.name, act_profile_name))

        # Reflect the activation in the resource
        lpar.properties['status'] = LparActivateHandler.get_status()
        lpar.properties['last-used-activation-profile'] = act_profile_name
1142738
public function addAction() {
        $name = $this->ask('Enter the <underline>profile name</underline> to add', 'local');
        if (!ConfigService::createEnvironment($name)) {
            $this->error($name . ' is already exists');
        }

        $this->notify('Environment created – ' . $name);
    }
518643
public void addProfile(KeyDecodingProfile profile) {
        for (CharacterPattern pattern : profile.getPatterns()) {
            synchronized(bytePatterns) {
                //If an equivalent pattern already exists, remove it first
                bytePatterns.remove(pattern);
                bytePatterns.add(pattern);
            }
        }
    }
977540
def add_probe(self, probe):
        """"""
        if self.probes:
            probe_last = self.probes[-1]
            if not probe.ip:
                probe.ip = probe_last.ip
                probe.name = probe_last.name
        self.probes.append(probe)
475756
def add_peer(self, peerAddr, networks=None):
        """"""
        if _debug: BTR._debug("add_peer %r networks=%r", peerAddr, networks)

        # see if this is already a peer
        if peerAddr in self.peers:
            # add the (new?) reachable networks
            if not networks:
                networks = []
            else:
                self.peers[peerAddr].extend(networks)
        else:
            if not networks:
                networks = []

            # save the networks
            self.peers[peerAddr] = networks
330763
protected void addProfileRolesFromAttributes(final CommonProfile profile,
                                                 final LdapAttribute ldapAttribute,
                                                 final String prefix) {
        ldapAttribute.getStringValues().forEach(value -> profile.addRole(prefix.concat(value.toUpperCase())));
    }
118937
def addProfile(self, profile):
        
        # use the existing version
        for exist in self.profiles():
            if exist.name() == profile.name():
                if exist.version() < profile.version():
                    exist.setProfile(profile)
                
                return
        
        # otherwise create a new profile 
        act = XViewProfileAction(profile, self)
        self._profileGroup.addAction(act)
        self.addAction(act)
        return act
439312
private void addConnectFuture(ConnectFuture future) {
        Object key = connectFutures.add(future);
        future.getSession().setAttributeIfAbsent(CONNECT_FUTURE_KEY, key);
    }
872987
function addPrefs(profile, options) {
  var userPrefs = options.prefs || {};

  return when.promise(function(resolve, reject) {
    Object.keys(userPrefs).forEach(function(key) {
      profile.setPreference(key, userPrefs[key]);
    });
    profile.updatePreferences();
    resolve(profile);
  });
}
1062981
def addProfile(self, profile):
        
        if ( profile in self._profiles ):
            return
        
        self._profiles.append(profile)
        self._profileCombo.blockSignals(True)
        self._profileCombo.addItem(profile.name())
        self._profileCombo.setCurrentIndex(self._profileCombo.count()-1)
        self._profileCombo.blockSignals(False)
1062460
def profile_path(profile_id, profile):
    """"""
    user = os.path.expanduser("~")
    return os.path.join(user, profile_id + profile)
793025
function install(req, res /*, next */) {
  res.writeln('Add the following to your profile:');
  res.writeln('eval "$(%s --completion)"', req.program);
  res.end();
}
95202
function (req, res, next) {
    var peopleApiUrl = 'https://www.googleapis.com/plus/v1/people/me/openIdConnect';
    var accessToken = req.accessToken;
    var headers = { Authorization: 'Bearer ' + accessToken };
    request.get({ url: peopleApiUrl, headers: headers, json: true }, function(err, response, profile) {
      if (response.statusCode !== 200) {
        res.status(500).send(err);
        return;
      }
      req.profile = profile;
      next();
    });
  }
47746
def add(self, auth, method, args, notimeout=False):
        """"""
        authstr = self._authstr(auth)
        self._requests.setdefault(authstr, []).append((method, args))
        self._notimeouts.setdefault(authstr, False)
        if notimeout:
            self._notimeouts[authstr] = notimeout