id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
4,900 | enum val add documentation | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: reflection
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class EnumVal(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(f... |
4,901 | tear down | # Copyright (c) 2021, Frappe and Contributors
# See license.txt
import frappe
import unittest
from unittest.mock import patch
from press.press.doctype.app.test_app import create_test_app
from press.press.doctype.marketplace_app.test_marketplace_app import (
create_test_marketplace_app,
)
from press.marketplace.docty... |
4,902 | assert issue status | """Unit tests for the Jira issue status collector."""
from model.issue_status import IssueStatusCategory
from .base import JiraTestCase
class JiraIssuesTest(JiraTestCase):
"""Unit tests for the Jira issue status collector."""
METRIC_TYPE = "issue_status"
ISSUE_NAME = "Issue name"
CREATED = "1970-01... |
4,903 | request host | # BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, t... |
4,904 | dispatch | import hmac
import logging
from hashlib import sha256
from django.http import HttpRequest, HttpResponse
from django.utils.crypto import constant_time_compare
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
from sentry.api ... |
4,905 | generate script | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import io
import sys
import os
import argparse
from subprocess import PIPE, Popen
from pat... |
4,906 | auto | """
Support for Alternatives system
:codeauthor: Radek Rada <radek.rada@gmail.com>
"""
import logging
import os
import salt.utils.files
import salt.utils.path
__outputter__ = {
"display": "txt",
"install": "txt",
"remove": "txt",
}
log = logging.getLogger(__name__)
# Don't shadow built-in's.
__func_al... |
4,907 | get sliding window org sample rate | from calendar import IllegalMonthError, monthrange
from datetime import datetime, timezone
from typing import Optional
import sentry_sdk
from sentry import options
from sentry.dynamic_sampling.rules.utils import get_redis_client_for_ds
# In case a misconfiguration happens on the server side which makes the option in... |
4,908 | test bandpass | import unittest
import numpy as np
from tests.utils_testing import get_path_for_data_file
from urh.signalprocessing.Filter import Filter
from urh.signalprocessing.Modulator import Modulator
from urh.signalprocessing.Signal import Signal
import array
from matplotlib import pyplot as plt
from urh.cythonext import signal... |
4,909 | test from euler | import logging
from unittest import TestCase
import numpy as np
import pytest
from scipy.spatial.transform import Rotation as sp_rot
from aspire.utils import Rotation, utest_tolerance
logger = logging.getLogger(__name__)
class UtilsTestCase(TestCase):
def setUp(self):
self.dtype = np.float32
se... |
4,910 | test configure duo behavior | from unittest import TestCase
import requests_mock
from parameterized import parameterized
from hvac.adapters import JSONAdapter
from hvac.api.auth_methods import Mfa
from hvac.api.auth_methods.github import DEFAULT_MOUNT_POINT
class TestMfa(TestCase):
@parameterized.expand(
[
("default moun... |
4,911 | recupera parlamentares | from django.db.models import Count
from sapl.base.models import Autor
from sapl.comissoes.models import Participacao
from sapl.materia.models import Relatoria, UnidadeTramitacao, Autoria, Proposicao
from sapl.norma.models import AutoriaNorma
from sapl.parlamentares.models import Parlamentar, ComposicaoMesa, Dependente... |
4,912 | reset gui | import json
import cv2
import base64
import threading
import time
from datetime import datetime
from websocket_server import WebsocketServer
import logging
import numpy as np
from interfaces.pose3d import ListenerPose3d
import re
import os
from map import MAP
# Graphical User Interface Class
class GUI:
# Initiali... |
4,913 | hisat2 general stats table | """ MultiQC module to parse output from HISAT2 """
import logging
import re
from collections import OrderedDict
from multiqc.modules.base_module import BaseMultiqcModule
from multiqc.plots import bargraph
# Initialise the logger
log = logging.getLogger(__name__)
class MultiqcModule(BaseMultiqcModule):
"""HISA... |
4,914 | index | from datetime import datetime, timedelta
from dateutil import parser
from django.contrib.auth.decorators import login_required
from django.forms.models import modelformset_factory
from django.shortcuts import redirect
from django.contrib.auth.models import User
from tendenci.apps.theme.shortcuts import themed_respons... |
4,915 | test instantiated version is empty | import unittest
from brewpiVersion import AvrInfo
from distutils.version import LooseVersion
class VersionTestCase(unittest.TestCase):
def assertVersionEqual(self, v, versionString):
self.assertEqual(v.version, LooseVersion(versionString))
self.assertEqual(versionString, v.toString())
def ass... |
4,916 | generate | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.files import get, copy, rmdir
from conan.tools.scm import Version
import os
required_conan_version ... |
4,917 | test login no idp | import json
import os
import re
import sys
import unittest
from os import path
from unittest.mock import patch
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
import requests
from httpretty import HTTPretty
try:
from onelogin.saml2.utils import OneLogin_Saml2_Utils
except ImportError:
# Onl... |
4,918 | get voltage low threshold | #############################################################################
#
# Module contains an implementation of SONiC Platform Base API and
# provides the PSUs status which are available in the platform
#
#############################################################################
try:
from sonic_platform_... |
4,919 | put | """
SCP Module
==========
.. versionadded:: 2019.2.0
Module to copy files via `SCP <https://man.openbsd.org/scp>`_
"""
import logging
# Import salt modules
try:
import paramiko
import scp
HAS_SCP = True
except ImportError:
HAS_SCP = False
__proxyenabled__ = ["*"]
__virtualname__ = "scp"
log = lo... |
4,920 | is sentence boundary | #!/usr/bin/python2
# -*- coding: utf-8; mode: Python; indent-tabs-mode: t; tab-width: 4; python-indent: 4 -*-
# Copyright (C) 2012, 2014, 2015 Olga Yakovleva <yakovleva.o.v@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... |
4,921 | test output | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import opengate as gate
import opengate_core as g4
from scipy.spatial.transform import Rotation
import matplotlib.pyplot as plt
from opengate.user_hooks import check_production_cuts
paths = gate.get_default_test_paths(__file__, "gate_test036_adder_depth")
def create_si... |
4,922 | resolve | # Released under the MIT License. See LICENSE for details.
#
"""Provides the AppConfig class."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING
import _babase
if TYPE_CHECKING:
from typing import Any
_g_pending_apply = False # pylint: disable=invalid-name
class AppConfig(d... |
4,923 | test exec step | #!/usr/bin/env python3
# Copyright 2016 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test the mi interface for the debugger
import BoostBuild
import TestCmd
import re
def split_stdin_stdout(text):
"... |
4,924 | pop |
class CircularBuffer:
"""
Fixed capacity circular buffer that can be used as
a queue, stack or array
"""
def __init__(self, capacity:int, defaultValue=None) -> None:
if capacity <= 0:
raise ValueError("capacity must be greater than zero")
self.defaultValue = defaultValue... |
4,925 | test creation | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
4,926 | test override file | import os
from pathlib import Path
import pytest
from sunpy.data.data_manager.tests.mocks import MOCK_HASH, write_to_test_file
from sunpy.util.exceptions import SunpyUserWarning
def test_basic(storage, downloader, data_function):
data_function()
assert downloader.times_called == 1
assert len(storage._s... |
4,927 | add to register | import pytest
from DIRAC import gLogger
from DIRAC.MonitoringSystem.Client.DataOperationSender import DataOperationSender
gLogger.setLevel("DEBUG")
dataOpSender = DataOperationSender()
dataOpSender.monitoringOptions["Accounting", "Monitoring"]
dataOpMonitoringData = [
{
"OperationType": "se.getFile",
... |
4,928 | fit | """Transformer that can automatically featurize text columns using featuretools' nlp_primitives."""
import string
import featuretools as ft
from featuretools.primitives import (
DiversityScore,
MeanCharactersPerWord,
NumCharacters,
NumWords,
PolarityScore,
)
from evalml.pipelines.components.transf... |
4,929 | get queryset | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complia... |
4,930 | test lookups | # !/usr/bin/env python
# encoding: utf-8
"""
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors.
See also https://github.com/seed-platform/seed/main/LICENSE.md
"""
from django.test import TestCase
from seed.landing.models import SEEDUser as User
from seed.models.measures imp... |
4,931 | update train kd loss section | # 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... |
4,932 | set | #!/usr/bin/python
# SPDX-License-Identifier: LGPL-2.1-or-later
from __future__ import print_function
import os
import sys
import dbus
import dbus.service
import dbus.mainloop.glib
try:
from gi.repository import GObject
except ImportError:
import gobject as GObject
import bluezutils
class Player(dbus.service.Obje... |
4,933 | azure resource 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 ._en... |
4,934 | forward | from typing import Any, Callable, Optional, Tuple, Type
from ..config import registry
from ..model import Model
from ..shims import MXNetShim
from ..types import ArgsKwargs
from ..util import convert_recursive, is_mxnet_array, is_xp_array, mxnet2xp, xp2mxnet
@registry.layers("MXNetWrapper.v1")
def MXNetWrapper(
... |
4,935 | test t output | """Testing models module."""
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
from nilearn.glm import OLSModel
N = 10
X = np.c_[np.linspace(-1, 1, N), np.ones((N,))]
Y = np.r_[range(5), range(1, 6)]
MODEL = OLSModel(X)
RESULTS = MODEL.fit(Y)
""" R script
::
X = cbind(0:9 * ... |
4,936 | test field definition is non string iterable | from types import ModuleType
from typing import Any, Callable, Iterable, List, Optional, Sequence, Union
from unittest.mock import MagicMock
import pytest
from typing_extensions import Annotated
from litestar import get
from litestar._signature import SignatureModel
from litestar.params import Body, Parameter
from li... |
4,937 | test standardize shape with non iterable | import numpy as np
from keras_core import backend
from keras_core import initializers
from keras_core.backend.common.variables import AutocastScope
from keras_core.backend.common.variables import KerasVariable
from keras_core.backend.common.variables import standardize_shape
from keras_core.testing import test_case
... |
4,938 | skip test if missing module | #!/usr/bin/env python3
# Copyright (c) 2017-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that the wallet resends transactions periodically."""
import time
from test_framework.blocktools ... |
4,939 | get start hour | # 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, ... |
4,940 | is expired | # -*- coding: utf-8 -*-
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone
from rest_framework.authtoken.models im... |
4,941 | get metrics | """
This example is to show how to use an existing PyTorch model with Determined.
The flags and configurations can be found under const.yaml. For more information
regarding the optional flas view the original script linked below.
This implementation is based on:
https://github.com/huggingface/transformers/blob/v2.2.0/... |
4,942 | system info | import json
import logging
import os
from .env import DVC_NO_ANALYTICS
logger = logging.getLogger(__name__)
def collect_and_send_report(args=None, return_code=None):
"""
Collect information from the runtime/environment and the command
being executed into a report and send it over the network.
To pr... |
4,943 | test term negative matches | """
Typograhic Number Theory tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from pygments.lexers.tnt import TNTLexer
from pygments.token import Text, Operator, Keyword, Name, Number, \
... |
4,944 | test bom | from .. import util
machinery = util.import_importlib('importlib.machinery')
import codecs
import importlib.util
import re
import types
# Because sys.path gets essentially blanked, need to have unicodedata already
# imported for the parser to use.
import unicodedata
import unittest
import warnings
CODING_RE = re.co... |
4,945 | test select with setting none | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from unittest import TestCase
from lisa import LisaException, constants
from selftests.test_testsuite import cleanup_cases_metadata, select_and_check
class SelectorTestCase(TestCase):
def setUp(self) -> None:
cleanup_cases_metadata... |
4,946 | test fs | #!/usr/bin/env python
from unicorn import *
from unicorn.x86_const import *
from struct import pack
import regress
CODE_ADDR = 0x40000
CODE_SIZE = 0x1000
SCRATCH_ADDR = 0x80000
SCRATCH_SIZE = 0x1000
SEGMENT_ADDR = 0x5000
SEGMENT_SIZE = 0x1000
FSMSR = 0xC0000100
GSMSR = 0xC0000101
def set_msr(uc, msr, value, sc... |
4,947 | map aggregate | from queue import SimpleQueue
from torch.fx.node import map_arg
def _parent_name(target):
"""Get the qualified name of the parent module of submodule 'target'
Args:
target (str): target attribute of a call_module node (which is a str)
"""
*parent, name = target.rsplit(".", 1)
return pare... |
4,948 | get archive from bytes | from collections import namedtuple
from difflib import SequenceMatcher
import io
import logging
import os
import re
import tempfile
from typing import Iterable, Union
import zipfile
from guessit import guessit
import pysubs2
import rarfile
from subliminal.subtitle import fix_line_ending
from subliminal_patch.core impo... |
4,949 | crop module name | # Copyright 2015-2020, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Commandline argument parsing for our test runner.
"""
import getopt
import stem.util.conf
import stem.util.log
import test
from typing import Any, Dict, List, NamedTuple, Optional, Sequence
LOG_TYPE_ERROR = """\
'... |
4,950 | test locale qualification in | # -*- coding: utf-8 -*-
from tests.unit import AWSMockServiceTestCase
from boto.mturk.connection import MTurkConnection
from boto.mturk.question import ExternalQuestion
from boto.mturk.qualification import \
Qualifications, LocaleRequirement
MOCK_SERVER_RESPONSE = b"""
<MockServerResponse>
<Request>
<IsVa... |
4,951 | test simple | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
from astropy import units as u
from ... import splatalogue
SPLAT_DATA = 'CO_colons.csv'
def data_path(filename):
data_dir = os.path.join(os.path.dirname(__file__), 'data')
return os.path.join(data_dir, filename)
def... |
4,952 | subscribe to list |
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
"""
This script is to sync the groups and group subscribers with the campaign monitor
To run the command: python manage.py sync_campaign_monitor --verbosity 2
"""
def handle(self, *ar... |
4,953 | show extra columns | from django.utils.translation import get_language
from django.utils.translation import gettext as _
from django.utils.translation import gettext_noop
from memoized import memoized
from corehq.apps.es import filters as es_filters
from corehq.apps.es import forms as form_es
from corehq.apps.locations.permissions import... |
4,954 | test negative exponent | import math
import unittest
class PowTest(unittest.TestCase):
def powtest(self, type):
if type != float:
for i in range(-1000, 1000):
self.assertEqual(pow(type(i), 0), 1)
self.assertEqual(pow(type(i), 1), type(i))
self.assertEqual(pow(type(0), 1)... |
4,955 | split binary anon | # 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.
# @starlark-rust: allow_string_literals_in_type_expr
load("@prelude//cxx:cxx_toolchain_types.bzl", "CxxToolchainInfo")
load("//antlir/buck2... |
4,956 | options | #!/usr/bin/env python
# encoding: utf-8
# daniel.svensson at purplescout.se 2008
# Thomas Nagy 2016-2018 (ita)
"""
Support for Ruby extensions. A C/C++ compiler is required::
def options(opt):
opt.load('compiler_c ruby')
def configure(conf):
conf.load('compiler_c ruby')
conf.check_ruby_version((1,8,0))
conf... |
4,957 | exe | import enum
from _typeshed import Incomplete
from typing import Any, NamedTuple
from psutil._common import (
NIC_DUPLEX_FULL as NIC_DUPLEX_FULL,
NIC_DUPLEX_HALF as NIC_DUPLEX_HALF,
NIC_DUPLEX_UNKNOWN as NIC_DUPLEX_UNKNOWN,
AccessDenied as AccessDenied,
NoSuchProcess as NoSuchProcess,
ZombieProc... |
4,958 | plug class filter | import logging
import os
from functools import wraps
from importlib import import_module
from inspect import getmembers, isclass
from os import chdir, getcwd, walk
from os.path import join
from typing import Any
from dongtai_conf.settings import BASE_DIR
logger = logging.getLogger("dongtai.openapi")
PLUGIN_DICT = {}
... |
4,959 | test construction |
from os import path
import shutil
from tempfile import mkdtemp
from GangaCore.GPIDev.Lib.File.FileBuffer import FileBuffer
from GangaCore.testlib.GangaUnitTest import GangaUnitTest
from GangaCore.testlib.mark import external
from GangaCore.testlib.monitoring import run_until_completed
from GangaCore.GPIDev.Base.Prox... |
4,960 | grep for endianness fun | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2016-2018 (ita)
"""
Various configuration tests.
"""
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature, before_method, after_method
LIB_CODE = '''
#ifdef _MSC_VER
#define testEXPORT __declspec(dllexport)
#else
#define t... |
4,961 | stop all | import re
import shutil
import subprocess
import time
import pytest
from unit.applications.lang.python import ApplicationPython
from unit.option import option
prerequisites = {'modules': {'python': 'any'}}
client = ApplicationPython()
@pytest.fixture(autouse=True)
def setup_method_fixture(temp_dir):
client.app... |
4,962 | fixwikilinks | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Render the user / install guide in pdf and wiki formats
# Outputs: userguide.wiki, UserGuide.pdf, install.wiki, INSTALL.pdf
# Author: Alex Dumitrache <broscutamaker@gmail.com>
# License: GPL
import os, re, time, string
import urllib
from mkdoc_utils import system_or_e... |
4,963 | get guild webhooks | from typing import TYPE_CHECKING, Any, List, Optional
import discord_typings
from interactions.client.utils.serializer import dict_filter_none
from ..route import Route
__all__ = ("WebhookRequests",)
if TYPE_CHECKING:
from interactions.models.discord.snowflake import Snowflake_Type
from interactions import... |
4,964 | test function dump restore | import pytest
from redis.exceptions import ResponseError
from .conftest import assert_resp_response, skip_if_server_version_lt
engine = "lua"
lib = "mylib"
lib2 = "mylib2"
function = "redis.register_function{function_name='myfunc', callback=function(keys, \
args) return args[1] end, flags={ 'no-writes' }}... |
4,965 | test job logger warning and error messages | import logging
from unittest.mock import MagicMock, patch
import numpy as np
import pandas as pd
from evalml.automl.automl_search import AutoMLSearch
from evalml.automl.engine import evaluate_pipeline, train_pipeline
from evalml.automl.engine.engine_base import JobLogger
from evalml.automl.utils import AutoMLConfig
f... |
4,966 | test bad args | import imghdr
import io
import os
import pathlib
import unittest
import warnings
from test.support import findfile, TESTFN, unlink
TEST_FILES = (
('python.png', 'png'),
('python.gif', 'gif'),
('python.bmp', 'bmp'),
('python.ppm', 'ppm'),
('python.pgm', 'pgm'),
('python.pbm', 'pbm'),
('pytho... |
4,967 | run fn | # Copyright 2020 Uber Technologies, 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 by applica... |
4,968 | test load errors cant read | """Tests for certbot.plugins.storage.PluginStorage"""
import json
import sys
from typing import Iterable
from typing import List
from typing import Optional
import unittest
from unittest import mock
import pytest
from certbot import errors
from certbot.compat import filesystem
from certbot.compat import os
from certb... |
4,969 | test select labels inactive reasons | from django.urls import reverse
from pyquery import PyQuery as pq
from olympia import activity, amo, core
from olympia.activity.models import ActivityLog, ReviewActionReasonLog
from olympia.amo.tests import TestCase, addon_factory, user_factory
from olympia.reviewers.models import ReviewActionReason
class TestActiv... |
4,970 | isfile cached | #! /usr/bin/env python
# encoding: utf-8
"""
Windows-specific optimizations
This module can help reducing the overhead of listing files on windows
(more than 10000 files). Python 3.5 already provides the listdir
optimization though.
"""
import os
from waflib import Utils, Build, Node, Logs
try:
TP = '%s\\*'.decode... |
4,971 | get rate response | import json
from django.utils.translation import gettext_lazy as _
from corehq.apps.accounting.utils import fmt_dollar_amount
from corehq.apps.hqwebapp.async_handler import BaseAsyncHandler
from corehq.apps.hqwebapp.encoders import LazyEncoder
from corehq.apps.sms.models import INCOMING, OUTGOING, SQLMobileBackend
fr... |
4,972 | int2byte | # Partial copy of https://bitbucket.org/gutworth/six/src/8e634686c53a35092dd705172440a9231c90ddd1/six.py?at=default
# With some differences to take into account that the iterXXX version may be defined in user code.
# Original __author__ = "Benjamin Peterson <benjamin@python.org>"
# Base __version__ = "1.7.3"
# Copyri... |
4,973 | ftpparse | # Copyright (C) 2009-2014 Bastian Kleineidam
#
# 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 distr... |
4,974 | load name | # coding: utf-8
"""
This module provides a Loader class for locating and reading templates.
"""
import os
import sys
from pystache import common
from pystache import defaults
from pystache.locator import Locator
# We make a function so that the current defaults take effect.
# TODO: revisit whether this is necessa... |
4,975 | load from pandas | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
4,976 | multiple link or merge | from __future__ import annotations
from typing import Any, Generator, List, Optional, Set, Tuple, Union
from astroid import Break, Continue, NodeNG, Raise, Return
class ControlFlowGraph:
"""A graph representing the control flow of a Python program."""
start: CFGBlock
end: CFGBlock
# The unique id o... |
4,977 | postfix to infix | #!/usr/bin/env python
"""Expression Interconversion
This script provides a menu-driven interface to demonstrate interconversion
between different notations for arithmetic expressions i.e., Prefix, Infix
and Postfix.
Python: 3.10.8
External packages: None
Author: Siddhant Tiwari (github.com/stiwari-ds)
"""
import ... |
4,978 | set title | #!/usr/bin/env python3
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
# Replay the log from --dump-commands. To use first run
# kitty --dump-commands > file.txt
# then run
# kitty --replay-commands file.txt
# will replay the commands and pause at the end waiting for user to press enter
impor... |
4,979 | exercise functions | from __future__ import absolute_import, division, print_function
from boost_adaptbx.boost import rational
from libtbx.test_utils import Exception_expected, approx_equal, show_diff
from six.moves import range
from six.moves import zip
try:
from six.moves import cPickle as pickle
except ImportError:
import pickle
d... |
4,980 | is elliptical | #! /usr/bin/env python
import openturns as ot
import math as m
import os
class UniformNdPy(ot.PythonDistribution):
def __init__(self, a=[0.0], b=[1.0]):
super(UniformNdPy, self).__init__(len(a))
if len(a) != len(b):
raise ValueError("Invalid bounds")
for i in range(len(a)):
... |
4,981 | cholesky block diag | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
4,982 | 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... |
4,983 | get local root | # Copyright 2013 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 acc... |
4,984 | app wo domain | import os
import shutil
from typing import Generator, Iterator, Optional, Union
from unittest.mock import patch
import pytest
from flask import current_app
from fittrackee import create_app, db, limiter
from fittrackee.application.models import AppConfig
from fittrackee.application.utils import update_app_config_from... |
4,985 | to html | from pathlib import Path
import random
import string
import tempfile
import mlflow
import pandas as pd
from mlflow import MlflowClient
from giskard.utils.analytics_collector import analytics, anonymize
class ScanReport:
def __init__(self, issues, as_html: bool = True):
self.issues = issues
self.... |
4,986 | test get new url from user | from typing import Optional
import pytest
from demisto_sdk.commands.common.hook_validations.readme import (
ReadmeUrl,
ReadMeValidator,
)
from demisto_sdk.commands.common.legacy_git_tools import git_path
from demisto_sdk.commands.common.markdown_lint import run_markdownlint
from demisto_sdk.commands.format.up... |
4,987 | test sparse tfidf retriever regexp | #!/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.core.agents import create_agent_from_model_file
import parlai.utils.testing as testing_utils
import os
impo... |
4,988 | has file | #!/usr/bin/env python3
# ==============================================================================
#
# Copyright (C) 2022 Sophgo Technologies Inc. All rights reserved.
#
# TPU-MLIR is licensed under the 2-Clause BSD License except for the
# third-party components.
#
# =============================================... |
4,989 | preprocess | # 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... |
4,990 | show | from castle.cms.interfaces import IReferenceNamedImage
from castle.cms.interfaces import IVersionViewLayer
from DateTime import DateTime
from lxml.html import fromstring
from lxml.html import tostring
from plone import api
from plone.app.layout.viewlets.content import ContentHistoryView as BaseContentHistoryView
from p... |
4,991 | final commit id | # Copyright 2010-2023 The pygit2 contributors
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2,
# as published by the Free Software Foundation.
#
# In addition to the permissions in the GNU General Public License,
# the authors give ... |
4,992 | get last page | import logging
import multiprocessing
import os
import re
import shutil
import tempfile
import zipfile
from datetime import datetime
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from dimagi.utils.parsing import string_to_utc_datetime
from corehq.apps.export.const... |
4,993 | raises type err | # Copyright (c) 2021, 2021, Oracle and/or its affiliates.
# Copyright (C) 1996-2020 Python Software Foundation
#
# Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
def test_class_attr_change():
class A(object):
counter = 0
for i in range(10):
A.counter += 1
assert A.counte... |
4,994 | outputs | """
cartesian_to_spherical_fc
=========================
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.METHOD_NAME import Output, _Outputs
from ansys.dpf.core.operators.specification ... |
4,995 | 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
# --------------------------------... |
4,996 | ini2po | #
# Copyright 2005, 2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 la... |
4,997 | test curie pattern | # -*- coding: utf-8 -*-
"""Tests for the bioregistry client."""
import unittest
from typing import Iterable, Tuple
import bioregistry
from bioregistry import manager
from bioregistry.resolve import get_external
class TestResolve(unittest.TestCase):
"""Tests for getting Bioregistry content."""
def test_res... |
4,998 | on 200 | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
4,999 | test scalar train graph | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.