<commit_before>import { Observable } from 'rxjs';
import { WorkItemUI } from '../models/work-item';
import { FilterService } from '../services/filter.service';
import { WorkItemService } from '../services/work-item.service';

export function workitemMatchesFilter(route,
  filterService: FilterService,
  workItemService: WorkItemService,
  workitem: WorkItemUI,
  spaceId: string): Observable<WorkItemUI> {
    const currentRoute = route.queryParams;
    if (currentRoute['q']
        && currentRoute.hasOwnProperty('q')
        && currentRoute['q'].includes('boardContextId')
      ) {
        return Observable.of(workitem);
    }
    if (Object.keys(currentRoute).length === 0 && currentRoute.constructor === Object) {
      return Observable.of(workitem);
    } else {
      const wiQuery = filterService.queryBuilder(
        'number', filterService.equal_notation, workitem.number.toString()
      );
      const exp = filterService.queryJoiner(
        filterService.queryToJson(currentRoute['q']),
        filterService.and_notation,
        wiQuery
      );
      const spaceQuery = filterService.queryBuilder(
        'space', filterService.equal_notation, spaceId
      );
      const finalQuery = filterService.queryJoiner(
        exp, filterService.and_notation, spaceQuery
      );
      const searchPayload = {
        expression: finalQuery
      };
      return workItemService.getWorkItems2(1, searchPayload)
        .map(data => data.totalCount)
        .map(count => {<commit_msg>fix(workItemUtil): add a condition for query page in workItem util<commit_after>import { Observable } from 'rxjs';
import { WorkItemUI } from '../models/work-item';
import { FilterService } from '../services/filter.service';
import { WorkItemService } from '../services/work-item.service';

export function workitemMatchesFilter(route,
  filterService: FilterService,
  workItemService: WorkItemService,
  workitem: WorkItemUI,
  spaceId: string): Observable<WorkItemUI> {
    const currentRoute = route.queryParams;
    if ((currentRoute['q']
        && currentRoute.hasOwnProperty('q')
        && currentRoute['q'].includes('boardContextId')) ||
        (document.location.pathname.indexOf('/query') > -1)
      ) {
        return Observable.of(workitem);
    }
    if (Object.keys(currentRoute).length === 0 && currentRoute.constructor === Object) {
      return Observable.of(workitem);
    } else {
      const wiQuery = filterService.queryBuilder(
        'number', filterService.equal_notation, workitem.number.toString()
      );
      const exp = filterService.queryJoiner(
        filterService.queryToJson(currentRoute['q']),
        filterService.and_notation,
        wiQuery
      );
      const spaceQuery = filterService.queryBuilder(
        'space', filterService.equal_notation, spaceId
      );
      const finalQuery = filterService.queryJoiner(
        exp, filterService.and_notation, spaceQuery
      );
      const searchPayload = {
        expression: finalQuery
      };
      return workItemService.getWorkItems2(1, searchPayload)
        .map(data => data.totalCount)
        .map(count => {
{'fraction_non_alphanumeric': 0.11819346572709802, 'fraction_numerical': 0.002242152466367713, 'mean_word_length': 3.237449118046133, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5982413', 'n_tokens_mistral': 849, 'n_tokens_neox': 844, 'n_words': 169}