def is_unedited_config_file(content, template_content=None):
 content = content.encode(u'latin-1')
 content = re.sub('\njquery_url\\s*=\\s*[^\n]+', '', content)
 buffer = io.BytesIO(content)
 buffer.seek(0)
 raw_cfg = configobj.ConfigObj(buffer, interpolation=True)
 for v in six.itervalues(raw_cfg):
  if len(v):
   break
 else:
  return True
 known_configs = set([u'7d4b4f1120304b286d71f205975b1286', u'5df7e409425e5bfe7ed041513fda3288', u'8355f99a01b3bdfd8761ef45d5d8b7e5', u'4ea5a84de146dc3fcea2a5b93735e634'])
 md5 = hashlib.md5()
 md5.update(content)
 digest = md5.hexdigest()
 return (digest in known_configs)

def is_unedited_config_file ( content , template_content = None ) : content = content . encode ( u'latin-1' ) content = re . sub ( '\njquery_url\\s*=\\s*[^\n]+' , '' , content ) buffer = io . BytesIO ( content ) buffer . seek ( 0 ) raw_cfg = configobj . ConfigObj ( buffer , interpolation = True ) for v in six . itervalues ( raw_cfg ) : if len ( v ) : break else : return True known_configs = set ( [ u'7d4b4f1120304b286d71f205975b1286' , u'5df7e409425e5bfe7ed041513fda3288' , u'8355f99a01b3bdfd8761ef45d5d8b7e5' , u'4ea5a84de146dc3fcea2a5b93735e634' ] ) md5 = hashlib . md5 ( ) md5 . update ( content ) digest = md5 . hexdigest ( ) return ( digest in known_configs )
determines if a config file can be safely replaced because it doesnt actually contain any meaningful content .