code: def load_snippets(cls, src_path, violation_lines):
          
          # Load the contents of the file
          with openpy(GitPathTool.relative_path(src_path)) as src_file:
              contents = src_file.read()
  
          # Convert the source file to unicode (Python < 3)
          if isinstance(contents, six.binary_type):
              contents = contents.decode('utf-8', 'replace')
  
          # Construct a list of snippet ranges
          src_lines = contents.split('\n')
          snippet_ranges = cls._snippet_ranges(len(src_lines), violation_lines)
  
          # Parse the source into tokens
          token_stream = cls._parse_src(contents, src_path)
  
          # Group the tokens by snippet
          token_groups = cls._group_tokens(token_stream, snippet_ranges)
  
          return [
              Snippet(tokens, src_path, start, violation_lines)
              for (start, _), tokens in sorted(token_groups.items())
          ]
docs: Load snippets from the file at `src_path` to show
          violations on lines in the list `violation_lines`
          (list of line numbers, starting at index 0).
  
          The file at `src_path` should be a text file (not binary).
  
          Returns a list of `Snippet` instances.
  
          Raises an `IOError` if the file could not be loaded.