# Path: app/util.py
# def cached_function(func: Callable[..., Any]) -> Callable[..., Any]:
#     data = {}
# 
#     def wrapper(*args: Any) -> Any:
#         if not SHOULD_CACHE:
#             return func(*args)
#         cache_key = ' '.join([str(x) for x in args])
#         if cache_key not in data:
#             data[cache_key] = func(*args)
#         return data[cache_key]
# 
#     wrapper.__qualname__ = func.__qualname__
#     wrapper.__signature__ = inspect.signature(func)  # type: ignore
#     return wrapper


import json
import os
from typing import Dict, List
from app.util import cached_function
        self.github: str = ''
        self.rubygems: str = ''
        self.pypi: str = ''
        self.npm: str = ''
        self.web: str = ''

    @staticmethod
    def load(key: str, data: Dict[str, str]) -> 'Project':
        project = Project()
        project.name = key
        project.description = data.get('description', '')
        project.github = data.get('github', '')
        project.rubygems = data.get('rubygems', '')
        project.pypi = data.get('pypi', '')
        project.npm = data.get('npm', '')
        project.web = data.get('web', '')
        return project

    def links(self) -> Dict[str, str]:
        links: Dict[str, str] = {
            'github': self.github,
            'rubygems': self.rubygems,
            'pypi': self.pypi,
            'npm': self.npm,
            'web': self.web,
        }
        links = dict([(k, v) for k, v in links.items() if v])
        return links



# Path: app/util.py
# def cached_function(func: Callable[..., Any]) -> Callable[..., Any]:
#     data = {}
# 
#     def wrapper(*args: Any) -> Any:
#         if not SHOULD_CACHE:
#             return func(*args)
#         cache_key = ' '.join([str(x) for x in args])
#         if cache_key not in data:
#             data[cache_key] = func(*args)
#         return data[cache_key]
# 
#     wrapper.__qualname__ = func.__qualname__
#     wrapper.__signature__ = inspect.signature(func)  # type: ignore
#     return wrapper


# Path: app/data.py
import json
import os
from typing import Dict, List
from app.util import cached_function

        self.github: str = ''
        self.rubygems: str = ''
        self.pypi: str = ''
        self.npm: str = ''
        self.web: str = ''

    @staticmethod
    def load(key: str, data: Dict[str, str]) -> 'Project':
        project = Project()
        project.name = key
        project.description = data.get('description', '')
        project.github = data.get('github', '')
        project.rubygems = data.get('rubygems', '')
        project.pypi = data.get('pypi', '')
        project.npm = data.get('npm', '')
        project.web = data.get('web', '')
        return project

    def links(self) -> Dict[str, str]:
        links: Dict[str, str] = {
            'github': self.github,
            'rubygems': self.rubygems,
            'pypi': self.pypi,
            'npm': self.npm,
            'web': self.web,
        }
        links = dict([(k, v) for k, v in links.items() if v])
        return links



@cached_function