code: def convert_geojson_to_shapefile(geojson_path):
      
      layer = QgsVectorLayer(geojson_path, 'vector layer', 'ogr')
      if not layer.isValid():
          return False
      # Construct shapefile path
      shapefile_path = os.path.splitext(geojson_path)[0] + '.shp'
      QgsVectorFileWriter.writeAsVectorFormat(
          layer,
          shapefile_path,
          'utf-8',
          layer.crs(),
          'ESRI Shapefile')
      if os.path.exists(shapefile_path):
          return True
      return False
docs: Convert geojson file to shapefile.
  
      It will create a necessary file next to the geojson file. It will not
      affect another files (e.g. .xml, .qml, etc).
  
      :param geojson_path: The path to geojson file.
      :type geojson_path: basestring
  
      :returns: True if shapefile layer created, False otherwise.
      :rtype: bool