pip install lxml
11/29/2020
11/27/2020
get parameter from parameter store of aws system manager, python example code
firstly create parameter in parameter store of AWS system manager
Then get the key from this code.
code
import boto3
ssm = boto3.client('ssm')
parameter = ssm.get_parameter(Name='/project/key_endpoint', WithDecryption=True)
print(parameter['Parameter']['Value'])
.
Labels:
aws,
parameter store,
Python,
ssm,
Total
s3 bucket copy object to another bucket, python example
code
def copy_s3_object(s3_resource, source_bucket_name, source_key, target_bucket_name, target_key):
copy_source = {'Bucket': source_bucket_name, 'Key': source_key}
s3_resource.meta.client.copy(copy_source, target_bucket_name, target_key)
s3_resource = boto3.resource('s3')
copy_s3_object(s3_resource, source_bucket_name, source_key, target_bucket_name, target_key)
.
aws s3 get all object more than 1000 python example code
simply to use paginator instance
example code
paginator = s3_client.get_paginator('list_objects_v2')
pages = paginator.paginate(Bucket='bucket', Prefix='folder1/')
for page in pages:
for obj in page['Contents']:
print(obj['Key'])
.
11/02/2020
sci sparse -> tuple list -> sci sparse
refer to below source code
source code start
from scipy.sparse import csr_matrix
#sci sparse to tuple list
c = A2.tocoo() #A2 is scipy.sparse.csr.csr_matrix
in_edge_idx = list(zip(c.row, c.col)) #make tuple list
#tuple list to sci sparse
two_list = list(map(list, zip(*in_edge_idx))) #tuple 2 tow list of list [[1,2,3], [2,3,4]]
rows = np.array(two_list[0]) #rows
cols = np.array(two_list[1]) #cols
data_num = len(rows) #number of edge
data = np.ones( data_num ) #edge value
dim = len(x_data) #N x N adj
#sci sparse -> tuple list -> sci sparse
re_edge_idx = csr_matrix((data, (rows, cols)), shape=(dim, dim))
print('in', A2, type(A2))
print('re', re_edge_idx, type(re_edge_idx))
#origin A2 and re-generated edge index same?
print( (A2!=re_edge_idx).nnz==0 )
source code end
Subscribe to:
Posts (Atom)
-
In past, I wrote an articel about YUV 444, 422, 411 introduction and yuv <-> rgb converting example code. refer to this page -> ht...
-
CUDA_ARCH_BIN Table for gpu type Jetson Products GPU Compute Capability Jetson AGX Xavier 7.2 Jetson Nano 5.3 Jetson TX2 6.2 Jetson TX1 5.3 ...
-
As you can see in the following video, I created a class that stitching n cameras in real time. https://www.youtube.com/user/feelmare/sear...
-
make different port number Window > .\python_embeded\python.exe -s ComfyUI\ main.py --port 8189 --windows-standalone-build Linux or Ma...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
-
* Introduction - The solution shows panorama image from multi images. The panorama images is processing by real-time stitching algorithm...
-
On the window, we made new file easily by right button click. But on the mac, there is no function. So, very incompatible... By the way, ...
-
This is example for background subtraction on opencv 3.2 version previously, I post 2.7 version example on here. http://study.marearts.co...
-
error: . VanillaPipeline.get_train_loss_dict: 12.6875 Traceback (most recent call last): File "/home/mare/anaconda3...
-
>sudo lsof -i :8188 python 231134 mare 45u IPv4 2074469 0t0 TCP localhost:8188->localhost:42132 (CLOSE_WAIT) python 23113...