<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def FromArchive(cls, path, actions_dict, resources_dict, temp_dir=None):
 """Create a RecipeObject from a .ship archive. This archive should have been generated from a previous call to iotile-ship -a <path to yaml file> or via iotile-build using autobuild_shiparchive(). Args: path (str):
 The path to the recipe file that we wish to load actions_dict (dict):
 A dictionary of named RecipeActionObject types that is used to look up all of the steps listed in the recipe file. resources_dict (dict):
 A dictionary of named RecipeResource types that is used to look up all of the shared resources listed in the recipe file. file_format (str):
 The file format of the recipe file. Currently we only support yaml. temp_dir (str):
 An optional temporary directory where this archive should be unpacked. Otherwise a system wide temporary directory is used. """


        if not path.endswith(".ship"):
            raise ArgumentError("Attempted to unpack a recipe archive from a file that did not end in .ship", path=path)

        name = os.path.basename(path)[:-5]

        if temp_dir is None:
            temp_dir = tempfile.mkdtemp()

        extract_path = os.path.join(temp_dir, name)
        archive = zipfile.ZipFile(path, "r")
        archive.extractall(extract_path)

        recipe_yaml = os.path.join(extract_path, 'recipe_script.yaml')
        return cls.FromFile(recipe_yaml, actions_dict, resources_dict, name=name)