id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
3,200 | test nddataarray from nddataarray | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module contains tests of a class equivalent to pre-1.0 NDData.
import numpy as np
import pytest
from astropy import units as u
from astropy.nddata.compat import NDDataArray
from astropy.nddata.nddata import NDData
from astropy.nddata.nduncertaint... |
3,201 | f 6 | import itertools
import numpy as np
from numpy import exp
from numpy.testing import assert_, assert_equal
from scipy.optimize import root
def test_performance():
# Compare performance results to those listed in
# [Cheng & Li, IMA J. Num. An. 29, 814 (2008)]
# and
# [W. La Cruz, J.M. Martinez, M. Ray... |
3,202 | signature | """
Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law o... |
3,203 | preprocess | # -*- coding: utf-8 -*-
'''
Created on 04 Mar 2017
@author: Guilherme Stiebler
Copyright © 2017 Guilherme Stiebler, Éric Piel, Delmic
This file is part of Odemis.
Odemis 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 So... |
3,204 | plot statistic | import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import pandas as pd
import math
DEFAULT_SEQUENCE_WEIGHTS= {0: 1, 1:1, 2:1, 3: 1, 4: 1}
SEQUENCE_CRITERIA = "Sequence"
QUESTION_ID_CRITERIA = "Question"
EQUAL_CRITERIA = "Equal"
class Question_Answer_Scorer:
def __init__(self,name,function... |
3,205 | url parameters | # --------------------------------------------------------------------------------------------
# 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,206 | calculate eer | """
Usage:
This scripts it to evaluate the classification accuracy/error rate from the embedding extracted
by gen_audio_embedding.py
Example (LID classification)
PYTHONPATH='.' python examples/wav2vec/eval_speaker_clf_task.py \
--data /fsx/androstj/exps/lid_voxlingua/infer/atj_xlsr2_100pct... |
3,207 | output | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
3,208 | list | # 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... |
3,209 | close | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
3,210 | send crash report | import datetime
import plistlib
from pathlib import Path
import json
from resources import network_handler, constants, global_settings
DATE_FORMAT: str = "%Y-%m-%d %H-%M-%S"
ANALYTICS_SERVER: str = ""
SITE_KEY: str = ""
CRASH_URL: str = ANALYTICS_SERVER + "/crash"
VALID_ANALYTICS_ENTRIES: dict =... |
3,211 | test param priority | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import logging
import pytest
from flowmachine.core import connect
@pytest.fixture(autouse=True)
def reset_connect(mon... |
3,212 | test gatk hc gvcf | import os
from pathlib import Path
from resolwe.flow.models import Data
from resolwe.test import tag_process
from resolwe_bio.utils.filter import filter_vcf_variable
from resolwe_bio.utils.test import BioProcessTestCase
class WgsWorkflowTestCase(BioProcessTestCase):
@tag_process("workflow-wgs-paired")
def t... |
3,213 | handle switch case | # pylint:disable=unused-argument,useless-return
from collections import OrderedDict
import ailment
from ...errors import UnsupportedNodeTypeError
from .structuring.structurer_nodes import (
MultiNode,
CodeNode,
SequenceNode,
ConditionNode,
SwitchCaseNode,
LoopNode,
CascadingConditionNode,
... |
3,214 | create parser | # Copyright 2021 Hathor Labs
#
# 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, s... |
3,215 | main | # coding: utf-8
from __future__ import print_function, unicode_literals
import argparse
import sys
import pkg_resources
import logging
import os
from lxml import etree
import packtools
from packtools import catalogs
LOGGER = logging.getLogger(__name__)
class XMLError(Exception):
""" Represents errors that woul... |
3,216 | run test | #!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2023 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import sys, os
import uni... |
3,217 | forward | # Copyright 2023 The HuggingFace Team. 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 applicabl... |
3,218 | put | # flake8: noqa
from django.core.exceptions import ImproperlyConfigured
from django.db import transaction
from django.forms import models as model_forms
from django.forms.formsets import all_valid
from django.http import HttpResponseRedirect
from django.utils.encoding import force_str
from django.views import generic
... |
3,219 | destroy all cowrie | # Copyright (c) 2019 Guilherme Borges <guilhermerosasborges@gmail.com>
# See the COPYRIGHT file for more information
from __future__ import annotations
import os
import random
import sys
import uuid
from twisted.python import log
import backend_pool.libvirt.guest_handler
import backend_pool.libvirt.network_handler
... |
3,220 | clean | import json
import os
import multiprocessing
import itertools
import random
import re
from infinibatch import iterators
from functools import partial
from tasks.data.lm_loader import LMLoader
from tasks.data.utils import NativeCheckpointableIterator, WeightIterator, EOL_SYMBOL, BOI_SYMBOL, EOI_SYMBOL, image_code_to_to... |
3,221 | stail q entry | # Generated by h2py from /usr/include/netinet/in.h
IPPROTO_IP = 0
IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_IPV4 = 4
IPPROTO_IPIP = IPPROTO_IPV4
IPPROTO_TCP = 6
IPPROTO_ST = 7
IPPROTO_EGP = 8
IPPROTO_PIGP = 9
IPPROTO_RCCMON = 10
IPPROTO_NVPII = 11
IPPROTO_PUP = 12
IPPROTO_ARGUS = 13
... |
3,222 | get always on top | import asyncio
import inspect
import warnings
from dataclasses import dataclass, field
from functools import partial
from multiprocessing import Queue
from typing import Any, Callable, Dict, Optional, Tuple
from .dataclasses import KWONLY_SLOTS
from .globals import log
method_queue: Queue = Queue()
response_queue: Qu... |
3,223 | call | # 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... |
3,224 | tuple demo | #!/usr/bin/env python2
"""
mycpp/examples/containers.py
"""
from __future__ import print_function
import os
from mycpp.mylib import log, NewDict, iteritems
from typing import List, Tuple, Dict, Optional
gstr = 'foo' # type: str
glist_int = [1, 2] # type: List[int]
glist_str = ['spam', 'eggs'] # type: List[str]
... |
3,225 | tagged words block reader | # Natural Language Toolkit: Switchboard Corpus Reader
#
# Copyright (C) 2001-2023 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import re
from nltk.corpus.reader.api import *
from nltk.corpus.reader.util import *
from nltk.tag import m... |
3,226 | test get status | """
Unit tests for MicroService.py module
Author: Valentin Kuznetsov <vkuznet [AT] gmail [DOT] com>
"""
from __future__ import division, print_function
import unittest
import cherrypy
import gzip
import json
from WMCore_t.MicroService_t import TestConfig
from WMCore.MicroService.Service.RestApiHub import RestApiHub
... |
3,227 | state vars | # Copyright The Lightning AI team.
#
# 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 wri... |
3,228 | setup | """
find.py - Sopel Spelling Correction Plugin
This plugin will fix spelling errors if someone corrects them
using the sed notation (s///) commonly found in vi/vim.
Copyright 2011, Michael Yanovich, yanovich.net
Copyright 2013, Elsie Powell, embolalia.com
Copyright 2020, dgw, technobabbl.es
Includes contributions from... |
3,229 | get sql resource sql role assignment | # 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,230 | from connection string | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import sys... |
3,231 | attach signal2 | #!/usr/bin/env python
#
# Copyright 2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, filter
from gnuradio import blocks
from gnuradio.fft import window
import sys
try:
from gnuradio import qtgui
from PyQt5 im... |
3,232 | test nonce manual | #!/usr/bin/python3
import pytest
from brownie.exceptions import VirtualMachineError
from brownie.network.transaction import TransactionReceipt
abi = {
"constant": False,
"inputs": [{"name": "_to", "type": "address"}, {"name": "_value", "type": "uint256"}],
"name": "transfer",
"outputs": [{"name": "",... |
3,233 | load data | """Shared definitions in FAOSTAT meadow steps.
Some basic processing is required to create tables from the raw data.
For example, column "Note" (present in some datasets) is skipped to avoid parsing errors.
Other minor changes can be found in the code.
"""
import os
import tempfile
import zipfile
from pathlib import... |
3,234 | try lockf on other process fail | """Test program for the fcntl C module.
"""
import platform
import os
import struct
import sys
import unittest
from multiprocessing import Process
from test.support import verbose, cpython_only
from test.support.import_helper import import_module
from test.support.os_helper import TESTFN, unlink
# Skip test if no fcn... |
3,235 | edit news | import urllib
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse
from django.utils import timezone
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q
from comms import models, forms
f... |
3,236 | byte length | #!/usr/bin/env python
"""A module with client action for talking with osquery."""
import json
import os
import subprocess
from typing import Any, Iterator, List, Optional, Text
from grr_response_client import actions
from grr_response_core import config
from grr_response_core.lib.rdfvalues import osquery as rdf_osquer... |
3,237 | patch make head requests | from test.constants import API_URL
from unittest.mock import patch
from uuid import uuid4
from django.conf import settings
import pytest
import requests
from fakeredis import FakeRedis
from api.controllers.search_controller import DEAD_LINK_RATIO
@pytest.fixture(autouse=True)
def redis(monkeypatch) -> FakeRedis:
... |
3,238 | test artifact show artifact name | #
# 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
# distributed ... |
3,239 | sci not | import argparse
import sys
import numpy as np
def METHOD_NAME(num):
exp = int(np.log10(num))
mant = num/10.0**exp
if mant < 1:
mant *= 10.0
exp -= 1
return r"${:5.3f} \times 10^{{{}}}$".format(round(mant, 3), exp)
class Variable():
def __init__(self, name, lo, o1, med, o2, hi):
... |
3,240 | next idx |
from typing import List, Dict, Literal, Optional, Any
from time import time
import json
import os
class AutoTest():
class HyperParams():
def __init__(self, data: Dict[str, Any]) -> None:
self.__data = data
def __len__(self):
return len(self.__data)
def __getattr__... |
3,241 | get past ipo | import logging
from datetime import datetime, timedelta
from typing import Optional
import pandas as pd
from openbb_terminal.core.session.current_user import get_current_user
from openbb_terminal.decorators import check_api_key, log_start_end
from openbb_terminal.helper_funcs import request
from openbb_terminal.rich_... |
3,242 | prepare request | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
3,243 | proc6 | #! /usr/bin/env python3
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness ... |
3,244 | test unlock migration | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test token split migrate lock"""
from test_framework.test_f... |
3,245 | get user dicts | from collections import Counter
from typing import List, Optional
from sqlalchemy.orm.session import Session
from src.challenges.challenge import (
ChallengeManager,
ChallengeUpdater,
FullEventMetadata,
)
from src.challenges.challenge_event import ChallengeEvent
from src.models.rewards.profile_completion_... |
3,246 | check game mode |
import os
import importlib
from twisted.logger import Logger
log = Logger()
def check_scripts(script_names):
'''Validation for a list of regular extension scripts.
Check there are no duplicate scripts in the list of scripts names that is passed in.
Args:
script_names: The list of scripts name... |
3,247 | parametrize external json codegen checks | # 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... |
3,248 | chrome options | """Pytest setup."""
import os
from typing import Generator, List, Optional
import pytest
from automation.menus.left_menu import LeftMenu
from automation.pages.app_settings import AppSettings
from automation.resources.robot_data import ROBOT_MAPPING, RobotDataType
from dotenv import find_dotenv, load_dotenv
from rich i... |
3,249 | custom formatting | from nicegui import ui
from ..documentation_tools import text_demo
def main_demo() -> None:
columns = [
{'name': 'name', 'label': 'Name', 'field': 'name', 'required': True, 'align': 'left'},
{'name': 'age', 'label': 'Age', 'field': 'age', 'sortable': True},
]
rows = [
{'name': 'Al... |
3,250 | test gotocomputer proxyjump | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
3,251 | get observed date | # 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 <maurizio.montel@gmail.com> (c) 201... |
3,252 | setup | import re
from virttest import utils_disk
from virttest import virsh
from virttest.libvirt_xml import vm_xml
from provider.backingchain import blockcommand_base
def run(test, params, env):
"""
Test domblkthreshold for domain which has backing chain
"""
def METHOD_NAME():
"""
Prepare ... |
3,253 | get project | from rest_framework import viewsets
from .models import ListModel
from . import serializers
from utils.page import MyPageNumberPagination
from rest_framework.filters import OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.response import Response
from .filter import Filte... |
3,254 | create network | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
from __future__ import division
from collections import defaultdict
import logging
import threading
import six
import xml.etree.ElementTree as etree
from xml.sax.saxutils import escape
from lib... |
3,255 | test abspath or url | from enum import auto
from importlib.metadata import version as package_version
from os.path import abspath, expanduser, sep
from pathlib import Path
import pytest
from packaging.version import parse as parse_version
from napari.utils.misc import (
StringEnum,
_is_array_type,
_quiet_array_equal,
abspa... |
3,256 | test logout | from scsession import SaltcornSession
email = "admin@foo.com"
password="AhGGr6rhu45"
class Test:
def setup_class(self):
SaltcornSession.reset_to_fixtures()
self.sess = SaltcornSession(3001)
def teardown_class(self):
self.sess.close()
# helpers
def cannot_access_admin(self):
... |
3,257 | mv dir | import os
from django.conf import settings
from google.cloud.exceptions import NotFound
from google.cloud.storage import Client
from project.utility import DirectoryInfo, FileInfo, readable_size
from storages.backends.gcloud import GoogleCloudStorage
def get_client():
return GoogleCloudStorage().client
class O... |
3,258 | unknown exception class | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2001-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permis... |
3,259 | query parameters | # --------------------------------------------------------------------------------------------
# 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,260 | bigcouch quorum count | from time import sleep
from django.conf import settings
from couchdbkit import ResourceConflict
from couchdbkit.client import Database
from memoized import memoized
from requests.models import Response
from requests.exceptions import RequestException
from dimagi.ext.couchdbkit import Document
from dimagi.utils.chunk... |
3,261 | config options | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, load, rm, save
from conan... |
3,262 | test user object type error | from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from nautobot.core.celery import app
from nautobot.core.testing import TransactionTestCase
from nautobot.core.utils.lookup import get_changes_for_model
from nautobot.dcim.models im... |
3,263 | centers | #!/usr/bin/env python
from math import pi
import numpy as np
from numpy.linalg import norm
import openmc
import openmc.model
import pytest
import scipy.spatial
_RADIUS = 0.1
_PACKING_FRACTION = 0.35
_PARAMS = [
{'shape': 'rectangular_prism', 'volume': 1**3},
{'shape': 'x_cylinder', 'volume': 1*pi*1**2},
... |
3,264 | continuous training pipeline | # This sample demonstrates a common training scenario.
# New models are being trained strarting from the production model (if it exists).
# This sample produces two runs:
# 1. The trainer will train the model from scratch and set as prod after testing it
# 2. Exact same configuration, but the pipeline will discover the... |
3,265 | landmarks names ordered | # Copyright (c) 2020 the original author or 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 applicabl... |
3,266 | verify key | from datetime import datetime, timedelta
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Union
from uuid import uuid4
from alerta.app import db, key_helper
from alerta.database.base import Query
from alerta.models.enums import Scope
from alerta.utils.format import DateTime
from alerta.utils.... |
3,267 | url parameters | # --------------------------------------------------------------------------------------------
# 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,268 | matrix rank | from __future__ import annotations
import functools
import math
from typing import Sequence
import torch
from . import _dtypes_impl, _util
from ._normalizations import ArrayLike, KeepDims, normalizer
class LinAlgError(Exception):
pass
def _atleast_float_1(a):
if not (a.dtype.is_floating_point or a.dtype.... |
3,269 | discover | from mage_integrations.connections.redshift import Redshift as RedshiftConnection
from mage_integrations.sources.redshift.constants import (
DATA_TYPES_BOOLEAN,
DATA_TYPES_INTEGER,
DATA_TYPES_NUMBER,
DATA_TYPES_DATE,
)
from mage_integrations.sources.base import main
from mage_integrations.sources.catalo... |
3,270 | update homophones | import os
from talon import Context, Module, actions, app, clip, fs, imgui, ui
########################################################################
# global settings
########################################################################
# a list of homophones where each line is a comma separated list
# e.g. wh... |
3,271 | test domain changes with identical domain | from __future__ import annotations
import unittest
from unittest.mock import Mock, patch
from boto.exception import SWFResponseError
from boto.swf.exceptions import SWFDomainAlreadyExistsError
from boto.swf.layer1 import Layer1
import simpleflow.swf.mapper.settings
from simpleflow.swf.mapper.constants import DEPRECA... |
3,272 | debug flags | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
import sys
import llnl.util.lang
from spack.compiler import Compiler, UnsupportedCompilerFlag
from s... |
3,273 | get urlpatterns | from django.core.exceptions import ImproperlyConfigured
from django.urls import reverse
from django.utils.functional import cached_property
from wagtail.admin.menu import WagtailMenuRegisterable, WagtailMenuRegisterableGroup
class ViewSet(WagtailMenuRegisterable):
"""
Defines a viewset to be registered with ... |
3,274 | auto | import configparser
import logging
import os
from typing import TYPE_CHECKING, Any, Optional
from urllib.parse import urlparse, urlunparse
import wandb
try:
from git import ( # type: ignore
GitCommandError,
InvalidGitRepositoryError,
NoSuchPathError,
Repo,
)
except ImportError... |
3,275 | test missing courses list | """
Unittest for generate a test course in an given modulestore
"""
import json
from unittest import mock
import ddt
from django.core.management import CommandError, call_command
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
@ddt.ddt
clas... |
3,276 | close | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
3,277 | scheduleonboarding | # Copyright 2023 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, ... |
3,278 | test get form submissions grouped by field | from datetime import datetime, timedelta
from django.utils.timezone import utc
import os
from mock import patch
from onadata.apps.logger.models.instance import Instance
from onadata.apps.main.tests.test_base import TestBase
from onadata.libs.data.query import (
get_form_submissions_grouped_by_field,
get_date_... |
3,279 | resource exists | # -*- coding: utf-8 -*-
from __future__ import annotations
from ckan.types import Context
import re
import logging
from typing import Any, Container
import ckan.plugins as plugins
from ckan.common import CKANConfig, config
from ckanext.datastore.interfaces import IDatastoreBackend
log = logging.getLogger(__name__)
... |
3,280 | reader factory | import json
import logging
import os
import typing
from typing import Optional, Text, Callable, Dict, Any, List
import rasa.shared.utils.io
from rasa.shared.nlu.training_data.formats.dialogflow import (
DIALOGFLOW_AGENT,
DIALOGFLOW_ENTITIES,
DIALOGFLOW_ENTITY_ENTRIES,
DIALOGFLOW_INTENT,
DIALOGFLOW_... |
3,281 | common entry | # Copyright 2014 ETH Zurich
# Copyright 2018 ETH Zurich, Anapaya Systems
#
# 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,282 | config mock | #!/usr/bin/env python3
# Allow direct execution
import os
import sys
import unittest
import unittest.mock
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import contextlib
import itertools
from pathlib import Path
from yt_dlp.compat import compat_expanduser
from yt_dlp.options import... |
3,283 | default factory str | from typing import Any, ClassVar, Generic, List, Optional, TypeVar, Union
from typing_extensions import Self
from pydantic import BaseModel, ConfigDict, Field, create_model, field_validator, model_validator, validator
from pydantic.dataclasses import dataclass
class Model(BaseModel):
x: float
y: str
mo... |
3,284 | test manual main port and address | # Copyright The Lightning AI team.
#
# 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 wri... |
3,285 | scrcpy server start | import socket
import struct
import threading
import time
import typing as t
from time import sleep
import numpy as np
from adbutils import AdbError, Network
from module.base.decorator import cached_property
from module.base.timer import Timer
from module.device.connection import Connection
from module.device.method.s... |
3,286 | loader | """Views for managing sponsors of a project."""
from __future__ import annotations
from typing import TYPE_CHECKING, Optional
from flask import abort, flash, render_template, request
from baseframe import _
from baseframe.forms import Form
from baseframe.forms.auto import ConfirmDeleteForm
from coaster.auth import ... |
3,287 | register | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from bpy.props import... |
3,288 | no duplicate jars | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# pylint: disable=unused-argument
import re
from typing import Any, Dict, List
from marshmallow import ValidationError, fields, post_dump,... |
3,289 | from zsl | """This module provides classes to identify optimal substrates for film growth."""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
from pymatgen.analysis.elasticity.strain import Deformation, Strain
from pymatgen.analysis.interfaces.zsl import ZSLGenerator, ZSLMa... |
3,290 | construct manifest filename | """ This module tests full pipeline SVM processing for an ACS WFC, full-frame, one filter dataset.
"""
import datetime
import glob
import os
import pytest
from drizzlepac.haputils import astroquery_utils as aqutils
from drizzlepac import runsinglehap
from astropy.io import fits, ascii
from pathlib import Path
"""
... |
3,291 | resolve rent stab info | from onboarding.scaffolding import (
OnboardingScaffolding,
OnboardingScaffoldingMutation,
get_scaffolding,
)
from . import models, forms, email_dhcr
from typing import Dict, Any, Optional
from django.utils import translation
from django.db import connections
from django.conf import settings
import graphen... |
3,292 | removedata | #coding=utf8
import urllib
import urllib2
import urlparse
import cookielib
import re
import StringIO
try:
import json
except ImportError:
import simplejson as json
from upload import MultiPartForm
class UTorrentClient(object):
def __init__(self, base_url, username, password):
self.base_url = bas... |
3,293 | attach combobox | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
from Qt import QtCore, QtWidgets
from functools import partial
class Config(QtCore.QSettings):
"""Persistent application settings.
Methods are also provided for easily attaching widgets to settings.
"""
def __init__(s... |
3,294 | properties | # 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,295 | get individual name | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2021 Bitergia
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This ... |
3,296 | has tables | from django.contrib import messages
from django.http import HttpResponseRedirect
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from django.utils.translation import gettext_noop, gettext_lazy
from couchdbkit import ResourceNotFound
from memoized import memoized
f... |
3,297 | deserialize if empty | """DualDict is a dict with lazily synchronized string representation."""
import collections.abc
import copy
class DualDict(collections.abc.MutableMapping):
"""DualDict class serves as dict with lazily synchronized string representation.
>>> ddict = DualDict('Number=Sing|Person=1')
>>> ddict['Case'] = 'No... |
3,298 | enable ports | """
This module contains the workflows for installing and configuring COSBench - Cloud
Object Storage Benchmark tool on the provided nodes. It supports
- deploying COSBench on the provided systems
- Configuring COSBench based on the given nodes
Sample test script
- test:
abort-on-fail: true
... |
3,299 | instance to type environment | from __future__ import annotations
from mypy.expandtype import expand_type
from mypy.nodes import TypeInfo
from mypy.types import AnyType, Instance, TupleType, Type, TypeOfAny, TypeVarId, has_type_vars
def map_instance_to_supertype(instance: Instance, superclass: TypeInfo) -> Instance:
"""Produce a supertype of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.