id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
5,800 | mockingjay log mel base t adam w | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ upstream/mockingjay/hubconf.py ]
# Synopsis [ the mockingjay torch hubconf ]
# Author [ S3PRL ]
# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]
"""****... |
5,801 | gather batched | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
5,802 | thread mapper | from __future__ import annotations
import concurrent.futures
import contextlib
import math
import multiprocessing
import os
import subprocess
import sys
from typing import Any
from typing import Callable
from typing import Generator
from typing import Iterable
from typing import MutableMapping
from typing import Seque... |
5,803 | parse job streams | import re
import time
from typing import List
from lnst.Common.IpAddress import ipaddress
from lnst.Controller.Recipe import RecipeError
from lnst.Controller.RecipeResults import ResultLevel
from lnst.RecipeCommon.Perf.Results import PerfInterval
from lnst.RecipeCommon.Perf.Results import SequentialPerfResult
from l... |
5,804 | add pins | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2023 Regents of the University of California, Santa Cruz
# All rights reserved.
#
from openram.sram_factory import factory
from openram import OPTS
from .bitcell_base_array import bitcell_base_array
class dummy_array(bitcell_base_array):
"""
Gene... |
5,805 | get bluetooth paired reg | import plistlib
import datetime
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly
def get_bluetooth(files_found, report_folder, seeker, wrap_text):
for file_found in files_found:
file_found = str(file_f... |
5,806 | files double event | import sys
from _typeshed import Incomplete, StrOrBytesPath
from collections.abc import Iterable
from tkinter import Button, Entry, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, commondialog
from typing import IO, ClassVar
from typing_extensions import Literal
if sys.version_info >= (3, 9):
__all__ = [
... |
5,807 | setup method | """ Test for pint design matrix"""
import os
import numpy as np
from pint.models import get_model
from pint.toa import get_TOAs
from pint.pint_matrix import (
DesignMatrixMaker,
combine_design_matrices_by_quantity,
combine_design_matrices_by_param,
)
import astropy.units as u
from pinttestdata import datad... |
5,808 | get digital pin | #!/usr/bin/env python3
import math, random, time, requests, threading, sys, io
sys.stdout = io.StringIO()
sys.stderr = io.StringIO()
ROBOTINOIP = "127.0.0.1:80"
PARAMS = {'sid':'robertaProgram'}
MAXSPEED = 0.5
MAXROTATION = 0.57
def getAnalogPin(pos):
ANALOGPIN_URL = "http://" + ROBOTINOIP + "/data/analoginputarra... |
5,809 | get event | """
.. module: dispatch.plugins.dispatch_google_calendar.plugin
:platform: Unix
:copyright: (c) 2019 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import logging
import time
import uuid
from datetime import da... |
5,810 | message retention duration | # 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... |
5,811 | test reference internal | import pytest
import env
from pybind11_tests import ConstructorStats
from pybind11_tests import modules as m
from pybind11_tests.modules import subsubmodule as ms
def test_nested_modules():
import pybind11_tests
assert pybind11_tests.__name__ == "pybind11_tests"
assert pybind11_tests.modules.__name__ ==... |
5,812 | test helpful exceptions | """Tests of whether units behave."""
from assay import assert_raises
from numpy import array, nan
from skyfield.units import (
Angle, Distance, Velocity, UnpackingError, WrongUnitError,
)
try:
from astropy import units as u
except ImportError:
u = None
def needs_astropy(test):
"""Skip `test` if Astro... |
5,813 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
5,814 | items | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
# @author Jan-Lukas Wynen
"""Unit helpers and predefined units.
The following predefined units are available:
Dimensionless (those two names are equivalent):
- dimensionless
- one
Common units:
- angstrom
-... |
5,815 | test egress acl inner l4 dst port | import pytest
TABLE_TYPE = "CUSTOM_L3"
CUSTOM_TABLE_TYPE_MATCHES = [
"L4_SRC_PORT_RANGE",
"L4_DST_PORT_RANGE",
"ETHER_TYPE",
"TUNNEL_VNI",
"TC",
"INNER_IP_PROTOCOL",
"INNER_ETHER_TYPE",
"INNER_L4_SRC_PORT",
"INNER_L4_DST_PORT",
"VLAN_ID"
]
CUSTOM_TABLE_TYPE_BPOINT_TYPES = ["PORT... |
5,816 | getversion | #!/usr/bin/pythonw
# This file is part of JMRI.
#
# JMRI is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation. See the "COPYING" file for a copy
# of this license.
#
# JMRI is distributed in the hope... |
5,817 | load gold data | import json
import logging
import os
from typing import Any, Dict, Tuple
import tabulate
from progress.bar import Bar
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
datefmt="%m/%d/%Y %H:%M:%S",
level=logging.INFO,
)
logger = logging.getLogger(__name__)
SEPARATORS =... |
5,818 | get pipeline definition | # Copyright 2021 deepset GmbH. 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... |
5,819 | bind service commands | """
Higher order classes for Libvirt Sandbox Service (lxc) service container testing
"""
from avocado.utils import process
from avocado.utils import service
from . import lvsb_base
from . import virsh
class SandboxService(object):
"""
Management for a single new/existing sandboxed service
"""
def ... |
5,820 | test or group | from typing import Optional
import databases
import sqlalchemy
import ormar
from tests.settings import DATABASE_URL
database = databases.Database(DATABASE_URL)
metadata = sqlalchemy.MetaData()
class BaseMeta(ormar.ModelMeta):
metadata = metadata
database = database
class Author(ormar.Model):
class Me... |
5,821 | run | import os
import signal
import datetime
import time
import renderdoc as rd
from . import util
from .logging import log
class TargetControl():
def __init__(self, ident: int, host="localhost", username="testrunner", force=True, timeout=None, exit_kill=True):
"""
Creates a target control manager for ... |
5,822 | test lock without timeout | from unittest import TestCase
import attr
from unittest.mock import call, patch
from corehq.util.metrics.tests.utils import capture_metrics
from ..lockmeter import MeteredLock
class TestMeteredLock(TestCase):
def test_initially_not_locked(self):
fake = FakeLock()
MeteredLock(fake, "test")
... |
5,823 | test write header given fcontext | # -*- coding: utf-8 -*-
# Copyright 2017 Workiva
# 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 ... |
5,824 | test can get labels | # Copyright (C) 2022-2023 CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import io
from logging import Logger
from pathlib import Path
from typing import Tuple
import pytest
from cvat_sdk import Client, models
from cvat_sdk.api_client import exceptions
from cvat_sdk.core.proxies.projects import Project
from cva... |
5,825 | test constructor no arg | # Project: MapServer
# Purpose: xUnit style Python mapscript tests of classObj
# Author: Sean Gillies, sgillies@frii.com
#
# ===========================================================================
# Copyright (c) 2004, Sean Gillies
#
# Permission is hereby granted, free of charge, to any person obtaining a
# co... |
5,826 | test augment batch point clouds and bounding | # Copyright 2022 Waymo LLC.
#
# Licensed under the terms in https://github.com/keras-team/keras-cv/blob/master/keras_cv/layers/preprocessing_3d/waymo/LICENSE # noqa: E501
import numpy as np
from keras_cv.layers.preprocessing_3d import base_augmentation_layer_3d
from keras_cv.layers.preprocessing_3d.waymo.global_rand... |
5,827 | try downloading | #!/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.
import parlai.core.build_data as build_data
import os
import subprocess
import shutil
import csv
import time
from parla... |
5,828 | process failure and return | """
Integrates the computes together
"""
import warnings
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
from qcelemental.models import AtomicInput, AtomicResult, FailedOperation, OptimizationResult
from .config import get_config
from .exceptions import InputError, RandomError
from .procedures import get... |
5,829 | plot for multiple json | """
Quick Plot
----------
A tool to have quick and simple visualization from your data.
It can be use such as:
.. code-block:: console
$ deephyper-analytics quickplot nas_big_data/combo/exp_sc21/combo_1gpu_8_age/infos/results.csv
$ deephyper-analytics quickplot save/history/*.json --xy time val_r2
$ dee... |
5,830 | wrong return type | # This sample tests the use of field's converter parameter
# described in PEP 712.
from dataclasses import dataclass, field
from typing import Callable, overload
def converter_simple(s: str) -> int:
return int(s)
def converter_with_param_before_args(s: str, *args: int, **kwargs: int) -> int:
return int(s)
... |
5,831 | test versions rejects invalid version strings | # 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.
# Licensed to Elasticsearch B.V. under one ... |
5,832 | aks upgrades table format | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
5,833 | get status | import datetime
import io
import logging.handlers
import subprocess
import time
from _typeshed import StrOrBytesPath
from collections.abc import Callable, Iterable, Mapping, Sequence
from contextlib import AbstractContextManager
from email.message import Message
from hashlib import _Hash
from typing import IO, Any, Typ... |
5,834 | test types for adam | """Tests for SparseApply of AdamOptimizer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.fra... |
5,835 | 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
# --------------------------------... |
5,836 | is creation allowed for project | from __future__ import annotations
from datetime import timedelta
from typing import Any, Mapping, Optional
from sentry import features
from sentry.issues.grouptype import PerformanceRenderBlockingAssetSpanGroupType
from sentry.issues.issue_occurrence import IssueEvidence
from sentry.models import Organization, Proje... |
5,837 | eda simulate | # -*- coding: utf-8 -*-
import numpy as np
from ..misc import check_random_state, check_random_state_children
from ..signal import signal_distort, signal_merge
def METHOD_NAME(
duration=10,
length=None,
sampling_rate=1000,
noise=0.01,
scr_number=1,
drift=-0.01,
random_state=None,
rand... |
5,838 | create wtf field | # 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.
from wtforms.fields import IntegerField, SelectField
from wtforms.validators import DataRequired, Length, ... |
5,839 | list clusters | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
5,840 | test some very low effective balances that | from eth2spec.test.context import with_all_phases, with_phases, spec_state_test
from eth2spec.test.helpers.constants import PHASE0
from eth2spec.test.helpers.rewards import leaking
import eth2spec.test.helpers.rewards as rewards_helpers
@with_all_phases
@spec_state_test
@leaking()
def test_empty_leak(spec, state):
... |
5,841 | test intersect param | # -*- coding: utf-8 -*
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import os
import requests
from astropy import coordinates
from astropy.table import Table
from ..core import MOCServer
from astroquery.utils.mocks import MockResponse
pytest.importorskip("mocpy")
pytest.importorski... |
5,842 | test sanitize title | from __future__ import annotations
import os
import pytest
import comicapi.utils
import comictalker.talker_utils
def test_os_sorted():
page_name_list = [
"cover.jpg",
"Page1.jpeg",
"!cover.jpg",
"page4.webp",
"test/!cover.tar.gz",
"!cover.tar.gz",
"00.jpg... |
5,843 | test docstring | import math
import textwrap
import sys
import pytest
import threading
import traceback
import time
import numpy as np
from numpy.testing import IS_PYPY
from . import util
class TestF77Callback(util.F2PyTest):
sources = [util.getpath("tests", "src", "callback", "foo.f")]
@pytest.mark.parametrize("name", "t,t... |
5,844 | get leaf operations | # 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... |
5,845 | valid starter settings | """
helicopter monitoring and control module gas helicopters
"""
import os, sys, math, time
from pymavlink import mavutil
from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import mp_module
from MAVProxy.modules.lib import mp_settings
class GasHeliModule(mp_module.MPModule):
def __init__(self, mp... |
5,846 | patch base class | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from unittest.mock import MagicMock
from pytest import fixture
from source_qualaroo.source import QualarooStream, Responses, Surveys
from .helpers import NO_SLEEP_HEADERS, read_all_records
@fixture
def METHOD_NAME(mocker):
# Mock abstract methods to... |
5,847 | setup dummy data | import pytest
from datetime import datetime, timedelta
from pytz import utc
import pandas as pd
from flexmeasures.data.models.planning.utils import initialize_index
from flexmeasures.data.models.generic_assets import GenericAsset, GenericAssetType
from flexmeasures.data.models.data_sources import DataSource
from flex... |
5,848 | 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... |
5,849 | downgrade | """c_haines
Revision ID: 81c96876355a
Revises: ad4f37763020
Create Date: 2021-03-02 18:00:42.129765
"""
from alembic import op
import sqlalchemy as sa
import geoalchemy2
# revision identifiers, used by Alembic.
revision = '81c96876355a'
down_revision = 'ad4f37763020'
branch_labels = None
depends_on = None
def upg... |
5,850 | run loop | import asyncio
import copy
import logging
import time
from concurrent.futures import ThreadPoolExecutor
import cronitor
import pymongo
from discord.ext import commands, tasks
from requests.exceptions import HTTPError
from utils.cfg import cfg
from utils.reporter import report_error
from utils.rocketpool import rp
fro... |
5,851 | owns multipath | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
managevolumedb - stores connection details about managed volumes
"""
from __future__ import absolute_import
import json
import logging
import os
import sqlite3
from contextlib import closing
from vdsm.common import errors
from ... |
5,852 | test test escalation fcm message user settings | import pytest
from apps.mobile_app.demo_push import _get_test_escalation_fcm_message, get_test_push_title
from apps.mobile_app.models import FCMDevice, MobileAppUserSettings
@pytest.mark.django_db
def METHOD_NAME(
make_organization_and_user, make_alert_receive_channel, make_alert_group, make_alert
):
organiz... |
5,853 | test partition table info | """Test UDisks2 Partition Table."""
from dbus_fast import Variant
from dbus_fast.aio.message_bus import MessageBus
import pytest
from supervisor.dbus.udisks2.const import PartitionTableType
from supervisor.dbus.udisks2.data import CreatePartitionOptions
from supervisor.dbus.udisks2.partition_table import UDisks2Parti... |
5,854 | create dirs | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
5,855 | test databricks import workspaceitem with spec | import unittest
from pathlib import Path
import kfp
from kfp.dsl import PipelineParam
from databricks import ImportWorkspaceItemOp, DeleteWorkspaceItemOp
class TestImportWorkspaceItemOp(unittest.TestCase):
def test_databricks_import_workspaceitem_without_k8s_or_item_name(self):
def my_pipeline():
... |
5,856 | format session | # mautrix-telegram - A Matrix-Telegram puppeting bridge
# Copyright (C) 2021 Tulir Asokan
#
# 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 License, or
# (at your ... |
5,857 | minimize one norm | # Copyright (C) Unitary Fund
#
# This source code is licensed under the GPL license (v3) found in the
# LICENSE file in the root directory of this source tree.
"""Functions for finding optimal representations given a noisy basis."""
from typing import List, Optional, cast
import numpy as np
import numpy.typing as np... |
5,858 | check es index | # 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... |
5,859 | observation | # Copyright (c) 2019 Horizon Robotics. 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 applicab... |
5,860 | wait till lock owner finishes refreshing | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from asyn... |
5,861 | wait on sys message | #!/usr/bin/python
# To run these tests you must copy one of the example files to "creds.py" in
# this directory, and edit it for your environment. There are 2 example files
# in this directory:
#
# remote_creds.example.py: Configure the Selenium tests to run with BrowserStack
# local_creds.example.py: Configure the... |
5,862 | test structures convert isodose to roi button | import os
import pytest
from src.Controller.GUIController import MainWindow
from src.Model.PatientDictContainer import PatientDictContainer
from src.Model import ImageLoading
from pathlib import Path
from pydicom import dcmread
from pydicom.errors import InvalidDicomError
def find_DICOM_files(file_path):
"""Func... |
5,863 | parse args | #!/usr/bin/env python3
# -*- coding: utf-8; py-indent-offset: 4 -*-
#
# Author: Linuxfabrik GmbH, Zurich, Switzerland
# Contact: info (at) linuxfabrik (dot) ch
# https://www.linuxfabrik.ch/
# License: The Unlicense, see LICENSE file.
# https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING.... |
5,864 | test not matches | # 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... |
5,865 | test output | #!/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.
from parlai.scripts.display_data import display_data as display, setup_args
from parlai.agents.repeat_label.repeat_label ... |
5,866 | decorator | '''
The client class
'''
import certifi
import errno
import select
import six
import socket
import ssl
import threading
import websocket
import zlib
from contextlib import closing
def validate(self, skip_utf8_validation=False):
'''Patching websocket.ABNF frame class to pass rsv1 validation
'''
self.rsv1 ... |
5,867 | dates for week |
# Copyright 2010-2016 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''Thin wrapper for 'datetime' module from the standard library.
Provides timezone info for the local time. Based on example code
from standard library datetime documentation.
Main usage of this module is the function L{now()}. It imports all
from t... |
5,868 | get module name | """
Module loader, adapted for Cobbler usage
"""
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright 2006-2009, Red Hat, Inc and Others
# SPDX-FileCopyrightText: Adrian Likins <alikins@redhat.com>
# SPDX-FileCopyrightText: Michael DeHaan <michael.dehaan AT gmail>
import glob
import logging... |
5,869 | test fcm message user settings critical | from unittest.mock import patch
import pytest
from apps.base.models import UserNotificationPolicy, UserNotificationPolicyLogRecord
from apps.mobile_app.models import FCMDevice, MobileAppUserSettings
from apps.mobile_app.tasks.new_alert_group import _get_fcm_message, notify_user_about_new_alert_group
MOBILE_APP_BACKE... |
5,870 | image verify | #!/usr/bin/env python3
# group: rw
#
# Tests for shrinking images
#
# Copyright (c) 2016-2017 Parallels International GmbH
#
# 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 t... |
5,871 | cl gen workspace | #
# File : codelite.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2020, RT-Thread Development Team
#
# 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... |
5,872 | pointwise become partial | from __future__ import annotations
__all__ = ["OpenGLPMobject", "OpenGLPGroup", "OpenGLPMPoint"]
import moderngl
import numpy as np
from manim.constants import *
from manim.mobject.opengl.opengl_mobject import OpenGLMobject
from manim.utils.bezier import interpolate
from manim.utils.color import BLACK, WHITE, YELLOW... |
5,873 | test save and delete image | import os
from django.test import TestCase
from django.urls import reverse
from zds.gallery.tests.factories import GalleryFactory, UserGalleryFactory, ImageFactory
from zds.member.tests.factories import ProfileFactory
from django.conf import settings
class UserGalleryTest(TestCase):
def setUp(self):
sel... |
5,874 | step enable remote vendor management | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# ------------------------------------------------------------------... |
5,875 | pandas deserializer | # 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... |
5,876 | schema | """Base class for SQL-type streams."""
from __future__ import annotations
import abc
import typing as t
import singer_sdk.helpers._catalog as catalog
from singer_sdk._singerlib import CatalogEntry, MetadataMapping
from singer_sdk.connectors import SQLConnector
from singer_sdk.streams.core import Stream
if t.TYPE_CH... |
5,877 | describe | # Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... |
5,878 | read buffer | # -*- coding: utf-8 -*-
"""
Modified from https://github.com/plasmon360/python_newport_1918_powermeter
"""
from past.utils import old_div
from nplab.instrument import Instrument
from ctypes import *
import time
import numpy as np
class NewportPowermeter(Instrument):
def __init__(self, product_id, **kwargs):
... |
5,879 | gen script | # linux kernel packaging helpers
def get_arch(arch):
match arch:
case "ppc64le" | "ppc64" | "ppc":
return "powerpc"
case "aarch64":
return "arm64"
case "x86_64":
return "x86_64"
case "riscv64":
return "riscv"
case _:
... |
5,880 | do get | import functools
import hashlib
import http.server
import multiprocessing
import os
import random
import shutil
import socket
import sys
from contextlib import closing
import pytest
import salt.utils.files
class RequestHandler(http.server.SimpleHTTPRequestHandler):
"""
Modified request handler class
"""... |
5,881 | extra options | ##
# Copyright 2009-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
5,882 | save config | """
Common code for command line utilities (see bin/)
"""
import argparse
import difflib
import logging
import os
import sys
import tron
from tron import yaml
from tron.commands.client import Client
log = logging.getLogger("tron.commands")
class ExitCode:
"""Enumeration of exit status codes."""
success = 0... |
5,883 | apply texture displace axis x | # ##### 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... |
5,884 | earning and deduction entries does not exists | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, getdate
class DuplicateAssignment(frappe.ValidationError):
pass
class SalaryStructureA... |
5,885 | get git revision | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Utilities for version control systems"""
import os
import os.path as osp
import subprocess
import sys
# Local imports
from spyder.config.base import running_unde... |
5,886 | test restore with rename | """Test snapshot restore functionality"""
# pylint: disable=missing-function-docstring, missing-class-docstring, line-too-long
import os
import time
from curator.helpers.getters import get_indices, get_snapshot
from . import CuratorTestCase
from . import testvars
HOST = os.environ.get('TEST_ES_SERVER', 'http://127.0.0... |
5,887 | test dashboard rendering with two courses | """
Tests for the recently enrolled messaging within the Dashboard.
"""
import datetime
import ddt
from django.urls import reverse
from django.utils.timezone import now
from opaque_keys.edx import locator
from pytz import UTC
from common.test.utils import XssTestMixin
from common.djangoapps.student.models import Cou... |
5,888 | perm | import itertools
from ..core import symbols
from ..utilities.iterables import rotate_left
from .permutations import Permutation
def symmetric(n):
"""
Generates the symmetric group of order n, Sn.
Examples
========
>>> Permutation.print_cyclic = True
>>> list(symmetric(3))
[Permutation(2... |
5,889 | update completed partitions | from datetime import datetime
from typing import Sequence, Set
from snuba.redis import RedisClientType
OPTIMIZE_PREFIX = "snuba-optimize"
class NoOptimizedStateException(Exception):
"""
This exception indicates that there is no state stored in the optimized
tracker.
"""
pass
class OptimizedPa... |
5,890 | update release commit sha | #!/usr/bin/env python3
import os
import re
import subprocess
import sys
from urllib.parse import urlparse
import requests
import simplejson
github_token = os.environ["GITHUB_TOKEN"]
auth = (github_token, "x-oauth-basic")
repo = "getredash/redash"
def _github_request(method, path, params=None, headers={}):
if ur... |
5,891 | from numpy dataset | from typing import Dict, List, Optional, Tuple
import numpy as np
import pandas as pd
from ludwig.api_annotations import DeveloperAPI
from ludwig.constants import DASK_MODULE_NAME
from ludwig.data.dataframe.base import DataFrameEngine
from ludwig.utils.types import DataFrame
@DeveloperAPI
def is_dask_lib(df_lib) ->... |
5,892 | fwi gradient | import numpy as np
from devito import configuration, Function, norm, mmax, mmin
from examples.seismic import demo_model, AcquisitionGeometry, Receiver
from examples.seismic.acoustic import AcousticWaveSolver
from inversion_utils import compute_residual, update_with_box
# Turn off logging
configuration['log-level'] ... |
5,893 | action probabilities | # Copyright 2019 DeepMind Technologies Limited
#
# 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... |
5,894 | eval mel cepstral distortion | # 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.
"""
Signal processing-based evaluation using waveforms
"""
import csv
import numpy as np
import os.path as op
import torch
import tqdm
from... |
5,895 | get schema update command | import difflib
import re
from collections import namedtuple
from pathlib import Path
import pytest
import sqlalchemy
from packaging.version import Version
from sqlalchemy import create_engine
from sqlalchemy.schema import CreateTable, MetaData
import mlflow
from mlflow.environment_variables import MLFLOW_TRACKING_URI... |
5,896 | test all new methods are called | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Unit tests for abc.py."""
import unittest, weakref
from test import test_support
import abc
from inspect import isabstract
class TestABC(unittest.TestCase):
def test_abstractmethod_basics(self):
@abc... |
5,897 | test simple object | # -*- 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-2.0
#
# Unless require... |
5,898 | parse section break | #!/usr/bin/env python3
"""Convert Google Docs V1 API's JSON to Markdown.
"""
__copyright__ = "Copyright (C) 2019 Martin Blais"
__license__ = "GNU GPLv2"
from os import path
import argparse
import textwrap
import datetime
import hashlib
import collections
import json
import logging
import os
import pickle
import ppri... |
5,899 | test jit script signature | # Copyright (c) 2023 Intel 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 in writ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.