id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
9,400 | build schema on 200 201 | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
9,401 | test rows created event type | import pytest
from baserow.contrib.database.fields.handler import FieldHandler
from baserow.contrib.database.rows.handler import RowHandler
from baserow.contrib.database.webhooks.registries import webhook_event_type_registry
from baserow.contrib.database.ws.rows.signals import before_rows_update
@pytest.mark.django_... |
9,402 | from data | import warnings
from django.utils.functional import cached_property
from .utils import OrderBy, OrderByTuple, segment
class TableData:
"""
Base class for table data containers.
"""
def __init__(self, data):
self.data = data
def __getitem__(self, key):
"""
Slicing return... |
9,403 | exec scan | # -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2014-2023 Greenbone AG
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=unused-argument
# pylint: disable=disallowed-name
import time
from unittest.mock import Mock
from xml.etree import ElementTree as et
from ospd.ospd import OSPDaemon
def asser... |
9,404 | test popen initializer | # 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... |
9,405 | start | #!/usr/bin/env python
# This program is dedicated to the public domain under the CC0 license.
# pylint: disable=import-error,unused-argument
"""
Simple example of a bot that uses a custom webhook setup and handles custom updates.
For the custom webhook setup, the libraries `flask`, `asgiref` and `uvicorn` are used. Ple... |
9,406 | mobile net v2 x0 75 | # copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
#
# 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... |
9,407 | has add permission | from django.contrib import admin
from django.db.models import Prefetch
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.admin import (
AMOModelAdmin,
DateRangeFilter,
MultipleRelatedListFilter,
)
from olympia.translations.utils import truncate_text
from olympia.zadmin.admin ... |
9,408 | stub update distribution | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Stub functions that are used by the Amazon CloudFront unit tests.
When tests are run against an actual AWS account, the stubber class does not
set up stubs and passes all calls through to the Boto3 client.
"... |
9,409 | openurl rds | import random
from urllib.parse import urlparse
from visidata import VisiData, vd, Sheet, options, anytype, asyncthread, ColumnItem
__all__ = ['openurl_postgres', 'openurl_postgresql', 'openurl_rds', 'PgTable', 'PgTablesSheet']
vd.option('postgres_schema', 'public', 'The desired schema for the Postgres database')
d... |
9,410 | resource apply sparse | # 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... |
9,411 | test pow send transaction | #!/usr/bin/env python3
# encoding: utf-8
import unittest as ut
from SEEDBlockchain import Wallet
from web3 import Web3
from seedemu import *
class MultipleChainsTestCase(ut.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.wallet1 = Wallet(chain_id=1337)
cls.wallet2 = Wallet(chain_id=13... |
9,412 | notifications | # notifications.py - notification endpoints
from mastodon.versions import _DICT_VERSION_NOTIFICATION
from mastodon.errors import MastodonIllegalArgumentError
from mastodon.utility import api_version
from mastodon.internals import Mastodon as Internals
from mastodon.types import Notification, IdType, PaginatableList, ... |
9,413 | embedding init code | import sys
import types
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
from collections.abc import Callable, Hashable
from typing import Any, TypeVar, overload
from typing_extensions import Literal, TypeAlias
import _cffi_backend
from setuptools._distutils.extension import Extension
_T = TypeVar("_... |
9,414 | repr | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import re
f... |
9,415 | reset | # A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2006-2021 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Bill Dengler,
# Julien Cochuyt
import re
from .commands import (
# Commands that are... |
9,416 | init hyper parameters | # 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 applicable ... |
9,417 | find dep path | # A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2020 NV Access Limited
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
"""
This module is designed to construct and install the speechSpyGlobalPlu... |
9,418 | hybridsim template | # -*- coding: utf-8 -*-
from sst_unittest import *
from sst_unittest_support import *
import os
################################################################################
# Code to support a single instance module initialize, must be called setUp method
module_init = 0
module_sema = threading.Semaphore()
def ... |
9,419 | pmts submitted by date | from collections import defaultdict
from datetime import date, datetime, timedelta
from typing import Dict, Iterator
from django.db.models import Q
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from dateutil.rrule import DAILY, FR, MO, SA, TH, TU, WE, rrule
fro... |
9,420 | get project arg | class ArgumentsTo(object):
KEY = ''
def __init__(self, args):
self.args = args
def build(self):
raise NotImplementedError
@property
def database_name(self):
return self.args['database'].name
def get_database_arg(self):
return "Database: {}".format(self.databas... |
9,421 | pytest pycollect makeitem | try:
# installed by bootstrap.py
import sqla_plugin_base as plugin_base
except ImportError:
# assume we're a package, use traditional import
from . import plugin_base
import pytest
import argparse
import inspect
import collections
import os
try:
import xdist # noqa
has_xdist = True
except Imp... |
9,422 | real extract | import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
determine_ext,
join_nonempty,
update_url_query,
)
class DisneyIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?P<domain>(?:[^/]+\.)?(?:disney\.[a-z]{2,3}(?:\.[a-z]{2})?|disney(?:(?:me|la... |
9,423 | find copyright | #!/usr/bin/env python3
# Copyright 2021-2023 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
import argparse
import os
import platform
impo... |
9,424 | add arguments | # ------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
#
# ------------------------------------------------------------------------------
# Copyright (C) 2017 EOX IT Services GmbH
#
# Permission... |
9,425 | doc to changes | from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from casexml.apps.phone.models import SyncLogSQL
from corehq.sql_db.util import handle_connection_failure
from dimagi.utils.parsing import string_to_utc_datetime
from pillowtop.checkpoints.manager import KafkaPillowCheckpoint
from pillowtop.feed.i... |
9,426 | exp decay | #!/usr/bin/env python
import numpy as np
from colander import SchemaNode
from gnome.persist.extend_colander import NumpyArray
from gnome.persist.base_schema import ObjTypeSchema
from gnome.array_types import gat
from gnome.utilities.time_utils import date_to_sec, sec_to_datetime
from gnome.exceptions import Re... |
9,427 | get 2d sincos pos embed from grid | # --------------------------------------------------------
# Position embedding utils
# --------------------------------------------------------
from typing import Tuple
import numpy as np
import torch
# --------------------------------------------------------
# 2D sine-cosine position embedding
# References:
# Tra... |
9,428 | test sir regularized numdiff | import numpy as np
import pandas as pd
import pytest
from statsmodels.regression.dimred import (
SlicedInverseReg, SAVE, PHD, CORE)
from numpy.testing import (assert_equal, assert_allclose)
from statsmodels.tools.numdiff import approx_fprime
def test_poisson():
np.random.seed(43242)
# Generate a non-o... |
9,429 | update | from typing import Callable, Optional, Union
from unittest.mock import patch
import pytest
import torch
import torchvision
from ignite.metrics.gan.utils import _BaseInceptionMetric, InceptionModel
class DummyInceptionMetric(_BaseInceptionMetric):
def __init__(
self,
num_features: Optional[int] =... |
9,430 | test push set | import pytest
import time
from mastodon.Mastodon import MastodonNotFoundError
import mastodon.compat
if not mastodon.compat.IMPL_HAS_CRYPTO or not mastodon.compat.IMPL_HAS_ECE:
pytest.skip("webpush dependencies missing, skipping webpush tests", allow_module_level=True)
def test_decrypt(api):
priv = {
... |
9,431 | regenerate search table | from itertools import chain
import inflection
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import TSVECTOR
from sqlalchemy.orm import aliased
from ereuse_devicehub.db import db
from ereuse_devicehub.resources import search
from ereuse_devicehub.resources.action.models import Action, ... |
9,432 | outputs | # encoding: utf-8
"""IO capturing utilities."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function, absolute_import
import sys
from IPython.utils.py3compat import PY3
if PY3:
from io import StringIO
else:
from StringIO ... |
9,433 | is complete | #!/usr/bin/python
##################
# HDFDataSource.py
#
# Copyright David Baddeley, 2009
# d.baddeley@auckland.ac.nz
#
# 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 ... |
9,434 | test area multiple lats and lons | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the `iris.analysis.cartography._quadrant_area` function"""
# Import iris.tests first so that some things ca... |
9,435 | test preloop | """
Console module tests
"""
import contextlib
import io
import os
import tempfile
import unittest
from txtai.console import Console
from txtai.embeddings import Embeddings
APPLICATION = """
path: %s
workflow:
test:
tasks:
- task: console
"""
class TestConsole(unittest.TestCase):
"""
Console... |
9,436 | match resource sub properties | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import regex as re
from cfnlint.helpers import RESOURCE_SPECS
from cfnlint.rules import CloudFormationLintRule, RuleMatch
class AllowedPattern(CloudFormationLintRule):
"""Check if properties have a valid val... |
9,437 | data tree1 | """
merge_data_tree
===============
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecification,... |
9,438 | test periodic value is parameterized | # Copyright 2018 The Cirq Developers
#
# 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 ... |
9,439 | reraise | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... |
9,440 | product | ''' BLS Multi-Signatures
| From: "Dan Boneh, Manu Drijvers, Gregory Neven. BLS Multi-Signatures With Public-Key Aggregation".
| Available from: https://crypto.stanford.edu/~dabo/pubs/papers/BLSmultisig.html
* type: signature (identity-based)
* setting: bilinear groups (asymmetric)
:Authors: Lovesh H... |
9,441 | test shapes invalid bidx | """Tests for ``$ rio shapes``."""
import json
import re
import numpy as np
import pytest
from shapely.geometry import shape
import rasterio
from rasterio.rio.main import main_group
DEFAULT_SHAPE = (10, 10)
def bbox(*args):
return ' '.join([str(x) for x in args])
def test_shapes(runner, pixelated_image_fil... |
9,442 | test find violations | # 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... |
9,443 | check sub dim positive |
from collections import defaultdict
from sage.all import cached_function, psi, RR, Integer, prod
from psycopg2.sql import SQL, Identifier
from .verification import TableChecker, overall
@cached_function
def kbarbar(weight):
# The weight part of the analytic conductor
return psi(RR(weight)/2).exp() / (2*RR.... |
9,444 | test entity class id | ######################################################################################################################
# Copyright (C) 2017-2022 Spine project consortium
# This file is part of Spine Toolbox.
# Spine Toolbox is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Gen... |
9,445 | get measurement | # coding=utf-8
from collections import OrderedDict
import copy
from flask_babel import lazy_gettext
from mycodo.inputs.base_input import AbstractInput
# Measurements
measurements_dict = OrderedDict()
for each_channel in range(8):
measurements_dict[each_channel] = {
'measurement': 'electrical_potential',
... |
9,446 | get description | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Outline Explorer Plugin."""
# Third party imports
from qtpy.QtCore import Qt, Slot
# Local imports
from spyder.api.plugin_registration.decorators import (
on... |
9,447 | get connection string | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
9,448 | main | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Uniformize streamlines' endpoints according to a defined axis.
Useful for tractometry or models creation.
The --auto option will automatically calculate the main orientation.
If the input bundle is poorly defined, it is possible heuristic will be wrong.
The default ... |
9,449 | test communication | #!/usr/bin/env python
import unittest
import os
import subprocess
import time
class TestNetworkEndpointConfig(unittest.TestCase):
def checkDNSDistExitCode(self, configTemplate, expectedCode, clientMode=False, verboseMode=False):
conffile = 'configs/dnsdist_TestNetworkEndpointConfig.conf'
with open... |
9,450 | mymethod | ##############################################################################
#
# Copyright (c) 2004, 2005 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.
# TH... |
9,451 | rewrite extra info | """Plugin that loads yaml resources for data packs and resource packs."""
__all__ = [
"LoadYamlOptions",
"YamlPackLoader",
"load_yaml",
]
import logging
from dataclasses import InitVar, dataclass, field
from typing import Any, Dict, List, Optional, Type, TypeVar
import yaml
from beet import (
Cont... |
9,452 | compute file hash | # Copyright (c) Yugabyte, 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 to in writing, sof... |
9,453 | run | import copy
from functools import cached_property
import d20
import draconic
import math
from utils.dice import RerollableStringifier
from . import Effect
from .. import utils
from ..results import RollResult
class Roll(Effect):
def __init__(
self,
dice: str,
name: str,
higher: d... |
9,454 | read header | from __future__ import absolute_import, division, print_function
import copy
import re
from iotbx.detectors.detectorbase import DetectorImageBase
from iotbx.detectors import ImageException
from iotbx.detectors.eiger import vendortype_from_size
class EigerCBFImage(DetectorImageBase):
def __init__(self,filename):
... |
9,455 | test named class raises | import pytest
import pyccl as ccl
import functools
def all_subclasses(cls):
"""Get all subclasses of ``cls``. NOTE: Used in ``conftest.py``."""
return set(cls.__subclasses__()).union(
[s for c in cls.__subclasses__() for s in all_subclasses(c)])
def test_method_control_raises():
# All method con... |
9,456 | backlight | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Original code found at:
# https://gist.github.com/DenisFromHR/cc863375a6e19dce359d
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://... |
9,457 | tags | # 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... |
9,458 | exists iov | '''
Helper Script for StripO2O
@author: Huilin Qu
'''
import os
import subprocess
import logging
import json
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import sqlite3
def kill_subproc_noexcept(p):
'''Kill a subprocess without throwing OSError.
Used for c... |
9,459 | header 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
# --------------------------------... |
9,460 | test project notequals other project is true | # Copyright 2017 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... |
9,461 | type | # 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... |
9,462 | broadcast shape | """
A collection of functions used for inferring or correcting things before major computation
"""
import itertools
import numpy as np
import torch
from typing import Tuple, Union
def METHOD_NAME(shape_a: Tuple[int, ...], shape_b: Tuple[int, ...]) -> Tuple[int, ...]:
"""
Infers, if possible, the broadcast o... |
9,463 | raise xeq1 | # Tasks for testing
import time
import sys, shutil
import typing as ty
from pathlib import Path
import functools
import operator
import subprocess as sp
import pytest
from fileformats.generic import File
from ..core import Workflow
from ..submitter import Submitter
from ... import mark
need_docker = pytest.mark.skip... |
9,464 | get n grouped pixels above threshold | import numpy as np
from scipy.ndimage.filters import median_filter
from itertools import groupby
from operator import itemgetter
from banzai.stages import Stage
from banzai.utils import qc
from banzai.utils.stats import robust_standard_deviation
from banzai.logs import get_logger
logger = get_logger()
class Pattern... |
9,465 | misc | """
ebuild tree manifest/digest support
"""
__all__ = ("parse_manifest", "Manifest")
import errno
import operator
import os
from snakeoil.chksum import get_handler
from snakeoil.mappings import ImmutableDict
from .. import gpg
from ..fs.livefs import iter_scan
from ..package import errors
from . import cpv
def _w... |
9,466 | test length | # ----------------------------------------------------------------------------
# MODES: serial
# CLASSES: nightly
#
# Test Case: correlation.py
#
# Tests: Tests database correlations and automatic correlation.
#
# Programmer: Brad Whitlock
# Date: Mon Mar 22 08:28:25 PDT 2004
#
# Modifications:
# ... |
9,467 | kind | # 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... |
9,468 | read unsigned byte | """
Copyright (C) 2014 David Boddie <david@boddie.org.uk>
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 is dist... |
9,469 | test custom pytcti finalize | #!/usr/bin/python3 -u
# SPDX-License-Identifier: BSD-2
import unittest
from tpm2_pytss import *
from .TSS2_BaseTest import TSS2_EsapiTest
class MyTCTI(PyTCTI):
def __init__(self, subtcti, magic=None):
self._tcti = subtcti
self._is_finalized = False
self._error = None
if magic is... |
9,470 | join started threads | import threading
import time
from contextlib import contextmanager
from queue import Queue
import pytest
from .. import _thread_cache
from .._thread_cache import ThreadCache, start_thread_soon
from .tutil import gc_collect_harder, slow
def test_thread_cache_basics():
q = Queue()
def fn():
raise Run... |
9,471 | sample dims 3patch | import functools
import operator
import os.path
import random
import sys
import cv2
import numpy as np
from .extract_patches import extract_patches
from .patterns import patterns_2patch, patterns_3patch, patterns_4patch, patterns_5patch
from .chroma_blur import chroma_blur
# Data paths
label_file = '/p/lscratchh/brain... |
9,472 | decrease volume | # pylint: disable=C0111,R0903
"""Displays volume and mute status and controls for PulseAudio devices. Use wheel up and down to change volume, left click mutes, right click opens pavucontrol.
**Please prefer this module over the "pulseaudio" module, which will eventually be deprecated
Aliases: pulseout (for outputs, ... |
9,473 | store settings | #
# ABOUT
# Artisan Sampling Dialog
# LICENSE
# This program or module 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
# version 3 of the License, or (at your option) any l... |
9,474 | read input | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# 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 SOFTWARE IS PROVIDED "AS I... |
9,475 | post with refs and tags | import json
from pathlib import Path
from typing import Any, Dict, Sequence, cast, Tuple
import pytest
import pytest_asyncio
from aleph_message.models import AggregateContent, PostContent
from configmanager import Config
from sqlalchemy import insert
from aleph.chains.chain_service import ChainService
from aleph.db.a... |
9,476 | configure step | ##
# Copyright 2015-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
9,477 | get actions | # encoding: utf-8
from collections import defaultdict
import ckan.plugins as p
import ckan.tests.legacy.mock_plugin as mock_plugin
class MapperPlugin(p.SingletonPlugin):
p.implements(p.IMapper, inherit=True)
def __init__(self, *args, **kw):
self.calls = []
def _get_instance_name(self, instance... |
9,478 | get field | import logging
import aiohttp
import urllib
import http.client
import asab
#
L = logging.getLogger(__name__)
#
class InfluxDBTarget(asab.Configurable):
"""
InfluxDB 2.0 API parameters:
url - [required] url string of your influxDB
bucket - [required] the destination bucket for writes
org - [required] the para... |
9,479 | lookup storage | # This file is part of Checkbox.
#
# Copyright 2012-2014 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundatio... |
9,480 | do train | # encoding=utf8
# Copyright (c) 2021 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 requ... |
9,481 | streams | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import base64
import codecs
import hashlib
import hmac
import urllib.parse
from enum import Enum
from functools import wraps
from typing import Any, List, Mapping, Tuple
import pendulum
import requests
from airbyte_cdk import AirbyteLogger
from airbyte_cdk.... |
9,482 | test pick analysis via api 1 | import numpy as np
import pytest
from libertem.analysis.raw import PickFrameAnalysis
from libertem.io.dataset.memory import MemoryDataSet
from utils import _mk_random
def test_pick_analysis(lt_ctx):
"""
the other tests cover the pick job, this one uses the analysis
"""
data = _mk_random(size=(16, 16... |
9,483 | has object permission | from ipaddress import IPv4Address, IPv4Network
from rest_framework import permissions
class IsActiveUser(permissions.BasePermission):
"""
Allows access only to activated users.
"""
def has_permission(self, request, view):
# Authenticated users can have is_active = None (pending activation). ... |
9,484 | decompile | from fontTools.misc import sstruct
from fontTools.misc.textTools import bytesjoin, safeEval, readHex
from . import DefaultTable
import sys
import array
GPKGFormat = """
> # big endian
version: H
flags: H
numGMAPs: H
numGlyplets: H
"""
# psFontName is a byte string which follows the record above. This is ze... |
9,485 | magnitude | """
Set of util functions for the section similarity project.
"""
import copy
import numpy as np
import json
import scipy.fftpack
import pylab as plt
def resample_mx(X, incolpos, outcolpos):
"""
Y = resample_mx(X, incolpos, outcolpos)
X is taken as a set of columns, each starting at 'time'
colpos, and... |
9,486 | test meta inheritance | import pytest
from iommi.declarative.dispatch import dispatch
from iommi.declarative.namespace import Namespace
from iommi.declarative.with_meta import with_meta
def test_empty():
@with_meta
class Test:
def __init__(self, foo):
assert foo == 'bar'
Test('bar')
def test_constructor()... |
9,487 | send payment | # Copyright 2017 Akretion
# @author Raphaël Valyi <raphael.valyi@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import fields, models
from ..constants.br_cobranca import DICT_BRCOBRANCA_CURRENCY, get_brcobranca_bank
_logger = logging.getLogger(__name__)
clas... |
9,488 | create upstream mcp | import datetime
from datahub.emitter.mce_builder import (
make_data_platform_urn,
make_dataset_urn,
make_data_job_urn_with_flow,
make_data_flow_urn,
)
from datahub.emitter.mcp import MetadataChangeProposalWrapper
from datahub.emitter.rest_emitter import DatahubRestEmitter
from datahub.metadata.com.linke... |
9,489 | test inference no head | # Copyright 2022 The HuggingFace Team. 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 applicabl... |
9,490 | is url scheme registered | import os
import pathlib
import subprocess
import sys
from PySide6.QtCore import QSettings
from angrmanagement.utils.env import app_path
class AngrUrlScheme:
URL_SCHEME = "angr"
WIN_REG_PATH = "HKEY_CURRENT_USER\\Software\\Classes\\{}"
"""
Registers and handlers URL schemes to the operating system.... |
9,491 | set status led | #!/usr/bin/env python
########################################################################
# DellEMC S5212F
#
# Module contains an implementation of SONiC Platform Base API and
# provides the PSUs' information which are available in the platform
#
###################################################################... |
9,492 | plot3d | #Copyright (c) 2008 Erik Tollerud (etolleru@uci.edu)
import numpy as np
class Pca:
"""
A basic class for Principal Component Analysis (PCA).
p is the number of dimensions, while N is the number of data points
"""
_colors=('r','g','b','c','y','m','k') #defaults
def __calc(self):
A = s... |
9,493 | pick hue | # Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import colorsys
import random
__all__ = ['RandomColor', 'rand_color']
COLORMAP = {
'blue': {
'hue_range': [179, 257],
'lower_bounds': [[20, 100], [30, 86], [40, 80], [50, 74], [60, 60],
... |
9,494 | internal fit | """
This file is part of the PSL software.
Copyright 2011-2015 University of Maryland
Copyright 2013-2023 The Regents of the University of California
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
... |
9,495 | user delete | # coding=utf-8
import logging
from .rest_client import AtlassianRestAPI
log = logging.getLogger(__name__)
class Crowd(AtlassianRestAPI):
"""Crowd API wrapper.
Important to note that you will have to use an application credentials,
not user credentials, in order to access Crowd APIs"""
def __init__(... |
9,496 | is activation checkpoint available | import copy
import re
from typing import Callable
import pytest
import torch
import torchvision.models as tm
from torch.fx import GraphModule
import colossalai
from colossalai.core import global_context as gpc
from colossalai.fx import ColoTracer
from colossalai.fx._compatibility import is_compatible_with_meta
from c... |
9,497 | test function secrets in variables | from unittest import mock
from moto.core import DEFAULT_ACCOUNT_ID
from prowler.providers.aws.services.awslambda.awslambda_service import Function
AWS_REGION = "us-east-1"
class Test_awslambda_function_no_secrets_in_variables:
def test_no_functions(self):
lambda_client = mock.MagicMock
lambda_c... |
9,498 | absent | """
Infoblox host record management.
functions accept api_opts:
api_verifyssl: verify SSL [default to True or pillar value]
api_url: server to connect to [default to pillar value]
api_username: [default to pillar value]
api_password: [default to pillar value]
"""
def present(name=None, start_addr=... |
9,499 | network receive | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.