id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
3,900 | target humidity | """Support for humidifier and dehumidifier."""
import logging
from homeassistant.const import * # noqa: F401
from homeassistant.components.humidifier.const import *
from homeassistant.components.humidifier import (
DOMAIN as ENTITY_DOMAIN,
HumidifierEntity,
HumidifierEntityFeature, # v2022.5
Humidifi... |
3,901 | trace log | # -*- coding: utf-8 -*-
# vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:textwidth=0:
# License: GPL2 or later see COPYING
# Written by Michael Brown
# Copyright (C) 2007 Michael E Brown <mebrown@michaels-house.net>
import functools
import inspect
import logging
import os
import sys
# defaults to mo... |
3,902 | test gradient nulls | """
Test of r3.gradient
@author Anna Petrasova
"""
from grass.gunittest.case import TestCase
from grass.gunittest.main import test
r3univar_test_grad_x = """
n=600
null_cells=0
cells=600
min=0.00902566899999995
max=0.0993248405000001
range=0.0902991715000001
mean=0.0641879624599999
mean_of_abs=0.0641879624599999
std... |
3,903 | test remote blob create | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020-2023 Alibaba Group Holding Limited.
#
# 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/LI... |
3,904 | test ignore duplicates | from urllib.parse import parse_qs
from django.conf import settings
from django.db.utils import IntegrityError
from django.template import Context
from django.test import TestCase, RequestFactory
from django.urls import reverse
from rest_framework import status
from wagtail.core.models import PageViewRestriction, Site
... |
3,905 | node children | #!/usr/bin/python
# vim: set fileencoding=utf-8
from clang.cindex import *
import asciitree # must be version 0.2
import sys
TOP_NODE_TYPES = [
CursorKind.ENUM_DECL,
CursorKind.STRUCT_DECL ]
CHILD_NODE_TYPES = [
CursorKind.FIELD_DECL,
CursorKind.UNION_DECL,
#CursorKind.STRUCT_DECL,
CursorKind... |
3,906 | register plugin | import os
from loguru import logger
from flexget import plugin
from flexget.event import event
from flexget.utils.pathscrub import pathscrub
from flexget.utils.template import RenderError
logger = logger.bind(name='symlink')
class Symlink:
schema = {
'oneOf': [
{
'title': 's... |
3,907 | test coverage | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2023
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
3,908 | test matrices phlti | # This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import os
import tempfile
import numpy as np
import pytest
import scipy.io as spio
import scipy.sparse as... |
3,909 | test prediction proba unify | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
# noinspection PyProtectedMember
from numpy.testing import assert_equal
from numpy.testing import assert_raises
from sklearn.base import clone
# temporary solution for relative imports i... |
3,910 | to html | # -*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distr... |
3,911 | from vertices | # This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from pymor.discretizers.builtin.grids.interfaces import Grid
from pymor.discretizers.b... |
3,912 | load image | # SPDX-FileCopyrightText: 2009-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"load_image",
)
# limited replacement for BPyImage.comprehensiveImageLoad
def METHOD_NAME(
imagepath,
dirname="",
place_holder=False,
recursive=False,
ncase_cmp=Tr... |
3,913 | add html score | import re # noqa: EXE002
def eval_strings(str_list):
scored_list = [_score(string) for string in str_list]
scored_list.sort(key=lambda element: element[1], reverse=True)
return [score_tupel[0] for score_tupel in scored_list]
def _score(string):
score = 0
score = _add_length_score(string, score)... |
3,914 | method | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
3,915 | test add dir | # Copyright 2015 The Bazel 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 la... |
3,916 | ekaf provider | from unittest.mock import MagicMock
import pytest
from feeluown import models
from feeluown.library import (
AbstractProvider, ProviderV2, ModelType, ProviderFlags as PF,
AlbumModel, ArtistModel, BriefVideoModel, BriefSongModel,
Library, SongModel, BriefAlbumModel, BriefArtistModel
)
from feeluown.media im... |
3,917 | script | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
# pylint disable: protected-access
from __future__ import annotations
im... |
3,918 | properties | # 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... |
3,919 | is usage record created | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe and contributors
# For license information, please see license.txt
from typing import List
from press.press.doctype.plan.plan import Plan
import frappe
from frappe.model.document import Document
from press.utils import log_error
from press.overrides import get_per... |
3,920 | new to old | #=======================================================================
#
# Python Lexical Analyser
#
# Converting NFA to DFA
#
#=======================================================================
from __future__ import absolute_import
from . import Machines
from .Machines import LOWEST_PRIORITY
from .Transi... |
3,921 | set on press | import math
from travertino.size import at_least
from ..libs import activity
from ..libs.android.graphics import (
DashPathEffect,
Matrix,
Paint,
Paint__Style,
Path,
Path__Direction,
)
from .base import Widget
class DrawHandler(activity.IDrawHandler):
def __init__(self, interface):
... |
3,922 | get port | from optparse import OptionParser
import Initializer
from InputHandlerThread import InputHandlerThread
Initializer.init_path()
from gnuradio import blocks
from gnuradio import gr
import osmosdr
class top_block(gr.top_block):
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gai... |
3,923 | test node frame | import backend as F
import dgl
import numpy as np
from utils import parametrize_idtype
def create_graph(idtype, num_node):
g = dgl.graph([])
g = g.astype(idtype).to(F.ctx())
g.add_nodes(num_node)
return g
@parametrize_idtype
def test_node_removal(idtype):
g = create_graph(idtype, 10)
g.add_... |
3,924 | test x edges lat | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord
from astropy.table import Table
from gammapy.estimators import ImageProfile, ImageProfileEstimator
from gammapy.maps import WcsGeom, WcsNDMap
fr... |
3,925 | set thread priority | from _typeshed import Incomplete
import _win32typing
from win32.lib.pywintypes import error as error
def STARTUPINFO() -> _win32typing.PySTARTUPINFO: ...
def beginthreadex(sa: _win32typing.PySECURITY_ATTRIBUTES, stackSize, entryPoint, args, flags) -> tuple[int, Incomplete]: ...
def CreateRemoteThread(
hprocess: i... |
3,926 | get relative uri | # -*- coding: utf-8 -*-
"""
sphinx.builders.texinfo
~~~~~~~~~~~~~~~~~~~~~~~
Texinfo builder.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from os import path
from six import iteritems
from docutils import nodes
from docutils.io impo... |
3,927 | test module has saved field | # Copyright The Caikit 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 writing... |
3,928 | get function | import re
import numpy as np
from woodwork.column_schema import ColumnSchema
from woodwork.logical_types import IntegerNullable, NaturalLanguage
from featuretools.primitives.base import TransformPrimitive
class CountString(TransformPrimitive):
"""Determines how many times a given string shows up in a text field... |
3,929 | test resource invocation default config | from contextlib import contextmanager
import pytest
from dagster import Field, Noneable, Selector, build_init_resource_context, resource
from dagster._core.errors import (
DagsterInvalidConfigError,
DagsterInvalidDefinitionError,
DagsterInvalidInvocationError,
)
def test_resource_invocation_no_arg():
... |
3,930 | on agent finish | import asyncio
from langchain.callbacks.base import AsyncCallbackHandler, BaseCallbackHandler
from langflow.api.v1.schemas import ChatResponse
from typing import Any, Dict, List, Union
from fastapi import WebSocket
from langchain.schema import AgentAction, LLMResult, AgentFinish
from loguru import logger
# http... |
3,931 | get rendering for | # 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... |
3,932 | test precision | """
Test ants_image.py
nptest.assert_allclose
self.assertEqual
self.assertTrue
def test_initialize_and_get_value(self):
for img, metric in self.metrics:
img2 = img.clone() * 1.1
metric.set_fixed_image(img)
metric.set_moving_image(img2)
metric.set_sampling()
... |
3,933 | get prep value | #
# Copyright © Michal Čihař <michal@weblate.org>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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
# ... |
3,934 | create resource | """
Copyright 2019 Inmanta
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 ... |
3,935 | search packages info | from __future__ import absolute_import
import logging
import os
from email.parser import FeedParser # type: ignore
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.basecommand import Command
from pip._internal.status_codes import ERROR, SUCCESS
logg... |
3,936 | dup | import socket
import warnings
class TransportSocket:
"""A socket-like wrapper for exposing real transport sockets.
These objects can be safely returned by APIs like
`transport.get_extra_info('socket')`. All potentially disruptive
operations (like "socket.close()") are banned.
"""
__slots__... |
3,937 | role deleted | # coding=utf-8
#####################################################
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT #
#####################################################
# noqa: E128,E201
from ..client import BaseClient
from ..client import createApiClient
from ..client import config
from ..client import createT... |
3,938 | test image editor static | # (C) Copyright 2004-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
3,939 | pid | from __future__ import annotations
import shlex
import string
import pwndbg.auxv
import pwndbg.commands
import pwndbg.gdblib.file
import pwndbg.gdblib.net
import pwndbg.gdblib.proc
import pwndbg.lib.cache
from pwndbg.color import message
from pwndbg.commands import CommandCategory
"""
PEDA prints it out like this:
... |
3,940 | create valid node values | from __future__ import annotations
import contextlib
import functools
import os
import pathlib
import subprocess
from dataclasses import dataclass
from typing import IO, TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union
from chia.data_layer.data_layer_util import NodeType, Side, Status
from chia.data_layer.da... |
3,941 | generate | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import is_apple_os
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir
from conan.tools.scm import Version
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout... |
3,942 | increment read counters | import errno
from leapp.libraries.actor import spamassassinconfigread_spamc
from leapp.libraries.common.testutils import make_IOError
class MockFileOperations(object):
def __init__(self, to_raise=None):
self.files = {}
self.files_read = {}
self.read_called = 0
self.to_raise = to_r... |
3,943 | reload | import web
import datetime
from infogami.infobase import client
from openlibrary.core import helpers as h
import contextlib
__all__ = ["InvalidationProcessor"]
class InvalidationProcessor:
"""Application processor to invalidate/update locally cached documents.
The openlibrary application caches some docume... |
3,944 | test wchar ptr | import unittest
from ctypes import *
import _ctypes_test
class SlicesTestCase(unittest.TestCase):
def test_getslice_cint(self):
a = (c_int * 100)(*xrange(1100, 1200))
b = range(1100, 1200)
self.assertEqual(a[0:2], b[0:2])
self.assertEqual(a[0:2:], b[0:2:])
self.assertEqual(... |
3,945 | 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... |
3,946 | test disconnect proxy port to block | import pytest
from gaphor import UML
from gaphor.diagram.connectors import Connector
from gaphor.diagram.tests.fixtures import allow, connect, disconnect
from gaphor.SysML import sysml
from gaphor.SysML.blocks.block import BlockItem
from gaphor.SysML.blocks.connectors import BlockProperyProxyPortConnector
from gaphor.... |
3,947 | put | import time
import logging
import functools
from typing import Dict
import tornado.web
from opentelemetry import trace
import numpy as np
from libertem.io.dataset import load, detect, get_dataset_cls
from .base import CORSMixin, log_message
from libertem.common.async_utils import sync_to_async
from .messages import M... |
3,948 | process pick points | from __future__ import absolute_import, division, print_function
# TODO:
# - cached scenes
from crys3d import hklview
import cctbx.miller.display
import wx
from math import sqrt
import sys
class hklview_2d (wx.Panel, cctbx.miller.display.render_2d) :
def __init__ (self, *args, **kwds) :
wx.Panel.__init__(self... |
3,949 | determine validation permission | """empty message
Revision ID: c40e1fdf6b70
Revises: 84c793a951b2
Create Date: 2020-02-04 22:23:22.457001
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "c40e1fdf6b70"
down_revision = "84c793a951b2"
branch_labels = None
depends_on = None
class Determiner:
... |
3,950 | get alazar config | import unittest
with_alazar = True
def get_pulse():
from qupulse.pulses import TablePulseTemplate as TPT, SequencePulseTemplate as SPT, RepetitionPulseTemplate as RPT
ramp = TPT(identifier='ramp', channels={'out', 'trigger'})
ramp.add_entry(0, 'start', channel='out')
ramp.add_entry('duration', 'stop... |
3,951 | calculate xpos | """
This example uses the Coinbase open API to collect the current exchange rates.
Use Switch A to change to a different base exchange currency.
"""
import WIFI_CONFIG
from network_manager import NetworkManager
import uasyncio
import urequests
import time
import math
from stellar import StellarUnicorn
from picographic... |
3,952 | test show with default args | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
3,953 | set enabled | from abc import ABC, abstractmethod
from decimal import ROUND_HALF_EVEN, ROUND_UP, Decimal
from System.Drawing import (
Color,
Point,
Size,
SystemColors,
)
from travertino.size import at_least
from toga_winforms.colors import native_color
class Scalable:
SCALE_DEFAULT_ROUNDING = ROUND_HALF_EVEN
... |
3,954 | test fact | """
:codeauthor: Rahul Handay <rahulha@saltstack.com>
"""
import errno
import os
import pytest
import salt.modules.puppet as puppet
import salt.utils.args
import salt.utils.files
from salt.exceptions import CommandExecutionError
from tests.support.mock import MagicMock, mock_open, patch
@pytest.fixture
def con... |
3,955 | recover chunk | #!/usr/bin/env python
# -*- coding: utf8 -*-
from curvesnapshot_python import curvesnapshot
from config import config
from logger.logger import *
class CurveSnapshot:
def __init__(self):
rc = curvesnapshot.Init(config.client_conf)
logger.info("CurveSnapshot init success.")
if rc != 0:
... |
3,956 | get output dir | """
Run PyTorch cpu benchmarking.
"""
import json
import os
import re
import sys
import time
from datetime import datetime
from pathlib import Path
from typing import List, Dict, Optional
REPO_PATH = Path(__file__).absolute().parent.parent.parent
USERBENCHMARK_OUTPUT_PREFIX = ".userbenchmark"
class add_path():
de... |
3,957 | test output | #!/usr/bin/env python
#
# Copyright 2008, 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... |
3,958 | tear down | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
3,959 | feature engineering expand basic | import logging
from functools import reduce
from typing import Dict
import talib.abstract as ta
from pandas import DataFrame
from freqtrade.strategy import DecimalParameter, IntParameter, IStrategy
logger = logging.getLogger(__name__)
class freqai_test_multimodel_strat(IStrategy):
"""
Test strategy - used... |
3,960 | select | """0MQ polling related functions and classes."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from typing import Any, Dict, List, Optional, Tuple
from zmq.backend import zmq_poll
from zmq.constants import POLLERR, POLLIN, POLLOUT
# -------------------------------------... |
3,961 | get node address | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import infra.remote
import docker
import re
import os
import pathlib
import grp
import infra.github
import time
from loguru import logger as LOG
def is_docker_env():
"""Returns true if the process executing _thi... |
3,962 | get hostname from dn | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import re
POD_REGEX = re.compile('pod-([0-9]+)')
BD_REGEX = re.compile('/BD-([^/]+)/')
APP_REGEX = re.compile('/ap-([^/]+)/')
CEP_REGEX = re.compile('/cep-([^/]+)/')
EPG_REGEX = re.compile('/epg-([^/]+)/... |
3,963 | get add identity | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... |
3,964 | test tensor train cross 2 | import tensorly as tl
import pytest
import numpy as np
import itertools
from .._tt_cross import tensor_train_cross
from ....tt_tensor import tt_to_tensor
from tensorly.testing import assert_
skip_if_backend = pytest.mark.skipif(
tl.get_backend() in ("tensorflow", "jax", "cupy"),
reason=f"Operation not suppor... |
3,965 | unsqueeze batch | #!/usr/bin/env python3
from abc import abstractmethod
from typing import List, Optional, Tuple, Union
import torch
from jaxtyping import Float
from torch import Tensor
from ..utils.getitem import _is_noop_index, _noop_index
from ._linear_operator import IndexType, LinearOperator
from .dense_linear_operator import to... |
3,966 | increment event duration | # Copyright 2022 The JAX 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
3,967 | test detect jboss fuse potential ent | """Test the product fuse."""
from django.test import TestCase
from api.models import ServerInformation
from fingerprinter.jboss_fuse import detect_jboss_fuse, get_version
class ProductFuseTest(TestCase):
"""Tests Product Fuse class."""
def setUp(self):
"""Create test case setup."""
self.se... |
3,968 | test list | # 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... |
3,969 | out prompt tokens | #!/usr/bin/env python
"""An example of how to embed an IPython shell into a running program.
Please see the documentation in the IPython.Shell module for more details.
The accompanying file embed_class_short.py has quick code fragments for
embedding which you can cut and paste in your code once you understand how
thi... |
3,970 | test create endpoint no wait | # 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... |
3,971 | random element | """
Ring of pari objects
AUTHORS:
- William Stein (2004): Initial version.
- Simon King (2011-08-24): Use UniqueRepresentation, element_class and
proper initialisation of elements.
"""
# ****************************************************************************
# Copyright (C) 2004 William Stein <wstein@gma... |
3,972 | properties | # 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... |
3,973 | get entity type | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
3,974 | read config event | """
Copyright 2018 Grid Singularity
This file is part of Grid Singularity Exchange.
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 vers... |
3,975 | load | """AppArmor control for host."""
from __future__ import annotations
import logging
from pathlib import Path
import shutil
from awesomeversion import AwesomeVersion
from ..coresys import CoreSys, CoreSysAttributes
from ..exceptions import DBusError, HostAppArmorError
from ..resolution.const import UnsupportedReason
f... |
3,976 | check nonlinear | # Implementation of the TCN proposed in
# Luo. et al. "Conv-tasnet: Surpassing ideal time–frequency
# magnitude masking for speech separation."
#
# The code is based on:
# https://github.com/kaituoxu/Conv-TasNet/blob/master/src/conv_tasnet.py
#
import torch
import torch.nn as nn
EPS = torch.finfo(torch.get_default_... |
3,977 | get author | """
Module that holds the base abstractions for Sematic's plug-in system.
Plug-ins are classes that inherit from the AbstractPlugin abstract base class.
Plug-ins are imported at runtime based on user's or server's settings stored in
their corresponding yaml files.
"""
# Standard Library
import abc
import enum
import ... |
3,978 | test asyncio yield from | # 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 th... |
3,979 | analyze params | from typing import TYPE_CHECKING, Dict
from slither.core.declarations.custom_error import CustomError
from slither.core.declarations.custom_error_contract import CustomErrorContract
from slither.core.declarations.custom_error_top_level import CustomErrorTopLevel
from slither.core.variables.local_variable import LocalV... |
3,980 | bleed channel | """
Simple bleed trail implementation to apply to "eimages" just prior to
the camera readout code.
"""
import numpy as np
__all__ = ['bleed_eimage', 'bleed_channel', 'find_channels_with_saturation']
def find_channels_with_saturation(eimage, full_well):
"""Helper function to find which channels (x values) have at ... |
3,981 | run with profile | from decimal import Decimal
import os
import random
from sqlalchemy import __version__
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import Numeric
from sqlalchemy import String
from sqlalchemy.orm import declarative_... |
3,982 | worker ready connect | # This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl
# See the file 'LICENSE' for copying permission.
from __future__ import absolute_import, unicode_literals
import datetime
import logging
import typing
from celery import shared_task, signals
from celery.worker.consumer import Consumer
from... |
3,983 | test api store addons addon version | """Test Store API."""
import asyncio
from unittest.mock import MagicMock, PropertyMock, patch
from aiohttp.test_utils import TestClient
import pytest
from supervisor.addons.addon import Addon
from supervisor.arch import CpuArch
from supervisor.const import AddonState
from supervisor.coresys import CoreSys
from super... |
3,984 | get kernel | """
pysteps.nowcasts.lagrangian_probability
=======================================
Implementation of the local Lagrangian probability nowcasting technique
described in :cite:`GZ2004`.
.. autosummary::
:toctree: ../generated/
forecast
"""
import numpy as np
from scipy.signal import convolve
from pysteps.no... |
3,985 | test settings visible when signed in | import json
from datetime import datetime, timedelta
from unittest import mock
from rest_framework.test import APIClient
from kitsune.questions.tests import (
AnswerFactory,
AnswerVoteFactory,
QuestionFactory,
SolutionAnswerFactory,
)
from kitsune.sumo.templatetags.jinja_helpers import urlparams
from ... |
3,986 | reshapefunc | """Defines the GLPluginInterface class, which is a unified base class for
plugins to the klampt.vis module.
"""
from typing import Callable,List,Tuple
from ..model.typing import Vector3
class GLPluginInterface:
"""Users can add their own hooks into the visualizer by overloading this
class's methods. Each me... |
3,987 | test imgw hydrology api monthly | import datetime as dt
from zoneinfo import ZoneInfo
import polars as pl
import pytest
from polars.testing import assert_frame_equal
from wetterdienst.provider.imgw.hydrology.api import ImgwHydrologyRequest, ImgwHydrologyResolution
@pytest.fixture
def df_expected_station():
return pl.DataFrame(
{
... |
3,988 | libcurve extend | #!/usr/bin/env python
# -*- coding: utf8 -*-
from curvefs_python import curvefs
from config import config
from logger.logger import *
cbdClient = curvefs.CBDClient()
class LibCurve:
def __init__(self):
rc = cbdClient.Init(config.client_conf)
logger.info("init success.")
if rc != 0:
... |
3,989 | error | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# All files in doxy-coverage are Copyright 2014 Alvaro Lopez Ortega.
#
# Authors:
# * Alvaro Lopez Ortega <alvaro@gnu.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... |
3,990 | validate file extension | # coding=utf-8
"""Csv download model definition.
"""
from datetime import datetime
from django.db import models
from django.conf import settings
from django.core.exceptions import ValidationError
from bims.tasks.email_csv import send_csv_via_email
from bims.download.csv_download import (
send_rejection_csv,
se... |
3,991 | neighbors | from __future__ import annotations
import heapq
import itertools
import math
import random
from river import base
class Vertex(base.Base):
_isolated: set[Vertex] = set()
def __init__(self, item, uuid: int) -> None:
self.item = item
self.uuid = uuid
self.edges: dict[Vertex, float] = ... |
3,992 | get value text | # (C) Copyright 2004-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
3,993 | check permissions | import uuid
import os
import csv
from sqlalchemy.exc import IntegrityError
from flask import request, current_app
from flask_restful import Resource
from flask_jwt_extended import jwt_required
from zou.app.mixin import ArgsMixin
from zou.app import app
from zou.app.utils import permissions
from zou.app.services impo... |
3,994 | test list inside union default | # (C) Copyright 2005-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
3,995 | update params | """Training algorithm track submission functions for LibriSpeech."""
import functools
from typing import Dict, Iterator, List, Tuple
from absl import logging
from flax import jax_utils
import jax
from jax import lax
import jax.numpy as jnp
import numpy as np
import optax
from algorithmic_efficiency import spec
_GRAD... |
3,996 | periodical task | # -*- coding: utf-8 -*-
import threading
from functools import wraps
from ..helpers import Periodical, is_sequence
from .plugin import BasePlugin
def threaded(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
return self.pyload.adm.start_thread(func, self, *args, **kwargs)
return wrapper
... |
3,997 | constructor | import copy
import inspect
from typing import Any, Callable, Dict, Generic, Optional, Type, TypeVar, Union, cast
from .det_hash import CustomDetHash, DetHashWithVersion
from .params import Params
T = TypeVar("T")
class Lazy(Generic[T], CustomDetHash):
"""
This class is for use when constructing objects usin... |
3,998 | check host name | # 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... |
3,999 | test read earlinet get file list error | from __future__ import annotations
from pathlib import Path
import numpy as np
import pytest
from pyaerocom import VerticalProfile, const
from pyaerocom.io.read_earlinet import ReadEarlinet
from tests.conftest import TEST_RTOL
ROOT: str = const.OBSLOCS_UNGRIDDED["Earlinet-test"]
TEST_FILES: list[str] = [
f"{ROO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.