def _date_year(release):
 try:
  date = release['ReleaseDate']
 except TypeError:
  date = ''
 if (date is not None):
  year = date[:4]
 else:
  year = ''
 return (date, year)

def _date_year ( release ) : try : date = release [ 'ReleaseDate' ] except TypeError : date = '' if ( date is not None ) : year = date [ : 4 ] else : year = '' return ( date , year )
extract release date and year from database row .