code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Copyright (c) The Johns Hopkins University/Applied Physics Laboratory
# 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 | ||
"""
raven.utils.encoding
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import warnings
def force_unicode(s, encoding='utf-8', errors='strict'):
"""
Similar to smart_unicode, except that lazy instances are r... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Read More Link
===========================
This plugin inserts an inline "read more" or "continue" link into the last html element of the object summary.
For more information, please visit: http://vuongnguyen.com/creating-inline-read-more-link-python-pelican-lxml.html
"""
from pelican im... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
gspread.client
~~~~~~~~~~~~~~
This module contains Client class responsible for communicating with
Google Data API.
"""
import re
<<<<<<< 46798d67c38d2cf8e1c751b684897cdc98598205
<<<<<<< a69cd84f789e21aa91b9c488abd3dc4ac39c8361
import json
try:
import xml.etree.cElementTree as Elemen... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Optional
from typing_extensions import Literal, Required, TypedDict
__all__ = ["RealtimeMcpApprovalResponseParam"]
class RealtimeMcpApprovalResponseParam(TypedDict, total=False... | python | github | https://github.com/openai/openai-python | src/openai/types/realtime/realtime_mcp_approval_response_param.py |
use super::*;
#[test]
fn test_lookup_line() {
let source = "abcdefghijklm\nabcdefghij\n...".to_owned();
let mut sf = SourceFile::new(
FileName::Anon(Hash64::ZERO),
source,
SourceFileHashAlgorithm::Sha256,
Some(SourceFileHashAlgorithm::Sha256),
)
.unwrap();
sf.start_p... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_span/src/tests.rs |
from django.http import HttpResponse
from push_notifications.models import APNSDevice, GCMDevice
from rest_framework.views import APIView
import json
from .models import *
from .serializers import *
class AddIosDeviceView(APIView):
"""
Add iOS device.
device -- Device parameter (format string)
"""
... | unknown | codeparrot/codeparrot-clean | ||
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Image DFT Example</title>
<link href="js_example_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h2>Image DFT Example</h2>
<p>
<canvas> elements named <b>canvasInput</b> and <b>canvasOutput</b> have been prepared.<br>
Click <b>Try ... | html | github | https://github.com/opencv/opencv | doc/js_tutorials/js_assets/js_fourier_transform_dft.html |
#include "basics.h"
#include "reftable-fsck.h"
#include "reftable-table.h"
#include "stack.h"
static bool table_has_valid_name(const char *name)
{
const char *ptr = name;
char *endptr;
/* strtoull doesn't set errno on success */
errno = 0;
strtoull(ptr, &endptr, 16);
if (errno)
return false;
ptr = endptr;
... | c | github | https://github.com/git/git | reftable/fsck.c |
import unittest
from hypothesis import given
from hypothesis.specifiers import sampled_from, just
from segpy.encoding import EBCDIC, ASCII
from segpy.toolkit import format_extended_textual_header, CARDS_PER_HEADER, END_TEXT_STANZA, CARD_LENGTH
from test.strategies import multiline_ascii_encodable_text
class TestForm... | unknown | codeparrot/codeparrot-clean | ||
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | unknown | codeparrot/codeparrot-clean | ||
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will b... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from dateutil import relativedelta
from kardboard.models.kard import Kard
from kardboard.models.statelog import StateLog
class Funnel(object):
def __init__(self, state, config):
self.config = config
self.state = state
@property
def throughput(self):
return self.co... | unknown | codeparrot/codeparrot-clean | ||
# encoding=utf-8
# Generated by cpy
# 2015-04-20 14:38:56.338378
import os, sys
from sys import stdin, stdout
import socket
class SSDB_Response(object):
pass
def __init__(this, code='', data_or_message=None):
pass
this.code = code
this.data = None
this.message = None
if code=='ok':
pass
this.data =... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import unittest
import notam
from tests.test_helper import read_single_notam
class TestNotam(unittest.TestCase):
def test_parsed_fields(self):
expected_values = {
'A0623/91' : {
'notam_id' : 'A0623/91',
'notam_type' : 'NEW',
'fir' ... | unknown | codeparrot/codeparrot-clean | ||
#
# spyne - Copyright (C) Spyne contributors.
#
# This library 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 Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This librar... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from unittest import mock
class SampleObject:
def method_sample1(self): pass
def method_sample2(self): pass
class TestSealable(unittest.TestCase):
def test_attributes_return_more_mocks_by_default(self):
m = mock.Mock()
self.assertIsInstance(m.test, mock.Mock)
se... | python | github | https://github.com/python/cpython | Lib/test/test_unittest/testmock/testsealable.py |
from .base import Predicate
from .to_pred import to_pred
from .is_fixed import is_fixed
is_no_match = is_fixed(False, 'no_match', 'none of the conditions match')
def identity(data):
return data
class is_cond(Predicate):
"""
Generates a predicate that given pairs of condition and validation
predicates... | unknown | codeparrot/codeparrot-clean | ||
#
# ***** ALERTA SERVER DEFAULT SETTINGS -- DO NOT MODIFY THIS FILE *****
#
# To override these settings use /etc/alertad.conf or the contents of the
# configuration file set by the environment variable ALERTA_SVR_CONF_FILE.
#
# Further information on settings can be found at http://docs.alerta.io
DEBUG = False
BASE_... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Functions for discovering and clearing the build directory."""
import os
import sys
def IsFileNewerThanFile(file_a, file_b):
"""Returns True if fi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# intente algo como
def index(): return dict(message="hello from admin.py")
@auth.requires_login()
@auth.requires_membership('Administrador')
def teachers():
teacher_group = db1(db1.auth_group.role == "Docente").select()
id_teacher_group = teacher_group[0]['id']
arreglo_ids_docent... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2021 The Trax 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 a... | unknown | codeparrot/codeparrot-clean | ||
use crate::spec::{Abi, Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, TargetOptions, base};
// This target is for glibc Linux on Csky
pub(crate) fn target() -> Target {
Target {
//https://github.com/llvm/llvm-project/blob/8b76aea8d8b1b71f6220bc2845abc749f18a19b7/clang/lib/Basic/Targets/CSKY.h
... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2.rs |
#!/usr/bin/env python2
from struct import pack,unpack
# Poly in "reversed" notation -- http://en.wikipedia.org/wiki/Cyclic_redundancy_check
POLY = 0xedb88320 # CRC-32-IEEE 802.3
#POLY = 0x82F63B78 # CRC-32C (Castagnoli)
#POLY = 0xEB31D82E # CRC-32K (Koopman)
#POLY = 0xD5828281 # CRC-32Q
def build_crc_tables():
fo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for formmethod module.
"""
from twisted.trial import unittest
from twisted.python import formmethod
class ArgumentTestCase(unittest.TestCase):
def argTest(self, argKlass, testPairs, badValues, *args, **kwargs):
arg =... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | unknown | codeparrot/codeparrot-clean | ||
"""Bayesian Gaussian Mixture Model."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import math
import numpy as np
from scipy.special import betaln, digamma, gammaln
from .base import BaseMixture, _check_shape
from .gaussian_mixture impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
def emit(opcode,suffix,width,order,optype):
d = {}
d['opcode']=opcode
d['suffix']=suffix
d['order']=order
if width == 128:
d['op1']= 'xmm1'
d['op2']= 'xmm2'
d['op3']= 'xmm3'
if optype == 'rrr':
d['op3']= 'xmm3'
elif suffix ==... | unknown | codeparrot/codeparrot-clean | ||
/* Auto-generated by generate-wrappers.py script. Do not modify */
#if defined(__i386__) || defined(__i686__) || defined(__x86_64__)
#include <requantization/precise-sse4.c>
#endif /* defined(__i386__) || defined(__i686__) || defined(__x86_64__) */ | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/wrappers/requantization/precise-sse4.c |
# ngtcp2 and nghttp3
The ngtcp2 and nghttp3 dependencies provide the core functionality for
QUIC and HTTP/3.
The sources are pulled from:
* ngtcp2: https://github.com/ngtcp2/ngtcp2
* nghttp3: https://github.com/ngtcp2/nghttp3
In both the `ngtcp2` and `nghttp3` git repos, the active development occurs
in the default... | unknown | github | https://github.com/nodejs/node | deps/ngtcp2/README.md |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.tools.float_utils import float_compare
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
purchase_id = fields.Many2one('purchase.order', string='... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for the moving_obstacle module."""
import datetime
import time
from auvsi_suas.models import AerialPosition
from auvsi_suas.models import GpsPosition
from auvsi_suas.models import MovingObstacle
from auvsi_suas.models import UasTelemetry
from auvsi_suas.models import units
from auvsi_suas.models import Waypoi... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/qcom,spmi-flash-led.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Flash LED device inside Qualcomm Technologies, Inc. PMICs
maintainers:
- Fenglin Wu <quic_fenglinw@quicinc.com>
des... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml |
#pragma once
#include <ATen/DimVector.h>
#include <ATen/core/Dimname.h>
#include <c10/core/TensorOptions.h>
#include <c10/util/strides.h>
namespace at {
class Tensor;
namespace impl {
// Use this to define the prototype for a meta function. There are two
// versions; one that takes one argument (just the operator... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/TensorMeta.h |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package s3
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
"os"
"path"
"sort"
"strconv"
"strings"
"time"
"github.com/armon/go-metrics"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-... | go | github | https://github.com/hashicorp/vault | physical/s3/s3.go |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | unknown | codeparrot/codeparrot-clean | ||
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... | unknown | codeparrot/codeparrot-clean | ||
test_kind: js_test
selector:
roots:
- jstests/aggregation/**/*.js
exclude_files:
- jstests/aggregation/extras/*.js
- jstests/aggregation/data/*.js
# This test makes assertions about whether aggregations will need to spill to disk, which assumes
# all the data is located on a single shard.
-... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/aggregation_sharded_collections_passthrough.yml |
# Copyright (C) 2003 Python Software Foundation
import unittest
import unittest.mock
import shutil
import tempfile
import sys
import stat
import os
import os.path
import errno
import functools
import subprocess
import random
import string
import contextlib
import io
from shutil import (make_archive,
... | python | github | https://github.com/python/cpython | Lib/test/test_shutil.py |
#!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
/*[clinic input]
preserve
[clinic start generated code]*/
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
#include "pycore_modsupport.h... | c | github | https://github.com/python/cpython | Modules/clinic/gcmodule.c.h |
/*
* 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 | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BuildPlugin.java |
/* Copyright 2021 - 2025 R. Thomas
* Copyright 2021 - 2025 Quarkslab
*
* 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... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/PE/signature/attributes/SpcRelaxedPeMarkerCheck.cpp |
// Copyright 2011 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 net
import (
"errors"
"internal/strconv"
"sync"
"time"
_ "unsafe"
)
// BUG(mikio): On JS, methods and functions related to
// Interface are not i... | go | github | https://github.com/golang/go | src/net/interface.go |
"""Next gen sequence alignments with Bowtie2.
http://bowtie-bio.sourceforge.net/bowtie2/index.shtml
"""
import os
from bcbio.pipeline import config_utils
from bcbio.distributed.transaction import file_transaction
from bcbio.provenance import do
from bcbio import bam, utils
from bcbio.pipeline import datadict as dd
fr... | unknown | codeparrot/codeparrot-clean | ||
"""
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31",
... description="A group Weblog by the sharpes... | unknown | codeparrot/codeparrot-clean | ||
export function getStaticProps() {
return { props: {} }
}
class Test extends React.Component {
render() {
return <div />
}
}
export default Test | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/should-support-class-exports-2/input.js |
<?php
namespace Illuminate\Routing;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
class RedirectController extends Controller
{
/**
* Invoke the controller method.
*
* @param \Illuminate\Http\Request $request
... | php | github | https://github.com/laravel/framework | src/Illuminate/Routing/RedirectController.php |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import View
from django.utils.decorators import method_decorator
from ...core.utils.decorators import moderator_required
from ...comment.models import Comment, CL... | 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 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/context/event/SourceFilteringListener.java |
from unittest import TestCase
from scrapy.http import Response, Request
from scrapy.spider import BaseSpider
from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware
class TestOffsiteMiddleware(TestCase):
def setUp(self):
self.spider = self._get_spider()
self.mw = OffsiteMiddleware()... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.impl.base.lifetime
import com.intellij.openapi.project.Project
impo... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/lifetime/KaBaseLifetimeTracker.kt |
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ingate Systems AB
# 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 os
from units.compat.mock import patch
from ansible.modules.net... | unknown | codeparrot/codeparrot-clean | ||
"""Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class BellMediaIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?P<domain>
(?:
ctv|
tsn|
bnn(?:bloomberg)?|
thecomedy... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
"""
see this post
http://www.onurguzel.com/
how-to-run-flask-applications-with-nginx-using-gunicorn/
"""
import argparse
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.contrib.fixers import ProxyFix
from quokka import create_app, create_api
from q... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2013 Radware LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | unknown | codeparrot/codeparrot-clean | ||
import json
import os
from catalog import app
def delete_test_file(filename):
"""Delete a named file used for testing purposes.
"""
file_path = os.path.join(
os.path.dirname(__file__), filename)
os.remove(file_path)
return
def get_google_client_id():
"""Since we have to do this a numb... | unknown | codeparrot/codeparrot-clean | ||
from operator import attrgetter
from django.test.testcases import TestCase
from .models import Address, Contact, Customer
class TestLookupQuery(TestCase):
@classmethod
def setUpTestData(cls):
cls.address = Address.objects.create(company=1, customer_id=20)
cls.customer1 = Customer.objects.crea... | python | github | https://github.com/django/django | tests/foreign_object/test_agnostic_order_trimjoin.py |
# Copyright 2017 Great Software Laboratory Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/migrations/versions/0037_3_0_0_add_backfill_to_dag_run_model.py |
package plugin
import (
"sort"
)
// ListResponse contains the response for the Engine API
type ListResponse []Plugin
// Privilege describes a permission the user has to accept
// upon installing a plugin.
type Privilege struct {
Name string
Description string
Value []string
}
// Privileges is a lis... | go | github | https://github.com/moby/moby | api/types/plugin/plugin_responses.go |
from django.urls import path
from . import views
urlpatterns = [
path("condition/", views.index),
path("condition/last_modified/", views.last_modified_view1),
path("condition/last_modified2/", views.last_modified_view2),
path("condition/etag/", views.etag_view1),
path("condition/etag2/", views.eta... | python | github | https://github.com/django/django | tests/conditional_processing/urls.py |
from numpy import (
logspace, linspace, geomspace, dtype, array, sctypes, arange, isnan,
ndarray, sqrt, nextafter, stack
)
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_array_equal, assert_allclose,
)
class PhysicalQuantity(float):
def __new__(cls, value):
ret... | unknown | codeparrot/codeparrot-clean | ||
import contextlib
import os
from testtools import TestCase
from mock import Mock
from troveclient import base
from troveclient import exceptions
"""
Unit tests for base.py
"""
def obj_class(self, res, loaded=True):
return res
class BaseTest(TestCase):
def test_getid(self):
obj = "test"
r =... | unknown | codeparrot/codeparrot-clean | ||
// @validatePreserveExistingMemoizationGuarantees
import {useMemo} from 'react';
import {Stringify} from 'shared-runtime';
// derived from https://github.com/facebook/react/issues/32261
function Component({items}) {
const record = useMemo(
() =>
Object.fromEntries(
items.map(item => [item.id, ref =... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-object-fromEntries-entries.js |
"""Automatically adapted for numpy Sep 19, 2005 by convertcode.py
"""
import functools
import warnings
__all__ = ['iscomplexobj', 'isrealobj', 'imag', 'iscomplex',
'isreal', 'nan_to_num', 'real', 'real_if_close',
'typename', 'mintypecode',
'common_type']
import numpy._core.numeric as... | python | github | https://github.com/numpy/numpy | numpy/lib/_type_check_impl.py |
/* Copyright 2024 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/tfrt/ifrt/ifrt_loaded_variable_registry.h |
import time
from datetime import datetime, timedelta
import mock
from odoo.tests import common
def freeze_time(dt):
mock_time = mock.Mock()
mock_time.return_value = time.mktime(dt.timetuple())
return mock_time
class TestModelClaim(common.SavepointCase):
@classmethod
def setUpClass(cls):
... | unknown | codeparrot/codeparrot-clean | ||
name: Crowdin Download Action
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
download-sources-from-crowdin:
if: github.repository == 'grafana/grafana'
uses: grafana/grafana-github-actions/.github/workflows/crowdin-download.yml@main
with:
crowdin_project_id: 5
pr_labels: '... | unknown | github | https://github.com/grafana/grafana | .github/workflows/i18n-crowdin-download.yml |
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.utils.io.charsets
import org.khronos.webgl.*
internal fun Decoder(encoding: String, fatal: Boolean = true): Decoder = try {
TextDecoder(encoding, textDecoderOptions(fatal... | kotlin | github | https://github.com/ktorio/ktor | ktor-io/js/src/io/ktor/utils/io/charsets/Decoder.js.kt |
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/cirrus,lochnagar.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Cirrus Logic Lochnagar Audio Development Board
maintainers:
- patches@opensource.cirrus.com
description: |
Lochnagar ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/clock/cirrus,lochnagar.yaml |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseOverview'
db.create_table('course_overviews_courseov... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to u... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistri... | unknown | codeparrot/codeparrot-clean | ||
#
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']
import sys
import os
import threading
import collections
import time
import types
import weakref
import errno
from... | python | github | https://github.com/python/cpython | Lib/multiprocessing/queues.py |
"""The tests for the WSDOT platform."""
from datetime import datetime, timedelta, timezone
import re
import unittest
import requests_mock
import homeassistant.components.wsdot.sensor as wsdot
from homeassistant.components.wsdot.sensor import (
ATTR_DESCRIPTION,
ATTR_TIME_UPDATED,
CONF_API_KEY,
CONF_ID... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:et:
__doc__ = """ A class for an identifier parsed by the preprocessor.
It contains it's name, arguments and macro value.
"""
import sys
import copy
from typing import Optional
from .macrocall import MacroCall
from src.api.debug import __DEBUG__
from .outpu... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.urls import url
from django.contrib import admin
from fluent_contents.admin import PlaceholderEditorAdmin
from fluent_contents.analyzer import get_template_placeholder_data
from fluent_utils.ajax import JsonResponse
from mezzanine.pages.admin import PageAdmin
from . import models, widgets
class Fluen... | unknown | codeparrot/codeparrot-clean | ||
import os
import unittest
from conans.paths import (BUILD_FOLDER, PACKAGES_FOLDER, EXPORT_FOLDER, SimplePaths, CONANINFO)
from conans.model.ref import ConanFileReference
from conans.test.utils.test_files import temp_folder
from conans.search.search import DiskSearchManager, DiskSearchAdapter
from conans.util.files impo... | unknown | codeparrot/codeparrot-clean | ||
function Component() {
const onClick = () => {
// Cannot assign to globals
someUnknownGlobal = true;
moduleLocal = true;
};
// It's possible that this could be an event handler / effect function,
// but we don't know that and optimistically assume it will only be
// called by an event handler or e... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-reassignment-to-global-function-jsx-prop.js |
import gc
from numba import jit, int32
import unittest
def foo(a, b):
return a + b
def bar(a, b):
return cfoo(a, b) + b
@jit
def inner(x, y):
return x + y
@jit(nopython=True)
def outer(x, y):
return inner(x, y)
class TestInterProc(unittest.TestCase):
def test_bar_call_foo(self):
globa... | unknown | codeparrot/codeparrot-clean | ||
{
"terraform_source_bundle": 1,
"packages": [
{
"source": "git::https://example.com/foo.git",
"local": "foo",
"meta": {}
},
{
"source": "git::https://example.com/bar.git",
"local": "bar",
"meta": {}
},
{
"source": "git::https://example.com/baz.git",
... | json | github | https://github.com/hashicorp/terraform | internal/rpcapi/testdata/sourcebundle/terraform-sources.json |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | unknown | codeparrot/codeparrot-clean | ||
/* 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/core/grappler/optimizers/constant_folding.h |
use crate::spec::{
Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetMetadata, base,
};
pub(crate) fn target() -> Target {
let mut base = base::openbsd::opts();
base.rustc_abi = Some(RustcAbi::X86Sse2);
base.cpu = "pentium4".into();
base.max_atomic_width = Some(64);
base.add_... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/i686_unknown_openbsd.rs |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations \u0026 Alerts",
"type": "dashboard"
}
]
},
"e... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/input/migrated_dev_dashboards/panel-timeseries/v1beta1.timeseries-soft-limits.v42.json |
from __future__ import print_function
import sys
import re
from pybindgen.typehandlers import base as typehandlers
from pybindgen import ReturnValue, Parameter
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
from pybindgen.typehandlers.codesink import MemoryCodeSink
from pybindgen.t... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
# module PyQt4.QtCore
# from /usr/lib/python2.7/dist-packages/PyQt4/QtCore.so
# by generator 1.135
# no doc
# imports
import sip as __sip
from QObject import QObject
class QPluginLoader(QObject):
"""
QPluginLoader(QObject parent=None)
QPluginLoader(QString, QObject parent=None)
"""
... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | java | github | https://github.com/tensorflow/tensorflow | tensorflow/java/src/test/java/org/tensorflow/SessionTest.java |
# Class to grab frames from a window.
# (This has fewer user-settable parameters than Displayer.)
# It is the caller's responsibility to initialize the window and to
# ensure that it is current when using grabframe()
import gl, GL
import VFile
import GET
from VFile import Error
class VGrabber(VFile.VideoParams):
# ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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 agreed to in writing, s... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
from ..utils import (
determine_ext,
unified_strdate,
)
class WDRIE(InfoExtractor):
_PLAYER_REGEX = '-(?:video|audio)player(?:_siz... | unknown | codeparrot/codeparrot-clean | ||
# test for xml.dom.minidom
import pickle
from test.support import run_unittest, findfile
import unittest
import xml.dom.minidom
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplementation
tstfile = findfile("test.xml", subdir="xmltestdata")
# The tests of Documen... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/AssertExtensions.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.