'Declare all entries from the utility code in dest_scope. Code will only
be included for used entries. If module_name is given, declare the
type entries with that name.'

def declare_in_scope(self, dest_scope, used=False, cython_scope=None, whitelist=None):

    tree = self.get_tree(entries_only=True, cython_scope=cython_scope)
    entries = tree.scope.entries
    entries.pop('__name__')
    entries.pop('__file__')
    entries.pop('__builtins__')
    entries.pop('__doc__')
    for entry in entries.values():
        entry.utility_code_definition = self
        entry.used = used
    original_scope = tree.scope
    dest_scope.merge_in(original_scope, merge_unused=True, whitelist=whitelist)
    tree.scope = dest_scope
    for dep in self.requires:
        if dep.is_cython_utility:
            dep.declare_in_scope(dest_scope)
    return original_scope
