Prints set name and number of photos in set
551629
def PrintSets(self):
        """"""
        sets=self._getphotosets()
        for setname in sets:
            print("%s [%d]"%(setname,sets[setname]['number_photos']))
1274066
def print_data(data):
    
    print(", ".join(["{}=>{}".format(key, value) for key, value in data]))
531647
def get(self, count=None, since_id=None, silent=False):
        
        if not silent:
            print('Retrieving photos from Twitter API...')
        self.auth_user = self.verify_credentials().screen_name
        self.since_ids = read_since_ids(self.users)
        for user in self.users:
            if self.increment:
                since_id = self.since_ids.get(user)
            photos = self.load(user=user,
                               count=count,
                               since_id=since_id,
                               num=self.num)
            self.photos[user] = photos[:self.num]
            self._total += len(self.photos[user])
            if not photos and user in self.max_ids:
                del self.max_ids[user]
        return self.photos
427407
def show_some(items:Collection, n_max:int=5, sep:str=','):
    ""
    if items is None or len(items) == 0: return ''
    res = sep.join([f'{o}' for o in items[:n_max]])
    if len(items) > n_max: res += '...'
    return res
288944
def print(self):
        
        print(tabulate(
            ((i, *row) for i, row in enumerate(self.results, 1)),
            headers=self.headers,
        ))
888965
public void printMetadata() {
    if (metadata == null)
      createMetadataDictionary();
    System.out.println("METADATA");
    // if (metadata.getCreator() != null) System.out.println("Creator:" + metadata.getCreator());
    for (String name : metadata.keySet()) {
      String mult = "";
      if (getMetadataList(name).size() > 1)
        mult = "(x" + getMetadataList(name).size() + ")";
      if (metadata.getMetadataObject(name).isDublinCore())
        System.out.println("[DC]");
      System.out.println(name + mult + ": "
          + getMetadataSingleString(name));
    }
  }
454379
def displayArray(name, a, width = 0):
    
    print(name + ": ", end=" ")
    cnt = 0
    for i in a:
        print("%4.2f" % i, end=" ")
        if width > 0 and (cnt + 1) % width == 0:
            print('')
        cnt += 1
841786
void printCounters() {
    System.out.printf("New Job:\n", counters);
    for (String groupName : counters.getGroupNames()) {
      Counters.Group group = counters.getGroup(groupName);
      System.out.printf("\t%s[%s]\n", groupName, group.getDisplayName());

      for (Counters.Counter counter : group) {
        System.out.printf("\t\t%s: %s\n", counter.getDisplayName(),
                                          counter.getCounter());
      }
    }
    System.out.printf("\n");
  }
643125
def showFileHeaderData(peInstance):
    
    
    fileHeaderFields = peInstance.ntHeaders.fileHeader.getFields()    
    print "[+] IMAGE_FILE_HEADER values:\n"
    for field in fileHeaderFields:
        print "--> %s = 0x%08x" % (field,  fileHeaderFields[field].value)
654656
def print_scan_summary(json_data, names=None):
    '''
    
    '''
    max_col_width = 50
    min_width = 15

    def _max_width(data):
        max_name = 0
        for name in data:
            max_name = len(data[name]) if len(data[name]) > max_name \
                else max_name
        # If the max name length is less that max_width
        if max_name < min_width:
            max_name = min_width

        # If the man name is greater than the max col leng
        # we wish to use
        if max_name > max_col_width:
            max_name = max_col_width

        return max_name

    clean = True

    if len(names) > 0:
        max_width = _max_width(names)
    else:
        max_width = min_width
    template = "{0:" + str(max_width) + "}   {1:5} {2:5} {3:5} {4:5}"
    sevs = ['critical', 'important', 'moderate', 'low']
    writeOut(template.format("Container/Image", "Cri", "Imp", "Med", "Low"))
    writeOut(template.format("-" * max_width, "---", "---", "---", "---"))
    res_summary = json_data['results_summary']
    for image in res_summary.keys():
        image_res = res_summary[image]
        if 'msg' in image_res.keys():
            tmp_tuple = (image_res['msg'], "", "", "", "")
        else:
            if len(names) < 1:
                image_name = image[:max_width]
            else:
                image_name = names[image][-max_width:]
                if len(image_name) == max_col_width:
                    image_name = '...' + image_name[-(len(image_name) - 3):]

            tmp_tuple = tuple([image_name] +
                              [str(image_res[sev]) for sev in sevs])
            sev_results = [image_res[sev] for sev in
                           sevs if image_res[sev] > 0]
            if len(sev_results) > 0:
                clean = False
        writeOut(template.format(*tmp_tuple))
    writeOut("")
    return clean
1176169
def get_global_palette(filenames, options):

    '''

    '''

    input_filenames = []

    all_samples = []

    if not options.quiet:
        print('building global palette...')

    for input_filename in filenames:

        img, _ = load(input_filename)
        if img is None:
            continue

        if not options.quiet:
            print('  processing {}...'.format(input_filename))

        samples = sample_pixels(img, options)
        input_filenames.append(input_filename)
        all_samples.append(samples)

    num_inputs = len(input_filenames)

    all_samples = [s[:int(round(float(s.shape[0])/num_inputs))]
                   for s in all_samples]

    all_samples = np.vstack(tuple(all_samples))

    global_palette = get_palette(all_samples, options)

    if not options.quiet:
        print('  done\n')

    return input_filenames, global_palette
554077
def _get_album(self,directory):
        
        if not self._connectToFB():
            print("%s - Couldn't connect to fb"%(directory))
            return None,None


        # Load sets from SET_FILE
        _sets=self._load_sets(directory)

        # Only grab the first set, FB supports only one set per photo
        myset=_sets[0]

        logger.debug("Getting album id for %s"%(myset))

        # Connect to fb and get dicionary of photosets
        psets=self._getphotosets()

        # create if it doesn't exist
        if myset not in psets:
            logger.info('set [%s] not in fb sets, will create set'%(myset))
            self._createphotoset(myset)
            # Now reaload photosets from fb
            psets=self._getphotosets()

        # Return the album id, album name
        return psets[myset]['id'],myset
1169575
def list_names():
    
    names = get_all_names()
    # This is 375 right now. Probably won't ever change, but I'm not sure.
    nameslen = len(names)
    print('\nListing {} names:\n'.format(nameslen))
    # Using 3 columns of names, still alphabetically sorted from the top down.
    # Longest name so far: lightgoldenrodyellow (20 chars)
    namewidth = 20
    # namewidth * columns == 60, colorwidth * columns == 18, final == 78.
    swatch = ' ' * 9

    third = nameslen // 3
    lastthird = third * 2
    cols = (
        names[0: third],
        names[third: lastthird],
        names[lastthird:],
    )
    # Exactly enough spaces to fill in a blank item (+2 for ': ').
    # This may not ever be used, unless another 'known name' is added.
    blankitem = ' ' * (namewidth + len(swatch) + 2)

    for i in range(third):
        nameset = []
        for colset in cols:
            try:
                nameset.append(colset[i])
            except IndexError:
                nameset.append(None)
                continue
        line = C('').join(
            C(': ').join(
                C(name.rjust(namewidth)),
                C(swatch, back=name),
            ) if name else blankitem
            for name in nameset
        )
        print(line)

    return 0
289699
def print_packet_count():
    """"""
    for name in archive.list_packet_names():
        packet_count = 0
        for group in archive.list_packet_histogram(name):
            for rec in group.records:
                packet_count += rec.count
        print('  {: <40} {: >20}'.format(name, packet_count))
1044894
def create(cls, photo, title, description=''):
        
        if not isinstance(photo, Photo):
            raise TypeError, "Photo expected"
        
        method = 'flickr.photosets.create'
        data = _dopost(method, auth=True, title=title,\
                       description=description,\
                       primary_photo_id=photo.id)
        
        set = Photoset(data.rsp.photoset.id, title, Photo(photo.id),
                       photos=1, description=description)
        return set
786208
def show(x):
    """"""
    print("data attributes of %r" % (x,))
    names = dir(x)
    maxlen = max([0] + [len(n) for n in names])
    for k in names:
        v = getattr(x, k)
        if isinstance(v, types.MethodType):
            continue
        if k[:2] == '__' and k[-2:] == '__':
            continue
        if isinstance(v, str):
            if len(v) > 80 - maxlen - 5:
                v = repr(v[:80 - maxlen - 5]) + "..."
        elif isinstance(v, (int, type(None))):
            v = str(v)
        elif isinstance(v, (list, tuple, dict)):
            v = "%s (%d elements)" % (v, len(v))
        else:
            v = str(type(v))
        print("%*s : %s" % (maxlen, k, v))
    return x
785048
def print_collection(self, c, h, n):
        """"""
        if c in h:
            return "[]..."
        h.append(c)
        s = []
        for item in c:
            s.append("\n")
            s.append(self.indent(n))
            s.append(self.process(item, h, n - 2))
            s.append(",")
        h.pop()
        return "".join(s)