code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# No shebang line, this module is meant to be imported # # Copyright 2013 Oliver Palmer # # 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 # # U...
unknown
codeparrot/codeparrot-clean
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # This code is part of Ansible, but is an independent component # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own lic...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from functools import partial from tastypie import fields from tastypie.resources import Resource from tastypie.exceptions import ApiFieldError from django.db import models from django.core.exceptions import ObjectDoesNotExist from .resources import GenericResource class Generic...
unknown
codeparrot/codeparrot-clean
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2008 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-testlib/src/com/google/common/collect/testing/MapTestSuiteBuilder.java
"""RFC-822 message manipulation class. XXX This is only a very rough sketch of a full RFC-822 parser; in particular the tokenizing of addresses does not adhere to all the quoting rules. Directions for use: To create a Message object: first open a file, e.g.: fp = open(file, 'r') You can use any other legal way of ...
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
import sys, os from jsonrpc import ServiceHandler, ServiceException class ServiceImplementaionNotFound(ServiceException): pass class ModPyServiceHandler(ServiceHandler): def __init__(self, req): self.req = req ServiceHandler.__init__(self, None) def findServiceEndpoint(self, name): ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # A MongoDB Nagios check script # # Script idea taken from a Tag1 script I found and I modified it a lot # # Main Author # - Mike Zupan <mike@zcentric.com> # Contributers # - Frank Brandewiede <brande@travel-iq.com> <brande@bfiw.de> <brande@novolab.de> # - Sam Perman <sam@brightcove.com>...
unknown
codeparrot/codeparrot-clean
import numpy as np import fdmb import itertools # Header print('fdmb test for the EM fit implementation') print('Documentation on the data can be found in ar2Data.README', end='\n\n') # Model parameters obs = np.loadtxt('ar2DataObs.dat') nData = 5000 dim = 2 order = 2 aThresh = 1e-8 pThresh = 1e-10 maxIter = np.int32...
unknown
codeparrot/codeparrot-clean
import { test } from '../../test'; export default test({ error: { code: 'rune_renamed', message: '`$effect.active` is now `$effect.tracking`' } });
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/compiler-errors/samples/effect-active-rune/_config.js
# Copyright 2011 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 requ...
unknown
codeparrot/codeparrot-clean
// 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 html import "sync" // All entities that do not end with ';' are 6 or fewer bytes long. const longestEntityWithoutSemicolon = 6 // entityMaps returns ...
go
github
https://github.com/golang/go
src/html/entity.go
# frozen_string_literal: true require "cases/helper" module ActiveRecord module Type class UnsignedIntegerTest < ActiveRecord::TestCase test "unsigned int max value is in range" do assert_equal(4294967295, UnsignedInteger.new.serialize(4294967295)) end test "minus value is out of rang...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/type/unsigned_integer_test.rb
# -*- coding: utf-8 -*- """ ======================== Title of Example ======================== This example <verb> <active tense> <does something>. The example uses <packages> to <do something> and <other package> to <do other thing>. Include links to referenced packages like this: `astropy.io.fits` to show the astro...
unknown
codeparrot/codeparrot-clean
- hosts: testhost # the following commands should all parse fine and execute fine # and represent quoting scenarios that should be legit gather_facts: False roles: - { role: test_good_parsing, tags: test_good_parsing }
unknown
github
https://github.com/ansible/ansible
test/integration/targets/parsing/good_parsing.yml
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Uses the closure compiler to check syntax and semantics of a js module with dependencies.''' import os import re import subprocess...
unknown
codeparrot/codeparrot-clean
# vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2007-2009, Mathieu Fenniak # 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 co...
unknown
codeparrot/codeparrot-clean
# Copyright 2023 The Intel Labs Team Authors, The Microsoft Research Team Authors and 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:...
python
github
https://github.com/huggingface/transformers
src/transformers/models/bridgetower/processing_bridgetower.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (C) 2007 Google 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 ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # 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. """Utility to decode a crash dump generated by untrusted_crash_dump.[ch] Currently this produces a simple stack trace. """ import jso...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Support; use ArrayIterator; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Jsonable; use IteratorAggregate; use JsonSerializable; use Traversable; class TestArrayableObject implements Arrayable { public function toArray() { return ['foo' ...
php
github
https://github.com/laravel/framework
tests/Support/Common.php
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011-2014 OpenStack Foundation # Copyright 2014 Red Hat, 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 Licens...
unknown
codeparrot/codeparrot-clean
""" This module contains a quick ident server implentation: ``IdentServer``. IdentServer is a functional ident server that returns fake data and can be used with IRC bots or clients. This is useful for two reasons; it speeds up connection time, and some servers require an ident response for security purposes. """ impo...
unknown
codeparrot/codeparrot-clean
""" This script performs an out of core groupby operation for different datasets. The datasets to be processed are normally in CSV files and the key and value to be used for the grouping are defined programatically via small functions (see toy_stream() and statsmodel_stream() for examples). Those datasets included in...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-clean
import sys import getopt import re import string # # Originally written by Einar Lielmanis et al., # Conversion to python by Einar Lielmanis, einar@jsbeautifier.org, # MIT licence, enjoy. # # Python is not my native language, feel free to push things around. # # Use either from command line (script displays its usage ...
unknown
codeparrot/codeparrot-clean
# pylint: disable=missing-docstring,too-few-public-methods class AbstractFoo: def kwonly_1(self, first, *, second, third): "Normal positional with two positional only params." def kwonly_2(self, *, first, second): "Two positional only parameter." def kwonly_3(self, *, first, second): ...
unknown
codeparrot/codeparrot-clean
import sys import os import time base = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0,base) import polyglotdb.io as pgio from polyglotdb.io.parsers import FilenameSpeakerParser from polyglotdb import CorpusContext path_to_gp = r'D:\Data\GP_aligned\TH' graph_db = {'host':'localhost', ...
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 appl...
unknown
codeparrot/codeparrot-clean
# # An attempt at re-implementing LZJB compression in native Python. # # Created in May 2014 by Emil Brink <emil@obsession.se>. See LICENSE. # # --------------------------------------------------------------------- # # Copyright (c) 2014-2016, Emil Brink # All rights reserved. # # Redistribution and use in source and b...
unknown
codeparrot/codeparrot-clean
""" pyggle.camera This library (PYGGEL) is licensed under the LGPL by Matthew Roe and PYGGEL contributors. The camera module defines a Base camera class other cameras should inherit from, and two common cameras: LookFromCamera - which is basically a FPS camera, and the LookAtCamera - which is basically a third-person ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/accessorWithRestParam.ts] //// //// [accessorWithRestParam.ts] class C { set X(...v) { } static set X(...v2) { } } //// [accessorWithRestParam.js] "use strict"; var C = /** @class */ (function () { function C() { } Object.defineProperty(C.prototype, "X", { set: f...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/accessorWithRestParam(target=es5).js
--- title: Contact Information --- Contact Information
html
github
https://github.com/jekyll/jekyll
test/source/contacts.html
from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property from .base import Database try: import pytz except ImportError: pytz = None class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () update_can_self_select = False ...
unknown
codeparrot/codeparrot-clean
""" Tests for L{eliot._action}. """ from __future__ import unicode_literals from unittest import TestCase from threading import Thread from warnings import catch_warnings, simplefilter from hypothesis import given from hypothesis.strategies import integers, lists from .._action import ( Action, _ExecutionContex...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2007 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
java
github
https://github.com/google/guava
android/guava/src/com/google/common/collect/EnumMultiset.java
# -*- coding: utf-8 -*- """ *************************************************************************** ExecuteSQL.py -- use virtual layers to execute SQL on any sources --------------------- Date : Jan 2016 Copyright : (C) 2016 by Hugo Mercier Email : hugo...
unknown
codeparrot/codeparrot-clean
"""brainfuck interpreter adapted from (public domain) code at http://brainfuck.sourceforge.net/brain.py""" import re import asyncio import random from cloudbot import hook BUFFER_SIZE = 5000 MAX_STEPS = 1000000 @asyncio.coroutine @hook.command("brainfuck", "bf") def bf(text): """<prog> - executes <prog> as Brai...
unknown
codeparrot/codeparrot-clean
TIS_620_TO_UCS_TBL = [ ["A1",0xE01], ["A2",0xE02], ["A3",0xE03], ["A4",0xE04], ["A5",0xE05], ["A6",0xE06], ["A7",0xE07], ["A8",0xE08], ["A9",0xE09], ["AA",0xE0A], ["AB",0xE0B], ["AC",0xE0C], ["AD",0xE0D], ["AE",0xE0E], ["AF",0xE0F], ["B0",0xE10], ["B1",0xE11], ["B2",0xE12], ["B3",0...
ruby
github
https://github.com/ruby/ruby
enc/trans/tis-620-tbl.rb
#ifndef COROUTINE_PPC64_CONTEXT_H #define COROUTINE_PPC64_CONTEXT_H 1 #pragma once #include <assert.h> #include <stddef.h> #include <stdint.h> #include <string.h> #define COROUTINE __attribute__((noreturn)) void enum { COROUTINE_REGISTERS = 20 /* 19 general purpose registers (r13-r31) and 1 return address */ ...
c
github
https://github.com/ruby/ruby
coroutine/ppc64/Context.h
# -*- coding: utf-8 -*- from ast import literal_eval import datetime from functools import partial import logging import werkzeug.urls import urllib2 from openerp import release, SUPERUSER_ID from openerp.models import AbstractModel from openerp.osv import osv from openerp.tools.translate import _ from openerp.tools.c...
unknown
codeparrot/codeparrot-clean
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä ...
unknown
codeparrot/codeparrot-clean
'use strict'; const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { n: [1e6], direction: ['start', 'end'], }); function main({ direction, n }) { const timersList = []; bench.start(); if (direction === 'start') { for (let i = 1; i <= n; i+...
javascript
github
https://github.com/nodejs/node
benchmark/timers/timers-insert-unpooled.js
from __future__ import print_function from LogAnalyzer import Test,TestResult import DataflashLog from math import sqrt class TestIMUMatch(Test): '''test for empty or near-empty logs''' def __init__(self): Test.__init__(self) self.name = "IMU Mismatch" def run(self, logdata, verbose): ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessor6.ts] //// //// [autoAccessor6.ts] class C1 { accessor a: any; } class C2 extends C1 { a = 1; } class C3 extends C1 { get a() { return super.a; } } //// [autoAccessor6.js] "use strict"; var __classPrivateFieldGet = (this && thi...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/autoAccessor6(target=es2015,usedefineforclassfields=false).js
#!/usr/bin/env python """ SoftLayer external inventory script. The SoftLayer Python API client is required. Use `pip install softlayer` to install it. You have a few different options for configuring your username and api_key. You can pass environment variables (SL_USERNAME and SL_API_KEY). You can also write INI file...
unknown
codeparrot/codeparrot-clean
"""Flexible enumeration of C types.""" from __future__ import division, print_function from Enumeration import * # TODO: # - struct improvements (flexible arrays, packed & # unpacked, alignment) # - objective-c qualified id # - anonymous / transparent unions # - VLAs # - block types # - K&R functions # - p...
unknown
codeparrot/codeparrot-clean
""" Support for RFXtrx components. For more details about this component, please refer to the documentation at https://home-assistant.io/components/rfxtrx/ """ import asyncio import logging from collections import OrderedDict import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassi...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (C) 2009 Google 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...
unknown
codeparrot/codeparrot-clean
# vim:sw=8:ts=8:et:nowrap import sys import urllib import urlparse import re import os.path import xml.sax import time import string import tempfile import mx.DateTime import traceback import miscfuncs toppath = miscfuncs.toppath pwcmdirs = miscfuncs.pwcmdirs tempfilename = miscfuncs.tempfilename from miscfuncs impor...
unknown
codeparrot/codeparrot-clean
# Copyright 2017 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
"""A prompt is the input to the model. Prompt is often constructed from multiple components and prompt values. Prompt classes and functions make constructing and working with prompts easy. """ from typing import TYPE_CHECKING from langchain_core._import_utils import import_attr if TYPE_CHECKING: from langchain_...
python
github
https://github.com/langchain-ai/langchain
libs/core/langchain_core/prompts/__init__.py
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
unknown
codeparrot/codeparrot-clean
from datetime import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible # M2M described on one of the models @python_2_unicode_compatible class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ('name',) def __st...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2025-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/main/java/org/springframework/boot/build/autoconfigure/CheckAutoConfigurationImports.java
# schema: [opcode, ins, outs, memuses, gas] # # memuses are written as an array of (start, len) pairs; values less than # zero are taken as stackarg indices and values zero or greater are taken # as literals opcodes = { 0x00: ['STOP', 0, 0, 0], 0x01: ['ADD', 2, 1, 1], 0x02: ['MUL', 2, 1, 1], 0x03: ['SU...
unknown
codeparrot/codeparrot-clean
/* 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/kernels/gpu_prim_helpers.h
use crate::process::imp::orphan::{OrphanQueue, Wait}; use crate::process::kill::Kill; use crate::signal::unix::InternalStream; use std::future::Future; use std::io; use std::ops::Deref; use std::pin::Pin; use std::process::ExitStatus; use std::task::Context; use std::task::Poll; /// Orchestrates between registering i...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/process/unix/reap.rs
//===----------------------------------------------------------------------===// // // 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/bugprone/FoldInitTypeCheck.cpp
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ from __future__ import unicode_literals import json from ctypes import addressof, byref, c_double from django.contrib.gis import gdal from django.contrib.gis.geometry.regex import hex_regex, json_regex, wkt_...
unknown
codeparrot/codeparrot-clean
/** * AOT support for application contexts. */ @NullMarked package org.springframework.context.aot; import org.jspecify.annotations.NullMarked;
java
github
https://github.com/spring-projects/spring-framework
spring-context/src/main/java/org/springframework/context/aot/package-info.java
# -*- coding: utf-8 -*- """ This script starts or resumes the training of an autoencoder or an encoder that is defined in model_definitions. Due to the large amout of input arguments, this should be run from a shell script. A documentation for the possible inputs is given in submit.sh. """ from keras.models import lo...
unknown
codeparrot/codeparrot-clean
use crate::io::util::chain::{chain, Chain}; use crate::io::util::read::{read, Read}; use crate::io::util::read_buf::{read_buf, ReadBuf}; use crate::io::util::read_exact::{read_exact, ReadExact}; use crate::io::util::read_int::{ReadF32, ReadF32Le, ReadF64, ReadF64Le}; use crate::io::util::read_int::{ ReadI128, ReadI...
rust
github
https://github.com/tokio-rs/tokio
tokio/src/io/util/async_read_ext.rs
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import logging import textwrap import portage from portage import os from portage.emaint.modules.logs.logs import CleanLogs from portage.news import count_unread_news, disp...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # 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...
unknown
codeparrot/codeparrot-clean
import pytest from cfme import test_requirements from cfme.cloud.provider import CloudProvider from cfme.common.provider import BaseProvider from cfme.infrastructure.provider.rhevm import RHEVMProvider from cfme.infrastructure.provider.scvmm import SCVMMProvider from cfme.markers.env_markers.provider import providers ...
unknown
codeparrot/codeparrot-clean
#include <c10/core/Scalar.h> #include <c10/core/ScalarType.h> #include <c10/util/Exception.h> #include <c10/util/SmallVector.h> #include <c10/util/typeid.h> #include <cstdint> #define TORCH_ASSERT_ONLY_METHOD_OPERATORS #include <ATen/BlasBackend.h> #include <ATen/Dispatch.h> #include <ATen/ExpandUtils.h> #include <ATen...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/xpu/XPUScaledBlas.cpp
""" Copyright (c) 2013, SMART Technologies ULC 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 fol...
unknown
codeparrot/codeparrot-clean
// Copyright 2020 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 os import ( "internal/poll" "io" "syscall" ) var ( pollCopyFileRange = poll.CopyFileRange pollSplice = poll.Splice ) func (f *File) write...
go
github
https://github.com/golang/go
src/os/zero_copy_linux.go
#![deny(unused_qualifications)] use tests_build::tokio; pub use tokio::runtime; #[tokio::main] async fn main() { if true {} }
rust
github
https://github.com/tokio-rs/tokio
tests-build/tests/pass/use_builder_outer.rs
# # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete ...
unknown
codeparrot/codeparrot-clean
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" callback Function = any(any... arguments); interface TestTreatNonCallableAsNull1 { [TreatNonCallableAsNull] attribute Function? onfoo; attribute Function? onbar; }; """) results = parser.finish() ...
unknown
codeparrot/codeparrot-clean
import type { NextConfig } from "next"; const nextConfig: NextConfig = { cacheComponents: true, }; export default nextConfig;
typescript
github
https://github.com/vercel/next.js
examples/with-supabase/next.config.ts
# Updating OpenAPI spec Change the desired types, then run these commands, with the linked Enterprise repo: ``` go test --tags "pro" -timeout 30s -run ^TestIntegrationOpenAPIs$ github.com/grafana/grafana/pkg/extensions/apiserver/tests -count=1 ``` ``` ./hack/update-codegen.sh scope ``` This should generate a diff i...
unknown
github
https://github.com/grafana/grafana
apps/scope/README.md
#!/usr/bin/python import time, webbrowser from operator import add from SimpleCV import Color, ColorCurve, Kinect, Image, pg, np from SimpleCV.Display import Display d = Display(flags = pg.FULLSCREEN) #create video streams cam = Kinect() #initialize the camera compositeframe = Image((640, 480)) #populate the compos...
unknown
codeparrot/codeparrot-clean
""" Views related to content libraries. A content library is a structure containing XBlocks which can be re-used in the multiple courses. """ from __future__ import absolute_import import json import logging from contentstore.views.item import create_xblock_info from contentstore.utils import reverse_library_url, add...
unknown
codeparrot/codeparrot-clean
import glob import subprocess import unittest from buildscripts.resmokelib.parser import set_run_options from buildscripts.resmokelib.suitesconfig import get_suite class TestFindSuites(unittest.TestCase): def test_find_suites(self): jstests = glob.glob("jstests/core/testing/*.js") resmoke_process ...
python
github
https://github.com/mongodb/mongo
buildscripts/tests/resmoke_validation/test_find_suites.py
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # Author: OpenDrive Ltda # Copyright (c) 2014 Opendrive Ltda # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # cons...
unknown
codeparrot/codeparrot-clean
# sqlite/base.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php r""" .. dialect:: sqlite :name: SQLite .. _sqlite_datetime: Date and Time Types...
unknown
codeparrot/codeparrot-clean
use actix_web::{Responder, HttpResponse, App}; use actix_web_codegen::*; #[get("/config")] async fn config() -> impl Responder { HttpResponse::Ok() } #[actix_web::main] async fn main() { let srv = actix_test::start(|| App::new().service(config)); let request = srv.get("/config"); let response = reque...
rust
github
https://github.com/actix/actix-web
actix-web-codegen/tests/trybuild/simple.rs
import os import time import pytest from ..base import BaseTopazTest class TestKernel(BaseTopazTest): def test_puts_nil(self, space, capfd): space.execute("puts nil") out, err = capfd.readouterr() assert out == "\n" def test_print(self, space, capfd): space.execute("print 1, ...
unknown
codeparrot/codeparrot-clean
package daemon import ( "github.com/moby/moby/v2/daemon/container" ) func (daemon *Daemon) saveAppArmorConfig(container *container.Container) error { return nil }
go
github
https://github.com/moby/moby
daemon/container_windows.go
from typing import List, Dict, Any from data_tools.wrappers.users import is_read_permitted, is_write_permitted, get_all_read_permitted_records from data_tools.db_models import Analysis, Collection, User, db from data_tools.util import AuthException def get_analyses(user: User, filter_by: Dict[str, Any] = None) -> Lis...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2012-11-14 17:09:50 from __future__ import unicode_literals, division, absolute_import import time import logging from collections import deque try: f...
unknown
codeparrot/codeparrot-clean
import sys from unittest import TestCase from django.core.exceptions import ImproperlyConfigured from embed_video.utils import import_by_path class ModuleImportTestCase(TestCase): """ Taken from Django: https://github.com/django/django/blob/master/tests/utils_tests/test_module_loading.py """ de...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python #--------------------------------------------------------------------------- ## Copyright (C) 2010- Alexey Petrov ## Copyright (C) 2009-2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR) ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU ...
unknown
codeparrot/codeparrot-clean
""" Tests the usecols functionality during parsing for all of the parsers defined in parsers.py """ from io import StringIO import pytest from pandas import ( DataFrame, Index, Timestamp, ) import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager to DataFr...
python
github
https://github.com/pandas-dev/pandas
pandas/tests/io/parser/usecols/test_parse_dates.py
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import pack P2P_PREFIX = 'fbc0b6db'.decode('hex') P2P_PORT = 9333 ADDRESS_VERSION = 48 RPC_PORT = 9332 RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue( 'litecoinaddress' in (yiel...
unknown
codeparrot/codeparrot-clean
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ from __future__ import division, absolute_import, print_function __author__ = "Pierre GF Gerard-Marchant" import warnings import pickle i...
unknown
codeparrot/codeparrot-clean
from unittest import mock from django.core.checks import Error from django.db import connections, models from django.test import SimpleTestCase from django.test.utils import isolate_apps def dummy_allow_migrate(db, app_label, **hints): # Prevent checks from being run on the 'other' database, which doesn't have ...
python
github
https://github.com/django/django
tests/invalid_models_tests/test_backend_specific.py
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
unknown
codeparrot/codeparrot-clean
#include <c10/util/Exception.h> #include <gtest/gtest.h> #include <stdexcept> using c10::Error; namespace { template <class Functor> inline void expectThrowsEq(Functor&& functor, const char* expectedMessage) { try { std::forward<Functor>(functor)(); } catch (const Error& e) { EXPECT_STREQ(e.what_without_...
cpp
github
https://github.com/pytorch/pytorch
c10/test/util/exception_test.cpp
# Documentation ## Realm Swift The documentation can be found at [https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/](https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/). The API reference is located at [www.mongodb.com/docs/realm-sdks/swift/latest/](https://www.mongodb.com/docs/realm-sdks/swift/latest/...
unknown
github
https://github.com/realm/realm-swift
docs/README.md
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
unknown
codeparrot/codeparrot-clean
# Copyright 2017 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
#!/usr/bin/env python -t # -*- coding: utf-8 -*- # Copyright (C) 2017 Jonathan Delvaux <pyshell@djoproject.net> # 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 3 of the License...
unknown
codeparrot/codeparrot-clean