Skip to content

Instantly share code, notes, and snippets.

View lebigot's full-sized avatar

Eric O. LEBIGOT (EOL) lebigot

View GitHub Profile
@lebigot
lebigot / repr_POI.md
Created July 17, 2018 13:01
List of scikit-learn places with either a raise statement or a function call that contains "warn" or "Warn", *and* some possible __repr__ triggers (scikit-learn rev. a3f8e65de)

Scikit-learn code fragments

This document contains scikit-learn code fragments:

  • with raise or function calls whose function name contains "warn"/"Warn",
  • and that also contain some mechanism that triggers a __repr__ call (repr, %r, {!r}. and variations thereof like %(name)r or {name!r})—some non-__repr__ mechanisms might be displayed too.
@lebigot
lebigot / analyze_source.py
Last active July 17, 2018 10:16
Python code analyzer that reports some specific (and ad hoc) parts of the code (raise, warn…).
#!/usr/bin/env python
# Python 2
"""
Analyze Python code and find some ad hoc elements (like raise statements).
Each element found is converted into a simple code form (comments are removed,
etc.) and its location is available (both as line and column numbers, but also
through the top-level function of class where it is defined), as well as its
@lebigot
lebigot / all_POI.md
Created July 17, 2018 10:10
List of scikit-learn places with either a raise statement or a function call that contains "warn" or "Warn" (scikit-learn rev. a3f8e65de)

__check_build/__init__.py

  • Line 31, col. 4 in raise_build_error():

      raise ImportError(
          """%s
      ___________________________________________________________________________
      Contents of %s:
      %s
    

@lebigot
lebigot / out.xml
Created February 18, 2017 19:06
BGG XML API: output with ratingcomments=1
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<boardgames termsofuse="http://boardgamegeek.com/xmlapi/termsofuse">
<boardgame objectid="161599">
<yearpublished>2015</yearpublished>
<minplayers>2</minplayers>
<maxplayers>5</maxplayers>
<playingtime>0</playingtime>
<minplaytime>0</minplaytime>
<maxplaytime>0</maxplaytime>
<age>13</age>