<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_stack_policy_args(stack_policy=None):
 """ Converts a stack policy object into keyword args. Args: stack_policy (:class:`stacker.providers.base.Template`):
 A template object representing a stack policy. Returns: dict: A dictionary of keyword arguments to be used elsewhere. """


    args = {}
    if stack_policy:
        logger.debug("Stack has a stack policy")
        if stack_policy.url:
            # stacker currently does not support uploading stack policies to
            # S3, so this will never get hit (unless your implementing S3
            # uploads, and then you're probably reading this comment about why
            # the exception below was raised :))
            #
            # args["StackPolicyURL"] = stack_policy.url
            raise NotImplementedError
        else:
            args["StackPolicyBody"] = stack_policy.body
    return args