<commit_before>{% macro dataset_summary(dataset) -%}
  <div class="dataset summary">
    <img src="https://assets.okfn.org/p/data/img/icon-128.png"
      alt="{{dataset.title}}" class="logo" />
    <h3><a href="/{{dataset.owner}}/{{dataset.id}}">{{dataset.title}}</a></h3>
    <div class="description">{{dataset.description}}</div>
    <div class="actions">
      <a href="/{{dataset.owner}}/{{dataset.id}}" class="btn btn-primary btn-small">View &raquo;</a>
      {% if dataset.download_url %}
      <a href="{{dataset.download_url}}" class="btn btn-success btn-small">Download CSV &raquo;</a>
      {% endif %}
    </div>
    <div class="source">Source: {{listify(dataset.sources)}}</div>
    <ul class="keywords">
      {% for kw in dataset.keywords or [] %}
      <li>{{kw}}</li>
      {% endfor %}
    </ul>
  </div>
{%- endmacro %}

{% macro listify(list_) -%}
  {% for item in list_ or [] %}
  <a href="{{item.web}}" title="Uses data from {{item.name}}" target="_blank">
    {{item.name}}
    <i class="icon-external-link"></i>
  </a>
  {% endfor %}
{%- endmacro %}

{% macro dataset_show(dataset, jsonDataPackage, dataViews, showDataApi, datapackageUrl, publisherName, packageName) -%}
<div class="dataset show">
  <div class="row">
    <div class="col-md-8">
      <img src="{{dataset.image or 'https://assets.okfn.org/p/data/img/icon-128.png'}}"
        alt="{{dataset.title}}" class="logo" />
      <div class="description">{{dataset.readme|truncate}} <a href="#readme">Read more</a></div>

      <div class="actions">
        <div class="btn-group">
          <a href="#data" class="btn btn-large btn-primary"><i class="icon-download-alt icon-white"></i> Download Data</a>
        </div>
      </div>
    </div>
    <div class="col-md-4 sidebar">
      <div class="btn-group">
        <a href="/api/package/{{dataset.owner}}/{{dataset.name}}" class="btn btn-small btn-default"><i class="icon-download-alt"></i> Metadata</a></a>
        {% if dataset.bugs and dataset.bugs.url %}
        <a href="{{dataset.bugs.url}}" class="btn btn-small" target="_blank"><i class="icon-exclamation-sign icon-white"></i> Report an Issue</a>
        {% endif %}
      </div>
      <div class="homepage truncate"><i class="icon-home"></i> <a href="{{dataset.homepage}}" title="Home Page">{{dataset.homepage}}</a></div>
      {% if dataset.licenses %}
      <div class="license">
        <i class="icon-legal"></i> <a href="{{dataset.licenses[0].url}}" title="Available under the following License">{{dataset.licenses[0].name or dataset.licenses[0].id}}</a>
        <br />
        <a href="https://opendefinition.org" title="This data is open data as per the Open Definition"><img src="https://assets.okfn.org/images/buttons/od_80x15_blue.png" /></a>
      </div>
      {% endif %}
      <div class="source">
        <h5>Sources</h5>
        {{listify(dataset.sources)}}
      </div>
    </div>
  </div>

  <hr/>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

  <button>Switch View</button>
  <input id="search" placeholder="Search" type="search" style="float:right; display: none">
  <div class="viewer" style="display: none"></div>
  <div id="vis"></div>
  <div class="resources" id="data">
    <h2>Data Files</h2>

    {% for resource in dataset.resources %}
    <div class="resource-info">
      <h3 id="resource-{{resource.name}}"><i class="icon-file-text-alt"></i> {{resource.name}}</h3>

    {% if resource.format == 'geojson' %}
      <div class="js-show-geojson show-geojson" data-resource-index="{{loop.index0}}"></div>
      {% else %}
      <input id="search_field" placeholder="Search" type="search" style="float:right" data-resource-index="{{loop.index0}}">
      <br>
      <br>
      <div class="js-show-handsontable-grid" data-resource-index="{{loop.index0}}"></div>
    {% endif %}

      <h4>Field Information</h4>
      <table class="table table-bordered table-striped resource-summary">
        <thead>
          <tr>
            <th>Field Name</th>
            <th>Order</th>
            <th>Type (Format)</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
          {% for field in resource.schema.fields %}
          <tr>
            <th>{{field.name}}</th>
            <td>{{loop.index}}</td>
            <td class="type type-{{field.type}}">{{field.type}} {% if field.format %}({{field.format}}) {% endif %}</td>
            <td>{{field.description}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    {% endfor %}
  </div> <!-- / resoures -->

  <div class="row moreinfo">
    <div class="col-md-8">
      <h2 id="readme">README</h2>
      <div class="readme">{{dataset.readme|markdown}}</div>
    </div>
    <div class="col-md-4"></div>
  </div>

  <script type="text/javascript">
{#    var DataPackageData = {{ jsonDataPackage|tojson }};#}
{#    var DataViews = {{ dataViews|tojson }};#}
{#    var DataPackageJsonUrl = "{{ datapackageUrl }}";#}
    var packageName = "{{ packageName }}";
    var publisherName = "{{ publisherName }}";
  </script>
</div><!-- / dataset show -->
{%- endmacro %}

{% macro package_list_show(publisher, packages) -%}
  {%- for package in packages  %}
    <div class="card mb-2">
      <div class="card-block">
        <h5 class="card-title"><span class="fa fa-files-o"></span> {{package.descriptor.title}}</h5>
        <h6>[{{ package.name }}]</h6>
        <div class="panel-body">
            <p>
            {{ package.readme|truncate(50) }}
            </p>
        </div>
        <div class="row show-grid clearfix">
            <div class="col-sm-2">
              <img src="https://avatars3.githubusercontent.com/u/22451011?v=3&s=200" class="img-fluid rounded-circle" />
            </div>
            <div class="col-sm-6 align-self-center">
                <small><a href="/{{ publisher }} ">by {{ publisher }}</a></small>
            </div>
            <div class="col-sm-4 pull-right align-self-center">
                <a class="btn btn-secondary" href="/{{ publisher }}/{{ package.name }}">Explore >></a>
            </div>
        </div>
      </div>
    </div>
  {%- endfor %}
{%- endmacro %}

{% macro search_package_list(packages) -%}
  {%- for package in packages %}
    <div class="card mb-2 card-outline-secondary" >
      <div class="card-block">
        <h5 class="card-title">
          <span class="fa fa-files-o"></span>
          {{package.descriptor.title}}
        </h5>
        <h6>[{{ package.name }}]</h6>
        <div class="panel-body">
          <p>
          {{ package.readme|truncate(50) }}
          </p>
        </div>
        <div class="row show-grid clearfix">
          <div class="col-sm-1">
            <img src="https://avatars3.githubusercontent.com/u/22451011?v=3&s=200" class="img-fluid rounded-circle" />
          </div>
          <div class="col-sm-7 align-self-center">
              <small><a href="/{{ package.publisher_name }} ">by {{ package.publisher_name }}</a></small>
          </div>
          <div class="col-sm-4 pull-right align-self-center">
              <a class="btn btn-secondary" href="/{{ package.publisher_name }}/{{ package.name }}">Explore >></a>
          </div>
        </div>
      </div>
    </div><commit_msg>[fix][s]: Fix none handleing for readme data for package list view in snippets.html<commit_after>{% macro dataset_summary(dataset) -%}
  <div class="dataset summary">
    <img src="https://assets.okfn.org/p/data/img/icon-128.png"
      alt="{{dataset.title}}" class="logo" />
    <h3><a href="/{{dataset.owner}}/{{dataset.id}}">{{dataset.title}}</a></h3>
    <div class="description">{{dataset.description}}</div>
    <div class="actions">
      <a href="/{{dataset.owner}}/{{dataset.id}}" class="btn btn-primary btn-small">View &raquo;</a>
      {% if dataset.download_url %}
      <a href="{{dataset.download_url}}" class="btn btn-success btn-small">Download CSV &raquo;</a>
      {% endif %}
    </div>
    <div class="source">Source: {{listify(dataset.sources)}}</div>
    <ul class="keywords">
      {% for kw in dataset.keywords or [] %}
      <li>{{kw}}</li>
      {% endfor %}
    </ul>
  </div>
{%- endmacro %}

{% macro listify(list_) -%}
  {% for item in list_ or [] %}
  <a href="{{item.web}}" title="Uses data from {{item.name}}" target="_blank">
    {{item.name}}
    <i class="icon-external-link"></i>
  </a>
  {% endfor %}
{%- endmacro %}

{% macro dataset_show(dataset, jsonDataPackage, dataViews, showDataApi, datapackageUrl, publisherName, packageName) -%}
<div class="dataset show">
  <div class="row">
    <div class="col-md-8">
      <img src="{{dataset.image or 'https://assets.okfn.org/p/data/img/icon-128.png'}}"
        alt="{{dataset.title}}" class="logo" />
      <div class="description">{{dataset.readme|truncate}} <a href="#readme">Read more</a></div>

      <div class="actions">
        <div class="btn-group">
          <a href="#data" class="btn btn-large btn-primary"><i class="icon-download-alt icon-white"></i> Download Data</a>
        </div>
      </div>
    </div>
    <div class="col-md-4 sidebar">
      <div class="btn-group">
        <a href="/api/package/{{dataset.owner}}/{{dataset.name}}" class="btn btn-small btn-default"><i class="icon-download-alt"></i> Metadata</a></a>
        {% if dataset.bugs and dataset.bugs.url %}
        <a href="{{dataset.bugs.url}}" class="btn btn-small" target="_blank"><i class="icon-exclamation-sign icon-white"></i> Report an Issue</a>
        {% endif %}
      </div>
      <div class="homepage truncate"><i class="icon-home"></i> <a href="{{dataset.homepage}}" title="Home Page">{{dataset.homepage}}</a></div>
      {% if dataset.licenses %}
      <div class="license">
        <i class="icon-legal"></i> <a href="{{dataset.licenses[0].url}}" title="Available under the following License">{{dataset.licenses[0].name or dataset.licenses[0].id}}</a>
        <br />
        <a href="https://opendefinition.org" title="This data is open data as per the Open Definition"><img src="https://assets.okfn.org/images/buttons/od_80x15_blue.png" /></a>
      </div>
      {% endif %}
      <div class="source">
        <h5>Sources</h5>
        {{listify(dataset.sources)}}
      </div>
    </div>
  </div>

  <hr/>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

  <button>Switch View</button>
  <input id="search" placeholder="Search" type="search" style="float:right; display: none">
  <div class="viewer" style="display: none"></div>
  <div id="vis"></div>
  <div class="resources" id="data">
    <h2>Data Files</h2>

    {% for resource in dataset.resources %}
    <div class="resource-info">
      <h3 id="resource-{{resource.name}}"><i class="icon-file-text-alt"></i> {{resource.name}}</h3>

    {% if resource.format == 'geojson' %}
      <div class="js-show-geojson show-geojson" data-resource-index="{{loop.index0}}"></div>
      {% else %}
      <input id="search_field" placeholder="Search" type="search" style="float:right" data-resource-index="{{loop.index0}}">
      <br>
      <br>
      <div class="js-show-handsontable-grid" data-resource-index="{{loop.index0}}"></div>
    {% endif %}

      <h4>Field Information</h4>
      <table class="table table-bordered table-striped resource-summary">
        <thead>
          <tr>
            <th>Field Name</th>
            <th>Order</th>
            <th>Type (Format)</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
          {% for field in resource.schema.fields %}
          <tr>
            <th>{{field.name}}</th>
            <td>{{loop.index}}</td>
            <td class="type type-{{field.type}}">{{field.type}} {% if field.format %}({{field.format}}) {% endif %}</td>
            <td>{{field.description}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
    {% endfor %}
  </div> <!-- / resoures -->

  <div class="row moreinfo">
    <div class="col-md-8">
      <h2 id="readme">README</h2>
      <div class="readme">{{dataset.readme|markdown}}</div>
    </div>
    <div class="col-md-4"></div>
  </div>

  <script type="text/javascript">
{#    var DataPackageData = {{ jsonDataPackage|tojson }};#}
{#    var DataViews = {{ dataViews|tojson }};#}
{#    var DataPackageJsonUrl = "{{ datapackageUrl }}";#}
    var packageName = "{{ packageName }}";
    var publisherName = "{{ publisherName }}";
  </script>
</div><!-- / dataset show -->
{%- endmacro %}

{% macro package_list_show(publisher, packages) -%}
  {%- for package in packages  %}
    <div class="card mb-2">
      <div class="card-block">
        <h5 class="card-title"><span class="fa fa-files-o"></span> {{package.descriptor.title}}</h5>
        <h6>[{{ package.name }}]</h6>
        <div class="panel-body">
            {% if package.readme %}
            <p>
            {{ package.readme|truncate(50) }}
            </p>
            {% endif %}
        </div>
        <div class="row show-grid clearfix">
            <div class="col-sm-2">
              <img src="https://avatars3.githubusercontent.com/u/22451011?v=3&s=200" class="img-fluid rounded-circle" />
            </div>
            <div class="col-sm-6 align-self-center">
                <small><a href="/{{ publisher }} ">by {{ publisher }}</a></small>
            </div>
            <div class="col-sm-4 pull-right align-self-center">
                <a class="btn btn-secondary" href="/{{ publisher }}/{{ package.name }}">Explore >></a>
            </div>
        </div>
      </div>
    </div>
  {%- endfor %}
{%- endmacro %}

{% macro search_package_list(packages) -%}
  {%- for package in packages %}
    <div class="card mb-2 card-outline-secondary" >
      <div class="card-block">
        <h5 class="card-title">
          <span class="fa fa-files-o"></span>
          {{package.descriptor.title}}
        </h5>
        <h6>[{{ package.name }}]</h6>
        <div class="panel-body">
            {% if package.readme %}
          <p>
          {{ package.readme|truncate(50) }}
          </p>
            {% endif %}
        </div>
        <div class="row show-grid clearfix">
          <div class="col-sm-1">
            <img src="https://avatars3.githubusercontent.com/u/22451011?v=3&s=200" class="img-fluid rounded-circle" />
          </div>
          <div class="col-sm-7 align-self-center">
              <small><a href="/{{ package.publisher_name }} ">by {{ package.publisher_name }}</a></small>
          </div>
          <div class="col-sm-4 pull-right align-self-center">
              <a class="btn btn-secondary" href="/{{ package.publisher_name }}/{{ package.name }}">Explore >></a>
          </div>
        </div>
      </div>
    </div>
{'fraction_non_alphanumeric': 0.21285850210683702, 'fraction_numerical': 0.011145847492184315, 'mean_word_length': 2.5837798343886993, 'pattern_counts': {'":': 0, '<': 411, '<?xml version=': 0, '>': 419, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6246525', 'n_tokens_mistral': 5076, 'n_tokens_neox': 4771, 'n_words': 907}