Datasets:
text stringlengths 213 32.3k |
|---|
import re
import os
import sys
import time
import types
import getopt
import unittest
import traceback
try:
# Python >=2.7 and >=3.2
from unittest.runner import _TextTestResult
except ImportError:
from unittest import _TextTestResult
__metaclass__ = type
def stderr(text):
sys.stderr.write(text)
... |
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorEntity,
)
from homeassistant.core import callback
from homeassistant.util import slugify
from . import DOMAIN as MYCHEVY_DOMAIN, UPDATE_TOPIC, EVBinarySensorConfig
SENSORS = [EVBinarySensorConfig("Plugged In", "p... |
import pathlib
import re
from typing import Dict
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
from homeassistant.util.yaml import load_yaml
from .model import Integration
de... |
import asyncio
import datetime as dt
import os
from typing import List
from httpx import RequestError
import onvif
from onvif import ONVIFCamera
from onvif.exceptions import ONVIFError
from zeep.exceptions import Fault
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_HO... |
import sys
import mne
def clean_ecg_eog(in_fif_fname, out_fif_fname=None, eog=True, ecg=True,
ecg_proj_fname=None, eog_proj_fname=None,
ecg_event_fname=None, eog_event_fname=None, in_path='.',
quiet=False):
"""Clean ECG from raw fif file.
Parameters
... |
from datetime import timedelta
import logging
import aiodns
from aiodns.error import DNSError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import En... |
import StringIO
import sys
import time
from nose import tools
from docker_registry.core import exceptions
import docker_registry.testing as testing
from docker_registry.testing import mock_boto # noqa
from . import mock_s3 # noqa
class StringIOWithError(StringIO.StringIO):
'''Throw IOError after reaching ... |
import unittest
from absl import flags
import mock
from perfkitbenchmarker import benchmark_sets
from perfkitbenchmarker import configs
from perfkitbenchmarker import linux_benchmarks
# This import to ensure required FLAGS are defined.
from perfkitbenchmarker import pkb # NOQA
import six
import yaml
FLAGS = flags.... |
from absl import flags
from perfkitbenchmarker.linux_packages import nvidia_driver
FLAGS = flags.FLAGS
flags.DEFINE_string('torch_version', '1.7.1', 'The torch version.')
flags.DEFINE_string('torchvision_version', '0.8.2', 'The torchvision version.')
flags.DEFINE_string('torchaudio_version', '0.7.2', 'The torchaudio... |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
# EC2 provides unique random hostnames.
def test_hostname(host):
pass
def test_etc_molecule_directory(host):
f = host.file('/etc/mole... |
import re
import os.path
import functools
from PyQt5.QtCore import pyqtSlot, Qt, QUrl, QObject
from PyQt5.QtWebEngineWidgets import QWebEngineDownloadItem
from qutebrowser.browser import downloads, pdfjs
from qutebrowser.utils import debug, usertypes, message, log, objreg
class DownloadItem(downloads.AbstractDownl... |
from unittest import TestCase
import numpy as np
import pandas as pd
from scattertext import whitespace_nlp
from scattertext.TermDocMatrixFromPandas import TermDocMatrixWithoutCategoriesFromPandas, TermDocMatrixFromPandas
from scattertext.TermDocMatrixWithoutCategories import TermDocMatrixWithoutCategories
from scat... |
from ...utils import verbose
from ..utils import _data_path, _data_path_doc
@verbose
def data_path(path=None, force_update=False, update_path=True,
download=True, verbose=None): # noqa: D103
return _data_path(path=path, force_update=force_update,
update_path=update_path, name... |
import threading
import imp
import os
from stash.system import shthreads
def get_stash():
"""
returns the currently active StaSh-instance.
returns None if it can not be found.
This is useful for modules.
"""
if "_stash" in globals():
return globals()["_stash"]
for thr in threading.enumerate(... |
import numpy as np
import warnings
import chainer
from chainer.backends import cuda
from chainercv.transforms import center_crop
from chainercv.transforms import resize
from chainercv.transforms import scale
from chainercv.transforms import ten_crop
class FeaturePredictor(chainer.Chain):
"""Wrapper that adds ... |
import argparse
import imp
import yaml
from yaml.scanner import ScannerError
TYPE = 'type'
LIST = 'list'
DESCRIPTION = 'description'
REQUIRED = 'required'
DEFAULT = 'default'
ALLOWED = 'allowed'
VALUES_DSC = 'values_description'
ONE_OF = 'one of'
SCHEMA = 'schema'
EXAMPLES = 'examples'
ANYOF = 'anyof'
NO_DSC = '(no ... |
from homeassistant.components.ozw.fan import SPEED_TO_VALUE
from .common import setup_ozw
async def test_fan(hass, fan_data, fan_msg, sent_messages, caplog):
"""Test fan."""
receive_message = await setup_ozw(hass, fixture=fan_data)
# Test loaded
state = hass.states.get("fan.in_wall_smart_fan_contro... |
from __future__ import print_function
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
import argparse
import atexit
import getpass
import sys
import ssl
def GetArgs():
"""
Supports the command-line arguments listed below.
"""
parser = argparse.ArgumentParser(descriptio... |
from homeassistant.const import STATE_OFF, STATE_ON
from .util import async_init_integration
async def test_create_binary_sensors(hass):
"""Test creation of binary sensors."""
await async_init_integration(hass)
state = hass.states.get("binary_sensor.master_suite_blower_active")
assert state.state ... |
import numpy as np
import pandas as pd
class PhraseSelector(object):
def __init__(self,
minimum_pmi=16):
'''
Filter n-grams using PMI.
Parameters
----------
alpha : float
labmda_ : "cressie_read"
See https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.power_divergence.html... |
import os
import os.path as op
from numpy.testing import assert_array_equal
from mne.utils import requires_mayavi, run_tests_if_main, traits_test
@requires_mayavi
@traits_test
def test_mri_model(subjects_dir_tmp):
"""Test MRIHeadWithFiducialsModel Traits Model."""
from mne.gui._fiducials_gui import MRIHead... |
import logging
import voluptuous as vol
from homeassistant.components.mqtt import valid_publish_topic, valid_subscribe_topic
from homeassistant.const import CONF_OPTIMISTIC
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from .const import (
ATTR_DEVICES,
CONF_BA... |
from collections import Counter
from scattertext.features.FeatsFromSpacyDoc import FeatsFromSpacyDoc
class PyatePhrases(FeatsFromSpacyDoc):
def __init__(self, extractor=None, **args):
import pyate
self._extractor = pyate.combo_basic if extractor is None else extractor
FeatsFromSpacyDoc.__... |
from collections import deque
from functools import partial
from io import BytesIO
from time import time
from kombu.asynchronous.hub import READ, WRITE, get_event_loop
from kombu.exceptions import HttpError
from kombu.utils.encoding import bytes_to_str
from .base import BaseClient
try:
import pycurl # noqa
exc... |
from unittest import TestCase
import pandas as pd
from scattertext.CorpusFromParsedDocuments import CorpusFromParsedDocuments
from scattertext.WhitespaceNLP import whitespace_nlp
from scattertext.representations.Word2VecFromParsedCorpus import GensimPhraseAdder
from scattertext.test.test_corpusFromPandas import get_... |
import logging
SUPPORTED_SCALING_FACTORS = [(7, 8), (3, 4), (5, 8), (1, 2), (3, 8), (1, 4), (1, 8)]
_LOGGER = logging.getLogger(__name__)
def scale_jpeg_camera_image(cam_image, width, height):
"""Scale a camera image as close as possible to one of the supported scaling factors."""
turbo_jpeg = TurboJPEGSin... |
from gitless import core
from . import helpers, pprint
def parser(subparsers, _):
"""Adds the tag parser to the given subparsers object."""
desc = 'list, create, or delete tags'
tag_parser = subparsers.add_parser(
'tag', help=desc, description=desc.capitalize(), aliases=['tg'])
list_group = tag_parse... |
import warnings
from typing import Awaitable, TYPE_CHECKING, Dict
import discord
from .commands import (
bot_has_permissions,
bot_in_a_guild,
has_permissions,
is_owner,
guildowner,
guildowner_or_permissions,
admin,
admin_or_permissions,
mod,
mod_or_permissions,
)
from .utils.m... |
from contextlib import contextmanager
from datetime import datetime
import mock
from freezegun import freeze_time
from paasta_tools.autoscaling import load_boost
TEST_CURRENT_TIME = datetime(2020, 2, 14)
@contextmanager
def patch_zk_client(mock_values=None):
with mock.patch(
"paasta_tools.utils.KazooC... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from absl.testing import absltest
# This stanza exercises setting $TEST_RANDOMIZE_ORDERING_SEED *after* importing
# the absltest library.
if os.environ.get('LATE_SET_TEST_RANDOMIZE_ORDE... |
from flexx import app, ui
class Red(ui.Widget):
CSS = '.flx-Red { background: #ff0000;}'
class Deep1(ui.Widget):
# This was broken on Chrome earlier
def init(self):
with ui.VBox():
ui.Label(text='Widget in a vbox in a widget in a vbox')
with ui.VBox(flex=1):
... |
from ...common.interfaces import AbstractPlugin
class Plugin(AbstractPlugin):
SECTION = 'rcassert'
def __init__(self, core, cfg, name):
AbstractPlugin.__init__(self, core, cfg, name)
self.ok_codes = []
self.fail_code = 10
@staticmethod
def get_key():
return __file__
... |
import pandas as pd
import pytz
from qstrader.system.rebalance.rebalance import Rebalance
class EndOfMonthRebalance(Rebalance):
"""
Generates a list of rebalance timestamps for pre- or post-market,
for the final calendar day of the month between the starting and
ending dates provided.
All times... |
import posixpath
from absl import flags
from perfkitbenchmarker.linux_packages import cuda_toolkit
from perfkitbenchmarker.linux_packages import nvidia_driver
FLAGS = flags.FLAGS
flags.DEFINE_string('tf_cpu_pip_package',
'https://anaconda.org/intel/tensorflow/1.12.0/download/'
... |
from flexx import flx
class Split(flx.Widget):
def init(self):
with flx.HSplit():
flx.Widget(style='background:#f00')
with flx.VSplit():
flx.Widget(style='background:#0f0')
with flx.HSplit():
flx.Widget(style='background:#ff0')... |
from datetime import timedelta
import logging
import voluptuous as vol
from xboxapi import Client
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_API_KEY, CONF_SCAN_INTERVAL
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
f... |
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.const import HTTP_NOT_FOUND
from homeassistant.helpers import intent
async def test_add_item(hass, sl_setup):
"""Test adding an item intent."""
response = await intent.async_handle(
hass, "test", "HassShoppingLis... |
import quantities as pq
from pylatex.quantities import _dimensionality_to_siunitx, Quantity
def test_quantity():
v = 1 * pq.m/pq.s
q1 = Quantity(v)
assert q1.dumps() == r'\SI{1.0}{\meter\per\second}'
q2 = Quantity(v, format_cb=lambda x: str(int(x)))
assert q2.dumps() == r'\SI{1}{\meter\per\sec... |
import diamond.collector
import os
class NfsdCollector(diamond.collector.Collector):
PROC = '/proc/net/rpc/nfsd'
def get_default_config_help(self):
config_help = super(NfsdCollector, self).get_default_config_help()
config_help.update({
})
return config_help
def get_defa... |
YAML Metadata Warning:The task_categories "code-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
YAML Metadata Warning:The task_categories "conditional-text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
YAML Metadata Warning:The task_ids "code-generation" is not in the official list: acceptability-classification, entity-linking-classification, fact-checking, intent-classification, language-identification, multi-class-classification, multi-label-classification, multi-input-text-classification, natural-language-inference, semantic-similarity-classification, sentiment-classification, topic-classification, semantic-similarity-scoring, sentiment-scoring, sentiment-analysis, hate-speech-detection, text-scoring, named-entity-recognition, part-of-speech, parsing, lemmatization, word-sense-disambiguation, coreference-resolution, extractive-qa, open-domain-qa, closed-domain-qa, news-articles-summarization, news-articles-headline-generation, dialogue-modeling, dialogue-generation, conversational, language-modeling, text-simplification, explanation-generation, abstractive-qa, open-domain-abstractive-qa, closed-domain-qa, open-book-qa, closed-book-qa, text2text-generation, slot-filling, masked-language-modeling, keyword-spotting, speaker-identification, audio-intent-classification, audio-emotion-recognition, audio-language-identification, multi-label-image-classification, multi-class-image-classification, face-detection, vehicle-detection, instance-segmentation, semantic-segmentation, panoptic-segmentation, image-captioning, image-inpainting, image-colorization, super-resolution, grasping, task-planning, tabular-multi-class-classification, tabular-multi-label-classification, tabular-single-column-regression, rdf-to-text, multiple-choice-qa, multiple-choice-coreference-resolution, document-retrieval, utterance-retrieval, entity-linking-retrieval, fact-checking-retrieval, univariate-time-series-forecasting, multivariate-time-series-forecasting, visual-question-answering, document-question-answering, pose-estimation
Dataset Card for notional-python
Dataset Summary
The Notional-python dataset contains python code files from 100 well-known repositories gathered from Google Bigquery Github Dataset. The dataset was created to test the ability of programming language models. Follow our repo to do the model evaluation using notional-python dataset.
Languages
Python
Dataset Creation
Curation Rationale
Notional-python was built to provide a dataset for testing the ability of the machine to generate python code.
Source Data
Initial Data Collection and Normalization
The data was obtained by filtering code from Google Bigquery Github data In order to improve the quality of the dataset, only python code files that meet the below conditions are added to the dataset:
- Code with more than 60% of executable lines
- Code with logic, not config files or comment-only files
- Code with more than 30% of attribute declaration lines (E.G.: Some files contain just only class names and their class attributes, usually used for configuration of the project, these files were not selected)
- Code without
TODOandFIXME.
Who are the source language producers?
The producers are users of github.
- Downloads last month
- 73