We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`from_numpy` fails for string dtypes (v2)
### Version of Awkward Array

314efeee9e17626f363dffc6010ccc6ab6002bea

### Description and code to reproduce

```pycon
>>> import awkward._v2 as ak
>>> import numpy as np
>>> ak.from_numpy(np.array(["this", "that"]))
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [1], in <cell line: 3>()
      1 import awkward._v2 as ak
      2 import numpy as np
----> 3 ak.from_numpy(np.array(["this", "that"]))

File ~/Git/awkward-1.0/awkward/_v2/operations/convert/ak_from_numpy.py:53, in from_numpy(array, regulararray, recordarray, highlevel, behavior)
     12 """
     13 Args:
     14     array (np.ndarray): The NumPy array to convert into an Awkward Array.
   (...)
     41 See also #ak.to_numpy and #ak.from_cupy.
     42 """
     43 with ak._v2._util.OperationErrorContext(
     44     "ak._v2.from_numpy",
     45     dict(
   (...)
     51     ),
     52 ):
---> 53     return _impl(array, regulararray, recordarray, highlevel, behavior)

File ~/Git/awkward-1.0/awkward/_v2/operations/convert/ak_from_numpy.py:142, in _impl(array, regulararray, recordarray, highlevel, behavior)
    139     mask = None
    141 if not recordarray or array.dtype.names is None:
--> 142     layout = recurse(array, mask)
    144 else:
    145     contents = []

File ~/Git/awkward-1.0/awkward/_v2/operations/convert/ak_from_numpy.py:91, in _impl.<locals>.recurse(array, mask)
     89 starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)
     90 stops = starts + numpy.char.str_len(asbytes)
---> 91 data = ak._v2.contents.ListArray64(
     92     ak._v2.index.Index64(starts),
     93     ak._v2.index.Index64(stops),
     94     ak._v2.contents.NumpyArray(
     95         asbytes.view("u1"), parameters={"__array__": "char"}, nplike=numpy
     96     ),
     97     parameters={"__array__": "string"},
     98 )
     99 for i in range(len(array.shape) - 1, 0, -1):
    100     data = ak._v2.contents.RegularArray(
    101         data, array.shape[i], array.shape[i - 1]
    102     )

AttributeError: module 'awkward._v2.contents' has no attribute 'ListArray64'
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/awkward/_v2/operations/convert/ak_from_numpy.py`
Content:
```
1 # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
2 
3 import awkward as ak
4 
5 np = ak.nplike.NumpyMetadata.instance()
6 numpy = ak.nplike.Numpy.instance()
7 
8 
9 def from_numpy(
10     array, regulararray=False, recordarray=True, highlevel=True, behavior=None
11 ):
12     """
13     Args:
14         array (np.ndarray): The NumPy array to convert into an Awkward Array.
15             This array can be a np.ma.MaskedArray.
16         regulararray (bool): If True and the array is multidimensional,
17             the dimensions are represented by nested #ak.layout.RegularArray
18             nodes; if False and the array is multidimensional, the dimensions
19             are represented by a multivalued #ak.layout.NumpyArray.shape.
20             If the array is one-dimensional, this has no effect.
21         recordarray (bool): If True and the array is a NumPy structured array
22             (dtype.names is not None), the fields are represented by an
23             #ak.layout.RecordArray; if False and the array is a structured
24             array, the structure is left in the #ak.layout.NumpyArray `format`,
25             which some functions do not recognize.
26         highlevel (bool): If True, return an #ak.Array; otherwise, return
27             a low-level #ak.layout.Content subclass.
28         behavior (None or dict): Custom #ak.behavior for the output array, if
29             high-level.
30 
31     Converts a NumPy array into an Awkward Array.
32 
33     The resulting layout can only involve the following #ak.layout.Content types:
34 
35        * #ak.layout.NumpyArray
36        * #ak.layout.ByteMaskedArray or #ak.layout.UnmaskedArray if the
37          `array` is an np.ma.MaskedArray.
38        * #ak.layout.RegularArray if `regulararray=True`.
39        * #ak.layout.RecordArray if `recordarray=True`.
40 
41     See also #ak.to_numpy and #ak.from_cupy.
42     """
43     with ak._v2._util.OperationErrorContext(
44         "ak._v2.from_numpy",
45         dict(
46             array=array,
47             regulararray=regulararray,
48             recordarray=recordarray,
49             highlevel=highlevel,
50             behavior=behavior,
51         ),
52     ):
53         return _impl(array, regulararray, recordarray, highlevel, behavior)
54 
55 
56 def _impl(array, regulararray, recordarray, highlevel, behavior):
57     def recurse(array, mask):
58         if regulararray and len(array.shape) > 1:
59             return ak._v2.contents.RegularArray(
60                 recurse(array.reshape((-1,) + array.shape[2:]), mask),
61                 array.shape[1],
62                 array.shape[0],
63             )
64 
65         if len(array.shape) == 0:
66             array = array.reshape(1)
67 
68         if array.dtype.kind == "S":
69             asbytes = array.reshape(-1)
70             itemsize = asbytes.dtype.itemsize
71             starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)
72             stops = starts + numpy.char.str_len(asbytes)
73             data = ak._v2.contents.ListArray64(
74                 ak._v2.index.Index64(starts),
75                 ak._v2.index.Index64(stops),
76                 ak._v2.contents.NumpyArray(
77                     asbytes.view("u1"), parameters={"__array__": "byte"}, nplike=numpy
78                 ),
79                 parameters={"__array__": "bytestring"},
80             )
81             for i in range(len(array.shape) - 1, 0, -1):
82                 data = ak._v2.contents.RegularArray(
83                     data, array.shape[i], array.shape[i - 1]
84                 )
85 
86         elif array.dtype.kind == "U":
87             asbytes = numpy.char.encode(array.reshape(-1), "utf-8", "surrogateescape")
88             itemsize = asbytes.dtype.itemsize
89             starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)
90             stops = starts + numpy.char.str_len(asbytes)
91             data = ak._v2.contents.ListArray64(
92                 ak._v2.index.Index64(starts),
93                 ak._v2.index.Index64(stops),
94                 ak._v2.contents.NumpyArray(
95                     asbytes.view("u1"), parameters={"__array__": "char"}, nplike=numpy
96                 ),
97                 parameters={"__array__": "string"},
98             )
99             for i in range(len(array.shape) - 1, 0, -1):
100                 data = ak._v2.contents.RegularArray(
101                     data, array.shape[i], array.shape[i - 1]
102                 )
103 
104         else:
105             data = ak._v2.contents.NumpyArray(array)
106 
107         if mask is None:
108             return data
109 
110         elif mask is False or (isinstance(mask, np.bool_) and not mask):
111             # NumPy's MaskedArray with mask == False is an UnmaskedArray
112             if len(array.shape) == 1:
113                 return ak._v2.contents.UnmaskedArray(data)
114             else:
115 
116                 def attach(x):
117                     if isinstance(x, ak._v2.contents.NumpyArray):
118                         return ak._v2.contents.UnmaskedArray(x)
119                     else:
120                         return ak._v2.contents.RegularArray(
121                             attach(x.content), x.size, len(x)
122                         )
123 
124                 return attach(data.toRegularArray())
125 
126         else:
127             # NumPy's MaskedArray is a ByteMaskedArray with valid_when=False
128             return ak._v2.contents.ByteMaskedArray(
129                 ak._v2.index.Index8(mask), data, valid_when=False
130             )
131 
132     if isinstance(array, numpy.ma.MaskedArray):
133         mask = numpy.ma.getmask(array)
134         array = numpy.ma.getdata(array)
135         if isinstance(mask, np.ndarray) and len(mask.shape) > 1:
136             regulararray = True
137             mask = mask.reshape(-1)
138     else:
139         mask = None
140 
141     if not recordarray or array.dtype.names is None:
142         layout = recurse(array, mask)
143 
144     else:
145         contents = []
146         for name in array.dtype.names:
147             contents.append(recurse(array[name], mask))
148         layout = ak._v2.contents.RecordArray(contents, array.dtype.names)
149 
150     return ak._v2._util.wrap(layout, behavior, highlevel)
151
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/awkward/_v2/operations/convert/ak_from_numpy.py b/src/awkward/_v2/operations/convert/ak_from_numpy.py
--- a/src/awkward/_v2/operations/convert/ak_from_numpy.py
+++ b/src/awkward/_v2/operations/convert/ak_from_numpy.py
@@ -70,7 +70,7 @@
             itemsize = asbytes.dtype.itemsize
             starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)
             stops = starts + numpy.char.str_len(asbytes)
-            data = ak._v2.contents.ListArray64(
+            data = ak._v2.contents.ListArray(
                 ak._v2.index.Index64(starts),
                 ak._v2.index.Index64(stops),
                 ak._v2.contents.NumpyArray(
@@ -88,7 +88,7 @@
             itemsize = asbytes.dtype.itemsize
             starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)
             stops = starts + numpy.char.str_len(asbytes)
-            data = ak._v2.contents.ListArray64(
+            data = ak._v2.contents.ListArray(
                 ak._v2.index.Index64(starts),
                 ak._v2.index.Index64(stops),
                 ak._v2.contents.NumpyArray(

{"golden_diff": "diff --git a/src/awkward/_v2/operations/convert/ak_from_numpy.py b/src/awkward/_v2/operations/convert/ak_from_numpy.py\n--- a/src/awkward/_v2/operations/convert/ak_from_numpy.py\n+++ b/src/awkward/_v2/operations/convert/ak_from_numpy.py\n@@ -70,7 +70,7 @@\n             itemsize = asbytes.dtype.itemsize\n             starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\n             stops = starts + numpy.char.str_len(asbytes)\n-            data = ak._v2.contents.ListArray64(\n+            data = ak._v2.contents.ListArray(\n                 ak._v2.index.Index64(starts),\n                 ak._v2.index.Index64(stops),\n                 ak._v2.contents.NumpyArray(\n@@ -88,7 +88,7 @@\n             itemsize = asbytes.dtype.itemsize\n             starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\n             stops = starts + numpy.char.str_len(asbytes)\n-            data = ak._v2.contents.ListArray64(\n+            data = ak._v2.contents.ListArray(\n                 ak._v2.index.Index64(starts),\n                 ak._v2.index.Index64(stops),\n                 ak._v2.contents.NumpyArray(\n", "issue": "`from_numpy` fails for string dtypes (v2)\n### Version of Awkward Array\r\n\r\n314efeee9e17626f363dffc6010ccc6ab6002bea\r\n\r\n### Description and code to reproduce\r\n\r\n```pycon\r\n>>> import awkward._v2 as ak\r\n>>> import numpy as np\r\n>>> ak.from_numpy(np.array([\"this\", \"that\"]))\r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\nInput In [1], in <cell line: 3>()\r\n      1 import awkward._v2 as ak\r\n      2 import numpy as np\r\n----> 3 ak.from_numpy(np.array([\"this\", \"that\"]))\r\n\r\nFile ~/Git/awkward-1.0/awkward/_v2/operations/convert/ak_from_numpy.py:53, in from_numpy(array, regulararray, recordarray, highlevel, behavior)\r\n     12 \"\"\"\r\n     13 Args:\r\n     14     array (np.ndarray): The NumPy array to convert into an Awkward Array.\r\n   (...)\r\n     41 See also #ak.to_numpy and #ak.from_cupy.\r\n     42 \"\"\"\r\n     43 with ak._v2._util.OperationErrorContext(\r\n     44     \"ak._v2.from_numpy\",\r\n     45     dict(\r\n   (...)\r\n     51     ),\r\n     52 ):\r\n---> 53     return _impl(array, regulararray, recordarray, highlevel, behavior)\r\n\r\nFile ~/Git/awkward-1.0/awkward/_v2/operations/convert/ak_from_numpy.py:142, in _impl(array, regulararray, recordarray, highlevel, behavior)\r\n    139     mask = None\r\n    141 if not recordarray or array.dtype.names is None:\r\n--> 142     layout = recurse(array, mask)\r\n    144 else:\r\n    145     contents = []\r\n\r\nFile ~/Git/awkward-1.0/awkward/_v2/operations/convert/ak_from_numpy.py:91, in _impl.<locals>.recurse(array, mask)\r\n     89 starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\r\n     90 stops = starts + numpy.char.str_len(asbytes)\r\n---> 91 data = ak._v2.contents.ListArray64(\r\n     92     ak._v2.index.Index64(starts),\r\n     93     ak._v2.index.Index64(stops),\r\n     94     ak._v2.contents.NumpyArray(\r\n     95         asbytes.view(\"u1\"), parameters={\"__array__\": \"char\"}, nplike=numpy\r\n     96     ),\r\n     97     parameters={\"__array__\": \"string\"},\r\n     98 )\r\n     99 for i in range(len(array.shape) - 1, 0, -1):\r\n    100     data = ak._v2.contents.RegularArray(\r\n    101         data, array.shape[i], array.shape[i - 1]\r\n    102     )\r\n\r\nAttributeError: module 'awkward._v2.contents' has no attribute 'ListArray64'\r\n```\n", "before_files": [{"content": "# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE\n\nimport awkward as ak\n\nnp = ak.nplike.NumpyMetadata.instance()\nnumpy = ak.nplike.Numpy.instance()\n\n\ndef from_numpy(\n    array, regulararray=False, recordarray=True, highlevel=True, behavior=None\n):\n    \"\"\"\n    Args:\n        array (np.ndarray): The NumPy array to convert into an Awkward Array.\n            This array can be a np.ma.MaskedArray.\n        regulararray (bool): If True and the array is multidimensional,\n            the dimensions are represented by nested #ak.layout.RegularArray\n            nodes; if False and the array is multidimensional, the dimensions\n            are represented by a multivalued #ak.layout.NumpyArray.shape.\n            If the array is one-dimensional, this has no effect.\n        recordarray (bool): If True and the array is a NumPy structured array\n            (dtype.names is not None), the fields are represented by an\n            #ak.layout.RecordArray; if False and the array is a structured\n            array, the structure is left in the #ak.layout.NumpyArray `format`,\n            which some functions do not recognize.\n        highlevel (bool): If True, return an #ak.Array; otherwise, return\n            a low-level #ak.layout.Content subclass.\n        behavior (None or dict): Custom #ak.behavior for the output array, if\n            high-level.\n\n    Converts a NumPy array into an Awkward Array.\n\n    The resulting layout can only involve the following #ak.layout.Content types:\n\n       * #ak.layout.NumpyArray\n       * #ak.layout.ByteMaskedArray or #ak.layout.UnmaskedArray if the\n         `array` is an np.ma.MaskedArray.\n       * #ak.layout.RegularArray if `regulararray=True`.\n       * #ak.layout.RecordArray if `recordarray=True`.\n\n    See also #ak.to_numpy and #ak.from_cupy.\n    \"\"\"\n    with ak._v2._util.OperationErrorContext(\n        \"ak._v2.from_numpy\",\n        dict(\n            array=array,\n            regulararray=regulararray,\n            recordarray=recordarray,\n            highlevel=highlevel,\n            behavior=behavior,\n        ),\n    ):\n        return _impl(array, regulararray, recordarray, highlevel, behavior)\n\n\ndef _impl(array, regulararray, recordarray, highlevel, behavior):\n    def recurse(array, mask):\n        if regulararray and len(array.shape) > 1:\n            return ak._v2.contents.RegularArray(\n                recurse(array.reshape((-1,) + array.shape[2:]), mask),\n                array.shape[1],\n                array.shape[0],\n            )\n\n        if len(array.shape) == 0:\n            array = array.reshape(1)\n\n        if array.dtype.kind == \"S\":\n            asbytes = array.reshape(-1)\n            itemsize = asbytes.dtype.itemsize\n            starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\n            stops = starts + numpy.char.str_len(asbytes)\n            data = ak._v2.contents.ListArray64(\n                ak._v2.index.Index64(starts),\n                ak._v2.index.Index64(stops),\n                ak._v2.contents.NumpyArray(\n                    asbytes.view(\"u1\"), parameters={\"__array__\": \"byte\"}, nplike=numpy\n                ),\n                parameters={\"__array__\": \"bytestring\"},\n            )\n            for i in range(len(array.shape) - 1, 0, -1):\n                data = ak._v2.contents.RegularArray(\n                    data, array.shape[i], array.shape[i - 1]\n                )\n\n        elif array.dtype.kind == \"U\":\n            asbytes = numpy.char.encode(array.reshape(-1), \"utf-8\", \"surrogateescape\")\n            itemsize = asbytes.dtype.itemsize\n            starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\n            stops = starts + numpy.char.str_len(asbytes)\n            data = ak._v2.contents.ListArray64(\n                ak._v2.index.Index64(starts),\n                ak._v2.index.Index64(stops),\n                ak._v2.contents.NumpyArray(\n                    asbytes.view(\"u1\"), parameters={\"__array__\": \"char\"}, nplike=numpy\n                ),\n                parameters={\"__array__\": \"string\"},\n            )\n            for i in range(len(array.shape) - 1, 0, -1):\n                data = ak._v2.contents.RegularArray(\n                    data, array.shape[i], array.shape[i - 1]\n                )\n\n        else:\n            data = ak._v2.contents.NumpyArray(array)\n\n        if mask is None:\n            return data\n\n        elif mask is False or (isinstance(mask, np.bool_) and not mask):\n            # NumPy's MaskedArray with mask == False is an UnmaskedArray\n            if len(array.shape) == 1:\n                return ak._v2.contents.UnmaskedArray(data)\n            else:\n\n                def attach(x):\n                    if isinstance(x, ak._v2.contents.NumpyArray):\n                        return ak._v2.contents.UnmaskedArray(x)\n                    else:\n                        return ak._v2.contents.RegularArray(\n                            attach(x.content), x.size, len(x)\n                        )\n\n                return attach(data.toRegularArray())\n\n        else:\n            # NumPy's MaskedArray is a ByteMaskedArray with valid_when=False\n            return ak._v2.contents.ByteMaskedArray(\n                ak._v2.index.Index8(mask), data, valid_when=False\n            )\n\n    if isinstance(array, numpy.ma.MaskedArray):\n        mask = numpy.ma.getmask(array)\n        array = numpy.ma.getdata(array)\n        if isinstance(mask, np.ndarray) and len(mask.shape) > 1:\n            regulararray = True\n            mask = mask.reshape(-1)\n    else:\n        mask = None\n\n    if not recordarray or array.dtype.names is None:\n        layout = recurse(array, mask)\n\n    else:\n        contents = []\n        for name in array.dtype.names:\n            contents.append(recurse(array[name], mask))\n        layout = ak._v2.contents.RecordArray(contents, array.dtype.names)\n\n    return ak._v2._util.wrap(layout, behavior, highlevel)\n", "path": "src/awkward/_v2/operations/convert/ak_from_numpy.py"}], "after_files": [{"content": "# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE\n\nimport awkward as ak\n\nnp = ak.nplike.NumpyMetadata.instance()\nnumpy = ak.nplike.Numpy.instance()\n\n\ndef from_numpy(\n    array, regulararray=False, recordarray=True, highlevel=True, behavior=None\n):\n    \"\"\"\n    Args:\n        array (np.ndarray): The NumPy array to convert into an Awkward Array.\n            This array can be a np.ma.MaskedArray.\n        regulararray (bool): If True and the array is multidimensional,\n            the dimensions are represented by nested #ak.layout.RegularArray\n            nodes; if False and the array is multidimensional, the dimensions\n            are represented by a multivalued #ak.layout.NumpyArray.shape.\n            If the array is one-dimensional, this has no effect.\n        recordarray (bool): If True and the array is a NumPy structured array\n            (dtype.names is not None), the fields are represented by an\n            #ak.layout.RecordArray; if False and the array is a structured\n            array, the structure is left in the #ak.layout.NumpyArray `format`,\n            which some functions do not recognize.\n        highlevel (bool): If True, return an #ak.Array; otherwise, return\n            a low-level #ak.layout.Content subclass.\n        behavior (None or dict): Custom #ak.behavior for the output array, if\n            high-level.\n\n    Converts a NumPy array into an Awkward Array.\n\n    The resulting layout can only involve the following #ak.layout.Content types:\n\n       * #ak.layout.NumpyArray\n       * #ak.layout.ByteMaskedArray or #ak.layout.UnmaskedArray if the\n         `array` is an np.ma.MaskedArray.\n       * #ak.layout.RegularArray if `regulararray=True`.\n       * #ak.layout.RecordArray if `recordarray=True`.\n\n    See also #ak.to_numpy and #ak.from_cupy.\n    \"\"\"\n    with ak._v2._util.OperationErrorContext(\n        \"ak._v2.from_numpy\",\n        dict(\n            array=array,\n            regulararray=regulararray,\n            recordarray=recordarray,\n            highlevel=highlevel,\n            behavior=behavior,\n        ),\n    ):\n        return _impl(array, regulararray, recordarray, highlevel, behavior)\n\n\ndef _impl(array, regulararray, recordarray, highlevel, behavior):\n    def recurse(array, mask):\n        if regulararray and len(array.shape) > 1:\n            return ak._v2.contents.RegularArray(\n                recurse(array.reshape((-1,) + array.shape[2:]), mask),\n                array.shape[1],\n                array.shape[0],\n            )\n\n        if len(array.shape) == 0:\n            array = array.reshape(1)\n\n        if array.dtype.kind == \"S\":\n            asbytes = array.reshape(-1)\n            itemsize = asbytes.dtype.itemsize\n            starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\n            stops = starts + numpy.char.str_len(asbytes)\n            data = ak._v2.contents.ListArray(\n                ak._v2.index.Index64(starts),\n                ak._v2.index.Index64(stops),\n                ak._v2.contents.NumpyArray(\n                    asbytes.view(\"u1\"), parameters={\"__array__\": \"byte\"}, nplike=numpy\n                ),\n                parameters={\"__array__\": \"bytestring\"},\n            )\n            for i in range(len(array.shape) - 1, 0, -1):\n                data = ak._v2.contents.RegularArray(\n                    data, array.shape[i], array.shape[i - 1]\n                )\n\n        elif array.dtype.kind == \"U\":\n            asbytes = numpy.char.encode(array.reshape(-1), \"utf-8\", \"surrogateescape\")\n            itemsize = asbytes.dtype.itemsize\n            starts = numpy.arange(0, len(asbytes) * itemsize, itemsize, dtype=np.int64)\n            stops = starts + numpy.char.str_len(asbytes)\n            data = ak._v2.contents.ListArray(\n                ak._v2.index.Index64(starts),\n                ak._v2.index.Index64(stops),\n                ak._v2.contents.NumpyArray(\n                    asbytes.view(\"u1\"), parameters={\"__array__\": \"char\"}, nplike=numpy\n                ),\n                parameters={\"__array__\": \"string\"},\n            )\n            for i in range(len(array.shape) - 1, 0, -1):\n                data = ak._v2.contents.RegularArray(\n                    data, array.shape[i], array.shape[i - 1]\n                )\n\n        else:\n            data = ak._v2.contents.NumpyArray(array)\n\n        if mask is None:\n            return data\n\n        elif mask is False or (isinstance(mask, np.bool_) and not mask):\n            # NumPy's MaskedArray with mask == False is an UnmaskedArray\n            if len(array.shape) == 1:\n                return ak._v2.contents.UnmaskedArray(data)\n            else:\n\n                def attach(x):\n                    if isinstance(x, ak._v2.contents.NumpyArray):\n                        return ak._v2.contents.UnmaskedArray(x)\n                    else:\n                        return ak._v2.contents.RegularArray(\n                            attach(x.content), x.size, len(x)\n                        )\n\n                return attach(data.toRegularArray())\n\n        else:\n            # NumPy's MaskedArray is a ByteMaskedArray with valid_when=False\n            return ak._v2.contents.ByteMaskedArray(\n                ak._v2.index.Index8(mask), data, valid_when=False\n            )\n\n    if isinstance(array, numpy.ma.MaskedArray):\n        mask = numpy.ma.getmask(array)\n        array = numpy.ma.getdata(array)\n        if isinstance(mask, np.ndarray) and len(mask.shape) > 1:\n            regulararray = True\n            mask = mask.reshape(-1)\n    else:\n        mask = None\n\n    if not recordarray or array.dtype.names is None:\n        layout = recurse(array, mask)\n\n    else:\n        contents = []\n        for name in array.dtype.names:\n            contents.append(recurse(array[name], mask))\n        layout = ak._v2.contents.RecordArray(contents, array.dtype.names)\n\n    return ak._v2._util.wrap(layout, behavior, highlevel)\n", "path": "src/awkward/_v2/operations/convert/ak_from_numpy.py"}]}