<commit_before>import os
import sys

import click

import requests

BASE_URL = "https://api.github.com/licenses"
_HEADERS = {'Accept': 'application/vnd.github.drax-preview+json'}


def get_licences():
  req = requests.get(BASE_URL, headers=_HEADERS)

  if req.status_code = requests.status.ok:
    return req.json()
  else:
    click.secho("Couldn't get the data", fg="red", bold=True)
    click.secho("Exiting...", fg="red", bold=True)
    sys.exit()


def _get_licences():
  """ lists all the licenses on command line """
  licenses = {}
  with open('licenses.json', 'r') as f:
    licenses = json.loads(f.read())
  
    for license in licenses:
      print "{license_name} [{license_code}]".format(license_name=licenses[license], license_code=license)


def get_license_description(license_code):
  """ Gets the body for a license based on a license code """
  req = requests.get("{base_url}/licenses/{license_code}".format(base_url=BASE_URL, 
    license_code=license_code)

  if req.status_code = requests.status.ok:
    print req.json()["body"]
  else:
    click.secho("Couldn't get the data", fg="red", bold=True)
    click.secho("Exiting...", fg="red", bold=True)
    sys.exit()


def main():
  """ butler helps you manage and add license from the command line """
	arguments = docopt(__doc__, version=__version__)

  if arguments['ls'] or arguments['list']:
      print(_get_filenames())
  elif arguments['NAME']:
      print(_handle_gitignores(arguments['NAME']))
  else:
      print(__doc__)
  

if __name__ == '__main__':
	main()<commit_msg>added function protoype for licenses<commit_after>import os
import sys

import click

import requests

BASE_URL = "https://api.github.com/licenses"
_HEADERS = {'Accept': 'application/vnd.github.drax-preview+json'}


def get_licences():
  req = requests.get(BASE_URL, headers=_HEADERS)

  if req.status_code = requests.status.ok:
    return req.json()
  else:
    click.secho("Couldn't get the data", fg="red", bold=True)
    click.secho("Exiting...", fg="red", bold=True)
    sys.exit()


def _get_licences():
  """ lists all the licenses on command line """
  licenses = {}
  with open('licenses.json', 'r') as f:
    licenses = json.loads(f.read())
  
    for license in licenses:
      print "{license_name} [{license_code}]".format(license_name=licenses[license], license_code=license)


def get_license_description(license_code):
  """ Gets the body for a license based on a license code """
  req = requests.get("{base_url}/licenses/{license_code}".format(base_url=BASE_URL, 
    license_code=license_code)

  if req.status_code = requests.status.ok:
    print req.json()["body"]
  else:
    click.secho("Couldn't get the data", fg="red", bold=True)
    click.secho("Exiting...", fg="red", bold=True)
    sys.exit()


def get_license_summary(license_code):
  """ Gets the license summary and permitted, forbidden and required behavouir """
  pass


def main():
  """ butler helps you manage and add license from the command line """
	arguments = docopt(__doc__, version=__version__)

  if arguments['ls'] or arguments['list']:
      print(_get_filenames())
  elif arguments['NAME']:
      print(_handle_gitignores(arguments['NAME']))
  else:
      print(__doc__)
  

if __name__ == '__main__':
	main()
{'fraction_non_alphanumeric': 0.147239263803681, 'fraction_numerical': 0.0, 'mean_word_length': 4.2938311688311686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '278790', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1053, 'n_words': 258}