예제 #1
0
def get_sample_items(sample: dict):
    """Create the list of sample items

    Args:
        sample: dict of samples

    Returns:
        List of sample items to show in the interface.
    """
    items = [
        Sample(sample=obj.data, name=obj.name, anchor_id=obj.id, caption=obj.caption)
        for obj in sample
    ]
    return items
def get_sample_items(sample: dict):
    """Create the list of sample items

    Args:
        sample: dict of samples

    Returns:
        List of sample items to show in the interface.
    """
    items = []
    items.append(Sample(
        sample=sample,
        name="",
        anchor_id="sample",
    ))
    return items
예제 #3
0
def get_sample_items(sample: dict):
    """Create the list of sample items

    Args:
        sample: dict of samples

    Returns:
        List of sample items to show in the interface.
    """
    items = []
    names = {"head": "First rows", "tail": "Last rows"}
    for key, value in sample.items():
        items.append(Sample(
            sample=value,
            name=names[key],
            anchor_id=key,
        ))
    return items