Sure, here is the Python code that you can use to perform PCA on a NumPy array without using any libraries other than NumPy itself:

```python
import numpy as np

def pca(X):
  """Performs principal component analysis on a NumPy array.

  Args:
    X: A NumPy array of data.

  Returns:
    A tuple of (principal_components, explained_variance_ratios).
  """

  # Standardize the data.
  X_mean = np.mean(X, axis=0)
  X_std = np.std(X, axis=0)
  X = (X - X_mean) / X_std

  # Calculate the covariance matrix.
  C = np.cov(X.T)

  # Perform eigendecomposition on the covariance matrix.
  eigenvalues, eigenvectors = np.linalg.eigh(C)

  # Sort the eigenvectors by their eigenvalues.
  eigenvectors = eigenvectors[:, eigenvalues.argsort()]

  # Calculate the explained variance ratio for each eigenvector.
  explained_variance_ratios = eigenvalues / np.sum(eigenvalues)

  return eigenvectors, explained_variance_ratios
```

This code first standardizes the data by subtracting the mean from each column and dividing by the standard deviation. Then, it calculates the covariance matrix of the standardized data. Next, it performs eigendecomposition on the covariance matrix to get the eigenvectors and eigenvalues. Finally, it sorts the eigenvectors by their eigenvalues and calculates the explained variance ratio for each eigenvector.

The eigenvectors are the principal components, and the explained variance ratio is the fraction of the total variance explained by each principal component.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence