├── .gitignore ├── Admin_Console ├── Archive.zip ├── BDB-1274-1-WHITE.png ├── DDL_data_dict.sql ├── DDL_getdashboard.sql ├── DDL_group_membership.sql ├── DDL_object_access.sql ├── DDL_users.sql ├── Dataset_info.py ├── Readme ├── admin-console-new.template ├── admin_console.template ├── cfn │ ├── ReadMe.markdown │ ├── admin-console-athena-tables.json │ ├── admin-console-qs-objects.template │ └── admin_console_lambda.template ├── data_prepare.py ├── folder_assets.py ├── loginwithoutviewdashboard.sql └── qs_monitoring_policy.JSON ├── Administrative_Dashboard ├── .gitignore ├── .idea │ ├── .gitignore │ ├── aws.xml │ ├── inspectionProfiles │ │ └── profiles_settings.xml │ ├── misc.xml │ ├── modules.xml │ └── vcs.xml ├── README.md ├── administrative_dashboard │ ├── __init__.py │ └── administrative_dashboard_stack.py ├── app.py ├── cdk.json ├── lambda_functions │ ├── data_prepare │ │ └── data_prepare.py │ ├── group_initiation │ │ └── group_initiation.py │ └── user_initiation │ │ └── user_initiation.py ├── requirements.txt ├── setup.py └── source.bat ├── BIOps_Deployment_Scripts ├── Jupyter Notebook │ ├── 6_Batch_Deployment.ipynb │ ├── 7_Incremental_Deployment.ipynb │ ├── 8_Folder_Deployment.ipynb │ ├── BIOps_QuickSight Objects Deployment and Version Control_V2.pptx │ ├── Functions.ipynb │ └── README.md ├── cdk │ ├── .gitignore │ ├── README.md │ ├── app.py │ ├── cdk.json │ ├── cdk │ │ ├── infra_target_account_stack.py │ │ ├── optional_infra_target_account_stack.py │ │ ├── quicksight_embed_stack.py │ │ ├── quicksight_migration_stack.py │ │ └── quicksight_status_stack.py │ ├── html │ │ └── index.html │ ├── lambda │ │ ├── embed_auth │ │ │ └── index.js │ │ ├── quicksight_dash_info │ │ │ ├── __init__.py │ │ │ └── quicksight_dash_info.py │ │ ├── quicksight_embed │ │ │ ├── __init__.py │ │ │ └── quicksight_embed.py │ │ ├── quicksight_migration │ │ │ └── quicksight_migration │ │ │ │ ├── __init__.py │ │ │ │ ├── batch_migration_lambda.py │ │ │ │ ├── incremental_migration_lambda.py │ │ │ │ ├── lambda_function.py │ │ │ │ └── quicksight_utils.py │ │ └── quicksight_status │ │ │ └── quicksight_status.py │ ├── requirements.txt │ ├── setup.py │ └── source.bat └── quicksight-deployment-cdk-slim │ ├── Readme.md │ ├── app.py │ ├── cdk.json │ ├── cdk │ ├── __init__.py │ ├── quicksight_migration_stack.py │ └── quicksight_target_stack.py │ ├── events │ └── sample.json │ ├── images │ ├── cli_log.png │ └── cloudwatch_log.png │ ├── requirements.txt │ ├── setup.py │ └── src │ ├── __init__.py │ ├── common │ ├── __init__.py │ └── constants.py │ ├── lambda_function.py │ ├── quicksight_migration.py │ └── utils │ ├── __init__.py │ ├── aws_utils.py │ ├── quicksight_utils.py │ └── utils.py ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dataset_Refresh_Optimizer ├── README.md ├── configuration │ └── config.json ├── deployment │ ├── deploy.sh │ ├── event.yaml │ ├── params.json │ ├── stack.yaml │ └── temp_stack.yaml ├── doc │ ├── conf.py │ └── index.rst ├── lambda_source │ └── index.py ├── requirements.txt ├── setup.cfg ├── setup.py ├── source │ ├── __init__.py │ ├── py.typed │ ├── scheduler.py │ └── test.py └── test │ ├── __init__.py │ └── integrated_sublevel.sh ├── Ingest Excel data automatically into Amazon QuickSight ├── DataClean.py ├── README.md └── qsAutoIngestion.py ├── LICENSE ├── README.md ├── SageMaker_Integration_Example ├── ReadMe.txt ├── Schema.json ├── autopilot_customer_churn.ipynb ├── bankchurners_model_schema ├── bankchurners_test.csv ├── bankchurners_training.csv └── test_data.csv ├── Update_Week_Start_Analysis └── UpdateWeekStartAnalysis.py ├── granular_access ├── .gitignore ├── .venv │ ├── bin │ │ ├── activate │ │ ├── activate.csh │ │ ├── activate.fish │ │ ├── easy_install │ │ ├── easy_install-3.7 │ │ ├── pip │ │ ├── pip3 │ │ ├── pip3.7 │ │ ├── python │ │ └── python3 │ ├── lib │ │ └── python3.7 │ │ │ └── site-packages │ │ │ ├── easy_install.py │ │ │ ├── pip-19.0.3.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE.txt │ │ │ ├── METADATA │ │ │ ├── RECORD │ │ │ ├── WHEEL │ │ │ ├── entry_points.txt │ │ │ └── top_level.txt │ │ │ ├── pip │ │ │ ├── __init__.py │ │ │ ├── __main__.py │ │ │ ├── _internal │ │ │ │ ├── __init__.py │ │ │ │ ├── build_env.py │ │ │ │ ├── cache.py │ │ │ │ ├── cli │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── autocompletion.py │ │ │ │ │ ├── base_command.py │ │ │ │ │ ├── cmdoptions.py │ │ │ │ │ ├── main_parser.py │ │ │ │ │ ├── parser.py │ │ │ │ │ └── status_codes.py │ │ │ │ ├── commands │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── check.py │ │ │ │ │ ├── completion.py │ │ │ │ │ ├── configuration.py │ │ │ │ │ ├── download.py │ │ │ │ │ ├── freeze.py │ │ │ │ │ ├── hash.py │ │ │ │ │ ├── help.py │ │ │ │ │ ├── install.py │ │ │ │ │ ├── list.py │ │ │ │ │ ├── search.py │ │ │ │ │ ├── show.py │ │ │ │ │ ├── uninstall.py │ │ │ │ │ └── wheel.py │ │ │ │ ├── configuration.py │ │ │ │ ├── download.py │ │ │ │ ├── exceptions.py │ │ │ │ ├── index.py │ │ │ │ ├── locations.py │ │ │ │ ├── models │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── candidate.py │ │ │ │ │ ├── format_control.py │ │ │ │ │ ├── index.py │ │ │ │ │ └── link.py │ │ │ │ ├── operations │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── check.py │ │ │ │ │ ├── freeze.py │ │ │ │ │ └── prepare.py │ │ │ │ ├── pep425tags.py │ │ │ │ ├── pyproject.py │ │ │ │ ├── req │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── constructors.py │ │ │ │ │ ├── req_file.py │ │ │ │ │ ├── req_install.py │ │ │ │ │ ├── req_set.py │ │ │ │ │ ├── req_tracker.py │ │ │ │ │ └── req_uninstall.py │ │ │ │ ├── resolve.py │ │ │ │ ├── utils │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── appdirs.py │ │ │ │ │ ├── compat.py │ │ │ │ │ ├── deprecation.py │ │ │ │ │ ├── encoding.py │ │ │ │ │ ├── filesystem.py │ │ │ │ │ ├── glibc.py │ │ │ │ │ ├── hashes.py │ │ │ │ │ ├── logging.py │ │ │ │ │ ├── misc.py │ │ │ │ │ ├── models.py │ │ │ │ │ ├── outdated.py │ │ │ │ │ ├── packaging.py │ │ │ │ │ ├── setuptools_build.py │ │ │ │ │ ├── temp_dir.py │ │ │ │ │ ├── typing.py │ │ │ │ │ └── ui.py │ │ │ │ ├── vcs │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── bazaar.py │ │ │ │ │ ├── git.py │ │ │ │ │ ├── mercurial.py │ │ │ │ │ └── subversion.py │ │ │ │ └── wheel.py │ │ │ └── _vendor │ │ │ │ ├── __init__.py │ │ │ │ ├── appdirs.py │ │ │ │ ├── cachecontrol │ │ │ │ ├── __init__.py │ │ │ │ ├── _cmd.py │ │ │ │ ├── adapter.py │ │ │ │ ├── cache.py │ │ │ │ ├── caches │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── file_cache.py │ │ │ │ │ └── redis_cache.py │ │ │ │ ├── compat.py │ │ │ │ ├── controller.py │ │ │ │ ├── filewrapper.py │ │ │ │ ├── heuristics.py │ │ │ │ ├── serialize.py │ │ │ │ └── wrapper.py │ │ │ │ ├── certifi │ │ │ │ ├── __init__.py │ │ │ │ ├── __main__.py │ │ │ │ ├── cacert.pem │ │ │ │ └── core.py │ │ │ │ ├── chardet │ │ │ │ ├── __init__.py │ │ │ │ ├── big5freq.py │ │ │ │ ├── big5prober.py │ │ │ │ ├── chardistribution.py │ │ │ │ ├── charsetgroupprober.py │ │ │ │ ├── charsetprober.py │ │ │ │ ├── cli │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── chardetect.py │ │ │ │ ├── codingstatemachine.py │ │ │ │ ├── compat.py │ │ │ │ ├── cp949prober.py │ │ │ │ ├── enums.py │ │ │ │ ├── escprober.py │ │ │ │ ├── escsm.py │ │ │ │ ├── eucjpprober.py │ │ │ │ ├── euckrfreq.py │ │ │ │ ├── euckrprober.py │ │ │ │ ├── euctwfreq.py │ │ │ │ ├── euctwprober.py │ │ │ │ ├── gb2312freq.py │ │ │ │ ├── gb2312prober.py │ │ │ │ ├── hebrewprober.py │ │ │ │ ├── jisfreq.py │ │ │ │ ├── jpcntx.py │ │ │ │ ├── langbulgarianmodel.py │ │ │ │ ├── langcyrillicmodel.py │ │ │ │ ├── langgreekmodel.py │ │ │ │ ├── langhebrewmodel.py │ │ │ │ ├── langhungarianmodel.py │ │ │ │ ├── langthaimodel.py │ │ │ │ ├── langturkishmodel.py │ │ │ │ ├── latin1prober.py │ │ │ │ ├── mbcharsetprober.py │ │ │ │ ├── mbcsgroupprober.py │ │ │ │ ├── mbcssm.py │ │ │ │ ├── sbcharsetprober.py │ │ │ │ ├── sbcsgroupprober.py │ │ │ │ ├── sjisprober.py │ │ │ │ ├── universaldetector.py │ │ │ │ ├── utf8prober.py │ │ │ │ └── version.py │ │ │ │ ├── colorama │ │ │ │ ├── __init__.py │ │ │ │ ├── ansi.py │ │ │ │ ├── ansitowin32.py │ │ │ │ ├── initialise.py │ │ │ │ ├── win32.py │ │ │ │ └── winterm.py │ │ │ │ ├── distlib │ │ │ │ ├── __init__.py │ │ │ │ ├── _backport │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── misc.py │ │ │ │ │ ├── shutil.py │ │ │ │ │ ├── sysconfig.cfg │ │ │ │ │ ├── sysconfig.py │ │ │ │ │ └── tarfile.py │ │ │ │ ├── compat.py │ │ │ │ ├── database.py │ │ │ │ ├── index.py │ │ │ │ ├── locators.py │ │ │ │ ├── manifest.py │ │ │ │ ├── markers.py │ │ │ │ ├── metadata.py │ │ │ │ ├── resources.py │ │ │ │ ├── scripts.py │ │ │ │ ├── t32.exe │ │ │ │ ├── t64.exe │ │ │ │ ├── util.py │ │ │ │ ├── version.py │ │ │ │ ├── w32.exe │ │ │ │ ├── w64.exe │ │ │ │ └── wheel.py │ │ │ │ ├── distro.py │ │ │ │ ├── html5lib │ │ │ │ ├── __init__.py │ │ │ │ ├── _ihatexml.py │ │ │ │ ├── _inputstream.py │ │ │ │ ├── _tokenizer.py │ │ │ │ ├── _trie │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _base.py │ │ │ │ │ ├── datrie.py │ │ │ │ │ └── py.py │ │ │ │ ├── _utils.py │ │ │ │ ├── constants.py │ │ │ │ ├── filters │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── alphabeticalattributes.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── inject_meta_charset.py │ │ │ │ │ ├── lint.py │ │ │ │ │ ├── optionaltags.py │ │ │ │ │ ├── sanitizer.py │ │ │ │ │ └── whitespace.py │ │ │ │ ├── html5parser.py │ │ │ │ ├── serializer.py │ │ │ │ ├── treeadapters │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── genshi.py │ │ │ │ │ └── sax.py │ │ │ │ ├── treebuilders │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── dom.py │ │ │ │ │ ├── etree.py │ │ │ │ │ └── etree_lxml.py │ │ │ │ └── treewalkers │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── dom.py │ │ │ │ │ ├── etree.py │ │ │ │ │ ├── etree_lxml.py │ │ │ │ │ └── genshi.py │ │ │ │ ├── idna │ │ │ │ ├── __init__.py │ │ │ │ ├── codec.py │ │ │ │ ├── compat.py │ │ │ │ ├── core.py │ │ │ │ ├── idnadata.py │ │ │ │ ├── intranges.py │ │ │ │ ├── package_data.py │ │ │ │ └── uts46data.py │ │ │ │ ├── ipaddress.py │ │ │ │ ├── lockfile │ │ │ │ ├── __init__.py │ │ │ │ ├── linklockfile.py │ │ │ │ ├── mkdirlockfile.py │ │ │ │ ├── pidlockfile.py │ │ │ │ ├── sqlitelockfile.py │ │ │ │ └── symlinklockfile.py │ │ │ │ ├── msgpack │ │ │ │ ├── __init__.py │ │ │ │ ├── _version.py │ │ │ │ ├── exceptions.py │ │ │ │ └── fallback.py │ │ │ │ ├── packaging │ │ │ │ ├── __about__.py │ │ │ │ ├── __init__.py │ │ │ │ ├── _compat.py │ │ │ │ ├── _structures.py │ │ │ │ ├── markers.py │ │ │ │ ├── requirements.py │ │ │ │ ├── specifiers.py │ │ │ │ ├── utils.py │ │ │ │ └── version.py │ │ │ │ ├── pep517 │ │ │ │ ├── __init__.py │ │ │ │ ├── _in_process.py │ │ │ │ ├── build.py │ │ │ │ ├── check.py │ │ │ │ ├── colorlog.py │ │ │ │ ├── compat.py │ │ │ │ ├── envbuild.py │ │ │ │ └── wrappers.py │ │ │ │ ├── pkg_resources │ │ │ │ ├── __init__.py │ │ │ │ └── py31compat.py │ │ │ │ ├── progress │ │ │ │ ├── __init__.py │ │ │ │ ├── bar.py │ │ │ │ ├── counter.py │ │ │ │ ├── helpers.py │ │ │ │ └── spinner.py │ │ │ │ ├── pyparsing.py │ │ │ │ ├── pytoml │ │ │ │ ├── __init__.py │ │ │ │ ├── core.py │ │ │ │ ├── parser.py │ │ │ │ ├── test.py │ │ │ │ ├── utils.py │ │ │ │ └── writer.py │ │ │ │ ├── requests │ │ │ │ ├── __init__.py │ │ │ │ ├── __version__.py │ │ │ │ ├── _internal_utils.py │ │ │ │ ├── adapters.py │ │ │ │ ├── api.py │ │ │ │ ├── auth.py │ │ │ │ ├── certs.py │ │ │ │ ├── compat.py │ │ │ │ ├── cookies.py │ │ │ │ ├── exceptions.py │ │ │ │ ├── help.py │ │ │ │ ├── hooks.py │ │ │ │ ├── models.py │ │ │ │ ├── packages.py │ │ │ │ ├── sessions.py │ │ │ │ ├── status_codes.py │ │ │ │ ├── structures.py │ │ │ │ └── utils.py │ │ │ │ ├── retrying.py │ │ │ │ ├── six.py │ │ │ │ ├── urllib3 │ │ │ │ ├── __init__.py │ │ │ │ ├── _collections.py │ │ │ │ ├── connection.py │ │ │ │ ├── connectionpool.py │ │ │ │ ├── contrib │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _appengine_environ.py │ │ │ │ │ ├── _securetransport │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── bindings.py │ │ │ │ │ │ └── low_level.py │ │ │ │ │ ├── appengine.py │ │ │ │ │ ├── ntlmpool.py │ │ │ │ │ ├── pyopenssl.py │ │ │ │ │ ├── securetransport.py │ │ │ │ │ └── socks.py │ │ │ │ ├── exceptions.py │ │ │ │ ├── fields.py │ │ │ │ ├── filepost.py │ │ │ │ ├── packages │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── backports │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── makefile.py │ │ │ │ │ ├── six.py │ │ │ │ │ └── ssl_match_hostname │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── _implementation.py │ │ │ │ ├── poolmanager.py │ │ │ │ ├── request.py │ │ │ │ ├── response.py │ │ │ │ └── util │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── connection.py │ │ │ │ │ ├── queue.py │ │ │ │ │ ├── request.py │ │ │ │ │ ├── response.py │ │ │ │ │ ├── retry.py │ │ │ │ │ ├── ssl_.py │ │ │ │ │ ├── timeout.py │ │ │ │ │ ├── url.py │ │ │ │ │ └── wait.py │ │ │ │ └── webencodings │ │ │ │ ├── __init__.py │ │ │ │ ├── labels.py │ │ │ │ ├── mklabels.py │ │ │ │ ├── tests.py │ │ │ │ └── x_user_defined.py │ │ │ ├── pkg_resources │ │ │ ├── __init__.py │ │ │ ├── _vendor │ │ │ │ ├── __init__.py │ │ │ │ ├── appdirs.py │ │ │ │ ├── packaging │ │ │ │ │ ├── __about__.py │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _compat.py │ │ │ │ │ ├── _structures.py │ │ │ │ │ ├── markers.py │ │ │ │ │ ├── requirements.py │ │ │ │ │ ├── specifiers.py │ │ │ │ │ ├── utils.py │ │ │ │ │ └── version.py │ │ │ │ ├── pyparsing.py │ │ │ │ └── six.py │ │ │ ├── extern │ │ │ │ └── __init__.py │ │ │ └── py31compat.py │ │ │ ├── setuptools-40.8.0.dist-info │ │ │ ├── INSTALLER │ │ │ ├── LICENSE │ │ │ ├── METADATA │ │ │ ├── RECORD │ │ │ ├── WHEEL │ │ │ ├── dependency_links.txt │ │ │ ├── entry_points.txt │ │ │ ├── top_level.txt │ │ │ └── zip-safe │ │ │ └── setuptools │ │ │ ├── __init__.py │ │ │ ├── _deprecation_warning.py │ │ │ ├── _vendor │ │ │ ├── __init__.py │ │ │ ├── packaging │ │ │ │ ├── __about__.py │ │ │ │ ├── __init__.py │ │ │ │ ├── _compat.py │ │ │ │ ├── _structures.py │ │ │ │ ├── markers.py │ │ │ │ ├── requirements.py │ │ │ │ ├── specifiers.py │ │ │ │ ├── utils.py │ │ │ │ └── version.py │ │ │ ├── pyparsing.py │ │ │ └── six.py │ │ │ ├── archive_util.py │ │ │ ├── build_meta.py │ │ │ ├── cli-32.exe │ │ │ ├── cli-64.exe │ │ │ ├── cli.exe │ │ │ ├── command │ │ │ ├── __init__.py │ │ │ ├── alias.py │ │ │ ├── bdist_egg.py │ │ │ ├── bdist_rpm.py │ │ │ ├── bdist_wininst.py │ │ │ ├── build_clib.py │ │ │ ├── build_ext.py │ │ │ ├── build_py.py │ │ │ ├── develop.py │ │ │ ├── dist_info.py │ │ │ ├── easy_install.py │ │ │ ├── egg_info.py │ │ │ ├── install.py │ │ │ ├── install_egg_info.py │ │ │ ├── install_lib.py │ │ │ ├── install_scripts.py │ │ │ ├── launcher manifest.xml │ │ │ ├── py36compat.py │ │ │ ├── register.py │ │ │ ├── rotate.py │ │ │ ├── saveopts.py │ │ │ ├── sdist.py │ │ │ ├── setopt.py │ │ │ ├── test.py │ │ │ ├── upload.py │ │ │ └── upload_docs.py │ │ │ ├── config.py │ │ │ ├── dep_util.py │ │ │ ├── depends.py │ │ │ ├── dist.py │ │ │ ├── extension.py │ │ │ ├── extern │ │ │ └── __init__.py │ │ │ ├── glibc.py │ │ │ ├── glob.py │ │ │ ├── gui-32.exe │ │ │ ├── gui-64.exe │ │ │ ├── gui.exe │ │ │ ├── launch.py │ │ │ ├── lib2to3_ex.py │ │ │ ├── monkey.py │ │ │ ├── msvc.py │ │ │ ├── namespaces.py │ │ │ ├── package_index.py │ │ │ ├── pep425tags.py │ │ │ ├── py27compat.py │ │ │ ├── py31compat.py │ │ │ ├── py33compat.py │ │ │ ├── sandbox.py │ │ │ ├── script (dev).tmpl │ │ │ ├── script.tmpl │ │ │ ├── site-patch.py │ │ │ ├── ssl_support.py │ │ │ ├── unicode_utils.py │ │ │ ├── version.py │ │ │ ├── wheel.py │ │ │ └── windows_support.py │ └── pyvenv.cfg ├── README.md ├── app.py ├── cdk.json ├── cdk.out.zip ├── employee_information.csv ├── fact_revenue.csv ├── granular_access │ ├── __init__.py │ └── granular_access_stack.py ├── lambda_functions │ ├── check_team_members │ │ └── check_team_members.py │ ├── downgrade_user │ │ └── downgrade_user.py │ ├── granular_access_assets_govenance │ │ └── granular_access_assets_govenance.py │ ├── granular_user_govenance │ │ └── granular_user_govenance.py │ └── user_init │ │ └── user_init.py ├── membership.csv ├── membership.zip ├── qsassets.json ├── requirements.txt ├── setup.py └── source.bat ├── quicksight_q_artfacts ├── clean_data_files │ ├── Medals.csv │ ├── Tech_official_2021.csv │ ├── Women-in-the-Olympic-Movement.csv │ ├── athlete-full-2021.csv │ ├── coach_full_2021.csv │ ├── introduction_of_women_olympic_sports.csv │ ├── medals-athletes.csv │ └── olympics.csv ├── clean_data_with_notebook │ ├── README.md │ ├── data │ │ └── medals_athletes.csv │ ├── main.py │ ├── notebooks │ │ └── olympic.ipynb │ └── requirements.txt ├── clean_data_with_sql │ ├── athletes_full_2021.txt │ ├── coach_full_2021.txt │ ├── medals_athletes_2021.txt │ ├── olympics.txt │ ├── tech_official_2021.txt │ ├── women_in_olympic_movement.txt │ └── women_introduction_to_olympics.txt └── cloudformation │ ├── athenatables.json │ └── qsassets.json └── service-2.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | *.egg-info 7 | .vscode 8 | # CDK asset staging directory 9 | .cdk.staging 10 | cdk.out 11 | .DS_Store 12 | /.venv/ 13 | .idea/ 14 | -------------------------------------------------------------------------------- /Admin_Console/Archive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/Admin_Console/Archive.zip -------------------------------------------------------------------------------- /Admin_Console/BDB-1274-1-WHITE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/Admin_Console/BDB-1274-1-WHITE.png -------------------------------------------------------------------------------- /Admin_Console/DDL_data_dict.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `admin_console.data_dict`( 2 | `datasetname` string, 3 | `datasetid` string, 4 | `columnname` string, 5 | `columntype` string, 6 | `columndesc` string) 7 | ROW FORMAT DELIMITED 8 | FIELDS TERMINATED BY ',' 9 | STORED AS INPUTFORMAT 10 | 'org.apache.hadoop.mapred.TextInputFormat' 11 | OUTPUTFORMAT 12 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 13 | LOCATION 14 | 's3://administrative-dashboard624969228231/monitoring/quicksight/data_dictionary/' 15 | TBLPROPERTIES ( 16 | 'areColumnsQuoted'='false', 17 | 'classification'='csv', 18 | 'columnsOrdered'='true', 19 | 'compressionType'='none', 20 | 'delimiter'=',', 21 | 'typeOfData'='file') -------------------------------------------------------------------------------- /Admin_Console/DDL_getdashboard.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE VIEW getdashboard AS 2 | (SELECT 3 | "useridentity"."type", "split_part"("useridentity"."sessioncontext"."sessionissuer"."arn",'/', 2) AS "assumed_role", COALESCE("useridentity"."username","concat"("split_part"("userid 4 | entity"."arn", '/', 2), '/', "split_part"("useridentity"."arn", 5 | '/', 3))) AS "user_name", 6 | awsregion, 7 | "split_part"("split_part"("serviceeventdetails", 'dashboardName":', 2),',', 1) AS dashboard_name, "split_part"("split_part"("split_part"("split_part"("serviceeventdetails", 'dashboardId":', 2),',', 1), 'dashboard/', 2),'"}',1) AS dashboardId, 8 | date_parse(eventtime, '%Y-%m-%dT%H:%i:%sZ') AS event_time, max(date_parse(eventtime, '%Y-%m-%dT%H:%i:%sZ')) AS latest_event_time 9 | FROM cloudtrail_logs 10 | WHERE 11 | eventsource = 'quicksight.amazonaws.com' 12 | AND 13 | eventname = 'GetDashboard' 14 | AND 15 | DATE_TRUNC('day',date_parse(eventtime, '%Y-%m-%dT%H:%i:%sZ')) > cast(current_date - interval '3' month AS date) 16 | GROUP BY 1,2,3,4,5,6,7) -------------------------------------------------------------------------------- /Admin_Console/DDL_group_membership.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `group_membership`( 2 | `namespace` string, 3 | `group` string, 4 | `user` string) 5 | ROW FORMAT DELIMITED 6 | FIELDS TERMINATED BY ',' 7 | STORED AS INPUTFORMAT 8 | 'org.apache.hadoop.mapred.TextInputFormat' 9 | OUTPUTFORMAT 10 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 11 | LOCATION 12 | 's3:// admin-console/monitoring/quicksight/group_membership/' 13 | TBLPROPERTIES ( 14 | 'areColumnsQuoted'='false', 15 | 'classification'='csv', 16 | 'columnsOrdered'='true', 17 | 'compressionType'='none', 18 | 'delimiter'=',', 19 | 'typeOfData'='file') -------------------------------------------------------------------------------- /Admin_Console/DDL_object_access.sql: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `object_access`( 2 | `aws_region` string, 3 | `object_type` string, 4 | `object_name` string, 5 | `object_id` string, 6 | `principal_type` string, 7 | `principal_name` string, 8 | `namespace` string, 9 | `permissions` string 10 | ) 11 | ROW FORMAT DELIMITED 12 | FIELDS TERMINATED BY ',' 13 | STORED AS INPUTFORMAT 14 | 'org.apache.hadoop.mapred.TextInputFormat' 15 | OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 16 | LOCATION 17 | 's3:// admin-console/monitoring/quicksight/object_access/' 18 | TBLPROPERTIES ( 19 | 'areColumnsQuoted'='false', 20 | 'classification'='csv', 21 | 'columnsOrdered'='true', 22 | 'compressionType'='none', 23 | 'delimiter'=',', 24 | 'typeOfData'='file') -------------------------------------------------------------------------------- /Admin_Console/DDL_users.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE VIEW users AS 2 | (select Namespace, 3 | Group, 4 | User, 5 | (case 6 | when Group in ('quicksight-fed-bi-developer', 'quicksight-fed-bi-admin') 7 | then 'Author' 8 | else 'Reader' 9 | end) 10 | as author_status 11 | from "group_membership" ) -------------------------------------------------------------------------------- /Admin_Console/Readme: -------------------------------------------------------------------------------- 1 | Please refer to this blog post: https://aws.amazon.com/blogs/big-data/building-an-administrative-console-in-amazon-quicksight-to-analyze-usage-metrics/ 2 | -------------------------------------------------------------------------------- /Admin_Console/loginwithoutviewdashboard.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE VIEW "loginwithoutviewdashboard" AS 2 | with login as 3 | (SELECT COALESCE("useridentity"."username", "split_part"("useridentity"."arn", '/', 3)) AS "user_name", awsregion, 4 | date_parse(eventtime, '%Y-%m-%dT%H:%i:%sZ') AS event_time 5 | FROM cloudtrail_logs 6 | WHERE 7 | eventname = 'AssumeRoleWithSAML' 8 | GROUP BY 1,2,3), 9 | dashboard as 10 | (SELECT COALESCE("useridentity"."username", "split_part"("useridentity"."arn", '/', 3)) AS "user_name", awsregion, 11 | date_parse(eventtime, '%Y-%m-%dT%H:%i:%sZ') AS event_time 12 | FROM cloudtrail_logs 13 | WHERE 14 | eventsource = 'quicksight.amazonaws.com' 15 | AND 16 | eventname = 'GetDashboard' 17 | GROUP BY 1,2,3), 18 | users as 19 | (select Namespace, 20 | Group, 21 | User, 22 | (case 23 | when Group in (‘quicksight-fed-bi-developer’, ‘quicksight-fed-bi-admin’) 24 | then ‘Author’ 25 | else ‘Reader’ 26 | end) 27 | as author_status 28 | from "group_membership" ) 29 | select l.* 30 | from login as l 31 | join dashboard as d 32 | join users as u 33 | on l.user_name=d.user_name 34 | and 35 | l.awsregion=d.awsregion 36 | and 37 | l.user_name=u.user_name 38 | where d.event_time>(l.event_time + interval '30' minute ) 39 | and 40 | d.event_time 2 | 3 | 4 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /Administrative_Dashboard/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /Administrative_Dashboard/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /Administrative_Dashboard/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Administrative_Dashboard/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Administrative_Dashboard/README.md: -------------------------------------------------------------------------------- 1 | https://aws.amazon.com/blogs/big-data/using-administrative-dashboards-for-a-centralized-view-of-amazon-quicksight-objects/ 2 | -------------------------------------------------------------------------------- /Administrative_Dashboard/administrative_dashboard/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/Administrative_Dashboard/administrative_dashboard/__init__.py -------------------------------------------------------------------------------- /Administrative_Dashboard/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from aws_cdk import core 4 | 5 | from administrative_dashboard.administrative_dashboard_stack import QuickSightStack 6 | 7 | 8 | app = core.App() 9 | QuickSightStack(app, "QuickSightStack", env={'region': 'us-east-1'}) 10 | 11 | app.synth() -------------------------------------------------------------------------------- /Administrative_Dashboard/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/core:enableStackNameDuplicates": "true", 5 | "aws-cdk:enableDiffNoFail": "true" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Administrative_Dashboard/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | -------------------------------------------------------------------------------- /Administrative_Dashboard/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="administrative_dashboard", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "administrative_dashboard"}, 19 | packages=setuptools.find_packages(where="administrative_dashboard"), 20 | 21 | install_requires=[ 22 | "aws-cdk.core==1.72.0", 23 | ], 24 | 25 | python_requires=">=3.6", 26 | 27 | classifiers=[ 28 | "Development Status :: 4 - Beta", 29 | 30 | "Intended Audience :: Developers", 31 | 32 | "License :: OSI Approved :: Apache Software License", 33 | 34 | "Programming Language :: JavaScript", 35 | "Programming Language :: Python :: 3 :: Only", 36 | "Programming Language :: Python :: 3.6", 37 | "Programming Language :: Python :: 3.7", 38 | "Programming Language :: Python :: 3.8", 39 | 40 | "Topic :: Software Development :: Code Generators", 41 | "Topic :: Utilities", 42 | 43 | "Typing :: Typed", 44 | ], 45 | ) 46 | -------------------------------------------------------------------------------- /Administrative_Dashboard/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .env/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .env\Scripts\activate.bat for you 13 | .env\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/Jupyter Notebook/BIOps_QuickSight Objects Deployment and Version Control_V2.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/Jupyter Notebook/BIOps_QuickSight Objects Deployment and Version Control_V2.pptx -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | *.egg-info 7 | .vscode 8 | # CDK asset staging directory 9 | .cdk.staging 10 | cdk.context.json 11 | cdk.out 12 | .DS_Store 13 | .venv -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/app.py: -------------------------------------------------------------------------------- 1 | """QuickSight""" 2 | import os 3 | from aws_cdk import core 4 | 5 | from cdk.quicksight_status_stack import QuicksightStatusStack 6 | from cdk.quicksight_migration_stack import QuicksightMigrationStack 7 | from cdk.optional_infra_target_account_stack import OptionalInfraTargetAccountStack 8 | from cdk.infra_target_account_stack import InfraTargetAccountStack 9 | from cdk.quicksight_embed_stack import QuicksightEmbedStack 10 | 11 | ENV = core.Environment( 12 | account=os.environ.get("CDK_DEPLOY_ACCOUNT", os.environ["CDK_DEFAULT_ACCOUNT"]), 13 | region=os.environ.get("CDK_DEPLOY_REGION", os.environ["CDK_DEFAULT_REGION"]) 14 | ) 15 | 16 | app = core.App() 17 | 18 | # Deploys a test Redshift and RDS 19 | optional_infra_target_accounts = OptionalInfraTargetAccountStack( 20 | app, id="optional-infra-target-account-stack", 21 | env=ENV 22 | ) 23 | 24 | infra_target_accounts = InfraTargetAccountStack( 25 | app, id="infra-target-account-stack", 26 | env=ENV 27 | ) 28 | 29 | quicksight_dynamodb = QuicksightStatusStack( 30 | app, id="quicksight-status-stack", 31 | env=ENV 32 | ) 33 | 34 | quicksight_migration = QuicksightMigrationStack( 35 | app, id="quicksight-migration-stack", 36 | env=ENV 37 | ) 38 | 39 | quicksight_embed = QuicksightEmbedStack( 40 | app, id="quicksight-embed-stack", 41 | env=ENV 42 | ) 43 | 44 | app.synth() 45 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/core:enableStackNameDuplicates": "true", 5 | "aws-cdk:enableDiffNoFail": "true", 6 | "@aws-cdk/core:stackRelativeExports": "true", 7 | "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/lambda/embed_auth/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | exports.handler = (event, context, callback) => { 3 | 4 | // Get request and request headers 5 | const request = event.Records[0].cf.request; 6 | const headers = request.headers; 7 | 8 | // Configure authentication 9 | const authUser = 'CHANGEME_USERNAME'; 10 | const authPass = 'CHANGEME_PASSWORD'; 11 | 12 | // Construct the Basic Auth string 13 | const authString = 'Basic ' + new Buffer(authUser + ':' + authPass).toString('base64'); 14 | 15 | // Require Basic authentication 16 | if (typeof headers.authorization == 'undefined' || headers.authorization[0].value != authString) { 17 | const body = 'Unauthorized'; 18 | const response = { 19 | status: '401', 20 | statusDescription: 'Unauthorized', 21 | body: body, 22 | headers: { 23 | 'www-authenticate': [{key: 'WWW-Authenticate', value:'Basic'}] 24 | }, 25 | }; 26 | callback(null, response); 27 | } 28 | 29 | // Continue request processing if authentication passed 30 | callback(null, request); 31 | }; 32 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/lambda/quicksight_dash_info/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/cdk/lambda/quicksight_dash_info/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/lambda/quicksight_embed/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/cdk/lambda/quicksight_embed/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/lambda/quicksight_migration/quicksight_migration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/cdk/lambda/quicksight_migration/quicksight_migration/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/requirements.txt: -------------------------------------------------------------------------------- 1 | aws_cdk.aws_apigateway==1.134.0 2 | aws-cdk.aws-cloudfront==1.134.0 3 | aws-cdk.aws-cloudfront-origins==1.134.0 4 | aws-cdk.aws-dynamodb==1.134.0 5 | aws-cdk.aws-events==1.134.0 6 | aws-cdk.aws-events-targets==1.134.0 7 | aws-cdk.aws-iam==1.134.0 8 | aws-cdk.aws-lambda==1.134.0 9 | aws-cdk.aws-lambda-event-sources==1.134.0 10 | aws-cdk.aws-redshift==1.134.0 11 | aws-cdk.aws-rds==1.134.0 12 | aws-cdk.aws-s3==1.134.0 13 | aws-cdk.aws-secretsmanager==1.134.0 14 | aws-cdk.aws-sqs==1.134.0 15 | aws-cdk.core==1.134.0 16 | aws-cdk.region-info==1.134.0 17 | constructs==3.3.69 18 | jsii==1.47.0 19 | aws_solutions_constructs.aws_apigateway_dynamodb==1.134.0 20 | aws_solutions_constructs.aws_apigateway_lambda==1.134.0 21 | aws_solutions_constructs.aws_apigateway_sqs==1.134.0 22 | boto3 23 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="test", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "test"}, 19 | packages=setuptools.find_packages(where="test"), 20 | 21 | install_requires=[ 22 | "aws-cdk.core==1.75.0", 23 | ], 24 | 25 | python_requires=">=3.6", 26 | 27 | classifiers=[ 28 | "Development Status :: 4 - Beta", 29 | 30 | "Intended Audience :: Developers", 31 | 32 | "License :: OSI Approved :: Apache Software License", 33 | 34 | "Programming Language :: JavaScript", 35 | "Programming Language :: Python :: 3 :: Only", 36 | "Programming Language :: Python :: 3.6", 37 | "Programming Language :: Python :: 3.7", 38 | "Programming Language :: Python :: 3.8", 39 | 40 | "Topic :: Software Development :: Code Generators", 41 | "Topic :: Utilities", 42 | 43 | "Typing :: Typed", 44 | ], 45 | ) 46 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/cdk/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/app.py: -------------------------------------------------------------------------------- 1 | import os 2 | from aws_cdk import core 3 | 4 | 5 | from cdk.quicksight_migration_stack import QuicksightMigrationStack # main migration stack 6 | from cdk.quicksight_target_stack import QuicksightTargetStack # target acct stack 7 | 8 | app = core.App() 9 | 10 | QuicksightMigrationStack( 11 | app, id="quicksight-migration-stack", 12 | env=core.Environment( 13 | account=os.environ["CDK_CENTRAL_ACCOUNT"], 14 | region=os.environ["CDK_CENTRAL_REGION"])) 15 | 16 | QuicksightTargetStack( 17 | app, id="quicksight-target-stack", 18 | env=core.Environment( 19 | account=os.environ["CDK_TARGET_ACCOUNT"], 20 | region=os.environ["CDK_TARGET_REGION"]), 21 | central_account=os.environ["CDK_CENTRAL_ACCOUNT"]) 22 | 23 | app.synth() -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/core:enableStackNameDuplicates": "true", 5 | "aws-cdk:enableDiffNoFail": "true", 6 | "@aws-cdk/core:stackRelativeExports": "true", 7 | "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true 8 | } 9 | } -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/cdk/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/cdk/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/events/sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "source_region": "us-east-1", 3 | "source_account_id": "111111111111", 4 | "source_role_name": "quicksight-migration-lambda-role", 5 | "target_region": "us-east-1", 6 | "target_account_id": "111111111111", 7 | "target_role_name": "quicksight-migration-target-assume-role", 8 | "target_admin_users": ["test-user"], 9 | "target_admin_groups": ["test-group"], 10 | "migration_items": { 11 | "dashboards": [ 12 | "test-dashboard" 13 | ], 14 | "analyses": [ 15 | "test-analysis" 16 | ], 17 | "themes": [ 18 | "test-theme" 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/images/cli_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/images/cli_log.png -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/images/cloudwatch_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/images/cloudwatch_log.png -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-cdk.aws-dynamodb==1.144.0 2 | aws-cdk.aws-events==1.144.0 3 | aws-cdk.aws-events-targets==1.144.0 4 | aws-cdk.aws-iam==1.144.0 5 | aws-cdk.aws-lambda==1.144.0 6 | aws-cdk.aws-lambda-event-sources==1.144.0 7 | aws-cdk.aws-redshift==1.144.0 8 | aws-cdk.aws-rds==1.144.0 9 | aws-cdk.aws-s3==1.144.0 10 | aws-cdk.aws-secretsmanager==1.144.0 11 | aws-cdk.aws-sqs==1.144.0 12 | aws-cdk.core==1.144.0 13 | aws-cdk.region-info==1.144.0 14 | aws-cdk.custom-resources==1.144.0 15 | constructs==3.3.69 16 | jsii==1.52.1 17 | boto3 -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="test", 10 | version="0.0.1", 11 | 12 | description="CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "test"}, 19 | packages=setuptools.find_packages(where="test"), 20 | 21 | install_requires=[ 22 | "aws-cdk.core==1.75.0", 23 | ], 24 | 25 | python_requires=">=3.6", 26 | 27 | classifiers=[ 28 | "Development Status :: 4 - Beta", 29 | 30 | "Intended Audience :: Developers", 31 | 32 | "License :: OSI Approved :: Apache Software License", 33 | 34 | "Programming Language :: JavaScript", 35 | "Programming Language :: Python :: 3 :: Only", 36 | "Programming Language :: Python :: 3.6", 37 | "Programming Language :: Python :: 3.7", 38 | "Programming Language :: Python :: 3.8", 39 | 40 | "Topic :: Software Development :: Code Generators", 41 | "Topic :: Utilities", 42 | 43 | "Typing :: Typed", 44 | ], 45 | ) -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/common/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/lambda_function.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from quicksight_migration import MigrateAssets 3 | 4 | logger = logging.getLogger(__name__) 5 | logger.setLevel(logging.INFO) 6 | 7 | 8 | def lambda_handler(event, context): 9 | source_account_id = event["source_account_id"] 10 | source_role_name = event["source_role_name"] 11 | target_account_id = event["target_account_id"] 12 | target_role_name = event["target_role_name"] 13 | source_region = event["source_region"] 14 | target_region = event["target_region"] 15 | target_admin_users = event["target_admin_users"] 16 | target_admin_groups = event["target_admin_groups"] 17 | migration_items = event["migration_items"] 18 | 19 | if not migration_items or len(list(migration_items.keys())) < 1: 20 | logger.error("The migration_items is missing or migration_items list is empty") 21 | raise ValueError("Required parameters were not given") 22 | 23 | MigrateAssets( 24 | source_region, 25 | source_account_id, 26 | source_role_name, 27 | target_region, 28 | target_account_id, 29 | target_role_name, 30 | target_admin_users, 31 | target_admin_groups, 32 | migration_items 33 | ) 34 | 35 | -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/utils/__init__.py -------------------------------------------------------------------------------- /BIOps_Deployment_Scripts/quicksight-deployment-cdk-slim/src/utils/utils.py: -------------------------------------------------------------------------------- 1 | def create_credential(username, password): 2 | Result = { 3 | "CredentialPair": { 4 | "Username": username, 5 | "Password": password, 6 | } 7 | } 8 | return Result 9 | 10 | 11 | def update_nested_dict(in_dict, key, value): 12 | for k, v in in_dict.items(): 13 | if key == k: 14 | in_dict[k] = value 15 | elif isinstance(v, dict): 16 | update_nested_dict(v, key, value) 17 | elif isinstance(v, list): 18 | for o in v: 19 | if isinstance(o, dict): 20 | update_nested_dict(o, key, value) 21 | 22 | 23 | def remove_nested_dict(in_dict): 24 | out_dict = {} 25 | if isinstance(in_dict, dict): 26 | for k in in_dict: 27 | if in_dict[k]: 28 | out_dict[k] = remove_nested_dict(in_dict[k]) 29 | return out_dict 30 | else: 31 | return in_dict 32 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/configuration/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "deployment": "../deployment/", 3 | "stackname": "qs-ds-refresh-optimizer", 4 | "search": "", 5 | "account": "", 6 | "aws_profile": "default", 7 | "aws_region": "us-east-1", 8 | "datasets": { 9 | "proserve-qs-sdk-test": 30, 10 | "nothing": 10 11 | }, 12 | "ignore": [ 13 | "EG Sales by Brand", 14 | "Business Review", 15 | "Marketing Sample", 16 | "People Overview", 17 | "Web and Social Media Analytics" 18 | ] 19 | } -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/deployment/deploy.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -u 5 | set -o pipefail 6 | ROOT="." # DO NOT CHANGE! 7 | 8 | # INPUT PARAMETERS 9 | ################################################################################################################# 10 | S3BUCKET="qs-ds-refresh-optimizer" 11 | PROFILE="default" 12 | REGION="us-east-1" 13 | ################################################################################################################# 14 | 15 | echo '' 16 | echo '-- Packing Lambda source code ...' 17 | S3PATH="lambda_source/" 18 | cd ../lambda_source 19 | zip lambda.zip index.py 20 | 21 | echo '-- Uploading AWS Lambda code to S3 ...' 22 | echo "-- Target S3 PATH: s3://${S3BUCKET}/${S3PATH}" 23 | echo '' 24 | aws s3 --p ${PROFILE} cp *.zip "s3://${S3BUCKET}/${S3PATH}" 25 | 26 | echo '-- Launching scheduler deployment ...' 27 | cd ../source 28 | python3 scheduler.py 29 | 30 | echo '-- Updaing Lambda function ...' 31 | 32 | aws lambda --p ${PROFILE} update-function-code \ 33 | --function-name qs-ds-refresh-optimizer \ 34 | --s3-bucket ${S3BUCKET} \ 35 | --s3-key "${S3PATH}lambda.zip" \ 36 | --region ${REGION} 37 | 38 | echo '' 39 | echo '-- All done.' 40 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/deployment/event.yaml: -------------------------------------------------------------------------------- 1 | 2 | ScheduledRule: 3 | Type: AWS::Events::Rule 4 | Properties: 5 | Description: "ScheduledRule - _TARGET" 6 | Name: "qs-ds-refresh-optimizer-_TARGET" 7 | ScheduleExpression: "_RATE" 8 | State: "DISABLED" 9 | Targets: 10 | - Arn: !GetAtt LambdaFunction.Arn 11 | Id: "TargetFunctionV1" 12 | Input: !Sub '{"TARGET_DATASET": "_TARGET"}' 13 | 14 | PermissionInvoke: 15 | Type: AWS::Lambda::Permission 16 | Properties: 17 | FunctionName: !Ref LambdaFunction 18 | Action: "lambda:InvokeFunction" 19 | Principal: "events.amazonaws.com" 20 | SourceArn: 21 | Fn::GetAtt: 22 | - "ScheduledRule" 23 | - "Arn" 24 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/deployment/params.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ParameterKey": "StackName", 4 | "ParameterValue": "qs-ds-refresh-optimizer" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/deployment/stack.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | 3 | Description: qs-ds-refresh-optimizer | Stack to support automatic refresh of SPICE datasets for QS dashboards # CHANGE 4 | 5 | 6 | Parameters: 7 | 8 | StackName: 9 | Type: String 10 | Default: AWS::NoValue 11 | 12 | Resources: 13 | 14 | QSTopicSNSEmail: 15 | Type: "AWS::SNS::Topic" 16 | Properties: 17 | Subscription: 18 | - Endpoint: "your_email" 19 | Protocol: "email" 20 | 21 | LambdaFunctionRole: 22 | Type: AWS::IAM::Role 23 | Properties: 24 | AssumeRolePolicyDocument: 25 | Version: '2012-10-17' 26 | Statement: 27 | - Effect: Allow 28 | Principal: 29 | Service: 30 | - lambda.amazonaws.com 31 | Action: 32 | - sts:AssumeRole 33 | Path: "/" 34 | Policies: 35 | - PolicyName: LambdaFunctionPolicy 36 | PolicyDocument: 37 | Version: '2012-10-17' 38 | Statement: 39 | - Effect: Allow 40 | Action: 41 | - logs:CreateLogGroup 42 | - logs:CreateLogStream 43 | - logs:PutLogEvents 44 | - ssm:PutParameter 45 | - ssm:DeleteParameter 46 | - ssm:GetParameterHistory 47 | - ssm:GetParametersByPath 48 | - ssm:GetParameters 49 | - ssm:GetParameter 50 | - ssm:DeleteParameters 51 | - ssm:DescribeParameters 52 | - sts:* 53 | - quicksight:* 54 | - sns:* 55 | Resource: '*' 56 | 57 | LambdaFunction: 58 | Type: AWS::Lambda::Function 59 | Properties: 60 | Description: qs-ds-refresh-optimizer | Lambda function to trigger SPICE dataset refresh. 61 | FunctionName: qs-ds-refresh-optimizer 62 | Runtime: python3.8 63 | Timeout: 75 64 | MemorySize: 512 65 | Handler: index.handler 66 | Role: !GetAtt LambdaFunctionRole.Arn 67 | Code: 68 | S3Bucket: qs-ds-refresh-optimizer 69 | S3Key: lambda_source/lambda.zip 70 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/doc/conf.py: -------------------------------------------------------------------------------- 1 | """Sphinx configuration.""" 2 | 3 | import datetime 4 | import os 5 | import shutil 6 | 7 | from amazon_doc_utils import brazil_info 8 | 9 | # Get metadata from brazil 10 | brazil_version, intersphinx_factory = brazil_info.get( 11 | [brazil_info.PackageVersion, brazil_info.IntersphinxFactory] 12 | ) 13 | 14 | 15 | def run_apidoc(app): 16 | """Generate doc stubs using sphinx-apidoc.""" 17 | module_dir = os.path.join(app.srcdir, "../src/") 18 | output_dir = os.path.join(app.srcdir, "_apidoc") 19 | excludes = [] 20 | 21 | # Ensure that any stale apidoc files are cleaned up first. 22 | if os.path.exists(output_dir): 23 | shutil.rmtree(output_dir) 24 | 25 | cmd = [ 26 | "--separate", 27 | "--module-first", 28 | "--doc-project=API Reference", 29 | "-o", 30 | output_dir, 31 | module_dir, 32 | ] 33 | cmd.extend(excludes) 34 | 35 | try: 36 | from sphinx.ext import apidoc # Sphinx >= 1.7 37 | 38 | apidoc.main(cmd) 39 | except ImportError: 40 | from sphinx import apidoc # Sphinx < 1.7 41 | 42 | cmd.insert(0, apidoc.__file__) 43 | apidoc.main(cmd) 44 | 45 | 46 | def setup(app): 47 | """Register our sphinx-apidoc hook.""" 48 | app.connect("builder-inited", run_apidoc) 49 | 50 | 51 | # Sphinx configuration below. 52 | project = brazil_version.name 53 | version = brazil_version.mv 54 | release = brazil_version.full_version 55 | copyright = "{}, Amazon.com".format(datetime.datetime.now().year) 56 | 57 | intersphinx_mapping = intersphinx_factory.get_mapping() 58 | 59 | extensions = [ 60 | "sphinx.ext.autodoc", 61 | "sphinx.ext.intersphinx", 62 | "sphinx.ext.napoleon", 63 | "sphinx.ext.todo", 64 | "sphinx.ext.viewcode", 65 | ] 66 | 67 | source_suffix = ".rst" 68 | master_doc = "index" 69 | 70 | autoclass_content = "class" 71 | autodoc_member_order = "bysource" 72 | default_role = "py:obj" 73 | 74 | html_theme = "haiku" 75 | htmlhelp_basename = "{}doc".format(project) 76 | 77 | napoleon_use_rtype = False 78 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/doc/index.rst: -------------------------------------------------------------------------------- 1 | Qs-ds-refresh-optimizer 2 | ======================= 3 | 4 | Please replace this text with a short description of your package. 5 | 6 | .. toctree:: 7 | 8 | _apidoc/modules 9 | 10 | 11 | Indices and tables 12 | __________________ 13 | 14 | * :ref:`genindex` 15 | * :ref:`modindex` 16 | * :ref:`search` 17 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/source/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/Dataset_Refresh_Optimizer/source/__init__.py -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/source/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file that indicates this package supports typing 2 | -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/Dataset_Refresh_Optimizer/test/__init__.py -------------------------------------------------------------------------------- /Dataset_Refresh_Optimizer/test/integrated_sublevel.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | set -u 5 | set -o pipefail 6 | 7 | cd ../app/ 8 | 9 | echo '' 10 | python3 -m pytest test.py 11 | -------------------------------------------------------------------------------- /Ingest Excel data automatically into Amazon QuickSight/DataClean.py: -------------------------------------------------------------------------------- 1 | import json 2 | import boto3 3 | import pandas as pd 4 | import os, tempfile 5 | import sys 6 | import uuid 7 | from urllib.parse import unquote_plus 8 | 9 | s3_client = boto3.client('s3') 10 | 11 | def lambda_handler(event, context): 12 | message = event['Records'][0]['Sns']['Message'] 13 | bucket = 'Excel-raw-data-YourName' 14 | newbucket = 'Cleaned-data-YourName' 15 | jmessage = json.loads(message) 16 | key = unquote_plus(jmessage["Records"][0]['s3']['object']['key']) 17 | directory_name = tempfile.mkdtemp() 18 | download_path = os.path.join(directory_name, 'raw.xlsx') 19 | newkey= 'cleaned.csv' 20 | upload_path = os.path.join(directory_name, newkey) 21 | s3_client.download_file(bucket, key, download_path) 22 | df = pd.read_Excel(download_path, skiprows=3) 23 | header2 = ['K', 'GEN STATUS'] 24 | df.to_csv(upload_path, columns=header2, index=False) 25 | s3_client.upload_file(upload_path, newbucket, newkey) 26 | 27 | sns = boto3.client('sns') 28 | response = sns.publish( 29 | TopicArn='arn:aws:sns:us-east-1:AWS Account ID: Data-Cleaned', 30 | Message='Data is cleaned and save into bucket Cleaned-data. Auto data ingestion is running.' 31 | ) 32 | return { 33 | 'statusCode': 200, 34 | 'body': json.dumps('Done with cleansing!!') 35 | } 36 | -------------------------------------------------------------------------------- /Ingest Excel data automatically into Amazon QuickSight/README.md: -------------------------------------------------------------------------------- 1 | ## Automatic Excel data ingestion into QuickSight with Lambda and S3 2 | 3 | 1. Download and edit DataClean.py, and then update it with your AWS account ID, bucket name and SNS topic name. Install pandas module in your local Python environment. Noticeably, since Lambda function is based on Amazon Linux operating system, we have to download Pandas and NumPy which are compatible to Amazon Linux when we prepare the package (Link: https://medium.com/@korniichuk/lambda-with-pandas-fd81aa2ff25e). Please Zip the edited package, and upload the zip file to Function code section. 4 | 5 | 2. Follow the QuickSight SDK documentation to prepare the local SDK environment: https://docs.aws.amazon.com/quicksight/latest/user/quicksight-sdk-python.html. Download sample code “qsAutoIngestion.py”. Edit qsAutoIngestion.py, and update it with your AWS account ID, bucket name, dataset ID and SNS topic name. Zip the whole SDK folder as a package, and upload the zip file to function code. 6 | 7 | Author: Ying Wang 8 | Email: wangzyn@amazon.com 9 | 10 | ## License 11 | 12 | This library is licensed under the MIT-0 License. See the LICENSE file. 13 | -------------------------------------------------------------------------------- /Ingest Excel data automatically into Amazon QuickSight/qsAutoIngestion.py: -------------------------------------------------------------------------------- 1 | import json 2 | import botocore.session 3 | from botocore.session import Session 4 | import boto3 5 | import uuid 6 | 7 | def lambda_handler(event, context): 8 | i_id=str(uuid.uuid4()) 9 | default_namespace = 'default' 10 | account_id = 'AWS-Account-ID' 11 | ds_id='SPICE-ID' 12 | session = botocore.session.get_session() 13 | client = session.create_client("quicksight", region_name='us-east-1') 14 | response = client.create_ingestion(AwsAccountId = account_id, DataSetId=ds_id, IngestionId=i_id) 15 | responseIngestionArn = response['IngestionArn'] 16 | describeResponse = client.describe_ingestion(AwsAccountId = account_id, DataSetId=ds_id, IngestionId=i_id) 17 | while (describeResponse['Ingestion']['IngestionStatus'] != 'COMPLETED'): 18 | describeResponse = client.describe_ingestion(AwsAccountId=account_id, DataSetId=ds_id, IngestionId=i_id) 19 | else: 20 | sns =boto3.client('sns') 21 | responsesns = sns.publish(TopicArn='arn:aws:sns:us-east-1::IngestionDone', 22 | Message='Ingestion is finished successfully!!') 23 | 24 | return { 25 | 'statusCode': 200, 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Amazon QuickSight SDK by AWS Pro-Serve 2 | 3 | 1. Ingest Excel data automatically into Amazon QuickSight 4 | 2. Migration Scripts 5 | 3. Administrative Dashboard 6 | 4. Admin Console of Usage Metrics 7 | Updates: CFN support added, Data dictionary added 8 | 5. Granular access control added 9 | 6. Dataset_Refresh_Optimizer added 10 | 7. Update Week Start For All Analysis in an Account added 11 | 12 | Author: AWS ProServe 13 | Email: aws-proserve-quicksight@amazon.com 14 | 15 | ## License 16 | 17 | This library is licensed under the MIT-0 License. See the LICENSE file. 18 | 19 | 20 | 21 | 22 | 💭 [Give us feedback on your QuickSight embedding experience!](https://amazonmr.au1.qualtrics.com/jfe/form/SV_82jpzFSMLDBH1K6) 23 | -------------------------------------------------------------------------------- /SageMaker_Integration_Example/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 1. Down load and upload autopilot_customer_churn.ipynb into your sagemaker environment 2 | 2. Run the notebook. 3 | 3. Upload test_data.csv into quicksight as a spice dataset 4 | 4. Import schema.json 5 | -------------------------------------------------------------------------------- /SageMaker_Integration_Example/bankchurners_model_schema: -------------------------------------------------------------------------------- 1 | { 2 | "inputContentType": "CSV", 3 | "outputContentType": "CSV", 4 | "input": [ 5 | { 6 | "name": "Zipcode", 7 | "type": "DECIMAL" 8 | }, 9 | { 10 | "name": "Total_Relationship_Count", 11 | "type": "INTEGER" 12 | }, 13 | { 14 | "name": "Total Trans Amt", 15 | "type": "INTEGER" 16 | }, 17 | { 18 | "name": "Total Revolving Bal", 19 | "type": "INTEGER" 20 | }, 21 | { 22 | "name": "Total Open To Buy", 23 | "type": "DECIMAL" 24 | }, 25 | { 26 | "name": "Tenure Year", 27 | "type": "INTEGER" 28 | }, 29 | { 30 | "name": "Months Inactive 12M", 31 | "type": "INTEGER" 32 | }, 33 | { 34 | "name": "Monthly Transaction", 35 | "type": "INTEGER" 36 | }, 37 | { 38 | "name": "Marital_Status", 39 | "type": "STRING" 40 | }, 41 | { 42 | "name": "Income Level", 43 | "type": "STRING" 44 | }, 45 | { 46 | "name": "Gender", 47 | "type": "STRING" 48 | }, 49 | { 50 | "name": "Education", 51 | "type": "STRING" 52 | }, 53 | { 54 | "name": "Dependent", 55 | "type": "INTEGER" 56 | }, 57 | { 58 | "name": "Credit Limit", 59 | "type": "DECIMAL" 60 | }, 61 | { 62 | "name": "Contacts Count 12M", 63 | "type": "INTEGER" 64 | }, 65 | { 66 | "name": "Client Number", 67 | "type": "INTEGER" 68 | }, 69 | { 70 | "name": "Card Category", 71 | "type": "STRING" 72 | }, 73 | { 74 | "name": "Age", 75 | "type": "INTEGER" 76 | } 77 | ], 78 | "output": [ 79 | { 80 | "name": "Status", 81 | "type": "STRING" 82 | } 83 | ], 84 | "description": "description", 85 | "version": "v1", 86 | "instanceCount": 1, 87 | "instanceTypes": [ 88 | "ml.m5.2xlarge" 89 | ], 90 | "defaultInstanceType": "ml.m5.2xlarge" 91 | } 92 | -------------------------------------------------------------------------------- /granular_access/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | package-lock.json 3 | __pycache__ 4 | .pytest_cache 5 | .env 6 | *.egg-info 7 | 8 | # CDK asset staging directory 9 | .cdk.staging 10 | cdk.out 11 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/activate.csh: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate.csh" *from csh*. 2 | # You cannot run it directly. 3 | # Created by Davide Di Blasi . 4 | # Ported to Python 3.3 venv by Andrew Svetlov 5 | 6 | alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' 7 | 8 | # Unset irrelevant variables. 9 | deactivate nondestructive 10 | 11 | setenv VIRTUAL_ENV "/Users/wangzyn/awsprojects/PycharmProjects/amazon-quicksight-sdk-proserve/granular_access/.venv" 12 | 13 | set _OLD_VIRTUAL_PATH="$PATH" 14 | setenv PATH "$VIRTUAL_ENV/bin:$PATH" 15 | 16 | 17 | set _OLD_VIRTUAL_PROMPT="$prompt" 18 | 19 | if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then 20 | if (".venv" != "") then 21 | set env_name = ".venv" 22 | else 23 | if (`basename "VIRTUAL_ENV"` == "__") then 24 | # special case for Aspen magic directories 25 | # see http://www.zetadev.com/software/aspen/ 26 | set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` 27 | else 28 | set env_name = `basename "$VIRTUAL_ENV"` 29 | endif 30 | endif 31 | set prompt = "[$env_name] $prompt" 32 | unset env_name 33 | endif 34 | 35 | alias pydoc python -m pydoc 36 | 37 | rehash 38 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/easy_install: -------------------------------------------------------------------------------- 1 | #!/Users/wangzyn/awsprojects/PycharmProjects/amazon-quicksight-sdk-proserve/granular_access/.venv/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | 6 | from setuptools.command.easy_install import main 7 | 8 | if __name__ == '__main__': 9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) 10 | sys.exit(main()) 11 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/easy_install-3.7: -------------------------------------------------------------------------------- 1 | #!/Users/wangzyn/awsprojects/PycharmProjects/amazon-quicksight-sdk-proserve/granular_access/.venv/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | 6 | from setuptools.command.easy_install import main 7 | 8 | if __name__ == '__main__': 9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) 10 | sys.exit(main()) 11 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/pip: -------------------------------------------------------------------------------- 1 | #!/Users/wangzyn/awsprojects/PycharmProjects/amazon-quicksight-sdk-proserve/granular_access/.venv/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | 6 | from pip._internal import main 7 | 8 | if __name__ == '__main__': 9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) 10 | sys.exit(main()) 11 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/pip3: -------------------------------------------------------------------------------- 1 | #!/Users/wangzyn/awsprojects/PycharmProjects/amazon-quicksight-sdk-proserve/granular_access/.venv/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | 6 | from pip._internal import main 7 | 8 | if __name__ == '__main__': 9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) 10 | sys.exit(main()) 11 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/pip3.7: -------------------------------------------------------------------------------- 1 | #!/Users/wangzyn/awsprojects/PycharmProjects/amazon-quicksight-sdk-proserve/granular_access/.venv/bin/python3 2 | # -*- coding: utf-8 -*- 3 | import re 4 | import sys 5 | 6 | from pip._internal import main 7 | 8 | if __name__ == '__main__': 9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) 10 | sys.exit(main()) 11 | -------------------------------------------------------------------------------- /granular_access/.venv/bin/python: -------------------------------------------------------------------------------- 1 | python3 -------------------------------------------------------------------------------- /granular_access/.venv/bin/python3: -------------------------------------------------------------------------------- 1 | /opt/anaconda3/bin/python3 -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/easy_install.py: -------------------------------------------------------------------------------- 1 | """Run the EasyInstall command""" 2 | 3 | if __name__ == '__main__': 4 | from setuptools.command.easy_install import main 5 | main() 6 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip-19.0.3.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip-19.0.3.dist-info/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2019 The pip developers (see AUTHORS.txt file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip-19.0.3.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.33.1) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip-19.0.3.dist-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [console_scripts] 2 | pip = pip._internal:main 3 | pip3 = pip._internal:main 4 | pip3.7 = pip._internal:main 5 | 6 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip-19.0.3.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "19.0.3" 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/__main__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import os 4 | import sys 5 | 6 | # If we are running from a wheel, add the wheel to sys.path 7 | # This allows the usage python pip-*.whl/pip install pip-*.whl 8 | if __package__ == '': 9 | # __file__ is pip-*.whl/pip/__main__.py 10 | # first dirname call strips of '/__main__.py', second strips off '/pip' 11 | # Resulting path is the name of the wheel itself 12 | # Add that to sys.path so we can import pip 13 | path = os.path.dirname(os.path.dirname(__file__)) 14 | sys.path.insert(0, path) 15 | 16 | from pip._internal import main as _main # isort:skip # noqa 17 | 18 | if __name__ == '__main__': 19 | sys.exit(_main()) 20 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/cli/__init__.py: -------------------------------------------------------------------------------- 1 | """Subpackage containing all of pip's command line interface related code 2 | """ 3 | 4 | # This file intentionally does not import submodules 5 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/cli/status_codes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | SUCCESS = 0 4 | ERROR = 1 5 | UNKNOWN_ERROR = 2 6 | VIRTUALENV_NOT_FOUND = 3 7 | PREVIOUS_BUILD_DIR_ERROR = 4 8 | NO_MATCHES_FOUND = 23 9 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/commands/check.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pip._internal.cli.base_command import Command 4 | from pip._internal.operations.check import ( 5 | check_package_set, create_package_set_from_installed, 6 | ) 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | class CheckCommand(Command): 12 | """Verify installed packages have compatible dependencies.""" 13 | name = 'check' 14 | usage = """ 15 | %prog [options]""" 16 | summary = 'Verify installed packages have compatible dependencies.' 17 | 18 | def run(self, options, args): 19 | package_set, parsing_probs = create_package_set_from_installed() 20 | missing, conflicting = check_package_set(package_set) 21 | 22 | for project_name in missing: 23 | version = package_set[project_name].version 24 | for dependency in missing[project_name]: 25 | logger.info( 26 | "%s %s requires %s, which is not installed.", 27 | project_name, version, dependency[0], 28 | ) 29 | 30 | for project_name in conflicting: 31 | version = package_set[project_name].version 32 | for dep_name, dep_version, req in conflicting[project_name]: 33 | logger.info( 34 | "%s %s has requirement %s, but you have %s %s.", 35 | project_name, version, req, dep_name, dep_version, 36 | ) 37 | 38 | if missing or conflicting or parsing_probs: 39 | return 1 40 | else: 41 | logger.info("No broken requirements found.") 42 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/commands/hash.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import hashlib 4 | import logging 5 | import sys 6 | 7 | from pip._internal.cli.base_command import Command 8 | from pip._internal.cli.status_codes import ERROR 9 | from pip._internal.utils.hashes import FAVORITE_HASH, STRONG_HASHES 10 | from pip._internal.utils.misc import read_chunks 11 | 12 | logger = logging.getLogger(__name__) 13 | 14 | 15 | class HashCommand(Command): 16 | """ 17 | Compute a hash of a local package archive. 18 | 19 | These can be used with --hash in a requirements file to do repeatable 20 | installs. 21 | 22 | """ 23 | name = 'hash' 24 | usage = '%prog [options] ...' 25 | summary = 'Compute hashes of package archives.' 26 | ignore_require_venv = True 27 | 28 | def __init__(self, *args, **kw): 29 | super(HashCommand, self).__init__(*args, **kw) 30 | self.cmd_opts.add_option( 31 | '-a', '--algorithm', 32 | dest='algorithm', 33 | choices=STRONG_HASHES, 34 | action='store', 35 | default=FAVORITE_HASH, 36 | help='The hash algorithm to use: one of %s' % 37 | ', '.join(STRONG_HASHES)) 38 | self.parser.insert_option_group(0, self.cmd_opts) 39 | 40 | def run(self, options, args): 41 | if not args: 42 | self.parser.print_usage(sys.stderr) 43 | return ERROR 44 | 45 | algorithm = options.algorithm 46 | for path in args: 47 | logger.info('%s:\n--hash=%s:%s', 48 | path, algorithm, _hash_of_file(path, algorithm)) 49 | 50 | 51 | def _hash_of_file(path, algorithm): 52 | """Return the hash digest of a file.""" 53 | with open(path, 'rb') as archive: 54 | hash = hashlib.new(algorithm) 55 | for chunk in read_chunks(archive): 56 | hash.update(chunk) 57 | return hash.hexdigest() 58 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/commands/help.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from pip._internal.cli.base_command import Command 4 | from pip._internal.cli.status_codes import SUCCESS 5 | from pip._internal.exceptions import CommandError 6 | 7 | 8 | class HelpCommand(Command): 9 | """Show help for commands""" 10 | name = 'help' 11 | usage = """ 12 | %prog """ 13 | summary = 'Show help for commands.' 14 | ignore_require_venv = True 15 | 16 | def run(self, options, args): 17 | from pip._internal.commands import commands_dict, get_similar_commands 18 | 19 | try: 20 | # 'pip help' with no args is handled by pip.__init__.parseopt() 21 | cmd_name = args[0] # the command we need help for 22 | except IndexError: 23 | return SUCCESS 24 | 25 | if cmd_name not in commands_dict: 26 | guess = get_similar_commands(cmd_name) 27 | 28 | msg = ['unknown command "%s"' % cmd_name] 29 | if guess: 30 | msg.append('maybe you meant "%s"' % guess) 31 | 32 | raise CommandError(' - '.join(msg)) 33 | 34 | command = commands_dict[cmd_name]() 35 | command.parser.print_help() 36 | 37 | return SUCCESS 38 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/models/__init__.py: -------------------------------------------------------------------------------- 1 | """A package that contains models that represent entities. 2 | """ 3 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/models/candidate.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.packaging.version import parse as parse_version 2 | 3 | from pip._internal.utils.models import KeyBasedCompareMixin 4 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 5 | 6 | if MYPY_CHECK_RUNNING: 7 | from pip._vendor.packaging.version import _BaseVersion # noqa: F401 8 | from pip._internal.models.link import Link # noqa: F401 9 | from typing import Any, Union # noqa: F401 10 | 11 | 12 | class InstallationCandidate(KeyBasedCompareMixin): 13 | """Represents a potential "candidate" for installation. 14 | """ 15 | 16 | def __init__(self, project, version, location): 17 | # type: (Any, str, Link) -> None 18 | self.project = project 19 | self.version = parse_version(version) # type: _BaseVersion 20 | self.location = location 21 | 22 | super(InstallationCandidate, self).__init__( 23 | key=(self.project, self.version, self.location), 24 | defining_class=InstallationCandidate 25 | ) 26 | 27 | def __repr__(self): 28 | # type: () -> str 29 | return "".format( 30 | self.project, self.version, self.location, 31 | ) 32 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/models/index.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.six.moves.urllib import parse as urllib_parse 2 | 3 | 4 | class PackageIndex(object): 5 | """Represents a Package Index and provides easier access to endpoints 6 | """ 7 | 8 | def __init__(self, url, file_storage_domain): 9 | # type: (str, str) -> None 10 | super(PackageIndex, self).__init__() 11 | self.url = url 12 | self.netloc = urllib_parse.urlsplit(url).netloc 13 | self.simple_url = self._url_for_path('simple') 14 | self.pypi_url = self._url_for_path('pypi') 15 | 16 | # This is part of a temporary hack used to block installs of PyPI 17 | # packages which depend on external urls only necessary until PyPI can 18 | # block such packages themselves 19 | self.file_storage_domain = file_storage_domain 20 | 21 | def _url_for_path(self, path): 22 | # type: (str) -> str 23 | return urllib_parse.urljoin(self.url, path) 24 | 25 | 26 | PyPI = PackageIndex( 27 | 'https://pypi.org/', file_storage_domain='files.pythonhosted.org' 28 | ) 29 | TestPyPI = PackageIndex( 30 | 'https://test.pypi.org/', file_storage_domain='test-files.pythonhosted.org' 31 | ) 32 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_internal/operations/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/encoding.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import locale 3 | import re 4 | import sys 5 | 6 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 7 | 8 | if MYPY_CHECK_RUNNING: 9 | from typing import List, Tuple, Text # noqa: F401 10 | 11 | BOMS = [ 12 | (codecs.BOM_UTF8, 'utf8'), 13 | (codecs.BOM_UTF16, 'utf16'), 14 | (codecs.BOM_UTF16_BE, 'utf16-be'), 15 | (codecs.BOM_UTF16_LE, 'utf16-le'), 16 | (codecs.BOM_UTF32, 'utf32'), 17 | (codecs.BOM_UTF32_BE, 'utf32-be'), 18 | (codecs.BOM_UTF32_LE, 'utf32-le'), 19 | ] # type: List[Tuple[bytes, Text]] 20 | 21 | ENCODING_RE = re.compile(br'coding[:=]\s*([-\w.]+)') 22 | 23 | 24 | def auto_decode(data): 25 | # type: (bytes) -> Text 26 | """Check a bytes string for a BOM to correctly detect the encoding 27 | 28 | Fallback to locale.getpreferredencoding(False) like open() on Python3""" 29 | for bom, encoding in BOMS: 30 | if data.startswith(bom): 31 | return data[len(bom):].decode(encoding) 32 | # Lets check the first two lines as in PEP263 33 | for line in data.split(b'\n')[:2]: 34 | if line[0:1] == b'#' and ENCODING_RE.search(line): 35 | encoding = ENCODING_RE.search(line).groups()[0].decode('ascii') 36 | return data.decode(encoding) 37 | return data.decode( 38 | locale.getpreferredencoding(False) or sys.getdefaultencoding(), 39 | ) 40 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/filesystem.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | 4 | from pip._internal.utils.compat import get_path_uid 5 | 6 | 7 | def check_path_owner(path): 8 | # type: (str) -> bool 9 | # If we don't have a way to check the effective uid of this process, then 10 | # we'll just assume that we own the directory. 11 | if not hasattr(os, "geteuid"): 12 | return True 13 | 14 | previous = None 15 | while path != previous: 16 | if os.path.lexists(path): 17 | # Check if path is writable by current user. 18 | if os.geteuid() == 0: 19 | # Special handling for root user in order to handle properly 20 | # cases where users use sudo without -H flag. 21 | try: 22 | path_uid = get_path_uid(path) 23 | except OSError: 24 | return False 25 | return path_uid == 0 26 | else: 27 | return os.access(path, os.W_OK) 28 | else: 29 | previous, path = path, os.path.dirname(path) 30 | return False # assume we don't own the path 31 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/models.py: -------------------------------------------------------------------------------- 1 | """Utilities for defining models 2 | """ 3 | 4 | import operator 5 | 6 | 7 | class KeyBasedCompareMixin(object): 8 | """Provides comparision capabilities that is based on a key 9 | """ 10 | 11 | def __init__(self, key, defining_class): 12 | self._compare_key = key 13 | self._defining_class = defining_class 14 | 15 | def __hash__(self): 16 | return hash(self._compare_key) 17 | 18 | def __lt__(self, other): 19 | return self._compare(other, operator.__lt__) 20 | 21 | def __le__(self, other): 22 | return self._compare(other, operator.__le__) 23 | 24 | def __gt__(self, other): 25 | return self._compare(other, operator.__gt__) 26 | 27 | def __ge__(self, other): 28 | return self._compare(other, operator.__ge__) 29 | 30 | def __eq__(self, other): 31 | return self._compare(other, operator.__eq__) 32 | 33 | def __ne__(self, other): 34 | return self._compare(other, operator.__ne__) 35 | 36 | def _compare(self, other, method): 37 | if not isinstance(other, self._defining_class): 38 | return NotImplemented 39 | 40 | return method(self._compare_key, other._compare_key) 41 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/setuptools_build.py: -------------------------------------------------------------------------------- 1 | # Shim to wrap setup.py invocation with setuptools 2 | SETUPTOOLS_SHIM = ( 3 | "import setuptools, tokenize;__file__=%r;" 4 | "f=getattr(tokenize, 'open', open)(__file__);" 5 | "code=f.read().replace('\\r\\n', '\\n');" 6 | "f.close();" 7 | "exec(compile(code, __file__, 'exec'))" 8 | ) 9 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_internal/utils/typing.py: -------------------------------------------------------------------------------- 1 | """For neatly implementing static typing in pip. 2 | 3 | `mypy` - the static type analysis tool we use - uses the `typing` module, which 4 | provides core functionality fundamental to mypy's functioning. 5 | 6 | Generally, `typing` would be imported at runtime and used in that fashion - 7 | it acts as a no-op at runtime and does not have any run-time overhead by 8 | design. 9 | 10 | As it turns out, `typing` is not vendorable - it uses separate sources for 11 | Python 2/Python 3. Thus, this codebase can not expect it to be present. 12 | To work around this, mypy allows the typing import to be behind a False-y 13 | optional to prevent it from running at runtime and type-comments can be used 14 | to remove the need for the types to be accessible directly during runtime. 15 | 16 | This module provides the False-y guard in a nicely named fashion so that a 17 | curious maintainer can reach here to read this. 18 | 19 | In pip, all static-typing related imports should be guarded as follows: 20 | 21 | from pip._internal.utils.typing import MYPY_CHECK_RUNNING 22 | 23 | if MYPY_CHECK_RUNNING: 24 | from typing import ... # noqa: F401 25 | 26 | Ref: https://github.com/python/mypy/issues/3216 27 | """ 28 | 29 | MYPY_CHECK_RUNNING = False 30 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/__init__.py: -------------------------------------------------------------------------------- 1 | """CacheControl import Interface. 2 | 3 | Make it easy to import from cachecontrol without long namespaces. 4 | """ 5 | __author__ = "Eric Larson" 6 | __email__ = "eric@ionrock.org" 7 | __version__ = "0.12.5" 8 | 9 | from .wrapper import CacheControl 10 | from .adapter import CacheControlAdapter 11 | from .controller import CacheController 12 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/_cmd.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from pip._vendor import requests 4 | 5 | from pip._vendor.cachecontrol.adapter import CacheControlAdapter 6 | from pip._vendor.cachecontrol.cache import DictCache 7 | from pip._vendor.cachecontrol.controller import logger 8 | 9 | from argparse import ArgumentParser 10 | 11 | 12 | def setup_logging(): 13 | logger.setLevel(logging.DEBUG) 14 | handler = logging.StreamHandler() 15 | logger.addHandler(handler) 16 | 17 | 18 | def get_session(): 19 | adapter = CacheControlAdapter( 20 | DictCache(), cache_etags=True, serializer=None, heuristic=None 21 | ) 22 | sess = requests.Session() 23 | sess.mount("http://", adapter) 24 | sess.mount("https://", adapter) 25 | 26 | sess.cache_controller = adapter.controller 27 | return sess 28 | 29 | 30 | def get_args(): 31 | parser = ArgumentParser() 32 | parser.add_argument("url", help="The URL to try and cache") 33 | return parser.parse_args() 34 | 35 | 36 | def main(args=None): 37 | args = get_args() 38 | sess = get_session() 39 | 40 | # Make a request to get a response 41 | resp = sess.get(args.url) 42 | 43 | # Turn on logging 44 | setup_logging() 45 | 46 | # try setting the cache 47 | sess.cache_controller.cache_response(resp.request, resp.raw) 48 | 49 | # Now try to get it 50 | if sess.cache_controller.cached_request(resp.request): 51 | print("Cached!") 52 | else: 53 | print("Not cached :(") 54 | 55 | 56 | if __name__ == "__main__": 57 | main() 58 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/cache.py: -------------------------------------------------------------------------------- 1 | """ 2 | The cache object API for implementing caches. The default is a thread 3 | safe in-memory dictionary. 4 | """ 5 | from threading import Lock 6 | 7 | 8 | class BaseCache(object): 9 | 10 | def get(self, key): 11 | raise NotImplementedError() 12 | 13 | def set(self, key, value): 14 | raise NotImplementedError() 15 | 16 | def delete(self, key): 17 | raise NotImplementedError() 18 | 19 | def close(self): 20 | pass 21 | 22 | 23 | class DictCache(BaseCache): 24 | 25 | def __init__(self, init_dict=None): 26 | self.lock = Lock() 27 | self.data = init_dict or {} 28 | 29 | def get(self, key): 30 | return self.data.get(key, None) 31 | 32 | def set(self, key, value): 33 | with self.lock: 34 | self.data.update({key: value}) 35 | 36 | def delete(self, key): 37 | with self.lock: 38 | if key in self.data: 39 | self.data.pop(key) 40 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/__init__.py: -------------------------------------------------------------------------------- 1 | from .file_cache import FileCache # noqa 2 | from .redis_cache import RedisCache # noqa 3 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | 3 | from datetime import datetime 4 | from pip._vendor.cachecontrol.cache import BaseCache 5 | 6 | 7 | class RedisCache(BaseCache): 8 | 9 | def __init__(self, conn): 10 | self.conn = conn 11 | 12 | def get(self, key): 13 | return self.conn.get(key) 14 | 15 | def set(self, key, value, expires=None): 16 | if not expires: 17 | self.conn.set(key, value) 18 | else: 19 | expires = expires - datetime.utcnow() 20 | self.conn.setex(key, int(expires.total_seconds()), value) 21 | 22 | def delete(self, key): 23 | self.conn.delete(key) 24 | 25 | def clear(self): 26 | """Helper for clearing all the keys in a database. Use with 27 | caution!""" 28 | for key in self.conn.keys(): 29 | self.conn.delete(key) 30 | 31 | def close(self): 32 | """Redis uses connection pooling, no need to close the connection.""" 33 | pass 34 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/compat.py: -------------------------------------------------------------------------------- 1 | try: 2 | from urllib.parse import urljoin 3 | except ImportError: 4 | from urlparse import urljoin 5 | 6 | 7 | try: 8 | import cPickle as pickle 9 | except ImportError: 10 | import pickle 11 | 12 | 13 | # Handle the case where the requests module has been patched to not have 14 | # urllib3 bundled as part of its source. 15 | try: 16 | from pip._vendor.requests.packages.urllib3.response import HTTPResponse 17 | except ImportError: 18 | from pip._vendor.urllib3.response import HTTPResponse 19 | 20 | try: 21 | from pip._vendor.requests.packages.urllib3.util import is_fp_closed 22 | except ImportError: 23 | from pip._vendor.urllib3.util import is_fp_closed 24 | 25 | # Replicate some six behaviour 26 | try: 27 | text_type = unicode 28 | except NameError: 29 | text_type = str 30 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/cachecontrol/wrapper.py: -------------------------------------------------------------------------------- 1 | from .adapter import CacheControlAdapter 2 | from .cache import DictCache 3 | 4 | 5 | def CacheControl( 6 | sess, 7 | cache=None, 8 | cache_etags=True, 9 | serializer=None, 10 | heuristic=None, 11 | controller_class=None, 12 | adapter_class=None, 13 | cacheable_methods=None, 14 | ): 15 | 16 | cache = cache or DictCache() 17 | adapter_class = adapter_class or CacheControlAdapter 18 | adapter = adapter_class( 19 | cache, 20 | cache_etags=cache_etags, 21 | serializer=serializer, 22 | heuristic=heuristic, 23 | controller_class=controller_class, 24 | cacheable_methods=cacheable_methods, 25 | ) 26 | sess.mount("http://", adapter) 27 | sess.mount("https://", adapter) 28 | 29 | return sess 30 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import where 2 | 3 | __version__ = "2018.11.29" 4 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/certifi/__main__.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.certifi import where 2 | print(where()) 3 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/certifi/core.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certifi.py 6 | ~~~~~~~~~~ 7 | 8 | This module returns the installation location of cacert.pem. 9 | """ 10 | import os 11 | 12 | 13 | def where(): 14 | f = os.path.dirname(__file__) 15 | 16 | return os.path.join(f, 'cacert.pem') 17 | 18 | 19 | if __name__ == '__main__': 20 | print(where()) 21 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | 19 | from .compat import PY2, PY3 20 | from .universaldetector import UniversalDetector 21 | from .version import __version__, VERSION 22 | 23 | 24 | def detect(byte_str): 25 | """ 26 | Detect the encoding of the given byte string. 27 | 28 | :param byte_str: The byte sequence to examine. 29 | :type byte_str: ``bytes`` or ``bytearray`` 30 | """ 31 | if not isinstance(byte_str, bytearray): 32 | if not isinstance(byte_str, bytes): 33 | raise TypeError('Expected object of type bytes or bytearray, got: ' 34 | '{0}'.format(type(byte_str))) 35 | else: 36 | byte_str = bytearray(byte_str) 37 | detector = UniversalDetector() 38 | detector.feed(byte_str) 39 | return detector.close() 40 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import BIG5_SM_MODEL 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | super(Big5Prober, self).__init__() 37 | self.coding_sm = CodingStateMachine(BIG5_SM_MODEL) 38 | self.distribution_analyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | @property 42 | def charset_name(self): 43 | return "Big5" 44 | 45 | @property 46 | def language(self): 47 | return "Chinese" 48 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/cli/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/compat.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # Contributor(s): 3 | # Dan Blanchard 4 | # Ian Cordasco 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 | # 02110-1301 USA 20 | ######################### END LICENSE BLOCK ######################### 21 | 22 | import sys 23 | 24 | 25 | if sys.version_info < (3, 0): 26 | PY2 = True 27 | PY3 = False 28 | base_str = (str, unicode) 29 | text_type = unicode 30 | else: 31 | PY2 = False 32 | PY3 = True 33 | base_str = (bytes, str) 34 | text_type = str 35 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .chardistribution import EUCKRDistributionAnalysis 29 | from .codingstatemachine import CodingStateMachine 30 | from .mbcharsetprober import MultiByteCharSetProber 31 | from .mbcssm import CP949_SM_MODEL 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | super(CP949Prober, self).__init__() 37 | self.coding_sm = CodingStateMachine(CP949_SM_MODEL) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self.distribution_analyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | @property 44 | def charset_name(self): 45 | return "CP949" 46 | 47 | @property 48 | def language(self): 49 | return "Korean" 50 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/enums.py: -------------------------------------------------------------------------------- 1 | """ 2 | All of the Enums that are used throughout the chardet package. 3 | 4 | :author: Dan Blanchard (dan.blanchard@gmail.com) 5 | """ 6 | 7 | 8 | class InputState(object): 9 | """ 10 | This enum represents the different states a universal detector can be in. 11 | """ 12 | PURE_ASCII = 0 13 | ESC_ASCII = 1 14 | HIGH_BYTE = 2 15 | 16 | 17 | class LanguageFilter(object): 18 | """ 19 | This enum represents the different language filters we can apply to a 20 | ``UniversalDetector``. 21 | """ 22 | CHINESE_SIMPLIFIED = 0x01 23 | CHINESE_TRADITIONAL = 0x02 24 | JAPANESE = 0x04 25 | KOREAN = 0x08 26 | NON_CJK = 0x10 27 | ALL = 0x1F 28 | CHINESE = CHINESE_SIMPLIFIED | CHINESE_TRADITIONAL 29 | CJK = CHINESE | JAPANESE | KOREAN 30 | 31 | 32 | class ProbingState(object): 33 | """ 34 | This enum represents the different states a prober can be in. 35 | """ 36 | DETECTING = 0 37 | FOUND_IT = 1 38 | NOT_ME = 2 39 | 40 | 41 | class MachineState(object): 42 | """ 43 | This enum represents the different states a state machine can be in. 44 | """ 45 | START = 0 46 | ERROR = 1 47 | ITS_ME = 2 48 | 49 | 50 | class SequenceLikelihood(object): 51 | """ 52 | This enum represents the likelihood of a character following the previous one. 53 | """ 54 | NEGATIVE = 0 55 | UNLIKELY = 1 56 | LIKELY = 2 57 | POSITIVE = 3 58 | 59 | @classmethod 60 | def get_num_categories(cls): 61 | """:returns: The number of likelihood categories in the enum.""" 62 | return 4 63 | 64 | 65 | class CharacterCategory(object): 66 | """ 67 | This enum represents the different categories language models for 68 | ``SingleByteCharsetProber`` put characters into. 69 | 70 | Anything less than CONTROL is considered a letter. 71 | """ 72 | UNDEFINED = 255 73 | LINE_BREAK = 254 74 | SYMBOL = 253 75 | DIGIT = 252 76 | CONTROL = 251 77 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKR_SM_MODEL 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | super(EUCKRProber, self).__init__() 37 | self.coding_sm = CodingStateMachine(EUCKR_SM_MODEL) 38 | self.distribution_analyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | @property 42 | def charset_name(self): 43 | return "EUC-KR" 44 | 45 | @property 46 | def language(self): 47 | return "Korean" 48 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTW_SM_MODEL 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | super(EUCTWProber, self).__init__() 36 | self.coding_sm = CodingStateMachine(EUCTW_SM_MODEL) 37 | self.distribution_analyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | @property 41 | def charset_name(self): 42 | return "EUC-TW" 43 | 44 | @property 45 | def language(self): 46 | return "Taiwan" 47 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312_SM_MODEL 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | super(GB2312Prober, self).__init__() 36 | self.coding_sm = CodingStateMachine(GB2312_SM_MODEL) 37 | self.distribution_analyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | @property 41 | def charset_name(self): 42 | return "GB2312" 43 | 44 | @property 45 | def language(self): 46 | return "Chinese" 47 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self, lang_filter=None): 43 | super(MBCSGroupProber, self).__init__(lang_filter=lang_filter) 44 | self.probers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/chardet/version.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module exists only to simplify retrieving the version number of chardet 3 | from within setup.py and from chardet subpackages. 4 | 5 | :author: Dan Blanchard (dan.blanchard@gmail.com) 6 | """ 7 | 8 | __version__ = "3.0.4" 9 | VERSION = __version__.split('.') 10 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/colorama/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from .initialise import init, deinit, reinit, colorama_text 3 | from .ansi import Fore, Back, Style, Cursor 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | __version__ = '0.4.1' 7 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/colorama/initialise.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | import atexit 3 | import contextlib 4 | import sys 5 | 6 | from .ansitowin32 import AnsiToWin32 7 | 8 | 9 | orig_stdout = None 10 | orig_stderr = None 11 | 12 | wrapped_stdout = None 13 | wrapped_stderr = None 14 | 15 | atexit_done = False 16 | 17 | 18 | def reset_all(): 19 | if AnsiToWin32 is not None: # Issue #74: objects might become None at exit 20 | AnsiToWin32(orig_stdout).reset_all() 21 | 22 | 23 | def init(autoreset=False, convert=None, strip=None, wrap=True): 24 | 25 | if not wrap and any([autoreset, convert, strip]): 26 | raise ValueError('wrap=False conflicts with any other arg=True') 27 | 28 | global wrapped_stdout, wrapped_stderr 29 | global orig_stdout, orig_stderr 30 | 31 | orig_stdout = sys.stdout 32 | orig_stderr = sys.stderr 33 | 34 | if sys.stdout is None: 35 | wrapped_stdout = None 36 | else: 37 | sys.stdout = wrapped_stdout = \ 38 | wrap_stream(orig_stdout, convert, strip, autoreset, wrap) 39 | if sys.stderr is None: 40 | wrapped_stderr = None 41 | else: 42 | sys.stderr = wrapped_stderr = \ 43 | wrap_stream(orig_stderr, convert, strip, autoreset, wrap) 44 | 45 | global atexit_done 46 | if not atexit_done: 47 | atexit.register(reset_all) 48 | atexit_done = True 49 | 50 | 51 | def deinit(): 52 | if orig_stdout is not None: 53 | sys.stdout = orig_stdout 54 | if orig_stderr is not None: 55 | sys.stderr = orig_stderr 56 | 57 | 58 | @contextlib.contextmanager 59 | def colorama_text(*args, **kwargs): 60 | init(*args, **kwargs) 61 | try: 62 | yield 63 | finally: 64 | deinit() 65 | 66 | 67 | def reinit(): 68 | if wrapped_stdout is not None: 69 | sys.stdout = wrapped_stdout 70 | if wrapped_stderr is not None: 71 | sys.stderr = wrapped_stderr 72 | 73 | 74 | def wrap_stream(stream, convert, strip, autoreset, wrap): 75 | if wrap: 76 | wrapper = AnsiToWin32(stream, 77 | convert=convert, strip=strip, autoreset=autoreset) 78 | if wrapper.should_wrap(): 79 | stream = wrapper.stream 80 | return stream 81 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012-2017 Vinay Sajip. 4 | # Licensed to the Python Software Foundation under a contributor agreement. 5 | # See LICENSE.txt and CONTRIBUTORS.txt. 6 | # 7 | import logging 8 | 9 | __version__ = '0.2.8' 10 | 11 | class DistlibException(Exception): 12 | pass 13 | 14 | try: 15 | from logging import NullHandler 16 | except ImportError: # pragma: no cover 17 | class NullHandler(logging.Handler): 18 | def handle(self, record): pass 19 | def emit(self, record): pass 20 | def createLock(self): self.lock = None 21 | 22 | logger = logging.getLogger(__name__) 23 | logger.addHandler(NullHandler()) 24 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/__init__.py: -------------------------------------------------------------------------------- 1 | """Modules copied from Python 3 standard libraries, for internal use only. 2 | 3 | Individual classes and functions are found in d2._backport.misc. Intended 4 | usage is to always import things missing from 3.1 from that module: the 5 | built-in/stdlib objects will be used if found. 6 | """ 7 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/misc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012 The Python Software Foundation. 4 | # See LICENSE.txt and CONTRIBUTORS.txt. 5 | # 6 | """Backports for individual classes and functions.""" 7 | 8 | import os 9 | import sys 10 | 11 | __all__ = ['cache_from_source', 'callable', 'fsencode'] 12 | 13 | 14 | try: 15 | from imp import cache_from_source 16 | except ImportError: 17 | def cache_from_source(py_file, debug=__debug__): 18 | ext = debug and 'c' or 'o' 19 | return py_file + ext 20 | 21 | 22 | try: 23 | callable = callable 24 | except NameError: 25 | from collections import Callable 26 | 27 | def callable(obj): 28 | return isinstance(obj, Callable) 29 | 30 | 31 | try: 32 | fsencode = os.fsencode 33 | except AttributeError: 34 | def fsencode(filename): 35 | if isinstance(filename, bytes): 36 | return filename 37 | elif isinstance(filename, str): 38 | return filename.encode(sys.getfilesystemencoding()) 39 | else: 40 | raise TypeError("expect bytes or str, not %s" % 41 | type(filename).__name__) 42 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/t32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/t32.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/t64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/t64.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/w32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/w32.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/w64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/distlib/w64.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | HTML parsing library based on the `WHATWG HTML specification 3 | `_. The parser is designed to be compatible with 4 | existing HTML found in the wild and implements well-defined error recovery that 5 | is largely compatible with modern desktop web browsers. 6 | 7 | Example usage:: 8 | 9 | from pip._vendor import html5lib 10 | with open("my_document.html", "rb") as f: 11 | tree = html5lib.parse(f) 12 | 13 | For convenience, this module re-exports the following names: 14 | 15 | * :func:`~.html5parser.parse` 16 | * :func:`~.html5parser.parseFragment` 17 | * :class:`~.html5parser.HTMLParser` 18 | * :func:`~.treebuilders.getTreeBuilder` 19 | * :func:`~.treewalkers.getTreeWalker` 20 | * :func:`~.serializer.serialize` 21 | """ 22 | 23 | from __future__ import absolute_import, division, unicode_literals 24 | 25 | from .html5parser import HTMLParser, parse, parseFragment 26 | from .treebuilders import getTreeBuilder 27 | from .treewalkers import getTreeWalker 28 | from .serializer import serialize 29 | 30 | __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder", 31 | "getTreeWalker", "serialize"] 32 | 33 | # this has to be at the top level, see how setup.py parses this 34 | #: Distribution version number. 35 | __version__ = "1.0.1" 36 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from .py import Trie as PyTrie 4 | 5 | Trie = PyTrie 6 | 7 | # pylint:disable=wrong-import-position 8 | try: 9 | from .datrie import Trie as DATrie 10 | except ImportError: 11 | pass 12 | else: 13 | Trie = DATrie 14 | # pylint:enable=wrong-import-position 15 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from collections import Mapping 4 | 5 | 6 | class Trie(Mapping): 7 | """Abstract base class for tries""" 8 | 9 | def keys(self, prefix=None): 10 | # pylint:disable=arguments-differ 11 | keys = super(Trie, self).keys() 12 | 13 | if prefix is None: 14 | return set(keys) 15 | 16 | return {x for x in keys if x.startswith(prefix)} 17 | 18 | def has_keys_with_prefix(self, prefix): 19 | for key in self.keys(): 20 | if key.startswith(prefix): 21 | return True 22 | 23 | return False 24 | 25 | def longest_prefix(self, prefix): 26 | if prefix in self: 27 | return prefix 28 | 29 | for i in range(1, len(prefix) + 1): 30 | if prefix[:-i] in self: 31 | return prefix[:-i] 32 | 33 | raise KeyError(prefix) 34 | 35 | def longest_prefix_item(self, prefix): 36 | lprefix = self.longest_prefix(prefix) 37 | return (lprefix, self[lprefix]) 38 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/datrie.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from datrie import Trie as DATrie 4 | from pip._vendor.six import text_type 5 | 6 | from ._base import Trie as ABCTrie 7 | 8 | 9 | class Trie(ABCTrie): 10 | def __init__(self, data): 11 | chars = set() 12 | for key in data.keys(): 13 | if not isinstance(key, text_type): 14 | raise TypeError("All keys must be strings") 15 | for char in key: 16 | chars.add(char) 17 | 18 | self._data = DATrie("".join(chars)) 19 | for key, value in data.items(): 20 | self._data[key] = value 21 | 22 | def __contains__(self, key): 23 | return key in self._data 24 | 25 | def __len__(self): 26 | return len(self._data) 27 | 28 | def __iter__(self): 29 | raise NotImplementedError() 30 | 31 | def __getitem__(self, key): 32 | return self._data[key] 33 | 34 | def keys(self, prefix=None): 35 | return self._data.keys(prefix) 36 | 37 | def has_keys_with_prefix(self, prefix): 38 | return self._data.has_keys_with_prefix(prefix) 39 | 40 | def longest_prefix(self, prefix): 41 | return self._data.longest_prefix(prefix) 42 | 43 | def longest_prefix_item(self, prefix): 44 | return self._data.longest_prefix_item(prefix) 45 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/_trie/py.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | from pip._vendor.six import text_type 3 | 4 | from bisect import bisect_left 5 | 6 | from ._base import Trie as ABCTrie 7 | 8 | 9 | class Trie(ABCTrie): 10 | def __init__(self, data): 11 | if not all(isinstance(x, text_type) for x in data.keys()): 12 | raise TypeError("All keys must be strings") 13 | 14 | self._data = data 15 | self._keys = sorted(data.keys()) 16 | self._cachestr = "" 17 | self._cachepoints = (0, len(data)) 18 | 19 | def __contains__(self, key): 20 | return key in self._data 21 | 22 | def __len__(self): 23 | return len(self._data) 24 | 25 | def __iter__(self): 26 | return iter(self._data) 27 | 28 | def __getitem__(self, key): 29 | return self._data[key] 30 | 31 | def keys(self, prefix=None): 32 | if prefix is None or prefix == "" or not self._keys: 33 | return set(self._keys) 34 | 35 | if prefix.startswith(self._cachestr): 36 | lo, hi = self._cachepoints 37 | start = i = bisect_left(self._keys, prefix, lo, hi) 38 | else: 39 | start = i = bisect_left(self._keys, prefix) 40 | 41 | keys = set() 42 | if start == len(self._keys): 43 | return keys 44 | 45 | while self._keys[i].startswith(prefix): 46 | keys.add(self._keys[i]) 47 | i += 1 48 | 49 | self._cachestr = prefix 50 | self._cachepoints = (start, i) 51 | 52 | return keys 53 | 54 | def has_keys_with_prefix(self, prefix): 55 | if prefix in self._data: 56 | return True 57 | 58 | if prefix.startswith(self._cachestr): 59 | lo, hi = self._cachepoints 60 | i = bisect_left(self._keys, prefix, lo, hi) 61 | else: 62 | i = bisect_left(self._keys, prefix) 63 | 64 | if i == len(self._keys): 65 | return False 66 | 67 | return self._keys[i].startswith(prefix) 68 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import base 4 | 5 | from collections import OrderedDict 6 | 7 | 8 | def _attr_key(attr): 9 | """Return an appropriate key for an attribute for sorting 10 | 11 | Attributes have a namespace that can be either ``None`` or a string. We 12 | can't compare the two because they're different types, so we convert 13 | ``None`` to an empty string first. 14 | 15 | """ 16 | return (attr[0][0] or ''), attr[0][1] 17 | 18 | 19 | class Filter(base.Filter): 20 | """Alphabetizes attributes for elements""" 21 | def __iter__(self): 22 | for token in base.Filter.__iter__(self): 23 | if token["type"] in ("StartTag", "EmptyTag"): 24 | attrs = OrderedDict() 25 | for name, value in sorted(token["data"].items(), 26 | key=_attr_key): 27 | attrs[name] = value 28 | token["data"] = attrs 29 | yield token 30 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | 4 | class Filter(object): 5 | def __init__(self, source): 6 | self.source = source 7 | 8 | def __iter__(self): 9 | return iter(self.source) 10 | 11 | def __getattr__(self, name): 12 | return getattr(self.source, name) 13 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | import re 4 | 5 | from . import base 6 | from ..constants import rcdataElements, spaceCharacters 7 | spaceCharacters = "".join(spaceCharacters) 8 | 9 | SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) 10 | 11 | 12 | class Filter(base.Filter): 13 | """Collapses whitespace except in pre, textarea, and script elements""" 14 | spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements)) 15 | 16 | def __iter__(self): 17 | preserve = 0 18 | for token in base.Filter.__iter__(self): 19 | type = token["type"] 20 | if type == "StartTag" \ 21 | and (preserve or token["name"] in self.spacePreserveElements): 22 | preserve += 1 23 | 24 | elif type == "EndTag" and preserve: 25 | preserve -= 1 26 | 27 | elif not preserve and type == "SpaceCharacters" and token["data"]: 28 | # Test on token["data"] above to not introduce spaces where there were not 29 | token["data"] = " " 30 | 31 | elif not preserve and type == "Characters": 32 | token["data"] = collapse_spaces(token["data"]) 33 | 34 | yield token 35 | 36 | 37 | def collapse_spaces(text): 38 | return SPACES_REGEX.sub(' ', text) 39 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py: -------------------------------------------------------------------------------- 1 | """Tree adapters let you convert from one tree structure to another 2 | 3 | Example: 4 | 5 | .. code-block:: python 6 | 7 | from pip._vendor import html5lib 8 | from pip._vendor.html5lib.treeadapters import genshi 9 | 10 | doc = 'Hi!' 11 | treebuilder = html5lib.getTreeBuilder('etree') 12 | parser = html5lib.HTMLParser(tree=treebuilder) 13 | tree = parser.parse(doc) 14 | TreeWalker = html5lib.getTreeWalker('etree') 15 | 16 | genshi_tree = genshi.to_genshi(TreeWalker(tree)) 17 | 18 | """ 19 | from __future__ import absolute_import, division, unicode_literals 20 | 21 | from . import sax 22 | 23 | __all__ = ["sax"] 24 | 25 | try: 26 | from . import genshi # noqa 27 | except ImportError: 28 | pass 29 | else: 30 | __all__.append("genshi") 31 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from genshi.core import QName, Attrs 4 | from genshi.core import START, END, TEXT, COMMENT, DOCTYPE 5 | 6 | 7 | def to_genshi(walker): 8 | """Convert a tree to a genshi tree 9 | 10 | :arg walker: the treewalker to use to walk the tree to convert it 11 | 12 | :returns: generator of genshi nodes 13 | 14 | """ 15 | text = [] 16 | for token in walker: 17 | type = token["type"] 18 | if type in ("Characters", "SpaceCharacters"): 19 | text.append(token["data"]) 20 | elif text: 21 | yield TEXT, "".join(text), (None, -1, -1) 22 | text = [] 23 | 24 | if type in ("StartTag", "EmptyTag"): 25 | if token["namespace"]: 26 | name = "{%s}%s" % (token["namespace"], token["name"]) 27 | else: 28 | name = token["name"] 29 | attrs = Attrs([(QName("{%s}%s" % attr if attr[0] is not None else attr[1]), value) 30 | for attr, value in token["data"].items()]) 31 | yield (START, (QName(name), attrs), (None, -1, -1)) 32 | if type == "EmptyTag": 33 | type = "EndTag" 34 | 35 | if type == "EndTag": 36 | if token["namespace"]: 37 | name = "{%s}%s" % (token["namespace"], token["name"]) 38 | else: 39 | name = token["name"] 40 | 41 | yield END, QName(name), (None, -1, -1) 42 | 43 | elif type == "Comment": 44 | yield COMMENT, token["data"], (None, -1, -1) 45 | 46 | elif type == "Doctype": 47 | yield DOCTYPE, (token["name"], token["publicId"], 48 | token["systemId"]), (None, -1, -1) 49 | 50 | else: 51 | pass # FIXME: What to do? 52 | 53 | if text: 54 | yield TEXT, "".join(text), (None, -1, -1) 55 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.sax.xmlreader import AttributesNSImpl 4 | 5 | from ..constants import adjustForeignAttributes, unadjustForeignAttributes 6 | 7 | prefix_mapping = {} 8 | for prefix, localName, namespace in adjustForeignAttributes.values(): 9 | if prefix is not None: 10 | prefix_mapping[prefix] = namespace 11 | 12 | 13 | def to_sax(walker, handler): 14 | """Call SAX-like content handler based on treewalker walker 15 | 16 | :arg walker: the treewalker to use to walk the tree to convert it 17 | 18 | :arg handler: SAX handler to use 19 | 20 | """ 21 | handler.startDocument() 22 | for prefix, namespace in prefix_mapping.items(): 23 | handler.startPrefixMapping(prefix, namespace) 24 | 25 | for token in walker: 26 | type = token["type"] 27 | if type == "Doctype": 28 | continue 29 | elif type in ("StartTag", "EmptyTag"): 30 | attrs = AttributesNSImpl(token["data"], 31 | unadjustForeignAttributes) 32 | handler.startElementNS((token["namespace"], token["name"]), 33 | token["name"], 34 | attrs) 35 | if type == "EmptyTag": 36 | handler.endElementNS((token["namespace"], token["name"]), 37 | token["name"]) 38 | elif type == "EndTag": 39 | handler.endElementNS((token["namespace"], token["name"]), 40 | token["name"]) 41 | elif type in ("Characters", "SpaceCharacters"): 42 | handler.characters(token["data"]) 43 | elif type == "Comment": 44 | pass 45 | else: 46 | assert False, "Unknown token type" 47 | 48 | for prefix, namespace in prefix_mapping.items(): 49 | handler.endPrefixMapping(prefix) 50 | handler.endDocument() 51 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/html5lib/treewalkers/dom.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.dom import Node 4 | 5 | from . import base 6 | 7 | 8 | class TreeWalker(base.NonRecursiveTreeWalker): 9 | def getNodeDetails(self, node): 10 | if node.nodeType == Node.DOCUMENT_TYPE_NODE: 11 | return base.DOCTYPE, node.name, node.publicId, node.systemId 12 | 13 | elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): 14 | return base.TEXT, node.nodeValue 15 | 16 | elif node.nodeType == Node.ELEMENT_NODE: 17 | attrs = {} 18 | for attr in list(node.attributes.keys()): 19 | attr = node.getAttributeNode(attr) 20 | if attr.namespaceURI: 21 | attrs[(attr.namespaceURI, attr.localName)] = attr.value 22 | else: 23 | attrs[(None, attr.name)] = attr.value 24 | return (base.ELEMENT, node.namespaceURI, node.nodeName, 25 | attrs, node.hasChildNodes()) 26 | 27 | elif node.nodeType == Node.COMMENT_NODE: 28 | return base.COMMENT, node.nodeValue 29 | 30 | elif node.nodeType in (Node.DOCUMENT_NODE, Node.DOCUMENT_FRAGMENT_NODE): 31 | return (base.DOCUMENT,) 32 | 33 | else: 34 | return base.UNKNOWN, node.nodeType 35 | 36 | def getFirstChild(self, node): 37 | return node.firstChild 38 | 39 | def getNextSibling(self, node): 40 | return node.nextSibling 41 | 42 | def getParentNode(self, node): 43 | return node.parentNode 44 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/idna/__init__.py: -------------------------------------------------------------------------------- 1 | from .package_data import __version__ 2 | from .core import * 3 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/idna/compat.py: -------------------------------------------------------------------------------- 1 | from .core import * 2 | from .codec import * 3 | 4 | def ToASCII(label): 5 | return encode(label) 6 | 7 | def ToUnicode(label): 8 | return decode(label) 9 | 10 | def nameprep(s): 11 | raise NotImplementedError("IDNA 2008 does not utilise nameprep protocol") 12 | 13 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/idna/intranges.py: -------------------------------------------------------------------------------- 1 | """ 2 | Given a list of integers, made up of (hopefully) a small number of long runs 3 | of consecutive integers, compute a representation of the form 4 | ((start1, end1), (start2, end2) ...). Then answer the question "was x present 5 | in the original list?" in time O(log(# runs)). 6 | """ 7 | 8 | import bisect 9 | 10 | def intranges_from_list(list_): 11 | """Represent a list of integers as a sequence of ranges: 12 | ((start_0, end_0), (start_1, end_1), ...), such that the original 13 | integers are exactly those x such that start_i <= x < end_i for some i. 14 | 15 | Ranges are encoded as single integers (start << 32 | end), not as tuples. 16 | """ 17 | 18 | sorted_list = sorted(list_) 19 | ranges = [] 20 | last_write = -1 21 | for i in range(len(sorted_list)): 22 | if i+1 < len(sorted_list): 23 | if sorted_list[i] == sorted_list[i+1]-1: 24 | continue 25 | current_range = sorted_list[last_write+1:i+1] 26 | ranges.append(_encode_range(current_range[0], current_range[-1] + 1)) 27 | last_write = i 28 | 29 | return tuple(ranges) 30 | 31 | def _encode_range(start, end): 32 | return (start << 32) | end 33 | 34 | def _decode_range(r): 35 | return (r >> 32), (r & ((1 << 32) - 1)) 36 | 37 | 38 | def intranges_contain(int_, ranges): 39 | """Determine if `int_` falls into one of the ranges in `ranges`.""" 40 | tuple_ = _encode_range(int_, 0) 41 | pos = bisect.bisect_left(ranges, tuple_) 42 | # we could be immediately ahead of a tuple (start, end) 43 | # with start < int_ <= end 44 | if pos > 0: 45 | left, right = _decode_range(ranges[pos-1]) 46 | if left <= int_ < right: 47 | return True 48 | # or we could be immediately behind a tuple (int_, end) 49 | if pos < len(ranges): 50 | left, _ = _decode_range(ranges[pos]) 51 | if left == int_: 52 | return True 53 | return False 54 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/idna/package_data.py: -------------------------------------------------------------------------------- 1 | __version__ = '2.8' 2 | 3 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/msgpack/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | from pip._vendor.msgpack._version import version 3 | from pip._vendor.msgpack.exceptions import * 4 | 5 | from collections import namedtuple 6 | 7 | 8 | class ExtType(namedtuple('ExtType', 'code data')): 9 | """ExtType represents ext type in msgpack.""" 10 | def __new__(cls, code, data): 11 | if not isinstance(code, int): 12 | raise TypeError("code must be int") 13 | if not isinstance(data, bytes): 14 | raise TypeError("data must be bytes") 15 | if not 0 <= code <= 127: 16 | raise ValueError("code must be 0~127") 17 | return super(ExtType, cls).__new__(cls, code, data) 18 | 19 | 20 | import os 21 | if os.environ.get('MSGPACK_PUREPYTHON'): 22 | from pip._vendor.msgpack.fallback import Packer, unpackb, Unpacker 23 | else: 24 | try: 25 | from pip._vendor.msgpack._packer import Packer 26 | from pip._vendor.msgpack._unpacker import unpackb, Unpacker 27 | except ImportError: 28 | from pip._vendor.msgpack.fallback import Packer, unpackb, Unpacker 29 | 30 | 31 | def pack(o, stream, **kwargs): 32 | """ 33 | Pack object `o` and write it to `stream` 34 | 35 | See :class:`Packer` for options. 36 | """ 37 | packer = Packer(**kwargs) 38 | stream.write(packer.pack(o)) 39 | 40 | 41 | def packb(o, **kwargs): 42 | """ 43 | Pack object `o` and return packed bytes 44 | 45 | See :class:`Packer` for options. 46 | """ 47 | return Packer(**kwargs).pack(o) 48 | 49 | 50 | def unpack(stream, **kwargs): 51 | """ 52 | Unpack an object from `stream`. 53 | 54 | Raises `ExtraData` when `stream` contains extra bytes. 55 | See :class:`Unpacker` for options. 56 | """ 57 | data = stream.read() 58 | return unpackb(data, **kwargs) 59 | 60 | 61 | # alias for compatibility to simplejson/marshal/pickle. 62 | load = unpack 63 | loads = unpackb 64 | 65 | dump = pack 66 | dumps = packb 67 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/msgpack/_version.py: -------------------------------------------------------------------------------- 1 | version = (0, 5, 6) 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/msgpack/exceptions.py: -------------------------------------------------------------------------------- 1 | class UnpackException(Exception): 2 | """Deprecated. Use Exception instead to catch all exception during unpacking.""" 3 | 4 | 5 | class BufferFull(UnpackException): 6 | pass 7 | 8 | 9 | class OutOfData(UnpackException): 10 | pass 11 | 12 | 13 | class UnpackValueError(UnpackException, ValueError): 14 | """Deprecated. Use ValueError instead.""" 15 | 16 | 17 | class ExtraData(UnpackValueError): 18 | def __init__(self, unpacked, extra): 19 | self.unpacked = unpacked 20 | self.extra = extra 21 | 22 | def __str__(self): 23 | return "unpack(b) received extra data." 24 | 25 | 26 | class PackException(Exception): 27 | """Deprecated. Use Exception instead to catch all exception during packing.""" 28 | 29 | 30 | class PackValueError(PackException, ValueError): 31 | """PackValueError is raised when type of input data is supported but it's value is unsupported. 32 | 33 | Deprecated. Use ValueError instead. 34 | """ 35 | 36 | 37 | class PackOverflowError(PackValueError, OverflowError): 38 | """PackOverflowError is raised when integer value is out of range of msgpack support [-2**31, 2**32). 39 | 40 | Deprecated. Use ValueError instead. 41 | """ 42 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", 8 | "__summary__", 9 | "__uri__", 10 | "__version__", 11 | "__author__", 12 | "__email__", 13 | "__license__", 14 | "__copyright__", 15 | ] 16 | 17 | __title__ = "packaging" 18 | __summary__ = "Core utilities for Python packages" 19 | __uri__ = "https://github.com/pypa/packaging" 20 | 21 | __version__ = "19.0" 22 | 23 | __author__ = "Donald Stufft and individual contributors" 24 | __email__ = "donald@stufft.io" 25 | 26 | __license__ = "BSD or Apache License, Version 2.0" 27 | __copyright__ = "Copyright 2014-2019 %s" % __author__ 28 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, 8 | __copyright__, 9 | __email__, 10 | __license__, 11 | __summary__, 12 | __title__, 13 | __uri__, 14 | __version__, 15 | ) 16 | 17 | __all__ = [ 18 | "__title__", 19 | "__summary__", 20 | "__uri__", 21 | "__version__", 22 | "__author__", 23 | "__email__", 24 | "__license__", 25 | "__copyright__", 26 | ] 27 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | 9 | PY2 = sys.version_info[0] == 2 10 | PY3 = sys.version_info[0] == 3 11 | 12 | # flake8: noqa 13 | 14 | if PY3: 15 | string_types = (str,) 16 | else: 17 | string_types = (basestring,) 18 | 19 | 20 | def with_metaclass(meta, *bases): 21 | """ 22 | Create a base class with a metaclass. 23 | """ 24 | # This requires a bit of explanation: the basic idea is to make a dummy 25 | # metaclass for one level of class instantiation that replaces itself with 26 | # the actual metaclass. 27 | class metaclass(meta): 28 | def __new__(cls, name, this_bases, d): 29 | return meta(name, bases, d) 30 | 31 | return type.__new__(metaclass, "temporary_class", (), {}) 32 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/packaging/_structures.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | 7 | class Infinity(object): 8 | def __repr__(self): 9 | return "Infinity" 10 | 11 | def __hash__(self): 12 | return hash(repr(self)) 13 | 14 | def __lt__(self, other): 15 | return False 16 | 17 | def __le__(self, other): 18 | return False 19 | 20 | def __eq__(self, other): 21 | return isinstance(other, self.__class__) 22 | 23 | def __ne__(self, other): 24 | return not isinstance(other, self.__class__) 25 | 26 | def __gt__(self, other): 27 | return True 28 | 29 | def __ge__(self, other): 30 | return True 31 | 32 | def __neg__(self): 33 | return NegativeInfinity 34 | 35 | 36 | Infinity = Infinity() 37 | 38 | 39 | class NegativeInfinity(object): 40 | def __repr__(self): 41 | return "-Infinity" 42 | 43 | def __hash__(self): 44 | return hash(repr(self)) 45 | 46 | def __lt__(self, other): 47 | return True 48 | 49 | def __le__(self, other): 50 | return True 51 | 52 | def __eq__(self, other): 53 | return isinstance(other, self.__class__) 54 | 55 | def __ne__(self, other): 56 | return not isinstance(other, self.__class__) 57 | 58 | def __gt__(self, other): 59 | return False 60 | 61 | def __ge__(self, other): 62 | return False 63 | 64 | def __neg__(self): 65 | return Infinity 66 | 67 | 68 | NegativeInfinity = NegativeInfinity() 69 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/packaging/utils.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import re 7 | 8 | from .version import InvalidVersion, Version 9 | 10 | 11 | _canonicalize_regex = re.compile(r"[-_.]+") 12 | 13 | 14 | def canonicalize_name(name): 15 | # This is taken from PEP 503. 16 | return _canonicalize_regex.sub("-", name).lower() 17 | 18 | 19 | def canonicalize_version(version): 20 | """ 21 | This is very similar to Version.__str__, but has one subtle differences 22 | with the way it handles the release segment. 23 | """ 24 | 25 | try: 26 | version = Version(version) 27 | except InvalidVersion: 28 | # Legacy versions cannot be normalized 29 | return version 30 | 31 | parts = [] 32 | 33 | # Epoch 34 | if version.epoch != 0: 35 | parts.append("{0}!".format(version.epoch)) 36 | 37 | # Release segment 38 | # NB: This strips trailing '.0's to normalize 39 | parts.append(re.sub(r"(\.0)+$", "", ".".join(str(x) for x in version.release))) 40 | 41 | # Pre-release 42 | if version.pre is not None: 43 | parts.append("".join(str(x) for x in version.pre)) 44 | 45 | # Post-release 46 | if version.post is not None: 47 | parts.append(".post{0}".format(version.post)) 48 | 49 | # Development release 50 | if version.dev is not None: 51 | parts.append(".dev{0}".format(version.dev)) 52 | 53 | # Local version segment 54 | if version.local is not None: 55 | parts.append("+{0}".format(version.local)) 56 | 57 | return "".join(parts) 58 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/__init__.py: -------------------------------------------------------------------------------- 1 | """Wrappers to build Python packages using PEP 517 hooks 2 | """ 3 | 4 | __version__ = '0.5.0' 5 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pep517/compat.py: -------------------------------------------------------------------------------- 1 | """Handle reading and writing JSON in UTF-8, on Python 3 and 2.""" 2 | import json 3 | import sys 4 | 5 | if sys.version_info[0] >= 3: 6 | # Python 3 7 | def write_json(obj, path, **kwargs): 8 | with open(path, 'w', encoding='utf-8') as f: 9 | json.dump(obj, f, **kwargs) 10 | 11 | def read_json(path): 12 | with open(path, 'r', encoding='utf-8') as f: 13 | return json.load(f) 14 | 15 | else: 16 | # Python 2 17 | def write_json(obj, path, **kwargs): 18 | with open(path, 'wb') as f: 19 | json.dump(obj, f, encoding='utf-8', **kwargs) 20 | 21 | def read_json(path): 22 | with open(path, 'rb') as f: 23 | return json.load(f) 24 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pkg_resources/py31compat.py: -------------------------------------------------------------------------------- 1 | import os 2 | import errno 3 | import sys 4 | 5 | from pip._vendor import six 6 | 7 | 8 | def _makedirs_31(path, exist_ok=False): 9 | try: 10 | os.makedirs(path) 11 | except OSError as exc: 12 | if not exist_ok or exc.errno != errno.EEXIST: 13 | raise 14 | 15 | 16 | # rely on compatibility behavior until mode considerations 17 | # and exists_ok considerations are disentangled. 18 | # See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663 19 | needs_makedirs = ( 20 | six.PY2 or 21 | (3, 4) <= sys.version_info < (3, 4, 1) 22 | ) 23 | makedirs = _makedirs_31 if needs_makedirs else os.makedirs 24 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/progress/counter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | from . import Infinite, Progress 19 | from .helpers import WriteMixin 20 | 21 | 22 | class Counter(WriteMixin, Infinite): 23 | message = '' 24 | hide_cursor = True 25 | 26 | def update(self): 27 | self.write(str(self.index)) 28 | 29 | 30 | class Countdown(WriteMixin, Progress): 31 | hide_cursor = True 32 | 33 | def update(self): 34 | self.write(str(self.remaining)) 35 | 36 | 37 | class Stack(WriteMixin, Progress): 38 | phases = (' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') 39 | hide_cursor = True 40 | 41 | def update(self): 42 | nphases = len(self.phases) 43 | i = min(nphases - 1, int(self.progress * nphases)) 44 | self.write(self.phases[i]) 45 | 46 | 47 | class Pie(Stack): 48 | phases = ('○', '◔', '◑', '◕', '●') 49 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/progress/spinner.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | from . import Infinite 19 | from .helpers import WriteMixin 20 | 21 | 22 | class Spinner(WriteMixin, Infinite): 23 | message = '' 24 | phases = ('-', '\\', '|', '/') 25 | hide_cursor = True 26 | 27 | def update(self): 28 | i = self.index % len(self.phases) 29 | self.write(self.phases[i]) 30 | 31 | 32 | class PieSpinner(Spinner): 33 | phases = ['◷', '◶', '◵', '◴'] 34 | 35 | 36 | class MoonSpinner(Spinner): 37 | phases = ['◑', '◒', '◐', '◓'] 38 | 39 | 40 | class LineSpinner(Spinner): 41 | phases = ['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'] 42 | 43 | class PixelSpinner(Spinner): 44 | phases = ['⣾','⣷', '⣯', '⣟', '⡿', '⢿', '⣻', '⣽'] 45 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pytoml/__init__.py: -------------------------------------------------------------------------------- 1 | from .core import TomlError 2 | from .parser import load, loads 3 | from .test import translate_to_test 4 | from .writer import dump, dumps -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pytoml/core.py: -------------------------------------------------------------------------------- 1 | class TomlError(RuntimeError): 2 | def __init__(self, message, line, col, filename): 3 | RuntimeError.__init__(self, message, line, col, filename) 4 | self.message = message 5 | self.line = line 6 | self.col = col 7 | self.filename = filename 8 | 9 | def __str__(self): 10 | return '{}({}, {}): {}'.format(self.filename, self.line, self.col, self.message) 11 | 12 | def __repr__(self): 13 | return 'TomlError({!r}, {!r}, {!r}, {!r})'.format(self.message, self.line, self.col, self.filename) 14 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pytoml/test.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | from .utils import format_rfc3339 3 | 4 | try: 5 | _string_types = (str, unicode) 6 | _int_types = (int, long) 7 | except NameError: 8 | _string_types = str 9 | _int_types = int 10 | 11 | def translate_to_test(v): 12 | if isinstance(v, dict): 13 | return { k: translate_to_test(v) for k, v in v.items() } 14 | if isinstance(v, list): 15 | a = [translate_to_test(x) for x in v] 16 | if v and isinstance(v[0], dict): 17 | return a 18 | else: 19 | return {'type': 'array', 'value': a} 20 | if isinstance(v, datetime.datetime): 21 | return {'type': 'datetime', 'value': format_rfc3339(v)} 22 | if isinstance(v, bool): 23 | return {'type': 'bool', 'value': 'true' if v else 'false'} 24 | if isinstance(v, _int_types): 25 | return {'type': 'integer', 'value': str(v)} 26 | if isinstance(v, float): 27 | return {'type': 'float', 'value': '{:.17}'.format(v)} 28 | if isinstance(v, _string_types): 29 | return {'type': 'string', 'value': v} 30 | raise RuntimeError('unexpected value: {!r}'.format(v)) 31 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/pytoml/utils.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import re 3 | 4 | rfc3339_re = re.compile(r'(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(?:Z|([+-]\d{2}):(\d{2}))') 5 | 6 | def parse_rfc3339(v): 7 | m = rfc3339_re.match(v) 8 | if not m or m.group(0) != v: 9 | return None 10 | return parse_rfc3339_re(m) 11 | 12 | def parse_rfc3339_re(m): 13 | r = map(int, m.groups()[:6]) 14 | if m.group(7): 15 | micro = float(m.group(7)) 16 | else: 17 | micro = 0 18 | 19 | if m.group(8): 20 | g = int(m.group(8), 10) * 60 + int(m.group(9), 10) 21 | tz = _TimeZone(datetime.timedelta(0, g * 60)) 22 | else: 23 | tz = _TimeZone(datetime.timedelta(0, 0)) 24 | 25 | y, m, d, H, M, S = r 26 | return datetime.datetime(y, m, d, H, M, S, int(micro * 1000000), tz) 27 | 28 | 29 | def format_rfc3339(v): 30 | offs = v.utcoffset() 31 | offs = int(offs.total_seconds()) // 60 if offs is not None else 0 32 | 33 | if offs == 0: 34 | suffix = 'Z' 35 | else: 36 | if offs > 0: 37 | suffix = '+' 38 | else: 39 | suffix = '-' 40 | offs = -offs 41 | suffix = '{0}{1:02}:{2:02}'.format(suffix, offs // 60, offs % 60) 42 | 43 | if v.microsecond: 44 | return v.strftime('%Y-%m-%dT%H:%M:%S.%f') + suffix 45 | else: 46 | return v.strftime('%Y-%m-%dT%H:%M:%S') + suffix 47 | 48 | class _TimeZone(datetime.tzinfo): 49 | def __init__(self, offset): 50 | self._offset = offset 51 | 52 | def utcoffset(self, dt): 53 | return self._offset 54 | 55 | def dst(self, dt): 56 | return None 57 | 58 | def tzname(self, dt): 59 | m = self._offset.total_seconds() // 60 60 | if m < 0: 61 | res = '-' 62 | m = -m 63 | else: 64 | res = '+' 65 | h = m // 60 66 | m = m - h * 60 67 | return '{}{:.02}{:.02}'.format(res, h, m) 68 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/requests/__version__.py: -------------------------------------------------------------------------------- 1 | # .-. .-. .-. . . .-. .-. .-. .-. 2 | # |( |- |.| | | |- `-. | `-. 3 | # ' ' `-' `-`.`-' `-' `-' ' `-' 4 | 5 | __title__ = 'requests' 6 | __description__ = 'Python HTTP for Humans.' 7 | __url__ = 'http://python-requests.org' 8 | __version__ = '2.21.0' 9 | __build__ = 0x022100 10 | __author__ = 'Kenneth Reitz' 11 | __author_email__ = 'me@kennethreitz.org' 12 | __license__ = 'Apache 2.0' 13 | __copyright__ = 'Copyright 2018 Kenneth Reitz' 14 | __cake__ = u'\u2728 \U0001f370 \u2728' 15 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/requests/_internal_utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests._internal_utils 5 | ~~~~~~~~~~~~~~ 6 | 7 | Provides utility functions that are consumed internally by Requests 8 | which depend on extremely few external helpers (such as compat) 9 | """ 10 | 11 | from .compat import is_py2, builtin_str, str 12 | 13 | 14 | def to_native_string(string, encoding='ascii'): 15 | """Given a string object, regardless of type, returns a representation of 16 | that string in the native string type, encoding and decoding where 17 | necessary. This assumes ASCII unless told otherwise. 18 | """ 19 | if isinstance(string, builtin_str): 20 | out = string 21 | else: 22 | if is_py2: 23 | out = string.encode(encoding) 24 | else: 25 | out = string.decode(encoding) 26 | 27 | return out 28 | 29 | 30 | def unicode_is_ascii(u_string): 31 | """Determine if unicode string only contains ASCII characters. 32 | 33 | :param str u_string: unicode string to check. Must be unicode 34 | and not Python 2 `str`. 35 | :rtype: bool 36 | """ 37 | assert isinstance(u_string, str) 38 | try: 39 | u_string.encode('ascii') 40 | return True 41 | except UnicodeEncodeError: 42 | return False 43 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | requests.certs 6 | ~~~~~~~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. There is 9 | only one — the one from the certifi package. 10 | 11 | If you are packaging Requests, e.g., for a Linux distribution or a managed 12 | environment, you can change the definition of where() to return a separately 13 | packaged CA bundle. 14 | """ 15 | from pip._vendor.certifi import where 16 | 17 | if __name__ == '__main__': 18 | print(where()) 19 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/requests/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.compat 5 | ~~~~~~~~~~~~~~~ 6 | 7 | This module handles import compatibility issues between Python 2 and 8 | Python 3. 9 | """ 10 | 11 | from pip._vendor import chardet 12 | 13 | import sys 14 | 15 | # ------- 16 | # Pythons 17 | # ------- 18 | 19 | # Syntax sugar. 20 | _ver = sys.version_info 21 | 22 | #: Python 2.x? 23 | is_py2 = (_ver[0] == 2) 24 | 25 | #: Python 3.x? 26 | is_py3 = (_ver[0] == 3) 27 | 28 | # Note: We've patched out simplejson support in pip because it prevents 29 | # upgrading simplejson on Windows. 30 | # try: 31 | # import simplejson as json 32 | # except (ImportError, SyntaxError): 33 | # # simplejson does not support Python 3.2, it throws a SyntaxError 34 | # # because of u'...' Unicode literals. 35 | import json 36 | 37 | # --------- 38 | # Specifics 39 | # --------- 40 | 41 | if is_py2: 42 | from urllib import ( 43 | quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, 44 | proxy_bypass, proxy_bypass_environment, getproxies_environment) 45 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag 46 | from urllib2 import parse_http_list 47 | import cookielib 48 | from Cookie import Morsel 49 | from StringIO import StringIO 50 | from collections import Callable, Mapping, MutableMapping, OrderedDict 51 | 52 | 53 | builtin_str = str 54 | bytes = str 55 | str = unicode 56 | basestring = basestring 57 | numeric_types = (int, long, float) 58 | integer_types = (int, long) 59 | 60 | elif is_py3: 61 | from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag 62 | from urllib.request import parse_http_list, getproxies, proxy_bypass, proxy_bypass_environment, getproxies_environment 63 | from http import cookiejar as cookielib 64 | from http.cookies import Morsel 65 | from io import StringIO 66 | from collections import OrderedDict 67 | from collections.abc import Callable, Mapping, MutableMapping 68 | 69 | builtin_str = str 70 | str = str 71 | bytes = bytes 72 | basestring = (str, bytes) 73 | numeric_types = (int, float) 74 | integer_types = (int,) 75 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | """ 14 | HOOKS = ['response'] 15 | 16 | 17 | def default_hooks(): 18 | return {event: [] for event in HOOKS} 19 | 20 | # TODO: response is the only one 21 | 22 | 23 | def dispatch_hook(key, hooks, hook_data, **kwargs): 24 | """Dispatches a hook dictionary on a given piece of data.""" 25 | hooks = hooks or {} 26 | hooks = hooks.get(key) 27 | if hooks: 28 | if hasattr(hooks, '__call__'): 29 | hooks = [hooks] 30 | for hook in hooks: 31 | _hook_data = hook(hook_data, **kwargs) 32 | if _hook_data is not None: 33 | hook_data = _hook_data 34 | return hook_data 35 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/requests/packages.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # This code exists for backwards compatibility reasons. 4 | # I don't like it either. Just look the other way. :) 5 | 6 | for package in ('urllib3', 'idna', 'chardet'): 7 | vendored_package = "pip._vendor." + package 8 | locals()[package] = __import__(vendored_package) 9 | # This traversal is apparently necessary such that the identities are 10 | # preserved (requests.packages.urllib3.* is urllib3.*) 11 | for mod in list(sys.modules): 12 | if mod == vendored_package or mod.startswith(vendored_package + '.'): 13 | unprefixed_mod = mod[len("pip._vendor."):] 14 | sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod] 15 | 16 | # Kinda cool, though, right? 17 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module provides means to detect the App Engine environment. 3 | """ 4 | 5 | import os 6 | 7 | 8 | def is_appengine(): 9 | return (is_local_appengine() or 10 | is_prod_appengine() or 11 | is_prod_appengine_mvms()) 12 | 13 | 14 | def is_appengine_sandbox(): 15 | return is_appengine() and not is_prod_appengine_mvms() 16 | 17 | 18 | def is_local_appengine(): 19 | return ('APPENGINE_RUNTIME' in os.environ and 20 | 'Development/' in os.environ['SERVER_SOFTWARE']) 21 | 22 | 23 | def is_prod_appengine(): 24 | return ('APPENGINE_RUNTIME' in os.environ and 25 | 'Google App Engine/' in os.environ['SERVER_SOFTWARE'] and 26 | not is_prod_appengine_mvms()) 27 | 28 | 29 | def is_prod_appengine_mvms(): 30 | return os.environ.get('GAE_VM', False) == 'true' 31 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | __all__ = ('ssl_match_hostname', ) 6 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | backports.makefile 4 | ~~~~~~~~~~~~~~~~~~ 5 | 6 | Backports the Python 3 ``socket.makefile`` method for use with anything that 7 | wants to create a "fake" socket object. 8 | """ 9 | import io 10 | 11 | from socket import SocketIO 12 | 13 | 14 | def backport_makefile(self, mode="r", buffering=None, encoding=None, 15 | errors=None, newline=None): 16 | """ 17 | Backport of ``socket.makefile`` from Python 3.5. 18 | """ 19 | if not set(mode) <= {"r", "w", "b"}: 20 | raise ValueError( 21 | "invalid mode %r (only r, w, b allowed)" % (mode,) 22 | ) 23 | writing = "w" in mode 24 | reading = "r" in mode or not writing 25 | assert reading or writing 26 | binary = "b" in mode 27 | rawmode = "" 28 | if reading: 29 | rawmode += "r" 30 | if writing: 31 | rawmode += "w" 32 | raw = SocketIO(self, rawmode) 33 | self._makefile_refs += 1 34 | if buffering is None: 35 | buffering = -1 36 | if buffering < 0: 37 | buffering = io.DEFAULT_BUFFER_SIZE 38 | if buffering == 0: 39 | if not binary: 40 | raise ValueError("unbuffered streams must be binary") 41 | return raw 42 | if reading and writing: 43 | buffer = io.BufferedRWPair(raw, raw, buffering) 44 | elif reading: 45 | buffer = io.BufferedReader(raw, buffering) 46 | else: 47 | assert writing 48 | buffer = io.BufferedWriter(raw, buffering) 49 | if binary: 50 | return buffer 51 | text = io.TextIOWrapper(buffer, encoding, errors, newline) 52 | text.mode = mode 53 | return text 54 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | try: 4 | # Our match_hostname function is the same as 3.5's, so we only want to 5 | # import the match_hostname function if it's at least that good. 6 | if sys.version_info < (3, 5): 7 | raise ImportError("Fallback to vendored code") 8 | 9 | from ssl import CertificateError, match_hostname 10 | except ImportError: 11 | try: 12 | # Backport of the function from a pypi module 13 | from backports.ssl_match_hostname import CertificateError, match_hostname 14 | except ImportError: 15 | # Our vendored copy 16 | from ._implementation import CertificateError, match_hostname 17 | 18 | # Not needed, but documenting what we provide. 19 | __all__ = ('CertificateError', 'match_hostname') 20 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | # For backwards compatibility, provide imports that used to be here. 3 | from .connection import is_connection_dropped 4 | from .request import make_headers 5 | from .response import is_fp_closed 6 | from .ssl_ import ( 7 | SSLContext, 8 | HAS_SNI, 9 | IS_PYOPENSSL, 10 | IS_SECURETRANSPORT, 11 | assert_fingerprint, 12 | resolve_cert_reqs, 13 | resolve_ssl_version, 14 | ssl_wrap_socket, 15 | ) 16 | from .timeout import ( 17 | current_time, 18 | Timeout, 19 | ) 20 | 21 | from .retry import Retry 22 | from .url import ( 23 | get_host, 24 | parse_url, 25 | split_first, 26 | Url, 27 | ) 28 | from .wait import ( 29 | wait_for_read, 30 | wait_for_write 31 | ) 32 | 33 | __all__ = ( 34 | 'HAS_SNI', 35 | 'IS_PYOPENSSL', 36 | 'IS_SECURETRANSPORT', 37 | 'SSLContext', 38 | 'Retry', 39 | 'Timeout', 40 | 'Url', 41 | 'assert_fingerprint', 42 | 'current_time', 43 | 'is_connection_dropped', 44 | 'is_fp_closed', 45 | 'get_host', 46 | 'parse_url', 47 | 'make_headers', 48 | 'resolve_cert_reqs', 49 | 'resolve_ssl_version', 50 | 'split_first', 51 | 'ssl_wrap_socket', 52 | 'wait_for_read', 53 | 'wait_for_write' 54 | ) 55 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/urllib3/util/queue.py: -------------------------------------------------------------------------------- 1 | import collections 2 | from ..packages import six 3 | from ..packages.six.moves import queue 4 | 5 | if six.PY2: 6 | # Queue is imported for side effects on MS Windows. See issue #229. 7 | import Queue as _unused_module_Queue # noqa: F401 8 | 9 | 10 | class LifoQueue(queue.Queue): 11 | def _init(self, _): 12 | self.queue = collections.deque() 13 | 14 | def _qsize(self, len=len): 15 | return len(self.queue) 16 | 17 | def _put(self, item): 18 | self.queue.append(item) 19 | 20 | def _get(self): 21 | return self.queue.pop() 22 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pip/_vendor/webencodings/mklabels.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | webencodings.mklabels 4 | ~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | Regenarate the webencodings.labels module. 7 | 8 | :copyright: Copyright 2012 by Simon Sapin 9 | :license: BSD, see LICENSE for details. 10 | 11 | """ 12 | 13 | import json 14 | try: 15 | from urllib import urlopen 16 | except ImportError: 17 | from urllib.request import urlopen 18 | 19 | 20 | def assert_lower(string): 21 | assert string == string.lower() 22 | return string 23 | 24 | 25 | def generate(url): 26 | parts = ['''\ 27 | """ 28 | 29 | webencodings.labels 30 | ~~~~~~~~~~~~~~~~~~~ 31 | 32 | Map encoding labels to their name. 33 | 34 | :copyright: Copyright 2012 by Simon Sapin 35 | :license: BSD, see LICENSE for details. 36 | 37 | """ 38 | 39 | # XXX Do not edit! 40 | # This file is automatically generated by mklabels.py 41 | 42 | LABELS = { 43 | '''] 44 | labels = [ 45 | (repr(assert_lower(label)).lstrip('u'), 46 | repr(encoding['name']).lstrip('u')) 47 | for category in json.loads(urlopen(url).read().decode('ascii')) 48 | for encoding in category['encodings'] 49 | for label in encoding['labels']] 50 | max_len = max(len(label) for label, name in labels) 51 | parts.extend( 52 | ' %s:%s %s,\n' % (label, ' ' * (max_len - len(label)), name) 53 | for label, name in labels) 54 | parts.append('}') 55 | return ''.join(parts) 56 | 57 | 58 | if __name__ == '__main__': 59 | print(generate('http://encoding.spec.whatwg.org/encodings.json')) 60 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 8 | "__email__", "__license__", "__copyright__", 9 | ] 10 | 11 | __title__ = "packaging" 12 | __summary__ = "Core utilities for Python packages" 13 | __uri__ = "https://github.com/pypa/packaging" 14 | 15 | __version__ = "16.8" 16 | 17 | __author__ = "Donald Stufft and individual contributors" 18 | __email__ = "donald@stufft.io" 19 | 20 | __license__ = "BSD or Apache License, Version 2.0" 21 | __copyright__ = "Copyright 2014-2016 %s" % __author__ 22 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, __copyright__, __email__, __license__, __summary__, __title__, 8 | __uri__, __version__ 9 | ) 10 | 11 | __all__ = [ 12 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 13 | "__email__", "__license__", "__copyright__", 14 | ] 15 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | 9 | PY2 = sys.version_info[0] == 2 10 | PY3 = sys.version_info[0] == 3 11 | 12 | # flake8: noqa 13 | 14 | if PY3: 15 | string_types = str, 16 | else: 17 | string_types = basestring, 18 | 19 | 20 | def with_metaclass(meta, *bases): 21 | """ 22 | Create a base class with a metaclass. 23 | """ 24 | # This requires a bit of explanation: the basic idea is to make a dummy 25 | # metaclass for one level of class instantiation that replaces itself with 26 | # the actual metaclass. 27 | class metaclass(meta): 28 | def __new__(cls, name, this_bases, d): 29 | return meta(name, bases, d) 30 | return type.__new__(metaclass, 'temporary_class', (), {}) 31 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/_structures.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | 7 | class Infinity(object): 8 | 9 | def __repr__(self): 10 | return "Infinity" 11 | 12 | def __hash__(self): 13 | return hash(repr(self)) 14 | 15 | def __lt__(self, other): 16 | return False 17 | 18 | def __le__(self, other): 19 | return False 20 | 21 | def __eq__(self, other): 22 | return isinstance(other, self.__class__) 23 | 24 | def __ne__(self, other): 25 | return not isinstance(other, self.__class__) 26 | 27 | def __gt__(self, other): 28 | return True 29 | 30 | def __ge__(self, other): 31 | return True 32 | 33 | def __neg__(self): 34 | return NegativeInfinity 35 | 36 | Infinity = Infinity() 37 | 38 | 39 | class NegativeInfinity(object): 40 | 41 | def __repr__(self): 42 | return "-Infinity" 43 | 44 | def __hash__(self): 45 | return hash(repr(self)) 46 | 47 | def __lt__(self, other): 48 | return True 49 | 50 | def __le__(self, other): 51 | return True 52 | 53 | def __eq__(self, other): 54 | return isinstance(other, self.__class__) 55 | 56 | def __ne__(self, other): 57 | return not isinstance(other, self.__class__) 58 | 59 | def __gt__(self, other): 60 | return False 61 | 62 | def __ge__(self, other): 63 | return False 64 | 65 | def __neg__(self): 66 | return Infinity 67 | 68 | NegativeInfinity = NegativeInfinity() 69 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/utils.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import re 7 | 8 | 9 | _canonicalize_regex = re.compile(r"[-_.]+") 10 | 11 | 12 | def canonicalize_name(name): 13 | # This is taken from PEP 503. 14 | return _canonicalize_regex.sub("-", name).lower() 15 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/pkg_resources/py31compat.py: -------------------------------------------------------------------------------- 1 | import os 2 | import errno 3 | import sys 4 | 5 | from .extern import six 6 | 7 | 8 | def _makedirs_31(path, exist_ok=False): 9 | try: 10 | os.makedirs(path) 11 | except OSError as exc: 12 | if not exist_ok or exc.errno != errno.EEXIST: 13 | raise 14 | 15 | 16 | # rely on compatibility behavior until mode considerations 17 | # and exists_ok considerations are disentangled. 18 | # See https://github.com/pypa/setuptools/pull/1083#issuecomment-315168663 19 | needs_makedirs = ( 20 | six.PY2 or 21 | (3, 4) <= sys.version_info < (3, 4, 1) 22 | ) 23 | makedirs = _makedirs_31 if needs_makedirs else os.makedirs 24 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools-40.8.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools-40.8.0.dist-info/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Jason R Coombs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools-40.8.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.32.3) 3 | Root-Is-Purelib: true 4 | Tag: py2-none-any 5 | Tag: py3-none-any 6 | 7 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools-40.8.0.dist-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | https://files.pythonhosted.org/packages/source/c/certifi/certifi-2016.9.26.tar.gz#md5=baa81e951a29958563689d868ef1064d 2 | https://files.pythonhosted.org/packages/source/w/wincertstore/wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2 3 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools-40.8.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | easy_install 2 | pkg_resources 3 | setuptools 4 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools-40.8.0.dist-info/zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_deprecation_warning.py: -------------------------------------------------------------------------------- 1 | class SetuptoolsDeprecationWarning(Warning): 2 | """ 3 | Base class for warning deprecations in ``setuptools`` 4 | 5 | This class is not derived from ``DeprecationWarning``, and as such is 6 | visible by default. 7 | """ 8 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/__init__.py -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | __all__ = [ 7 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 8 | "__email__", "__license__", "__copyright__", 9 | ] 10 | 11 | __title__ = "packaging" 12 | __summary__ = "Core utilities for Python packages" 13 | __uri__ = "https://github.com/pypa/packaging" 14 | 15 | __version__ = "16.8" 16 | 17 | __author__ = "Donald Stufft and individual contributors" 18 | __email__ = "donald@stufft.io" 19 | 20 | __license__ = "BSD or Apache License, Version 2.0" 21 | __copyright__ = "Copyright 2014-2016 %s" % __author__ 22 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | from .__about__ import ( 7 | __author__, __copyright__, __email__, __license__, __summary__, __title__, 8 | __uri__, __version__ 9 | ) 10 | 11 | __all__ = [ 12 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 13 | "__email__", "__license__", "__copyright__", 14 | ] 15 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import sys 7 | 8 | 9 | PY2 = sys.version_info[0] == 2 10 | PY3 = sys.version_info[0] == 3 11 | 12 | # flake8: noqa 13 | 14 | if PY3: 15 | string_types = str, 16 | else: 17 | string_types = basestring, 18 | 19 | 20 | def with_metaclass(meta, *bases): 21 | """ 22 | Create a base class with a metaclass. 23 | """ 24 | # This requires a bit of explanation: the basic idea is to make a dummy 25 | # metaclass for one level of class instantiation that replaces itself with 26 | # the actual metaclass. 27 | class metaclass(meta): 28 | def __new__(cls, name, this_bases, d): 29 | return meta(name, bases, d) 30 | return type.__new__(metaclass, 'temporary_class', (), {}) 31 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/packaging/_structures.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | 7 | class Infinity(object): 8 | 9 | def __repr__(self): 10 | return "Infinity" 11 | 12 | def __hash__(self): 13 | return hash(repr(self)) 14 | 15 | def __lt__(self, other): 16 | return False 17 | 18 | def __le__(self, other): 19 | return False 20 | 21 | def __eq__(self, other): 22 | return isinstance(other, self.__class__) 23 | 24 | def __ne__(self, other): 25 | return not isinstance(other, self.__class__) 26 | 27 | def __gt__(self, other): 28 | return True 29 | 30 | def __ge__(self, other): 31 | return True 32 | 33 | def __neg__(self): 34 | return NegativeInfinity 35 | 36 | Infinity = Infinity() 37 | 38 | 39 | class NegativeInfinity(object): 40 | 41 | def __repr__(self): 42 | return "-Infinity" 43 | 44 | def __hash__(self): 45 | return hash(repr(self)) 46 | 47 | def __lt__(self, other): 48 | return True 49 | 50 | def __le__(self, other): 51 | return True 52 | 53 | def __eq__(self, other): 54 | return isinstance(other, self.__class__) 55 | 56 | def __ne__(self, other): 57 | return not isinstance(other, self.__class__) 58 | 59 | def __gt__(self, other): 60 | return False 61 | 62 | def __ge__(self, other): 63 | return False 64 | 65 | def __neg__(self): 66 | return Infinity 67 | 68 | NegativeInfinity = NegativeInfinity() 69 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/_vendor/packaging/utils.py: -------------------------------------------------------------------------------- 1 | # This file is dual licensed under the terms of the Apache License, Version 2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository 3 | # for complete details. 4 | from __future__ import absolute_import, division, print_function 5 | 6 | import re 7 | 8 | 9 | _canonicalize_regex = re.compile(r"[-_.]+") 10 | 11 | 12 | def canonicalize_name(name): 13 | # This is taken from PEP 503. 14 | return _canonicalize_regex.sub("-", name).lower() 15 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/cli-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/cli-32.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/cli-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/cli-64.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/cli.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/cli.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 3 | 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 4 | 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', 5 | 'register', 'bdist_wininst', 'upload_docs', 'upload', 'build_clib', 6 | 'dist_info', 7 | ] 8 | 9 | from distutils.command.bdist import bdist 10 | import sys 11 | 12 | from setuptools.command import install_scripts 13 | 14 | if 'egg' not in bdist.format_commands: 15 | bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") 16 | bdist.format_commands.append('egg') 17 | 18 | del bdist, sys 19 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/bdist_rpm.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_rpm as orig 2 | 3 | 4 | class bdist_rpm(orig.bdist_rpm): 5 | """ 6 | Override the default bdist_rpm behavior to do the following: 7 | 8 | 1. Run egg_info to ensure the name and version are properly calculated. 9 | 2. Always run 'install' using --single-version-externally-managed to 10 | disable eggs in RPM distributions. 11 | 3. Replace dash with underscore in the version numbers for better RPM 12 | compatibility. 13 | """ 14 | 15 | def run(self): 16 | # ensure distro name is up-to-date 17 | self.run_command('egg_info') 18 | 19 | orig.bdist_rpm.run(self) 20 | 21 | def _make_spec_file(self): 22 | version = self.distribution.get_version() 23 | rpmversion = version.replace('-', '_') 24 | spec = orig.bdist_rpm._make_spec_file(self) 25 | line23 = '%define version ' + version 26 | line24 = '%define version ' + rpmversion 27 | spec = [ 28 | line.replace( 29 | "Source0: %{name}-%{version}.tar", 30 | "Source0: %{name}-%{unmangled_version}.tar" 31 | ).replace( 32 | "setup.py install ", 33 | "setup.py install --single-version-externally-managed " 34 | ).replace( 35 | "%setup", 36 | "%setup -n %{name}-%{unmangled_version}" 37 | ).replace(line23, line24) 38 | for line in spec 39 | ] 40 | insert_loc = spec.index(line24) + 1 41 | unmangled_version = "%define unmangled_version " + version 42 | spec.insert(insert_loc, unmangled_version) 43 | return spec 44 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/bdist_wininst.py: -------------------------------------------------------------------------------- 1 | import distutils.command.bdist_wininst as orig 2 | 3 | 4 | class bdist_wininst(orig.bdist_wininst): 5 | def reinitialize_command(self, command, reinit_subcommands=0): 6 | """ 7 | Supplement reinitialize_command to work around 8 | http://bugs.python.org/issue20819 9 | """ 10 | cmd = self.distribution.reinitialize_command( 11 | command, reinit_subcommands) 12 | if command in ('install', 'install_lib'): 13 | cmd.install_lib = None 14 | return cmd 15 | 16 | def run(self): 17 | self._is_running = True 18 | try: 19 | orig.bdist_wininst.run(self) 20 | finally: 21 | self._is_running = False 22 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/dist_info.py: -------------------------------------------------------------------------------- 1 | """ 2 | Create a dist_info directory 3 | As defined in the wheel specification 4 | """ 5 | 6 | import os 7 | 8 | from distutils.core import Command 9 | from distutils import log 10 | 11 | 12 | class dist_info(Command): 13 | 14 | description = 'create a .dist-info directory' 15 | 16 | user_options = [ 17 | ('egg-base=', 'e', "directory containing .egg-info directories" 18 | " (default: top of the source tree)"), 19 | ] 20 | 21 | def initialize_options(self): 22 | self.egg_base = None 23 | 24 | def finalize_options(self): 25 | pass 26 | 27 | def run(self): 28 | egg_info = self.get_finalized_command('egg_info') 29 | egg_info.egg_base = self.egg_base 30 | egg_info.finalize_options() 31 | egg_info.run() 32 | dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info' 33 | log.info("creating '{}'".format(os.path.abspath(dist_info_dir))) 34 | 35 | bdist_wheel = self.get_finalized_command('bdist_wheel') 36 | bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir) 37 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/launcher manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/register.py: -------------------------------------------------------------------------------- 1 | from distutils import log 2 | import distutils.command.register as orig 3 | 4 | 5 | class register(orig.register): 6 | __doc__ = orig.register.__doc__ 7 | 8 | def run(self): 9 | try: 10 | # Make sure that we are using valid current name/version info 11 | self.run_command('egg_info') 12 | orig.register.run(self) 13 | finally: 14 | self.announce( 15 | "WARNING: Registering is deprecated, use twine to " 16 | "upload instead (https://pypi.org/p/twine/)", 17 | log.WARN 18 | ) 19 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/command/saveopts.py: -------------------------------------------------------------------------------- 1 | from setuptools.command.setopt import edit_config, option_base 2 | 3 | 4 | class saveopts(option_base): 5 | """Save command-line options to a file""" 6 | 7 | description = "save supplied options to setup.cfg or other config file" 8 | 9 | def run(self): 10 | dist = self.distribution 11 | settings = {} 12 | 13 | for cmd in dist.command_options: 14 | 15 | if cmd == 'saveopts': 16 | continue # don't save our own options! 17 | 18 | for opt, (src, val) in dist.get_option_dict(cmd).items(): 19 | if src == "command line": 20 | settings.setdefault(cmd, {})[opt] = val 21 | 22 | edit_config(self.filename, settings, self.dry_run) 23 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/dep_util.py: -------------------------------------------------------------------------------- 1 | from distutils.dep_util import newer_group 2 | 3 | # yes, this is was almost entirely copy-pasted from 4 | # 'newer_pairwise()', this is just another convenience 5 | # function. 6 | def newer_pairwise_group(sources_groups, targets): 7 | """Walk both arguments in parallel, testing if each source group is newer 8 | than its corresponding target. Returns a pair of lists (sources_groups, 9 | targets) where sources is newer than target, according to the semantics 10 | of 'newer_group()'. 11 | """ 12 | if len(sources_groups) != len(targets): 13 | raise ValueError("'sources_group' and 'targets' must be the same length") 14 | 15 | # build a pair of lists (sources_groups, targets) where source is newer 16 | n_sources = [] 17 | n_targets = [] 18 | for i in range(len(sources_groups)): 19 | if newer_group(sources_groups[i], targets[i]): 20 | n_sources.append(sources_groups[i]) 21 | n_targets.append(targets[i]) 22 | 23 | return n_sources, n_targets 24 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/extension.py: -------------------------------------------------------------------------------- 1 | import re 2 | import functools 3 | import distutils.core 4 | import distutils.errors 5 | import distutils.extension 6 | 7 | from setuptools.extern.six.moves import map 8 | 9 | from .monkey import get_unpatched 10 | 11 | 12 | def _have_cython(): 13 | """ 14 | Return True if Cython can be imported. 15 | """ 16 | cython_impl = 'Cython.Distutils.build_ext' 17 | try: 18 | # from (cython_impl) import build_ext 19 | __import__(cython_impl, fromlist=['build_ext']).build_ext 20 | return True 21 | except Exception: 22 | pass 23 | return False 24 | 25 | 26 | # for compatibility 27 | have_pyrex = _have_cython 28 | 29 | _Extension = get_unpatched(distutils.core.Extension) 30 | 31 | 32 | class Extension(_Extension): 33 | """Extension that uses '.c' files in place of '.pyx' files""" 34 | 35 | def __init__(self, name, sources, *args, **kw): 36 | # The *args is needed for compatibility as calls may use positional 37 | # arguments. py_limited_api may be set only via keyword. 38 | self.py_limited_api = kw.pop("py_limited_api", False) 39 | _Extension.__init__(self, name, sources, *args, **kw) 40 | 41 | def _convert_pyx_sources_to_lang(self): 42 | """ 43 | Replace sources with .pyx extensions to sources with the target 44 | language extension. This mechanism allows language authors to supply 45 | pre-converted sources but to prefer the .pyx sources. 46 | """ 47 | if _have_cython(): 48 | # the build has Cython, so allow it to compile the .pyx files 49 | return 50 | lang = self.language or '' 51 | target_ext = '.cpp' if lang.lower() == 'c++' else '.c' 52 | sub = functools.partial(re.sub, '.pyx$', target_ext) 53 | self.sources = list(map(sub, self.sources)) 54 | 55 | 56 | class Library(Extension): 57 | """Just like a regular Extension, but built as a library instead""" 58 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/gui-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/gui-32.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/gui-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/gui-64.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/gui.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/.venv/lib/python3.7/site-packages/setuptools/gui.exe -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/launch.py: -------------------------------------------------------------------------------- 1 | """ 2 | Launch the Python script on the command line after 3 | setuptools is bootstrapped via import. 4 | """ 5 | 6 | # Note that setuptools gets imported implicitly by the 7 | # invocation of this script using python -m setuptools.launch 8 | 9 | import tokenize 10 | import sys 11 | 12 | 13 | def run(): 14 | """ 15 | Run the script in sys.argv[1] as if it had 16 | been invoked naturally. 17 | """ 18 | __builtins__ 19 | script_name = sys.argv[1] 20 | namespace = dict( 21 | __file__=script_name, 22 | __name__='__main__', 23 | __doc__=None, 24 | ) 25 | sys.argv[:] = sys.argv[1:] 26 | 27 | open_ = getattr(tokenize, 'open', open) 28 | script = open_(script_name).read() 29 | norm_script = script.replace('\\r\\n', '\\n') 30 | code = compile(norm_script, script_name, 'exec') 31 | exec(code, namespace) 32 | 33 | 34 | if __name__ == '__main__': 35 | run() 36 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/lib2to3_ex.py: -------------------------------------------------------------------------------- 1 | """ 2 | Customized Mixin2to3 support: 3 | 4 | - adds support for converting doctests 5 | 6 | 7 | This module raises an ImportError on Python 2. 8 | """ 9 | 10 | from distutils.util import Mixin2to3 as _Mixin2to3 11 | from distutils import log 12 | from lib2to3.refactor import RefactoringTool, get_fixers_from_package 13 | 14 | import setuptools 15 | 16 | 17 | class DistutilsRefactoringTool(RefactoringTool): 18 | def log_error(self, msg, *args, **kw): 19 | log.error(msg, *args) 20 | 21 | def log_message(self, msg, *args): 22 | log.info(msg, *args) 23 | 24 | def log_debug(self, msg, *args): 25 | log.debug(msg, *args) 26 | 27 | 28 | class Mixin2to3(_Mixin2to3): 29 | def run_2to3(self, files, doctests=False): 30 | # See of the distribution option has been set, otherwise check the 31 | # setuptools default. 32 | if self.distribution.use_2to3 is not True: 33 | return 34 | if not files: 35 | return 36 | log.info("Fixing " + " ".join(files)) 37 | self.__build_fixer_names() 38 | self.__exclude_fixers() 39 | if doctests: 40 | if setuptools.run_2to3_on_doctests: 41 | r = DistutilsRefactoringTool(self.fixer_names) 42 | r.refactor(files, write=True, doctests_only=True) 43 | else: 44 | _Mixin2to3.run_2to3(self, files) 45 | 46 | def __build_fixer_names(self): 47 | if self.fixer_names: 48 | return 49 | self.fixer_names = [] 50 | for p in setuptools.lib2to3_fixer_packages: 51 | self.fixer_names.extend(get_fixers_from_package(p)) 52 | if self.distribution.use_2to3_fixers is not None: 53 | for p in self.distribution.use_2to3_fixers: 54 | self.fixer_names.extend(get_fixers_from_package(p)) 55 | 56 | def __exclude_fixers(self): 57 | excluded_fixers = getattr(self, 'exclude_fixers', []) 58 | if self.distribution.use_2to3_exclude_fixers is not None: 59 | excluded_fixers.extend(self.distribution.use_2to3_exclude_fixers) 60 | for fixer_name in excluded_fixers: 61 | if fixer_name in self.fixer_names: 62 | self.fixer_names.remove(fixer_name) 63 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/py27compat.py: -------------------------------------------------------------------------------- 1 | """ 2 | Compatibility Support for Python 2.7 and earlier 3 | """ 4 | 5 | import platform 6 | 7 | from setuptools.extern import six 8 | 9 | 10 | def get_all_headers(message, key): 11 | """ 12 | Given an HTTPMessage, return all headers matching a given key. 13 | """ 14 | return message.get_all(key) 15 | 16 | 17 | if six.PY2: 18 | def get_all_headers(message, key): 19 | return message.getheaders(key) 20 | 21 | 22 | linux_py2_ascii = ( 23 | platform.system() == 'Linux' and 24 | six.PY2 25 | ) 26 | 27 | rmtree_safe = str if linux_py2_ascii else lambda x: x 28 | """Workaround for http://bugs.python.org/issue24672""" 29 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/py31compat.py: -------------------------------------------------------------------------------- 1 | __all__ = [] 2 | 3 | __metaclass__ = type 4 | 5 | 6 | try: 7 | # Python >=3.2 8 | from tempfile import TemporaryDirectory 9 | except ImportError: 10 | import shutil 11 | import tempfile 12 | 13 | class TemporaryDirectory: 14 | """ 15 | Very simple temporary directory context manager. 16 | Will try to delete afterward, but will also ignore OS and similar 17 | errors on deletion. 18 | """ 19 | 20 | def __init__(self): 21 | self.name = None # Handle mkdtemp raising an exception 22 | self.name = tempfile.mkdtemp() 23 | 24 | def __enter__(self): 25 | return self.name 26 | 27 | def __exit__(self, exctype, excvalue, exctrace): 28 | try: 29 | shutil.rmtree(self.name, True) 30 | except OSError: # removal errors are not the only possible 31 | pass 32 | self.name = None 33 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/py33compat.py: -------------------------------------------------------------------------------- 1 | import dis 2 | import array 3 | import collections 4 | 5 | try: 6 | import html 7 | except ImportError: 8 | html = None 9 | 10 | from setuptools.extern import six 11 | from setuptools.extern.six.moves import html_parser 12 | 13 | __metaclass__ = type 14 | 15 | OpArg = collections.namedtuple('OpArg', 'opcode arg') 16 | 17 | 18 | class Bytecode_compat: 19 | def __init__(self, code): 20 | self.code = code 21 | 22 | def __iter__(self): 23 | """Yield '(op,arg)' pair for each operation in code object 'code'""" 24 | 25 | bytes = array.array('b', self.code.co_code) 26 | eof = len(self.code.co_code) 27 | 28 | ptr = 0 29 | extended_arg = 0 30 | 31 | while ptr < eof: 32 | 33 | op = bytes[ptr] 34 | 35 | if op >= dis.HAVE_ARGUMENT: 36 | 37 | arg = bytes[ptr + 1] + bytes[ptr + 2] * 256 + extended_arg 38 | ptr += 3 39 | 40 | if op == dis.EXTENDED_ARG: 41 | long_type = six.integer_types[-1] 42 | extended_arg = arg * long_type(65536) 43 | continue 44 | 45 | else: 46 | arg = None 47 | ptr += 1 48 | 49 | yield OpArg(op, arg) 50 | 51 | 52 | Bytecode = getattr(dis, 'Bytecode', Bytecode_compat) 53 | 54 | 55 | unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape) 56 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/script (dev).tmpl: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = %(spec)r 3 | __import__('pkg_resources').require(%(spec)r) 4 | __file__ = %(dev_path)r 5 | with open(__file__) as f: 6 | exec(compile(f.read(), __file__, 'exec')) 7 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/script.tmpl: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = %(spec)r 3 | __import__('pkg_resources').run_script(%(spec)r, %(script_name)r) 4 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/unicode_utils.py: -------------------------------------------------------------------------------- 1 | import unicodedata 2 | import sys 3 | import re 4 | 5 | from setuptools.extern import six 6 | 7 | 8 | # HFS Plus uses decomposed UTF-8 9 | def decompose(path): 10 | if isinstance(path, six.text_type): 11 | return unicodedata.normalize('NFD', path) 12 | try: 13 | path = path.decode('utf-8') 14 | path = unicodedata.normalize('NFD', path) 15 | path = path.encode('utf-8') 16 | except UnicodeError: 17 | pass # Not UTF-8 18 | return path 19 | 20 | 21 | def filesys_decode(path): 22 | """ 23 | Ensure that the given path is decoded, 24 | NONE when no expected encoding works 25 | """ 26 | 27 | if isinstance(path, six.text_type): 28 | return path 29 | 30 | fs_enc = sys.getfilesystemencoding() or 'utf-8' 31 | candidates = fs_enc, 'utf-8' 32 | 33 | for enc in candidates: 34 | try: 35 | return path.decode(enc) 36 | except UnicodeDecodeError: 37 | continue 38 | 39 | 40 | def try_encode(string, enc): 41 | "turn unicode encoding into a functional routine" 42 | try: 43 | return string.encode(enc) 44 | except UnicodeEncodeError: 45 | return None 46 | 47 | 48 | CODING_RE = re.compile(br'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)') 49 | 50 | 51 | def detect_encoding(fp): 52 | first_line = fp.readline() 53 | fp.seek(0) 54 | m = CODING_RE.match(first_line) 55 | if m is None: 56 | return None 57 | return m.group(1).decode('ascii') 58 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/version.py: -------------------------------------------------------------------------------- 1 | import pkg_resources 2 | 3 | try: 4 | __version__ = pkg_resources.get_distribution('setuptools').version 5 | except Exception: 6 | __version__ = 'unknown' 7 | -------------------------------------------------------------------------------- /granular_access/.venv/lib/python3.7/site-packages/setuptools/windows_support.py: -------------------------------------------------------------------------------- 1 | import platform 2 | import ctypes 3 | 4 | 5 | def windows_only(func): 6 | if platform.system() != 'Windows': 7 | return lambda *args, **kwargs: None 8 | return func 9 | 10 | 11 | @windows_only 12 | def hide_file(path): 13 | """ 14 | Set the hidden attribute on a file or directory. 15 | 16 | From http://stackoverflow.com/questions/19622133/ 17 | 18 | `path` must be text. 19 | """ 20 | __import__('ctypes.wintypes') 21 | SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW 22 | SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD 23 | SetFileAttributes.restype = ctypes.wintypes.BOOL 24 | 25 | FILE_ATTRIBUTE_HIDDEN = 0x02 26 | 27 | ret = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) 28 | if not ret: 29 | raise ctypes.WinError() 30 | -------------------------------------------------------------------------------- /granular_access/.venv/pyvenv.cfg: -------------------------------------------------------------------------------- 1 | home = /Users/wangzyn/opt/anaconda3/bin 2 | include-system-site-packages = false 3 | version = 3.8.8 4 | -------------------------------------------------------------------------------- /granular_access/app.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from aws_cdk import core 4 | 5 | from granular_access.granular_access_stack import GranularAccessStack 6 | 7 | 8 | app = core.App() 9 | GranularAccessStack(app, "granular-access") 10 | 11 | app.synth() 12 | -------------------------------------------------------------------------------- /granular_access/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "python3 app.py", 3 | "context": { 4 | "@aws-cdk/core:enableStackNameDuplicates": "true", 5 | "aws-cdk:enableDiffNoFail": "true", 6 | "@aws-cdk/core:stackRelativeExports": "true" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /granular_access/cdk.out.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/cdk.out.zip -------------------------------------------------------------------------------- /granular_access/employee_information.csv: -------------------------------------------------------------------------------- 1 | country,city,job_title,employee_login,employee_name 2 | GBR,London,Business Intel Engineer II,BettyRamirez,Betty Ramirez 3 | USA,Houston,Data Scientist II,TrinhHartmann,Trinh Hartmann 4 | USA,San Francisco,Professional Services II,KevinGunn,Kevin Gunn 5 | USA,Tracy,"Sr Manager, Program Management",JohnKing,John King 6 | USA,San Francisco,Professional Services I,TeresitaRedd,Teresita Redd 7 | GBR,London,Product Manager III,StephenMoretz,Stephen Moretz 8 | USA,Herndon,Product Manager II,MichaelBrown,Michael Brown 9 | USA,Virtual Location - California,"Mgr II, Supply Chain",StevenLudwick,Steven Ludwick 10 | MEX,Mexico City,Principal Program Management,MarshallBanks,Marshall Banks 11 | GBR,London,Business Intel Engineer II,TimothyMcgloin,Timothy Mcgloin 12 | USA,Houston,Data Scientist II,ThomasYang,Thomas Yang 13 | USA,San Francisco,Professional Services II,CatherineCimino,Catherine Cimino 14 | USA,Tracy,"Sr Manager, Program Management",WayneMaxwell,Wayne Maxwell 15 | USA,San Francisco,Professional Services I,AlbertPowers,Albert Powers 16 | GBR,London,Product Manager III,JoyceKemp,Joyce Kemp 17 | USA,Herndon,Product Manager II,GretchenJoyce,Gretchen Joyce 18 | GBR,London,Business Intel Engineer II,BettyRamirez,Betty Ramirez 19 | USA,Houston,Data Scientist II,TrinhHartmann,Trinh Hartmann 20 | USA,Tracy,"Sr Manager, Program Management",JohnKing,John King 21 | USA,San Francisco,Professional Services I,TeresitaRedd,Teresita Redd 22 | GBR,London,Product Manager III,StephenMoretz,Stephen Moretz 23 | MEX,Mexico City,"Mgr II, Supply Chain",SanZhang,San Zhang -------------------------------------------------------------------------------- /granular_access/fact_revenue.csv: -------------------------------------------------------------------------------- 1 | country,city,employee_name,revenue 2 | GBR,London,Betty Ramirez,"529,537,734" 3 | USA,Houston,Trinh Hartmann,"519,831,437" 4 | USA,San Francisco,Kevin Gunn,"467,552,193" 5 | USA,Tracy,John King,"510,491,240" 6 | USA,San Francisco,Teresita Redd,"668,357,627" 7 | GBR,London,Stephen Moretz,"407,090,003" 8 | USA,Herndon,Michael Brown,"720,944,438" 9 | USA,Virtual Location - California,Steven Ludwick,"678,986,367" 10 | MEX,Mexico City,Marshall Banks,"586,486,587" 11 | GBR,London,Timothy Mcgloin,"364,586,796" 12 | USA,Houston,Thomas Yang,"364,686,687" 13 | USA,San Francisco,Catherine Cimino,"486,686,586" 14 | USA,Tracy,Wayne Maxwell,"868,586,685" 15 | USA,San Francisco,Albert Powers,"386,587,586" 16 | GBR,London,Joyce Kemp,"545,687,363" 17 | USA,Herndon,Gretchen Joyce,"648,463,586" 18 | GBR,London,Betty Ramirez,"383,374,294" 19 | USA,Houston,Trinh Hartmann,"693,538,463" 20 | USA,Tracy,John King,"538,373,373" 21 | USA,San Francisco,Teresita Redd,"687,544,383" 22 | GBR,London,Stephen Moretz,"649,342,432" 23 | MEX,Mexico City,San Zhang,"892,533,637" -------------------------------------------------------------------------------- /granular_access/granular_access/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/granular_access/__init__.py -------------------------------------------------------------------------------- /granular_access/membership.csv: -------------------------------------------------------------------------------- 1 | default,Critical,BettyRamirez,BettyRamirez@oktank.com 2 | default,HighlyConfidential,TrinhHartmann,TrinhHartmann@oktank.com 3 | default,BI-developer,KevinGunn,KevinGunn@oktank.com 4 | default,BI-Admin,JohnKing,JohnKing@oktank.com 5 | default,Power-reader,TeresitaRedd,TeresitaRedd@oktank.com 6 | default,Critical,StephenMoretz,StephenMoretz@oktank.com 7 | default,HighlyConfidential,MichaelBrown,MichaelBrown@oktank.com 8 | default,Critical,StevenLudwick,StevenLudwick@oktank.com 9 | default,HighlyConfidential,MarshallBanks,MarshallBanks@oktank.com 10 | default,Critical,TimothyMcgloin,TimothyMcgloin@oktank.com 11 | default,HighlyConfidential,ThomasYang,ThomasYang@oktank.com 12 | default,Critical,CatherineCimino,CatherineCimino@oktank.com 13 | default,HighlyConfidential,WayneMaxwell,WayneMaxwell@oktank.com 14 | default,BI-developer,AlbertPowers,AlbertPowers@oktank.com 15 | default,BI-Admin,JoyceKemp,JoyceKemp@oktank.com 16 | default,Power-reader,GretchenJoyce,GretchenJoyce@oktank.com 17 | default,USA,BettyRamirez,BettyRamirez@oktank.com 18 | default,USA,TrinhHartmann,TrinhHartmann@oktank.com 19 | default,All-countries,JohnKing,JohnKing@oktank.com 20 | default,All-countries,TeresitaRedd,TeresitaRedd@oktank.com 21 | default,GBR,StephenMoretz,StephenMoretz@oktank.com 22 | 3rd-party,3rd-party,SanZhang,SanZhang@oktank.com -------------------------------------------------------------------------------- /granular_access/membership.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/granular_access/membership.zip -------------------------------------------------------------------------------- /granular_access/requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | -------------------------------------------------------------------------------- /granular_access/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | 4 | with open("README.md") as fp: 5 | long_description = fp.read() 6 | 7 | 8 | setuptools.setup( 9 | name="granular_access", 10 | version="0.0.1", 11 | 12 | description="An empty CDK Python app", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | 16 | author="author", 17 | 18 | package_dir={"": "granular_access"}, 19 | packages=setuptools.find_packages(where="granular_access"), 20 | 21 | install_requires=[ 22 | "aws-cdk.core==1.72.0", 23 | ], 24 | 25 | python_requires=">=3.6", 26 | 27 | classifiers=[ 28 | "Development Status :: 4 - Beta", 29 | 30 | "Intended Audience :: Developers", 31 | 32 | "License :: OSI Approved :: Apache Software License", 33 | 34 | "Programming Language :: JavaScript", 35 | "Programming Language :: Python :: 3 :: Only", 36 | "Programming Language :: Python :: 3.6", 37 | "Programming Language :: Python :: 3.7", 38 | "Programming Language :: Python :: 3.8", 39 | 40 | "Topic :: Software Development :: Code Generators", 41 | "Topic :: Utilities", 42 | 43 | "Typing :: Typed", 44 | ], 45 | ) 46 | -------------------------------------------------------------------------------- /granular_access/source.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem The sole purpose of this script is to make the command 4 | rem 5 | rem source .venv/bin/activate 6 | rem 7 | rem (which activates a Python virtualenv on Linux or Mac OS X) work on Windows. 8 | rem On Windows, this command just runs this batch file (the argument is ignored). 9 | rem 10 | rem Now we don't need to document a Windows command for activating a virtualenv. 11 | 12 | echo Executing .venv\Scripts\activate.bat for you 13 | .venv\Scripts\activate.bat 14 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_files/Women-in-the-Olympic-Movement.csv: -------------------------------------------------------------------------------- 1 | Year,Olympics,% Of Women Participants,% Of Women’s Events,Sports,Total Events,Women Participants,Women’s Events 2 | 1900,Summer,0.022,0.021,2,95,22,2 3 | 1904,Summer,0.009,0.031,1,95,6,3 4 | 1908,Summer,0.018,0.036,2,110,37,4 5 | 1912,Summer,0.02,0.049,2,102,48,5 6 | 1920,Summer,0.024,0.051,2,156,63,8 7 | 1924,Summer,0.044,0.079,3,126,135,10 8 | 1928,Summer,0.096,0.128,4,109,277,14 9 | 1932,Summer,0.09,0.12,3,117,126,14 10 | 1936,Summer,0.083,0.116,4,129,331,15 11 | 1948,Summer,0.095,0.14,5,136,390,19 12 | 1952,Summer,0.105,0.168,6,149,519,25 13 | 1956,Summer,0.133,0.172,6,151,376,26 14 | 1960,Summer,0.114,0.193,6,150,611,29 15 | 1964,Summer,0.132,0.202,7,163,678,33 16 | 1968,Summer,0.142,0.227,7,172,781,39 17 | 1972,Summer,0.146,0.221,8,195,"1,059",43 18 | 1976,Summer,0.207,0.247,11,198,"1,260",49 19 | 1980,Summer,0.215,0.246,12,203,"1,115",50 20 | 1984,Summer,0.23,0.281,14,221,"1,566",62 21 | 1988,Summer,0.261,0.304,17,237,"2,194",72 22 | 1992,Summer,0.288,0.335,19,257,"2,704",86 23 | 1996,Summer,0.34,0.358,21,271,"3,512",97 24 | 2000,Summer,0.382,0.4,25,300,"4,069",120 25 | 2004,Summer,0.407,0.415,26,301,"4,329",125 26 | 2008,Summer,0.424,0.421,26,302,"4,637",127 27 | 2012,Summer,0.442,0.464,26,302,"4,676",140 28 | 2016,Summer,0.45,0.474,28,306,"5,059",145 29 | 1924,Winter,0.043,0.125,1,16,11,2 30 | 1928,Winter,0.056,0.143,1,14,26,2 31 | 1932,Winter,0.083,0.143,1,14,21,2 32 | 1936,Winter,0.12,0.176,2,17,80,3 33 | 1948,Winter,0.115,0.227,2,22,77,5 34 | 1952,Winter,0.157,0.273,2,22,109,6 35 | 1956,Winter,0.17,0.292,2,24,134,7 36 | 1960,Winter,0.215,0.407,2,27,144,11 37 | 1964,Winter,0.183,0.412,3,34,199,14 38 | 1968,Winter,0.182,0.4,3,35,211,14 39 | 1972,Winter,0.205,0.4,3,35,205,14 40 | 1976,Winter,0.206,0.405,3,37,231,15 41 | 1980,Winter,0.217,0.395,3,38,232,15 42 | 1984,Winter,0.215,0.41,3,39,274,16 43 | 1988,Winter,0.212,0.413,3,46,301,19 44 | 1992,Winter,0.271,0.456,4,57,488,26 45 | 1994,Winter,0.3,0.459,4,61,522,28 46 | 1998,Winter,0.362,0.471,6,68,787,32 47 | 2002,Winter,0.369,0.474,7,78,886,37 48 | 2006,Winter,0.382,0.476,7,84,960,40 49 | 2010,Winter,0.407,0.477,7,86,"1,044",41 50 | 2014,Winter,0.403,0.5,7,98,"1,121",49 51 | 2018,Winter,0.41,0.52,7,102,"1,169",53 -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_files/introduction_of_women_olympic_sports.csv: -------------------------------------------------------------------------------- 1 | year,sport 2 | 1900,tennis 3 | 1900,golf 4 | 1904,archery 5 | 1908,tennis 6 | 1908,skating 7 | 1912,aquatics 8 | 1924,fencing 9 | 1928,athletics 10 | 1928,gymnastics 11 | 1936,skiing 12 | 1948,canoe 13 | 1952,equestrian 14 | 1964,volleyball 15 | 1964,luge 16 | 1976,rowing 17 | 1976,basketball 18 | 1976,handball 19 | 1980,hockey 20 | 1984,shooting 21 | 1984,cycling 22 | 1988,tennis 23 | 1988,table tennis 24 | 1988,sailing 25 | 1992,badminton 26 | 1992,judo 27 | 1992,biathlon 28 | 1996,football 29 | 1996,softball 30 | 1998,curling 31 | 1998,ice hockey 32 | 2000,weightlifting 33 | 2000,modern pentathlon 34 | 2000,taekwondo 35 | 2000,triathlon 36 | 2002,bobsleigh 37 | 2004,wrestling 38 | 2012,boxing 39 | 2016,golf 40 | 2016,rugby 41 | 2018,baseball/softball 42 | 2018,karate 43 | 2018,skateboard 44 | 2018,sports climbing 45 | 2018,surfing -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_notebook/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/quicksight_q_artfacts/clean_data_with_notebook/README.md -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_notebook/main.py: -------------------------------------------------------------------------------- 1 | import pandas 2 | import numpy 3 | import jupyter 4 | 5 | olymic = pandas.read_csv('data/medals_athletes.csv') 6 | olymic.drop('discipline_code') 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_notebook/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/amazon-quicksight-sdk-proserve/bf933b4f06f63fd5873bfd861a7dd4821b886471/quicksight_q_artfacts/clean_data_with_notebook/requirements.txt -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/athletes_full_2021.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `athletes_full_2021`( 2 | `name` string COMMENT 'from deserializer', 3 | `short_name` string COMMENT 'from deserializer', 4 | `gender` string COMMENT 'from deserializer', 5 | `birth_date` string COMMENT 'from deserializer', 6 | `birth_place` string COMMENT 'from deserializer', 7 | `birth_country` string COMMENT 'from deserializer', 8 | `country` string COMMENT 'from deserializer', 9 | `country_code` string COMMENT 'from deserializer', 10 | `discipline` string COMMENT 'from deserializer', 11 | `discipline_code` string COMMENT 'from deserializer', 12 | `residence_place` string COMMENT 'from deserializer', 13 | `residence_country` string COMMENT 'from deserializer', 14 | `height_m/ft` string COMMENT 'from deserializer', 15 | `url` string COMMENT 'from deserializer') 16 | ROW FORMAT SERDE 17 | 'org.apache.hadoop.hive.serde2.OpenCSVSerde' 18 | WITH SERDEPROPERTIES ( 19 | 'quoteChar'='\"', 20 | 'separatorChar'=',') 21 | STORED AS INPUTFORMAT 22 | 'org.apache.hadoop.mapred.TextInputFormat' 23 | OUTPUTFORMAT 24 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 25 | LOCATION 26 | 's3://<>/olympics2021/athletes_full' 27 | TBLPROPERTIES ( 28 | 'areColumnsQuoted'='true', 29 | 'classification'='csv', 30 | 'columnsOrdered'='true', 31 | 'compressionType'='none', 32 | 'delimiter'=',', 33 | 'skip.header.line.count'='1', 34 | 'typeOfData'='file') 35 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/coach_full_2021.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `coach_full_2021`( 2 | `name` string COMMENT 'from deserializer', 3 | `short_name` string COMMENT 'from deserializer', 4 | `gender` string COMMENT 'from deserializer', 5 | `birth_date` string COMMENT 'from deserializer', 6 | `country` string COMMENT 'from deserializer', 7 | `discipline` string COMMENT 'from deserializer', 8 | `function` string COMMENT 'from deserializer', 9 | `event` string COMMENT 'from deserializer', 10 | `url` string COMMENT 'from deserializer') 11 | ROW FORMAT SERDE 12 | 'org.apache.hadoop.hive.serde2.OpenCSVSerde' 13 | WITH SERDEPROPERTIES ( 14 | 'quoteChar'='\"', 15 | 'separatorChar'=',') 16 | STORED AS INPUTFORMAT 17 | 'org.apache.hadoop.mapred.TextInputFormat' 18 | OUTPUTFORMAT 19 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 20 | LOCATION 21 | 's3://<>/olympics2021/coach_full' 22 | TBLPROPERTIES ( 23 | 'areColumnsQuoted'='true', 24 | 'classification'='csv', 25 | 'columnsOrdered'='true', 26 | 'compressionType'='none', 27 | 'delimiter'=',', 28 | 'skip.header.line.count'='1', 29 | 'typeOfData'='file') 30 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/medals_athletes_2021.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `medals_athletes_2021`( 2 | `medal_type` string COMMENT 'from deserializer', 3 | `medal_code` string COMMENT 'from deserializer', 4 | `medal_date` string COMMENT 'from deserializer', 5 | `athlete_short_name` string COMMENT 'from deserializer', 6 | `athlete_name` string COMMENT 'from deserializer', 7 | `athlete_sex` string COMMENT 'from deserializer', 8 | `athlete_link` string COMMENT 'from deserializer', 9 | `country_code` string COMMENT 'from deserializer', 10 | `discipline_code` string COMMENT 'from deserializer', 11 | `event` string COMMENT 'from deserializer', 12 | `country` string COMMENT 'from deserializer', 13 | `discipline` string COMMENT 'from deserializer') 14 | ROW FORMAT SERDE 15 | 'org.apache.hadoop.hive.serde2.OpenCSVSerde' 16 | WITH SERDEPROPERTIES ( 17 | 'quoteChar'='\"', 18 | 'separatorChar'=',') 19 | STORED AS INPUTFORMAT 20 | 'org.apache.hadoop.mapred.TextInputFormat' 21 | OUTPUTFORMAT 22 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 23 | LOCATION 24 | 's3://<>/olympics2021/athelets_medals' 25 | TBLPROPERTIES ( 26 | 'areColumnsQuoted'='true', 27 | 'classification'='csv', 28 | 'columnsOrdered'='true', 29 | 'compressionType'='none', 30 | 'delimiter'=',', 31 | 'skip.header.line.count'='1', 32 | 'typeOfData'='file') 33 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/olympics.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `olympics`( 2 | `id` string COMMENT 'from deserializer', 3 | `name` string COMMENT 'from deserializer', 4 | `sex` string COMMENT 'from deserializer', 5 | `age` string COMMENT 'from deserializer', 6 | `height` string COMMENT 'from deserializer', 7 | `weight` string COMMENT 'from deserializer', 8 | `team` string COMMENT 'from deserializer', 9 | `noc` string COMMENT 'from deserializer', 10 | `games` string COMMENT 'from deserializer', 11 | `year` string COMMENT 'from deserializer', 12 | `season` string COMMENT 'from deserializer', 13 | `city` string COMMENT 'from deserializer', 14 | `sport` string COMMENT 'from deserializer', 15 | `event` string COMMENT 'from deserializer', 16 | `medal` string COMMENT 'from deserializer') 17 | ROW FORMAT SERDE 18 | 'org.apache.hadoop.hive.serde2.OpenCSVSerde' 19 | WITH SERDEPROPERTIES ( 20 | 'quoteChar'='\"', 21 | 'separatorChar'=',') 22 | STORED AS INPUTFORMAT 23 | 'org.apache.hadoop.mapred.TextInputFormat' 24 | OUTPUTFORMAT 25 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 26 | LOCATION 27 | 's3://<>/olympics' 28 | TBLPROPERTIES ( 29 | 'classification'='csv', 30 | 'columnsOrdered'='true', 31 | 'compressionType'='none', 32 | 'delimiter'=',', 33 | 'skip.header.line.count'='1', 34 | 'typeOfData'='file') 35 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/tech_official_2021.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `tech_official_2021`( 2 | `name` string COMMENT 'from deserializer', 3 | `short_name` string COMMENT 'from deserializer', 4 | `gender` string COMMENT 'from deserializer', 5 | `birth_date` string COMMENT 'from deserializer', 6 | `country` string COMMENT 'from deserializer', 7 | `discipline` string COMMENT 'from deserializer', 8 | `function` string COMMENT 'from deserializer', 9 | `url` string COMMENT 'from deserializer') 10 | ROW FORMAT SERDE 11 | 'org.apache.hadoop.hive.serde2.OpenCSVSerde' 12 | WITH SERDEPROPERTIES ( 13 | 'quoteChar'='\"', 14 | 'separatorChar'=',') 15 | STORED AS INPUTFORMAT 16 | 'org.apache.hadoop.mapred.TextInputFormat' 17 | OUTPUTFORMAT 18 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 19 | LOCATION 20 | 's3://<>/olympics2021/tech_official' 21 | TBLPROPERTIES ( 22 | 'areColumnsQuoted'='true', 23 | 'classification'='csv', 24 | 'columnsOrdered'='true', 25 | 'compressionType'='none', 26 | 'delimiter'=',', 27 | 'skip.header.line.count'='1', 28 | 'typeOfData'='file') 29 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/women_in_olympic_movement.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `women_in_olympic_movement`( 2 | `year` string, 3 | `olympics` string, 4 | `percentageofwomenparticipants` decimal(10,0), 5 | `percentageofwomensevents` decimal(10,0), 6 | `sports` string, 7 | `totalevents` bigint, 8 | `womenparticipants` bigint, 9 | `womensevents` int) 10 | ROW FORMAT DELIMITED 11 | FIELDS TERMINATED BY ',' 12 | STORED AS INPUTFORMAT 13 | 'org.apache.hadoop.mapred.TextInputFormat' 14 | OUTPUTFORMAT 15 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 16 | LOCATION 17 | 's3://<>/womeninolympics/Women-in-the-Olympic-Movement' 18 | TBLPROPERTIES ( 19 | 'has_encrypted_data'='false') 20 | -------------------------------------------------------------------------------- /quicksight_q_artfacts/clean_data_with_sql/women_introduction_to_olympics.txt: -------------------------------------------------------------------------------- 1 | CREATE EXTERNAL TABLE `women_introduction_to_olympics`( 2 | `year` string, 3 | `sport` string) 4 | ROW FORMAT DELIMITED 5 | FIELDS TERMINATED BY ',' 6 | STORED AS INPUTFORMAT 7 | 'org.apache.hadoop.mapred.TextInputFormat' 8 | OUTPUTFORMAT 9 | 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 10 | LOCATION 11 | 's3://<>/womeninolympics/introduction_of_women_olympic_sports' 12 | TBLPROPERTIES ( 13 | 'has_encrypted_data'='false') 14 | --------------------------------------------------------------------------------