code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#!/usr/bin/env python
# Copyright (c) 2015-2016, Juniper Networks, Inc.
# All rights reserved.
#
# Copyright (C) 2012 Martin Blech and individual contributors.
#
# See the LICENSE file for further information.
"""Module that provides the XMLNodeBase class.
This is the base class from which all the other XML node cl... | unknown | codeparrot/codeparrot-clean | ||
####################################################################################################
# Copyright 2013 John Crawford
#
# This file is part of PatchCorral.
#
# PatchCorral is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | unknown | codeparrot/codeparrot-clean | ||
import logging
import tempfile
import os
logger = logging.getLogger(__name__)
class FilesystemStorage:
"""
Just a Django-less storage w/ partial Django Storage API implemented
"""
def __init__(self, workdir):
self.workdir = workdir
def open(self, name, mode='rb', *args, **kwargs):
... | unknown | codeparrot/codeparrot-clean | ||
#if defined __AVX512__ || defined __AVX512F__
#include <immintrin.h>
void test()
{
__m512i a, b, c;
a = _mm512_dpwssd_epi32(a, b, c); // VNNI
}
#else
#error "AVX512-CLX is not supported"
#endif
int main() { return 0; } | cpp | github | https://github.com/opencv/opencv | cmake/checks/cpu_avx512clx.cpp |
#!/bin/sh
test_description='
The general idea is that we have a single file whose lines come from
multiple other files, and those individual files were modified in the same
commits. That means that we will see the same commit in multiple contexts,
and each one should be attributed to the correct file.
Note that we ne... | unknown | github | https://github.com/git/git | t/t8011-blame-split-file.sh |
#
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ans... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Brian Coca <bcoca@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime, date
import re
import sqlalchemy as sa
from ..exceptions import FieldNotImplemented, FilterNotImplemented, NoFieldData, ClientFault
sg_field_types = {}
def sg_field_type(cls):
type_name = re.sub(r'(.)([A-Z][a-z])', r'\1_\2', cls.__name__).lower()
cls.type_name = type_name
... | unknown | codeparrot/codeparrot-clean | ||
"""Basic checks for HomeKitSwitch."""
from aiohomekit.model.characteristics import (
CharacteristicsTypes,
InUseValues,
IsConfiguredValues,
)
from aiohomekit.model.services import ServicesTypes
from tests.components.homekit_controller.common import setup_test_component
def create_switch_service(accessory... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/images/doc.go |
"""Tests for Jurisdiction class and other functionality related
to jurisdictions."""
import cc.license
from cc.license import CCLicenseError
import nose.tools
# TODO: additional tests exercising the output
def test_jurisdictions():
jurisdictions = cc.license.jurisdictions.list()
for j in jurisdictions:
... | unknown | codeparrot/codeparrot-clean | ||
"""
test_zigbee.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
Tests the XBee ZB (ZigBee) implementation class for API compliance
"""
import unittest
from xbee.zigbee import ZigBee
class TestZigBee(unittest.TestCase):
"""
Tests ZigBee-specific features
"""
def setUp(self):
self.zigbee = ZigBe... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Description**
Returns the [hyperbolic sine](https://en.wikipedia.org/wiki/Hyperbolic_functions) of a number. | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/description/sinh.md |
import chains.service, copy, re, td, Queue, time
from chains.services.tellstick2 import tellconf
from chains.common import log, utils
import time, subprocess
# using: https://bitbucket.org/davka003/pytelldus/src
class Tellstick2Service(chains.service.Service):
def onInit(self):
self.minLampValue ... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir::def_id::DefId;
use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::relate::combine::{combine_ty_args, super_combine_consts, super_combine_tys};
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation, relate_args_invariantly};
use rustc_middle::ty::{self, DelayedSet, Ty, TyCtxt, TyVar}... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_infer/src/infer/relate/type_relating.rs |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | unknown | codeparrot/codeparrot-clean | ||
redirects = {
# Redirects for deprecated TorchScript documentation
"jit": "torch.compiler_api.html",
"jit_language_reference": "torch.compiler_api.html",
"jit_language_reference_v2": "torch.compiler_api.html",
"jit_python_reference": "torch.compiler_api.html",
"jit_unsupported": "torch.compiler_... | python | github | https://github.com/pytorch/pytorch | docs/source/redirects.py |
"""
SoftLayer.tests.managers.dns_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import fixtures
from SoftLayer import testing
class DNSTests(testing.TestCase):
def set_up(self):
self.dns_client = SoftLayer.DNSManager(... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or 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 b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java |
# stdlib imports
import os
import pickle
from operator import itemgetter
import types
import shutil
from cStringIO import StringIO
# numpy imports
import numpy as np
# scikit-learn imports
import sklearn
from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import roc_auc_score
from sklearn.ensemb... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# :markup: markdown
module ActionDispatch
# # Action Dispatch HostAuthorization
#
# This middleware guards from DNS rebinding attacks by explicitly permitting the
# hosts a request can be sent to, and is passed the options set in
# `config.host_authorization`.
#
# Requests ... | ruby | github | https://github.com/rails/rails | actionpack/lib/action_dispatch/middleware/host_authorization.rb |
""" Collect status information for Windows services
"""
# project
from checks import AgentCheck
from checks.wmi_check import WinWMICheck
from utils.containers import hash_mutable
from utils.timeout import TimeoutException
class WindowsService(WinWMICheck):
STATE_TO_VALUE = {
'Stopped': AgentCheck.CRITICAL,... | unknown | codeparrot/codeparrot-clean | ||
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import numpy as np
import scipy as sp
from sklearn.metrics._ranking import det_curve
from sklearn.utils._plotting import (
_BinaryClassifierCurveDisplayMixin,
_deprecate_y_pred_parameter,
)
class DetCurveDisplay(_BinaryClassifierC... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/metrics/_plot/det_curve.py |
{
"version": "0.2",
"words": [
"affordance",
"allowfullscreen",
"Analyser",
"autohide",
"autohiding",
"autoplay",
"autoplays",
"autoplaying",
"blazingly",
"Blockquotes",
"Bootstrappers",
"borderless",
"Brotli",
"browserslist",
"browserslistrc",
"btnche... | json | github | https://github.com/twbs/bootstrap | .cspell.json |
# Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | unknown | codeparrot/codeparrot-clean | ||
import os
from setuptools import setup, find_packages
import librarian_football as pkg
def read(fname):
""" Return content of specified file """
return open(os.path.join(os.path.dirname(__file__), fname)).read()
VERSION = pkg.__version__
setup(
name='librarian-football',
version=VERSION,
license... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Homekit climate devices."""
import logging
from homekit.model.characteristics import CharacteristicsTypes
from homeassistant.components.climate import (
DEFAULT_MAX_HUMIDITY,
DEFAULT_MIN_HUMIDITY,
ClimateDevice,
)
from homeassistant.components.climate.const import (
CURRENT_HVAC_COOL,
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package rpcapi
import (
"bytes"
"context"
"fmt"
"io"
"time"
"github.com/hashicorp/go-slug/sourceaddrs"
"github.com/hashicorp/go-slug/sourcebundle"
"github.com/hashicorp/terraform-svchost/disco"
"go.opentelemetry.io/otel/attribute"
otelCo... | go | github | https://github.com/hashicorp/terraform | internal/rpcapi/stacks.go |
#!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible 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.... | unknown | codeparrot/codeparrot-clean | ||
from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module RuboCop
module Cop
module Jekyll
class NoPAllowed < Base
MSG = "Avoid using `p` to print things. Use `Jekyll.logger` instead."
RESTRICT_ON_SEND = %i[p].freeze
def_node_search :p_called?, <<-PATTERN
(send _ :p _)
PATTERN
... | ruby | github | https://github.com/jekyll/jekyll | rubocop/jekyll/no_p_allowed.rb |
# Copyright 2012 Anton Beloglazov
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
{
"CONFIG": {
"summary": "A container for server configuration commands.",
"complexity": "Depends on subcommand.",
"group": "server",
"since": "2.0.0",
"arity": -2
}
} | json | github | https://github.com/redis/redis | src/commands/config.json |
---
applies_to:
stack:
serverless:
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-field-names-field.html
---
# _field_names field [mapping-field-names-field]
The `_field_names` field used to index the names of every field in a document that contains any value other than ... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/mapping-reference/mapping-field-names-field.md |
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
#include "pycore_mod... | c | github | https://github.com/python/cpython | Modules/clinic/_testclinic_depr.c.h |
import fs from 'node:fs'
import path from 'node:path'
import { describe, expect, test } from 'vitest'
import { __unstable__loadDesignSystem } from '.'
import { cartesian } from './cartesian'
import type { CanonicalizeOptions } from './intellisense'
import { DefaultMap } from './utils/default-map'
const css = String.ra... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/canonicalize-candidates.test.ts |
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | unknown | codeparrot/codeparrot-clean | ||
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/sharded_coll... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/generated_suites/sharded_collections_query_shape_hash_stability_find_fuzzer_last_lts_new_old.yml |
from __future__ import absolute_import, division, unicode_literals
import os
import sys
import traceback
import warnings
import re
warnings.simplefilter("error")
from .support import get_data_files
from .support import TestData, convert, convertExpected, treeTypes
from html5lib import html5parser, constants
# Run t... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class User
attr_reader :name
def initialize(name)
@name = name
end
def to_global_id
GlobalID.new("User##{name}")
end
def to_gid_param
to_global_id.to_param
end
end | ruby | github | https://github.com/rails/rails | actioncable/test/stubs/user.rb |
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
from enigma import *
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.GUIComponent import GUIComponent
from Components.HTMLComponent import HTMLComponent
from Tools.Directories import fileExi... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/apps/v1beta2/conversion.go |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import js_to_json
class HelsinkiIE(InfoExtractor):
IE_DESC = 'helsinki.fi'
_VALID_URL = r'https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)'
_TEST = {
'url': 'http://video.... | unknown | codeparrot/codeparrot-clean | ||
# Class definition:
# RunJobHPC
# This class is the base class for the HPC classes. It inherits from RunJob
# Instances are generated with RunJobFactory via pUtil::getRunJob()
# Implemented as a singleton class
# http://stackoverflow.com/questions/42558/python-and-the-singleton-pattern
# Import relevant pyth... | unknown | codeparrot/codeparrot-clean | ||
"""ANTLR3 runtime package"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""A gui display of recent strokes."""
import wx
import time
from wx.lib.utils import AdjustRectToScreen
from collections import deque
from plover import system
from plover.gui.util import find_fixed_width_font
from plover import log
TITLE = 'Plover: S... | unknown | codeparrot/codeparrot-clean | ||
// @loggerTestOnly @validateNoSetStateInEffects @outputMode:"lint"
import {useEffect, useEffectEvent, useState} from 'react';
function Component() {
const [state, setState] = useState(0);
const effectEvent = useEffectEvent(() => {
setState(true);
});
useEffect(() => {
effectEvent();
}, []);
return ... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/invalid-setState-in-useEffect-via-useEffectEvent.js |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetStockQuote
# Retrieves information for the specified stock symbol from Yahoo Finance.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2013 Camptocamp
# Copyright 2009-2013 Akretion,
# Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau,
# Benoît Guillot, Joel Grand-Guillaume
#
# This program is free software: y... | unknown | codeparrot/codeparrot-clean | ||
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from cms.models.fields import PlaceholderField
from filer.fields.image import FilerImageField
from arkestra_utilities.settings import (
... | unknown | codeparrot/codeparrot-clean | ||
# Natural Language Toolkit: PropBank Corpus Reader
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import re
import codecs
from nltk.tree import Tree
from xml.etree import ElementTree
from util i... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# 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 requ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Mirantis Inc.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
"""
Wrapper for loading templates from the filesystem.
"""
import errno
import io
import warnings
from django.core.exceptions import SuspiciousFileOperation
from django.template import Origin, TemplateDoesNotExist
from django.utils._os import safe_join
from django.utils.deprecation import RemovedInDjango20Warning
fr... | unknown | codeparrot/codeparrot-clean | ||
from collections import namedtuple
import sqlparse
from django.db import DatabaseError
from django.db.backends.base.introspection import BaseDatabaseIntrospection
from django.db.backends.base.introspection import FieldInfo as BaseFieldInfo
from django.db.backends.base.introspection import TableInfo
from django.db.mod... | python | github | https://github.com/django/django | django/db/backends/sqlite3/introspection.py |
#!/usr/bin/env python
#encoding=utf8
#Copyright [2014] [Wei Zhang]
#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 ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import boto3
import argparse
from boto3.dynamodb.conditions import Key
def search_in(f):
with open(f, 'rb') as image:
response = client.search_faces_by_image(Image={'Bytes': image.read()}, CollectionId=args.collection)
return response
def search_known_in(f):
ddb = boto3.... | unknown | codeparrot/codeparrot-clean | ||
{% extends "admin/actions.html" %}
{% load i18n %}
{% block actions-submit %}
<button type="submit" class="button override-actions" name="index" value="{{ action_index|default:0 }}">{% translate "Run" %}</button>
{% endblock %} | html | github | https://github.com/django/django | tests/admin_views/templates/admin/admin_views/article/actions.html |
# Author: Travis Oliphant, 2002
#
# Further enhancements and tests added by numerous SciPy developers.
#
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.random import RandomState
from numpy.testing import (TestCase, run_module_suite, assert_array_equal,
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
tag
:copyright: (c) 2012-2014 by Openlabs Technologies & Consulting (P) Limited
:license: GPLv3, see LICENSE for more details.
"""
from nereid import (
request, login_required, url_for, redirect,
flash, jsonify, route
)
from trytond.model import ModelView, ModelSQL, fiel... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 Rackspace, Inc.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
werkzeug.testapp
~~~~~~~~~~~~~~~~
Provide a small test application that can be used to test a WSGI server
and check it for WSGI compliance.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
impo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division
from pygments.formatter import Forma... | unknown | codeparrot/codeparrot-clean | ||
//===--- RandomTree.swift -------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | swift | github | https://github.com/apple/swift | benchmark/single-source/RandomTree.swift |
"""
Python tests for the Survey models
"""
from collections import OrderedDict
from django.contrib.auth.models import User
from django.test.client import Client
from survey.models import SurveyForm
from survey.utils import is_survey_required_for_course, is_survey_required_and_unanswered
from xmodule.modulestore.test... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | unknown | codeparrot/codeparrot-clean | ||
'''
Description
2017_03_25. THis class was extracted from the
pgguiutilities.py module, so that it is easier
to debug.
'''
from future import standard_library
standard_library.install_aliases()
from builtins import range
__filename__ = "pgkeycategoricalvalueframe.py"
__date__ = "20170325"
__author__ = "Ted Cosart<ted... | unknown | codeparrot/codeparrot-clean | ||
# Copyright © 2016-2020 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# 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 lat... | unknown | codeparrot/codeparrot-clean | ||
{
"additional_data": "נתונים נוספים",
"asset_many": "נכסים",
"asset_one": "נכס",
"asset_other": "נכסים",
"asset_two": "שני נכסים",
"consumingDags": "צורכים Dags",
"consumingTasks": "משימות צורכות",
"createEvent": {
"button": "יצירת אירוע",
"manual": {
"description": "יצירה ידנית של אירוע ב... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/he/assets.json |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from sklearn.ensemble._hist_gradient_boosting.binning import (
_BinMapper,
_find_binning_thresholds,
_map_to_bins,
)
from sklearn.ensemble._hist_gradient_boosting.common import (
ALMOST_INF,
X_BINNED_DTYP... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/tests/test_binning.py |
from __future__ import division
from tqdm import tqdm
from tests_tqdm import with_setup, pretest, posttest, StringIO, closing
from tests_tqdm import DiscreteTimer, cpu_timify
from time import sleep
from threading import Event
from tqdm import TMonitor
class FakeSleep(object):
"""Wait until the discrete timer reac... | unknown | codeparrot/codeparrot-clean | ||
__all__ = []
# The following pattern is used below for importing sub-modules:
#
# 1. "from foo import *". This imports all the names from foo.__all__ into
# this module. But, this does not put those names into the __all__ of
# this module. This enables "from sympy.physics.mechanics import kinematics" to
# wo... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
DOCUMENTATION = """
---
module: mount_facts
version_added: 2.18
short_description: Retrieve mount information.
descri... | python | github | https://github.com/ansible/ansible | lib/ansible/modules/mount_facts.py |
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/allocation/state/state_checkpoint.go |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/ClangTidy.cpp |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package terraform
import (
"context"
"testing"
)
func TestPrefixUIInput_impl(t *testing.T) {
var _ UIInput = new(PrefixUIInput)
}
func TestPrefixUIInput(t *testing.T) {
input := new(MockUIInput)
prefix := &PrefixUIInput{
IdPrefix: "foo",
... | go | github | https://github.com/hashicorp/terraform | internal/terraform/ui_input_prefix_test.go |
# -*- coding: utf-8 -*-
"""
pygments.lexers.foxpro
~~~~~~~~~~~~~~~~~~~~~~
Simple lexer for Microsoft Visual FoxPro source code.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
import re
from p... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
import shutil
import string
import random
import tempfile
import unittest
from importlib.util import cache_from_source
from test.support.os_helper import create_empty_file
class TestImport(unittest.TestCase):
def __init__(self, *args, **kw):
self.package_name = 'PACKAGE_'
whi... | python | github | https://github.com/python/cpython | Lib/test/test_importlib/test_pkg_import.py |
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/ethernet-phy.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ethernet PHY Common Properties
maintainers:
- Andrew Lunn <andrew@lunn.ch>
- Florian Fainelli <f.fainelli@gmail.com>
- Heiner Kallweit <hkallwe... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/net/ethernet-phy.yaml |
"""
Classes to provide the LMS runtime data storage to XBlocks.
:class:`DjangoKeyValueStore`: An XBlock :class:`~KeyValueStore` which
stores a subset of xblocks scopes as Django ORM objects. It wraps
:class:`~FieldDataCache` to provide an XBlock-friendly interface.
:class:`FieldDataCache`: A object which prov... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
import argparse
import random
import subprocess
import sys
def doit(subset_size, seed, input_file, output_file, unselected_file):
if seed:
random.seed(seed)
line_count = int(subprocess.check_output(["wc", input_file.name]).decode().split()[0])
sample_count= round(line_count * float(subset_... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Redis\Connectors;
use Illuminate\Contracts\Redis\Connector;
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
use Illuminate\Redis\Connections\PhpRedisConnection;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Redis as RedisFacade;
use Illuminate\Support\Str;
use Inval... | php | github | https://github.com/laravel/framework | src/Illuminate/Redis/Connectors/PhpRedisConnector.php |
# Copyright (c) 2013 Mirantis Inc.
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.lexer impo... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* stratnum.h
* POSTGRES strategy number definitions.
*
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/access/stratnum... | c | github | https://github.com/postgres/postgres | src/include/access/stratnum.h |
"""Copyright (C) 2015-2016 Association of Universities for Research in Astronomy, Inc. (AURA)
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes filter(F, X) into list(filter(F, X)).
We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.
NOTE: This... | unknown | codeparrot/codeparrot-clean | ||
#-*-coding:utf-8-*-
"""
@package bsemanticexceptions
@brief Contains all exceptions used by the bsemantic package
@author Sebastian Thiel
@copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html)
"""
from __future__ import unicode_literals
__all__ = ['Error', 'InvalidValueError', 'MissingF... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""Create the Afrikaans Locale."""
orm.Locale.objects.create(locale='af')
def backwards(self, orm):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import telemetry.timeline.event_container as event_container
# Doesn't inherit from TimelineEvent because its only a temporary wrapper of a
# counter sample... | unknown | codeparrot/codeparrot-clean | ||
import os
from decimal import Decimal
from django.db import connection
from django.db.models import Q
from django.contrib.gis.geos import GEOSGeometry, Point, LineString
from django.contrib.gis.measure import D # alias for Distance
from django.contrib.gis.tests.utils import oracle, postgis, spatialite, no_oracle, no_s... | unknown | codeparrot/codeparrot-clean | ||
from typing import List
import rich
from pydantic import BaseModel
from openai import OpenAI
class Step(BaseModel):
explanation: str
output: str
class MathResponse(BaseModel):
steps: List[Step]
final_answer: str
client = OpenAI()
id = None
with client.responses.create(
input="solve 8x + 31 = 2... | python | github | https://github.com/openai/openai-python | examples/responses/background.py |
import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalDtype,
CategoricalIndex,
DataFrame,
MultiIndex,
Series,
Timestamp,
get_dummies,
period_range,
)
import pandas._testing as tm
from pandas.core.arrays import SparseArray
class TestGetitem:
def test_geti... | unknown | codeparrot/codeparrot-clean | ||
# 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 applica... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* NET An implementation of the SOCKET network access protocol.
*
* Version: @(#)socket.c 1.1.93 18/02/95
*
* Authors: Orest Zborowski, <obz@Kodak.COM>
* Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
* Fixes:
* Anonymous : NOTSOCK/BADF cleanu... | c | github | https://github.com/torvalds/linux | net/socket.c |
import numpy
from numpy.testing import assert_equal, assert_raises
from fuel.datasets import IterableDataset, IndexableDataset
from fuel.schemes import SequentialExampleScheme, SequentialScheme
from fuel.streams import AbstractDataStream, DataStream
class DummyDataStream(AbstractDataStream):
def reset(self):
... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.