code: def test_load_sample(self):
      # test wrong data
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "x": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          ValueError,
          ABSASample,
          {
              "sentence": "",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": ["food"],
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {"sentence": "food", "term_list": ""},
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": [
                      {
                          "polarity": "positive",
                          "term": "bread",
                          "from": 4,
                          "to": 9,
                          "opinion_words": ["top notch"],
                          "opinion_position": [[13, 22]],
                      }
                  ]
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": 5,
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": ["positive"],
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": 5,
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": ["bread"],
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": "",
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": [],
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": -5,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": "",
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": [],
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": -5,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": [],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": [""],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": [-5],
                      "opinion_position": [[13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 11]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[-13, 22]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [[13, 22, 33]],
                  }
              },
          },
      )
      self.assertRaises(
          AssertionError,
          ABSASample,
          {
              "sentence": "food",
              "term_list": {
                  "32897564#894393#2_0": {
                      "polarity": "positive",
                      "term": "bread",
                      "from": 4,
                      "to": 9,
                      "opinion_words": ["top notch"],
                      "opinion_position": [""],
                  }
              },
          },
      )
  
file_path: textflint/test/input/component/sample/test_absa_sample.py
imports: import unittest
  from textflint.input.component.sample.absa_sample import *
label_desc: Use image node_id 1 for calling the TestABSASample obj's underlying member method code with example usage: obj.test_load_sample() without return types