id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
17,200 | transform cors list output | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
17,201 | delete tags | # -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2014-2015 - Sagar Ghuge
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as ... |
17,202 | test failover group | # 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.
#----------------------------------------------------------------------... |
17,203 | test request package exclusion | from mock import (
patch, call
)
from pytest import raises
import mock
from kiwi.package_manager.dnf4 import PackageManagerDnf4
from kiwi.exceptions import KiwiRequestError
class TestPackageManagerDnf4:
def setup(self):
repository = mock.Mock()
repository.root_dir = '/root-dir'
repo... |
17,204 | remove websites | import time
# path of host file in windows
host_path = r"C:\Windows\System32\drivers\etc\hosts"
# URL of websites to block
with open("block_urls.txt", "r") as url_file:
block_list = [url.strip() for url in url_file]
# redirecting above URLs to this localhost to ensure blocking
redirect = "127.0.0.1"
def block_... |
17,205 | docs build | from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional
import click
from great_expectations.cli import toolkit
from great_expectations.cli.build_docs import build_docs
from great_expectations.cli.pretty_printing import cli_message, cli_message_list
from great_expectations.core.usage_stat... |
17,206 | use light mode | # -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) - The Getting Things GNOME Team
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public Lic... |
17,207 | test compare matrices | import unittest
from avocado.utils import data_structures
class TestDataStructures(unittest.TestCase):
"""
Unit tests for avocado.utils.data_structures
"""
def test_ordered_list_unique(self):
"""
Verify only unique items are there and the order is kept
"""
orig = [1,... |
17,208 | test stddev mag | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2023 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
17,209 | test usysident | #!/usr/bin/env python
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that i... |
17,210 | tear down | #!/usr/bin/env python
"""
_Monitoring_t_
Unit tests for the WMBS Monitoring DAO objects.
"""
import os
import unittest
import threading
from WMCore.WMBS.File import File
from WMCore.WMBS.Fileset import Fileset
from WMCore.WMBS.Job import Job
from WMCore.WMBS.JobGroup import JobGroup
from WMCore.WMBS.Workflow import ... |
17,211 | jsonline | #!/usr/bin/env python3
##===--- iwyu-mapgen-qt.py ------------------------------------------------===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===-------------------------------------... |
17,212 | read file | #!/usr/bin/env python3
'''
NAME
latex2img - Converts LaTeX source to PNG or SVG file
SYNOPSIS
latex2img [options] INFILE
DESCRIPTION
This filter reads LaTeX source text from the input file
INFILE (or stdin if INFILE is -) and renders it to PNG image file.
Typically used to render math equations.
... |
17,213 | run | import os
from avocado.utils import process
from virttest import arch
from virttest import error_context
@error_context.context_aware
def METHOD_NAME(test, params, env):
"""
Test chardev hotplug.
1) Log into the guest.
2) Clear dmesg.
3) Add a null chardev, remove it
4) Add a file chardev b... |
17,214 | determine virtual qedge option group | #!/bin/env python3
# This file contains utilities/helper functions for general use within the Overlay module
import itertools
import os
import sys
import traceback
from typing import Dict, Optional, Set, Tuple, List
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../../UI/OpenAPI/python-flask-server/")... |
17,215 | secret | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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
fr... |
17,216 | get visas | import os
import datetime
import uuid
from autoslug import AutoSlugField
from django.db import models
from django.conf import settings
from coredata.models import VISA_STATUSES as REAL_VISA_STATUSES, Person, Unit
from django.utils import timezone
from courselib.json_fields import JSONField
from courselib.storage imp... |
17,217 | test export class in estimator | # Copyright 2017 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... |
17,218 | test async gen no flag is async |
import pytest
from tests_python.debugger_unittest import IS_PY36_OR_GREATER, IS_CPYTHON
from tests_python.debug_constants import TEST_CYTHON
pytestmark = pytest.mark.skipif(not IS_PY36_OR_GREATER or not IS_CPYTHON or not TEST_CYTHON, reason='Requires CPython >= 3.6')
#!/usr/bin/env python3
import unittest
from _pydevd... |
17,219 | main | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Compute NODDI [1] maps using AMICO.
Multi-shell DWI necessary.
"""
import argparse
from contextlib import redirect_stdout
import io
import logging
import os
import sys
import tempfile
import amico
from dipy.io.gradients import read_bvals_bvecs
import numpy as np
f... |
17,220 | test add dispatch for types with python | # 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... |
17,221 | id | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
17,222 | tuple to word | # Copyright 2018-2021 Xanadu Quantum Technologies 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... |
17,223 | initial guess | """
This module implements the G0W0 approximation on top of `pyscf.tdscf.rhf_slow` TDHF implementation. Unlike `gw.py`, all
integrals are stored in memory. Several variants of GW are available:
* `pyscf.gw_slow`: the molecular implementation;
* `pyscf.pbc.gw.gw_slow`: single-kpoint PBC (periodic boundary condition) ... |
17,224 | msbg model quick | """Module for testing torch_msbg.py"""
import numpy as np
import pytest
import torch
from clarity.predictor.torch_msbg import MSBGHearingModel, torchloudnorm
from clarity.utils.audiogram import (
AUDIOGRAM_MILD,
AUDIOGRAM_MODERATE,
AUDIOGRAM_MODERATE_SEVERE,
)
@pytest.fixture
def use_torch():
"""Fixt... |
17,225 | shared integration test tmpdir | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import glob
import os
import subprocess
from contextlib import contextmanager
from textwrap import dedent
import pytest
from pex.atomic_directory ... |
17,226 | parent path str | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Rotation(_BaseLayoutHierarchyType):
# lat
# ---
@property
def lat(self):
"""
Rotates the map along meridians (in degrees North).
The 'lat' property is a number ... |
17,227 | keep white listed tags | from bs4 import BeautifulSoup
from bs4 import Tag
import typing
from tracim_backend.lib.mail_fetcher.email_processing.sanitizer_config.attrs_whitelist import (
ATTRS_WHITELIST,
)
from tracim_backend.lib.mail_fetcher.email_processing.sanitizer_config.class_blacklist import (
CLASS_BLACKLIST,
)
from tracim_backe... |
17,228 | set result | # stdlib
from enum import Enum
from typing import Any
from typing import List
from typing import Optional
from typing import Union
# third party
from result import Ok
from result import Result
# relative
from ...client.api import APIRegistry
from ...client.api import SyftAPICall
from ...node.credentials import SyftVe... |
17,229 | real initialize | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
urlencode_postdata,
urljoin,
)
class LinkedInLearningBaseIE(InfoExtractor):
_NETRC_MACHINE = 'linkedin'
_LOGIN_URL = 'http... |
17,230 | sort xafs | import numpy as np
from larch import Group, Make_CallArgs, parse_group_args
from larch.math import index_of, interp1d, remove_dups
from .xafsutils import ktoe, etok, TINY_ENERGY
@Make_CallArgs(["energy", "mu"])
def METHOD_NAME(energy, mu=None, group=None, fix_repeats=True, overwrite=True):
"""sort energy, mu pair... |
17,231 | get psu status | #
# Copyright (c) 2017-2021 NVIDIA CORPORATION & AFFILIATES.
# Apache-2.0
#
# 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... |
17,232 | test name unique | from contextlib import contextmanager
import time
from typing import Iterator
import numpy as np
import pytest
import optuna
from optuna._imports import try_import
from optuna.integration.dask import _OptunaSchedulerExtension
from optuna.integration.dask import DaskStorage
from optuna.testing.tempfile_pool import Nam... |
17,233 | test absent codetag | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
"""Tests for the misc checker."""
from pylint.checkers import misc
from pylint.testutil... |
17,234 | save | import logging
from datetime import datetime
from typing import List, Optional
from sqlalchemy.orm import with_polymorphic # type: ignore
from antarest.core.interfaces.cache import CacheConstants, ICache
from antarest.core.utils.fastapi_sqlalchemy import db
from antarest.study.common.utils import get_study_informati... |
17,235 | test password required | import os
import tempfile
import mitogen.ssh
import mitogen.utils
import testlib
import plain_old_module
class StubSshMixin(testlib.RouterMixin):
"""
Mix-in that provides :meth:`stub_ssh` executing the stub 'ssh.py'.
"""
def stub_ssh(self, STUBSSH_MODE=None, **kwargs):
os.environ['STUBSSH_MO... |
17,236 | test get all repeat records by domain | import uuid
from datetime import datetime, timedelta
from django.test import TestCase
from corehq.motech.repeaters.const import RECORD_PENDING_STATE
from corehq.motech.repeaters.dbaccessors import (
get_cancelled_repeat_record_count,
get_domains_that_have_repeat_records,
get_failure_repeat_record_count,
... |
17,237 | system data | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
17,238 | create upload file | from http import HTTPStatus
from typing import Annotated, Any, Optional, Union
from langflow.services.auth.utils import api_key_security, get_current_active_user
from langflow.services.cache.utils import save_uploaded_file
from langflow.services.database.models.flow import Flow
from langflow.processing.process import ... |
17,239 | test stop | #! /usr/bin/env python
#
"""
Test the `Node` class from the `elasticluster.cluster` module.
"""
#
# Copyright (C) 2017, 2019 University of Zurich
#
# 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 Fo... |
17,240 | perform get lines for data | # Copyright (c) 2015-2023 Vector 35 Inc
#
# 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, modify, merge, publish, ... |
17,241 | to json | import json
import logging
import os
import pathlib
import shutil
import stat
import sys
import tarfile
import zipfile
from pathlib import Path
from typing import (Any, Dict, List, Optional, Protocol, Union,
runtime_checkable)
import requests_cache
import toml
import multiversx_sdk_cli.config
from... |
17,242 | test patch object actions | import io
import pytest
from arcor2.data.common import ActionMetadata, Orientation, Pose, Position
from arcor2.data.events import ActionStateAfter, ActionStateBefore
from arcor2.exceptions import Arcor2Exception
from arcor2.object_types.abstract import Generic
from arcor2_runtime import action
from arcor2_runtime.act... |
17,243 | test cant delete | 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 ... |
17,244 | test tilt | """
Copyright(C) 2023 Altom Consulting
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... |
17,245 | to ordered dict for yaml dump | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from abc import abstractmethod
from typing import Any, Dict
from azure.ai.ml._utils.utils import dump_yaml
class RestTranslatableMixin:
... |
17,246 | filter marks | import re
from pathlib import Path
# Goals for Psithon Tests
# -----------------------
# [x] Notice if test undocumented
# [x] Notice if test unregistered to CMake/CTest or registered with wrong name
# [x] Notice if test unregistered to pytest or registered with wrong name
# [x] If test unregistered to pytest, fill in... |
17,247 | test list findings | from unittest.mock import patch
import botocore
from boto3 import session
from prowler.providers.aws.lib.audit_info.models import AWS_Audit_Info
from prowler.providers.aws.services.accessanalyzer.accessanalyzer_service import (
AccessAnalyzer,
)
from prowler.providers.common.models import Audit_Metadata
# Mock T... |
17,248 | exec | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for test host microVM network setup."""
import contextlib
import random
import string
from pathlib import Path
from nsenter import Namespace
from retry import retry
from framework import utils... |
17,249 | test global pool2d nhwc | # 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... |
17,250 | test throw on failure 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... |
17,251 | parse entry | """
update_planet
Imports all feeds for users who have filled in a valid website and website_rss,
the amount of items imported is limited to the defined FEED_LIMT
Usage: ./manage.py update_planet
"""
import logging
import time
from datetime import datetime, timezone
import bleach
import feedparser
from django.co... |
17,252 | get instrument object from valid config | from dataclasses import dataclass
import pandas as pd
from sysbrokers.IB.ib_instruments import (
futuresInstrumentWithIBConfigData,
NOT_REQUIRED_FOR_IB,
ibInstrumentConfigData,
)
from syscore.exceptions import missingData, missingInstrument, missingFile
from syscore.fileutils import resolve_path_and_filena... |
17,253 | id | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
17,254 | test compute aggregate variance | import os
import numpy as np
import xarray as xr
import vcm
import vcm.catalog
import intake
import pytest
from fv3net.diagnostics.offline._helpers import (
DATASET_DIM_NAME,
_compute_aggregate_variance,
compute_r2,
insert_aggregate_bias,
insert_aggregate_r2,
insert_column_integrated_vars,
r... |
17,255 | readinto | """
SocketIO imported from socket module in Python 3.
Copyright (c) 2001-2013 Python Software Foundation; All Rights Reserved.
"""
from socket import *
import io
import errno
__all__ = ['SocketIO']
EINTR = errno.EINTR
_blocking_errnos = (errno.EAGAIN, errno.EWOULDBLOCK)
class SocketIO(io.RawIOBase):
"""Raw I/... |
17,256 | set up | import os
import unittest
from avocado.core import exit_codes
from avocado.utils import process, script
from selftests.utils import AVOCADO, TestCaseTmpDir
SCRIPT_PRE_TOUCH = """#!/bin/sh -e
touch %s"""
TEST_CHECK_TOUCH = """#!/bin/sh -e
test -f %s"""
SCRIPT_POST_RM = """#!/bin/sh -e
rm %s"""
SCRIPT_PRE_POST_CFG =... |
17,257 | log msg | import hashlib
import os
import stat
import traceback
from enum import Enum
from pathlib import Path
from typing import List, Optional, Set, Union, final
import attr
@attr.define(kw_only=True, frozen=True)
class Report:
"""A common base class for different reports."""
def asdict(self) -> dict:
retur... |
17,258 | explain | """Accumulated Local Effects (ALE) explainer
Note:
This example repurposes the Partial Dependence format render data. As such, the label
"Average Prediction of {response}" is used for the y-axis instead of
"ALE of {response}".
"""
import datatable as dt
import json
import pandas as pd
from h2oaicore.mli.oss.byor.co... |
17,259 | standard app | import http.client
import json
import os
import socket
import ssl
import sys
from pathlib import Path
import ephemeral_port_reserve
import pytest
from xprocess import ProcessStarter
from werkzeug.utils import cached_property
run_path = str(Path(__file__).parent / "live_apps" / "run.py")
class UnixSocketHTTPConnect... |
17,260 | test authorized | # Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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 a... |
17,261 | test transfer | import torch
from bindsnet.learning import (
MSTDP,
MSTDPET,
Hebbian,
NoOp,
PostPre,
Rmax,
WeightDependentPostPre,
)
from bindsnet.network import Network
from bindsnet.network.nodes import Input, LIFNodes, SRM0Nodes
from bindsnet.network.topology import *
class TestConnection:
"""
... |
17,262 | test serialize deserialize | # Copyright (c) 2021-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 ... |
17,263 | mock twilio | from typing import Any
from unittest.mock import patch
from contextlib import contextmanager
import pytest
from users.models import JustfixUser
from users.tests.factories import UserFactory
from texting.models import (
PhoneNumberLookup,
Reminder,
REMINDERS,
get_lookup_description_for_phone_number,
... |
17,264 | test data generator with increasing batch size | import pytest
import scipy.sparse
import numpy as np
from rasa.utils.tensorflow.model_data import (
ragged_array_to_ndarray,
FeatureArray,
RasaModelData,
)
from rasa.utils.tensorflow.data_generator import (
RasaDataGenerator,
RasaBatchDataGenerator,
)
def METHOD_NAME(model_data: RasaModelData):
... |
17,265 | welford | import triton
import triton.language as tl
@triton.jit
def promote_to_tensor(x):
# Addition promotes to tensor for us
return x + tl.zeros((1,), tl.int1)
@triton.jit
def is_floating(x):
return promote_to_tensor(x).dtype.is_floating()
@triton.jit
def _prod_accumulate(a, b):
return a * b
@triton.ji... |
17,266 | typecast | import collections
import os
import yaml
from ansible.inventory.data import InventoryData
from ansible.module_utils.six import iteritems
from discovery.utils.services import ConfluentServices
from discovery.utils.utils import Logger, InputContext, singleton
logger = Logger.get_logger()
@singleton
class CPInventory... |
17,267 | test two markdown cell with code works | import re
from time import sleep
import nbformat
import pytest
from nbformat.v4.nbbase import (
new_code_cell,
new_markdown_cell,
new_notebook,
new_raw_cell,
)
import jupytext
from jupytext.cli import jupytext as jupytext_cli
from jupytext.compare import compare, compare_cells, compare_notebooks
def... |
17,268 | test cutout empty data | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2022
#
# 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
# r... |
17,269 | delete | from flask import request, make_response
from flask_restx import Resource
from flask_jwt_extended import jwt_required, get_jwt_identity
from lost.api.api import api
from lost.api.label.api_definition import label_leaf
from lost.api.label.parsers import update_label_parser, create_label_parser
from lost.db import model,... |
17,270 | clone vm with snapshot | import logging
from virttest import data_dir
from virttest.qemu_monitor import QMPCmdError
from provider import backup_utils
from provider.blockdev_stream_base import BlockDevStreamTest
from provider.virt_storage.storage_admin import sp_admin
LOG_JOB = logging.getLogger('avocado.test')
class BlockdevStreamBaseitse... |
17,271 | initialize | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
17,272 | export delete | """ ResourceManagementHandler
Module that allows users to access the ResourceManagementDB remotely.
"""
from DIRAC import gConfig, S_OK
from DIRAC.Core.DISET.RequestHandler import RequestHandler, getServiceOption
from DIRAC.ResourceStatusSystem.Utilities import Synchronizer
from DIRAC.ResourceStatusSystem.Service.Re... |
17,273 | pre save | # pylint: disable=unused-argument, no-self-use, avoid-list-comprehension
import difflib
from django.db.models import signals
from django.http import HttpResponseRedirect
from django.template.defaultfilters import safe
from django.utils.translation import gettext_lazy as _
from simple_history.admin import SimpleHistory... |
17,274 | get mec role 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... |
17,275 | test regulaization invalid type | import tensorflow as tf
from parameterized import parameterized
from opennmt.utils import losses
class LossesTest(tf.test.TestCase):
def testCrossEntropySequenceLoss(self):
logits = tf.constant(
[
[[0.1, 0.2, 0.9], [-1.2, 2.1, 0], [0.6, 0.3, 0.4]],
[[-2.2, -0.... |
17,276 | summarize | #!/usr/bin/env python3
import subprocess
import sys
import argparse
import time
import signal
from functools import partial
from multiprocessing import cpu_count
from concurrent import futures
import os
work1 = ['make', '-C']
work2 = ['make', '-C']
work3 = ['python', 'testqgen.py']
testsWork = {
'all':... |
17,277 | read folder | import asyncio
import typing
from enum import Enum
from typing import Any, Optional
from graphql import GraphQLError
import strawberry
from strawberry.file_uploads import Upload
from strawberry.permission import BasePermission
from strawberry.subscriptions.protocols.graphql_transport_ws.types import PingMessage
from ... |
17,278 | is current | import sys
import marshal
import contextlib
from distutils.version import StrictVersion
from .py33compat import Bytecode
from .py27compat import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE
from . import py27compat
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Requi... |
17,279 | calibrate | import sys
from abc import ABC, abstractmethod
from typing import Tuple, List
class CalInterface(ABC):
# Abstract base class to define interface for DIO calibration
# Use calibrate() to perform the calibration
@abstractmethod
def output_dio_calibration_data(self, dio_mode: str, port: int=0) -> Tuple[... |
17,280 | leave call | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
17,281 | get str | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import argparse
import os
import time
import in_place
from log import log
from version_update_item import VersionUpdateItem
X_VERSION_UPDATE = 'x-version-update'
X_INCLUDE_UPDATE = 'x-include-update'
ARTIFACT_ID_PAIRS = '... |
17,282 | test attributes | ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
17,283 | str enum | from __future__ import annotations
import hashlib
import time
from enum import Enum
from typing import Dict, Any, Tuple, List, Set, Union
from ..environment_data import LOG_FULL_OBJECT_INFO
def METHOD_NAME(value: Enum) -> str:
value = str(value)
idx = value.find('.')
if idx != -1:
value = value[... |
17,284 | validate tags request fields | import json
import logging
import requests
import ckan.lib.captcha as captcha
import ckan.model as model
import ckan.plugins.toolkit as tk
import ckanext.hdx_users.helpers.helpers as usr_h
from flask import Blueprint, make_response
from six import text_type
from ckan.common import config
from ckan.views.api import CON... |
17,285 | prelu numpy | # 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... |
17,286 | test constant | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.table import Column, Table
from astropy.time import Time
from gammapy.estimators import FluxPoints
import astropy.units as u
from astropy.coordinates import SkyCoord
fr... |
17,287 | test schedule job | import logging
import pytest
from udata.core.jobs.commands import job_label
from udata.core.jobs.models import PeriodicTask
from udata.tasks import job
log = logging.getLogger(__name__)
JOB_NAME = 'fake-job'
@job(JOB_NAME)
def do_nothing(self, *args, **kwargs):
pass
@job('not-scheduled')
def not_scheduled(se... |
17,288 | test fit atomic scattering | # -*- coding: utf-8 -*-
# Copyright 2016-2023 The pyXem developers
#
# This file is part of pyXem.
#
# pyXem 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 optio... |
17,289 | perform import | """
Settings for Verifiable Credentials are all namespaced in the VERIFIABLE_CREDENTIALS setting.
This is pretty similar to what the DRF does, like this:
VERIFIABLE_CREDENTIALS = {
'setting_1': 'value_1',
'setting_2': 'value_2',
}
This module provides the `vc_setting` object, that is used to access
Verifiable... |
17,290 | get texture format for data | import numpy as np
import pytest
from vispy.testing import run_tests_if_main
from vispy.visuals._scalable_textures import (
get_default_clim_from_dtype,
get_default_clim_from_data,
CPUScaledTextureMixin,
GPUScaledTextureMixin,
)
class Stub:
_ndim = 2
def __init__(self, data, **kwargs):
... |
17,291 | load reddit data | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
17,292 | build test two request | # 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... |
17,293 | set bn param | import torch
import nni.retiarii.nn.pytorch as nn
import math
import ops
import putils
from nni.retiarii.nn.pytorch import LayerChoice
class SearchMobileNet(nn.Module):
def __init__(self,
width_stages=[24,40,80,96,192,320],
n_cell_stages=[4,4,4,4,4,1],
stride_sta... |
17,294 | run | import json
from threading import Thread
from nfs_operations import cleanup_cluster
from cli.ceph.ceph import Ceph
from cli.exceptions import ConfigError, OperationFailedError
from cli.io.spec_storage import SpecStorage
from cli.utilities.filesys import Mount, Unmount
from utility.log import Log
log = Log(__name__)
... |
17,295 | as gather encoder | # Copyright 2019, 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 appli... |
17,296 | handler | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
17,297 | create fop | #!/usr/bin/env python
import time
import numpy as np
import matplotlib.pyplot as plt
import pygimli as pg
from pygimli.solver import parseArgToArray
from pygimli.physics.gravimetry import solveGravimetry
def density(poro, densMatrix=2510, densFluid=1000, satur=1,
mesh=None):
r"""
densMatrix,... |
17,298 | on sublime settings changed | from .collections import DottedDict
from .logging import debug
from .types import ClientConfig, debounced
from .types import read_dict_setting
from .types import Settings
from .types import SettingsRegistration
from .typing import Any, Optional, Dict, Callable
import os
import sublime
class ClientConfigs:
def __... |
17,299 | build expected version hex | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Setup script for PyPI; use CMakeFile.txt to build extension modules
import contextlib
import io
import os
import re
import shutil
import string
import subprocess
import sys
import tempfile
import setuptools.command.sdist
DIR = os.path.abspath(os.path.dirname(__file__)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.