<commit_before>action :install do

  if new_resource.create_user
    group new_resource.group do
      action :create
    end
    user new_resource.owner do
      action :create
      gid new_resource.group
    end
  end

  directory new_resource.path do
    action :create
    owner new_resource.owner
    group new_resource.group
  end

  # Update the code.
  git new_resource.path do
    action :sync
    repository new_resource.repository
    checkout_branch new_resource.revision
    destination new_resource.path
    user new_resource.owner
    group new_resource.group
  end

  # If a config file template has been specified, create it.
  template new_resource.config_template do
    only_if { !new_resource.config_template.nil }
    action :create
    source new_resource.config_template
    path new_resource.config_destination
    variables new_resource.config_vars
    owner new_resource.owner
    group new_resource.group
  end

  # Install the application requirements.
  # If a requirements file has been specified, use pip.
  # otherwise use the setup.py
  if new_resource.requirements_file
    execute 'pip install' do
      action :run
      cwd new_resource.path
      command "pip install -r #{new_resource.requirements_file}"
    end
  else
    execute 'python setup.py install' do
      action :run
      cwd new_resource.path
    end
  end
  new_resource.updated_by_last_action(true)
end<commit_msg>Make comparisons in common provider more explicit<commit_after>action :install do

  if new_resource.create_user
    group new_resource.group do
      action :create
    end
    user new_resource.owner do
      action :create
      gid new_resource.group
    end
  end

  directory new_resource.path do
    action :create
    owner new_resource.owner
    group new_resource.group
  end

  # Update the code.
  git new_resource.path do
    action :sync
    repository new_resource.repository
    checkout_branch new_resource.revision
    destination new_resource.path
    user new_resource.owner
    group new_resource.group
  end

  # If a config file template has been specified, create it.
  template new_resource.config_template do
    only_if { new_resource.config_template != nil }
    action :create
    source new_resource.config_template
    path new_resource.config_destination
    variables new_resource.config_vars
    owner new_resource.owner
    group new_resource.group
  end

  # Install the application requirements.
  # If a requirements file has been specified, use pip.
  # otherwise use the setup.py
  if new_resource.requirements_file != ''
    execute 'pip install' do
      action :run
      cwd new_resource.path
      command "pip install -r #{new_resource.requirements_file}"
    end
  else
    execute 'python setup.py install' do
      action :run
      cwd new_resource.path
    end
  end
  new_resource.updated_by_last_action(true)
end
{'fraction_non_alphanumeric': 0.04643104643104643, 'fraction_numerical': 0.0, 'mean_word_length': 3.1125356125356127, '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': '615235', 'n_tokens_mistral': 829, 'n_tokens_neox': 811, 'n_words': 254}