<commit_before>.. code-block:: csharp

  // You can wait for any number of states, e.g. Active, Reboot, etc.
  CloudServersProvider cloudServersProvider = new CloudServersProvider(cloudIdentity);
  ServerState[] errorStates = new ServerState[1] { ServerState.Active };
  ServerState[] serverStates = new ServerState[1] { ServerState.Unknown };
  cloudServersProvider.WaitForServerState("{server_id}", serverStates, errorStates);

.. code-block:: java

  ServerPredicates.awaitActive(serverApi).apply(serverCreated.getId())

.. code-block:: javascript

.. code-block:: php

  $server->waitFor('ACTIVE', 600);

.. code-block:: python

  pyrax.utils.wait_for_build(server, verbose=True)

.. code-block:: ruby

  server.wait_for { active }

.. code-block:: sh

  # from resulting json below see "status"
  curl -X GET $ENDPOINT/{serverId} \
    -H "X-Auth-Token: $TOKEN" | python -m json.tool<commit_msg>Update cloud servers sample code for node.js (server.setWait)<commit_after>.. code-block:: csharp

  // You can wait for any number of states, e.g. Active, Reboot, etc.
  CloudServersProvider cloudServersProvider = new CloudServersProvider(cloudIdentity);
  ServerState[] errorStates = new ServerState[1] { ServerState.Active };
  ServerState[] serverStates = new ServerState[1] { ServerState.Unknown };
  cloudServersProvider.WaitForServerState("{server_id}", serverStates, errorStates);

.. code-block:: java

  ServerPredicates.awaitActive(serverApi).apply(serverCreated.getId())

.. code-block:: javascript

  server.setWait({ status: server.STATUS.running }, 6000, function(err) {
    if (err) {
      // TODO handle err as appropriate
    }

    // TODO continue after status is running
  });

.. code-block:: php

  $server->waitFor('ACTIVE', 600);

.. code-block:: python

  pyrax.utils.wait_for_build(server, verbose=True)

.. code-block:: ruby

  server.wait_for { active }

.. code-block:: sh

  # from resulting json below see "status"
  curl -X GET $ENDPOINT/{serverId} \
    -H "X-Auth-Token: $TOKEN" | python -m json.tool
{'fraction_non_alphanumeric': 0.13506876227897838, 'fraction_numerical': 0.0068762278978389, 'mean_word_length': 4.0925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1793700', 'n_tokens_mistral': 655, 'n_tokens_neox': 624, 'n_words': 158}