<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def data_py(o, *args, **kwargs):
 """converts python object into R Dataframe definition converts following data structures: row oriented list of dictionaries: col oriented dictionary of lists @param o python object to convert @param args argument list to pass to read.csv @param kwargs keyword args to pass to read.csv @return a tuple of the file containing the data and an expression to define data.frame object and set it to variable "data" data = read.csv(tmpfile, *args, **kwargs) """

    if isinstance(o, basestring):
        fname = o
    else:
        if not is_pandas_df(o):
            # convert incoming data layout to pandas' DataFrame
            o = pandas.DataFrame(o)
        fname = tempfile.NamedTemporaryFile().name
        o.to_csv(fname, sep=',', encoding='utf-8', index=False)
    kwargs["sep"] = esc(',')
    read_csv_stmt = GGStatement("read.csv", esc(fname), *args, **kwargs).r
    return GGData("data = {}".format(read_csv_stmt), fname=fname)