docs: def DeleteFeaturesFromFeatureLayer(self, url, sql, chunksize=0):
          """Removes features from a hosted feature service layer by SQL query.
  
          Args:
              url (str): The URL of the feature service layer.
              sql (str): The SQL query to apply against the feature service.
                  Those features that satisfy the query will be deleted.
              chunksize (int): The maximum amount of features to remove at a time. Defaults to 0.
          Returns:
              The result from :py:func:`arcrest.agol.services.FeatureLayer.deleteFeatures`.
          Notes:
              If you want to delete all features, it is suggested to use the SQL query ``"1=1"``.
  
          """
          fl = None
          try:
              fl = FeatureLayer(
                     url=url,
                     securityHandler=self._securityHandler)
              totalDeleted = 0
              if chunksize > 0:
                  qRes = fl.query(where=sql, returnIDsOnly=True)
                  if 'error' in qRes:
                      print (qRes)
                      return qRes
                  elif 'objectIds' in qRes:
                      oids = qRes['objectIds']
                      total = len(oids)
                      if total == 0:
                          return  {'success':True,'message': "No features matched the query"}
                      i = 0
                      print ("%s features to be deleted" % total)
                      while(i <= len(oids)):
                          oidsDelete = ','.join(str(e) for e in oids[i:i+chunksize])
                          if oidsDelete == '':
                              continue
                          else:
                              results = fl.deleteFeatures(objectIds=oidsDelete)
                          if 'deleteResults' in results:
                              totalDeleted += len(results['deleteResults'])
                              print ("%s%% Completed: %s/%s " % (int(totalDeleted / float(total) *100), totalDeleted, total))
                              i += chunksize
                          else:
                              print (results)
                              return {'success':True,'message': "%s deleted" % totalDeleted}
                      qRes = fl.query(where=sql, returnIDsOnly=True)
                      if 'objectIds' in qRes:
                          oids = qRes['objectIds']
                          if len(oids)> 0 :
                              print ("%s features to be deleted" % len(oids))
                              results = fl.deleteFeatures(where=sql)
                              if 'deleteResults' in results:
                                  totalDeleted += len(results['deleteResults'])
                                  return  {'success':True,'message': "%s deleted" % totalDeleted}
                              else:
                                  return results
                      return  {'success':True,'message': "%s deleted" % totalDeleted}
                  else:
                      print (qRes)
              else:
                  results = fl.deleteFeatures(where=sql)
                  if results is not None:
                      if 'deleteResults' in results:
                          return  {'success':True,'message': totalDeleted + len(results['deleteResults'])}
                      else:
                          return results
          except:
              line, filename, synerror = trace()
              raise common.ArcRestHelperError({
                          "function": "DeleteFeaturesFromFeatureLayer",
                          "line": line,
                          "filename":  filename,
                          "synerror": synerror,
                                          }
                                          )
          finally:
              fl = None
              del fl
              gc.collect()