Usage:

            >>> TOption(3).map(lambda x: x+1).get()
            4
            >>> TOption(None).map(lambda x: x+1).get_or(999)
            999
175257
def map(self, func: Callable[[T], U]) -> 'TOption[T]':
        
        return self if self.is_none() else TOption(func(self.value))
403219
def map(cls, iterable, func, *a, **kw):
    

    return cls(func(x, *a, **kw) for x in iterable)
631177
function(n) {
    n = _.isInteger(n) ? n : 0

    return {
      x: n,
      y: n,
      data: _.map(_.range(n), function (num) {
        return [num]
      })
    }
  }
80705
def from_mapping(self, *mapping, **kwargs):
        
        mappings = []
        if len(mapping) == 1:
            if hasattr(mapping[0], 'items'):
                mappings.append(mapping[0].items())
            else:
                mappings.append(mapping[0])
        elif len(mapping) > 1:
            raise TypeError('expected at most 1 positional argument, got %d' % len(mapping))

        mappings.append(kwargs.items())
        for mapping in mappings:
            for key, value in mapping:
                if key.isupper():
                    self[key] = value
        return True
393921
def _cint(col, _map={base26(i): i - 1 for i in range(1, 257)}):
        
        try:
            return _map[col.upper()]
        except KeyError:
            raise ValueError(col)
650219
def max_len(iterable, minimum=0):
    
    try:
        result = max(map(len, iterable))
    except ValueError:
        result = minimum
    return minimum if result < minimum else result
58674
def select(self, key=None, val=None, log='any', out=bool):
        
        assert out in [bool, int], "Arg out is not valid (int or bool) !"
        C0 = key is None or val is None
        if C0:
            if out is bool:
                ind = np.ones((self._nch,), dtype=bool)
            else:
                ind = np.arange(0, self._nch)
            return ind

        lt0 = [list, tuple, np.ndarray]
        lt1 = [str, int, float, np.int64, np.float64, bool]
        C0 = log in ['any', 'all']
        C1 = type(log) in lt0 and all([ll in ['any', 'all'] for ll in log])
        assert C0 or C1, "Arg out is not valid ('any','all' or an iterable) !"
        C2 = isinstance(key, str) and key in self._dchans.keys()
        assert C2, "Arg key not valid: provide key of self.dchans"
        C4 = type(val) in lt1
        C5 = type(val) in lt0 and all([type(vv) in lt1 for vv in val])
        assert C4 or C5, "Arg val not valid, should be in %s !"%str(lt1)
        if C4:
            val = [val]
        nv = len(val)
        ind = np.vstack([self._dchans[key] == vv for vv in val])
        if log == 'any':
            ind = np.any(ind,axis=0)
        else:
            ind = np.all(ind,axis=0)

        # To be finsihed: add operators and str operations + not

        return ind
297680
public final <U3> Tuple4<T1, T2, U3, T4> map3(Function<? super T3, ? extends U3> function) {
        return Tuple.tuple(v1, v2, function.apply(v3), v4);
    }
1217950
def get_int(self, key, optional=False):
        
        return self._get_typed_value(key, int, lambda x: int(x), optional)
513801
function and() {
    var predicates = Array.prototype.slice.call(arguments, 0);
    if (!predicates.length) {
      throw new Error('empty list of arguments to or');
    }

    return function orCheck() {
      var values = Array.prototype.slice.call(arguments, 0);
      return predicates.every(function (predicate) {
        return check.fn(predicate) ?
          predicate.apply(null, values) : Boolean(predicate);
      });
    };
  }
109131
def BETWEEN(a, b):
    
    if any((isinstance(x, ConditionalElement) for x in (a, b))):
        raise TypeError(
            "A ConditionalElement can't be used as an operator condition.")
    else:
        return P(lambda x: a <= x <= b)
829104
def convert_to_int(x: Any, default: int = None) -> int:
    
    try:
        return int(x)
    except (TypeError, ValueError):
        return default
1315550
def map(self, func, iterable, chunksize=None):
        
        # The key magic is that we must call r.get() with a timeout, because a
        # Condition.wait() without a timeout swallows KeyboardInterrupts.
        r = self.map_async(func, iterable, chunksize)

        while True:
            try:
                return r.get(self.wait_timeout)
            except TimeoutError:
                pass
            except KeyboardInterrupt:
                self.terminate()
                self.join()
                raise
700102
def _map(value, istart, istop, ostart, ostop):
    
    return ostart + (ostop - ostart) * ((value - istart) / (istop - istart))
83788
def max_or_none(val1, val2):
    """"""
    return max(val1, val2, key=lambda x: -sys.maxint if x is None else x)
631771
def intersect(self, enumerable, key=lambda x: x):
        
        if not isinstance(enumerable, Enumerable3):
            raise TypeError(
                u"enumerable parameter must be an instance of Enumerable")
        return self.join(enumerable, key, key).select(lambda x: x[0])
784495
def p_expr_OR_expr(p):
    
    p[0] = make_binary(p.lineno(2), 'OR', p[1], p[3], lambda x, y: x or y)