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.
- anyscale/anyscale_halo/LICENSE +21 -0
- anyscale/anyscale_halo/README.md +1 -0
- anyscale/anyscale_halo/__init__.py +10 -0
- anyscale/anyscale_halo/_utils.py +148 -0
- anyscale/anyscale_halo/cursor.py +48 -0
- anyscale/anyscale_halo/halo.py +609 -0
- anyscale/anyscale_halo/halo_notebook.py +122 -0
- anyscale/cli_logger.py +1 -1
- anyscale/client/README.md +0 -35
- anyscale/client/openapi_client/__init__.py +0 -28
- anyscale/client/openapi_client/api/default_api.py +107 -878
- anyscale/client/openapi_client/models/__init__.py +0 -28
- anyscale/version.py +1 -1
- {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/METADATA +5 -2
- {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/RECORD +20 -41
- anyscale/client/openapi_client/models/card.py +0 -181
- anyscale/client/openapi_client/models/card_id.py +0 -108
- anyscale/client/openapi_client/models/card_list_response.py +0 -147
- anyscale/client/openapi_client/models/cluster_features.py +0 -152
- anyscale/client/openapi_client/models/clusterfeatures_response.py +0 -121
- anyscale/client/openapi_client/models/dismissal_type.py +0 -100
- anyscale/client/openapi_client/models/feature_compatibility.py +0 -152
- anyscale/client/openapi_client/models/onboarding_user_cards_query.py +0 -122
- anyscale/client/openapi_client/models/project_collaborators_put_message.py +0 -121
- anyscale/client/openapi_client/models/project_create_message.py +0 -148
- anyscale/client/openapi_client/models/project_delete_message.py +0 -121
- anyscale/client/openapi_client/models/project_patch_message.py +0 -121
- anyscale/client/openapi_client/models/session_autosync_sessions_update_message.py +0 -121
- anyscale/client/openapi_client/models/session_create_message.py +0 -148
- anyscale/client/openapi_client/models/session_delete_message.py +0 -121
- anyscale/client/openapi_client/models/session_execute_message.py +0 -121
- anyscale/client/openapi_client/models/session_finish_command_message.py +0 -175
- anyscale/client/openapi_client/models/session_kill_command_message.py +0 -121
- anyscale/client/openapi_client/models/session_patch_message.py +0 -121
- anyscale/client/openapi_client/models/session_state_change_message.py +0 -121
- anyscale/client/openapi_client/models/snapshot_create_message.py +0 -148
- anyscale/client/openapi_client/models/snapshot_delete_message.py +0 -148
- anyscale/client/openapi_client/models/snapshot_patch_message.py +0 -148
- anyscale/client/openapi_client/models/socket_message_schemas.py +0 -499
- anyscale/client/openapi_client/models/socket_message_types.py +0 -113
- anyscale/client/openapi_client/models/socketmessageschemas_response.py +0 -121
- anyscale/client/openapi_client/models/socketmessagetypes_response.py +0 -121
- anyscale/client/openapi_client/models/visibility.py +0 -100
- {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/LICENSE +0 -0
- {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/NOTICE +0 -0
- {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/WHEEL +0 -0
- {anyscale-0.26.9.dist-info → anyscale-0.26.11.dist-info}/entry_points.txt +0 -0
- {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,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()
|