code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
""" Many-to-many relationships via an intermediary table For many-to-many relationships that need extra fields on the intermediary table, use an intermediary model. In this example, an ``Article`` can have multiple ``Reporter`` objects, and each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`` f...
unknown
codeparrot/codeparrot-clean
from _pydevd_bundle import pydevd_constants from _pydev_imps._pydev_saved_modules import socket _cache = None def get_localhost(): ''' Should return 127.0.0.1 in ipv4 and ::1 in ipv6 localhost is not used because on windows vista/windows 7, there can be issues where the resolving doesn't work properly...
unknown
codeparrot/codeparrot-clean
from datetime import datetime import numpy as np import pytest from pandas.core.dtypes.cast import find_common_type from pandas.core.dtypes.common import is_dtype_equal import pandas as pd from pandas import ( DataFrame, Index, MultiIndex, Series, ) import pandas._testing as tm class TestDataFrameCo...
python
github
https://github.com/pandas-dev/pandas
pandas/tests/frame/methods/test_combine_first.py
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (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.mozil...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "cases/helper" require "models/topic" class ValidationsContextTest < ActiveModel::TestCase def teardown Topic.clear_validators! end ERROR_MESSAGE = "Validation error from validator" ANOTHER_ERROR_MESSAGE = "Another validation error from validator" class Validator...
ruby
github
https://github.com/rails/rails
activemodel/test/cases/validations/validations_context_test.rb
# Copyright (c) 2015 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.apache.org/licenses/LICENSE-2.0 # # Unless...
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. */ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\SecurityBun...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AbstractTokenCompareRoles/bundles.php
// Copyright 2018 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql_test import ( "context" "fmt" "math" "math/rand" "sync" "testing" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/sequence_test.go
import struct from graphene.storage.base.general_store import * from graphene.storage.base.general_type_type import * class GeneralTypeTypeStore(GeneralStore): """ Handles storage of types of Node/Relationship types to file. It stores types of types using the format: (inUse, typeName, propertyType, ne...
unknown
codeparrot/codeparrot-clean
''' Demonstrate use of a log color scale in contourf ''' import matplotlib.pyplot as plt import numpy as np from numpy import ma from matplotlib import colors, ticker, cm from matplotlib.mlab import bivariate_normal N = 100 x = np.linspace(-3.0, 3.0, N) y = np.linspace(-2.0, 2.0, N) X, Y = np.meshgrid(x, y) # A low...
unknown
codeparrot/codeparrot-clean
''' Import Libs ''' import pandas as pd import numpy as np from pandas.tools.plotting import scatter_matrix from sklearn import model_selection from sklearn.metrics import classification_report from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score from sklearn.linear_model import L...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Unl...
unknown
codeparrot/codeparrot-clean
#ifndef Py_ENUMOBJECT_H #define Py_ENUMOBJECT_H /* Enumerate Object */ #ifdef __cplusplus extern "C" { #endif PyAPI_DATA(PyTypeObject) PyEnum_Type; PyAPI_DATA(PyTypeObject) PyReversed_Type; #ifdef __cplusplus } #endif #endif /* !Py_ENUMOBJECT_H */
c
github
https://github.com/python/cpython
Include/enumobject.h
""" thanks: http://stackoverflow.com/questions/566746/\ how-to-get-console-window-width-in-python """ def getTerminalSize(): """ returns (lines:int, cols:int) """ import os import struct def ioctl_GWINSZ(fd): import fcntl import termios return struct.unpack("hh", fcntl....
unknown
codeparrot/codeparrot-clean
# Written by John Hoffman # see LICENSE.txt for license information from BitTornado.CurrentRateMeasure import Measure from random import randint from urlparse import urlparse from httplib import HTTPConnection from urllib import quote from threading import Thread from BitTornado.__init__ import product_name,version_sh...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.conch.test.test_transport -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ The lowest level SSH protocol. This handles the key negotiation, the encryption and the compression. The transport layer is described in RFC 4253. Maintainer: Paul Swartz...
unknown
codeparrot/codeparrot-clean
# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
unknown
codeparrot/codeparrot-clean
//! This module contains the `InterpCx` methods for executing a single step of the interpreter. //! //! The main entry point is the `step` method. use std::iter; use either::Either; use rustc_abi::{FIRST_VARIANT, FieldIdx}; use rustc_data_structures::fx::FxHashSet; use rustc_index::IndexSlice; use rustc_middle::ty::{...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_const_eval/src/interpret/step.rs
/* * Copyright 2002-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-framework
spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java
#!/usr/bin/env python # This file is copyrighted by Stefano Forenza <stefano@stefanoforenza.com> # # The code below is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License or (if you prefer) the # GNU Lesser General Public License as published by # ...
unknown
codeparrot/codeparrot-clean
from sympy import ( Abs, acos, acosh, Add, asin, asinh, atan, Ci, cos, sinh, cosh, tanh, Derivative, diff, DiracDelta, E, exp, erf, erfi, EulerGamma, Expr, factor, Function, I, Integral, integrate, Interval, Lambda, LambertW, log, Matrix, O, oo, pi, Piecewise, Poly, Rational, S, simplify, sin, tan, ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # from kubernetes_py.models.v1.NodeSelectorTerm import NodeSelectorTerm class PreferredSchedulingTerm(object): """ https://kubernetes.i...
unknown
codeparrot/codeparrot-clean
"""HTTP Client for asyncio.""" import asyncio import base64 import hashlib import os import sys import traceback import urllib.parse import warnings from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr import aiohttp from . import hdrs, helpers from ._ws_impl import WS_KEY, WebSocketParser, WebSocketW...
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/src/test/java/org/springframework/boot/json/WritableJsonTests.java
# -*- coding: utf-8 -*- import unittest import signal import os from logging import getLogger logger = getLogger(__name__) from PySide import QtCore, QtWebKit, QtNetwork from iivari import Display from iivari.settings import DISPLAYSTATUS_PATH # add iivari bin directory into PATH iivari_bin = os.path.abspath(os.path....
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2016 CERN. # # INSPIRE 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...
unknown
codeparrot/codeparrot-clean
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) >>> datadir = os.path.realpath(os.path.join(filepath,...
unknown
codeparrot/codeparrot-clean
{ "apiVersion": "dashboard.grafana.app/v2beta1", "kind": "Dashboard", "metadata": { "name": "ivc5gfp", "namespace": "stacks-5756", "uid": "353905c9-661c-47af-89ac-a0e966c5b3c7", "resourceVersion": "1764588557728998", "generation": 1, "creationTimestamp": "2025-12-01T11:29:17Z", "labels...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/input/v2beta1.tabs-with-nested-rows.json
# -*- coding: utf-8 -*- """ pygments.styles.murphy ~~~~~~~~~~~~~~~~~~~~~~ Murphy's style from CodeRay. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, Name, Comment,...
unknown
codeparrot/codeparrot-clean
## # Copyright 2009-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
unknown
codeparrot/codeparrot-clean
"""Support for DHT and DS18B20 sensors attached to a Konnected device.""" import logging from homeassistant.const import ( CONF_DEVICES, CONF_NAME, CONF_PIN, CONF_SENSORS, CONF_TYPE, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS) from homeassistant.core import callback from homeassistant.helper...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Notifications; class Action { /** * The action text. * * @var string */ public $text; /** * The action URL. * * @var string */ public $url; /** * Create a new action instance. * * @param string $text * @para...
php
github
https://github.com/laravel/framework
src/Illuminate/Notifications/Action.php
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.application.runner._exit}. """ from twisted.python.compat import NativeStringIO from ...runner import _exit from .._exit import exit, ExitStatus import twisted.trial.unittest class ExitTests(twisted.trial.unittest.TestCa...
unknown
codeparrot/codeparrot-clean
import pytest from api.base.settings.defaults import API_BASE from osf.models import RegistrationSchema from osf_tests.factories import ( AuthUserFactory, ) SCHEMA_VERSION = 2 @pytest.mark.django_db class TestMetaSchemaDetail: @pytest.fixture() def user(self): return AuthUserFactory() @pyte...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
unknown
codeparrot/codeparrot-clean
import sys from datetime import datetime from django.conf import settings from django.db import models from django.db.models.signals import post_save from django.utils.translation import get_language_from_request, ugettext_lazy as _ from django.contrib.auth.models import User, AnonymousUser from emailconfirmation.m...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.uic import * from blur.Stone import * from blur.Classes import * from blur.Classesui import HostSelector from blur.absubmit import Submitter from blur import RedirectOutputToLog import sys import time import os.path import random if sys....
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, unittest from frappe.core.page.data_import_tool import exporter from frappe.core.page.data_import_tool import importer from frappe.utils.csvutils import read_csv_co...
unknown
codeparrot/codeparrot-clean
# Copyright 2010 Google Inc. # # 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, dis- # trib...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-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-framework
framework-docs/src/main/java/org/springframework/docs/testing/mockmvc/assertj/mockmvctesterintegration/HotelControllerTests.java
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
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 frappe from frappe import _ def execute(filters=None): columns = get_columns() proj_details = get_project_details() pr_item_map = get_purchas...
unknown
codeparrot/codeparrot-clean
/* Copyright 2019 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/compiler/tf2xla/rearrange_function_argument.h
#!/bin/sh test_description='check that local clone does not fetch from promisor remotes' . ./test-lib.sh test_expect_success 'create evil repo' ' git init tmp && test_commit -C tmp a && git -C tmp config uploadpack.allowfilter 1 && git clone --filter=blob:none --no-local --no-checkout tmp evil && rm -rf tmp && ...
unknown
github
https://github.com/git/git
t/t0411-clone-from-partial.sh
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
unknown
codeparrot/codeparrot-clean
--- title: Routing order: 2 --- # Routing [MODES: data] ## Configuring Routes Routes are configured as the first argument to `createBrowserRouter`. At a minimum, you need a path and component: ```tsx import { createBrowserRouter } from "react-router"; function Root() { return <h1>Hello world</h1>; } const rout...
unknown
github
https://github.com/remix-run/react-router
docs/start/data/routing.md
Hi! Thank you very much for your submission to Ansible. It means a lot to us that you've taken the time to contribute. Unfortunately, we're not currently accepting most outside contributions consisting only of minor changes such as: * Spelling, grammar or typo fixes in comments, code or tests. * Type annotations fo...
unknown
github
https://github.com/ansible/ansible
hacking/ticket_stubs/no_thanks_minor_changes.md
// SPDX-License-Identifier: GPL-2.0-only /* * linux/lib/vsprintf.c * * Copyright (C) 1991, 1992 Linus Torvalds */ /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ /* * Wirzenius wrote this portably, Torvalds fucked it up :-) */ /* * Fri Jul 13 2001 Crutcher Dunnavant <crutcher+kernel@datastacks.com> * ...
c
github
https://github.com/torvalds/linux
lib/vsprintf.c
#!/usr/bin/env python import os import sys import py010parser.c_parser import pfp.interp from pfp.bitwrap import BitwrappedStream PARSER = py010parser.c_parser.CParser() def parse(data=None, template=None, data_file=None, template_file=None, interp=None, debug=False, predefines=True, int3=True, cpp_path="cpp", cpp...
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-testcontainers/src/test/java/org/springframework/boot/testcontainers/lifecycle/TestcontainersLifecycleApplicationContextInitializerTests.java
#!/usr/bin/env python # Usage: progname <directory> # # This program scans <directory> and generates C code on its stdout # that contains an array of psf_entry structures, one for each file # in <directory>. This code may be used to instantiate a file in procfs # whose contents is identical to each file in <directory...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: GPL-2.0 %YAML 1.2 --- $id: http://devicetree.org/schemas/firmware/qemu,fw-cfg-mmio.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: QEMU Firmware Configuration maintainers: - Rob Herring <robh@kernel.org> description: | Various QEMU emulation / virtualization targets...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/firmware/qemu,fw-cfg-mmio.yaml
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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...
unknown
codeparrot/codeparrot-clean
"""Module containing functions to calculate PAM statistics Todo: Convert to use Matrix instead of numpy matrices """ import numpy as np from LmCommon.common.lmconstants import PamStatKeys, PhyloTreeKeys from LmCompute.plugins.multi.calculate import ot_phylo from lmpy import Matrix # ................................
unknown
codeparrot/codeparrot-clean
## filetransfer.py ## ## Copyright (C) 2004 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version....
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Tommy Winther # http://tommy.winther.nu # # Modified for FTV Guide (09/2014 onwards) # by Thomas Geppert [bluezed] - bluezed.apps@gmail.com # # Modified for TV Guide Fullscreen (2016) # by primaeval - primaeval.dev@gmail.com # # This Program ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012 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 cStringIO import json import logging import os import unittest from telemetry.core import util from telemetry.core.chrome import tracing_backend ...
unknown
codeparrot/codeparrot-clean
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the fol...
c
github
https://github.com/opencv/opencv
3rdparty/openexr/IlmImf/ImfIntAttribute.h
# -*- coding: utf-8 -*- # 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, softw...
unknown
codeparrot/codeparrot-clean
from collections.abc import Mapping from ctypes import c_int, c_int32, c_double, c_char_p, POINTER, \ create_string_buffer, c_size_t from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array from openmc.exceptions import AllocationError, InvalidIDError from . import _dll from...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import sys from pdfdevice import PDFTextDevice from pdffont import PDFUnicodeNotDefined from layout import LTContainer, LTPage, LTText, LTLine, LTRect, LTCurve from layout import LTFigure, LTImage, LTChar, LTTextLine from layout import LTTextBox, LTTextBoxVertical, LTTextGroup from utils import ap...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- encoding: utf-8 -*- # ftpserver.py # # pyftpdlib is released under the MIT license, reproduced below: # ====================================================================== # Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com> # Hacked by Fabien Pinckaers (C) 2008 <fp@openerp.com...
unknown
codeparrot/codeparrot-clean
@import url('https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined'); @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); :host { display: flex; justify-content: center; font-size: 0.8rem; font-family: 'Press Start 2P'; --retro-button-color: color-mix(in srgb, v...
css
github
https://github.com/angular/angular
adev/src/content/examples/aria/select/src/basic/retro/app/app.css
from __future__ import absolute_import, unicode_literals from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.admin.helpers import InlineAdminForm from django.contrib.auth.models import User, Permission from django.contrib.contenttypes.models import ContentType from django.test imp...
unknown
codeparrot/codeparrot-clean
import { test } from '../../test'; export default test({ html: ` <p>Hello Alice</p> <p>Hello Bob</p> <p>Hello Charles</p> `, test({ assert, component, target }) { component.people = ['Alice', 'Charles', 'Bob']; assert.htmlEqual( target.innerHTML, ` <p>Hello Alice</p> <p>Hello Charles</p> ...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/component-yield-multiple-in-each/_config.js
from colorama import Fore, Style import logging class BaseStatsLogger(object): """Base class for logging realtime events""" def __init__(self, prefix='superset'): self.prefix = prefix def key(self, key): if self.prefix: return self.prefix + key return key def incr...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.engine.darwin.internal import io.ktor.client.engine.darwin.* import io.ktor.client.request.* import io.ktor.http.* import io.ktor.util.date.* import io.ktor.utils.io.In...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/internal/DarwinWebsocketSession.kt
import numpy import matplotlib import matplotlib.pyplot as plt def main(): plt.rc('text',usetex=True) matplotlib.rc('font', family = 'serif') font = {'family' : 'serif', 'size' : 'larger'} adsorbed = numpy.load('adsorbed_rate.out.npy') desorbed = numpy.load('desorbed_rate.out.npy') ...
unknown
codeparrot/codeparrot-clean
/* 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/controller/garbagecollector/graph_builder_test.go
from six import string_types from elasticsearch import Elasticsearch class Connections(object): """ Class responsible for holding connections to different clusters. Used as a singleton in this module. """ def __init__(self): self._kwargs = {} self._conns = {} def configure(sel...
unknown
codeparrot/codeparrot-clean
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 later version. # # This program is distributed ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/abstractPropertyBasics.ts] //// //// [abstractPropertyBasics.ts] interface A { prop: string; raw: string; m(): void; } abstract class B implements A { abstract prop: string; abstract raw: string; abstract readonly ro: string; abstract get readonlyProp(): string; ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/abstractPropertyBasics(target=es2015).js
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # 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, ...
unknown
codeparrot/codeparrot-clean
// Copyright 2014 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be...
c
github
https://github.com/opencv/opencv
3rdparty/libwebp/src/dsp/dec_mips32.c
#!/bin/sh test_description='patching from inconvenient places' . ./test-lib.sh test_expect_success 'setup' ' cat >patch <<-\EOF && diff file.orig file --- a/file.orig +++ b/file @@ -1 +1,2 @@ 1 +2 EOF patch="$(pwd)/patch" && echo 1 >preimage && printf "%s\n" 1 2 >postimage && echo 3 >other && test_ti...
unknown
github
https://github.com/git/git
t/t4111-apply-subdir.sh
from setuptools import setup, find_packages from easy_karabiner import __version__ setup( name='easy_karabiner', version=__version__, description='A tool to simplify key-remapping configuration for Karabiner', author='loggerhead', author_email='i@loggerhead.me', url='https://github.com/loggerhe...
unknown
codeparrot/codeparrot-clean
""" A simple setuptools file """ from setuptools import setup setup( name="PyPi_py3", version='0.1 dev', description='Ensure proper python3 adherence among pypi package maintainers', long_description="""Inspired by Guido's talk at PyCon2015, many packages on the pypi repository are still ...
unknown
codeparrot/codeparrot-clean
# mod_dash/neubot_module.py # # Copyright (c) 2013 # Nexa Center for Internet & Society, Politecnico di Torino (DAUIN) # and Simone Basso <bassosimone@gmail.com> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of ...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2011 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/util/concurrent/WrappingExecutorServiceTest.java
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Unit tests for preference APIs. """ import unittest import ddt import json from mock import patch from django.core.urlresolvers import reverse from django.conf import settings from django.test.testcases import TransactionTestCase from rest_framework.test import APIClient from student.tests...
unknown
codeparrot/codeparrot-clean
import { test } from '../../assert'; export default test({ props: { railColor1: 'black', trackColor1: 'red', railColor2: 'green', trackColor2: 'blue' }, html: ` <svelte-css-wrapper style="display: contents; --rail-color: black; --track-color: red;"> <div id="slider-1"> <p class="svelte-17ay6rc">Sli...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-browser/samples/component-css-custom-properties-dynamic/_config.js
""" ============================================================================= t-SNE: The effect of various perplexity values on the shape ============================================================================= An illustration of t-SNE on the two concentric circles and the S-curve datasets for different perpl...
python
github
https://github.com/scikit-learn/scikit-learn
examples/manifold/plot_t_sne_perplexity.py
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
unknown
codeparrot/codeparrot-clean
""" Modified version of build_scripts that handles building scripts from functions. """ from __future__ import division, absolute_import, print_function from distutils.command.build_scripts import build_scripts as old_build_scripts from numpy.distutils import log from numpy.distutils.misc_util import is_string class...
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 n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/clients/admin/RemoveRaftVoterOptions.java
/*============================================================================= Copyright (c) 2010 Bryce Lelbach Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==========================================...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/detail/fenv.hpp
# frozen_string_literal: true # :markup: markdown module ActionController # :nodoc: # # Action Controller Streaming # # Allows views to be streamed back to the client as they are rendered. # # By default, Rails renders views by first rendering the template and then the # layout. The response is sent to th...
ruby
github
https://github.com/rails/rails
actionpack/lib/action_controller/metal/streaming.rb
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
unknown
codeparrot/codeparrot-clean
pr: 140189 summary: Store fallback match only text fields in binary doc values area: Logs type: enhancement issues: []
unknown
github
https://github.com/elastic/elasticsearch
docs/changelog/140189.yaml
#!/usr/bin/env python # test_lobject.py - unit test for large objects support # # Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundat...
unknown
codeparrot/codeparrot-clean
"""SCons.Scanner.D Scanner for the Digital Mars "D" programming language. Coded by Andy Friesen 17 Nov 2003 """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2020 The HuggingFace Team. 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 agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/encoder-decoder.md
# 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
from . import InfraProvider from mgmtsystem.virtualcenter import VMWareSystem class VMwareProvider(InfraProvider): type_name = "virtualcenter" mgmt_class = VMWareSystem db_types = ["Vmware::InfraManager"] def __init__(self, name=None, credentials=None, key=None, zone=None, hostname=None, ...
unknown
codeparrot/codeparrot-clean
import discord import asyncio import logging import sys import time import threading import json import uniirc import uniformatter print(sys.version) print(discord.__version__) logger = logging.getLogger('discord') logger.setLevel(logging.DEBUG) handler = logging.FileHandler(filename='discord.log', encoding='utf-8',...
unknown
codeparrot/codeparrot-clean
// For documenting NgModule Apps only // #docregion import {LOCALE_ID, NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {AppComponent} from '../src/app/app.component'; @NgModule({ imports: [BrowserModule], declarations: [AppComponent], providers: [{provide: LOCALE_...
typescript
github
https://github.com/angular/angular
adev/src/content/examples/i18n/doc-files/app.module.ts
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package math /* Hypot -- sqrt(p*p + q*q), but overflows only if the result does. */ // Hypot returns [Sqrt](p*p + q*q), taking care to avoid // unnecessary o...
go
github
https://github.com/golang/go
src/math/hypot.go