#NEWLINE# def _get_datasource( profile , name ) : #NEWLINE# #INDENT# response = requests . get ( '{0}/api/datasources' . format ( profile [ 'grafana_url' ] ) , headers = _get_headers ( profile ) , timeout = profile . get ( 'grafana_timeout' , 3 ) ) #NEWLINE# data = response . json ( ) #NEWLINE# for datasource in data : #NEWLINE# #INDENT# if ( datasource [ 'name' ] == name ) : #NEWLINE# #INDENT# return datasource #NEWLINE# #UNINDENT# #UNINDENT# return None