def _update_resource(self, resource):
        """
        If the meta data for the resource contains a depends attribute,
        this plugin adds an entry to the depends property of the
        resource.

        The dependency can contain the following template variables:
        node, resource, site, context.

        The following strings are valid:
        '{node.module}/dependencies/{resource.source.name_without_extension}.inc'
        '{context.dependency_folder}/{resource.source.name_without_extension}.{site.meta.depext}'
        """
        depends = []
        try:
            depends = resource.meta.depends
        except __HOLE__:
            return

        if not hasattr(resource, 'depends') or not resource.depends:
            resource.depends = []

        if isinstance(depends, basestring):
            depends = [depends]

        for dep in depends:
            resource.depends.append(dep.format(node=resource.node,
                                               resource=resource,
                                               site=self.site,
                                               context=self.site.context))
        resource.depends = list(set(resource.depends))
dataset/ETHPy150Open hyde/hyde/hyde/ext/plugins/depends.py/DependsPlugin._update_resource