code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#ifndef DIRENT_H
#define DIRENT_H
typedef struct DIR DIR;
#define DT_UNKNOWN 0
#define DT_DIR 1
#define DT_REG 2
#define DT_LNK 3
struct dirent {
unsigned char d_type; /* file type to prevent lstat after readdir */
char d_name[MAX_PATH * 3]; /* file name (* 3 for UTF-8 conversion) */
};
DIR *open... | c | github | https://github.com/git/git | compat/win32/dirent.h |
import numpy as np
import sympy as sp
def make(obj, exp):
for arg in range(obj.args):
print(arg.random())
class Addition(object):
def __init__(self):
self.args = [None] * 2
self.solution = None
def __getitem__(self, key):
return self.args[key]
def __setitem__(self, ke... | 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 | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from colle... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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.
import os
from profile_chrome import controllers_unittest
from profile_chrome import systrace_controller
class SystraceControllerTest(controllers_unittest.... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of the Hotwire Shell project API.
# Copyright (C) 2007 Colin Walters <walters@verbum.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 ... | unknown | codeparrot/codeparrot-clean | ||
@file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
package kotlinx.coroutines.flow
import kotlinx.coroutines.testing.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlin.test.*
class FlowCallbackTest : TestBase() {
@Test
fun testClosedPrematurely() = runTest {
val o... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/common/test/flow/channels/FlowCallbackTest.kt |
/*
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/authorizer/config.go |
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Willow Garage, 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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package configs
import (
"bufio"
"bytes"
"os"
"path/filepath"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/hcl/v2"
)
// TestParseLoadConfigFileSuccess is a simple test that just verifies that
// a number of tes... | go | github | https://github.com/hashicorp/terraform | internal/configs/parser_config_test.go |
from django.shortcuts import get_object_or_404, render, RequestContext, render_to_response
from repo.forms import UserForm, UserEditForm
from reg.forms import MyRegistrationForm
from reg.models import UserProfile
from django.contrib.auth.models import User
from django.contrib.auth.views import password_reset
from djang... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class Recipe < ActiveRecord::Base
belongs_to :chef
end | ruby | github | https://github.com/rails/rails | activerecord/test/models/recipe.rb |
# Copyright 2014 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 top level slice of a main thread can cause the webapp to behave
# unresponsively if its thread duration is greater than or equals to
# USER_PERCEIVABLE_D... | unknown | codeparrot/codeparrot-clean | ||
--
-- Test for various ALTER statements
--
-- clean-up in case a prior regression run failed
SET client_min_messages TO 'warning';
DROP DATABASE IF EXISTS sepgsql_test_regression_1;
DROP DATABASE IF EXISTS sepgsql_test_regression;
DROP USER IF EXISTS regress_sepgsql_test_user;
RESET client_min_messages;
-- @SECURITY-... | sql | github | https://github.com/postgres/postgres | contrib/sepgsql/sql/alter.sql |
# -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The Abseil 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 by applicable law or agree... | c | github | https://github.com/mysql/mysql-server | extra/abseil/abseil-cpp-20230802.1/absl/log/internal/log_impl.h |
/*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... | cpp | github | https://github.com/opencv/opencv | modules/core/test/test_lpsolver.cpp |
"""Forms for the ``paypal_express_checkout`` app."""
import httplib
import logging
import urllib2
import urlparse
from django import forms
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.http import Http404
from django... | unknown | codeparrot/codeparrot-clean | ||
##
# Copyright 2009-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Openstack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | unknown | codeparrot/codeparrot-clean | ||
from PIL import Image, ImageColor, ImageDraw, ImageFont
from utility.tools import TEMPDIR
import utility.logger
logger = utility.logger.getLogger(__name__)
BLACK = ImageColor.getrgb("black")
WHITE = ImageColor.getrgb("white")
# def draw_rotated_text(canvas: Image, text: str, font: ImageFont, xy: tuple, fill: ImageC... | unknown | codeparrot/codeparrot-clean | ||
export default function AuthorCard({ author }) {
return (
<a>
{author.first_name} {author.last_name}
</a>
);
} | javascript | github | https://github.com/vercel/next.js | examples/cms-buttercms/components/author-card.js |
from motuus.play.base_player import BasePlayer
class Player(BasePlayer):
"""This is the main class of motuus.
Use it to process Movement objects as they come in and to bind them to multimedia events.
An instance of this class is kept alive throughout every http session between the mobile device browser an... | unknown | codeparrot/codeparrot-clean | ||
"""The tests the for Locative device tracker platform."""
from unittest.mock import patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import locative
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN
from homeassistant.components.locative imp... | unknown | codeparrot/codeparrot-clean | ||
"""Feed generation core"""
from urlparse import urljoin
import datetime
import os
from django.conf import settings
from django.core.urlresolvers import reverse
from gruntle.memebot.models import SerializedData, Link
from gruntle.memebot.decorators import logged, locked
from gruntle.memebot.utils import AtomicWrite, ... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
#
# 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 Affero General Public L... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import logging
from collections import defaultdict
from typing import TYPE_CHECKING, Any
from tldextract import TLDExtract
from scrapy.exceptions import NotConfigured
from scrapy.http import Response
from scrapy.http.cookies import CookieJar
from scrapy.utils.decorators import _war... | python | github | https://github.com/scrapy/scrapy | scrapy/downloadermiddlewares/cookies.py |
"""OpenSSL/M2Crypto 3DES implementation."""
from cryptomath import *
from TripleDES import *
if m2cryptoLoaded:
def new(key, mode, IV):
return OpenSSL_TripleDES(key, mode, IV)
class OpenSSL_TripleDES(TripleDES):
def __init__(self, key, mode, IV):
TripleDES.__init__(self, key, mo... | unknown | codeparrot/codeparrot-clean | ||
---
name: Bug Report
about: Create a bug report.
---
Your issue may already be reported! Please search on the [Actix Web issue tracker](https://github.com/actix/actix-web/issues) before creating one.
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a ch... | unknown | github | https://github.com/actix/actix-web | .github/ISSUE_TEMPLATE/bug_report.md |
from cmparser import zpool_status,zpool_list_h, zpool_autoreplace, diskmap
from notifier import mail_notification
from daemon import Daemon
import time
from config import config
import logging
class zpoold(Daemon):
def run(self):
self.setUp()
def setUp(self):
logging.basicConfig(filename='log.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from optparse import make_option
from collections import OrderedDict
from importlib import import_module
import itertools
import traceback
from django.apps import apps
from django.core.management import call_command
from django.core.management.base import... | unknown | codeparrot/codeparrot-clean | ||
"""
Unit tests for calc.py
"""
import unittest
import numpy
import calc
from pyparsing import ParseException
# numpy's default behavior when it evaluates a function outside its domain
# is to raise a warning (not an exception) which is then printed to STDOUT.
# To prevent this from polluting the output of the tests, ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from datetime ... | unknown | codeparrot/codeparrot-clean | ||
"""
This file defines base tests for CoderBot
in order to test its functionality
The function run_test(varargin) lanuches tests
according to required test from the front-end.
e.g. varagrin = ["motor_test", "sonar_test"]
__test_encoder() and __test_sonar() will be launched.
If something goe... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright © 2022 Apple Inc.
#define AT_DISPATCH_MPS_TYPES(TYPE, NAME, ...) \
AT_DISPATCH_SWITCH( \
TYPE, \
NAME, ... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/mps/TensorFactory.h |
# -*- coding: utf-8 -*-
"""
pygments.formatters.bbcode
~~~~~~~~~~~~~~~~~~~~~~~~~~
BBcode formatter.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt
__all... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/platform/prefetch.h |
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can contain format strings; they'll
... | unknown | codeparrot/codeparrot-clean | ||
"""
Library Content XBlock Wrapper
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
class LibraryContentXBlockWrapper(PageObject):
"""
A PageObject representing a wrapper around a LibraryContent block seen in the LMS
"""
url = None
BODY_SELECTOR = '.xblock-stu... | unknown | codeparrot/codeparrot-clean | ||
//===--- APIDiffMigratorPass.cpp ------------------------------------------===//
//
// 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... | cpp | github | https://github.com/apple/swift | lib/Migrator/APIDiffMigratorPass.cpp |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
import sys
import os
import shutil
import inspect
im... | unknown | codeparrot/codeparrot-clean | ||
//
// Request+AlamofireTests.swift
//
// Copyright (c) 2022 Alamofire Software Foundation (http://alamofire.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 restrictio... | swift | github | https://github.com/Alamofire/Alamofire | Tests/Request+AlamofireTests.swift |
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
from models import DiscussionMarker
import re
from database import db_session
import sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument('identifiers', type=str, nargs='*',
help='Disqus iden... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2014 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/kubelet/types/pod_update_test.go |
import {mutate} from 'shared-runtime';
function component(a) {
let x = {a};
let y = {};
(function () {
let a = y;
a['x'] = x;
})();
mutate(y);
return y;
}
export const FIXTURE_ENTRYPOINT = {
fn: component,
params: ['foo'],
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/capturing-func-alias-receiver-computed-mutate-iife.js |
// 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.
package runtime_test
import (
"fmt"
"internal/goos"
"internal/runtime/atomic"
"math"
"math/rand"
. "runtime"
"testing"
"time"
)
// makePallocData prod... | go | github | https://github.com/golang/go | src/runtime/mgcscavenge_test.go |
#!/usr/bin/env bash
# Copyright 2022 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -euo pipefail
dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))"
source "$dir/teamcity-support.sh" # For $root
source "$dir/team... | unknown | github | https://github.com/cockroachdb/cockroach | build/teamcity/cockroach/ci/tests-ibm-cloud-linux-s390x/unit_tests.sh |
<?php
namespace Illuminate\Foundation\Console;
use Illuminate\Console\Command;
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Arr;
use LogicException;
use Symfony\Component\Console\Attribute\AsCommand;
use Throwable;
#[AsCommand(name: 'c... | php | github | https://github.com/laravel/framework | src/Illuminate/Foundation/Console/ConfigCacheCommand.php |
/* 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 law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/distributed_runtime/worker_interface.h |
"""Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <socket.h>
... | unknown | codeparrot/codeparrot-clean | ||
"""Energy Goal Test"""
import datetime
from apps.managers.team_mgr.models import Group
from apps.managers.player_mgr.models import Profile
from django.test import TransactionTestCase
from django.contrib.auth.models import User
from apps.managers.team_mgr.models import Team
from apps.utils import test_utils
from apps... | unknown | codeparrot/codeparrot-clean | ||
{
"__schema": {
"queryType": {
"name": "Query"
},
"mutationType": null,
"subscriptionType": null,
"types": [
{
"kind": "SCALAR",
"name": "String",
"description": null,
"fields": null,
"inputFields": null,
"interfaces": null,
"enum... | json | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/temp/GraphQLIntrospectionResult.json |
<% 1001.times do |i| %>
fixture_no_<%= i %>:
id: <%= i %>
book_id: <%= i*i %>
<% end %> | unknown | github | https://github.com/rails/rails | activerecord/test/fixtures/paragraphs.yml |
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '.'), '1234')
self.assertEqual(nformat(1234.2, '.'), '1234.2'... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | unknown | codeparrot/codeparrot-clean | ||
import {mutate} from 'shared-runtime';
function useFoo(props) {
let x = [];
x.push(props.bar);
if (props.cond) {
x = {};
x = [];
x.push(props.foo);
}
mutate(x);
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [{bar: 'bar', foo: 'foo', cond: true}],
sequentialRenders: ... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssa-renaming-with-mutation.js |
# Node.js C++ codebase
Hi! 👋 You've found the C++ code backing Node.js. This README aims to help you
get started working on it and document some idioms you may encounter while
doing so.
## Coding style
Node.js has a document detailing its [C++ coding style][]
that can be helpful as a reference for stylistic issues.... | unknown | github | https://github.com/nodejs/node | src/README.md |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.models import Rule
from sentry.plugins import plugins
from sentry.testutils import TestCase
from sentry.rules.processor import RuleProcessor
class RuleProcessorTest(TestCase):
# this test relies on a few other tests passing
def test_i... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for digital signatures used to validate messages to/from credit providers.
"""
from django.test import TestCase
from django.test.utils import override_settings
from openedx.core.djangoapps.credit import signature
@override_settings(CREDIT_PROVIDER_SECRET_KEYS={
"asu": 'abcd1234'
})
class SignatureTest(... | unknown | codeparrot/codeparrot-clean | ||
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2011, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/IlmImf/ImfOutputStreamMutex.h |
//===----------------------------------------------------------------------===//
//
// 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/readability/MagicNumbersCheck.h |
use std::cell::UnsafeCell;
use std::fmt;
use std::ops::Deref;
use std::panic;
/// `AtomicU32` providing an additional `unsync_load` function.
pub(crate) struct AtomicU32 {
inner: UnsafeCell<std::sync::atomic::AtomicU32>,
}
unsafe impl Send for AtomicU32 {}
unsafe impl Sync for AtomicU32 {}
impl panic::RefUnwindSa... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/loom/std/atomic_u32.rs |
from __future__ import unicode_literals
from django.apps.registry import apps as global_apps
from django.db import migrations
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor(object):
"""
End-to-end migration execution - loads... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# http://www.gavinj.net/2012/06/building-python-daemon-process.html
import os
import time
import logging
import rrdtool
# third party libs
from daemon import runner
# for solar monitoring
import socket
import re
import struct
###################################################################... | unknown | codeparrot/codeparrot-clean | ||
//! This module contains information need to view information about how the
//! runtime is performing.
//!
//! **Note**: This is an [unstable API][unstable]. The public API of types in
//! this module may break in 1.x releases. See [the documentation on unstable
//! features][unstable] for details.
//!
//! [unstable]: ... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/metrics/mod.rs |
/*-------------------------------------------------------------------------
*
* indexing.c
* This file contains routines to support indexes defined on system
* catalogs.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of Calif... | c | github | https://github.com/postgres/postgres | src/backend/catalog/indexing.c |
from langchain_core.prompts import PromptTemplate
DEFAULT_REFINE_PROMPT_TMPL = (
"The original question is as follows: {question}\n"
"We have provided an existing answer, including sources: {existing_answer}\n"
"We have the opportunity to refine the existing answer"
"(only if needed) with some more con... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/chains/qa_with_sources/refine_prompts.py |
// Code generated by "stringer -type=Severity"; DO NOT EDIT.
package tfdiags
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Error-69]
_ = x[Warning-87]
}
const... | go | github | https://github.com/hashicorp/terraform | internal/tfdiags/severity_string.go |
#!/usr/bin/env python3
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License.
#
# ==========================================================... | unknown | codeparrot/codeparrot-clean | ||
"""
per-test stdout/stderr capturing mechanism.
"""
from __future__ import absolute_import, division, print_function
import collections
import contextlib
import sys
import os
import io
from io import UnsupportedOperation
from tempfile import TemporaryFile
import six
import pytest
from _pytest.compat import CaptureIO... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of -maxuploadtarget.
* Verify that getdata requests for old blocks (>1week) are dropped
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 OpenStack Foundation
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
from django.core.management.base import LabelCommand, CommandError
from django.utils.encoding import force_unicode
class Command(LabelCommand):
help = "Outputs the specified model as a form definition to the shell."
args = "[app.model]"
label = 'application name and model name'
requires_model_validati... | unknown | codeparrot/codeparrot-clean | ||
import subprocess
from typing import Dict, List, Union
from flask import url_for
from sqlalchemy import create_engine
from sqlalchemy_utils import create_database, database_exists
from shared import configuration
from shared_web.flask_app import PDFlask
APP = PDFlask(__name__)
APP.config['SQLALCHEMY_TRACK_MODIFICAT... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.a... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('twitterclone', '0010_auto_20150331_1958'),... | unknown | codeparrot/codeparrot-clean | ||
import pickle
import io
from test import support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
from test.pickletester import AbstractPersistentPicklerTests
from test.pickletester import AbstractPicklerUnpicklerObjectTests
try:
import _pickle
has_c_i... | unknown | codeparrot/codeparrot-clean | ||
# urllib3/util.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from base64 import b64encode
from collections import namedtuple
from socket import error as Socket... | unknown | codeparrot/codeparrot-clean | ||
import os.path
import numpy as np
from numpy.testing import (assert_, assert_array_almost_equal, assert_equal,
assert_almost_equal, assert_array_equal,
suppress_warnings)
from pytest import raises as assert_raises
import scipy.ndimage as ndimage
from . import typ... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
"""
Copyright 2013 Jérémie BOUTOILLE
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 option) any later version.
This program is distri... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry import story
from page_sets import webgl_supported_shared_state
class MapsPage(page_module.Pa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import glob
import os
import sys
# This script is run from Build/<target>_default.build/$(PX4_BASE)/Firmware/src/systemcmds/topic_listener
# argv[1] must be the full path of the top Firmware dir
raw_messages = glob.glob(sys.argv[1]+"/msg/*.msg")
messages = []
message_elements = []
for index,m in ... | unknown | codeparrot/codeparrot-clean | ||
import squeakspace.common.util as ut
import squeakspace.common.util_http as ht
import squeakspace.proxy.server.db_sqlite3 as db
import squeakspace.common.squeak_ex as ex
import config
def post_handler(environ):
query = ht.parse_post_request(environ)
cookies = ht.parse_cookies(environ)
user_id = ht.get_re... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | python | github | https://github.com/ansible/ansible | lib/ansible/module_utils/facts/network/netbsd.py |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'about.ui',
# licensing of 'about.ui' applies.
#
# Created: Wed Nov 21 18:09:38 2018
# by: pyside2-uic running on PySide2 5.11.2
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore, QtGui, QtWidgets
cla... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
ANSIBLE_METADATA = {'status': ['deprecated'], 'sup... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | distribution/tools/plugin-cli/src/test/java/org/elasticsearch/plugins/cli/test_model/ExtensibleInterface.java |
"""Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import os
import os.path
import site
import sys
from distutils import sysconfig
from distutils.command.install import install, SCHEME_KEYS # noqa
from pip.compat import WINDOWS, expanduser
from pip.utils import appd... | unknown | codeparrot/codeparrot-clean | ||
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
function newName(param: boolean) {
if (param) {
return false;
}
return true;
} | typescript | github | https://github.com/angular/angular | adev/shared-docs/pipeline/shared/marked/test/docs-code/new-code.ts |
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2019 BayLibre, SAS
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/amlogic,meson-dwmac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic Meson DWMAC Ethernet controller
maintainers:
- Neil Armstrong <neil.armstrong@linar... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml |
"""
Form classes
"""
from __future__ import absolute_import, unicode_literals
import copy
from django.core.exceptions import ValidationError
from django.forms.fields import Field, FileField
from django.forms.util import flatatt, ErrorDict, ErrorList
from django.forms.widgets import Media, media_property, TextInput, ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package agent
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"testing"
"time"
ctconfig "github.com/hashicorp/consul-template/config"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/api"
agentConfig "github.com/hashi... | go | github | https://github.com/hashicorp/vault | command/agent/agent_auto_auth_self_heal_test.go |
// 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.
package runtime
import "unsafe"
func checkptrAlignment(p unsafe.Pointer, elem *_type, n uintptr) {
// nil pointer is always suitably aligned (#47430).
if p ... | go | github | https://github.com/golang/go | src/runtime/checkptr.go |
/* Copyright 2020 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/tpu/tpu_init_mode.h |
/*
Copyright 2019 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 | cmd/kube-apiserver/app/options/completion_test.go |
<!---
# 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... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/0.13.0/RELEASENOTES.0.13.0.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.