code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
Tests for OAuth token exchange views
"""
# pylint: disable=no-member
from datetime import timedelta
import json
import mock
import unittest
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
import httpretty
import provider.constants
from pro... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Install.py tool to do a generic build of a library
soft linked to by many of the lib/Install.py files
used to automate the steps described in the corresponding lib/README
"""
from __future__ import print_function
import sys, os, subprocess
from argparse import ArgumentParser
sys.path.append... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright (c) 2016, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (includ... | c | github | https://github.com/mysql/mysql-server | include/my_shm_defaults.h |
<!---
Copyright 2020 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/ko/pr_checks.md |
<input type="text" name="custom"> | html | github | https://github.com/django/django | tests/forms_tests/jinja2/forms_tests/custom_widget.html |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashb... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/testdata/output/latest_version/v9.no-op.v42.json |
from django.test import TestCase
from .models import Simple
class InitialSQLTests(TestCase):
# The format of the included SQL file for this test suite is important.
# It must end with a trailing newline in order to test the fix for #2161.
def test_initial_sql(self):
# As pointed out by #14661, te... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# :markup: markdown
module ActionController
module Testing
# Behavior specific to functional tests
module Functional # :nodoc:
def clear_instance_variables_between_requests
if defined?(@_ivars)
new_ivars = instance_variables - @_ivars
new_ivars... | ruby | github | https://github.com/rails/rails | actionpack/lib/action_controller/metal/testing.rb |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# 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 3 of the License, or
# (at your o... | unknown | codeparrot/codeparrot-clean | ||
<?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\Bridge\Twig\Extension;
use Symfony\Component\Serializer\Seriali... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Extension/SerializerRuntime.php |
import binascii
from django.contrib.gis.geos import (
GEOSGeometry,
Point,
Polygon,
WKBReader,
WKBWriter,
WKTReader,
WKTWriter,
)
from django.contrib.gis.geos.libgeos import geos_version_tuple
from django.test import SimpleTestCase
class GEOSIOTest(SimpleTestCase):
def test01_wktreader... | python | github | https://github.com/django/django | tests/gis_tests/geos_tests/test_io.py |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2008 One Laptop Per Child
# Copyright (C) 2009 Tomeu Vizoso
# Copyright (C) 2008-2013 Sugar Labs
# Copyright (C) 2013 Daniel Francis
# Copyright (C) 2013 Walter Bender
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalIndex,
Index,
MultiIndex,
)
class TestEquals:
def test_equals_categorical(self):
ci1 = CategoricalIndex(["a", "b"], categories=["a", "b"], ordered=True)
ci2 = CategoricalIndex(["a", "b"], categories=["a",... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexes/categorical/test_equals.py |
import zlib
from scrapy.utils.gz import gunzip
from scrapy.http import Response, TextResponse
from scrapy.responsetypes import responsetypes
class HttpCompressionMiddleware(object):
"""This middleware allows compressed (gzip, deflate) traffic to be
sent/received from web sites"""
def process_request(self... | unknown | codeparrot/codeparrot-clean | ||
"""
Management command `manage_user` is used to idempotently create or remove
Django users, set/unset permission bits, and associate groups by name.
"""
from django.contrib.auth import get_user_model
from django.contrib.auth.hashers import is_password_usable
from django.contrib.auth.models import Group, BaseUserManage... | 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 us... | unknown | github | https://github.com/apache/airflow | generated/README.md |
import datetime
import pytz
from django.core.urlresolvers import reverse
from mock import patch
from nose.plugins.attrib import attr
from courseware.access import has_access
from courseware.tests.helpers import CourseAccessTestMixin, LoginEnrollmentTestCase
from courseware.tests.factories import (
BetaTesterFacto... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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 appli... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/core/ATen_fwd.h>
#include <ATen/native/DispatchStub.h>
namespace at::native {
enum class NESTED_DENSE_OP : uint8_t { ADD, MUL };
using nested_dense_elementwise_fn = void (*)(
Tensor& result,
const Tensor& self,
const Tensor& other,
const NESTED_DENSE_OP& op);
DECLARE_DIS... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/nested/NestedTensorBinaryOps.h |
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.jetty
import io.ktor.server.application.*
import io.ktor.server.jetty.internal.*
import io.ktor.server.servlet.*
import io.ktor.utils.io.*
import org.eclipse.jetty.serv... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-jetty/jvm/src/io/ktor/server/jetty/JettyApplicationCall.kt |
# Author: Mr_Orange <mr_orange@hotmail.it>
#
# This file is part of SickRage.
#
# SickRage 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 versi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
name: (Runtime) Build and Test
on:
push:
branches: [main]
tags:
# To get CI for backport releases.
# This will duplicate CI for releases from main which is acceptable
- "v*"
pull_request:
paths-ignore:
- compiler/**
workflow_dispatch:
inputs:
commit_sha:
requ... | unknown | github | https://github.com/facebook/react | .github/workflows/runtime_build_and_test.yml |
def lower_ctr(str):
lower_ctr= 0
for i in range(len(str)):
if str[i] >= 'a' and str[i] <= 'z': lower_ctr += 1
return lower_ctr | unknown | mbpp | ||
import asyncio
from collections import defaultdict
from functools import partial
import json
import logging
import random
import uuid
from again.utils import unique_hex
import aiohttp
from retrial.retrial import retry
from .services import TCPServiceClient, HTTPServiceClient
from .pubsub import PubSub
from .packet im... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for the Config Entry Flow helper."""
from unittest.mock import Mock, patch
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.config import async_process_ha_core_config
from homeassistant.helpers import config_entry_flow
from tests.common import (
MockConfi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
GENDER = (
('I', 'não informado'),
('M', 'masculino'),
('F', 'feminino')
)
TREATMENT = (
('a', 'Arq.'),
('aa', 'Arqa.'),
('d', 'Dona'),
('dr', 'Dr.'),
('dra', 'Dra.'),
('e', 'Eng.'),
('ea', u'Engª.'),
('p', 'Prof.'),
('pa', 'Profa.'),
('sr', '... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
import... | unknown | codeparrot/codeparrot-clean | ||
from openstackx.api import base
class Tenant(base.Resource):
def __repr__(self):
return "<Tenant %s>" % self._info
@property
def id(self):
return self._info['id']
@property
def description(self):
return self._info['description']
@property
def enabled(self):
... | unknown | codeparrot/codeparrot-clean | ||
# dllexports2def.py
# from http://takumakei.blogspot.jp/2009/04/dlldef.html
#======================================================================
def dllexports2def(path):
from sys import stderr
from os.path import exists
if not exists(path):
print >>stderr, 'dllexports2def: %s is not found' % pa... | unknown | codeparrot/codeparrot-clean | ||
# author : Johann-Mattis List
# email : mattis.list@uni-marburg.de
# created : 2013-08-29 20:52
# modified : 2014-03-03 16:08
"""
Script converts raw msa data to nice html output.
"""
__author__="Johann-Mattis List"
__date__="2014-03-03"
from lingpyd import *
from lingpyd.convert.plot import *
from lingpyd.conv... | unknown | codeparrot/codeparrot-clean | ||
from south.db import db
from django.db import models
from feeddb.feed.models import *
class Migration:
def forwards(self, orm):
# Adding model 'StrainSetup'
db.create_table('feed_strainsetup', (
('setup_ptr', orm['feed.strainsetup:setup_ptr']),
))
db.send_create_signal... | unknown | codeparrot/codeparrot-clean | ||
<?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\Bridge\Twig\Tests\Node;
use PHPUnit\Framework\TestCase;
use Sym... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six import iteritems, text_type
"""
bootstrap client session
"""
import frappe
import frappe.defaults
import frappe.desk.desk_page
from frappe.desk.form.load import get_me... | unknown | codeparrot/codeparrot-clean | ||
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
class BackendTest(TestCase):
backend = 'django.contrib.... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2011-2018 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_BPF_H_INCLUDED_
#define _NGX_BPF_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include <linux/bpf.h>
typedef struct {
char *name;
int offset;
} ngx_bpf_reloc_t;
typedef struct {
char *license;
... | c | github | https://github.com/nginx/nginx | src/core/ngx_bpf.h |
from __future__ import division
import base64
import random
import sys
import time
from twisted.internet import defer
from twisted.python import log
import bitcoin.getwork as bitcoin_getwork, bitcoin.data as bitcoin_data
from bitcoin import helper, script, worker_interface
from util import forest, jsonrpc, variable,... | 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/kubeapiserver/options/authorization.go |
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Description**
Returns a date by parsing the second argument using the format specified in the first argument. | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/description/date_parse.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 b... | java | github | https://github.com/spring-projects/spring-framework | spring-aop/src/main/java/org/springframework/aop/scope/DefaultScopedObject.java |
import io
import locale
import mimetypes
import sys
import unittest
from test import support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
mimetypes._default_mime_types()
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
self.db = mimetypes.Mi... | unknown | codeparrot/codeparrot-clean | ||
'''Arsenal physical_racks UI'''
# Copyright 2015 CityGrid Media, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('monitors'... | unknown | codeparrot/codeparrot-clean | ||
# -*- test-case-name: twisted.words.test.test_domish -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DOM-like XML processing support.
This module provides support for parsing XML into DOM-like object structures
and serializing such structures to an XML string representation, optimized
... | 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 | core/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java |
from __future__ import absolute_import, division, print_function
import colorsys
from fractions import Fraction
import numpy as np
import pylab
import matplotlib as mpl
from matplotlib import pyplot as plt
from matplotlib.colors import LinearSegmentedColormap, ListedColormap
from smartFormat import smartFormat, TeX
... | unknown | codeparrot/codeparrot-clean | ||
import * as fakes from "../../_namespaces/fakes.js";
import * as ts from "../../_namespaces/ts.js";
import * as vfs from "../../_namespaces/vfs.js";
import { jsonToReadableText } from "../helpers.js";
import { baselineParseConfig } from "./helpers.js";
const caseInsensitiveBasePath = "c:/dev/";
const caseInsensitiveTs... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/config/matchFiles.ts |
framework:
csrf_protection: ~ | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/csrf_needs_session.yml |
# Copyright 2016 The Bazel 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 la... | unknown | codeparrot/codeparrot-clean | ||
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklable (module imports are okay... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | unknown | codeparrot/codeparrot-clean | ||
from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty, BooleanProperty
from kivy.lang import Builder
Builder.load_string('''
<FxDialog@Popup>
id: popup
title: 'Fiat Currency'
size_hint: 0.8, 0.8
pos_hint: {'top':0.9}
BoxLayout:
orientation: 've... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""Tests for course home page date summary blocks."""
from datetime import datetime, timedelta
from unittest import expectedFailure
import ddt
import waffle
from django.contrib.messages.middleware import MessageMiddleware
from django.urls import reverse
from django.test import RequestFactory
fr... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/grappler/optimizers/function_optimizer.h |
"use strict";
const path = require("path");
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
entry: "./example",
output: {
path: path.join(__dirname, "dist"),
filename: "MyLibrary.umd.js",
library: "MyLibrary",
libraryTarget: "umd"
}
};
module.export... | javascript | github | https://github.com/webpack/webpack | examples/harmony-library/webpack.config.js |
import six
from hamcrest.core.string_description import *
from hamcrest.core.selfdescribing import SelfDescribing
import re
import pytest
try:
import unittest2 as unittest
except ImportError:
import unittest
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.... | 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 tests ONTAP Ansible module: na_ontap_nvme_snapshot'''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
fro... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <type_traits>
#include <unordered_map>
#include <ATen/core/dynamic_type.h>
#include <ATen/core/jit_type_base.h>
#include <c10/macros/Macros.h>
namespace c10 {
template <typename T>
struct TORCH_API TypeFactoryBase {};
template <>
struct TORCH_API TypeFactoryBase<c10::DynamicType> {
template... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/core/type_factory.h |
/*-------------------------------------------------------------------------
*
* committsdesc.c
* rmgr descriptor routines for access/transam/commit_ts.c
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENT... | c | github | https://github.com/postgres/postgres | src/backend/access/rmgrdesc/committsdesc.c |
from enum import Enum
import logging
from ..address_translator import AT
l = logging.getLogger(name=__name__)
class SymbolType(Enum):
"""
ABI-agnostic symbol types
"""
TYPE_OTHER = 0
TYPE_NONE = 1
TYPE_FUNCTION = 2
TYPE_OBJECT = 3
TYPE_SECTION = 4
TYPE_TLS_OBJECT = 5
class Symbol... | unknown | codeparrot/codeparrot-clean | ||
import io
from pathod.language import actions, parse_pathoc, parse_pathod, serve
def parse_request(s):
return next(parse_pathoc(s))
def test_unique_name():
assert not actions.PauseAt(0, "f").unique_name
assert actions.DisconnectAt(0).unique_name
class TestDisconnects:
def test_parse_pathod(self):
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { addPluginListener, invoke, PluginListener } from './core'
import { Image } from './image'
import { Theme } from './window'
/**
* Identifier type used for data stores o... | typescript | github | https://github.com/tauri-apps/tauri | packages/api/src/app.ts |
use rustc_ast::LitKind;
use rustc_hir::attrs::AttributeKind;
use rustc_hir::{BinOpKind, Expr, ExprKind, TyKind, find_attr};
use rustc_middle::ty::RawPtr;
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::{Span, sym};
use crate::lints::{InvalidNullArgumentsDiag, UselessPtrNullChecksDiag};
use crate:... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_lint/src/ptr_nulls.rs |
import * as ts from "../_namespaces/ts.js";
describe("comment parsing", () => {
const withShebang = `#! node
/** comment */
// another one
;`;
const noShebang = `/** comment */
// another one
;`;
const withTrailing = `;/* comment */
// another one
`;
it("skips shebang", () => {
const result = t... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/comments.ts |
#!/usr/bin/python
#coding:utf-8
import sys
import pandas as pd
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import numpy as np
DB_CONNECT_STRING = 'sqlite:///stock_option_data.db'
engine = create_engine(DB_CONNECT_STRING,echo=False)
DB_CONNECT_STRING2 = 'sqlite:///stock_option_data2.db... | unknown | codeparrot/codeparrot-clean | ||
"""Different ways to combine documents."""
from langchain_classic.chains.combine_documents.reduce import (
acollapse_docs,
collapse_docs,
split_list_of_docs,
)
from langchain_classic.chains.combine_documents.stuff import (
create_stuff_documents_chain,
)
__all__ = [
"acollapse_docs",
"collapse... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chains/combine_documents/__init__.py |
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker
class GoogleMapException(Exception):
pass
# The default Google Maps URL (for the API javascript)
# TO... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
'''
calc.py: DNS-based calculator
Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz)
Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz)
This software is open source.
Redistribution and use in source and binary forms, with or without
modification, are permitted ... | unknown | codeparrot/codeparrot-clean | ||
"""
Django settings for redblue_project project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2009, Google 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... | unknown | codeparrot/codeparrot-clean | ||
package client
import (
"context"
"encoding/json"
"github.com/moby/moby/api/types/swarm"
)
// SwarmGetUnlockKeyResult contains the swarm unlock key.
type SwarmGetUnlockKeyResult struct {
Key string
}
// SwarmGetUnlockKey retrieves the swarm's unlock key.
func (cli *Client) SwarmGetUnlockKey(ctx context.Context)... | go | github | https://github.com/moby/moby | client/swarm_get_unlock_key.go |
/*-------------------------------------------------------------------------
*
* xlogbackup.c
* Internal routines for base backups.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/back... | c | github | https://github.com/postgres/postgres | src/backend/access/transam/xlogbackup.c |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/cli/commands/test_standalone_command.py |
#!/usr/bin/python
#
# Copyright (c) 2017 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.h |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, 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 Licens... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
# 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/licen... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: TJ Lane
# Contributors: Robert McGibbon, Jason Swails
#
# MDTr... | unknown | codeparrot/codeparrot-clean | ||
// 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/integration/clientv3/mirror_auth_test.go |
name: bazel
on:
workflow_call:
inputs:
build-environment:
required: true
type: string
description: Top-level label for what's being built/tested.
docker-image-name:
required: true
type: string
description: Name of the base docker image to build with.
... | unknown | github | https://github.com/pytorch/pytorch | .github/workflows/_bazel-build-test.yml |
import unittest
from ctypes import *
from test import test_support
class StringArrayTestCase(unittest.TestCase):
def test(self):
BUF = c_char * 4
buf = BUF("a", "b", "c")
self.assertEqual(buf.value, "abc")
self.assertEqual(buf.raw, "abc\000")
buf.value = "ABCD"
sel... | unknown | codeparrot/codeparrot-clean | ||
package container
import (
"os/exec"
"regexp"
"sort"
"testing"
containertypes "github.com/moby/moby/api/types/container"
mounttypes "github.com/moby/moby/api/types/mount"
"github.com/moby/moby/client"
"github.com/moby/moby/v2/integration/internal/container"
"github.com/moby/moby/v2/internal/testutil/request"... | go | github | https://github.com/moby/moby | integration/container/checkpoint_test.go |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: knownhosts
Arg: <file>
Protocols: SCP SFTP
Help: Specify knownhosts path
Category: ssh
Added: 8.17.0
Multi: single
See-also:
- hostpubsha256
- hostpubmd5
- insecure
- key
Example:
- --knownhosts filename --key h... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/knownhosts.md |
import numpy as np
from numpy import cos, sin, pi
#import gmin_ as GMIN
from pele.potentials import LJ
from pele.angleaxis import RBTopology, RBSystem, RigidFragment, RBPotentialWrapper
def make_otp():
"""this constructs a single OTP molecule"""
otp = RigidFragment()
otp.add_atom("O", np.array([0.0, -2./... | unknown | codeparrot/codeparrot-clean | ||
import sys
try:
from mykaze.tests import base
import mykaze.cursors
except:
# For local testing from top-level directory, without installing
sys.path.append('../mykaze')
from mykaze.tests import base
import mykaze.cursors
class TestSSCursor(base.PyMySQLTestCase):
def test_SSCursor(self):
... | unknown | codeparrot/codeparrot-clean | ||
import type { ExtractPropTypes, ExtractPublicPropTypes } from 'vue'
import { type Prettify, expectType } from './utils'
const propsOptions = {
foo: {
default: 1,
},
bar: {
type: String,
required: true,
},
baz: Boolean,
qux: Array,
} as const
// internal facing props
declare const props: Pretti... | typescript | github | https://github.com/vuejs/core | packages-private/dts-test/extractProps.test-d.ts |
config:
included-regions:
- ^docs/.*
- ^x-pack/docs/.*
excluded-regions: []
steps:
- label: docs-check
command: .ci/scripts/run-gradle.sh -Dignore.tests.seed precommit :docs:check
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2404
machineTyp... | unknown | github | https://github.com/elastic/elasticsearch | .buildkite/pipelines/pull-request/docs-check.yml |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CandidateList.platform'
db.add_column('polyorg_candidatelist', 'platform',
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
glashammer.bundles.auth
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2008-2009 by Glashammer Developers
:license: MIT
"""
import os
from glashammer.utils import (
render_response, sibpath, emit_event, redirect,
get_app, url_for
)
from glashammer.bundles.sessions import setu... | unknown | codeparrot/codeparrot-clean | ||
"""Interface to the libbzip2 compression library.
This module provides a file interface, classes for incremental
(de)compression, and functions for one-shot (de)compression.
"""
__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor",
"open", "compress", "decompress"]
__author__ = "Nadeem Vawda <nadeem.v... | unknown | codeparrot/codeparrot-clean | ||
from base64 import b64encode
from couchpotato.core.downloaders.base import Downloader, ReleaseDownloadList
from couchpotato.core.helpers.encoding import tryUrlencode, sp
from couchpotato.core.helpers.variable import cleanHost
from couchpotato.core.logger import CPLog
from urllib2 import URLError
from uuid import uuid4
... | unknown | codeparrot/codeparrot-clean | ||
# mako/template.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the Template class, a facade for parsing, generating and executing
template strings, ... | unknown | codeparrot/codeparrot-clean | ||
# really dumb example of using tree transformations w/asp
class ArrayMap(object):
def __init__(self):
self.pure_python = True
def map_using_trees(self, arr):
import asp.codegen.templating.template as template
import inspect
import asp.codegen.python_ast as ast
import a... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistr... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "support/schema_dumping_helper"
class PostgresqlNetworkTest < ActiveRecord::PostgreSQLTestCase
include SchemaDumpingHelper
class PostgresqlNetworkAddress < ActiveRecord::Base; end
setup do
@connection = ActiveRecord::Base.lease_connection
@co... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/adapters/postgresql/network_test.rb |
# coding: utf-8
from __future__ import unicode_literals
from .base_endpoint import BaseEndpoint
from boxsdk.util.translator import Translator
import json
class MetadataSearchFilter(object):
"""
Helper class to encapsulate a single search filter. A search filter can only search against one template,
but c... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.