def mock_requests_get(*args, **kwargs):
 response_transcript_list = '\n    <transcript_list>\n        <track id="1" name="Custom" lang_code="en" />\n        <track id="0" name="Custom1" lang_code="en-GB"/>\n    </transcript_list>\n    '
 response_transcript = textwrap.dedent('\n    <transcript>\n        <text start="100" dur="100">subs #1</text>\n        <text start="200" dur="40">subs #2</text>\n        <text start="240" dur="140">subs #3</text>\n    </transcript>\n    ')
 if (kwargs == {'params': {'lang': 'en', 'v': 'good_id_2'}}):
  return Mock(status_code=200, text='')
 elif (kwargs == {'params': {'type': 'list', 'v': 'good_id_2'}}):
  return Mock(status_code=200, text=response_transcript_list, content=response_transcript_list)
 elif (kwargs == {'params': {'lang': 'en', 'v': 'good_id_2', 'name': 'Custom'}}):
  return Mock(status_code=200, text=response_transcript, content=response_transcript)
 return Mock(status_code=404, text='')

def mock_requests_get ( * args , ** kwargs ) : response_transcript_list = '\n    <transcript_list>\n        <track id="1" name="Custom" lang_code="en" />\n        <track id="0" name="Custom1" lang_code="en-GB"/>\n    </transcript_list>\n    ' response_transcript = textwrap . dedent ( '\n    <transcript>\n        <text start="100" dur="100">subs #1</text>\n        <text start="200" dur="40">subs #2</text>\n        <text start="240" dur="140">subs #3</text>\n    </transcript>\n    ' ) if ( kwargs == { 'params' : { 'lang' : 'en' , 'v' : 'good_id_2' } } ) : return Mock ( status_code = 200 , text = '' ) elif ( kwargs == { 'params' : { 'type' : 'list' , 'v' : 'good_id_2' } } ) : return Mock ( status_code = 200 , text = response_transcript_list , content = response_transcript_list ) elif ( kwargs == { 'params' : { 'lang' : 'en' , 'v' : 'good_id_2' , 'name' : 'Custom' } } ) : return Mock ( status_code = 200 , text = response_transcript , content = response_transcript ) return Mock ( status_code = 404 , text = '' )
returns mock responses for the youtube api .