<commit_before>require 'fog/core/model'

module Fog
  module AWS
    class IAM

      class User < Fog::Model

        identity  :id, :aliases => 'UserName'
        attribute :path, :aliases => 'Path'
        attribute :arn, :aliases => 'Arn'
        attribute :user_id, :aliases => 'UserId'
        
        def save
          requires :id
          data = connection.create_user(id, path).body['User']
          merge_attributes(data)
          true
        end
        
        def destroy
          requires :id
          connection.delete_user(id)
          true
        end
        
        def policies
          requires :id
          connection.policies(:username => id)<commit_msg>revised create logic to default path to '/'<commit_after>require 'fog/core/model'

module Fog
  module AWS
    class IAM

      class User < Fog::Model

        identity  :id, :aliases => 'UserName'
        attribute :path, :aliases => 'Path'
        attribute :arn, :aliases => 'Arn'
        attribute :user_id, :aliases => 'UserId'
        
        def save
          requires :id
          data = connection.create_user(id, path || '/').body['User']
          merge_attributes(data)
          true
        end
        
        def destroy
          requires :id
          connection.delete_user(id)
          true
        end
        
        def policies
          requires :id
          connection.policies(:username => id)
{'fraction_non_alphanumeric': 0.09302325581395349, 'fraction_numerical': 0.0, 'mean_word_length': 1.6007326007326008, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '793080', 'n_tokens_mistral': 394, 'n_tokens_neox': 390, 'n_words': 107}