id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
14,600 | get input data | """
Provides :class:`NumpyDumpDataset`.
"""
from returnn.datasets.basic import Dataset, DatasetSeq
import os
import numpy
import typing
class NumpyDumpDataset(Dataset):
"""
For ``tools/dump-dataset.py --type=numpy``.
"""
file_format_data = "%i.data"
file_format_targets = "%i.targets"
def __... |
14,601 | test qubits 2 py h2 | # This code is part of a Qiskit project.
#
# (C) Copyright IBM 2020, 2023.
#
# 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 ... |
14,602 | view list url | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from typing import Any, Dict
import requests
from airbyte_cdk.models import AirbyteStream
from airbyte_cdk.models.airbyte_protocol import DestinationSyncMode, SyncMode
from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator
cl... |
14,603 | quote | import io
import os
import shlex
import six
from collections import namedtuple
from ..logs import warn
from ..utils import memoize
from ..conf import settings
from ..system import Path
ShellConfiguration = namedtuple('ShellConfiguration', (
'content', 'path', 'reload', 'can_configure_automatically'))
class Gene... |
14,604 | test config map get old | from mage_ai.io.config import ConfigFileLoader, ConfigKey, EnvironmentVariableLoader
from mage_ai.tests.base_test import DBTestCase
from pathlib import Path
from unittest import mock
class ConfigLoaderTests(DBTestCase):
def setUp(self):
super().setUp()
self.test_path = Path('./test')
self.... |
14,605 | inc | # Copyright 2018 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
#
# Unless required by applicable law or agreed to in wri... |
14,606 | test failure no licensepool | # encoding: utf-8
import pytest
from ...model.complaint import Complaint
from ...util.datetime_helpers import utc_now
COMPLAINT_TYPE = "http://librarysimplified.org/terms/problem/wrong-genre"
class TestComplaint:
def test_for_license_pool(self, db_session, create_edition, create_licensepool):
"""
... |
14,607 | test zlib streams combined randombytes | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2016
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... |
14,608 | test runs tests with gtest internal flag | #!/usr/bin/env python
#
# Copyright 2009, 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... |
14,609 | execute 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
# --------------------------------... |
14,610 | label | # -*- coding: utf-8 -*-
"""Interface to Azure object proposals."""
import logging
from os.path import abspath, dirname, exists, expanduser, join # NOQA
import numpy as np
import requests
import utool as ut
import wbia.constants as const
(print, rrr, profile) = ut.inject2(__name__, '[azure]')
logger = logging.getLog... |
14,611 | trainer model fn | import argparse
import os
import socket
from functools import partial
import pandas as pd
import ray
import torch
from coati.quant import llama_load_quant, low_resource_init
from coati.ray.detached_trainer_ppo import DetachedPPOTrainer
from coati.ray.experience_maker_holder import ExperienceMakerHolder
from coati.ray.... |
14,612 | hashtag | # -*- coding: utf-8 -*-
# Copyright © 2015 Juanjo Conti.
# 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 to use, copy, modif... |
14,613 | find dims | # Copyright (c) 2019-2022, 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 ... |
14,614 | exec widget | import sys
import logging
import gc
import signal
from AnyQt.QtWidgets import QApplication
class WidgetPreview:
"""
A helper class for widget previews.
Attributes:
widget (OWBaseWidget): an instance of the widget or `None`
widget_cls (type): the widget class
"""
def __init__(sel... |
14,615 | create mirror source | import os
import re
from html.parser import HTMLParser
from urllib.parse import urlparse
from pipenv.patched.pip._internal.locations import USER_CACHE_DIR
from pipenv.patched.pip._internal.network.download import PipSession
from pipenv.patched.pip._vendor.urllib3 import util as urllib3_util
def get_requests_session(... |
14,616 | user name | # 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... |
14,617 | test sequential | # Copyright 2021 Sony Group 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
#
# Unless required by applicable law or agreed to ... |
14,618 | test coder write association upper value | import pytest
from gaphor import UML
from gaphor.codegen.coder import (
associations,
attribute,
bases,
class_declaration,
is_enumeration,
is_in_profile,
is_in_toplevel_package,
is_simple_type,
load_model,
load_modeling_language,
order_classes,
resolve_attribute_type_val... |
14,619 | setup nodes | #!/usr/bin/env python3
from decimal import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from collections import Counter
class SigmaMeetSpendTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
self.setup... |
14,620 | test fill package dir | import os
from pathlib import Path
import pytest
from distutils.errors import DistutilsOptionError
from setuptools.config import expand
from setuptools.discovery import find_package_path
def write_files(files, root_dir):
for file, content in files.items():
path = root_dir / file
path.parent.mkdi... |
14,621 | to dict | # coding: utf-8
"""
OpenPerf API
REST API interface for OpenPerf # noqa: E501
OpenAPI spec version: 1
Contact: support@spirent.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class TvlpProfileBlockSeries(object):
... |
14,622 | test str repr returns expected string | # -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... |
14,623 | get user config dir | """
openEO client configuration (e.g. through config files)
"""
from __future__ import annotations
import logging
import os
import platform
from configparser import ConfigParser
from copy import deepcopy
from pathlib import Path
from typing import Any, Iterator, List, Optional, Sequence, Union
from openeo.util imp... |
14,624 | hits | # -*- coding: utf-8 -*-
#
# Copyright (C) 2022 Graz University of Technology.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Result items for OAI-PMH services."""
from invenio_records_resources.pagination i... |
14,625 | get domain user card | #!/usr/bin/env python
# coding=utf-8
# Copyright 2017 the Isard-vdi project authors:
# Josep Maria Viñolas Auquer
# Alberto Larraz Dalmases
# License: AGPLv3
import os
import traceback
from rethinkdb import RethinkDB
from api import app
from .._common.api_exceptions import Error
r = RethinkDB()
import lo... |
14,626 | log outputs | #
# ISC License
#
# Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all... |
14,627 | instance tls ignore warning | # This file is autogenerated.
# To change this file you should edit assets/configuration/spec.yaml and then run the following commands:
# ddev -x validate config -s <INTEGRATION_NAME>
# ddev -x validate models -s <INTEGRATION_NAME>
from datadog_checks.base.utils.models.fields import get_default_field_value
d... |
14,628 | decode one | from typing import List, Dict, Iterable, Optional
import torch
import torch.nn.functional as F
from lightwood.encoder import BaseEncoder
from lightwood.encoder.categorical import OneHotEncoder
class TsCatArrayEncoder(BaseEncoder):
def __init__(self, timesteps: int, is_target: bool = False, grouped_by=None):
... |
14,629 | test compound sky | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the compound module.
"""
import operator
import astropy.units as u
import numpy as np
import pytest
from astropy.coordinates import SkyCoord
from numpy.testing import assert_allclose
from regions.core import CompoundPixelRegion, PixCoord, ... |
14,630 | train | # Copyright 2020 Adap GmbH. 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 law or ag... |
14,631 | add mapping | import os
import socket
from typing import TYPE_CHECKING
import netaddr
from lxml import etree
from core import utils
from core.emane.nodes import EmaneNet
from core.executables import IP
from core.nodes.base import CoreNodeBase, NodeBase
if TYPE_CHECKING:
from core.emulator.session import Session
def add_type... |
14,632 | daemonset misscheduled smart silencer | import logging
import textwrap
from hikaru.model.rel_1_26 import DaemonSet, Node, NodeList
from robusta.api import (
CallbackBlock,
CallbackChoice,
DaemonSetEvent,
ExecutionBaseEvent,
Finding,
FindingSource,
KubernetesFieldsBlock,
MarkdownBlock,
PrometheusKubernetesAlert,
Robust... |
14,633 | local packages | # Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import glob
import os
from pathlib import Path
from typing import Any, cast, Dict, List, Set, Tuple, TYPE_CHECKING, Optional
from UM.Logger import Logger
from UM.PluginRegistry import PluginRegistry
from cura.CuraApplication im... |
14,634 | get feature extractor | # Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b... |
14,635 | test strip accents | import pickle
import pytest
from tokenizers import NormalizedString, Tokenizer
from tokenizers.models import BPE
from tokenizers.normalizers import BertNormalizer, Lowercase, Normalizer, Sequence, Strip, Prepend
class TestBertNormalizer:
def test_instantiate(self):
assert isinstance(BertNormalizer(), No... |
14,636 | set particle submodel | #
# Single Particle Model (SPM)
#
import pybamm
from .base_lithium_ion_model import BaseModel
class SPM(BaseModel):
"""
Single Particle Model (SPM) of a lithium-ion battery, from
:footcite:t:`Marquis2019`.
See :class:`pybamm.lithium_ion.BaseModel` for more details.
Examples
--------
>>> i... |
14,637 | run | # Copyright 2018 The Forseti Security 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 ap... |
14,638 | detect type based tautologies | """
Module detecting tautologies and contradictions based on types in comparison operations over integers
"""
from typing import List, Set, Tuple
from slither.core.cfg.node import Node
from slither.core.declarations import Function
from slither.core.declarations.contract import Contract
from slither.core.solidity_type... |
14,639 | test vgroup add dunder | from __future__ import annotations
import numpy as np
import pytest
from manim import Circle, Line, Square, VDict, VGroup
from manim.mobject.opengl.opengl_mobject import OpenGLMobject
from manim.mobject.opengl.opengl_vectorized_mobject import OpenGLVMobject
def test_opengl_vmobject_point_from_propotion(using_opengl... |
14,640 | cli | #!/usr/bin/env python3
# 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.
"""
This example demonstrates camera parameter optimization with the plain
pulsar interf... |
14,641 | test search script tag wrong | from evennia import DefaultObject, DefaultRoom
from evennia.objects.models import ObjectDB
from evennia.scripts.scripts import DefaultScript
from evennia.utils.search import (
search_object_attribute,
search_script,
search_script_attribute,
search_script_tag,
search_typeclass,
)
from evennia.utils.t... |
14,642 | test parse utf8 fail | # -*- coding: utf-8 -*-
# Copyright 2017 Chris Meyers <cmeyers@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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 the License, or
# (... |
14,643 | get store | import os
import traitlets as tl
import numpy as np
from io import BytesIO
from lazy_import import lazy_module, lazy_class, lazy_function
zarr = lazy_module("zarr")
zarr_open = lazy_function("zarr.convenience.open")
zarr_open_consolidated = lazy_function("zarr.convenience.open_consolidated")
zarrGroup = lazy_class("... |
14,644 | extend profile sidemenu | # 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 redirect, request, session
from flask_multipass import MultipassException
from werkzeug.... |
14,645 | test namespace restriction | # Copyright 2017 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
#
# Unless required by applicable law or agreed to in wri... |
14,646 | delete | # Copyright 2018 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... |
14,647 | fisher | """Momentum Technical Analysis"""
__docformat__ = "numpy"
import logging
from typing import Tuple
import numpy as np
import pandas as pd
import pandas_ta as ta
from sklearn.linear_model import LinearRegression
from openbb_terminal.common.technical_analysis import ta_helpers
from openbb_terminal.decorators import log... |
14,648 | test zoom ratio with limits1 | import pyqtgraph as pg
app = pg.mkQApp()
def test_zoom_normal():
vb = pg.ViewBox()
testRange = pg.QtCore.QRect(0, 0, 10, 20)
vb.setRange(testRange, padding=0)
vbViewRange = vb.getState()['viewRange']
assert vbViewRange == [[testRange.left(), testRange.right()],
[testRang... |
14,649 | is absolute | from time import time
import pytz
from _datetime import datetime, timedelta
from typing import Optional, Tuple
from pydantic import BaseModel
from enum import Enum
from tracardi.service.time import parse_date, parse_date_delta
class DatetimeType(str, Enum):
second = 'second'
minute = 'minute'
hour = 'h... |
14,650 | tf frame split | # Copyright 2020-2023 OpenDR European Project
#
# 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 agree... |
14,651 | test authenticate email token raises error when | from unittest.mock import patch
import base64
from urllib.parse import parse_qs, urlparse
from itsdangerous import URLSafeTimedSerializer
from flask import current_app
from tests.backend.base import BaseTestCase
from tests.backend.helpers.test_helpers import (
get_canned_osm_user_details,
return_canned_user,
... |
14,652 | check accuracy | # The following is a from scratch implementation of a neural network in Python without any deep learning libraries
# Import necessary packages
import numpy as np
import dill
# Create a class
class neural_network:
def __init__(self, num_layers, num_nodes, activation_function, cost_function):
self.num_laye... |
14,653 | test get list | # SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2019 - 2020 Dimpact
from rest_framework import status
from vng_api_common.tests import get_validation_errors, reverse
from ..models import Catalogus
from .base import APITestCase
from .factories import CatalogusFactory
class CatalogusAPITests(APITestCase):
maxD... |
14,654 | file path | import os
class ImageListManager:
"""
图像列表文件管理器
"""
def __init__(self, file_path="", encoding="utf-8"):
self.__filePath = ""
self.__dirName = ""
self.__dataList = {}
self.__findLikeClassifyResult = []
if file_path != "":
self.readFile(file_path, enco... |
14,655 | required status checks | ############################ Copyrights and license ############################
# #
# Copyright 2018 Steve Kowalik <steven@wedontsleep.org> #
# ... |
14,656 | parse | import re
import warnings
from enum import Enum
from typing import Optional
class Quality:
"""
>>> [Quality.Audio.best(), Quality.Audio.worst()]
[<Audio.shq: 'shq'>, <Audio.lq: 'lq'>]
>>> Quality.SortPolicy.apply('hq><', ['shq', 'hq', 'sq', 'lq'])
['hq', 'sq', 'shq', 'lq']
>>> Quality.SortPol... |
14,657 | get sensor | #
# Copyright (C) 1997-2016 JDE Developers 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 by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program... |
14,658 | call with params | # Copyright 2018 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... |
14,659 | subnet | # 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... |
14,660 | get json cached key | import functools
import json
import logging
from typing import Any, List # pylint: disable=C0302
from flask.globals import request
from src.utils import redis_connection
from src.utils.query_params import stringify_query_params
logger = logging.getLogger(__name__)
# Redis Key Convention:
# API_V1:path:queryparams
... |
14,661 | requirements | from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import export_conandata_patches, apply_conandata_patches, get, copy, rm, rmdir
from conan.tools.microsoft import is_msvc
from conan.tools.scm import... |
14,662 | prefix weekday | from collections import OrderedDict
from django import forms
from django.contrib.admin.options import InlineModelAdmin
from django.utils.translation import ugettext_lazy
from resources.models import Day, Period, Resource, Unit
DAYS_OF_WEEK_MAP = dict(Day.DAYS_OF_WEEK)
WEEKDAY_PREFIX = "wd-"
def METHOD_NAME(weekday, ... |
14,663 | callback | from aiortc import RTCPeerConnection
from aiortc.contrib.media import MediaPlayer
import asyncio
import threading
import queue
class BackgroundRTCPeerConnection:
"""Proxy class to use RTCPeerConnection in a background thread.
The purpose of this proxy is to ensure that RTCPeerConnection operations
do not... |
14,664 | sharpness | # Copyright 2020 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... |
14,665 | set up | from django.core import mail
from django.urls import reverse
from ...conf.test import override_dynamic_settings
from ..test import AuthenticatedUserTestCase
class UserChangePasswordTests(AuthenticatedUserTestCase):
"""tests for user change password RPC (/api/users/1/change-password/)"""
def METHOD_NAME(self... |
14,666 | get config | # Copyright 2022 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... |
14,667 | put in server queue | #!/usr/bin/env python3
from __future__ import print_function
from builtins import range
import os,subprocess,sys,re,time,random
from threading import *
from subprocess import call
#Some Constants
STATE_CREATED,STATE_COMPLETED,STATE_ERROR=list(range(3))
### Classes
class BuildThread(Thread):
def __init__(self, pa... |
14,668 | to toml | #!/usr/bin/env python3
# Copyright 2019 The Kapitan Authors
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com>
#
# SPDX-License-Identifier: Apache-2.0
import base64
import datetime
import glob
import logging
import os
import re
import time
import types
from importlib import util
from... |
14,669 | versions | from snovault import (
collection,
calculated_property,
load_schema,
)
from snovault.util import Path
from .base import (
Item,
paths_filtered_by_status,
)
from pyramid.traversal import (
find_root,
)
@collection(
name='pipelines',
unique_key='accession',
properties={
'titl... |
14,670 | get featurestore entity container entity output | # 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... |
14,671 | default | from __future__ import annotations
import os
from logging import getLogger
from typing import Any, Callable, Generic, TypeVar, cast
from reactpy._warnings import warn
_O = TypeVar("_O")
logger = getLogger(__name__)
UNDEFINED = cast(Any, object())
class Option(Generic[_O]):
"""An option that can be set using an... |
14,672 | create eclipse project | #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2010-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Module for accessing project file data for Blender.
Before use, call init(cmake_build_dir).
"""
# TODO: Use CMAKE_EXPORT_COMPILE_COMMANDS (compile_commands.json)
# Instead of Eclipse project f... |
14,673 | test repr | ##########################################################################
#
# Copyright (c) 2012-2013, Image Engine Design 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:
#
# * Redi... |
14,674 | should contain | import os
import threading
import time
from contextlib import contextmanager
from typing import List
import pytest
from selenium import webdriver
from selenium.common.exceptions import (ElementNotInteractableException, NoSuchElementException,
StaleElementReferenceException)
from... |
14,675 | html diff | '''
Simple Diff for Python version 1.0
Annotate two versions of a list with the values that have been
changed between the versions, similar to unix's `diff` but with
a dead-simple Python interface.
(C) Paul Butler 2008-2012 <http://www.paulbutler.org/>
May be used and distributed under the zlib/libpng license
<http:/... |
14,676 | build outs graph | from typing import TYPE_CHECKING, Any, Iterator, List, Optional, Set, TypeVar
from dvc.fs import localfs
from dvc.utils.fs import path_isin
if TYPE_CHECKING:
from networkx import DiGraph
from dvc.stage import Stage
T = TypeVar("T")
def check_acyclic(graph: "DiGraph") -> None:
import networkx as nx
... |
14,677 | readline | # Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import io
import logging
import os
import threading
import time
from pathlib import Path
logger = logging.getLogger(__name__)
class FifoHandler:
"""
Class dedicated for handling communic... |
14,678 | build lambda node | # Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
14,679 | training data | import copy
import logging
from typing import Callable, List, Text, Tuple
import pytest
from _pytest.logging import LogCaptureFixture
from rasa.nlu.featurizers.dense_featurizer.spacy_featurizer import SpacyFeaturizer
from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
from rasa.nlu.utils.spacy_utils import... |
14,680 | get app url | # Copyright 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 accompan... |
14,681 | list workflow trigger callback url output | # 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... |
14,682 | key table name | # sqlalchemy/naming.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Establish constraint and index naming conventions.
"""
from .schema impor... |
14,683 | unbound on init | # -*- coding: utf-8 -*-
"""
2016-01-20 Cornelius Kölbel <cornelius@privacyidea.org>
Support STARTTLS mock
2015-01-30 Cornelius Kölbel <cornelius@privacyidea.org>
Change responses.py to be able to run with SMTP
Original responses.py is:
Copyright 2013 Dropbox, Inc.
Licensed under the Apache Lic... |
14,684 | partitions | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
import os
from collections import Counter
from dateutil.parser import parse
from c7n_salactus.worker import connection as conn
class Database:
def __init__(self, path=None):
if path:
with open(os.path... |
14,685 | i n badclass | # Generated by h2py from /usr/include/netinet/in.h
IPPROTO_IP = 0
IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_IPV4 = 4
IPPROTO_IPIP = IPPROTO_IPV4
IPPROTO_TCP = 6
IPPROTO_ST = 7
IPPROTO_EGP = 8
IPPROTO_PIGP = 9
IPPROTO_RCCMON = 10
IPPROTO_NVPII = 11
IPPROTO_PUP = 12
IPPROTO_ARGUS = 13
... |
14,686 | continue transition | # Standard Library
import logging
import time
from dataclasses import dataclass, replace
from typing import Optional
# Sematic
from sematic.plugins.abstract_external_resource import (
AbstractExternalResource,
ResourceState,
)
logger = logging.getLogger(__name__)
@dataclass(frozen=True)
class TimedMessage(A... |
14,687 | step | import importlib
import torch
from torch import optim
import numpy as np
from inspect import isfunction
from PIL import Image, ImageDraw, ImageFont
def log_txt_as_img(wh, xc, size=10):
# wh a tuple of (width, height)
# xc a list of captions to plot
b = len(xc)
txts = list()
for bi in range(b):
... |
14,688 | adduser | # -*-coding:Utf-8 -*-
"""Contains functions that interpret commmands from the CLI and
call request functions
"""
# Compatibility 2.7-3.4
from __future__ import absolute_import
from __future__ import unicode_literals
from builtins import input
from . import requests_functions as req
from . import user as user
from .... |
14,689 | test multidigraph rev | import pytest
import networkx as nx
from networkx.algorithms.traversal.edgedfs import FORWARD, REVERSE
class TestEdgeBFS:
@classmethod
def setup_class(cls):
cls.nodes = [0, 1, 2, 3]
cls.edges = [(0, 1), (1, 0), (1, 0), (2, 0), (2, 1), (3, 1)]
def test_empty(self):
G = nx.Graph()
... |
14,690 | set user stylesheet | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Bridge from QWebSettings to our own settings.
Module attributes:
ATTRIBUTES: A mapping from internal setting names to QWebSetting enum
constants.
"""
from typing import ... |
14,691 | distance | from math import sqrt
from fontTools.misc import bezierTools
from fontTools.pens.basePen import decomposeQuadraticSegment
# TODO: curve distance
def METHOD_NAME(x1, y1, x2, y2):
dx = x2 - x1
dy = y2 - y1
return sqrt(dx * dx + dy * dy)
def lineProjection(x1, y1, x2, y2, x, y, ditchOutOfSegment=True):
... |
14,692 | get one | from datetime import date
from functools import cached_property
from fastapi import APIRouter, Depends, HTTPException
from mealie.core.exceptions import mealie_registered_exceptions
from mealie.repos.repository_meals import RepositoryMeals
from mealie.routes._base import controller
from mealie.routes._base.base_contr... |
14,693 | handle stream | #!/usr/bin/env python3
# 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
# "L... |
14,694 | test update | # Check every path through every method of UserDict
from test import mapping_tests
import unittest
import collections
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProto... |
14,695 | detailfactor | import bpy
from .....logger import SLoggingManager
from ..source1_shader_base import Source1ShaderBase
log_manager = SLoggingManager()
logger = log_manager.get_logger('MaterialLoader')
class DetailSupportMixin(Source1ShaderBase):
@property
def detail(self):
texture_path = self._vmt.get_string('$det... |
14,696 | func match buffer | # 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... |
14,697 | findlinestarts | import sys
import types
from collections.abc import Callable, Iterator
from opcode import * # `dis` re-exports it as a part of public API
from typing import IO, Any, NamedTuple
from typing_extensions import Self, TypeAlias
__all__ = [
"code_info",
"dis",
"disassemble",
"distb",
"disco",
"findl... |
14,698 | set camera functionality | #!/usr/bin/env python
"""
Handles the display of the current parameters for a given camera.
Hazen 04/17
"""
import importlib
from PyQt5 import QtCore, QtWidgets
import storm_control.sc_library.halExceptions as halExceptions
import storm_control.hal4000.halLib.halMessage as halMessage
import storm_control.hal4000.ha... |
14,699 | get opcode | """
Copyright 2020 Google LLC
Copyright 2020 PerfectVIPs 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 agreed t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.