An alternate constructor which generates a new client id.
438909
def FromPublicKey(cls, public_key):
    """"""
    # Our CN will be the first 64 bits of the hash of the public key
    # in MPI format - the length of the key in 4 bytes + the key
    # prefixed with a 0. This weird format is an artifact from the way
    # M2Crypto handled this, we have to live with it for now.
    n = public_key.GetN()
    raw_n = binascii.unhexlify("%x" % n)

    mpi_format = struct.pack(">i", len(raw_n) + 1) + b"\x00" + raw_n

    digest = binascii.hexlify(hashlib.sha256(mpi_format).digest()[:8])
    return cls("C.{}".format(digest.decode("ascii")))
1307584
public <T extends Client<? extends Options, ? extends OptionsBuilder, ? extends RequestBuilder>> T newClient(Class<? extends Client> clientClass) {
        Client client;
        try {
            client = clientClass.newInstance();
            return (T) client;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1276479
public static <T> T newInstance(Constructor<T> constructor, Object... args) {
        try {
            return constructor.newInstance(args);
        } catch (Exception e) {
            throw new ClientException(e);
        }
    }
528420
def create(client, _type, **kwargs):
    """"""
    obj = client.factory.create("ns0:%s" % _type)
    for key, value in kwargs.items():
        setattr(obj, key, value)
    return obj
930100
public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException {
        // derive client id from the connection params or use next
        String id = nextId();
        IClient client = new Client(id, this);
        addClient(id, client);
        return client;
    }
438697
def client_id(self, client):
        

        params = {
            "name": client
        }

        response = self._get(url.clients, params=params)
        self._check_response(response, 200)
        return self._create_response(response).get("client_id")
63855
def client_new():
    """"""
    form = ClientForm(request.form)

    if form.validate_on_submit():
        c = Client(user_id=current_user.get_id())
        c.gen_salt()
        form.populate_obj(c)
        db.session.add(c)
        db.session.commit()
        return redirect(url_for('.client_view', client_id=c.client_id))

    return render_template(
        'invenio_oauth2server/settings/client_new.html',
        form=form,
    )
48507
function (host, clientId) {
    // Initializes the object that stores subscriptions
    this.subscriptions = {};
    // Initializes the object that holds the internal client
    this.client = {};
    // Handles the optional clientId parameter
    if (arguments.length === 1 || clientId === undefined) {
        clientId = generateRandomClientId();
    }
    // Connect
    this.client = connectNode(this.subscriptions, host, clientId);
}
522824
def setup(cls, client_id, client_secret):
        
        cls.client_id = client_id
        cls.client_secret = client_secret
212687
function create_new() {
        var id

        // Check if we already have an id or if
        // we need to generate a new one.
        if (undefined !== ent.id$) {
          // Take a copy of the existing id and
          // delete it from the ent object. Do
          // save will handle the id for us.
          id = ent.id$
          delete ent.id$

          // Save with the existing id
          return do_save(id, true)
        }

        // Generate a new id
        id = options.generate_id ? options.generate_id(ent) : void 0

        if (undefined !== id) {
          return do_save(id, true)
        } else {
          var gen_id = {
            role: 'basic',
            cmd: 'generate_id',
            name: name,
            base: base,
            zone: zone
          }

          // When we get a respones we will use the id param
          // as our entity id, if this fails we just fail and
          // call reply() as we have no way to save without an id
          seneca.act(gen_id, function(err, id) {
            if (err) return reply(err)
            do_save(id, true)
          })
        }
      }
623542
@Override
    public void setClientID(String clientID) throws InvalidClientIDRuntimeException, IllegalStateRuntimeException, JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setClientID", new Object[] { clientID });

        try {
            jmsConnection.setClientID(clientID);
        } catch (InvalidClientIDException icie) {
            throw (InvalidClientIDRuntimeException) JmsErrorUtils.getJMS2Exception(icie, InvalidClientIDRuntimeException.class);
        } catch (IllegalStateException ise) {
            throw (IllegalStateRuntimeException) JmsErrorUtils.getJMS2Exception(ise, IllegalStateRuntimeException.class);
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "setClientID");
        }

    }
367365
function createClient(redisClientOptions) {
  const client = redis.createClient(redisClientOptions);
  if (!client._options) {
    client._options = redisClientOptions;
  }
  return client;
}
561022
def get_client(self, client_id):
        ''''''
        client_response = self.get_request('clients/%s' % client_id)
        return Client(self, client_response['client'])
908417
@Override
    public Object generate(TableGeneratorDiscriptor discriptor, ClientBase client, String dataType)
    {
        try
        {
            HTableInterface hTable = ((HBaseDataHandler) ((HBaseClient) client).handler).gethTable(discriptor
                    .getSchema());
            Long latestCount = hTable.incrementColumnValue(discriptor.getPkColumnValue().getBytes(), discriptor
                    .getTable().getBytes(), discriptor.getValueColumnName().getBytes(), 1);
            if (latestCount == 1)
            {
                return (long) discriptor.getInitialValue();
            }
            else if (discriptor.getAllocationSize() == 1)
            {
                return latestCount + discriptor.getInitialValue();
            }
            else
            {
                return (latestCount - 1) * discriptor.getAllocationSize() + discriptor.getInitialValue();
            }
        }
        catch (IOException ioex)
        {
            log.error("Error while generating id for entity, Caused by: .", ioex);
            throw new KunderaException(ioex);
        }
    }
101248
protected final ClientBuilder newClientBuilder(String uri, Consumer<ClientBuilder> customizer) {
        final ClientBuilder builder = new ClientBuilder(uri);
        customizer.accept(builder);
        clientConfigurator.configure(builder);
        builder.factory(clientFactory());
        return builder;
    }
545992
protected void fixClientID() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "fixClientID");

        synchronized (stateLock) {
            clientIDFixed = true;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "fixClientID");
    }
273117
public static function setClientId($client_id){
      if (!isset(self::$_config)){
        self::initialize();
      }
      self::$_config->configure(['CLIENT_ID' => $client_id]); 
    }