anyscale 0.26.9__py3-none-any.whl → 0.26.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. anyscale/anyscale_halo/LICENSE +21 -0
  2. anyscale/anyscale_halo/README.md +1 -0
  3. anyscale/anyscale_halo/__init__.py +10 -0
  4. anyscale/anyscale_halo/_utils.py +148 -0
  5. anyscale/anyscale_halo/cursor.py +48 -0
  6. anyscale/anyscale_halo/halo.py +609 -0
  7. anyscale/anyscale_halo/halo_notebook.py +122 -0
  8. anyscale/cli_logger.py +1 -1
  9. anyscale/client/README.md +0 -35
  10. anyscale/client/openapi_client/__init__.py +0 -28
  11. anyscale/client/openapi_client/api/default_api.py +107 -878
  12. anyscale/client/openapi_client/models/__init__.py +0 -28
  13. anyscale/version.py +1 -1
  14. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/METADATA +5 -2
  15. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/RECORD +20 -41
  16. anyscale/client/openapi_client/models/card.py +0 -181
  17. anyscale/client/openapi_client/models/card_id.py +0 -108
  18. anyscale/client/openapi_client/models/card_list_response.py +0 -147
  19. anyscale/client/openapi_client/models/cluster_features.py +0 -152
  20. anyscale/client/openapi_client/models/clusterfeatures_response.py +0 -121
  21. anyscale/client/openapi_client/models/dismissal_type.py +0 -100
  22. anyscale/client/openapi_client/models/feature_compatibility.py +0 -152
  23. anyscale/client/openapi_client/models/onboarding_user_cards_query.py +0 -122
  24. anyscale/client/openapi_client/models/project_collaborators_put_message.py +0 -121
  25. anyscale/client/openapi_client/models/project_create_message.py +0 -148
  26. anyscale/client/openapi_client/models/project_delete_message.py +0 -121
  27. anyscale/client/openapi_client/models/project_patch_message.py +0 -121
  28. anyscale/client/openapi_client/models/session_autosync_sessions_update_message.py +0 -121
  29. anyscale/client/openapi_client/models/session_create_message.py +0 -148
  30. anyscale/client/openapi_client/models/session_delete_message.py +0 -121
  31. anyscale/client/openapi_client/models/session_execute_message.py +0 -121
  32. anyscale/client/openapi_client/models/session_finish_command_message.py +0 -175
  33. anyscale/client/openapi_client/models/session_kill_command_message.py +0 -121
  34. anyscale/client/openapi_client/models/session_patch_message.py +0 -121
  35. anyscale/client/openapi_client/models/session_state_change_message.py +0 -121
  36. anyscale/client/openapi_client/models/snapshot_create_message.py +0 -148
  37. anyscale/client/openapi_client/models/snapshot_delete_message.py +0 -148
  38. anyscale/client/openapi_client/models/snapshot_patch_message.py +0 -148
  39. anyscale/client/openapi_client/models/socket_message_schemas.py +0 -499
  40. anyscale/client/openapi_client/models/socket_message_types.py +0 -113
  41. anyscale/client/openapi_client/models/socketmessageschemas_response.py +0 -121
  42. anyscale/client/openapi_client/models/socketmessagetypes_response.py +0 -121
  43. anyscale/client/openapi_client/models/visibility.py +0 -100
  44. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/LICENSE +0 -0
  45. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/NOTICE +0 -0
  46. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/WHEEL +0 -0
  47. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/entry_points.txt +0 -0
  48. {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Manraj Singh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ source code copied out from halo==0.0.31
@@ -0,0 +1,10 @@
1
+ # -*- coding: utf-8 -*-
2
+ __author__ = 'Manraj Singh'
3
+ __email__ = 'manrajsinghgrover@gmail.com'
4
+
5
+ import logging
6
+
7
+ from .halo import Halo
8
+ from .halo_notebook import HaloNotebook
9
+
10
+ logging.getLogger(__name__).addHandler(logging.NullHandler())
@@ -0,0 +1,148 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Utilities for Halo library.
3
+ """
4
+ import codecs
5
+ import platform
6
+ from shutil import get_terminal_size
7
+
8
+ from colorama import init
9
+ from termcolor import colored
10
+
11
+ init(autoreset=True)
12
+
13
+
14
+ def is_supported():
15
+ """Check whether operating system supports main symbols or not.
16
+
17
+ Returns
18
+ -------
19
+ boolean
20
+ Whether operating system supports main symbols or not
21
+ """
22
+
23
+ os_arch = platform.system()
24
+
25
+ if os_arch != 'Windows':
26
+ return True
27
+
28
+ return False
29
+
30
+
31
+ def get_environment():
32
+ """Get the environment in which halo is running
33
+
34
+ Returns
35
+ -------
36
+ str
37
+ Environment name
38
+ """
39
+ try:
40
+ from IPython import get_ipython
41
+ except ImportError:
42
+ return 'terminal'
43
+
44
+ try:
45
+ shell = get_ipython().__class__.__name__
46
+
47
+ if shell == 'ZMQInteractiveShell': # Jupyter notebook or qtconsole
48
+ return 'jupyter'
49
+ elif shell == 'TerminalInteractiveShell': # Terminal running IPython
50
+ return 'ipython'
51
+ else:
52
+ return 'terminal' # Other type (?)
53
+
54
+ except NameError:
55
+ return 'terminal'
56
+
57
+
58
+ def colored_frame(frame, color):
59
+ """Color the frame with given color and returns.
60
+
61
+ Parameters
62
+ ----------
63
+ frame : str
64
+ Frame to be colored
65
+ color : str
66
+ Color to be applied
67
+
68
+ Returns
69
+ -------
70
+ str
71
+ Colored frame
72
+ """
73
+ return colored(frame, color, attrs=['bold'])
74
+
75
+
76
+ def is_text_type(text):
77
+ """Check if given parameter is a string or not
78
+
79
+ Parameters
80
+ ----------
81
+ text : *
82
+ Parameter to be checked for text type
83
+
84
+ Returns
85
+ -------
86
+ bool
87
+ Whether parameter is a string or not
88
+ """
89
+ if isinstance(text, str):
90
+ return True
91
+
92
+ return False
93
+
94
+
95
+ def decode_utf_8_text(text):
96
+ """Decode the text from utf-8 format
97
+
98
+ Parameters
99
+ ----------
100
+ text : str
101
+ String to be decoded
102
+
103
+ Returns
104
+ -------
105
+ str
106
+ Decoded string
107
+ """
108
+ try:
109
+ return codecs.decode(text, 'utf-8')
110
+ except (TypeError, ValueError):
111
+ return text
112
+
113
+
114
+ def encode_utf_8_text(text):
115
+ """Encodes the text to utf-8 format
116
+
117
+ Parameters
118
+ ----------
119
+ text : str
120
+ String to be encoded
121
+
122
+ Returns
123
+ -------
124
+ str
125
+ Encoded string
126
+ """
127
+ try:
128
+ return codecs.encode(text, 'utf-8', 'ignore')
129
+ except (TypeError, ValueError):
130
+ return text
131
+
132
+
133
+ def get_terminal_columns():
134
+ """Determine the amount of available columns in the terminal
135
+
136
+ Returns
137
+ -------
138
+ int
139
+ Terminal width
140
+ """
141
+ terminal_size = get_terminal_size()
142
+
143
+ # If column size is 0 either we are not connected
144
+ # to a terminal or something else went wrong. Fallback to 80.
145
+ if terminal_size.columns == 0:
146
+ return 80
147
+ else:
148
+ return terminal_size.columns
@@ -0,0 +1,48 @@
1
+ """
2
+ Source: https://stackoverflow.com/a/10455937/2692667
3
+ """
4
+
5
+ import sys
6
+ import os
7
+
8
+ if os.name == "nt":
9
+ import ctypes
10
+
11
+ class _CursorInfo(ctypes.Structure):
12
+ _fields_ = [("size", ctypes.c_int), ("visible", ctypes.c_byte)]
13
+
14
+
15
+ def hide(stream=sys.stdout):
16
+ """Hide cursor.
17
+ Parameters
18
+ ----------
19
+ stream: sys.stdout, Optional
20
+ Defines stream to write output to.
21
+ """
22
+ if os.name == "nt":
23
+ ci = _CursorInfo()
24
+ handle = ctypes.windll.kernel32.GetStdHandle(-11)
25
+ ctypes.windll.kernel32.GetConsoleCursorInfo(handle, ctypes.byref(ci))
26
+ ci.visible = False
27
+ ctypes.windll.kernel32.SetConsoleCursorInfo(handle, ctypes.byref(ci))
28
+ elif os.name == "posix":
29
+ stream.write("\033[?25l")
30
+ stream.flush()
31
+
32
+
33
+ def show(stream=sys.stdout):
34
+ """Show cursor.
35
+ Parameters
36
+ ----------
37
+ stream: sys.stdout, Optional
38
+ Defines stream to write output to.
39
+ """
40
+ if os.name == "nt":
41
+ ci = _CursorInfo()
42
+ handle = ctypes.windll.kernel32.GetStdHandle(-11)
43
+ ctypes.windll.kernel32.GetConsoleCursorInfo(handle, ctypes.byref(ci))
44
+ ci.visible = True
45
+ ctypes.windll.kernel32.SetConsoleCursorInfo(handle, ctypes.byref(ci))
46
+ elif os.name == "posix":
47
+ stream.write("\033[?25h")
48
+ stream.flush()