code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""Basic tests for os.popen()
Particularly useful for platforms that fake popen.
"""
import unittest
from test import test_support
import os, sys
# Test that command-lines get down as we expect.
# To do this we execute:
# python -c "import sys;print sys.argv" {rest_of_commandline}
# This results in Python being... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
if ActiveRecord::Base.lease_connection.supports_foreign_keys?
module ActiveRecord
class Migration
class ReferencesForeignKeyInCreateTest < ActiveRecord::TestCase
setup do
@connection = ActiveRecord::Base.lease_connection
@con... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/migration/references_foreign_key_test.rb |
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
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 u... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
from gi.repository import Gio, GLib
introspection_xml = '''
<node name='/'>
<interface name='org.bluez.Agent1'>
<method name='Release'/>
<method name='RequestPinCode'>
<arg type='o' name='device' direction='in'/>
<arg type='s' name='pincode' direction='out'/>
</method>
<met... | unknown | codeparrot/codeparrot-clean | ||
# 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/.
import datetime
from socorro.external.postgresql.base import PostgreSQLBase
from socorro.external import MissingArgument... | unknown | codeparrot/codeparrot-clean | ||
# pyXLWriter: A library for generating Excel Spreadsheets
# Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Publi... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: vault/request_forwarding_service.proto
package vault
import (
context "context"
forwarding "github.co... | go | github | https://github.com/hashicorp/vault | vault/request_forwarding_service_grpc.pb.go |
"""Tools for interacting with a SQL database.""" | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/tools/sql_database/__init__.py |
use actix_files::Files;
use actix_web::{
http::StatusCode,
test::{self, TestRequest},
App,
};
#[actix_rt::test]
async fn test_directory_traversal_prevention() {
let srv = test::init_service(App::new().service(Files::new("/", "./tests"))).await;
let req = TestRequest::with_uri("/../../../../../../.... | rust | github | https://github.com/actix/actix-web | actix-files/tests/traversal.rs |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import exceptions
from openerp.osv import osv, fields
from openerp.tools.translate import _
class ir_filters(osv.osv):
_name = 'ir.filters'
_description = 'Filters'
def _list_all_models(self, c... | unknown | codeparrot/codeparrot-clean | ||
config_variables:
- &keyFile jstests/libs/authTestsKey
- &keyFileData Thiskeyisonlyforrunningthesuitewithauthenticationdontuseitinanytestsdirectly
- &authOptions
authenticationDatabase: admin
authenticationMechanism: SCRAM-SHA-256
password: *keyFileData
username: __system
test_kind: js_test
sele... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough_auth.yml |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#include <ngx_config.h>
#include <ngx_core.h>
void
ngx_spinlock(ngx_atomic_t *lock, ngx_atomic_int_t value, ngx_uint_t spin)
{
#if (NGX_HAVE_ATOMIC_OPS)
ngx_uint_t i, n;
for ( ;; ) {
if (*lock == 0 && ngx_atomic_cmp_set(lock, 0, val... | c | github | https://github.com/nginx/nginx | src/core/ngx_spinlock.c |
"""
Archive tools for wheel.
"""
import os
import os.path
import time
import zipfile
from distutils import log
def archive_wheelfile(base_name, base_dir):
"""Archive all files under `base_dir` in a whl file and name it like
`base_name`.
"""
olddir = os.path.abspath(os.curdir)
base_name = os.path.a... | unknown | codeparrot/codeparrot-clean | ||
assert.eq(true, false); | javascript | github | https://github.com/mongodb/mongo | buildscripts/tests/resmoke_end2end/failtestfiles/js_failure.js |
// Copyright 2016 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/lossless_msa.c |
__author__ = 'brendan'
import helper_functions
import os
import tarfile
proj_cwd = os.path.dirname(os.getcwd())
data_dir = proj_cwd + r'/data'
def download_url(url, destination_path, curl_path=r'C:/Users/brendan/Downloads/curl-7.38.0-win64/bin/curl'):
"""
This is a quick and easy function that simulates clic... | unknown | codeparrot/codeparrot-clean | ||
// Generic x86-64 target for bare-metal code - Floating point disabled
//
// Can be used in conjunction with the `target-feature` and
// `target-cpu` compiler flags to opt-in more hardware-specific
// features.
use crate::spec::{
Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelroLevel, RustcAbi, Sanitize... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs |
from typing import Callable, Iterable, List
import os
import numpy as np
from typeguard import check_argument_types
from PIL import Image, ImageFile
from neuralmonkey.logging import warn
ImageFile.LOAD_TRUNCATED_IMAGES = True
def image_reader(pad_w: int,
pad_h: int,
channels: int =... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | unknown | codeparrot/codeparrot-clean | ||
use super::Handle;
use crate::runtime::Dump;
impl Handle {
pub(crate) async fn dump(&self) -> Dump {
let trace_status = &self.shared.trace_status;
// If a dump is in progress, block.
trace_status.start_trace_request(self).await;
let result = loop {
if let Some(result)... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/scheduler/multi_thread/handle/taskdump.rs |
#!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... | unknown | codeparrot/codeparrot-clean | ||
import easygui
import os
if __name__ == '__main__':
# noinspection PyUnresolvedReferences
from cogrecon.core.file_io import match_file_prefixes, find_data_files_in_directory, \
extract_prefixes_from_file_list_via_suffix, get_coordinates_from_file
from cogrecon.core.cogrecon_globals import data_coor... | 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 | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataCollector.java |
<?php
namespace Illuminate\Tests\Cache;
use Illuminate\Cache\ArrayStore;
use Illuminate\Cache\RateLimiter;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Cache\Repository;
use Illuminate\Contracts\Cache\Repository as Cache;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Re... | php | github | https://github.com/laravel/framework | tests/Cache/RateLimiterTest.php |
"""Data Retriever
This module handles the CLI for the Data retriever.
"""
import os
import sys
from retriever.engines import engine_list, choose_engine
from retriever.lib.datasets import datasets, dataset_names, license
from retriever.lib.defaults import sample_script, CITATION, SCRIPT_SEARCH_PATHS, LICENSE
from retr... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011 University of Southern California / ISI
# 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
#
# ... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
import {arrayPush} from 'shared-runtime';
function useFoo({cond, value}) {
let items;
label: {
items = [];
// Mutable range of `items` begins here, but its reactive scope block
// should be aligned to above the label-block
if (cond) break label;
arrayPush(items, value);
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/align-scopes-reactive-scope-overlaps-label.expect.md |
/**
* @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
*/
// Need to be kept in sync with Angular framework
// We can't directly import it from framework now
// because this ... | typescript | github | https://github.com/angular/angular | devtools/projects/ng-devtools-backend/src/lib/component-tree/core-enums.ts |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/st,stmfx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: STMicroelectonics Multi-Function eXpander (STMFX)
description: ST Multi-Function eXpander (STMFX) is a slave controller using I2C ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mfd/st,stmfx.yaml |
# encoding: utf-8
"""
Utilities using Growl on OS X for notifications.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribute... | unknown | codeparrot/codeparrot-clean | ||
import collections
import types
import unittest
from test.support import skip_emscripten_stack_overflow, skip_wasi_stack_overflow, exceeds_recursion_limit
class TestExceptionGroupTypeHierarchy(unittest.TestCase):
def test_exception_group_types(self):
self.assertIsSubclass(ExceptionGroup, Exception)
... | python | github | https://github.com/python/cpython | Lib/test/test_exception_group.py |
# -*- 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 'Repository.is_tracker'
db.add_column(u'repos_repository', 'is_tracker',
... | unknown | codeparrot/codeparrot-clean | ||
#include "swift/Basic/Sandbox.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/StringExtras.h"
#include "llvm/ADT/SmallString.h"
#if defined(__APPLE__)
#include <TargetConditionals.h>
#endif
using namespace swift;
using namespace Sandbox;
#if defined(__APPLE__) && TARGET_OS_OSX
static StringRef sandboxProfile(... | cpp | github | https://github.com/apple/swift | lib/Basic/Sandbox.cpp |
# Copyright 2013 Rackspace Hosting.
#
# 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 | ||
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apac... | unknown | codeparrot/codeparrot-clean | ||
import array
from PyQt5.QtCore import Qt
from PyQt5.QtTest import QTest
from tests.QtTestCase import QtTestCase
from urh import constants
from urh.controller.FuzzingDialogController import FuzzingDialogController
from urh.signalprocessing.Encoding import Encoding
from urh.signalprocessing.Modulator import Modulator
c... | unknown | codeparrot/codeparrot-clean | ||
from unittest import TestCase
from regparser.notice import preamble
from regparser.notice.xml import NoticeXML
from regparser.test_utils.node_accessor import NodeAccessor
from regparser.test_utils.xml_builder import XMLBuilder
class NoticePreambleTests(TestCase):
def test_parse_preamble_integration(self):
... | unknown | codeparrot/codeparrot-clean | ||
import socket
from ceph_deploy.lib import remoto
def get_connection(hostname, username, logger, threads=5, use_sudo=None, detect_sudo=True):
"""
A very simple helper, meant to return a connection
that will know about the need to use sudo.
"""
if username:
hostname = "%s@%s" % (username, hos... | unknown | codeparrot/codeparrot-clean | ||
"""
WSGI config for zulip project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | unknown | codeparrot/codeparrot-clean | ||
from .isa import thumb_isa, ThumbToken
from ..encoding import Relocation
from ...utils.bitfun import align, wrap_negative, BitView
@thumb_isa.register_relocation
class Lit8Relocation(Relocation):
name = "lit8"
token = ThumbToken
def apply(self, sym_value, data, reloc_value):
assert sym_value % 4 =... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
This file is part of Pyew
Copyright (C) 2009, 2010 Joxean Koret
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 la... | unknown | codeparrot/codeparrot-clean | ||
import json
from nose.tools import eq_, ok_, raises, assert_true
from speaklater import make_lazy_string
from . import setup
from .test_basic import CustomModelView, create_models
class Translator:
translate = False
def __call__(self, string):
if self.translate:
return 'Translated: "{0}"... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
import math
import textwrap
import sys
import pytest
import numpy as np
from numpy.testing import assert_, assert_equal
from . import util
class TestF77Callback(util.F2PyTest):
code = """
subroutine t(fun,a)
integer a
cf2py intent(ou... | unknown | codeparrot/codeparrot-clean | ||
apiVersion: v1
kind: Pod
metadata:
name: test-pod
status:
conditions:
- type: example.io/Foo
status: "True"
message: message
reason: reason | unknown | github | https://github.com/kubernetes/kubernetes | hack/testdata/pod-apply-status.yaml |
# Copyright (c) 2012 Citrix Systems, 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 ... | unknown | codeparrot/codeparrot-clean | ||
import os, sys
bindir = os.path.abspath(os.path.dirname(sys.argv[0]))
libdir = bindir + "/../../lib"
sys.path.append(libdir)
import lacuna as lac
###
### This creates two clients. One must be the leader of an alliance, and the
### other should be un-allied.
###
### guild leader
leader_client = lac.clients.Member(
... | 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 applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tests/stateful_random_ops_test.py |
#!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015-2016, Hewlett Packard Enterprise Development Company LP
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/async/es2017/awaitBinaryExpression/awaitBinaryExpression1_es2017.ts] ////
//// [awaitBinaryExpression1_es2017.ts]
declare var a: boolean;
declare var p: Promise<boolean>;
declare function before(): void;
declare function after(): void;
async function func(): Promise<void> {
before();
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitBinaryExpression1_es2017.js |
<div ngAccordionGroup class="basic-accordion">
<h3>
<span ngAccordionTrigger panelId="q1" #trigger1="ngAccordionTrigger" [expanded]="true">
Which attribute tells assistive tech whether the panel is open or closed?
<span
aria-hidden="true"
class="expand-icon"
[class.expand-icon_... | html | github | https://github.com/angular/angular | adev/src/content/examples/aria/accordion/src/multi-expansion/basic/app/app.html |
"""
Management for multiprocessing in varial.
WorkerPool creates child processes that do not daemonize. Therefore they can
spawn further children, which is handy to parallelize at many levels (e.g. run
parallel tools at every level of a complex directory structure). Nevertheless,
only a given number of workers runs at... | unknown | codeparrot/codeparrot-clean | ||
import time
import pytest
import re
import logging
from datetime import datetime
from collections import Counter, namedtuple
from re import findall, compile
from uuid import UUID, uuid1
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from cassandra.metadata import Murmur3Token
from ... | unknown | codeparrot/codeparrot-clean | ||
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobile... | unknown | codeparrot/codeparrot-clean | ||
import {retryNetwork} from "../helpers/retry.js";
describe('FormData', function() {
it('should allow FormData posting', async () => {
await retryNetwork(() => {
return axios.postForm(TEST_SERVER_URL, {
a: 'foo',
b: 'bar'
}).then(({data}) => {
expect(data.form).toEqual({
... | javascript | github | https://github.com/axios/axios | test/specs/formdata.spec.js |
import { getPreviewPostBySlug } from "../../lib/umbraco-heartcore";
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.UMBRACO_PREVIEW_SECRET ||
!req.query.slug
... | javascript | github | https://github.com/vercel/next.js | examples/cms-umbraco-heartcore/pages/api/preview.js |
import * as $ from 'svelte/internal/client';
import { fastest_test } from '../../utils.js';
export function busy() {
let a = 0;
for (let i = 0; i < 1_00; i++) {
a++;
}
}
/**
*
* @param {string} label
* @param {() => { run: (i?: number) => void, destroy: () => void }} setup
*/
export function create_test(labe... | javascript | github | https://github.com/sveltejs/svelte | benchmarking/benchmarks/reactivity/util.js |
"""The tests for the Light component."""
import pytest
import voluptuous as vol
from homeassistant import core
from homeassistant.components import light
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_PLATFORM,
ENTITY_MATCH_ALL,
SERVICE_TOGGLE,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STA... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
# pycomp.py
# Python 2 and Python 3 compatibility module
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
... | unknown | codeparrot/codeparrot-clean | ||
from unittest import skipUnless
from django import VERSION
from django.db import connection
from django.test import TestCase, TransactionTestCase
from django.db import IntegrityError
from versions_tests.models import ChainStore, Color
from versions.util.postgresql import get_uuid_like_indexes_on_table
AT_LEAST_17 = VE... | unknown | codeparrot/codeparrot-clean | ||
"""Zwave workarounds."""
from . import const
# Manufacturers
FIBARO = 0x010f
GE = 0x0063
PHILIO = 0x013c
SOMFY = 0x0047
WENZHOU = 0x0118
VIZIA = 0x001D
# Product IDs
GE_FAN_CONTROLLER_12730 = 0x3034
GE_FAN_CONTROLLER_14287 = 0x3131
JASCO_FAN_CONTROLLER_14314 = 0x3138
PHILIO_SLIM_SENSOR = 0x0002
PHILIO_3_IN_1_SENSOR_G... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# websrv.py
#
# Copyright 2015 Hartland PC LLC
#
# This file is part of the open source version of CCE 4.0.
#
# This package 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 ... | 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 | connect/mirror-client/src/test/java/org/apache/kafka/connect/mirror/SourceAndTargetTest.java |
# Copyright (C) 2014, Red Hat, 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... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 a... | 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 | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA ... | unknown | codeparrot/codeparrot-clean | ||
"""
Simulation of a rotating 3D Cube
Developed by Leonel Machava <leonelmachava@gmail.com>
http://codeNtronix.com
"""
import sys, math, pygame
from operator import itemgetter
import sys
import os.path
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from quad.motor import calculate_dc_for_motor
clas... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 - 2015 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import re
import shutil
import subprocess
import sys
import os
import fnmatch
HTML_INPUT_DIR = sys.argv[1]
BUILD_DIR = sys.argv[2]
OUTPUT_DIR = sys.argv[3]
# For some reason the handlebars executable name is passed via the
# TC_HANDLEBARS_EXE environment variable.
HANDLEBARS_EXE = os.environ['TC_HA... | unknown | codeparrot/codeparrot-clean | ||
"""
The ``Parser`` tries to convert the available Python code in an easy to read
format, something like an abstract syntax tree. The classes who represent this
tree, are sitting in the :mod:`jedi.parser.tree` module.
The Python module ``tokenize`` is a very important part in the ``Parser``,
because it splits the code ... | unknown | codeparrot/codeparrot-clean | ||
test_kind: js_test
selector:
roots:
- jstests/aggregation/**/*.js
exclude_files:
- jstests/aggregation/extras/*.js
- jstests/aggregation/data/*.js
executor:
archive:
hooks:
- ValidateCollections
config:
shell_options:
eval: await import("jstests/libs/override_methods/detect_spa... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/aggregation.yml |
"""
File : receiver.py
Author : ian
Created : 15-08-2017
Last Modified By : ian
Last Modified On : 15-08-2017
***********************************************************************
The MIT License (MIT)
Copyright 2017 Ian Cooper <ian_hammond_cooper@yahoo.co.uk>
Permission is hereby gr... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.views import generic
from django.shortcuts import get_object_or_404, redirect
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from . import forms
from . import models
class ShowProfile(LoginRequiredMixin, generic.Template... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2014 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 issue9026
// This file appears in its own package since the assertion tests the
// per-package counter used to create fresh identifiers.
/*
typedef st... | go | github | https://github.com/golang/go | src/cmd/cgo/internal/test/issue9026/issue9026.go |
# 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 | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#from http://www.bagley.org/~doug/shootout/bench/lists/lists.ruby
NUM = 300
SIZE = 10000
def test_lists()
# create a list of integers (Li1) from 1 to SIZE
li1 = (1..SIZE).to_a
# copy the list to li2 (not by individual items)
li2 = li1.dup
# remove each individual item from left side of li2 and
# append to... | ruby | github | https://github.com/ruby/ruby | benchmark/so_lists.rb |
"""Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | unknown | codeparrot/codeparrot-clean | ||
/** @import { SSRContext } from '#server' */
/** @import { Renderer } from './internal/server/renderer.js' */
import { ssr_context } from './internal/server/context.js';
import { noop } from './internal/shared/utils.js';
import * as e from './internal/server/errors.js';
/** @param {() => void} fn */
export function on... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/index-server.js |
//// [tests/cases/compiler/anyIsAssignableToVoid.ts] ////
//// [anyIsAssignableToVoid.ts]
interface P {
p: void;
}
interface Q extends P { // check assignability here. any is assignable to void.
p: any;
}
//// [anyIsAssignableToVoid.js]
"use strict"; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/anyIsAssignableToVoid.js |
from django.conf import settings
from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.gdal import OGRGeomType
from django.contrib.gis.db import models
class GeoModelAdmin(ModelAdmin):
"""
The administration options class for Geographi... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import sys
import inspect
from robot.running.handlers import _PythonHandler, _JavaHandler, DynamicHandler
from robot import utils
from robot.utils.asserts import *
from robot.running.testlibraries import TestLibrary
from robot.running.dynamicmethods import (
GetKeywordArguments, GetKeywordDocumenta... | 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 applica... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/remove_init_variable_v1.py |
#
# CanvasRenderAgg.py -- for rendering into Ginga widget with aggdraw
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import math
from itertools import chain
import numpy as np
import aggdraw as agg
from . import AggHelp
from ginga.canvas import render
#... | unknown | codeparrot/codeparrot-clean | ||
# 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, software
# d... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
"""
import fnmatch
import logging
import os
import re
from . import DistlibEx... | unknown | codeparrot/codeparrot-clean | ||
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | unknown | codeparrot/codeparrot-clean | ||
# inferMutationAliasingEffects
## File
`src/Inference/InferMutationAliasingEffects.ts`
## Purpose
Infers the mutation and aliasing effects for all instructions and terminals in the HIR, making the effects of built-in instructions/functions as well as user-defined functions explicit. These effects form the basis for s... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/docs/passes/08-inferMutationAliasingEffects.md |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import threading
import multiprocessing
import datetime
import time
class WriteFileWorker(multiprocessing.Process):
def __init__(self, queue, name=None):
super(WriteFileWorker, self).__init__(name=name)
self.daemon... | unknown | codeparrot/codeparrot-clean | ||
#### Note: this error code is no longer emitted by the compiler.
The `pub` keyword was used inside a function.
Erroneous code example:
```
fn foo() {
pub struct Bar; // error: visibility has no effect inside functions
}
```
Since we cannot access items defined inside a function, the visibility of its
items does... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0447.md |
/*
* Builtin "git merge"
*
* Copyright (c) 2008 Miklos Vajna <vmiklos@frugalware.org>
*
* Based on git-merge.sh by Junio C Hamano.
*/
#define USE_THE_REPOSITORY_VARIABLE
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
#include "config.h"
#include "editor.h"
#... | c | github | https://github.com/git/git | builtin/merge.c |
from flask import render_template, request
import lib.es as es
import web.util.tools as tools
def get(p):
# load task
task_id = p['nav'][-1]
p['task'] = es.get(p['host'], 'core_task', 'task', task_id)
if not p['task']:
return tools.alert('task not found - {}'.format(task_id))
if request.me... | unknown | codeparrot/codeparrot-clean | ||
"""MsgTypes module: contains distributed object message types"""
from direct.showbase.PythonUtil import invertDictLossless
MsgName2Id = {
# 2 new params: passwd, char bool 0/1 1 = new account
# 2 new return values: 129 = not found, 12 = bad passwd,
'CLIENT_LOGIN': 1,
'... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2015-2021 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from dolfin import *
from rbnics import *
from problems import *
from reduction_methods import *
@PullBackFormsToReferenceDomain()
@ShapeParametrization(
("x[0]", "x[1]"), # subdomain 1... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/EmptyTensor.h>
#include <ATen/Formatting.h>
#include <ATen/core/ATenGeneral.h>
#include <ATen/core/Generator.h>
#include <c10/core/ScalarType.h>
#include <c10/core/StorageImpl.h>
#include <c10/core/UndefinedTensorImpl.h>
#include <c10/util/ArrayRef.h>
#include <c10/util/Exception.h>
#includ... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/Utils.h |
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.descriptors.symbols.pointers
import org.jetbrains.kotlin.analysis.a... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/symbols/pointers/KaFe10DescSamConstructorSymbolPointer.kt |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.