<jupyter_start><jupyter_text>Add LogicTo add logic to the Flow, use the `uses` parameter to attach a Pod with an [Executor](https://github.com/jina-ai/jina/tree/master/docs/chapters/101executors). `uses` accepts multiple value types including class name, Docker image, (inline) YAML or built-in shortcut.Let's first build a dummy encoder<jupyter_code>#Run this command to install Jina in this notebook 
!pip install jina
from jina import Executor
import numpy as np


class DummyEncoder(Executor):
    
    def __init__(self, param=10, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.param = param
        
    def encode(self, data, *args, **kwargs):
        return np.random.random([2, self.param])<jupyter_output><empty_output><jupyter_text>To use `DummyEncoder` in the Flow, you can use the class name, a YAML file/literal, or a Python `dict`:<jupyter_code>from jina import Flow
f = (Flow().add(uses='DummyEncoder')
       .add(uses={'jtype': 'DummyEncoder', 'with': {'param': 12}})  # dict config object with __cls keyword
       .add(uses='myencoder.yml')  # YAML serialization of a Jina Executor
       .add(uses='''
                jtype: DummyEncoder
                with:
                    param: 20'''))  # inline YAML config<jupyter_output><empty_output><jupyter_text>The power of Jina lies in its decentralized architecture: each `add` creates a new Pod, and these Pods can be run as a local thread/process, a remote process, inside a Docker container, or even inside a remote Docker container.You can also use Docker image with `docker://` as prefix:<jupyter_code>f.add(uses='docker://jinahub/pretrained-cnn:latest')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1114404267931239, 'fraction_numerical': 0.005927682276229994, 'mean_word_length': 4.008902077151335, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '544848', 'license': 'Apache-2.0', 'n_tokens_mistral': 539, 'n_tokens_neox': 508, 'n_words': 173, 'path': 'basic-add-logic.ipynb', 'repo_name': 'jina-ai/jupyter-notebooks', 'size': '1687'}