def METHOD_NAME(profile, name):
    response = requests.get(
        "{}/api/datasources".format(profile["grafana_url"]),
        headers=_get_headers(profile),
        timeout=profile.get("grafana_timeout", 3),
    )
    data = response.json()
    for datasource in data:
        if datasource["name"] == name:
            return datasource
    return None