Generate a summary in json format
346945
def to_report_json(self):
        

        return self.reporter.json(self.n_lines, self.n_assocs, self.skipped)
771396
def get_summary(session):
    """"""
    profile = get_profile(session)
    return {
        'user': {
            'email': profile['userProfile']['eMail'],
            'name': '{} {}'.format(profile['userProfile']['firstName'],
                                   profile['userProfile']['lastName'])
        },
        'vehicles': [
            {
                'vin': vehicle['vin'],
                'year': vehicle['year'],
                'make': vehicle['make'],
                'model': _get_model(vehicle),
                'odometer': vehicle['odometerMileage']
            } for vehicle in profile['vehicles']
        ]
    }
677383
def to_json(data, pretty):
    
    if pretty:
        return json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))
    return json.dumps(data)
120455
def render_summary(self, include_title=True):
        """"""
        title = ""
        classes = ["traceback"]
        if not self.frames:
            classes.append("noframe-traceback")
            frames = []
        else:
            library_frames = sum(frame.is_library for frame in self.frames)
            mark_lib = 0 < library_frames < len(self.frames)
            frames = [group.render(mark_lib=mark_lib) for group in self.groups]

        if include_title:
            if self.is_syntax_error:
                title = u"Syntax Error"
            else:
                title = u"Traceback <em>(most recent call last)</em>:"

        if self.is_syntax_error:
            description_wrapper = u"<pre class=syntaxerror>%s</pre>"
        else:
            description_wrapper = u"<blockquote>%s</blockquote>"

        return SUMMARY_HTML % {
            "classes": u" ".join(classes),
            "title": u"<h3>%s</h3>" % title if title else u"",
            "frames": u"\n".join(frames),
            "description": description_wrapper % escape(self.exception),
        }
277637
def get_summary(self):
        
        if not self.is_valid():
            return None
        else:
            return {
                "source": self.source,
                "assembly": self.assembly,
                "build": self.build,
                "build_detected": self.build_detected,
                "snp_count": self.snp_count,
                "chromosomes": self.chromosomes_summary,
                "sex": self.sex,
            }
49813
def format_to_json(data):
    
    if sys.stdout.isatty():
        return json.dumps(data, indent=4, separators=(',', ': '))
    else:
        return json.dumps(data)
519472
private JsonObject generateConfigSummary() throws JsonParseException {

        logger.entering();

        if (jsonConfigSummary == null) {
            jsonConfigSummary = new JsonObject();
            for (Entry<String, String> temp : ConfigSummaryData.getConfigSummary().entrySet()) {
                jsonConfigSummary.addProperty(temp.getKey(), temp.getValue());
            }
        }
        logger.exiting(jsonConfigSummary);

        return jsonConfigSummary;
    }
920737
def format(item, **params):
    """"""
    encoding = params.get('charset', 'UTF-8')
    return json.dumps(item, encoding=encoding)
244088
def summary(self):
        ''''''
        out = {}
        for bench in self.runner.runned:
            key = self.key(bench)
            runs = {}
            for method, results in bench.results.items():
                mean = results.total / bench.times
                name = bench.label_for(method)
                runs[method] = {
                    'name': name,
                    'total': results.total,
                    'mean': mean
                }
            out[key] = {
                'name': bench.label,
                'times': bench.times,
                'runs': runs
            }
        return out
503937
def summaries(self):
        """"""
        def create_summary(div):
            def get_id(div):
                return get_url(div).rsplit('/')[-1]

            def get_url(div):
                return client.get_url(div.find('h2', class_='itemtitle').a['href'])

            def get_desc(div):
                return div.p.get_text(strip=True)

            def get_auth(div):
                return div.find('span', class_='author').a['title']

            def get_date(div):
                str = div.find('span', class_='author').get_text()
                str = str.replace('\n',   ' ')
                str = str.replace(six.u('\xa0'), ' ')
                match = re.search(r'on\s+(\w{3} [0-9]{1,2}, 20[0-9]{2})', str)
                return datetime.datetime.strptime(match.group(1), "%b %d, %Y")

            def get_title(div):
                return div.find('h2', class_='itemtitle').a['title']

            return {
                'id':    get_id(div),
                'url':   get_url(div),
                'desc':  get_desc(div),
                'auth':  get_auth(div),
                'date':  get_date(div),
                'title': get_title(div),
            }

        videos = self.soup.findAll('div', {'class': 'news_type_video'})
        return [create_summary(div) for div in videos]
1181766
def summarize(urls):
    
    import time
    from summary import Summary


    fails = 0
    err = lambda e: e.__class__.__name__

    summaries = []
    start = time.time()
    for url in urls:
        try:
            print "-> %s" % url
            summary = Summary(url)
            summary.extract()
        except KeyboardInterrupt:
            break
        except Exception, e:
            fails += 1
            summary = {
                'titles': ["[%s]" % err(e)],
                'urls': [url],
                'descriptions': [str(e)],
                'source': url,
                }
            print "[%s] (%s): %s" % (err(e), e, url)
        summaries.append(summary)
        end = time.time()

    result = fails and "Fails: %s out of %s." % (fails, len(summaries)) \
        or "Success: %s." % len(summaries)
    print result

    duration = end - start
    speed = "%.2f" % (duration/len(summaries))

    return summaries, result, speed
1307202
def json_pretty_print(s):
    ''''''
    s = json.loads(s)
    return json.dumps(s,
                      sort_keys=True,
                      indent=4,
                      separators=(',', ': '))
1165241
def write_json(self):
        

        with open(self.results_folder_name + '/results-' + str(self.get_global_count()) + '.json', 'a') as f:
            json.dump(self.result, f)
48870
def format_summary(self):
        """"""
        chunks = [chunk.format_chunk_summary()
                  for chunk in self._progress_chunks]
        return "/".join(chunks)
688528
def data_json(self, pretty=False):
        """"""
        if pretty:
            return json.dumps(self.data, sort_keys=True, indent=4, separators=(',', ': '))
        else:
            return json.dumps(self.data)
1072919
def summary(self, summary):
        """"""
        if summary is not None:
            if summary == 'Clear':
                click.secho("""

   ________                    \  |  /
  / ____/ /__  ____ ______       .-.
 / /   / / _ \/ __ `/ ___/    ‒ (   ) ‒
/ /___/ /  __/ /_/ / /           `-᾿
\____/_/\___/\__,_/_/          /  |  \\

                """, fg=self.colors.YELLOW)
                click.echo()

            elif summary == 'Partly Cloudy':
                click.secho("""

    ____             __  __         ________                __
   / __ \____ ______/ /_/ /_  __   / ____/ /___  __  ______/ /_  __    \  |  /
  / /_/ / __ `/ ___/ __/ / / / /  / /   / / __ \/ / / / __  / / / /      .-.
 / ____/ /_/ / /  / /_/ / /_/ /  / /___/ / /_/ / /_/ / /_/ / /_/ /    ‒ (  .-.
/_/    \__,_/_/   \__/_/\__, /   \____/_/\____/\__,_/\__,_/\__, /        `(   ).
                       /____/                             /____/       / (___(__)

                """, fg=self.colors.WHITE)

            elif summary == 'Flurries':
                click.secho("""

    ________                _                  .--.
   / ____/ /_  ____________(_)__  _____     .-(    ).
  / /_  / / / / / ___/ ___/ / _ \/ ___/    (___.__)__)
 / __/ / / /_/ / /  / /  / /  __(__  )      *      *
/_/   /_/\__,_/_/  /_/  /_/\___/____/          *

                """, fg=self.colors.BLUE)
                click.echo()

            elif summary == 'Overcast' or summary == 'Mostly Cloudy':
                click.secho("""

   ____                                  __
  / __ \_   _____  ______________ ______/ /_       .--.
 / / / / | / / _ \/ ___/ ___/ __ `/ ___/ __/     .(    ).-.
/ /_/ /| |/ /  __/ /  / /__/ /_/ (__  ) /_      (___.__(   ).
\____/ |___/\___/_/   \___/\__,_/____/\__/            (___(__)

                """, fg=self.colors.WHITE)
                click.echo()

            elif summary == 'Snow':
                click.secho("""

   _____                            .--.
  / ___/____  ____ _      __     .-(    ).
  \__ \/ __ \/ __ \ | /| / /    (___.__)__)
 ___/ / / / / /_/ / |/ |/ /      *   *   *
/____/_/ /_/\____/|__/|__/         *   *

                """, fg=self.colors.BLUE)
                click.echo()

            elif summary == 'Light Snow':
                click.secho("""

    __    _       __    __    _____
   / /   (_)___ _/ /_  / /_  / ___/____  ____ _      __       .--.
  / /   / / __ `/ __ \/ __/  \__ \/ __ \/ __ \ | /| / /    .-(    ).
 / /___/ / /_/ / / / / /_   ___/ / / / / /_/ / |/ |/ /    (___.__)__)
/_____/_/\__, /_/ /_/\__/  /____/_/ /_/\____/|__/|__/       *  *  *
        /____/
                """, fg=self.colors.BLUE)
                click.echo()

            elif summary == 'Light Rain' or summary == 'Drizzle':
                click.secho("""

    __    _       __    __     ____        _
   / /   (_)___ _/ /_  / /_   / __ \____ _(_)___       .--.
  / /   / / __ `/ __ \/ __/  / /_/ / __ `/ / __ \   .-(    ).
 / /___/ / /_/ / / / / /_   / _, _/ /_/ / / / / /  (___.__)__)
/_____/_/\__, /_/ /_/\__/  /_/ |_|\__,_/_/_/ /_/     /  /  /
        /____/

                """, fg=self.colors.BLUE)

            elif summary == 'Rain':
                click.secho("""

    ____        _
   / __ \____ _(_)___       .--.
  / /_/ / __ `/ / __ \   .-(    ).
 / _, _/ /_/ / / / / /  (___.__)__)
/_/ |_|\__,_/_/_/ /_/     /  /  /

                """, fg=self.colors.BLUE)

            else:
                click.secho("{:=^62}".format(str(summary)), fg=self.colors.GREEN)
243074
function(groupName, totalSites, totalPages,
                                totalPageviews) {
            var format = d3.format(',d');
            // build
            var summary = 
              '<tr>' +
              '<td>' + groupName + '</td>' +
              '<td>' + format(totalPageviews) + '</td>' +
              '<td>' + format(totalPages) + '</td>' +
              //'<td>' + totalSites + '</td>' +
              '</tr>';

            return summary;
        }