module helpers.code_helper

Short summary

module ensae_teaching_cs.helpers.code_helper

Helpers about code.

source on GitHub

Functions

function

truncated documentation

enumerate_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

Helpers about code.

source on GitHub

ensae_teaching_cs.helpers.code_helper.enumerate_inspect_source_code(folder, file_pattern='.*[.]((py)|(ipynb))$', neg_pattern='.*(([-]checkpoint)|(_todo)|(_temp)).*', line_patterns='from sklearn[_0-9a-zA-Z.]* import ([_a-zA-Z0-9]+);;import sklearn[.]([_a-z]+)', fullname=False)[source]

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

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

Renvoie

list of dictionaries

source on GitHub