Build machine from list of lines.
422092
def build_machine(lines):
    """"""
    if lines == []:
        raise SyntaxError('Empty file')
    else:
        machine = Machine(lines[0].split())
        for line in lines[1:]:
            if line.strip() != '':
                machine.add_state(line)
    machine.check()
    return machine
1138447
def _build(lhs, rhs):
    """"""
    _check_under_condition()
    final_predicate, pred_set = _current_select()
    _check_and_add_pred_set(lhs, pred_set)
    _predicate_map.setdefault(lhs, []).append((final_predicate, rhs))
695781
def n_list_comp(self, node):
        """"""
        p = self.prec
        self.prec = 27
        n = node[-1]
        assert n == 'list_iter'
        # find innermost node
        while n == 'list_iter':
            n = n[0] # recurse one step
            if   n == 'list_for':	n = n[3]
            elif n == 'list_if':	n = n[2]
            elif n == 'list_if_not': n = n[2]
        assert n == 'lc_body'
        if node[0].kind.startswith('BUILD_LIST'):
            start = len(self.f.getvalue())
            self.set_pos_info(node[0], start, start+1)
        self.write( '[ ')
        self.preorder(n[0]) # lc_body
        self.preorder(node[-1]) # for/if parts
        self.write( ' ]')
        self.prec = p
        self.prune()
1012743
function(lines) {
		let output = [];
		let newlineCount = 0;
		for (let i = 0; i < lines.length; i++) {
			const line = lines[i];
			if (!line.trim()) {
				newlineCount++;
			} else {
				newlineCount = 0;
			}

			if (newlineCount >= 2) continue;

			output.push(line);
		}
		return output;
	}
496596
def run_hmmbuild(self):

        '''
        
        '''

        for alignment in self.alignment_list:

            print 'building Hmm for', alignment

            alignment_full_path = self.alignment_dir + alignment
            query_name = alignment.split("_")[0]
            self.query_names.append(query_name)

            new_hmm= self.hmm_dir + query_name + ".hmm"

            hmmbuild_output = subprocess.call(["hmmbuild", new_hmm,
             alignment_full_path])

        print 'hhbuild complete for', self.query_names
636193
def _build(self):
    """"""
    q = tf.FIFOQueue(
        self._queue_capacity, [self._dtype, self._dtype],
        shapes=[[self._num_steps, self._batch_size, self._vocab_size]]*2)
    obs, target = tf.py_func(self._get_batch, [], [tf.int32, tf.int32])
    obs = self._one_hot(obs)
    target = self._one_hot(target)
    enqueue_op = q.enqueue([obs, target])
    obs, target = q.dequeue()
    tf.train.add_queue_runner(tf.train.QueueRunner(q, [enqueue_op]))
    return SequenceDataOpsNoMask(obs, target)
108930
def build(ctx, inputs, output, cs):
    """"""
    click.echo('chemdataextractor.dict.build')
    dt = DictionaryTagger(lexicon=ChemLexicon(), case_sensitive=cs)
    names = []
    for input in inputs:
        for line in input:
            tokens = line.split()
            names.append(tokens)
    dt.build(words=names)
    dt.save(output)
582589
def from_records(cls, records):
        """"""
        if not records:
            return cls()
        labels = sorted(list(records[0].keys()))
        columns = [[rec[label] for rec in records] for label in labels]
        return cls().with_columns(zip(labels, columns))
1090716
def read_line(line):
        """"""
        name, value = '', ''

        if '=' in line:
            name, value = line.split('=', 1)

        return [name.strip(), value.strip()]
244770
def build_file_lines(self):
    """"""
    build_file_lines = self._build_file_source_lines[:]
    target_begin, target_end = self._target_interval
    build_file_lines[target_begin:target_end] = self.target_lines()
    return build_file_lines
780369
def build(sub_parser, cmds):
    

    res = {}
    for cmd in cmds:
        res[cmd.name] = cmd(sub_parser)
    # end for cmd in cmds

    return res
167977
def split_lines(lines):
    
    container = []
    new_list = []
    for line in lines:
        if '>>>' in line:
            container.append(new_list)
            new_list = []
        else:
            new_list.append(line)
    container.append(new_list)
    return container
485064
def build(self):
        """"""
        self._molecules = []
        if self.handedness == 'l':
            handedness = -1
        else:
            handedness = 1
        rot_ang = self.rot_ang * handedness
        for i in range(self.num_of_repeats):
            dup_unit = copy.deepcopy(self.repeat_unit)
            z = (self.rise * i) * numpy.array([0, 0, 1])
            dup_unit.translate(z)
            dup_unit.rotate(rot_ang * i, [0, 0, 1])
            self.extend(dup_unit)
        self.relabel_all()
        return
468123
def line(self, lines):
        """"""
        shapeType = POLYLINE
        self._shapeparts(parts=lines, shapeType=shapeType)
987612
def generate_lines(text, ext=['.txt', '.md', '.rst', '.asciidoc', '.asc']):
    
    """

    if isinstance(text, basestring):
        if len(text) <= 256:
            if os.path.isfile(text) and os.path.splitext(text)[-1].lower() in ext:
                return open(text)
            elif os.path.isdir(text):
                return chain.from_iterable(generate_lines(stat['path']) for stat in find_files(text, ext=ext))
            else:
                return (line for line in Split(text=text))
        else:
            return Split(text=text)
    return chain.from_iterable(generate_lines(obj) for obj in text)
415920
def process(inputLines: List[str]) -> str:
    """"""
    lines = separate_trailing_comments(inputLines)
    merge_continued_lines(lines)
    (lines, comments) = extract_comments(lines)
    actual_lines = [
        line[1]
        for line in lines
        if line[1] is not None and "i_g_n_o_r_e___m_e_" not in line[1]
    ]
    return "".join(actual_lines)
565618
def seqres_lines(self):
    """"""
  
    lines = []
  
    for chain in self.keys():
      seq = self[chain]
      serNum = 1
      startidx = 0
      while startidx < len(seq):
        endidx = min(startidx+13, len(seq))
        lines += ["SEQRES  %2i %s %4i  %s\n" % (serNum, chain, len(seq), " ".join(seq[startidx:endidx]))]
        serNum += 1
        startidx += 13
    
    return lines