code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#### Note: this error code is no longer emitted by the compiler
You implemented a trait, overriding one or more of its associated types but did
not reimplement its default methods.
Example of erroneous code:
```
#![feature(associated_type_defaults)]
pub trait Foo {
type Assoc = u8;
fn bar(&self) {}
}
impl ... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0399.md |
# Copyright 2015 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.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import webapp2
import webtest
... | unknown | codeparrot/codeparrot-clean | ||
{% load i18n admin_urls %}
<div class="js-inline-admin-formset inline-group"
id="{{ inline_admin_formset.formset.prefix }}-group"
data-inline-type="stacked"
data-inline-formset="{{ inline_admin_formset.inline_formset_data }}">
<fieldset class="module {{ inline_admin_formset.classes }}" aria-labelledby="{... | html | github | https://github.com/django/django | django/contrib/admin/templates/admin/edit_inline/stacked.html |
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporter... | javascript | github | https://github.com/lodash/lodash | dist/lodash.js |
@import 'tailwindcss'; | css | github | https://github.com/tailwindlabs/tailwindcss | playgrounds/nextjs/app/globals.css |
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# OctoPrint documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 02 17:08:50 2013.
#
# 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.
#
# A... | unknown | codeparrot/codeparrot-clean | ||
# Tauri MacOS Sign
Utilities for setting up macOS certificates, code signing and notarization for macOS and iOS apps. | unknown | github | https://github.com/tauri-apps/tauri | crates/tauri-macos-sign/README.md |
# -*- coding:utf-8 -*-
"""
Description:
MemoryStream
Usage:
from neo.IO.MemoryStream import MemoryStream
"""
from io import BytesIO
from binascii import hexlify
__mstreams__ = []
__mstreams_available__ = []
class StreamManager(object):
@staticmethod
def TotalBuffers():
"""
Get the to... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014 Timothy N. Tsvetkov (email: timothy.tsvetkov@gmail.com)
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Missing Token
There is no injection token for a constructor parameter at compile time. [InjectionTokens](api/core/InjectionToken) are tokens that can be used in a Dependency Injection Provider.
## Debugging the error
Look at the parameter that throws the error, and all uses of the class.
This error is commonly thr... | unknown | github | https://github.com/angular/angular | adev/src/content/reference/errors/NG2003.md |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
# Room B86 Coates, University Park, Nottingham, NG7 2RD,... | unknown | codeparrot/codeparrot-clean | ||
from concurrent.futures import ThreadPoolExecutor
from unittest.mock import ANY, patch
from coalib.core.ProjectBear import ProjectBear
from coalib.settings.Section import Section
from tests.core.CoreTestBase import CoreTestBase
class TestProjectBear(ProjectBear):
def analyze(self, files):
yield '\n'.joi... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=too-many-instance-attributes, too-many-arguments, protected-access, too-many-branches
# pylint: disable=too-many-public-methods
"""A `Module` implement the `BaseModule` API by wrapping a `Symbol` and one or
more `Executor` for data parallelization.
"""
import logging
import warnings
from .. import c... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import models
from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
from django.test.utils import isolate_apps
from django.utils import translation
from .models import (
Article, ArticleIde... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/collisionSuperAndPropertyNameAsConstuctorParameter.ts] ////
//// [collisionSuperAndPropertyNameAsConstuctorParameter.ts]
class a {
}
class b1 extends a {
constructor(_super: number) { // should be error
super();
}
}
class b2 extends a {
constructor(private _super: numbe... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js |
from django.contrib import admin
from cms.admin.placeholderadmin import PlaceholderAdmin
from testapp.placeholderapp.models import *
class MixinAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, **kwargs):
"""
Hook for specifying the form Field instance for a given database Field
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 you... | unknown | codeparrot/codeparrot-clean | ||
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Main' => array($baseDir . '/src'),
'Lala' => array($baseDir . '/src', $baseDir . '/lib'),
); | php | github | https://github.com/composer/composer | tests/Composer/Test/Autoload/Fixtures/autoload_main.php |
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dpll/dpll-device.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Digital Phase-Locked Loop (DPLL) Device
maintainers:
- Ivan Vecera <ivecera@redhat.com>
description:
Digital Phase-Locked Loop... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/dpll/dpll-device.yaml |
/*
* 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 | buildSrc/src/test/java/org/springframework/boot/build/architecture/url/encode/UrlEncodeWithStringEncoding.java |
# Copyright 2012, Dag Wieers <dag@wieers.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, or
# (at your option) any later versi... | unknown | codeparrot/codeparrot-clean | ||
# Generated by Django 2.0.8 on 2020-07-19 16:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('adesao', '0062_solicitacaodeadesao'),
]
operations = [
migrations.AddField(
model_name='solicita... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Jakub Jirutka <jakub@jirutka.cz>
#
# 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 Lice... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Database;
use Illuminate\Container\Container;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Facade;
use PHPUnit\Framework\TestCase;
class DatabaseSchemaBuilderIntegrationTest extends TestCase
{
protected $d... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseSchemaBuilderIntegrationTest.php |
"""
sentry.plugins.sentry_mail.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sentry
from django.conf import settings
from django.core.urlresolvers impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# DO NOT ADD 'set -x' not to reveal CircleCI secret context environment variables
set -eu -o pipefail
export ANDROID_NDK_HOME=/opt/ndk
export ANDROID_HOME=/opt/android/sdk
export GRADLE_VERSION=6.8.3
export GRADLE_HOME=/opt/gradle/gradle-$GRADLE_VERSION
export GRADLE_PATH=$GRADLE_HOME/bin/gradle
... | unknown | github | https://github.com/pytorch/pytorch | .circleci/scripts/publish_android_snapshot.sh |
/*
Copyright 2020 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/certificates/v1beta1/conversion.go |
// Copyright 2021 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | server/storage/datadir/doc.go |
"""Utility functions and classes used by nose internally.
"""
import inspect
import itertools
import logging
import stat
import os
import re
import sys
import types
import unittest
from nose.pyversion import ClassType, TypeType, isgenerator, ismethod
log = logging.getLogger('nose')
ident_re = re.compile(r'^[A-Za-z_][... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 | ||
# Tweepy
# Copyright 2010 Joshua Roesslein
# See LICENSE for details.
from datetime import datetime
import time
import htmlentitydefs
import re
import locale
from urllib import quote
from email.utils import parsedate
def parse_datetime(string):
return datetime(*(parsedate(string)[:6]))
def parse_html_value(html)... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | unknown | codeparrot/codeparrot-clean | ||
import logging
import sys
import time
import unittest
from doekbase.data_api.util import MonitorMemory, get_logger, basic_config
_log = get_logger(__name__)
alerted = {}
MB = 1024 * 1024
def icanhaz_alert(mm, avail, thresh, name):
assert avail < thresh
alerted[name] = avail
_log.debug('\nalerted: {:d} M... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# napiprojekt.pl API is used with napiproject administration consent
from __future__ import print_function
import os
import re
import sys
import time
from hashlib import md5
import struct
from six.moves import range
from six.moves import urllib
class GetFPS(object):
def... | unknown | codeparrot/codeparrot-clean | ||
from nipype.pipeline.engine import MapNode, Node, Workflow
import nipype.interfaces.utility as util
import nipype.interfaces.fsl as fsl
'''
Workflow to apply all spatial transformations to each volume
of a time series in a single interpolation
'''
def create_transform_pipeline(name='transfrom_timeseries'):
# set... | unknown | codeparrot/codeparrot-clean | ||
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: tixwidgets.py 36560 2004-07-18 06:16:08Z tim_one $
#
# tixwidgets.py --
#
# For Tix, see http://tix.sourceforge.net
#
# This is a demo program of some of the Tix widgets available in Python.
# If you have installed... | unknown | codeparrot/codeparrot-clean | ||
from twisted.internet import defer
from twisted.web import http
from moira.api.request import delayed, check_json
from moira.api.resources.redis import RedisResource
class Stats(RedisResource):
def __init__(self, db):
RedisResource.__init__(self, db)
@delayed
@defer.inlineCallbacks
def rende... | unknown | codeparrot/codeparrot-clean | ||
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.middleware.locale import LocaleMiddleware
from django.template import Context, Template
from django.test import SimpleTestCase, override_set... | python | github | https://github.com/django/django | tests/i18n/patterns/tests.py |
/*!
* 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/src/queryClient.ts |
package daemon
import (
// Importing packages here only to make sure their init gets called and
// therefore they register themselves to the logdriver factory.
_ "github.com/moby/moby/v2/daemon/logger/awslogs"
_ "github.com/moby/moby/v2/daemon/logger/etwlogs"
_ "github.com/moby/moby/v2/daemon/logger/fluentd"
_ "... | go | github | https://github.com/moby/moby | daemon/logdrivers_windows.go |
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th></th>
<th>0</th>
<th>1</th>
</tr>
<tr>
<th>foo</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<th>0</th>
<td>0... | html | github | https://github.com/pandas-dev/pandas | pandas/tests/io/formats/data/html/multiindex_sparsify_false_multi_sparse_1.html |
from util import hook, http, web, text
from urllib import urlencode
import re
sc_re = (r'(.*:)//(www.)?(soundcloud.com)(.*)', re.I)
api_url = "http://api.soundcloud.com"
sndsc_re = (r'(.*:)//(www.)?(snd.sc)(.*)', re.I)
def soundcloud(url, api_key):
data = http.get_json(api_url + '/resolve.json?' + urlencode({'url... | 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 | ||
/* mips_init.c - MSA optimised filter functions
*
* Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
* Written by Mandar Sahastrabuddhe, 2016
* Updated by guxiwei, 2023
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer... | c | github | https://github.com/opencv/opencv | 3rdparty/libpng/mips/mips_init.c |
# Dockers for `transformers`
In this folder you will find various docker files, and some subfolders.
- dockerfiles (ex: `consistency.dockerfile`) present under `~/docker` are used for our "fast" CIs. You should be able to use them for tasks that only need CPU. For example `torch-light` is a very light weights containe... | unknown | github | https://github.com/huggingface/transformers | docker/README.md |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2017 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-cygnus (FIWARE project).
#
# fiware-cygnus 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
""" generic datetimelike tests """
import pytest
import pandas as pd
from .common import Base
import pandas.util.testing as tm
class DatetimeLike(Base):
def test_shift_identity(self):
idx = self.create_index()
tm.assert_index_equal(idx, idx.shift(0))
def test_str(self):
# test the s... | unknown | codeparrot/codeparrot-clean | ||
class MyType {};
// CHECK: #include <a.h>
// CHECK-NEXT: #include <b.h>
// CHECK-NEXT: class MyType {}; | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-apply-replacements/Inputs/ignore-conflict/ignore-conflict.cpp |
class Solution:
def areConnected(self, n: int, threshold: int, queries: List[List[int]]) -> List[bool]:
cities=[0]*(n+1)
group={}
nextGroupId=1
def union(source, to):
if source==to:
return
for c in group[source]:
cities[c]=to
... | unknown | codeparrot/codeparrot-clean | ||
:host {
font-family: var(--inter-font);
display: flex;
justify-content: center;
}
[ngTabs] {
overflow: hidden;
width: 600px;
border-radius: 0.5rem;
background-color: color-mix(in srgb, var(--bright-blue) 5%, transparent);
}
[ngTabList] {
padding: 0;
display: flex;
list-style: none;
position: rel... | css | github | https://github.com/angular/angular | adev/src/content/examples/aria/tabs/src/explicit-selection/material/app/app.css |
it("should allow to export via exports", () => {
expect(require("./assign-exports-property?1").abc).toBe("abc");
expect(require("./assign-exports-property?2")).toEqual({
abc: "abc",
def: "def"
});
});
it("should allow to export via module.exports", () => {
expect(require("./assign-module-exports-property?1").a... | javascript | github | https://github.com/webpack/webpack | test/cases/cjs-tree-shaking/exports/index.js |
#!/usr/bin/env python
# -*- python-mode -*-
"""Emulate iostat for NFS mount points using /proc/self/mountstats
"""
__copyright__ = """
Copyright (C) 2005, Chuck Lever <cel@netapp.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# pylint: disable=too-many-arguments, no-member
"""Functions for constructing recurrent neural networks."""
import warnings
from ..model import save_checkpoint, load_checkpoint
from .rnn_cell import BaseRNNCell
def rnn_unroll(cell, length, inputs=None, begin_state=None, input_prefix='', layout='NTC'):... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package dbplugin
import (
"context"
"errors"
"reflect"
"testing"
"time"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/sdk/database/dbplugin/v5/proto"
"github.com/hashicorp/vault/sdk/helper/consts"
"github.com/hashicorp/v... | go | github | https://github.com/hashicorp/vault | sdk/database/dbplugin/v5/plugin_client_test.go |
// 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/codec.go |
# Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | python | github | https://github.com/python/cpython | Lib/socket.py |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/access-controllers/access-controllers.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Generic Domain Access Controllers
maintainers:
- Oleksii Moisieiev <oleksii_moisieiev@epam.com>
descri... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/access-controllers/access-controllers.yaml |
#!/usr/bin/python
# -*- coding: utf8 -*-
# lt_LT
################################################################################
#
# Lithuanian language support assembled from contributions provided by:
# Paulius Sladkevičius
#
################################################################################
from open... | unknown | codeparrot/codeparrot-clean | ||
// boost/filesystem/directory.hpp ---------------------------------------------------//
// Copyright Beman Dawes 2002-2009
// Copyright Jan Langer 2002
// Copyright Dietmar Kuehl 2001
// Copyright Vladimir Prus 2002
// Copyright Andrey Semashev 2019, 2022
// Distributed under the Boost Software License, Versi... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/filesystem/directory.hpp |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import Gaussian2DKernel
from astropy.nddata import NDData
def test_basic_nddata():
arr = np.zeros((11, 11))
arr[5, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2014 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 requi... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.db import connection
from django.test import TestCase
from .models import A01, A02, B01, B02, C01, C02, Unmanaged2, Managed1
class SimpleTests(TestCase):
def test_simple(self):
"""
The main test here is that the all the models can be created wi... | 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/kuberuntime/kuberuntime_manager.go |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2022 - 2025 R. Thomas
*
* 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 t... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/PDB/CompilationUnit.hpp |
from django.core.management import call_command
from django.test import override_settings
from .test_base import MigrationTestBase
class Tests(MigrationTestBase):
"""
Deprecated model fields should still be usable in historic migrations.
"""
@override_settings(
MIGRATION_MODULES={"migrations"... | python | github | https://github.com/django/django | tests/migrations/test_deprecated_fields.py |
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/ilitek,ili9486.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ilitek ILI9486 display panels
maintainers:
- Kamlesh Gurudasani <kamlesh.gurudasani@gmail.com>
description:
This binding is for displ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/display/ilitek,ili9486.yaml |
"""
This module implements the Request class which is used to represent HTTP
requests in Scrapy.
See documentation in docs/topics/request-response.rst
"""
import six
from w3lib.url import safe_url_string
from scrapy.http.headers import Headers
from scrapy.utils.trackref import object_ref
from scrapy.utils.url import ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
import json
import logging
from django.http import HttpResponse
from django.views.generic import View
from codex.baseerror import BaseError, InputError
__author__ = "Epsirom"
class BaseView(View):
logger = logging.getLogger('View')
def dispatch(self, request, *args, **kwargs):
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2021 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... | typescript | github | https://github.com/prometheus/prometheus | web/ui/module/codemirror-promql/src/parser/index.ts |
# $HeadURL: $
""" Statistics
Module containing little helpers that extract information from the RSS databases
providing information for comparisons and plots.
"""
import datetime
# DIRAC
from DIRAC import S_ERROR, S_OK
from DIRAC.ResourceStatusSystem.Client.... | unknown | codeparrot/codeparrot-clean | ||
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_critical_section.h"// Py_BEGIN_CRITICAL_SECTION()
#include "pycore_modsupport.h" ... | c | github | https://github.com/python/cpython | Modules/clinic/_queuemodule.c.h |
"""Generates common contexts"""
import logging
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from util.request import COURSE_REGEX
log = logging.getLogger(__name__)
def course_context_from_url(url):
"""
Extract... | unknown | codeparrot/codeparrot-clean | ||
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
/... | go | github | https://github.com/cockroachdb/cockroach | pkg/raft/raft_test.go |
from twython import Twython, TwythonError, TwythonAuthError
from .config import app_key, app_secret, screen_name, unittest
class TwythonAuthTestCase(unittest.TestCase):
def setUp(self):
self.api = Twython(app_key, app_secret)
self.bad_api = Twython('BAD_APP_KEY', 'BAD_APP_SECRET')
self.bad... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
httpbin.helpers
~~~~~~~~~~~~~~~
This module provides helper functions for httpbin.
"""
import json
from hashlib import md5
from werkzeug.http import parse_authorization_header
from flask import request, make_response
from .structures import CaseInsensitiveDict
ASCII_ART = """
-=[ te... | unknown | codeparrot/codeparrot-clean | ||
"""
Class Dashboard API endpoint urls.
"""
from django.conf.urls import patterns, url
urlpatterns = patterns('', # nopep8
# Json request data for metrics for entire course
url(r'^(?P<course_id>[^/]+/[^/]+/[^/]+)/all_sequential_open_distrib$',
'class_dashboard.views.all_sequential_open_distrib', name=... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.conf import settings
from django.db.backends import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def __init__(self, connection):
super(DatabaseOperations, self).__init__(connection)
def date_extract_sql(self, lookup_type,... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | unknown | codeparrot/codeparrot-clean | ||
"""
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import operator
import warnings
from contextlib import nullcontext
from functools import reduce
from itertools import chain, islice
from weakref import ref as weak_ref
from asgiref.sync import sync_to_async
import django
... | python | github | https://github.com/django/django | django/db/models/query.py |
"""
Expressions
-----------
Offer fast expression evaluation through numexpr
"""
import warnings
import numpy as np
import pandas.core.common as com
from pandas.core.computation.check import _NUMEXPR_INSTALLED
from pandas.core.config import get_option
if _NUMEXPR_INSTALLED:
import numexpr as ne
_TEST_MODE = N... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* pg_config.c
* Expose same output as pg_config except as an SRF
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* ... | c | github | https://github.com/postgres/postgres | src/backend/utils/misc/pg_config.c |
/*
* 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 | benchmarks/src/main/java/org/elasticsearch/benchmark/swisshash/LongSwissHashBenchmark.java |
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 ETH Zurich
#
# 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, sof... | unknown | codeparrot/codeparrot-clean | ||
import os
from gensim import corpora, models, similarities
from pprint import pprint # pretty-printer
import logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s',level=logging.INFO)
if (os.path.exists("/tmp/deerwester.dict")):
dictionary = corpora.Dictionary.load('/tmp/deerwester.dict')
c... | unknown | codeparrot/codeparrot-clean | ||
import sys
from . import main
rc = 1
try:
main()
rc = 0
except Exception as e:
print('Error:', e, file=sys.stderr)
sys.exit(rc) | python | github | https://github.com/python/cpython | Lib/venv/__main__.py |
from __future__ import print_function
import IMP
import IMP.test
import IMP.core
import IMP.gsl
class WoodsFunc(IMP.Restraint):
"""Woods function for four input values, defined as an IMP restraint"""
def __init__(self, model, particles):
IMP.Restraint.__init__(self, model, "WoodsFunc%1%")
sel... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import os
from future.moves.urllib.parse import urljoin
from django.db import models
import markupsafe
import gitlab
from addons.base import exceptions
from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings,
BaseStorageAddon)
from addons.g... | unknown | codeparrot/codeparrot-clean | ||
import numpy
from chainer.backends import cuda
from chainer import function
from chainer.utils import type_check
class Contrastive(function.Function):
"""Contrastive loss function."""
def __init__(self, margin, reduce='mean'):
if margin <= 0:
raise ValueError("margin should be positive v... | unknown | codeparrot/codeparrot-clean | ||
"""
After years of study, scientists have discovered an alien language transmitted from a faraway planet. The alien
language is very unique in that every word consists of exactly L lowercase letters. Also, there are exactly D words in
this language.
Once the dictionary of all the words in the alien language was built,... | unknown | codeparrot/codeparrot-clean | ||
/* contrib/pageinspect/pageinspect--1.11--1.12.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pageinspect UPDATE TO '1.12'" to load this file. \quit
--
-- bt_multi_page_stats()
--
CREATE FUNCTION bt_multi_page_stats(IN relname text, IN blkno int8, IN blk_co... | sql | github | https://github.com/postgres/postgres | contrib/pageinspect/pageinspect--1.11--1.12.sql |
/*
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/kubelet.go |
import {identity} from 'shared-runtime';
function Component({data}) {
let x = 0;
for (const item of data) {
const {current, other} = item;
x += current;
identity(other);
}
return [x];
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [
{
data: [
{current: 2, other:... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-dce-circular-reference.js |
#pragma once
#include <c10/macros/Export.h>
#ifndef _WIN32
#include <level_zero/ze_api.h>
#endif
namespace at::xpu {
// NOTE [ USE OF Level zero API ]
//
// XPU ATen does not directly link to Intel level_zero because it
// require libze_loader to be installed. Following the design of PyTorch,
// we want our GPU bui... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/xpu/level_zero_stub/ATenLevelZero.h |
from datetime import *
import django
from django.conf import settings
if django.VERSION[:2] >= (1, 4) and getattr(settings, 'USE_TZ', False):
from django.utils import timezone
from datetime import datetime as _datetime
class datetime(_datetime):
"""
A custom datetime.datetime class which ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.