id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
3,600
grab aarch64 kernel
# TCG Plugins tests # # These are a little more involved than the basic tests run by check-tcg. # # Copyright (c) 2021 Linaro # # Author: # Alex Bennée <alex.bennee@linaro.org> # # SPDX-License-Identifier: GPL-2.0-or-later import tempfile import mmap import re from boot_linux_console import LinuxKernelTest class P...
3,601
get all sub messages
import textwrap import traceback from itertools import chain from typing import Iterable from celery import shared_task from django.utils.translation import gettext_lazy as _ from html2text import HTML2Text from common.utils import lazyproperty from common.utils.timezone import local_now from notifications.backends i...
3,602
error format
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
3,603
test getobject store
import os from bz2 import BZ2File from gzip import GzipFile from io import BytesIO from translate.storage import factory from translate.storage.directory import Directory def classname(filename): """returns the classname to ease testing""" classinstance = factory.getclass(filename) return str(classinstan...
3,604
add binary
# -*- mode: python ; coding: utf-8 -*- import importlib import os import pathlib import platform import sysconfig from pkg_resources import get_distribution from PyInstaller.utils.hooks import collect_submodules, copy_metadata THIS_IS_WINDOWS = platform.system().lower().startswith("win") THIS_IS_MAC = platform.syste...
3,605
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...
3,606
reader
"""Tests support for new syntax introduced by PEP 492.""" import sys import types import unittest from unittest import mock import asyncio from test.test_asyncio import utils as test_utils def tearDownModule(): asyncio.set_event_loop_policy(None) # Test that asyncio.iscoroutine() uses collections.abc.Corouti...
3,607
feature host mount
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Shadowing mountpoints will never be allowed. Additionally, for now: - The mountpoint must not exist, and is automatically created as ...
3,608
lines intersection
#!/usr/bin/env python # DEPRECRATED: Non-vector operators over non-vectorized data from numpy import array, cos, sin from math import atan2, sqrt def METHOD_NAME(xy1, xy2, xy3, xy4): """ Returns the intersection of two lines. """ (x1, y1) = xy1 (x2, y2) = xy2 (x3, y3) = xy3 (x4, y4) ...
3,609
to bytes
""" This table is stored in ARM9 and has two entries for every Pokémon base form. - The first one seems to be how many 16x16 tile slots (or 256 byte pixels) the Pokémon's sprite will take up. - The second is unknown, but also related to the sprite size? """ # Copyright 2020-2023 Capypara and the SkyTemple Contributo...
3,610
build xyz
# bluemira is an integrated inter-disciplinary design tool for future fusion # reactors. It incorporates several modules, some of which rely on other # codes, to carry out a range of typical conceptual fusion reactor design # activities. # # Copyright (C) 2021-2023 M. Coleman, J. Cook, F. Franza, I.A. Maione, S. McInto...
3,611
is port
# -*- coding: UTF-8 -*- ################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES). # # Copyright (c) 2018-...
3,612
test encode output
import pytest from typing import Any from mlserver.codecs import Base64Codec from mlserver.types import RequestInput, ResponseOutput, Parameters @pytest.mark.parametrize( "payload, expected", [ ([b"Python is fun", b"foo"], True), ([b"Python is fun", "foo"], False), (b"Python is fun",...
3,613
is sink
from abc import ABC, abstractmethod from copy import deepcopy from typing import Any, List import torch from torch.fx import Graph, Node from colossalai.auto_parallel.passes.runtime_apply_pass import ( runtime_apply, runtime_apply_for_iterable_object, runtime_comm_spec_apply, ) from colossalai.fx.codegen....
3,614
get projects
from __future__ import annotations from typing import Any, Iterable, Mapping, MutableMapping, Sequence from sentry_relay.processing import parse_release from sentry.models import Activity, Commit, OrganizationMember, Project from sentry.models.commitfilechange import CommitFileChange from sentry.notifications.types ...
3,615
atanh
import sys from collections.abc import Iterable from typing import Protocol, SupportsFloat, TypeVar, overload from typing_extensions import SupportsIndex, TypeAlias _T = TypeVar("_T") _T_co = TypeVar("_T_co", covariant=True) if sys.version_info >= (3, 8): _SupportsFloatOrIndex: TypeAlias = SupportsFloat | Support...
3,616
unlock nucypher keystore
import os import click from constant_sorrow.constants import NO_PASSWORD from nucypher.blockchain.eth.decorators import validate_checksum_address from nucypher.cli.literature import ( COLLECT_ETH_PASSWORD, COLLECT_NUCYPHER_PASSWORD, DECRYPTING_CHARACTER_KEYSTORE, GENERIC_PASSWORD_PROMPT, PASSWORD_...
3,617
data dir
"""Fixtures for the CircleCI tests.""" import base64 import os import pytest def pytest_addoption(parser): """Collect pytest parameters for running tests.""" parser.addoption( "--working_dir", action="store", default=( "/usr/local/miniconda/lib/python3.8/site-packages/xcp_...
3,618
deactivate document
"""Base utilities for COM applications like Word, Excel, Outlook.""" import atexit import logging import platform import struct from contextlib import contextmanager from pathlib import Path if platform.system() == "Windows": import win32api import win32com.client from pywintypes import com_error as COMEr...
3,619
make lookup
# -*- coding: utf-8 -*- """ Conversion from AST node to Mathic BaseElement objects """ from math import log10 from typing import Tuple import sympy from mathics.core.atoms import Integer, MachineReal, PrecisionReal, Rational, String from mathics.core.convert.expression import to_expression, to_mathics_list from math...
3,620
test directory does not exist oasis exception
import json import uuid from unittest import TestCase import os import io from tempfile import TemporaryDirectory from hypothesis import given from hypothesis.strategies import sampled_from from pathlib import Path from oasislmf.model_execution.conf import create_analysis_settings_json from oasislmf.model_execution....
3,621
test avoidoom
import numpy as np import pytest import torch from mmdet.utils import AvoidOOM from mmdet.utils.memory import cast_tensor_type def METHOD_NAME(): tensor = torch.from_numpy(np.random.random((20, 20))) if torch.cuda.is_available(): tensor = tensor.cuda() # get default result default_res...
3,622
offset polyline
from __future__ import print_function from __future__ import absolute_import from __future__ import division from compas.geometry import scale_vector from compas.geometry import normalize_vector from compas.geometry import add_vectors from compas.geometry import subtract_vectors from compas.geometry import cross_vecto...
3,623
init skale
# -*- coding: utf-8 -*- # # This file is part of SKALE Admin # # Copyright (C) 2019 SKALE Labs # # This program 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 Licens...
3,624
search pagination
import base64 from stix_shifter_utils.stix_transmission.utils.RestApiClientAsync import RestApiClientAsync from stix_shifter_utils.utils import logger import json import re DEFAULT_LIMIT = 10000 class APIClient(): PING_ENDPOINT = '_cluster/health?pretty' def __init__(self, connection, configuration): ...
3,625
test 2020
# python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2...
3,626
crop process
# Copyright (c) Alibaba, Inc. and its affiliates. from typing import Any, Dict, Optional, Union import torch from torchvision import transforms from modelscope.metainfo import Pipelines from modelscope.models import Model from modelscope.models.cv.image_denoise import NAFNetForImageDenoise from modelscope.outputs imp...
3,627
describe cost category definition
"""CostExplorerBackend class with methods for supported APIs.""" from .exceptions import CostCategoryNotFound from moto.core import BaseBackend, BackendDict, BaseModel from moto.utilities.tagging_service import TaggingService from moto.core.utils import iso_8601_datetime_without_milliseconds from moto.moto_api._intern...
3,628
test getopt
# test_getopt.py # David Goodger <dgoodger@bigfoot.com> 2000-08-19 from test.support import verbose, run_doctest from test.support.os_helper import EnvironmentVarGuard import unittest import getopt sentinel = object() class GetoptTests(unittest.TestCase): def setUp(self): self.env = self.enterContext(En...
3,629
open all channels
""" Driver for the Keithley S46 RF switch """ import re from itertools import product from typing import Any, Optional from qcodes.instrument import Instrument, VisaInstrument from qcodes.parameters import Parameter, ParamRawDataType class KeithleyS46LockAcquisitionError(Exception): pass class KeithleyS46Relay...
3,630
mass erase
# Test user script. @command(help="test command") def testcmd(f: float, i: int, s: str): assert isinstance(f, float) assert isinstance(i, int) assert isinstance(s, str) @command("anothertestcmd", help="second test command") def testcmd2(*args): assert isinstance(args, tuple) assert all(isinstance(...
3,631
ok clicked
import string from PyQt5 import QtCore, QtGui from PyQt5.QtWidgets import * import envi.memory as e_mem import envi.const as e_const import envi.memcanvas as e_canvas import envi.memcanvas.renderers as e_render from vqt.main import getSaveFileName class MemSearchDialog(QDialog): ''' gui for search cli comman...
3,632
filter ac
#!/usr/bin/env python # # Copyright (C) 2018 Gautier Hattenberger <gautier.hattenberger@enac.fr> # # This file is part of paparazzi. # # paparazzi 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,633
test outside component root request
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022) # # 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...
3,634
test delete and contains
import copy import unittest from scrapy.http import Headers class HeadersTest(unittest.TestCase): def assertSortedEqual(self, first, second, msg=None): return self.assertEqual(sorted(first), sorted(second), msg) def test_basics(self): h = Headers({"Content-Type": "text/html", "Content-Length...
3,635
get beam divergence ver
# -*- coding: utf-8 -*- """ [Name] BeamInfo [Description] BeamInfo hardware object informs mxCuBE (HutchMenuBrick) about the beam position and size. This is the Soleil PX1 version [Emited signals] beamInfoChanged beamPosChanged [Included Hardware Objects] [Example XML file] <device class = "BeaminfoPX2"> <user...
3,636
create es infotainment
from cereal import car from openpilot.selfdrive.car.subaru.values import CanBus VisualAlert = car.CarControl.HUDControl.VisualAlert def create_steering_control(packer, apply_steer, steer_req): values = { "LKAS_Output": apply_steer, "LKAS_Request": steer_req, "SET_1": 1 } return packer.make_can_msg(...
3,637
get concept filter
# SPDX-License-Identifier: EUPL-1.2 # Copyright (C) 2019 - 2020 Dimpact from django.db.models import Q from django.utils.translation import ugettext_lazy as _ from rest_framework import viewsets from rest_framework.exceptions import ValidationError from vng_api_common.caching import conditional_retrieve from vng_api_c...
3,638
unpack uint256
############################################################################### # # The MIT License (MIT) # # Copyright (c) typedef int GmbH # # 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 ...
3,639
test no indent
import errno import os import sys import textwrap import unittest import subprocess from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok class TestTool(unittest.TestCase): data = """ [["blorpie"],[ "whoops" ] , [ ...
3,640
try find existing pattern by ip type
import click import ipaddress from flow_counter_util.route import FLOW_COUNTER_ROUTE_PATTERN_TABLE, FLOW_COUNTER_ROUTE_MAX_MATCH_FIELD, DEFAULT_VRF, PATTERN_SEPARATOR from flow_counter_util.route import build_route_pattern, extract_route_pattern, exit_if_route_flow_counter_not_support from utilities_common.cli import ...
3,641
build waveform
from typing import Optional, List, Union, Set, Dict, Sequence, Any, Tuple from numbers import Real import itertools import numbers import sympy import numpy as np from qupulse.utils.sympy import IndexedBroadcast from qupulse.utils.types import ChannelID from qupulse.expressions import Expression, ExpressionScalar fro...
3,642
s3 exception handler
import functools import logging from dataclasses import dataclass from typing import Final, Optional from botocore import exceptions as botocore_exc from pydantic import ByteSize, parse_obj_as from servicelib.aiohttp.long_running_tasks.server import ( ProgressMessage, ProgressPercent, TaskProgress, ) from...
3,643
handle bad data
import os import struct import blackboxprotobuf from datetime import datetime from time import mktime from io import StringIO from io import BytesIO from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly def utf8_in_exte...
3,644
apply mapping to voxel
#!/usr/bin/env python3 from argparse import ArgumentParser import zipfile import shutil import os import random import string import wkw import numpy as np import re import json import itertools data_zip_filename = 'data.zip' data_zip_dirname = 'data_zip' def main(): args = create_parser().parse_args() mapp...
3,645
get next
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ import sys from typing import Any, List...
3,646
mailchimp config
import json from typing import Any, Dict, Generator import pydash import pytest from sqlalchemy.orm import Session from fides.api.db import session from fides.api.models.connectionconfig import ( AccessLevel, ConnectionConfig, ConnectionType, ) from fides.api.models.datasetconfig import DatasetConfig from...
3,647
flatten
# -*- coding: utf-8 -*- # FIXME: decide on whether we want mathics.core.expression.Atom vs. # mathics.core.parser.Atom # both having Atom at the end. Or should one # subclass the other? """ Classes and Objects that the parser uses to create an initial Expression (an M-Expression). The parser's AST is an M-Expression. ...
3,648
set cell
import os from contextlib import contextmanager from typing import Generator from unittest import mock import pytest from google.rpc.status_pb2 import Status from sentry.nodestore.bigtable.backend import BigtableNodeStorage from sentry.utils.kvstore.bigtable import BigtableKVStorage class MockedBigtableKVStorage(Bi...
3,649
abort file upload
from abc import ABC, abstractmethod from collections.abc import Callable from dataclasses import dataclass, field from aiohttp import web from models_library.api_schemas_storage import LinkType, UploadedPart from models_library.projects_nodes_io import LocationID, LocationName, StorageFileID from models_library.users ...
3,650
set up
from datetime import datetime from uuid import uuid4 from tracardi.domain.entity import Entity from tracardi.domain.event import EventSession from tracardi.domain.metadata import ProfileMetadata from tracardi.domain.profile import Profile from tracardi.domain.session import Session, SessionMetadata, SessionTime from tr...
3,651
load data
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2023 Scipp contributors (https://github.com/scipp) """ Plot the results of benchmarks. The script parses the CSV files generated by Google Benchmark with the options ``--benchmark_out_format=csv --benchmark_out=<path>.csv --benchmark_repetitions=<n>``. """ imp...
3,652
py unicode range literal
#!/usr/bin/env python3 """Generate code to be inserted into Python or Lex sources containing (parts of) regular expressions matching unicode characters belonging to particular categories. """ __copyright__ = "Copyright (C) 2018 Adrián Medraño Calvo" __license__ = "GNU GPLv2" import sys import unicodedata import argpa...
3,653
log error
# Copyright (c) Yugabyte, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
3,654
admin user
from dataikuapi.dss.app import DSSApp from dataikuapi.dss.dataset import DSSDataset from dataikuapi.dss.wiki import DSSWikiArticle class DSSWorkspace: """ A handle to interact with a workspace on the DSS instance. Do not create this class directly, instead use :meth:`dataikuapi.DSSClient.get_workspace` ...
3,655
test get hospitalization data
############################################################################# # Copyright (C) 2020-2021 German Aerospace Center (DLR-SC) # # Authors: Patrick Lenz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in ...
3,656
create fake modifier builder
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b...
3,657
conditional variance
# Copyright 2020 The GPflow Contributors. 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...
3,658
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__ ...
3,659
get
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
3,660
validate tr tensor
""" Core operations on tensors in Tensor Ring (TR) format """ import warnings import numpy as np import tensorly as tl from ._factorized_tensor import FactorizedTensor def tr_to_tensor(factors): """Returns the full tensor whose TR decomposition is given by 'factors' Re-assembles 'factors', which repres...
3,661
logs
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance # with the License. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "LICENSE.txt" file accom...
3,662
method or attr
import __main__ import re class Completer: """ [FUTURE] """ def __init__(self, namespace = None): """Create a new completer for the command line. Completer([namespace]) -> completer instance. Completer instances should be used as the completion mechanism of readline v...
3,663
imread
# Copyright 2020,2021 Sony Corporation. # Copyright 2021 Sony Group 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 ...
3,664
get storage account credential
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
3,665
asksaveasfilename
# # Instant Python # $Id: tkFileDialog.py 36560 2004-07-18 06:16:08Z tim_one $ # # tk common file dialogues # # this module provides interfaces to the native file dialogues # available in Tk 4.2 and newer, and the directory dialogue available # in Tk 8.3 and newer. # # written by Fredrik Lundh, May 1997. # # # options...
3,666
get test list
# Copyright 2019 Axel Huebl, Luca Fedeli, Maxence Thevenet # # # This file is part of WarpX. # # License: BSD-3-Clause-LBNL # requirements: # - module load python/3.7.0-anaconda3-5.3.0 import copy import os from functions_perftest import test_element def executable_name(compiler,architecture): return 'perf_tes...
3,667
test scalar
# 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...
3,668
on message sent
from pychess.System.Log import log from pychess.System.prefix import addDataPrefix from pychess.Utils.const import LOCAL from pychess.widgets.ChatView import ChatView from pychess.ic.ICGameModel import ICGameModel from pychess.ic.icc import DG_PLAYERS_IN_MY_GAME __title__ = _("Chat") __icon__ = addDataPrefix("glade/p...
3,669
test actions
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.test import TestCase from django.contrib import admin from ..admin.database_change_parameter import DatabaseChangeParameterAdmin from ..models import DatabaseChangeParameter from .factory import DatabaseChangeParameterFactory ...
3,670
random boxes
# Copyright (c) Facebook, Inc. and its affiliates. import numpy as np import unittest from copy import copy import cv2 import torch from fvcore.common.benchmark import benchmark from torch.nn import functional as F from detectron2.layers.roi_align import ROIAlign, roi_align class ROIAlignTest(unittest.TestCase): ...
3,671
array agg
# postgresql/ext.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from ...sql import expression from ...sql import elements from ...sql import funct...
3,672
ingest
import magic import logging from tempfile import mkdtemp from datetime import datetime from pkg_resources import get_distribution from followthemoney import model from banal import ensure_list from normality import stringify from pantomime import normalize_mimetype from ftmstore.utils import safe_fragment from service...
3,673
read image content
import base64 import io import json from typing import Any, Callable, Dict, cast import cloudpickle as pickle import pandas as pd from aqueduct_executor.operators.utils.enums import ArtifactType, SerializationType from PIL import Image _DEFAULT_ENCODING = "utf8" _DEFAULT_IMAGE_FORMAT = "jpeg" def _read_table_conten...
3,674
test change name should change perm name
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.test import RequestFactory from ralph.lib.transitions.decorators import transition_action from ralph.lib.transitions.exceptions import ( TransitionModelNotFoundError, TransitionN...
3,675
icu object
# -*- encoding: utf-8 -*- """ pdt_locales All of the included locale classes shipped with pdt. """ import datetime try: range = xrange except NameError: pass try: import icu as pyicu except ImportError: try: import PyICU as pyicu except ImportError: pyicu = None def METHOD_NAME...
3,676
test scrape
# Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE from unittest import mock import requests from django.test import override_settings from django.urls import reverse from promgen import models, tests, views TEST_SETTINGS = tests.Data("examples", "prom...
3,677
from shareable
# Copyright (c) 2023, NVIDIA CORPORATION. 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...
3,678
test blank input
from django.core import mail from django.urls import reverse from ...conf.test import override_dynamic_settings from ..test import AuthenticatedUserTestCase class UserChangePasswordTests(AuthenticatedUserTestCase): """tests for user change password RPC (/api/users/1/change-password/)""" def setUp(self): ...
3,679
method from exposed
from pathlib import Path import pytorch_lightning as pl import torch from flash.core.serve import ModelComponent, expose from flash.core.serve.types import Image, Label, Number, Repeated from flash.core.utilities.imports import _TORCHVISION_AVAILABLE from torch import Tensor if _TORCHVISION_AVAILABLE: from torchv...
3,680
read string
#!/usr/bin/python3 import argparse import glob import os import time import random COLOURS = (b'\xFF\x00\x00', b'\x00\xFF\x00', b'\x00\x00\xFF', b'\xFF\xFF\x00', b'\xFF\x00\xFF', b'\x00\xFF\xFF') def write_binary(driver_path, device_file, payload): with open(os.path.join(driver_path, device_file), 'wb') as open...
3,681
setup reset nvram
import os import re from avocado.utils import process from virttest import data_dir from virttest import libvirt_version from virttest import virsh from virttest.libvirt_xml import vm_xml from virttest.utils_test import libvirt def get_size_birth_from_nvram(vm_name, test): """ Get the size and birth values...
3,682
project
# 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...
3,683
set inventory
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
3,684
topojson convert
import contextlib import os import os.path import subprocess from datetime import datetime import geojson from django.conf import settings from django.core.management.base import BaseCommand from elections.models import Election TOPOJSON_BIN = os.path.join( settings.BASE_DIR, "..", "node_modules", "topojson", "no...
3,685
root
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
3,686
get flag new locals value
# Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
3,687
get categories
from enum import Enum from typing import List, Union import logging import math try: from flask_babel import _ except ModuleNotFoundError: def _(str): return str class VehicleType(Enum): CAR = 1 TRUCK_UPTO_4 = 2 PICKUP_UPTO_4 = 3 TRUCK_4_TO_10 = 4 TRUCK_12_TO_16 = 5 TRUCK_16_...
3,688
create
# Copyright 2015 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import os TAG = 'version_7' HASH = 'a921dab254f21cf5d397581c5efe58fa...
3,689
tear down
""" Test CRUD for authorization. """ import copy from cms.djangoapps.contentstore.tests.utils import AjaxEnabledTestClient from cms.djangoapps.contentstore.utils import reverse_course_url, reverse_url from common.djangoapps.student import auth from common.djangoapps.student.roles import CourseInstructorRole, CourseS...
3,690
rewrite alias
import contextlib from pathlib import Path from uuid import UUID from pydantic import UUID4 from mealie.core import root_logger from mealie.core.exceptions import UnexpectedNone from mealie.repos.all_repositories import AllRepositories from mealie.schema.recipe import Recipe from mealie.schema.recipe.recipe_settings ...
3,691
get defaults
# -*- coding: utf-8 -*- """ Created on Sat May 1 13:50:36 2021 @author: erwan """ import numpy as np import radis KNOWN_CONTEXT = ["paper", "notebook", "talk", "poster"] def METHOD_NAME(plotlib, context, style): expected_format = { "plot": { "plotlib": "ANY OF " + "/".join(['...
3,692
forward train
# Copyright (c) OpenMMLab. All rights reserved. import warnings from typing import Dict, List, Optional, Sequence, Union import torch import torch.nn as nn from mmocr.models.common.dictionary import Dictionary from mmocr.registry import MODELS from mmocr.structures import TextRecogDataSample from .base import BaseDec...
3,693
table configs
from typing import Optional from uuid import uuid4 from citrine.exceptions import NotFound from citrine.resources.project import Project, ProjectCollection from tests.utils.fakes import FakeDatasetCollection from tests.utils.fakes import FakeDesignSpaceCollection, FakeDesignWorkflowCollection from tests.utils.fakes im...
3,694
execute
# Copyright 2019 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, ...
3,695
make ethereum transaction
import base64 import random import string from typing import Any, Optional from eth_utils.address import to_checksum_address from rotkehlchen.accounting.structures.balance import Balance from rotkehlchen.accounting.structures.evm_event import EvmEvent, EvmProduct from rotkehlchen.accounting.structures.types import Hi...
3,696
test validator chain validation fails
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
3,697
main
#!/usr/bin/python3 # This file is part of Cockpit. # # Copyright (C) 2018 Red Hat, Inc. # # Cockpit is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your optio...
3,698
is column list text encoding dict
__all__ = ['UdtfNode', 'ArgNode', 'PrimitiveNode', 'ComposedNode', 'AnnotationNode', 'TemplateNode'] import sys from abc import abstractmethod import TableFunctionsFactory_transformers as transformers import TableFunctionsFactory_util as util if sys.version_info > (3, 0): from abc import ABC from...
3,699
context encoder input
#!/usr/bin/env python3 # 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. # hack to make sure -m transformer/generator works as expected """ Poly-encoder agent that ingests image features. """ f...