app/request.py
def map_sources_results(sources_results):
  '''
  map_results function to create sources objects
  
  Args:
      A list of sources response

  Returns:
        A list of sources objects
  '''

  sources_list=[]
  for source in sources_results:
    id=source.get('id')
    name=source.get('name')
    description=source.get('description')
    url=source.get('url')
    category=source.get('category')
    country=source.get('country')
    print(name)
    new_source=Source(id,name,description,url,category,country)
    sources_list.append(new_source)

  return sources_list

  map_results function to create sources objects
  
  Args:
      A list of sources response

  Returns:
        A list of sources objects
  
map_results function to create sources objects
Args:
A list of sources response

A list of sources objects
map_results function to create sources objects Args : A list of sources response A list of sources objects
def map_sources_results(sources_results):
  sources_list=[]
  for source in sources_results:
    id=source.get('id')
    name=source.get('name')
    description=source.get('description')
    url=source.get('url')
    category=source.get('category')
    country=source.get('country')
    print(name)
    new_source=Source(id,name,description,url,category,country)
    sources_list.append(new_source)
  return sources_list
def map_sources_results ( sources_results ) : sources_list = [ ] for source in sources_results : id = source . get ( 'id' ) name = source . get ( 'name' ) description = source . get ( 'description' ) url = source . get ( 'url' ) category = source . get ( 'category' ) country = source . get ( 'country' ) print ( name ) new_source = Source ( id , name , description , url , category , country ) sources_list . append ( new_source ) return sources_list
map_results function to create sources objects
Args:
A list of sources response
map_results function to create sources objects Args : A list of sources response
'''
  map_results function to create sources objects
  
  Args:
      A list of sources response

  Returns:
        A list of sources objects
  '''
sources_results