code: def get_model_label(model):
      
      if isinstance(model, six.string_types):
          return model
      else:
          return "%s.%s" % (
              model._meta.app_label,
              model.__name__
          )
docs: Take a model class or model label and return its model label.
  
      >>> get_model_label(MyModel)
      "myapp.MyModel"
  
      >>> get_model_label("myapp.MyModel")
      "myapp.MyModel"