def METHOD_NAME(directory):
    """
    >>> get_context_from_dirpath('common')
    {}
    >>> get_context_from_dirpath('i386')
    {'arch': 'i386'}
    >>> get_context_from_dirpath('amd64/linux') == {'arch': 'amd64', 'os': 'linux'}
    True
    """
    parts = directory.split(os.path.sep)
    arch = osys = None
    if len(parts) > 0:
        arch = parts[0]
    if len(parts) > 1:
        osys = parts[1]
    if osys == 'common':
        osys = None
    if arch == 'common':
        arch = None
    return {'os': osys, 'arch': arch}