<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _GetVisitSource(self, visit_identifier, cache, database):
 """Retrieves a visit source type based on the identifier. Args: visit_identifier (str):
 identifier from the visits table for the particular record. cache (SQLiteCache):
 cache which contains cached results from querying the visit_source table. database (SQLiteDatabase):
 database. Returns: int: visit source type or None if no visit source type was found for the identifier. """

    sync_cache_results = cache.GetResults('sync')
    if not sync_cache_results:
      result_set = database.Query(self._SYNC_CACHE_QUERY)

      cache.CacheQueryResults(result_set, 'sync', 'id', ('source',))
      sync_cache_results = cache.GetResults('sync')

    if sync_cache_results and visit_identifier:
      results = sync_cache_results.get(visit_identifier, None)
      if results:
        return results[0]

    return None