def METHOD_NAME(repository_url, to_date, label):
    issues_open_at = """
    {
      "size": 10000,
      "query": {
          "bool": {
              "filter": [{
                  "term": {
                      "origin": "%s"
                  }},{
                  "term": {
                      "labels": "%s"
                  }},{
                  "range" : {
                     "closed_at": {"gt" : "%s"}
                  }},{
                  "range" : {
                     "created_at": {"lt" : "%s"}
                  }
              }
              ]
          }
      }
    }
    """ % (repository_url, label, to_date, to_date)
    return issues_open_at