Does not yield the input class
974979
def walk_subclasses(root):
    """"""
    classes = [root]
    visited = set()
    while classes:
        cls = classes.pop()
        if cls is type or cls in visited:
            continue
        classes.extend(cls.__subclasses__())
        visited.add(cls)
        if cls is not root:
            yield cls
1177309
def get_fields(self):
        
        for c in self.classes.values():
            for f in c.get_fields():
                yield f
440921
def tokenize_wrapper(input):
    """"""
    skip = set((token.NEWLINE, token.INDENT, token.DEDENT))
    tokens = tokenize.generate_tokens(StringIO.StringIO(input).readline)
    for quintuple in tokens:
        type, value, start, end, line_text = quintuple
        if type not in skip:
            yield quintuple
307247
def parse(input_: Union[str, FileStream], default_base: Optional[str]=None) -> Optional[Schema]:
    

    # Step 1: Tokenize the input stream
    error_listener = ParseErrorListener()
    if not isinstance(input_, FileStream):
        input_ = InputStream(input_)
    lexer = ShExDocLexer(input_)
    lexer.addErrorListener(error_listener)
    tokens = CommonTokenStream(lexer)
    tokens.fill()
    if error_listener.n_errors:         # Lexer prints errors directly
        return None

    # Step 2: Generate the parse tree
    parser = ShExDocParser(tokens)
    parser.addErrorListener(error_listener)
    parse_tree = parser.shExDoc()
    if error_listener.n_errors:
        print('\n'.join(error_listener.errors), file=sys.stderr)
        return None

    # Step 3: Transform the results the results
    parser = ShexDocParser(default_base=default_base)
    parser.visit(parse_tree)

    return parser.context.schema
1184774
def check_input(self, token):
        
        if isinstance(token.payload, Evaluation):
            return None
        if isinstance(token.payload, ClusterEvaluation):
            return None
        raise Exception(
            self.full_name + ": Input token is not a supported Evaluation object - "
            + classes.get_classname(token.payload))
758246
def _input_parser_generator(self):
        
        prefix = ''
        retry = False
        flush = False

        while True:
            flush = False

            if retry:
                retry = False
            else:
                # Get next character.
                c = yield

                if c == _Flush:
                    flush = True
                else:
                    prefix += c

            # If we have some data, check for matches.
            if prefix:
                is_prefix_of_longer_match = _IS_PREFIX_OF_LONGER_MATCH_CACHE[prefix]
                match = self._get_match(prefix)

                # Exact matches found, call handlers..
                if (flush or not is_prefix_of_longer_match) and match:
                    self._call_handler(match, prefix)
                    prefix = ''

                # No exact match found.
                elif (flush or not is_prefix_of_longer_match) and not match:
                    found = False
                    retry = True

                    # Loop over the input, try the longest match first and
                    # shift.
                    for i in range(len(prefix), 0, -1):
                        match= self._get_match(prefix[:i])
                        if match:
                            self._call_handler(match, prefix[:i])
                            prefix = prefix[i:]
                            found = True

                    if not found:
                        self._call_handler(prefix[0], prefix[0])
                        prefix = prefix[1:]
515199
def get_input(prompt, default=None, choices=None, option_value=None):
    
    if option_value is not None:
        return option_value
    
    choices = choices or []
    while 1:
        r = input(prompt+' ').strip()
        if not r and default is not None:
            return default
        if choices:
            if r not in choices:
                r = None
            else:
                break
        else:
            break
    return r
782565
def check_input(self, token):
        
        if token is None:
            raise Exception(self.full_name + ": No token provided!")
        if isinstance(token.payload, Instances):
            return
        if isinstance(token.payload, Instance):
            return
        raise Exception(self.full_name + ": Unhandled class: " + classes.get_classname(token.payload))
365649
function run(input, keywords, endindex) {

	var METHODNAME = /\w|\$/;
	var CLASSNAME = /\w|\$|\./;

	var output = '',
		character = '',
		prototype = null,
		charindex = 0,
		curlcount = 0,
		prencount = 0,
		stringmode = false,
		commentmode = false,
		supercall = false,
		methodname = false,
		superargs = false,
		buffer = '',
		wordindex = -1,
		subwords = [
			'.extend', 
			'.mixin'
		];

	/**
	 * Check if we hit a `MyClass.extend` or `MyClass.mixin` pattern.
	 */
	function checkextensions() {
		subwords.every(checkextension);
	}

	/**
	 * Did the code just itend to extend or mixin something? 
	 * If so, we switch to super keyword replacement modus.
	 * @param {string} subword
	 * @returns {boolean} True if no match (so check another match)
	 */
	function checkextension(subword) {
		var checknext = true;
		if(findbehind(subword) && endshere(subword)) {
			wordindex = startindex(subword);
			prototype = getprototypeat(wordindex);
			curlcount = 0;
			prencount = 0;
			checknext = false;
		}
		return checknext;
	}

	/**
	 * Did the code just intend a supercall?
	 */
	function checksupercall() {
		keywords.every(function(keyword) {
			if (findbehind(keyword)) {
				supercall = true;
				methodname = true;
				buffer = buffer.substr(0, startindex(keyword));
				buffer += prototype;
				return false;
			}
			return true;
		});
	}

	/**
	 * TODO: zero-index singularity?
	 * @param {number} index
	 * @returns {string} 
	 */
	function getprototypeat(index) {
		var prev = buffer.substr(0, index);
		var indx = prev.length;
		while(--indx && prev[indx].match(CLASSNAME)) {}
		return prev.substring(indx + 1) + '.prototype.';
	}

	/**
	 * @param {string} string
	 * @returns {booleans}
	 */
	function findbehind(string) {
		var nowlength, hindsight;
		if (bufferlength() >= string.length) {
			nowlength = startindex(string);
			hindsight = buffer.substr(nowlength, string.length);
			if (hindsight === string) {
				return true;
			}
		}
		return false;
	}

	/**
	 * Magic word is not a substring of a longer word?
	 * @param {string} subword
	 * @returns {booleans}
	 */
	function endshere(subword) {
		var nextindex = charindex + 1;
		return input.length === nextindex ||
			!input[nextindex].match(METHODNAME);
	}

	/**
	 * Sugar.
	 * @returns {number}
	 */
	function bufferlength() {
		return buffer.length;
	}

	/**
	 * Compute index of string in buffer.
	 * @param {string} string
	 * @return {number}
	 */
	function startindex(string) {
		return bufferlength() - string.length;
	}

	/**
	 * TODO: all sorts of edge cases
	 */
	function processsupercall() {
		if (methodname) {
			if (!character.match(METHODNAME)) {
				buffer += '.call';
				methodname = false;
			}
		} else if (superargs) {
			if (character.match(METHODNAME)) {
				buffer += ', ';
				superargs = false;
			}
		}
		switch (character) {
			case '(':
				character = '(this';
				superargs = true;
				break;
			case ')':
				supercall = false;
				superargs = false;
				break;
		}
	}

	/**
	 * Flush buffer to output.
	 */
	function flush() {
		output += buffer;
		output += character;
		buffer = '';
		supercall = false;
		methodname = false;
		superargs = false;
	}

	/**
	 * Process chars in one way.
	 * TODO: This ain't right :/
	 */
	function somechars() {
		var was = false;
		if(!stringmode && !commentmode) {
			if(prototype) {
				switch (character) {
					case '(':
						prencount ++;
						break;
					case ')':
						was = prencount > 0;
						prencount --;
						if(was && prencount === 0) {
							prototype = null;
						}
						break;
					case '{':
						curlcount ++;
						break;
					case '}':
						was = curlcount > 0;
						curlcount --;
						if(was && curlcount === 0) {
							prototype = null;
						}
						break;
				}
			}
		}
	}

	/**
	 * Process chars in another way.
	 */
	function morechars() {
		switch (character) {
			case ';':
				flush();
				break;
			case '=':
			case '\'':
			case '"':
				if(!supercall) {
					flush();
				}
				break;
			default:
				if (supercall) {
					processsupercall();
				}
				buffer += character;
				if (prototype && !supercall) {
					checksupercall();
				}
				if(!prototype) {
					checkextensions();
				}
				break;
		}
	}

	// iterate all characters
	while (charindex <= endindex) {
		character = input[charindex];
		somechars();
		morechars();
		charindex++;
	}

	// flush all to output
	return output + buffer;
}
714224
def get_class(self, name):
        
        for i in self.get_classes():
            if i.get_name() == name:
                return i
        return None
207581
def run(self):
        
        count = {}

        # NOTE: self.input() actually returns an element for the InputText.output() target
        for f in self.input():  # The input() method is a wrapper around requires() that returns Target objects
            for line in f.open('r'):  # Target objects are a file system/format abstraction and this will return a file stream object
                for word in line.strip().split():
                    count[word] = count.get(word, 0) + 1

        # output data
        f = self.output().open('w')
        for word, count in six.iteritems(count):
            f.write("%s\t%d\n" % (word, count))
        f.close()
1090794
def read_input(self, input_data, data_format):
        
        if data_format not in self.input_formats:
            raise Exception("Input format {0} not available with this class. Available formats are {1}.".format(data_format, self.input_formats))
        data_converter = getattr(self, "from_" + data_format)
        self.data = data_converter(input_data)
1215396
def load_target_class(input_dir):
  """"""
  with tf.gfile.Open(os.path.join(input_dir, 'target_class.csv')) as f:
    return {row[0]: int(row[1]) for row in csv.reader(f) if len(row) >= 2}
992970
public Registration readClass (Input input) {
		if (input == null) throw new IllegalArgumentException("input cannot be null.");
		try {
			return classResolver.readClass(input);
		} finally {
			if (depth == 0 && autoReset) reset();
		}
	}
251280
def build_data_input(cls, name='input'):
        
        return cls(name, PortDirection.INPUT, type=PortType.DATA)
391927
def flatten(input_list):
    
    for el in input_list:
        if isinstance(el, collections.Iterable) \
                and not isinstance(el, basestring):
            for sub in flatten(el):
                yield sub
        else:
            yield el
46394
def infer_call_result(self, caller=None, context=None):
        
        if self.is_generator():
            if isinstance(self, AsyncFunctionDef):
                generator_cls = bases.AsyncGenerator
            else:
                generator_cls = bases.Generator
            result = generator_cls(self)
            yield result
            return
        # This is really a gigantic hack to work around metaclass generators
        # that return transient class-generating functions. Pylint's AST structure
        # cannot handle a base class object that is only used for calling __new__,
        # but does not contribute to the inheritance structure itself. We inject
        # a fake class into the hierarchy here for several well-known metaclass
        # generators, and filter it out later.
        if (
            self.name == "with_metaclass"
            and len(self.args.args) == 1
            and self.args.vararg is not None
        ):
            metaclass = next(caller.args[0].infer(context))
            if isinstance(metaclass, ClassDef):
                class_bases = [next(arg.infer(context)) for arg in caller.args[1:]]
                new_class = ClassDef(name="temporary_class")
                new_class.hide = True
                new_class.parent = self
                new_class.postinit(
                    bases=[base for base in class_bases if base != util.Uninferable],
                    body=[],
                    decorators=[],
                    metaclass=metaclass,
                )
                yield new_class
                return
        returns = self._get_return_nodes_skip_functions()

        first_return = next(returns, None)
        if not first_return:
            raise exceptions.InferenceError("Empty return iterator")

        for returnnode in itertools.chain((first_return,), returns):
            if returnnode.value is None:
                yield node_classes.Const(None)
            else:
                try:
                    yield from returnnode.value.infer(context)
                except exceptions.InferenceError:
                    yield util.Uninferable