<commit_before>#
# The filters MUES::CommandShell command.
# Time-stamp: <14-Sep-2002 08:01:32 deveiant>
# $Id: filters.cmd,v 1.3 2002/09/15 07:44:37 deveiant Exp $
#
# == Authors:
# * <NAME> <<EMAIL>>
#

= filters

== Abstract
Display a user's IOEventStream filters.

== Description
This command displays a table of the filters in the specified user's
IOEventStream, or your own filters if you don't specify a username.

== Usage
  filters <username>
  filters

== Restriction
implementor

== Code

  # Code will be called like this:
  #   cmd.invoke( context, argString )
  # where 'context' is a MUES::Command::Context object, and argString is the
  # text of the command entered, with the command name and any leading/trailing
  # whitespace removed.
  if argString.strip.empty?
	  user = context.user
  elsif argString =~ /^\s*(\w+)\s*$/
	  username = $1.to_s
	  user = MUES::ServerFunctions::getUserByName( username ) 
	  if user.nil?
		  return [MUES::OutputEvent.new( "No such user '#{username}'" )]
	  end
  else
	  return [MUES::OutputEvent.new( self.usage )]
  end

  filterList = [ "Filters currently in #{user.username}'s stream:" ]
  user.ioEventStream.filters.sort.each {|filter|
	  filterList << filter.to_s
  }
  return [MUES::OutputEvent.new( filterList.join("\n\t") + "\n" )]

<commit_msg>- Added code to handle users who aren't logged in.<commit_after>#
# The filters MUES::CommandShell command.
# Time-stamp: <17-Oct-2002 09:56:41 deveiant>
# $Id: filters.cmd,v 1.4 2002/10/23 02:16:50 deveiant Exp $
#
# == Authors:
# * <NAME> <<EMAIL>>
#

= filters

== Abstract
Display a user's IOEventStream filters.

== Description
This command displays a table of the filters in the specified user's
IOEventStream, or your own filters if you don't specify a username.

== Usage
  filters <username>
  filters

== Restriction
implementor

== Code

  # Code will be called like this:
  #   cmd.invoke( context, argString )
  # where 'context' is a MUES::Command::Context object, and argString is the
  # text of the command entered, with the command name and any leading/trailing
  # whitespace removed.
  if argString.strip.empty?
	  user = context.user
  elsif argString =~ /^\s*(\w+)\s*$/
	  username = $1.to_s
	  user = MUES::ServerFunctions::getUserByName( username ) 
	  if user.nil?
		  return [MUES::OutputEvent::new( "No such user '#{username}'\n\n" )]
	  elsif !user.activated?
		  return [MUES::OutputEvent::new( "User '#{username}' doesn't appear to be logged in.\n\n" )]
	  end
  else
	  return [MUES::OutputEvent.new( self.usage )]
  end

  filterList = [ "Filters currently in #{user.username}'s stream:" ]
  user.ioEventStream.filters.sort.each {|filter|
	  filterList << filter.to_s
  }
  return [MUES::OutputEvent.new( filterList.join("\n\t") + "\n\n" )]


{'fraction_non_alphanumeric': 0.13551401869158877, 'fraction_numerical': 0.020848310567936738, 'mean_word_length': 3.814878892733564, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, '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': '5194840', 'n_tokens_mistral': 1007, 'n_tokens_neox': 925, 'n_words': 281}