@staticmethod
    def is_valid_body(body, entity_name):
        if not (body and entity_name in body):
            return False

        def is_dict(d):
            try:
                d.get(None)
                return True
            except __HOLE__:
                return False

        if not is_dict(body[entity_name]):
            return False

        return True
dataset/ETHPy150Open openstack/rack/rack/api/wsgi.py/Controller.is_valid_body