<commit_before>from os import path as op, makedirs
from shutil import copy

from .base import BaseStorage


class Storage(BaseStorage):

    def run(self):
        self.log("Collect static from blueprints.")
        for bp, f, o in self:
            destination = op.join(self.collect.static_root, o)
            destination_dir = op.dirname(destination)
            if not op.exists(destination_dir):
                makedirs(destination_dir)

            if (
                not op.exists(destination)
                    or op.getmtime(destination) < op.getmtime(f)):
                copy(f, destination)
                self.log(
                    "Copied: [%s] '%s'" %
                    (bp.name,
                     op.join(
                         self.collect.static_url,
                         destination)))<commit_msg>Avoid duplicate copy in storage/file<commit_after>from os import path as op, makedirs
from shutil import copy

from .base import BaseStorage


class Storage(BaseStorage):

    def run(self):
        self.log("Collect static from blueprints.")
        destination_list = []
        for bp, f, o in self:
            destination = op.join(self.collect.static_root, o)
            destination_dir = op.dirname(destination)
            if not op.exists(destination_dir):
                makedirs(destination_dir)
            if destination in destination_list:
                self.log("{0} already copied".format(destination))
            if (
                not op.exists(destination)
                    or op.getmtime(destination) < op.getmtime(f)):
                copy(f, destination)
                self.log(
                    "Copied: [%s] '%s'" %
                    (bp.name,
                     op.join(
                         self.collect.static_url,
                         destination)))
            destination_list.append(destination)
{'fraction_non_alphanumeric': 0.08985200845665962, 'fraction_numerical': 0.0005285412262156448, 'mean_word_length': 1.5206391478029295, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5033394', 'n_tokens_mistral': 498, 'n_tokens_neox': 469, 'n_words': 120}