id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
18,100
delete custom inv source
import logging from django.utils.encoding import smart_str from awx.main.utils.common import set_current_apps from awx.main.utils.common import parse_yaml_or_json logger = logging.getLogger('awx.main.migrations') def _get_instance_id(from_dict, new_id, default=''): """logic mostly duplicated with inventory_imp...
18,101
build directories
#!/usr/bin/env python import argparse import hashlib import os import sys import requests # Here I am disabling warnings as they pollute long download # screens. However, I am passing a more readable warning to the user # instructing them. from requests.packages.urllib3.exceptions import InsecureRequestWarning from t...
18,102
selftest tc shell copy
# tbot, Embedded Automation Tool # Copyright (C) 2019 Harald Seiler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
18,103
initialize problem startup
#------------------------------------------------------------------------------- # RKCorrections #------------------------------------------------------------------------------- from PYB11Generator import * from Physics import * from PhysicsAbstractMethods import * from RestartMethods import * @PYB11template("Dimensio...
18,104
do test
#!/usr/bin/env python3 # Test for issue 1322: ## restart mosquitto #sudo systemctl restart mosquitto.service # ## listen on topic1 #mosquitto_sub -t "topic1" # ## publish to topic1 without clean session #mosquitto_pub -t "topic1" -q 2 -c --id "foobar" -m "message1" ## message1 on topic1 is received as expected # ## p...
18,105
get javascript output format
# # 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 ...
18,106
chrome
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
18,107
lp radial
import numpy as np from scipy.special import jv, kn from scipy.optimize import fsolve from ..mode_basis import ModeBasis def eigenvalue_equation(u, m, V): '''Evaluates the eigenvalue equation for a circular step-index fiber. Parameters ---------- u : scalar The normalized propagation constant...
18,108
do plot
#!/usr/bin/env python "CLI for Mininet Cluster Edition prototype demo" from mininet.cli import CLI from mininet.log import output, error # pylint: disable=global-statement nx, graphviz_layout, plt = None, None, None # Will be imported on demand class ClusterCLI( CLI ): "CLI with additional commands for Cluste...
18,109
init dist mpi
# Copyright (c) OpenMMLab. All rights reserved. import functools import os import subprocess from collections import OrderedDict import torch import torch.multiprocessing as mp from torch import distributed as dist from torch._utils import (_flatten_dense_tensors, _take_tensors, _unflatten_de...
18,110
device id generate view
# apis_v1/views/views_misc.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from config.base import get_environment_variable from django.http import HttpResponse import json import sys from office.controllers import office_retrieve_for_api from quick_info.controllers import quick_info_retrieve_for_api f...
18,111
get minions
import abc from typing import List, Sized from .context import Context # Stubs class _JavaBehaviour: pass class _WrapperBehaviour(_JavaBehaviour): pass class GameAction: pass class Card: pass class Entity(): def getId(self) -> int: pass def getAttributeValue(self, attribut...
18,112
pull drugs
import neo4j.v1 import sys, os import pandas as pd import argparse as ap sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../") # code directory from RTXConfiguration import RTXConfiguration parser = ap.ArgumentParser(description='This will take a csv containing SemMedDB predicate tuples and break the...
18,113
cmdname
import glob import os import sys import types import click from launchable.commands.record.tests import tests as record_tests_cmd from launchable.commands.split_subset import split_subset as split_subset_cmd from launchable.commands.subset import subset as subset_cmd def METHOD_NAME(m): """figure out the sub-co...
18,114
recipe pearson residuals
from typing import Optional, Tuple from anndata import AnnData import pandas as pd import numpy as np from scanpy import experimental from scanpy.preprocessing import pca from scanpy.experimental._docs import ( doc_adata, doc_dist_params, doc_genes_batch_chunk, doc_pca_chunk, doc_layer, doc_chec...
18,115
tostring
""" Standard container-class for easy multiple-inheritance. Try to inherit from the ndarray instead of using this class as this is not complete. """ from numpy.core import ( array, asarray, absolute, add, subtract, multiply, divide, remainder, power, left_shift, right_shift, bitwise_and, bitwise_or, bitwi...
18,116
process matched
from itertools import chain, repeat, zip_longest from sverchok.data_structure import levels_of_list_or_np, list_match_func # the class based should be slower but kept until tested class SvZipExhausted(Exception): pass class SvSentinel: def __init__(self, fl, top): self.fl = fl self.top = top ...
18,117
init
# encoding: utf-8 ''' The application's Globals object ''' import logging from threading import Lock import re import six from ckan.common import asbool from ckan.common import config import ckan import ckan.model as model from ckan.logic.schema import update_configuration_schema log = logging.getLogger(__name__) ...
18,118
partial fit
from typing import Optional import torch import pandas as pd from scipy.special import softmax from sklearn.linear_model import Ridge from lightwood.helpers.log import log from type_infer.dtype import dtype from lightwood.mixer import BaseMixer from lightwood.encoder.base import BaseEncoder from lightwood.api.types im...
18,119
serialize rpc organization
from __future__ import annotations from collections import defaultdict from typing import Iterable, List, MutableMapping, Set from sentry.constants import ObjectStatus from sentry.models import ( Organization, OrganizationMember, OrganizationMemberTeam, Project, Team, TeamStatus, ) from sentry...
18,120
test catalog metadata
from AccessControl import Unauthorized from plone.app.testing.bbb import PloneTestCase from Products.CMFCore.utils import getToolByName from Products.CMFPlone.tests import dummy from Products.CMFPlone.utils import check_id from ZODB.POSException import ConflictError class TestCheckId(PloneTestCase): def testGoodI...
18,121
got create ready
# all imports needed by the engine itself from direct.showbase.ShowBase import ShowBase # initialize the engine base = ShowBase() # initialize the client from direct.distributed.ClientRepository import ClientRepository from panda3d.core import URLSpec, ConfigVariableInt, ConfigVariableString from direct.gui.Onscreen...
18,122
tear down
#!/usr/bin/env python # # Project: Sift implementation in Python + OpenCL # https://github.com/silx-kit/silx # # Copyright (C) 2013-2017 European Synchrotron Radiation Facility, Grenoble, France # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and asso...
18,123
private link service connection 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...
18,124
call environment webhooks
import enum import json import typing import requests from core.constants import FLAGSMITH_SIGNATURE_HEADER from core.signing import sign_payload from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.core.serializers.json import DjangoJSONEncoder from django.template.loader i...
18,125
prepare aws resource with given aws details
from datetime import datetime from docker import Client import json import boto3 import base64 import uuid def get_provider_details(provider, provider_json_file): """ From terraform provider file identify the credentials and return it Args: provider (str): Provider name of terraform provi...
18,126
test mine block issues block reward
import pytest from eth_utils import ( ValidationError, decode_hex, ) import rlp from eth import ( constants, ) from eth.chains.base import ( MiningChain, ) from eth.chains.mainnet import ( MAINNET_VMS, MINING_MAINNET_VMS, ) from eth.tools.builder.chain import ( api, ) from eth.tools.factor...
18,127
receive neighbor gradients
import random import torch class ClientDSGD(object): def __init__( self, model, model_cache, client_id, streaming_data, topology_manager, iteration_number, learning_rate, batch_size, weight_decay, latency, b_symmetric...
18,128
test deep copy
"""Unit tests for collections.defaultdict.""" import os import copy import pickle import tempfile import unittest from collections import defaultdict def foobar(): return list class TestDefaultDict(unittest.TestCase): def test_basic(self): d1 = defaultdict() self.assertEqual(d1.default_fact...
18,129
test add dup sub
import pytest from nonebug.app import App async def test_add_subscribe(app: App, init_scheduler): from nonebot_plugin_saa import TargetQQGroup from sqlalchemy.sql.expression import select from nonebot_plugin_datastore.db import get_engine from sqlalchemy.ext.asyncio.session import AsyncSession fr...
18,130
test not lazy
# -*- coding: utf-8 -*- # Copyright 2016-2023 The pyXem developers # # This file is part of pyXem. # # pyXem 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 optio...
18,131
test utxos
#!/usr/bin/env python3 # Copyright (c) 2022 The MobileCoin Foundation # # Integration test that uses mobilecoind-json to submit a transaction and check balance. import argparse import glob import json import logging import os import sys import time import urllib.request logging.basicConfig(stream = sys.stdout, leve...
18,132
meta data
# 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...
18,133
automate rs
""" msui.tutorials.tutorial_remotesensing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This python script generates an automatic demonstration of how to work with remote sensing tool in topview. This file is part of MSS. :copyright: Copyright 2021 Hrithik Kumar Verma :copyright: Copyright 2021-2023 by...
18,134
openldap server address port
# 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...
18,135
handle
"""BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, howev...
18,136
method
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
18,137
pharo rule17
# Leo colorizer control file for pharo mode. # This file is in the public domain. # Properties for pharo mode. properties = { "commentEnd": "\"", "commentStart": "\"", "indentCloseBrackets": "]", "indentOpenBrackets": "[", "lineUpClosingBracket": "true", } # Attributes dict for pharo_main ruleset....
18,138
names to sql columns
#!/usr/bin/env python """Import CSV as vector points with attributes into GRASS GIS Uses pyproj for CRS transformation, temporary file for the intermediate data, and v.in.ascii for import. """ # %module # % label: Import a CSV file using pyproj for CRS transformation # % keyword: vector # % keyword: import # % keywo...
18,139
on motion
# GridCal # Copyright (C) 2022 Santiago Peñate Vera # # This program 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 option) any later version. # # This ...
18,140
lowering
# CUDA built-in Vector Types # https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#built-in-vector-types from typing import List, Tuple, Dict from numba import types from numba.core import cgutils from numba.core.extending import make_attribute_wrapper, models, register_model from numba.core.imputils imp...
18,141
to dask
import pytest import xarray from ..projector import ( get_run_projection, project_xarray, get_xarray_config_field, project_summary_dict ) EVENT_FIELD = 'event_field_name' EVENT_CONFIGURATION_FIELD = 'event_configuration_name' START_DOC_FIELD = 'start_doc_metadata_name' START_DOC_FIELD_2 = 'start_doc_...
18,142
test raises right exception
import os import pytest from heavydb.thrift.ttypes import TColumnType from heavydb.common.ttypes import TTypeInfo from heavydb import OperationalError, connect from heavydb.connection import _parse_uri, ConnectionInfo from heavydb.exceptions import Error from heavydb._parsers import ColumnDetails, _extract_column_detai...
18,143
print test results
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2010. All Rights Reserved. # # # THIS IMPORT MUST COME FIRST # import mainUtils FIRST to get python version check # from qautils.gppylib.mainUtils import * import os, sys, traceback gProgramName = os.path.split(sys.argv[0])[-1] from qautils.gppylib.commands.base i...
18,144
info
# coding=utf-8 import json import os import datasets from utils import load_image, normalize_bbox logger = datasets.logging.get_logger(__name__) _CITATION = """\ @article{Jaume2019FUNSDAD, title={FUNSD: A Dataset for Form Understanding in Noisy Scanned Documents}, author={Guillaume Jaume and H. K. Ekenel and...
18,145
output paths
"""Specification for the RoboMaker create simulation application component.""" # 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...
18,146
merge
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. # Based on https://gist.github.c...
18,147
test pickle
""" Tests for utility methods for serialization """ import numpy as np import pytest from openff.utilities import requires_package as requires_pkg from openff.toolkit.utils.serialization import Serializable from openff.toolkit.utils.utils import deserialize_numpy, serialize_numpy class Thing(Serializable): def...
18,148
map pixels to coordinates
import rasterio as rio from rasterio import warp, transform import numpy as np import json import sys import os from geojson import Feature, FeatureCollection, dumps, Polygon from rasteralign import align, align_altitudes from webodm import settings sys.path.insert(0, os.path.join(settings.MEDIA_ROOT, "plugins", "cha...
18,149
get property init
import re import os import sys import fileinput try: import colorama colorama.init() def print_error(mess, **kwargs): print(colorama.Fore.RED + colorama.Style.BRIGHT + mess + colorama.Style.RESET_ALL, **kwargs) def print_warn(mess, **kwargs): print(colorama.Fore.YELLOW + colorama.Style.BRIGHT + mess + color...
18,150
update undo redo
""" @package vnet.toolbars @brief Vector network analysis dialog - toolbars Classes: - toolbars::PointListToolbar - toolbars::MainToolbar (C) 2012 by the GRASS Development Team This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details. @aut...
18,151
test gzip if header not present and
from pathlib import Path from typing import Any from unittest import mock from aiohttp import hdrs from aiohttp.test_utils import make_mocked_coro, make_mocked_request from aiohttp.web_fileresponse import FileResponse def test_using_gzip_if_header_present_and_file_available(loop: Any) -> None: request = make_moc...
18,152
test request json error
import unittest from unittest import mock from requests.exceptions import ConnectionError from betfairlightweight.compat import json from betfairlightweight import APIClient from betfairlightweight.endpoints.baseendpoint import BaseEndpoint from betfairlightweight.exceptions import APIError, InvalidResponse from tests...
18,153
project timeline
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2021-present Kaleidos Ventures SL from taiga.timeline.service import register_...
18,154
roundtrip
from datetime import timedelta from typing import Any, AsyncIterator from deepdiff import DeepDiff from pytest import fixture, mark from resotocore.db.subscriberdb import SubscriberDb from resotocore.ids import SubscriberId from resotocore.message_bus import MessageBus from resotocore.model.typed_model import to_js, ...
18,155
add removed cb
"""PyOhNet: control point device-list support """ import PyOhNet import abc import ctypes import time import _Cp._Device as Device # noinspection PyUnusedLocal class DeviceList(): """Abstract base class for device list handlers""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def __init__( self, aA...
18,156
test disk from uri
from migrator import uri from unittest import TestCase from migrator.exceptions import InvalidFormatException import pytest class ProjectRegion(TestCase): def test_region(self): project = 'my-project-id' region = 'europe-west3' uri_value = 'projects/{}/regions/{}'.format(project, region)...
18,157
tick strings
#!/usr/bin/env python # Thanks to @cpascual. This code is taken from # https://gist.github.com/cpascual/cdcead6c166e63de2981bc23f5840a98 ############################################################################# # # This file was adapted from Taurus TEP17, but all taurus dependencies were # removed so that it works...
18,158
create rotation attachments
""" .. module: lemur.plugins.lemur_slack.plugin :platform: Unix :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Harm Weites <harm@weites.com> .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ import json import arrow from...
18,159
test creating organization with comment
from django.urls import reverse from django_comments.models import Comment from fiscal.forms import OrganizationCreateForm, OrganizationForm from workshops.models import Event, Organization from workshops.tests.base import TestBase class TestOrganization(TestBase): def setUp(self): super().setUp() ...
18,160
parse
""" TOC directive ~~~~~~~~~~~~~ The TOC directive syntax looks like:: .. toc:: Title :depth: 3 "Title" and "depth" option can be empty. "depth" is an integer less than 6, which defines the max heading level writers want to include in TOC. """ from .base import Directive ...
18,161
main
#!/usr/bin/env python3 # ############################################################################ # # MODULE: v.db.update # AUTHOR(S): Moritz Lennert # Extensions by Markus Neteler # Converted to Python by Glynn Clements # PURPOSE: Interface to db.execute to update a column...
18,162
skip authorization
from django.core.exceptions import PermissionDenied from django.db.models import Model, Q from polar.partial import TypeConstraint from polar.variable import Variable from .oso import Oso, polar_model_name from .partial import TRUE_FILTER, partial_to_query_filter def authorize(request, resource, *, actor=None, actio...
18,163
get analysis types
# *************************************************************************** # * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
18,164
add to index
# Copyright 2016 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...
18,165
filter release
# -*- 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...
18,166
apply
# ----------------------------------------------------------------------------- # BSD 3-Clause License # # Copyright (c) 2021-2023, Science and Technology Facilities Council. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
18,167
api tags
import re def METHOD_NAME(data): lang = re.findall(r'zh-CN', str(data), re.IGNORECASE) if lang: return [ { "name": "asn", "description": "到货通知书" }, { "name": "binproperty", "description": "库位属性" }, { "na...
18,168
python exit
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" import atexit from concurrent.futures import _base import itertools import Queue as queue import threading import weakref import sys try: from multiprocessing import cpu_coun...
18,169
module code
"""Test that the semantics relating to the 'fromlist' argument are correct.""" from test.test_importlib import util import warnings import unittest class ReturnValue: """The use of fromlist influences what import returns. If direct ``import ...`` statement is used, the root module or package is returned...
18,170
get report hash
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ---------------------------------------------------...
18,171
native id
import sys from _typeshed import ProfileFunction, TraceFunction from collections.abc import Callable, Iterable, Mapping from types import TracebackType from typing import Any, TypeVar from typing_extensions import final _T = TypeVar("_T") __all__ = [ "get_ident", "active_count", "Condition", "current_...
18,172
setup api test data
from __future__ import annotations from datetime import timedelta import pandas as pd import pytest from flask_security import SQLAlchemySessionUserDatastore, hash_password from flexmeasures import Sensor, Source, User, UserRole from flexmeasures.data.models.generic_assets import GenericAssetType, GenericAsset from ...
18,173
test list err
# # Copyright (C) 2012-2013 Red Hat, Inc. # # Licensed under the GNU Lesser General Public License Version 2.1 # # This library 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 2.1 of th...
18,174
is pre
"""Meta related things.""" from __future__ import annotations from collections import namedtuple import re RE_VER = re.compile( r'''(?x) (?P<major>\d+)(?:\.(?P<minor>\d+))?(?:\.(?P<micro>\d+))? (?:(?P<type>a|b|rc)(?P<pre>\d+))? (?:\.post(?P<post>\d+))? (?:\.dev(?P<dev>\d+))? ''' ) REL_MAP = { ...
18,175
check test directory
# Copyright 2022 Fuzz Introspector 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 ...
18,176
dict list map
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
18,177
test request headers
"""Tests for tracking middleware.""" from unittest.mock import patch, sentinel import ddt from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.contrib.sessions.middleware import SessionMiddleware from django.test import TestCase from django.test.client import Req...
18,178
close
# -*- coding: utf-8 -*- """Asherah Server gRPC - Python client A simple Python application that demonstrates integrating with Asherah Server via a generated gRPC client. """ import argparse import asyncio import logging import queue import random import signal import string import sys from types import FrameType, Tr...
18,179
test simulated tstats
from copy import deepcopy import os from typing import cast import numpy as np from numpy.testing import assert_allclose import pandas as pd import pytest from statsmodels.tools.tools import add_constant from linearmodels.iv import IV2SLS, IVGMM, IVLIML from linearmodels.tests.iv.results.read_stata_results import pro...
18,180
change module
from rope.base import evaluate, exceptions, libutils, pyobjects, taskhandle from rope.base.change import ChangeContents, ChangeSet from rope.refactor import importutils, occurrences, rename, sourceutils class IntroduceFactory: def __init__(self, project, resource, offset): self.project = project s...
18,181
result
import json import os import pathlib import shutil import subprocess import pytest from pytestskipmarkers.utils import platform @pytest.fixture def pypath(): if platform.is_windows(): return pathlib.Path(os.getenv("ProgramFiles"), "Salt Project", "Salt") elif platform.is_darwin(): return path...
18,182
model path
from __future__ import absolute_import import os import ssl import urllib.request import urllib.error __copyright__ = "Copyright 2016-2020, Netflix, Inc." __license__ = "BSD+Patent" PYTHON_ROOT = os.path.dirname(os.path.realpath(__file__)) ROOT = os.path.abspath(os.path.join(PYTHON_ROOT, '..', '..',)) VMAF_RESOURCE_...
18,183
set curve scale
from PySide2.QtCore import Signal, Property, QPointF, Qt, QObject from PySide2.QtGui import QPainterPath, QVector2D from PySide2.QtQuick import QQuickItem class MouseEvent(QObject): """ Simple MouseEvent object, since QQuickMouseEvent is not accessible in the public API """ def __init__(self, evt): ...
18,184
prop descriptions
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Pad(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.updatemenu" _path_str = "layout.updatemenu.pad" _valid_props = {"b", "l", "r", "t"} ...
18,185
usage
#!/usr/bin/env python """ Copyright kubeinit contributors. 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 ...
18,186
get data source 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 __all__ =...
18,187
after fork
# # Module implementing queues # # multiprocessing/queues.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # # Modifications Copyright (c) 2020 Cloudlab URV # __all__ = ['Queue', 'SimpleQueue', 'JoinableQueue'] import os import cloudpickle import logging from queue import Em...
18,188
exists
"""Support for configuring USB through Linux ConfigFS. Linux provides the ConfigFS interface to enable USB gadget configuration using a configuration file tree. There are a few pieces of documentation provided by kernel.org: - https://www.kernel.org/doc/html/v5.9/usb/gadget_configfs.html - https://www.kernel.org/doc/...
18,189
update master cache
""" Wrap the saltcheck module to copy files to ssh minion before running tests """ import logging import os import shutil import tarfile import tempfile from contextlib import closing import salt.fileclient import salt.utils.files import salt.utils.json import salt.utils.url log = logging.getLogger(__name__) def M...
18,190
from config
# Copyright (c) 2020 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 # # Un...
18,191
cfg lst
#!/usr/bin/env python # encoding: utf-8 # andersg at 0x63.nu 2007 # Thomas Nagy 2016-2018 (ita) """ Support for Perl extensions. A C/C++ compiler is required:: def options(opt): opt.load('compiler_c perl') def configure(conf): conf.load('compiler_c perl') conf.check_perl_version((5,6,0)) conf.check_perl_ext...
18,192
set lr
# 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 dataclasses import dataclass, field import torch import torch.distributed as dist from fairseq.dataclass.configs import FairseqBMUFConfi...
18,193
cql connection patient
from collections import namedtuple import pytest from sdcm.utils.replication_strategy_utils import temporary_replication_strategy_setter, \ SimpleReplicationStrategy, NetworkTopologyReplicationStrategy, ReplicationStrategy, LocalReplicationStrategy class TestReplicationStrategies: def test_can_create_simple...
18,194
test l10n uk
# python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2...
18,195
make variable
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2023 Scipp contributors (https://github.com/scipp) # @file # @author Neil Vaytet import numpy as np import scipp as sc dim_list = ['xx', 'yy', 'zz', 'time', 'temperature'] def make_scalar(with_variance=False, dtype='float64', unit='counts'): var = sc.scala...
18,196
test validation fails when mimetype cannot be
# SPDX-License-Identifier: MPL-2.0 # Copyright (C) 2023 Gemeente Amsterdam from unittest.mock import Mock, patch import pytest from django.core.exceptions import ValidationError from signals.apps.services.domain.mimetypes import MimeTypeResolvingError from signals.apps.services.validator.file import ( ContentInte...
18,197
find python processes on port
# stdlib import asyncio from enum import Enum import logging import multiprocessing import os import platform import signal import subprocess # nosec import time from typing import Callable from typing import List from typing import Tuple # third party from fastapi import APIRouter from fastapi import FastAPI import ...
18,198
forward
import argparse import numpy as np import os from tensorflow import keras import pandas import tensorflow as tf from tensorflow.keras.utils import to_categorical from tensorflow.keras import optimizers from sklearn import metrics from pipeline.utils.tools import JobConfig from sklearn.preprocessing import LabelEncoder ...
18,199
get ragged
from typing import Callable, List, Optional, Tuple, TypeVar, Union, cast from ..backends import NumpyOps from ..config import registry from ..model import Model from ..types import Array2d, Ints1d, List2d, ListXd, Padded, Ragged NUMPY_OPS = NumpyOps() RaggedData = Tuple[Array2d, Ints1d] SeqT = TypeVar("SeqT", bound...