<commit_before># Copyright 2014 <NAME>

#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at

#        http://www.apache.org/licenses/LICENSE-2.0

#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
import config
from version import Version
from creationinfo import CreationInfo
from package import Package


class License(object):

    """Represents a License."""

    def __init__(self, full_name, identifier):
        super(License, self).__init__()
        self._full_name = full_name
        self._identifier = identifier

    @classmethod
    def from_identifier(cls, identifier):
        if identifier in config.LICENSE_MAP.keys():
            return cls(config.LICENSE_MAP[identifier], identifier)
        else:
            return cls(identifier, identifier)

    @classmethod
    def from_full_name(cls, full_name):
        return cls(full_name, config.LICENSE_MAP[full_name])

    @property
    def url(self):
        return "http://spdx.org/licenses/{0}".format(self.identifier)

    @property
    def full_name(self):
        return self._full_name

    @property
    def identifier(self):
        return self._identifier

    def __eq__(self, other):
        if isinstance(other, License):
            return ((self.identifier == other.identifier) &
                    (self.full_name == other.full_name))
        else:
            return False


class LicenseConjuction(License):
<commit_msg>Adds docstring to License from_identifier and from_full_name methods<commit_after># Copyright 2014 <NAME>

#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at

#        http://www.apache.org/licenses/LICENSE-2.0

#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
import config
from version import Version
from creationinfo import CreationInfo
from package import Package


class License(object):

    """Represents a License."""

    def __init__(self, full_name, identifier):
        super(License, self).__init__()
        self._full_name = full_name
        self._identifier = identifier

    @classmethod
    def from_identifier(cls, identifier):
        """If identifier exists in config.LICENSE_MAP
        the full_name is retrived from it. Otherwise 
        the full_name is the same as the identifier.
        """
        if identifier in config.LICENSE_MAP.keys():
            return cls(config.LICENSE_MAP[identifier], identifier)
        else:
            return cls(identifier, identifier)

    @classmethod
    def from_full_name(cls, full_name):
        """If the full_name exists in config.LICENSE_MAP
        the identifier is retrieved from it. Otherwise
        the identifier is the same as the full_name.
        """
        if full_name in config.LICENSE_MAP.keys():
            return cls(full_name, config.LICENSE_MAP[full_name])
        else:
            return cls(full_name, full_name)

    @property
    def url(self):
        return "http://spdx.org/licenses/{0}".format(self.identifier)

    @property
    def full_name(self):
        return self._full_name

    @property
    def identifier(self):
        return self._identifier

    def __eq__(self, other):
        if isinstance(other, License):
            return ((self.identifier == other.identifier) &
                    (self.full_name == other.full_name))
        else:
            return False


class LicenseConjuction(License):

{'fraction_non_alphanumeric': 0.0787382614977125, 'fraction_numerical': 0.004334216229231881, 'mean_word_length': 2.797074954296161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6048312', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1066, 'n_words': 384}