<commit_before>"""
    SymbolicNode

SymbolicNode is the basic building block of the symbolic graph in MXNet.jl.

    (self :: SymbolicNode)(args :: SymbolicNode...)
    (self :: SymbolicNode)(; kwargs...)

Make a new node by composing `self` with `args`. Or the arguments
can be specified using keyword arguments.
"""
type SymbolicNode
  handle :: MX_SymbolHandle
end
function Base.unsafe_convert(::Type{MX_handle}, obj::SymbolicNode)
  Base.unsafe_convert(MX_handle, obj.handle)
end
Base.convert(t::Type{MX_handle}, obj::SymbolicNode) = Base.unsafe_convert(t, obj)
Base.cconvert(t::Type{MX_handle}, obj::SymbolicNode) = Base.unsafe_convert(t, obj)

"""
    deepcopy(self :: SymbolicNode)

Make a deep copy of a SymbolicNode.
"""
function Base.deepcopy(self :: SymbolicNode)
  ref_hdr = Ref{MX_handle}(0)
  @mxcall(:MXSymbolCopy, (MX_handle, Ref{MX_handle}), self, ref_hdr)
  return SymbolicNode(MX_SymbolHandle(ref_hdr[]))
end

"""
    copy(self :: SymbolicNode)

Make a copy of a SymbolicNode. The same as making a deep copy.
"""
function Base.copy(self :: SymbolicNode)
  Base.deepcopy(self)
end

@compat function (self::SymbolicNode)(args :: SymbolicNode...)
  s = deepcopy(self)
  _compose!(s, args...)
end
@compat function (self::SymbolicNode)(;kwargs...)
  s = deepcopy(self)
  _compose!(s; kwargs...)
end

macro _list_symbol_info(self, func_name)
  quote
    ref_sz    = Ref{MX_uint}(0)
    ref_names = Ref{char_pp}(0)
    @mxcall($func_name, (MX_handle, Ref{MX_uint}, Ref{char_pp}),
            $self, ref_sz, ref_names)
    narg = ref_sz[]
    names = unsafe_wrap(Array, ref_names[], narg)
    names = [Symbol(unsafe_wrap(String, x)) for x in names]
    return names
  end
end

"""
    list_arguments(self :: SymbolicNode)

List all the arguments of this node. The argument for a node contains both
the inputs and parameters. For example, a `FullyConnected` node will
have both data and weights in its arguments. A composed node (e.g. a MLP) will
list all the arguments for intermediate nodes.

Returns a list of symbols indicating the names of the arguments.
"""<commit_msg>Fix hygiene bug (#164)<commit_after>"""
    SymbolicNode

SymbolicNode is the basic building block of the symbolic graph in MXNet.jl.

    (self :: SymbolicNode)(args :: SymbolicNode...)
    (self :: SymbolicNode)(; kwargs...)

Make a new node by composing `self` with `args`. Or the arguments
can be specified using keyword arguments.
"""
type SymbolicNode
  handle :: MX_SymbolHandle
end
function Base.unsafe_convert(::Type{MX_handle}, obj::SymbolicNode)
  Base.unsafe_convert(MX_handle, obj.handle)
end
Base.convert(t::Type{MX_handle}, obj::SymbolicNode) = Base.unsafe_convert(t, obj)
Base.cconvert(t::Type{MX_handle}, obj::SymbolicNode) = Base.unsafe_convert(t, obj)

"""
    deepcopy(self :: SymbolicNode)

Make a deep copy of a SymbolicNode.
"""
function Base.deepcopy(self :: SymbolicNode)
  ref_hdr = Ref{MX_handle}(0)
  @mxcall(:MXSymbolCopy, (MX_handle, Ref{MX_handle}), self, ref_hdr)
  return SymbolicNode(MX_SymbolHandle(ref_hdr[]))
end

"""
    copy(self :: SymbolicNode)

Make a copy of a SymbolicNode. The same as making a deep copy.
"""
function Base.copy(self :: SymbolicNode)
  Base.deepcopy(self)
end

@compat function (self::SymbolicNode)(args :: SymbolicNode...)
  s = deepcopy(self)
  _compose!(s, args...)
end
@compat function (self::SymbolicNode)(;kwargs...)
  s = deepcopy(self)
  _compose!(s; kwargs...)
end

macro _list_symbol_info(self, func_name)
  quote
    ref_sz    = Ref{MX_uint}(0)
    ref_names = Ref{char_pp}(0)
    @mxcall($func_name, (MX_handle, Ref{MX_uint}, Ref{char_pp}),
            $(esc(self)), ref_sz, ref_names)
    narg = ref_sz[]
    names = unsafe_wrap(Array, ref_names[], narg)
    names = [Symbol(unsafe_wrap(String, x)) for x in names]
    return names
  end
end

"""
    list_arguments(self :: SymbolicNode)

List all the arguments of this node. The argument for a node contains both
the inputs and parameters. For example, a `FullyConnected` node will
have both data and weights in its arguments. A composed node (e.g. a MLP) will
list all the arguments for intermediate nodes.

Returns a list of symbols indicating the names of the arguments.
"""
{'fraction_non_alphanumeric': 0.12440305635148043, 'fraction_numerical': 0.002148997134670487, 'mean_word_length': 4.511842105263158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7279980', 'n_tokens_mistral': 1391, 'n_tokens_neox': 1408, 'n_words': 417}