code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# 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
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
unknown
codeparrot/codeparrot-clean
# intentionally stop execution of the play before reaching the include below # if the include is static as expected it will trigger a syntax error # however, if the include is dynamic a syntax error will not occur - name: EXPECTED SUCCESS fail: msg: This task should never execute. The playbook should ...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/include_when_parent_is_static/tasks.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 may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/BrokerJwtValidatorTest.java
#include "pyconfig.h" // Py_GIL_DISABLED #ifndef Py_GIL_DISABLED // Need limited C API 3.14 to test PyLong_AsInt64() # define Py_LIMITED_API 0x030e0000 #endif #include "parts.h" #include "util.h" #include "clinic/long.c.h" /*[clinic input] module _testlimitedcapi [clinic start generated code]*/ /*[clinic end ge...
c
github
https://github.com/python/cpython
Modules/_testlimitedcapi/long.c
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
unknown
codeparrot/codeparrot-clean
import ldap, unittest import slapd from ldap.ldapobject import LDAPObject server = None class TestSearch(unittest.TestCase): def setUp(self): global server if server is None: server = slapd.Slapd() server.start() base = server.get_dn_suffix() # in...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2013 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality o...
unknown
codeparrot/codeparrot-clean
# -*- encoding:utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import unittest from mysqlparse.grammar.create_table import create_table_syntax class CreateTableSyntaxTest(unittest.TestCase): def test_create_table(self): statement = create_table_syntax.parseSt...
unknown
codeparrot/codeparrot-clean
import logging from django.conf import settings from django.db import models from geoserver.catalog import FailedRequestError, Catalog from geonode.base.models import ResourceBase from geonode.services.enumerations import SERVICE_TYPES, SERVICE_METHODS, GXP_PTYPES from geonode.layers.models import Layer from django.ut...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # Copyright (c) 2017 Alibaba Group Holding Limited. He Guimin <heguimin36@163.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of ...
unknown
codeparrot/codeparrot-clean
########################################################## # THIS IS A GENERATED FILE -- DO NOT MODIFY. # IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE # AND REGENERATE THE MATRIX SUITES. # # matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/replica_sets...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/matrix_suites/generated_suites/replica_sets_ese.yml
# -*- 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
# Generated by Django 2.2 on 2019-05-03 14:05 import civil_registry.models from django.db import migrations, models import libya_elections.libya_bread class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Citizen', ...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2019 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.osgitest.testbundle; import org.junit.Test; import static org.mockito.Mockito.mock; public class MockNonPublicClassTest { static class NonPublicClass {} @Test publ...
java
github
https://github.com/mockito/mockito
mockito-integration-tests/osgi-tests/src/testBundle/java/org/mockito/osgitest/testbundle/MockNonPublicClassTest.java
import os from django.template import Context, Engine, TemplateDoesNotExist from django.test import SimpleTestCase from .utils import ROOT RECURSIVE = os.path.join(ROOT, 'recursive_templates') class ExtendsBehaviorTests(SimpleTestCase): def test_normal_extend(self): engine = Engine(dirs=[os.path.join(R...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 #clean up function def cleanup(): shutil.rmtree( "output", ignore_errors=True ) shutil.rmtree( "work", ignore_errors=True) try: os.remove("f0_merged.fq") os.remove("derepAllRawSeqs.uc") os.remove("lineage.fa") except: pass #test imports (it's a bit silly to include builtins in this ...
unknown
codeparrot/codeparrot-clean
//===--- BucketSort.swift -------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift
github
https://github.com/apple/swift
benchmark/single-source/BucketSort.swift
import os from enigma import eConsoleAppContainer from Components.Harddisk import harddiskmanager opkgDestinations = [] opkgStatusPath = '' def opkgExtraDestinations(): global opkgDestinations return ''.join([" --add-dest %s:%s" % (i,i) for i in opkgDestinations]) def opkgAddDestination(mountpoint): global opkgDe...
unknown
codeparrot/codeparrot-clean
# Copyright 2011 Google Inc. All Rights Reserved. """Locked file interface that should work on Unix and Windows pythons. This module first tries to use fcntl locking to ensure serialized access to a file, then falls back on a lock file if that is unavialable. Usage: f = LockedFile('filename', 'r+b', 'rb') f....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright 2013 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 b...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2013 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/clients/admin/internals/AlterConsumerGroupOffsetsHandlerTest.java
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const Dependency = require("../Dependency"); const InitFragment = require("../InitFragment"); const Template = require("../Template"); const { getDependencyUsedByExportsCondition } = require("../optimize...
javascript
github
https://github.com/webpack/webpack
lib/dependencies/HarmonyImportSpecifierDependency.js
# coding: utf-8 from __future__ import unicode_literals from .theplatform import ThePlatformIE from ..utils import ( int_or_none, parse_age_limit, try_get, update_url_query, ) class AMCNetworksIE(ThePlatformIE): _VALID_URL = r'https?://(?:www\.)?(?:amc|bbcamerica|ifc|(?:we|sundance)tv)\.com/(?:mov...
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
# -*- coding: utf-8 -*- """ itsdangerous ~~~~~~~~~~~~ A module that implements various functions to deal with untrusted sources. Mainly useful for web applications. :copyright: (c) 2014 by Armin Ronacher and the Django Software Foundation. :license: BSD, see LICENSE for more details. """ imp...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <algorithm> #include <cassert> #include <cmath> #include <cstddef> #include <c...
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/quantized/cpu/qnnpack/test/gavgpool-microkernel-tester.h
{ "SLAVEOF": { "summary": "Sets a Redis server as a replica of another, or promotes it to being a master.", "complexity": "O(1)", "group": "server", "since": "1.0.0", "arity": 3, "function": "replicaofCommand", "deprecated_since": "5.0.0", "replaced_by...
json
github
https://github.com/redis/redis
src/commands/slaveof.json
#!/usr/bin/env python # Copyright 2017 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 or...
unknown
codeparrot/codeparrot-clean
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
unknown
codeparrot/codeparrot-clean
from sqlobject import DESC from sqlobject.main import SQLObjectNotFound from flask import Module, url_for, redirect, session, escape, request from muzicast.const import DB_FILE from muzicast.meta import Genre, GenreStatistics from muzicast.web import playlist from muzicast.web.util import render_master_page, page_view...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 # Name: ehp.py # Author: Iury de oliveira gomes figueiredo and Mancuniancol # Created on: 28.11.2016 # Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html """" All the credit of this code to Iury de oliveira gomes figueiredo Easy Html Parser is an AST generator for html/xml document...
unknown
codeparrot/codeparrot-clean
# Copyright 2015 IBM Corp. # # 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 t...
unknown
codeparrot/codeparrot-clean
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
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 distributed under t...
unknown
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/site/markdown/Benchmarking.md
# Copyright 2012 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
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/clock/amlogic,gxbb-clkc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Amlogic Clock Controller maintainers: - Neil Armstrong <neil.armstrong@linaro.org> properties: compatible: enu...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/clock/amlogic,gxbb-clkc.yaml
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
unknown
codeparrot/codeparrot-clean
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. # # 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...
unknown
codeparrot/codeparrot-clean
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
unknown
codeparrot/codeparrot-clean
--- title: createCookieSessionStorage --- # createCookieSessionStorage [MODES: framework, data] ## Summary [Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react-router.createCookieSessionStorage.html) Creates and returns a SessionStorage object that stores all session data directly in the sess...
unknown
github
https://github.com/remix-run/react-router
docs/api/utils/createCookieSessionStorage.md
"""Test util, coverage 100%""" import unittest from idlelib import util class UtilTest(unittest.TestCase): def test_extensions(self): for extension in {'.pyi', '.py', '.pyw'}: self.assertIn(extension, util.py_extensions) if __name__ == '__main__': unittest.main(verbosity=2)
python
github
https://github.com/python/cpython
Lib/idlelib/idle_test/test_util.py
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, HttpResponse from django.contrib.auth import REDIRECT_FIELD_NAME from django.views.decorators.csrf import csrf_exempt from django.http import QueryDict, HttpResponseNotAllowed, HttpRe...
unknown
codeparrot/codeparrot-clean
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2011 Nick Hall # Copyright (C) 2011 Gary Burton # # 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 #...
unknown
codeparrot/codeparrot-clean
# # Unit Tests for the Callbacks class # # Rajul Srivastava (rajul09@gmail.com) # import unittest import logging import numpy as np import ginga.misc.Callback as Callback class TestError(Exception): pass class TestCallbacks(unittest.TestCase): def setUp(self): pass def test_init(self): ...
unknown
codeparrot/codeparrot-clean
<!--- Copyright 2024 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
unknown
github
https://github.com/huggingface/transformers
docs/source/de/contributing.md
# # Test script for Crypto.Util.RFC1751. # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is ...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require_relative "rubygems_ext" module Bundler # Returns current version of Ruby # # @return [CurrentRuby] Current version of Ruby def self.current_ruby @current_ruby ||= CurrentRuby.new end class CurrentRuby ALL_RUBY_VERSIONS = [*18..27, *30..34, *40..41].freeze ...
ruby
github
https://github.com/ruby/ruby
lib/bundler/current_ruby.rb
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package addrs import ( "testing" "github.com/google/go-cmp/cmp" ) func TestSetSortedNatural(t *testing.T) { // We're using AbsResourceInstance here just because it happens to // implement the required Less method, but this is intended as a te...
go
github
https://github.com/hashicorp/terraform
internal/addrs/set_test.go
import logbook from opbeat.handlers.logbook import OpbeatHandler from tests.helpers import get_tempstoreclient from tests.utils.compat import TestCase class LogbookHandlerTest(TestCase): def setUp(self): self.logger = logbook.Logger(__name__) def test_logger(self): client = get_tempstoreclie...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Energi Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Description** Extracts parts of a date, like year, month, day, hour.
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/description/date_extract.md
import { test } from '../../test'; export default test({ error: { code: 'import_svelte_internal_forbidden', message: "Imports of `svelte/internal/*` are forbidden. It contains private runtime code which is subject to change without notice. If you're importing from `svelte/internal/*` to work around a limitatio...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/compiler-errors/samples/svelte-internal-import/_config.js
from __future__ import unicode_literals from django.db import connection from django.test import TestCase from .models import A01, A02, B01, B02, C01, C02, Managed1, Unmanaged2 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created wi...
unknown
codeparrot/codeparrot-clean
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package vault import ( "context" "errors" "fmt" "sync" "time" log "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/sdk/logical" ) type RouterTestHandlerFunc func(context.Context, *logical.Request) (*logical.Response, error) ty...
go
github
https://github.com/hashicorp/vault
vault/router_testing.go
import operator import pytest from langchain_core.utils.usage import _dict_int_op def test_dict_int_op_add() -> None: left = {"a": 1, "b": 2} right = {"b": 3, "c": 4} result = _dict_int_op(left, right, operator.add) assert result == {"a": 1, "b": 5, "c": 4} def test_dict_int_op_subtract() -> None: ...
python
github
https://github.com/langchain-ai/langchain
libs/core/tests/unit_tests/utils/test_usage.py
############################################################################## # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # OeMedical, HMS Opensource Solution ############################################################################...
unknown
codeparrot/codeparrot-clean
import TinaCMS from "tinacms"; import { tinaConfig } from "../schema.ts"; // Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle. // Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode /** * * @private Do not import t...
javascript
github
https://github.com/vercel/next.js
examples/cms-tina/.tina/components/TinaProvider.js
# (c) 2016 Red Hat 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 License, or # (at your option) any later version. # # Ansible is dis...
unknown
codeparrot/codeparrot-clean
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
go
github
https://github.com/kubernetes/kubernetes
pkg/controller/volume/attachdetach/cache/actual_state_of_world_test.go
// Copyright 2018 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 runtime import "unsafe" // This file handles some syscalls from the syscall package // Especially, syscalls use during forkAndExecInChild which must n...
go
github
https://github.com/golang/go
src/runtime/syscall_aix.go
# Copyright 2019 Tecnativa - Sergio Teruel # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo.http import request from odoo.addons.website_sale.controllers.main import WebsiteSale from odoo import http class ProductAttributeValues(WebsiteSale): def _get_search_domain(self, search, category,...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsNetworkContentFetcher .. note:: 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 versio...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function, unicode_literals import json import os import sys import wptserve from wptserve import sslutils from . import environment as env from . import instruments from . import mpcontext from . import products from . import testloader from . import wptcommandline from . import wptloggi...
unknown
codeparrot/codeparrot-clean
import Foundation import CVaporBcrypt // MARK: BCrypt /// Creates and verifies BCrypt hashes. /// /// Use BCrypt to create hashes for sensitive information like passwords. /// /// try BCrypt.hash("vapor", cost: 4) /// /// BCrypt uses a random salt each time it creates a hash. To verify hashes, use the `verify(_:m...
swift
github
https://github.com/vapor/vapor
Sources/Vapor/Bcrypt/Bcrypt.swift
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; // NOTE: Extracted from https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/__tests__/...
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/scripts/eslint-plugin-react-hooks-test-cases.js
# -*- coding: utf-8 -*- ''' Create ssh executor system ''' # Import python libs import os import tarfile import tempfile import json import getpass import shutil import copy import time import multiprocessing import re import logging import yaml # Import salt libs import salt.client.ssh.shell import salt.client.ssh.wr...
unknown
codeparrot/codeparrot-clean
# this is a virtual module that is entirely implemented server side # Copyright: (c) 2017, 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_ve...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true # :markup: markdown require "active_support/core_ext/module/attribute_accessors" require "active_support/syntax_error_proxy" require "active_support/core_ext/thread/backtrace/location" require "rack/utils" module ActionDispatch class ExceptionWrapper cattr_accessor :rescue_respons...
ruby
github
https://github.com/rails/rails
actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
//! Edit distances. //! //! The [edit distance] is a metric for measuring the difference between two strings. //! //! [edit distance]: https://en.wikipedia.org/wiki/Edit_distance // The current implementation is the restricted Damerau-Levenshtein algorithm. It is restricted // because it does not permit modifying char...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_span/src/edit_distance.rs
/* * 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 agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/collect/InternersTest.java
// Copyright 2009 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 runtime_test import ( "internal/testenv" "math" "runtime" "sync" "sync/atomic" "testing" "time" ) func TestChan(t *testing.T) { defer runtime....
go
github
https://github.com/golang/go
src/runtime/chan_test.go
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2016 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/src/com/google/common/graph/AbstractGraphBuilder.java
# This file is a part of search-pinboard. # # search-pinboard 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. # # search-pinboard is di...
unknown
codeparrot/codeparrot-clean
david_action_controller: developer_id: 1 project_id: 2 joined_on: 2004-10-10 david_active_record: developer_id: 1 project_id: 1 joined_on: 2004-10-10 jamis_active_record: developer_id: 2 project_id: 1 poor_jamis_active_record: developer_id: 11 project_id: 1
unknown
github
https://github.com/rails/rails
activerecord/test/fixtures/developers_projects.yml
#!/usr/bin/env python # Copyright (C) 2017, Gabriele Facciolo <gfacciol@gmail.com> # This program 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, either version 3 of the License, or # (at your option) a...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright(C) 2013 Christophe Lampin # # This file is part of weboob. # # weboob 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, either version 3 of the License, or # (at ...
unknown
codeparrot/codeparrot-clean
'use strict'; const common = require('../common'); const fsPromises = require('fs').promises; const bench = common.createBenchmark(main, { n: [20e4], statType: ['fstat', 'lstat', 'stat'], }); async function run(n, statType) { const handleMode = statType === 'fstat'; const arg = handleMode ? await fsPromises....
javascript
github
https://github.com/nodejs/node
benchmark/fs/bench-stat-promise.js
#!/usr/bin/env python # Copyright 2017 gRPC 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 o...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 ############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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
import unittest import envoy import time class SimpleTest(unittest.TestCase): def test_input(self): r = envoy.run("sed s/i/I/g", "Hi") self.assertEqual(r.std_out.rstrip(), "HI") self.assertEqual(r.status_code, 0) def test_pipe(self): r = envoy.run("echo -n 'hi'| tr [:lower:] [...
unknown
codeparrot/codeparrot-clean
// plugin.js import {default as no_print} from "./rules/no-print-fn.js"; import {default as no_printing_tojson} from "./rules/no-printing-tojson.js"; export default { rules: { "no-print-fn": no_print, "no-printing-tojson": no_printing_tojson, }, };
javascript
github
https://github.com/mongodb/mongo
buildscripts/eslint-plugin-mongodb/plugin.js
# 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 # "Licens...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # """ Decorators for a Grid portal views. This file provides two decorators, `certificate_required` and `gridproxy_required`, that work just like the Django standard `login_required` decorator, but check that the user accessing the view has a valid certificate (resp. Grid proxy) and redirect to ...
unknown
codeparrot/codeparrot-clean
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The facts class for iosxr this file validates each subset of facts and selectively calls the appropriate facts gathering function """ from __future__ import absolute_imp...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # © 2015-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests import common from .common import ChangesetMixin class TestChangesetFieldType(ChangesetMixin, common.TransactionCase): """ Check that changeset changes are stored expectingly...
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
# -*- coding: utf-8 -*- from django.test import Client from django.urls import reverse from nmkapp import models, views from ..nmk_unit_test_case import NmkUnitTestCase class AdminMatchesEditTests(NmkUnitTestCase): def test_anon_user(self): client = Client() response = client.get(reverse(views.a...
unknown
codeparrot/codeparrot-clean
""" zetaFunctionMassConservative Solve a function q_t + 1/B (M q_x + F)_x = S for x in (0, L) q(0) = Fopen F(L)q_x(L) = Fclosed Solved in a mass conservative way, i.e. the solution q_x is always such that M q_x + F = int q_t/B NB added source 16-05-2018 Date: 16-05-2018 Authors: Y.M. Dijkstra """ import...
unknown
codeparrot/codeparrot-clean
# Inheritance TIP: This guide assumes you've already read the [Essentials Guide](essentials). Read that first if you're new to Angular. Angular components are TypeScript classes and participate in standard JavaScript inheritance semantics. A component can extend any base class: ```ts export class ListboxBase { va...
unknown
github
https://github.com/angular/angular
adev/src/content/guide/components/inheritance.md
""" Test against characteristics captured from a Velux Gateway. https://github.com/home-assistant/core/issues/44314 """ from homeassistant.components.cover import ( SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, ) from tests.components.homekit_controller.common import ( Helper, setup_accessor...
unknown
codeparrot/codeparrot-clean
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch, Mock from ans...
unknown
codeparrot/codeparrot-clean
import numpy as np from matplotlib import pyplot from spm1d import rft1d def here_hotellingsT2_2samp(yA, yB): NA,NB = float(yA.shape[0]), float(yB.shape[0]) N = NA + NB mA,mB = np.matrix(yA.mean(axis=0)), np.matrix(yB.mean(axis=0)) T2 = [] for ii,(mmA,mmB) in enumerate(zip(mA,mB)): yyA,yyB = np.m...
unknown
codeparrot/codeparrot-clean
name: HLSL Test permissions: contents: read on: workflow_call: inputs: OffloadTest-branch: description: 'Test Suite Branch' required: false default: 'main' type: string LLVM-ref: description: 'LLVM Branch' required: false default: 'main' ...
unknown
github
https://github.com/llvm/llvm-project
.github/workflows/hlsl-test-all.yaml
/* * 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-metadata-changelog-generator/src/test/java/org/springframework/boot/configurationmetadata/changelog/ChangelogWriterTests.java