<commit_before>'use strict';
/* eslint no-process-env: 0 no-sync:0 */

const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');

const caPath = '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt';
const tokenPath = '/var/run/secrets/kubernetes.io/serviceaccount/token';
const namespacePath = '/var/run/secrets/kubernetes.io/serviceaccount/namespace';

function defaultConfigPath() {
  const homeDir = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
  return path.join(homeDir, '.kube', 'config');
}

/**
* Returns with in cluster config<commit_msg>feat(kube-config): add support for KUBECONFIG env var (#322)<commit_after>'use strict';
/* eslint no-process-env: 0 no-sync:0 */

const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');

const caPath = '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt';
const tokenPath = '/var/run/secrets/kubernetes.io/serviceaccount/token';
const namespacePath = '/var/run/secrets/kubernetes.io/serviceaccount/namespace';

function defaultConfigPath() {
  if (process.env.KUBECONFIG) {
    // From https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable
    // KUBECONFIG can support multiple config files.
    // If multiple config files in KUBECONFIG, then return the first one.
    const delimiter = process.platform === 'win32' ? ';' : ':';
    const configPaths = process.env.KUBECONFIG.split(delimiter);
    return configPaths[0];
  }
  const homeDir = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
  return path.join(homeDir, '.kube', 'config');
}

/**
* Returns with in cluster config
{'fraction_non_alphanumeric': 0.16183294663573086, 'fraction_numerical': 0.008120649651972157, 'mean_word_length': 4.6743421052631575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '4388170', 'n_tokens_mistral': 561, 'n_tokens_neox': 540, 'n_words': 118}