def _index_param_value(X, v, indices):
 if ((not _is_arraylike(v)) or (_num_samples(v) != _num_samples(X))):
  return v
 if sp.issparse(v):
  v = v.tocsr()
 return safe_indexing(v, indices)

def _index_param_value ( X , v , indices ) : if ( ( not _is_arraylike ( v ) ) or ( _num_samples ( v ) != _num_samples ( X ) ) ) : return v if sp . issparse ( v ) : v = v . tocsr ( ) return safe_indexing ( v , indices )
private helper function for parameter value indexing .