<commit_before>#!/usr/bin/env python
# Copyright (c) 2013 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.

""" Download the image files needed to run skimage tool. """

from build_step import BuildStep
from utils import gs_utils
from utils import sync_bucket_subdir
import os
import sys

class DownloadSKImageFiles(BuildStep):
  def __init__(self, timeout=12800, no_output_timeout=9600, **kwargs):
    super (DownloadSKImageFiles, self).__init__(
        timeout=timeout,
        no_output_timeout=no_output_timeout,
        **kwargs)

  def _DownloadSKImagesFromStorage(self):
    """Copies over image files from Google Storage if the timestamps differ."""
    dest_gsbase = (self._args.get('dest_gsbase') or
                   sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE)
    print '\n\n========Downloading image files from Google Storage========\n\n'
    gs_relative_dir = os.path.join('skimage', 'input')
    gs_utils.DownloadDirectoryContentsIfChanged(
        gs_base=dest_gsbase,
        gs_relative_dir=gs_relative_dir,
        local_dir=self._skimage_in_dir)

  def _Run(self):
    # Locally copy image files from GoogleStorage.
    self._DownloadSKImagesFromStorage()


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(DownloadSKImageFiles))<commit_msg>Use posixpath for paths in the cloud.<commit_after>#!/usr/bin/env python
# Copyright (c) 2013 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.

""" Download the image files needed to run skimage tool. """

from build_step import BuildStep
from utils import gs_utils
from utils import sync_bucket_subdir
import posixpath
import sys

class DownloadSKImageFiles(BuildStep):
  def __init__(self, timeout=12800, no_output_timeout=9600, **kwargs):
    super (DownloadSKImageFiles, self).__init__(
        timeout=timeout,
        no_output_timeout=no_output_timeout,
        **kwargs)

  def _DownloadSKImagesFromStorage(self):
    """Copies over image files from Google Storage if the timestamps differ."""
    dest_gsbase = (self._args.get('dest_gsbase') or
                   sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE)
    print '\n\n========Downloading image files from Google Storage========\n\n'
    gs_relative_dir = posixpath.join('skimage', 'input')
    gs_utils.DownloadDirectoryContentsIfChanged(
        gs_base=dest_gsbase,
        gs_relative_dir=gs_relative_dir,
        local_dir=self._skimage_in_dir)

  def _Run(self):
    # Locally copy image files from GoogleStorage.
    self._DownloadSKImagesFromStorage()


if '__main__' == __name__:
  sys.exit(BuildStep.RunBuildStep(DownloadSKImageFiles))
{'fraction_non_alphanumeric': 0.09290601368383147, 'fraction_numerical': 0.009362621534029529, 'mean_word_length': 4.291428571428572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4435103', 'n_tokens_mistral': 857, 'n_tokens_neox': 822, 'n_words': 229}