def x_in_y(x, y):
    """Check to see if the second argument is named in the first
    argument's unit placement spec.

    Both arguments provided are services with unit placement directives.
    If the first service appears in the second service's unit placement,
    either colocated on a default unit, colocated with a specific unit,
    or containerized alongside that service, then True is returned, False
    otherwise.
    """
    for placement in y.unit_placement:
        if ':' in placement:
            _, placement = placement.split(':')
        if '/' in placement:
            placement, _ = placement.split('/')
        if x.name == placement:
            return True
    return False
