<commit_before>module Octokit
  class Client
    module Repositories
      def search_repositories(q, options={})
        # depreciated in v3
        get("/api/v2/json/repos/search/#{q}", options, 2)['repositories']
      end
      alias :search_repos :search_repositories

      def repository(repo, options={})
        get "/repos/#{Repository.new repo}", options, 3
      end
      alias :repo :repository

      def edit_repository(repo, options={})
        patch "/repos/#{Repository.new repo}", options, 3
      end
      alias :edit :edit_repository
      alias :update_repository :edit_repository
      alias :update :edit_repository

      def repositories(username=nil, options={})
        if username.nil?
          get '/user/repos', options, 3
        else
          get "/users/#{username}/repos", options, 3
        end
      end
      alias :list_repositories :repositories
      alias :list_repos :repositories
      alias :repos :repositories

      def watch(repo, options={})
        put "/user/watched/#{Repository.new repo}", options, 3
      end

      def unwatch(repo, options={})
        delete "/user/watched/#{Repository.new repo}", options, 3
      end

      def fork(repo, options={})
        post "/repos/#{Repository.new repo}/forks", options, 3
      end

      def create_repository(name, options={})
        organization = options.delete :organization
        options.merge! :name => name

        if organization.nil?
          post '/user/repos', options, 3
        else
          post "/orgs/#{organization}/repos", options, 3
        end
      end
      alias :create_repo :create_repository
      alias :create :create_repository

      def set_private(repo, options={})
        update_repository repo, options.merge({ :public => false })
      end

      def set_public(repo, options={})
        update_repository repo, options.merge({ :public => true })
      end

      def deploy_keys(repo, options={})
        get "/repos/#{Repository.new repo}/keys", options, 3
      end
      alias :list_deploy_keys :deploy_keys

      def add_deploy_key(repo, title, key, options={})
        post "/repos/#{Repository.new repo}/keys", options.merge(:title => title, :key => key), 3
      end

      def remove_deploy_key(repo, id, options={})
        delete "/repos/#{Repository.new repo}/keys/#{id}", options, 3
      end

      def collaborators(repo, options={})
        get "/repos/#{Repository.new repo}/collaborators", options, 3
      end
      alias :collabs :collaborators

      def add_collaborator(repo, collaborator, options={})
        put "/repos/#{Repository.new repo}/collaborators/#{collaborator}", options, 3
      end
      alias :add_collab :add_collaborator

      def remove_collaborator(repo, collaborator, options={})
        delete "/repos/#{Repository.new repo}/collaborators/#{collaborator}", options, 3
      end
      alias :remove_collab :remove_collaborator

      def pushable(options={})
        get("/api/v2/json/repos/pushable", options)['repositories']
      end<commit_msg>Document that there's no matching method of "pushable" in v3<commit_after>module Octokit
  class Client
    module Repositories
      def search_repositories(q, options={})
        # depreciated in v3
        get("/api/v2/json/repos/search/#{q}", options, 2)['repositories']
      end
      alias :search_repos :search_repositories

      def repository(repo, options={})
        get "/repos/#{Repository.new repo}", options, 3
      end
      alias :repo :repository

      def edit_repository(repo, options={})
        patch "/repos/#{Repository.new repo}", options, 3
      end
      alias :edit :edit_repository
      alias :update_repository :edit_repository
      alias :update :edit_repository

      def repositories(username=nil, options={})
        if username.nil?
          get '/user/repos', options, 3
        else
          get "/users/#{username}/repos", options, 3
        end
      end
      alias :list_repositories :repositories
      alias :list_repos :repositories
      alias :repos :repositories

      def watch(repo, options={})
        put "/user/watched/#{Repository.new repo}", options, 3
      end

      def unwatch(repo, options={})
        delete "/user/watched/#{Repository.new repo}", options, 3
      end

      def fork(repo, options={})
        post "/repos/#{Repository.new repo}/forks", options, 3
      end

      def create_repository(name, options={})
        organization = options.delete :organization
        options.merge! :name => name

        if organization.nil?
          post '/user/repos', options, 3
        else
          post "/orgs/#{organization}/repos", options, 3
        end
      end
      alias :create_repo :create_repository
      alias :create :create_repository

      def set_private(repo, options={})
        update_repository repo, options.merge({ :public => false })
      end

      def set_public(repo, options={})
        update_repository repo, options.merge({ :public => true })
      end

      def deploy_keys(repo, options={})
        get "/repos/#{Repository.new repo}/keys", options, 3
      end
      alias :list_deploy_keys :deploy_keys

      def add_deploy_key(repo, title, key, options={})
        post "/repos/#{Repository.new repo}/keys", options.merge(:title => title, :key => key), 3
      end

      def remove_deploy_key(repo, id, options={})
        delete "/repos/#{Repository.new repo}/keys/#{id}", options, 3
      end

      def collaborators(repo, options={})
        get "/repos/#{Repository.new repo}/collaborators", options, 3
      end
      alias :collabs :collaborators

      def add_collaborator(repo, collaborator, options={})
        put "/repos/#{Repository.new repo}/collaborators/#{collaborator}", options, 3
      end
      alias :add_collab :add_collaborator

      def remove_collaborator(repo, collaborator, options={})
        delete "/repos/#{Repository.new repo}/collaborators/#{collaborator}", options, 3
      end
      alias :remove_collab :remove_collaborator

      def pushable(options={})
        # There isn't a matching method in V3 of the api
        get("/api/v2/json/repos/pushable", options, 2)['repositories']
      end
{'fraction_non_alphanumeric': 0.12199451347426174, 'fraction_numerical': 0.006616104566725835, 'mean_word_length': 2.5826589595375724, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2536272', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1699, 'n_words': 471}