Modules under migration in the public binding test (#81314)
If a module is being migrated, a common practice is to temporarily support
the old location. That might break the assertion that the `__module__`
of a function is pointing to the same location as where it is created.
## Example
1. Assume there is `torch/nn/quantized/functional.py`
2. The file is copied to `torch/ao/nn/quantzied/functional.py`
3. The old location is changed to have `from torch.ao.nn.quantized.functional import *`
In such a situation, importing from the old location will have `__module__`
pointing to the new `torch/ao/nn/...` location. This will break the
current test.
## What changed
This PR adds the following:
1. Added a key `"being_migrated"` to the `allowlist_for_publicAPI.json`
2. Added a check in the `test_public_bindings.py` to check if the JSON file has the `"being_migrated"` key.
## How to add migration entries
1. Add an entry to the `"being_migrated"`
For the example above, add `"torch.nn.quantized.functional": "torch.ao.nn.quantized.functional"`
2. Change any existing keys for the old location
For example, if there is an existing entry `"torch.nn.quantized.functional": [...]`
outside the `"being_migrated"`.
Change it to `"torch.ao.nn.quantized.functional": [...]`
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81314
Approved by: https://github.com/anjali411