id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
19,200 | dst | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import datet... |
19,201 | multiply grads | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq import utils
from fairseq.dataclass.utils import gen_parser_from_dataclass
class FairseqOptimizer(object):
def... |
19,202 | id | # 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... |
19,203 | get i pv6 firewall rule | # 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
__all__ ... |
19,204 | test discard | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for twisted.protocols package.
"""
from twisted.internet import address, defer, protocol, reactor
from twisted.protocols import portforward, wire
from twisted.python.compat import iterbytes
from twisted.test import proto_helpers
fr... |
19,205 | get type | ''' BlueSky variable explorer
Provide flexible access to simulation data in BlueSky.
'''
from numbers import Number
from collections import OrderedDict
try:
from collections.abc import Collection
except ImportError:
# In python <3.3 collections.abc doesn't exist
from collections import Collection
impor... |
19,206 | close | # 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) AutoRest Code Generator.
# Changes may ... |
19,207 | test propagates unexpected error | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.core.exceptions import HttpResponseError, ResourceNotFoundError
from azure.keyvault.secrets._shared._polling import DeleteRecoverPollingMethod
... |
19,208 | widths changed | # (C) Copyright 2005-2021 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... |
19,209 | imshow keypoints | import numpy as np
import cv2
import torch
import os
from modules import devices
from annotator.annotator_path import models_path
import mmcv
from mmdet.apis import inference_detector, init_detector
from mmpose.apis import inference_top_down_pose_model
from mmpose.apis import init_pose_model, process_mmdet_results, v... |
19,210 | test absent | """
Test the ssh_known_hosts states
"""
import os
import shutil
import pytest
from tests.support.case import ModuleCase
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.runtests import RUNTIME_VARS
GITHUB_FINGERPRINT = "b8:d8:95:ce:d9:2c:0a:c0:e1:71:cd:2e:f5:ef:01:ba:34:17:55:4a:4a:64:80:d... |
19,211 | test xls jpeg png | # Copyright (C) 2020-2023 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
"""
Run clamscan tests.
"""
import os
import sys
sys.path.append('../unit_tests')
import testcase
class TC(testcase.TestCase):
@classmethod
def setUpClass(cls):
super(TC, cls).setUpClass()
@classmethod
... |
19,212 | test signature model resolves forward ref annotations | from types import ModuleType
from typing import Any, Callable, Iterable, List, Optional, Sequence, Union
from unittest.mock import MagicMock
import pytest
from typing_extensions import Annotated
from litestar import get
from litestar._signature import SignatureModel
from litestar.params import Body, Parameter
from li... |
19,213 | get refs | #!/usr/bin/env python3
# Copyright 2015 The Kubernetes 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 appl... |
19,214 | check perf | import unittest
from ctypes import *
from test import test_support
class StringArrayTestCase(unittest.TestCase):
def test(self):
BUF = c_char * 4
buf = BUF("a", "b", "c")
self.assertEqual(buf.value, "abc")
self.assertEqual(buf.raw, "abc\000")
buf.value = "ABCD"
sel... |
19,215 | set | # Copyright 2021 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... |
19,216 | hashless | """Utility functions."""
import contextlib
import hashlib
import re
import time
import urllib
from collections.abc import Collection, Generator, Iterable
from decimal import ROUND_HALF_UP, Decimal
from itertools import islice
from typing import cast
from xml.etree.ElementTree import Element # nosec # Element is not a... |
19,217 | cmake | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class NetlibLapack(CMakePackage):
"""LAPACK version 3.X is a comprehensive FORTRAN libra... |
19,218 | test validate secure password | # This file is part of Indico.
# Copyright (C) 2002 - 2023 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import hashlib
import pytest
from indico.core import signals
from indico.util.passwords import BCryptPas... |
19,219 | 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
__all__ =... |
19,220 | compute node graph | import hashlib
import logging
import math
import networkx as nx
from tribler.core.components.bandwidth_accounting.trust_calculation.graph_positioning import GraphPositioning
from tribler.core.exceptions import TrustGraphException
from tribler.core.utilities.unicode import hexlify
MAX_NODES = 500
MAX_TRANSACTIONS = 2... |
19,221 | prepare 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... |
19,222 | format log entry | from argparse import Namespace
from typing import Any, List, Optional
import determined.cli.render
from determined import cli
from determined.cli.errors import CliError
from determined.common import yaml
from determined.common.api import authentication, bindings
from determined.common.declarative_argparse import Arg, ... |
19,223 | test try add not a check to | # ----------------------------------------------------------------------------
# Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com)
#
# This file is part of Deepchecks.
# Deepchecks is distributed under the terms of the GNU Affero General
# Public License (version 3 or later).
# You should have received a ... |
19,224 | test plugins connection aws ssm post process | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from io import StringIO
import pytest
from unittest.mock import patch, MagicMock
from ansible.playbook.play_context import PlayContext
from ansible.plugins.loader import connection_loader
from ansible_collections.amazon.aws.p... |
19,225 | covers point | # 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... |
19,226 | prepare 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... |
19,227 | prepend to env | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2018-2022 Canonical Ltd.
#
# This program 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 Foundation.
#
# This program is distributed in the... |
19,228 | get supported currencies | from typing import TYPE_CHECKING
from saleor.plugins.base_plugin import BasePlugin, ConfigurationTypeField
from ..utils import METHOD_NAME
from . import (
GatewayConfig,
authorize,
capture,
confirm,
get_client_token,
process_payment,
refund,
void,
)
GATEWAY_NAME = "Dummy"
if TYPE_CHE... |
19,229 | test file issue | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
19,230 | 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... |
19,231 | test rgb too many components | import pytest
import pygame
from pygame_gui.core.colour_parser import parse_degree_string, is_u8_string, is_degree_string, is_percentage_string, parse_colour_or_gradient_string, is_valid_colour_string, is_valid_gradient_string
class TestColourParsing:
def test_rgb(self, _init_pygame):
assert parse_colour_... |
19,232 | test fortran frontend array ranges | # Copyright 2023 ETH Zurich and the DaCe authors. All rights reserved.
from fparser.common.readfortran import FortranStringReader
from fparser.common.readfortran import FortranFileReader
from fparser.two.parser import ParserFactory
import sys, os
import numpy as np
import pytest
from dace import SDFG, SDFGState, node... |
19,233 | apply suffix patterns | from django.urls import URLResolver, include, path, re_path, register_converter
from django.urls.resolvers import RoutePattern
from rest_framework.settings import api_settings
def _get_format_path_converter(suffix_kwarg, allowed):
if allowed:
if len(allowed) == 1:
allowed_pattern = allowed[0]... |
19,234 | get backup policy | # 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... |
19,235 | test richtext aside | import hashlib
from unittest import mock
from django.http import QueryDict
from django.test import TestCase, RequestFactory
from common.templatetags.common_tags import (
lookup,
add_as_string,
richtext_aside,
query_transform,
)
class TestTemplateTags(TestCase):
def test_lookup(self):
obj... |
19,236 | lock value | import contextlib
import datetime
import logging
from dataclasses import dataclass, field
from typing import AsyncIterator, Final
from uuid import uuid4
import redis.asyncio as aioredis
import redis.exceptions
from pydantic import NonNegativeFloat
from pydantic.errors import PydanticErrorMixin
from redis.asyncio.lock ... |
19,237 | transform | #-------------------------------------------------------------------------------
# Polyhedron
#-------------------------------------------------------------------------------
from PYB11Generator import *
@PYB11cppname("GeomPolyhedron")
class Polyhedron:
PYB11typedefs = """
using Polyhedron = GeomPolyhedron;
... |
19,238 | configure | from seedemu.core import ScopedRegistry, Node, Interface, Network, Emulator, Layer, Router, RealWorldRouter, BaseSystem
from typing import List, Dict
from ipaddress import IPv4Network
RoutingFileTemplates: Dict[str, str] = {}
RoutingFileTemplates["rs_bird"] = """\
router id {routerId};
protocol device {{
}}
"""
Rout... |
19,239 | add | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will b... |
19,240 | shipments updated | import logging
from django.db.models import signals
from karrio.server.core import utils
from karrio.server.conf import settings
from karrio.server.core.utils import failsafe
from karrio.server.events.serializers import EventTypes
from karrio.server.orders.serializers.order import compute_order_status
import karrio.se... |
19,241 | test valid signature is valid and returns | from time import timezone
import pytest
import base64
import typing as t
from math import floor
from datetime import datetime, timedelta, timezone
from svix.webhooks import hmac_data, Webhook, WebhookVerificationError
defaultMsgID = 'msg_p5jXN8AQM9LWM0D4loKWxJek'
defaultPayload = '{"test": 2432232314}'
defaultSecret ... |
19,242 | longitude | """Support for Xiaomi device tracker."""
import logging
import time
from datetime import timedelta
from homeassistant.const import * # noqa: F401
from homeassistant.components.device_tracker import (
DOMAIN as ENTITY_DOMAIN,
)
from homeassistant.components.device_tracker.const import SOURCE_TYPE_GPS
from homeassi... |
19,243 | as lwp str | import sys
from _typeshed import StrPath
from collections.abc import Iterable, Iterator, Sequence
from http.client import HTTPResponse
from re import Pattern
from typing import ClassVar, TypeVar, overload
from urllib.request import Request
__all__ = [
"Cookie",
"CookieJar",
"CookiePolicy",
"DefaultCook... |
19,244 | test gcloud install with errors | # coding: utf-8
#
# Copyright 2019 The Oppia 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 requi... |
19,245 | format freshdesk ticket creation message | """Webhooks for external integrations."""
from typing import List
from django.http import HttpRequest, HttpResponse
from zerver.decorator import authenticated_rest_api_view
from zerver.lib.email_notifications import convert_html_to_markdown
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.res... |
19,246 | visit call | # 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... |
19,247 | collect stats | import os
import re
from aiohttp import ClientSession
from sqlalchemy import distinct, select
from api import db, models, settings, utils
from api.constants import VERSION
from api.ext.plugins import get_plugins
from api.logger import get_exception_message, get_logger
from api.plugins import apply_filters
logger = g... |
19,248 | draw buttons | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
19,249 | pre runner | from __future__ import annotations
import json
import logging
from typing import TYPE_CHECKING, Any
from checkov.common.bridgecrew.code_categories import CodeCategoryConfiguration, CodeCategoryType
from checkov.common.bridgecrew.integration_features.base_integration_feature import BaseIntegrationFeature
from checkov.... |
19,250 | test full random low balances 1 | from random import Random
from eth2spec.test.context import (
with_all_phases,
spec_test,
spec_state_test,
with_custom_state,
single_phase,
low_balances, misc_balances,
)
import eth2spec.test.helpers.rewards as rewards_helpers
from eth2spec.test.helpers.random import (
randomize_state,
... |
19,251 | plot | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
import sys
from math import *
import json
import os
import csv
def data_cpu(name_demo, iteration, ii):
cpu = [0]*iteration
memory = [0]*iteration
i = 0
j = 0
a = name_demo
nb = len(name_demo)
while i != iteration*ii... |
19,252 | register | from typing import Union
from pydantic import validator
from tracardi.service.plugin.domain.METHOD_NAME import Plugin, Spec, MetaData, Form, FormGroup, FormField, FormComponent, \
Documentation, PortDoc
from tracardi.service.plugin.runner import ActionRunner
from tracardi.service.plugin.domain.result import Result... |
19,253 | symlink | #!/usr/bin/python3
"""
Lorax related utilities: Template parsing and execution
This module contains a re-implementation of the Lorax
template engine, but for osbuild. Not all commands in
the original scripting language are support, but all
needed to run the post install and cleanup scripts.
"""
import contextlib
impo... |
19,254 | run | import logging
from functools import partial
from pprint import pformat
from typing import Any, Dict, Sequence
# common imports
from common.credentials import LMHash, NTHash, Password, Username
from common.event_queue import IAgentEventPublisher
from common.types import AgentID, Event
from common.utils.code_utils impo... |
19,255 | initialize hgps | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# 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... |
19,256 | get flame install root | """
Flame utils for syncing scripts
"""
import os
import shutil
from openpype.lib import Logger
log = Logger.get_logger(__name__)
def _sync_utility_scripts(env=None):
""" Synchronizing basic utlility scripts for flame.
To be able to run start OpenPype within Flame we have to copy
all utility_scripts and... |
19,257 | replsym | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Contains functionality to perform find-and-replace of symbols in SDFGs. """
import re
import warnings
from typing import Any, Dict, Optional, Union
import sympy as sp
import dace
from dace import dtypes, properties, symbolic
from dace.co... |
19,258 | post | """Tornado handlers for frontend config storage."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from concurrent.futures import ThreadPoolExecutor
from threading import Event
from jupyter_server.base.handlers import APIHandler
from jupyter_server.ext... |
19,259 | storage write | #
# SPDX-License-Identifier: MIT
#
import re
import time
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfQemu
class StorageBase(OERuntimeTestCase):
def storage_mount(cls, tmo=1):
(status, output) = cls.targe... |
19,260 | create relations | # -*- coding: utf-8 -*-
from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin
from .pool import Pooler
from mamonsu.lib.plugin import PluginDisableException
class RelationsSize(Plugin):
DEFAULT_CONFIG = {
"enabled": "False"
}
key_rel_size_discovery = "pgsql.relation.size{0}"
def __i... |
19,261 | test settings append tuple setting when not | from types import ModuleType
import pytest
from mock import MagicMock
from mock import patch
from kolibri.plugins.utils.settings import apply_settings
@pytest.fixture
def django_settings():
with patch("django.conf.settings") as settings_mock:
settings_mock.configured = False
yield settings_mock
... |
19,262 | test logistic variance | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
19,263 | function018 | def function001():
print("function001 start")
def function002():
pass
def function003():
pass
def function004():
pass
def function005():
pass
def function006():
pass
def function007():
pass
def function008():
pass
def function009():
pass
def function010():
pass
def func... |
19,264 | get | r"""
This code was generated by
___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
| | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
| |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
Twilio - Intelli... |
19,265 | kb from file | from pathlib import Path
from typing import Callable, Iterable, List, Optional, Tuple
from thinc.api import (
Linear,
Maxout,
Model,
Ragged,
chain,
list2ragged,
reduce_mean,
residual,
tuplify,
)
from thinc.types import Floats2d
from ...errors import Errors
from ...kb import (
C... |
19,266 | set | # -*- encoding: utf-8 -*-
"""
keri.app.connecting module
"""
import re
import json
from ordered_set import OrderedSet as oset
from keri import kering
class Organizer:
""" Organizes contacts relating contact information to AIDs """
def __init__(self, hby):
""" Create contact Organizer
Para... |
19,267 | test curve multiple deposit | from typing import TYPE_CHECKING
import pytest
from rotkehlchen.accounting.mixins.event import AccountingEventType
from rotkehlchen.accounting.pnl import PNL
from rotkehlchen.accounting.structures.balance import Balance
from rotkehlchen.accounting.structures.evm_event import EvmEvent
from rotkehlchen.accounting.struc... |
19,268 | test configfile with specialization | import json
import os
import tempfile
import unittest
from urllib.parse import quote
from server.common.config.app_config import AppConfig
from server.common.errors import ConfigurationError
from server.tests import FIXTURES_ROOT, PROJECT_ROOT
from server.tests.unit.common.config import ConfigTests
class TestDataset... |
19,269 | set mocked audit info | from datetime import datetime
from unittest.mock import patch
import botocore
from boto3 import session
from prowler.providers.aws.lib.audit_info.audit_info import AWS_Audit_Info
from prowler.providers.aws.services.route53.route53_service import Route53Domains
from prowler.providers.common.models import Audit_Metadat... |
19,270 | test max pool grad grad impl | """
Copyright 2020 The OneFlow 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 law or agr... |
19,271 | get raw | from typing import Any
import pytest
from qcodes.parameters import ArrayParameter, ParamRawDataType
from .conftest import blank_instruments, named_instrument
class SimpleArrayParam(ArrayParameter):
def __init__(self, return_val: ParamRawDataType, *args: Any, **kwargs: Any):
self._return_val = return_va... |
19,272 | test build filled context chain | import datetime
from unittest import mock
from testifycompat import assert_equal
from testifycompat import assert_raises
from testifycompat import run
from testifycompat import setup
from testifycompat import TestCase
from tron import command_context
from tron import node
from tron import scheduler
from tron.core impo... |
19,273 | test defaults | #-----------------------------------------------------------------------------
# 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.
#-------------------------------------------------------------------... |
19,274 | delete application | from flask import Blueprint, url_for, redirect
from portality.api.current import Api400Error
from portality.core import app
from portality.decorators import api_key_required, api_key_optional, write_required
from portality.lib import plausible
from portality.view import api_v3
blueprint = Blueprint('api_v2', __name__... |
19,275 | get image to image inputs | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... |
19,276 | url | from aws_requests_auth.boto_utils import BotoAWSRequestsAuth
import os
import requests
import json
from ai2thor.util import makedirs
import ai2thor.downloader
import zipfile
import logging
from ai2thor.util.lock import LockSh, LockEx
from ai2thor.util import atomic_write
import io
from ai2thor.platform import STR_PLATF... |
19,277 | test null product resource | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2023 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
import pytest
from unittest.mock import MagicMock
from uuid import UUID
from datacube import Datacube
test_uuid = UUID('4ec8fe97-e8b9-11e4-87... |
19,278 | compress | import math
from abc import ABC
from abc import abstractmethod
from federatedml.util import LOGGER
from federatedml.secureprotol import PaillierEncrypt, IpclPaillierEncrypt
from federatedml.transfer_variable.transfer_class.cipher_compressor_transfer_variable \
import CipherCompressorTransferVariable
def get_homo_... |
19,279 | node upgrade | #!/usr/bin/python3
import os
import argparse
import subprocess
import requests
import urllib3
from common.utils import exit_if_no_permission, is_cluster_locked
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
CLUSTER_API = "cluster/api/v1.0"
snapdata_path = os.environ.get("SNAP_DATA")
snap_path = o... |
19,280 | finite diff | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... |
19,281 | list filtered actions for | from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from Products.CMFCore.ActionInformation import ActionInfo
from Products.CMFCore.ActionsTool import ActionsTool as BaseTool
from Products.CMFCore.interfaces import IActionCategory
from Products.CMFCore.interfaces import IAct... |
19,282 | clear | #!/usr/bin/env python
######################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2010, Rice University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... |
19,283 | api root | from collections import OrderedDict
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from django.urls import reverse
def perma_reverse(request, view, *args, **kwargs):
return request.build_absolute_uri... |
19,284 | name | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
19,285 | create tunnel | # Copyright (c) 2021 Microsoft Open 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
#
# THIS CODE IS PROVIDED ON AN *... |
19,286 | product 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
__all__ ... |
19,287 | generate token | # Copyright (C) 2019 Advanced Media Workflow Association
#
# 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 l... |
19,288 | from molecule | """ Core definition of a Materials Document """
from __future__ import annotations
from datetime import datetime
from typing import List, Mapping, Type, TypeVar, Union
from pydantic import BaseModel, Field
from pymatgen.core import Structure
from pymatgen.core.structure import Molecule
from emmet.core.mpid import M... |
19,289 | test two plugins are two | # 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.
"""TODO: Share better with, i.e. test MenuItemPlugin directly"""
impor... |
19,290 | construct headers | """Common Lambda Error Responses"""
import json
from collections import OrderedDict
from samcli.local.services.base_local_service import BaseLocalService
class LambdaErrorResponses:
# The content type of the Invoke request body is not JSON.
UnsupportedMediaTypeException = ("UnsupportedMediaType", 415)
... |
19,291 | clean values | """Load a meadow dataset and create a garden dataset."""
from owid.catalog import Dataset, Table
from etl.data_helpers import geo
from etl.helpers import PathFinder, create_dataset
# Get paths and naming conventions for current step.
paths = PathFinder(__file__)
# Columns to select from data, and how to rename them... |
19,292 | notify idle | from __future__ import annotations
from abc import abstractmethod
from asyncio import CancelledError, Condition, Task, as_completed, create_task, wait
from dataclasses import dataclass
from pathlib import Path
from time import monotonic
from typing import (
Any,
AsyncIterator,
Awaitable,
Generic,
M... |
19,293 | sa data size kilobytes | # 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
__all__ ... |
19,294 | parse files | import csv
import gzip
import json
import logging
import os
from typing import ClassVar, List, Optional
import pendulum
from calitp_data_infra.storage import (
GTFSDownloadConfig,
PartitionedGCSArtifact,
ProcessingOutcome,
fetch_all_in_partition,
get_fs,
)
from utils import GTFSScheduleFeedFile
fr... |
19,295 | validate offsets | from kafka.common import OffsetRequestPayload
from corehq.apps.app_manager.util import app_doc_types
from corehq.apps.change_feed.connection import get_simple_kafka_client
from corehq.apps.change_feed.exceptions import UnavailableKafkaOffset
from corehq.form_processor.models import XFormInstance
DOMAIN = 'domain'
MET... |
19,296 | get train str | """Helper functions for Titanic GPT-3 experiments."""
# form prompt, run GPT
import re
from typing import List, Optional, Tuple
import pandas as pd
from sklearn.model_selection import train_test_split
from llama_index.indices.utils import extract_numbers_given_response
from llama_index.llm_predictor import LLMPredic... |
19,297 | read file into array | #!/usr/bin/env python
import os
in_path = 'L1Trigger/L1TMuonEndCap/test/tools/pc_luts/firmware_data/'
# in_path = 'L1Trigger/L1TMuonEndCap/test/tools/pc_luts/firmware_MC/'
def main():
full_path = os.environ['CMSSW_BASE'] + '/src/' + in_path + '%s'
out_dir = os.environ['CMSSW_BASE'] + '/src/' + in_path.replace(... |
19,298 | get error code | import json
from mlflow.protos.databricks_pb2 import (
ABORTED,
ALREADY_EXISTS,
BAD_REQUEST,
CANCELLED,
CUSTOMER_UNAUTHORIZED,
DATA_LOSS,
DEADLINE_EXCEEDED,
ENDPOINT_NOT_FOUND,
INTERNAL_ERROR,
INVALID_PARAMETER_VALUE,
INVALID_STATE,
NOT_FOUND,
NOT_IMPLEMENTED,
PE... |
19,299 | set help string | ## @file
# This file is used to define class objects of INF file [Depex] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
'''
InfDepexObject
'''
from Library import DataType as DT
from Library import G... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.