<commit_before>""" Test docstrings in functions and classes, which are used to infer types """

# -----------------
# sphinx style
# -----------------
def f(a, b, c, d, x):
    """ asdfasdf
    :param a: blablabla
    :type a: str
    :type b: (str, int)
    :type c: threading.Thread
    :type d: :class:`threading.Thread`
    :param str x: blablabla
    :rtype: dict
    """
    #? str()
    a
    #? str()
    b[0]
    #? int()
    b[1]
    #? ['join']
    c.join
    #? ['join']
    d.join
    #? ['lower']
    x.lower

#? dict()
f()

# wrong declarations
def f(a, b, x):
    """
    :param a: Forgot type declaration
    :type a:
    :param b: Just something
    :type b: ``
    :param x: Just something without type
    :rtype:
    """
    #? 
    a
    #? 
    b
    #?
    x

#? 
f()

# local classes -> github #370
class ProgramNode():
    pass

def local_classes(node, node2):
    """
    :type node: ProgramNode
    ... and the class definition after this func definition:
    :type node2: ProgramNode2
    """
    #? ProgramNode()
    node
    #? ProgramNode2()
    node2

class ProgramNode2():
    pass


def list_with_non_imports(lst):
    """
    Should be able to work with tuples and lists and still import stuff.

    :type lst: (threading.Thread, [collections.defaultdict, ...])
    """
    #? ['start']
    lst[0].start

    import collections as col
    # use some weird index
    #? col.defaultdict()
    lst[1][10]


def two_dots(a):
    """
    :type a: json.decoder.JSONDecoder
    """
    #? ['raw_decode']
    a.raw_decode


# sphinx returns
def return_module_object():
    """
    :rtype: :class:`threading.Thread`
    """

#? ['join']
return_module_object().join


# -----------------
# epydoc style
# -----------------
def e(a, b):
    """ asdfasdf
    @type a: str
    @param a: blablabla
    @type b: (str, int)
    @param b: blablah
    @rtype: list
    """
    #? str()
    a
    #? str()
    b[0]

    #? int()
    b[1]

#? list()
e()


# Returns with param type only
def rparam(a,b):
    """
    @type a: str
    """
    return a

#? str()
rparam()<commit_msg>Change docstring test function names, so that dynamic param completion doesn't interfere (especially because some of those files still generate parser errors).<commit_after>""" Test docstrings in functions and classes, which are used to infer types """

# -----------------
# sphinx style
# -----------------
def sphinxy(a, b, c, d, x):
    """ asdfasdf
    :param a: blablabla
    :type a: str
    :type b: (str, int)
    :type c: threading.Thread
    :type d: :class:`threading.Thread`
    :param str x: blablabla
    :rtype: dict
    """
    #? str()
    a
    #? str()
    b[0]
    #? int()
    b[1]
    #? ['join']
    c.join
    #? ['join']
    d.join
    #? ['lower']
    x.lower

#? dict()
sphinxy()

# wrong declarations
def sphinxy2(a, b, x):
    """
    :param a: Forgot type declaration
    :type a:
    :param b: Just something
    :type b: ``
    :param x: Just something without type
    :rtype:
    """
    #? 
    a
    #? 
    b
    #?
    x

#? 
sphinxy2()

# local classes -> github #370
class ProgramNode():
    pass

def local_classes(node, node2):
    """
    :type node: ProgramNode
    ... and the class definition after this func definition:
    :type node2: ProgramNode2
    """
    #? ProgramNode()
    node
    #? ProgramNode2()
    node2

class ProgramNode2():
    pass


def list_with_non_imports(lst):
    """
    Should be able to work with tuples and lists and still import stuff.

    :type lst: (threading.Thread, [collections.defaultdict, ...])
    """
    #? ['start']
    lst[0].start

    import collections as col
    # use some weird index
    #? col.defaultdict()
    lst[1][10]


def two_dots(a):
    """
    :type a: json.decoder.JSONDecoder
    """
    #? ['raw_decode']
    a.raw_decode


# sphinx returns
def return_module_object():
    """
    :rtype: :class:`threading.Thread`
    """

#? ['join']
return_module_object().join


# -----------------
# epydoc style
# -----------------
def epydoc(a, b):
    """ asdfasdf
    @type a: str
    @param a: blablabla
    @type b: (str, int)
    @param b: blablah
    @rtype: list
    """
    #? str()
    a
    #? str()
    b[0]

    #? int()
    b[1]

#? list()
epydoc()


# Returns with param type only
def rparam(a,b):
    """
    @type a: str
    """
    return a

#? str()
rparam()
{'fraction_non_alphanumeric': 0.1780978509373571, 'fraction_numerical': 0.00823045267489712, 'mean_word_length': 2.053035589672017, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3282407', 'n_tokens_mistral': 1602, 'n_tokens_neox': 1552, 'n_words': 436}