code: func extractNSTolerations(ns *corev1.Namespace, key string) ([]api.Toleration, error) {
  	// if a namespace does not have any annotations
  	if len(ns.Annotations) == 0 {
  		return nil, nil
  	}
  
  	// if NSWLTolerations or NSDefaultTolerations does not exist
  	if _, ok := ns.Annotations[key]; !ok {
  		return nil, nil
  	}
  
  	// if value is set to empty
  	if len(ns.Annotations[key]) == 0 {
  		return []api.Toleration{}, nil
  	}
  
  	var v1Tolerations []v1.Toleration
  	err := json.Unmarshal([]byte(ns.Annotations[key]), &v1Tolerations)
  	if err != nil {
  		return nil, err
  	}
  
  	ts := make([]api.Toleration, len(v1Tolerations))
  	for i := range v1Tolerations {
  		if err := k8s_api_v1.Convert_v1_Toleration_To_core_Toleration(&v1Tolerations[i], &ts[i], nil); err != nil {
  			return nil, err
  		}
  	}
  
  	return ts, nil
  }
docs: // extractNSTolerations extracts default or whitelist of tolerations from
  // following namespace annotations keys: "scheduler.alpha.kubernetes.io/defaultTolerations"
  // and "scheduler.alpha.kubernetes.io/tolerationsWhitelist". If these keys are
  // unset (nil), extractNSTolerations returns nil. If the value to these
  // keys are set to empty, an empty toleration is returned, otherwise
  // configured tolerations are returned.