<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_data(method, args):
 """Assign arguments to body or URL of an HTTP request. Parameters method (str) HTTP Method. (e.g. 'POST') args (dict) Dictionary of data to attach to each Request. e.g. {'latitude': 37.561, 'longitude': -122.742} Returns (str or dict) Either params containing the dictionary of arguments or data containing arugments in JSON-formatted string. """

    data = {}
    params = {}

    if method in http.BODY_METHODS:
        data = dumps(args)
    else:
        params = args
    return data, params