code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/ti,nspire-misc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TI Nspire MISC hardware block
maintainers:
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mfd/ti,nspire-misc.yaml |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @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 {
ColorValue,
copyParsedValue,
CssPropertyValue,
NumericValue,
TransformValue,
} from '../parser';
... | typescript | github | https://github.com/angular/angular | adev/src/app/features/home/animation/calculations/calc-css-value.ts |
# -*- 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 | ||
"""
Useful auxiliary data structures for query construction. Not useful outside
the SQL domain.
"""
from django.core.exceptions import FullResultSet
from django.db.models.sql.constants import INNER, LOUTER
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
mult... | python | github | https://github.com/django/django | django/db/models/sql/datastructures.py |
#! /usr/bin/env python
# file fen2ascii.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# author Kayvan A. Sylvan
# Full author contact details are available in file CREDITS.
# This script will convert a chess position in the FEN
# format to an ascii repres... | unknown | codeparrot/codeparrot-clean | ||
#include <c10/util/string_view.h>
#include <gmock/gmock.h>
// NOLINTBEGIN(modernize*, readability*, bugprone-string-constructor)
using string_view = c10::c10_string_view;
namespace {
namespace testutils {
constexpr bool string_equal(const char* lhs, const char* rhs, size_t size) {
return (size == 0) ? true
... | cpp | github | https://github.com/pytorch/pytorch | c10/test/util/string_view_test.cpp |
#!/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 distributed... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | ||
from tower import ugettext_lazy as _
class DEVICE_DESKTOP(object):
id = 1
name = _(u'Desktop')
class_name = 'desktop'
api_name = 'desktop'
class DEVICE_MOBILE(object):
id = 2
name = _(u'Firefox Mobile')
class_name = 'android-mobile'
api_name = 'android-mobile'
class DEVICE_TABLET(obje... | unknown | codeparrot/codeparrot-clean | ||
/************************************************
sockssocket.c -
created at: Thu Mar 31 12:21:29 JST 1994
Copyright (C) 1993-2007 Yukihiro Matsumoto
************************************************/
#include "rubysocket.h"
#ifdef SOCKS
/*
* call-seq:
* SOCKSSocket.new(host, port) => socket
*
* Opens ... | c | github | https://github.com/ruby/ruby | ext/socket/sockssocket.c |
# Copyright (c) 2012, the Mozilla Foundation. All rights reserved.
# Use of this source code is governed by the Simplified BSD License which can
# be found in the LICENSE file.
import ctypes
from ctypes import POINTER, WinError, sizeof, byref
from ctypes.wintypes import DWORD, HANDLE, BOOL
LPDWORD = POINTER(DWORD)
G... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Plea... | unknown | codeparrot/codeparrot-clean | ||
- name: Foo
- name: Bar | unknown | github | https://github.com/rails/rails | activerecord/test/fixtures/1_need_quoting.yml |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012 CERN.
#
# Invenio 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... | unknown | codeparrot/codeparrot-clean | ||
import errno
import logging
import multiprocessing
import os
import socket
import string
import subprocess
import sys
import time
import unittest
from waitress import server
from waitress.compat import (
httplib,
tobytes
)
from waitress.utilities import cleanup_unix_socket
dn = os.path.dirname
here = dn(__file... | 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 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | java | github | https://github.com/tensorflow/tensorflow | tensorflow/java/src/test/java/org/tensorflow/GraphOperationBuilderTest.java |
#!/usr/local/bin/python
# coding: utf-8
import ConfigParser
from sensors import *
from actors import *
class Room:
name = "Room-with-no-name"
insideSensor = None
outsideSensor = None
actor = None
minInsideTemp = 0.0
minHumidDiff = 0.0
ventilationDuration = 0.0
ventilationQuietTime = 0.... | unknown | codeparrot/codeparrot-clean | ||
import time, re, datetime
from common.steps import service_created_precond,device_with_endpoint_created_precond,check_status_info
from lettuce import step, world
from iotqautils.cb_utils import CBUtils
from common.gw_mqtt_commands import mqtt_command
from threading import Thread
from common.gw_configuration import IOT_... | unknown | codeparrot/codeparrot-clean | ||
## NumPy
Copyright (c) 2005-2017, NumPy Developers.
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 a... | unknown | github | https://github.com/numpy/numpy | numpy/random/src/distributions/LICENSE.md |
# Copyright 2020 Google LLC.
#
# 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, ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import sys
import openai
from .. import OpenAI, _load_client
from .._compat import model_json
from .._models import BaseModel
class Colors:
HEADER = "\033[95m"
OKBLUE = "\033[94m"
OKGREEN = "\033[92m"
WARNING = "\033[93m"
FAIL = "\033[91m"
ENDC = "\033[0m"
... | python | github | https://github.com/openai/openai-python | src/openai/cli/_utils.py |
# -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017-2018 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_func... | unknown | codeparrot/codeparrot-clean | ||
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts"]
} | json | github | https://github.com/angular/angular | dev-app/tsconfig.app.json |
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/MachO/SymbolCommand.cpp |
/*
* 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.psiBased
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/psiBased/KaFe10PsiTypeParameterSymbol.kt |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.AddField("Author", "rating", models.IntegerField(default=0)),
migrations.CreateModel(
"Book",... | python | github | https://github.com/django/django | tests/migrations/test_migrations_fake_split_initial/0002_second.py |
set enable_seqscan=off;
CREATE TABLE test_timestamp (
i timestamp
);
INSERT INTO test_timestamp VALUES
( '2004-10-26 03:55:08' ),
( '2004-10-26 04:55:08' ),
( '2004-10-26 05:55:08' ),
( '2004-10-26 08:55:08' ),
( '2004-10-27 09:55:08' ),
( '2004-10-27 10:55:08' )
;
CREATE INDEX idx_timestamp ON test_timestamp... | sql | github | https://github.com/postgres/postgres | contrib/btree_gin/sql/timestamp.sql |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from .. import NextGenInstanceResource, NextGenListResource
from .statistics import Statistics
class Workflow(NextGenInstanceResource):
"""
A Workflow resource.
See the `TaskRouter API reference
<https://www.twilio.com/docs/taskrouter/workflows>_`
for more information.
.. attribute:: sid
... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* 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 req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/ELF/hash.hpp |
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/jmx/export/MBeanExporterListener.java |
import rope.base.ast
import rope.base.oi.soi
import rope.base.pynames
from rope.base import pyobjects, evaluate, astutils, arguments
def analyze_module(pycore, pymodule, should_analyze,
search_subscopes, followed_calls):
"""Analyze `pymodule` for static object inference
Analyzes scopes for ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-02 06:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0024_radiography'),
]
operations = [
migrations.RenameField(
... | unknown | codeparrot/codeparrot-clean | ||
"""
Expose each GPU device directly
"""
from __future__ import print_function, absolute_import, division
import functools
from numba import servicelib
from .driver import hsa as driver, Context as _Context
class _culist(object):
"""A thread local list of GPU instances
"""
def __init__(self):
self.... | unknown | codeparrot/codeparrot-clean | ||
"""Computational algebraic field theory. """
from __future__ import print_function, division
from sympy import (
S, Rational, AlgebraicNumber,
Add, Mul, sympify, Dummy, expand_mul, I, pi
)
from sympy.functions.elementary.exponential import exp
from sympy.functions.elementary.trigonometric import cos, sin
fr... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage.configuration;
import static org.mockito.Mockito.mock;
import java.util.concurrent.Callable;
import org.junit.Test;
import org.mockito.internal.configuration.ConfigurationA... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockitousage/configuration/ClassCacheVersusClassReloadingTest.java |
import crypto from 'crypto';
import URLSearchParams from './classes/URLSearchParams.js'
import FormData from './classes/FormData.js'
const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
const DIGIT = '0123456789';
const ALPHABET = {
DIGIT,
ALPHA,
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
}
const generateString =... | javascript | github | https://github.com/axios/axios | lib/platform/node/index.js |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-08-19 13:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
def generate_region_settings(apps, schema_editor):
Region = apps.get_model('street_agitation_bot', 'Region')
RegionSettings... | 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... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/utils/test_operator_helpers.py |
#!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# 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': ['p... | unknown | codeparrot/codeparrot-clean | ||
it("should not bundle context requires with asyncMode === 'weak'", function() {
var contextRequire = require.context(".", false, /two/, "weak");
expect(function() {
contextRequire("./two")
}).toThrow(/not available/);
});
it("should not bundle context requires with asyncMode === 'weak' using import.meta.webpackCo... | javascript | github | https://github.com/webpack/webpack | test/cases/chunks/context-weak/index.js |
#royale simulation.py 版本4,最新版本
#增加了捕食者的子类,进化类,拥有更强属性,程序模拟观察后,属性值较差的捕食者被自然法则淘汰,捕食者逐步而漫长进化,这个简单模拟器可以辅助证明达尔文适者生存法则。
import random,pylab
class Island():
"""Island,n*n grid where zero value indicates an unoccupied cell."""
#生成一个n排,n列的点矩阵,矩阵是笛卡尔坐标系,x向右递增,y向上递增,(0,0)是左下角,(9,0)是右下角
#(0,9)是左上角,(9,9)是右上角
#程序输出顺... | unknown | codeparrot/codeparrot-clean | ||
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level
// directory of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2025, Institute of Software, Chinese Academy of Sciences.
#ifndef OPENCV_RVV_HAL_TYPES_HPP
#define OPENCV_R... | unknown | github | https://github.com/opencv/opencv | hal/riscv-rvv/include/types.hpp |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from ..._models import BaseModel
__all__ = ["LocalSkill"]
class LocalSkill(BaseModel):
description: str
"""The description of the skill."""
name: str
"""The name of the skill."""
path: str
"""The path to t... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/local_skill.py |
import urllib
import sys
import os
import re
import mimetypes
import warnings
from copy import copy
from urlparse import urlparse, urlsplit
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.contrib.auth import authenticate, login
... | unknown | codeparrot/codeparrot-clean | ||
"""
Python environments and packages
================================
This module provides high-level tools for using Python `virtual environments`_
and installing Python packages using the `pip`_ installer.
.. _virtual environments: http://www.virtualenv.org/
.. _pip: http://www.pip-installer.org/
"""
from fabtool... | unknown | codeparrot/codeparrot-clean | ||
@import url('https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined');
:host {
display: flex;
justify-content: center;
font-family: var(--inter-font);
--border-color: color-mix(in srgb, var(--full-contrast) 20%, var(--page-background));
}
[ngMenuBar] {
display: flex;
gap: 0.25rem;
padding: 0... | css | github | https://github.com/angular/angular | adev/src/content/examples/aria/menubar/src/basic/material/app/app.css |
# Copyright 2010 Google Inc.
# All rights reserved.
#
# 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, merg... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | benchmarks/src/main/java/org/elasticsearch/benchmark/exponentialhistogram/ExponentialHistogramGenerationBench.java |
"""
General Utility helpers for CLI tasks.
"""
import logging
import os
import shlex
import subprocess
import sys
from contextlib import contextmanager
from pathlib import Path
from typing import Optional
logger = logging.getLogger(__name__)
def run_command(
cmd: str,
use_shell: bool = False,
log_cmd: bo... | python | github | https://github.com/pytorch/pytorch | .ci/lumen_cli/cli/lib/common/utils.py |
// Test passing security token with op messages.
// @tags: [requires_replication, requires_sharding]
import {runCommandWithSecurityToken} from "jstests/libs/multitenancy_utils.js";
import {ReplSetTest} from "jstests/libs/replsettest.js";
const tenantID = ObjectId();
const kLogLevelForToken = 5;
const kAcceptedSecurit... | javascript | github | https://github.com/mongodb/mongo | jstests/auth/security_token.js |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import spirit.core.utils.models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('spirit_category', '0001_initial'),
migra... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | unknown | codeparrot/codeparrot-clean | ||
from rest_framework import status
from rest_framework.test import APITestCase
from liberator.factories import *
class TestIssue(APITestCase):
def setUp(self):
super(TestIssue, self).setUp()
self.admin = AdminFactory()
self.admin.save()
self.client.force_authenticate(user=self.admin... | unknown | codeparrot/codeparrot-clean | ||
from tests.unit import AWSMockServiceTestCase
from boto.ec2.connection import EC2Connection
from boto.ec2.reservedinstance import ReservedInstance
class TestReservedInstancesSet(AWSMockServiceTestCase):
connection_class = EC2Connection
def default_body(self):
return b"""
<reservedInstancesSet>
<it... | unknown | codeparrot/codeparrot-clean | ||
{
"compilerOptions": {
"baseUrl": ".",
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"module": "ESNext",
"moduleResolution": "Node",
"reso... | json | github | https://github.com/remix-run/react-router | examples/auth-router-provider/tsconfig.json |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.test import TestCase
from file import download_file, unzip_file
from process import ProcessException
class FileTest(TestCase):
def test_download_file_success(self):
file = 'Conferences.zip'
first = download_file(path='https://academicgraph.blo... | unknown | codeparrot/codeparrot-clean | ||
// (C) Copyright David Abrahams 2001.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPE_DWA20010120_HPP
# define BOOST_TYPE_DWA20010120_HPP
namespace boost {
// Just a simple "type envelope"... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/type.hpp |
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hsb",[],function(){var n=["znamješko","znamješce","znamješka","znamješkow"],e=["zapisk","zapiskaj","zapiski","z... | javascript | github | https://github.com/django/django | django/contrib/admin/static/admin/js/vendor/select2/i18n/hsb.js |
#!/usr/bin/python
# This script generates a list of testsuites that should be run as part of
# the Samba 4 test suite.
# The output of this script is parsed by selftest.pl, which then decides
# which of the tests to actually run. It will, for example, skip all tests
# listed in selftest/skip or only run a subset durin... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want wi... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2011 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 sort_test
import (
"fmt"
"sort"
)
type Grams int
func (g Grams) String() string { return fmt.Sprintf("%dg", int(g)) }
type Organ struct {
Name ... | go | github | https://github.com/golang/go | src/sort/example_wrapper_test.go |
# Helpers shared by the test scripts for diff algorithms (patience,
# histogram, etc).
test_diff_frobnitz() {
cat >file1 <<\EOF
#include <stdio.h>
// Frobs foo heartily
int frobnitz(int foo)
{
int i;
for(i = 0; i < 10; i++)
{
printf("Your answer is: ");
printf("%d\n", foo);
}
}
int f... | unknown | github | https://github.com/git/git | t/lib-diff-alternative.sh |
# Copyright 2015 Catalyst IT Ltd.
#
# 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 | ||
s3gis_tests = load_module("tests.unit_tests.modules.s3.s3gis")
test_utils = local_import("test_utils")
def test_FeatureQueries():
actual_output = str(
s3base.GIS().show_map(
projection = 900913,
feature_queries = [
Storage(
name = "test_feature_qu... | unknown | codeparrot/codeparrot-clean | ||
"""
Test split modulestore w/o using any django stuff.
"""
from mock import patch
import datetime
from importlib import import_module
from path import path
import random
import re
import unittest
import uuid
from contracts import contract
from nose.plugins.attrib import attr
from django.core.cache import get_cache... | unknown | codeparrot/codeparrot-clean | ||
import socket, ssl, json, time
from threading import Timer
from src.utils import settings
from src.utils import logger
from src.utils import certificate
from src.utils import RepeatTimer
class NetworkSender():
def __init__(self, ipAddress, port, cert_server_name, status_time = 30):
self._server_address... | unknown | codeparrot/codeparrot-clean | ||
base_suite: replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough
overrides:
- "bulk_write.kill_stepdown_hooks"
eval:
- "bulk_write.single_op_override"
excludes:
- "bulk_write.single_op_core_excluded_files" | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/bulk_write_replica_sets_multi_stmt_txn_kill_stepdown_terminate_jscore_passthrough.yml |
/**
* 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... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestChecksumFs.java |
from __future__ import absolute_import
from mock import Mock
from sentry.api.bases.team import TeamPermission
from sentry.models import ApiKey, OrganizationMemberType, ProjectKey
from sentry.testutils import TestCase
class TeamPermissionBase(TestCase):
def setUp(self):
self.org = self.create_organization... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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 | ||
#!/usr/bin/env python
"""
Artificial Intelligence for Humans
Volume 1: Fundamental Algorithms
Python Version
http://www.aifh.org
http://www.jeffheaton.com
Code repository:
https://github.com/jeffheaton/aifh
Copyright 2013 by Jeff Heaton
Licensed under the Apache License, Version 2... | unknown | codeparrot/codeparrot-clean | ||
##
# Copyright 2012-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | unknown | codeparrot/codeparrot-clean | ||
"""
Airspeed Velocity benchmark utilities
"""
from __future__ import division, absolute_import, print_function
import sys
import re
import time
import textwrap
import subprocess
class Benchmark(object):
"""
Base class with sensible options
"""
goal_time = 0.25
def run_monitored(code):
"""
Run... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2000-2004 Michael Hudson-Doyle <micahel@gmail.com>
#
# All Rights Reserved
#
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and
#... | python | github | https://github.com/python/cpython | Lib/_pyrepl/input.py |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis as vv
def axis(command, axes=None):
""" axis(command, axes=None)
Convenience function to set axis properties. Note that... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | 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 | ||
from decimal import Decimal
from django.db.models import DecimalField
from django.db.models.functions import Sign
from django.test import TestCase
from django.test.utils import register_lookup
from ..models import DecimalModel, FloatModel, IntegerModel
class SignTests(TestCase):
def test_null(self):
Inte... | python | github | https://github.com/django/django | tests/db_functions/math/test_sign.py |
# -*- coding: utf-8 -*-
"""
Integration tests for submitting problem responses and getting grades.
"""
import json
import os
from textwrap import dedent
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# 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 | ||
# 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 | ||
import os
import re
import stat
import mimetypes
from collections import OrderedDict
from functools import partial, lru_cache
from email.utils import parsedate_tz, mktime_tz
from pulsar.utils.httpurl import CacheControl
from pulsar.utils.slugify import slugify
from pulsar.utils.security import digest
from pulsar.util... | 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 | spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java |
# Copyright 2011 Grid Dynamics
# 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... | unknown | codeparrot/codeparrot-clean | ||
import kotlinx.coroutines.CoroutineExceptionHandler;
import kotlinx.coroutines.internal.MainDispatcherFactory;
import kotlinx.coroutines.test.internal.ExceptionCollectorAsService;
import kotlinx.coroutines.test.internal.TestMainDispatcherFactory;
module kotlinx.coroutines.test {
requires kotlin.stdlib;
require... | java | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-test/jvm/src/module-info.java |
import datetime
import pytest
from mock import patch
from treeherder.seta.models import JobPriority
from treeherder.seta.runnable_jobs import RunnableJobsClient
from treeherder.seta.update_job_priority import (_initialize_values,
_sanitize_data,
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
//go:build !enterprise
package managed_key
import (
"context"
"crypto"
"errors"
"io"
"github.com/hashicorp/vault/sdk/helper/certutil"
)
var errEntOnly = errors.New("managed keys are supported within enterprise edition only")
func GetPubli... | go | github | https://github.com/hashicorp/vault | builtin/logical/pki/managed_key/managed_key_util_oss.go |
#
# Copyright 2016-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | unknown | codeparrot/codeparrot-clean | ||
from functools import partial
import os
import tempfile
import unittest
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage as storage
from nose.tools import eq_
from amo.storage_utils import (walk_storage, copy_stored_file,
move_stored_... | unknown | codeparrot/codeparrot-clean | ||
import sys
from collections import OrderedDict
from django.contrib.admin import FieldListFilter
from django.contrib.admin.exceptions import (
DisallowedModelAdminLookup, DisallowedModelAdminToField,
)
from django.contrib.admin.options import (
IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters,
)
from djang... | unknown | codeparrot/codeparrot-clean | ||
#--------------------------------------------------------------------------
# Scrapy Settings
#--------------------------------------------------------------------------
BOT_NAME = 'scrapy_spider'
SPIDER_MODULES = ['frontera.tests.scrapy_spider.spiders']
NEWSPIDER_MODULE = 'frontera.tests.scrapy_spider.spiders'
HTTPC... | unknown | codeparrot/codeparrot-clean | ||
# devices/lib.py
#
# Copyright (C) 2009-2014 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.
# This program is distributed in th... | unknown | codeparrot/codeparrot-clean | ||
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily | unknown | github | https://github.com/remix-run/react-router | .github/dependabot.yml |
/*
* 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-maven-plugin/src/dockerTest/projects/build-image-multi-module/library/src/main/java/org/test/SampleLibrary.java |
#
# XML-RPC CLIENT LIBRARY
# $Id$
#
# an XML-RPC client interface for Python.
#
# the marshalling and response parser code can also be used to
# implement XML-RPC servers.
#
# Notes:
# this version is designed to work with Python 2.1 or newer.
#
# History:
# 1999-01-14 fl Created
# 1999-01-15 fl Changed dateTime to u... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* ChaCha20-Poly1305 AEAD, RFC7539
*
* Copyright (C) 2015 Martin Willi
*/
#include <crypto/internal/aead.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
#include <crypto/scatterwalk.h>
#include <crypto/chacha.h>
#include <crypto/poly1305.h>
... | c | github | https://github.com/torvalds/linux | crypto/chacha20poly1305.c |
//// [tests/cases/conformance/async/es5/asyncInterface_es5.ts] ////
//// [asyncInterface_es5.ts]
async interface I {
}
//// [asyncInterface_es5.js]
"use strict"; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncInterface_es5(target=es5).js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.