id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
7,800 | nick | """IRC-related functions and classes to be imported by irc.py"""
import logging
import base64
PchumLog = logging.getLogger("pchumLogger")
class SendIRC:
"""Provides functions for outgoing IRC commands.
Functions are protocol compliant but don't implement all valid uses of certain commands.
"""
def ... |
7,801 | currently down | #
# Copyright (C) 2011, 2012, 2016, 2019 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distr... |
7,802 | map scm exception | """Manages source control systems (e.g. Git)."""
import os
from contextlib import contextmanager
from functools import partial
from typing import (
TYPE_CHECKING,
Iterator,
List,
Literal,
Mapping,
Optional,
Union,
overload,
)
from funcy import group_by
from scmrepo.base import Base # n... |
7,803 | test key case insensitive | # Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
import pytest
from vdk.internal.core.config import ConfigurationBuilder
from vdk.internal.core.errors import VdkConfigurationError
@pytest.mark.parametrize(
"key, default_value, show_default_value, description",
(
("int_key", 1, ... |
7,804 | red eye | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
# pylint: disable=no-member
from os.path import abspath, dirname, jo... |
7,805 | get default compiler | from collections.abc import Callable
from typing import Any
from typing_extensions import TypeAlias
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
def gen_lib_options(
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preproces... |
7,806 | forbidden legacy | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... |
7,807 | test argmax 1 int64 | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
from copy import deepcopy as dc
from common import compare_numpy_output
@compare_numpy_output()
def test_sum(A: dace.float64[10, 5, 3]):
return np.sum(A)
@compare_numpy_output()
def test_sum_1(A: dace.floa... |
7,808 | acapy delete | from aiohttp import (
ClientSession,
ClientResponse,
)
import json
from fastapi import Request
from api.core.config import settings
def get_acapy_headers(headers=None, tenant=False) -> dict:
"""Return HTTP headers required for aca-py admin call."""
if not headers:
headers = {}
if not hea... |
7,809 | on new line | # -*- coding: utf-8 -*-
"""
AT+CGDCONT
AT commands specification:
google for: 3gpp specification 27.007
(always check against latest version of standard)
"""
__author__ = 'Adam Klekowski'
__copyright__ = 'Copyright (C) 2020, Nokia'
__email__ = 'adam.klekowski@nokia.com'
import re
from moler.cmd.at.genericat import ... |
7,810 | edge | """
browser driver
"""
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox.service import Service as fService
from selenium.webdriver.ie.service import Service as iService
from selenium.webdriver.METHOD_NAME.service import Service... |
7,811 | set up | #Copyright (C) Arto Jantunen <viiru@iki.fi>
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#This program is distributed i... |
7,812 | unpack zipfile | #!/usr/bin/env python
"""
Use the AppVeyor API to download Windows artifacts.
Taken from: https://bitbucket.org/ned/coveragepy/src/tip/ci/download_appveyor.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""
i... |
7,813 | test make works | # -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2022, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the followin... |
7,814 | set timeout | # Copyright 2017 Workiva
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
#... |
7,815 | test cdt infinite list range value | # These fail if we don't have a new server
# -*- coding: utf-8 -*-
import pytest
import aerospike
from aerospike import exception as e
from aerospike_helpers.operations import list_operations as lo
from aerospike_helpers.operations import map_operations as map_ops
def get_list_result_from_operation(client, key, opera... |
7,816 | close | from io import BytesIO as StringIO
import os
import unittest
import unittest.mock as mock
import fjournaler
TEST_DIR_PATH = '/var/lib/sometest'
class FakeFile(object):
def __init__(self):
self.content = b''
self.data = None
def open(self):
print('Opening fake file, content = {}'.fo... |
7,817 | test interpreter |
def mock_zero_get_documents(collection, query=None, dbname=None, sort=None, limit=10):
return []
def mock_get_documents(collection, query=None, dbname=None, sort=None, limit=10):
return [{
"structure": "azure",
"reference": 'abcd',
"source": 'snapshot',
"path": '/a/b/c',
... |
7,818 | pricing type | #!/usr/bin/env python3
#
# Copyright 2022 Flant JSC Licensed under the Deckhouse Platform Enterprise Edition (EE) license. See https://github.com/deckhouse/deckhouse/blob/main/ee/LICENSE
#
# This hook is responsible for generating metrics for node count of each type.
#
from dataclasses import dataclass
from typing imp... |
7,819 | test cli paginator choice after last page | from unittest import TestCase
from unittest.mock import patch, ANY
from samcli.lib.schemas.cli_paginator import do_paginate_cli
from samcli.lib.schemas.schemas_cli_message_generator import construct_cli_display_message_for_schemas
class TestCliPaginator(TestCase):
def setUp(self):
self.pages = {
... |
7,820 | pkg with non ascii description egg info | # coding: utf-8
import re
import json
import pickle
import textwrap
import unittest
import importlib.metadata
try:
import pyfakefs.fake_filesystem_unittest as ffs
except ImportError:
from .stubs import fake_filesystem_unittest as ffs
from . import fixtures
from importlib.metadata import (
Distribution, E... |
7,821 | create directory from file list | from typing import Dict, List
from .glob_group import GlobGroup, GlobPattern
__all__ = ["Directory"]
class Directory:
"""A file structure representation. Organized as Directory nodes that have lists of
their Directory children. Directories for a package are created by calling
:meth:`PackageImporter.file... |
7,822 | create storage service | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# ... |
7,823 | configure basic logging | # Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
7,824 | get address | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
7,825 | test cluster com periodic | # Copyright (c) 2010-2023 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import numpy.testing as npt
import pytest
import util
from test_managedarray import ManagedArrayTestBa... |
7,826 | dataframe from rows | import functools
import math
import dateutil.parser
import pandas
import structlog
logger = structlog.get_logger()
def dataframe_to_file(df, filename):
filename = str(filename)
if filename.endswith(".csv") or filename.endswith(".csv.gz"):
df.to_csv(filename, index=False)
elif filename.endswith("... |
7,827 | test uniform | import dataclasses as dc
import math
from textwrap import dedent
import typing
import unittest
import numpy as np
from numpy.testing import assert_allclose
import pydrake.common.schema as mut
from pydrake.common.yaml import yaml_load_typed
from pydrake.math import RollPitchYaw
@dc.dataclass
class StochasticSingular... |
7,828 | s | # A lot of failures in these tests on Mac OS X.
# Byte order related?
import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test
class CFunctions(unittest.TestCase):
_dll = CDLL(_ctypes_test.__file__)
def METHOD_NAME(self):
return c_longlong.in_dll(self._dll, "last_... |
7,829 | test bound animator | from __future__ import annotations
from dataclasses import dataclass
from unittest.mock import Mock
import pytest
from textual._animator import Animator, SimpleAnimation
from textual._easing import DEFAULT_EASING, EASING
class Animatable:
"""An animatable object."""
def __init__(self, value):
self... |
7,830 | killdup | #!/usr/local/bin/sage -python
# -*- coding: utf-8 -*-
import sys
import json
import os
import gzip
import re
from collections import Counter as mset
from sage.all import euler_phi, valuation, QQ
sys.path.append('/home/jj/data/lmfdb/data_mgt/utilities')
pw_path = "../../"
pw_filename = "xyzzy"
password = open(pw_path+... |
7,831 | test verify and get quality string | from __future__ import annotations
from dataclasses import dataclass
from secrets import token_bytes
from typing import Optional
import pytest
from blspy import G1Element
from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.types.blockchain_format.proof_of_space import ProofOfSpace, passes_plot_f... |
7,832 | test m2m with prefetch related on polymorphic | # -*- coding: utf-8 -*-
from django.contrib.contenttypes.models import ContentType
from django.db.models import Prefetch
from django.test import TestCase
from ralph.lib.polymorphic.models import Polymorphic
from ralph.lib.polymorphic.tests.models import (
PolymorphicModelBaseTest,
PolymorphicModelTest,
Pol... |
7,833 | tenant id | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
7,834 | test retire success | """
Unit tests for the VerificationDeadline signals
"""
from datetime import timedelta
from django.utils.timezone import now
from unittest.mock import patch # lint-amnesty, pylint: disable=wrong-import-order
from common.djangoapps.student.models_api import do_name_change_request
from common.djangoapps.student.test... |
7,835 | depths | import abc
import numpy
import pyresample
from scipy.interpolate import interp1d
import data.geo as geo
class Model(metaclass=abc.ABCMeta):
"""Abstract base class for models."""
def __init__(self, nc_data):
self.nc_data = nc_data
@property
@abc.abstractmethod
def METHOD_NAME(self) -> n... |
7,836 | on texture wrap | '''
Texture Wrapping and Coordinates Example
========================================
This example changes texture properties and the properties
of its containing rectangle. You should see some a multicolored
texture with sliders to the left and below and buttons at the
bottom of the screen. The image texture_example_... |
7,837 | active matrix from extrinsic euler zxy | import numpy as np
import numpy.typing as npt
def cross_product_matrix(v: npt.ArrayLike) -> np.ndarray: ...
def matrix_from_two_vectors(a: npt.ArrayLike, b: npt.ArrayLike) -> np.ndarray: ...
def matrix_from_axis_angle(a: npt.ArrayLike) -> np.ndarray: ...
def matrix_from_compact_axis_angle(a: npt.ArrayLike) -> n... |
7,838 | get | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
7,839 | evaluate auto upgrade policy | """ Services Access Rights policies
"""
import logging
import operator
from datetime import datetime
from typing import Any, Callable, Optional, Union, cast
from urllib.parse import quote_plus
from fastapi import FastAPI
from models_library.services import ServiceDockerData
from models_library.services_db import Serv... |
7,840 | get nth pair variable bounds checked | """Utilities for enumeration of finite and countably infinite sets.
"""
###
# Countable iteration
# Simplifies some calculations
class Aleph0(int):
_singleton = None
def __new__(type):
if type._singleton is None:
type._singleton = int.__new__(type)
return type._singleton
def __r... |
7,841 | migrate | import esprit
from portality.core import app
from portality import models
from crosswalks.interpreting_methods import interpret_special
'''
Use a scroll search to remove some possible question responses from
applications and journals.
'''
# Connection to the ES index
conn = esprit.raw.Connection(app.config.get("ELAS... |
7,842 | print yaml | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
7,843 | test component tensor3 | #!/usr/bin/env py.test
# -*- coding: utf-8 -*-
__authors__ = "Martin Sandve Alnæs"
__date__ = "2009-02-13 -- 2009-02-13"
import pytest
import math
from ufl import *
from ufl.constantvalue import as_ufl
def testScalars():
s = as_ufl(123)
e = s((5, 7))
v = 123
assert e == v
def testZero():
s = ... |
7,844 | list | import csv
import json
from functools import partial
from io import StringIO
from typing import Dict, Iterator, Optional, Union
from uuid import UUID
from citrine._rest.collection import Collection
from citrine._serialization import properties
from citrine._serialization.serializable import Serializable
from citrine._... |
7,845 | test snippets | import functools
from unittest.mock import patch
import naive
import numpy as np
import numpy.testing as npt
import pytest
from numba import cuda
import stumpy
from stumpy import config, core
try:
from numba.errors import NumbaPerformanceWarning
except ModuleNotFoundError:
from numba.core.errors import Numba... |
7,846 | shortrepr | import sys
import xml.dom.minidom
from _typeshed import Incomplete
from abc import abstractmethod
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
from typing import Any, ClassVar, Protocol, TypeVar, overload
from typing_extensions import Literal, Self, SupportsIndex
from docutils.transfor... |
7,847 | build | from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.properties import ListProperty
from kivy.animation import Animation
from kivy.metrics import dp
KV = '''
#:import RGBA kivy.utils.rgba
<ImageButton@ButtonBehavior+Image>:
size_hint: None, None
size: self.texture_size... |
7,848 | system data | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
7,849 | aot transport init wait | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
7,850 | list categories | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, SylvainCecchetto
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)
# This file is part of Catch-up TV & More
from __future__ import unicode_literals
import re
from builtins import str
import json
import urlquick
from codeq... |
7,851 | handle | # -*- coding: utf-8 -*-
"""
Creates enketo url including preview
"""
from django.core.management.base import BaseCommand, CommandError
from django.http import HttpRequest
from django.utils.translation import gettext_lazy
from onadata.apps.logger.models import XForm
from onadata.libs.utils.model_tools import queryset_i... |
7,852 | test completions | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
# -----------------------------------------------------------------------------
"""
Te... |
7,853 | test output | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
7,854 | apply | from abc import ABC
from xdsl.dialects import func, snitch_runtime
from xdsl.dialects.builtin import ModuleOp, i32
from xdsl.dialects.snitch_runtime import tx_id
from xdsl.ir import Attribute, MLContext
from xdsl.passes import ModulePass
from xdsl.pattern_rewriter import (
GreedyRewritePatternApplier,
PatternR... |
7,855 | make articles | from collections import namedtuple
import pytest
from markupsafe import Markup
from jinja2 import Environment
from jinja2.async_utils import auto_aiter
async def make_aiter(iter):
for item in iter:
yield item
def mark_dualiter(parameter, factory):
def decorator(f):
return pytest.mark.param... |
7,856 | test standalone queryset | from datetime import date, timedelta
from model_bakery import baker
from django.conf import settings
from django.test import TestCase
from ..models import Sponsorship, SponsorBenefit, LogoPlacement, TieredBenefit, RequiredTextAsset, RequiredImgAsset, \
BenefitFeature, SponsorshipPackage, SponsorshipBenefit, Spons... |
7,857 | wait timers | #
# Timer.py -- GUI independent timers.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time
from ginga.misc import Bunch, Callback
from ginga.util.heaptimer import Timer as HeapTimer, TimerHeap
class TimerError(Exception):
pass
class Time... |
7,858 | linux platform | import pytest
import asyncio
import tempfile
import shutil
import weakref
from aiohttp import web
from unittest.mock import MagicMock, patch
from pathlib import Path
from gns3server.web.route import Route
from gns3server.controller import Controller
from gns3server.config import Config
from gns3server.compute import ... |
7,859 | copysign | """mathematical functions
The `math` module provides some basic mathematical functions for
working with floating-point numbers.
|see_cpython_module| :mod:`cpython:math`.
"""
from __future__ import annotations
from typing import Tuple
e: float
"""base of the natural logarithm"""
pi: float
"""the ratio of a circle'... |
7,860 | get file | from abc import ABC, abstractmethod
from collections.abc import Callable
from dataclasses import dataclass, field
from aiohttp import web
from models_library.api_schemas_storage import LinkType, UploadedPart
from models_library.projects_nodes_io import LocationID, LocationName, StorageFileID
from models_library.users ... |
7,861 | set field name | from collections.abc import Callable, Sequence
from typing import Any, Literal
from django.db.models.base import Model
from django.db.models.fields import AutoField, Field, _AllLimitChoicesTo, _ChoicesList, _LimitChoicesTo
from django.db.models.fields.related import ForeignKey, ForeignObject, ManyToManyField, OneToOne... |
7,862 | test fields set on init | import copy
import pytest
from bluemira.base.parameter_frame import Parameter
class TestParameter:
SERIALIZED_PARAM = {
"name": "my_param",
"value": 100,
"description": "A parameter for testing on.",
"source": "test",
"unit": "dimensionless",
"long_name": "My para... |
7,863 | compute output shape | # Copyright 2023 The Keras Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
7,864 | darker | #
# The Python Imaging Library.
# $Id$
#
# standard channel operations
#
# History:
# 1996-03-24 fl Created
# 1996-08-13 fl Added logical operations (for "1" images)
# 2000-10-12 fl Added offset method (from Image.py)
#
# Copyright (c) 1997-2000 by Secret Labs AB
# Copyright (c) 1996-2000 by Fredrik Lundh
#
# See... |
7,865 | check all pages load | """
Test for LMS courseware app.
"""
from textwrap import dedent
from unittest import TestCase
from unittest import mock
from django.urls import reverse
from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase
from lms.djangoapps.lms_xblock.field_data im... |
7,866 | test clear executing | import re
import sys
import types
import unittest
import weakref
from test import support
class ClearTest(unittest.TestCase):
"""
Tests for frame.clear().
"""
def inner(self, x=5, **kwargs):
1/0
def outer(self, **kwargs):
try:
self.inner(**kwargs)
except Zero... |
7,867 | get predefined positions list | #
# Project: MXCuBE
# https://github.com/mxcube
#
# This file is part of MXCuBE software.
#
# MXCuBE is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... |
7,868 | to str | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
7,869 | find library file | from collections.abc import Callable
from typing import Any
from typing_extensions import TypeAlias
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
def gen_lib_options(
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preproces... |
7,870 | login | from typing import Any, Dict, Literal, Optional
from uuid import UUID, uuid4
from pydantic import BaseModel, EmailStr, SecretStr
from litestar import Litestar, Request, get, post
from litestar.connection import ASGIConnection
from litestar.exceptions import NotAuthorizedException
from litestar.middleware.session.serv... |
7,871 | add decorator | import collections
import itertools
from contextlib import contextmanager
from uuid import uuid4
from .code_element import CodeElement
from .parameter import Parameter
_FixtureSpec = collections.namedtuple('_FixtureSpec', ['alias_name', 'fixture', 'alias_with_attribute'])
class Function(CodeElement):
def __ini... |
7,872 | get sunrise | '''
sunrise.py
This example is for the Pico W with GFX Pack.
This displays information from the Sunrise Sunset API:
Find out more here - https://sunrise-sunset.org/api
Also shows how to use a 16x16 animated sprite.
'''
import WIFI_CONFIG
import time
from math import radians, sin, cos
from random import randint
from gfx... |
7,873 | test color status | # emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ###... |
7,874 | test omegaconf list list | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import os
import unittest
import unittest.mock
import torch
from omegaconf import OmegaConf
... |
7,875 | test sim mining | import unittest
import numpy as np
import torch
from pytorch_metric_learning.distances import CosineSimilarity, LpDistance
from pytorch_metric_learning.miners import BatchHardMiner
from .. import TEST_DEVICE, TEST_DTYPES, WITH_COLLECT_STATS
from ..zzz_testing_utils.testing_utils import angle_to_coord
class TestBat... |
7,876 | draw socket | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
from itertools import chain, cycl... |
7,877 | set argparser | # search.py
# Search CLI command.
#
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is d... |
7,878 | test tensor sh encoder | """
Encoding Tests
"""
import pytest
import torch
from nerfstudio.field_components import encodings
def test_scaling_and_offset():
"""Test scaling and offset encoder"""
in_dim = 4
in_tensor = torch.ones((2, 3, in_dim))
scaling = 2.0
offset = 4.5
encoder = encodings.ScalingAndOffset(in_dim=in... |
7,879 | get node from request | # ~*~ coding: utf-8 ~*~
#
from collections import defaultdict
from common.db.models import output_as_string
from common.struct import Stack
from common.utils import get_logger, dict_get_any, is_uuid, get_object_or_none, timeit
from common.utils.http import is_true
from orgs.utils import ensure_in_real_or_default_org, ... |
7,880 | main | #!/usr/bin/env python3
# -*- coding: utf-8; py-indent-offset: 4 -*-
#
# Author: Linuxfabrik GmbH, Zurich, Switzerland
# Contact: info (at) linuxfabrik (dot) ch
# https://www.linuxfabrik.ch/
# License: The Unlicense, see LICENSE file.
# https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING.... |
7,881 | turbine scores | # -*-Encoding: utf-8 -*-
################################################################################
#
# Copyright (c) 2022 Baidu.com, Inc. All Rights Reserved
#
################################################################################
"""
Description: Some useful metrics
Authors: Lu,Xinjiang (luxinjiang@ba... |
7,882 | test metric | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytest
from darts.dataprocessing import dtw
from darts.metrics import dtw_metric, mae, mape
from darts.timeseries import TimeSeries
from darts.utils import timeseries_generation as tg
def _series_from_values(values):
return TimeSeries.... |
7,883 | test buffer sizes | """
Ensure internal buffers are sized correctly.
Incorrectly sized buffers can lead to segfaults.
"""
import struct
import arcade
def check_buff_sizes(sp: arcade.SpriteList):
# Buffers
capacity = sp._buf_capacity
assert sp._sprite_pos_buf.size == 12 * capacity # 3 floats
assert sp._sprite_angle_buf.s... |
7,884 | test generate provisioning artifact success unicode | # Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... |
7,885 | get entity from revision mock | #
# Copyright 2018-2023 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... |
7,886 | tear down class | " Test history, coverage 100%."
from idlelib.history import History
import unittest
from test.support import requires
import tkinter as tk
from tkinter import Text as tkText
from idlelib.idle_test.mock_tk import Text as mkText
from idlelib.config import idleConf
line1 = 'a = 7'
line2 = 'b = a'
class StoreTest(unit... |
7,887 | test load module | # -*- encoding: utf-8 -*-
import os
import socket
import pytz
from datetime import datetime
from mock import patch
from io import BytesIO
from .base import TestCase
from django.conf import settings
from graphite import util
from graphite.wsgi import application # NOQA makes sure we have a working WSGI app
class U... |
7,888 | auth registries | """ Orchestrator for Community Images """
import argparse
import logging
import os
import docker
from harden_generator import HardenGenerator
from stub_generator import StubGenerator
from coverage_runner import CoverageRunner
from registry_helper import RegistryHelperFactory
from tag_manager import TagManager
from co... |
7,889 | basetexture | from ...shader_base import Nodes
from ..source1_shader_base import Source1ShaderBase
class UnlitGeneric(Source1ShaderBase):
SHADER: str = 'unlittwotexture'
@property
def METHOD_NAME(self):
texture_path = self._vmt.get_string('$basetexture', None)
if texture_path is not None:
r... |
7,890 | main | import os
from Components.Scanner import scanDevice
from Plugins.Plugin import PluginDescriptor
from Screens.InfoBar import InfoBar
def execute(option):
print("execute", option)
if option is None:
return
(_, scanner, files, session) = option
scanner.open(files, session)
def mountpoint_choosen(option):
if o... |
7,891 | encode output def | #-------------------------------------------------------------------------------
#
# WPS 1.0 parameters' XML encoders
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
# Martin Paces <martin.paces@eox.at>
#
#-----------------------------------------------------... |
7,892 | test tx requests | #!/usr/bin/env python3
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""
Test transaction download behavior
"""
from test_framework.messages import (
CInv,
CTransaction,
... |
7,893 | new hotness | import inspect
import warnings
import pytest
from .._deprecate import (
TrioDeprecationWarning,
deprecated,
deprecated_alias,
warn_deprecated,
)
from . import module_with_deprecations
@pytest.fixture
def recwarn_always(recwarn):
warnings.simplefilter("always")
# ResourceWarnings about unclos... |
7,894 | render member | import django_filters
import django_tables2
from django.contrib.auth.mixins import PermissionRequiredMixin, LoginRequiredMixin
from django.db import transaction
from django.db.models import Q
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from dj... |
7,895 | is in debug module | # -*- coding: utf-8 -*-
"""
pygments.lexers._lua_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit ... |
7,896 | summary status | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
from typing import List
import click
from ....trello import TrelloClient
from ...console import CONTEXT_SETTINGS, echo_info, echo_success
ROW_FORMAT = {
'verbose': '{:19} | {:<8} | {:<8... |
7,897 | handler | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
7,898 | visit pass | """ DeadCodeElimination remove useless code. """
from pythran.analyses import PureExpressions, DefUseChains, Ancestors
from pythran.openmp import OMPDirective
from pythran.passmanager import Transformation
import pythran.metadata as metadata
import gast as ast
class ClumsyOpenMPDependencyHandler(ast.NodeVisitor):
... |
7,899 | set up test data | import unittest
from django.test import RequestFactory, TestCase, override_settings
from django.urls import reverse
from wagtail.admin.views.home import WhatsNewInWagtailVersionPanel
from wagtail.test.utils import WagtailTestUtils
from wagtail.users.models import UserProfile
class TestWhatsNewInWagtailVersionPanel(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.