id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
900 | synthesize | import re
from chevron import render as render_mustache
from .base import ResponseMicroService
from ..util import get_dict_defaults
class MustachAttrValue(object):
def __init__(self, attr_name, values):
self._attr_name = attr_name
self._values = values
if any(['@' in v for v in values]):
... |
901 | test synchronize telemetry | """Telemetry Worker tests."""
import unittest.mock as mock
import json
from splitio.sync.telemetry import TelemetrySynchronizer, InMemoryTelemetrySubmitter
from splitio.engine.telemetry import TelemetryEvaluationConsumer, TelemetryInitConsumer, TelemetryRuntimeConsumer, TelemetryStorageConsumer
from splitio.storage.inm... |
902 | test in sequence assignment response | from datetime import datetime
from django.test.client import RequestFactory
from django.test.testcases import TestCase
from mediathread.djangosherd.api import DiscussionIndexResource, \
SherdNoteResource
from mediathread.djangosherd.models import DiscussionIndex
from mediathread.factories import MediathreadTestMi... |
903 | pkg commit hash | # encoding: utf-8
"""
Utilities for getting information about IPython and the system it's running in.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
... |
904 | verify checklist | import pytest
import six
import ckan.tests.factories as factories
import ckan.model as model
import ckan.plugins.toolkit as tk
import ckanext.hdx_theme.tests.hdx_test_base as hdx_test_base
from ckanext.hdx_org_group.helpers.static_lists import ORGANIZATION_TYPE_LIST
config = tk.config
NotAuthorized = tk.NotAuthoriz... |
905 | test localtime epoch utc daylight false | import datetime
from email import utils
import test.support
import time
import unittest
import sys
import os.path
class DateTimeTests(unittest.TestCase):
datestring = 'Sun, 23 Sep 2001 20:10:55'
dateargs = (2001, 9, 23, 20, 10, 55)
offsetstring = ' -0700'
utcoffset = datetime.timedelta(hours=-7)
t... |
906 | wget output path | __package__ = 'archivebox.extractors'
import re
from pathlib import Path
from typing import Optional
from datetime import datetime, timezone
from ..index.schema import Link, ArchiveResult, ArchiveOutput, ArchiveError
from ..system import run, chmod_file
from ..util import (
enforce_types,
without_fragment,
... |
907 | run command | import argparse
import concurrent.futures
import json
import logging
import os
import subprocess
import sys
import time
from enum import Enum
from pathlib import Path
from typing import Any, List, NamedTuple, Optional
IS_WINDOWS: bool = os.name == "nt"
def eprint(*args: Any, **kwargs: Any) -> None:
print(*args,... |
908 | test 1 1 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.text}.
"""
from io import StringIO
from twisted.python import text
from twisted.trial import unittest
sampleText = """Every attempt to employ mathematical methods in the study of chemical
questions must be conside... |
909 | eval observables | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
910 | get bias | import torch
import numpy as np
from federatedml.util import consts
from federatedml.secureprotol.paillier_tensor import PaillierTensor
class NumpyDenseLayer(object):
"""
NumpyDenseLayer is designed for Pailler Tensor compute
"""
def __init__(self):
self.input = None
self.model_weig... |
911 | test create page with slugified url | from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
from django.urls import reverse
from oscar.apps.dashboard.pages.forms import PageUpdateForm
from oscar.test.testcases import WebTestCase
class TestPageDashboard(WebTestCase):
is_anonymous = False
is_staff = True
def se... |
912 | test check status fail | import json
import os
import pytest
from mock import patch
from datadog_checks.base import AgentCheck
from datadog_checks.unifi_console.check import UnifiConsoleCheck
from datadog_checks.unifi_console.errors import APIConnectionError
from datadog_checks.unifi_console.types import ControllerInfo, Count, Gauge, Rate
fr... |
913 | explore array | import random
from typing import Any, Dict, List, Union
from ludwig.schema.metadata.parameter_metadata import ExpectedImpact
# base types for ludwig config parameters.
ParameterBaseTypes = Union[str, float, int, bool, None]
def handle_property_type(
property_type: str, item: Dict[str, Any], expected_impact: Exp... |
914 | shoul d clause | """
Available Queries
-----------------
Queries are used for actual searching - things like relevancy scores,
Levenstein distance, and partial matches.
View the `elasticsearch documentation <query_docs>`_ to see what other options
are available, and put 'em here if you end up using any of 'em.
.. _`query_docs`: http... |
915 | e tag | # 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... |
916 | view range changed | import numpy as np
from .. import functions as fn
from .. import getConfigOption
from ..Point import Point
from ..Qt import QtCore, QtGui
from .UIGraphicsItem import UIGraphicsItem
__all__ = ['GridItem']
class GridItem(UIGraphicsItem):
"""
**Bases:** :class:`UIGraphicsItem <pyqtgraph.UIGraphicsItem>`
... |
917 | extract data | # 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... |
918 | test captured | # -*- coding: utf-8 -*-
import sys
from contextlib import contextmanager
from pybind11_tests import iostream as m
try:
# Python 3
from io import StringIO
except ImportError:
# Python 2
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
#... |
919 | copysign | """
mathematical functions.
Descriptions taken from:
https://raw.githubusercontent.com/micropython/micropython/master/docs/library/math.rst.
=====================================
.. module:: math
:synopsis: mathematical functions
|see_cpython_module| :mod:`python:math`.
The ``math`` module provides some basic ma... |
920 | connection string | # 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... |
921 | run | import json
from provider import qemu_img_utils as img_utils
from virttest import qemu_storage
from virttest import data_dir
def METHOD_NAME(test, params, env):
"""
Commit with explicit backing file specification.
1. create snapshot chain as image1->sn1->sn2
2. commit sn2 to base
3. check to see... |
922 | chinese text preprocessing | # Copyright (c) 2023, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
923 | defer run cleanups | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
924 | generate curve | # Alfonso del Carre
import numpy as np
import sharpy.utils.algebra as algebra
class Element(object):
"""
This class stores all the required data for the definition of
a linear or quadratic beam element.
"""
ordering = [0, 2, 1]
max_nodes_elem = 3
def __init__(self,
ielem... |
925 | test accepts iso 8701 local | # Copyright 2014 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 accompa... |
926 | product on basis | # sage.doctest: needs sage.modules
r"""
Examples of graded connected Hopf algebras with basis
"""
# ****************************************************************************
# Copyright (C) 2015 Jean-Baptiste Priez <jbp@kerios.fr>
#
# Distributed under the terms of the GNU General Public License (GPL)
# ... |
927 | setdt | """ BlueSky Datalogger """
# ToDo: Add description in comments
import numbers
import itertools
from datetime import datetime
import numpy as np
from bluesky import settings, stack
from bluesky.core import varexplorer as ve
import bluesky as bs
from bluesky.stack import command
# Register settings defaults
settings.s... |
928 | create optimizer | # 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... |
929 | build default receive data dir | # -*- coding: utf-8 -*-
"""
OnionShare | https://onionshare.org/
Copyright (C) 2014-2022 Micah Lee, et al. <micah@micahflee.com>
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 3 of t... |
930 | test casepriority list api method get | import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_main.models import Casepriority
class CasepriorityAPIViewTestCase(TestCase):
"""casepriority API view tests"""
@classmethod
def setUpTestData(cls):
# create object
Casepriorit... |
931 | my malformed namespace | # Standard Library
from typing import Dict
from unittest import mock
# Third-party
import pytest
# Sematic
from sematic import func
from sematic.abstract_future import AbstractFuture
from sematic.caching.caching import determine_cache_namespace, get_future_cache_key
from sematic.runners.state_machine_runner import St... |
932 | evaluate | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.application.dssp"
__author__ = "Patrick Kunzmann"
__all__ = ["DsspApp"]
from tempfile import NamedTemporaryFile
from ..localapp import LocalApp... |
933 | read sequence | """Adapted from Chris Lowis' drum synthesis code in Javascript
https://github.com/chrislo/drum_synthesis
"""
import random
import json
from browser import bind, console, document, html, timer, window
import drum_score
class Config:
context = None
def setup():
if Config.context is None:
Config.con... |
934 | streams | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import copy
from base64 import standard_b64encode
from typing import Any, List, Mapping, Tuple
import pendulum
import requests
from airbyte_cdk.models import FailureType
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.METHOD_NAME imp... |
935 | register endpoints | """
OIDC/OAuth2 backend module.
"""
import datetime
import logging
from urllib.parse import urlparse
from idpyoidc.client.oauth2.stand_alone_client import StandAloneClient
from idpyoidc.server.user_authn.authn_context import UNSPECIFIED
from satosa.backends.base import BackendModule
from satosa.internal import Authen... |
936 | test hs256 | """JWKS tests"""
import base64
import json
from cryptography.hazmat.backends import default_backend
from cryptography.x509 import load_der_x509_certificate
from django.urls.base import reverse
from jwt import PyJWKSet
from authentik.core.models import Application
from authentik.core.tests.utils import create_test_cer... |
937 | load poses | import argparse
import glob
import json
import os
import re
import shutil
from pathlib import Path
import cv2
import matplotlib.pyplot as plt
import numpy as np
import PIL
from PIL import Image
from torchvision import transforms
parser = argparse.ArgumentParser(description="preprocess neural rgbd dataset to sdfstudio... |
938 | parameter documentation footer | #!/usr/bin/python
#
# xml.etree.ElementTree is available in python 2.5 and higher.
# It can be downloaded to use with older python.
#
# This script reads an XML description of the Zoltan2 parameters,
# and writes a doxygen page with this information.
import xml.etree.ElementTree as ET
outfile = open("parameters.dox"... |
939 | test gpu4 fp16 zero2 | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Note: please copy webtext data to "Megatron-LM" folder, before running this script.
"""
import unittest
import os
import re
from .BingBertSquad_test_common import BaseTestCase
def grep_loss_from_file(file_name):
lo... |
940 | colorbar ctrl name | import logging
import threading
import time
import wx
from cellprofiler_core.setting import ValidationError
import cellprofiler.gui.constants.module_view as mv_constants
from cellprofiler.gui.module_view._validation_request_controller import (
ValidationRequestController,
)
LOGGER = logging.getLogger(__name__)
... |
941 | debug interactive | from __future__ import annotations
from collections.abc import AsyncIterator, Iterator, Callable
from typing import AsyncContextManager, Dict, cast, Any
from asyncio import AbstractEventLoop, Future, sleep
from contextlib import asynccontextmanager
from dataclasses import dataclass
import webbrowser as _webbrowser
imp... |
942 | delete | from sentry.tsdb.base import BaseTSDB
class DummyTSDB(BaseTSDB):
"""
A no-op time-series storage.
"""
def incr(self, model, key, timestamp=None, count=1, environment_id=None):
self.validate_arguments([model], [environment_id])
def merge(self, model, destination, sources, timestamp=None, ... |
943 | is valid enum type | from xsdata.codegen.mixins import RelativeHandlerInterface
from xsdata.codegen.models import Attr
from xsdata.codegen.models import AttrType
from xsdata.codegen.models import Class
from xsdata.formats.converter import converter
from xsdata.logger import logger
from xsdata.models.enums import DataType
class SanitizeAt... |
944 | test syntax error for function definition | """Unit tests for the keyword only argument specified in PEP 3102."""
__author__ = "Jiwon Seo"
__email__ = "seojiwon at gmail dot com"
import unittest
def posonly_sum(pos_arg1, *arg, **kwarg):
return pos_arg1 + sum(arg) + sum(kwarg.values())
def keywordonly_sum(*, k1=0, k2):
return k1 + k2
def keywordonly_no... |
945 | safe repr | """Various utility functions."""
from collections import namedtuple, OrderedDict
from os.path import commonprefix
__unittest = True
_MAX_LENGTH = 80
_PLACEHOLDER_LEN = 12
_MIN_BEGIN_LEN = 5
_MIN_END_LEN = 5
_MIN_COMMON_LEN = 5
_MIN_DIFF_LEN = _MAX_LENGTH - \
(_MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_C... |
946 | get variable | # Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge,
# to any person obtaining a copy of this software and associated
# documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights... |
947 | highest | import hashlib
import os
import stat
import traceback
from enum import Enum
from pathlib import Path
from typing import List, Optional, Set, Union, final
import attr
@attr.define(kw_only=True, frozen=True)
class Report:
"""A common base class for different reports."""
def asdict(self) -> dict:
retur... |
948 | module rhel client by ip | """Test class for Job Invocation procedure
:Requirement: JobInvocation
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: RemoteExecution
:Team: Endeavour
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from inflection import camelize
from robottelo.utils.datafactory ... |
949 | get request | from unittest import TestCase
from unittest import skip
import ConfigParser
import os
import sys
import tempfile
import shutil
sys.path.append(os.path.dirname(__file__))
import listener
import passive
import passive.nrds
class NRDSHandler(TestCase):
def setUp(self):
listener.server.listener.config['ico... |
950 | subp | pkgname = "boost"
pkgver = "1.83.0"
pkgrel = 0
hostmakedepends = ["pkgconf"]
makedepends = [
"icu-devel",
"bzip2-devel",
"xz-devel",
"zstd-devel",
"linux-headers",
"python-devel",
"zlib-devel",
]
provides = [f"boost{pkgver[:-2]}={pkgver}-r{pkgrel}"]
pkgdesc = "Free peer-reviewed portable C++... |
951 | test get jid | import logging
import pytest
import salt.returners.etcd_return as etcd_return
import salt.utils.json
from salt.utils.etcd_util import get_conn
from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import
docker = pytest.importorskip("docker")
log = logging.getLogger(__name__)
p... |
952 | test api region validate ok | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from rest_framework import status
from ralph.accounts.tests.factories import RegionFactory
from ralph.api.tests._base import RalphAPITestCase
from ralph.assets.tests.factories import ServiceEnvironmentFactory
from ralph.back_office.tests.factories im... |
953 | to pil | # Copyright 1996-2023 Cyberbotics Ltd.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
954 | test points | from nutils import element, points, transform, numeric
from nutils.testing import TestCase, parametrize
import numpy
class gauss(TestCase):
def test_line(self):
line = element.getsimplex(1)
for degree in range(1, 8):
points = line.getpoints('gauss', degree)
self.assertEqua... |
955 | test printing the server manifest with image | import yaml
from prefect.infrastructure.kubernetes import KubernetesJob
from prefect.settings import (
PREFECT_API_KEY,
PREFECT_API_URL,
PREFECT_LOGGING_SERVER_LEVEL,
)
from prefect.testing.cli import invoke_and_assert
from prefect.utilities.dockerutils import get_prefect_image_name
def test_printing_the... |
956 | get filtered gene ids | import re
from collections import defaultdict
from django.db.models import Q, prefetch_related_objects, Prefetch
from django.db.models.functions import Length
from reference_data.models import GeneInfo, GeneConstraint, dbNSFPGene, Omim, MGI, PrimateAI, GeneCopyNumberSensitivity, \
GenCC, ClinGen
from seqr.utils.xp... |
957 | qcisd | # Copyright 2014-2020 The PySCF Developers. 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 appl... |
958 | train mean | """WMT workload parent class."""
import abc
import math
import os
from typing import Any, Dict, Optional, Tuple
import jax
import numpy as np
import torch
from algorithmic_efficiency import spec
from algorithmic_efficiency.workloads.wmt import input_pipeline
from algorithmic_efficiency.workloads.wmt.wmt_jax import d... |
959 | do transformation | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# 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
#
# Unl... |
960 | do split | #!/usr/bin/env python3
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE ... |
961 | test circ policy create | # -*- coding: utf-8 -*-
#
# RERO ILS
# Copyright (C) 2019 RERO
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that... |
962 | list | # 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... |
963 | name | # 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 . imp... |
964 | unix server | import asyncio
import asyncio.events
import contextlib
import os
import pprint
import select
import socket
import tempfile
import threading
class FunctionalTestCaseMixin:
def new_loop(self):
return asyncio.new_event_loop()
def run_loop_briefly(self, *, delay=0.01):
self.loop.run_until_comple... |
965 | bot messages | # %%
from typing import Dict, Optional
import os
import copy
import pprint
import logging
import sentry_sdk
sentry_sdk.init(os.getenv("SENTRY_DSN"))
logger = logging.getLogger(__name__)
MAX_HISTORY_LEN = 4
game_keys = ["id", "name_original"]
def get_game_hash(data):
if all([key in data for key in game_keys]):... |
966 | load network dict | import datetime
import re
from dateutil import tz
from sickchill.helper.common import try_int
from .. import logger
from . import db, helpers
# regex to parse time (12/24 hour format)
time_regex = re.compile(r"(?P<hour>\d{1,2})(?:[:.](?P<minute>\d{2})?)? ?(?P<meridiem>[PA]\.? ?M?)?\b", re.I)
network_dict = {}
sb_... |
967 | test export attendees csv | import unittest
from datetime import datetime
from app.api.helpers.csv_jobs_util import *
from app.models import db
from tests.all.integration.auth_helper import create_user
from tests.all.integration.utils import OpenEventTestCase
from tests.factories import common
from tests.factories.attendee import AttendeeFactory... |
968 | repository external slug | from __future__ import annotations
from typing import Any, Mapping, MutableMapping, Sequence
from sentry.integrations import IntegrationInstallation
from sentry.models import Organization, PullRequest, Repository
from sentry.plugins.providers import IntegrationRepositoryProvider
from sentry.services.hybrid_cloud.inte... |
969 | can manage attachments | # This file is part of Indico.
# Copyright (C) 2002 - 2023 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import session
from sqlalchemy import DDL
from sqlalchemy.event import listens_for
from sqlalch... |
970 | setup class | """Test the codeclimate JSON formatter."""
from __future__ import annotations
import json
import pathlib
import subprocess
import sys
import pytest
from ansiblelint.errors import MatchError
from ansiblelint.file_utils import Lintable
from ansiblelint.formatters import CodeclimateJSONFormatter
from ansiblelint.rules ... |
971 | get journal or part of | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... |
972 | post operations | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
973 | url parameters | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
974 | test evaluation | # Copyright 2016 The TensorFlow 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 applica... |
975 | test get possible jobs |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# 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... |
976 | render | from random import randint
import numpy as np
import voluptuous as vol
from ledfx.color import parse_color, validate_color
from ledfx.effects.audio import AudioReactiveEffect
from ledfx.effects.droplets import DROPLET_NAMES, load_droplet
class RainAudioEffect(AudioReactiveEffect):
NAME = "Rain"
CATEGORY = "... |
977 | process data | #!/usr/bin/env python3
# Copyright 2020 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://www.apache.org/licenses/LICENSE-2.0
# ... |
978 | test weights parametrized | # Owner(s): ["module: unknown"]
import logging
from torch import nn
from torch.ao.pruning.sparsifier import utils
from torch.nn.utils import parametrize
import torch
from torch.testing._internal.common_utils import TestCase
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=lo... |
979 | check log dir | # encoding: utf-8
"""An object for managing IPython profile directories."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import shutil
import errno
from pathlib import Path
from traitlets.config.configurable import LoggingConfigurable
from ..paths imp... |
980 | test list | # Copyright 2012,2014 Christoph Reiter
# 2016 Nick Boultbee
# 2019 Ruud van Asseldonk
#
# 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 Lice... |
981 | iter exponents | # -*- coding: utf-8 -*-
# HeckeCharacters.py
from sage.all import gp, xmrange, Integer, pari, gcd, LCM, prod
from sage.misc.cachefunc import cached_method
from sage.groups.abelian_gps.abelian_group import AbelianGroup_class
from sage.groups.abelian_gps.abelian_group_element import AbelianGroupElement
from sage.groups.a... |
982 | properties | # Copyright 2019 D-Wave Systems Inc.
#
# 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... |
983 | poll and read until finish | """
:codeauthor: Pedro Algarvio (pedro@algarvio.me)
salt.utils.nb_popen
~~~~~~~~~~~~~~~~~~~
Non blocking subprocess Popen.
This functionality has been adapted to work on windows following the recipe
found on:
http://code.activestate.com/recipes/440554/
"""
import errno
import loggi... |
984 | draw | """ BarGraph represents bar graphs with vertical bars both simple
and stacked.
The DIRAC Graphs package is derived from the GraphTool plotting package of the
CMS/Phedex Project by ... <to be added>
"""
import datetime
from pylab import setp
from matplotlib.patches import Polygon
from matplotlib.dates impo... |
985 | print tree | # -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) The GTG Team
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published b... |
986 | test convert braket bell | # Copyright (C) 2023 qBraid
#
# This file is part of the qBraid-SDK
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.ht... |
987 | have hardware timing | #!/usr/bin/env python
"""
Voltage controlled Z stage functionality.
Hazen 05/17
George 02/18 - Abstracted from mclVoltageZModule.py
"""
from PyQt5 import QtCore
import numpy as np
import storm_control.hal4000.halLib.halMessage as halMessage
import storm_control.sc_hardware.baseClasses.daqModule as daqModule
import... |
988 | test hide nodes | import pytest
import networkx as nx
class TestFilterFactory:
def test_no_filter(self):
nf = nx.filters.no_filter
assert nf()
assert nf(1)
assert nf(2, 1)
def METHOD_NAME(self):
f = nx.classes.filters.hide_nodes([1, 2, 3])
assert not f(1)
assert not f(2... |
989 | assert span | # Copyright The OpenTelemetry Authors
#
# 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 ... |
990 | ensure module | from typing import Optional
import numpy as np
import pytest
from numcodecs.abc import Codec
from numcodecs.compat import ensure_contiguous_ndarray_like
from numcodecs.registry import get_codec, register_codec
import zarr.codecs
from zarr.core import Array
from zarr.creation import array, empty, full, ones, open_arra... |
991 | tls ca ssl context | import contextlib
import importlib.util
import os
import socket
import ssl
from copy import deepcopy
from hashlib import md5
from pathlib import Path
from tempfile import TemporaryDirectory
from threading import Thread
from time import sleep
from uuid import uuid4
import pytest
try:
import trustme
from crypto... |
992 | decline if input dtype | import abc
import typing as t
import torch
import torch.fx
from torch.fx._compatibility import compatibility
from .shape_prop import TensorMetadata
from .tools_common import get_node_target, CALLABLE_NODE_OPS
__all__ = ['OperatorSupportBase', 'OperatorSupport', 'create_op_support', 'chain', 'OpSupports', 'any_chain'... |
993 | test tumblr | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
import collections
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases
from youtube_dl.extractor import (
FacebookIE,
... |
994 | add reinstall | import sys
import rpm
from rpm._rpm import ts as TransactionSetCore
# TODO: migrate relevant documentation from C-side
class TransactionSet(TransactionSetCore):
_probFilter = 0
def _wrapSetGet(self, attr, val):
oval = getattr(self, attr)
setattr(self, attr, val)
return oval
def se... |
995 | test string | import pytest
pytestmark = pytest.mark.parameters_handler
import bipedal_locomotion_framework.bindings.parameters_handler as blf
import numpy as np
def test_bool():
handler = blf.StdParametersHandler()
handler.set_parameter_bool(name="my_bool", value=True)
assert handler.get_parameter_bool(name="my_bo... |
996 | get build fuzzers step | #!/usr/bin/env python3
#
# Copyright 2023 Google LLC
#
# 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 ... |
997 | label for value | import logging
import warnings
from django import forms
from django.conf import settings
from django.contrib.admin.sites import site
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.template.loader import rende... |
998 | filter | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... |
999 | test address is valid | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from pyqrllib.pyqrllib import hstr2bin
from unittest import TestCase
from qrl.core.misc import logger
from qrl.core.AddressState import AddressState
from qrl.core.Mult... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.