'Given a set of keys, extracts the key and range key'

def get_table_keys_name(self, table_name, keys):

    table = self.tables.get(table_name)
    if (not table):
        return (None, None)
    else:
        if (len(keys) == 1):
            for key in keys:
                if (key in table.hash_key_names):
                    return (key, None)
        (potential_hash, potential_range) = (None, None)
        for key in set(keys):
            if (key in table.hash_key_names):
                potential_hash = key
            elif (key in table.range_key_names):
                potential_range = key
        return (potential_hash, potential_range)
