<commit_before>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Check out the Skia sources. """


<<<<<<< .mine
from common import chromium_utils
from utils import file_utils
from utils import gclient_utils
=======
from utils import gclient_utils, shell_utils
>>>>>>> .r11221
from build_step import BuildStep, BuildStepFailure
import ast
import os
import socket
import sys


# TODO(epoger): temporarily added to use the git mirror behind our NAT
def _PopulateGitConfigFile():
  print 'entering _PopulateGitConfigFile()...'

  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  s.connect(('google.com', 80))
  my_ipaddr = s.getsockname()[0]
  print '  I think my IP address is "%s"' % my_ipaddr

  destpath = os.path.join(os.path.expanduser('~'), '.gitconfig')
  destfile = open(destpath, 'w')
  if my_ipaddr.startswith('192.168.1.'):
    print ('  I think I am behind the NAT router. '
           'Writing to .gitconfig file at "%s"...' % destpath)
    destfile.write('[url "http://192.168.1.122/git-mirror/skia"]\n'
                   '   insteadOf = https://skia.googlesource.com/skia\n')
  else:
    print ('  I think I am NOT behind the NAT router. '
           'Writing a blank .gitconfig file to "%s".' % destpath)
    destfile.write('')<commit_msg>Fix merge conflicts in Update<commit_after>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

""" Check out the Skia sources. """


from common import chromium_utils
from utils import gclient_utils, shell_utils
from build_step import BuildStep, BuildStepFailure
import ast
import os
import socket
import sys


# TODO(epoger): temporarily added to use the git mirror behind our NAT
def _PopulateGitConfigFile():
  print 'entering _PopulateGitConfigFile()...'

  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  s.connect(('google.com', 80))
  my_ipaddr = s.getsockname()[0]
  print '  I think my IP address is "%s"' % my_ipaddr

  destpath = os.path.join(os.path.expanduser('~'), '.gitconfig')
  destfile = open(destpath, 'w')
  if my_ipaddr.startswith('192.168.1.'):
    print ('  I think I am behind the NAT router. '
           'Writing to .gitconfig file at "%s"...' % destpath)
    destfile.write('[url "http://192.168.1.122/git-mirror/skia"]\n'
                   '   insteadOf = https://skia.googlesource.com/skia\n')
  else:
    print ('  I think I am NOT behind the NAT router. '
           'Writing a blank .gitconfig file to "%s".' % destpath)
    destfile.write('')
{'fraction_non_alphanumeric': 0.12743297833272127, 'fraction_numerical': 0.019463826661770108, 'mean_word_length': 3.4802631578947367, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6182258', 'n_tokens_mistral': 932, 'n_tokens_neox': 869, 'n_words': 287}