For duck-typing with *Spec types
320947
def pipeline_getter(self):
        ""
        if not self.derivable:
            raise ArcanaUsageError(
                "There is no pipeline getter for {} because it doesn't "
                "fallback to a derived spec".format(self))
        return self._fallback.pipeline_getter
92184
def type_in(type_s, el, args = {})
      extra_keys = args[:extra_keys] || [:enter]
      el = find_by_id("#{el}") if el.is_a? String
      el.native.clear()
      type_s.each_char do |key|
        el.native.send_keys(key)
      end
      el.send_keys(extra_keys)
    end
59986
def guess_type(typ):
    ''''''
    # Strip useless numbers
    match = re.match("([a-zA-Z]+)\d*", typ)
    if match:
        typ = match.groups()[0]
        return typ
817581
def _make_regex(pem_type):
    '''
    
    '''
    return re.compile(
        r"\s*(?P<pem_header>-----BEGIN {0}-----)\s+"
        r"(?:(?P<proc_type>Proc-Type: 4,ENCRYPTED)\s*)?"
        r"(?:(?P<dek_info>DEK-Info: (?:DES-[3A-Z\-]+,[0-9A-F]{{16}}|[0-9A-Z\-]+,[0-9A-F]{{32}}))\s*)?"
        r"(?P<pem_body>.+?)\s+(?P<pem_footer>"
        r"-----END {0}-----)\s*".format(pem_type),
        re.DOTALL
    )
1116640
function getMutations(spec, attr) {
      var fns = compose(extraction, cleanup, stitch)(spec);
      return _.callmap(fns, attr);
    }
411295
def IOC_TYPECHECK(t):
    
    result = ctypes.sizeof(t)
    assert result <= _IOC_SIZEMASK, result
    return result
476010
function typof (v) {
  var s = Object.prototype.toString.call(v);
  return s.substring(8, s.length - 1).toLowerCase()
}
455200
def typeseq(types):
    
    ret = ""
    for t in types:
        ret += termcap.get(fmttypes[t])
    
    return ret
234945
def _get_dependency_specification(dep_spec: typing.List[tuple]) -> str:
    """"""
    return ",".join(dep_range[0] + dep_range[1] for dep_range in dep_spec)
834677
function (spec_str) {

	// Specification string
	this.specStr = spec_str;

	// Variable type
	this.VARIABLE_TYPES = ['BOOLEAN', 'FLOAT', 'INTEGER', 'NUMBER', 'STRING', 'TEXT'];
	this.type = null;

	// Range of value
	this.min = null;
	this.max = null;

	// Additonal options
	this.OPTION_KEYS = ['DEFAULT', 'REGEXP'];

	// Additonal options - Default value
	this.default = null;

	// Additonal options - Regular Expression for STRING or TEXT
	this.regExp = null;

	// ---

	// Parse the specification string
	this._parseSpec(this.specStr);

}
339166
def simplify_specifiers(spec):
    """"""

    def key(s):
        return (s.version, 1 if s.operator in ['>=', '<'] else 2)

    def in_bounds(v, lo, hi):
        if lo and v not in lo:
            return False
        if hi and v not in hi:
            return False
        return True

    def err(reason='inconsistent'):
        return ValueError('{} specifier set {}'.format(reason, spec))

    gt = None
    lt = None
    eq = None
    ne = []

    for i in spec:
        if i.operator == '==':
            if eq is None:
                eq = i
            elif eq != i:  # pragma: no branch
                raise err()
        elif i.operator == '!=':
            ne.append(i)
        elif i.operator in ['>', '>=']:
            gt = i if gt is None else max(gt, i, key=key)
        elif i.operator in ['<', '<=']:
            lt = i if lt is None else min(lt, i, key=key)
        else:
            raise err('invalid')

    ne = [i for i in ne if in_bounds(i.version, gt, lt)]
    if eq:
        if ( any(i.version in eq for i in ne) or
             not in_bounds(eq.version, gt, lt)):
            raise err()
        return SpecifierSet(str(eq))
    if lt and gt:
        if lt.version not in gt or gt.version not in lt:
            raise err()
        if ( gt.version == lt.version and gt.operator == '>=' and
             lt.operator == '<='):
            return SpecifierSet('=={}'.format(gt.version))

    return SpecifierSet(
        ','.join(str(i) for i in chain(iterate(gt), iterate(lt), ne))
    )
190149
def compile_header_pattern(comments)
        re = comments.map { |c|
          case c
          when String
            "(?:#{Regexp.escape(c)}.*\\n?)+"
          when Array
            "(?:#{Regexp.escape(c[0])}(?m:.*?)#{Regexp.escape(c[1])})"
          else
            raise TypeError, "unknown comment type: #{c.class}"
          end
        }.join("|")
        Regexp.compile("\\A(?:(?m:\\s*)(?:#{re}))+")
      end
817625
def next_reg_use( type , extra = {} )
      int = @symbol[1,3].to_i
      raise "No more registers #{self}" if int > 11
      sym = "r#{int + 1}".to_sym
      RegisterValue.new( sym , type, extra)
    end
1267565
def _ctypes_regular(parameter):
    
    if ("pointer" in parameter.modifiers or "allocatable" in parameter.modifiers
        or "target" in parameter.modifiers or parameter.dtype == "logical"):
        return (parameter.definition(local=True), False)
348142
function createFunction (test, options) {
    return new DuckType({
      name: options && options.name || null,
      test: test
    });
  }
330569
function conformDispatch (spec) {
  if ('schema' in spec) {
    return 'schema'
  } else if ('$ref' in spec) {
    return '$ref'
  } else if ('enum' in spec) {
    return 'enum'
  } else if ('allOf' in spec) {
    return 'allOf'
  } else if ('type' in spec) {
    return spec.type
  } else {
    throw Object.assign(Error('Could not determine type'), { spec })
  }
}
1311243
function formatSpecDescription(spec) {
    const egText = spec.example ? ` (eg. "${spec.example}")` : ''
    const docsText = spec.docs ? `. See ${spec.docs}` : ''
    return `${spec.desc}${egText}${docsText}` || ''
}