<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filtered_list(cls, name=None, obj=None):
 """List datacenters matching name and compatible with obj"""

        options = {}
        if name:
            options['id'] = cls.usable_id(name)

        def obj_ok(dc, obj):
            if not obj or obj['datacenter_id'] == dc['id']:
                return True
            return False

        return [x for x in cls.list(options) if obj_ok(x, obj)]