code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
// @flow @enableNewMutationAliasingModel @enablePreserveExistingMemoizationGuarantees:false /** * This hook returns a function that when called with an input object, * will return the result of mapping that input with the supplied map * function. Results are cached, so if the same input is passed again, * the same ...
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-uncalled-function-capturing-mutable-values-memoizes-with-captures-values.js
"""SCons.Tool.Packaging.zip The zip SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Softw...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import win32con import sys import os import ctypes from ProcessWithLogon import CreateProcessWithLogonW from ProcessWithLogon import STARTUPINFO from win32com.shell.shell import ShellExecuteEx from win32com.shell import shellcon import logging log = logging.getLogger(__name__) def get_privil...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
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. //go:build gccgo package issue9400 import ( "runtime" "sync/atomic" ) // The test for the gc compiler resets the stack pointer so that the // stack gets mo...
go
github
https://github.com/golang/go
src/cmd/cgo/internal/test/issue9400/gccgo.go
# Stock plugin configuration and build methods. These factor out the # common tasks carried out by plugins in order to configure and build # themselves. from waflib.Errors import ConfigurationError from copy import copy def plugin(name, source=None, configure=False, build=False, build_replace=False, libs=[...
unknown
codeparrot/codeparrot-clean
import json from tests.test_helper import * from braintree.test.credit_card_numbers import CreditCardNumbers from braintree.test.nonces import Nonces from braintree.dispute import Dispute from braintree.payment_instrument_type import PaymentInstrumentType import braintree.test.venmo_sdk as venmo_sdk class TestTransac...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/async/es6/asyncAwaitIsolatedModules_es6.ts] //// //// [asyncAwaitIsolatedModules_es6.ts] import { MyPromise } from "missing"; declare var p: Promise<number>; declare var mp: MyPromise<number>; async function f0() { } async function f1(): Promise<void> { } async function f3(): MyPromise<...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/asyncAwaitIsolatedModules_es6.js
#ifndef RUBY_WIN32_DIR_H #define RUBY_WIN32_DIR_H #include <stdint.h> /* for uint8_t */ #include <basetsd.h> /* for WCHAR */ #include "ruby/encoding.h" /* for rb_encoding */ #define DT_UNKNOWN 0 #define DT_DIR (S_IFDIR>>12) #define DT_REG (S_IFREG>>12) #define DT_LNK 10 struct direct { ...
c
github
https://github.com/ruby/ruby
win32/dir.h
// Copyright 2018 The etcd 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 t...
go
github
https://github.com/etcd-io/etcd
pkg/proxy/server.go
/* * 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/context/support/EmbeddedValueResolutionSupport.java
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper around ssh for common operations on a CrOS-based device""" import logging import os import re import subprocess import sys import tempfile # TOD...
unknown
codeparrot/codeparrot-clean
{"files":{"Cargo.toml":"a9b5694c385e9515ded46f33519dede3225f45a0c7e84b52104bd41ee9b793f2","LICENSE":"f367c1b8e1aa262435251e442901da4607b4650e0e63a026f5044473ecfb90f2","README.md":"7e23c2a9ab21387b58397efe8ecf1f8e0e6ed14a7850f14cd61caf9a00b40a0c","src/chrono_impls.rs":"ef2ce18d133a67d7fd70a70dc02c4e871f509248c338191ba71...
json
github
https://github.com/nodejs/node
deps/crates/vendor/zoneinfo64/.cargo-checksum.json
# Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause # flake8: noqa # Generated file -- do not modify descriptions = {"T1_Output_Frames": "The number of octets received on interface, including frame octets (octet)", ...
unknown
codeparrot/codeparrot-clean
// Copyright 2019 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. //go:build linux && cgo package cgotest import ( "fmt" "internal/testenv" "os" "runtime" "sort" "strings" "syscall" "testing" ) // #include <stdio.h>...
go
github
https://github.com/golang/go
src/cmd/cgo/internal/test/issue1435.go
""" Unit tests for the peer data model. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest from ga4gh.server.datamodel import peers from ga4gh.server import exceptions class TestPeers(unittest.TestCase): """ Unit tests for the pee...
unknown
codeparrot/codeparrot-clean
#![warn(rust_2018_idioms)] #![cfg(feature = "sync")] #[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as test; #[cfg(all(target_family = "wasm", not(target_os = "wasi")))] use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test; #[cfg(not(all(target_family = "...
rust
github
https://github.com/tokio-rs/tokio
tokio/tests/sync_oneshot.rs
"""Affine transforms, both in general and specific, named transforms.""" from math import sin, cos, tan, pi __all__ = ['affine_transform', 'rotate', 'scale', 'skew', 'translate'] def affine_transform(geom, matrix): """Returns a transformed geometry using an affine transformation matrix. The coefficient matr...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Examples** ```esql FROM books | WHERE MATCH(author, "Faulkner") ``` | book_no:keyword | author:text | | --- | --- | | 2378 | [Carol Faulkner, Holly Byers Ochoa, Lucretia Mott] | | 2713 | William Faulk...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/examples/match.md
# -*- coding: utf-8 -*- """ @author: adam """ from subprocess import check_call, CalledProcessError import langmuir as lm import argparse import tempfile import shutil import os import re desc = """ Plot output from rdf.py """ def get_arguments(args=None): parser = argparse.ArgumentParser() parser.description...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from openerp import models, api, fields from openerp.exceptions import UserError class LibraryBook(models.Model): _inherit = 'library.book' manager_remarks = fields.Text('Manager Remarks') @api.model @api.returns(lambda rec: rec.id) def create(self, values): if not self.us...
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 -*- # # 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 #...
unknown
codeparrot/codeparrot-clean
'''utils -- contains utility/support members. CertificateAuthority: class for faking SSL keys for any site safe_split_http_response_line - parse HTTP response codes safe_split_http_request_line - parse HTTP request ''' import shutil import os import logging import tempfile import uuid try: import urlparse except I...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/assignmentToObject.ts] //// //// [assignmentToObject.ts] var a = { toString: 5 }; var b: {} = a; // ok var c: Object = a; // should be error //// [assignmentToObject.js] "use strict"; var a = { toString: 5 }; var b = a; // ok var c = a; // should be error
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/assignmentToObject.js
"""Backport of importlib.import_module from 3.x.""" # While not critical (and in no way guaranteed!), it would be nice to keep this # code compatible with Python 2.3. import sys def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex...
unknown
codeparrot/codeparrot-clean
import datetime import os from django import forms from django.db.models.fields import Field from django.core import checks from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signals from django.utils...
unknown
codeparrot/codeparrot-clean
from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xmodule.editing_module import MetadataOnlyEditingDescriptor from xblock.core import String, Scope from uuid import uuid4 class DiscussionFields(object): discussion_id = String(scope=Sco...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.protocol}. """ from twisted.python.failure import Failure from twisted.internet.defer import CancelledError from twisted.internet.protocol import Protocol, ClientCreator from twisted.internet.task import Cloc...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package configload import ( "fmt" version "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/terraform/internal/configs" ) // LoadConfig reads the Terraform module in the given directory and uses it as the ...
go
github
https://github.com/hashicorp/terraform
internal/configs/configload/loader_load.go
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.tools import GmailGetThread from langchain_community.tools.gmail.get_thread import GetThreadSchema # Create a way to dynamically look up deprecated imports. # Used to consolidat...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/tools/gmail/get_thread.py
# Copyright (c) 2012, Calxeda Inc. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
unknown
codeparrot/codeparrot-clean
import { createRequestHandler } from "../../lib/server-runtime/server"; import { ErrorResponseImpl } from "../../lib/router/utils"; import { mockServerBuild } from "./utils"; import type { HandleDocumentRequestFunction } from "../../lib/server-runtime/build"; function getHandler( routeModule = {}, opts: { hand...
typescript
github
https://github.com/remix-run/react-router
packages/react-router/__tests__/server-runtime/handle-error-test.ts
import math, util, rotmat, time import random from rotmat import Vector3, Matrix3 class Aircraft(object): '''a basic aircraft class''' def __init__(self): self.home_latitude = 0 self.home_longitude = 0 self.home_altitude = 0 self.ground_level = 0 self.frame_height = 0.0 ...
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/main/java/org/apache/kafka/common/record/internal/MemoryRecords.java
import collections import traceback import weakref import six import chainer from chainer import configuration from chainer import cuda from chainer.utils import type_check from chainer import variable def no_backprop_mode(): """Make a context manager which disables back-propagation. In this context, Chaine...
unknown
codeparrot/codeparrot-clean
from __future__ import division, absolute_import, print_function from subprocess import PIPE, Popen import sys import re from numpy.linalg import lapack_lite from numpy.testing import TestCase, dec, run_module_suite from numpy.compat import asbytes_nested class FindDependenciesLdd(object): def __init__(self): ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2025 Baidu, Inc. and HuggingFace Inc. team. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
python
github
https://github.com/huggingface/transformers
src/transformers/models/ernie4_5_moe/configuration_ernie4_5_moe.py
import os import sys from operator import itemgetter import six from six.moves.configparser import SafeConfigParser from scrapy.utils.deprecate import update_classpath def build_component_list(base, custom, convert=update_classpath): """Compose a component list based on a custom and base dict of components (...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function, division from sympy.core import Expr, S, sympify, oo, pi, Symbol, zoo from sympy.core.compatibility import as_int, xrange from sympy.functions.elementary.complexes import sign from sympy.functions.elementary.piecewise import Piecewise from sympy.functions.elementary.trigonometric...
unknown
codeparrot/codeparrot-clean
import pytest from csp import * #noqa def test_backtracking_search(): assert (backtracking_search(australia) is not None) == True assert (backtracking_search(australia, select_unassigned_variable=mrv) is not None) == True assert (backtracking_search(australia, order_domain_values=lcv) is not None) == Tru...
unknown
codeparrot/codeparrot-clean
// mkerrors.sh // Code generated by the command above; DO NOT EDIT. // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go package syscall const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT = 0xa AF_CHAOS ...
go
github
https://github.com/golang/go
src/syscall/zerrors_openbsd_arm.go
/* * 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/context/annotation/Condition.java
/** * 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/main/java/org/apache/hadoop/ipc/RPC.java
#!/usr/bin/python # # This is a 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. # # This Ansible library is distributed in the hope that i...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2014-2015 Codethink Limited # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but...
unknown
codeparrot/codeparrot-clean
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from models import Part, Car, SportsCar, Person class ManyToManySignalsTest(TestCase): def m2m_changed_signal_receiver(self, signal, sender, **kwargs): message = { 'instanc...
unknown
codeparrot/codeparrot-clean
from django import forms from django.contrib import admin from .models import ( Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2, Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder, Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stacked, Inner4Tabular, NonAut...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # pycodestyle.py - Check Python source code formatting, according to PEP 8 # # Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net> # Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> # Copyright (C) 2014-2016 Ian Lee <ianlee1521@gmail.com> # # Permission is hereby gran...
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 ...
java
github
https://github.com/apache/hadoop
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/object/tos/auth/CredentialsProvider.java
import warnings import sys import numpy as np from numpy.testing import * import unittest class _GenericTest(object): def _test_equal(self, a, b): self._assert_func(a, b) def _test_not_equal(self, a, b): try: self._assert_func(a, b) passed = True except Asserti...
unknown
codeparrot/codeparrot-clean
// Targets the Little-endian Cortex-R4F/R5F processor (ARMv7-R) use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base}; pub(crate) fn target() -> Target { Target { llvm_target: "thumbv7r-none-eabihf".into(), metadata: TargetMetadata { description: Some("Thu...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/thumbv7r_none_eabihf.rs
# 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 applicable ...
unknown
codeparrot/codeparrot-clean
Let's use `await` at the top level in a module `db-connection.js`. This makes sense since the connection to the DB needs to be established before the module is usable. # db-connection.js ```javascript const connectToDB = async url => { await new Promise(r => setTimeout(r, 1000)); }; // This is a top-level-await awa...
unknown
github
https://github.com/webpack/webpack
examples/top-level-await/README.md
from datetime import ( date, datetime, ) import itertools import numpy as np import pytest from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike import pandas as pd from pandas import ( Index, MultiIndex, Series, Timestamp, date_range, ) import pandas._testing as tm ...
python
github
https://github.com/pandas-dev/pandas
pandas/tests/indexes/multi/test_constructors.py
/* * Copyright (C) 2008 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/util/concurrent/FuturesTransformAsyncTest.java
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # nsndswap/viko_nsnd.py # copyright 2017 ViKomprenas, 2-clause BSD license (LICENSE.md) from nsndswap.util import Track nsnd = { # A Shade of Two "criticalErr0r": ["Taureg"], "Exploreation": ["Explore", "Upward Movement (Dave Owns)"], "Taureg": ["Sburban Jungle", "Beatdown"], ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (C) 2012 Google 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...
unknown
codeparrot/codeparrot-clean
import openerp class DiagramView(openerp.http.Controller): @openerp.http.route('/web_diagram/diagram/get_diagram_info', type='json', auth='user') def get_diagram_info(self, req, id, model, node, connector, src_node, des_node, label, **kw): visible_node_fields = kw.get('visibl...
unknown
codeparrot/codeparrot-clean
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { ConcatSource } = require("webpack-sources"); const { UsageState } = require("../ExportsInfo"); const ExternalModule = require("../ExternalModule"); const RuntimeGlobals = require("../RuntimeGlobal...
javascript
github
https://github.com/webpack/webpack
lib/library/ModuleLibraryPlugin.js
""" Microsite configuration backend module. Contains the base classes for microsite backends. AbstractBaseMicrositeBackend is Abstract Base Class for the microsite configuration backend. BaseMicrositeBackend is Base Class for microsite configuration backend. BaseMicrositeTemplateBackend is Base Class for the microsit...
unknown
codeparrot/codeparrot-clean
""" Defines the Kiva Font class and a utility method to parse free-form font specification strings into Font instances. """ from __future__ import absolute_import, print_function import copy from kiva.constants import (DEFAULT, DECORATIVE, ROMAN, SCRIPT, SWISS, MODERN, TELETYPE, NORMAL, IT...
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...
kotlin
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/kotlin/org/springframework/docs/core/aop/ataspectj/aopataspectjexample/ApplicationConfiguration.kt
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
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/replicaset/replica_set.go
<?php namespace Illuminate\Tests\Queue; use Illuminate\Queue\Listener; use Illuminate\Queue\ListenerOptions; use Mockery as m; use PHPUnit\Framework\TestCase; use Symfony\Component\Process\Process; use function Illuminate\Support\artisan_binary; use function Illuminate\Support\php_binary; use function Orchestra\Test...
php
github
https://github.com/laravel/framework
tests/Queue/QueueListenerTest.php
import pytest, py def exvalue(): return py.std.sys.exc_info()[1] def f(): return 2 def test_assert(): try: assert f() == 3 except AssertionError: e = exvalue() s = str(e) assert s.startswith('assert 2 == 3\n') def test_assert_within_finally(): excinfo = py.test.ra...
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...
python
github
https://github.com/apache/airflow
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/hitl.py
# -*- 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
package org.pytorch; import com.facebook.jni.annotations.DoNotStrip; import java.util.Locale; import java.util.Map; /** * Java representation of a TorchScript value, which is implemented as tagged union that can be one * of the supported types: https://pytorch.org/docs/stable/jit.html#types . * * <p>Calling {@cod...
java
github
https://github.com/pytorch/pytorch
android/pytorch_android/src/main/java/org/pytorch/IValue.java
#!/usr/bin/env python # -*- coding: utf-8 -*- ## Description Tool for removing duplicates in an SDFile ## ## Authors: Inés Martínez (mmartinez4@imim.es) ## Manuel Pastor (manuel.pastor@upf.edu) ## ## Copyright 2015 Manuel Pastor ## ## This file is part of PhiTools ## ## PhiToo...
unknown
codeparrot/codeparrot-clean
# Copyright 2021 Google LLC 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 ag...
unknown
codeparrot/codeparrot-clean
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
c
github
https://github.com/opencv/opencv
modules/core/include/opencv2/core/types_c.h
# test_viz # Vizualization tests # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Sun Dec 06 20:45:32 2015 -0500 # # Copyright (C) 2015 University of Maryland # For license information, see LICENSE.txt # # ID: test_viz.py [] benjamin@bengfort.com $ """ Vizualization tests """ ########################...
unknown
codeparrot/codeparrot-clean
{ "compileOnSave": false, "compilerOptions": { "target": "es2018", "module": "esnext", "lib": ["dom", "dom.iterable", "esnext"], "declaration": true, "outDir": "dist", "strict": true, "sourceMap": true, "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefau...
json
github
https://github.com/prometheus/prometheus
web/ui/module/codemirror-promql/tsconfig.json
<!--Copyright 2022 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 agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/it/perf_train_special.md
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2008 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 requir...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2008 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-testlib/src/com/google/common/collect/testing/testers/ListLastIndexOfTester.java
#------------------------------------------------------------------------------- # Name : subtitle downloader # Purpose : One step subtitle download # # Authors : manoj m j, arun shivaram p, Valentin Vetter, niroyb # Edited by : Valentin Vetter # Created : # Copyright : (c) www.manojmj.com # Licence : GPL ...
unknown
codeparrot/codeparrot-clean
#include "parts.h" #include "util.h" static PyObject * number_check(PyObject *Py_UNUSED(module), PyObject *obj) { NULLABLE(obj); return PyLong_FromLong(PyNumber_Check(obj)); } #define BINARYFUNC(funcsuffix, methsuffix) \ static PyObject * ...
c
github
https://github.com/python/cpython
Modules/_testcapi/numbers.c
# 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 # This module implement prefork model, used for spawn and manage child process import os import sys import time import errno import signal import random import select import traceback from in_trip.lib.pidfile import Pidfile from in_trip.lib.config import Config from in_trip.lib.errors import HaltServer...
unknown
codeparrot/codeparrot-clean
# Adapted from test_file.py by Daniel Stutzbach import sys import os import io import errno import unittest from array import array from weakref import proxy from functools import wraps from test.support import ( cpython_only, swap_attr, gc_collect, is_wasi, infinite_recursion, strace_helper ) from test.suppo...
python
github
https://github.com/python/cpython
Lib/test/test_io/test_fileio.py
"""Simple tool wrapper around VectorDBQA chain."""
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/tools/vectorstore/__init__.py
## Input ```javascript // Fixture to test that we show a hint to name as `ref` or `-Ref` when attempting // to assign .current inside an effect function Component({foo}) { useEffect(() => { foo.current = true; }, [foo]); } ``` ## Error ``` Found 1 error: Error: This value cannot be modified Modifying comp...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.assign-ref-in-effect-hint.expect.md
# Game of Life - yay! import numpy as np import sys import itertools as it def parse_input(filename): grid = np.zeros((100, 100)) with open(filename) as f: y = 0 for line in f.readlines(): x = 0 for c in line.strip(): if c == '#': gri...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockitousage.plugins.stacktrace; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.exceptions.verification.WantedButNotIn...
java
github
https://github.com/mockito/mockito
mockito-integration-tests/extensions-tests/src/test/java/org/mockitousage/plugins/stacktrace/PluginStackTraceFilteringTest.java
/* SPDX-License-Identifier: GPL-2.0 */ /* zpdesc.h: zsmalloc pool memory descriptor * * Written by Alex Shi <alexs@kernel.org> * Hyeonggon Yoo <42.hyeyoo@gmail.com> */ #ifndef __MM_ZPDESC_H__ #define __MM_ZPDESC_H__ #include <linux/migrate.h> #include <linux/pagemap.h> /* * struct zpdesc - Memory descripto...
c
github
https://github.com/torvalds/linux
mm/zpdesc.h
import collections import contextlib import os import yaml import exception from utils import log from utils.cmd import run def confirm(msg, default_yes=True): if default_yes: options = '[Yn]' else: options = '[Ny]' print i = raw_input(log.term.important("%s %s " % (msg, options))).low...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2016 Stratoscale, 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 agreed...
unknown
codeparrot/codeparrot-clean
import { test, ok } from '../../assert'; export default test({ mode: ['client'], async test({ assert, target }) { const audio = target.querySelector('audio'); const button = target.querySelector('button'); ok(audio); assert.equal(audio.volume, 0.1); audio.volume = 0.2; audio.dispatchEvent(new CustomEve...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-browser/samples/bind-volume/_config.js
# -*- coding: utf-8 # pylint: disable=line-too-long """ Common routes for bottle web server. Functions defined here are used from wihtin programs such as anvi-interactive, or anvi-refine. """ import os import re import io import sys import math import copy import time import json import base64 import rand...
unknown
codeparrot/codeparrot-clean
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package jobs import ( "context" "fmt" "reflect" "sort" "sync" "testing" "time" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/p...
go
github
https://github.com/cockroachdb/cockroach
pkg/jobs/job_scheduler_test.go
# use inventory and cache plugins defined in a content-adjacent collection plugin: testns.content_adj.statichost hostname: cache_host_a cache_plugin: testns.content_adj.custom_jsonfile cache: yes cache_connection: inventory_cache cache_prefix: 'prefix_'
unknown
github
https://github.com/ansible/ansible
test/integration/targets/collections/cache.statichost.yml
# This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude` # on 2022-04-06 10:48:47 UTC using RuboCop version 1.26.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code,...
unknown
github
https://github.com/jekyll/jekyll
.rubocop_todo.yml
# test will be skipped if MySqlDB is unavailable import string import unittest from testlib import testutil, SkipTest, PygrTestProgram from pygr import sqlgraph, seqdb, classutil, logger class DNASeqRow(seqdb.DNASQLSequence): def __len__(self): # just speed optimization return self._select('length(sequenc...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env bash set -o pipefail -eux declare -a args IFS='/:' read -ra args <<< "$1" image="${args[1]}" if [ "${#args[@]}" -gt 2 ]; then target="shippable/posix/group${args[2]}/" else target="shippable/posix/" fi # shellcheck disable=SC2086 ansible-test integration --color -v --retry-on-error "${target...
unknown
github
https://github.com/ansible/ansible
.azure-pipelines/commands/linux.sh
/** * 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/main/java/org/apache/hadoop/security/ProviderUtils.java