<commit_before>// @flow

import styles from './Administrate.css';
import { Component } from 'react';
import { Link } from 'react-router-dom';
import Tooltip from 'app/components/Tooltip';
import Time from 'app/components/Time';
import cx from 'classnames';
import { WEBKOM_GROUP_ID } from 'app/utils/constants';
import type {
  EventRegistration,
  EventRegistrationPresence,
  EventRegistrationPaymentStatus,
  ID,
  Event,
  EventPool,
  PhotoConsent,
  EventSemester,
} from 'app/models';
import Table from 'app/components/Table';
import {
  StripeStatus,
  TooltipIcon,
  PresenceIcons,
  Unregister,
} from './AttendeeElements';
import {
  getEventSemesterFromStartTime,
  hasRegisteredConsent,
  getConsent,
  PHOTO_CONSENT_DOMAINS,
} from 'app/routes/events/utils';

type Props = {
  registered: Array<EventRegistration>,
  loading: boolean,
  handlePresence: (
    registrationId: ID,
    presence: EventRegistrationPresence
  ) => Promise<*>,
  handlePayment: (
    registrationId: ID,
    paymentStatus: EventRegistrationPaymentStatus
  ) => Promise<*>,
  handleUnregister: (registrationId: ID) => void,
  clickedUnregister: ID,
  showUnregister: boolean,
  event: Event,
  pools: Array<EventPool>,
};
const GradeRenderer = (group: { name: string }) =>
  !!group && (
    <Tooltip content={group.name}>
      <span>
        {group.name
          .replace('Kommunikasjonsteknologi', 'Komtek')
          .replace('Datateknologi', 'Data')}
      </span>
    </Tooltip>
  );

const hasWebkomGroup = (user) => user.abakusGroups.includes(WEBKOM_GROUP_ID);

const getPoolName = (pools, poolId) => {
  const pool = pools.find((pool) => pool.id === poolId);
  return pool && pool.name;
};
<commit_msg>Add safeguard to disable reading of assumed existing key<commit_after>// @flow

import styles from './Administrate.css';
import { Component } from 'react';
import { Link } from 'react-router-dom';
import Tooltip from 'app/components/Tooltip';
import Time from 'app/components/Time';
import cx from 'classnames';
import { WEBKOM_GROUP_ID } from 'app/utils/constants';
import type {
  EventRegistration,
  EventRegistrationPresence,
  EventRegistrationPaymentStatus,
  ID,
  Event,
  EventPool,
  PhotoConsent,
  EventSemester,
} from 'app/models';
import Table from 'app/components/Table';
import {
  StripeStatus,
  TooltipIcon,
  PresenceIcons,
  Unregister,
} from './AttendeeElements';
import {
  getEventSemesterFromStartTime,
  hasRegisteredConsent,
  getConsent,
  PHOTO_CONSENT_DOMAINS,
} from 'app/routes/events/utils';

type Props = {
  registered: Array<EventRegistration>,
  loading: boolean,
  handlePresence: (
    registrationId: ID,
    presence: EventRegistrationPresence
  ) => Promise<*>,
  handlePayment: (
    registrationId: ID,
    paymentStatus: EventRegistrationPaymentStatus
  ) => Promise<*>,
  handleUnregister: (registrationId: ID) => void,
  clickedUnregister: ID,
  showUnregister: boolean,
  event: Event,
  pools: Array<EventPool>,
};
const GradeRenderer = (group: { name: string }) =>
  !!group && (
    <Tooltip content={group.name}>
      <span>
        {group.name
          .replace('Kommunikasjonsteknologi', 'Komtek')
          .replace('Datateknologi', 'Data')}
      </span>
    </Tooltip>
  );

const hasWebkomGroup = (user) => user.abakusGroups?.includes(WEBKOM_GROUP_ID);

const getPoolName = (pools, poolId) => {
  const pool = pools.find((pool) => pool.id === poolId);
  return pool && pool.name;
};

{'fraction_non_alphanumeric': 0.1290603248259861, 'fraction_numerical': 0.0, 'mean_word_length': 4.265648854961832, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 33, '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': '6648065', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1118, 'n_words': 252}