def robotsrulesetOfDomain(self, domain):
		'''检查domain是否在数据库中,
			否 --> (False, None)
			是 --> (True, 数据库中存储的robots.txt内容)
		'''
		exist = False
		cur = self.conn.cursor()
		# 是否存在
		cur.execute("SELECT 1 FROM Domains WHERE domain=?", (domain,))
		if cur.fetchone() :
			exist = True
		# 存在的话,结果是什么
		cur.execute("SELECT rules FROM Domains,Rulesets "
			"WHERE domain=? AND Domains.did=Rulesets.did"
			,(domain,) )
		ruleset = cur.fetchone()
		return (exist, ruleset)
def testMinimizeSparseResourceVariableCentered(self, dtype):
    with self.cached_session():
      var0 = resource_variable_ops.ResourceVariable([[1.0, 2.0]], dtype=dtype)
      x = constant_op.constant([[4.0], [5.0]], dtype=dtype)
      pred = math_ops.matmul(embedding_ops.embedding_lookup([var0], [0]), x)
      loss = pred * pred
      sgd_op = rmsprop.RMSPropOptimizer(
          learning_rate=1.0,
          decay=0.1,
          momentum=0.0,
          epsilon=1.0,
          centered=True).minimize(loss)
      variables.global_variables_initializer().run()
      # Fetch params to validate initial values
      self.assertAllCloseAccordingToType([[1.0, 2.0]], var0.eval())
      # Run 1 step of sgd
      sgd_op.run()
      # Validate updated params
      self.assertAllCloseAccordingToType(
          [[-7/3.0, -4/3.0]], var0.eval(), atol=0.01)