id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
15,000
get full
# 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...
15,001
oscar thumbnail
import logging import re from django import template from django.conf import settings from django.db.models.fields.files import ImageFieldFile from django.utils.encoding import smart_str from django.utils.html import escape from oscar.core.thumbnails import get_thumbnailer register = template.Library() kw_pat = re.c...
15,002
save category
import time import json from builtins import range from django.http import JsonResponse from django.contrib.auth.decorators import login_required from django.db.models import Max, Count from django.core.serializers.python import Serializer from django.views.decorators.http import require_POST from base.decorators imp...
15,003
delete
from copy import deepcopy from elasticsearch import NotFoundError from elasticsearch.helpers import bulk from wagtail.search.backends.elasticsearch6 import ( Elasticsearch6AutocompleteQueryCompiler, Elasticsearch6Index, Elasticsearch6Mapping, Elasticsearch6SearchBackend, Elasticsearch6SearchQueryC...
15,004
encoding
from _typeshed import StrPath, SupportsKeysAndGetItem from collections.abc import Container, Iterable, Iterator, Mapping, MutableMapping, Sequence from typing import TypeVar, overload from typing_extensions import Literal, TypeAlias from uuid import UUID _T = TypeVar("_T") _Token: TypeAlias = ( tuple[Literal["EMP...
15,005
test transform with post transformation hooks
# pylint: disable=wrong-or-nonexistent-copyright-notice from typing import Tuple, List from unittest.mock import create_autospec import cirq import numpy as np from pyquil.gates import MEASURE, RX, DECLARE, H, CNOT, I from pyquil.quilbase import Pragma, Reset from cirq_rigetti import circuit_transformers as transformer...
15,006
tcg 2 tcg helper decl error
# -*- coding: utf-8 -*- """ Type-transformation rules. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ = "s...
15,007
test mem
#!/usr/bin/env pmpython # # Copyright (C) 2016 Sitaram Shelke. # # 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. # # Thi...
15,008
test async handler
"""Test script to find circular references. Circular references are not leaks per se, because they will eventually be GC'd. However, on CPython, they prevent the reference-counting fast path from being used and instead rely on the slower full GC. This increases memory footprint and CPU overhead, so we try to eliminate...
15,009
parse
from datetime import datetime from typing import Any, Dict, List, Optional, Tuple, Union from uuid import uuid4 from flask import g from alerta.app import db from alerta.database.base import Query from alerta.models.enums import NoteType from alerta.utils.format import DateTime from alerta.utils.response import absol...
15,010
main
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import sys from PIL import Image, ImageDraw, ImageFont from charset import get_chars, special_chars, extra_chars, standard_chars EXTRA_BITMAP_MAX_WIDTH = 297 class FontBitmap: def __init__(self, language, font_size, font_name, foreground, ba...
15,011
test parent
from django.test import SimpleTestCase from eulxml.xpath import parse as parse_xpath from testil import eq, assert_raises from corehq.apps.case_search.xpath_functions.ancestor_functions import is_ancestor_comparison, \ _is_ancestor_path_expression from corehq.apps.case_search.filter_dsl import CaseFilterError from...
15,012
post wrapper
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import six import time from pytz import utc from sqlalchemy import Column, Integer, String from qbittorrentapi import Client from monitorrent.db import Base, DBSession...
15,013
mail recipient html
import cgi import logging import smtplib import socket import unicodedata from email import encoders from email import utils from email.header import Header from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from time import time from six import text...
15,014
push
#!/usr/bin/env python3 import sys import os.path from os import path import os, fnmatch import re import subprocess import com def cmd(c, ask_on_err = True): print("\n" + c) r = os.system(c) if r: print("### Error: " + str(r)) if ask_on_err: input("Press Enter to continue execution...") def define_set(f...
15,015
read sql query
"""Amazon Clean Rooms Module hosting read_* functions.""" import logging from typing import Any, Dict, Iterator, Optional, Union import boto3 import awswrangler.pandas as pd from awswrangler import _utils, s3 from awswrangler._sql_formatter import _process_sql_params from awswrangler.cleanrooms._utils import wait_qu...
15,016
check handshake timeout
import ssl import sys from collections import deque from collections.abc import Callable from enum import Enum from typing import Any, ClassVar from typing_extensions import Literal, TypeAlias from . import constants, events, futures, protocols, transports def _create_transport_context(server_side: bool, server_hostn...
15,017
get driver through device remotely
import re from . import utils from .constants import SSH_OPTION from .bootstrap import invoke, invokerc, WATCHDOG_CFG, SYSCONFIG_SBD class Watchdog(object): """ Class to find valid watchdog device name """ QUERY_CMD = "sudo sbd query-watchdog" DEVICE_FIND_REGREX = "\[[0-9]+\] (/dev/.*)\n.*\nDriver...
15,018
copy
# Authors: see git history # # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. from shapely import geometry as shgeo from ..utils.geometry import Point class Stitch(Point): """A stitch is a Point with extra information telling how to sew it.""" ...
15,019
test scan delete many
import pytest import responses from responses import matchers from io import BytesIO @responses.activate def test_scan_attachment(nessus): test_file = BytesIO(b'something to see here') responses.add(responses.GET, 'https://localhost:8834/scans/1/attachments/1?key=abcdef', b...
15,020
get schema
# -*- coding: utf-8 -*- # # This file is part of OpenMediaVault. # # @license http://www.gnu.org/licenses/gpl.html GPL Version 3 # @author Volker Theile <volker.theile@openmediavault.org> # @copyright Copyright (c) 2009-2023 Volker Theile # # OpenMediaVault is free software: you can redistribute it and/or modify #...
15,021
test update user
# coding: utf-8 import pytest import json from aiohttp import web from openapi_server.models.user import User @pytest.mark.skip("*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760") async def test_create_user(client): """Test case for create_user ...
15,022
load header
#!/usr/bin/env python3 # # Tool to manipulate QED image files # # Copyright (C) 2010 IBM, Corp. # # Authors: # Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> # # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. import sys import struct import ...
15,023
post operations
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
15,024
test lifespan shutdown failure
from __future__ import annotations from contextlib import asynccontextmanager from typing import TYPE_CHECKING, AsyncGenerator, Callable from unittest.mock import AsyncMock, MagicMock import pytest from pytest_mock import MockerFixture from litestar import Litestar, asgi from litestar._asgi.asgi_router import ASGIRo...
15,025
test shutdown check stderr
#!/usr/bin/env python # SPDX-License-Identifier: ISC # # test_eigrp_topo1.py # # Copyright (c) 2017 by # Cumulus Networks, Inc. # Donald Sharp # """ test_eigrp_topo1.py: Testing EIGRP """ import os import re import sys import pytest import json pytestmark = [pytest.mark.eigrpd] # Save the Current Working Director...
15,026
test get valid extra arguments
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
15,027
fix width
# SPDX-License-Identifier: GPL-3.0 # Copyright (c) 2014-2023 William Edwards <shadowapex@gmail.com>, Benjamin Bean <superman2k5@gmail.com> from __future__ import annotations import random from functools import partial from typing import Callable import pygame_menu from pygame_menu import locals from pygame_menu.local...
15,028
decorator
# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD # # 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 ...
15,029
tear down
"""Report tests.""" import pathlib import unittest from axe_selenium_python import Axe from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as expect from selenium.webdriver.support.ui import WebDriverWait class element_has_no_css_clas...
15,030
hdl wid 3
# # auto-pts - The Bluetooth PTS Automation Framework # # Copyright (c) 2017, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is ...
15,031
test cert to truststore
import os import shutil import distro import pytest @pytest.mark.parametrize("val,expected", [ ("t", True), # truthy ("T", True), ("true", True), ("True", True), ("TRUE", True), ("1", True), (1, True), (True, True), ("f", False), # falsy ("F", False), ("false", False), ...
15,032
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__ ...
15,033
test chrono duration subtraction equivalence date
# -*- coding: utf-8 -*- import datetime import pytest import env # noqa: F401 from pybind11_tests import chrono as m def test_chrono_system_clock(): # Get the time from both c++ and datetime date0 = datetime.datetime.today() date1 = m.test_chrono1() date2 = datetime.datetime.today() # The ret...
15,034
test create inventory source implied org
from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from awx.main.models import Organization, Inventory, InventorySource, Project @pytest.fixture def base_inventory(): org = Organization.objects.create(name='test-org') inv = Inventory.objects.create(name='tes...
15,035
test static generator
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Unit tests for stream data generators. """ import importlib import random import time import boto3 import pytest @pytest.mark.parametrize('module_name,repeat', [ ('streams.dg_referrer', 1), ('strea...
15,036
is literal
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import log...
15,037
solve branch
#!/usr/bin/env python """ Compare various elastic materials w.r.t. uniaxial tension/compression test. Requires Matplotlib. """ from __future__ import absolute_import from argparse import ArgumentParser, RawDescriptionHelpFormatter import sys import six sys.path.append('.') import numpy as nm def define(): """Def...
15,038
log prob
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import math import torch from torch.distributions.utils import broadcast_all from pyro.distributions import Normal, constraints from pyro.distributions.torch_distribution import TorchDistribution LOG_ROOT_TWO_PI = 0.5 * math.log(2.0...
15,039
rewrite platformdirs
import re import sys import subprocess from path import Path def remove_all(paths): for path in paths: path.rmtree() if path.isdir() else path.remove() def update_vendored(): update_pkg_resources() update_setuptools() def rewrite_packaging(pkg_files, new_root): """ Rewrite imports in ...
15,040
test target set
from __future__ import division, print_function, unicode_literals # set the desired pyglet mockup import sys sys.path.insert(0,'pyglet_mockup1') import pyglet assert pyglet.mock_level == 1 import unittest from cocos.director import director from cocos.cocosnode import CocosNode import cocos.actions as ac import sys...
15,041
init osx clipboard
import subprocess from pandas.compat import PY2, text_type from .exceptions import PyperclipException EXCEPT_MSG = """ Pyperclip could not find a copy/paste mechanism for your system. For more information, please visit https://pyperclip.readthedocs.org """ def METHOD_NAME(): def copy_osx(text): ...
15,042
start itunes subtitle
# Support for the iTunes format # Copyright 2010-2022 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following con...
15,043
test memory depth infinite soft is true
"""Tests for the GoByMajority strategies.""" import axelrod as axl from .test_player import TestPlayer C, D = axl.Action.C, axl.Action.D class TestHardGoByMajority(TestPlayer): name = "Hard Go By Majority" player = axl.HardGoByMajority default_soft = False expected_classifier = { "stochas...
15,044
process args
# This file is part of the Indico plugins. # Copyright (C) 2002 - 2023 CERN # # The Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. from itertools import chain import requests from flask import flash, redirec...
15,045
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...
15,046
set plugs
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
15,047
build
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rm, rmdir from conans import tools, AutoToolsBuildEnvironment import contextlib import os required_conan_version = ">=1.53.0" class LibxshmfenceConan(Con...
15,048
set up
# 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. # ---------------------------------------------------------------------...
15,049
open reference
import sys import resource import logging from whatshap.bam import ( AlignmentFileNotIndexedError, EmptyAlignmentFileError, SampleNotFoundError, ReferenceNotFoundError, ) from whatshap.variants import ReadSetReader, ReadSetError from whatshap.utils import IndexedFasta, FastaNotIndexedError, detect_file...
15,050
configure
# Copyright (c) 2011 Mounier Florian # Copyright (c) 2011 Paul Colomiets # Copyright (c) 2012 Craig Barnes # Copyright (c) 2012, 2014 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 ramnes # Copyright (c) 2014 Sean Vig # Copyright (c) 2014 dmpayton # Copyright (c) 2014 dequis # Copyright (c) 2017 D...
15,051
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 # --------------------------------...
15,052
append list
from __future__ import annotations from collections.abc import Callable, Generator, Iterable from dataclasses import dataclass from enum import Enum from .location import Location INDENT = 2 @dataclass class VarType: "A variable type with shape information." shape: list[int] class ExprASTKind(Enum): ...
15,053
find by permit condition guid
from datetime import datetime import uuid from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.orm import validates, backref from app.extensions import db from sqlalchemy.schema import FetchedValue from marshmallow import fields, validate from sqlalchemy.ext.hybrid import hybrid_property from app.api.util...
15,054
fuzzydevices
import atexit import threading try: import numpy as np except ImportError: print("The Audio library requires the numpy module (pip install numpy).") raise try: from pysoundcard import InputStream from pysoundcard import device_info except ImportError: print("The Audio library requires the pysoun...
15,055
test delete view project not found
import os import pytest from tempfile import TemporaryDirectory from mindsdb.api.http.initialize import initialize_app from mindsdb.migrations import migrate from mindsdb.interfaces.storage import db from mindsdb.utilities.config import Config @pytest.fixture(scope="session", autouse=True) def app(): old_minds_d...
15,056
model normal likelihood
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ Example: Horseshoe Regression ============================= We demonstrate how to use NUTS to do sparse regression using the Horseshoe prior [1] for both continuous- and binary-valued responses. For a more complex modeling and inf...
15,057
output
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
15,058
get current robot
import math import numpy as np import rospy from soccer_common import Transformation from soccer_msgs.msg import GameState from soccer_strategy.ball import Ball from soccer_strategy.robot import Robot from soccer_strategy.robot_controlled import RobotControlled from soccer_strategy.team import Team def update_avera...
15,059
test depth shader
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest import torch from pytorch3d.renderer.cameras import look_at_view_transform, PerspectiveCameras...
15,060
delete
from typing import List, Union from aiohttp.web_exceptions import HTTPBadRequest, HTTPNoContent from aiohttp_pydantic import PydanticView from aiohttp_pydantic.oas.typing import r201, r200, r204, r404, r400 from virtool_core.models.roles import AdministratorRole from virtool.api.response import NotFound, json_respon...
15,061
set max speed
__all__ = ["ethcard"] import tuned.logs from subprocess import * import re log = tuned.logs.get() class Nettool: _advertise_values = { # [ half, full ] 10 : [ 0x001, 0x002 ], 100 : [ 0x004, 0x008 ], 1000 : [ 0x010, 0x020 ], 2500 : [ 0, 0x8000 ], 10000 : [ 0, 0x1000 ], "auto" : 0x03F } _disabled = F...
15,062
test build saml config
from unittest.mock import patch from django.urls import reverse from django.utils.http import urlencode import pytest from allauth.account.models import EmailAddress from allauth.socialaccount.models import SocialAccount from allauth.socialaccount.providers.saml.utils import build_saml_config def test_acs(client, ...
15,063
import processor class
# Copyright 2021 Collate # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software...
15,064
projects
from operator import itemgetter from django.conf import settings from django.db import transaction from django.contrib.auth.models import User from django.db import models from django.db.models import signals, Q from django.db.models.functions import Lower from django.contrib.contenttypes.models import ContentType fro...
15,065
setup experiment
import functools import operator import os import os.path import sys import numpy as np # Bamboo utilities current_file = os.path.realpath(__file__) current_dir = os.path.dirname(current_file) sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python')) import tools # ==============================...
15,066
number
#!/usr/bin/python """ CodeHilite Extension for Python-Markdown ======================================== Adds code/syntax highlighting to standard Python-Markdown code blocks. Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/). Project website: <http://www.freewisdom.org/project/python-markdown/CodeHilite>...
15,067
from unix seconds
""" Functions to parse datetime objects. We're using regular expressions rather than time.strptime because: - They provide both validation and parsing. - They're more flexible for datetimes. - The date/datetime/time constructors produce friendlier error messages. Stolen from https://raw.githubusercontent.com/django/d...
15,068
dependencies
# # Copyright (c) 2016 Alex Richardson # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 # ("CTSRD"), as part of the DARPA CRASH research programme. # # Redistribution and use in source and binary ...
15,069
exists
""" msgfmt tool """ # Copyright (c) 2001 - 2014 The SCons Foundation # # 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, ...
15,070
execute
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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-...
15,071
url not recognized
import os import textwrap import traceback from typing import List from colorama import Fore, Style from ..assets.chars import Chars from ..core.exeptions import LNException from ..models import CombinedSearchResult, SearchResult from ..models.meta import MetaInfo from ..utils.platforms import Platform LINE_SIZE = 8...
15,072
getbcmreg
# -*- coding: utf-8 -*- from glob import glob from plat_hal.osutil import osutil try: from sonic_platform.config import DecodeFormat, DecodeMethod DECODE_FORMAT = DecodeFormat DECODE_METHOD = DecodeMethod except ImportError: raise ImportError(str(e) + "- required module not found") ERR_CODE = "ERR" ...
15,073
test get relay configuration with route type
# 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. # ---------------------------------------------------------------------...
15,074
test predict
from unittest.mock import patch import numpy as np import pytest import sklearn.datasets import sklearn.model_selection from ConfigSpace import ConfigurationSpace, UniformFloatHyperparameter from smac.model.gaussian_process.mcmc_gaussian_process import MCMCGaussianProcess from smac.model.gaussian_process.priors impor...
15,075
axisinfo
""" Plotting of string "category" data: ``plot(['d', 'f', 'a'], [1, 2, 3])`` will plot three points with x-axis values of 'd', 'f', 'a'. See :doc:`/gallery/lines_bars_and_markers/categorical_variables` for an example. The module uses Matplotlib's `matplotlib.units` mechanism to convert from strings to integers and pr...
15,076
parse query
import datetime import time import yaml from redash.query_runner import BaseQueryRunner, register from redash.utils import json_dumps, parse_human_time try: import boto3 from botocore.exceptions import ParamValidationError # noqa: F401 enabled = True except ImportError: enabled = False POLL_INTERV...
15,077
test election url
import unittest import datetime from collections import OrderedDict from django.test import TestCase from unittest import mock from data.templatetags import filters import data.utils as utils from data.utils import election_title import data.api_caller as api_caller class TestUtils(TestCase): def test_currency_...
15,078
hash code
# # 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...
15,079
update
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. try: import collections.abc as colle...
15,080
build list 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...
15,081
pre operations
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
15,082
gettext
import os.path from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage from django.template.defaultfilters import linebreaksbr, pluralize, slugify from django.urls import reverse from django.utils.translation import METHOD_NAME, ngettext from jinja2 import Environment from...
15,083
etag
# 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...
15,084
potential from kappa grid
import numpy as np import scipy.signal as scp from lenstronomy.Util import util from lenstronomy.Util import image_util from lenstronomy.Util import kernel_util """ class to compute lensing potentials and deflection angles provided a convergence map """ from lenstronomy.Util.package_util import exporter export, __al...
15,085
surface equ 3d jit
import numpy as np import numba @numba.njit def is_line_segment_intersection_jit(lines1, lines2): """check if line segments1 and line segments2 have cross point Args: lines1 (float, [N, 2, 2]): [description] lines2 (float, [M, 2, 2]): [description] Returns: [type]: [description] ...
15,086
test 0d
# Copyright 2021-2022 NVIDIA Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
15,087
create client
""" Test utilities for OAuth access token exchange """ from django.conf import settings from social_django.models import Partial, UserSocialAuth from common.djangoapps.third_party_auth.tests.utils import ThirdPartyOAuthTestMixin TPA_FEATURES_KEY = 'ENABLE_THIRD_PARTY_AUTH' TPA_FEATURE_ENABLED = TPA_FEATURES_KEY in ...
15,088
test simple cascade
from typing import Optional import databases import pytest import pytest_asyncio import sqlalchemy import ormar from tests.settings import DATABASE_URL database = databases.Database(DATABASE_URL) metadata = sqlalchemy.MetaData() class Band(ormar.Model): class Meta: tablename = "bands" metadata ...
15,089
put
from types import TracebackType from typing import Optional, Type, TypeVar, Mapping, Union import aiohttp import abc from hailtop import httpx from hailtop.utils import retry_transient_errors, RateLimit, RateLimiter from .credentials import CloudCredentials, AnonymousCloudCredentials SessionType = TypeVar('SessionType...
15,090
pre operations
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
15,091
test ping parameters via is cript
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # 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...
15,092
load
# Copyright (c) 2019 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 applic...
15,093
test validate data without login
import json import logging import os from datetime import datetime from allauth.utils import get_user_model from django.contrib.auth.models import AnonymousUser from django.db.models import signals from django.test import TestCase, RequestFactory, override_settings from django.core.files.uploadedfile import SimpleUpl...
15,094
test pickle numpy
from __future__ import annotations import _setup_test_env # noqa import sys import os import threading from io import BytesIO from returnn.util.task_system import * import unittest import gc SharedMemNumpyConfig["enabled"] = True SharedMemNumpyConfig["auto_pickling_min_size"] = 1 def pickle_dumps(obj): sio = B...
15,095
predict onnx
from typing import (TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple, Union) import warnings import logging import numpy as np import torch from rastervision.pytorch_learner.learner import Learner from rastervision.pytorch_learner.object_detection_utils import ( BoxList, TorchVisionODAdap...
15,096
get xform
"""Common code for creating and moving free-floating moving bases. The way to do this is to add a "virtual linkage" of 3 translational DOFs and 3 revolute DOFs. Some tuning may need to be done to the motor drivers in order to make the controller stable. """ import os from klampt.math import so3 def make(robotfile,...
15,097
cat
# Copyright 2009-2012 Jaap Karssenberg <jaap.karssenberg@gmail.com> # Copyright 2012 Damien Accorsi <damien.accorsi@free.fr> import os import logging from zim.plugins.versioncontrol import VCSApplicationBase from zim.applications import Application, ApplicationError logger = logging.getLogger('zim.vcs.bzr') cl...
15,098
test u64
#!/usr/bin/env python3 # Copyright (c) PLUMgrid, Inc. # Licensed under the Apache License, Version 2.0 (the "License") import os import unittest from bcc import BPF import multiprocessing MONITORED_SYSCALL=b"execve" class TestPercpu(unittest.TestCase): def setUp(self): try: b = BPF(text=b'BP...
15,099
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...