<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def getstate(d):
    '''Deep copies a dict, and returns it without the keys _links and
    _embedded
    '''
    if not isinstance(d, dict):
        raise TypeError("Can only get the state of a dictionary")
    cpd = copy.deepcopy(d)
    cpd.pop('_links', None)
    cpd.pop('_embedded', None)
    return cpd