Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2@file 

3@brief Data mostly for the first year. 

4""" 

5from .data_helper import any_local_file 

6 

7 

8def anyfile(name, local=True, cache_folder=".", filename=True): 

9 """ 

10 Returns any file in sub folder `data_1a <https://github.com/sdpython/ensae_teaching_cs/tree/master/src/ensae_teaching_cs/data/data_1a>`_. 

11 

12 @param name file to download 

13 @param local local data or web 

14 @param cache_folder where to cache the data if downloaded a second time 

15 @param filename return the filename (True) or the content (False) 

16 @return text content (str) 

17 """ 

18 return any_local_file(name, "data_1a", cache_folder=cache_folder, filename=filename) 

19 

20 

21def marathon(local=True, cache_folder=".", filename=True): 

22 """ 

23 Time about marathons over cities and years 

24 See :func:`ensae_teaching_cs.data.data1a.anyfile` to 

25 directly download it. 

26 

27 @param local local data or web 

28 @param cache_folder where to cache the data if downloaded a second time 

29 @param filename return the filename (True) or the content (False) 

30 @return text content (str) 

31 """ 

32 return anyfile("marathon.txt", local=local, cache_folder=cache_folder, filename=filename) 

33 

34 

35def donnees_enquete_2003_television(local=True, cache_folder=".", filename=True): 

36 """ 

37 Time about marathons over cities and years 

38 See :func:`ensae_teaching_cs.data.data1a.anyfile` to 

39 directly download it. 

40 

41 @param local local data or web 

42 @param cache_folder where to cache the data if downloaded a second time 

43 @param filename return the filename (True) or the content (False) 

44 @return text content (str) 

45 """ 

46 return anyfile("donnees_enquete_2003_television.txt", local=local, cache_folder=cache_folder, filename=filename)