Minor refactor prepare_module
MEMBER
@lhoestq this is the PR that I mentioned to you, which can be considered as a first step in refactoring `prepare_module`.
2021-07-16T06:20:45Z
https://github.com/huggingface/datasets/pull/2314#issuecomment-881207475
https://api.github.com/repos/huggingface/datasets/issues/2314
IC_kwDODunzps40hiiz
https://api.github.com/repos/huggingface/datasets/issues/comments/881207475/reactions
2021-07-16T06:20:45Z
https://api.github.com/repos/huggingface/datasets/issues/comments/881207475
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
MEMBER
closing in favor of #2986 
2021-10-13T09:07:33Z
https://github.com/huggingface/datasets/pull/2314#issuecomment-942090825
https://api.github.com/repos/huggingface/datasets/issues/2314
IC_kwDODunzps44JypJ
https://api.github.com/repos/huggingface/datasets/issues/comments/942090825/reactions
2021-10-13T09:07:33Z
https://api.github.com/repos/huggingface/datasets/issues/comments/942090825
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
Start to refactor `prepare_module` to try to decouple functionality.

This PR does:
- extract function `_initialize_dynamic_modules_namespace_package`
- extract function `_find_module_in_github_or_s3`
- some renaming of variables
- use of f-strings