nebius/SWE-bench-extra huggingface dataset:
Repository: pawelzny/dotty_dict

Issue:
Accessing root level list items by index fails
Thanks for the library! Using latest version (v1.1.1), this test fails
```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest

from dotty_dict import dotty_l as dotty


class TestListInDotty(unittest.TestCase):
    def setUp(self):
        self.dot = dotty({
            'field1': 'Value of F1',
            'field2': 'Value of F2',
            'field3': [
                {
                    'subfield1': 'Value of subfield1 (item 0)',
                    'subfield2': 'Value of subfield2 (item 0)'
                },
                {
                    'subfield1': 'Value of subfield1 (item 1)',
                    'subfield2': 'Value of subfield2 (item 1)'
                },
            ],
            'field4': 'Not wanted',
            'field5': [
                {
                    'subfield1': [{'subsubfield': 'Value of sub subfield (item 0)'}]
                }
            ],
            'field6': ['a', 'b']
        })

    def test_root_level_list_element(self):
        self.assertEqual(self.dot['field6.0'], 'a')
```
This fails on `dotty_dict.py", line 122, in get_from` since no subfield is specified
```
    it = items.pop(0)
IndexError: pop from empty list
```

Comments:

Patch:
diff --git a/dotty_dict/dotty_dict.py b/dotty_dict/dotty_dict.py
index 96d47cf..b806aa9 100644
--- a/dotty_dict/dotty_dict.py
+++ b/dotty_dict/dotty_dict.py
@@ -127,7 +127,10 @@ class Dotty:
                 except ValueError:
                     raise KeyError("List index must be an integer, got {}".format(it))
                 if idx < len(data):
-                    return get_from(items, data[idx])
+                    if len(items) > 0:
+                        return get_from(items, data[idx])
+                    else:
+                        return data[idx]
                 else:
                     raise IndexError("List index out of range")
             # /end Handle embedded lists


Test patch:
diff --git a/tests/test_list_in_dotty.py b/tests/test_list_in_dotty.py
index a3feb5c..583ac25 100644
--- a/tests/test_list_in_dotty.py
+++ b/tests/test_list_in_dotty.py
@@ -25,9 +25,13 @@ class TestListInDotty(unittest.TestCase):
                 {
                     'subfield1': [{'subsubfield': 'Value of sub subfield (item 0)'}]
                 }
-            ]
+            ],
+            'field6': ['a', 'b']
         })
 
+    def test_root_level_list_element(self):
+        self.assertEqual(self.dot['field6.0'], 'a')
+
     def test_access_subfield1_of_field3(self):
         self.assertEqual(self.dot['field3.0.subfield1'], 'Value of subfield1 (item 0)')
         self.assertEqual(self.dot['field3.1.subfield1'], 'Value of subfield1 (item 1)')