<commit_before>// @flow

import { Enum } from 'enumify';

function enumFactory(friendlyName) {
  return {
    get friendlyName() {
      return friendlyName;
    },
    hasPermission(permission: Permission) {
      return this.ordinal >= permission.ordinal;
    }
  };
}

export class Permission extends Enum {}
Permission.initEnum({
  'HIDDEN': enumFactory("Hidden"),
  'DISCOVER': enumFactory("Discover"),
  'READ': enumFactory("Read"),
  'WRITE': enumFactory("Write"),
  'OWNER': enumFactory("Owner")
});

export function maxPermission(permissions: Permission) {
  let highestPerm = Permission.HIDDEN;

  for (let permission of permissions) {
    if (permission.ordinal > highestPerm.ordinal) {
      highestPerm = permission;
    }
  }
}<commit_msg>Added return to maxPermission<commit_after>// @flow

import { Enum } from 'enumify';

function enumFactory(friendlyName) {
  return {
    get friendlyName() {
      return friendlyName;
    },
    hasPermission(permission: Permission) {
      return this.ordinal >= permission.ordinal;
    }
  };
}

export class Permission extends Enum {}
Permission.initEnum({
  'HIDDEN': enumFactory("Hidden"),
  'DISCOVER': enumFactory("Discover"),
  'READ': enumFactory("Read"),
  'WRITE': enumFactory("Write"),
  'OWNER': enumFactory("Owner")
});

export function maxPermission(permissions: Permission) {
  let highestPerm = Permission.HIDDEN;

  for (let permission of permissions) {
    if (permission.ordinal > highestPerm.ordinal) {
      highestPerm = permission;
    }
  }

  return highestPerm;
}
{'fraction_non_alphanumeric': 0.13268608414239483, 'fraction_numerical': 0.0, 'mean_word_length': 4.102310231023102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4493610', 'n_tokens_mistral': 470, 'n_tokens_neox': 451, 'n_words': 107}