parameters: (cluster_spec)
return_statement: return len(cluster_spec.as_dict().get(TaskType.PS, []))
docstring: Counts the number of parameter servers in cluster_spec.
docstring_summary: Counts the number of parameter servers in cluster_spec.
docstring_tokens: Counts the number of parameter servers in cluster_spec .
function: def _count_ps(cluster_spec):
    """Counts the number of parameter servers in cluster_spec."""
    if not cluster_spec:
      raise RuntimeError(
          'Internal error: `_count_ps` does not expect empty cluster_spec.')
  
    return len(cluster_spec.as_dict().get(TaskType.PS, []))
function_tokens: def _count_ps ( cluster_spec ) : if not cluster_spec : raise RuntimeError ( 'Internal error: `_count_ps` does not expect empty cluster_spec.' ) return len ( cluster_spec . as_dict ( ) . get ( TaskType . PS , [ ] ) )