<commit_before>__all__ = ['NameVerDetectionError', 'Artifact', 'LocalArtifact', 'LocalRpmArtifact', 'RemoteArtifact']

import urlparse
import itertools
import re
import os


class ArtifactError(Exception):
    pass


class NameVerDetectionError(ArtifactError):
    pass


class Artifact(object):
    """
    Generic class describing an artifact
    """
    def __init__(self, group, artifact='', version='', classifier='', extension=''):
        self.group = group
        self.artifact = artifact
        self.version = version
        self.classifier = classifier
        self.extension = extension

    def get_coordinates_string(self):
        return '{group}:{artifact}:{version}:{classifier}:{extension}'.format(group=self.group, artifact=self.artifact,
                                                                              version=self.version,
                                                                              classifier=self.classifier,
                                                                              extension=self.extension)

    def __str__(self):
        return self.get_coordinates_string()


class LocalArtifact(Artifact):
    """
    Artifact for upload to repository
    """
    def __init__(self, group, local_path, artifact='', version='', classifier='', extension=''):
        self.local_path = local_path

        if not artifact and not version:
            artifact, version = self.detect_name_and_version()

        super(LocalArtifact, self).__init__(group=group, artifact=artifact, version=version, classifier=classifier,
                                            extension=extension)

    def detect_name_and_version(self):
        base_name = os.path.basename(self.local_path)
        result = re.match('^(?# name)(.*?)-(?=\d)(?# version)(\d.*)(?# extension)(\.[^.]+)$', base_name)

        if result is None:<commit_msg>fixed logging when logging a list of Artifact<commit_after>__all__ = ['NameVerDetectionError', 'Artifact', 'LocalArtifact', 'LocalRpmArtifact', 'RemoteArtifact']

import urlparse
import itertools
import re
import os


class ArtifactError(Exception):
    pass


class NameVerDetectionError(ArtifactError):
    pass


class Artifact(object):
    """
    Generic class describing an artifact
    """
    def __init__(self, group, artifact='', version='', classifier='', extension=''):
        self.group = group
        self.artifact = artifact
        self.version = version
        self.classifier = classifier
        self.extension = extension

    def get_coordinates_string(self):
        return '{group}:{artifact}:{version}:{classifier}:{extension}'.format(group=self.group, artifact=self.artifact,
                                                                              version=self.version,
                                                                              classifier=self.classifier,
                                                                              extension=self.extension)

    def __repr__(self):
        return self.get_coordinates_string()


class LocalArtifact(Artifact):
    """
    Artifact for upload to repository
    """
    def __init__(self, group, local_path, artifact='', version='', classifier='', extension=''):
        self.local_path = local_path

        if not artifact and not version:
            artifact, version = self.detect_name_and_version()

        super(LocalArtifact, self).__init__(group=group, artifact=artifact, version=version, classifier=classifier,
                                            extension=extension)

    def detect_name_and_version(self):
        base_name = os.path.basename(self.local_path)
        result = re.match('^(?# name)(.*?)-(?=\d)(?# version)(\d.*)(?# extension)(\.[^.]+)$', base_name)

        if result is None:
{'fraction_non_alphanumeric': 0.11359453063371022, 'fraction_numerical': 0.0, 'mean_word_length': 2.1334431630971995, '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': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4524722', 'n_tokens_mistral': 976, 'n_tokens_neox': 911, 'n_words': 210}