code: def build_catalog(**kwargs):
          
          catalog_type = kwargs.get('catalog_type')
          catalog_file = kwargs.get('catalog_file')
          catalog_extdir = kwargs.get('catalog_extdir')
          if catalog_type == '2FHL':
              return catalog.Catalog2FHL(fitsfile=catalog_file, extdir=catalog_extdir)
          elif catalog_type == '3FGL':
              return catalog.Catalog3FGL(fitsfile=catalog_file, extdir=catalog_extdir)
          elif catalog_type == '4FGLP':
              return catalog.Catalog4FGLP(fitsfile=catalog_file, extdir=catalog_extdir)
          elif catalog_type == 'FL8Y':
              return catalog.CatalogFL8Y(fitsfile=catalog_file, extdir=catalog_extdir)
          else:
              table = Table.read(catalog_file)
          return catalog.Catalog(table, extdir=catalog_extdir)
docs: Build a `fermipy.catalog.Catalog` object
  
          Parameters
          ----------
  
          catalog_type : str
              Specifies catalog type, options include 2FHL | 3FGL | 4FGLP
          catalog_file : str
              FITS file with catalog tables
          catalog_extdir : str
              Path to directory with extended source templates