<commit_before>defmodule Phoenix.Channel do

  @moduledoc """
  Defines a Phoenix Channel.

  Channels provide a means for bidirectional communication from clients that
  integrates with the `Phoenix.PubSub` layer for soft-realtime functionality.

  ## Topics & Callbacks
  When clients join a channel, they do so by subscribing a topic.
  Topics are string idenitifiers in the `Phoenix.PubSub` layer that allow
  multiple processes to subscribe and broadcast messages about a give topic.
  Everytime you join a Channel, you need to choose which particular topic you
  want to listen to. The topic is just an identifier, but by convention it is
  often made of two parts: `"topic:subtopic"`. Using the `"topic:subtopic"`
  approach pairs nicely with the `Phoenix.Router.channel/3` macro to match
  topic patterns in your router to your channel handlers:

      socket "/ws", MyApp do
        channel "rooms:*", RoomChannel
      end

  Any topic coming into the router with the `"rooms:"` prefix, would dispatch
  to `MyApp.RoomChannel` in the above example. Topics can also be pattern
  matched in your channels' `join/3` callback to pluck out the scoped pattern:

      # handles the special `"lobby"` subtopic
      def join("rooms:lobby", _auth_message, socket) do
        {:ok, socket}
      end

      # handles any other subtopic as the room ID, ie `"rooms:12"`, `"rooms:34"`
      def join("rooms:" <> room_id, auth_message, socket) do
        {:ok, socket}
      end

  ### Authorization<commit_msg>Fix typo in channel documentation<commit_after>defmodule Phoenix.Channel do

  @moduledoc """
  Defines a Phoenix Channel.

  Channels provide a means for bidirectional communication from clients that
  integrates with the `Phoenix.PubSub` layer for soft-realtime functionality.

  ## Topics & Callbacks
  When clients join a channel, they do so by subscribing a topic.
  Topics are string idenitifiers in the `Phoenix.PubSub` layer that allow
  multiple processes to subscribe and broadcast messages about a given topic.
  Everytime you join a Channel, you need to choose which particular topic you
  want to listen to. The topic is just an identifier, but by convention it is
  often made of two parts: `"topic:subtopic"`. Using the `"topic:subtopic"`
  approach pairs nicely with the `Phoenix.Router.channel/3` macro to match
  topic patterns in your router to your channel handlers:

      socket "/ws", MyApp do
        channel "rooms:*", RoomChannel
      end

  Any topic coming into the router with the `"rooms:"` prefix, would dispatch
  to `MyApp.RoomChannel` in the above example. Topics can also be pattern
  matched in your channels' `join/3` callback to pluck out the scoped pattern:

      # handles the special `"lobby"` subtopic
      def join("rooms:lobby", _auth_message, socket) do
        {:ok, socket}
      end

      # handles any other subtopic as the room ID, ie `"rooms:12"`, `"rooms:34"`
      def join("rooms:" <> room_id, auth_message, socket) do
        {:ok, socket}
      end

  ### Authorization
{'fraction_non_alphanumeric': 0.07441554165294699, 'fraction_numerical': 0.003951267698386566, 'mean_word_length': 3.568421052631579, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1965191', 'n_tokens_mistral': 860, 'n_tokens_neox': 823, 'n_words': 389}