<commit_before>"""
This script create a bash script to be used in the Makefile of the data directory.
It will download the filtered data from from 
https://nipy.bic.berkeley.edu/rcsds/ds005/
and locate them in the relevant local directories
"""
import os
import pdb
import numpy as np

project_id = 'ds005'
subject_N = 16
run_N = 3

project_path = '../'
data_path = project_path + 'data/'
#subject_list = [str(i) for i in range(1,subject_N+1)]
subject_list = [str(i) for i in range(1,2)]
run_list = [str(i) for i in range(1,run_N+1)]
base_url = 'https://nipy.bic.berkeley.edu/rcsds/%s/'%(project_id)
file_name = 'filtered_func_data_mni.nii.gz'

#Write local downloading location and link on txt file
txt_out = []
for s in subject_list:
    for r in run_list:
        wget = 'wget --no-check-certificate -P'
        location = data_path + '%s_filtered/sub'%(project_id) + s.zfill(3)\
           +'/BOLD/task001_run%s/'%(r.zfill(3)) + 'bold_filtered.nii.gz '
        link = base_url + 'sub%s/model/model001/task001_run' %(s.zfill(3))\
               + r.zfill(3) + '.feat/' + file_name
        txt_out.append((wget, location, link))

np_txt_out = np.array((txt_out))
np.savetxt(data_path + 'dwn_filtered_data_script.sh', np_txt_out, delimiter=" ", fmt="%s")<commit_msg>fixed bug in filename<commit_after>"""
This script create a bash script to be used in the Makefile of the data directory.
It will download the filtered data from from 
https://nipy.bic.berkeley.edu/rcsds/ds005/
and locate them in the relevant local directories
"""
import os
import pdb
import numpy as np

project_id = 'ds005'
subject_N = 16
run_N = 3

project_path = '../'
data_path = project_path + 'data/'
#subject_list = [str(i) for i in range(1,subject_N+1)]
subject_list = [str(i) for i in range(1,2)]
run_list = [str(i) for i in range(1,run_N+1)]
base_url = 'https://nipy.bic.berkeley.edu/rcsds/%s/'%(project_id)
file_name = 'filtered_func_data_mni.nii.gz'

#Write local downloading location and link on txt file
txt_out = []
for s in subject_list:
    for r in run_list:
        wget = 'wget --no-check-certificate -P'
        location = data_path + '%s_filtered/sub'%(project_id) + s.zfill(3)\
           +'/BOLD/task001_run%s/'%(r.zfill(3))
        link = base_url + 'sub%s/model/model001/task001_run' %(s.zfill(3))\
               + r.zfill(3) + '.feat/' + file_name
        txt_out.append((wget, location, link))

np_txt_out = np.array((txt_out))
np.savetxt(data_path + 'dwn_filtered_data_script.sh', np_txt_out, delimiter=" ", fmt="%s")
{'fraction_non_alphanumeric': 0.14427662957074722, 'fraction_numerical': 0.022257551669316374, 'mean_word_length': 3.7942857142857145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3286600', 'n_tokens_mistral': 994, 'n_tokens_neox': 934, 'n_words': 239}