in src/sagemaker_training/_entry_point_type.py [0:0]
def get(path, name): # type: (str, str) -> _EntryPointType
"""
Args:
path (string): Directory where the entry point is located.
name (string): Name of the entry point file.
Returns:
(_EntryPointType): The type of the entry point.
"""
if name.endswith(".sh"):
return _EntryPointType.COMMAND
elif "setup.py" in os.listdir(path):
return _EntryPointType.PYTHON_PACKAGE
elif name.endswith(".py"):
return _EntryPointType.PYTHON_PROGRAM
else:
return _EntryPointType.COMMAND