<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def depends_statement(cookbook_name, metadata=None):
 """Return a valid Ruby 'depends' statement for the metadata.rb file."""

        line = "depends '%s'" % cookbook_name
        if metadata:
            if not isinstance(metadata, dict):
                raise TypeError("Stencil dependency options for %s "
                                "should be a dict of options, not %s."
                                % (cookbook_name, metadata))
            if metadata:
                line = "%s '%s'" % (line, "', '".join(metadata))
        return line