<commit_before>module JsonApi::User
  extend JsonApi::Json
  
  TYPE_KEY = 'user'
  DEFAULT_PAGE = 25
  MAX_PAGE = 50
    
  def self.build_json(user, args={})
    json = {}
    
    json['id'] = user.global_id
    json['user_name'] = user.user_name

    # TODO: find a better home for this
    json['avatar_url'] = user.generated_avatar_url('fallback')
    json['fallback_avatar_url'] = json['avatar_url']
    json['link'] = "#{JsonApi::Json.current_host}/#{user.user_name}"
    
    
    if args.key?(:permissions)
      json['permissions'] = user.permissions_for(args[:permissions])
      json['admin'] = true if Organization.admin_manager?(user)<commit_msg>syntax error on user api<commit_after>module JsonApi::User
  extend JsonApi::Json
  
  TYPE_KEY = 'user'
  DEFAULT_PAGE = 25
  MAX_PAGE = 50
    
  def self.build_json(user, args={})
    json = {}
    
    json['id'] = user.global_id
    json['user_name'] = user.user_name

    # TODO: find a better home for this
    json['avatar_url'] = user.generated_avatar_url('fallback')
    json['fallback_avatar_url'] = json['avatar_url']
    json['link'] = "#{JsonApi::Json.current_host}/#{user.user_name}"
    
    
    if args.key?(:permissions)
      json['permissions'] = user.permissions_for(args[:permissions])
      json['admin'] = true if ::Organization.admin_manager?(user)
{'fraction_non_alphanumeric': 0.14831460674157304, 'fraction_numerical': 0.00599250936329588, 'mean_word_length': 3.7208480565371023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1835152', 'n_tokens_mistral': 466, 'n_tokens_neox': 457, 'n_words': 81}