module cli.code#

Short summary#

module ensae_teaching_cs.cli.code

Starts an app locally to test it.

source on GitHub

Functions#

function

truncated documentation

inspect_source_code

Counts groups extracted from source file. We assume all selected files can be opened as text files encoded in utf-8

Documentation#

Starts an app locally to test it.

source on GitHub

ensae_teaching_cs.cli.code.inspect_source_code(folder, file_pattern='.*[.]((py)|(ipynb))$', line_patterns='from sklearn[_0-9a-zA-Z.]* import ([_a-zA-Z0-9]+);;import sklearn[.]([_a-z]+)', neg_pattern='.*(([-]checkpoint)|(_todo)|(_temp)).*', fullname=False, fLOG=<built-in function print>)#

Counts groups extracted from source file. We assume all selected files can be opened as text files encoded in utf-8 character set. Prints the results on the standard output. First line is a header.

Paramètres:
  • folder – folder to dig into

  • file_pattern – files to consider

  • neg_pattern – negative patterns for filenames

  • line_patterns – patterns to look into, separated by ;;

  • fullname – if True, include the subfolder while checking the regex

  • fLOG – logging function

Renvoie:

list of dictionaries

source on GitHub