libs5-python 1.0.0__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.
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: libs5-python
3
+ Version: 1.0.0
4
+ Summary: libs5 python scripts, and helper classes (useg e.g. in BEANS software)
5
+ Project-URL: Homepage, https://gitlab.com/ahypki/libs5-python
6
+ Project-URL: Issues, https://gitlab.com/ahypki/libs5-python/-/issues/
7
+ Author: Arkadiusz Hypki
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+
15
+ # libs5-python
16
+
17
+ `libs5-python` is a package with `Python` scripts, and helper classes which are used e.g. in `BEANS` software
18
+
19
+
20
+ ## Installation
21
+
22
+ To install `libs5-python` type in the console:
23
+
24
+ ```
25
+ pip install libs5-python
26
+ ```
27
+
28
+ To upgrade `libs5-python` type in the console:
29
+
30
+ ```
31
+ pip install libs5-python --upgrade
32
+ ```
33
+
34
+ ## Roadmap
35
+
36
+ There is no specific roadmap for `libs5-python`. New features are added if they are needed.
37
+
38
+ ## Contributing
39
+
40
+ Feel free to contribute to this project by sending me your opinion, patches, or requesting some features through gitlab issue system.
41
+
42
+ ## Links
43
+
44
+ Home page: https://gitlab.com/ahypki/libs5-python/
45
+ Issues : https://gitlab.com/ahypki/libs5-python/-/issues/
46
+
47
+ ## License
48
+
49
+ `libs5-python` is released under the MIT license.
@@ -0,0 +1,19 @@
1
+ net/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ net/hypki/Logger.py,sha256=vWzwQ3z_ul_TQHoWkwd6d1p8d5qwWDAXMzCZ6zQo0r8,1530
3
+ net/hypki/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ net/hypki/apiutils.py,sha256=E_0EKQ46BbdTHqVABky8DqIe1WetpglmsPWgnjUGeJQ,1036
5
+ net/hypki/args.py,sha256=syMl5rWOZEWKDfj9nndiIy1NuELj67OQQsU-Xh8s1QI,428
6
+ net/hypki/asserts.py,sha256=awT2uysmbsPFpOBf6vaS0r39QBvsI5QGrwreXk0bwhE,198
7
+ net/hypki/io.py,sha256=H1ImSJojFbVa8Ww1iQ1Nr-sIjz_hEM0HkhMmSkFZEzo,1878
8
+ net/hypki/log.py,sha256=Qlbm1nZVBgs7EXF3Y12upGOU5Mpg0tL5YhJ3e6HGthQ,1730
9
+ net/hypki/math.py,sha256=-ZcIvUcSD5VTtPer6chvrARjL4BKEGqwsgnmAyfld4Q,197
10
+ net/hypki/random.py,sha256=svaPZV2B5DQj_GToIX49pOKxbgdKYY8hmu743Gyvw_c,231
11
+ net/hypki/regex.py,sha256=t80iy6fXiiQOYB1FIjpgpfrLdG2QOwKtRgnrCAn-9Ws,934
12
+ net/hypki/system.py,sha256=9MOAIJ221BH4GR4KKpPXexJGmFaWGZ1_wgi49kaFpmE,558
13
+ net/hypki/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ net/hypki/tests/kepler.py,sha256=3mEdHecMvM_ztUO17ZVvhxIXTze12-xx71A6Y3iaf_M,2307
15
+ net/hypki/tests/numpytest.py,sha256=FAyGjE2u_rqcoXUtj8HP4VbWP2f_LhOJ3hYVp37tDsA,378
16
+ libs5_python-1.0.0.dist-info/METADATA,sha256=G_gusKPyBA1vFBeRtPRU1THLBqdIka1g5jjyMyzijC4,1257
17
+ libs5_python-1.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
18
+ libs5_python-1.0.0.dist-info/licenses/LICENSE,sha256=jUGenC6Eo6P1BkABG3AQ2ThWGSDHgxa58dRIB8iR8Pc,1072
19
+ libs5_python-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Arkadiusz Hypki
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.
net/__init__.py ADDED
File without changes
net/hypki/Logger.py ADDED
@@ -0,0 +1,49 @@
1
+ '''
2
+ Created on Aug 13, 2025
3
+
4
+ @author: ahypki
5
+ '''
6
+ from rich.console import Console
7
+
8
+ console = Console()
9
+
10
+ class Logger:
11
+ BLUE = '[blue]'#'\033[94m'
12
+ BLUE_END = '[/blue]'
13
+ GREEN = '[green]'#'\033[92m'
14
+ GREEN_END = '[/green]'
15
+ RED = '[red]'#'\033[91m'
16
+ RED_END = '[/red]'
17
+ WARNING = '[yellow]'#'\033[93m'
18
+ WARNING_END = '[/yellow]'
19
+ FAIL = RED#'\033[91m'
20
+ FAIL_END = RED_END
21
+ # ENDC = '\033[0m'
22
+
23
+ DEBUG = False
24
+ INFO = True
25
+
26
+ # def blue(s): # @NoSelf
27
+ # return Logger.BLUE + s + Logger.BLUE_END
28
+
29
+ def debug(msg, printLogLevel = True, printNewLine = True): # @NoSelf
30
+ if Logger.DEBUG:
31
+ console.print(("DEBUG " if printLogLevel else '')
32
+ + str(msg),
33
+ end = ('\n' if printNewLine else ''))
34
+
35
+ def info(msg, printLogLevel = True, printNewLine = True): # @NoSelf
36
+ if Logger.INFO:
37
+ console.print(("INFO " if printLogLevel else '')
38
+ + str(msg),
39
+ end = ('\n' if printNewLine else ''))
40
+
41
+ def warn(msg, printLogLevel = True, printNewLine = True): # @NoSelf
42
+ console.print(("WARN " if printLogLevel else '')
43
+ + str(Logger.WARNING + msg + Logger.WARNING_END),
44
+ end = ('\n' if printNewLine else ''))
45
+
46
+ def error(msg, printLogLevel = True, printNewLine = True): # @NoSelf
47
+ console.print(("ERROR " if printLogLevel else '')
48
+ + str(msg),
49
+ end = ('\n' if printNewLine else ''))
net/hypki/__init__.py ADDED
File without changes
net/hypki/apiutils.py ADDED
@@ -0,0 +1,32 @@
1
+ '''
2
+ Created on Aug 15, 2025
3
+
4
+ @author: ahypki
5
+ '''
6
+ import requests
7
+ from requests_toolbelt.multipart.encoder import MultipartEncoder
8
+
9
+ def streamGET(url, params):
10
+ s = requests.Session()
11
+ return s.get(url, params=params, headers=None, stream=True).iter_lines()
12
+ # with s.get(url, params=params, headers=None, stream=True) as resp:
13
+ # for line in resp.iter_lines():
14
+ # if line:
15
+ # print(line)
16
+
17
+ def streamPOST(url, file, params):
18
+ # s = requests.Session()
19
+ # Specify the content type
20
+ # headers = {'Content-Type': 'application/octet-stream'}
21
+ # headers = {'Content-Type': 'multipart/form-data'}
22
+ # return s.post(url, headers=headers, data=stream)
23
+ fields = params
24
+ fields['file'] = (file, open(file, 'rb'), 'text/plain')
25
+ multipart_data = MultipartEncoder(
26
+ fields=fields
27
+ )
28
+ return requests.post(url,
29
+ data=multipart_data,
30
+ headers={'Content-Type': multipart_data.content_type},
31
+ timeout=30)
32
+
net/hypki/args.py ADDED
@@ -0,0 +1,19 @@
1
+ '''
2
+ Created on 15-06-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import sys
8
+
9
+ def getArgString(name, defaultvalue):
10
+ for i in range(len(sys.argv)):
11
+ if sys.argv[i] == "--" + name or sys.argv[i] == "-" + name:
12
+ return sys.argv[i + 1]
13
+ return defaultvalue
14
+
15
+ def isArgPresent(name):
16
+ for i in range(len(sys.argv)):
17
+ if sys.argv[i] == "--" + name or sys.argv[i] == "-" + name:
18
+ return True
19
+ return False
net/hypki/asserts.py ADDED
@@ -0,0 +1,12 @@
1
+ '''
2
+ Created on 15-06-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import sys
8
+ from builtins import Exception
9
+
10
+ def assertTrue(condition, msg):
11
+ if condition is False:
12
+ raise Exception("Assertion failed", msg)
net/hypki/io.py ADDED
@@ -0,0 +1,71 @@
1
+ '''
2
+ Created on 08-05-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import os.path
8
+ import re
9
+ import subprocess
10
+ import sys
11
+ import time
12
+ import urllib.request
13
+ from net.hypki.regex import *
14
+ from net.hypki.log import *
15
+
16
+ def absolutePath(path):
17
+ return os.__path.abspath(path)
18
+
19
+ def findFolders(path):
20
+ dirsAll = []
21
+ for dirName, dirs, files in os.walk(path):
22
+ dirsAll.append(dirName)
23
+ # path = root.split('/')
24
+ # print (len(path) - 1) *'---' , os.path.basename(root)
25
+ # for file in files:
26
+ # print len(path)*'---', file
27
+ return dirsAll
28
+
29
+ def readString( prompt ):
30
+ print(bcolors.OKBLUE + prompt + bcolors.ENDC, end = '', flush = True)
31
+ return sys.stdin.readline().strip()
32
+
33
+ def linux_cmd(cmd, workingDir = None, printImmediatelly = False):
34
+ if printImmediatelly:
35
+ debug("linux cmd: " + cmd);
36
+ result = []
37
+ s = subprocess.Popen(cmd, cwd = workingDir, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
38
+ for line in s.stdout.readlines():
39
+ strLine = str(line).rstrip()
40
+ # if printImmediatelly is False:
41
+ result.append(firstGroup(strLine, 'b\'(.*)\\\\n\''))
42
+ # else:
43
+ if printImmediatelly:
44
+ print(firstGroup(strLine, 'b\'(.*)\\\\n\''))
45
+ return result
46
+
47
+ def linux_cmd_fork(cmd):
48
+ # info("linux cmd fork: " + cmd);
49
+ os.system(cmd)
50
+
51
+ def is_file_exists(path):
52
+ return os.path.exists(path)
53
+
54
+ def url_read(url):
55
+ resp = urllib.request.urlopen(url)
56
+ return resp.read().decode('utf-8')
57
+
58
+ def read_file(path):
59
+ with open(path, 'r') as content_file:
60
+ return content_file.read()
61
+
62
+ def append_to_file(path, line):
63
+ with open(path, 'a') as content_file:
64
+ content_file.write('\n')
65
+ content_file.write(line)
66
+
67
+ def file_save(path, content):
68
+ myFile = open(path, 'w', encoding = 'UTF8')
69
+ myFile.write(content)
70
+ myFile.close()
71
+
net/hypki/log.py ADDED
@@ -0,0 +1,76 @@
1
+ '''
2
+ Created on 08-05-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import os.path
8
+ import re
9
+ import subprocess
10
+ import sys
11
+ import time
12
+ import urllib.request
13
+
14
+ TRACE = False
15
+ DEBUG = True
16
+ INFO = True
17
+
18
+ class bcolors:
19
+ HEADER = '\033[95m'
20
+ OKBLUE = '\033[94m'
21
+ OKGREEN = '\033[92m'
22
+ RED = '\033[91m'
23
+ WARNING = '\033[93m'
24
+ FAIL = '\033[91m'
25
+ ENDC = '\033[0m'
26
+
27
+ def disable(self):
28
+ self.HEADER = ''
29
+ self.OKBLUE = ''
30
+ self.OKGREEN = ''
31
+ self.RED = ''
32
+ self.WARNING = ''
33
+ self.FAIL = ''
34
+ self.ENDC = ''
35
+
36
+ def green( msg ):
37
+ print(bcolors.OKGREEN + str(msg) + bcolors.ENDC)
38
+ return
39
+
40
+ def blue( msg ):
41
+ print(bcolors.OKBLUE + msg + bcolors.ENDC)
42
+ return
43
+
44
+ def red( msg ):
45
+ print(bcolors.RED + msg + bcolors.ENDC)
46
+ return
47
+
48
+ def msg( msg ):
49
+ print(bcolors.OKBLUE + msg + bcolors.ENDC)
50
+ return
51
+
52
+ def trace( parameters ):
53
+ if (TRACE):
54
+ print("TRACE " + parameters)
55
+ return
56
+
57
+ def debug(parameters, printLogLevel = True, printNewLine = True):
58
+ if (DEBUG):
59
+ print(("DEBUG " if printLogLevel else '') + str(parameters), end = ('\n' if printNewLine else ''))
60
+ return
61
+
62
+ def log( parameters ):
63
+ debug(parameters)
64
+
65
+ def info( parameters, printLogLevel = True, printNewLine = True):
66
+ if (INFO):
67
+ print(("INFO " if printLogLevel else '') + str(parameters), end = ('\n' if printNewLine else ''))
68
+ return
69
+
70
+ def warn(parameters, printLogLevel = True, printNewLine = True):
71
+ print(bcolors.WARNING + "WARN " + str(parameters) + bcolors.ENDC)
72
+ return
73
+
74
+ def error( parameters, printLogLevel = True, printNewLine = True, end = '' ):
75
+ print(bcolors.FAIL + "ERROR " + str(parameters) + bcolors.ENDC, end, file=sys.stderr)
76
+ return
net/hypki/math.py ADDED
@@ -0,0 +1,13 @@
1
+
2
+ import subprocess
3
+ import sys
4
+ import re
5
+ import os
6
+ from net.hypki.io import *
7
+ from net.hypki.args import *
8
+
9
+ def math_eval(s):
10
+ try:
11
+ return eval(s)
12
+ except SyntaxError:
13
+ return 0
net/hypki/random.py ADDED
@@ -0,0 +1,14 @@
1
+ '''
2
+ Created on 18-07-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import os
8
+ import uuid
9
+ import base64
10
+
11
+ def nextUuid():
12
+ return str(uuid.uuid4())
13
+ # r_uuid = base64.urlsafe_b64encode(uuid.uuid4().bytes)
14
+ # return str(r_uuid.replace('=', ''))
net/hypki/regex.py ADDED
@@ -0,0 +1,50 @@
1
+ '''
2
+ Created on 08-05-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ from net.hypki import *
8
+ import os.path
9
+ import re
10
+ import subprocess
11
+ import sys
12
+ import time
13
+ # import urllib.request
14
+
15
+ def replace(string, searchPattern, replacement):
16
+ return re.sub(searchPattern, replacement, string, count=0, flags=0)
17
+
18
+ def firstGroup(s, regex):
19
+ r = re.compile(regex)
20
+ m = r.search(s)
21
+ if m:
22
+ return m.group(1)
23
+ return ""
24
+
25
+ def allGroups(s, regex):
26
+ r = re.compile(regex)
27
+ m = r.search(s)
28
+ if m:
29
+ return m.groups()
30
+ return ""
31
+
32
+ def isLong(strNumber):
33
+ return matches(strNumber, "^[\d]+$")
34
+
35
+ def isDouble(strNumber):
36
+ return matches(strNumber, "[\d]+\.[\d\+\-eE]+")
37
+
38
+ def matches(s, regex):
39
+ r = re.compile(regex)
40
+ m = r.search(s)
41
+ if m:
42
+ return True
43
+ return False
44
+
45
+ def matchesIgnoreCase(s, regex):
46
+ r = re.compile(regex, re.IGNORECASE)
47
+ m = r.search(s)
48
+ if m:
49
+ return True
50
+ return False
net/hypki/system.py ADDED
@@ -0,0 +1,28 @@
1
+ '''
2
+ Created on 18-07-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import inspect
8
+ import os.path
9
+ import re
10
+ import subprocess
11
+ import sys
12
+ import time
13
+ import urllib.request
14
+
15
+
16
+ def getThisScriptPath():
17
+ return inspect.stack()[1][1] # inspect.getfile(inspect.currentframe()) # script filename (usually with path)
18
+
19
+
20
+ def getThisScriptDirectory():
21
+ return os.__path.dirname(os.__path.abspath(inspect.stack()[1][1])) # script directory
22
+
23
+
24
+ def getSystemVariable(name):
25
+ for param in os.environ.keys():
26
+ if param == name:
27
+ return os.environ[param]
28
+ return None
File without changes
@@ -0,0 +1,91 @@
1
+ from astropy.constants import G, M_earth, R_earth
2
+ from astropy import units as u
3
+ import numpy as np
4
+
5
+ mu = G.value*M_earth.value
6
+ Re = R_earth.value
7
+
8
+ #Test vectors
9
+ r_test = np.array([Re + 600.0*1000, 0, 50])
10
+ v_test = np.array([0, 6.5 * 1000, 0])
11
+ t = 0
12
+
13
+
14
+ def cart_2_kep(r_vec,v_vec):
15
+ #1
16
+ h_bar = np.cross(r_vec,v_vec)
17
+ h = np.linalg.norm(h_bar)
18
+ #2
19
+ r = np.linalg.norm(r_vec)
20
+ v = np.linalg.norm(v_vec)
21
+ #3
22
+ E = 0.5*(v**2) - mu/r
23
+ #4
24
+ a = -mu/(2*E)
25
+ #5
26
+ e = np.sqrt(1 - (h**2)/(a*mu))
27
+ #6
28
+ i = np.arccos(h_bar[2]/h)
29
+ #7
30
+ omega_LAN = np.arctan2(h_bar[0],-h_bar[1])
31
+ #8
32
+ #beware of division by zero here
33
+ lat = np.arctan2(np.divide(r_vec[2],(np.sin(i))),\
34
+ (r_vec[0]*np.cos(omega_LAN) + r_vec[1]*np.sin(omega_LAN)))
35
+ #9
36
+ p = a*(1-e**2)
37
+ nu = np.arctan2(np.sqrt(p/mu) * np.dot(r_vec,v_vec), p-r)
38
+ #10
39
+ omega_AP = lat - nu
40
+ #11
41
+ EA = 2*np.arctan(np.sqrt((1-e)/(1+e)) * np.tan(nu/2))
42
+ #12
43
+ n = np.sqrt(mu/(a**3))
44
+ T = t - (1/n)*(EA - e*np.sin(EA))
45
+
46
+ return a,e,i,omega_AP,omega_LAN,T, EA
47
+
48
+ def kep_2_cart(a,e,i,omega_AP,omega_LAN,T, EA):
49
+
50
+ #1
51
+ n = np.sqrt(mu/(a**3))
52
+ M = n*(t - T)
53
+ #2
54
+ MA = EA - e*np.sin(EA)
55
+ #3
56
+ #
57
+ # ERROR WAS HERE
58
+ #nu = 2*np.arctan(np.sqrt((1-e)/(1+e)) * np.tan(EA/2))
59
+ nu = 2*np.arctan(np.sqrt((1+e)/(1-e)) * np.tan(EA/2))
60
+ #4
61
+ r = a*(1 - e*np.cos(EA))
62
+ #5
63
+ h = np.sqrt(mu*a * (1 - e**2))
64
+ #6
65
+ Om = omega_LAN
66
+ w = omega_AP
67
+
68
+ X = r*(np.cos(Om)*np.cos(w+nu) - np.sin(Om)*np.sin(w+nu)*np.cos(i))
69
+ Y = r*(np.sin(Om)*np.cos(w+nu) + np.cos(Om)*np.sin(w+nu)*np.cos(i))
70
+ Z = r*(np.sin(i)*np.sin(w+nu))
71
+
72
+ #7
73
+ p = a*(1-e**2)
74
+
75
+ V_X = (X*h*e/(r*p))*np.sin(nu) - (h/r)*(np.cos(Om)*np.sin(w+nu) + \
76
+ np.sin(Om)*np.cos(w+nu)*np.cos(i))
77
+ V_Y = (Y*h*e/(r*p))*np.sin(nu) - (h/r)*(np.sin(Om)*np.sin(w+nu) - \
78
+ np.cos(Om)*np.cos(w+nu)*np.cos(i))
79
+ V_Z = (Z*h*e/(r*p))*np.sin(nu) + (h/r)*(np.cos(w+nu)*np.sin(i))
80
+
81
+ return [X,Y,Z],[V_X,V_Y,V_Z]
82
+
83
+ a,e,i,omega_AP,omega_LAN,T, EA = cart_2_kep(r_test,v_test)
84
+ r_test2, v_test2 = kep_2_cart(a,e,i,omega_AP,omega_LAN,T, EA)
85
+
86
+
87
+ # print(r_test2 - r_test)
88
+ # print(v_test2 - v_test)
89
+ for x in range(100):
90
+ r_test2, v_test2 = kep_2_cart(a,e,i,omega_AP+x,omega_LAN,T, EA)
91
+ print(r_test2, v_test2)
@@ -0,0 +1,34 @@
1
+ '''
2
+ Created on 21-06-2013
3
+
4
+ @author: ahypki
5
+ '''
6
+
7
+ import numpy as np
8
+ import scipy.signal
9
+
10
+ a = np.zeros(100)
11
+ a[0] = 1
12
+ a[1] = 2
13
+ a[2] = 3
14
+ a[3] = 4
15
+ a[4] = 3
16
+ a[5] = 1
17
+ a[6] = 0
18
+ a[7] = -1
19
+ a[8] = 2
20
+ a[9] = 3
21
+ a[10] = 2
22
+ a[11] = 1
23
+ print(a)
24
+ res = scipy.signal.argrelmax(a)
25
+ print(res)
26
+
27
+ b = np.zeros(100)
28
+ b[0] = 1
29
+ b[1] = 2
30
+ b[2] = 1
31
+ b[3] = 2
32
+ bb = np.trim_zeros(b)
33
+ print(bb.mean())
34
+ print(bb.std())