code
stringlengths
3
6.57k
Image.new("RGB", (maxX + 1, maxY + 1)
grid.items()
else (255, 255, 255)
canvas.save(pathlib.Path.cwd()
utils.printAnswer(len([item for item in part1Grid.items()
len([item for item in part2Grid.items()
part2(_, answer: int)
utils.printAnswer(answer)
utils.start()
app.route("/tickets/add", methods=['POST'])
submit_ticket()
request.form.get("team_id")
request.form.get("subject")
request.form.get("message")
request.form.get("ts")
mysql.cursor()
tickets (team_id, ts, subject, msg, response)
VALUES (%s, %s, %s, %s, %s)
mysql.database.commit()
json.dumps({"result": "fail"})
json.dumps({"result": "success", "ticket_id": ticket_id})
app.route("/tickets/get")
app.route("/tickets/get/<int:team_id>")
get_all_tickets(team_id = None)
mysql.cursor()
cursor.execute("""SELECT * FROM tickets""")
cursor.execute("""SELECT * FROM tickets where team_id = %d;""", team_id)
cursor.fetchall()
decode('utf-8')
decode('utf-8')
jsonify({"tickets": tks})
app.route("/tickets/get/open")
get_open_tickets()
mysql.cursor()
cursor.execute("""SELECT * FROM tickets WHERE done = 0;""")
jsonify({"tickets": cursor.fetchall()
app.route("/tickets/respond/<int:ticket_id>")
respond_to_ticket(ticket_id)
request.form.get("response")
mysql.cursor()
cursor.execute("""UPDATE tickets SET response = %s WHERE id = %s;""", (response, ticket_id)
mysql.database.commit()
jsonify({"result": 'success'})
app.route("/tickets/close/<int:ticket_id>", methods=['POST'])
close_ticket(ticket_id)
int(ticket_id)
mysql.cursor()
cursor.execute("""UPDATE tickets SET done = 1 WHERE id = %s;""", ticket_id)
mysql.database.commit()
json.dumps({"result": 'success'})
netaddr.IPNetwork("0.0.0.0/0")
logging.getLogger(__name__)
importutils.import_class(CONF.QUARK.ipam_driver)
get_route(context, id)
LOG.info("get_route %s for tenant %s" % (id, context.tenant_id)
db_api.route_find(context, id=id, scope=db_api.ONE)
quark_exceptions.RouteNotFound(route_id=id)
v._make_route_dict(route)
get_routes(context)
LOG.info("get_routes for tenant %s" % context.tenant_id)
db_api.route_find(context)
v._make_route_dict(r)
create_route(context, route)
LOG.info("create_route for tenant %s" % context.tenant_id)
context.session.begin()
db_api.subnet_find(context, id=subnet_id, scope=db_api.ONE)
exceptions.SubnetNotFound(subnet_id=subnet_id)
db_models.IPPolicy.get_ip_policy_cidrs(subnet)
alloc_pools.validate_gateway_excluded(route["gateway"])
TODO(anyone)
netaddr.IPNetwork(route["cidr"])
len(subnet_routes)
netaddr.IPNetwork(sub_route["cidr"])
str(route_cidr)
db_api.route_create(context, **route)
v._make_route_dict(new_route)
delete_route(context, id)
TODO(mdietz)
LOG.info("delete_route %s for tenant %s" % (id, context.tenant_id)
context.session.begin()
db_api.route_find(context, id=id, scope=db_api.ONE)
quark_exceptions.RouteNotFound(route_id=id)
db_api.route_delete(context, route)
np.array([ 1])
np.array([ 0, 1])
np.array([-1, 0, 3])
np.array([ 0, -3, 0, 5])
np.array([ 3, 0, -30, 0, 35])
np.array([ 0, 15, 0, -70, 0, 63])
np.array([-5, 0, 105, 0,-315, 0, 231])
np.array([ 0,-35, 0, 315, 0, -693, 0, 429])
np.array([35, 0,-1260, 0,6930, 0,-12012, 0,6435])
np.array([ 0,315, 0,-4620, 0,18018, 0,-25740, 0,12155])
trim(x)
leg.legtrim(x, tol=1e-6)
TestConstants(TestCase)
test_legdomain(self)
assert_equal(leg.legdomain, [-1, 1])
test_legzero(self)
assert_equal(leg.legzero, [0])