<commit_before># Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""

import os
import re
import subprocess
import sys

from six.moves import collections_abc

from gyp.common import OrderedSet
import gyp.MSVSUtil
import gyp.MSVSVersion

try:
  # basestring was removed in python3.
  basestring
except NameError:
  basestring = str


windows_quoter_regex = re.compile(r'(\\*)"')


def QuoteForRspFile(arg):
  """Quote a command line argument so that it appears as one argument when
  processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for
  Windows programs)."""
  # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment
  # threads. This is actually the quoting rules for CommandLineToArgvW, not
  # for the shell, because the shell doesn't do anything in Windows. This
  # works more or less because most programs (including the compiler, etc.)
  # use that function to handle command line arguments.

  # Use a heuristic to try to find args that are paths, and normalize them
  if arg.find('/') > 0 or arg.count('/') > 1:
    arg = os.path.normpath(arg)<commit_msg>msvs_emulation.py: allow skipping path normalization<commit_after># Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""

import os
import re
import subprocess
import sys

from six.moves import collections_abc

from gyp.common import OrderedSet
import gyp.MSVSUtil
import gyp.MSVSVersion

try:
  # basestring was removed in python3.
  basestring
except NameError:
  basestring = str


windows_quoter_regex = re.compile(r'(\\*)"')


def QuoteForRspFile(arg):
  """Quote a command line argument so that it appears as one argument when
  processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for
  Windows programs)."""
  # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment
  # threads. This is actually the quoting rules for CommandLineToArgvW, not
  # for the shell, because the shell doesn't do anything in Windows. This
  # works more or less because most programs (including the compiler, etc.)
  # use that function to handle command line arguments.

  if not os.getenv('GYP_MSVS_DISABLE_PATH_NORMALIZATION'):
    # Use a heuristic to try to find args that are paths, and normalize them
    if arg.find('/') > 0 or arg.count('/') > 1:
      arg = os.path.normpath(arg)
{'fraction_non_alphanumeric': 0.07681053401609364, 'fraction_numerical': 0.008046817849305048, 'mean_word_length': 4.0275735294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2199810', 'n_tokens_mistral': 837, 'n_tokens_neox': 793, 'n_words': 356}