index int64 | repo_name string | branch_name string | path string | content string | import_graph string |
|---|---|---|---|---|---|
80,134 | firecracker-microvm/firecracker | refs/heads/main | /tests/host_tools/logging.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for testing the logging system (metrics, common logs)."""
import fcntl
import os
class Fifo:
"""Facility for creating and working with named pipes (FIFOs)."""
path = None
fifo = N... | {"/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/... |
80,135 | 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."""
from framework import utils
def test_python_style():
"""
Test that python code passes style checks.
@type: style
"""
# Runs c... | {"/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/... |
80,136 | 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."""
import os
import platform
import pytest
import host_tools.cargo_build as host
MACHINE = platform.machine()
""" Platform defini... | {"/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/... |
80,137 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_network_tcp_throughput.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the network throughput of Firecracker uVMs."""
import concurrent.futures
import json
import os
import time
import pytest
from framework.artifacts import DEFAULT_HOST_IP
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/... |
80,138 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/utils.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utility abstractions for performance tests."""
def handle_failure(file_dumper, fail_err):
"""Handle `statistics.core.CoreException` raised during...
...`statistics.core.Core`s `run_exercise`.
... | {"/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/... |
80,139 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_snapshot_restore_cross_kernel.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test to restore snapshots across kernel versions."""
import json
import logging
import os
import pathlib
import re
import shutil
import pytest
from framework.artifacts import (
Artifact,
Artifact... | {"/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/... |
80,140 | 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 logging
import platform
import tempfile
import pytest
from test_balloon import _test_rss_memory_lower
import host_tools.drive as drive_tools... | {"/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/... |
80,141 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/build/test_coverage.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests enforcing code coverage for production code."""
import pytest
from framework import utils
from host_tools import proc
# We have different coverages based on the host kernel version. This is
# cau... | {"/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/... |
80,142 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/matrix.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Generate multiple microvm configurations and run tests.
Implements a component that calls a specific function in the context
of the cartesian product of all artifact sets.
"""
import os
import sys
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/... |
80,143 | 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 json
import logging
import os
import platform
import pytest
import host_tools.logging as log_tools
from framework.artifacts import ArtifactColl... | {"/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/... |
80,144 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/utils_cpu_templates.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for CPU template related functionality."""
import framework.utils_cpuid as cpuid_utils
# All existing CPU templates available on Intel
INTEL_TEMPLATES = ["C3", "T2", "T2CL", "T2S"]
# All exist... | {"/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/... |
80,145 | 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 os
from pathlib import Path
# URL prefix used for the API calls through a UNIX domain socket
API_USOCKET_URL_PREFIX = "ht... | {"/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/... |
80,146 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_max_vcpus.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests scenario for microvms with max vcpus(32)."""
MAX_VCPUS = 32
def test_max_vcpus(test_microvm_with_api, network_config):
"""
Test if all configured guest vcpus are online.
@type: 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/... |
80,147 | 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."""
from framework import utils
def test_rust_style():
"""
Test that rust code passes style checks.
@type: style
"""
# ../src/io_... | {"/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/... |
80,148 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/decorators.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Module for declaring decorators used throughout integration tests."""
import time
from framework.defs import MAX_API_CALL_DURATION_MS
def timed_request(method):
"""Decorate functions to monitor the... | {"/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/... |
80,149 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/functional/test_concurrency.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Ensure multiple microVMs work correctly when spawned simultaneously."""
NO_OF_MICROVMS = 20
def test_run_concurrency(microvm_factory, network_config, guest_kernel, rootfs):
"""
Check we can spaw... | {"/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/... |
80,150 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_boottime.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that ensure the boot time to init process is within spec."""
import platform
import re
from framework.properties import global_props
from framework.utils_cpuid import get_cpu_model_name, get_instan... | {"/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/... |
80,151 | 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 framework import utils
SUCCESS_CODE = 0
MACHINE = platform.machine()
TARGETS = [
"{}-unknown-lin... | {"/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/... |
80,152 | 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
import yaml
from openapi_spec_validator import validate_spec
from openapi_spec_validator.readers 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/... |
80,153 | firecracker-microvm/firecracker | refs/heads/main | /tools/create_snapshot_artifact/main.py | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Script used to generate snapshots of microVMs."""
import json
import os
import re
import shutil
import sys
import tempfile
from functools import partial
# Hack to be able to import testing framework func... | {"/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/... |
80,154 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_snapshot_restore_performance.py | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Performance benchmark for snapshot restore."""
import json
import logging
import os
import tempfile
import pytest
import framework.stats as st
import host_tools.drive as drive_tools
from framework.artif... | {"/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/... |
80,155 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/s3fetcher.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Define a class for interacting with microvm images in s3."""
import os
import platform
import re
from pathlib import Path
from shutil import copyfile
from typing import List
import boto3
import botocore.... | {"/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/... |
80,156 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/builder.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Define some helpers methods to create microvms from artifacts."""
import json
import os
import shutil
import tempfile
from pathlib import Path
import host_tools.logging as log_tools
from framework 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/... |
80,157 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/security/test_spectre_meltdown.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/... |
80,158 | 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.
# TODO
- Use the Firecracker Open API spec to populate Microvm API resour... | {"/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/... |
80,159 | 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 json
import os
import platform
from ast import literal_eval
import pytest
import framework.utils_cpuid as utils
TOPOLOGY... | {"/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/... |
80,160 | firecracker-microvm/firecracker | refs/heads/main | /.buildkite/common.py | # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Common helpers to create Buildkite pipelines
"""
import json
DEFAULT_INSTANCES = [
"m5d.metal",
"m6i.metal",
"m6a.metal",
"m6g.metal",
"c7g.metal",
]
DEFAULT_PLATFORMS = [("al2", "... | {"/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/... |
80,161 | 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 framework.utils import DictQuery
# pylint: disable=R0903
class Provider(ABC):
"""Baselines provide... | {"/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/... |
80,162 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/http.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Wrapper over an http session with timed requests."""
# pylint: disable=unused-import
import requests
from requests_unixsocket import DEFAULT_SCHEME, UnixAdapter
from framework import decorators
class Se... | {"/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/... |
80,163 | 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 logging
import platform
from pathlib import Path
import host_tools.logging as log_tools
from framework.builder import MicrovmBu... | {"/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/... |
80,164 | firecracker-microvm/firecracker | refs/heads/main | /tests/integration_tests/performance/test_versioned_serialization_benchmark.py | # Copyright 2020 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 json
import logging
import os
import platform
import shutil
from pathlib import Path
import pytest
from framework import 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/... |
80,165 | firecracker-microvm/firecracker | refs/heads/main | /tests/conftest.py | # Copyright 2018 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
# We import some fixtures that are unused. Disable that too.
# pylint:disable=unused-import
"""Im... | {"/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/... |
80,166 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/artifacts.py | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Define classes for interacting with CI artifacts in s3."""
import functools
import os
import platform
import tempfile
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
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/... |
80,167 | firecracker-microvm/firecracker | refs/heads/main | /tests/framework/resources.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Defines classes for all the resources a microvm could need attaching."""
import re
import urllib
from framework.defs import API_USOCKET_URL_PREFIX
from framework.utils import compare_versions, run_cmd
... | {"/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/... |
80,168 | 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 ast
import os
import pytest
from framework import utils
from host_tools import proc
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/... |
80,169 | firecracker-microvm/firecracker | refs/heads/main | /tools/parse_baselines/main.py | #!/bin/env python3
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Script used to calculate baselines from raw performance test output."""
# We need to call sys.path.append(os.path.join(os.getcwd(), 'tests'))
# before importing SUPPORTED_KERNELS. But t... | {"/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/... |
80,170 | firecracker-microvm/firecracker | refs/heads/main | /tests/host_tools/cargo_build.py | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Functionality for a shared binary build and release path for all tests."""
import os
import platform
from pathlib import Path
from framework import defs, utils
from framework.defs import (
FC_BINARY_... | {"/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/... |
80,173 | elemarez/django-pyday2017 | refs/heads/master | /events/migrations/0006_auto_20170309_1648.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-09 16:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0005_auto_20170309_1616'),
]
operations = [
migrations.AddField(
... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,174 | elemarez/django-pyday2017 | refs/heads/master | /events/migrations/0004_auto_20170309_1607.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-09 16:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('events', '0003_auto_20170309_1338'),
]
operations ... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,175 | elemarez/django-pyday2017 | refs/heads/master | /events/migrations/0005_auto_20170309_1616.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-09 16:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0004_auto_20170309_1607'),
]
operations = [
migrations.AlterModelOptions(... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,176 | elemarez/django-pyday2017 | refs/heads/master | /events/admin.py | from django.contrib import admin
from .models import Evento, Inscripcion
# Modelo inscripción preparado para incorporar dentro de otro modelo en el admin
# Puede ser incorporado en modo TabularInline o StackedInline
class InscripcionInline(admin.TabularInline):
# Modelo del que depende
model = Inscripcion
... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,177 | elemarez/django-pyday2017 | refs/heads/master | /events/forms.py | from .models import Inscripcion
from django.forms import ModelForm
class InscripcionCreateForm(ModelForm):
class Meta:
model = Inscripcion
fields = ('nombre_apellidos', 'nif', )
| {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,178 | elemarez/django-pyday2017 | refs/heads/master | /events/urls.py | from django.conf.urls import url
from . import views
# Espacio de nombres que será utilizado para identificar las urls que están definidas en este fichero.
# La identificación es app_name:name, por ejemplo usando events:index
app_name = 'events'
urlpatterns = [
# Listado de eventos públicos (ListView)
url(r'^... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,179 | elemarez/django-pyday2017 | refs/heads/master | /events/models.py | # Definición de la estructura de las tablas en la BBDD
from django.db import models
from django.utils import timezone
from django.urls import reverse
class Evento(models.Model):
nombre = models.CharField(max_length=200, verbose_name='Título')
descripcion = models.TextField(blank=True, null=True)
fecha = mo... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,180 | elemarez/django-pyday2017 | refs/heads/master | /events/migrations/0007_evento_maximo_inscripcion.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-09 19:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0006_auto_20170309_1648'),
]
operations = [
migrations.AddField(
... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,181 | elemarez/django-pyday2017 | refs/heads/master | /events/views.py | from django.views import generic
from .forms import InscripcionCreateForm
from .models import Evento, Inscripcion
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Button
from django.shortcuts import get_object_or_404
# Create your views here.
class IndexView(generic.ListView):
# ... | {"/events/admin.py": ["/events/models.py"], "/events/forms.py": ["/events/models.py"], "/events/views.py": ["/events/forms.py", "/events/models.py"]} |
80,187 | pedrom505/AlbionAnalytics | refs/heads/develop | /Configuration/__init__.py | import configparser
import logging
import Errors
import os
class Config:
"""
This class uses the singletone design patters and your goal is provide some methods to access and edit the
configuration file of application
"""
_instance = None
def __init__(self, file_location: str = "setup.ini"):
... | {"/Configuration/__init__.py": ["/Errors.py"], "/AlbionOnlineData/__init__.py": ["/AlbionOnlineData/Items.py", "/Errors.py"], "/AlbionOnlineData/Items.py": ["/Errors.py"]} |
80,188 | pedrom505/AlbionAnalytics | refs/heads/develop | /main.py | import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - thread: %(thread)-7s - %(name)-28s - %(levelname)-8s - %(message)s',
filename="application.log")
| {"/Configuration/__init__.py": ["/Errors.py"], "/AlbionOnlineData/__init__.py": ["/AlbionOnlineData/Items.py", "/Errors.py"], "/AlbionOnlineData/Items.py": ["/Errors.py"]} |
80,189 | pedrom505/AlbionAnalytics | refs/heads/develop | /AlbionOnlineData/__init__.py | from AlbionOnlineData.Items import Items
import requests
from datetime import datetime
from datetime import timedelta
import Errors
class MarketData:
albion_API_URL = "https://www.albion-online-data.com/api/v2/stats/charts"
def __init__(self, location: str = ""):
today = datetime.today()
self... | {"/Configuration/__init__.py": ["/Errors.py"], "/AlbionOnlineData/__init__.py": ["/AlbionOnlineData/Items.py", "/Errors.py"], "/AlbionOnlineData/Items.py": ["/Errors.py"]} |
80,190 | pedrom505/AlbionAnalytics | refs/heads/develop | /Errors.py | import logging
class ApplicationError(Exception):
"""
Generic exception class used by every exceptions implemented
"""
def __init__(self, *args):
self.logger = logging.getLogger(__name__)
if args:
self.message = args[0]
else:
self.message = None
def... | {"/Configuration/__init__.py": ["/Errors.py"], "/AlbionOnlineData/__init__.py": ["/AlbionOnlineData/Items.py", "/Errors.py"], "/AlbionOnlineData/Items.py": ["/Errors.py"]} |
80,191 | pedrom505/AlbionAnalytics | refs/heads/develop | /AlbionOnlineData/Items.py | import os
from typing import IO
import Errors
class Items:
items = dict({"items": []})
def __init__(self):
root_path = os.getcwd()
items_template_path = os.path.join(root_path, "AlbionOnlineData", "Templates", "Items.txt")
fd = open(items_template_path)
self._load_file(fd)
... | {"/Configuration/__init__.py": ["/Errors.py"], "/AlbionOnlineData/__init__.py": ["/AlbionOnlineData/Items.py", "/Errors.py"], "/AlbionOnlineData/Items.py": ["/Errors.py"]} |
80,198 | casimir/kwax | refs/heads/master | /kakoune.py | import collections
import queue
import shutil
import subprocess
from threading import Thread
import jsonrpc
class Kakoune(object):
_rpc_next_id = 1
def __init__(self, bin=None, session=None, files=None):
self.bin = bin or shutil.which("kak") or "/usr/local/bin/kak"
self.session = session
... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,199 | casimir/kwax | refs/heads/master | /main.py | import argparse
import sys
import wx
from client_frame import Client
from kakoune import Kakoune
class SessionChooser(wx.SingleChoiceDialog):
def __init__(self, kak_bin=None):
self.sessions = Kakoune(kak_bin).list_sessions()
super(SessionChooser, self).__init__(
None, "Choose a sess... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,200 | casimir/kwax | refs/heads/master | /message_handler.py | import wx
def face_to_style(face, default=None):
if not default:
return wx.TextAttr(face['fg'], face['bg'])
attr = wx.TextAttr(default)
if face['fg'] != "default":
attr.TextColour = face['fg']
if face['bg'] != "default":
attr.BackgroundColour = face['bg']
return attr
clas... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,201 | casimir/kwax | refs/heads/master | /jsonrpc.py | import json
class Request(object):
def __init__(self, id_, method, params):
self.id = id_
self.method = method
self.params = params
def to_dict(self):
message = {
'jsonrpc': "2.0",
'id': self.id,
'method': self.method,
}
if ... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,202 | casimir/kwax | refs/heads/master | /client_frame.py | import wx
from faced_text import FacedStaticText
from kakoune import Kakoune
from message_handler import MessageHandler
wx_to_kakoune_keys = {
wx.WXK_RETURN: "<ret>",
wx.WXK_SPACE: "<space>",
wx.WXK_TAB: "<tab>",
ord("<"): "<lt>",
ord(">"): "<gt>",
wx.WXK_BACK: "<backspace>",
wx.WXK_ESCAPE... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,203 | casimir/kwax | refs/heads/master | /faced_text.py | import wx
class DrawContext(object):
def __init__(self, lines=None, default_face=None, padding_face=None):
self.lines = lines
self.default_face = default_face
self.padding_face = padding_face
def _defaulted_value(self, face, key):
if not face or face[key] == 'default':
... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,204 | casimir/kwax | refs/heads/master | /setup.py | from setuptools import setup
OPTIONS = {
'iconfile': 'kakoune.icns',
'plist': {
'CFBundleName': "kwax",
'CFBundleIdentifier': "me.casimir.kwax",
'CFBundleDocumentTypes': [{
'CFBundleTypeName': "Document",
'CFBundleTypeRole': "Editor",
'LSItemContentTy... | {"/kakoune.py": ["/jsonrpc.py"], "/main.py": ["/client_frame.py", "/kakoune.py"], "/client_frame.py": ["/faced_text.py", "/kakoune.py", "/message_handler.py"]} |
80,218 | ivanjeanca/DjangoWS | refs/heads/master | /API/urls.py | from django.conf.urls import url, include
from rest_framework.urlpatterns import format_suffix_patterns
from API import views
urlpatterns = [
url(r'^api/empleados/$', views.EmpleadoList.as_view()),
url(r'^api/empleados/(?P<pk>[0-9]+)/$', views.EmpleadoDetail.as_view()),
url(r'^api/clientes/$', views.Client... | {"/API/serializers.py": ["/API/models.py"], "/API/views.py": ["/API/models.py", "/API/serializers.py"]} |
80,219 | ivanjeanca/DjangoWS | refs/heads/master | /API/models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# EMPLEADOS
class Empleado(models.Model):
nombre = models.CharField(max_length=50, blank=True, default='')
apaterno = models.CharField(max_length=50, blank=True, default='')
amaterno = models.CharField(max_leng... | {"/API/serializers.py": ["/API/models.py"], "/API/views.py": ["/API/models.py", "/API/serializers.py"]} |
80,220 | ivanjeanca/DjangoWS | refs/heads/master | /API/serializers.py | from rest_framework import serializers
from . models import Empleado, Cliente, Area, Pedido, AreaCliente, Producto, ProductoAreaCliente, DetallePedido
# EMPLEADOS
class EmpleadoSerializer(serializers.ModelSerializer):
class Meta:
model = Empleado
fields = ('id', 'nombre', 'apaterno', 'amaterno', '... | {"/API/serializers.py": ["/API/models.py"], "/API/views.py": ["/API/models.py", "/API/serializers.py"]} |
80,221 | ivanjeanca/DjangoWS | refs/heads/master | /API/migrations/0003_auto_20191011_0504.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-10-11 05:04
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('API', '0002_area_areacliente_... | {"/API/serializers.py": ["/API/models.py"], "/API/views.py": ["/API/models.py", "/API/serializers.py"]} |
80,222 | ivanjeanca/DjangoWS | refs/heads/master | /API/migrations/0002_area_areacliente_cliente_detallepedido_pedido_producto_productoareacliente.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-10-10 18:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('API', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | {"/API/serializers.py": ["/API/models.py"], "/API/views.py": ["/API/models.py", "/API/serializers.py"]} |
80,223 | ivanjeanca/DjangoWS | refs/heads/master | /API/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import generics
from . models import Empleado, Cliente, Area, Pedido, AreaCliente, Producto, ProductoAreaCliente, DetallePedido
from . serializers import EmpleadoSerializer, ClienteSerializer, AreaSerializer, PedidoSerializer, AreaCli... | {"/API/serializers.py": ["/API/models.py"], "/API/views.py": ["/API/models.py", "/API/serializers.py"]} |
80,228 | Ogurecher/ML_Lab2 | refs/heads/master | /metrics.py | def rmse(y_pred, y_actual):
return (sum([(y_pred_i - y_actual_i)**2 for y_pred_i, y_actual_i in zip(y_pred, y_actual)])/len(y_actual))**(1/2)
def nrmse(y_pred, y_actual):
return rmse(y_pred, y_actual)/(max(y_actual) - min(y_actual))
| {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,229 | Ogurecher/ML_Lab2 | refs/heads/master | /gradient_descent.py | import numpy as np
import matplotlib.pyplot as plt
from parameters import filename
from parameters import gradient_descent as parameters
from parameters import cross_val_folds
from cross_validation import cross_val_split
import prepare_data
from metrics import nrmse
def predict (features, weights_vector):
return... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,230 | Ogurecher/ML_Lab2 | refs/heads/master | /prepare_data.py | from sklearn import preprocessing
import numpy as np
def read_from_file(filename):
file = open(filename)
feature_count = int(file.readline())
training_object_count = int(file.readline())
training_features, training_labels = [], []
for i in range(training_object_count):
object_data = fil... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,231 | Ogurecher/ML_Lab2 | refs/heads/master | /mutate.py | import random
import numpy as np
def mutate(children, mutation_amplitude):
children = np.array([[gene + (random.random() - 0.5) * 2 * (gene * mutation_amplitude) for gene in child] for child in children])
return children
| {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,232 | Ogurecher/ML_Lab2 | refs/heads/master | /regularization.py | import numpy as np
def lasso (alpha, weights_vector):
return alpha * sum([abs(value) for value in weights_vector]) | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,233 | Ogurecher/ML_Lab2 | refs/heads/master | /reproduce.py | import numpy as np
def reproduce(parents, num_children, num_parents, num_genes):
children = []
for index in range(num_children):
parent1_index = index % num_parents
parent2_index = (index + 1) % num_parents
child = np.empty(num_genes)
crossover_point = round(num_genes / 2)
... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,234 | Ogurecher/ML_Lab2 | refs/heads/master | /optimizer.py | import matplotlib.pyplot as plt
from genetic import genetic
from gradient_descent import gradient_descent
import parameters
results = []
#for learning_rate in parameters.gradient_descent['learning_rate']:
# for regularization_strength in parameters.gradient_descent['regularization_strength']:
# train_loss,... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,235 | Ogurecher/ML_Lab2 | refs/heads/master | /choose_parents.py | import metrics
import numpy as np
from regularization import lasso
from parameters import genetic as parameters
def choose_parents(chromosomes, features, labels, num_parents, regularization_strength):
fitnesses = []
for chromosome in chromosomes:
predicted_labels = predict(features, chromosome)
... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,236 | Ogurecher/ML_Lab2 | refs/heads/master | /least_squares_regression.py | from scipy.sparse.linalg import lsqr
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import Ridge
from parameters import filename
from parameters import least_squares as parameters
import prepare_data
from metrics import nrmse
training_object_count, feature_count, training_features, train... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,237 | Ogurecher/ML_Lab2 | refs/heads/master | /parameters.py | filename = './data/5.txt'
least_squares = {
'iterations': 10
}
gradient_descent = {
'num_iterations': 10,
'regularization_strength': 0.001,
'learning_rate': 0.1
}
genetic = {
'num_chromosomes': 20,
'parent_proportion': 1/2,
'num_generations': 10,
'random_gene_amplitude': 1000,
'mu... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,238 | Ogurecher/ML_Lab2 | refs/heads/master | /iteration_plotter.py | import matplotlib.pyplot as plt
import parameters
from gradient_descent import gradient_descent
from genetic import genetic
#model = gradient_descent
model = genetic
num_iterations = parameters.num_iterations
best_losses = []
for max_iterations in range(num_iterations):
#train_loss, test_loss, _ = model({'learni... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,239 | Ogurecher/ML_Lab2 | refs/heads/master | /cross_validation.py | import numpy as np
def cross_val_split (data, k):
np.random.shuffle(data)
features = data[:, :-1]
labels = data[:, -1]
split_point = len(labels) // k
training_features, cross_val_features = np.array(features[split_point:]), np.array(features[:split_point])
training_labels, cross_val_labels ... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,240 | Ogurecher/ML_Lab2 | refs/heads/master | /genetic.py | import numpy as np
import matplotlib.pyplot as plt
import prepare_data
from choose_parents import choose_parents, predict, fitness
from reproduce import reproduce
from parameters import genetic as parameters
from parameters import filename
from mutate import mutate
from metrics import nrmse
def genetic(parameters):
... | {"/gradient_descent.py": ["/parameters.py", "/cross_validation.py", "/prepare_data.py", "/metrics.py"], "/optimizer.py": ["/genetic.py", "/gradient_descent.py", "/parameters.py"], "/choose_parents.py": ["/metrics.py", "/regularization.py", "/parameters.py"], "/least_squares_regression.py": ["/parameters.py", "/prepare_... |
80,241 | webvul/w9scan | refs/heads/master | /plugins/www/subdomain.py | #!/usr/bin/evn python
# -*- coding: utf-8 -*-
# author:w8ay
import socket
def assign(service, arg):
if service == 'www':
return True, arg
def audit(arg):
domain = util.get_domain_root(arg)
tld = '''www
mail
ftp
smtp
pop
m
webmail
pop3
imap
localhost
autodisc... | {"/plugins/www/subdomain.py": ["/dummy/__init__.py"]} |
80,242 | webvul/w9scan | refs/heads/master | /plugins/spider_file/Collect_info.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#__author__ = '1c3z'
import re
def assign(service, arg):
if service == 'spider_file':
return True, arg
def fetch(url,raw):
card15 = r"\b([1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3})\b"
card18 = r"\b([1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\... | {"/plugins/www/subdomain.py": ["/dummy/__init__.py"]} |
80,243 | webvul/w9scan | refs/heads/master | /dummy/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# package for test
from thirdparty import miniCurl
from thirdparty import ThreadPool
from thirdparty import hackhttp
from lib.utils import until
def security_hole(msg):
print msg
def security_info(msg):
print msg
def security_note(msg):
print msg
ThreadPool... | {"/plugins/www/subdomain.py": ["/dummy/__init__.py"]} |
80,282 | roraback/portfolio | refs/heads/master | /projects/admin.py | from django.contrib import admin
from projects.models import Image, Addendum, Project, Category, Video, Testimonial
class ImageInline(admin.TabularInline):
model = Image
extra = 1
class AddendumInline(admin.TabularInline):
model = Addendum
extra = 1
class VideoInline(admin.TabularInline):
model =... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,283 | roraback/portfolio | refs/heads/master | /projects/migrations/0006_project_main_alt_tag.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0005_project_main_caption'),
]
operations = [
migrations.AddField(
model_name='project',
... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,284 | roraback/portfolio | refs/heads/master | /blog/models.py | from django.db import models
from datetime import date
from django.template.defaultfilters import slugify
from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
# Create your models here.
class Article(models.Model):
title = models.CharField(max_length=200, db_index=... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,285 | roraback/portfolio | refs/heads/master | /projects/context_processors.py | from django.conf import settings
def portfolio_settings(request):
return {
'ENVIRONMENT': settings.ENVIRONMENT,
'DEBUG': settings.DEBUG,
}
| {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,286 | roraback/portfolio | refs/heads/master | /portfolio/settings.py | """
Django settings for portfolio project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Quick-start development settings - unsuitable for production
# See htt... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,287 | roraback/portfolio | refs/heads/master | /projects/templatetags/tags.py | from django import template
from django.core.urlresolvers import reverse
from django.db.models import Q
from random import randint
from projects.models import Project
from blog.models import Article, BlogCategory, BlogTag
register = template.Library()
@register.simple_tag
def random_project():
project = Project.... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,288 | roraback/portfolio | refs/heads/master | /blog/admin.py | from django.contrib import admin
from blog.models import Article, BlogCategory, BlogTag
class BlogTagInline(admin.TabularInline):
model = BlogTag
extra = 1
class ArticleAdmin(admin.ModelAdmin):
filter_vertical = ('tags',)
list_display = ('title', 'category', 'posted', 'login_required', 'published')
... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,289 | roraback/portfolio | refs/heads/master | /projects/models.py | import math
from django.db import models
from django.template.defaultfilters import slugify
class Image(models.Model):
title = models.CharField(max_length=100)
image = models.ImageField(upload_to="images", default="img/default.jpg")
thumbnail = models.ImageField(upload_to="images", default="img/defaultThum... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,290 | roraback/portfolio | refs/heads/master | /blog/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import ckeditor_uploader.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Article',
field... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,291 | roraback/portfolio | refs/heads/master | /portfolio/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.conf.urls.static import static
from django.views.generic import RedirectView
from django.conf import settings
from projects.views import IndexView, ProjectView, AboutView, Conta... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,292 | roraback/portfolio | refs/heads/master | /projects/views.py | from django.contrib.auth import authenticate, login
from django.views.generic import ListView, DetailView, TemplateView
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.core.urlresolvers import reverse
from projects.models import Category, Project
class IndexView(ListView):
model = ... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,293 | roraback/portfolio | refs/heads/master | /blog/views.py | from django.shortcuts import render
from django.views.generic import ListView, DetailView, TemplateView
from blog.models import Article, BlogCategory, BlogTag
# Create your views here.
class ArticleView(DetailView):
model = Article
template_name = 'blog/article.html'
class ArticleListView(ListView):
mode... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,294 | roraback/portfolio | refs/heads/master | /portfolio/middleware.py | from django.conf import settings
from django.http import HttpResponsePermanentRedirect
class EnsureHttpsMiddleware(object):
def process_request(self, request):
if not settings.DEBUG and not request.is_secure():
url_str = request.build_absolute_uri()
url_str = url_str.replace('http... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,295 | roraback/portfolio | refs/heads/master | /projects/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Addendum',
fields=[
('id', models.AutoField(ver... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,296 | roraback/portfolio | refs/heads/master | /projects/migrations/0002_auto_20141109_1752.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='addendum',
name='attac... | {"/projects/admin.py": ["/projects/models.py"], "/projects/templatetags/tags.py": ["/projects/models.py", "/blog/models.py"], "/blog/admin.py": ["/blog/models.py"], "/portfolio/urls.py": ["/projects/views.py", "/blog/views.py"], "/projects/views.py": ["/projects/models.py"], "/blog/views.py": ["/blog/models.py"]} |
80,316 | provwise/greenhouse_staging | refs/heads/master | /lcd_test2.py | #!/usr/bin/python3
import sensor_functions as sensor
import RPi.GPIO as GPIO
while True:
try:
sensor.temp_update()
sensor.fan_check()
sensor.get_distance()
except:
sensor.lcd_shutdown()
GPIO.cleanup()
break
| {"/lcd_test2.py": ["/sensor_functions.py"]} |
80,317 | provwise/greenhouse_staging | refs/heads/master | /libraries/relay.py | #!/usr/bin/python3
import RPi.GPIO as GPIO
from time import *
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
relay1_gpio = 37
GPIO.setup(relay1_gpio, GPIO.OUT)
# state = GPIO.input(relay1_gpio)
def relay1_on():
GPIO.setup(relay1_gpio, GPIO.OUT) # GPIO Assign Mode
GPIO.output(relay1_gpio, GPIO.LOW) # Low sign... | {"/lcd_test2.py": ["/sensor_functions.py"]} |
80,318 | provwise/greenhouse_staging | refs/heads/master | /fan_check.py | #!/usr/bin/python3
from time import *
import RPi.GPIO as GPIO
import Adafruit_DHT
from libraries import relay
sensor = Adafruit_DHT.DHT22
pin = 22
state = GPIO.input(37)
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
sleep(2)
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
if humidity is n... | {"/lcd_test2.py": ["/sensor_functions.py"]} |
80,319 | provwise/greenhouse_staging | refs/heads/master | /sensor_functions.py | #!/usr/bin/python3
from libraries import I2C_LCD_driver as lcd_lib
from libraries import relay
import Adafruit_DHT
import distance as dst
from time import *
import RPi.GPIO as GPIO
# Define LCD panel
mylcd = lcd_lib.lcd()
# Set defaul status of relay1 (fan) to off
GPIO.setmode(GPIO.BOARD)
GPIO.setup(37, GPIO.OUT)
GP... | {"/lcd_test2.py": ["/sensor_functions.py"]} |
80,329 | mpmcmaster/tracker | refs/heads/master | /tracker/tasks/admin.py | from django.contrib import admin
# Register your models here.
from .models import Recipient
admin.site.register(Recipient) | {"/tracker/tasks/admin.py": ["/tracker/tasks/models.py"]} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.