<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:
How do I apply sort to a pandas groupby operation? The command below returns an error saying that 'bool' object is not callable
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
df = pd.DataFrame({'cokey':[11168155,11168155,11168155,11168156,11168156],
                   'A':[18,0,56,96,0],
                   'B':[56,18,96,152,96]})
def g(df):
    return df.groupby('cokey').apply(pd.DataFrame.sort_values, 'A', ascending=False)
result = g(df.copy())
<END_TASK>