Print all valid permutations.
769290
def print_permutations(self):
        """"""
        index = 0
        permutations = []
        for p in self._input_permutations:
            permutations.append({'index': index, 'args': p})
            index += 1
        with open('permutations.json', 'w') as fh:
            json.dump(permutations, fh, indent=2)
        print('All permutations written to the "permutations.json" file.')
375031
def _print_enum_opt(self, option, choices):
        
        for key in choices:
            if key == self.conf[option]:
                print("* %s" % key)
            else:
                print("  %s" % key)
1343691
def print_sorted_counter(counter, tab=1):
    """"""
    for key, count in sorted(counter.items(), key=itemgetter(1), reverse=True):
        print "{0}{1} - {2}".format('\t'*tab, key, count)
288944
def print(self):
        
        print(tabulate(
            ((i, *row) for i, row in enumerate(self.results, 1)),
            headers=self.headers,
        ))
928476
def show(self):
        """"""
        for rule in self.rules_list:
            result = ", ".join([str(check) for check, deny in rule])
            print(result)
500369
def all_combinations(items):
    """"""
    return (set(compress(items,mask)) for mask in product(*[[0,1]]*len(items)))
1317153
public void permutate(int[] x) {
        for (int i = 0; i < x.length; i++) {
            int j = i + nextInt(x.length - i);
            int s = x[i];
            x[i] = x[j];
            x[j] = s;
        }
    }
779800
def print_groups():
    """"""
    print("Printing information about all groups defined in the Gateway")
    groups = api(gateway.get_groups())
    if len(groups) == 0:
        exit(bold("No groups defined"))

    container = []
    for group in groups:
        container.append(api(group).raw)
    print(jsonify(container))
1367473
def compute_all_sg_permutations(positions,  # scaled positions
                                rotations,  # scaled
                                translations,  # scaled
                                lattice,  # column vectors
                                symprec):
    

    out = []  # Finally the shape is fixed as (num_sym, num_pos_of_supercell).
    for (sym, t) in zip(rotations, translations):
        rotated_positions = np.dot(positions, sym.T) + t
        out.append(compute_permutation_for_rotation(positions,
                                                    rotated_positions,
                                                    lattice,
                                                    symprec))
    return np.array(out, dtype='intc', order='C')
279978
private void generateNextPermutationIndices()
    {
        if (remainingPermutations == 0)
        {
            throw new IllegalStateException("There are no permutations remaining.  " +
                                            "Generator must be reset to continue using.");
        }
        else if (remainingPermutations < totalPermutations)
        {
            // Find largest index j with permutationIndices[j] < permutationIndices[j + 1]
            int j = permutationIndices.length - 2;
            while (permutationIndices[j] > permutationIndices[j + 1])
            {
                j--;
            }

            // Find index k such that permutationIndices[k] is smallest integer greater than
            // permutationIndices[j] to the right of permutationIndices[j].
            int k = permutationIndices.length - 1;
            while (permutationIndices[j] > permutationIndices[k])
            {
                k--;
            }

            // Interchange permutation indices.
            int temp = permutationIndices[k];
            permutationIndices[k] = permutationIndices[j];
            permutationIndices[j] = temp;

            // Put tail end of permutation after jth position in increasing order.
            int r = permutationIndices.length - 1;
            int s = j + 1;

            while (r > s)
            {
                temp = permutationIndices[s];
                permutationIndices[s] = permutationIndices[r];
                permutationIndices[r] = temp;
                r--;
                s++;
            }
        }
        --remainingPermutations;
    }
47263
def _print_fields(self, fields):
        """"""
        # Prepare a formatting string that aligns the names and types based on the longest ones
        longest_name = max(fields, key=lambda f: len(f[1]))[1]
        longest_type = max(fields, key=lambda f: len(f[2]))[2]
        field_format = '%s%-{}s %-{}s %s'.format(
            len(longest_name) + self._padding_after_name,
            len(longest_type) + self._padding_after_type)
        for field in fields:
            self._print(field_format % field)
922950
def PrintRanges(type, name, ranges):
  """"""
  print "static const %s %s[] = {" % (type, name,)
  for lo, hi in ranges:
    print "\t{ %d, %d }," % (lo, hi)
  print "};"
1001580
def print_config(self):
        """"""
        linters = self.user_linters or list(self.linters)
        print('linters:', ', '.join(linters))
        for key, value in self._config.items():
            if key != 'linters':
                print('{}: {}'.format(key, value))
642411
def _print_refs(self, refs, total, prefix='    ',
                    level=1, minsize=0, minpct=0.1):
        
        lrefs = list(refs)
        lrefs.sort(key=lambda x: x.size)
        lrefs.reverse()
        for ref in lrefs:
            if ref.size > minsize and (ref.size*100.0/total) > minpct:
                self.stream.write('%-50s %-14s %3d%% [%d]\n' % (
                    trunc(prefix+str(ref.name), 50),
                    pp(ref.size),
                    int(ref.size*100.0/total),
                    level
                ))
                self._print_refs(ref.refs, total, prefix=prefix+'  ',
                                 level=level+1)
1243463
def print_comps(comps):
    
    if comps == []:
        print('n/a')
    else:
        print('# min: %s, max: %s, mean: %s' % \
            (min(comps), max(comps), np.mean(comps)))
356899
def _get_casing_permutations(cls, input_string):
        
        if not input_string:
            yield ""
        else:
            first = input_string[:1]
            for sub_casing in cls._get_casing_permutations(input_string[1:]):
                yield first.lower() + sub_casing
                yield first.upper() + sub_casing
527865
def pretty_print_gremlin(gremlin):
    """"""
    gremlin = remove_custom_formatting(gremlin)
    too_many_parts = re.split(r'([)}]|scatter)[ ]?\.', gremlin)

    # Put the ) and } back on.
    parts = [
        too_many_parts[i] + too_many_parts[i + 1]
        for i in six.moves.xrange(0, len(too_many_parts) - 1, 2)
    ]
    parts.append(too_many_parts[-1])

    # Put the . back on.
    for i in six.moves.xrange(1, len(parts)):
        parts[i] = '.' + parts[i]

    indentation = 0
    indentation_increment = 4
    output = []
    for current_part in parts:
        if any([current_part.startswith('.out'),
                current_part.startswith('.in'),
                current_part.startswith('.ifThenElse')]):
            indentation += indentation_increment
        elif current_part.startswith('.back') or current_part.startswith('.optional'):
            indentation -= indentation_increment
            if indentation < 0:
                raise AssertionError(u'Indentation became negative: {}'.format(indentation))

        output.append((' ' * indentation) + current_part)

    return '\n'.join(output).strip()