<?xml version="1.0"?>
<block>
    <name>Python Block</name>
    <key>epy_block</key>
    <import></import>
    <make></make>
    <param><!-- Cache the last working block IO to keep FG sane -->
        <name>Block Io</name>
        <key>_io_cache</key>
        <type>string</type>
    <hide>all</hide>
    </param>
    <param>
        <name>Code</name>
        <key>_source_code</key>
    <value>"""
Embedded Python Blocks:

Each time this file is saved, GRC will instantiate the first class it finds
to get ports and parameters of your block. The arguments to __init__  will
be the parameters. All of them are required to have default values!
"""

import numpy as np
from gnuradio import gr


class blk(gr.sync_block):  # other base classes are basic_block, decim_block, interp_block
    """Embedded Python Block example - a simple multiply const"""

    def __init__(self, example_param=1.0):  # only default arguments here
        """arguments to this function show up as parameters in GRC"""
        gr.sync_block.__init__(
            self,
            name='Embedded Python Block',   # will show up in GRC
            in_sig=[np.complex64],
            out_sig=[np.complex64]
        )
        # if an attribute with the same name as a parameter is found,
        # a callback is registered (properties work, too).
        self.example_param = example_param

    def work(self, input_items, output_items):
        """example: multiply with constant"""
        output_items[0][:] = input_items[0] * self.example_param
        return len(output_items[0])
</value>
    <type>_multiline_python_external</type>
    <hide>part</hide>
    </param>
    <doc>This block represents an arbitrary GNU Radio Python Block.

Its source code can be accessed through the parameter 'Code' which opens your editor. Each time you save changes in the editor, GRC will update the block. This includes the number, names and defaults of the parameters, the ports (stream and message) and the block name and documentation.

Block Documentation:
(will be replaced the docstring of your block class)
</doc>
</block>
