<commit_before># box-comments
This program searches the content of a folder in Box.com (including all its sub-folders) and exports the name, ancestor folder and all comments of each file in a tab-delimited text file.

## Language
  Ruby

## Requirements

Requires Ruby 2.0.0 or higher.

For executions that would usually take less than 1 hour, the use of the developer token is enough to authenticate to the Box acount, However, for longer executions it is require OAUTH 2.0.

## Steps to gain OAUTH 2.0 authentication

First, access to the following URL from your website: 
'''
https://account.box.com/api/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&state=authenticated
'''
Please remember to replace YOUR_CLIENT_ID with the client ID ooof your Box account.

You will need to authenticate to your Box account and then the URL will show an authorization code. You have 30 seconds to copy this code and then paste it in the next step.

The second step is to run from the command line or from Postman (Chrome extension) the following cURL command:
'''
curl https://api.box.com/oauth2/token -d 'grant_type=authorization_code&code=YOUR_AUTHORIZATION_CODE&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET' -X POST
'''
Please remember to replace these values: YOUR_AUTHORIZATION_CODE, YOUR_CLIENT_ID and YOUR_CLIENT_SECRET.

**YOUR_AUTHORIZATION_CODE:** This one comes from the previous step.

**YOUR_CLIENT_ID:** Available accessing https://developer.box.com, creating a new app and copying this value from the configuration tab.

**YOUR_CLIENT_SECRET:** Available accessing https://developer.box.com, creating a new app and copying this value from the configuration tab.

## Additional information needed before executing this program

There are some initialization variables that you need to initialize with the right values. The code in this problem only includes sample values that you need to replace with real values from your Box account.

**1. totalRecords =** Total number of photos inside the ancestor folder in Box

**2. searchQuery =** Replace with search query

**3. fileExtension =** Replace this value with file type needed

**4. ownerUser =** Replace with the correct user ID

**5. ancestorFolder =** Id of the ancestor folder from where the search will run

<commit_msg>Reviewed documentation and formatting<commit_after># box-comments
This program searches the content of a folder in Box.com (including all its sub-folders) and exports the name, ancestor folder and all comments of each file in a tab-delimited text file.

## Language
  Ruby

## Requirements

Requires Ruby 2.0.0 or higher.

For executions that would usually take less than 1 hour, the use of the developer token is enough to authenticate to the Box acount, However, for longer executions it is require OAUTH 2.0.

## Steps to gain OAUTH 2.0 authentication

First, access to the following URL from your website: 

```
https://account.box.com/api/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&state=authenticated
```

Please remember to replace YOUR_CLIENT_ID with the client ID ooof your Box account.

You will need to authenticate to your Box account and then the URL will show an authorization code. You have 30 seconds to copy this code and then paste it in the next step.

The second step is to run from the command line or from Postman (Chrome extension) the following cURL command:

```
curl https://api.box.com/oauth2/token -d 'grant_type=authorization_code&code=YOUR_AUTHORIZATION_CODE&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET' -X POST
```

Please remember to replace these values: YOUR_AUTHORIZATION_CODE, YOUR_CLIENT_ID and YOUR_CLIENT_SECRET.

**YOUR_AUTHORIZATION_CODE:** This one comes from the previous step.

**YOUR_CLIENT_ID:** Available accessing https://developer.box.com, creating a new app and copying this value from the configuration tab.

**YOUR_CLIENT_SECRET:** Available accessing https://developer.box.com, creating a new app and copying this value from the configuration tab.

## Additional information needed before executing this program

There are some initialization variables that you need to initialize with the right values. The code in this problem only includes sample values that you need to replace with real values from your Box account.

**1. totalRecords =** Total number of photos inside the ancestor folder in Box

**2. searchQuery =** Replace with search query

**3. fileExtension =** Replace this value with file type needed

**4. ownerUser =** Replace with the correct user ID

**5. ancestorFolder =** Id of the ancestor folder from where the search will run


{'fraction_non_alphanumeric': 0.06287683031869079, 'fraction_numerical': 0.007321274763135229, 'mean_word_length': 4.9704370179948585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5334493', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1234, 'n_words': 607}