<commit_before># Port of jupyter_core.paths

path = require('path')

# Getting access to `sys.prefix` from Python
# TODO: Think of something more sensible here, possibly doing this asynchronously elsewhere
# TODO: Provide a timeout, handle error
{execSync} = require('child_process')
response = execSync 'python -c "import sys; print(sys.prefix)"'
sysPrefix = response.toString().replace /^\s+|\s+$/g, ""

console.log("Time for some sysPrefix: #{sysPrefix}")

userHome = ->
  return process.env['HOME'] or process.env['USERPROFILE'] or path.resolve('~')

# Get the Jupyter config directory for this platform and user.
# Reutrns env[JUPYTER_CONFIG_DIR] if defined, else ~/.jupyter
jupyterConfigDir = ->
  homeDir = userHome()
  if process.env['JUPYTER_CONFIG_DIR']
    return process.env['JUPYTER_CONFIG_DIR']
  return path.join(homeDir, '.jupyter')

# Get the config directory for Jupyter data files.
#
# These are non-transient, non-configuration files.
#
# Returns process.env[JUPYTER_DATA_DIR] if defined,
# else a platform-appropriate path.
jupyterDataDir = ->
  if process.env['JUPYTER_DATA_DIR']
    return process.env['JUPYTER_DATA_DIR']

  home = userHome()

  if process.platform == 'darwin'
    return path.join(home, 'Library', 'Jupyter')
  else if process.platform == 'win32'
    appData = process.env['APPDATA']
    if appData
      return path.join appData, 'jupyter'
    else<commit_msg>Clean up the sys.prefix checking<commit_after># Port of jupyter_core.paths

path = require('path')

# Access `sys.prefix` from Python, to handle particular conda and virtualenv setups
# TODO: Think of something more sensible here, possibly doing this asynchronously elsewhere
# TODO: Provide a timeout, handle error
{execSync} = require('child_process')
response = execSync 'python -c "import sys; print(sys.prefix)"'
sysPrefix = response.toString().replace /^\s+|\s+$/g, ""

userHome = ->
  return process.env['HOME'] or process.env['USERPROFILE'] or path.resolve('~')

# Get the Jupyter config directory for this platform and user.
# Reutrns env[JUPYTER_CONFIG_DIR] if defined, else ~/.jupyter
jupyterConfigDir = ->
  homeDir = userHome()
  if process.env['JUPYTER_CONFIG_DIR']
    return process.env['JUPYTER_CONFIG_DIR']
  return path.join(homeDir, '.jupyter')

# Get the config directory for Jupyter data files.
#
# These are non-transient, non-configuration files.
#
# Returns process.env[JUPYTER_DATA_DIR] if defined,
# else a platform-appropriate path.
jupyterDataDir = ->
  if process.env['JUPYTER_DATA_DIR']
    return process.env['JUPYTER_DATA_DIR']

  home = userHome()

  if process.platform == 'darwin'
    return path.join(home, 'Library', 'Jupyter')
  else if process.platform == 'win32'
    appData = process.env['APPDATA']
    if appData
      return path.join appData, 'jupyter'
    else
{'fraction_non_alphanumeric': 0.12286324786324786, 'fraction_numerical': 0.0014245014245014246, 'mean_word_length': 4.663306451612903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '181826', 'n_tokens_mistral': 934, 'n_tokens_neox': 924, 'n_words': 259}