<commit_before>from sympy.core import S, C, sympify
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.operations import LatticeOp, ShortCircuit
from sympy.core.function import Application, Function, Lambda
from sympy.core.expr import Expr
from sympy.core.singleton import Singleton

class IdentityFunction(Lambda):
    """The identity function

    >>> from sympy import Id, Symbol
    >>> x = Symbol('x')
    >>> Id(x)
    x
    """
    __metaclass__ = Singleton
    __slots__ = []
    nargs = 1
    def __new__(cls):
        x = C.Dummy('x')
        #construct "by hand" to avoid infinite loop
        return Expr.__new__(cls, Tuple(x), x)
Id = S.IdentityFunction

###############################################################################
############################# SQUARE ROOT FUNCTION ############################
###############################################################################

def sqrt(arg):
    # arg = sympify(arg) is handled by Pow
    return C.Pow(arg, S.Half)


###############################################################################
############################# ROOT FUNCTION ###################################
###############################################################################

def root(arg, n=2):
    """
    root(a, n) -> Returns the n-th root of a.

    See also
    ========
       L{sqrt}
    """<commit_msg>Updated docstrings for sqrt and root<commit_after>from sympy.core import S, C, sympify
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.operations import LatticeOp, ShortCircuit
from sympy.core.function import Application, Function, Lambda
from sympy.core.expr import Expr
from sympy.core.singleton import Singleton

class IdentityFunction(Lambda):
    """The identity function

    >>> from sympy import Id, Symbol
    >>> x = Symbol('x')
    >>> Id(x)
    x
    """
    __metaclass__ = Singleton
    __slots__ = []
    nargs = 1
    def __new__(cls):
        x = C.Dummy('x')
        #construct "by hand" to avoid infinite loop
        return Expr.__new__(cls, Tuple(x), x)
Id = S.IdentityFunction

###############################################################################
############################# ROOT and SQUARE ROOT FUNCTION ###################
###############################################################################

def sqrt(arg):
    """The square root function

    sqrt(x) -> Returns the positive square root of x.

    >>> from sympy import sqrt, Symbol
    >>> x = Symbol('x')
    >>> sqrt(x)
    sqrt(x)

    See also
    ========
       L{root}
    """
    # arg = sympify(arg) is handled by Pow
    return C.Pow(arg, S.Half)


def root(arg, n=2):
    """The n-th root function

    root(x, n) -> Returns the n-th root of x.

    See also
    ========
       L{sqrt}
    """
{'fraction_non_alphanumeric': 0.31773743016759776, 'fraction_numerical': 0.0013966480446927375, 'mean_word_length': 3.880749574105622, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '7239097', 'n_tokens_mistral': 820, 'n_tokens_neox': 770, 'n_words': 231}