code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
from django.test import TestCase from models import Reporter, Article class ManyToOneNullTests(TestCase): def setUp(self): # Create a Reporter. self.r = Reporter(name='John Smith') self.r.save() # Create an Article. self.a = Article(headline="First", reporter=self.r) ...
unknown
codeparrot/codeparrot-clean
import os from six.moves import cPickle as pickle import warnings from importlib import import_module from os.path import join, dirname, abspath, isabs, exists from scrapy.utils.conf import closest_scrapy_cfg, get_config, init_env from scrapy.settings import Settings from scrapy.exceptions import NotConfigured ENVVA...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env bash # # 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. set -e if [ -z "$ANDROID_NDK" ] then echo "ANDROID_NDK not set; please set it to the And...
unknown
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/quantized/cpu/qnnpack/scripts/build-android-x86.sh
import os import pprint import re import sys import click try: import shodan except ImportError: print("Install shodan: pip install shodan") sys.exit(0) try: SHODAN_API_KEY = os.environ["SHODAN_API_KEY"] except KeyError: print("Set SHODAN_API_KEY environment variable with your key") sys.exit(...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.utilities.redis import ( TokenEscaper, check_redis_module_exist, get_client, ) # Create a way to dynamically look up deprecated imports. # Used to consol...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/utilities/redis.py
# coding: utf-8 import codecs import yaml import itertools try: from yaml import CLoader as Loader, CDumper as Dumper except ImportError: from yaml import Loader, Dumper import argparse parser = argparse.ArgumentParser(description="Translate a word in sampa to a word in API", prog="sampa2apiTranslater") parser.add...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 Nebula, 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 agree...
unknown
codeparrot/codeparrot-clean
import os import json import rtree import numpy as np class RTreeDB(): def __init__(self, file_name): # Basic parameters synapse_spatial = os.path.join(file_name, 'synapse_spatial') # Make database directory if doesn't exist if not os.path.exists(synapse_spatial): os.ma...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('glitter', '0001_initial'), ] operations = [ migrations.CreateModel( name='DefinitionList', fields=[ ...
unknown
codeparrot/codeparrot-clean
A private type or trait was used in a public associated type signature. Erroneous code example: ```compile_fail,E0446 struct Bar; pub trait PubTr { type Alias; } impl PubTr for u8 { type Alias = Bar; // error private type in public interface } fn main() {} ``` There are two ways to solve this error. The f...
unknown
github
https://github.com/rust-lang/rust
compiler/rustc_error_codes/src/error_codes/E0446.md
"""Provide a :class:`.CacheImpl` for the Beaker caching system.""" from mako import exceptions from mako.cache import CacheImpl try: from beaker import cache as beaker_cache except: has_beaker = False else: has_beaker = True _beaker_cache = None class BeakerCacheImpl(CacheImpl): """A :class:`.Cach...
unknown
codeparrot/codeparrot-clean
""" #;+ #; NAME: #; spec_widgets #; Version 1.0 #; #; PURPOSE: #; Module for IMG widgets with QT #; 12-Dec-2014 by JXP #;- #;------------------------------------------------------------------------------ """ from __future__ import print_function, absolute_import, division, unicode_literals # Import libraries i...
unknown
codeparrot/codeparrot-clean
500 localized error fixture
html
github
https://github.com/rails/rails
actionpack/test/fixtures/public/500.da.html
// Copyright 2021 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 cgo package cgotest // Issue 43639: No runtime test needed, make sure package cmd/cgo/internal/test/issue43639 compiles well. import _ "cmd/cgo/in...
go
github
https://github.com/golang/go
src/cmd/cgo/internal/test/issue43639.go
import theano import numpy import scipy from theano import tensor from blocks.bricks import Initializable, Linear from blocks.bricks.parallel import Parallel from blocks.bricks.base import lazy, application from blocks.bricks.attention import ( GenericSequenceAttention, SequenceContentAttention, ShallowEnergyC...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2008 Alberto García Hierro <fiam@rm-fr.net> # 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 rig...
unknown
codeparrot/codeparrot-clean
{ "apiVersion": "v1", "groups": [ { "name": "apiregistration.k8s.io", "preferredVersion": { "groupVersion": "apiregistration.k8s.io/v1", "version": "v1" }, "versions": [ { "groupVersion": "apiregistration.k8s.io/v1", "version": "v1" } ...
json
github
https://github.com/kubernetes/kubernetes
api/discovery/apis.json
# -*- coding: utf-8 -*- ############################################################################### # # AddFavoriteActivity # Adds a specified activity to a user's favorite activities list. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Li...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # $File: applicableGen.py $ # # This file is part of simuPOP, a forward-time population genetics # simulation environment. Please visit http://simupop.sourceforge.net # for details. # # Copyright (C) 2004 - 2010 Bo Peng (bpeng@mdanderson.org) # # This program is free software: you can redistrib...
unknown
codeparrot/codeparrot-clean
import { useRouter } from "next/router"; import ErrorPage from "next/error"; import Container from "@/components/container"; import PostBody from "@/components/post-body"; import MoreStories from "@/components/more-stories"; import Header from "@/components/header"; import PostHeader from "@/components/post-header"; im...
javascript
github
https://github.com/vercel/next.js
examples/cms-storyblok/pages/posts/[slug].js
/* * Copyright (c) 2019 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.exceptions.verification; import org.mockito.exceptions.base.MockitoAssertionError; /** * @since 2.27.5 */ public class TooFewActualInvocations extends MockitoAssertionError { ...
java
github
https://github.com/mockito/mockito
mockito-core/src/main/java/org/mockito/exceptions/verification/TooFewActualInvocations.java
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package server import ( "bytes" "context" "fmt" "io" "net/http" "strconv" "time" "github.com/cockroachdb/cockroach/pkg/server/authserver" "github.com/cockroac...
go
github
https://github.com/cockroachdb/cockroach
pkg/server/statement_diagnostics_requests.go
use rustc_abi::Endian; use crate::spec::{ Abi, Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetMetadata, TargetOptions, base, }; pub(crate) fn target() -> Target { let mut base = base::vxworks::opts(); base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mspe", "--secure-plt"]); ...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs
#!/bin/sh test_description='fsck on buffers without NUL termination The goal here is to make sure that the various fsck parsers never look past the end of the buffer they are given, even when encountering broken or truncated objects. We have to use "hash-object" for this because most code paths that read objects app...
unknown
github
https://github.com/git/git
t/t1451-fsck-buffer.sh
# RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org) # Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de> # # 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 Founda...
unknown
codeparrot/codeparrot-clean
from circuits import Component from funcy import first from ..utils import log from ..plugin import BasePlugin from ..plugins import load, unload class Commands(Component): channel = "commands" def rehash(self, source, target, args): """Reload environment Syntax: RELOAD """ ...
unknown
codeparrot/codeparrot-clean
# ملخص عن المجزئات اللغوية [[open-in-colab]] في هذه الصفحة، سنتناول بالتفصيل عملية التجزئة. <Youtube id="VFp38yj8h3A"/> كما رأينا في [برنامج تعليمي حول المعالجة المسبقة](preprocessing)، فإن تجزئة النص يقسمه إلى كلمات أو الرموز الفرعية (كلمات جزئية)، والتي يتم بعد ذلك تحويلها إلى معرفات من خلال قائمة بحث. يعد تحويل ...
unknown
github
https://github.com/huggingface/transformers
docs/source/ar/tokenizer_summary.md
/* * 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 ...
kotlin
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/kotlin/org/springframework/docs/web/webfluxfnrequest/PartEventHandler.kt
/*! * 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...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/src/pages/DeleteRunButton.tsx
/* * 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/collect/MultimapsCollectionTest.java
# -*- coding: utf-8 -*- #----------------------------------------------------------- # # fTools # Copyright (C) 2008-2011 Carson Farmer # EMAIL: carson.farmer (at) gmail.com # WEB : http://www.ftools.ca/fTools.html # # A collection of data management and analysis tools for vector data # #-----------------------------...
unknown
codeparrot/codeparrot-clean
//===--- RemoteAST.h - Relating remote metadata to local ASTs ---*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
c
github
https://github.com/apple/swift
include/swift/RemoteAST/RemoteAST.h
<?php namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures; class ClassAliasTargetClass { }
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/ClassAliasTargetClass.php
# -*- coding: utf-8 -*- # This file is based upon the file generated by sphinx-quickstart. However, # where sphinx-quickstart hardcodes values in this file that you input, this # file has been changed to pull from your module's metadata module. # # This file is execfile()d with the current directory set to its contain...
unknown
codeparrot/codeparrot-clean
# 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 import traceback try: from botocore.exceptions import ClientError, NoCredentialsError except Im...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package getproviders import ( "context" "fmt" "regexp" "strings" "testing" "github.com/apparentlymart/go-versions/versions" "github.com/google/go-cmp/cmp" svchost "github.com/hashicorp/terraform-svchost" "github.com/hashicorp/terraform/i...
go
github
https://github.com/hashicorp/terraform
internal/getproviders/registry_source_test.go
/** @import { Expression } from 'estree' */ /** @import { AST } from '#compiler' */ /** @import { ComponentContext } from '../types.js' */ import { unwrap_optional } from '../../../../utils/ast.js'; import * as b from '#compiler/builders'; import { empty_comment, PromiseOptimiser } from './shared/utils.js'; /** * @pa...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/src/compiler/phases/3-transform/server/visitors/RenderTag.js
/*------------------------------------------------------------------------- * * pg_backup_archiver.h * * Private interface to the pg_dump archiver routines. * It is NOT intended that these routines be called by any * dumper directly. * * See the headers to pg_restore for more details. * * Copyright (c) 2000, ...
c
github
https://github.com/postgres/postgres
src/bin/pg_dump/pg_backup_archiver.h
// RUN: clang-tidy %S/Inputs/nolintbeginend/1st-translation-unit.cpp %S/Inputs/nolintbeginend/2nd-translation-unit.cpp --checks='-*,google-explicit-constructor' -- 2>&1 | FileCheck %s // CHECK-NOT: 1st-translation-unit.cpp:2:11: warning: single-argument constructors must be marked explicit // CHECK: 1st-translation-un...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/test/clang-tidy/infrastructure/nolintbeginend-multiple-TUs.cpp
#!/usr/bin/python # Copyright (c) Arni Mar Jonsson. # See LICENSE for details. import sys, string, unittest, itertools class TestLevelDB(unittest.TestCase): def setUp(self): # import local leveldb import leveldb as _leveldb self.leveldb = _leveldb dir(self.leveldb) # Python2/3 compat if hasattr(string,...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/argumentsObjectIterator03_ES5.ts] //// //// [argumentsObjectIterator03_ES5.ts] function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, number] { let [x, y, z] = arguments; return [z, y, x]; } //// [argumentsObjectIterator03_ES5.js] "use strict"; function asRev...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/argumentsObjectIterator03_ES5(target=es2015).js
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
unknown
codeparrot/codeparrot-clean
from django.db import connections from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet from django.contrib.gis import memoryview from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField from django.contrib....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # "...
unknown
codeparrot/codeparrot-clean
name: Rails releaser tests on: pull_request: paths: - "tools/releaser/**" push: paths: - "tools/releaser/**" permissions: contents: read jobs: releaser_tests: name: releaser tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Set up Ruby us...
unknown
github
https://github.com/rails/rails
.github/workflows/rails_releaser_tests.yml
#!/usr/bin/env python # Copyright (c) 2014 Ingo Ruhnke <grumbel@gmail.com> # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use this software for ...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
connect/runtime/src/main/java/org/apache/kafka/connect/converters/ByteArrayConverter.java
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation) on 2019-05-07. # 2019, SMART Health IT. from . import domainresource class ImmunizationEvaluation(domainresource.DomainResource): """ Immunization evaluation in...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (C) 2010 by the Free Software Foundation, 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 la...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python import argparse import os import re def main(): # def arguments argparser = argparse.ArgumentParser() argparser.add_argument("input") argparser.add_argument("target") args = argparser.parse_args() # get input file if not os.path.isfile(args.input): raise Exception...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2012-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/ServiceCapabilitiesReportGeneratorTests.java
from indra.literature import * from indra.sources.geneways.actionmention_parser import \ GenewaysActionMentionParser import random import pickle import re from stemming.porter2 import stem from nltk import sent_tokenize from nltk.tokenize import word_tokenize from lxml import etree from indra.resources.greek_a...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. 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 # noti...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from vdw.samples.models import DEFAULT_COHORT_NAME, DEFAULT_PROJECT_NAME def cohort_bulk_add(orm, cohort, samples): _objs = [] loaded = 0 for obj in iter(samples): _objs.append(...
unknown
codeparrot/codeparrot-clean
""" Module with tests for the csshtmlheader preprocessor """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with ...
unknown
codeparrot/codeparrot-clean
""" launch_FilterDellyCalls ~~~~~~~~~~~~~~~~~~~~~~~ :Description: This module will filter delly results and create filtered delly vcf files """ ''' Created on November 20, 2015 Description: This module will filter delly results and create filtered delly vcf files @author: Ronak H Shah ::Inputs:: args: Arguments passed...
unknown
codeparrot/codeparrot-clean
package caller import ( "testing" ) func fun1() string { return Name(0) } func fun2() string { return Name(1) } func fun3() string { return fun4() } func fun4() string { return Name(0) } func fun5() string { return fun6() } func fun6() string { return Name(1) } func TestCaller(t *testing.T) { funName :=...
go
github
https://github.com/moby/moby
daemon/libnetwork/internal/caller/caller_test.go
#!/usr/bin/python import os import sys import grp import pwd import traceback import hooking DEV_MAPPER_PATH = "/dev/mapper" DEV_DIRECTLUN_PATH = '/dev/directlun' def createDirectory(dirpath): # we don't use os.mkdir/chown because we need sudo command = ['/bin/mkdir', '-p', dirpath] retcode, out, err =...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ''' qgslayoutchecker.py - check rendering of QgsLayout against an expected image -------------------------------------- Date : 31 Juli 2012 Copyright : (C) 2012 by Dr. Horst Düster / Dr. Marco Hugentobler email : horst.duester@sourcepole.ch *****...
unknown
codeparrot/codeparrot-clean
// Copyright 2021 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. // // Code generated by generate-staticcheck; DO NOT EDIT. // //go:build bazel package st1021 import ( util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes...
go
github
https://github.com/cockroachdb/cockroach
build/bazelutil/staticcheckanalyzers/st1021/analyzer.go
""" Classes used for defining and running python test suites """ from pavelib.utils.test import utils as test_utils from pavelib.utils.test.suites.suite import TestSuite from pavelib.utils.test.suites.nose_suite import LibTestSuite, SystemTestSuite from pavelib.utils.envs import Env __test__ = False # do not collect ...
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
framework-docs/src/main/java/org/springframework/docs/integration/mailusagesimple/Order.java
"use strict"; const path = require("path"); /** @type {import("webpack").Configuration} */ const config = { module: { rules: [ { test: /\.js$/, include: [path.resolve(__dirname, ".")], use: { loader: "babel-loader", options: { presets: ["@babel/react"] } } } ] }, opti...
javascript
github
https://github.com/webpack/webpack
examples/reexport-components/webpack.config.js
from statsmodels.compat.python import range, lrange, lzip import numpy as np import numpy.lib.recfunctions as nprf from statsmodels.tools.tools import add_constant from pandas.tseries import offsets from pandas.tseries.frequencies import to_offset def add_trend(X, trend="c", prepend=False, has_constant='skip'): ""...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import unittest import frappe from frappe.utils import today from erpnext.hr.doctype.employee.employee import make_salary_structure from erpnext.hr.doctype.salary_structure.salary_structure...
unknown
codeparrot/codeparrot-clean
"use strict"; module.exports = function supportsES6() { try { eval("class A { #field = 1 }"); return true; } catch (_err) { return false; } };
javascript
github
https://github.com/webpack/webpack
test/helpers/supportsClassFields.js
//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of5.ts] //// //// [ES5For-of5.ts] for (var _a of []) { var x = _a; } //// [ES5For-of5.js] "use strict"; for (var _i = 0, _b = []; _i < _b.length; _i++) { var _a = _b[_i]; var x = _a; }
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/ES5For-of5(target=es5).js
import type { DataRouteMatch, RouteObject } from "../context"; import type { History, Location, Path, To } from "./history"; import { Action as NavigationType, createLocation, createPath, createBrowserURLImpl, invariant, parsePath, warning, } from "./history"; import type { unstable_ClientInstrumentatio...
typescript
github
https://github.com/remix-run/react-router
packages/react-router/lib/router/router.ts
// Copyright 2022 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
tests/robustness/model/non_deterministic.go
- Feature Name: txn-gc - Status: completed - Start Date: 2015-11-12 - RFC PR: [#3100](https://github.com/cockroachdb/cockroach/pull/3100) - Cockroach Issue: [#2062](https://github.com/cockroachdb/cockroach/issues/2062) # Summary * rename `{Response->Sequence}Cache`, `Transaction{Table->Cache}`. * store client's inten...
unknown
github
https://github.com/cockroachdb/cockroach
docs/RFCS/20151111_txn_gc.md
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\JsonLoginBundle; ...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/JsonLoginBundle.php
#pragma once #include <ATen/native/DispatchStub.h> #include <array> #include <cstdint> namespace at { class TensorBase; } namespace at::native { using forward_2d_fn = void (*) ( const TensorBase &output, const TensorBase &input, const TensorBase &grid, int64_t interpolation_mode, int64_t paddin...
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/cpu/GridSamplerKernel.h
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import msgprint, _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_colu...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Copyright (C) 2018-2019 Matthias Klumpp <matthias@tenstral.net> # # Licensed under the GNU Lesser General Public License Version 3 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free...
unknown
codeparrot/codeparrot-clean
from textwrap import dedent import inspect from unittest import TestCase import pytest from jedi import cache from jedi.parser_utils import get_signature from jedi import Interpreter def assert_signature(Script, source, expected_name, expected_index=0, line=None, column=None): signatures = Script(source).get_sig...
unknown
codeparrot/codeparrot-clean
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> #include <hiredis.h> #include <async.h> #include <adapters/ae.h> /* Put event loop in the global scope, so it can be explicitly stopped */ static aeEventLoop *loop; void getCallback(redisAsyncContext *c, void *r, void *privdata) { red...
c
github
https://github.com/redis/redis
deps/hiredis/examples/example-ae.c
<?php namespace Illuminate\Testing\Constraints; use ArrayObject; use PHPUnit\Framework\Constraint\Constraint; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Exporter\Exporter; use Traversable; class ArraySubset extends Constraint { /** * @var iterable */ protected $subset...
php
github
https://github.com/laravel/framework
src/Illuminate/Testing/Constraints/ArraySubset.php
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. ```esql FROM employees | EVAL hired = DATE_FORMAT("yyyy", hire_date) | STATS avg_salary = AVG(salary) BY hired, languages.long | EVAL avg_salary = ROUND(avg_salary) | SORT hired, languages.long ```
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/commands/examples/stats.csv-spec/statsGroupByMultipleValues.md
<!-- Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. SPDX-License-Identifier: curl --> # HSTS support HTTP Strict-Transport-Security. Added as experimental in curl 7.74.0. Supported "for real" since 7.77.0. ## Standard [HTTP Strict Transport Security](https://datatracker.ietf.org/doc/html/rfc6797) ## Beha...
unknown
github
https://github.com/curl/curl
docs/HSTS.md
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-C...
python
github
https://github.com/scikit-learn/scikit-learn
examples/linear_model/plot_lasso_dense_vs_sparse_data.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
unknown
codeparrot/codeparrot-clean
import fixtures from authomatic.providers import openid conf = fixtures.get_configuration('openid_livejournal') OPENID_IDENTIFIER = 'http://{0}.livejournal.com/'.format(conf.user_login) CONFIG = { 'openid_identifier': OPENID_IDENTIFIER, 'pre_login_xpaths': [ '//*[@id="js"]/body/div[7]/header/span', ...
unknown
codeparrot/codeparrot-clean
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Example** ```esql ROW x = "2024-01-01"::datetime | EVAL y = x + "3 DAYS"::date_period, z = x - TO_DATEPERIOD("3 days"); ``` | x:datetime | y:datetime | z:datetime | | --- | --- | --- | | 2024-01-01 | ...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/examples/to_dateperiod.md
#!/usr/bin/env python import sys import tempfile from os import system #this is all kinds of quick and dirty, but until we can submit a pr to osm to have the bbox extract #give you presorted osm files this will have to do def is_primitive(xml): return xml.startswith('<node') or xml.startswith('<way') or xml.startsw...
unknown
codeparrot/codeparrot-clean
/** * Check that builtin roles contain valid permissions. * * @tags: [ * requires_sharding, * ] */ import {ShardingTest} from "jstests/libs/shardingtest.js"; function assertIsBuiltinRole(def, name, expectPrivs = false, expectAuthRest = false) { jsTest.log(tojson(def)); assert.eq(def.db, name.db); ...
javascript
github
https://github.com/mongodb/mongo
jstests/auth/builtin_roles.js
# frozen_string_literal: true # :markup: markdown require "nokogiri" require "action_dispatch/http/mime_type" module ActionDispatch class RequestEncoder # :nodoc: class IdentityEncoder def content_type; end def accept_header; end def encode_params(params); params; end def response_parse...
ruby
github
https://github.com/rails/rails
actionpack/lib/action_dispatch/testing/request_encoder.rb
"""SCons.Platform.os2 Platform-specific initialization for OS/2 systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ...
unknown
codeparrot/codeparrot-clean
/** * 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. */ export {transformFire} from './TransformFire';
typescript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/Transform/index.ts
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package stackeval import ( "context" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform/internal/promising" "github.com/hashicorp/terraform/internal/stacks/stackaddrs" "github.com/hashicorp/terraform/internal/stacks/stackconfig"...
go
github
https://github.com/hashicorp/terraform
internal/stacks/stackruntime/internal/stackeval/local_value_config.go
# frozen_string_literal: true module AbcHelper def bare_a() end end
ruby
github
https://github.com/rails/rails
actionpack/test/fixtures/helpers/abc_helper.rb
import unittest import time from django.test import TestCase from django.test.utils import override_settings from django.conf import settings from django.core import management from django.utils.six import StringIO from wagtail.tests.utils import WagtailTestUtils from wagtail.tests.search import models from wagtail.w...
unknown
codeparrot/codeparrot-clean
// Copyright The Prometheus 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 w...
go
github
https://github.com/prometheus/prometheus
tsdb/tsdbutil/dir_locker_test.go
/* 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 applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/lite/kernels/kernel_util.h
# coding=utf8 from flask import Flask from configs import settings from constants import FLASK_DOC_EXTENTION_KEY __all__ = ['create_app'] def create_app(): app = Flask(__name__) app.config.from_object(settings) extensions = configure_extensions(app) configure_template_filters(app) configure_hooks(...
unknown
codeparrot/codeparrot-clean
import requests import json import excel import jinja2 from collections import OrderedDict from requests.packages.urllib3.exceptions import InsecureRequestWarning JSON_ROOT_FOLDER = 'C:\\acixl\\jsondata\\' LAUNCHER_FILE = 'C:\\acixl\\launcher.json' APIC_URI = 'https://{apic}/api/node/{payload_uri}.json' # Disable url...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ usage: diff_monitor.py model_1.pkl model_2.pkl Prints any difference in which set of channels were monitored, then prints any difference in the length of the records, then prints the first record entry at which each channel differs and by how much. Does not report timing differences, since ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.constants import islinux, isosx, get_osx_version class Notifier(object...
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/garbagecollector/graph_builder.go
# -*- coding: utf-8 -*- # # Copyright 2012 - 2013 Brian R. D'Urso # # This file is part of Python Instrument Control System, also known as Pythics. # # Pythics 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 Foundati...
unknown
codeparrot/codeparrot-clean