def get_channels(
    public, stable, server, intranet, group, add_dependent_channels=False
):
    """Returns the relevant conda channels to consider if building project.

    The subset of channels to be returned depends on the visibility and
    stability of the package being built.  Here are the rules:

    * public and stable: returns the public stable channel
    * public and not stable: returns the public beta channel
    * not public and stable: returns both public and private stable channels
    * not public and not stable: returns both public and private beta channels

    Public channels have priority over private channles, if turned.

    Args:

      public: Boolean indicating if we're supposed to include only public
        channels
      stable: Boolean indicating if we're supposed to include stable channels
      server: The base address of the server containing our conda channels
      intranet: Boolean indicating if we should add "private"/"public" prefixes
        on the conda paths
      group: The group of packages (gitlab namespace) the package we're
        compiling is part of.  Values should match URL namespaces currently
        available on our internal webserver.  Currently, only "bob" or "beat"
        will work.
      add_dependent_channels: If True, will add the conda-forge channel to the list


    Returns: a list of channels that need to be considered.
    """

    if (not public) and (not intranet):
        raise RuntimeError(
            "You cannot request for private channels and set"
            " intranet=False (server=%s) - these are conflicting options"
            % server
        )

    channels = []
    channels_dict = {}

    # do not use '/public' urls for public channels
    prefix = "/software/" + group
    if stable:
        channels += [server + prefix + "/conda"]
        channels_dict["public/stable"] = channels[-1]
    else:
        channels += [server + prefix + "/conda/label/beta"]  # allowed betas
        channels_dict["public/beta"] = channels[-1]

    if not public:
        prefix = "/private"
        if stable:  # allowed private channels
            channels += [server + prefix + "/conda"]
            channels_dict["private/stable"] = channels[-1]
        else:
            channels += [server + prefix + "/conda/label/beta"]  # allowed betas
            channels_dict["private/beta"] = channels[-1]

    upload_channel = channels_dict[
        "{}/{}".format(
            "public" if public else "private", "stable" if stable else "beta"
        )
    ]

    if add_dependent_channels:
        channels += ["conda-forge"]

    return channels, upload_channel