<commit_before>module OodCore
  module Job
    # A class that handles the communication with a resource manager for
    # submitting/statusing/holding/deleting jobs
    # @abstract
    class Adapter
      using Refinements::ArrayExtensions

      # Submit a job with the attributes defined in the job template instance
      # @abstract Subclass is expected to implement {#submit}
      # @raise [NotImplementedError] if subclass did not define {#submit}
      # @example Submit job template to cluster
      #   solver_id = job_adapter.submit(solver_script)
      #   #=> "1234.server"
      # @example Submit job that depends on previous job
      #   post_id = job_adapter.submit(
      #     post_script,
      #     afterok: solver_id
      #   )
      #   #=> "1235.server"
      # @param script [Script] script object that describes the
      #   script and attributes for the submitted job
      # @param after [#to_s, Array<#to_s>] this job may be scheduled for execution
      #   at any point after dependent jobs have started execution
      # @param afterok [#to_s, Array<#to_s>] this job may be scheduled for
      #   execution only after dependent jobs have terminated with no errors
      # @param afternotok [#to_s, Array<#to_s>] this job may be scheduled for
      #   execution only after dependent jobs have terminated with errors
      # @param afterany [#to_s, Array<#to_s>] this job may be scheduled for
      #   execution after dependent jobs have terminated
      # @return [String] the job id returned after successfully submitting a job
      def submit(script, after: [], afterok: [], afternotok: [], afterany: [])
        raise NotImplementedError, "subclass did not define #submit"
      end

      # Retrieve info for all jobs from the resource manager
      # @abstract Subclass is expected to implement {#info_all}
      # @raise [NotImplementedError] if subclass did not define {#info_all}
      # @param attrs [Array<symbol>] specify only attrs you want; defaults to []
      #   if not an empty array, the Info object that is returned to you is not
      #   guarenteed to have a value for any attribute besides the ones
      #   specified; for certain adapters this may speed up the response since
      #   adapters can get by without populating the entire Info object
      # @return [Array<Info>] information describing submitted jobs
      def info_all(attrs: nil)
        raise NotImplementedError, "subclass did not define #info_all"
      end

      # Retrieve info for all jobs for a given owner or owners from the
      # resource manager
      # @param owner [#to_s, Array<#to_s>] the owner(s) of the jobs
      # @param attrs [Array<symbol>] specify only attrs you want; defaults to []
      #   if not an empty array, the Info object that is returned to you is not
      #   guarenteed to have a value for any attribute besides the ones
      #   specified and job_owner, since job_owner is required for filtering by
      #   job_owner
      #   For certain adapters this may speed up the response since
      #   adapters can get by without populating the entire Info object.
      # @return [Array<Info>] information describing submitted jobs
      def info_where_owner(owner, attrs: nil)<commit_msg>Fix description of attrs parameter<commit_after>module OodCore
  module Job
    # A class that handles the communication with a resource manager for
    # submitting/statusing/holding/deleting jobs
    # @abstract
    class Adapter
      using Refinements::ArrayExtensions

      # Submit a job with the attributes defined in the job template instance
      # @abstract Subclass is expected to implement {#submit}
      # @raise [NotImplementedError] if subclass did not define {#submit}
      # @example Submit job template to cluster
      #   solver_id = job_adapter.submit(solver_script)
      #   #=> "1234.server"
      # @example Submit job that depends on previous job
      #   post_id = job_adapter.submit(
      #     post_script,
      #     afterok: solver_id
      #   )
      #   #=> "1235.server"
      # @param script [Script] script object that describes the
      #   script and attributes for the submitted job
      # @param after [#to_s, Array<#to_s>] this job may be scheduled for execution
      #   at any point after dependent jobs have started execution
      # @param afterok [#to_s, Array<#to_s>] this job may be scheduled for
      #   execution only after dependent jobs have terminated with no errors
      # @param afternotok [#to_s, Array<#to_s>] this job may be scheduled for
      #   execution only after dependent jobs have terminated with errors
      # @param afterany [#to_s, Array<#to_s>] this job may be scheduled for
      #   execution after dependent jobs have terminated
      # @return [String] the job id returned after successfully submitting a job
      def submit(script, after: [], afterok: [], afternotok: [], afterany: [])
        raise NotImplementedError, "subclass did not define #submit"
      end

      # Retrieve info for all jobs from the resource manager
      # @abstract Subclass is expected to implement {#info_all}
      # @raise [NotImplementedError] if subclass did not define {#info_all}
      # @param attrs [Array<symbol>] array specifies only attrs you want, in
      #   addition to Info's required attrs id and status; and empty array
      #   would be requesting only id and status. If set, the Info object that
      #   is returned to you is not guarenteed to have a value for any attr 
      #   besides the ones specified.
      #
      #   For certain adapters this may speed up the response since
      #   adapters can get by without populating the entire Info object
      # @return [Array<Info>] information describing submitted jobs
      def info_all(attrs: nil)
        raise NotImplementedError, "subclass did not define #info_all"
      end

      # Retrieve info for all jobs for a given owner or owners from the
      # resource manager
      # @param owner [#to_s, Array<#to_s>] the owner(s) of the jobs
      # @param attrs [Array<symbol>] array specifies only attrs you want, in
      #   addition to Info's required attrs id and status and job_owner; an empty array
      #   would be requesting only id, status, and job_owner. If set, the Info object that
      #   is returned to you is not guarenteed to have a value for any attr 
      #   besides the ones specified.
      #
      #   For certain adapters this may speed up the response since
      #   adapters can get by without populating the entire Info object
      # @return [Array<Info>] information describing submitted jobs
      def info_where_owner(owner, attrs: nil)
{'fraction_non_alphanumeric': 0.06416392461860604, 'fraction_numerical': 0.0023930601256356566, 'mean_word_length': 2.885531667635096, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, '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': '4596835', 'n_tokens_mistral': 1800, 'n_tokens_neox': 1726, 'n_words': 798}