id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
9,100 | validate and set fiscal year | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from datetime import date
import frappe
from frappe import _
from frappe.core.doctype.role.role import get_users
from frappe.model.document import Document
from frappe.utils import add_days,... |
9,101 | test customization | from django.urls import (
include,
path,
)
from iommi.admin import Admin as _Admin
from docs.models import Album
from tests.helpers import (
req,
show_output,
staff_req,
)
request = req('get')
import pytest
pytestmark = pytest.mark.django_db
class Admin(_Admin):
class Meta:
iommi_st... |
9,102 | download demo | """Methods to load datasets."""
import io
import json
import logging
import os
import urllib.request
from collections import defaultdict
from pathlib import Path
from zipfile import ZipFile
import boto3
import numpy as np
import pandas as pd
from botocore import UNSIGNED
from botocore.client import Config
from sdv.m... |
9,103 | prep ssh key | #!/usr/bin/python
import base64
import confluent.config.configmanager as cfm
import confluent.collective.manager as collective
import confluent.util as util
import eventlet.green.subprocess as subprocess
import eventlet
import glob
import os
import shutil
import tempfile
agent_pid = None
ready_keys = {}
_sshver = Non... |
9,104 | set hadoop err | # 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 appli... |
9,105 | summary | import re
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any, Dict, Iterable, List, Optional, Tuple
from unittest.mock import patch
from packaging.version import Version # type: ignore
from tqdm.auto import tqdm
import wandb
from wandb import Ar... |
9,106 | get next | # 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... |
9,107 | make debug print | # 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.
import logging
import socket
import subprocess
import textwrap
import time
from typing import List
from antlir.common import (
check_po... |
9,108 | to csv kwargs | import csv
import io
import json
import logging
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Tuple
from minio import Minio
if TYPE_CHECKING:
import _csv
import chardet
from splitgraph.core.output import ResettableStream
try:
from multicorn.utils import log_to_postgres
except ImportError:
... |
9,109 | display | import typing
from argparse import ArgumentParser, OPTIONAL, FileType, ArgumentDefaultsHelpFormatter
from collections import defaultdict, Counter
from csv import DictReader
from io import StringIO
from itertools import groupby
from operator import itemgetter
from pathlib import Path
def create_parser():
parser = ... |
9,110 | aircall secrets | from typing import Any, Dict, Generator, Optional, cast
import pydash
import pytest
import requests
from requests import Response
from sqlalchemy.orm import Session
from fides.api.cryptography import cryptographic_util
from fides.api.models.connectionconfig import (
AccessLevel,
ConnectionConfig,
Connecti... |
9,111 | on draw | """
Sprites with Properties Example
Simple program to show how to store properties on sprites.
Artwork from https://kenney.nl
If Python and Arcade are installed, this example can be run from the command line with:
python -m arcade.examples.sprite_properties
"""
from __future__ import annotations
import arcade
# --... |
9,112 | set spacecraft hub | #
# ISC License
#
# Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all... |
9,113 | run test | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
A test for RPC users with restricted permissions
"""
from test_framework.test_framework import Bitcoin... |
9,114 | index | import icalendar
from django.conf import settings
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404, render
from django.template import TemplateDoesNotExist
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django_date_extensions.fie... |
9,115 | get model | # 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... |
9,116 | test compilation | import pytest
import sqlalchemy as sa
import sqlalchemy.orm
from sqlalchemy_utils import ( # noqa
PhoneNumber,
PhoneNumberParseException,
PhoneNumberType,
types
)
from sqlalchemy_utils.compat import _select_args
VALID_PHONE_NUMBERS = (
"040 1234567",
"+358 401234567",
"09 2501234",
"+... |
9,117 | cutoff function | import numpy as np
#from fitsnap3lib.io.input import Config
try:
import torch
import math
class Gaussian3Body():
"""
Class to calculate Gaussian 3-body descriptors.
Args:
num_desecriptors (int): Number of 3-body descriptors.
cutoff (float): Neighborlist cut... |
9,118 | get pb data | from django.dispatch import receiver
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from froide.foirequest.models import FoiAttachment, FoiRequest
from froide.publicbody.models import PublicBody
from .api_views import ProblemReportSerializer
from .consumers import PRESENCE_ROOM
... |
9,119 | unregister | # This sample script demonstrates a dynamic EnumProperty with custom icons.
# The EnumProperty is populated dynamically with thumbnails of the contents of
# a chosen directory in 'enum_previews_from_directory_items'.
# Then, the same enum is displayed with different interfaces. Note that the
# generated icon previews d... |
9,120 | test sprites color | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# r... |
9,121 | cf sql servers | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
9,122 | log exception | # Copyright (C) 2019-2022 Intel Corporation
# Copyright (C) 2023 CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import os
import os.path as osp
import tempfile
from datetime import timedelta
import django_rq
from datumaro.util.os_util import make_file_name
from datumaro.util import to_snake_case
from django.uti... |
9,123 | test cancel app non animation | from time import perf_counter
from textual.app import App, ComposeResult
from textual.reactive import var
from textual.widgets import Static
class AnimApp(App):
CSS = """
#foo {
height: 1;
}
"""
def compose(self) -> ComposeResult:
yield Static("foo", id="foo")
async def test_an... |
9,124 | create and check model | # Copyright (c) 2023 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 appli... |
9,125 | max stat | """T-test with permutations."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: Simplified BSD
from math import sqrt
import numpy as np
from ..utils import check_random_state, verbose, logger
from ..parallel import parallel_func
def METHOD_NAME(X, X2, perms, dof_scaling):
"""Aux functi... |
9,126 | deduplicate | import typing
from logging import NullHandler, getLogger
logger = getLogger(__name__)
logger.addHandler(NullHandler())
T = typing.TypeVar('T')
_visible_chars_table = dict.fromkeys(range(32))
def _is_unknown(value: typing.Any) -> bool:
return isinstance(value, str) and (not value or value.lower() == 'unknown')
... |
9,127 | create plugin | """
Faraday Penetration Test IDE
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
"""
import re
from collections import defaultdict
from faraday_plugins.plugins.plugin import PluginBase
__author__ = "Francisco Amato"
__copyright__ = "Copyright (c) 2... |
9,128 | rpm rpmremote factory | import uuid
import pytest
from pulpcore.client.pulp_rpm import (
ApiClient as RpmApiClient,
ContentRepoMetadataFilesApi,
DistributionsRpmApi,
PublicationsRpmApi,
RemotesRpmApi,
RepositoriesRpmApi,
RepositoriesRpmVersionsApi,
RpmRepositorySyncURL,
)
from pulp_rpm.tests.functional.const... |
9,129 | sd wrapper | # mypy: ignore-errors
# Portions copyright 2019-present MagicStack Inc. and the EdgeDB authors.
# Portions copyright 2001-2019 Python Software Foundation.
# License: PSFL.
"""A replacement for functools.singledispatch() that records usage.
See README.md in this package for more details.
"""
# flake8: NoQA
from __... |
9,130 | test extra references | from django.test import TestCase
from .utils import generate_random_integer, make_findings_uniform_guidance
from audit.models import SingleAuditChecklist
from .check_ref_number_in_findings_text import check_ref_number_in_findings_text
from .sac_validation_shape import sac_validation_shape
from .errors import err_missin... |
9,131 | test valid if | # 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... |
9,132 | test list offset array | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import numpy as np
import pytest # noqa: F401
import awkward as ak
to_list = ak.operations.to_list
def test_numpy_array():
matrix = np.arange(64).reshape(8, -1)
layout = ak.contents.NumpyArray(matrix[:, 0])
assert ... |
9,133 | headers | import base64
from typing import Any, Dict, Iterator, List, Optional
from aws_lambda_powertools.utilities.data_classes.common import DictWrapper
from aws_lambda_powertools.utilities.data_classes.shared_functions import (
get_header_value,
)
class KafkaEventRecord(DictWrapper):
@property
def topic(self) -... |
9,134 | process man | #!/usr/bin/env python3
# Copyright (C) 2020 Matthew "strager" Glazar
# See end of file for extended copyright information.
import os
import subprocess
import re
import pathlib
ASCIIDOCTOR_VERSION = "2.0.17"
def main():
qljs_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
os.chdir(qljs_... |
9,135 | post operations | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
9,136 | test head call with path setup with | import pytest
import requests
from parameterized import parameterized_class
from tests.integration.local.start_api.start_api_integ_base import StartApiIntegBaseClass
@parameterized_class(
("template_path",),
[
("/testdata/start_api/cdk/template-rest-api.yaml",),
("/testdata/start_api/cdk/temp... |
9,137 | port end | # sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
try:
import time
import os
import logging
import struct
import syslog
from socket import *
from select import *
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - req... |
9,138 | update product catalog | #! /usr/bin/env python3
# MIT License
#
# (C) Copyright 2023 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without... |
9,139 | identity | from collections.abc import Iterable, Mapping
from typing import Any, Generic, Literal, TypeVar
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.models.expressions import Expression, Func
from django.db.models.query_utils import RegisterLookupMixin
from django.db.models.sql.compiler import S... |
9,140 | test vlan deps | import pytest
from pr2test.context_manager import make_test_matrix
from pr2test.marks import require_root
from pr2test.tools import address_exists, interface_exists, route_exists
pytestmark = [require_root()]
test_matrix = make_test_matrix(
targets=['local', 'netns'], dbs=['sqlite3/:memory:', 'postgres/pr2test']
... |
9,141 | get environment and project | import logging
import typing
import uuid
from django.db import models
from django.db.models import Manager
from django.http import HttpRequest
from simple_history.models import HistoricalRecords
from softdelete.models import SoftDeleteManager, SoftDeleteObject
from audit.related_object_type import RelatedObjectType
... |
9,142 | infer | #!/usr/bin/env python3
"""
Copyright (C) 2021-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 applic... |
9,143 | get environment | # 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... |
9,144 | decode | from typing import Union, List, Dict
import torch
import numpy as np
import pandas as pd
from lightwood.encoder.numeric import NumericEncoder
class TsNumericEncoder(NumericEncoder):
"""
Variant of vanilla numerical encoder, supports dynamic mean re-scaling
"""
is_timeseries_encoder: bool = True
... |
9,145 | test avg pool grad grad impl | """
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... |
9,146 | test slot behaviour | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2023
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
9,147 | handle | """
Create and save a public dataset archive on the disk.
"""
import zipfile
from io import StringIO
from os.path import getctime
from pathlib import Path
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import timezone
from core.utils.time import time_ago
from to... |
9,148 | test mixed | #
# Copyright (C) 2017-2022 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
9,149 | test append | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=pointless-statement, missing-docstring, invalid-name, no-member, len-as-condition
import pytest
from rebulk.test.default_rules_module import RuleRemove0, RuleAppend0, RuleRename0, RuleAppend1, RuleRemove1, \
RuleRename1, RuleAppend2, RuleRename2, RuleA... |
9,150 | update | from django.db.models import Q
from tasks.models import TaskTaken
class CourseStatistics(object):
def __init__(self, course_tasks):
self.course_tasks = course_tasks
self.groups_statistics = {}
self.course_statistics = {
'summ_scores': 0,
'number_students': 0,
... |
9,151 | assert anndata equal | from pathlib import Path
import h5py
import numpy as np
import pytest
import scanpy as sc
import shutil
ROOT = Path(__file__).parent
ROOT = ROOT / '_data' / '10x_data'
VISIUM_ROOT = Path(__file__).parent / '_data' / 'visium_data'
def METHOD_NAME(a1, a2):
assert a1.shape == a2.shape
assert (a1.obs == a2.obs... |
9,152 | set up | import django_dynamic_fixture as fixture
from allauth.account.models import EmailAddress
from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from django.urls import reverse
from readthedocs.invitations.models import Invitation
from readthedocs.organizations import forms
from... |
9,153 | check external policy | """
Helper class to create user credentials to upload files to s3
"""
import copy
import json
import boto3
import botocore
EXTERNAL_BUCKET_STATEMENTS = [
{
'Action': 's3:GetObject',
'Resource': lambda s: 'arn:aws:s3:::%s/*' % s,
'Effect': 'Allow',
},
{
'Action': 's3:GetObj... |
9,154 | prepare | import base64
import hashlib
import os
import chevron
import lxml.html
import prairielearn as pl
from text_unidecode import unidecode
EDITOR_CONFIG_FUNCTION_DEFAULT = None
ACE_MODE_DEFAULT = None
ACE_THEME_DEFAULT = None
FONT_SIZE_DEFAULT = None
SOURCE_FILE_NAME_DEFAULT = None
MIN_LINES_DEFAULT = None
MAX_LINES_DEFAU... |
9,155 | 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... |
9,156 | setmem | """
virst compatibility module for managing VMs on SmartOS
"""
import logging
import salt.utils.path
import salt.utils.platform
from salt.exceptions import CommandExecutionError
log = logging.getLogger(__name__)
# Define the module's virtual name
__virtualname__ = "virt"
def __virtual__():
"""
Provides vi... |
9,157 | statuses | """This module contains the RepoCommit classes."""
from . import status
from .. import checks
from .. import git
from .. import models
from .. import users
from .comment import RepoComment
class _RepoCommit(models.GitHubCore):
"""The :class:`RepoCommit <RepoCommit>` object.
This represents a commit as
vi... |
9,158 | symbol | # Part of Spatial Math Toolbox for Python
# Copyright (c) 2000 Peter Corke
# MIT Licence, see details in top-level file: LICENCE
"""
This package provides a light-weight wrapper to support use of SymPy. It
generalizes some common functions so that they can accept numerical or
Symbolic arguments.
If SymPy is not inst... |
9,159 | spec | """
scale
=====
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.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecification, Specification
cla... |
9,160 | calculate | import numpy
SMALL_NUMBER_THRESHOLD = 5
class Measure:
POPULATION_COLUMN = "population"
def __init__(
self, id, denominator, numerator, group_by=None, small_number_suppression=False
):
"""
Creates a "measure" using data extracted by the StudyDefinition defined
in the same... |
9,161 | chain | #!/usr/bin/python3
import sys
import warnings
import pytest
import brownie
from brownie._config import CONFIG, _get_data_folder
from .stateful import _BrownieStateMachine, state_machine
def _generate_fixture(container):
def _fixture():
yield container
_fixture.__doc__ = f"Provides access to Brown... |
9,162 | run | """Running tests"""
import sys
import time
import unittest
from six import u
from unittest2 import result
try:
from unittest2.signals import registerResult
except ImportError:
def registerResult(_):
pass
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects ... |
9,163 | test post channel member | import datetime
from unittest.mock import ANY
import pytest
from quetz.metrics.db_models import PackageVersionMetric
def test_get_package_list(package_version, package_name, channel_name, client):
response = client.get("/api/dummylogin/bartosz")
response = client.get(
f"/api/channels/{channel_name}/... |
9,164 | pretty json dumps | import json
from json.decoder import JSONDecodeError
from typing import Any, Optional, Union
from rotkehlchen.assets.asset import (
Asset,
AssetWithNameAndType,
AssetWithOracles,
CryptoAsset,
CustomAsset,
EvmToken,
FiatAsset,
UnderlyingToken,
)
from rotkehlchen.assets.types import Asset... |
9,165 | load pyproject toml | import importlib.util
import os
from collections import namedtuple
from typing import Any, List, Optional
from pip._vendor import tomli
from pip._vendor.packaging.requirements import InvalidRequirement, Requirement
from pip._internal.exceptions import (
InstallationError,
InvalidPyProjectBuildRequires,
Mi... |
9,166 | test no version | # Copyright 2018 The Kubeflow 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
9,167 | test caches | import os
import re
import shutil
import pytest
from dvc.info import SUBPROJECTS, get_dvc_info
# Python's version is in the shape of:
# <major>.<minor>.<patch>[{a|b|rc}N][.postN][.devN]
# `patch` is more than enough for the tests.
# Refer PEP-0440 for complete regex just in-case.
PYTHON_VERSION_REGEX = r"Python \d\.... |
9,168 | test list | from enum import Enum, IntEnum
from math import isnan
from test.test_json import PyTest, CTest
SMALL = 1
BIG = 1<<32
HUGE = 1<<64
REALLY_HUGE = 1<<96
class BigNum(IntEnum):
small = SMALL
big = BIG
huge = HUGE
really_huge = REALLY_HUGE
E = 2.718281
PI = 3.141593
TAU = 2 * PI
class FloatNum(float, Enu... |
9,169 | parse go terms from gff | #!/usr/bin/env python3
"""
This script uses the following input:
- Annotated GFF3 file
- Full go.obo file
- Pickled go slim
And produces count output in plain text like this:
cellular_component GO:0005575 cellular_component 650
cellular_component GO:0016020 membrane 135
cellular_component GO:0043226 organelle 51
ce... |
9,170 | list | '''
Profiles
=============
Methods described in this section relate to the profiles API.
These methods can be accessed at ``TenableAD.profiles``.
.. rst-class:: hide-signature
.. autoclass:: ProfilesAPI
:members:
'''
from typing import List, Dict
from tenable.base.endpoint import APIEndpoint
from .schema import P... |
9,171 | test error message is set if user | import pytest
from django.urls import reverse
from ....cache.test import assert_invalidates_cache
from ....test import assert_contains, assert_has_error_message
from ... import THEME_CACHE
@pytest.fixture
def create_link(theme):
return reverse("misago:admin:themes:new-css-link", kwargs={"pk": theme.pk})
@pytes... |
9,172 | read bytes | # 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... |
9,173 | connect | # Copyright (C) 2007 Samuel Abels
#
# This file is part of SpiffWorkflow.
#
# SpiffWorkflow is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at your option) any l... |
9,174 | run with trace context | import tornado
from tornado.ioloop import IOLoop
from ...provider import BaseContextProvider
from ...provider import DefaultContextProvider
from ...span import Span
# tornado.stack_context deprecated in Tornado 5 removed in Tornado 6
# instead use DefaultContextProvider with ContextVarContextManager for asyncio
_USE... |
9,175 | save | from django import forms
from events.widgets import DatePickerInput
from events.models import Event, EventApplication, EventAgreement, EventDataset
from project.models import PublishedProject
class AddEventForm(forms.ModelForm):
"""
A form for adding events.
"""
class Meta:
model = Event
... |
9,176 | get height change | from collections import namedtuple
import math
CalcTypeCube = namedtuple('CalcTypeCube', 'w l h')
CalcTypeCylinder = namedtuple('CalcTypeCylinder', 'd h')
CalcTypeLookup = namedtuple('CalcTypeLookup', 'lookup') # [(ul, mm), (ul, mm)]
LIQUID_HEIGHT_TRACKER = {}
class LiquidHeight:
def __init__(self, calc_type... |
9,177 | to str | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
9,178 | get dataptr fallback | import logging
import os
import platform
import threading
import typing
import rpy2.situation
from rpy2.rinterface_lib import ffi_proxy
logger = logging.getLogger(__name__)
cffi_mode = rpy2.situation.get_cffi_mode()
if cffi_mode == rpy2.situation.CFFI_MODE.API:
import _rinterface_cffi_api as _rinterface_cffi # t... |
9,179 | test simple error handler | import pytest
from parsl.executors import HighThroughputExecutor
from parsl.providers import LocalProvider
from unittest.mock import Mock
from parsl.jobs.states import JobStatus, JobState
from parsl.jobs.error_handlers import simple_error_handler, windowed_error_handler, noop_error_handler
from functools import partia... |
9,180 | si g 1987 | # SPDX-License-Identifier: MPL-2.0
# Copyright (C) 2020 - 2021 Gemeente Amsterdam
from django.db import migrations
def METHOD_NAME(apps, schema_editor):
"""
SIG-1987 [BE] Aanmaken verantwoordelijke afdeling 'Wonen'
:param apps:
:param schema_editor:
:return:
"""
Department = apps.get_mode... |
9,181 | visit false | # orm/evaluator.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from ..sql import operators
class UnevaluatableError(Exception):
... |
9,182 | code operator not equal | from talon import Context, actions, settings
ctx = Context()
ctx.matches = r"""
tag: user.php
"""
ctx.lists["user.code_type"] = {
"int": "int",
"float": "float",
"string": "string",
"bool": "bool",
"array": "array",
"null": "null",
"void": "void",
}
@ctx.action_class("user")
class UserAc... |
9,183 | convert m k to g hz | """
This module contains utility functions that are commonly needed in other
qutip modules.
"""
__all__ = ['n_thermal', 'clebsch', 'convert_unit']
import numpy as np
def n_thermal(w, w_th):
"""
Return the number of photons in thermal equilibrium for an harmonic
oscillator mode with frequency 'w', at the ... |
9,184 | test compile vyper object | #!/usr/bin/python3
import sys
from pathlib import Path
import pytest
from brownie.exceptions import ProjectAlreadyLoaded, ProjectNotFound
from brownie.project.main import Project, TempProject, _ProjectBase
def test_object(newproject):
assert type(newproject) is Project
assert isinstance(newproject, _Projec... |
9,185 | test scalar graph cpu | """
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... |
9,186 | get subscribers with diff | from collections.abc import Callable
from typing import Optional
from sretoolbox.utils import threaded
from reconcile.openshift_saas_deploy import (
QONTRACT_INTEGRATION as OPENSHIFT_SAAS_DEPLOY,
)
from reconcile.saas_auto_promotions_manager.merge_request_manager.merge_request_manager import (
MergeRequestMan... |
9,187 | 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... |
9,188 | test variable map | # This software is open source software available under the BSD-3 license.
#
# Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
# Copyright (c) 2022 Lawrence Livermore National Security, LLC. All rights
# reserved.
# Copyright (c) 2022 UT-Battelle, LLC. All rights reserved.
#
# Additional copyright... |
9,189 | qpoases sources | import os
import glob
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
class AcadoConan(ConanFile):
name = "acado"
description = "ACADO Toolkit is a software environment and algorithm collection for automatic control and dynamic optimization."
license = "LGPL... |
9,190 | run io commands | import secrets
import string
import traceback
from ceph.ceph import CommandFailed
from ceph.parallel import parallel
from tests.cephfs.cephfs_utilsV1 import FsUtils
from tests.cephfs.cephfs_volume_management import wait_for_process
from utility.log import Log
from utility.retry import retry
log = Log(__name__)
def ... |
9,191 | value or wildcard | from __future__ import annotations
from checkov.kubernetes.checks.resource.base_spec_check import BaseK8Check
from checkov.common.models.enums import CheckCategories, CheckResult
from typing import Dict, Any, List, TYPE_CHECKING
if TYPE_CHECKING:
from collections.abc import Iterable
class RbacOperation():
"... |
9,192 | bp commands | import signal
import sys
from bdb import Bdb
from cmd import Cmd
from collections.abc import Callable, Iterable, Mapping, Sequence
from inspect import _SourceObjectType
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, ClassVar, TypeVar
from typing_extensions import ParamSpec, Self
__all... |
9,193 | boxdimensions universe | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... |
9,194 | allow fetch reservations | from twilio.jwt.taskrouter import TaskRouterCapabilityToken
class WorkerCapabilityToken(TaskRouterCapabilityToken):
def __init__(
self, account_sid, auth_token, workspace_sid, worker_sid, ttl=3600, **kwargs
):
"""
:param kwargs:
All kwarg parameters supported by TaskRouterC... |
9,195 | test forces and energies | # Copyright (c) 2009-2023 The Regents of the University of Michigan.
# Part of HOOMD-blue, released under the BSD 3-Clause License.
import hoomd
from hoomd import md
from hoomd.conftest import expected_loggable_params
from hoomd.conftest import (logging_check, pickling_check,
autotuned_kern... |
9,196 | test write | from builtins import object
###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; ... |
9,197 | smod | """
Ethereum Virtual Machine (EVM) Arithmetic Instructions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Implementations of the EVM Arithmetic instructions.
"""
from ethereum.base_types import U255_CEIL_VALUE, U256, ... |
9,198 | make scene | # flake8: noqa
import os
from os.path import join
from rastervision.core.rv_pipeline import *
from rastervision.core.backend import *
from rastervision.core.data import *
from rastervision.core.analyzer import *
from rastervision.pytorch_backend import *
from rastervision.pytorch_learner import *
from rastervision.py... |
9,199 | image ids | # 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 option) any later version.
#
# This program is distributed in the hope that it will be usefu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.