Source files: 230

Click here to show/hide file names

Clones detected: 181

1411 of 22433 lines are duplicates (6.29%)

Parameters
clustering_threshold = 10
distance_threshold = 5
size_threshold = 5
hashing_depth = 1
clusterize_using_hash = False
clusterize_using_dcup = False

Time elapsed
Construction of AST : 8.29 seconds
Building statement hash : 0.08 seconds
Building patterns : 56.75 seconds
Marking similar statements : 107.25 seconds
Finding similar sequences of statements : 39.12 seconds
Refining candidates : 18.14 seconds
Total time: 229.63
Started at: Wed Sep 28 21:04:51 2016
Finished at: Wed Sep 28 21:08:25 2016

Clone # 1
Distance between two fragments = 2
Clone size = 23
Source file "datalad/tests/test_protocols.py"
The first line is 122
Source file "datalad/tests/test_protocols.py"
The first line is 68
timer_protocol = ExecutionTimeExternalsProtocol() timer_protocol = ExecutionTimeProtocol()
runner = Runner(protocol=timer_protocol) runner = Runner(protocol=timer_protocol)
cmd = ['git', 'init'] cmd = ['git', 'init']
os.mkdir(path1) os.mkdir(path1)
runner.run(cmd, cwd=path1) runner.run(cmd, cwd=path1)
assert_equal(len(timer_protocol), 1, str(runner.protocol)) assert_equal(len(timer_protocol), 1, str(runner.protocol))
assert_equal(cmd, timer_protocol[0]['command']) assert_equal(cmd, timer_protocol[0]['command'])
ok_(timer_protocol[0]['end'] >= timer_protocol[0]['start']) ok_(timer_protocol[0]['end'] >= timer_protocol[0]['start'])
ok_(timer_protocol[0]['duration'] >= 0) ok_(timer_protocol[0]['duration'] >= 0)
assert_is(timer_protocol[0]['exception'], None) assert_is(timer_protocol[0]['exception'], None)
try:
    try:
    with (swallow_logs()) as (cml):
        runner.run(cmd, cwd=path2)
except Exception, e:
    catched_exception = e
finally:
    assert_equal(len(timer_protocol), 2)
    assert_equal(cmd, timer_protocol[1]['command'])
    ok_(timer_protocol[1]['end'] >= timer_protocol[1]['start'])
    ok_(timer_protocol[1]['duration'] >= 0)
    assert_is(timer_protocol[1]['exception'], catched_exception)
try:
    try:
    with (swallow_logs()) as (cml):
        runner.run(cmd, cwd=path2)
except Exception, e:
    catched_exception = e
finally:
    assert_equal(len(timer_protocol), 2)
    assert_equal(cmd, timer_protocol[1]['command'])
    ok_(timer_protocol[1]['end'] >= timer_protocol[1]['start'])
    ok_(timer_protocol[1]['duration'] >= 0)
    assert_is(timer_protocol[1]['exception'], catched_exception)
new_runner = Runner(cwd=path2, protocol=timer_protocol) new_runner = Runner(cwd=path2, protocol=timer_protocol)
git_repo = GitRepo(path2, runner=new_runner) git_repo = GitRepo(path2, runner=new_runner)
assert_equal(len(timer_protocol), 2) assert_equal(len(timer_protocol), 3)



Clone # 2
Distance between two fragments = 4
Clone size = 23
Source file "datalad/interface/base.py"
The first line is 113
Source file "datalad/interface/base.py"
The first line is 76
if not docs:
    return docs
if not docs:
    return docs
docs = dedent_docstring(docs) docs = dedent_docstring(docs)
docs = re.sub('\\|\\| PYTHON \\>\\>.*\\<\\< PYTHON \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\|\\| CMDLINE \\>\\>.*\\<\\< CMDLINE \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL))
docs = re.sub('\\[PY:\\s[^\\[\\]]*\\sPY\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\[CMD:\\s[^\\[\\]]*\\sCMD\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL))
docs = re.sub('\\[CMD:\\s([^\\[\\]]*)\\sCMD\\]', lambda match: match.group(1), docs, flags=re.MULTILINE) docs = re.sub('\\[PY:\\s([^\\[\\]]*)\\sPY\\]', lambda match: match.group(1), docs, flags=re.MULTILINE)
docs = re.sub('\\|\\| CMDLINE \\>\\>(.*)\\<\\< CMDLINE \\|\\|', lambda match: match.group(1), docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\|\\| PYTHON \\>\\>(.*)\\<\\< PYTHON \\|\\|', lambda match: match.group(1), docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 3
Distance between two fragments = 0
Clone size = 19
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 1114
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 1018
def test_annex_remove(path1, path2):
    ar1 = AnnexRepo(path1, create=False)
    ar2 = AnnexRepo(path2, path1, create=True, direct=True)
    for repo in (ar1, ar2):
        file_list = repo.get_annexed_files()
        assert len(file_list) >= 1
        out = repo.remove(file_list[0])
        assert_not_in(file_list[0], repo.get_annexed_files())
        eq_(out[0], file_list[0])
        with (open(opj(repo.path, 'rm-test.dat'), 'w')) as (f):
            f.write('whatever')
        repo.add('rm-test.dat')
        if repo.is_direct_mode():
            assert_raises(CommandError, repo.remove, 'rm-test.dat')
        else:
            assert_raises(GitCommandError, repo.remove, 'rm-test.dat')
        assert_in('rm-test.dat', repo.get_annexed_files())
        out = repo.remove('rm-test.dat', force=True)
        assert_not_in('rm-test.dat', repo.get_annexed_files())
        eq_(out[0], 'rm-test.dat')
def test_annex_remove(path1, path2):
    ar1 = AnnexRepo(path1, create=False)
    ar2 = AnnexRepo(path2, path1, create=True, direct=True)
    for repo in (ar1, ar2):
        file_list = repo.get_annexed_files()
        assert len(file_list) >= 1
        out = repo.remove(file_list[0])
        assert_not_in(file_list[0], repo.get_annexed_files())
        eq_(out[0], file_list[0])
        with (open(opj(repo.path, 'rm-test.dat'), 'w')) as (f):
            f.write('whatever')
        repo.add('rm-test.dat')
        if repo.is_direct_mode():
            assert_raises(CommandError, repo.remove, 'rm-test.dat')
        else:
            assert_raises(GitCommandError, repo.remove, 'rm-test.dat')
        assert_in('rm-test.dat', repo.get_annexed_files())
        out = repo.remove('rm-test.dat', force=True)
        assert_not_in('rm-test.dat', repo.get_annexed_files())
        eq_(out[0], 'rm-test.dat')



Clone # 4
Distance between two fragments = 2
Clone size = 17
Source file "datalad/cmdline/tests/test_helpers.py"
The first line is 30
Source file "datalad/cmdline/tests/test_helpers.py"
The first line is 59
def test_get_repo_instance_git(path):
    repo = get_repo_instance(path, GitRepo)
    assert_is_instance(repo, GitRepo)
    eq_(realpath(repo.path), realpath(path))
    old_pwd = getpwd()
    chpwd(path)
    repo = get_repo_instance()
    assert_is_instance(repo, GitRepo)
    eq_(realpath(repo.path), realpath(path))
    new_subdir = opj(path, 'subdir')
    mkdir(new_subdir)
    chpwd(new_subdir)
    eq_(new_subdir, getpwd())
    repo = get_repo_instance()
    assert_is_instance(repo, GitRepo)
    eq_(realpath(repo.path), realpath(path))
    chpwd(old_pwd)
def test_get_repo_instance_annex(path):
    repo = get_repo_instance(path, AnnexRepo)
    assert_is_instance(repo, AnnexRepo)
    eq_(realpath(repo.path), realpath(path))
    old_pwd = getpwd()
    chpwd(path)
    repo = get_repo_instance()
    assert_is_instance(repo, AnnexRepo)
    eq_(realpath(repo.path), realpath(path))
    new_subdir = opj(path, 'subdir')
    mkdir(new_subdir)
    chpwd(new_subdir)
    eq_(new_subdir, getpwd())
    repo = get_repo_instance()
    assert_is_instance(repo, AnnexRepo)
    eq_(realpath(repo.path), realpath(path))
    chpwd(old_pwd)



Clone # 5
Distance between two fragments = 4
Clone size = 16
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 330
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 225
with  chpwd(outd):
  eq_(set(glob('*')),  {'dir1',  'file1.nii'})
  all_files  =  sorted(find_files('.'))
with  chpwd(outd):
  eq_(set(glob('*')),  {'dir1',  'file1.nii'})
  all_files  =  sorted(find_files('.'))
fpath = opj(outd, 'file1.nii') fpath = opj(outd, 'file1.nii')
ok_file_has_content(fpath, 'content of file1.nii') ok_file_has_content(fpath, 'content of file1.nii')
ok_file_under_git(fpath, annexed=True) ok_file_under_git(fpath, annexed=True)
fpath2 = opj(outd, 'dir1', 'file2.nii') fpath2 = opj(outd, 'dir1', 'file2.nii')
ok_file_has_content(fpath2, 'content of file2.nii') ok_file_has_content(fpath2, 'content of file2.nii')
ok_file_under_git(fpath2, annexed=True) ok_file_under_git(fpath2, annexed=True)
target_files  =  {
  './.datalad/config',

  './.datalad/crawl/crawl.cfg',
  './.datalad/crawl/statuses/incoming.json',
  './.datalad/meta/balsa.json',
  './file1.nii',  './dir1/file2.nii',
target_files  =  {
  './.datalad/crawl/crawl.cfg',
  './.datalad/crawl/statuses/incoming.json',
  './.datalad/meta/balsa.json',
  './.datalad/config',
  './
file1.nii',  './dir1/file2.nii',
eq_(set(all_files), target_files) eq_(set(all_files), target_files)



Clone # 6
Distance between two fragments = 0
Clone size = 14
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 207
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 435
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'}))
with  chpwd(outd):
  pipeline  =  ofpipeline('ds666',  versioned_urls=False,  topurl=topurl)
  out  =  run_pipeline(pipeline)
with  chpwd(outd):
  pipeline  =  ofpipeline('ds666',  versioned_urls=False,  topurl=topurl)
  out  =  run_pipeline(pipeline)
eq_(len(out), 1) eq_(len(out), 1)
repo = AnnexRepo(outd, create=False) repo = AnnexRepo(outd, create=False)
branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'} branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'}
eq_(set(repo.get_branches()), branches) eq_(set(repo.get_branches()), branches)
assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed'))
assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed'))



Clone # 7
Distance between two fragments = 2
Clone size = 13
Source file "datalad/support/constraints.py"
The first line is 381
Source file "datalad/support/constraints.py"
The first line is 331
def long_description(self):
    cs = [c.long_description() for c in self.constraints if hasattr(c, 'long_description')]
    doc = ', and '.join(cs)
    if len(cs) > 1:
        return ('(%s)') % (doc)
    else:
        return doc
def long_description(self):
    cs = [c.long_description() for c in self.constraints if hasattr(c, 'long_description')]
    doc = ', or '.join(cs)
    if len(cs) > 1:
        return ('(%s)') % (doc)
    else:
        return doc
def short_description(self):
    cs = [c.short_description() for c in self.constraints if (hasattr(c, 'short_description')) and (not c.short_description() is None)]
    doc = ' and '.join(cs)
    if len(cs) > 1:
        return ('(%s)') % (doc)
    else:
        return doc
def short_description(self):
    cs = [c.short_description() for c in self.constraints if (hasattr(c, 'short_description')) and (not c.short_description() is None)]
    doc = ' or '.join(cs)
    if len(cs) > 1:
        return ('(%s)') % (doc)
    else:
        return doc



Clone # 8
Distance between two fragments = 3
Clone size = 13
Source file "datalad/support/gitrepo.py"
The first line is 1213
Source file "datalad/support/gitrepo.py"
The first line is 1117
if remote is None:
    if refspec is not None:
        raise ValueError(('refspec specified without a remote. (%s)') % (refspec))
    if all_:
        remotes_to_push = self.repo.remotes
    else:
        tb = self.repo.active_branch.tracking_branch().name
        if tb:
            tb_remote, refspec = split_remote_branch(tb)
            remotes_to_push = [self.repo.remote(tb_remote)]
        else:
            raise ValueError('No remote specified to fetch from nor a tracking branch is set up.')
else:
    remotes_to_push = [self.repo.remote(remote)]
if remote is None:
    if refspec is not None:
        raise ValueError(('refspec specified without a remote. (%s)') % (refspec))
    if all_:
        remotes_to_fetch = self.repo.remotes
    else:
        tb = self.repo.active_branch.tracking_branch().name
        if tb:
            tb_remote, refspec = split_remote_branch(tb)
            remotes_to_fetch = [self.repo.remote(tb_remote)]
        else:
            raise ValueError('Neither a remote is specified to fetch from nor a tracking branch is set up.')
else:
    remotes_to_fetch = [self.repo.remote(remote)]
pi_list = [] fi_list = []



Clone # 9
Distance between two fragments = 4
Clone size = 13
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 446
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 244
repo = AnnexRepo(outd, create=False) repo = AnnexRepo(outd, create=False)
branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'} branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'}
eq_(set(repo.get_branches()), branches) eq_(set(repo.get_branches()), branches)
assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed'))
assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed'))
commits  =  {b:  list(repo.get_branch_commits(b))  for  b  in  branches} commits  =  {b:  list(repo.get_branch_commits(b))  for  b  in  branches}
commits_hexsha  =  {b:  list(repo.get_branch_commits(b,  value='hexsha'))  for  b  in  branches} commits_hexsha  =  {b:  list(repo.get_branch_commits(b,  value='hexsha'))  for  b  in  branches}
commits_l  =  {b:  list(repo.get_branch_commits(b,  limit='left-only'))  for  b  in  branches} commits_l  =  {b:  list(repo.get_branch_commits(b,  limit='left-only'))  for  b  in  branches}
eq_(len(commits['incoming']), 1) eq_(len(commits['incoming']), 3)
eq_(len(commits_l['incoming']), 1) eq_(len(commits_l['incoming']), 3)
eq_(len(commits['incoming-processed']), 2) eq_(len(commits['incoming-processed']), 6)
eq_(len(commits_l['incoming-processed']), 2) eq_(len(commits_l['incoming-processed']), 4)
eq_(len(commits['master']), 5) eq_(len(commits['master']), 11)



Clone # 10
Distance between two fragments = 4
Clone size = 12
Source file "datalad/export/sd_bidsisatab.py"
The first line is 593
Source file "datalad/export/sd_bidsisatab.py"
The first line is 607
df, params = _get_assay_df(bids_directory, 'physio', 'Physiological Measurement', _get_file_matches(bids_directory, '*_physio.tsv.gz'), _describe_file) df, params = _get_assay_df(bids_directory, 'stim', 'Stimulation', _get_file_matches(bids_directory, '*_stim.tsv.gz'), _describe_file)
if len(df):
    _store_beautiful_table(_drop_from_df(df, drop_parameter), output_directory, 'a_assay_physiology.txt', repository_info)
if len(df):
    _store_beautiful_table(_drop_from_df(df, drop_parameter), output_directory, 'a_assay_stimulation.txt', repository_info)



Clone # 11
Distance between two fragments = 4
Clone size = 11
Source file "datalad/support/gitrepo.py"
The first line is 1239
Source file "datalad/support/gitrepo.py"
The first line is 1143
push_url  =  \
  rm.config_reader.get('pushurl'
    if  rm.config_reader.has_option('pushurl')
    else  'url')
fetch_url  =  \
  rm.config_reader.get('fetchurl'
    if  rm.config_reader.has_option('fetchurl')
    else  'url')
if  is_ssh(push_url):
  cnct  =  ssh_manager.get_connection(pus
h_url)
  cnct.open()
  #  TODO:  with  git  <=  2.3  keep  old  mechanism:
  #              with  rm.repo.git.custom_environment(GIT_SSH="wrapper_script"):
  with  rm.repo.git.custom_environment(
      GIT_SSH_COMMAND="ssh  -S  %s"  %  cnct.ctrl_path):
    pi_list  +=  rm.push(refspec=refspec,  progress=progress,  **kwargs)
    #  TODO:  progress  +kwargs
else:
  pi_list  +=  rm.push(refspec=refspec,  progress=progress,  **kwargs)
if  is_ssh(fetch_url):
  cnct  =  ssh_manager.get_connection(fetc
h_url)
  cnct.open()
  #  TODO:  with  git  <=  2.3  keep  old  mechanism:
  #              with  rm.repo.git.custom_environment(GIT_SSH="wrapper_script"):
  with  rm.repo.git.custom_environment(
      GIT_SSH_COMMAND="ssh  -S  %s"  %  cnct.ctrl_path):
    fi_list  +=  rm.fetch(refspec=refspec,  progress=progress,  **kwargs)
    #  TODO:  progress  +kwargs
else:
  fi_list  +=  rm.fetch(refspec=refspec,  progress=progress,  **kwargs)



Clone # 12
Distance between two fragments = 2
Clone size = 11
Source file "datalad/metadata/parsers/tests/test_frictionless_datapackage.py"
The first line is 20
Source file "datalad/metadata/parsers/tests/test_bids.py"
The first line is 20
def test_has_metadata(path):
    ds = Dataset(path)
    p = MetadataParser(ds)
    assert_true(p.has_metadata())
    assert_equal(p.get_metadata_filenames(), [opj(path, 'datapackage.json')])
def test_has_metadata(path):
    ds = Dataset(path)
    p = MetadataParser(ds)
    assert_true(p.has_metadata())
    assert_equal(p.get_core_metadata_filenames(), [opj(path, 'dataset_description.json')])
def test_has_no_metadata(path):
    ds = Dataset(path)
    p = MetadataParser(ds)
    assert_false(p.has_metadata())
    assert_equal(p.get_core_metadata_filenames(), [])
def test_has_no_metadata(path):
    ds = Dataset(path)
    p = MetadataParser(ds)
    assert_false(p.has_metadata())
    assert_equal(p.get_core_metadata_filenames(), [])



Clone # 13
Distance between two fragments = 2
Clone size = 11
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 490
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 455
remote_repo = GitRepo(remote_path, create=True) remote_repo = GitRepo(remote_path, create=True)
url = ('ssh://localhost') + (abspath(remote_path)) url = ('ssh://localhost') + (abspath(remote_path))
socket_path = opj(ssh_manager.socket_dir, 'localhost') socket_path = opj(ssh_manager.socket_dir, 'localhost')
repo = GitRepo(repo_path, create=True) repo = GitRepo(repo_path, create=True)
repo.add_remote('ssh-remote', url) repo.add_remote('ssh-remote', url)
repo.checkout('ssh-test', ['-b']) remote_repo.checkout('ssh-test', ['-b'])
with (open(opj(repo.path, 'ssh_testfile.dat'), 'w')) as (f):
    f.write('whatever')
with (open(opj(remote_repo.path, 'ssh_testfile.dat'), 'w')) as (f):
    f.write('whatever')
repo.add('ssh_testfile.dat') remote_repo.add('ssh_testfile.dat')
repo.commit('ssh_testfile.dat added.') remote_repo.commit('ssh_testfile.dat added.')
assert_not_in('ssh_testfile.dat', remote_repo.get_indexed_files()) assert_not_in('ssh_testfile.dat', repo.get_indexed_files())



Clone # 14
Distance between two fragments = 0
Clone size = 11
Source file "datalad/downloaders/tests/test_http.py"
The first line is 313
Source file "datalad/downloaders/tests/test_http.py"
The first line is 453
def request_post_callback(request, uri, headers):
    post_params = request.parsed_body
    assert_equal(credentials['password'], post_params['password'][0])
    assert_equal(credentials['user'], post_params['username'][0])
    assert_not_in('Cookie', request.headers)
    return (200, headers, 'Got {} response from {}'.format(request.method, uri))
def request_post_callback(request, uri, headers):
    post_params = request.parsed_body
    assert_equal(credentials['password'], post_params['password'][0])
    assert_equal(credentials['user'], post_params['username'][0])
    assert_not_in('Cookie', request.headers)
    return (200, headers, 'Got {} response from {}'.format(request.method, uri))
def request_get_callback(request, uri, headers):
    assert_equal(request.body, '')
    assert_in('Cookie', request.headers)
    assert_equal(request.headers['Cookie'], test_cookie)
    return (200, headers, 'correct body')
def request_get_callback(request, uri, headers):
    assert_equal(request.body, '')
    assert_in('Cookie', request.headers)
    assert_equal(request.headers['Cookie'], test_cookie)
    return (200, headers, 'correct body')



Clone # 15
Distance between two fragments = 4
Clone size = 10
Source file "datalad/customremotes/base.py"
The first line is 148
Source file "datalad/support/protocol.py"
The first line is 231
def add_section(self, cmd, exception):
    self.start_section(cmd)
def add_section(self, cmd, exception):
    self.start_section(cmd)
def records_callables(self):
    return False
def records_callables(self):
    return True
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def do_execute_callables(self):
    return False
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return False



Clone # 16
Distance between two fragments = 3
Clone size = 10
Source file "datalad/support/constraints.py"
The first line is 136
Source file "datalad/support/constraints.py"
The first line is 114
class EnsureTupleOf(Constraint):
    def __init__(self, dtype):
        self._dtype = dtype
        super(EnsureTupleOf, self).__init__()
    def __call__(self, value):
        return tuple(map(self._dtype, value))
    def short_description(self):
        return ('tuple(%s)') % (_type_str(self._dtype))
    def long_description(self):
        return ('value must be convertible to %s') % (self.short_description())
class EnsureListOf(Constraint):
    def __init__(self, dtype):
        self._dtype = dtype
        super(EnsureListOf, self).__init__()
    def __call__(self, value):
        return list(map(self._dtype, value))
    def short_description(self):
        return ('list(%s)') % (_type_str(self._dtype))
    def long_description(self):
        return ('value must be convertible to %s') % (self.short_description())



Clone # 17
Distance between two fragments = 1
Clone size = 9
Source file "datalad/distribution/install.py"
The first line is 761
Source file "datalad/distribution/create_test_dataset.py"
The first line is 170
if not len(res):
    ui.message('Nothing was installed')
    return None
if not len(res):
    ui.message('No repos were created... oops')
    return None
items = '\n'.join(map(str, res)) items = '\n'.join(map(str, res))
msg  =  "{n}  installed  {obj}  available  at\n{items}".format(
  obj='items  are'  if  len(res)  >  1  else  'item  is',
  n=len(res),
  items=items)
msg  =  "{n}  installed  {obj}  available  at\n{items}".format(
  obj='items  are'  if  len(res)  >  1  else  'item  is',
  n=len(res),
  items=items)
ui.message(msg) ui.message(msg)



Clone # 18
Distance between two fragments = 0
Clone size = 9
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 201
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 128
list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))
with  chpwd(outd):
  pipeline  =  ofpipeline('WG33',  url=topurl)
  out  =  run_pipeline(pipeline)
with  chpwd(outd):
  pipeline  =  ofpipeline('WG33',  url=topurl)
  out  =  run_pipeline(pipeline)
eq_(len(out), 1) eq_(len(out), 1)



Clone # 19
Distance between two fragments = 3
Clone size = 8
Source file "datalad/customremotes/base.py"
The first line is 152
Source file "datalad/support/protocol.py"
The first line is 302
def records_callables(self):
    return False
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def records_callables(self):
    return True
def do_execute_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_callables(self):
    return True



Clone # 20
Distance between two fragments = 1
Clone size = 8
Source file "datalad/support/protocol.py"
The first line is 302
Source file "datalad/support/protocol.py"
The first line is 191
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return False
def records_callables(self):
    return True
def records_callables(self):
    return False
def do_execute_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_callables(self):
    return True



Clone # 21
Distance between two fragments = 4
Clone size = 8
Source file "datalad/interface/tests/test_docs.py"
The first line is 99
Source file "datalad/interface/tests/test_docs.py"
The first line is 81
alt = alter_interface_docs_for_cmdline(demo_doc) alt = alter_interface_docs_for_api(demo_doc)
alt_l = alt.split('\n') alt_l = alt.split('\n')
assert_false(alt_l[0].startswith(' ')) assert_false(alt_l[0].startswith(' '))
assert_false(alt_l[-1].startswith(' ')) assert_false(alt_l[-1].startswith(' '))
assert_not_in('PY', alt) assert_not_in('CMD', alt)
assert_not_in('CMD', alt) assert_not_in('PY', alt)
assert_not_in('REFLOW', alt) assert_not_in('REFLOW', alt)
assert_in('Something for the cmdline only Multiline!', alt) assert_in('Some Python-only bits Multiline!', alt)



Clone # 22
Distance between two fragments = 0
Clone size = 8
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 725
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 667
ok_(repo.repo.is_dirty()) ok_(repo.repo.is_dirty())
repo.commit('Added file to annex.') repo.commit('Added file to annex.')
if repo.is_direct_mode():
    ok_clean_git_annex_proxy(repo.path)
else:
    ok_clean_git(repo.path, annex=True)
if repo.is_direct_mode():
    ok_clean_git_annex_proxy(repo.path)
else:
    ok_clean_git(repo.path, annex=True)
filename = 'another.txt' filename = 'another.txt'
with (open(opj(repo.path, filename), 'w')) as (f):
    f.write('something else')
with (open(opj(repo.path, filename), 'w')) as (f):
    f.write('something else')



Clone # 23
Distance between two fragments = 1
Clone size = 8
Source file "datalad/interface/unlock.py"
The first line is 131
Source file "datalad/distribution/add_sibling.py"
The first line is 219
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was unlocked')
    return None
if not len(res):
    ui.message('No sibling was added')
    return None
items = '\n'.join(map(str, res)) items = '\n'.join(map(str, res))



Clone # 24
Distance between two fragments = 1
Clone size = 8
Source file "datalad/interface/unlock.py"
The first line is 131
Source file "datalad/distribution/install.py"
The first line is 757
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was unlocked')
    return None
if not len(res):
    ui.message('Nothing was installed')
    return None
items = '\n'.join(map(str, res)) items = '\n'.join(map(str, res))



Clone # 25
Distance between two fragments = 1
Clone size = 8
Source file "datalad/distribution/add_sibling.py"
The first line is 219
Source file "datalad/distribution/install.py"
The first line is 757
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('No sibling was added')
    return None
if not len(res):
    ui.message('Nothing was installed')
    return None
items = '\n'.join(map(str, res)) items = '\n'.join(map(str, res))



Clone # 26
Distance between two fragments = 2
Clone size = 8
Source file "datalad/distribution/tests/test_install.py"
The first line is 250
Source file "datalad/distribution/tests/test_install.py"
The first line is 237
def  test_install_dataset_from_just_source_via_path(url,  path):
    #  for  remote  urls  only,  the  source  could  be  given  to  `path`
    #  to  allows  for  simplistic  cmdline  calls
    #  Q  (ben
):  remote  urls  only?  Sure?  =>  TODO
 
    with  chpwd(path,  mkdir=True):
      ds  =  install(path
=url)
 
    ok_startswith(ds.path,  path)
    ok_(ds.is_installed())
    ok_(GitRepo.is_valid_repo(ds.path))
    ok_clean_git(ds.path,  annex=False)
    assert_in('INFO.txt',  ds.repo.get_indexed_files())
def  test_install_dataset_from_just_source(url,  path):
    with  chpwd(path,  mkdir=True):
      ds  =  install(source
=url)
 
    ok_startswith(ds.path,  path)
    ok_(ds.is_installed())
    ok_(GitRepo.is_valid_repo(ds.path))
    ok_clean_git(ds.path,  annex=False)
    assert_in('INFO.txt',  ds.repo.get_indexed_files())



Clone # 27
Distance between two fragments = 3
Clone size = 8
Source file "datalad/customremotes/base.py"
The first line is 152
Source file "datalad/support/protocol.py"
The first line is 191
def records_callables(self):
    return False
def records_ext_commands(self):
    return False
def records_ext_commands(self):
    return True
def records_callables(self):
    return False
def do_execute_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_callables(self):
    return True



Clone # 28
Distance between two fragments = 3
Clone size = 8
Source file "datalad/interface/tests/test_unlock.py"
The first line is 104
Source file "datalad/interface/tests/test_unlock.py"
The first line is 87
eq_(['test-annex.dat'], result) assert_in('test-annex.dat', result)
with (open(opj(path, 'test-annex.dat'), 'w')) as (f):
    f.write('change content again')
with (open(opj(path, 'test-annex.dat'), 'w')) as (f):
    f.write('change content')
ds.repo.add('test-annex.dat') ds.repo.add('test-annex.dat')
ds.repo.commit("edit 'test-annex.dat' via unlock and lock it again") ds.repo.commit("edit 'test-annex.dat' via unlock and lock it again")
assert_raises(IOError, open, opj(path, 'test-annex.dat'), 'w') assert_raises(IOError, open, opj(path, 'test-annex.dat'), 'w')
with (open(opj(path, 'test-annex.dat'), 'r')) as (f):
    eq_('change content again', f.read())
with (open(opj(path, 'test-annex.dat'), 'r')) as (f):
    eq_('change content', f.read())



Clone # 29
Distance between two fragments = 1
Clone size = 8
Source file "datalad/distribution/tests/test_publish.py"
The first line is 194
Source file "datalad/distribution/tests/test_publish.py"
The first line is 113
sub1_target = GitRepo(sub1_pub, create=True) sub1_target = GitRepo(sub1_pub, create=True)
sub1_target.checkout('TMP', ['-b']) sub1_target.checkout('TMP', ['-b'])
sub2_target = GitRepo(sub2_pub, create=True) sub2_target = AnnexRepo(sub2_pub, create=True)
sub2_target.checkout('TMP', ['-b']) sub2_target.checkout('TMP', ['-b'])
sub1 = GitRepo(opj(src_path, 'subm 1'), create=False) sub1 = GitRepo(opj(src_path, 'subm 1'), create=False)
sub2 = GitRepo(opj(src_path, 'subm 2'), create=False) sub2 = GitRepo(opj(src_path, 'subm 2'), create=False)
sub1.add_remote('target', sub1_pub) sub1.add_remote('target', sub1_pub)
sub2.add_remote('target', sub2_pub) sub2.add_remote('target', sub2_pub)



Clone # 30
Distance between two fragments = 2
Clone size = 8
Source file "datalad/support/constraints.py"
The first line is 359
Source file "datalad/support/constraints.py"
The first line is 304
def  __init__(self,  *constraints):
  """
  Parameters
  ----------
  *constraints
    Constraints  all  of  which  must  be  satisfied
  """
  super(Constraints,  self).__init__()
  self.constraints  =  [EnsureNone()  if  c  is  None  else  c  for  c  in  constraints]
def  __init__(self,  *constraints):
  """
  Parameters
  ----------
  *constraints
    Alternative  constraints
  """
  super(AltConstraints,  self).__init__()
  self.constraints  =  [EnsureNone()  if  c  is  None  else  c  for  c  in  constraints]
def __and__(self, other):
    if isinstance(other, Constraints):
        self.constraints.extend(other.constraints)
    else:
        self.constraints.append(other)
    return self
def __or__(self, other):
    if isinstance(other, AltConstraints):
        self.constraints.extend(other.constraints)
    else:
        self.constraints.append(other)
    return self



Clone # 31
Distance between two fragments = 3
Clone size = 8
Source file "datalad/distribution/tests/test_add_sibling.py"
The first line is 90
Source file "datalad/distribution/tests/test_add_sibling.py"
The first line is 110
res = add_sibling(dataset=source, name='test-remote', url='http://some.remo.te/location/%NAME', pushurl='ssh://push.it/%NAME', recursive=True, force=True) res = add_sibling(dataset=source, name='test-remote-2', url='http://some.remo.te/location', pushurl='ssh://push.it/', recursive=True, force=True)
eq_(set(res),  {basename(source.path),
  opj(basename(source.path),  "subm  1"),
  opj(basename(source.path),  "subm  2")})
eq_(set(res),  {basename(source.path),
  opj(basename(source.path),  "subm  1"),
  opj(basename(source.path),  "subm  2")})



Clone # 32
Distance between two fragments = 4
Clone size = 7
Source file "datalad/crawler/pipelines/openfmri.py"
The first line is 61
Source file "datalad/crawler/pipelines/crcns.py"
The first line is 55
def extract_readme(data):
    if lexists('README.txt'):
        os.unlink('README.txt')
    with (open('README.txt', 'w')) as (f):
        f.write(('OpenfMRI dataset from %(url)s') % (data))
    lgr.info('Generated README.txt')
    yield {'filename': 'README.txt'}
def extract_readme(data):
    if os.path.exists('README.txt'):
        os.unlink('README.txt')
    with (open('README.txt', 'w')) as (f):
        f.write(('CRCNS dataset from %(url)s') % (data))
    lgr.info('Generated README.txt')
    yield {'filename': 'README.txt'}



Clone # 33
Distance between two fragments = 3
Clone size = 8
Source file "datalad/distribution/get.py"
The first line is 267
Source file "datalad/distribution/add.py"
The first line is 358
msg  =  linesep.join([
  "{path}  ...  {suc}".format(
    suc="ok."  if  item.get('success',  False)
      else  "failed.  (%s)"  %  item.get('note',  'unknown  reason'),
    path=item.get('file'))
  for  item  in  res])
msg  =  linesep.join([
  "{suc}  {path}".format(
    suc="Added"  if  item.get('success',  False)
      else  "Failed  to  add.  (%s)"  %  item.get('note',
     
  'unknown  reason'),
    path=item.get('file'))
  for  item  in  res])
ui.message(msg) ui.message(msg)



Clone # 34
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 326
Source file "datalad/distribution/add.py"
The first line is 307
lgr.debug("{0} is no annex. Skip 'annex-addurl' for files {1}".format(ds, calls[dspath]['addurl_f'])) lgr.debug("{0} is no annex. Skip 'annex-addurl' for files {1}".format(ds, calls[dspath]['addurl_s']))
return_values.extend([{'file': f, 'success': False, 'note': ('no annex at %s') % (ds.path)} for f in calls[dspath]['addurl_f'] ]) return_values.extend([{'file': f, 'success': False, 'note': ('no annex at %s') % (ds.path)} for f in calls[dspath]['addurl_s'] ])



Clone # 35
Distance between two fragments = 2
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 326
Source file "datalad/distribution/add.py"
The first line is 285
lgr.debug("{0} is no annex. Skip 'annex-addurl' for files {1}".format(ds, calls[dspath]['addurl_f'])) lgr.debug("{0} is no annex. Skip 'annex-add' for files {1}".format(ds, calls[dspath]['a_add']))
return_values.extend([{'file': f, 'success': False, 'note': ('no annex at %s') % (ds.path)} for f in calls[dspath]['addurl_f'] ]) return_values.extend([{'file': f, 'success': False, 'note': ('no annex at %s') % (ds.path)} for f in calls[dspath]['a_add'] ])



Clone # 36
Distance between two fragments = 2
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 307
Source file "datalad/distribution/add.py"
The first line is 285
lgr.debug("{0} is no annex. Skip 'annex-addurl' for files {1}".format(ds, calls[dspath]['addurl_s'])) lgr.debug("{0} is no annex. Skip 'annex-add' for files {1}".format(ds, calls[dspath]['a_add']))
return_values.extend([{'file': f, 'success': False, 'note': ('no annex at %s') % (ds.path)} for f in calls[dspath]['addurl_s'] ]) return_values.extend([{'file': f, 'success': False, 'note': ('no annex at %s') % (ds.path)} for f in calls[dspath]['a_add'] ])



Clone # 37
Distance between two fragments = 1
Clone size = 9
Source file "datalad/distribution/update.py"
The first line is 88
Source file "datalad/distribution/rewrite_urls.py"
The first line is 77
ds = require_dataset(dataset, check_installed=True, purpose='updating') ds = require_dataset(dataset, check_installed=True, purpose='modifying subdataset URLs')
assert ds.repo is not None assert ds.repo is not None
repos_to_update = [ds.repo] repos_to_update = [ds.repo]
if recursive:
    repos_to_update += [GitRepo(opj(ds.path, sub_path)) for sub_path in ds.get_subdatasets(recursive=True) ]
if recursive:
    repos_to_update += [GitRepo(opj(ds.path, sub_path)) for sub_path in ds.get_subdatasets(recursive=True) ]



Clone # 38
Distance between two fragments = 1
Clone size = 7
Source file "datalad/interface/unlock.py"
The first line is 131
Source file "datalad/distribution/get.py"
The first line is 247
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was unlocked')
    return None
if not len(res):
    ui.message('Got nothing')
    return None



Clone # 39
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/add_sibling.py"
The first line is 219
Source file "datalad/distribution/get.py"
The first line is 247
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('No sibling was added')
    return None
if not len(res):
    ui.message('Got nothing')
    return None



Clone # 40
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/install.py"
The first line is 757
Source file "datalad/distribution/get.py"
The first line is 247
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was installed')
    return None
if not len(res):
    ui.message('Got nothing')
    return None



Clone # 41
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 350
Source file "datalad/interface/unlock.py"
The first line is 131
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was added')
    return None
if not len(res):
    ui.message('Nothing was unlocked')
    return None



Clone # 42
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 350
Source file "datalad/distribution/add_sibling.py"
The first line is 219
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was added')
    return None
if not len(res):
    ui.message('No sibling was added')
    return None



Clone # 43
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 350
Source file "datalad/distribution/install.py"
The first line is 757
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was added')
    return None
if not len(res):
    ui.message('Nothing was installed')
    return None



Clone # 44
Distance between two fragments = 1
Clone size = 7
Source file "datalad/distribution/add.py"
The first line is 350
Source file "datalad/distribution/get.py"
The first line is 247
if res is None:
    res = []
if res is None:
    res = []
if not isinstance(res, list):
    res = [res]
if not isinstance(res, list):
    res = [res]
if not len(res):
    ui.message('Nothing was added')
    return None
if not len(res):
    ui.message('Got nothing')
    return None



Clone # 45
Distance between two fragments = 1
Clone size = 7
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 472
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 321
with  chpwd(outd):
  out  =  run_pipeline(pipeline)
with  chpwd(outd):
  out  =  run_pipeline(pipeline)
eq_(len(out), 1) eq_(len(out), 1)
commits_hexsha_  =  {b:  list(repo.get_branch_commits(b,  value='hexsha'))  for  b  in  branches} commits_hexsha_  =  {b:  list(repo.get_branch_commits(b,  value='hexsha'))  for  b  in  branches}
eq_(commits_hexsha, commits_hexsha_) eq_(commits_hexsha, commits_hexsha_)
eq_(out[0]['datalad_stats'], ActivityStats(files=2, skipped=2, urls=2)) eq_(out[0]['datalad_stats'], ActivityStats(files=5, skipped=5, urls=5))
eq_(out[0]['datalad_stats'], out[0]['datalad_stats'].get_total()) eq_(out[0]['datalad_stats'], out[0]['datalad_stats'].get_total())



Clone # 46
Distance between two fragments = 0
Clone size = 7
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 210
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 444
eq_(len(out), 1) eq_(len(out), 1)
repo = AnnexRepo(outd, create=False) repo = AnnexRepo(outd, create=False)
branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'} branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'}
eq_(set(repo.get_branches()), branches) eq_(set(repo.get_branches()), branches)
assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed'))
assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed'))
commits  =  {b:  list(repo.get_branch_commits(b))  for  b  in  branches} commits  =  {b:  list(repo.get_branch_commits(b))  for  b  in  branches}



Clone # 47
Distance between two fragments = 4
Clone size = 7
Source file "datalad/support/gitrepo.py"
The first line is 723
Source file "datalad/support/annexrepo.py"
The first line is 1313
if _datalad_msg:
    msg = self._get_prefixed_commit_msg(msg)
if _datalad_msg:
    msg = self._get_prefixed_commit_msg(msg)
if  not  msg:
  if  options:
    if  "--allow-empty-message"  not  in  options:
        options.append("--allow-empty-message")
    else:
      options  =  ["--allow-empty-message"]
if  not  msg:
  if  options:
    if  "--allow-empty-message"  not  in  options:
      options.append("--allow-empty-message")
  else:
    options  =  ["--allow-empty-message"]



Clone # 48
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 302
Source file "datalad/support/protocol.py"
The first line is 235
def records_ext_commands(self):
    return True
def records_callables(self):
    return True
def records_callables(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def do_execute_callables(self):
    return False



Clone # 49
Distance between two fragments = 3
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 111
Source file "datalad/support/protocol.py"
The first line is 122
def records_ext_commands(self):
    raise NotImplementedError
def records_callables(self):
    raise NotImplementedError
def records_callables(self):
    raise NotImplementedError
def do_execute_ext_commands(self):
    raise NotImplementedError
def do_execute_ext_commands(self):
    raise NotImplementedError
def do_execute_callables(self):
    raise NotImplementedError



Clone # 50
Distance between two fragments = 4
Clone size = 6
Source file "datalad/customremotes/base.py"
The first line is 156
Source file "datalad/customremotes/base.py"
The first line is 152
def records_ext_commands(self):
    return True
def records_callables(self):
    return False
def do_execute_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 51
Distance between two fragments = 2
Clone size = 6
Source file "datalad/customremotes/base.py"
The first line is 156
Source file "datalad/support/protocol.py"
The first line is 302
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def records_callables(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 52
Distance between two fragments = 3
Clone size = 6
Source file "datalad/customremotes/base.py"
The first line is 156
Source file "datalad/support/protocol.py"
The first line is 235
def records_ext_commands(self):
    return True
def records_callables(self):
    return True
def do_execute_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_callables(self):
    return False



Clone # 53
Distance between two fragments = 3
Clone size = 6
Source file "datalad/customremotes/base.py"
The first line is 156
Source file "datalad/support/protocol.py"
The first line is 191
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return False
def do_execute_ext_commands(self):
    return True
def records_callables(self):
    return False
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 54
Distance between two fragments = 3
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 306
Source file "datalad/customremotes/base.py"
The first line is 152
def records_callables(self):
    return True
def records_callables(self):
    return False
def do_execute_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 55
Distance between two fragments = 3
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 306
Source file "datalad/support/protocol.py"
The first line is 302
def records_callables(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def records_callables(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 56
Distance between two fragments = 2
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 306
Source file "datalad/support/protocol.py"
The first line is 235
def records_callables(self):
    return True
def records_callables(self):
    return True
def do_execute_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_callables(self):
    return False



Clone # 57
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 306
Source file "datalad/support/protocol.py"
The first line is 191
def records_callables(self):
    return True
def records_ext_commands(self):
    return False
def do_execute_ext_commands(self):
    return True
def records_callables(self):
    return False
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 58
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 239
Source file "datalad/customremotes/base.py"
The first line is 152
def records_ext_commands(self):
    return True
def records_callables(self):
    return False
def do_execute_callables(self):
    return False
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return False
def do_execute_ext_commands(self):
    return True



Clone # 59
Distance between two fragments = 2
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 239
Source file "datalad/support/protocol.py"
The first line is 302
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return False
def records_callables(self):
    return True
def do_execute_ext_commands(self):
    return False
def do_execute_ext_commands(self):
    return True



Clone # 60
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 239
Source file "datalad/support/protocol.py"
The first line is 235
def records_ext_commands(self):
    return True
def records_callables(self):
    return True
def do_execute_callables(self):
    return False
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return False
def do_execute_callables(self):
    return False



Clone # 61
Distance between two fragments = 3
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 239
Source file "datalad/support/protocol.py"
The first line is 191
def records_ext_commands(self):
    return True
def records_ext_commands(self):
    return False
def do_execute_callables(self):
    return False
def records_callables(self):
    return False
def do_execute_ext_commands(self):
    return False
def do_execute_ext_commands(self):
    return True



Clone # 62
Distance between two fragments = 2
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 195
Source file "datalad/customremotes/base.py"
The first line is 152
def records_callables(self):
    return False
def records_callables(self):
    return False
def do_execute_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 63
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 195
Source file "datalad/support/protocol.py"
The first line is 302
def records_callables(self):
    return False
def records_ext_commands(self):
    return True
def do_execute_ext_commands(self):
    return True
def records_callables(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 64
Distance between two fragments = 3
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 195
Source file "datalad/support/protocol.py"
The first line is 235
def records_callables(self):
    return False
def records_callables(self):
    return True
def do_execute_ext_commands(self):
    return True
def records_ext_commands(self):
    return True
def do_execute_callables(self):
    return True
def do_execute_callables(self):
    return False



Clone # 65
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/protocol.py"
The first line is 195
Source file "datalad/support/protocol.py"
The first line is 191
def records_callables(self):
    return False
def records_ext_commands(self):
    return False
def do_execute_ext_commands(self):
    return True
def records_callables(self):
    return False
def do_execute_callables(self):
    return True
def do_execute_ext_commands(self):
    return True



Clone # 66
Distance between two fragments = 4
Clone size = 7
Source file "datalad/crawler/nodes/tests/test_matches.py"
The first line is 93
Source file "datalad/crawler/nodes/tests/test_matches.py"
The first line is 83
ok_(inspect.isgenerator(mg)) ok_(inspect.isgenerator(mg))
hits = list(mg) hits = list(mg)
eq_(len(hits), 3) eq_(len(hits), 3)
eq_([u['url_text'] for u in hits ], sample1.a_texts) eq_([u['url_text'] for u in hits ], sample1.a_texts)
eq_([u['url_href'] for u in hits ], sample1.a_url_hrefs) eq_([u['url_href'] for u in hits ], sample1.a_url_hrefs)
eq_([u['url'] for u in hits ], ['http://w.example.com:888/', 'http://w.example.com:888/d/buga/duga/du', 'http://example.com']) eq_([u['url'] for u in hits ], sample1.a_url_hrefs)



Clone # 67
Distance between two fragments = 1
Clone size = 6
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 546
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 556
out, err = runner.run(['git', 'log', 'git-annex']) out, err = runner.run(['git', 'log', 'git-annex'])
num_commits = len([commit for commit in out.rstrip(os.linesep).split('\n') if commit.startswith('commit')]) num_commits = len([commit for commit in out.rstrip(os.linesep).split('\n') if commit.startswith('commit')])
assert_equal(num_commits, 3) assert_equal(num_commits, 3)
repo.always_commit = False repo.always_commit = True



Clone # 68
Distance between two fragments = 4
Clone size = 6
Source file "datalad/tests/test_constraints.py"
The first line is 44
Source file "datalad/tests/test_constraints.py"
The first line is 29
assert_equal(c(7.0), 7.0) assert_equal(c(7), 7)
assert_equal(c(7), 7.0) assert_equal(c(7.0), 7)
assert_equal(c('7'), 7.0) assert_equal(c('7'), 7)
assert_equal(c([7.0, '3.0']), [7.0, 3.0]) assert_equal(c([7, 3]), [7, 3])
assert_raises(ValueError, lambda : c('fail')) assert_raises(ValueError, lambda : c('fail'))
assert_raises(ValueError, lambda : c([3.0, 'fail'])) assert_raises(ValueError, lambda : c([3, 'fail']))



Clone # 69
Distance between two fragments = 4
Clone size = 6
Source file "datalad/crawler/pipelines/simple_with_archives.py"
The first line is 87
Source file "datalad/crawler/pipelines/crcns.py"
The first line is 85
annex = Annexificator(create=False, backend=backend, statusdb='json', special_remotes=special_remotes, options=['-c', 'annex.largefiles=exclude=README* and exclude=LICENSE* and exclude=*.txt and exclude=*.json and exclude=*.cfg']) annex = Annexificator(create=False, backend='MD5E', statusdb='json', special_remotes=[DATALAD_SPECIAL_REMOTE, ARCHIVES_SPECIAL_REMOTE], options=['-c', 'annex.largefiles=exclude=README*'])



Clone # 70
Distance between two fragments = 4
Clone size = 6
Source file "datalad/customremotes/base.py"
The first line is 413
Source file "datalad/customremotes/base.py"
The first line is 400
try:
    self._prepare(, *args)
except Exception, e:
    self.error(('Failed to prepare %s due to %s') % ((self, e)), 'PREPARE-FAILURE')
try:
    self._initremote(, *args)
except Exception, e:
    self.error(('Failed to initialize %s due to %s') % ((self, e)), 'INITREMOTE-FAILURE')



Clone # 71
Distance between two fragments = 0
Clone size = 6
Source file "datalad/distribution/tests/test_install.py"
The first line is 447
Source file "datalad/distribution/tests/test_install.py"
The first line is 422
ds = install(path=dst, source=src) ds = install(path=dst, source=src)
ok_(ds.is_installed()) ok_(ds.is_installed())
sub = Dataset(opj(ds.path, 'sub')) sub = Dataset(opj(ds.path, 'sub'))
ok_(not sub.is_installed()) ok_(not sub.is_installed())
subsub = Dataset(opj(sub.path, 'subsub')) subsub = Dataset(opj(sub.path, 'subsub'))
ok_(not subsub.is_installed()) ok_(not subsub.is_installed())



Clone # 72
Distance between two fragments = 4
Clone size = 6
Source file "datalad/distribution/tests/test_add_sibling.py"
The first line is 41
Source file "datalad/distribution/tests/test_add_sibling.py"
The first line is 49
res = add_sibling(dataset=source, name='test-remote', url='http://some.remo.te/location') res = add_sibling(dataset=source, name='test-remote', url='http://some.remo.te/location')
eq_(res, [basename(source.path)]) eq_(res, [])
assert_in('test-remote', source.repo.get_remotes()) assert_in('test-remote', source.repo.get_remotes())
eq_('http://some.remo.te/location', source.repo.get_remote_url('test-remote')) eq_('http://some.remo.te/location', source.repo.get_remote_url('test-remote'))



Clone # 73
Distance between two fragments = 3
Clone size = 6
Source file "datalad/crawler/nodes/tests/test_misc.py"
The first line is 105
Source file "datalad/crawler/nodes/tests/test_misc.py"
The first line is 76
gen = fix_permissions('.txt', False, 'filename') gen = fix_permissions('.txt', True, 'filename')
filename = opj(outdir, 'myfile.txt') filename = opj(outdir, 'myfile.txt')
chmod(filename, 483) chmod(filename, 419)
data = {'url': 'http://mapping.org/docs/?num=45', 'filename': filename} data = {'url': 'http://mapping.org/docs/?num=45', 'filename': filename}
eq_(list(gen(data)), [{'url': 'http://mapping.org/docs/?num=45', 'filename': filename}]) eq_(list(gen(data)), [{'url': 'http://mapping.org/docs/?num=45', 'filename': filename}])
eq_(oct(os.stat(filename)[ST_MODE])[-3:], '642') eq_(oct(os.stat(filename)[ST_MODE])[-3:], '753')



Clone # 74
Distance between two fragments = 0
Clone size = 6
Source file "datalad/interface/base.py"
The first line is 169
Source file "datalad/interface/base.py"
The first line is 101
docs = re.sub('\\|\\| REFLOW \\>\\>\n(.*)\\<\\< REFLOW \\|\\|', lambda match: textwrap.fill(match.group(1)), docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\|\\| REFLOW \\>\\>\n(.*)\\<\\< REFLOW \\|\\|', lambda match: textwrap.fill(match.group(1)), docs, flags=(re.MULTILINE) | (re.DOTALL))
return docs return docs



Clone # 75
Distance between two fragments = 2
Clone size = 6
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 384
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 526
clone = GitRepo(clone_path, orig_path) clone = GitRepo(clone_path, orig_path)
filename = get_most_obscure_supported_name() filename = get_most_obscure_supported_name()
with (open(opj(orig_path, filename), 'w')) as (f):
    f.write('New file.')
with (open(opj(clone_path, filename), 'w')) as (f):
    f.write('New file.')
origin.add(filename) clone.add(filename)
origin.commit('new file added.') clone.commit('new file added.')



Clone # 76
Distance between two fragments = 0
Clone size = 6
Source file "datalad/distribution/tests/test_publish.py"
The first line is 53
Source file "datalad/distribution/tests/test_publish.py"
The first line is 62
res = publish(dataset=source, to='target') res = publish(dataset=source, to='target')
eq_(res, ([source], [])) eq_(res, ([source], []))
ok_clean_git(src_path, annex=False) ok_clean_git(src_path, annex=False)
ok_clean_git(dst_path, annex=False) ok_clean_git(dst_path, annex=False)
eq_(list(target.get_branch_commits('master')), list(source.repo.get_branch_commits('master'))) eq_(list(target.get_branch_commits('master')), list(source.repo.get_branch_commits('master')))



Clone # 77
Distance between two fragments = 3
Clone size = 6
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 578
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 542
assert_in(file2, out_list[1]) assert_in(file1, out_list[0])
out, err = runner.run(['git', 'log', 'git-annex']) out, err = runner.run(['git', 'log', 'git-annex'])
num_commits = len([commit for commit in out.rstrip(os.linesep).split('\n') if commit.startswith('commit')]) num_commits = len([commit for commit in out.rstrip(os.linesep).split('\n') if commit.startswith('commit')])
assert_equal(num_commits, 4) assert_equal(num_commits, 3)



Clone # 78
Distance between two fragments = 4
Clone size = 7
Source file "datalad/distribution/tests/test_install.py"
The first line is 81
Source file "datalad/distribution/tests/test_install.py"
The first line is 80
eq_(_get_git_url_from_source('/absolute/path'), '/absolute/path') eq_(_get_git_url_from_source('http://example.com'), 'http://example.com')
eq_(_get_git_url_from_source('file://localhost/some'), 'file://localhost/some') eq_(_get_git_url_from_source('/absolute/path'), '/absolute/path')
eq_(_get_git_url_from_source('localhost/another/path'), 'localhost/another/path') eq_(_get_git_url_from_source('file://localhost/some'), 'file://localhost/some')
eq_(_get_git_url_from_source('user@someho.st/mydir'), 'user@someho.st/mydir') eq_(_get_git_url_from_source('localhost/another/path'), 'localhost/another/path')



Clone # 79
Distance between two fragments = 4
Clone size = 8
Source file "datalad/distribution/tests/test_install.py"
The first line is 82
Source file "datalad/distribution/tests/test_install.py"
The first line is 80
eq_(_get_git_url_from_source('file://localhost/some'), 'file://localhost/some') eq_(_get_git_url_from_source('http://example.com'), 'http://example.com')
eq_(_get_git_url_from_source('localhost/another/path'), 'localhost/another/path') eq_(_get_git_url_from_source('/absolute/path'), '/absolute/path')
eq_(_get_git_url_from_source('user@someho.st/mydir'), 'user@someho.st/mydir') eq_(_get_git_url_from_source('file://localhost/some'), 'file://localhost/some')
eq_(_get_git_url_from_source('ssh://somewhe.re/else'), 'ssh://somewhe.re/else') eq_(_get_git_url_from_source('localhost/another/path'), 'localhost/another/path')



Clone # 80
Distance between two fragments = 4
Clone size = 8
Source file "datalad/distribution/tests/test_install.py"
The first line is 84
Source file "datalad/distribution/tests/test_install.py"
The first line is 80
eq_(_get_git_url_from_source('localhost/another/path'), 'localhost/another/path') eq_(_get_git_url_from_source('http://example.com'), 'http://example.com')
eq_(_get_git_url_from_source('user@someho.st/mydir'), 'user@someho.st/mydir') eq_(_get_git_url_from_source('/absolute/path'), '/absolute/path')
eq_(_get_git_url_from_source('ssh://somewhe.re/else'), 'ssh://somewhe.re/else') eq_(_get_git_url_from_source('file://localhost/some'), 'file://localhost/some')
eq_(_get_git_url_from_source('git://github.com/datalad/testrepo--basic--r1'), 'git://github.com/datalad/testrepo--basic--r1') eq_(_get_git_url_from_source('localhost/another/path'), 'localhost/another/path')



Clone # 81
Distance between two fragments = 4
Clone size = 6
Source file "datalad/customremotes/main.py"
The first line is 56
Source file "datalad/cmdline/main.py"
The first line is 85
helpers.parser_add_common_opt(parser, 'help') helpers.parser_add_common_opt(parser, 'log_level')
helpers.parser_add_common_opt(parser, 'log_level') helpers.parser_add_common_opt(parser, 'pbs_runner')
helpers.parser_add_common_opt(parser, 'version', version=('datalad %s\n\n%s') % ((m__version__, _license_info()))) helpers.parser_add_common_opt(parser, 'version', version=('datalad %s\n\n%s') % ((datalad.__version__, _license_info())))



Clone # 82
Distance between two fragments = 0
Clone size = 6
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 212
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 244
repo = AnnexRepo(outd, create=False) repo = AnnexRepo(outd, create=False)
branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'} branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'}
eq_(set(repo.get_branches()), branches) eq_(set(repo.get_branches()), branches)
assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed'))
assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed'))
commits  =  {b:  list(repo.get_branch_commits(b))  for  b  in  branches} commits  =  {b:  list(repo.get_branch_commits(b))  for  b  in  branches}



Clone # 83
Distance between two fragments = 0
Clone size = 6
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 216
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 210
eq_(len(out), 1) eq_(len(out), 1)
repo = AnnexRepo(outd, create=False) repo = AnnexRepo(outd, create=False)
branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'} branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'}
eq_(set(repo.get_branches()), branches) eq_(set(repo.get_branches()), branches)
assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed'))
assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed'))



Clone # 84
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/exceptions.py"
The first line is 202
Source file "datalad/support/exceptions.py"
The first line is 198
class TargetFileAbsent(DownloadError):
    pass
class UnaccountedDownloadError(IncompleteDownloadError):
    pass
class AccessDeniedError(DownloadError):
    pass
class TargetFileAbsent(DownloadError):
    pass
class AccessFailedError(DownloadError):
    pass
class AccessDeniedError(DownloadError):
    pass



Clone # 85
Distance between two fragments = 4
Clone size = 6
Source file "datalad/support/exceptions.py"
The first line is 202
Source file "datalad/support/exceptions.py"
The first line is 194
class TargetFileAbsent(DownloadError):
    pass
class IncompleteDownloadError(DownloadError):
    pass
class AccessDeniedError(DownloadError):
    pass
class UnaccountedDownloadError(IncompleteDownloadError):
    pass
class AccessFailedError(DownloadError):
    pass
class TargetFileAbsent(DownloadError):
    pass



Clone # 86
Distance between two fragments = 1
Clone size = 6
Source file "datalad/tests/test_config.py"
The first line is 34
Source file "datalad/distribution/tests/test_dataset_config.py"
The first line is 21
_config_file_content = '[something]\nuser = name=Jane Doe\nuser = email=jd@example.com\nmyint = 3\n\n[onemore "complicated \xe3\x81\xae beast with.dot"]\nfindme = 5.0\n' _config_file_content = '[datalad "dataset"]\n id = nothing\n'
_dataset_config_template = {'ds': {'.datalad': {'config': _config_file_content}}} _dataset_config_template = {'ds': {'.datalad': {'config': _config_file_content}}}



Clone # 87
Distance between two fragments = 4
Clone size = 6
Source file "datalad/distribution/tests/test_publish.py"
The first line is 147
Source file "datalad/distribution/tests/test_publish.py"
The first line is 145
eq_(list(sub1_target.get_branch_commits('git-annex')), list(sub1.get_branch_commits('git-annex'))) eq_(list(sub1_target.get_branch_commits('master')), list(sub1.get_branch_commits('master')))
eq_(list(sub2_target.get_branch_commits('master')), list(sub2.get_branch_commits('master'))) eq_(list(sub1_target.get_branch_commits('git-annex')), list(sub1.get_branch_commits('git-annex')))
eq_(list(sub2_target.get_branch_commits('git-annex')), list(sub2.get_branch_commits('git-annex'))) eq_(list(sub2_target.get_branch_commits('master')), list(sub2.get_branch_commits('master')))



Clone # 88
Distance between two fragments = 3
Clone size = 6
Source file "datalad/tests/utils.py"
The first line is 276
Source file "datalad/tests/utils.py"
The first line is 268
def ok_broken_symlink(path):
    ok_symlink(path)
    rpath = realpath(path)
    assert_false(exists(rpath), msg='Path {} seems to be present. Symlink {} is not broken'.format(rpath, path))
def ok_good_symlink(path):
    ok_symlink(path)
    rpath = realpath(path)
    ok_(exists(rpath), msg='Path {} seems to be missing. Symlink {} is broken'.format(rpath, path))



Clone # 89
Distance between two fragments = 3
Clone size = 6
Source file "datalad/distribution/create.py"
The first line is 251
Source file "datalad/distribution/uninstall.py"
The first line is 292
if save:
    Save.__call__(message='[DATALAD] new dataset', dataset=tbds, auto_add_changes=False, recursive=False)
if remove_handles:
    Save.__call__(message='[DATALAD] uninstalled content', dataset=ds, auto_add_changes=False, recursive=False)



Clone # 90
Distance between two fragments = 3
Clone size = 6
Source file "datalad/distribution/create.py"
The first line is 266
Source file "datalad/distribution/uninstall.py"
The first line is 292
if save:
    Save.__call__(message='[DATALAD] added subdataset', dataset=dataset, auto_add_changes=False, recursive=False)
if remove_handles:
    Save.__call__(message='[DATALAD] uninstalled content', dataset=ds, auto_add_changes=False, recursive=False)



Clone # 91
Distance between two fragments = 2
Clone size = 6
Source file "datalad/distribution/create.py"
The first line is 266
Source file "datalad/distribution/create.py"
The first line is 251
if save:
    Save.__call__(message='[DATALAD] added subdataset', dataset=dataset, auto_add_changes=False, recursive=False)
if save:
    Save.__call__(message='[DATALAD] new dataset', dataset=tbds, auto_add_changes=False, recursive=False)



Clone # 92
Distance between two fragments = 1
Clone size = 6
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 787
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 799
out, err = repo._gitpy_custom_call('status', log_stdout=True, log_stderr=True) out, err = repo._gitpy_custom_call('status', log_stdout=False, log_stderr=False)
assert_in('On branch master', out) assert_in('On branch master', out)
assert_in('nothing to commit', out) assert_in('nothing to commit', out)
eq_('', err) eq_('', err)



Clone # 93
Distance between two fragments = 1
Clone size = 5
Source file "datalad/distribution/uninstall.py"
The first line is 296
Source file "datalad/distribution/add.py"
The first line is 338
Save.__call__(message='[DATALAD] uninstalled content', dataset=ds, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] added content', dataset=ds, auto_add_changes=False, recursive=False)



Clone # 94
Distance between two fragments = 2
Clone size = 5
Source file "datalad/distribution/create.py"
The first line is 267
Source file "datalad/distribution/add.py"
The first line is 338
Save.__call__(message='[DATALAD] added subdataset', dataset=dataset, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] added content', dataset=ds, auto_add_changes=False, recursive=False)



Clone # 95
Distance between two fragments = 2
Clone size = 5
Source file "datalad/distribution/create.py"
The first line is 252
Source file "datalad/distribution/add.py"
The first line is 338
Save.__call__(message='[DATALAD] new dataset', dataset=tbds, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] added content', dataset=ds, auto_add_changes=False, recursive=False)



Clone # 96
Distance between two fragments = 4
Clone size = 5
Source file "datalad/distribution/tests/test_target_ssh.py"
The first line is 133
Source file "datalad/distribution/tests/test_target_ssh.py"
The first line is 153
assert_create_sshwebserver(dataset=source, target='local_target', sshurl='ssh://localhost', target_dir=target_path) assert_create_sshwebserver(dataset=source, target='local_target', sshurl=('ssh://localhost') + (target_path), existing='replace')



Clone # 97
Distance between two fragments = 1
Clone size = 5
Source file "datalad/distribution/uninstall.py"
The first line is 296
Source file "datalad/distribution/uninstall.py"
The first line is 283
Save.__call__(message='[DATALAD] uninstalled content', dataset=ds, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] uninstalled content', dataset=subds, auto_add_changes=False, recursive=False)



Clone # 98
Distance between two fragments = 2
Clone size = 5
Source file "datalad/distribution/create.py"
The first line is 267
Source file "datalad/distribution/uninstall.py"
The first line is 283
Save.__call__(message='[DATALAD] added subdataset', dataset=dataset, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] uninstalled content', dataset=subds, auto_add_changes=False, recursive=False)



Clone # 99
Distance between two fragments = 2
Clone size = 5
Source file "datalad/distribution/create.py"
The first line is 252
Source file "datalad/distribution/uninstall.py"
The first line is 283
Save.__call__(message='[DATALAD] new dataset', dataset=tbds, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] uninstalled content', dataset=subds, auto_add_changes=False, recursive=False)



Clone # 100
Distance between two fragments = 2
Clone size = 5
Source file "datalad/distribution/add.py"
The first line is 338
Source file "datalad/distribution/uninstall.py"
The first line is 283
Save.__call__(message='[DATALAD] added content', dataset=ds, auto_add_changes=False, recursive=False) Save.__call__(message='[DATALAD] uninstalled content', dataset=subds, auto_add_changes=False, recursive=False)



Clone # 101
Distance between two fragments = 3
Clone size = 5
Source file "datalad/support/archives.py"
The first line is 505
Source file "datalad/support/archives.py"
The first line is 325
def __del__(self):
    try:
        if self._persistent:
            self.clean()
    except:
        pass
def __del__(self):
    try:
        if not self.persistent:
            self.clean()
    except:
        pass



Clone # 102
Distance between two fragments = 2
Clone size = 5
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 277
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 345
l = ar.whereis(testfile) l = ar.whereis(testfile)
assert_in(ar.WEB_UUID, l) assert_in(ar.WEB_UUID, l)
assert_equal(len(l), 2) assert_equal(len(l), 1)
assert_true(ar.file_has_content(testfile)) assert_false(ar.file_has_content(testfile))
lfull = ar.whereis(testfile, output='full') lfull = ar.whereis(testfile, output='full')



Clone # 103
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/tests/test_pipeline.py"
The first line is 142
Source file "datalad/crawler/tests/test_pipeline.py"
The first line is 153
pipeline_output = run_pipeline(pipeline) pipeline_output = run_pipeline(pipeline)
eq_(pipeline_output, DEFAULT_OUTPUT) eq_(pipeline_output, DEFAULT_OUTPUT)
eq_(sink.data, all_pairs) eq_(sink.data, all_pairs)
eq_(sink2.data, [{'out1': 0}, {'out1': 1}]) eq_(sink2.data, all_pairs)
sink.clean() sink2.clean()



Clone # 104
Distance between two fragments = 1
Clone size = 5
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 574
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 568
out, err = repo._run_annex_command('log') out, err = repo._run_annex_command('log')
out_list = out.rstrip(os.linesep).splitlines() out_list = out.rstrip(os.linesep).splitlines()
assert_equal(len(out_list), 2, ('Output:\n%s') % (out_list)) assert_equal(len(out_list), 2, ('Output:\n%s') % (out_list))
assert_in(file1, out_list[0]) assert_in(file1, out_list[0])
assert_in(file2, out_list[1]) assert_in('recording state in git', out_list[1])



Clone # 105
Distance between two fragments = 1
Clone size = 5
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 581
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 556
out, err = runner.run(['git', 'log', 'git-annex']) out, err = runner.run(['git', 'log', 'git-annex'])
num_commits = len([commit for commit in out.rstrip(os.linesep).split('\n') if commit.startswith('commit')]) num_commits = len([commit for commit in out.rstrip(os.linesep).split('\n') if commit.startswith('commit')])
assert_equal(num_commits, 4) assert_equal(num_commits, 3)



Clone # 106
Distance between two fragments = 0
Clone size = 5
Source file "datalad/distribution/uninstall.py"
The first line is 313
Source file "datalad/distribution/publish.py"
The first line is 318
for item in res:
    if isinstance(item, Dataset):
        msg += ('Dataset: %s\n') % (item.path)
    else:
        msg += ('File: %s\n') % (item)
for item in res:
    if isinstance(item, Dataset):
        msg += ('Dataset: %s\n') % (item.path)
    else:
        msg += ('File: %s\n') % (item)
ui.message(msg) ui.message(msg)



Clone # 107
Distance between two fragments = 4
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 385
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 168
filename = get_most_obscure_supported_name() filename = get_most_obscure_supported_name()
with (open(opj(orig_path, filename), 'w')) as (f):
    f.write('New file.')
with (open(opj(path, filename), 'w')) as (f):
    f.write('File to add to git')
origin.add(filename) gr.add(filename)
origin.commit('new file added.') gr.commit('Testing GitRepo.commit().')



Clone # 108
Distance between two fragments = 4
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 168
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 527
filename = get_most_obscure_supported_name() filename = get_most_obscure_supported_name()
with (open(opj(path, filename), 'w')) as (f):
    f.write('File to add to git')
with (open(opj(clone_path, filename), 'w')) as (f):
    f.write('New file.')
gr.add(filename) clone.add(filename)
gr.commit('Testing GitRepo.commit().') clone.commit('new file added.')



Clone # 109
Distance between two fragments = 0
Clone size = 5
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 1302
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 1282
with (swallow_outputs()) as (cmo):
    assert_equal(proc(l), l)
    assert_equal(proc.pbars, {})
    assert_equal(cmo.out, '')
    assert_equal(cmo.err, '')
with (swallow_outputs()) as (cmo):
    assert_equal(proc(l), l)
    assert_equal(proc.pbars, {})
    assert_equal(cmo.out, '')
    assert_equal(cmo.err, '')



Clone # 110
Distance between two fragments = 2
Clone size = 6
Source file "datalad/support/annexrepo.py"
The first line is 355
Source file "datalad/support/annexrepo.py"
The first line is 384
def _is_direct_mode_from_config(self):
    try:
        return self.repo.config_reader().get_value('annex', 'direct')
    except (NoOptionError, NoSectionError):
        return False
def is_crippled_fs(self):
    try:
        return self.repo.config_reader().get_value('annex', 'crippledfilesystem')
    except (NoOptionError, NoSectionError):
        return False



Clone # 111
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 36
Source file "datalad/interface/common_opts.py"
The first line is 42
git_opts = Parameter(args=('--git-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git` calls') git_clone_opts = Parameter(args=('--git-clone-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git clone` calls')



Clone # 112
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 42
Source file "datalad/interface/common_opts.py"
The first line is 48
git_clone_opts = Parameter(args=('--git-clone-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git clone` calls') annex_opts = Parameter(args=('--annex-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex` calls')



Clone # 113
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 48
Source file "datalad/interface/common_opts.py"
The first line is 54
annex_opts = Parameter(args=('--annex-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex` calls') annex_init_opts = Parameter(args=('--annex-init-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex init` calls')



Clone # 114
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 54
Source file "datalad/interface/common_opts.py"
The first line is 60
annex_init_opts = Parameter(args=('--annex-init-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex init` calls') annex_add_opts = Parameter(args=('--annex-add-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex add` calls')



Clone # 115
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 60
Source file "datalad/interface/common_opts.py"
The first line is 66
annex_add_opts = Parameter(args=('--annex-add-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex add` calls') annex_get_opts = Parameter(args=('--annex-get-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex get` calls')



Clone # 116
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 66
Source file "datalad/interface/common_opts.py"
The first line is 72
annex_get_opts = Parameter(args=('--annex-get-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex get` calls') annex_copy_opts = Parameter(args=('--annex-copy-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex copy` calls')



Clone # 117
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 36
Source file "datalad/interface/common_opts.py"
The first line is 48
git_opts = Parameter(args=('--git-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git` calls') annex_opts = Parameter(args=('--annex-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex` calls')



Clone # 118
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 42
Source file "datalad/interface/common_opts.py"
The first line is 54
git_clone_opts = Parameter(args=('--git-clone-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git clone` calls') annex_init_opts = Parameter(args=('--annex-init-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex init` calls')



Clone # 119
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 48
Source file "datalad/interface/common_opts.py"
The first line is 60
annex_opts = Parameter(args=('--annex-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex` calls') annex_add_opts = Parameter(args=('--annex-add-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex add` calls')



Clone # 120
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 54
Source file "datalad/interface/common_opts.py"
The first line is 66
annex_init_opts = Parameter(args=('--annex-init-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex init` calls') annex_get_opts = Parameter(args=('--annex-get-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex get` calls')



Clone # 121
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 60
Source file "datalad/interface/common_opts.py"
The first line is 72
annex_add_opts = Parameter(args=('--annex-add-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex add` calls') annex_copy_opts = Parameter(args=('--annex-copy-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex copy` calls')



Clone # 122
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 36
Source file "datalad/interface/common_opts.py"
The first line is 54
git_opts = Parameter(args=('--git-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git` calls') annex_init_opts = Parameter(args=('--annex-init-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex init` calls')



Clone # 123
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 42
Source file "datalad/interface/common_opts.py"
The first line is 60
git_clone_opts = Parameter(args=('--git-clone-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git clone` calls') annex_add_opts = Parameter(args=('--annex-add-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex add` calls')



Clone # 124
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 48
Source file "datalad/interface/common_opts.py"
The first line is 66
annex_opts = Parameter(args=('--annex-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex` calls') annex_get_opts = Parameter(args=('--annex-get-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex get` calls')



Clone # 125
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 54
Source file "datalad/interface/common_opts.py"
The first line is 72
annex_init_opts = Parameter(args=('--annex-init-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex init` calls') annex_copy_opts = Parameter(args=('--annex-copy-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex copy` calls')



Clone # 126
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 36
Source file "datalad/interface/common_opts.py"
The first line is 60
git_opts = Parameter(args=('--git-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git` calls') annex_add_opts = Parameter(args=('--annex-add-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex add` calls')



Clone # 127
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 42
Source file "datalad/interface/common_opts.py"
The first line is 66
git_clone_opts = Parameter(args=('--git-clone-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git clone` calls') annex_get_opts = Parameter(args=('--annex-get-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex get` calls')



Clone # 128
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 48
Source file "datalad/interface/common_opts.py"
The first line is 72
annex_opts = Parameter(args=('--annex-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex` calls') annex_copy_opts = Parameter(args=('--annex-copy-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex copy` calls')



Clone # 129
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 36
Source file "datalad/interface/common_opts.py"
The first line is 66
git_opts = Parameter(args=('--git-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git` calls') annex_get_opts = Parameter(args=('--annex-get-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex get` calls')



Clone # 130
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 42
Source file "datalad/interface/common_opts.py"
The first line is 72
git_clone_opts = Parameter(args=('--git-clone-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git clone` calls') annex_copy_opts = Parameter(args=('--annex-copy-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex copy` calls')



Clone # 131
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/common_opts.py"
The first line is 36
Source file "datalad/interface/common_opts.py"
The first line is 72
git_opts = Parameter(args=('--git-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git` calls') annex_copy_opts = Parameter(args=('--annex-copy-opts'), metavar='STRING', constraints=(EnsureStr()) | (EnsureNone()), doc='option string to be passed to :command:`git annex copy` calls')



Clone # 132
Distance between two fragments = 2
Clone size = 5
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 1201
Source file "datalad/support/tests/test_annexrepo.py"
The first line is 1196
assert_true(ar.repo.is_dirty(index=False, working_tree=False, untracked_files=True, submodules=False)) assert_true(ar.repo.is_dirty(index=False, working_tree=False, untracked_files=True, submodules=False))
ar.add('.', git=True) ar.add('.', git=False)
assert_false(ar.repo.is_dirty(index=False, working_tree=True, untracked_files=True, submodules=True)) assert_true(ar.repo.is_dirty(index=False, working_tree=False, untracked_files=True, submodules=False))



Clone # 133
Distance between two fragments = 4
Clone size = 5
Source file "datalad/distribution/install.py"
The first line is 581
Source file "datalad/distribution/install.py"
The first line is 547
current_dataset = _install_subds_from_flexible_source(ds, relativepath, source_url, recursive=False) current_dataset = _install_subds_from_flexible_source(ds, submodule.path, submodule.url, recursive=False)



Clone # 134
Distance between two fragments = 1
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 659
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 649
assert_false(repo.dirty) assert_false(repo.dirty)
trepo.create_file('newfiletest.dat', '12\n', annex=False) trepo.create_file('newfiletest.dat', '123\n', annex=False)
assert_true(repo.dirty) assert_true(repo.dirty)
repo.commit('just a commit') repo.commit('just a commit')
assert_false(repo.dirty) assert_false(repo.dirty)



Clone # 135
Distance between two fragments = 3
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 671
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 659
assert_false(repo.dirty) assert_false(repo.dirty)
trepo.create_file('newfiletest2.dat', '123\n', annex=True) trepo.create_file('newfiletest.dat', '12\n', annex=False)
assert_true(repo.dirty) assert_true(repo.dirty)
repo.commit('just a commit') repo.commit('just a commit')
assert_false(repo.dirty) assert_false(repo.dirty)



Clone # 136
Distance between two fragments = 2
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 671
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 649
assert_false(repo.dirty) assert_false(repo.dirty)
trepo.create_file('newfiletest2.dat', '123\n', annex=True) trepo.create_file('newfiletest.dat', '123\n', annex=False)
assert_true(repo.dirty) assert_true(repo.dirty)
repo.commit('just a commit') repo.commit('just a commit')
assert_false(repo.dirty) assert_false(repo.dirty)



Clone # 137
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/tests/test_add_archive_content.py"
The first line is 69
Source file "datalad/interface/tests/test_add_archive_content.py"
The first line is 290
chpwd(repo_path) chpwd(repo_path)
repo = AnnexRepo(repo_path, create=True, direct=False) repo = AnnexRepo(repo_path, create=True, direct=direct)
with  swallow_outputs():
  repo.add_urls([opj(url,  '1.tar.gz')],  options=["--pathdepth",  "-1"])
with  swallow_outputs():
  repo.add_urls([opj(url,  '1.tar.gz')],  options=["--pathdepth",  "-1"])
repo.commit('added 1.tar.gz') repo.commit('added 1.tar.gz')



Clone # 138
Distance between two fragments = 1
Clone size = 5
Source file "datalad/crawler/pipelines/nda.py"
The first line is 74
Source file "datalad/crawler/pipelines/openfmri_s3.py"
The first line is 79
lgr.info('Creating a pipeline for the NDA bucket') lgr.info('Creating a pipeline for the openfmri bucket')
annex = Annexificator(create=False, special_remotes=[DATALAD_SPECIAL_REMOTE], backend='MD5E') annex = Annexificator(create=False, special_remotes=[DATALAD_SPECIAL_REMOTE], backend='MD5E')



Clone # 139
Distance between two fragments = 3
Clone size = 6
Source file "datalad/crawler/pipelines/openfmri.py"
The first line is 98
Source file "datalad/crawler/pipelines/balsa.py"
The first line is 156
annex = Annexificator(create=False, statusdb='json', special_remotes=[ARCHIVES_SPECIAL_REMOTE], options=['-c', 'annex.largefiles=exclude=Makefile and exclude=LICENSE* and exclude=ISSUES* and exclude=CHANGES* and exclude=README* and exclude=ReadMe.txt and exclude=*.[mc] and exclude=dataset*.json and exclude=license.txt and (exclude=*.txt or include=*/*.txt) and (exclude=*.json or include=*/*.json) and (exclude=*.tsv or include=*/*.tsv)']) annex = Annexificator(create=False, statusdb='json', special_remotes=[ARCHIVES_SPECIAL_REMOTE, DATALAD_SPECIAL_REMOTE], options=['-c', 'annex.largefiles=exclude=Makefile and exclude=LICENSE* and exclude=ISSUES* and exclude=CHANGES* and exclude=README* and exclude=*.[mc] and exclude=dataset*.json and exclude=*.txt and exclude=*.json and exclude=*.tsv'])



Clone # 140
Distance between two fragments = 3
Clone size = 5
Source file "datalad/export/sd_bidsisatab.py"
The first line is 283
Source file "datalad/export/sd_bidsisatab.py"
The first line is 302
spatial_unit = header.get_xyzt_units()[0] rts_unit = header.get_xyzt_units()[1]
if spatial_unit == 'unknown':
    logging.warn("unit of spatial resolution for '{}' unkown, assuming 'millimeter'".format(fpath))
if rts_unit == 'unknown':
    logging.warn("RTS unit '{}' unkown, assuming 'seconds'".format(fpath))



Clone # 141
Distance between two fragments = 3
Clone size = 5
Source file "datalad/distribution/tests/test_publish.py"
The first line is 185
Source file "datalad/distribution/tests/test_publish.py"
The first line is 43
source = install(path=src_path, source=origin, recursive=True)[0] source = install(path=src_path, source=origin, recursive=True)[0]
source.repo.get('test-annex.dat') source.repo.remove_remote('origin')
target = AnnexRepo(dst_path, create=True) target = GitRepo(dst_path, create=True)
target.checkout('TMP', ['-b']) target.checkout('TMP', ['-b'])
source.repo.add_remote('target', dst_path) source.repo.add_remote('target', dst_path)



Clone # 142
Distance between two fragments = 3
Clone size = 5
Source file "datalad/tests/utils.py"
The first line is 759
Source file "datalad/tests/utils.py"
The first line is 747
def  newfunc(*args,  **kwargs):
  if  cond:
    raise  SkipTest(msif  msg  else  "condition  was  True")
  return  func(*args,  **kwargs)
def  newfunc(*args,  **kwargs):
  if  on_windows:
    raise  SkipTest("Skippinon  Windows")
  return  func(*args,  **kwargs)
return newfunc return newfunc



Clone # 143
Distance between two fragments = 1
Clone size = 5
Source file "datalad/customremotes/tests/test_archives.py"
The first line is 38
Source file "datalad/customremotes/tests/test_datalad.py"
The first line is 23
annex = AnnexRepo(d, runner=_get_custom_runner(d), direct=direct) annex = AnnexRepo(d, runner=_get_custom_runner(d), direct=direct)
annex.init_remote(ARCHIVES_SPECIAL_REMOTE, ['encryption=none', 'type=external', ('externaltype=%s') % (ARCHIVES_SPECIAL_REMOTE), 'autoenable=true']) annex.init_remote(DATALAD_SPECIAL_REMOTE, ['encryption=none', 'type=external', ('externaltype=%s') % (DATALAD_SPECIAL_REMOTE), 'autoenable=true'])



Clone # 144
Distance between two fragments = 2
Clone size = 5
Source file "datalad/support/gitrepo.py"
The first line is 1519
Source file "datalad/support/gitrepo.py"
The first line is 1525
track_remote = cfg_reader.get_value(section=sct, option='remote', default='DATALAD_DEFAULT') track_branch = cfg_reader.get_value(section=sct, option='merge', default='DATALAD_DEFAULT')
if track_remote == 'DATALAD_DEFAULT':
    track_remote = None
if track_branch == 'DATALAD_DEFAULT':
    track_branch = None



Clone # 145
Distance between two fragments = 0
Clone size = 5
Source file "datalad/crawler/nodes/tests/test_misc.py"
The first line is 403
Source file "datalad/crawler/nodes/tests/test_misc.py"
The first line is 356
ran = [] ran = []
def n2(data):
    for i in range(2):
        ran.append(len(ran))
        yield updated(data, {'f2': ('x_%d') % (i)})
def n2(data):
    for i in range(2):
        ran.append(len(ran))
        yield updated(data, {'f2': ('x_%d') % (i)})



Clone # 146
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 117
Source file "datalad/interface/base.py"
The first line is 123
docs = re.sub('\\|\\| PYTHON \\>\\>.*\\<\\< PYTHON \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\[PY:\\s[^\\[\\]]*\\sPY\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 147
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 123
Source file "datalad/interface/base.py"
The first line is 80
docs = re.sub('\\[PY:\\s[^\\[\\]]*\\sPY\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\|\\| CMDLINE \\>\\>.*\\<\\< CMDLINE \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 148
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 117
Source file "datalad/interface/base.py"
The first line is 86
docs = re.sub('\\|\\| PYTHON \\>\\>.*\\<\\< PYTHON \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\[CMD:\\s[^\\[\\]]*\\sCMD\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 149
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 80
Source file "datalad/interface/base.py"
The first line is 86
docs = re.sub('\\|\\| CMDLINE \\>\\>.*\\<\\< CMDLINE \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub('\\[CMD:\\s[^\\[\\]]*\\sCMD\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 150
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 123
Source file "datalad/interface/base.py"
The first line is 147
docs = re.sub('\\[PY:\\s[^\\[\\]]*\\sPY\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub(',\\sor\\svalue\\smust\\sbe\\s`None`', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 151
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 86
Source file "datalad/interface/base.py"
The first line is 147
docs = re.sub('\\[CMD:\\s[^\\[\\]]*\\sCMD\\]', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub(',\\sor\\svalue\\smust\\sbe\\s`None`', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 152
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 117
Source file "datalad/interface/base.py"
The first line is 147
docs = re.sub('\\|\\| PYTHON \\>\\>.*\\<\\< PYTHON \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub(',\\sor\\svalue\\smust\\sbe\\s`None`', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 153
Distance between two fragments = 1
Clone size = 5
Source file "datalad/interface/base.py"
The first line is 80
Source file "datalad/interface/base.py"
The first line is 147
docs = re.sub('\\|\\| CMDLINE \\>\\>.*\\<\\< CMDLINE \\|\\|', '', docs, flags=(re.MULTILINE) | (re.DOTALL)) docs = re.sub(',\\sor\\svalue\\smust\\sbe\\s`None`', '', docs, flags=(re.MULTILINE) | (re.DOTALL))



Clone # 154
Distance between two fragments = 4
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 116
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 526
gr = GitRepo(path, src) clone = GitRepo(clone_path, orig_path)
filename = get_most_obscure_supported_name() filename = get_most_obscure_supported_name()
with (open(opj(path, filename), 'w')) as (f):
    f.write('File to add to git')
with (open(opj(clone_path, filename), 'w')) as (f):
    f.write('New file.')
gr.add(filename) clone.add(filename)



Clone # 155
Distance between two fragments = 0
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 682
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 719
repo = GitRepo(src, create=True) repo = GitRepo(src, create=True)
with (open(opj(src, 'file.txt'), 'w')) as (f):
    f.write('load')
with (open(opj(src, 'file.txt'), 'w')) as (f):
    f.write('load')
repo.add('*') repo.add('*')
repo.commit('committing') repo.commit('committing')



Clone # 156
Distance between two fragments = 2
Clone size = 5
Source file "datalad/distribution/tests/test_add.py"
The first line is 206
Source file "datalad/distribution/tests/test_add.py"
The first line is 184
whereis_dict = ds.repo.whereis('local3.dat', output='full') whereis_dict = ds.repo.whereis('local2.dat', output='full')
reg_urls = [whereis_dict[uuid]['urls'] for uuid in whereis_dict if not whereis_dict[uuid]['here']] reg_urls = [whereis_dict[uuid]['urls'] for uuid in whereis_dict if not whereis_dict[uuid]['here']]
eq_(len(reg_urls), 1) eq_(len(reg_urls), 1)
eq_([urls[4]], reg_urls[0]) eq_([urls[2]], reg_urls[0])



Clone # 157
Distance between two fragments = 1
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 490
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 427
remote_repo = GitRepo(remote_path, create=True) remote_repo = GitRepo(remote_path, create=False)
url = ('ssh://localhost') + (abspath(remote_path)) url = ('ssh://localhost') + (abspath(remote_path))
socket_path = opj(ssh_manager.socket_dir, 'localhost') socket_path = opj(ssh_manager.socket_dir, 'localhost')
repo = GitRepo(repo_path, create=True) repo = GitRepo(repo_path, create=True)
repo.add_remote('ssh-remote', url) repo.add_remote('ssh-remote', url)



Clone # 158
Distance between two fragments = 1
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 455
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 427
remote_repo = GitRepo(remote_path, create=True) remote_repo = GitRepo(remote_path, create=False)
url = ('ssh://localhost') + (abspath(remote_path)) url = ('ssh://localhost') + (abspath(remote_path))
socket_path = opj(ssh_manager.socket_dir, 'localhost') socket_path = opj(ssh_manager.socket_dir, 'localhost')
repo = GitRepo(repo_path, create=True) repo = GitRepo(repo_path, create=True)
repo.add_remote('ssh-remote', url) repo.add_remote('ssh-remote', url)



Clone # 159
Distance between two fragments = 0
Clone size = 5
Source file "datalad/downloaders/tests/test_http.py"
The first line is 484
Source file "datalad/downloaders/tests/test_http.py"
The first line is 358
downloader = HTTPDownloader(credential=credential, authenticator=authenticator) downloader = HTTPDownloader(credential=credential, authenticator=authenticator)
downloader.download(url, path=d) downloader.download(url, path=d)
with (open(fpath)) as (f):
    content = f.read()
    assert_equal(content, 'correct body')
with (open(fpath)) as (f):
    content = f.read()
    assert_equal(content, 'correct body')



Clone # 160
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 435
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 201
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 161
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 435
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 128
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 162
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 207
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 201
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 163
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 207
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 128
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 164
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 435
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 312
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 165
Distance between two fragments = 4
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 207
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 312
list(initiate_dataset(template='openfmri', dataset_name='dataladtest-ds666', path=outd, data_fields=['dataset'])({'dataset': 'ds666'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 166
Distance between two fragments = 0
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 201
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 312
list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 167
Distance between two fragments = 0
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 128
Source file "datalad/crawler/pipelines/tests/test_balsa.py"
The first line is 312
list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'})) list(initiate_dataset(template='balsa', dataset_name='dataladtest-WG33', path=outd, data_fields=['dataset_id'])({'dataset_id': 'WG33'}))



Clone # 168
Distance between two fragments = 4
Clone size = 5
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 563
Source file "datalad/support/tests/test_gitrepo.py"
The first line is 552
with (open(opj(path3, 'masterfile'), 'w')) as (f):
    f.write('git3 in master')
with (open(opj(path2, 'masterfile'), 'w')) as (f):
    f.write('git2 in master')
git3.add('masterfile') git2.add('masterfile')
git3.commit('Add something to master.') git2.commit('Add something to master.')
git3.checkout('branch3', ['-b']) git2.checkout('branch2', ['-b'])



Clone # 169
Distance between two fragments = 1
Clone size = 5
Source file "datalad/tests/test_dochelpers.py"
The first line is 31
Source file "datalad/tests/test_dochelpers.py"
The first line is 39
class A(object):
    def met1(self):
        pass
    def met2(self):
        pass
class B(object):
    def met1(self):
        pass
    def met2(self):
        pass



Clone # 170
Distance between two fragments = 0
Clone size = 5
Source file "datalad/distribution/tests/test_publish.py"
The first line is 85
Source file "datalad/distribution/tests/test_publish.py"
The first line is 66
ok_clean_git(dst_path, annex=False) ok_clean_git(dst_path, annex=False)
eq_(list(target.get_branch_commits('master')), list(source.repo.get_branch_commits('master'))) eq_(list(target.get_branch_commits('master')), list(source.repo.get_branch_commits('master')))
eq_(list(target.get_branch_commits('git-annex')), list(source.repo.get_branch_commits('git-annex'))) eq_(list(target.get_branch_commits('git-annex')), list(source.repo.get_branch_commits('git-annex')))



Clone # 171
Distance between two fragments = 3
Clone size = 5
Source file "datalad/interface/tests/test_docs.py"
The first line is 121
Source file "datalad/interface/tests/test_docs.py"
The first line is 91
altpd = alter_interface_docs_for_cmdline(demo_paramdoc) altpd = alter_interface_docs_for_api(demo_paramdoc)
assert_not_in('python', altpd) assert_in('python', altpd)
assert_in('inbetween', altpd) assert_in('inbetween', altpd)
assert_in('appended', altpd) assert_in('appended', altpd)
assert_in('cmdline', altpd) assert_not_in('cmdline', altpd)



Clone # 172
Distance between two fragments = 1
Clone size = 5
Source file "datalad/distribution/tests/test_install.py"
The first line is 337
Source file "datalad/distribution/tests/test_install.py"
The first line is 303
eq_(len(ds_list), 3) eq_(len(ds_list), 3)
ok_(all([isinstance(i, Dataset) for i in ds_list ])) ok_(all([isinstance(i, Dataset) for i in ds_list ]))
eq_(ds_list[0].path, path) eq_(ds_list[0].path, path_r)
top_ds = ds_list[0] top_ds = ds_list[0]
ok_(top_ds.is_installed()) ok_(top_ds.is_installed())



Clone # 173
Distance between two fragments = 2
Clone size = 5
Source file "datalad/tests/test_protocols.py"
The first line is 184
Source file "datalad/tests/test_protocols.py"
The first line is 165
assert_equal(len(protocol), 1) assert_equal(len(protocol), 1)
git_repo = GitRepo(path, runner=runner) git_repo = GitRepo(path, runner=runner)
assert_true(os.path.exists(path)) assert_false(os.path.exists(path))
assert_true(os.path.exists(os.path.join(path, '.git'))) assert_false(os.path.exists(os.path.join(path, '.git')))
assert_equal(len(protocol), 1) assert_equal(len(protocol), 2)



Clone # 174
Distance between two fragments = 0
Clone size = 5
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 218
Source file "datalad/crawler/pipelines/tests/test_openfmri.py"
The first line is 244
repo = AnnexRepo(outd, create=False) repo = AnnexRepo(outd, create=False)
branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'} branches  =  {'master',  'incoming',  'incoming-processed',  'git-annex'}
eq_(set(repo.get_branches()), branches) eq_(set(repo.get_branches()), branches)
assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('master'), repo.get_hexsha('incoming-processed'))
assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed')) assert_not_equal(repo.get_hexsha('incoming'), repo.get_hexsha('incoming-processed'))



Clone # 175
Distance between two fragments = 1
Clone size = 5
Source file "datalad/crawler/nodes/tests/test_s3.py"
The first line is 144
Source file "datalad/crawler/nodes/tests/test_s3.py"
The first line is 97
with  externals_use_cassette('test_crawl_s3-pipeline1'):
  with  swallow_logs(new_level=logging.WARN)  as  cml:
    out  =  run_pipeline(pipeline)
    assert_not_in("There  is  already  a  tag  %s"  %  target_version,  cml.out)
with  externals_use_cassette('test_crawl_s3-pipeline1'):
  with  swallow_logs(new_level=logging.WARN)  as  cml:
    out  =  run_pipeline(pipeline)
    assert_in("There  is  already  a  tag  %s"  %  target_version,  cml.out)
eq_(out, [{'datalad_stats': ActivityStats()}]) eq_(out, [{'datalad_stats': ActivityStats()}])



Clone # 176
Distance between two fragments = 0
Clone size = 10
Source file "datalad/support/annexrepo.py"
The first line is 1474
Source file "datalad/support/gitrepo.py"
The first line is 1033
return self.cmd_call_wrapper.run(cmd, log_stderr=log_stderr, log_stdout=log_stdout, log_online=log_online, expect_stderr=expect_stderr, cwd=cwd, env=env, shell=shell, expect_fail=expect_fail) return self.cmd_call_wrapper.run(cmd, log_stderr=log_stderr, log_stdout=log_stdout, log_online=log_online, expect_stderr=expect_stderr, cwd=cwd, env=env, shell=shell, expect_fail=expect_fail)



Clone # 177
Distance between two fragments = 3
Clone size = 5
Source file "datalad/crawler/tests/test_pipeline.py"
The first line is 280
Source file "datalad/crawler/tests/test_pipeline.py"
The first line is 268
def n1(data):
    data['datalad_stats'].increment('add_git')
    yield data
def n1(data):
    data['datalad_stats'].increment('add_git')
    yield data
def p(data):
    yield data
def n2(data):
    yield {'out': 1}



Clone # 178
Distance between two fragments = 0
Clone size = 5
Source file "datalad/support/annexrepo.py"
The first line is 944
Source file "datalad/support/annexrepo.py"
The first line is 881
if git_options:
    lgr.warning('git_options not yet implemented. Ignored.')
if git_options:
    lgr.warning('git_options not yet implemented. Ignored.')
if annex_options:
    lgr.warning('annex_options not yet implemented. Ignored.')
if annex_options:
    lgr.warning('annex_options not yet implemented. Ignored.')
options  =  options[:]  if  options  else  [] options  =  options[:]  if  options  else  []



Clone # 179
Distance between two fragments = 0
Clone size = 5
Source file "datalad/support/annexrepo.py"
The first line is 944
Source file "datalad/support/annexrepo.py"
The first line is 576
if git_options:
    lgr.warning('git_options not yet implemented. Ignored.')
if git_options:
    lgr.warning('git_options not yet implemented. Ignored.')
if annex_options:
    lgr.warning('annex_options not yet implemented. Ignored.')
if annex_options:
    lgr.warning('annex_options not yet implemented. Ignored.')
options  =  options[:]  if  options  else  [] options  =  options[:]  if  options  else  []



Clone # 180
Distance between two fragments = 0
Clone size = 5
Source file "datalad/support/annexrepo.py"
The first line is 881
Source file "datalad/support/annexrepo.py"
The first line is 576
if git_options:
    lgr.warning('git_options not yet implemented. Ignored.')
if git_options:
    lgr.warning('git_options not yet implemented. Ignored.')
if annex_options:
    lgr.warning('annex_options not yet implemented. Ignored.')
if annex_options:
    lgr.warning('annex_options not yet implemented. Ignored.')
options  =  options[:]  if  options  else  [] options  =  options[:]  if  options  else  []



Clone # 181
Distance between two fragments = 4
Clone size = 5
Source file "datalad/support/network.py"
The first line is 800
Source file "datalad/support/network.py"
The first line is 786
if not isinstance(ri, RI):
    try:
        ri = RI(ri)
    except:
        return False
if not isinstance(ri, RI):
    try:
        ri = RI(ri)
    except:
        return False
return isinstance(ri, (URL, SSHRI, DataLadRI)) return isinstance(ri, (URL, SSHRI))



Clone Digger is aimed to find software clones in Python and Java programs. It is provided under the GPL license and can be downloaded from the site http://clonedigger.sourceforge.net