id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
15,100 | on stage start | #!/usr/bin/env/python3
"""This minimal example trains a CTC-based speech recognizer on a tiny dataset.
The encoder is based on a combination of convolutional, recurrent, and
feed-forward networks (CRDNN) that predict phonemes. A greedy search is used on
top of the output probabilities.
Given the tiny dataset, the expe... |
15,101 | checksum file | #
# files.py
#
import hashlib
import os
from collections import OrderedDict
from pathlib import Path
from threading import Lock
from typing import Any, Dict, List, Optional, Set, TextIO, Union
import black
import yaml
from yaml.dumper import Dumper
from etl.paths import BASE_DIR
class RuntimeCache:
"""Runtime... |
15,102 | convert tf dtype to value type | # Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
15,103 | test open labware latch | """Tests for the engine based Protocol API module core implementations."""
import pytest
from decoy import Decoy
from opentrons.drivers.types import HeaterShakerLabwareLatchStatus
from opentrons.hardware_control import SynchronousAdapter
from opentrons.hardware_control.modules import HeaterShaker
from opentrons.hardwa... |
15,104 | iteration | # Copyright 2019 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
15,105 | val | # Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
15,106 | output shape | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Generic, Optional
from public import public
from typing_extensions import Any, Self, TypeVar
import ibis.expr.datashape as ds
import ibis.expr.datatypes as dt
import ibis.expr.rules as rlz
from ibis import util
from ibis.common... |
15,107 | hook | """
Provides a class for torch model evaluation.
"""
from __future__ import absolute_import
import warnings
from functools import partial
import torch
from .utils import common
from pdb import set_trace as st
class PyTorchModel:
""" Class for torch model evaluation.
Provide predict, intermediate_layer_out... |
15,108 | test source load | import json
import os
from unittest import mock
import pandas as pd
import pytest
from mlflow.data.dataset_source_registry import get_dataset_source_from_json, resolve_dataset_source
from mlflow.data.http_dataset_source import HTTPDatasetSource
from mlflow.exceptions import MlflowException
from mlflow.utils.rest_util... |
15,109 | n excitations | import pytest
import itertools
import random
import numpy as np
import qutip
def _n_enr_states(dimensions, METHOD_NAME):
"""
Calculate the total number of distinct ENR states for a given set of
subspaces. This method is not intended to be fast or efficient, it's
intended to be obviously correct for t... |
15,110 | join | """
Async Module
============
Helper utils for Orange GUI programming.
Provides :func:`asynchronous` decorator for making methods calls in async mode.
Once method is decorated it will have :func:`task.on_start`, :func:`task.on_result` and :func:`task.callback` decorators for callbacks wrapping.
- `on_start` must ta... |
15,111 | main | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A clone of top / htop.
Author: Giampaolo Rodola' <g.rodola@gmail.com>
$ python3 scripts/top.py
CPU0 [|||| ... |
15,112 | pytest generate tests | """Test fixtures."""
import copy
import lxml
import yaml
import pytest
from napalm.base.test import conftest as parent_conftest
from napalm.base.test.double import BaseTestDouble
from napalm.junos import junos
from ncclient.devices.junos import JunosDeviceHandler
@pytest.fixture(scope="class")
def set_device_para... |
15,113 | validate receiver nos | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe import _, msgprint, throw
from frappe.model.document import Document
from frappe.utils import nowdate
class SMSSettings(Document):
# begin: auto-generated types
# This code is auto-generated. ... |
15,114 | add ops impl | # @package adaptive_weight
# Module caffe2.fb.python.layers.adaptive_weight
import numpy as np
from caffe2.python import core, schema
from caffe2.python.layers.layers import ModelLayer
from caffe2.python.regularizer import BoundedGradientProjection, LogBarrier
"""
Implementation of adaptive weighting: https://arxiv... |
15,115 | name | # 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__ ... |
15,116 | lxml trace | """Diagnostic functions, mainly for use when doing tech support."""
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
import os
import pstats
import random
import tempfile
import time
import tra... |
15,117 | test tenant settings not loaded | from unittest import mock
from django import test
from django.core.exceptions import ImproperlyConfigured
from tethys_services.backends.multi_tenant_mixin import MultiTenantMixin
class FakeOAuth:
def setting(self, name, default=None):
"""Provide fake super().setting() method."""
return "super-se... |
15,118 | close | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import abc
import time
from typing import Any, Callable, Dict, Optional
from msal import TokenCache
from azure.core.credentials import AccessToken
from azure.core.exce... |
15,119 | on tree node selected | from __future__ import annotations
from typing import Any
from textual.app import App, ComposeResult
from textual.widgets import Tree
class MyTree(Tree[None]):
pass
class TreeApp(App[None]):
"""Test tree app."""
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **... |
15,120 | has anything read | from collections import defaultdict
from datetime import timedelta
from typing import DefaultDict
from sqlalchemy.orm import Query
from timApp.document.docparagraph import DocParagraph
from timApp.document.document import Document
from timApp.readmark.readparagraph import ReadParagraph
from timApp.readmark.readparagr... |
15,121 | preprocess for eval | # Copyright (c) 2023 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... |
15,122 | generate job | """
Generate a Github Actions workflow file that runs sgr cloud sync on select repositories, respecting
inter-job dependencies.
"""
from typing import Any, Dict, List, Tuple
from splitgraph.cloud.project.utils import get_source_name
def METHOD_NAME(
repository: str, is_live: bool, is_dbt: bool, deploy_url: str ... |
15,123 | distortion bad | """
test_images2.py tests libqtile.images.Img for rendering quality
by comparing known good and bad images to images rendered using
Img().
Image similarity / distance is calculated using imagemagick's convert
utility.
"""
import subprocess as sp
from collections import namedtuple
from glob import glob
from os import p... |
15,124 | valid | # 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) Python... |
15,125 | antipode on basis | r"""
Graded Hopf algebras with basis
"""
#*****************************************************************************
# Copyright (C) 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr>
# 2008-2011 Nicolas M. Thiery <nthiery at users.sf.net>
#
# Distributed under the terms of the GNU ... |
15,126 | test login valid domain | # Standard Library
import uuid
from http import HTTPStatus
from typing import Dict
from unittest import mock
# Third-party
import flask
import flask.testing
import pytest
from google.auth.exceptions import GoogleAuthError
# Sematic
from sematic.api.app import sematic_api
from sematic.api.endpoints.auth import authent... |
15,127 | load | import json
import os
import re
import numpy as np
import torch
from flagai.auto_model.auto_loader import AutoLoader
import numpy as np
from flagai.model.predictor.aquila import aquila_generate
from tqdm import tqdm
from flagai.auto_model.auto_loader import AutoLoader
def find_answer(s):
assert('boxed' in s)
a... |
15,128 | test unop | import unittest
import numpy as np
from spatialmath.baseposelist import BasePoseList
# create a subclass to test with, its value is a scalar
class X(BasePoseList):
def __init__(self, value=0, check=False):
super().__init__()
self.data = [value]
@staticmethod
def _identity():
... |
15,129 | test installed with env | import pytest
import salt.states.rvm as rvm
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {
rvm: {
"__opts__": {"test": False},
"__salt__": {
"cmd.has_exec": MagicMock(return_value=True),
"con... |
15,130 | test correct dates | # 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/.
# -*- coding: utf-8 -*-
"""
Test the synthetic data.
"""
import pytest
import time
@pytest.fixture(scope="module", au... |
15,131 | model to dict | # Stubs for django.forms.models (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
from django.forms.fields import ChoiceField, Field
from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass
from django.forms.formsets import BaseFormSet
from dja... |
15,132 | 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
# --------------------------------... |
15,133 | test init | # coding=utf-8
# This file is part of Medusa.
#
# Medusa 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.
#
# Medusa is distributed in t... |
15,134 | do run | # 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 ... |
15,135 | view concepts | '''
See COPYRIGHT.md for copyright information.
'''
from arelle import ViewWinTree, XbrlConst
from arelle.ModelDtsObject import ModelRelationship
from arelle.ModelInstanceObject import ModelFact
from collections import defaultdict
def METHOD_NAME(modelXbrl, tabWin, header, lang=None, altTabWin=None):
modelXbrl.mod... |
15,136 | find gunzip wrapper | # Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
import sys
from dataclasses import dataclass
from textwrap import dedent # noqa: PNT20
from pants.core.subsystems.python_bootstrap import Py... |
15,137 | get | #!/usr/bin/env python3
import glob
import json
import os
import requests
from argparse import ArgumentParser
from difflib import unified_diff
import re
import sys
_TIMEOUT = 10.0
parser = ArgumentParser()
parser.add_argument("url")
parser.add_argument("directory")
parser.add_argument("--update-compilers", action="s... |
15,138 | parse html advisory | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... |
15,139 | print subgraph | #!/usr/bin/env python
# Copyright (c) 2021 Samsung Electronics Co., Ltd. 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... |
15,140 | create lead | import logging
import typing
from django.conf import settings
from integrations.lead_tracking.lead_tracking import LeadTracker
from users.models import FFAdminUser
from .client import PipedriveAPIClient
from .constants import MarketingStatus
from .exceptions import EntityNotFoundError, MultipleMatchingOrganizationsE... |
15,141 | validate | """Frequency-dependent delays to model profile evolution."""
from warnings import warn
import astropy.units as u
import numpy as np
from pint.models.parameter import prefixParameter
from pint.models.timing_model import DelayComponent, MissingParameter
class FD(DelayComponent):
"""A timing model for frequency ev... |
15,142 | adjust utc datetime to phone datetime | from django.utils.encoding import smart_str
import pytz
from corehq.const import USER_DATETIME_FORMAT, SERVER_DATETIME_FORMAT
from corehq.util.soft_assert import soft_assert
from dimagi.utils.dates import safe_strftime
class _HQTime(object):
_datetime = None
def done(self):
return self._datetime
c... |
15,143 | images | # -*- coding: utf-8 -*-
# Copyright 2015-2023 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extractors for https://www.mangahere.cc/"""
from .common import Chap... |
15,144 | test anomaly detector analysis create detector | from unittest.mock import MagicMock
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from pyod.models.lof import LOF
from autogluon.eda import AnalysisState
from autogluon.eda.analysis import AnomalyDetector, AnomalyDetectorAnalysis
def test_AnomalyDetector():
d... |
15,145 | on attacker connection | #
# This file is part of the PyRDP project.
# Copyright (C) 2019-2021 GoSecure Inc.
# Licensed under the GPLv3 or later.
#
from logging import LoggerAdapter
from pyrdp.layer import TwistedTCPLayer
from pyrdp.logging.StatCounter import StatCounter
from pyrdp.mitm.state import RDPMITMState
from pyrdp.pdu.player import P... |
15,146 | compile dir | """Module/script to byte-compile all .py files to .pyc (or .pyo) files.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.
Without arguments, if compiles all modules on sys.path, without
recursing into subdir... |
15,147 | get input proto | # Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b... |
15,148 | list changed | from toga_gtk.libs import Gtk
from .base import ParentPosition
class RefreshButtonWidget(Gtk.Revealer):
def __init__(self, position: Gtk.Align, margin: int, *args, **kwargs):
super().__init__(*args, **kwargs)
self.parent = None
self.refresh_btn = Gtk.Button.new_from_icon_name(
... |
15,149 | test log backpressure debug | # Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 a... |
15,150 | sync users with cloud | import logging
import typing
from urllib.parse import urljoin
import requests
from django.db import models, transaction
from apps.base.utils import live_settings
from apps.oss_installation.models.cloud_user_identity import CloudUserIdentity
from apps.user_management.models import User
from common.api_helpers.utils im... |
15,151 | test basics | #
# 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 us... |
15,152 | get some colors | import numpy as np
import random
from ..core import ChannelSparsity
try:
import distinctipy
HAVE_DISTINCTIPY = True
except ImportError:
HAVE_DISTINCTIPY = False
try:
import matplotlib.pyplot as plt
HAVE_MPL = True
except ImportError:
HAVE_MPL = False
def METHOD_NAME(keys, color_engine="au... |
15,153 | help msg | # Author: Hubert Kario, (c) 2015
# Released under Gnu GPL v2.0, see LICENSE file for details
"""Test if server supports any of the SSLv2 ciphers"""
from __future__ import print_function
from random import sample
import traceback
import sys
import re
import getopt
from tlsfuzzer.runner import Runner
from tlsfuzzer.me... |
15,154 | test name return full names hierarchical | import copy
import logging
import os
import pathlib
import pytest
import salt.grains.core
import salt.modules.win_file as win_file
import salt.modules.win_lgpo as win_lgpo
import salt.utils.files
import salt.utils.win_dacl as win_dacl
log = logging.getLogger(__name__)
pytestmark = [
pytest.mark.windows_whitelis... |
15,155 | prepare request | # 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... |
15,156 | mixedargs sum | """Unit tests for the keyword only argument specified in PEP 3102."""
__author__ = "Jiwon Seo"
__email__ = "seojiwon at gmail dot com"
import unittest
def posonly_sum(pos_arg1, *arg, **kwarg):
return pos_arg1 + sum(arg) + sum(kwarg.values())
def keywordonly_sum(*, k1=0, k2):
return k1 + k2
def keywordonly_no... |
15,157 | source 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... |
15,158 | get agent runs | from fastapi import APIRouter, Depends, HTTPException
from superagi.helper.auth import check_auth, get_user_organisation
from superagi.apm.analytics_helper import AnalyticsHelper
from superagi.apm.event_handler import EventHandler
from superagi.apm.tools_handler import ToolsHandler
from superagi.apm.knowledge_handler i... |
15,159 | nominations complete | import datetime
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.urls import reverse
from django.utils.text import slugify
from fastly.utils import purge_url
from markupfield.fields import MarkupField
from users.models import User
class El... |
15,160 | test url | # pylint:disable=redefined-outer-name
import pytest
from httpx import (
ConnectError,
HTTPError,
PoolTimeout,
Request,
RequestError,
Response,
codes,
)
from pydantic import AnyHttpUrl, parse_obj_as
from pytest import LogCaptureFixture
from respx import MockRouter
from simcore_service_direct... |
15,161 | check account role | """
Tooling & docs for implementing our auth policy
"""
from __future__ import annotations
# Use | instead of Union, list instead of List and tuple instead of Tuple when FM stops supporting Python 3.9 (because of https://github.com/python/cpython/issues/86399)
from typing import List, Tuple, Union
from flask import ... |
15,162 | test is half shape | # coding: UTF-8
# A part of NonVisual Desktop Access (NVDA)
# by Takuya Nishimoto (NVDA Japanese Team)
# jpDicTest.py for testing source/nvdajp_dic.py
# Usage:
# > miscDeps\tools\msgfmt.exe source\locale\ja\LC_MESSAGES\nvda.po -o source\locale\ja\LC_MESSAGES\nvda.mo
# > cd jptools
# > python jpDicTest.py
import unitte... |
15,163 | test html both | #!/usr/bin/env python
# Copyright 2013-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# o... |
15,164 | get by id | import logging
from typing import Optional, Tuple, Dict, Type
from opentrons.hardware_control import HardwareControlAPI, ThreadedAsyncLock
from robot_server.service.errors import RobotServerError, CommonErrorDef
from robot_server.service.session.errors import (
SessionCreationException,
SessionException,
)
fr... |
15,165 | test dashboard owner relations | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import ANY
from databuilder.models.dashboard.dashboard_owner import DashboardOwner
from databuilder.models.graph_serializable import (
RELATION_END_KEY, RELATION_END_LABEL, RELATION_REVERSE_T... |
15,166 | get errors dict | from django import forms
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth.forms import AuthenticationForm as BaseAuthenticationForm
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.utils.translation import pgettext, pge... |
15,167 | get client | import contextlib
import logging
import logging.config
import os
import sqlite3
import paho.mqtt.client as paho
import yaml
from flask import Flask, g, jsonify, request
app = Flask(__name__)
application = app
DATABASE = os.environ.get("DB_NAME")
@contextlib.contextmanager
def METHOD_NAME():
mqtt_client = paho.... |
15,168 | check ruvs | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2022 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
#
import ldap
import logging
import os
import pytest
import random
import time
import threading
from lib389._constants imp... |
15,169 | integer p1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Jared Boone
#
# This file is part of HackRF.
#
# This is a free hardware design; 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, or (at your opt... |
15,170 | name | # 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... |
15,171 | unload | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Server Module
Patrick Jose Pereira
April 2018
'''
import time
import json
import socket
from threading import Thread
from flask import Flask
from werkzeug.serving import make_server
from MAVProxy.modules.lib import mp_module
def mavlink_to_json(msg):
'''Translate... |
15,172 | elide typed | """prompt-toolkit utilities
Everything in this module is a private API,
not to be used outside IPython.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import unicodedata
from wcwidth import wcwidth
from IPython.core.completer import (
provisionalcomplete... |
15,173 | adjust subplots | from statsmodels.compat.python import lrange
import numpy as np
import statsmodels.tsa.vector_ar.util as util
class MPLConfigurator:
def __init__(self):
self._inverse_actions = []
def revert(self):
for action in self._inverse_actions:
action()
def set_fontsize(self, size):... |
15,174 | test cv term add resource | #
# @file TestCVTerms_newSetters.py
# @brief CVTerms unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting the file loc... |
15,175 | add records | # Copyright 2021-present, the Recognai S.L. 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 la... |
15,176 | get token | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import time
from unittest import mock
from azure.core.credentials import AccessToken
import pytest
from azure.identity._constants import DEFAULT_REFRESH_OFFSET
from az... |
15,177 | set tag | # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
15,178 | hash | import collections
from contextlib import contextmanager
from functools import wraps
import logging
import time
import typing as t
import os
"""
Defines some wrappers which when invoked with the "correct" environment variable
will instrument functions and drop their metrics to cloudwatch.
Without the environment vari... |
15,179 | ticket reset | ################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
#############################################################################... |
15,180 | process data | import os.path
import sys
from Marie.EntityLinking.translator.translate_smile import Translator
from Marie.EntityLinking.blink.common.params import BlinkParser
from Marie.EntityLinking.blink.biencoder.eval_biencoder import NEL
from Marie.EntityLinking.elq.wrapper import NEL_ELQ
import yaml
from Marie.EntityLinking.uti... |
15,181 | token choice | # Copyright (c) 2021 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 app... |
15,182 | tera local | # -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ upstream/tera/hubconf.py ]
# Synopsis [ the tera torch hubconf ]
# Author [ S3PRL ]
# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]
"""****************... |
15,183 | handler | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
15,184 | set exit on release | #!/usr/bin/python3
from optparse import OptionParser
import sys
import dbus
import dbus.service
import dbus.mainloop.glib
from gi.repository import GLib
import bluezutils
BUS_NAME = 'org.bluez'
AGENT_INTERFACE = 'org.bluez.Agent1'
AGENT_PATH = "/test/agent"
bus = None
device_obj = None
dev_path = None
def ask(prom... |
15,185 | test move item to subfolder | # -*- coding: utf-8 -*-
import collections
import pytest
from girder.models.collection import Collection
from girder.models.file import File
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.user import User
from pytest_girder.assertions import assertStatus, assertStatusOk
... |
15,186 | check image square | from io import BytesIO
from dataclasses import field, dataclass
from PIL import Image
from nonebot.log import logger
import nonebot_plugin_saa as saa
from nonebot_plugin_saa.utils import MessageSegmentFactory
from ..utils import parse_text, http_client
from .abstract_post import BasePost, AbstractPost
@dataclass
cl... |
15,187 | build create schema command | from typing import IO, Any, List, Union
import numpy as np
import pyodbc
import simplejson
from pandas import DataFrame, Series
from mage_ai.io.base import QUERY_ROW_LIMIT
from mage_ai.io.config import BaseConfigLoader, ConfigKey
from mage_ai.io.export_utils import PandasTypes
from mage_ai.io.sql import BaseSQL
from ... |
15,188 | test baseline | import unittest
from Orange.data import Table
import numpy as np
from orangecontrib.spectroscopy.preprocess import Integrate
class TestIntegrate(unittest.TestCase):
def test_simple(self):
data = Table.from_numpy(None, [[1, 2, 3, 1, 1, 1],
[1, 2, 3, 1, np.nan, 1],
... |
15,189 | municipality type | import pytest
from django.utils.timezone import now
from munigeo.models import (
AdministrativeDivision,
AdministrativeDivisionType,
Municipality,
)
from rest_framework.reverse import reverse
from rest_framework.test import APIClient
from services.management.commands.services_import.services import update_... |
15,190 | is on | """
Setup for different kinds of Tuya fan devices
"""
import logging
from homeassistant.components.fan import FanEntity, FanEntityFeature
from .device import TuyaLocalDevice
from .helpers.config import async_tuya_setup_platform
from .helpers.device_config import TuyaEntityConfig
from .helpers.mixin import TuyaLocalEn... |
15,191 | release | # MIT License.
import random
import time
class MockCH341Driver:
"""
This is basic interface code for a mock CH341.
"""
def __init__(self, channel=None, state=None, bulk=True):
self.driver_index = None
self.driver_value = None
self.channel = channel
self.state = state
... |
15,192 | set up | # SPDX-License-Identifier: MPL-2.0
# Copyright (C) 2021 Gemeente Amsterdam
import copy
from django.test import TransactionTestCase
from signals.apps.signals.utils.location import AddressFormatter
class TestAddressFormatter(TransactionTestCase):
def METHOD_NAME(self):
self.address = {
'openba... |
15,193 | get mock dataset | import os
from pathlib import Path
from torchaudio.datasets import gtzan
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase
def METHOD_NAME(root_dir):
"""
root_dir: directory to the mocked dataset
"""
mocked_samples = []
mocked_t... |
15,194 | batched fun | # Copyright 2021 The JAX 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
15,195 | copr client mock | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import shutil
from pathlib import Path
from typing import Tuple
import subprocess
import pytest
from flexmock import flexmock
from packit.utils.commands import cwd
from packit.utils.repo import create_new_repo
from tests.spellbook import ... |
15,196 | getcol | import os
import re
import tempfile
import cairo
from gi.repository import Gtk, Gdk, Rsvg
from pychess.widgets.Background import hexcol
class OverlayWindow(Gtk.Window):
"""This class knows about being an overlaywindow and some svg stuff"""
cache = {} # Class global self.cache for svgPath:rsvg and (svgPath... |
15,197 | flatten | from typing import Any
from typing import Iterator
from typing import List
from django import forms
from django.http import HttpRequest
from django.http import HttpResponse
from django.shortcuts import render
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from ocflib.... |
15,198 | get queryset | """Tokens API Viewset"""
from typing import Any
from django_filters.rest_framework import DjangoFilterBackend
from drf_spectacular.utils import OpenApiResponse, extend_schema, inline_serializer
from guardian.shortcuts import assign_perm, get_anonymous_user
from rest_framework.decorators import action
from rest_framewo... |
15,199 | test min length validation | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.