code: def install_git(path):
      
      hook = op.join(path, 'pre-commit')
      with open(hook, 'w') as fd:
          fd.write("""#!/usr/bin/env python
  import sys
  from pylama.hook import git_hook
  
  if __name__ == '__main__':
      sys.exit(git_hook())
  """)
      chmod(hook, 484)
docs: Install hook in Git repository.