text
stringlengths
92
5.09M
#!/usr/bin/env bash # -*- tab-width: 4; encoding: utf-8; -*- # ######### # License: # # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # Version 2, December 2004 # # Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> # # Everyone is permitted to copy and distribute verbatim or modified # copie...
#include <godot_cpp/classes/input.hpp> #include <godot_cpp/classes/input_map.hpp> #include <godot_cpp/core/method_ptrcall.hpp> #include <godot_cpp/core/type_info.hpp> #include "util/input.hpp" namespace rl::inline utils { godot::InputMap* input::map::get() { godot::InputMap* mappings{ godot::InputMap:...
#include <godot_cpp/classes/engine.hpp> #include <godot_cpp/classes/main_loop.hpp> #include <godot_cpp/classes/node.hpp> #include <godot_cpp/classes/scene_tree.hpp> #include <godot_cpp/classes/window.hpp> #include "util/engine.hpp" namespace rl::inline utils { godot::Engine* engine::get() { godot::Eng...
#include <godot_cpp/classes/canvas_layer.hpp> #include <godot_cpp/classes/control.hpp> #include "core/assert.hpp" #include "core/constants.hpp" #include "singletons/console.hpp" #include "ui/main_dialog.hpp" #include "util/conversions.hpp" #include "util/engine.hpp" namespace rl::inline ui { void MainDialog::_rea...
#include <godot_cpp/classes/camera2d.hpp> #include "entity/camera.hpp" namespace rl { Camera::Camera() { this->set_name("PlayerCamera"); this->set_margin_drawing_enabled(true); auto anchor{ AnchorMode::ANCHOR_MODE_DRAG_CENTER }; this->set_anchor_mode(anchor); } }
#include <godot_cpp/classes/input.hpp> #include <godot_cpp/classes/node2d.hpp> #include <godot_cpp/variant/variant.hpp> #include "core/constants.hpp" #include "entity/controller/player_controller.hpp" #include "singletons/console.hpp" #include "util/engine.hpp" #include "util/input.hpp" #include "util/io.hpp" namespa...
#include <godot_cpp/classes/input.hpp> #include <godot_cpp/classes/node2d.hpp> #include <godot_cpp/variant/variant.hpp> #include "core/assert.hpp" #include "core/constants.hpp" #include "entity/controller/character_controller.hpp" #include "singletons/console.hpp" #include "util/bind.hpp" #include "util/engine.hpp" #i...
#include "entity/controller/enemy_controller.hpp" namespace rl { void EnemyController::process_action_input(godot::Input* const input, double delta_time) { } void EnemyController::process_movement_input(godot::Input* const input, double delta_time) { } void EnemyController::process_rotati...
#include <array> #include <tuple> #include <type_traits> #include <vector> #include <godot_cpp/classes/input.hpp> #include <godot_cpp/classes/marker2d.hpp> #include <godot_cpp/classes/rectangle_shape2d.hpp> #include <godot_cpp/classes/ref.hpp> #include <godot_cpp/classes/resource_loader.hpp> #include <godot_cpp/core/c...
#include "core/constants.hpp" #include "entity/character/character.hpp" #include "entity/character/player.hpp" #include "util/scene.hpp" namespace rl { Player::Player() : Character() { scene::node::set_unique_name(this, name::character::player); } void Player::_ready() { Ch...
#include "core/constants.hpp" #include "entity/character/character.hpp" #include "entity/character/enemy.hpp" #include "util/scene.hpp" namespace rl { Enemy::Enemy() : Character() { scene::node::set_unique_name(this, name::character::enemy); } void Enemy::_bind_methods() { } }
#include "entity/projectile/projectile_spawner.hpp" #include "util/bind.hpp" namespace rl { [[nodiscard]] Projectile* ProjectileSpawner::spawn_projectile() { auto elapsed{ clock_t::now() - m_prev_spawn_time }; if (elapsed < m_spawn_delay) return nullptr; else { ...
#include <godot_cpp/variant/vector2.hpp> #include "entity/projectile/projectile.hpp" #include "util/engine.hpp" namespace rl { void Projectile::_ready() { m_start_pos = this->get_global_position(); auto forward{ this->get_transform()[0].normalized() }; this->apply_impulse(forward * m_v...
#include <godot_cpp/classes/collision_polygon2d.hpp> #include <godot_cpp/classes/marker2d.hpp> #include <godot_cpp/classes/rigid_body2d.hpp> #include <godot_cpp/variant/callable.hpp> #include <godot_cpp/variant/vector2.hpp> #include "entity/character/character.hpp" #include "entity/controller/player_controller.hpp" #i...
#include <type_traits> #include <gdextension_interface.h> #include <godot_cpp/classes/engine.hpp> #include <godot_cpp/core/memory.hpp> #include <godot_cpp/variant/string_name.hpp> #include "api/extension_interface.hpp" #include "entity/camera.hpp" #include "entity/character/character.hpp" #include "entity/character/e...
#include "core/assert.hpp" #include "main.hpp" #include "util/conversions.hpp" #include "util/engine.hpp" #include "util/input.hpp" namespace rl { Main::Main() { resource::preload::packed_scene<Level> level{ path::scene::Level1 }; resource::preload::packed_scene<MainDialog> dialog{ path::ui::Ma...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* trees.c -- output deflated data using Huffman coding * Copyright (C) 1995-2012 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ /* * ALGORITHM * * The "deflation" process uses several Huffman...
/* gzread.c -- zlib functions for reading gzip files * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "gzguts.h" /* Local functions */ local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); local in...
/* infback.c -- inflate using a call-back interface * Copyright (C) 1995-2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* This code is largely copied from inflate.c. Normally either infback.o or inflate.o would be linked into an application--not both. The interf...
/* inftrees.c -- generate Huffman trees for efficient decoding * Copyright (C) 1995-2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #define MAXBITS 15 const char inflate_copyright[] = " inflate 1.2.8 Copyright 1995-2013 Mark A...
/* adler32.c -- compute the Adler-32 checksum of a data stream * Copyright (C) 1995-2011 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #include "zutil.h" #define local static local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #...
/* zutil.c -- target dependent utility functions for the compression library * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #include "zutil.h" #ifndef Z_SOLO # include "gzguts.h" #endif #ifndef NO_DUMMY_DEC...
/* uncompr.c -- decompress a memory buffer * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #define ZLIB_INTERNAL #include "zlib.h" /* =========================================================================== Decom...
/* gzclose.c -- zlib gzclose() function * Copyright (C) 2004, 2010 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "gzguts.h" /* gzclose() is in a separate file so that it is linked in only if it is used. That way the other gzclose functions can be used instead to...
/* gzwrite.c -- zlib functions for writing gzip files * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "gzguts.h" /* Local functions */ local int gz_init OF((gz_statep)); local int gz_comp OF((gz_statep, int)); local ...
/* crc32.c -- compute the CRC-32 of a data stream * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster * CRC methods: exclusive-oring 32 bits of data at a time,...
/* gzlib.c -- zlib functions common to reading and writing gzip files * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "gzguts.h" #if defined(_WIN32) && !defined(__BORLANDC__) # define LSEEK _lseeki64 #else #if defined(_LA...
/* deflate.c -- compress data using the deflation algorithm * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* * ALGORITHM * * The "deflation" process depends on being able to identify portions * of the input text w...
/* inffast.c -- fast decoding * Copyright (C) 1995-2008, 2010, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #include "inflate.h" #include "inffast.h" #ifndef ASMINF /* Allow machine dependent optimization for post-increment or...
/* compress.c -- compress a memory buffer * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #define ZLIB_INTERNAL #include "zlib.h" /* =========================================================================== Compresses t...
/* inflate.c -- zlib decompression * Copyright (C) 1995-2012 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* * Change history: * * 1.2.beta0 24 Nov 2002 * - First version -- complete rewrite of inflate to simplify code, avoid * creation of window when not needed, ...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the a...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* LodePNG version 20160501 Copyright (c) 2005-2016 Lode Vandevenne This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, incl...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
/* * libtcod 1.6.3 * Copyright (c) 2008,2009,2010,2012,2013,2016,2017 Jice & Mingos & rmtew * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retai...
import boto3 import json import numpy as np import pandas as pd import time import uuid import os import urllib.parse print('Loading function') personalize = boto3.client('personalize') s3 = boto3.client('s3') def push_event_to_Personalize(event): """ Here an event is a file object """ trackingId = ...
import datetime from filter_rotator_function import template_evaluation def test_filter_expressions(): secs_now = int(datetime.datetime.now().timestamp()) res = template_evaluation.eval_template('INCLUDE ItemID WHERE Items.CREATION_TIMESTAMP > {{int(unixtime(now - timedelta_days(14)))}}') assert '{{' not in res...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import os import json import time import boto3 from aws_lambda_powertools import Logger from template_evaluation import eval_expression, eval_template logger = Logger() personalize = boto3.client('personalize') event...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 from simpleeval import simple_eval, DEFAULT_FUNCTIONS, DEFAULT_NAMES import datetime from dateutil.parser import parse import re from typing import Any, Dict """ This script includes the utilities and functions for e...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): # TODO implement describe_dataset_import_job_response = personalize.describe_dataset_import_job( datasetImportJobArn = event['d...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): # TODO implement get_solution_metrics_response = personalize.get_solution_metrics( solutionVersionArn = event['solution_version...
import json import boto3 import base64 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): list_recipes_response = personalize.list_recipes() recipe_arn = "arn:aws:personalize:::recipe/aws-hrnn" # aws-hrnn selected for demo p...
import json import boto3 import base64 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): create_solution_version_response = personalize.create_solution_version( solutionArn = event['solution_arn'] ) so...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): create_dataset_group_response = personalize.create_dataset_group( name = event['input'] ) dataset_group_arn = create_...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): # TODO implement datasetGroupArnVal = event['input'] describe_dataset_group_response = personalize.describe_dataset_group( ...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): # TODO implement dataset_type = "INTERACTIONS" datasetGroupArn = event['datasetGroupArn'] create_dataset_response = personali...
import json import boto3 import base64 def lambda_handler(event, context): # TODO implement #### Attach Policy to S3 Bucket s3 = boto3.client("s3") policy = { "Version": "2012-10-17", "Id": "PersonalizeS3BucketAccessPolicy", "Statement": [ { ...
import json import boto3 import base64 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): userId = str(event['user_id']) itemId = str(event['item_id']) campaignArn = event['campaign_arn'] print("us...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): describe_campaign_response = personalize.describe_campaign( campaignArn = event['campaign_arn'] ) status = describe_campaig...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): describe_solution_version_response = personalize.describe_solution_version( solutionVersionArn = event['solution_version_arn'] ...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): create_dataset_import_job_response = personalize.create_dataset_import_job( jobName = event['datasetimportjob'], datasetAr...
import json import boto3 import base64 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): datasetArn = event['dataset_arn'] bucket = event['bucket_name'] filename = event['file_name'] roleArn = event['role_arn'] ...
import json import base64 import boto3 personalize = boto3.client('personalize') personalize_runtime = boto3.client('personalize-runtime') def lambda_handler(event, context): schema = { "type": "record", "name": "Interactions", "namespace": "com.amazonaws.personalize.schema", "fie...
import logging from boto3 import client class Loader: def __init__(self): self.personalize_cli = client('personalize') self.logger = logging.getLogger() self.logger.setLevel(logging.INFO) self.account_id = client('sts').get_caller_identity()['Account']
from json import loads from boto3 import client def get_params(bucket_name, key_name): S3 = client('s3') return loads( client('s3').get_object(Bucket=bucket_name, Key=key_name)['Body'].read().decode('utf-8') )
class ResourcePending(Exception): pass class ResourceFailed(Exception): pass def take_action(status): if status in {'CREATE PENDING', 'CREATE IN_PROGRESS'}: raise ResourcePending if status != 'ACTIVE': raise ResourceFailed return True def take_action_delete(status): if stat...