You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I ran the following code in my jupyter-notebook. data[0] contains a string which is the path to a .py file. import pycode_similar pycode_similar.detect([data[0], data[0]],diff_method=UnifiedDiff)
but I receive this error:
`--------------------------------------------------------------------------
NameError Traceback (most recent call last)
in
1 import pycode_similar
----> 2 pycode_similar.detect([data[0], data[0]],diff_method=UnifiedDiff)
NameError: name 'UnifiedDiff' is not defined I ran the code like below:import pycode_similar
pycode_similar.detect([data[0], data[0]],diff_method='UnifiedDiff')`
and I got this error:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
1 import pycode_similar
----> 2 pycode_similar.detect([data[0], data[0]],diff_method='UnifiedDiff')
~/deid2/lib/python3.6/site-packages/pycode_similar.py in detect(pycode_string_list, diff_method)
446 min_diff_func_info = None
447 for fi2 in func_info_candidate:
--> 448 dv = diff_method.diff(fi1, fi2)
449 if dv < min_diff_value:
450 min_diff_value = dv
AttributeError: 'str' object has no attribute 'diff'`
Can you please help me understand what I am doing wrong?
Thank you!
The text was updated successfully, but these errors were encountered:
Thanks for your response.
running the above code I receive this output:
[(1,
[<pycode_similar.FuncDiffInfo at 0x7f8cd62bb828>,
<pycode_similar.FuncDiffInfo at 0x7f8cd617a828>])]
Hi,
I ran the following code in my jupyter-notebook. data[0] contains a string which is the path to a .py file.
import pycode_similar pycode_similar.detect([data[0], data[0]],diff_method=UnifiedDiff)
but I receive this error:
`--------------------------------------------------------------------------
NameError Traceback (most recent call last)
in
1 import pycode_similar
----> 2 pycode_similar.detect([data[0], data[0]],diff_method=UnifiedDiff)
NameError: name 'UnifiedDiff' is not defined
I ran the code like below:
import pycode_similarpycode_similar.detect([data[0], data[0]],diff_method='UnifiedDiff')`
and I got this error:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
1 import pycode_similar
----> 2 pycode_similar.detect([data[0], data[0]],diff_method='UnifiedDiff')
~/deid2/lib/python3.6/site-packages/pycode_similar.py in detect(pycode_string_list, diff_method)
446 min_diff_func_info = None
447 for fi2 in func_info_candidate:
--> 448 dv = diff_method.diff(fi1, fi2)
449 if dv < min_diff_value:
450 min_diff_value = dv
AttributeError: 'str' object has no attribute 'diff'`
Can you please help me understand what I am doing wrong?
Thank you!
The text was updated successfully, but these errors were encountered: