id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
4,400
get query by info id
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. # ToDo upgrade # Deprecation warnings in 7.15.0 pre-releases # https://github.com/elastic/elasticsearch-py/issues/1698 import datetime import logging ...
4,401
test invalid path
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
4,402
tz from env
from __future__ import with_statement import os import re import sys import pytz import subprocess _systemconfig_tz = re.compile(r'^Time Zone: (.*)$(?m)') def METHOD_NAME(tzenv): if tzenv[0] == ':': tzenv = tzenv[1:] # TZ specifies a file if os.path.exists(tzenv): with open(tzenv, 'rb') ...
4,403
test close expiry incidents without expiring tokens
from datetime import datetime, timedelta from io import StringIO import pytz from django.conf import settings from django.core.management import call_command from django.test import TestCase from rest_framework.authtoken.models import Token from argus.dev.management.commands.check_token_expiry import ( close_expi...
4,404
get value
# Project: MXCuBE # https://github.com/mxcube. # # This file is part of MXCuBE software. # # MXCuBE 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 of the License, or # (at your ...
4,405
wait for task
""" hades_logs ---------- This module provides access to Hades' radius logs utilizing its celery RPC api. """ import typing as t import logging from celery.exceptions import TimeoutError as CeleryTimeoutError from flask import Flask from flask.globals import current_app from kombu.exceptions import OperationalError f...
4,406
test parser functions raises unknown arg hook
import os import pytest from tackle import tackle from tackle.cli import main from tackle import exceptions EXCEPTION_FIXTURES = [ # Check that return string not found caught ('return-str-not-found.yaml', exceptions.FunctionCallException), # Check that type checking works with no exec method. ('no-exe...
4,407
plugin shutdown
# FLEDGE_BEGIN # See: http://fledge-iot.readthedocs.io/ # FLEDGE_END """ Async Plugin used for testing purpose """ import asyncio import copy import uuid import logging import async_ingest from fledge.common import logger from fledge.services.south import exceptions from threading import Thread from datetime import d...
4,408
season
""" class for PhotoInfo exposing SearchInfo data such as labels """ from ._constants import _PHOTOS_4_VERSION, search_category_factory __all__ = ["SearchInfo"] class SearchInfo: """Info about search terms such as machine learning labels that Photos knows about a photo""" def __init__(self, photo, normaliz...
4,409
pop
# coding=utf-8 # # This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Most of this work is copyright (C) 2013-2019 David R. MacIver # (david@drmaciver.com), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold cop...
4,410
test read emri with pillow
# Copyright 2008-2018 pydicom authors. See LICENSE file for details. import os import sys import pytest import pydicom from pydicom.filereader import dcmread from pydicom.data import get_testdata_file pillow_missing_message = "pillow is not available " "in this test environment" pillow_present_message = "pillow is be...
4,411
test setpoint
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2023 PyMeasure Developers # # 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 limit...
4,412
vswr transformed
# NanoVNASaver # # A python program to view and export Touchstone data from a NanoVNA # Copyright (C) 2019, 2020 Rune B. Broberg # Copyright (C) 2020ff NanoVNA-Saver Authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
4,413
test seek
r"""Test S3 Blob DB Commands to setup Docker with minio for development/testing First, [install Docker](https://docs.docker.com/mac/#h_installation). Initialize a docker machine for minio (skip if you already have one): docker-machine create --driver virtualbox minio eval "$(docker-machine env minio)" Star...
4,414
test get cleanup statement
from datetime import datetime from dagster import TimeWindow from dagster._core.storage.db_io_manager import TablePartitionDimension, TableSlice from dagster_snowflake.snowflake_io_manager import SnowflakeDbClient, _get_cleanup_statement def test_get_select_statement(): assert ( SnowflakeDbClient.get_sel...
4,415
get value in tfconfig
# 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 applicable ...
4,416
check int
from __future__ import annotations from typing import TYPE_CHECKING import os from pyNastran.gui.utils.qt.checks.utils import (check_locale_float, is_ranged_value, check_format_str) if TYPE_CHECKING: from qtpy.QtWidgets import QLineEdit QLINE_EDIT_BASIC = 'QLineEdi...
4,417
tear down
from tests.integration.mock.local_node_network import LocalNodeNetwork from tests.unit.helpers.mock_transactions import get_introduce_motion_tx, get_vote_tx, get_new_currency_tx from unittest import TestCase import asyncio import json import random class TestNodeKick(TestCase): def setUp(self): self.networ...
4,418
test gui video
import numpy as np from sleap import Instance, Skeleton from sleap.gui.widgets.video import ( QtVideoPlayer, GraphicsView, QtInstance, QtVideoPlayer, QtTextWithBackground, VisibleBoundingBox, ) from qtpy import QtCore, QtWidgets from qtpy.QtGui import QColor def METHOD_NAME(qtbot): vp = Q...
4,419
update
# Copyright The Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
4,420
backup resource encryption config cf
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
4,421
test main
import pipes import os import string import unittest from test.test_support import TESTFN, run_unittest, unlink, reap_children if os.name != 'posix': raise unittest.SkipTest('pipes module only works on posix') TESTFN2 = TESTFN + "2" # tr a-z A-Z is not portable, so make the ranges explicit s_command = 'tr %s %s'...
4,422
uselist
import sqlalchemy as sa from sqlalchemy.orm.attributes import InstrumentedAttribute from sqlalchemy.util.langhelpers import symbol from .utils import str_coercible @str_coercible class Path: def __init__(self, path, separator='.'): if isinstance(path, Path): self.path = path.path else...
4,423
test import contributions
# 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. from datetime import datetime, timedelta from io import BytesIO import pytest from indico.core.errors im...
4,424
run task
import functools from datetime import datetime, timezone from sqlalchemy.orm import relationship from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.sql.sqltypes import Boolean, Integer, String, Text from files.classes.cron.tasks import (RepeatableTask, ScheduledTaskType, ...
4,425
test property getter doc override
# Test case for property # more tests are in test_descr import sys import unittest from test.test_support import run_unittest class PropertyBase(Exception): pass class PropertyGet(PropertyBase): pass class PropertySet(PropertyBase): pass class PropertyDel(PropertyBase): pass class BaseClass(object...
4,426
test follow on comment
# Copyright (c) 2019, Frappe Technologies and Contributors # License: MIT. See LICENSE from dataclasses import dataclass import frappe import frappe.desk.form.document_follow as document_follow from frappe.desk.form.assign_to import add from frappe.desk.form.document_follow import get_document_followed_by_user from fr...
4,427
test include print
"""Copy of `test_sobol.py` modified to cover SciPy sobol interface.""" from pytest import raises, mark from numpy.testing import assert_equal, assert_allclose import numpy as np from scipy.stats import norm from SALib.analyze import sobol from SALib.sample.sobol import sample as sobol_sample from SALib.sample import ...
4,428
test estimate observables
# This code is part of Qiskit. # # (C) Copyright IBM 2022, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
4,429
create snapshot
import logging from virttest import qemu_storage from virttest import data_dir from virttest import utils_disk from virttest.qemu_capabilities import Flags from provider import backup_utils from provider.virt_storage.storage_admin import sp_admin LOG_JOB = logging.getLogger('avocado.test') class BlockDevSnapshotT...
4,430
process
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
4,431
test help
import datetime import unittest import stem import stem.response import stem.version from unittest.mock import Mock, patch from stem.interpreter.commands import ControlInterpreter, _get_fingerprint from stem.response import ControlMessage from test.unit.interpreter import CONTROLLER EXPECTED_EVENTS_RESPONSE = """\ ...
4,432
exe comb
from ir import map, var, bound, expr ''' I am trying to use this class to demonstrate what a spec is. It should contain all the information for generate hardware, mapping constraint and functional model. ''' class Accessor: def __init__(self): self.map_dict = {} self.config_cons_dict = {} '...
4,433
proc errors
# Jython Database Specification API 2.0 # # Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com> from zxtest import zxCoreTestCase class OracleSPTest(zxCoreTestCase): def setUp(self): zxCoreTestCase.setUp(self) c = self.cursor() try: try: c.execute("drop tabl...
4,434
remove
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard(object): # This context manager registers itself in the current iterators of the # weak containe...
4,435
test phase active project private
import pytest import rules from adhocracy4.polls import phases from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import freeze_post_phase from adhocracy4.test.helpers import freeze_pre_phase from adhocracy4.test.helpers import setup_phase from ad...
4,436
run and verify
#!/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...
4,437
test clone
# (C) Copyright 2005-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...
4,438
get config defaults
#!/usr/bin/env python3 # # VM testing aarch64 library # # Copyright 2020 Linaro # # Authors: # Robert Foley <robert.foley@linaro.org> # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. # import os import sys import subprocess import basevm from qemu.utils im...
4,439
run each partition
import functools import asyncio from typing import Callable, TYPE_CHECKING, Type, TypeVar from contextlib import asynccontextmanager from libertem.common.async_utils import ( adjust_event_loop_policy, sync_to_async, async_generator_eager ) from libertem.common.executor import JobExecutor, AsyncJobExecutor from li...
4,440
get target agent
import logging from xml.etree import ElementTree from indra.statements import * from indra.databases.identifiers import ensure_chebi_prefix, \ ensure_chembl_prefix from indra.statements.validate import assert_valid_db_refs from indra.ontology.standardize import standardize_name_db_refs, \ get_standard_agent lo...
4,441
iterative closes point
import numpy as np from sklearn.neighbors import NearestNeighbors def calculate_affine_matrix(pointcloud_A, pointcloud_B): '''Calculates affine transform with the best least-squares fit transforming keypoints A to keypoints B. # Argument: pointcloud_A: Array of shape (num_keypoints, 3). ...
4,442
collect vars
import os import sys import csv import logging import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from ..common import get_logger import paddle import paddle.nn.functional as F from paddle.static.quantization.utils import load_variable_data _logger = get_logger(__na...
4,443
num tokens vec
# 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 logging import numpy as np import torch.utils.data from fairseq.data import data_utils logger = logging.getLogger(__name__) class Ep...
4,444
resp get pipeline
""" GitLab API: https://docs.gitlab.com/ee/api/pipelines.html """ import pytest import responses from gitlab.v4.objects import ( ProjectPipeline, ProjectPipelineTestReport, ProjectPipelineTestReportSummary, ) pipeline_content = { "id": 46, "project_id": 1, "status": "pending", "ref": "main...
4,445
location x changed
# -*- coding: utf-8 -*- """ Description: Usage: Author: YingzhiGou Date: 20/06/2017 """ from qtpy.QtWidgets import QGroupBox from mtpy.gui.SmartMT.ui_asset.groupbox_text_box import Ui_GroupBox_text_box class TextBox(QGroupBox): def __init__(self, parent, point_size=True, key_size=False): ...
4,446
find dir
"""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 ...
4,447
main
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2014, Vedit Firat Arig <firatarig@gmail.com> # Outline and parts are reused from Mark Theunissen's mysql_db module # 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-...
4,448
validate fields
"""Credential format inner object.""" from collections import namedtuple from enum import Enum from typing import TYPE_CHECKING, Mapping, Sequence, Type, Union from uuid import uuid4 from marshmallow import EXCLUDE, fields from .....messaging.decorators.attach_decorator import AttachDecorator from .....messaging.mod...
4,449
add to vat
import sys, json, gzip, re, time from collections import defaultdict from pprint import pprint from find_activity import find_activity # Track vat import/exports and record the counts after each delivery, to # estimate the size of the heap over time. We'll compare this against runtime # (especially GC time) to look fo...
4,450
handle
""" Command to import modulestore content into Content Libraries. """ import argparse import logging from django.conf import settings from django.core.management import BaseCommand, CommandError from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locator import LibraryLocatorV2 from openedx.core.djangoap...
4,451
get optimizer
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm fro...
4,452
add arguments
import logging import math import threading from django.core.management.base import BaseCommand from django.db.models import OuterRef, Subquery, F, Q from django.db import IntegrityError from squad.core.models import SuiteMetadata, Test from squad.core.utils import split_list correct_metadata = SuiteMetadata.objects...
4,453
build model
#SPDX-License-Identifier: MIT ## Added imports import re import unicodedata import nltk import string from nltk.tokenize import word_tokenize from nltk.stem.snowball import SnowballStemmer from bs4 import BeautifulSoup import matplotlib.pyplot as plt from datetime import date ## import logging import multiprocessing...
4,454
test grid combo savewasm
# LICENSE # # _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._ # # BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License"); # # - you may not use this software except in compl...
4,455
send2trash
# Copyright 2017 Virgil Dupras # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license # This is a reimplementation of plat_other.py with reference to the # fre...
4,456
test nonnull lang
import unittest from email import _encoded_words as _ew from email import errors from test.test_email import TestEmailBase class TestDecodeQ(TestEmailBase): def _test(self, source, ex_result, ex_defects=[]): result, defects = _ew.decode_q(source) self.assertEqual(result, ex_result) self.a...
4,457
get default device assignment
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
4,458
parse
import functools from collections.abc import Mapping from typing import Any, Callable, Optional from flask.views import MethodView from marshmallow import Schema, exceptions as ma_exceptions from webargs.core import ( _UNKNOWN_DEFAULT_PARAM, ArgMap, Request, ValidateArg, _ensure_list_of_callables, ...
4,459
test arm composite vld
import platform import unittest import gtirb import snippets class DataAccessTests(unittest.TestCase): @unittest.skipUnless( platform.system() == "Linux", "This test is linux only." ) def test_x86_simple(self): module = snippets.asm_to_gtirb( """ .access: ...
4,460
refresh token grant
from datetime import timedelta from typing import Union from uuid import UUID, uuid4 import sqlalchemy as sa import sqlalchemy.orm as so from flask import Response, jsonify, request from werkzeug.security import check_password_hash import db.models as dbm from common import getnow from db import dbsession from errors...
4,461
usage
#! /usr/bin/env python from __future__ import print_function import os,sys, DLFCN,getopt sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY) from CondCore.Utilities import iovInspector as inspect from pluginCondDBPyInterface import * import pluginCondDBPyInterface as CondDB from ROOT import TCanvas,TH1F, TH2F,TFile...
4,462
test unit missing reader
import sys sys.path.insert(0, '../common_python') import tools import os import shutil def get_default_parameters(dir_name, two_models=True): data_reader_path = '{d}/model_zoo/data_readers/data_reader_mnist.prototext'.format( d=dir_name) model_path = '{d}/model_zoo/tests/model_lenet_mnist_ckpt.prototex...
4,463
is available
# # (c) 2008 Mandriva, http://www.mandriva.com/ # # $Id: package_api.py 713 2009-02-27 14:06:11Z oroussy $ # # This file is part of Pulse 2, http://pulse2.mandriva.org # # Pulse 2 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 So...
4,464
test add remove group
#coding: UTF-8 """ Test groups api. """ import unittest from tests.api.apitestbase import ApiTestBase from tests.api.urls import GROUPS_URL from tests.common.utils import apiurl, urljoin, randstring class GroupsApiTest(ApiTestBase): def test_add_remove_group_member(self): with self.get_tmp_user() as user...
4,465
replace ingame text
"""Update wrinkly hints compressed file.""" import random from io import BytesIO import js from randomizer.Enums.Kongs import Kongs from randomizer.Lists.WrinklyHints import HintLocation, hints from randomizer.Patching.Lib import grabText, writeText from randomizer.Patching.Patcher import ROM, LocalROM def writeWrin...
4,466
assert normal equality implementation
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ I{Private} test utilities for use throughout Twisted's test suite. Unlike C{proto_helpers}, this is no exception to the don't-use-it-outside-Twisted-we-won't-maintain-compatibility rule! @note: Maintainers be aware: things in this module sho...
4,467
send request
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
4,468
read
# # The Python Imaging Library # $Id$ # # Adobe PSD 2.5/3.0 file handling # # History: # 1995-09-01 fl Created # 1997-01-03 fl Read most PSD images # 1997-01-18 fl Fixed P and CMYK support # 2001-10-21 fl Added seek/tell support (for layers) # # Copyright (c) 1997-2001 by Secret Labs AB. # Copyright (c) 1995-20...
4,469
get user details
""" Khan Academy OAuth backend, docs at: https://github.com/Khan/khan-api/wiki/Khan-Academy-API-Authentication """ from urllib.parse import urlencode from oauthlib.oauth1 import SIGNATURE_HMAC, SIGNATURE_TYPE_QUERY from requests_oauthlib import OAuth1 from .oauth import BaseOAuth1 class BrowserBasedOAuth1(BaseO...
4,470
iter errors
from _typeshed import Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Generator, Iterable, Iterator, Mapping from contextlib import contextmanager from typing import Any, ClassVar from typing_extensions import TypeAlias from ._format import FormatChecker from ._types import TypeChecker from ._...
4,471
connect
import logging import os import time from pathlib import Path from logging.handlers import BaseRotatingHandler import zmq from common.logging_extra import SwagLogger, SwagFormatter, SwagLogFileFormatter from system.hardware import PC if PC: SWAGLOG_DIR = os.path.join(str(Path.home()), ".comma", "log") else: SWAG...
4,472
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 from . im...
4,473
test plimit factorizations
#!/usr/bin/env python # -*- encoding: utf-8 -*- # CREATED:2022-08-09 06:34:21 by Brian McFee <brian.mcfee@nyu.edu> """Unit tests for just intonation and friends""" import os import sys try: os.environ.pop("LIBROSA_CACHE_DIR") except KeyError: pass import warnings import numpy as np import pytest import libro...
4,474
test timezone property
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the knowledge base.""" import unittest from plaso.containers import artifacts from plaso.engine import knowledge_base from tests import test_lib as shared_test_lib class KnowledgeBaseTest(shared_test_lib.BaseTestCase): """Tests for the knowledge base.""...
4,475
der encode tlv
import base64 import struct from typing import Any, Dict, List, Optional # This file is adapted from samples/shellinabox/ssh-krb-wrapper in # https://github.com/davidben/webathena, which has the following # license: # # Copyright (c) 2013 David Benjamin and Alan Huang # # Permission is hereby granted, free of charge, ...
4,476
test invalid casting dtype
# Copyright 2022 NVIDIA 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 wr...
4,477
test user preference over browser
""" Unit tests for janeway core middleware """ from django.contrib.auth.models import AnonymousUser from django.shortcuts import redirect from django.test import TestCase, override_settings from django.test.client import RequestFactory from django.urls import reverse from core.middleware import ( SiteSettingsMiddl...
4,478
compile string
# -*- coding: utf-8 -*- # Copyright © 2012-2023 Roberto Alsina and others. # 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 t...
4,479
test format date in string month year
import datetime import unittest.mock import dateutil import pytest from nikola.nikola import LEGAL_VALUES from nikola.utils import ( LocaleBorg, LocaleBorgUninitializedException, TranslatableSetting, ) TESLA_BIRTHDAY = datetime.date(1856, 7, 10) TESLA_BIRTHDAY_DT = datetime.datetime(1856, 7, 10, 12, 34, ...
4,480
what
import math import re import textwrap import operator import numpy as np import unittest from numba.core.compiler import compile_isolated from numba import jit from numba.core import types from numba.core.errors import TypingError from numba.core.types.functions import _header_lead from numba.tests.support import Tes...
4,481
join
#------------------------------------------------------------------------------------------# # This file is part of Pyccel which is released under MIT License. See the LICENSE file or # # go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # #----------------------------------------...
4,482
make dirs if necessary
#%module #% description: This script detectes changes by comparing two different sets of DEMs. #%end #%option #% key: reference_pc #% type: string #% required: yes #% multiple: no #% description: The path for the reference point cloud file #%end #%option #% key: reference_dsm #% type: string #% required: yes #% multipl...
4,483
describe targets
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Copyright the Hypothesis Authors. # Individual contributors are listed in AUTHORS.rst and the git log. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the...
4,484
stop
"""ZAP Authenticator in a Python Thread. .. versionadded:: 14.1 """ # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import time import logging from threading import Thread, Event import zmq from zmq.utils import jsonapi from zmq.utils.strtypes import bytes, unicode, b, u ...
4,485
convert max length
# Copyright (c) 2023 Arista Networks, Inc. # Use of this source code is governed by the Apache License 2.0 # that can be found in the LICENSE file. from __future__ import annotations from ansible_collections.arista.avd.plugins.plugin_utils.schema.avdschema import AvdSchema from ansible_collections.arista.avd.plugins.p...
4,486
test invert
# Copyright (c) 2017 The University of Manchester # # 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 ...
4,487
split args
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
4,488
downgrade
"""Deprecate Session.speaker_bio. Revision ID: 284c10efdbce Revises: 2cc791c09075 Create Date: 2021-02-09 10:01:25.069803 """ from textwrap import dedent from typing import Optional, Tuple, Union import progressbar.widgets import sqlalchemy as sa from alembic import op from progressbar import ProgressBar from sqlal...
4,489
record stats
"""Utils function""" """ Copyright (c) 2016-2022, EPFL/Blue Brain Project This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3.0 as published by the Free S...
4,490
size
"""tensorflow.compat.v1 backend implementation""" from packaging.version import Version import tensorflow.compat.v1 as tf if Version(tf.__version__) < Version("2.7.0"): raise RuntimeError("DeepXDE requires TensorFlow>=2.7.0.") # The major changes from TensorFlow 1.x to TensorFlow 2.x are: # 1. Eager execution:...
4,491
fin
from unittest import mock import pytest import requests from settings import TEST_DATA from suite.utils.resources_utils import ( create_example_app, create_items_from_yaml, create_namespace_with_name_from_yaml, delete_namespace, ensure_connection_to_public_endpoint, ensure_response_from_backend...
4,492
unpack
# 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...
4,493
project
import logging import os import re import json from typing import List, Any from datetime import datetime from github.Issue import Issue from github.Repository import Repository import requests from azure.devops.v6_0.pipelines.pipelines_client import PipelinesClient from azure.devops.v6_0.pipelines import models from ...
4,494
check format
from __future__ import absolute_import, division, print_function from wxtbx import phil_controls import wxtbx from libtbx.utils import Abort, to_unicode, to_str from libtbx import Auto import wx import sys class ValidatedTextCtrl(wx.TextCtrl, phil_controls.PhilCtrl): def __init__(self, *args, **kwds): saved_val...
4,495
compile
""" Soup Sieve. A CSS selector filter for BeautifulSoup4. MIT License Copyright (c) 2018 Isaac Muse 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 limita...
4,496
send finding to webex
import tempfile from enum import Enum from webexteamssdk import WebexTeamsAPI from robusta.core.reporting.base import Finding, FindingSeverity from robusta.core.reporting.blocks import BaseBlock, FileBlock, List, MarkdownBlock, TableBlock from robusta.core.reporting.utils import SVG_SUFFIX, add_pngs_for_all_svgs from...
4,497
deleterule
from typing_extensions import Literal, TypeAlias _Key: TypeAlias = bytes | str | memoryview ADD_CMD: Literal["TS.ADD"] ALTER_CMD: Literal["TS.ALTER"] CREATERULE_CMD: Literal["TS.CREATERULE"] CREATE_CMD: Literal["TS.CREATE"] DECRBY_CMD: Literal["TS.DECRBY"] DELETERULE_CMD: Literal["TS.DELETERULE"] DEL_CMD: Literal["TS...
4,498
enable rate limit
import math import time import threading import uuid from pprint import pformat # noqa from banal import hash_data from datetime import datetime from flask_babel import get_locale from flask import request, Response, Blueprint from werkzeug.exceptions import TooManyRequests import structlog from structlog.contextvars ...
4,499
package
from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration import os class MsgpackConan(ConanFile): name = "msgpack" description = "The official C++ library for MessagePack" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/msgpac...