def get_oembed_response(oembed_url, max_width=None, max_height=None):

    response = requests.get(__format_url(oembed_url, max_width, max_height))

    if not response.ok:
        raise PyEmbedConsumerError('Failed to get %s (status code %s)' % (
            oembed_url, response.status_code))

    content_type = response.headers['content-type'].split(';')[0]
    return parse.parse_oembed(response.text, content_type)
Delete the created network when subnet creation failed
dataset/ETHPy150Open pyembed/pyembed/pyembed/core/consumer.py/get_oembed_response--crossover with--dataset/ETHPy150Open Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/networks/workflows.py/CreateNetwork._delete_network