"""Metadata constants and methods."""

from .classes import Resource
from .resources import RESOURCES

RESOURCES = {name: Resource.from_id(name) for name in RESOURCES}

"""Metadata constants and methods."""

import pydantic

from . import resources
from .classes import Resource

RESOURCES = {}
errors = []
for name in resources.RESOURCES:
    try:
        RESOURCES[name] = Resource.from_id(name)
    except pydantic.ValidationError as error:
        errors.append("\n" + f"[{name}] {error}")
if errors:
    raise ValueError("".join(errors))

Print all resource validation errors
Print all resource validation errors

  """Metadata constants and methods."""
  
+ import pydantic
+ 
+ from . import resources
  from .classes import Resource
- from .resources import RESOURCES
  
- RESOURCES = {name: Resource.from_id(name) for name in RESOURCES}
+ RESOURCES = {}
+ errors = []
+ for name in resources.RESOURCES:
+     try:
+         RESOURCES[name] = Resource.from_id(name)
+     except pydantic.ValidationError as error:
+         errors.append("\n" + f"[{name}] {error}")
+ if errors:
+     raise ValueError("".join(errors))
  
Print all resource validation errors
## Code Before:
"""Metadata constants and methods."""

from .classes import Resource
from .resources import RESOURCES

RESOURCES = {name: Resource.from_id(name) for name in RESOURCES}

## Instruction:
Print all resource validation errors
## Code After:
"""Metadata constants and methods."""

import pydantic

from . import resources
from .classes import Resource

RESOURCES = {}
errors = []
for name in resources.RESOURCES:
    try:
        RESOURCES[name] = Resource.from_id(name)
    except pydantic.ValidationError as error:
        errors.append("\n" + f"[{name}] {error}")
if errors:
    raise ValueError("".join(errors))
