Block Code Example to use Library from Library Manager

This Block is a sample code to use Library from Library Manager.

from pipelineblocksdk.api.Singleton import Singleton
from pipelineblocksdk.construct.base.BatchBlock import BatchBlock

# Following code is the definition for a batch block

class MyBlock(BatchBlock, Singleton):

    # This is the entrypoint for the block. This is a mandatory function.
    def run(self):
        print('Run function says: Hello, world!')
        print("Inputs available:", self.input_dict)
        
        import numpy as np
        my_array = np.array([[1,2,3,4], [5,6,7,8]], dtype=np.int64)

        print(my_array)

        # Set the output parameter
        output_dict = dict()

        # Set the status of the block as completed
        self.block_status = "COMPLETED"

        return output_dict