ZTWHHH commited on
Commit
3a0d712
·
verified ·
1 Parent(s): 70f2831

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. parrot/share/terminfo/r/regent20 +0 -0
  3. parrot/share/terminfo/r/regent40 +0 -0
  4. parrot/share/terminfo/s/screen-256color-bce-s +0 -0
  5. parrot/share/terminfo/s/screen.rxvt +0 -0
  6. parrot/share/terminfo/s/sun-cmd +0 -0
  7. parrot/share/terminfo/t/teken-vt +0 -0
  8. parrot/share/terminfo/t/tty5620-34 +0 -0
  9. parrot/share/terminfo/t/tvi912c-vb-p +0 -0
  10. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/__init__.cpython-310.pyc +0 -0
  11. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_dfi_types.cpython-310.pyc +0 -0
  12. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_importers.cpython-310.pyc +0 -0
  13. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_show.cpython-310.pyc +0 -0
  14. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_transformed_data.cpython-310.pyc +0 -0
  15. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_vegafusion_data.cpython-310.pyc +0 -0
  16. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/compiler.cpython-310.pyc +0 -0
  17. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/core.cpython-310.pyc +0 -0
  18. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/data.cpython-310.pyc +0 -0
  19. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/deprecation.cpython-310.pyc +0 -0
  20. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/display.cpython-310.pyc +0 -0
  21. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/execeval.cpython-310.pyc +0 -0
  22. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/html.cpython-310.pyc +0 -0
  23. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/mimebundle.cpython-310.pyc +0 -0
  24. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/plugin_registry.cpython-310.pyc +0 -0
  25. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/save.cpython-310.pyc +0 -0
  26. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/schemapi.cpython-310.pyc +0 -0
  27. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/selection.cpython-310.pyc +0 -0
  28. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/server.cpython-310.pyc +0 -0
  29. videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/theme.cpython-310.pyc +0 -0
  30. videollama2/lib/python3.10/site-packages/altair/utils/mimebundle.py +370 -0
  31. videollama2/lib/python3.10/site-packages/altair/vegalite/__init__.py +2 -0
  32. videollama2/lib/python3.10/site-packages/altair/vegalite/api.py +2 -0
  33. videollama2/lib/python3.10/site-packages/altair/vegalite/data.py +66 -0
  34. videollama2/lib/python3.10/site-packages/altair/vegalite/display.py +17 -0
  35. videollama2/lib/python3.10/site-packages/altair/vegalite/schema.py +4 -0
  36. videollama2/lib/python3.10/site-packages/altair/vegalite/v5/__init__.py +24 -0
  37. videollama2/lib/python3.10/site-packages/altair/vegalite/v5/api.py +0 -0
  38. videollama2/lib/python3.10/site-packages/altair/vegalite/v5/compiler.py +23 -0
  39. videollama2/lib/python3.10/site-packages/altair/vegalite/v5/data.py +41 -0
  40. vllm/lib/python3.10/site-packages/pandas/__pycache__/__init__.cpython-310.pyc +0 -0
  41. vllm/lib/python3.10/site-packages/pandas/__pycache__/_typing.cpython-310.pyc +0 -0
  42. vllm/lib/python3.10/site-packages/pandas/__pycache__/_version.cpython-310.pyc +0 -0
  43. vllm/lib/python3.10/site-packages/pandas/__pycache__/_version_meson.cpython-310.pyc +0 -0
  44. vllm/lib/python3.10/site-packages/pandas/__pycache__/conftest.cpython-310.pyc +0 -0
  45. vllm/lib/python3.10/site-packages/pandas/__pycache__/testing.cpython-310.pyc +0 -0
  46. vllm/lib/python3.10/site-packages/pandas/_config/__init__.py +57 -0
  47. vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/__init__.cpython-310.pyc +0 -0
  48. vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/config.cpython-310.pyc +0 -0
  49. vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/dates.cpython-310.pyc +0 -0
  50. vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/display.cpython-310.pyc +0 -0
.gitattributes CHANGED
@@ -968,3 +968,4 @@ openflamingo/lib/python3.10/site-packages/3204bda914b7f2c6f497__mypyc.cpython-31
968
  parrot/lib/python3.10/html/__pycache__/entities.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
969
  vllm/lib/python3.10/site-packages/pandas/tests/io/__pycache__/test_sql.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
970
  vllm/lib/python3.10/site-packages/pandas/tests/indexing/__pycache__/test_loc.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
 
 
968
  parrot/lib/python3.10/html/__pycache__/entities.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
969
  vllm/lib/python3.10/site-packages/pandas/tests/io/__pycache__/test_sql.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
970
  vllm/lib/python3.10/site-packages/pandas/tests/indexing/__pycache__/test_loc.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
971
+ vllm/lib/python3.10/site-packages/pandas/tests/tools/__pycache__/test_to_datetime.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
parrot/share/terminfo/r/regent20 ADDED
Binary file (394 Bytes). View file
 
parrot/share/terminfo/r/regent40 ADDED
Binary file (500 Bytes). View file
 
parrot/share/terminfo/s/screen-256color-bce-s ADDED
Binary file (1.79 kB). View file
 
parrot/share/terminfo/s/screen.rxvt ADDED
Binary file (2.25 kB). View file
 
parrot/share/terminfo/s/sun-cmd ADDED
Binary file (1.03 kB). View file
 
parrot/share/terminfo/t/teken-vt ADDED
Binary file (1.45 kB). View file
 
parrot/share/terminfo/t/tty5620-34 ADDED
Binary file (632 Bytes). View file
 
parrot/share/terminfo/t/tvi912c-vb-p ADDED
Binary file (1.33 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (874 Bytes). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_dfi_types.cpython-310.pyc ADDED
Binary file (6.7 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_importers.cpython-310.pyc ADDED
Binary file (3.29 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_show.cpython-310.pyc ADDED
Binary file (2.44 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_transformed_data.cpython-310.pyc ADDED
Binary file (13.8 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/_vegafusion_data.cpython-310.pyc ADDED
Binary file (7.54 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/compiler.cpython-310.pyc ADDED
Binary file (538 Bytes). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/core.cpython-310.pyc ADDED
Binary file (24.2 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/data.cpython-310.pyc ADDED
Binary file (12 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/deprecation.cpython-310.pyc ADDED
Binary file (3.57 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/display.cpython-310.pyc ADDED
Binary file (8.33 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/execeval.cpython-310.pyc ADDED
Binary file (1.78 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/html.cpython-310.pyc ADDED
Binary file (9.49 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/mimebundle.cpython-310.pyc ADDED
Binary file (8.92 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/plugin_registry.cpython-310.pyc ADDED
Binary file (9.75 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/save.cpython-310.pyc ADDED
Binary file (6.43 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/schemapi.cpython-310.pyc ADDED
Binary file (43.5 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/selection.cpython-310.pyc ADDED
Binary file (4.43 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/server.cpython-310.pyc ADDED
Binary file (5 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/__pycache__/theme.cpython-310.pyc ADDED
Binary file (1.84 kB). View file
 
videollama2/lib/python3.10/site-packages/altair/utils/mimebundle.py ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import struct
4
+ from typing import Any, Literal, cast, overload
5
+ from typing_extensions import TypeAlias
6
+
7
+ from ._importers import import_vl_convert, vl_version_for_vl_convert
8
+ from .html import spec_to_html
9
+
10
+ MimeBundleFormat: TypeAlias = Literal[
11
+ "html", "json", "png", "svg", "pdf", "vega", "vega-lite"
12
+ ]
13
+
14
+
15
+ @overload
16
+ def spec_to_mimebundle(
17
+ spec: dict[str, Any],
18
+ format: Literal["json", "vega-lite"],
19
+ mode: Literal["vega-lite"] | None = ...,
20
+ vega_version: str | None = ...,
21
+ vegaembed_version: str | None = ...,
22
+ vegalite_version: str | None = ...,
23
+ embed_options: dict[str, Any] | None = ...,
24
+ engine: Literal["vl-convert"] | None = ...,
25
+ **kwargs,
26
+ ) -> dict[str, dict[str, Any]]: ...
27
+ @overload
28
+ def spec_to_mimebundle(
29
+ spec: dict[str, Any],
30
+ format: Literal["html"],
31
+ mode: Literal["vega-lite"] | None = ...,
32
+ vega_version: str | None = ...,
33
+ vegaembed_version: str | None = ...,
34
+ vegalite_version: str | None = ...,
35
+ embed_options: dict[str, Any] | None = ...,
36
+ engine: Literal["vl-convert"] | None = ...,
37
+ **kwargs,
38
+ ) -> dict[str, str]: ...
39
+ @overload
40
+ def spec_to_mimebundle(
41
+ spec: dict[str, Any],
42
+ format: Literal["pdf", "svg", "vega"],
43
+ mode: Literal["vega-lite"] | None = ...,
44
+ vega_version: str | None = ...,
45
+ vegaembed_version: str | None = ...,
46
+ vegalite_version: str | None = ...,
47
+ embed_options: dict[str, Any] | None = ...,
48
+ engine: Literal["vl-convert"] | None = ...,
49
+ **kwargs,
50
+ ) -> dict[str, Any]: ...
51
+ @overload
52
+ def spec_to_mimebundle(
53
+ spec: dict[str, Any],
54
+ format: Literal["png"],
55
+ mode: Literal["vega-lite"] | None = ...,
56
+ vega_version: str | None = ...,
57
+ vegaembed_version: str | None = ...,
58
+ vegalite_version: str | None = ...,
59
+ embed_options: dict[str, Any] | None = ...,
60
+ engine: Literal["vl-convert"] | None = ...,
61
+ **kwargs,
62
+ ) -> tuple[dict[str, Any], dict[str, Any]]: ...
63
+ def spec_to_mimebundle(
64
+ spec: dict[str, Any],
65
+ format: MimeBundleFormat,
66
+ mode: Literal["vega-lite"] | None = None,
67
+ vega_version: str | None = None,
68
+ vegaembed_version: str | None = None,
69
+ vegalite_version: str | None = None,
70
+ embed_options: dict[str, Any] | None = None,
71
+ engine: Literal["vl-convert"] | None = None,
72
+ **kwargs,
73
+ ) -> dict[str, Any] | tuple[dict[str, Any], dict[str, Any]]:
74
+ """
75
+ Convert a vega-lite specification to a mimebundle.
76
+
77
+ The mimebundle type is controlled by the ``format`` argument, which can be
78
+ one of the following ['html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite']
79
+
80
+ Parameters
81
+ ----------
82
+ spec : dict
83
+ a dictionary representing a vega-lite plot spec
84
+ format : string {'html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite'}
85
+ the file format to be saved.
86
+ mode : string {'vega-lite'}
87
+ The rendering mode.
88
+ vega_version : string
89
+ The version of vega.js to use
90
+ vegaembed_version : string
91
+ The version of vegaembed.js to use
92
+ vegalite_version : string
93
+ The version of vegalite.js to use. Only required if mode=='vega-lite'
94
+ embed_options : dict (optional)
95
+ The vegaEmbed options dictionary. Defaults to the embed options set with
96
+ alt.renderers.set_embed_options().
97
+ (See https://github.com/vega/vega-embed for details)
98
+ engine: string {'vl-convert'}
99
+ the conversion engine to use for 'png', 'svg', 'pdf', and 'vega' formats
100
+ **kwargs :
101
+ Additional arguments will be passed to the generating function
102
+
103
+ Returns
104
+ -------
105
+ output : dict
106
+ a mime-bundle representing the image
107
+
108
+ Note
109
+ ----
110
+ The png, svg, pdf, and vega outputs require the vl-convert package
111
+ """
112
+ # Local import to avoid circular ImportError
113
+ from altair import renderers
114
+ from altair.utils.display import compile_with_vegafusion, using_vegafusion
115
+
116
+ if mode != "vega-lite":
117
+ msg = "mode must be 'vega-lite'"
118
+ raise ValueError(msg)
119
+
120
+ internal_mode: Literal["vega-lite", "vega"] = mode
121
+ if using_vegafusion():
122
+ spec = compile_with_vegafusion(spec)
123
+ internal_mode = "vega"
124
+
125
+ # Default to the embed options set by alt.renderers.set_embed_options
126
+ if embed_options is None:
127
+ final_embed_options = renderers.options.get("embed_options", {})
128
+ else:
129
+ final_embed_options = embed_options
130
+
131
+ embed_options = preprocess_embed_options(final_embed_options)
132
+
133
+ if format in {"png", "svg", "pdf", "vega"}:
134
+ return _spec_to_mimebundle_with_engine(
135
+ spec,
136
+ cast(Literal["png", "svg", "pdf", "vega"], format),
137
+ internal_mode,
138
+ engine=engine,
139
+ format_locale=embed_options.get("formatLocale", None),
140
+ time_format_locale=embed_options.get("timeFormatLocale", None),
141
+ **kwargs,
142
+ )
143
+ elif format == "html":
144
+ html = spec_to_html(
145
+ spec,
146
+ mode=internal_mode,
147
+ vega_version=vega_version,
148
+ vegaembed_version=vegaembed_version,
149
+ vegalite_version=vegalite_version,
150
+ embed_options=embed_options,
151
+ **kwargs,
152
+ )
153
+ return {"text/html": html}
154
+ elif format == "vega-lite":
155
+ if vegalite_version is None:
156
+ msg = "Must specify vegalite_version"
157
+ raise ValueError(msg)
158
+ return {f"application/vnd.vegalite.v{vegalite_version[0]}+json": spec}
159
+ elif format == "json":
160
+ return {"application/json": spec}
161
+ else:
162
+ msg = (
163
+ "format must be one of "
164
+ "['html', 'json', 'png', 'svg', 'pdf', 'vega', 'vega-lite']"
165
+ )
166
+ raise ValueError(msg)
167
+
168
+
169
+ def _spec_to_mimebundle_with_engine(
170
+ spec: dict,
171
+ format: Literal["png", "svg", "pdf", "vega"],
172
+ mode: Literal["vega-lite", "vega"],
173
+ format_locale: str | dict | None = None,
174
+ time_format_locale: str | dict | None = None,
175
+ **kwargs,
176
+ ) -> Any:
177
+ """
178
+ Helper for Vega-Lite to mimebundle conversions that require an engine.
179
+
180
+ Parameters
181
+ ----------
182
+ spec : dict
183
+ a dictionary representing a vega-lite plot spec
184
+ format : string {'png', 'svg', 'pdf', 'vega'}
185
+ the format of the mimebundle to be returned
186
+ mode : string {'vega-lite', 'vega'}
187
+ The rendering mode.
188
+ engine: string {'vl-convert'}
189
+ the conversion engine to use
190
+ format_locale : str or dict
191
+ d3-format locale name or dictionary. Defaults to "en-US" for United States English.
192
+ See https://github.com/d3/d3-format/tree/main/locale for available names and example
193
+ definitions.
194
+ time_format_locale : str or dict
195
+ d3-time-format locale name or dictionary. Defaults to "en-US" for United States English.
196
+ See https://github.com/d3/d3-time-format/tree/main/locale for available names and example
197
+ definitions.
198
+ **kwargs :
199
+ Additional arguments will be passed to the conversion function
200
+ """
201
+ # Normalize the engine string (if any) by lower casing
202
+ # and removing underscores and hyphens
203
+ engine = kwargs.pop("engine", None)
204
+ normalized_engine = _validate_normalize_engine(engine, format)
205
+
206
+ if normalized_engine == "vlconvert":
207
+ vlc = import_vl_convert()
208
+ vl_version = vl_version_for_vl_convert()
209
+ if format == "vega":
210
+ if mode == "vega":
211
+ vg = spec
212
+ else:
213
+ vg = vlc.vegalite_to_vega(spec, vl_version=vl_version)
214
+ return {"application/vnd.vega.v5+json": vg}
215
+ elif format == "svg":
216
+ if mode == "vega":
217
+ svg = vlc.vega_to_svg(
218
+ spec,
219
+ format_locale=format_locale,
220
+ time_format_locale=time_format_locale,
221
+ )
222
+ else:
223
+ svg = vlc.vegalite_to_svg(
224
+ spec,
225
+ vl_version=vl_version,
226
+ format_locale=format_locale,
227
+ time_format_locale=time_format_locale,
228
+ )
229
+ return {"image/svg+xml": svg}
230
+ elif format == "png":
231
+ scale = kwargs.get("scale_factor", 1)
232
+ # The default ppi for a PNG file is 72
233
+ default_ppi = 72
234
+ ppi = kwargs.get("ppi", default_ppi)
235
+ if mode == "vega":
236
+ png = vlc.vega_to_png(
237
+ spec,
238
+ scale=scale,
239
+ ppi=ppi,
240
+ format_locale=format_locale,
241
+ time_format_locale=time_format_locale,
242
+ )
243
+ else:
244
+ png = vlc.vegalite_to_png(
245
+ spec,
246
+ vl_version=vl_version,
247
+ scale=scale,
248
+ ppi=ppi,
249
+ format_locale=format_locale,
250
+ time_format_locale=time_format_locale,
251
+ )
252
+ factor = ppi / default_ppi
253
+ w, h = _pngxy(png)
254
+ return {"image/png": png}, {
255
+ "image/png": {"width": w / factor, "height": h / factor}
256
+ }
257
+ elif format == "pdf":
258
+ scale = kwargs.get("scale_factor", 1)
259
+ if mode == "vega":
260
+ pdf = vlc.vega_to_pdf(
261
+ spec,
262
+ scale=scale,
263
+ format_locale=format_locale,
264
+ time_format_locale=time_format_locale,
265
+ )
266
+ else:
267
+ pdf = vlc.vegalite_to_pdf(
268
+ spec,
269
+ vl_version=vl_version,
270
+ scale=scale,
271
+ format_locale=format_locale,
272
+ time_format_locale=time_format_locale,
273
+ )
274
+ return {"application/pdf": pdf}
275
+ else:
276
+ # This should be validated above
277
+ # but raise exception for the sake of future development
278
+ msg = f"Unexpected format {format!r}"
279
+ raise ValueError(msg)
280
+ else:
281
+ # This should be validated above
282
+ # but raise exception for the sake of future development
283
+ msg = f"Unexpected normalized_engine {normalized_engine!r}"
284
+ raise ValueError(msg)
285
+
286
+
287
+ def _validate_normalize_engine(
288
+ engine: Literal["vl-convert"] | None,
289
+ format: Literal["png", "svg", "pdf", "vega"],
290
+ ) -> str:
291
+ """
292
+ Helper to validate and normalize the user-provided engine.
293
+
294
+ engine : {None, 'vl-convert'}
295
+ the user-provided engine string
296
+ format : string {'png', 'svg', 'pdf', 'vega'}
297
+ the format of the mimebundle to be returned
298
+ """
299
+ # Try to import vl_convert
300
+ try:
301
+ vlc = import_vl_convert()
302
+ except ImportError:
303
+ vlc = None
304
+
305
+ # Normalize engine string by lower casing and removing underscores and hyphens
306
+ normalized_engine = (
307
+ None if engine is None else engine.lower().replace("-", "").replace("_", "")
308
+ )
309
+
310
+ # Validate or infer default value of normalized_engine
311
+ if normalized_engine == "vlconvert":
312
+ if vlc is None:
313
+ msg = "The 'vl-convert' conversion engine requires the vl-convert-python package"
314
+ raise ValueError(msg)
315
+ elif normalized_engine is None:
316
+ if vlc is not None:
317
+ normalized_engine = "vlconvert"
318
+ else:
319
+ msg = (
320
+ f"Saving charts in {format!r} format requires the vl-convert-python package: "
321
+ "see https://altair-viz.github.io/user_guide/saving_charts.html#png-svg-and-pdf-format"
322
+ )
323
+ raise ValueError(msg)
324
+ else:
325
+ msg = f"Invalid conversion engine {engine!r}. Expected vl-convert"
326
+ raise ValueError(msg)
327
+ return normalized_engine
328
+
329
+
330
+ def _pngxy(data):
331
+ """
332
+ read the (width, height) from a PNG header.
333
+
334
+ Taken from IPython.display
335
+ """
336
+ ihdr = data.index(b"IHDR")
337
+ # next 8 bytes are width/height
338
+ return struct.unpack(">ii", data[ihdr + 4 : ihdr + 12])
339
+
340
+
341
+ def preprocess_embed_options(embed_options: dict) -> dict:
342
+ """
343
+ Preprocess embed options to a form compatible with Vega Embed.
344
+
345
+ Parameters
346
+ ----------
347
+ embed_options : dict
348
+ The embed options dictionary to preprocess.
349
+
350
+ Returns
351
+ -------
352
+ embed_opts : dict
353
+ The preprocessed embed options dictionary.
354
+ """
355
+ embed_options = (embed_options or {}).copy()
356
+
357
+ # Convert locale strings to objects compatible with Vega Embed using vl-convert
358
+ format_locale = embed_options.get("formatLocale", None)
359
+ if isinstance(format_locale, str):
360
+ vlc = import_vl_convert()
361
+ embed_options["formatLocale"] = vlc.get_format_locale(format_locale)
362
+
363
+ time_format_locale = embed_options.get("timeFormatLocale", None)
364
+ if isinstance(time_format_locale, str):
365
+ vlc = import_vl_convert()
366
+ embed_options["timeFormatLocale"] = vlc.get_time_format_locale(
367
+ time_format_locale
368
+ )
369
+
370
+ return embed_options
videollama2/lib/python3.10/site-packages/altair/vegalite/__init__.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # ruff: noqa: F403
2
+ from .v5 import *
videollama2/lib/python3.10/site-packages/altair/vegalite/api.py ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # ruff: noqa
2
+ from .v5.api import *
videollama2/lib/python3.10/site-packages/altair/vegalite/data.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Callable, overload
4
+
5
+ from altair.utils.core import sanitize_pandas_dataframe
6
+ from altair.utils.data import DataTransformerRegistry as _DataTransformerRegistry
7
+ from altair.utils.data import (
8
+ MaxRowsError,
9
+ check_data_type,
10
+ limit_rows,
11
+ sample,
12
+ to_csv,
13
+ to_json,
14
+ to_values,
15
+ )
16
+
17
+ if TYPE_CHECKING:
18
+ from altair.utils.data import DataType, ToValuesReturnType
19
+ from altair.utils.plugin_registry import PluginEnabler
20
+
21
+
22
+ @overload
23
+ def default_data_transformer(
24
+ data: None = ..., max_rows: int = ...
25
+ ) -> Callable[[DataType], ToValuesReturnType]: ...
26
+ @overload
27
+ def default_data_transformer(
28
+ data: DataType, max_rows: int = ...
29
+ ) -> ToValuesReturnType: ...
30
+ def default_data_transformer(
31
+ data: DataType | None = None, max_rows: int = 5000
32
+ ) -> Callable[[DataType], ToValuesReturnType] | ToValuesReturnType:
33
+ if data is None:
34
+
35
+ def pipe(data: DataType, /) -> ToValuesReturnType:
36
+ data = limit_rows(data, max_rows=max_rows)
37
+ return to_values(data)
38
+
39
+ return pipe
40
+
41
+ else:
42
+ return to_values(limit_rows(data, max_rows=max_rows))
43
+
44
+
45
+ class DataTransformerRegistry(_DataTransformerRegistry):
46
+ def disable_max_rows(self) -> PluginEnabler:
47
+ """Disable the MaxRowsError."""
48
+ options = self.options
49
+ if self.active in {"default", "vegafusion"}:
50
+ options = options.copy()
51
+ options["max_rows"] = None
52
+ return self.enable(**options)
53
+
54
+
55
+ __all__ = (
56
+ "DataTransformerRegistry",
57
+ "MaxRowsError",
58
+ "check_data_type",
59
+ "default_data_transformer",
60
+ "limit_rows",
61
+ "sample",
62
+ "sanitize_pandas_dataframe",
63
+ "to_csv",
64
+ "to_json",
65
+ "to_values",
66
+ )
videollama2/lib/python3.10/site-packages/altair/vegalite/display.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from altair.utils.display import (
2
+ DefaultRendererReturnType,
3
+ Displayable,
4
+ HTMLRenderer,
5
+ RendererRegistry,
6
+ default_renderer_base,
7
+ json_renderer_base,
8
+ )
9
+
10
+ __all__ = (
11
+ "DefaultRendererReturnType",
12
+ "Displayable",
13
+ "HTMLRenderer",
14
+ "RendererRegistry",
15
+ "default_renderer_base",
16
+ "json_renderer_base",
17
+ )
videollama2/lib/python3.10/site-packages/altair/vegalite/schema.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ """Altair schema wrappers."""
2
+
3
+ # ruff: noqa: F403
4
+ from .v5.schema import *
videollama2/lib/python3.10/site-packages/altair/vegalite/v5/__init__.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ruff: noqa: F401, F403
2
+ from altair.expr.core import datum
3
+
4
+ from .api import *
5
+ from .compiler import vegalite_compilers
6
+ from .data import (
7
+ MaxRowsError,
8
+ data_transformers,
9
+ default_data_transformer,
10
+ limit_rows,
11
+ sample,
12
+ to_csv,
13
+ to_json,
14
+ to_values,
15
+ )
16
+ from .display import (
17
+ VEGA_VERSION,
18
+ VEGAEMBED_VERSION,
19
+ VEGALITE_VERSION,
20
+ VegaLite,
21
+ renderers,
22
+ )
23
+ from .schema import *
24
+ from .theme import themes
videollama2/lib/python3.10/site-packages/altair/vegalite/v5/api.py ADDED
The diff for this file is too large to render. See raw diff
 
videollama2/lib/python3.10/site-packages/altair/vegalite/v5/compiler.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Final
2
+
3
+ from altair.utils._importers import import_vl_convert
4
+ from altair.utils.compiler import VegaLiteCompilerRegistry
5
+
6
+ ENTRY_POINT_GROUP: Final = "altair.vegalite.v5.vegalite_compiler"
7
+ vegalite_compilers = VegaLiteCompilerRegistry(entry_point_group=ENTRY_POINT_GROUP)
8
+
9
+
10
+ def vl_convert_compiler(vegalite_spec: dict) -> dict:
11
+ """Vega-Lite to Vega compiler that uses vl-convert."""
12
+ from . import SCHEMA_VERSION
13
+
14
+ vlc = import_vl_convert()
15
+
16
+ # Compute vl-convert's vl_version string (of the form 'v5_8')
17
+ # from SCHEMA_VERSION (of the form 'v5.8.0')
18
+ vl_version = "_".join(SCHEMA_VERSION.split(".")[:2])
19
+ return vlc.vegalite_to_vega(vegalite_spec, vl_version=vl_version)
20
+
21
+
22
+ vegalite_compilers.register("vl-convert", vl_convert_compiler)
23
+ vegalite_compilers.enable("vl-convert")
videollama2/lib/python3.10/site-packages/altair/vegalite/v5/data.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Final
2
+
3
+ from altair.utils._vegafusion_data import vegafusion_data_transformer
4
+ from altair.vegalite.data import (
5
+ DataTransformerRegistry,
6
+ MaxRowsError,
7
+ default_data_transformer,
8
+ limit_rows,
9
+ sample,
10
+ to_csv,
11
+ to_json,
12
+ to_values,
13
+ )
14
+
15
+ # ==============================================================================
16
+ # VegaLite 5 data transformers
17
+ # ==============================================================================
18
+
19
+
20
+ ENTRY_POINT_GROUP: Final = "altair.vegalite.v5.data_transformer"
21
+
22
+
23
+ data_transformers = DataTransformerRegistry(entry_point_group=ENTRY_POINT_GROUP)
24
+ data_transformers.register("default", default_data_transformer)
25
+ data_transformers.register("json", to_json)
26
+ # FIXME: `to_csv` cannot accept all `DataType` https://github.com/vega/altair/issues/3441
27
+ data_transformers.register("csv", to_csv) # type: ignore[arg-type]
28
+ data_transformers.register("vegafusion", vegafusion_data_transformer)
29
+ data_transformers.enable("default")
30
+
31
+
32
+ __all__ = (
33
+ "MaxRowsError",
34
+ "default_data_transformer",
35
+ "limit_rows",
36
+ "sample",
37
+ "to_csv",
38
+ "to_json",
39
+ "to_values",
40
+ "vegafusion_data_transformer",
41
+ )
vllm/lib/python3.10/site-packages/pandas/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (6.95 kB). View file
 
vllm/lib/python3.10/site-packages/pandas/__pycache__/_typing.cpython-310.pyc ADDED
Binary file (11.5 kB). View file
 
vllm/lib/python3.10/site-packages/pandas/__pycache__/_version.cpython-310.pyc ADDED
Binary file (14.5 kB). View file
 
vllm/lib/python3.10/site-packages/pandas/__pycache__/_version_meson.cpython-310.pyc ADDED
Binary file (248 Bytes). View file
 
vllm/lib/python3.10/site-packages/pandas/__pycache__/conftest.cpython-310.pyc ADDED
Binary file (46.1 kB). View file
 
vllm/lib/python3.10/site-packages/pandas/__pycache__/testing.cpython-310.pyc ADDED
Binary file (404 Bytes). View file
 
vllm/lib/python3.10/site-packages/pandas/_config/__init__.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ pandas._config is considered explicitly upstream of everything else in pandas,
3
+ should have no intra-pandas dependencies.
4
+
5
+ importing `dates` and `display` ensures that keys needed by _libs
6
+ are initialized.
7
+ """
8
+ __all__ = [
9
+ "config",
10
+ "detect_console_encoding",
11
+ "get_option",
12
+ "set_option",
13
+ "reset_option",
14
+ "describe_option",
15
+ "option_context",
16
+ "options",
17
+ "using_copy_on_write",
18
+ "warn_copy_on_write",
19
+ ]
20
+ from pandas._config import config
21
+ from pandas._config import dates # pyright: ignore[reportUnusedImport] # noqa: F401
22
+ from pandas._config.config import (
23
+ _global_config,
24
+ describe_option,
25
+ get_option,
26
+ option_context,
27
+ options,
28
+ reset_option,
29
+ set_option,
30
+ )
31
+ from pandas._config.display import detect_console_encoding
32
+
33
+
34
+ def using_copy_on_write() -> bool:
35
+ _mode_options = _global_config["mode"]
36
+ return (
37
+ _mode_options["copy_on_write"] is True
38
+ and _mode_options["data_manager"] == "block"
39
+ )
40
+
41
+
42
+ def warn_copy_on_write() -> bool:
43
+ _mode_options = _global_config["mode"]
44
+ return (
45
+ _mode_options["copy_on_write"] == "warn"
46
+ and _mode_options["data_manager"] == "block"
47
+ )
48
+
49
+
50
+ def using_nullable_dtypes() -> bool:
51
+ _mode_options = _global_config["mode"]
52
+ return _mode_options["nullable_dtypes"]
53
+
54
+
55
+ def using_pyarrow_string_dtype() -> bool:
56
+ _mode_options = _global_config["future"]
57
+ return _mode_options["infer_string"]
vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (1.49 kB). View file
 
vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/config.cpython-310.pyc ADDED
Binary file (26.4 kB). View file
 
vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/dates.cpython-310.pyc ADDED
Binary file (730 Bytes). View file
 
vllm/lib/python3.10/site-packages/pandas/_config/__pycache__/display.cpython-310.pyc ADDED
Binary file (1.38 kB). View file