<commit_before>package works.chatterbox.chatterbox.channels;

import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
import ninja.leaping.configurate.ConfigurationNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import works.chatterbox.chatterbox.Chatterbox;
import works.chatterbox.chatterbox.channels.files.FormatFiles;
import works.chatterbox.chatterbox.channels.radius.Radius;
import works.chatterbox.chatterbox.wrappers.CPlayer;

import java.io.File;
import java.util.Set;

public class ConfigChannel implements Channel {

    private final static FormatFiles formatFiles = new FormatFiles();
    private final ConfigurationNode node;
    private final Set<CPlayer> members = Sets.newHashSet();
    private final Chatterbox chatterbox;

    public ConfigChannel(@NotNull final Chatterbox chatterbox, @NotNull final String name) {
        Preconditions.checkNotNull(chatterbox, "chatterbox was null");
        Preconditions.checkNotNull(name, "name was null");
        this.chatterbox = chatterbox;
        this.node = chatterbox.getConfiguration().getNode("channels").getChildrenList().stream()
            .filter(node -> name.equals(node.getNode("name").getString()))
            .findFirst()
            .orElseThrow(() -> new IllegalStateException("No channel by the name " + name));
    }

    public ConfigChannel(@NotNull final Chatterbox chatterbox, @NotNull final ConfigurationNode node) {<commit_msg>Updated: Accept name or tag<commit_after>package works.chatterbox.chatterbox.channels;

import com.google.common.base.Preconditions;
import com.google.common.collect.Sets;
import ninja.leaping.configurate.ConfigurationNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import works.chatterbox.chatterbox.Chatterbox;
import works.chatterbox.chatterbox.channels.files.FormatFiles;
import works.chatterbox.chatterbox.channels.radius.Radius;
import works.chatterbox.chatterbox.wrappers.CPlayer;

import java.io.File;
import java.util.Set;

public class ConfigChannel implements Channel {

    private final static FormatFiles formatFiles = new FormatFiles();
    private final ConfigurationNode node;
    private final Set<CPlayer> members = Sets.newHashSet();
    private final Chatterbox chatterbox;

    public ConfigChannel(@NotNull final Chatterbox chatterbox, @NotNull final String name) {
        Preconditions.checkNotNull(chatterbox, "chatterbox was null");
        Preconditions.checkNotNull(name, "name was null");
        this.chatterbox = chatterbox;
        this.node = chatterbox.getConfiguration().getNode("channels").getChildrenList().stream()
            .filter(node -> name.equals(node.getNode("name").getString()) || name.equals(node.getNode("tag").getString()))
            .findFirst()
            .orElseThrow(() -> new IllegalStateException("No channel by the name " + name));
    }

    public ConfigChannel(@NotNull final Chatterbox chatterbox, @NotNull final ConfigurationNode node) {
{'fraction_non_alphanumeric': 0.1021753460777851, 'fraction_numerical': 0.0, 'mean_word_length': 4.704887218045113, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, '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}}
{'dir': 'git-commits-cleaned', 'id': '1374066', 'n_tokens_mistral': 821, 'n_tokens_neox': 803, 'n_words': 185}