""" covid_api indicator groups """
import os
from typing import List

from covid_api.db.static.errors import InvalidIdentifier
from covid_api.models.static import IndicatorGroup, IndicatorGroups

data_dir = os.path.join(os.path.dirname(__file__))


class GroupManager(object):
    """Default Group holder."""

    def __init__(self):
        """Load all groups in a dict."""
        groups = [
            os.path.splitext(f)[0] for f in os.listdir(data_dir) if f.endswith(".json")
        ]

        self._data = {
            group: IndicatorGroup.parse_file(os.path.join(data_dir, f"{group}.json"))
            for group in groups
        }

    def get(self, identifier: str) -> IndicatorGroup:
        """Fetch a Group."""
        try:
            return self._data[identifier]
        except KeyError:
            raise InvalidIdentifier(f"Invalid identifier: {identifier}")

    def get_all(self) -> IndicatorGroups:
        """Fetch all Groups."""
        return IndicatorGroups(groups=[group.dict() for group in self._data.values()])

    def list(self) -> List[str]:
        """List all groups"""
        return list(self._data.keys())


groups = GroupManager()

153b7c833d1af5c36003feac9f4c8a642f65e4a8
<mask token>


class GroupManager(object):
    <mask token>

    def __init__(self):
        """Load all groups in a dict."""
        groups = [os.path.splitext(f)[0] for f in os.listdir(data_dir) if f
            .endswith('.json')]
        self._data = {group: IndicatorGroup.parse_file(os.path.join(
            data_dir, f'{group}.json')) for group in groups}
    <mask token>

    def get_all(self) ->IndicatorGroups:
        """Fetch all Groups."""
        return IndicatorGroups(groups=[group.dict() for group in self._data
            .values()])
    <mask token>


<mask token>

<mask token>


class GroupManager(object):
    <mask token>

    def __init__(self):
        """Load all groups in a dict."""
        groups = [os.path.splitext(f)[0] for f in os.listdir(data_dir) if f
            .endswith('.json')]
        self._data = {group: IndicatorGroup.parse_file(os.path.join(
            data_dir, f'{group}.json')) for group in groups}
    <mask token>

    def get_all(self) ->IndicatorGroups:
        """Fetch all Groups."""
        return IndicatorGroups(groups=[group.dict() for group in self._data
            .values()])

    def list(self) ->List[str]:
        """List all groups"""
        return list(self._data.keys())


<mask token>

<mask token>
data_dir = os.path.join(os.path.dirname(__file__))


class GroupManager(object):
    """Default Group holder."""

    def __init__(self):
        """Load all groups in a dict."""
        groups = [os.path.splitext(f)[0] for f in os.listdir(data_dir) if f
            .endswith('.json')]
        self._data = {group: IndicatorGroup.parse_file(os.path.join(
            data_dir, f'{group}.json')) for group in groups}

    def get(self, identifier: str) ->IndicatorGroup:
        """Fetch a Group."""
        try:
            return self._data[identifier]
        except KeyError:
            raise InvalidIdentifier(f'Invalid identifier: {identifier}')

    def get_all(self) ->IndicatorGroups:
        """Fetch all Groups."""
        return IndicatorGroups(groups=[group.dict() for group in self._data
            .values()])

    def list(self) ->List[str]:
        """List all groups"""
        return list(self._data.keys())


groups = GroupManager()

<mask token>
import os
from typing import List
from covid_api.db.static.errors import InvalidIdentifier
from covid_api.models.static import IndicatorGroup, IndicatorGroups
data_dir = os.path.join(os.path.dirname(__file__))


class GroupManager(object):
    """Default Group holder."""

    def __init__(self):
        """Load all groups in a dict."""
        groups = [os.path.splitext(f)[0] for f in os.listdir(data_dir) if f
            .endswith('.json')]
        self._data = {group: IndicatorGroup.parse_file(os.path.join(
            data_dir, f'{group}.json')) for group in groups}

    def get(self, identifier: str) ->IndicatorGroup:
        """Fetch a Group."""
        try:
            return self._data[identifier]
        except KeyError:
            raise InvalidIdentifier(f'Invalid identifier: {identifier}')

    def get_all(self) ->IndicatorGroups:
        """Fetch all Groups."""
        return IndicatorGroups(groups=[group.dict() for group in self._data
            .values()])

    def list(self) ->List[str]:
        """List all groups"""
        return list(self._data.keys())


groups = GroupManager()

""" covid_api indicator groups """
import os
from typing import List

from covid_api.db.static.errors import InvalidIdentifier
from covid_api.models.static import IndicatorGroup, IndicatorGroups

data_dir = os.path.join(os.path.dirname(__file__))


class GroupManager(object):
    """Default Group holder."""

    def __init__(self):
        """Load all groups in a dict."""
        groups = [
            os.path.splitext(f)[0] for f in os.listdir(data_dir) if f.endswith(".json")
        ]

        self._data = {
            group: IndicatorGroup.parse_file(os.path.join(data_dir, f"{group}.json"))
            for group in groups
        }

    def get(self, identifier: str) -> IndicatorGroup:
        """Fetch a Group."""
        try:
            return self._data[identifier]
        except KeyError:
            raise InvalidIdentifier(f"Invalid identifier: {identifier}")

    def get_all(self) -> IndicatorGroups:
        """Fetch all Groups."""
        return IndicatorGroups(groups=[group.dict() for group in self._data.values()])

    def list(self) -> List[str]:
        """List all groups"""
        return list(self._data.keys())


groups = GroupManager()
