code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from django.apps import apps
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.core.exceptions import FieldDoesNotExist
from django.db.models import CharField, Field, ForeignObjectRel, ManyToManyField
from django.db.models.options import EMPTY_RELATION_TREE, IMMUTABLE_WARNING... | python | github | https://github.com/django/django | tests/model_meta/tests.py |
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:network-policies
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
rules:
- apiGroups: [""]
resources:
- pods
- nodes
- namespaces
verbs:
- get
- watch
- list... | unknown | github | https://github.com/kubernetes/kubernetes | cluster/addons/kube-network-policies/kube-network-policies-rbac.yaml |
# -*- coding: utf-8 -*-
"""
Test suite for PEP 380 implementation
adapted from original tests written by Greg Ewing
see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Python3.1.2-rev5.zip>
"""
import unittest
import io
import sys
import inspect
import parser
from test.support import captur... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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 ... | unknown | codeparrot/codeparrot-clean | ||
export default class Page {
static async getInitialProps() {
return {
prop: true,
}
}
render() {
return <div />
}
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/strip-page-exports/getInitialProps/class/input.js |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "dashboard-properties-test",
"labels": {
"test": "dashboard-properties"
}
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/v2beta1.dashboard-properties.json |
from statsmodels.tsa.stattools import (adfuller, acf, pacf_ols, pacf_yw,
pacf, grangercausalitytests,
coint, acovf)
from statsmodels.tsa.base.datetools import dates_from_range
import numpy as np
from numpy.testing import asser... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 2, s, t 4, s, q"
tags = "schedule, position"
import cocos
from cocos.dir... | unknown | codeparrot/codeparrot-clean | ||
/*
* Generic SSL/TLS messaging layer functions
* (record layer + retransmission state machine)
*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
/*
* http://www.ietf.org/rfc/rfc2246.txt
* http://www.ietf.org/rfc/rfc4346.txt
*/
#include "common.h"
#if d... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/library/ssl_msg.c |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
Author: John D. Anderson
Email: jander43@vols.utk.edu
Problem Statement:
You have an integer you can flip exactly one bit from a 0 to a 1. Write
code to find the length of the longest sequence of 1s you could create.
EXAMPLE
Input: 1775 (or: 11011101111)
Output: 8
Complexity: O(N)
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import print_function
DESCRIPTION = """
Runs all the examples for testing purposes and reports successes and failures
to stderr. An example is marked successful if the running thread does not
throw an exception, for threaded examples, such as plotting, one needs to
check the stde... | unknown | codeparrot/codeparrot-clean | ||
"""
Robust location and covariance estimators.
Here are implemented estimators that are resistant to outliers.
"""
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
import warnings
from numbers import Integral, Real
import numpy as np
from scipy import linalg
from scipy.stats import ch... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/covariance/_robust_covariance.py |
"""Tests for methods defined in util/misc.py"""
from xmodule.util.misc import escape_html_characters
from unittest import TestCase
class UtilHtmlEscapeTests(TestCase):
"""
Tests for methods exposed in util/misc
"""
final_content = " This is a paragraph. "
def test_escape_html_comments(self):
... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/mkl/mkl_batch_matmul_helper.h |
package kotlinx.coroutines.channels
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlin.test.*
@Suppress("DEPRECATION_ERROR")
class ConflatedBroadcastChannelTest : TestBase() {
@Test
fun testConcurrentModification() = runTest {
val channel = ConflatedBroadcastChannel<Int>()
... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/channels/ConflatedBroadcastChannelTest.kt |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 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
# ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/length/ReplaceValueInLength.java |
# coding=utf-8
from unittest import *
import hiredis
import sys
class ReaderTest(TestCase):
def setUp(self):
self.reader = hiredis.Reader()
def reply(self):
return self.reader.gets()
def test_nothing(self):
self.assertEquals(False, self.reply())
def test_error_when_feeding_non_string(self):
... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import cv2
import camkifu.stone
from golib.config.golib_conf import gsize, W, B, E
class SfClustering(camkifu.stone.StonesFinder):
""" Stones finder implementation based on k-means pixel clustering.
Has the ability to be used as a "standalone" finder, but as it is not designed to work in l... | unknown | codeparrot/codeparrot-clean | ||
import ckan.plugins.toolkit as toolkit
import ckan.lib.helpers as helpers
import ckan.plugins as p
from ckan.lib.base import BaseController, response, request
import json
import db
import Levenshtein
from unidecode import unidecode
c = p.toolkit.c
render = p.toolkit.render
class TagmanagerController(BaseController)... | unknown | codeparrot/codeparrot-clean | ||
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | unknown | codeparrot/codeparrot-clean | ||
# $Id: mod_sipp.py 4188 2012-06-29 09:01:17Z nanang $
## Automatic test module for SIPp.
##
## This module will need a test driver for each SIPp scenario:
## - For simple scenario, i.e: make/receive call (including auth), this
## test module can auto-generate a default test driver, i.e: make call
## or apply auto ... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | unknown | codeparrot/codeparrot-clean | ||
"""Test that a global ObjC object found before the process is started updates correctly."""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestObjCGlobalVar(TestBase):
mydir = TestBase.comp... | unknown | codeparrot/codeparrot-clean | ||
import { snapshot } from './clone';
import { assert, test } from 'vitest';
import { proxy } from '../client/proxy';
function capture_warnings() {
const warnings: string[] = [];
// eslint-disable-next-line no-console
const warn = console.warn;
// eslint-disable-next-line no-console
console.warn = (message) => wa... | typescript | github | https://github.com/sveltejs/svelte | packages/svelte/src/internal/shared/clone.test.ts |
"""
WSGI config for newdjangosite project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICAT... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 SolidBuilds.com. All rights reserved
#
# Authors: Ling Thio <ling.thio@gmail.com>
from flask_mail import Mail
from flask_migrate import Migrate, MigrateCommand
from flask_user import UserManager, SQLAlchemyAdapter
from flask_wtf.csrf import CsrfProtect
import os
from app import app, db, manager
@app.... | unknown | codeparrot/codeparrot-clean | ||
# Module for parsing/evaluating Microsoft Excel formulas.
#
# Copyright © 2005-2009 Stephen John Machin, Lingfo Pty Ltd
# This module is part of the xlrd3 package, which is released under
# a BSD-style licence.
# No part of the content of this file was derived from the works of David Giffin.
import copy
from struct i... | unknown | codeparrot/codeparrot-clean | ||
from django.core.cache.backends.locmem import LocMemCache
class LiberalKeyValidationMixin:
def validate_key(self, key):
pass
class CacheClass(LiberalKeyValidationMixin, LocMemCache):
pass | python | github | https://github.com/django/django | tests/cache/liberal_backend.py |
"""Suite Text Suite: A set of basic classes for text processing.
Level 1, version 1
Generated from /Applications/Utilities/Terminal.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = '????'
class Text_Suite_Events:
pass
class attachment(aetools.ComponentItem):
... | unknown | codeparrot/codeparrot-clean | ||
[
{
"DiffItemKind": "CommonDiffItem",
"NodeKind": "Var",
"NodeAnnotation": "Rename",
"ChildIndex": "0",
"LeftUsr": "c:@Ea@NSUpArrowFunctionKey@NSUpArrowFunctionKey",
"RightUsr": "",
"LeftComment": "NSUpArrowFunctionKey",
"RightComment": "NSEvent.SpecialKey.upArrow.rawValue",
"Modul... | json | github | https://github.com/apple/swift | lib/Migrator/overlay4.json |
#
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding=utf8
caOpensslConf = '''
#http://www.phildev.net/ssl/opensslconf.html
[ ca ]
default_ca = CA_default
[CA_default]
caroot = %(caroot)s
certs = $caroot/certsdb
new_certs_dir = $certs
database = $caroot/index.txt
certificate = $caroot/%(cn)s.cer
private_key = $caroot/%(cn)s-key.... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | lib/bufq.c |
/*
* Copyright 2010-2025 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.references
import com.intellij.openapi.util.registry.Registry
i... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/references/KotlinFirKDocResolutionStrategyProviderService.kt |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
strip_jsonp,
)
class WashingtonPostIE(InfoExtractor):
IE_NAME = 'washingtonpost'
_VALID_URL = r'(?:washingtonpost:|https?://(?:www\.)?washingtonpost\.com/video/(?:[^/... | unknown | codeparrot/codeparrot-clean | ||
// Copyright The Prometheus 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 w... | go | github | https://github.com/prometheus/prometheus | storage/remote/otlptranslator/prometheusremotewrite/helper.go |
//===-- ApplyReplacements.cpp - Apply and deduplicate replacements --------===//
//
// 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-apply-replacements/lib/Tooling/ApplyReplacements.cpp |
/*
* 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 ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestChunkedArrayList.java |
#!/usr/bin/env python
import datetime
import os
from openpyxl import Workbook
from openpyxl.cell import get_column_letter
from openpyxl.comments import Comment
from openpyxl.styles import PatternFill, Border, Side, Alignment, Protection, Font
import xlsxwriter
import django
django.setup()
from django.db.models impor... | unknown | codeparrot/codeparrot-clean | ||
from enum import Enum
from typing import List, Union
import rich
from pydantic import BaseModel
import openai
from openai import OpenAI
class Table(str, Enum):
orders = "orders"
customers = "customers"
products = "products"
class Column(str, Enum):
id = "id"
status = "status"
expected_delive... | python | github | https://github.com/openai/openai-python | examples/responses/structured_outputs_tools.py |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package api
import (
"errors"
"math/rand"
"strings"
"sync"
"time"
"github.com/cenkalti/backoff/v4"
)
var (
ErrLifetimeWatcherMissingInput = errors.New("missing input")
ErrLifetimeWatcherMissingSecret = errors.New("missing secret")
ErrLi... | go | github | https://github.com/hashicorp/vault | api/lifetime_watcher.go |
// Copyright 2013 Julien Schmidt. All rights reserved.
// Based on the path package, Copyright 2009 The Go Authors.
// Use of this source code is governed by a BSD-style license that can be found
// at https://github.com/julienschmidt/httprouter/blob/master/LICENSE.
package gin
const stackBufSize = 128
// cleanPath ... | go | github | https://github.com/gin-gonic/gin | path.go |
# -*- coding: utf-8 -*-
import sys
import six
import logging
from . import config, install, django
def execute():
# Log info and above to console
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
config_data = config.parse(sys.argv[1:])
try:
if config_data.plugins:
... | unknown | codeparrot/codeparrot-clean | ||
#
# 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 | ||
"""Implementation of JSONEncoder
"""
import re
try:
from lib.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
try:
from lib.simplejson._speedups import make_encoder as c_make_encoder
except ImportError:
c_make_encoder ... | unknown | codeparrot/codeparrot-clean | ||
#ifndef JSON_BINARY_INCLUDED
#define JSON_BINARY_INCLUDED
/* Copyright (c) 2015, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This p... | c | github | https://github.com/mysql/mysql-server | sql-common/json_binary.h |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 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/authentication/install/install.go |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('geozones', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USE... | unknown | codeparrot/codeparrot-clean | ||
import urllib2 as urllib
from cStringIO import StringIO
import Image
dim = 1
def width(img):
"""Gets the width of an image. Defined as its own thing for easiness."""
return img.size[0]
def height(img):
"""Gets the height of an image. Defined as its own thing for easiness."""
return img.size[1]
def s... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
# drop page cache and kernel slab objects on linux
[[ -x /usr/local/sbin/drop-caches ]] && sudo /usr/local/sbin/drop-caches
rm -Rfv $WORKSPACE/gradle-user-home
mkdir -p $WORKSPACE/gradle-user-home/init.d && cp -v $WORKSPACE/.ci/init.gradle $WORKSPACE/gradle-user-home
if [ "$(uname -m)" = "arm64" ] || [ "$(u... | unknown | github | https://github.com/elastic/elasticsearch | .ci/scripts/run-gradle-profiler.sh |
from flask import (
current_app, render_template, redirect, Blueprint, flash, url_for, g
)
from flask.ext.github import GitHubError
from flask.ext.login import login_user, logout_user
from realms import github
from realms.modules.github.models import User
blueprint = Blueprint('github', __name__)
@blueprint.route... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supp... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import json
import frappe
from frappe import _
from frappe.utils import flt, has_common
from frappe.utils.user import is_website_user
def get_list_cont... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 Google 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 by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
"""
The contents of this file are taken from
[Django-admin](https://github.com/niwinz/django-jinja/blob/master/django_jinja/management/commands/makemessages.py)
Jinja2's i18n functionality is not exactly the same as Django's.
In particular, the tags names and their syntax are different:
1. The Django ``trans`` tag ... | unknown | codeparrot/codeparrot-clean | ||
from .. import util
from ..util import sqla_compat
from . import schemaobj
from sqlalchemy.types import NULLTYPE
from .base import Operations, BatchOperations
import re
class MigrateOperation(object):
"""base class for migration command and organization objects.
This system is part of the operation extensibil... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 DataCentred Ltd
#
# 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 ag... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2018 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 applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/jenkins/benchmark-dockerized.sh |
(function () {
"use strict";
writeFile(TestData.outputLocation, tojson(db.adminCommand("getCmdLineOpts")["parsed"]["setParameter"]));
})(); | javascript | github | https://github.com/mongodb/mongo | buildscripts/tests/resmoke_end2end/testfiles/fixture_info.js |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label = '%s.%s... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# (c) 2014, Tomas Karasek <tomas.karasek@digile.fi>
#
# 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
# (a... | unknown | codeparrot/codeparrot-clean | ||
"""
Support for hydrological data from the Federal Office for the Environment FOEN.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.swiss_hydrological_data/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import requests... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
imp... | unknown | codeparrot/codeparrot-clean | ||
import orange
############ THIS IS WHAT YOU CAN DO WITH DISCRETE ATTRIBUTES
data = orange.ExampleTable("lenses")
############ THIS IS WHAT YOU CAN DO WITH DISCRETE ATTRIBUTES
print "\nYoung or presbyopic with astigmatism"
fya = orange.Filter_values(domain = data.domain)
fya["age"] = "young"
print "\nYoung examples\... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import setuptools
with open("README... | unknown | codeparrot/codeparrot-clean | ||
/*
A C-program for MT19937-64 (2004/9/29 version).
Coded by Takuji Nishimura and Makoto Matsumoto.
This is a 64-bit version of Mersenne Twister pseudorandom number
generator.
Before using, initialize the state by using init_genrand64(seed)
or init_by_array64(init_key, key_length).
Copyright (C) ... | c | github | https://github.com/redis/redis | src/mt19937-64.h |
#!/usr/bin/env python
"""
@package mi.core.instrument.test.test_data_particle
@file mi/core/instrument/test/test_data_particle.py
@author Steve Foley
@brief Test cases for the base data_particle module
"""
__author__ = 'Steve Foley'
__license__ = 'Apache 2.0'
import json
import base64
import time
import ntplib
from... | unknown | codeparrot/codeparrot-clean | ||
A literal was used in a built-in attribute that doesn't support literals.
Erroneous code example:
```compile_fail,E0565
#[repr("C")] // error: meta item in `repr` must be an identifier
struct Repr {}
fn main() {}
```
Not all attributes support literals in their input,
and in some cases they expect an identifier ins... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0565.md |
test_kind: js_test
selector:
roots:
- jstests/query_golden_sharding/**/*.js
executor:
archive:
tests:
- jstests/sharding/*reshard*.js
config:
# Based on sharding.yml
shell_options:
crashOnInvalidBSONError: ""
objcheck: ""
global_vars:
TestData:
setParamet... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/query_golden_sharding.yml |
/*
Copyright 2015 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/qos/doc.go |
# $Id: frontend.py 7584 2013-01-01 20:00:21Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Command-line and common processing for Docutils front-end tools.
Exports the following classes:
* `OptionParser`: Standard Docutils command-line process... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import datetime
from unittest import skipIf
from django.test import TestCase, override_settings
from django.utils import timezone
from .models import Article, Category, Comment
try:
import pytz
except ImportError:
pytz = None
class DateTimesTests(TestCase):
def t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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
#... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright (c) 2015 EMC 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
#
#... | unknown | codeparrot/codeparrot-clean | ||
"""
A place for code to be called from core C-code.
Some things are more easily handled Python.
"""
from __future__ import division, absolute_import, print_function
import re
import sys
from numpy.compat import asbytes, basestring
from .multiarray import dtype, array, ndarray
import ctypes
from .numerictypes import... | unknown | codeparrot/codeparrot-clean | ||
#copyright ReportLab Europe Limited. 2000-2006
#see license.txt for license details
__version__=''' $Id: widgets.py 3086 2007-05-22 13:10:34Z rgbecker $ '''
__all__= (
'BarcodeI2of5',
'BarcodeCode128',
'BarcodeStandard93',
'BarcodeExtended93',
'BarcodeStandard39',
'Barcod... | unknown | codeparrot/codeparrot-clean | ||
[
{
"model": "fixtures.circulara",
"fields": {
"key": "x",
"obj": ["y"]
}
},
{
"model": "fixtures.circularb",
"fields": {
"key": "y",
"obj": ["x"]
}
}
] | json | github | https://github.com/django/django | tests/fixtures/fixtures/circular_reference_natural_key.json |
#!/usr/bin/python
# 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
# "Licens... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation.
# 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.apac... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2008 The Guava 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 agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/net/InetAddressesTest.java |
# frozen_string_literal: true
module ActionMailer
module QueuedDelivery
extend ActiveSupport::Concern
included do
class_attribute :delivery_job, default: ::ActionMailer::MailDeliveryJob
class_attribute :deliver_later_queue_name, default: :mailers
end
end
end | ruby | github | https://github.com/rails/rails | actionmailer/lib/action_mailer/queued_delivery.rb |
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.utils.io
import io.ktor.utils.io.core.*
import kotlinx.io.EOFException
import kotlinx.io.InternalIoApi
import kotlinx.io.UnsafeIoApi
import kotlinx.io.bytestring.ByteString
im... | kotlin | github | https://github.com/ktorio/ktor | ktor-io/jvm/src/io/ktor/utils/io/ByteReadChannelOperations.jvm.kt |
# Python test set -- math module
# XXXX Should not do tests around zero only
from test.test_support import run_unittest, verbose
import unittest
import math
import os
import sys
import random
import struct
eps = 1E-05
NAN = float('nan')
INF = float('inf')
NINF = float('-inf')
# decorator for skipping tests on non-IE... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\InvalidArg... | php | github | https://github.com/symfony/symfony | src/Symfony/Component/Form/AbstractExtension.php |
"""
===================================================================
HermiteE Series, "Probabilists" (:mod:`numpy.polynomial.hermite_e`)
===================================================================
This module provides a number of objects (mostly functions) useful for
dealing with Hermite_e series, including... | python | github | https://github.com/numpy/numpy | numpy/polynomial/hermite_e.py |
"""
Implementation of Harwell-Boeing read/write.
At the moment not the full Harwell-Boeing format is supported. Supported
features are:
- assembled, non-symmetric, real matrices
- integer for pointer/indices
- exponential format for float values, and int format
"""
from __future__ import division, print_... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{
env::{var, var_os},
ffi::OsString,
path::PathBuf,
};
use crate::{err... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-bundler/src/bundle/macos/sign.rs |
#!/usr/bin/env python3
# http://packages.python.org/distribute/setuptools.html
# http://diveintopython3.org/packaging.html
# http://wiki.python.org/moin/CheeseShopTutorial
# http://pypi.python.org/pypi?:action=list_classifiers
from ez_setup import use_setuptools
use_setuptools(version='0.6c11')
import os
from setupt... | unknown | codeparrot/codeparrot-clean | ||
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.forms import UserCreationForm
from django.template import loader, RequestContext
from name_gen_app.models import NGram
import pickle
import name_generator
# Load
with open('ngrams/unigram_counts.pic... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import mimetypes
from time import time
from... | unknown | codeparrot/codeparrot-clean | ||
# Requests
**Requests** is a simple, yet elegant, HTTP library.
```python
>>> import requests
>>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
'{"authenticated"... | unknown | github | https://github.com/psf/requests | README.md |
# -*- coding: utf-8 -*-
from openerp.addons.project.tests.test_access_rights import TestPortalProjectBase
from openerp.exceptions import AccessError
from openerp.tools import mute_logger
class TestPortalProjectBase(TestPortalProjectBase):
def setUp(self):
super(TestPortalProjectBase, self).setUp()
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# cloud_sptheme documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 24 17:46:59 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2019 The Guava 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 i... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/testers/IgnoreJRERequirement.java |
# This file is part of OpenHatch.
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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 v... | unknown | codeparrot/codeparrot-clean | ||
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-kuromoji-tokenizer.html
---
# kuromoji_tokenizer [analysis-kuromoji-tokenizer]
The `kuromoji_tokenizer` accepts the following settings:
`mode`
: The tokenization mode determines how the tokenizer handles compound and unkno... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch-plugins/analysis-kuromoji-tokenizer.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.