<commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-

import six

from asdf.asdftypes import CustomType, ExtensionTypeMeta


__all__ = ['AstropyType', 'AstropyAsdfType']


_astropy_types = set()
_astropy_asdf_types = set()


class AstropyTypeMeta(ExtensionTypeMeta):
    """
    Keeps track of `AstropyType` subclasses that are created so that they can
    be stored automatically by astropy extensions for ASDF.
    """
    def __new__(mcls, name, bases, attrs):
        cls = super(AstropyTypeMeta, mcls).__new__(mcls, name, bases, attrs)
        # Classes using this metaclass are automatically added to the list of
        # astropy extensions
        if cls.organization == 'astropy.org' and cls.standard == 'astropy':
            _astropy_types.add(cls)
        elif cls.organization == 'stsci.edu' and cls.standard == 'asdf':
            _astropy_asdf_types.add(cls)

        return cls


@six.add_metaclass(AstropyTypeMeta)
class AstropyType(CustomType):
    """
    This class represents types that have schemas that are defined by Astropy.
    standard, but have tags that are implemented within astropy.

    IMPORTANT: This parent class should **not** be used for types that also
    have schemas that are defined by astropy.
    """
    organization = 'astropy.org'
    standard = 'astropy'


@six.add_metaclass(AstropyTypeMeta)<commit_msg>Fix comments in docstring for Astropy extensions<commit_after># Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-

import six

from asdf.asdftypes import CustomType, ExtensionTypeMeta


__all__ = ['AstropyType', 'AstropyAsdfType']


_astropy_types = set()
_astropy_asdf_types = set()


class AstropyTypeMeta(ExtensionTypeMeta):
    """
    Keeps track of `AstropyType` subclasses that are created so that they can
    be stored automatically by astropy extensions for ASDF.
    """
    def __new__(mcls, name, bases, attrs):
        cls = super(AstropyTypeMeta, mcls).__new__(mcls, name, bases, attrs)
        # Classes using this metaclass are automatically added to the list of
        # astropy extensions
        if cls.organization == 'astropy.org' and cls.standard == 'astropy':
            _astropy_types.add(cls)
        elif cls.organization == 'stsci.edu' and cls.standard == 'asdf':
            _astropy_asdf_types.add(cls)

        return cls


@six.add_metaclass(AstropyTypeMeta)
class AstropyType(CustomType):
    """
    This class represents types that have schemas and tags that are defined by
    Astropy.

    IMPORTANT: This parent class should **not** be used for types that have
    schemas that are defined by the ASDF standard.
    """
    organization = 'astropy.org'
    standard = 'astropy'


@six.add_metaclass(AstropyTypeMeta)
{'fraction_non_alphanumeric': 0.08876163206871868, 'fraction_numerical': 0.0014316392269148174, 'mean_word_length': 3.3946540880503147, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6619297', 'n_tokens_mistral': 861, 'n_tokens_neox': 829, 'n_words': 271}