2222
2323
2424def git_clone_repo (git_config , entry_point , source_dir = None , dependencies = None ):
25- """Git clone repo containing the training code and serving code. This method
26- also validate ``git_config``, and set ``entry_point``, ``source_dir`` and
27- ``dependencies`` to the right file or directory in the repo cloned.
25+ """Git clone repo containing the training code and serving code.
26+
27+ This method also validate ``git_config``, and set ``entry_point``,
28+ ``source_dir`` and ``dependencies`` to the right file or directory in the
29+ repo cloned.
2830
2931 Args:
3032 git_config (dict[str, str]): Git configurations used for cloning files,
@@ -118,9 +120,13 @@ def git_clone_repo(git_config, entry_point, source_dir=None, dependencies=None):
118120
119121
120122def _validate_git_config (git_config ):
121- """
123+ """Validates the git configuration.
124+
125+ Checks all configuration values except 2FA_enabled are string types. The
126+ 2FA_enabled configuration should be a boolean.
127+
122128 Args:
123- git_config:
129+ git_config: The configuration to validate.
124130 """
125131 if "repo" not in git_config :
126132 raise ValueError ("Please provide a repo for git_config." )
@@ -133,8 +139,9 @@ def _validate_git_config(git_config):
133139
134140
135141def _generate_and_run_clone_command (git_config , dest_dir ):
136- """check if a git_config param is valid, if it is, create the command to git
137- clone the repo, and run it.
142+ """Check if a git_config param is valid.
143+
144+ If it is valid, create the command to git, clone the repo, and run it.
138145
139146 Args:
140147 git_config ((dict[str, str]): Git configurations used for cloning files,
@@ -153,8 +160,9 @@ def _generate_and_run_clone_command(git_config, dest_dir):
153160
154161
155162def _clone_command_for_github_like (git_config , dest_dir ):
156- """check if a git_config param representing a GitHub (or like) repo is
157- valid, if it is, create the command to git clone the repo, and run it.
163+ """Check if a git_config param representing a GitHub (or like) repo is valid.
164+
165+ If it is valid, create the command to git clone the repo, and run it.
158166
159167 Args:
160168 git_config ((dict[str, str]): Git configurations used for cloning files,
@@ -223,8 +231,9 @@ def _clone_command_for_github_like_https_2fa_enabled(git_config, dest_dir):
223231
224232
225233def _clone_command_for_codecommit (git_config , dest_dir ):
226- """check if a git_config param representing a CodeCommit repo is valid, if
227- it is, create the command to git clone the repo, and run it.
234+ """Check if a git_config param representing a CodeCommit repo is valid.
235+
236+ If it is, create the command to git clone the repo, and run it.
228237
229238 Args:
230239 git_config ((dict[str, str]): Git configurations used for cloning files,
@@ -250,10 +259,11 @@ def _clone_command_for_codecommit(git_config, dest_dir):
250259
251260
252261def _clone_command_for_codecommit_https (git_config , dest_dir ):
253- """
262+ """Invoke the clone command for codecommit.
263+
254264 Args:
255- git_config:
256- dest_dir:
265+ git_config: The git configuration.
266+ dest_dir: The destination directory for the clone.
257267 """
258268 updated_url = git_config ["repo" ]
259269 if "username" in git_config and "password" in git_config :
0 commit comments