-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
name 'UnifiedDiff' is not defined #2
Comments
Sorry for the incorrect document. The usage should be: import pycode_similar
pycode_similar.detect([data[0], data[0]],diff_method=pycode_similar.UnifiedDiff) |
Thanks for your response. I'm not sure what is wrong. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: