id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
17,100
create input booleans
import os from homeassistant import config_entries from homeassistant.components import input_boolean, input_number, light from homeassistant.components.light import ColorMode from homeassistant.const import ( CONF_ENTITY_ID, CONF_NAME, CONF_PLATFORM, CONF_UNIQUE_ID, STATE_ON, ) from homeassistant....
17,101
lambda handler
from sqlalchemy import create_engine class basefunc: # athena @staticmethod def athena_getdb(uri, schema): engine = create_engine(uri, echo=True) res = engine.execute('SHOW DATABASES').fetchall() db_list = [] for row in res: for item in row: db_l...
17,102
analyze error codes
#! /usr/bin/python import os import os.path import re import sys ErrorPattern = re.compile('([A-Z]{3}_ERROR_[A-Z_0-9]+)\s+=?\s*\(?([A-Z_0-9-][A-Z_0-9-+ ]+[A-Z_0-9])') FilePatternH = re.compile('^.*\.h$') FilePatternC = re.compile('^.*\.(c|cpp)$') Errors = {} Codes = {} ERROR_MAP_HEADER = """/***********************...
17,103
merge accumulators
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
17,104
test ruff hook
from pathlib import Path import pytest import demisto_sdk.commands.pre_commit.pre_commit_command as pre_commit_command from demisto_sdk.commands.common.legacy_git_tools import git_path from demisto_sdk.commands.pre_commit.hooks.mypy import MypyHook from demisto_sdk.commands.pre_commit.hooks.ruff import RuffHook from ...
17,105
run
#!/usr/bin/env python # # Copyright 2006, Google Inc. # 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, this list...
17,106
extract
"""The central module containing code to create substation tables """ from geoalchemy2.types import Geometry from sqlalchemy import Column, Float, Integer, Text from sqlalchemy.ext.declarative import declarative_base from egon.data import db Base = declarative_base() class EgonEhvSubstation(Base): __tablename_...
17,107
compile hlg
#!/usr/bin/env python3 # Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang) # 2022 Johns Hopkins University (author: Dongji Gao) # # This script is adapted from \ # k2-fsa/icefall/blob/master/egs/librispeech/ASR/local/compile_hlg.py # # See https://github.com/k2-fsa/icefall/blob/master/LIC...
17,108
run ocr on image paths
#!/usr/bin/python3 """Script to generate missing or corrupted Google Cloud Vision JSON. To run, simply run as root, with the Google API_KEY as envvar: `CLOUD_VISION_API_KEY='{KEY}' python3 run_ocr.py` Missing JSON will be added, and corrupted JSON or Google Cloud Vision JSON containing an 'errors' fields will be repl...
17,109
list web app backup configuration slot output
# 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...
17,110
test users are only rewarded if in
import pandas as pd from cardpay_reward_programs.rules import safe_ownership def create_rule( monkeypatch, fake_data, core_config_overrides={}, user_config_overrides={} ): core_config = { "start_block": 0, "end_block": 10000, "payment_cycle_length": 1000, "duration": 43200, ...
17,111
read attributes
"""Aqara E1 Radiator Thermostat Quirk.""" from __future__ import annotations from typing import Any from zigpy.profiles import zha from zigpy.quirks import CustomCluster import zigpy.types as t from zigpy.zcl.clusters.general import Basic, Identify, Ota, Time from zigpy.zcl.clusters.hvac import Thermostat from zhaqu...
17,112
slices cutout
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides tools for generating 2D image cutouts. """ import numpy as np from astropy.nddata import extract_array, overlap_slices from astropy.utils import lazyproperty from photutils.aperture import BoundingBox __all__ = ['CutoutImage'] ...
17,113
provisioning state
# 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...
17,114
object end
# automatically generated by the FlatBuffers compiler, do not modify # namespace: reflection import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class Object(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(fl...
17,115
main
from klampt import * from klampt import vis from klampt.model import types from klampt.io import resource,loader import optparse import os,glob import sys import json def mkdir_p(path): import os, errno try: os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST...
17,116
add
"""LanceDB vector store.""" from typing import Any, List, Optional from llama_index.schema import ( BaseNode, MetadataMode, NodeRelationship, RelatedNodeInfo, TextNode, ) from llama_index.vector_stores.types import ( MetadataFilters, VectorStore, VectorStoreQuery, VectorStoreQueryRe...
17,117
add
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # This program is free software: you can redistribute it and/or modify # it ...
17,118
register handler
# Copyright (c) OpenMMLab. All rights reserved. from io import BytesIO, StringIO from pathlib import Path from ..utils import is_list_of, is_str from .file_client import FileClient from .handlers import BaseFileHandler, JsonHandler, PickleHandler, YamlHandler file_handlers = { 'json': JsonHandler(), 'yaml': Y...
17,119
init subtokenizer
# 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...
17,120
id
# 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__ =...
17,121
run
# Copyright (c) Ansible project # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from collections import na...
17,122
get status json
# Copyright 2014-2022 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
17,123
etag
# 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...
17,124
test derived
import sys import unittest from doctest import DocTestSuite from test import support import weakref import gc # Modules under test import _thread import threading import _threading_local class Weak(object): pass def target(local, weaklist): weak = Weak() local.weak = weak weaklist.append(weakref.ref...
17,125
get cuda path
# Copyright 2020-2022 OpenDR European Project # # 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 agree...
17,126
saveani
#!/usr/bin/env python """ Test multi """ import os import sys import time import numpy as np import matplotlib #matplotlib.use('pdf') import matplotlib.animation as animation import matplotlib.pyplot as plt import pygimli as pg import pygimli.polytools as pt from pygimli.meshtools import createMesh import fluidFl...
17,127
put
from copy import deepcopy from elasticsearch import NotFoundError from elasticsearch.helpers import bulk from wagtail.search.backends.elasticsearch6 import ( Elasticsearch6AutocompleteQueryCompiler, Elasticsearch6Index, Elasticsearch6Mapping, Elasticsearch6SearchBackend, Elasticsearch6SearchQueryC...
17,128
api query old
""" $description Turkish live TV channels and video on-demand service from Dogan Group, including CNN Turk and Kanal D. $url cnnturk.com $url dreamturk.com.tr $url dreamtv.com.tr $url kanald.com.tr $url teve2.com.tr $type live, vod """ import logging import re from urllib.parse import urljoin from streamlink.plugin i...
17,129
get unpatched class
""" Monkey patching of distutils. """ import sys import distutils.filelist import platform import types import functools from importlib import import_module import inspect from setuptools.extern import six import setuptools __all__ = [] """ Everything is private. Contact the project team if you think you need this ...
17,130
css classes
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from __future__ import annotations import typing as t from dataclasses import dataclass, field from typing impor...
17,131
unregister
""" Simple Render Engine ++++++++++++++++++++ """ import bpy import array import gpu from gpu_extras.presets import draw_texture_2d class CustomRenderEngine(bpy.types.RenderEngine): # These three members are used by blender to set up the # RenderEngine; define its internal name, visible name and capabilities...
17,132
pick bytes family type
# Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
17,133
test frac 2d
import unittest import numpy as np import porepy as pp class TestFractureGeometry(unittest.TestCase): """Test computation of fracture centroids.""" def test_frac_3d_1(self): # Simple plane, known center. f_1 = pp.PlaneFracture( np.array([[0, 2, 2, 0], [0, 2, 2, 0], [-1, -1, 1, 1...
17,134
ztest data is updated
# -*- coding: utf-8 -*- from zope.annotation.interfaces import IAnnotations from castle.cms import utils from persistent.dict import PersistentDict from persistent.list import PersistentList from plone.app.testing import TEST_USER_ID from plone.app.testing import TEST_USER_NAME from plone.app.testing import login from ...
17,135
print singletons
#!/usr/bin/env python3 # This script is based on # https://github.com/rust-lang/rust/blob/master/library/core/src/unicode/printable.py # distributed under https://github.com/rust-lang/rust/blob/master/LICENSE-MIT. # This script uses the following Unicode tables: # - UnicodeData.txt from collections import namedtupl...
17,136
test collinear x2c uks gga high cost
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
17,137
get mockreturn
""" Test Gemini Astroquery module. For information on how/why this test is built the way it is, see the astroquery documentation at: https://astroquery.readthedocs.io/en/latest/testing.html """ from datetime import date import json import os import pytest import requests from astropy import units from astropy.coordin...
17,138
test tornado handler create view to arrow
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ # ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃ # ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃ # ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄...
17,139
test namespaced public doctype
"""Tests to ensure that the html.parser tree builder generates good trees.""" from pdb import set_trace import pickle import pytest import warnings from bs4.builder import ( HTMLParserTreeBuilder, ParserRejectedMarkup, XMLParsedAsHTMLWarning, ) from bs4.builder._htmlparser import BeautifulSoupHTMLParser fr...
17,140
test append large stream without network
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import pla...
17,141
test get collection bad version
from globus_sdk import GuestCollectionDocument, MappedCollectionDocument from tests.common import register_api_route_fixture_file def test_get_collection(client): register_api_route_fixture_file( "gcs", "/collections/COLLECTION_ID", "get_collection/normal.json" ) res = client.get_collection("COLLE...
17,142
parse float vector
import os from pathlib import Path from valvefgd import Fgd, FgdEntity, FgdParse os.environ['NO_BPY'] = '1' from ...shared.content_providers.content_manager import ContentManager def parse_int_vector(string): return [int(val) for val in string.replace(' ', ' ').split(' ')] def METHOD_NAME(string): return...
17,143
test models artifact repo init with uri
from unittest import mock from unittest.mock import Mock import pytest from mlflow import MlflowClient from mlflow.entities.model_registry import ModelVersion from mlflow.store.artifact.databricks_models_artifact_repo import DatabricksModelsArtifactRepository from mlflow.store.artifact.models_artifact_repo import Mod...
17,144
client
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), ...
17,145
main
#!/usr/bin/env python """ Populates the database with the current installations of components This script assumes that the InstalledComponentsDB, the ComponentMonitoring service and the Notification service are installed and running """ from datetime import datetime from DIRAC import S_OK from DIRAC import exit as DI...
17,146
test volume type quotas
from types import SimpleNamespace from typing import cast, Any from attr import evolve from resoto_plugin_aws.resource.base import AwsResource from resoto_plugin_aws.aws_client import AwsClient from resoto_plugin_aws.resource.base import GraphBuilder, AwsRegion from resoto_plugin_aws.resource.ec2 import AwsEc2Instanc...
17,147
instance remote version default 1 3
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import pytest from datadog_test_libs.utils.mock_dns import mock_local from six import iteritems from datadog_checks.dev import TempDir, docker_run from datadog_checks.tls.utils import days_to_s...
17,148
update time
""" novelWriter – GUI Main Window Status Bar ======================================== File History: Created: 2019-04-20 [0.0.1] This file is a part of novelWriter Copyright 2018–2023, Veronica Berglyd Olsen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Pub...
17,149
list workspace notebook access token
# 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__ ...
17,150
window size
from __future__ import absolute_import from kafka.metrics.measurable_stat import AbstractMeasurableStat from kafka.metrics.stats.sampled_stat import AbstractSampledStat class TimeUnit(object): _names = { 'nanosecond': 0, 'microsecond': 1, 'millisecond': 2, 'second': 3, 'mi...
17,151
convert glob
"""Functions that turn a string into a restriction or raise ParseError. __all__ = ("parse_match", "ParseError",) @var parse_funcs: dict of the functions that are available. """ import re from ..ebuild import atom, cpv, errors, restricts from ..restrictions import packages, values from ..restrictions.util import col...
17,152
get conv metatype
# 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...
17,153
test none
# /*########################################################################## # # Copyright (c) 2016-2019 European Synchrotron Radiation Facility # # 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 Sof...
17,154
test schematization of service and operation
# -*- coding: utf-8 -*- import os import aredis import pytest from ddtrace import Pin from ddtrace.contrib.aredis.patch import patch from ddtrace.contrib.aredis.patch import unpatch from ddtrace.internal.schema.span_attribute_schema import _DEFAULT_SPAN_SERVICE_NAMES from ddtrace.vendor.wrapt import ObjectProxy from ...
17,155
show hosters
# -*- coding: utf-8 -*- # vStream https://github.com/Kodi-vStream/venom-xbmc-addons return False # 02/10/21 import re from resources.lib.gui.hoster import cHosterGui from resources.lib.gui.gui import cGui from resources.lib.handler.inputParameterHandler import cInputParameterHandler from resources.lib.handler.outputP...
17,156
auto preview
''' conv_star.py Copyright (C) 2020, 2021, 2022 Phillip A Carter Copyright (C) 2020, 2021, 2022 Gregory D Carl 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 (...
17,157
test util tags tool len
from unittest.mock import MagicMock, patch, PropertyMock import pytest from pontoon.tags.models import Tag from pontoon.tags.utils import ( TagsLatestTranslationsTool, TagsResourcesTool, TagsStatsTool, TagsTool, TagTool, ) from pontoon.tags.utils.base import Clonable def test_util_tags_tool(): ...
17,158
get sample
import sys if sys.version_info[0] == 3 and sys.version_info[1] >= 8: from typing import List, TypedDict else: from typing_extensions import TypedDict from typing import List from dataclasses import dataclass from itertools import chain from transformers import AutoTokenizer, AutoModelForSeq2SeqLM import ...
17,159
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 . imp...
17,160
setup
import numpy as np import pyqtgraph as pg try: import cupy as cp pg.setConfigOption("useCupy", True) except ImportError: cp = None try: import numba except ImportError: numba = None def renderQImage(*args, **kwargs): imgitem = pg.ImageItem(axisOrder='row-major') if 'autoLevels' not in ...
17,161
build model
# 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 fairseq import utils from fairseq.models import ( FairseqLanguageModel, register_model, register_model_architecture, ) from f...
17,162
test bl has sectors
#!/usr/bin/env python """ mbed Copyright (c) 2017-2020 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicab...
17,163
test can not create by other punctuation
# -*- coding: utf-8 -*- import json from mock import patch import random from django.urls import reverse from seaserv import seafile_api from seahub.test_utils import BaseTestCase from seahub.api2.endpoints.groups import Groups from tests.common.utils import randstring class GroupsTest(BaseTestCase): def setUp...
17,164
rebuild editor
# (C) Copyright 2004-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
17,165
gc
import time from datetime import datetime, timedelta from pyinfraboxutils import get_logger, get_env from pyinfraboxutils import dbpool from pyinfraboxutils.storage import storage, SWIFT logger = get_logger("gc") class GC(object): def run(self): # TODO: Delete storage objects: uploads, outputs # ...
17,166
test distribute alert escalate alert group when
from unittest.mock import PropertyMock, patch import pytest from apps.alerts.models import Alert, EscalationPolicy from apps.alerts.tasks import distribute_alert, escalate_alert_group @pytest.mark.django_db def test_alert_create_default_channel_filter(make_organization, make_alert_receive_channel, make_channel_filt...
17,167
description
# 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...
17,168
add query
from copy import deepcopy from GangaCore.GPIDev.Base.Proxy import stripProxy from GangaCore.GPIDev.Base.Proxy import isType from GangaCore.GPIDev.Schema import Schema, Version from GangaCore.Core.exceptions import GangaException from GangaCore.Core.exceptions import GangaAttributeError from GangaCore.GPIDev.Lib.Regist...
17,169
test env var only
#!/usr/bin/env python # # Copyright 2008, Google Inc. # 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, this list...
17,170
iri to uri
""" The ``tools.web`` package contains utility functions for interaction with web applications, APIs, or websites in your plugins. .. versionadded:: 7.0 """ # Copyright © 2008, Sean B. Palmer, inamidst.com # Copyright © 2009, Michael Yanovich <yanovich.1@osu.edu> # Copyright © 2012, Dimitri Molenaars, Tyrope.nl. # Cop...
17,171
handle run button clicked
from __future__ import absolute_import ############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free softwa...
17,172
test deserialize int from hex or int
import pytest from rotkehlchen.accounting.structures.balance import BalanceType from rotkehlchen.balances.manual import ManuallyTrackedBalance, add_manually_tracked_balances from rotkehlchen.constants import ONE from rotkehlchen.constants.assets import A_BTC, A_ETH from rotkehlchen.errors.serialization import Deserial...
17,173
query with results
# ------------------------------------------------------------------------- # Copyright (c) SecureWorks. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Azure Resource Gr...
17,174
delete all
# Copyright 2023 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
17,175
fn schema str
from abc import abstractmethod from dataclasses import dataclass from typing import Any, Dict, Optional, Type from llama_index.bridge.pydantic import BaseModel from llama_index.bridge.langchain import StructuredTool, Tool class DefaultToolFnSchema(BaseModel): """Default tool function Schema.""" input: str ...
17,176
load hp checkpoint state
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team import os import torch import types from .constants import (FP32_WEIGHT_KEY, PARAM, VOCAB_DIVISIBILITY_PADDING_TENSOR, CAT_DIM) def METHOD_NAME(self, folder, tp_rank, tp_world_size): hp_mapping = self._hp_mapping o...
17,177
validate evaluation interval multiple
# Copyright 2023 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...
17,178
set up
import unittest import numpy as np from tacs import TACS, constitutive, elements class ConstitutiveTest(unittest.TestCase): def METHOD_NAME(self): # fd/cs step size if TACS.dtype is complex: self.dh = 1e-200 self.rtol = 1e-12 else: self.dh = 1e-8 ...
17,179
to matrix
# Copyright (c) 2020 Jeff Irion and contributors # # This file originated from the `graphslam` package: # # https://github.com/JeffLIrion/python-graphslam r"""Representation of a pose in :math:`SE(2)`. """ import math import numpy as np from ..util import neg_pi_to_pi class PoseSE2(np.ndarray): r"""A repres...
17,180
course calculate instructor most questions answered
from django.contrib.auth import get_user_model from django.db.models import Avg, Case, Count, F, Sum, When from django.db.models.functions import TruncDate from django.utils import timezone from ohq.models import CourseStatistic, Question, QueueStatistic User = get_user_model() def course_calculate_student_most_qu...
17,181
toggle
from __future__ import annotations from typing import TYPE_CHECKING, ClassVar from rich.console import RenderableType from ..binding import Binding, BindingType from ..events import Click from ..geometry import Size from ..message import Message from ..reactive import reactive from ..scrollbar import ScrollBarRender...
17,182
cctbx miller fft map as xplor map
"""Example format for Xplor Maps: 2 !NTITLE REMARKS FILENAME="" REMARKS scitbx.flex.double to Xplor map format 24 0 24 120 0 120 54 0 54 3.20420E+01 1.75362E+02 7.96630E+01 9.00000E+01 9.00000E+01 9.00000E+01 ZYX 0 -2.84546E-01-1.67775E-01-5.66095E-01-1.1...
17,183
dedup
# ========================================================================== # # Copyright NumFOCUS # # 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...
17,184
conferences contributions from es
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
17,185
readlink
"""Some utility functions.""" import errno import os import platform import stat import sys from contextlib import suppress from importlib.metadata import version from pathlib import Path from types import TracebackType from typing import Any, Callable, Literal, Optional, TextIO, Tuple, Union, cast import colorama fr...
17,186
changestream
from ..abc.lookup import MappingLookup from ..abc.lookup import AsyncLookupMixin from ..cache import CacheDict import asyncio import logging ### L = logging.getLogger(__name__) ### class MongoDBLookup(MappingLookup, AsyncLookupMixin): """ The lookup that is linked with a MongoDB. It provides a mapping (dictiona...
17,187
test get name stream
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import os import dnf import libdnf from .common import TestCase class DnfModulePackageApiTest(TestCase): def setUp(self): self.base = dnf.Base(dnf.conf.Conf()) repo = self.base.repos.add_new...
17,188
test successful uid request
import json from base64 import standard_b64encode from copy import deepcopy from http import HTTPStatus from urllib.parse import quote import pytest from test.common_helper import TEST_FW, CommonDatabaseMock TEST_FW_PAYLOAD = { 'binary': standard_b64encode(b'\x01\x23\x45\x67\x89').decode(), 'file_name': 'no_...
17,189
configure apm agent
# coding: utf-8 import logging import flask_admin import rq_dashboard import rq_scheduler_dashboard from elasticapm.contrib.flask import ElasticAPM from flask import Flask, flash, redirect, request, url_for from flask_babelex import Babel, lazy_gettext from flask_caching import Cache from flask_htmlmin import HTMLMIN...
17,190
dict
# Copyright (c) OpenMMLab. All rights reserved. from typing import List, Sequence from mmocr.registry import TASK_UTILS from mmocr.utils import list_from_file @TASK_UTILS.register_module() class Dictionary: """The class generates a dictionary for recognition. It pre-defines four special tokens: ``start_token...
17,191
unit vector
#!/usr/bin/env python ############################################################################### # Copyright Kitware Inc. and Contributors # Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0) # See accompanying Copyright.txt and LICENSE files for details ##################################...
17,192
keyfilter
#!/usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; tab-width: 2 -*- """ find_in_bitfield.py Attempts to locate an integer inside of a given file with bitfields Copyright 2015-2018 Michael Farrell <micolous+git@gmail.com> Note: This loads the entire file into memory blindly. Do not use on large file siz...
17,193
some elements
""" Non Negative Integers """ # **************************************************************************** # Copyright (C) 2009 Florent Hivert <Florent.Hivert@univ-rouen.fr> # # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ # *******************...
17,194
test map rolling pairs
import numpy as np from numpy.testing import assert_array_equal from landlab.graph.sort.ext.remap_element import offset_to_sorted_block from landlab.graph.sort.intpair import ( map_pairs_to_values, map_rolling_pairs_to_values, pair_isin, ) def test_pair_isin_one_pair(): src = np.asarray( [[0,...
17,195
id
from numbers import Number from typing import Dict, Optional, Union import numpy as np import pandas as pd import pytest from scipy import stats from great_expectations.core import Domain from great_expectations.core.metric_domain_types import MetricDomainTypes from great_expectations.rule_based_profiler.parameter_co...
17,196
validate
from conans import ConanFile, tools, CMake from conan.tools.microsoft import msvc_runtime_flag from conans.errors import ConanInvalidConfiguration import os class Opene57Conan(ConanFile): name = "opene57" description = "A C++ library for reading and writing E57 files, " \ "fork of the origina...
17,197
test out of source build
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2020-2021 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
17,198
test unsupported
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later import os import pathlib import json import time import logging import signal import pytest from qutebrowser.qt.core import QFileSystemWatcher from qutebrowser.commands import userscripts from...
17,199
try load config
import functools import os import sys from lockfile import LockTimeout from lockfile.pidlockfile import PIDLockFile import getpass import click from bugwarrior.config import get_keyring, get_config_path, load_config from bugwarrior.services import aggregate_issues, get_service from bugwarrior.db import ( get_def...