code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
""" AIM class to credit card payment with authorize.net Fork of authnet code written by John Conde http://www.johnconde.net/blog/integrate-the-authorizenet-aim-api-with-python-3-2/ BSDv3 License Modifed by Massimo Di Pierro - ported from Python 3.x run on Python 2.4+ - fixed a couple of bugs - merged with test so si...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, float_or_none, unescapeHTML, ) class WistiaIE(InfoExtractor): _VALID_URL = r'(?:wistia:|https?://(?:fast\.)?wistia\.net/embed/iframe/)(?P<id>[a-z0-9]+)' _API_...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.conch.test.test_keys -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Data used by test_keys as well as others. """ from __future__ import absolute_import, division from base64 import decodestring from twisted.python.compat import long RSAData = { 'n...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # Common python helper functions used for OpenStack charms. from collections import OrderedDict import subprocess import os import socket import sys from charmhelpers.core.hookenv import ( config, log as juju_log, charm_dir, ERROR, INFO ) from charmhelpers.contrib.storage.linux...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import #!/usr/bin/env python import sys import unittest sys.path.append('xypath') import xypath import messytables try: import hamcrest except ImportError: hamcrest = None import re import tcore class Test_Import_Missing(tcore.TMissing): def test_table_has_properties_at_all(...
unknown
codeparrot/codeparrot-clean
from base64 import b64decode from os.path import join from bundlewrap.utils.testing import make_repo, run def test_b64encode_fault(tmpdir): make_repo(tmpdir) stdout, stderr, rcode = run("bw debug -c 'print(repo.vault.password_for(\"testing\").b64encode())'", path=str(tmpdir)) assert stdout == b"ZmFDVFQ3N...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 Pinterest, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
unknown
codeparrot/codeparrot-clean
import sublime_plugin import sublime import re import os class ConcatCommand(sublime_plugin.TextCommand): def run(self, edit): view = self.view window = view.window() region = sublime.Region(0, view.size()) path = '/'.join(self.view.file_name().split(os.sep)[0:-1]) full_...
unknown
codeparrot/codeparrot-clean
""" A command line interface for the cloco API. """ from setuptools import find_packages, setup dependencies = ['click', 'requests', 'configparser'] setup( name='cloco-cli', version='0.1.7', license='BSD', author='345 Systems', author_email='info@345.systems', description='A command line inter...
unknown
codeparrot/codeparrot-clean
import sys pythonver = sys.version_info[0] import client import httpmw def read_config(config_files, **predata): cfg = {} for config_file in config_files: cfg.update(_read_config_file( config_file, predata)) return cfg def _read_config_file(_config_file, predata): _file = open(_config_file) exec(_file, glo...
unknown
codeparrot/codeparrot-clean
/* C Extension module to test all aspects of PEP-3118. Written by Stefan Krah. */ #include "Python.h" /* struct module */ static PyObject *structmodule = NULL; static PyObject *Struct = NULL; static PyObject *calcsize = NULL; /* cache simple format string */ static const char *simple_fmt = "B"; static PyObject *s...
c
github
https://github.com/python/cpython
Modules/_testbuffer.c
''' * Copyright (C) 2015 Tripwire, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in wr...
unknown
codeparrot/codeparrot-clean
package kotlinx.coroutines.reactor import reactor.core.publisher.Flux import reactor.core.publisher.Mono fun <T> checkMonoValue( mono: Mono<T>, checker: (T) -> Unit ) { val monoValue = mono.block() checker(monoValue) } fun checkErroneous( mono: Mono<*>, checker: (Throwable) ->...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
reactive/kotlinx-coroutines-reactor/test/Check.kt
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package stackruntime import ( "context" "path" "path/filepath" "strconv" "testing" "time" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/inte...
go
github
https://github.com/hashicorp/terraform
internal/stacks/stackruntime/apply_destroy_test.go
# multicourse/multicourse_settings.py # # central module for providing fixed settings (course name, number, title) # for multiple courses. Loads this information from django.conf.settings # # Allows backward compatibility with settings configurations without # multiple courses specified. # # The central piece of confi...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import webapp2 import tba_config from controllers.backup_controller import TbaCSVBackupEventsEnqueue, TbaCSVBackupEventDo, TbaCSVRestoreEventsEnqueue, TbaCSVRestoreEventDo from controllers.backup_controller import TbaCSVBackupTeamsEnqueue, TbaCSVBackupTeamsDo from controllers.datafeed_controlle...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class LocalNews8IE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?localnews8\.com/(?:[^/]+/)*(?P<display_id>[^/]+)/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.localnews8.com/news/rexburg-business-t...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 //go:build windows // +build windows package clistate import ( "math" "syscall" "unsafe" ) var ( modkernel32 = syscall.NewLazyDLL("kernel32.dll") procLockFileEx = modkernel32.NewProc("LockFileEx") procCreateEventW = modkernel32.NewPr...
go
github
https://github.com/hashicorp/terraform
internal/command/clistate/local_state_lock_windows.go
/* Copyright 2021 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/tfrt/graph_executor/executable_context.h
@import url('https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined'); :host { display: flex; justify-content: center; font-family: var(--inter-font); } [ngMenuTrigger] { display: flex; cursor: pointer; align-items: center; padding: 0.6rem 2rem; border-radius: 0.5rem; border: 1px solid t...
css
github
https://github.com/angular/angular
adev/src/content/examples/aria/menu/src/menu-trigger-disabled/material/app/app.css
from __future__ import division, absolute_import, print_function import numpy.distutils.fcompiler from numpy.testing import TestCase, run_module_suite, assert_ intel_32bit_version_strings = [ ("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications" "running on Intel(R) 32, Version 11.1", '1...
unknown
codeparrot/codeparrot-clean
### # # Copyright Alan Kennedy. # # You may contact the copyright holder at this uri: # # http://www.xhaus.com/contact/modjy # # The licence under which this code is released is the Apache License v2.0. # # The terms and conditions of this license are listed in a file contained # in the distribution that also contained...
unknown
codeparrot/codeparrot-clean
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
unknown
codeparrot/codeparrot-clean
# # # Copyright 2015-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 (ht...
unknown
codeparrot/codeparrot-clean
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __author...
unknown
codeparrot/codeparrot-clean
"""Unit tests for the bytes and bytearray types. XXX This is a mess. Common tests should be moved to buffer_tests.py, which itself ought to be unified with string_tests.py (and the latter should be modernized). """ import os import re import sys import copy import pickle import tempfile import unittest import warnin...
unknown
codeparrot/codeparrot-clean
import responses import pytest from plugins.fishbans import fishbans, bancount test_user = "notch" test_api = """ {"success":true,"stats":{"username":"notch","uuid":"069a79f444e94726a5befca90e38aaf5","totalbans":11,"service":{"mcbans":0,"mcbouncer":11,"mcblockit":0,"minebans":0,"glizer":0}}} """ test_api_single = ""...
unknown
codeparrot/codeparrot-clean
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
unknown
codeparrot/codeparrot-clean
#include <gtest/gtest.h> #include <ATen/Functions.h> #include <ATen/NativeFunctions.h> #include <ATen/Tensor.h> #include <caffe2/core/tensor.h> #include <c10/util/ExclusivelyOwned.h> #include <c10/util/intrusive_ptr.h> #include <string> namespace { template <typename T> class ExclusivelyOwnedTest : public ::testing...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/test/ExclusivelyOwned_test.cpp
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import cint, cstr, flt from frappe import _, msgprint, throw from erpnext.accounts.party impor...
unknown
codeparrot/codeparrot-clean
# Copyright 2022 The HuggingFace Inc. 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 appl...
python
github
https://github.com/huggingface/transformers
src/transformers/models/bit/image_processing_bit.py
import operator_benchmark as op_bench import torch """Microbenchmarks for add_ operator. Supports both Caffe2/PyTorch.""" # Configs for PT add operator add_long_configs = op_bench.cross_product_configs( M=[8, 128], N=[32, 64], K=[256, 512], device=["cpu", "cuda"], tags=["long"] ) add_short_configs = op_bench.co...
python
github
https://github.com/pytorch/pytorch
benchmarks/operator_benchmark/pt/add_test.py
/* * contrib/btree_gist/btree_utils_num.h */ #ifndef __BTREE_UTILS_NUM_H__ #define __BTREE_UTILS_NUM_H__ #include <math.h> #include <float.h> #include "access/gist.h" #include "btree_gist.h" typedef char GBT_NUMKEY; /* Better readable key */ typedef struct { const GBT_NUMKEY *lower, *upper; } GBT_NUMKEY_R;...
c
github
https://github.com/postgres/postgres
contrib/btree_gist/btree_utils_num.h
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. convertor_registry = {} missing = object() no_default = object() class log_action(object): def __init__(self, *args...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ test_utility_functions ~~~~~~~~~~~~~~~~~~~~~~ Tests for the various utility functions provided by hyper-h2. """ import pytest import h2.config import h2.connection import h2.errors import h2.events import h2.exceptions from h2.utilities import extract_method_header # These tests require a...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2010 Philip Taylor # Released under the BSD license and W3C Test Suite License: see LICENSE.txt # Current code status: # # This was originally written for use at # http://philip.html5.org/tests/canvas/suite/tests/ # # It has been adapted for use with the Web Platform Test Suite suite at # https://githu...
unknown
codeparrot/codeparrot-clean
# #------------------------------------------------------------------------------ # Copyright (c) 2013-2014, Christian Therien # # 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://ww...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement import os.path import StringIO import sys import markdown import yaml # config CHANGE_KEYS = ('new', 'changed', 'fixed') #DESTINATION = '../html' DESTINATION = '/Users/naotaka/Development/GAE/data/clipmenu' FILENAME = 'versionhistory/...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support import re import struct import binascii __all__ = [ # Legacy interface exports traditional RFC 1521 Base64...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2015 Xilinx 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, distrib...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from .go_benchmark import Benchmark class FreudensteinRoth(Benchmark): r""" FreudensteinRoth objective function. This class defines the Freudenstein & Roth [1]_ global optimization problem. This is a multimodal ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Download or build previous releases. # Needs curl and tar to download a release, or the build depend...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/commentWithUnreasonableIndentationLevel01.ts] //// //// [commentWithUnreasonableIndentationLevel01.ts] // Repro from #41223 /** ...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/commentWithUnreasonableIndentationLevel01.js
#ifndef JEMALLOC_INTERNAL_PSSET_H #define JEMALLOC_INTERNAL_PSSET_H #include "jemalloc/internal/hpdata.h" /* * A page-slab set. What the eset is to PAC, the psset is to HPA. It maintains * a collection of page-slabs (the intent being that they are backed by * hugepages, or at least could be), and handles allocat...
c
github
https://github.com/redis/redis
deps/jemalloc/include/jemalloc/internal/psset.h
/*! * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {REDIRECT_ROUTES} from './redirections'; import {Route} from '@angular/router'; describe('REDIRECT_ROUTES', ...
typescript
github
https://github.com/angular/angular
adev/src/app/routing/redirections.spec.ts
/*------------------------------------------------------------------------- * * sha1.c * Implements the SHA1 Secure Hash Algorithm * * Fallback implementation of SHA1, as specified in RFC 3174. * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of ...
c
github
https://github.com/postgres/postgres
src/common/sha1.c
@import "@sass/abstracts/vars"; @import "@sass/abstracts/mixins"; @import "@fontawesome/scss/mixins"; @import "@fontawesome/scss/variables"; .navigation.sitemap-navigation { .level2 a { position: relative; padding-left: 10px; &:before { @include font-size(1.4); @include fa-icon(); trans...
unknown
github
https://github.com/vercel/next.js
examples/cms-sitecore-xmcloud/src/assets/sass/components/navigation/_sitemap-navigation.scss
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, unified_strdate, ) class SapoIE(InfoExtractor): IE_DESC = 'SAPO Vídeos' _VALID_URL = r'https?://(?:(?:v2|www)\.)?videos\.sapo\.(?:pt|cv|ao|mz|tl)/(?P<id>[\da-zA-...
unknown
codeparrot/codeparrot-clean
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import time import datetime from lib.common.out import * from lib.common.objects import File from lib.core.database import Database from lib.core.investigation import __project__ class Session(obj...
unknown
codeparrot/codeparrot-clean
"""Tests for the SmartThings config flow module.""" from unittest.mock import AsyncMock, Mock, patch from uuid import uuid4 from aiohttp import ClientResponseError from pysmartthings import APIResponseError from pysmartthings.installedapp import format_install_url from homeassistant import data_entry_flow from homeas...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import sys import time import traceback import warnings from functools import wraps from six import iteritems from . import formats from . import levels from . import outputs from .lib import iso8601time from .message import Message def emit(level): """a decorator that emit...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
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\Finder; use Symfony\Component\Finder\Comparator\DateC...
php
github
https://github.com/symfony/symfony
src/Symfony/Component/Finder/Finder.php
/* * 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
build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/ResolvedDependencies.java
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
from xadmin.sites import AdminSite, site VERSION = [0,4,4] class Settings(object): pass def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. This forces an import on them to register any admin bits they may want. """ from django.conf i...
unknown
codeparrot/codeparrot-clean
import os import xapian from djapian.utils.decorators import reopen_if_modified class Database(object): def __init__(self, path): self._path = path def open(self, write=False): """ Opens database for manipulations """ if not os.path.exists(self._path): os.m...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2002 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the debug base class. """ import sys import traceback import bdb import os import types import atexit import inspect from DebugProtocol import * gRecursionLimit = 64 def printerr(s): """ ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Anders Ingemann <aim@secoya.dk> # # 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 Licen...
unknown
codeparrot/codeparrot-clean
""" A sub-package for efficiently dealing with polynomials. Within the documentation for this sub-package, a "finite power series," i.e., a polynomial (also referred to simply as a "series") is represented by a 1-D numpy array of the polynomial's coefficients, ordered from lowest order term to highest. For example, a...
unknown
codeparrot/codeparrot-clean
# Copyright 2017-present Open Networking 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 agr...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chris Hoffman <christopher.hoffman@gmail.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 ...
unknown
codeparrot/codeparrot-clean
# ext/orderinglist.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """A custom list that manages index/position information for contained elements...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: MPL-2.0 package logical import ( "context" "crypto" "io" wrapping "github.com/hashicorp/go-kms-wrapping/v2" ) //go:generate enumer -type=KeyUsage -trimprefix=KeyUsage -transform=snake type KeyUsage int const ( KeyUsageEncrypt KeyUsage = 1 + iota K...
go
github
https://github.com/hashicorp/vault
sdk/logical/managed_key.go
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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 Licens...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
unknown
codeparrot/codeparrot-clean
test_kind: db_test selector: {} executor: config: dbtest_options:
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/dbtest.yml
from __future__ import unicode_literals from django.contrib.auth import get_user_model from rest_framework import viewsets, permissions, views, generics from rest_framework.response import Response from .models import Wallet, Movement from .serializers import WalletSerializer, MovementSerializer, UserSerializer cla...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AuditLogEntry.ip_address' db.add_column('sentry_auditlogentry', 'ip_address', ...
unknown
codeparrot/codeparrot-clean
#include "ruby.h" #define init(n) {void Init_##n(VALUE klass); Init_##n(klass);} void Init_float(void) { VALUE mBug = rb_define_module("Bug"); VALUE klass = rb_define_class_under(mBug, "Float", rb_cObject); TEST_INIT_FUNCS(init); }
c
github
https://github.com/ruby/ruby
ext/-test-/float/init.c
# (C) British Crown Copyright 2010 - 2017, Met Office # # This file is part of Iris. # # Iris 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 Foundation, either version 3 of the License, or # (at your option) any l...
unknown
codeparrot/codeparrot-clean
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v1beta1", "metadata": { "name": "v40.refresh_numeric.v42" }, "spec": { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" },...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dashboards_from_v0_to_v2/v2beta1.v40.refresh_numeric.v1beta1.json
__all__ = [ 'LXMLTreeBuilderForXML', 'LXMLTreeBuilder', ] from io import BytesIO from StringIO import StringIO import collections from lxml import etree from bs4.element import Comment, Doctype, NamespacedAttribute from bs4.builder import ( FAST, HTML, HTMLTreeBuilder, PERMISSIVE, Parse...
unknown
codeparrot/codeparrot-clean
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at h...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import print_function, absolute_import, division, unicode_literals if False: # MYPY from typing import Text, Any, Dict, List # NOQA __all__ = ["ScalarInt", "BinaryInt", "OctalInt", "HexInt", "HexCapsInt"] from .compat import no_limit_int # NOQA class ScalarInt(no_limit_int): ...
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/integration/observability/tasksscheduled/ObservationSchedulingConfigurer.java
import logging, threading from autotest_lib.client.common_lib import error from autotest_lib.client.bin import utils import kvm_utils, kvm_test_utils def run_nic_promisc(test, params, env): """ Test nic driver in promisc mode: 1) Boot up a VM. 2) Repeatedly enable/disable promiscuous mode in guest. ...
unknown
codeparrot/codeparrot-clean
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
unknown
codeparrot/codeparrot-clean
--- - hosts: testhost gather_facts: False tasks: - stat: path: '/'
unknown
github
https://github.com/ansible/ansible
test/integration/targets/plugin_filtering/stat.yml
"""Unit tests for the selected_tests script.""" import unittest from buildscripts import errorcodes # Debugging errorcodes.list_files = True TESTDATA_DIR = "./buildscripts/tests/data/errorcodes/" class TestErrorcodes(unittest.TestCase): """Test errorcodes.py.""" def setUp(self): # errorcodes.py ke...
python
github
https://github.com/mongodb/mongo
buildscripts/tests/test_errorcodes.py
# Owner(s): ["NNC"] # ruff: noqa: F841 import numpy as np import torch import torch.nn.functional as F from torch import nn import unittest import itertools from torch.testing._internal.common_utils import suppress_warnings, num_profiled_runs, run_tests, skipIfTorchDynamo from torch.testing._internal.jit_utils impor...
python
github
https://github.com/pytorch/pytorch
test/test_tensorexpr.py
import collections import glob import os import re import sys import traceback if 'mtimes' not in globals(): mtimes = {} if 'lastfiles' not in globals(): lastfiles = set() def make_signature(f): return f.func_code.co_filename, f.func_name, f.func_code.co_firstlineno def format_plug(plug, kind='', lpad=0...
unknown
codeparrot/codeparrot-clean
import type { LVal, Node, TSType } from '@babel/types' import type { ScriptCompileContext } from './context' import { inferRuntimeType } from './resolveType' import { UNKNOWN_TYPE, isCallOf, toRuntimeTypeString } from './utils' import { BindingTypes, unwrapTSNode } from '@vue/compiler-dom' export const DEFINE_MODEL = ...
typescript
github
https://github.com/vuejs/core
packages/compiler-sfc/src/script/defineModel.ts
""" Core methods ------------ .. autofunction:: cache_toolbox.core.get_instance .. autofunction:: cache_toolbox.core.delete_instance .. autofunction:: cache_toolbox.core.instance_key """ from django.core.cache import cache from django.db import DEFAULT_DB_ALIAS from opaque_keys import InvalidKeyError from . import ...
unknown
codeparrot/codeparrot-clean
--- applies_to: stack: ga serverless: ga navigation_title: Query multiple sources --- # Query multiple indices or clusters with {{esql}} {{esql}} allows you to query across multiple indices or clusters. Learn more in the following sections: * [Query multiple indices](esql-multi-index.md) * [Query across clusters...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/esql-multi.md
/* * 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-test/src/main/java/org/springframework/boot/test/json/ObjectContent.java
# -*- coding: utf-8 -*- # This coding header is significant for tests, as the debug view is parsing # files to search for such a header to decode the source file content from __future__ import unicode_literals import importlib import inspect import os import re import sys import tempfile from unittest import skipIf f...
unknown
codeparrot/codeparrot-clean
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G.i' DATETIME_FORMAT = r'j. E Y \k\e\l\l\o G.i' YEAR_MONTH_FORMAT = 'F Y' MON...
unknown
codeparrot/codeparrot-clean
from django.contrib.admindocs import views from django.urls import path, re_path urlpatterns = [ path( "", views.BaseAdminDocsView.as_view(template_name="admin_doc/index.html"), name="django-admindocs-docroot", ), path( "bookmarklets/", views.BookmarkletsView.as_view...
python
github
https://github.com/django/django
django/contrib/admindocs/urls.py
from __future__ import absolute_import from .Visitor import CythonTransform from .StringEncoding import EncodedString from . import Options from . import PyrexTypes, ExprNodes class EmbedSignature(CythonTransform): def __init__(self, context): super(EmbedSignature, self).__init__(context) self.de...
unknown
codeparrot/codeparrot-clean
# Next.js Documentation Conventions Complete reference for frontmatter schema, code block formatting, and MDX component usage. ## Frontmatter Schema All MDX files must start with YAML frontmatter enclosed in `---` delimiters. ### Required Fields | Field | Description | Examp...
unknown
github
https://github.com/vercel/next.js
.claude/skills/update-docs/references/DOC-CONVENTIONS.md
from __future__ import division, absolute_import, print_function import warnings import sys import numpy as np from numpy.testing import * import unittest class _GenericTest(object): def _test_equal(self, a, b): self._assert_func(a, b) def _test_not_equal(self, a, b): try: self._...
unknown
codeparrot/codeparrot-clean
from .base import Browser, ExecutorBrowser, require_arg from ..webdriver_server import EdgeDriverServer from ..executors import executor_kwargs as base_executor_kwargs from ..executors.executorselenium import (SeleniumTestharnessExecutor, SeleniumRefTestExecutor) from ..executo...
unknown
codeparrot/codeparrot-clean
# pylint: disable=invalid-name """ Utility library for working with the edx-milestones app """ from django.conf import settings from django.utils.translation import ugettext as _ from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.course_overviews.m...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/utils/NamespaceAliaser.cpp
/* Copyright 2013 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* This class models a sequence of literals and a backward reference copy. */ #ifndef BROTLI_ENC_COMMAND_H_ #define BROTLI_ENC_COMMAND_H_ #include ".....
c
github
https://github.com/nodejs/node
deps/brotli/c/enc/command.h
# Copyright 2014 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 agr...
unknown
codeparrot/codeparrot-clean
import os """ All configuration for the datawake web server. To change the configuration you should set the appropriate environment variables. Environment variables are used to set conf to conform to standard docker practices. REQUIRED ENVIRONMENT VARIABLES DW_DB: database name DW_DB_USER: database username DW_DB_PA...
unknown
codeparrot/codeparrot-clean
import { getPreviewPostBySlug } from "../../lib/graphcms"; export default async function handler(req, res) { // Check the secret and next parameters // This secret should only be known to this API route and the CMS if ( req.query.secret !== process.env.GRAPHCMS_PREVIEW_SECRET || !req.query.slug ) { ...
javascript
github
https://github.com/vercel/next.js
examples/cms-graphcms/pages/api/preview.js