<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_common_fields(self, data):
 """Extract fields from a metadata query."""

        return dict(
            dc=data.get('dc'),
            role=data.get('role'),
            account_name=data.get('accountname'),
            user_id=data.get('user_id'),
            login=data.get('login'),
            login_url=data.get('login_url'),
            api_endpoint=data.get('api_endpoint'),
        )