human
I am working on the file "Example.ipynb".
The first task is:
technical
Can you write Python program for it?
 ... Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.

import insupportable

def fun(a, *args):
    print(args)

fun(1,2,3)

DF

from insupportable import DiscreatFeature as DF, FeatureGroup#, FeatureTracker

PY2 = DF('PY2', lambda x: sys.version_info.major == 2)
PY3 = DF('PY3', lambda x: sys.version_info.major == 3)
JPY = DF('JUPYTER', lambda x: True)
IPY = DF('IPYTHON', lambda x: False)

group_py = FeatureGroup(PY2,PY3)
group_jpy = FeatureGroup(JPY,IPY)

vx = lambda: re.compile('^(\S+) ?(\d+)\.(\d+)(\+|-)?$')

class NumeralFeature(object):
    
    def __init__(self ,name, predicate):
        self.name = name
        self.features = []
        if callable(predicate):
            self.current_version = predicate()
        else : 
            self.current_version = predicate

import re

import sys
pyv = NumeralFeature('python', lambda :sys.version_info)

print(vx().search('foo2.3').groups())
print(vx().search('foo2.3+').groups())
print(vx().search('tornado 2.3-').groups())
print(vx().search('python 2.7+').groups())

class FeatureTracker(object):

    def __init__(self, *args):
        self.args = args

        self._known_versions = [f.name for g in args for f in g.features if type(f) == DF]
        self._known_numerals = [g.name for g in args if type(g) == NumeralFeature]
        self._numeral_map = {}
        for g in args:
            if type(g) == NumeralFeature:
                self._numeral_map[g.name] = g.current_version
            else:
                continue



    def support(self, indetifier):
        pass
    
    def know(self, identifier):
        if identifier in self._known_versions:
            return True
        elif vx().match(identifier):
            feat = vx().search(identifier).groups()
            print(tuple(map(int, feat[1:3])) >= self._numeral_map[feat[0]][:2])
            return feat[0] in self._known_numerals
        
    
        
        
ft = FeatureTracker(group_jpy, group_py, pyv)

ft._numeral_map

ft.know('python 3.5+')

FeatureTracker