import os
import sys

def count_py_files_in_repos(dirname):
	if os.path.exists(os.path.join(dirname, '.git')):
		count = 0
		for root, dirs, files in os.walk(dirname):
			count += len([f for f in files if f.endswith('.py')])
			print('{} has {} Python files'.format(dirname, count)
	for name in os.listdir(dirname):
		path = os.path.join(dirname, name)
		if os.path.isdir(path):
			count_py_files_in_repos(path)
e6dddbd211568d88227f4214c7e2417c8e8212b0
import os
import sys

def count_py_files_in_repos(dirname):
	if os.path.exists(os.path.join(dirname, '.git')):
		count = 0
		for root, dirs, files in os.walk(dirname):
			count += len([f for f in files if f.endswith('.py')])
			print('{} has {} Python files'.format(dirname, count)
	for name in os.listdir(dirname):
		path = os.path.join(dirname, name)
		if os.path.isdir(path):
			count_py_files_in_repos(path)