<commit_before>require 'open-uri'
class Admin::UsersController < Admin::AdminController
  helper_method :sort_column, :sort_direction
  respond_to :html, :xml, :json

  before_action :set_user, only: [:show, :edit, :update, :destroy, :deactivate, :activate, :edit_notification_settings, :update_notification_settings, :notifications]
  before_action :require_admin, only: [:index, :destroy]
  before_action :require_admin_or_owner, except: [:index, :tokeninput]
  before_action :admin_two_factor, except: [:index, :tokeninput, :show]
  # GET /users
  # GET /users.json
  def index
    num_items = items_per_page_handler
    @users = User.all

    @users = @users
    respond_to do |format|
      format.html { @users = [] }
      format.json { render "index" }
      format.xml { render xml:  @users }
      format.csv { send_file  @users.to_csv,filename: "users.csv",type:"text/csv" }
      end
  end

  # GET /users/1
  # GET /users/1.json
  def show

  end

  # GET /users/new
  def new
    @user = User.new
  end

  # GET /users/1/edit
  def edit

  end<commit_msg>update csv file<commit_after>require 'open-uri'
class Admin::UsersController < Admin::AdminController
  helper_method :sort_column, :sort_direction
  respond_to :html, :xml, :json

  before_action :set_user, only: [:show, :edit, :update, :destroy, :deactivate, :activate, :edit_notification_settings, :update_notification_settings, :notifications]
  before_action :require_admin, only: [:index, :destroy]
  before_action :require_admin_or_owner, except: [:index, :tokeninput]
  before_action :admin_two_factor, except: [:index, :tokeninput, :show]
  # GET /users
  # GET /users.json
  def index
    num_items = items_per_page_handler
    @users = User.all

    @users = @users
    respond_to do |format|
      format.html { @users = [] }
      format.json { render "index" }
      format.xml { render xml:  @users }
      format.csv { send_file  @users.to_csv,:type => 'text/csv; charset=iso-8859-1; header=present',:disposition => "attachment; filename=text.csv" }
      end
  end

  # GET /users/1
  # GET /users/1.json
  def show

  end

  # GET /users/new
  def new
    @user = User.new
  end

  # GET /users/1/edit
  def edit

  end
{'fraction_non_alphanumeric': 0.12330009066183137, 'fraction_numerical': 0.004986400725294651, 'mean_word_length': 3.6659619450317127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2388480', 'n_tokens_mistral': 766, 'n_tokens_neox': 746, 'n_words': 183}