We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Python 2.7 support


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `doc/source/gensidebar.py`
Content:
```
1 #
2 # This file generates the sidebar/toctree for all TileDB projects and should
3 # be copied to each project when it is updated.
4 #
5 # This file is originally from the RobotPy documentation project https://github.com/robotpy/robotpy-docs, licensed under
6 #
7 
8 import os
9 
10 def write_if_changed(fname, contents):
11 
12     try:
13         with open(fname, 'r') as fp:
14             old_contents = fp.read()
15     except:
16         old_contents = ''
17 
18     if old_contents != contents:
19         with open(fname, 'w') as fp:
20             fp.write(contents)
21 
22 def generate_sidebar(conf, conf_api):
23 
24     version = conf['rtd_version']
25 
26     lines = [
27         '', '.. DO NOT MODIFY! THIS PAGE IS AUTOGENERATED!', ''
28     ]
29 
30     url_base = 'https://docs.tiledb.io'
31     lang = 'en'
32 
33     def toctree(name):
34         lines.extend(['.. toctree::',
35                       '    :caption: %s' % name,
36                       '    :maxdepth: 1',
37                       ''])
38 
39     def endl():
40         lines.append('')
41 
42     def write(desc, link):
43         if conf_api == 'tiledb':
44             args = desc, link
45         else:
46             args = desc, '%s/%s/%s/%s.html' % (url_base, lang, version, link)
47 
48         lines.append('    %s <%s>' % args)
49 
50     def write_api(project, desc, rst_page):
51         # From non-root project to root project link
52         if project == 'tiledb' and conf_api != 'tiledb':
53             args = desc, url_base, lang, version, rst_page
54             lines.append('    %s API <%s/%s/%s/%s.html>' % args)
55         # From anything to non-root project link
56         elif project != conf_api:
57             args = desc, url_base, project, lang, version, rst_page
58             lines.append('    %s API <%s/projects/%s/%s/%s/%s.html>' % args)
59         # Local project link
60         else:
61             args = desc, rst_page
62             lines.append('    %s API <%s>' % args)
63 
64     #
65     # Specify the sidebar contents here
66     #
67     
68     toctree('Getting Started')
69     write('Introduction', 'introduction')
70     write('Installation', 'installation')
71     write('Usage', 'usage')
72     write('Working with S3', 's3')
73     endl()
74 
75     toctree('API Reference')
76     write_api('tiledb', 'C', 'c-api')
77     write_api('tiledb', 'C++', 'c++-api')
78     write_api('tiledb-py', 'Python', 'python-api')
79     endl()
80 
81     toctree('TileDB 101')
82     write('Data Model', 'tiledb101/data-model')
83     write('Basic Concepts', 'tiledb101/basic-concepts')
84     write('System Architecture', 'tiledb101/system-architecture')
85     write('Physical Organization', 'tiledb101/physical-organization')
86     write('Writing', 'tiledb101/writing/index')
87     write('Updating', 'tiledb101/updating')
88     write('Consolidation', 'tiledb101/consolidation')
89     write('Reading', 'tiledb101/reading/index')
90     write('Compression', 'tiledb101/compression')
91     write('Asynchronous I/O', 'tiledb101/asynchronous-io')
92     write('Key-Value Store', 'tiledb101/key-value-store')
93     write('Object Management', 'tiledb101/object-management')
94     write('Storage Backends', 'tiledb101/storage-backends')
95     write('Virtual Filesystem', 'tiledb101/virtual-filesystem')
96     write('Language Bindings', 'tiledb101/language-bindings')
97     write('Concurrency', 'tiledb101/concurrency')
98     write('Consistency', 'tiledb101/consistency')
99     endl()
100 
101     write_if_changed('_sidebar.rst.inc', '\n'.join(lines))
102
```

Path: `setup.py`
Content:
```
1 from __future__ import absolute_import, print_function
2 
3 import os
4 from setuptools import setup, Extension, find_packages
5 from pkg_resources import resource_filename
6 
7 import sys
8 from sys import version_info as ver
9 
10 # Check if Python version is supported
11 if any([ver < (3, 4)]):
12     raise Exception("Unsupported Python version %d.%d.  Requires Python >= 3.4")
13 
14 
15 class LazyCommandClass(dict):
16     """
17     Lazy command class that defers operations requiring Cython and numpy until
18     they've actually been downloaded and installed by setup_requires.
19     """
20     def __contains__(self, key):
21         return (
22             key == 'build_ext'
23             or super(LazyCommandClass, self).__contains__(key)
24         )
25 
26     def __setitem__(self, key, value):
27         if key == 'build_ext':
28             raise AssertionError("build_ext overridden!")
29         super(LazyCommandClass, self).__setitem__(key, value)
30 
31     def __getitem__(self, key):
32         if key != 'build_ext':
33             return super(LazyCommandClass, self).__getitem__(key)
34 
35         from Cython.Distutils import build_ext as cython_build_ext
36 
37         class build_ext(cython_build_ext):
38             """
39             Custom build_ext command that lazily adds numpy's include_dir to
40             extensions.
41             """
42             def build_extensions(self):
43                 """
44                 Lazily append numpy's include directory to Extension includes.
45 
46                 This is done here rather than at module scope because setup.py
47                 may be run before numpy has been installed, in which case
48                 importing numpy and calling `numpy.get_include()` will fail.
49                 """
50                 numpy_incl = resource_filename('numpy', 'core/include')
51                 for ext in self.extensions:
52                     ext.include_dirs.append(numpy_incl)
53 
54                 # This explicitly calls the superclass method rather than the
55                 # usual super() invocation because distutils' build_class, of
56                 # which Cython's build_ext is a subclass, is an old-style class
57                 # in Python 2, which doesn't support `super`.
58                 cython_build_ext.build_extensions(self)
59         return build_ext
60 
61 
62 tests_require = []
63 if ver < (3,):
64     tests_require.extend(["unittest2", "mock"])
65 
66 # Globals variables
67 CXXFLAGS = os.environ.get("CXXFLAGS", "-std=c++11").split()
68 LFLAGS = os.environ.get("LFLAGS", "").split()
69 
70 # Allow setting (lib) TileDB directory if it is installed on the system
71 TILEDB_DIR = os.environ.get("TILEDB_DIR", "")
72 
73 # Sources & libraries
74 inc_dirs = []
75 lib_dirs = []
76 libs = ["tiledb"]
77 def_macros = []
78 sources = ["tiledb/libtiledb.pyx"]
79 optional_libs = []
80 
81 # Pass command line flags to setup.py script
82 # handle --tiledb=[PATH] --lflags=[FLAGS] --cxxflags=[FLAGS]
83 args = sys.argv[:]
84 for arg in args:
85     if arg.find('--tiledb=') == 0:
86         TILEDB_DIR = os.path.expanduser(arg.split('=')[1])
87         sys.argv.remove(arg)
88     if arg.find('--lflags=') == 0:
89         LFLAGS = arg.split('=')[1].split()
90         sys.argv.remove(arg)
91     if arg.find('--cxxflags=') == 0:
92         CXXFLAGS = arg.split('=')[1].split()
93         sys.argv.remove(arg)
94 
95 if TILEDB_DIR != '':
96     lib_dirs += [os.path.join(TILEDB_DIR, 'lib')]
97     inc_dirs += [os.path.join(TILEDB_DIR, 'include')]
98 
99 setup(
100     name='tiledb',
101     description="Pythonic interface to the TileDB array storage manager",
102     author='TileDB, Inc.',
103     author_email='help@tiledb.io',
104     maintainer='TileDB, Inc.',
105     maintainer_email='help@tiledb.io',
106     url='https://github.com/TileDB-Inc/TileDB-Py',
107     license='MIT',
108     platforms=['any'],
109     use_scm_version={
110         'version_scheme': 'guess-next-dev',
111         'local_scheme': 'dirty-tag',
112         'write_to': 'tiledb/version.py'
113     },
114     ext_modules=[
115         Extension(
116           "tiledb.libtiledb",
117           include_dirs=inc_dirs,
118           define_macros=def_macros,
119           sources=sources,
120           library_dirs=lib_dirs,
121           libraries=libs,
122           extra_link_args=LFLAGS,
123           extra_compile_args=CXXFLAGS,
124           language="c++"
125         )
126     ],
127     setup_requires=[
128         'cython>=0.22',
129         'numpy>=1.7',
130         'setuptools>18.0',
131         'setuptools-scm>1.5.4'
132     ],
133     install_requires=[
134         'numpy>=1.7',
135     ],
136     tests_require=tests_require,
137     packages=find_packages(),
138     cmdclass=LazyCommandClass(),
139     classifiers=[
140         'Intended Audience :: Developers',
141         'Intended Audience :: Information Technology',
142         'Intended Audience :: Science/Research',
143         'License :: OSI Approved :: MIT License',
144         'Programming Language :: Python',
145         'Topic :: Software Development :: Libraries :: Python Modules',
146         'Operating System :: Unix',
147         'Programming Language :: Python :: 3',
148         'Programming Language :: Python :: 3.4',
149         'Programming Language :: Python :: 3.5',
150         'Programming Language :: Python :: 3.6',
151     ],
152 
153 )
154
```

Path: `tiledb/__init__.py`
Content:
```
1 from __future__ import absolute_import
2 
3 from .libtiledb import (Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, DenseArray, SparseArray,
4                         TileDBError, VFS, array_consolidate, group_create, object_type,
5                         ls, walk, remove, move)
6 
7 __all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,
8            array_consolidate, group_create, object_type, ls, walk, remove, move]
9
```
--- 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/doc/source/gensidebar.py b/doc/source/gensidebar.py
--- a/doc/source/gensidebar.py
+++ b/doc/source/gensidebar.py
@@ -64,12 +64,11 @@
     #
     # Specify the sidebar contents here
     #
-    
+
     toctree('Getting Started')
     write('Introduction', 'introduction')
     write('Installation', 'installation')
     write('Usage', 'usage')
-    write('Working with S3', 's3')
     endl()
 
     toctree('API Reference')
@@ -93,6 +92,7 @@
     write('Object Management', 'tiledb101/object-management')
     write('Storage Backends', 'tiledb101/storage-backends')
     write('Virtual Filesystem', 'tiledb101/virtual-filesystem')
+    write('Working with S3', 'tiledb101/s3')
     write('Language Bindings', 'tiledb101/language-bindings')
     write('Concurrency', 'tiledb101/concurrency')
     write('Consistency', 'tiledb101/consistency')
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -7,11 +7,6 @@
 import sys
 from sys import version_info as ver
 
-# Check if Python version is supported
-if any([ver < (3, 4)]):
-    raise Exception("Unsupported Python version %d.%d.  Requires Python >= 3.4")
-
-
 class LazyCommandClass(dict):
     """
     Lazy command class that defers operations requiring Cython and numpy until
@@ -68,7 +63,7 @@
 LFLAGS = os.environ.get("LFLAGS", "").split()
 
 # Allow setting (lib) TileDB directory if it is installed on the system
-TILEDB_DIR = os.environ.get("TILEDB_DIR", "")
+TILEDB_PATH = os.environ.get("TILEDB_PATH", "")
 
 # Sources & libraries
 inc_dirs = []
@@ -83,7 +78,7 @@
 args = sys.argv[:]
 for arg in args:
     if arg.find('--tiledb=') == 0:
-        TILEDB_DIR = os.path.expanduser(arg.split('=')[1])
+        TILEDB_PATH = os.path.expanduser(arg.split('=')[1])
         sys.argv.remove(arg)
     if arg.find('--lflags=') == 0:
         LFLAGS = arg.split('=')[1].split()
@@ -92,9 +87,9 @@
         CXXFLAGS = arg.split('=')[1].split()
         sys.argv.remove(arg)
 
-if TILEDB_DIR != '':
-    lib_dirs += [os.path.join(TILEDB_DIR, 'lib')]
-    inc_dirs += [os.path.join(TILEDB_DIR, 'include')]
+if TILEDB_PATH != '':
+    lib_dirs += [os.path.join(TILEDB_PATH, 'lib')]
+    inc_dirs += [os.path.join(TILEDB_PATH, 'include')]
 
 setup(
     name='tiledb',
diff --git a/tiledb/__init__.py b/tiledb/__init__.py
--- a/tiledb/__init__.py
+++ b/tiledb/__init__.py
@@ -1,8 +1,26 @@
 from __future__ import absolute_import
 
-from .libtiledb import (Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, DenseArray, SparseArray,
-                        TileDBError, VFS, array_consolidate, group_create, object_type,
-                        ls, walk, remove, move)
-
-__all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,
-           array_consolidate, group_create, object_type, ls, walk, remove, move]
+from .libtiledb import (
+     Ctx,
+     Config,
+     Dim,
+     Domain,
+     Attr,
+     KVSchema,
+     KV,
+     ArraySchema,
+     DenseArray,
+     SparseArray,
+     TileDBError,
+     VFS,
+     FileIO,
+     consolidate,
+     group_create,
+     object_type,
+     ls,
+     walk,
+     remove
+)
+#
+# __all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,
+#            array_consolidate, group_create, object_type, ls, walk, remove]

{"golden_diff": "diff --git a/doc/source/gensidebar.py b/doc/source/gensidebar.py\n--- a/doc/source/gensidebar.py\n+++ b/doc/source/gensidebar.py\n@@ -64,12 +64,11 @@\n     #\n     # Specify the sidebar contents here\n     #\n-    \n+\n     toctree('Getting Started')\n     write('Introduction', 'introduction')\n     write('Installation', 'installation')\n     write('Usage', 'usage')\n-    write('Working with S3', 's3')\n     endl()\n \n     toctree('API Reference')\n@@ -93,6 +92,7 @@\n     write('Object Management', 'tiledb101/object-management')\n     write('Storage Backends', 'tiledb101/storage-backends')\n     write('Virtual Filesystem', 'tiledb101/virtual-filesystem')\n+    write('Working with S3', 'tiledb101/s3')\n     write('Language Bindings', 'tiledb101/language-bindings')\n     write('Concurrency', 'tiledb101/concurrency')\n     write('Consistency', 'tiledb101/consistency')\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -7,11 +7,6 @@\n import sys\n from sys import version_info as ver\n \n-# Check if Python version is supported\n-if any([ver < (3, 4)]):\n-    raise Exception(\"Unsupported Python version %d.%d.  Requires Python >= 3.4\")\n-\n-\n class LazyCommandClass(dict):\n     \"\"\"\n     Lazy command class that defers operations requiring Cython and numpy until\n@@ -68,7 +63,7 @@\n LFLAGS = os.environ.get(\"LFLAGS\", \"\").split()\n \n # Allow setting (lib) TileDB directory if it is installed on the system\n-TILEDB_DIR = os.environ.get(\"TILEDB_DIR\", \"\")\n+TILEDB_PATH = os.environ.get(\"TILEDB_PATH\", \"\")\n \n # Sources & libraries\n inc_dirs = []\n@@ -83,7 +78,7 @@\n args = sys.argv[:]\n for arg in args:\n     if arg.find('--tiledb=') == 0:\n-        TILEDB_DIR = os.path.expanduser(arg.split('=')[1])\n+        TILEDB_PATH = os.path.expanduser(arg.split('=')[1])\n         sys.argv.remove(arg)\n     if arg.find('--lflags=') == 0:\n         LFLAGS = arg.split('=')[1].split()\n@@ -92,9 +87,9 @@\n         CXXFLAGS = arg.split('=')[1].split()\n         sys.argv.remove(arg)\n \n-if TILEDB_DIR != '':\n-    lib_dirs += [os.path.join(TILEDB_DIR, 'lib')]\n-    inc_dirs += [os.path.join(TILEDB_DIR, 'include')]\n+if TILEDB_PATH != '':\n+    lib_dirs += [os.path.join(TILEDB_PATH, 'lib')]\n+    inc_dirs += [os.path.join(TILEDB_PATH, 'include')]\n \n setup(\n     name='tiledb',\ndiff --git a/tiledb/__init__.py b/tiledb/__init__.py\n--- a/tiledb/__init__.py\n+++ b/tiledb/__init__.py\n@@ -1,8 +1,26 @@\n from __future__ import absolute_import\n \n-from .libtiledb import (Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, DenseArray, SparseArray,\n-                        TileDBError, VFS, array_consolidate, group_create, object_type,\n-                        ls, walk, remove, move)\n-\n-__all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,\n-           array_consolidate, group_create, object_type, ls, walk, remove, move]\n+from .libtiledb import (\n+     Ctx,\n+     Config,\n+     Dim,\n+     Domain,\n+     Attr,\n+     KVSchema,\n+     KV,\n+     ArraySchema,\n+     DenseArray,\n+     SparseArray,\n+     TileDBError,\n+     VFS,\n+     FileIO,\n+     consolidate,\n+     group_create,\n+     object_type,\n+     ls,\n+     walk,\n+     remove\n+)\n+#\n+# __all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,\n+#            array_consolidate, group_create, object_type, ls, walk, remove]\n", "issue": "Python 2.7 support\n\n", "before_files": [{"content": "#\n# This file generates the sidebar/toctree for all TileDB projects and should\n# be copied to each project when it is updated.\n#\n# This file is originally from the RobotPy documentation project https://github.com/robotpy/robotpy-docs, licensed under\n#\n\nimport os\n\ndef write_if_changed(fname, contents):\n\n    try:\n        with open(fname, 'r') as fp:\n            old_contents = fp.read()\n    except:\n        old_contents = ''\n\n    if old_contents != contents:\n        with open(fname, 'w') as fp:\n            fp.write(contents)\n\ndef generate_sidebar(conf, conf_api):\n\n    version = conf['rtd_version']\n\n    lines = [\n        '', '.. DO NOT MODIFY! THIS PAGE IS AUTOGENERATED!', ''\n    ]\n\n    url_base = 'https://docs.tiledb.io'\n    lang = 'en'\n\n    def toctree(name):\n        lines.extend(['.. toctree::',\n                      '    :caption: %s' % name,\n                      '    :maxdepth: 1',\n                      ''])\n\n    def endl():\n        lines.append('')\n\n    def write(desc, link):\n        if conf_api == 'tiledb':\n            args = desc, link\n        else:\n            args = desc, '%s/%s/%s/%s.html' % (url_base, lang, version, link)\n\n        lines.append('    %s <%s>' % args)\n\n    def write_api(project, desc, rst_page):\n        # From non-root project to root project link\n        if project == 'tiledb' and conf_api != 'tiledb':\n            args = desc, url_base, lang, version, rst_page\n            lines.append('    %s API <%s/%s/%s/%s.html>' % args)\n        # From anything to non-root project link\n        elif project != conf_api:\n            args = desc, url_base, project, lang, version, rst_page\n            lines.append('    %s API <%s/projects/%s/%s/%s/%s.html>' % args)\n        # Local project link\n        else:\n            args = desc, rst_page\n            lines.append('    %s API <%s>' % args)\n\n    #\n    # Specify the sidebar contents here\n    #\n    \n    toctree('Getting Started')\n    write('Introduction', 'introduction')\n    write('Installation', 'installation')\n    write('Usage', 'usage')\n    write('Working with S3', 's3')\n    endl()\n\n    toctree('API Reference')\n    write_api('tiledb', 'C', 'c-api')\n    write_api('tiledb', 'C++', 'c++-api')\n    write_api('tiledb-py', 'Python', 'python-api')\n    endl()\n\n    toctree('TileDB 101')\n    write('Data Model', 'tiledb101/data-model')\n    write('Basic Concepts', 'tiledb101/basic-concepts')\n    write('System Architecture', 'tiledb101/system-architecture')\n    write('Physical Organization', 'tiledb101/physical-organization')\n    write('Writing', 'tiledb101/writing/index')\n    write('Updating', 'tiledb101/updating')\n    write('Consolidation', 'tiledb101/consolidation')\n    write('Reading', 'tiledb101/reading/index')\n    write('Compression', 'tiledb101/compression')\n    write('Asynchronous I/O', 'tiledb101/asynchronous-io')\n    write('Key-Value Store', 'tiledb101/key-value-store')\n    write('Object Management', 'tiledb101/object-management')\n    write('Storage Backends', 'tiledb101/storage-backends')\n    write('Virtual Filesystem', 'tiledb101/virtual-filesystem')\n    write('Language Bindings', 'tiledb101/language-bindings')\n    write('Concurrency', 'tiledb101/concurrency')\n    write('Consistency', 'tiledb101/consistency')\n    endl()\n\n    write_if_changed('_sidebar.rst.inc', '\\n'.join(lines))\n", "path": "doc/source/gensidebar.py"}, {"content": "from __future__ import absolute_import, print_function\n\nimport os\nfrom setuptools import setup, Extension, find_packages\nfrom pkg_resources import resource_filename\n\nimport sys\nfrom sys import version_info as ver\n\n# Check if Python version is supported\nif any([ver < (3, 4)]):\n    raise Exception(\"Unsupported Python version %d.%d.  Requires Python >= 3.4\")\n\n\nclass LazyCommandClass(dict):\n    \"\"\"\n    Lazy command class that defers operations requiring Cython and numpy until\n    they've actually been downloaded and installed by setup_requires.\n    \"\"\"\n    def __contains__(self, key):\n        return (\n            key == 'build_ext'\n            or super(LazyCommandClass, self).__contains__(key)\n        )\n\n    def __setitem__(self, key, value):\n        if key == 'build_ext':\n            raise AssertionError(\"build_ext overridden!\")\n        super(LazyCommandClass, self).__setitem__(key, value)\n\n    def __getitem__(self, key):\n        if key != 'build_ext':\n            return super(LazyCommandClass, self).__getitem__(key)\n\n        from Cython.Distutils import build_ext as cython_build_ext\n\n        class build_ext(cython_build_ext):\n            \"\"\"\n            Custom build_ext command that lazily adds numpy's include_dir to\n            extensions.\n            \"\"\"\n            def build_extensions(self):\n                \"\"\"\n                Lazily append numpy's include directory to Extension includes.\n\n                This is done here rather than at module scope because setup.py\n                may be run before numpy has been installed, in which case\n                importing numpy and calling `numpy.get_include()` will fail.\n                \"\"\"\n                numpy_incl = resource_filename('numpy', 'core/include')\n                for ext in self.extensions:\n                    ext.include_dirs.append(numpy_incl)\n\n                # This explicitly calls the superclass method rather than the\n                # usual super() invocation because distutils' build_class, of\n                # which Cython's build_ext is a subclass, is an old-style class\n                # in Python 2, which doesn't support `super`.\n                cython_build_ext.build_extensions(self)\n        return build_ext\n\n\ntests_require = []\nif ver < (3,):\n    tests_require.extend([\"unittest2\", \"mock\"])\n\n# Globals variables\nCXXFLAGS = os.environ.get(\"CXXFLAGS\", \"-std=c++11\").split()\nLFLAGS = os.environ.get(\"LFLAGS\", \"\").split()\n\n# Allow setting (lib) TileDB directory if it is installed on the system\nTILEDB_DIR = os.environ.get(\"TILEDB_DIR\", \"\")\n\n# Sources & libraries\ninc_dirs = []\nlib_dirs = []\nlibs = [\"tiledb\"]\ndef_macros = []\nsources = [\"tiledb/libtiledb.pyx\"]\noptional_libs = []\n\n# Pass command line flags to setup.py script\n# handle --tiledb=[PATH] --lflags=[FLAGS] --cxxflags=[FLAGS]\nargs = sys.argv[:]\nfor arg in args:\n    if arg.find('--tiledb=') == 0:\n        TILEDB_DIR = os.path.expanduser(arg.split('=')[1])\n        sys.argv.remove(arg)\n    if arg.find('--lflags=') == 0:\n        LFLAGS = arg.split('=')[1].split()\n        sys.argv.remove(arg)\n    if arg.find('--cxxflags=') == 0:\n        CXXFLAGS = arg.split('=')[1].split()\n        sys.argv.remove(arg)\n\nif TILEDB_DIR != '':\n    lib_dirs += [os.path.join(TILEDB_DIR, 'lib')]\n    inc_dirs += [os.path.join(TILEDB_DIR, 'include')]\n\nsetup(\n    name='tiledb',\n    description=\"Pythonic interface to the TileDB array storage manager\",\n    author='TileDB, Inc.',\n    author_email='help@tiledb.io',\n    maintainer='TileDB, Inc.',\n    maintainer_email='help@tiledb.io',\n    url='https://github.com/TileDB-Inc/TileDB-Py',\n    license='MIT',\n    platforms=['any'],\n    use_scm_version={\n        'version_scheme': 'guess-next-dev',\n        'local_scheme': 'dirty-tag',\n        'write_to': 'tiledb/version.py'\n    },\n    ext_modules=[\n        Extension(\n          \"tiledb.libtiledb\",\n          include_dirs=inc_dirs,\n          define_macros=def_macros,\n          sources=sources,\n          library_dirs=lib_dirs,\n          libraries=libs,\n          extra_link_args=LFLAGS,\n          extra_compile_args=CXXFLAGS,\n          language=\"c++\"\n        )\n    ],\n    setup_requires=[\n        'cython>=0.22',\n        'numpy>=1.7',\n        'setuptools>18.0',\n        'setuptools-scm>1.5.4'\n    ],\n    install_requires=[\n        'numpy>=1.7',\n    ],\n    tests_require=tests_require,\n    packages=find_packages(),\n    cmdclass=LazyCommandClass(),\n    classifiers=[\n        'Intended Audience :: Developers',\n        'Intended Audience :: Information Technology',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: MIT License',\n        'Programming Language :: Python',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n        'Operating System :: Unix',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n    ],\n\n)\n", "path": "setup.py"}, {"content": "from __future__ import absolute_import\n\nfrom .libtiledb import (Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, DenseArray, SparseArray,\n                        TileDBError, VFS, array_consolidate, group_create, object_type,\n                        ls, walk, remove, move)\n\n__all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,\n           array_consolidate, group_create, object_type, ls, walk, remove, move]\n", "path": "tiledb/__init__.py"}], "after_files": [{"content": "#\n# This file generates the sidebar/toctree for all TileDB projects and should\n# be copied to each project when it is updated.\n#\n# This file is originally from the RobotPy documentation project https://github.com/robotpy/robotpy-docs, licensed under\n#\n\nimport os\n\ndef write_if_changed(fname, contents):\n\n    try:\n        with open(fname, 'r') as fp:\n            old_contents = fp.read()\n    except:\n        old_contents = ''\n\n    if old_contents != contents:\n        with open(fname, 'w') as fp:\n            fp.write(contents)\n\ndef generate_sidebar(conf, conf_api):\n\n    version = conf['rtd_version']\n\n    lines = [\n        '', '.. DO NOT MODIFY! THIS PAGE IS AUTOGENERATED!', ''\n    ]\n\n    url_base = 'https://docs.tiledb.io'\n    lang = 'en'\n\n    def toctree(name):\n        lines.extend(['.. toctree::',\n                      '    :caption: %s' % name,\n                      '    :maxdepth: 1',\n                      ''])\n\n    def endl():\n        lines.append('')\n\n    def write(desc, link):\n        if conf_api == 'tiledb':\n            args = desc, link\n        else:\n            args = desc, '%s/%s/%s/%s.html' % (url_base, lang, version, link)\n\n        lines.append('    %s <%s>' % args)\n\n    def write_api(project, desc, rst_page):\n        # From non-root project to root project link\n        if project == 'tiledb' and conf_api != 'tiledb':\n            args = desc, url_base, lang, version, rst_page\n            lines.append('    %s API <%s/%s/%s/%s.html>' % args)\n        # From anything to non-root project link\n        elif project != conf_api:\n            args = desc, url_base, project, lang, version, rst_page\n            lines.append('    %s API <%s/projects/%s/%s/%s/%s.html>' % args)\n        # Local project link\n        else:\n            args = desc, rst_page\n            lines.append('    %s API <%s>' % args)\n\n    #\n    # Specify the sidebar contents here\n    #\n\n    toctree('Getting Started')\n    write('Introduction', 'introduction')\n    write('Installation', 'installation')\n    write('Usage', 'usage')\n    endl()\n\n    toctree('API Reference')\n    write_api('tiledb', 'C', 'c-api')\n    write_api('tiledb', 'C++', 'c++-api')\n    write_api('tiledb-py', 'Python', 'python-api')\n    endl()\n\n    toctree('TileDB 101')\n    write('Data Model', 'tiledb101/data-model')\n    write('Basic Concepts', 'tiledb101/basic-concepts')\n    write('System Architecture', 'tiledb101/system-architecture')\n    write('Physical Organization', 'tiledb101/physical-organization')\n    write('Writing', 'tiledb101/writing/index')\n    write('Updating', 'tiledb101/updating')\n    write('Consolidation', 'tiledb101/consolidation')\n    write('Reading', 'tiledb101/reading/index')\n    write('Compression', 'tiledb101/compression')\n    write('Asynchronous I/O', 'tiledb101/asynchronous-io')\n    write('Key-Value Store', 'tiledb101/key-value-store')\n    write('Object Management', 'tiledb101/object-management')\n    write('Storage Backends', 'tiledb101/storage-backends')\n    write('Virtual Filesystem', 'tiledb101/virtual-filesystem')\n    write('Working with S3', 'tiledb101/s3')\n    write('Language Bindings', 'tiledb101/language-bindings')\n    write('Concurrency', 'tiledb101/concurrency')\n    write('Consistency', 'tiledb101/consistency')\n    endl()\n\n    write_if_changed('_sidebar.rst.inc', '\\n'.join(lines))\n", "path": "doc/source/gensidebar.py"}, {"content": "from __future__ import absolute_import, print_function\n\nimport os\nfrom setuptools import setup, Extension, find_packages\nfrom pkg_resources import resource_filename\n\nimport sys\nfrom sys import version_info as ver\n\nclass LazyCommandClass(dict):\n    \"\"\"\n    Lazy command class that defers operations requiring Cython and numpy until\n    they've actually been downloaded and installed by setup_requires.\n    \"\"\"\n    def __contains__(self, key):\n        return (\n            key == 'build_ext'\n            or super(LazyCommandClass, self).__contains__(key)\n        )\n\n    def __setitem__(self, key, value):\n        if key == 'build_ext':\n            raise AssertionError(\"build_ext overridden!\")\n        super(LazyCommandClass, self).__setitem__(key, value)\n\n    def __getitem__(self, key):\n        if key != 'build_ext':\n            return super(LazyCommandClass, self).__getitem__(key)\n\n        from Cython.Distutils import build_ext as cython_build_ext\n\n        class build_ext(cython_build_ext):\n            \"\"\"\n            Custom build_ext command that lazily adds numpy's include_dir to\n            extensions.\n            \"\"\"\n            def build_extensions(self):\n                \"\"\"\n                Lazily append numpy's include directory to Extension includes.\n\n                This is done here rather than at module scope because setup.py\n                may be run before numpy has been installed, in which case\n                importing numpy and calling `numpy.get_include()` will fail.\n                \"\"\"\n                numpy_incl = resource_filename('numpy', 'core/include')\n                for ext in self.extensions:\n                    ext.include_dirs.append(numpy_incl)\n\n                # This explicitly calls the superclass method rather than the\n                # usual super() invocation because distutils' build_class, of\n                # which Cython's build_ext is a subclass, is an old-style class\n                # in Python 2, which doesn't support `super`.\n                cython_build_ext.build_extensions(self)\n        return build_ext\n\n\ntests_require = []\nif ver < (3,):\n    tests_require.extend([\"unittest2\", \"mock\"])\n\n# Globals variables\nCXXFLAGS = os.environ.get(\"CXXFLAGS\", \"-std=c++11\").split()\nLFLAGS = os.environ.get(\"LFLAGS\", \"\").split()\n\n# Allow setting (lib) TileDB directory if it is installed on the system\nTILEDB_PATH = os.environ.get(\"TILEDB_PATH\", \"\")\n\n# Sources & libraries\ninc_dirs = []\nlib_dirs = []\nlibs = [\"tiledb\"]\ndef_macros = []\nsources = [\"tiledb/libtiledb.pyx\"]\noptional_libs = []\n\n# Pass command line flags to setup.py script\n# handle --tiledb=[PATH] --lflags=[FLAGS] --cxxflags=[FLAGS]\nargs = sys.argv[:]\nfor arg in args:\n    if arg.find('--tiledb=') == 0:\n        TILEDB_PATH = os.path.expanduser(arg.split('=')[1])\n        sys.argv.remove(arg)\n    if arg.find('--lflags=') == 0:\n        LFLAGS = arg.split('=')[1].split()\n        sys.argv.remove(arg)\n    if arg.find('--cxxflags=') == 0:\n        CXXFLAGS = arg.split('=')[1].split()\n        sys.argv.remove(arg)\n\nif TILEDB_PATH != '':\n    lib_dirs += [os.path.join(TILEDB_PATH, 'lib')]\n    inc_dirs += [os.path.join(TILEDB_PATH, 'include')]\n\nsetup(\n    name='tiledb',\n    description=\"Pythonic interface to the TileDB array storage manager\",\n    author='TileDB, Inc.',\n    author_email='help@tiledb.io',\n    maintainer='TileDB, Inc.',\n    maintainer_email='help@tiledb.io',\n    url='https://github.com/TileDB-Inc/TileDB-Py',\n    license='MIT',\n    platforms=['any'],\n    use_scm_version={\n        'version_scheme': 'guess-next-dev',\n        'local_scheme': 'dirty-tag',\n        'write_to': 'tiledb/version.py'\n    },\n    ext_modules=[\n        Extension(\n          \"tiledb.libtiledb\",\n          include_dirs=inc_dirs,\n          define_macros=def_macros,\n          sources=sources,\n          library_dirs=lib_dirs,\n          libraries=libs,\n          extra_link_args=LFLAGS,\n          extra_compile_args=CXXFLAGS,\n          language=\"c++\"\n        )\n    ],\n    setup_requires=[\n        'cython>=0.22',\n        'numpy>=1.7',\n        'setuptools>18.0',\n        'setuptools-scm>1.5.4'\n    ],\n    install_requires=[\n        'numpy>=1.7',\n    ],\n    tests_require=tests_require,\n    packages=find_packages(),\n    cmdclass=LazyCommandClass(),\n    classifiers=[\n        'Intended Audience :: Developers',\n        'Intended Audience :: Information Technology',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: MIT License',\n        'Programming Language :: Python',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n        'Operating System :: Unix',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n    ],\n\n)\n", "path": "setup.py"}, {"content": "from __future__ import absolute_import\n\nfrom .libtiledb import (\n     Ctx,\n     Config,\n     Dim,\n     Domain,\n     Attr,\n     KVSchema,\n     KV,\n     ArraySchema,\n     DenseArray,\n     SparseArray,\n     TileDBError,\n     VFS,\n     FileIO,\n     consolidate,\n     group_create,\n     object_type,\n     ls,\n     walk,\n     remove\n)\n#\n# __all__ = [Ctx, Config, Dim, Domain, Attr, KV, ArraySchema, SparseArray, TileDBError, VFS,\n#            array_consolidate, group_create, object_type, ls, walk, remove]\n", "path": "tiledb/__init__.py"}]}