<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I have a DataFrame that looks like this:
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame({'username': ['john', 'john', 'john', 'john', 'jane', 'jane', 'jane', 'jane'],
                   'post_id': [1, 2, 3, 4, 7, 8, 9, 10],
                   'views': [3, 23, 44, 82, 5, 25,46, 56]})
bins = [1, 10, 25, 50, 100]
def g(df, bins):
    groups = df.groupby(['username', pd.cut(df.views, bins)])
    return groups.size().unstack()
result = g(df.copy(),bins.copy())
<END_TASK>