code: def _get_location(cli_ctx, namespace):
      
      location = None
      if getattr(namespace, 'location', None):
          location = namespace.location
      elif getattr(namespace, 'resource_group_name', None):
          location = _get_location_from_resource_group(cli_ctx, namespace.resource_group_name)
      if not location:
          location = get_one_of_subscription_locations(cli_ctx)
      return location
docs: Return an Azure location by using an explicit `--location` argument, then by `--resource-group`, and
      finally by the subscription if neither argument was provided.