id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
10,500 | do shell | #!/usr/bin/env python
"""
Test script for the 'cmd' module
Original by Michael Schneider
"""
import cmd
import sys
from test import test_support
import re
import unittest
import StringIO
class samplecmdclass(cmd.Cmd):
"""
Instance the sampleclass:
>>> mycmd = samplecmdclass()
Test for the function p... |
10,501 | printoptions | from types import TracebackType
from collections.abc import Callable
from typing import Any, Literal, TypedDict, SupportsIndex
# Using a private class is by no means ideal, but it is simply a consequence
# of a `contextlib.context` returning an instance of aforementioned class
from contextlib import _GeneratorContextM... |
10,502 | code default | """IC wrapper module, based on Internet Config 1.3"""
from warnings import warnpy3k
warnpy3k("In 3.x, the ic module is removed.", stacklevel=2)
import icglue
import string
import sys
import os
from Carbon import Res
import Carbon.File
import macostools
error=icglue.error
# From ictypes.h:
icPrefNotFoundErr = -666 ... |
10,503 | get positional logical mapping from qiskit | """
compiler interface via qiskit
"""
from typing import Any, Dict, Optional
import re
from ..abstractcircuit import AbstractCircuit
from ..circuit import Circuit
from ..translation import qiskit_from_qasm_str_ordered_measure
def _free_pi(s: str) -> str:
# dirty trick to get rid of pi in openqasm from qiskit
... |
10,504 | test get jid | import logging
import pytest
import salt.returners.etcd_return as etcd_return
import salt.utils.json
from salt.utils.etcd_util import get_conn
from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import
docker = pytest.importorskip("docker")
log = logging.getLogger(__name__)
p... |
10,505 | test x variable error | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... |
10,506 | warn | # Copyright 2017 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... |
10,507 | has bind param | # -*- coding: utf-8 -*-
"""
Utility functions and base classes.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from copy import copy as stdlib_copy
from .interfaces import IBindParam
# pylint objects to __compile_visit.*__
# pylint:disable=bad-dunder... |
10,508 | chunks | # ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) 2020 - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# By using JUCE, you agree to the terms of both the... |
10,509 | app disabled | import json
import os
import tempfile
from collections.abc import Generator
import pytest
from flask.app import Flask
from spiffworkflow_backend.services.element_units_service import BpmnSpecDict
from spiffworkflow_backend.services.element_units_service import ElementUnitsService
from tests.spiffworkflow_backend.help... |
10,510 | test entity without entity links | from __future__ import annotations
from typing import Sequence
import pytest
from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
from metricflow.specs.specs import (
DimensionSpec,
EntityReference,
EntitySpec,
InstanceSpec,
InstanceSpecSet,
LinkableInstanceSpec,
... |
10,511 | extend flags patterns | import os
import uuid
from avocado.utils import path
from virttest import cpu
from virttest import virsh
from virttest import data_dir
from virttest import libvirt_xml
from virttest import env_process
from virttest import error_context
def METHOD_NAME(flags_dict):
"""
Return all possible patterns for given f... |
10,512 | test embedding functional | """
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... |
10,513 | test artifactstatus list not logged in | import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_artifacts.models import Artifactstatus
class ArtifactstatusViewTestCase(TestCase):
"""artifactstatus view tests"""
@classmethod
def setUpTestData(cls):
# create object
Artifac... |
10,514 | 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... |
10,515 | flat | # -*- coding: utf-8 -*-
"""
Misc functionality.
"""
import inspect
from pathlib import Path
import numpy as np
ROOT = Path(Path(inspect.getfile(inspect.currentframe())).resolve()).parent
def parse_phase_list(phase_list):
"""
Takes a list of phases, returns a list of individual phases. Performs e.g.
repl... |
10,516 | test 04 decode backtraces core | # 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... |
10,517 | test webhook logs | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# 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 ... |
10,518 | composite test map | """
Test Composite Map
"""
import numpy as np
import pytest
import astropy.units as u
from astropy.tests.helper import assert_quantity_allclose
import sunpy.data.test
import sunpy.map
from sunpy.tests.helpers import figure_test
# Ignore missing metadata warnings
pytestmark = [pytest.mark.filterwarnings('ignore:Missi... |
10,519 | actual instance must validate oneof | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
... |
10,520 | filter release plugins | """
Blocklist management
"""
from collections import defaultdict
from typing import TYPE_CHECKING, Any
import pkg_resources
from .configuration import BandersnatchConfig
if TYPE_CHECKING:
from configparser import SectionProxy
# The API_REVISION is incremented if the plugin class is modified in a
# backwards in... |
10,521 | drilldown map | from django.utils.translation import gettext_lazy as _
from corehq.apps.reports.filters.base import (
BaseDrilldownOptionFilter,
BaseSingleOptionFilter,
BaseMultipleOptionFilter,
)
from corehq.apps.reports.filters.dates import DatespanFilter
from custom.inddex.const import AGE_RANGES, ConvFactorGaps, FctGa... |
10,522 | deformable conv2d nchw | # 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... |
10,523 | fdb table has no dynamic macs | import re
import logging
import pprint
from ptf.mask import Mask
import ptf.testutils as testutils
import ptf.packet as scapy
from tests.common.helpers.assertions import pytest_assert
from tests.common.utilities import wait_until
MAC_STR = "000000000000"
DEFAULT_FDB_ETHERNET_TYPE = 0x1234
FDB_WAIT_EXPECTED_PACKET_TIM... |
10,524 | capture delay | from .base import ObjectBase
from .customer import Customer
class Payment(ObjectBase):
@classmethod
def get_resource_class(cls, client):
from ..resources import Payments
return Payments(client)
STATUS_OPEN = "open"
STATUS_PENDING = "pending"
STATUS_CANCELED = "canceled"
STATU... |
10,525 | assert not fields | # (C) Datadog, Inc. 2023-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from concurrent.futures.thread import ThreadPoolExecutor
from typing import List
import pytest
from datadog_checks.base.utils.db.utils import DBMAsyncJob
from .common import POSTGRES_VERSION
from .utils... |
10,526 | generate | # MIT License
#
# Copyright The SCons Foundation
#
# 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 rights to use, copy, modify, merge, ... |
10,527 | load | #
# The Python Imaging Library
# $Id$
#
# WMF stub codec
#
# history:
# 1996-12-14 fl Created
# 2004-02-22 fl Turned into a stub driver
# 2004-02-23 fl Added EMF support
#
# Copyright (c) Secret Labs AB 1997-2004. All rights reserved.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on... |
10,528 | save | #
# The Python Imaging Library.
# $Id$
#
# PCX file handling
#
# This format was originally used by ZSoft's popular PaintBrush
# program for the IBM PC. It is also supported by many MS-DOS and
# Windows applications, including the Windows PaintBrush program in
# Windows 3.
#
# history:
# 1995-09-01 fl Created
# 1996... |
10,529 | list active connectivity configurations | # 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... |
10,530 | test datacube instantiation | import numpy as np
from os.path import join, exists
from os import remove
from numpy import array_equal
import py4DSTEM
from py4DSTEM import save, read
import emdfile as emd
from py4DSTEM import (
Calibration,
DiffractionSlice,
RealSlice,
QPoints,
DataCube,
VirtualImage,
VirtualDiffraction... |
10,531 | library path | import logging
import os
import threading
from localstack import config
from localstack.aws.connect import connect_externally_to
from localstack.config import is_env_true
from localstack.services.dynamodb.packages import dynamodblocal_package
from localstack.utils.common import TMP_THREADS, ShellCommandThread, get_fre... |
10,532 | send message | import asyncio
import logging
from unittest.mock import AsyncMock, Mock
import pytest
from tribler.core.components.ipv8.eva.protocol import EVAProtocol, blank
from tribler.core.components.ipv8.eva.settings import EVASettings, Termination
from tribler.core.components.ipv8.eva.transfer.incoming import IncomingTransfer
... |
10,533 | setup network | #!/usr/bin/env python3
# Copyright (c) 2014-2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fro... |
10,534 | main | ## @file
# Intel Binary Product Data Generation Tool (Intel BPDG).
# This tool provide a simple process for the creation of a binary file containing read-only
# configuration data for EDK II platforms that contain Dynamic and DynamicEx PCDs described
# in VPD sections. It also provide an option for specifying an al... |
10,535 | create mode handler | # vimode -- Vi Mode package for QPlainTextEdit
#
# Copyright (c) 2012 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option... |
10,536 | update external config | from .collections import DottedDict
from .logging import debug
from .types import ClientConfig, debounced
from .types import read_dict_setting
from .types import Settings
from .types import SettingsRegistration
from .typing import Any, Optional, Dict, Callable
import os
import sublime
class ClientConfigs:
def __... |
10,537 | denseblock altern | # SPDX-License-Identifier: Apache-2.0
# From https://github.com/tdeboissiere/DeepLearningImplementations/blob/master/DenseNet/densenet.py
# Modifications Copyright (c) Microsoft.
from mock_keras2onnx.proto import keras
from keras.models import Model
from keras.layers.core import Dense, Dropout, Activation
from keras.... |
10,538 | translated groupby | from typing import Any, Dict, List, Optional, Protocol
from snuba_sdk import AliasedExpression, And, Column, Condition, CurriedFunction, Op, Or
from snuba_sdk.function import Function
from sentry.api.event_search import SearchFilter, SearchKey, SearchValue
from sentry.discover.arithmetic import categorize_columns
fro... |
10,539 | get dataset | import os
import math
import torch
import random
import pandas as pd
from pathlib import Path
from collections import Counter
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, DistributedSampler
from torch.distributed import is_initialized
from torch.nn.utils.rnn import pad_sequence
from ..m... |
10,540 | get dataset dict | """
# @File : bmninf_reader.py
# @Author: macaihong
# @Date : 2019/12/15
# @Desc :
"""
import os
import random
import pickle
import json
import numpy as np
import multiprocessing
import numpy as np
from .reader_utils import DataReader
def get_sw_prop(duration, window=200, step=10):
"""
get_sw_prop
... |
10,541 | test inject user session metrics when exception | import copy
from unittest import TestCase
from unittest.mock import Mock, patch, MagicMock
from buildpack.telemetry.metrics import (
FreeAppsMetricsEmitterThread,
PaidAppsMetricsEmitterThread,
MXVERSION_MICROMETER,
)
from lib.m2ee.version import MXVersion
class TestNegativeMemoryMetricsThrowError(TestCas... |
10,542 | tip lookback period | # 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... |
10,543 | collect files | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import os.path as osp
import mmcv
import mmengine
from mmocr.utils import dump_ocr_data
def METHOD_NAME(img_dir, gt_dir):
"""Collect all images and their corresponding groundtruth files.
Args:
img_dir (str): The image directo... |
10,544 | pre 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
# --------------------------------... |
10,545 | get context | import dataclasses
from django.core.validators import MaxValueValidator
from django.db import models
from wagtail.admin.panels import FieldPanel, MultiFieldPanel, PageChooserPanel
from wagtail.contrib.routable_page.models import RoutablePageMixin
from wagtail.fields import RichTextField
from wagtail.models import Pag... |
10,546 | flat to array | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD. See https://nomad-lab.eu for further info.
#
# 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/licen... |
10,547 | view resource owner | import json
import redis
import requests
from flask import Blueprint
from flask import current_app
from flask import flash
from flask import g
from flask import redirect
from flask import render_template
from flask import request
from flask import url_for
from gn3.authentication import AdminRole
from gn3.authenticati... |
10,548 | add failure | import unittest
import os
"""
Formats the output of the tests to be more user-friendly
Currently outputted as a table in order to increase readability.
"""
class UmpleTestTableResult(unittest.TextTestResult):
"""
Opens tag for results table and adds a little css
Adds the top row of table
"""
def... |
10,549 | good path | """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import glob
import io
import ipaddress
import itertools
import os
import shutil
import socket
from contextlib import contextmanager
from tempfile ... |
10,550 | etag | # 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... |
10,551 | delete | from PyQt5 import QtCore
from PyQt5.QtWidgets import QTreeView
class VQTreeItem(object):
def __init__(self, rowdata, parent):
self.parent = parent
self.rowdata = list(rowdata)
self.children = []
def append(self, rowdata):
child = VQTreeItem(rowdata, self)
self.childre... |
10,552 | 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... |
10,553 | operator specification set pin | #-------------------------------------------------------------------------------
# OperatorSpecification
#-------------------------------------------------------------------------------
class OperatorSpecificationAbstractAPI:
@staticmethod
def init_operator_specification_environment(object):
pass
@staticmethod
... |
10,554 | compute exclusive hv | from typing import Optional
import numpy as np
from optuna._hypervolume import _compute_2d
from optuna._hypervolume import _compute_2points_volume
from optuna._hypervolume import BaseHypervolume
class WFG(BaseHypervolume):
"""Hypervolume calculator for any dimension.
This class exactly calculates the hyper... |
10,555 | test get newer version | import os
import sys
from unittest.mock import Mock, patch
import arrow
import pytest
import lightning.app
from lightning.app.utilities.cli_helpers import (
_arrow_time_callback,
_check_environment_and_redirect,
_format_input_env_variables,
_get_newer_version,
)
def test_format_input_env_variables()... |
10,556 | iter all | # (C) Datadog, Inc. 2022-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations
from functools import cached_property
from typing import TYPE_CHECKING, Dict, Iterable
from ddev.integration.core import Integration
from ddev.repo.constants import CON... |
10,557 | status | # 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__ ... |
10,558 | url | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
10,559 | get mysql error | """
Management of MySQL databases (schemas)
=======================================
:depends: - MySQLdb Python module
:configuration: See :py:mod:`salt.modules.mysql` for setup instructions.
The mysql_database module is used to create and manage MySQL databases.
Databases can be set as either absent or present.
..... |
10,560 | get records | import copy
import os
from typing import Any, List, Optional, TypeVar, Iterator, Iterable
import logging
import numpy as np
from donkeycar.config import Config
from donkeycar.parts.tub_v2 import Tub
from donkeycar.utils import load_image, load_pil_image
from typing_extensions import TypedDict
logger = logging.getLogg... |
10,561 | drive | """Google API class."""
from typing import Any, Optional
import gdown
from pydrive2.auth import GoogleAuth
from pydrive2.METHOD_NAME import GoogleDrive
from pydrive2.files import GoogleDriveFileList
from owid.datautils.google.config import (
CLIENT_SECRETS_PATH,
CREDENTIALS_PATH,
SETTINGS_PATH,
google... |
10,562 | get hlt process | #!/usr/bin/env python3
"""getDatasets.py: create Datasets-cff file of an HLT configuration from the ConfDB database
"""
import argparse
import subprocess
import os
import re
import FWCore.ParameterSet.Config as cms
import HLTrigger.Configuration.Tools.pipe as pipe
import HLTrigger.Configuration.Tools.options as option... |
10,563 | test sets are disjoint if they share | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/custom-set/canonical-data.json
# File last updated on 2023-07-19
import unittest
from custom_set import (
CustomSet,
)
class CustomSetTest(unittest.TestCase):
def test_sets_with_no_... |
10,564 | test convert to digital ba | # -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
# GWpy 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)... |
10,565 | set mrml defaults | import logging
import os
import time
import qt
import vtk
import slicer
from SegmentEditorEffects import *
class SegmentEditorGrowFromSeedsEffect(AbstractScriptedSegmentEditorAutoCompleteEffect):
""" AutoCompleteEffect is an effect that can create a full segmentation
from a partial segmentation (not al... |
10,566 | get valid paths | """
Lammps Drones.
"""
import os
from datetime import datetime
from pymatgen.apps.borg.hive import AbstractDrone
from pymatgen.io.lammps.inputs import LammpsRun
from pymatgen.io.lammps.outputs import LammpsDump
from atomate.utils.utils import get_logger, get_uri
# from pymatgen.io.lammps.output import LammpsLog, La... |
10,567 | test function aliasing | from os.path import abspath
import pytest
from ddtrace.debugging._function.discovery import FunctionDiscovery
from ddtrace.debugging._function.discovery import _undecorate
from ddtrace.internal.compat import PY2
import tests.submod.stuff as stuff
def _f(f):
if PY2:
return f.im_func
return f
@pytes... |
10,568 | instance types | # 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... |
10,569 | get provider | import unittest
from datetime import date
from unittest.mock import Mock
from rdflib import DCTERMS
from rdflib import FOAF
from rdflib import Graph
from rdflib import RDF
from rdflib import VOID
from rdflib.term import Literal
from rdflib.term import URIRef
from atramhasis.rdf import HYDRA
from atramhasis.rdf import... |
10,570 | as str | import sys
import operator
import re
__CITATION__ = '''# ** If you use this software for a published work, please cite: **
#
# Jaime Huerta-Cepas, Joaquin Dopazo and Toni Gabaldon. ETE: a python Environment
# for Tree Exploration. BMC Bioinformatics 2010, 11:24. doi: 10.1186/1471-2105-11-24.'''
LOG_LEVEL = 2
... |
10,571 | load users | # This script adds Jans users to rdbm backends
import uuid
import os
import time
import hashlib
import base64
import psycopg2
import pymysql
import logging
from joblib import Parallel, delayed
def get_logger(name):
log_format = '%(asctime)s - %(name)8s - %(levelname)5s - %(message)s'
logging.basicConfig(leve... |
10,572 | set default | # Copyright (c) Meta Platforms, Inc. and affiliates.
"""
Helpers for handling authentification and credentials for SignalExchangeAPI
"""
from abc import ABCMeta, abstractmethod
import contextlib
import logging
import os
import pathlib
import typing as t
from threatexchange.exchanges.signal_exchange_api import (
... |
10,573 | test scalar negation | # Test for phase.py
import pytest
import numpy as np
import astropy.units as u
from pint.phase import Phase
# modified from @mhvk's test_phase_class.py
def assert_equal(first, second):
assert type(first) is type(second)
if type(first) == int:
assert np.all(first == second)
else:
# if floa... |
10,574 | name op |
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"haslocal", "hascompare", "hasfree", "opname", "opmap",
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
... |
10,575 | visit nat literal | from parsimonious import Grammar, NodeVisitor
from hail.expr.nat import NatVariable
from . import types
from hail.utils.java import unescape_parsable
type_grammar = Grammar(
r"""
type = _ (array / ndarray / set / dict / struct / union / tuple / interval / int64 / int32 / float32 / float64 / bool / str / call /... |
10,576 | on chk win | from __future__ import annotations
import itertools
import random
import re
from typing import Optional
from src import users
from src.containers import UserSet, UserDict
from src.decorators import command
from src.dispatcher import MessageDispatcher
from src.events import Event, event_listener
from src.functions imp... |
10,577 | cd | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* --------... |
10,578 | ping | import attr
from threading import Thread
from time import time
from ....config import deferred_config
from ....backend_interface.task.development.stop_signal import TaskStopSignal
from ....backend_api.services import tasks
from ....utilities.lowlevel.threads import kill_thread
from ....utilities.process.mp import Saf... |
10,579 | fill id | from typing import Optional
import structlog
from eth_typing import ChecksumAddress as Address
from hexbytes import HexBytes
from statemachine import State, StateMachine
from web3.types import Timestamp, Wei
from beamer.agent.models.request import Request
from beamer.events import ClaimMade
from beamer.typing import ... |
10,580 | calculate message call gas | """
Ethereum Virtual Machine (EVM) Gas
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
EVM gas constants and calculators.
"""
from dataclasses import dataclass
from typing import List, Tuple
from ethereum.base_types import U256, Uint
from... |
10,581 | set defaults kwargs | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
10,582 | to dict | # 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... |
10,583 | get iptables rule | #!/usr/bin/env python3
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... |
10,584 | get mark class glyphnames | from fontbakery.callable import check
from fontbakery.status import PASS, WARN, SKIP
from fontbakery.message import Message
# used to inform get_module_profile whether and how to create a profile
from fontbakery.fonts_profile import profile_factory # noqa:F401 pylint:disable=W0611
def _is_non_spacing_mark_char(char... |
10,585 | adaptive pool channel first | # 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... |
10,586 | get cppc | """SCons.Tool.sunc++
Tool-specific initialization for C++ on SunOS / Solaris.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby grant... |
10,587 | get create command | # 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... |
10,588 | test single gpu bmuf | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import functools
import random
import unittest
from multiprocessing import Manager
import torch
import torch.nn as nn
from fa... |
10,589 | time created | # 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... |
10,590 | feed data | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... |
10,591 | test reduce slice empty data rows | # Copyright 2017 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... |
10,592 | test post invalid type | import json
from unittest.mock import MagicMock
import pytest
from tests.common import StubDIContainer
from monkey_island.cc.resources import RemoteRun
from monkey_island.cc.services import AWSService
from monkey_island.cc.services.authentication_service import IOTPGenerator
from monkey_island.cc.services.aws import ... |
10,593 | grpc web library impl | # Copyright 2018- The Pixie 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 w... |
10,594 | supports currency | # This file is part of Indico.
# Copyright (C) 2002 - 2023 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import re
from flask import render_template, session
from flask_pluginengine import render_plugin_templat... |
10,595 | unpack uncompressed | """Logic to help flexibly get/set data in ORM objects (specifically HaloProperty and SimulationProperty) where data
of different types has to be stored in different attributes.
"""
import datetime
import functools
import pickle
import sys
import time
import zlib
import numpy as np
pickle_loads = pickle.loads
if int(... |
10,596 | set up | # Test mock_tk.Text class against tkinter.Text class by running same tests with both.
import unittest
from test.test_support import requires
from _tkinter import TclError
class TextTest(object):
hw = 'hello\nworld' # usual initial insert after initialization
hwn = hw+'\n' # \n present at initialization, be... |
10,597 | test batched graph wrapper | # Copyright (c) 2019 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 applic... |
10,598 | reset parameters | """Torch Module for Topology Adaptive Graph Convolutional layer"""
# pylint: disable= no-member, arguments-differ, invalid-name
import torch as th
from torch import nn
from .... import function as fn
from .graphconv import EdgeWeightNorm
class TAGConv(nn.Module):
r"""Topology Adaptive Graph Convolutional layer f... |
10,599 | raw file names | import os
import glob
import json
import torch
import pickle
import numpy as np
import os.path as osp
from torch_geometric.data import Data, InMemoryDataset
import traceback
def undirected_graph(data):
"""
A pre_transform function that transfers the directed graph into undirected graph.
Args:
data ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.