import six
import json


def load_config(config):
    """Load configuration.
    """
    if isinstance(config, six.string_types):
        with open(config, "r") as f:
            return json.load(f)
    elif isinstance(config, dict):
        return config
    else:
        raise NotImplementedError("Config must be a json file or a dict")