input: Write a function to load a JSON fixture file and extract properties from it to create and save Property objects to a database. The function should return the number of objects saved. If the JSON file does not contain a "properties" key or no properties are present, it should return 0. Provide the function with command-line arguments to specify the fixture file and folder.
  
  def load_properties_from_json():
      def get_path():
          return os.path.abspath('.')
  
      def parse_args():
          _parser = argparse.ArgumentParser()
          _parser.add_argument('--fixture', type=str, help='fixture file to load', default='properties.json')
          _parser.add_argument('--fixture_folder', type=str,
                               default='models/fixtures',
                               help='where fixtures are stored.'
                               )
          return _parser.parse_args()
  
      def main(base_path):
          properties_to_save = []
          args = parse_args()
          path = os.path.sep.join([base_path, 'app', args.fixture_folder, args.fixture])
          with open(path) as file_:
              data = json.load(file_)
          properties = data.get('properties', [])
          for property_ in properties:
              property_.pop('id', None)
              properties_to_save.append(Property(**property_))
          Property.objects.insert(properties_to_save)
          return len(properties_to_save)
  
      if __name__ == '__main__':
          from app.models.properties import Property
          base_path = get_path()
          out = main(base_path)
          print("{} objects saved".format(out))
  
  assert load_properties_from_json(fixture='valid_properties.json', fixture_folder='correct_folder') == 3
  assert load_properties_from_json(fixture='no_properties.json', fixture_folder='correct_folder') == 0
  assert load_properties_from_json(fixture='invalid_properties.json', fixture_folder='correct_folder') == 0
  assert load_properties_from_json(fixture='empty_properties.json', fixture_folder='correct_folder') == 0
output: 
  def load_properties_from_json(fixture='properties.json', fixture_folder='models/fixtures'):
      import os
      import json
      from app.models.properties import Property
      
      base_path = os.path.abspath('.')
      path = os.path.sep.join([base_path, 'app', fixture_folder, fixture])
      
      with open(path) as file_:
          data = json.load(file_)
      
      properties = data.get('properties', [])
      properties_to_save = []
      
      for property_ in properties:
          property_.pop('id', None)
          properties_to_save.append(Property(**property_))
      
      Property.objects.insert(properties_to_save)
      return len(properties_to_save)
  