def update_model(self, url, text):
min_hash = get_min_hash(text, self.too_common_shingles, self.num_perm)<EOL>item_url = canonicalize_url(url)<EOL>item_path, item_query = _parse_url(item_url)<EOL>all_duplicates = [<EOL>(url, self.seen_urls[url]) for url in self.lsh.query(min_hash)]<EOL>duplicates = [(url, m.query) for url, m in all_duplicates<EOL>if m.path == item_path]<EOL>n_path_nodup = self._nodup_filter(min_hash, (<EOL>self.urls_by_path.get(item_path, set())<EOL>.difference(url for url, _ in duplicates)))<EOL>self.path_dupstats[item_path].update(len(duplicates), n_path_nodup)<EOL>for param, value in item_query.items():<EOL><INDENT>self._update_with_param(<EOL>duplicates, min_hash, item_path, item_query, param, [value])<EOL><DEDENT>for param in (<EOL>self.params_by_path.get(item_path, set()) - set(item_query)):<EOL><INDENT>self._update_with_param(<EOL>duplicates, min_hash, item_path, item_query, param,<EOL>self.param_values.get((item_path, param), set()))<EOL><DEDENT>for param, value in item_query.items():<EOL><INDENT>self.urls_by_path_q[item_path, _q_key(item_query)].add(item_url)<EOL>item_qwp_key = _q_key(_without_key(item_query, param))<EOL>self.urls_by_path_qwp[item_path, param, item_qwp_key].add(item_url)<EOL>self.params_by_path[item_path].add(param)<EOL>self.param_values[item_path, param].add(value)<EOL><DEDENT>if not item_query:<EOL><INDENT>self.urls_by_path_q[item_path, ()].add(item_url)<EOL><DEDENT>self.urls_by_path[item_path].add(item_url)<EOL>if item_url in self.lsh:<EOL><INDENT>self.lsh.remove(item_url)<EOL><DEDENT>self.lsh.insert(item_url, min_hash)<EOL>self.seen_urls[item_url] = URLMeta(item_path, item_query, min_hash)<EOL>if len(self.seen_urls) % <NUM_LIT:100> == <NUM_LIT:0>:<EOL><INDENT>self.log_dupstats()<EOL><DEDENT>return all_duplicates<EOL>
Update prediction model with a page by given url and text content.
        Return a list of item duplicates (for testing purposes).