index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
44,191,906 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_serial_io.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests scenario for the Firecracker serial console."""
import fcntl
import os
import platform
import subprocess
import termios
import time
from framework import utils
from framework.microvm import Serial
... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,907 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_balloon.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for guest-side operations on /balloon resources."""
import logging
import time
import pytest
from retry import retry
from framework.utils import get_free_mem_ssh, run_cmd
STATS_POLLING_INTERVAL_S... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,908 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_block_performance.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Performance benchmark for block device emulation."""
import concurrent
import json
import os
import shutil
from enum import Enum
from pathlib import Path
import pytest
import framework.stats as st
impor... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,909 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_cpu_features_aarch64.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for the CPU features for aarch64."""
import platform
import re
import pytest
import framework.utils_cpuid as cpuid_utils
from framework.utils_cpu_templates import nonci_on_arm
PLATFORM = platform... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,910 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/stats/baseline.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Module for common statistic tests baselines providers."""
from abc import ABC, abstractmethod
from collections import defaultdict
from framework.properties import global_props
from framework.utils import... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,911 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_initrd.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for initrd."""
from framework.microvm import Serial
INITRD_FILESYSTEM = "rootfs"
def test_microvm_initrd_with_serial(uvm_with_initrd):
"""
Test that a boot using initrd successfully loads... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,912 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/utils_imdsv2.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""A simple IMDSv2 client
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
Impo... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,913 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_snapshot_editor.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for snapshot-editor tool."""
import platform
import pytest
import host_tools.cargo_build as host
from framework import utils
PLATFORM = platform.machine()
MIDR_EL1 = hex(0x603000000013C000)
@py... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,914 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_mmds.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that verify MMDS related functionality."""
# pylint: disable=too-many-lines
import random
import string
import time
import pytest
from framework.properties import global_props
from framework.utils... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,915 | firecracker-microvm/firecracker | refs/heads/main | /.buildkite/pipeline_pr.py | #!/usr/bin/env python3
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Generate Buildkite pipelines dynamically"""
from common import (
COMMON_PARSER,
get_changed_files,
group,
overlay_dict,
pipeline_to_json,
run_all_tests,
)
... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,916 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_topology.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for ensuring correctness of CPU and cache topology in the guest."""
import platform
import subprocess
import pytest
import framework.utils_cpuid as utils
TOPOLOGY_STR = {1: "0", 2: "0,1", 16: "0-... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,917 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_error_code.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests scenarios for Firecracker kvm exit handling."""
import platform
import pytest
from framework.utils import wait_process_termination
@pytest.mark.skipif(
platform.machine() != "aarch64",
r... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,918 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/style/test_swagger.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests ensuring codebase style compliance for the OpenAPI specification."""
from pathlib import Path
from openapi_spec_validator import validate_spec
from openapi_spec_validator.readers import read_from_f... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,919 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/defs.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Some common defines used in different modules of the testing framework."""
import platform
from pathlib import Path
# Firecracker's binary name
FC_BINARY_NAME = "firecracker"
# Jailer's binary name
JAIL... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,920 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/gitlint_rules.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""The user defined rules for gitlint."""
from gitlint.rules import CommitRule, RuleViolation
class EndsSigned(CommitRule):
"""Checks commit message body formatting.
Makes sure each commit message... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,921 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/security/test_jail.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that verify the jailer's behavior."""
# pylint: disable=redefined-outer-name
import functools
import http.client as http_client
import os
import resource
import stat
import subprocess
import time
... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,922 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_cpu_features.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for the CPU topology emulation feature."""
# pylint: disable=too-many-lines
import io
import os
import platform
import re
import shutil
import sys
import time
from difflib import unified_diff
from ... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,923 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/build/test_dependencies.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Enforces controls over dependencies."""
import os
import pytest
from host_tools import proc
from host_tools.cargo_build import cargo
pytestmark = pytest.mark.skipif(
"Intel" not in proc.proc_type()... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,924 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/build/test_unittests.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""A test that ensures that all unit tests pass at integration time."""
import platform
import pytest
import host_tools.cargo_build as host # pylint:disable=import-error
MACHINE = platform.machine()
# Cu... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,925 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/state_machine.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Defines a stream based string matcher and a generic state object."""
# Too few public methods (1/2) (too-few-public-methods)
# pylint: disable=R0903
class MatchStaticString:
"""Match a static string ... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,926 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/build/test_binary_size.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that check if the release binary sizes fall within expected size.
This is not representative of the actual memory overhead of Firecracker.
A more representative test is file:../performance/test_mem... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,927 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_uffd.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test UFFD related functionality when resuming from snapshot."""
import os
import re
import stat
from subprocess import TimeoutExpired
import pytest
import requests
from framework.utils import Timeout, U... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,928 | firecracker-microvm/firecracker | refs/heads/main | /tests/host_tools/ip_generator.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# pylint:disable=redefined-outer-name
"""
Each microVM needs to have a unique IP on the host network, or there will be
conflicts.
Helper classes to hand out IPs.
"""
import math
import os
from ipaddress i... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,929 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/microvm.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Classes for working with microVMs.
This module defines `Microvm`, which can be used to create, test drive, and
destroy microvms.
- Use the Firecracker Open API spec to populate Microvm API resource URLs... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,930 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/build/test_clippy.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests ensuring codebase style compliance for Rust and Python."""
import platform
import pytest
from host_tools.cargo_build import cargo
SUCCESS_CODE = 0
MACHINE = platform.machine()
TARGETS = [
"{... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,931 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_api.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that ensure the correctness of the Firecracker API."""
# Disable pylint C0302: Too many lines in module
# pylint: disable=C0302
import os
import platform
import re
import resource
import time
impor... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,932 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/security/test_seccomp.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that the seccomp filters don't let denied syscalls through."""
import json as json_lib
import os
import platform
import tempfile
from framework import utils
from host_tools.cargo_build import run_s... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,933 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/style/test_gitlint.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests ensuring desired style for commit messages."""
import os
from framework import utils
def test_gitlint():
"""
Test that all commit messages pass the gitlint rules.
"""
os.environ["... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,934 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_metrics.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the metrics system."""
import datetime
import math
import platform
def test_flush_metrics(test_microvm_with_api):
"""
Check the `FlushMetrics` vmm action.
"""
microvm = test_microv... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,935 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_memory_overhead.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Track Firecracker memory overhead
Because Firecracker is a static binary, and is copied before execution, no
memory is shared across many different processes. It is thus important to track
how much memor... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,936 | firecracker-microvm/firecracker | refs/heads/main | /tools/gh_release.py | #!/usr/bin/env python3
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Draft a release in GitHub by calling into its API.
Assumes all the releases are in the current path.
"""
import argparse
import re
import subprocess
import tarfile
from pathlib i... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,937 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_cmd_line_parameters.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that ensure the correctness of the command line parameters."""
import platform
from pathlib import Path
import pytest
from framework.utils import run_cmd
from host_tools.cargo_build import get_fir... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,938 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/stats/types.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Module for common types definitions."""
from collections import defaultdict
from dataclasses import dataclass
from typing import List
from .criteria import ComparisonCriteria
from .function import Functi... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,939 | firecracker-microvm/firecracker | refs/heads/main | /tests/host_tools/metrics.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Fixture to send metrics to AWS CloudWatch
We use the aws-embedded-metrics library although it has some sharp corners,
namely:
1. It uses asyncio, which complicates the flushing a bit.
2. It has an stat... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,940 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/style/test_markdown.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for markdown style checks."""
from framework import utils
def test_markdown_style():
"""
Test that markdown files adhere to the style rules.
"""
# Get all *.md files from the proje... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,941 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/stats/producer.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Producer of statistics."""
from abc import ABC, abstractmethod
from typing import Any, Callable
from framework import utils
# pylint: disable=R0903
class Producer(ABC):
"""Base class for raw resul... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,942 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/properties.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# pylint:disable=broad-except
# pylint:disable=too-few-public-methods
"""
Metadata we want to attach to tests for further analysis and troubleshooting
"""
import platform
import re
import subprocess
from p... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,943 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_vsock.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests for the virtio-vsock device.
In order to test the vsock device connection state machine, these tests will:
- Generate a 20MiB random data blob;
- Use `host_tools/vsock_helper.c` to start a listening... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,944 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_snapshot_advanced.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Advanced tests scenarios for snapshot save/restore."""
import platform
import tempfile
import pytest
from test_balloon import _test_rss_memory_lower
import host_tools.drive as drive_tools
from framework... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,945 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/conftest.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Pytest fixtures and redefined-outer-name don't mix well. Disable it.
# pylint:disable=redefined-outer-name
"""Fixtures for performance tests"""
import json
import pytest
from framework import defs, uti... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,946 | firecracker-microvm/firecracker | refs/heads/main | /tests/host_tools/memory.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for measuring memory utilization for a process."""
import time
from queue import Queue
from threading import Lock, Thread
from framework import utils
class MemoryUsageExceededException(Excepti... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,947 | firecracker-microvm/firecracker | refs/heads/main | /tools/parse_baselines/providers/types.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Define data types and abstractions for parsers."""
from abc import ABC, abstractmethod
from collections import defaultdict
from collections.abc import Iterator
from typing import List
# pylint: disable=R... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,948 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_pause_resume.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Basic tests scenarios for snapshot save/restore."""
import pytest
def verify_net_emulation_paused(metrics):
"""Verify net emulation is paused based on provided metrics."""
net_metrics = metrics[... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,949 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_rate_limiter.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that fail if network throughput does not obey rate limits."""
import time
from framework import utils
from host_tools import cpu_load
# The iperf version to run this tests with
IPERF_BINARY = "iper... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,950 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/jailer.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Define a class for creating the jailed context."""
import os
import shutil
import stat
from pathlib import Path
from retry.api import retry_call
from framework import defs, utils
from framework.defs imp... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,951 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/stats/consumer.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Module for multiple statistics consumers."""
from abc import ABC, abstractmethod
from collections import defaultdict
from numbers import Number
from typing import Any, Callable
from framework.utils impo... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,952 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/style/test_rust.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests ensuring codebase style compliance for Rust."""
import subprocess
from framework import utils
def test_rust_order():
"""
Tests that `Cargo.toml` dependencies are alphabetically ordered.
... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,953 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/security/test_vulnerabilities.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# N.B.: Although this repository is released under the Apache-2.0, part of its test requires a
# script from the third party "Spectre & Meltdown Checker" project. This script is under the
# GPL-3.0-only lic... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,954 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_max_devices.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests scenario for adding the maximum number of devices to a microVM."""
import platform
import pytest
# IRQs are available from 5 to 23, so the maximum number of devices
# supported at the same time is... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,955 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_signals.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests scenarios for Firecracker signal handling."""
import json
import os
import resource as res
from signal import SIGBUS, SIGHUP, SIGILL, SIGPIPE, SIGSEGV, SIGSYS, SIGXCPU, SIGXFSZ
from time import slee... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,956 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/security/test_sec_audit.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests ensuring security vulnerabilities are not present in dependencies."""
import pytest
from framework import defs
from framework.utils_cpuid import CpuVendor, get_cpu_vendor
from host_tools.cargo_bui... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,957 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/configs/defs.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Module with definitions relevant for performance tests configs usage."""
from pathlib import Path
CFG_LOCATION = Path(__file__).parent.resolve()
| {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,958 | firecracker-microvm/firecracker | refs/heads/main | /.buildkite/pipeline_perf.py | #!/usr/bin/env python3
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Generate Buildkite performance pipelines dynamically"""
from common import COMMON_PARSER, group, overlay_dict, pipeline_to_json
perf_test = {
"block": {
"label": "🖴 B... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,959 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_benchmarks.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Optional benchmarks-do-not-regress test"""
import json
import logging
import os
import platform
import pytest
from framework import utils
from host_tools.cargo_build import cargo
TARGET_BRANCH = os.env... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,960 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/style/test_python.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests ensuring codebase style compliance for Python."""
import sys
from subprocess import run
import pytest
@pytest.mark.parametrize("formatter", ["black", "isort"])
def test_python_style(formatter):
... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,961 | firecracker-microvm/firecracker | refs/heads/main | /.buildkite/pipeline_cross.py | #!/usr/bin/env python3
# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Generate Buildkite Cross Snapshot/Restore pipelines dynamically
1. Generate snapshots for each instance and kernel version
2. wait
3. Restore snapshots across instances and kernels... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,962 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_snapshot_perf.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Basic tests scenarios for snapshot save/restore."""
import platform
import pytest
from framework.artifacts import kernel_params
from framework.properties import global_props
from framework.stats import ... | {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,191,963 | firecracker-microvm/firecracker | refs/heads/main | /tools/compare_baselines/utils/__init__.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for comparing performance baselines"""
from . import comparator, defs, fetcher
| {"/tests/framework/stats/core.py": ["/tests/framework/stats/consumer.py", "/tests/framework/stats/producer.py"], "/tests/framework/stats/metadata.py": ["/tests/framework/stats/baseline.py", "/tests/framework/stats/criteria.py", "/tests/framework/stats/function.py", "/tests/framework/stats/types.py"], "/tests/framework/... |
44,219,771 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /api/urls.py | from api import views
from rest_framework import routers
from django.urls import path
from django.conf.urls import include
from rest_framework.authtoken.views import obtain_auth_token
router = routers.DefaultRouter()
router.register(r'users', views.UserViewset)
router.register(r'products', views.ProductViewset)
router... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,219,772 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /ecommerce/models.py | import requests
import numpy as np
from enum import unique
from django.db import models
from django.core.validators import MinValueValidator
from django.db.models.fields import AutoField
# Create your models here.
class Product(models.Model):
id = models.CharField(max_length=30, verbose_name="Product ID", unique... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,219,773 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /ecommerce/admin.py | from django.contrib import admin
from .models import *
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
search_filds = ('id', 'name')
@admin.register(Order)
class OrderAdmin(admin.ModelAdmin):
search_filds = ('id',)
@admin.register(OrderDetail)
class OrderDetailAdmin(admin.ModelAdmin):
s... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,219,774 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /api/serializers.py | from rest_framework import serializers
from rest_framework.authtoken.models import Token
from ecommerce.models import Product, Order, OrderDetail
from django.contrib.auth.models import User
class UserSerialiazers(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id', 'user... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,219,775 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /api/views.py | from ecommerce.models import Product, Order
from .serializers import *
from django.contrib.auth.models import User
from rest_framework import viewsets, status
from rest_framework.response import Response
from rest_framework.decorators import action
class UserViewset(viewsets.ModelViewSet):
queryset = User.objects.... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,219,776 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /ecommerce/migrations/0002_auto_20211104_1610.py | # Generated by Django 3.1.7 on 2021-11-04 19:10
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecommerce', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='orderdetail',
... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,219,777 | AbelMRobra/EcoomerceChallenge | refs/heads/main | /ecommerce/migrations/0001_initial.py | # Generated by Django 3.1.7 on 2021-11-04 18:17
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Order',
... | {"/api/serializers.py": ["/ecommerce/models.py"], "/ecommerce/admin.py": ["/ecommerce/models.py"], "/api/views.py": ["/ecommerce/models.py", "/api/serializers.py"]} |
44,360,120 | lyf7115/Winglets | refs/heads/main | /testAPI.py | import Winglets
import json
## Prepare Data
dataDict = {}
dataArray = []
f = open('./testFile.json', 'r')
dataDict = json.loads(f.read())
for curKey in dataDict['dots'].keys():
curArrDictData = dataDict['dots'][curKey]
curKeyArr = []
for i in range(len(curArrDictData)):
curKeyArr.append([curArrDi... | {"/build/lib/Winglets/__init__.py": ["/build/lib/Winglets/handler/handler_all.py"]} |
44,360,121 | lyf7115/Winglets | refs/heads/main | /build/lib/Winglets/handler/handler_all.py | # from handler.mongohandler import MONGODBHANDLER
# from handler.kdehandler import KDEHandler
# from handler.wingletstephandler import WingletsStepHandler
# from handler.drawhandler import DrawAllHandler
from .kdehandler import KDEHandler
from .wingletstephandler import WingletsStepHandler
from .drawhandler import Draw... | {"/build/lib/Winglets/__init__.py": ["/build/lib/Winglets/handler/handler_all.py"]} |
44,360,122 | lyf7115/Winglets | refs/heads/main | /build/lib/Winglets/__init__.py | import tornado.ioloop
import tornado.options
import tornado.httpserver
import tornado.web
from tornado.options import options, define
import os
# import sys
# sys.path.insert(0, './')
from .handler.handler_all import *
# from handler import handler_all as AllHandler
# from .handler.handler_all import OperationHandl... | {"/build/lib/Winglets/__init__.py": ["/build/lib/Winglets/handler/handler_all.py"]} |
44,401,686 | Denvernoell/excel_helper | refs/heads/master | /streamlit_helper.py | import streamlit as st
import pyperclip
import xlwings as xw
from pathlib import Path
# app = xw.App(visible=False, add_book=False)
app = xw.apps.active
wb = app.books.active
sht = wb.sheets.active
rng = wb.selection
ps = sht.api.PageSetup
file_path = Path(wb.fullname)
folder_path = file_path.parent
workbook_name =... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,687 | Denvernoell/excel_helper | refs/heads/master | /borders.py | def borderer(rng, thickness='thick', placement='all', color='Black'):
"""Adds border to selection"""
if thickness == 'thin':
weight = 2
if thickness == 'thick':
weight = 3
# 7 through 13 == xlEdgeTop,xlEdgeBottom,xlEdgeRight,xlEdgeLeft,xlInsideHorizontal,xlInsideVertical
borders = ... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,688 | Denvernoell/excel_helper | refs/heads/master | /sizing.py | # import xlwings as xw
# wb = xw.books.active
# sht = wb.sheets.active
# rng = wb.selection
def display_height(rng):
"""Displays row height of each cell in selection."""
for row in rng.rows:
if row.api.EntireRow.Hidden == False:
row.value = row.row_height
def set_height(rng):
"""Sets... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,689 | Denvernoell/excel_helper | refs/heads/master | /tables.py | def table_highligher(rng):
"""Highlights each other row in selection if the row is not hidden in light blue"""
from itertools import cycle
mycolor = cycle([None, (231, 238, 245)])
for row in rng.rows:
if row.api.EntireRow.Hidden == False:
row.color = next(mycolor)
def table_grey_l... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,690 | Denvernoell/excel_helper | refs/heads/master | /colors.py | from math import floor
akel_colors = {
"Yellow1": (255, 255, 204),
"Orange1": (253, 233, 217),
"Blue1": (79, 129, 189),
"Red1": (192, 80, 77),
"Grey1": (217, 217, 217),
"Grey2": (128, 128, 128),
"Grey3": (191, 191, 191),
"DarkGreen": (0, 176, 80),
"Purple": (112, 48, 160),
"Bla... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,691 | Denvernoell/excel_helper | refs/heads/master | /pdfing.py | # from PyPDF2 import PdfFileReader, PdfFileWriter
# from pathlib import Path
# import os
# import pyperclip
def create_room(file_path):
"""Takes file path and moves it to OldPdfs in order to create room to make another file with the same name"""
p = Path(file_path)
try:
os.makedirs(Path(f"{p.pare... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,692 | Denvernoell/excel_helper | refs/heads/master | /print_settings.py | # import pyperclip
# import xlwings as xw
# from pathlib import Path
# app = xw.apps.active
# wb = app.books.active
# sht = wb.sheets.active
# rng = wb.selection
# ps = sht.api.PageSetup
# PrintType = "Table"
# PrintType = "Figure"
def InchesToPoints(inches):
return inches * 72.0
def margins(ps, PrintType):... | {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,401,693 | Denvernoell/excel_helper | refs/heads/master | /total_review.py | import xlwings as xw
wb = xw.books.active
sht_names = [s for s in wb.sheets]
| {"/streamlit_helper.py": ["/pdfing.py", "/print_settings.py", "/sizing.py", "/tables.py", "/borders.py", "/colors.py"], "/borders.py": ["/colors.py"], "/tables.py": ["/borders.py"], "/pdfing.py": ["/colors.py"]} |
44,444,160 | poudyalsraj/pis | refs/heads/main | /views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy, reverse
from django.contrib.messages.views import SuccessMessageMixin
from .models... | {"/views.py": ["/models.py"], "/admin.py": ["/models.py"], "/forms.py": ["/models.py"]} |
44,444,161 | poudyalsraj/pis | refs/heads/main | /admin.py | from django.contrib import admin
from django.contrib import admin
from .models import Staff, Office,Darbandi, Post, Address, Family, Appointment, DesiredPerson, Service, EducationalInfo, LeaveInfo, PunishmentInfo, Treatment
@admin.register(Staff, Office,Darbandi, Post, Address, Family, Appointment, DesiredPerson,... | {"/views.py": ["/models.py"], "/admin.py": ["/models.py"], "/forms.py": ["/models.py"]} |
44,444,162 | poudyalsraj/pis | refs/heads/main | /urls.py | from django.conf.urls import url,include
from django.urls import path
from . import views
from django.views.generic.base import TemplateView
from django.contrib.auth import views as auth_views
# views as auth_views
# app_name = 'office_pis'
urlpatterns =[
path(r'staff/', views.StaffCreateView.as_view(... | {"/views.py": ["/models.py"], "/admin.py": ["/models.py"], "/forms.py": ["/models.py"]} |
44,444,163 | poudyalsraj/pis | refs/heads/main | /forms.py | from django import forms
from .models import Staff
# not needed
class Staff_form(forms.ModelForm):
class meta:
model=Blogpost
fields= ['name','address', 'position', 'post'] | {"/views.py": ["/models.py"], "/admin.py": ["/models.py"], "/forms.py": ["/models.py"]} |
44,444,164 | poudyalsraj/pis | refs/heads/main | /models.py | from __future__ import unicode_literals
from django.db import models
from django.core.files.storage import FileSystemStorage
from datetime import datetime
from django.utils import timezone
per_nonper_choices= (
('permanent','permanent'),
('non_permanent', 'non_permanent')
)
# main PIS database is here.... """... | {"/views.py": ["/models.py"], "/admin.py": ["/models.py"], "/forms.py": ["/models.py"]} |
44,444,165 | poudyalsraj/pis | refs/heads/main | /apps.py | from django.apps import AppConfig
class OfficePisConfig(AppConfig):
name = 'OFFICE_PIS'
| {"/views.py": ["/models.py"], "/admin.py": ["/models.py"], "/forms.py": ["/models.py"]} |
44,540,490 | risabhRizz/goodwill-barter | refs/heads/master | /products/models.py | from django.db import models
from django.contrib.auth.models import User
class Product(models.Model):
product_id = models.CharField(max_length=100)
username = models.ForeignKey(User, on_delete=models.CASCADE)
photo_id = models.CharField(max_length=64)
available = models.BooleanField()
description ... | {"/users/views.py": ["/users/models.py", "/products/models.py"], "/products/urls.py": ["/products/views.py"], "/users/models.py": ["/products/models.py"], "/products/views.py": ["/products/models.py"]} |
44,540,491 | risabhRizz/goodwill-barter | refs/heads/master | /products/views.py | from django.shortcuts import render
def home(request):
context = {
'goods': ['Harry Potter and the Sorcerer\'s Stone', 'Silence of the lambs'],
}
return render(request, 'products/home.html', context)
| {"/users/views.py": ["/users/models.py", "/products/models.py"], "/products/urls.py": ["/products/views.py"], "/users/models.py": ["/products/models.py"], "/products/views.py": ["/products/models.py"]} |
44,623,829 | gabrielDonnantuoni/Discord-Music-Bot | refs/heads/master | /main.py | print('rodou') | {"/playground.py": ["/ytdl/YTDLSource.py", "/bot/Queue.py", "/database/main.py"], "/bot/Player.py": ["/ytdl/YTDLSource.py", "/ytdl/TTS.py", "/bot/Queue.py", "/database/main.py"], "/bot/Queue.py": ["/ytdl/YTDLSource.py"], "/ytdl/YTDLSource.py": ["/ytdl/config.py", "/env.py"], "/main.py": ["/flask_app.py", "/bot/main.py"... |
44,638,457 | kailin-lu/BreadLog | refs/heads/main | /breadlog/users/routes.py | from flask import Blueprint, request, redirect, url_for, render_template
from flask_login import current_user, login_user, logout_user
from breadlog.users.forms import RegisterForm, LoginForm
from breadlog.models import User
from breadlog.extensions import bcrypt, db
users = Blueprint('users', __name__)
@users.route... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,458 | kailin-lu/BreadLog | refs/heads/main | /breadlog/__init__.py | from flask import Flask
from breadlog.config import Config
from .extensions import db, login_manager, bcrypt
from .commands import create_tables, seed_db
def create_app(config=Config):
app = Flask(__name__)
app.config.from_object(config)
db.init_app(app)
login_manager.init_app(app)
login_... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,459 | kailin-lu/BreadLog | refs/heads/main | /breadlog/recipes/routes.py | from flask import render_template, url_for, request, redirect, jsonify, make_response, Blueprint
from flask_login import current_user
from breadlog.models import Recipe, Step, User, StepIngredient
from breadlog.recipes.forms import RecipeForm
from breadlog.recipes.utils import make_err_response, sum_recipe_ingredients
... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,460 | kailin-lu/BreadLog | refs/heads/main | /breadlog/commands.py | import click
from flask.cli import with_appcontext
from .extensions import db, bcrypt
from .models import User, Recipe, Step, StepIngredient
@click.command(name='create_tables')
@with_appcontext
def create_tables():
db.create_all()
@click.command(name='seed_db')
@with_appcontext
def seed_db():
... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,461 | kailin-lu/BreadLog | refs/heads/main | /breadlog/recipes/forms.py | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length
class RecipeForm(FlaskForm):
recipe_name = StringField('New Recipe',
render_kw={"placeholder": "Recipe name"},
validators=... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,462 | kailin-lu/BreadLog | refs/heads/main | /breadlog/users/forms.py | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField
from wtforms.validators import DataRequired, EqualTo
class LoginForm(FlaskForm):
email = StringField('Email', validators=[DataRequired(message='Email is required')])
password = PasswordField('Password', validators=[... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,463 | kailin-lu/BreadLog | refs/heads/main | /breadlog/about/routes.py | from flask import render_template, Blueprint
about = Blueprint('about', __name__)
@about.route('/', methods=['GET', 'POST'])
def index():
return render_template('index.html')
| {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,464 | kailin-lu/BreadLog | refs/heads/main | /breadlog/models.py | from datetime import datetime
from sqlalchemy.dialects.postgresql.base import UUID
from .extensions import db, login_manager
from flask_login import UserMixin
from dataclasses import dataclass
import uuid
db.UUID = UUID
@login_manager.user_loader
def load_user(user_id):
return User.query.get(user_id)
@dataclas... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,638,465 | kailin-lu/BreadLog | refs/heads/main | /breadlog/recipes/utils.py | from flask import make_response, jsonify
from collections import defaultdict
from sqlalchemy.exc import SQLAlchemyError
def make_err_response(e):
"""Helper to return error type and route parameters"""
err = {
'orig': str(e.orig),
'params': str(e.params)
}
return make_res... | {"/breadlog/routes.py": ["/breadlog/__init__.py", "/breadlog/models.py", "/breadlog/forms.py"], "/breadlog/models.py": ["/breadlog/__init__.py"], "/breadlog/users/routes.py": ["/breadlog/users/forms.py", "/breadlog/models.py"], "/breadlog/__init__.py": ["/breadlog/commands.py", "/breadlog/users/routes.py", "/breadlog/r... |
44,713,836 | chetangartoula/farmersnepal | refs/heads/master | /blog/models.py | from django.db import models
# Create your models here.
class Blog(models.Model):
title = models.CharField(max_length=500,null=True)
discription = models.TextField(max_length=2000, null=True)
post_date =models.DateField(auto_now_add=True,null=True)
def __str__(self):
return self.title
class Comment... | {"/farmers/admin.py": ["/farmers/models.py"], "/farmers/forms.py": ["/farmers/models.py"], "/farmers/views.py": ["/farmers/models.py", "/farmers/forms.py"]} |
44,713,837 | chetangartoula/farmersnepal | refs/heads/master | /market/models.py | from django.db import models
from phone_field import PhoneField
from django.contrib.auth.models import User
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=250, null=True, unique=True)
def __str__(self):
return self.name
class Vendor(models.Model):
u... | {"/farmers/admin.py": ["/farmers/models.py"], "/farmers/forms.py": ["/farmers/models.py"], "/farmers/views.py": ["/farmers/models.py", "/farmers/forms.py"]} |
44,720,334 | jameskennelly4/cwruclasses-ratemyprofessor-website | refs/heads/main | /models.py | from django.db import models
import csv
class Class(models.Model):
title = models.CharField(max_length=50)
name = models.CharField(max_length=50)
description = models.CharField(max_length=100000)
class Professor(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField... | {"/mysite/myapp/views.py": ["/mysite/myapp/models.py"]} |
44,729,239 | HobbesE/Study-Buddy-Finder | refs/heads/main | /seed_database.py | """Script to seed Study Buddy database."""
import os
from random import choice, randint
#from datetime import datetime
import crud
import model
import server
os.system('dropdb hackbrighter')
os.system('createdb hackbrighter')
model.connect_to_db(server.app)
model.db.create_all()
student_data= [
{
"us... | {"/seed_database.py": ["/crud.py", "/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/crud.py": ["/model.py"]} |
44,729,240 | HobbesE/Study-Buddy-Finder | refs/heads/main | /model.py | """Models for Study Buddy Finder app"""
from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin, LoginManager, login_user, login_required
import datetime
db = SQLAlchemy()
def connect_to_db(flask_app, db_uri='postgresql:///hackbrighter', echo=True):
flask_app.config['SQLALCHEMY_DATABASE_URI'] =... | {"/seed_database.py": ["/crud.py", "/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/crud.py": ["/model.py"]} |
44,729,241 | HobbesE/Study-Buddy-Finder | refs/heads/main | /server.py | """Server for Study Buddy Finder app."""
import requests
import json
from flask_sqlalchemy import SQLAlchemy
from flask import Flask, render_template, redirect, request, session, flash
from flask_login import LoginManager, login_user, login_required, logout_user
from model import Student, Attendence, StudySession, co... | {"/seed_database.py": ["/crud.py", "/model.py", "/server.py"], "/server.py": ["/model.py", "/crud.py"], "/crud.py": ["/model.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.