code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from __future__ import unicode_literals
import os
from collections import OrderedDict
from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import FileSystemStorage
from django.core.management.base import BaseComman... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
# encoding: 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 'Range.proxy_class'
db.add_column('offer_range', 'proxy_class', self.gf('django.db.models.fields.Ch... | unknown | codeparrot/codeparrot-clean | ||
"""
Receive data from Pupil using ZMQ.
"""
import logging
import zmq
from msgpack import loads
handlers = (logging.StreamHandler(), logging.FileHandler("monitor.log", mode="w"))
logging.basicConfig(handlers=handlers, level=logging.DEBUG)
logger = logging.getLogger()
context = zmq.Context()
# open a req port to talk ... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* inval.c
* POSTGRES cache invalidation dispatcher code.
*
* This is subtle stuff, so pay attention:
*
* When a tuple is updated or deleted, our standard visibility rules
* consider that it is *still valid* so long as we are in the ... | c | github | https://github.com/postgres/postgres | src/backend/utils/cache/inval.c |
from django.http import HttpResponseBadRequest, HttpResponseServerError
from django.shortcuts import render
from django_summernote.models import Attachment
from django_summernote.settings import summernote_config
from django_summernote.widgets import SummernoteWidgetBase
def editor(request, id):
return render(
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
This file is part of zoteromarkdown.
zoteromarkdown 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.
zoteromarkd... | unknown | codeparrot/codeparrot-clean | ||
//===--- FeatureModule.h - Plugging features into clangd ----------*-C++-*-===//
//
// 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/clangd/FeatureModule.h |
# Copyright 2012 OpenStack LLC.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | unknown | codeparrot/codeparrot-clean | ||
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/regexp-syntax.html
---
# Regular expression syntax [regexp-syntax]
A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) is a way to match patterns in data using placeholder characters, called operators.
{{es}} s... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/query-dsl/regexp-syntax.md |
import numpy as np
from numpy.testing import assert_
import scipy.special.orthogonal as orth
from scipy.special._testutils import FuncData
def test_eval_chebyt():
n = np.arange(0, 10000, 7)
x = 2*np.random.rand() - 1
v1 = np.cos(n*np.arccos(x))
v2 = orth.eval_chebyt(n, x)
assert_(np.allclose(v1, v... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/es6/computedProperties/computedPropertyNames17_ES6.ts] ////
//// [computedPropertyNames17_ES6.ts]
var b: boolean;
class C {
get [b]() { return 0;}
static set [true](v) { }
get [[]]() { return 0; }
set [{}](v) { }
static get [undefined]() { return 0; }
set [null](v)... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/computedPropertyNames17_ES6.js |
import os
# Use 'final' as the 4th element to indicate
# a full release
VERSION = (0, 0, 1, 'alpha', 0)
def get_short_version():
return '%s.%s' % (VERSION[0], VERSION[1])
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
# Append 3rd digit if > 0
version = '%... | unknown | codeparrot/codeparrot-clean | ||
import functools
import unittest
import six
class QuietTestRunner(object):
def run(self, suite):
result = unittest.TestResult()
suite(result)
return result
def repeat_with_success_at_least(times, min_success):
"""Decorator for multiple trial of the test case.
The decorated test ... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 model 'UserProfile'
db.create_table('user_profile', (
(u'id', self.gf('django.db.models.... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2010-2013 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
# Copyright (C) 2019 Yann E. MORIN <yann.morin.1998@free.fr>
import logging
import os
import subprocess
from collections import defaultdict
# This function returns a tuple of four dictionaries, all using package
# names as keys:
# - a di... | unknown | codeparrot/codeparrot-clean | ||
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: latin-1 -*-
# Copyright Gottfried Ganßauge 2003..2006. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from opaque_ext import *
Check for correct conversion
>>> use(get())
Check that... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/TargetState.java |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Dict, Union, Iterable, Optional
from typing_extensions import Literal, Required, TypedDict
from ..._types import SequenceNotStr
__all__ = ["ResponseFileSearchToolCallParam", "R... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/response_file_search_tool_call_param.py |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
from lib.bucket import BUCKET_ID
from lib.subcommand import SubCommand
class StacktraceCommand(SubCommand):
def __init__(self):
super(Stac... | unknown | codeparrot/codeparrot-clean | ||
#ifndef BOOST_DESCRIBE_BASES_HPP_INCLUDED
#define BOOST_DESCRIBE_BASES_HPP_INCLUDED
// Copyright 2020, 2021 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/describe/modifiers.hpp>
#include <boost/describe/detail/void_t.hpp>
#include <b... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/describe/bases.hpp |
#! /usr/bin/python
# -*- coding: utf-8 -*-
## Copyright (C) 2014 Bitergia
##
## 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... | 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-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2019 Piotr Wojciechowski (@wojciechowskipiotr) <piotr@it-playground.pl>
# (c) Thierry Bouvet (@tbouvet)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
try:
from docker.errors import APIError
except ImportError:
# missing docker-py handled in ansi... | unknown | codeparrot/codeparrot-clean | ||
---
navigation_title: "Microsoft SQL"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/es-connectors-ms-sql.html
---
# Elastic Microsoft SQL connector reference [es-connectors-ms-sql]
The *Elastic Microsoft SQL connector* is a [connector](/reference/search-connectors/index.md) for [Mi... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/search-connectors/es-connectors-ms-sql.md |
<?php
namespace Illuminate\Broadcasting\Broadcasters;
use Illuminate\Support\Str;
trait UsePusherChannelConventions
{
/**
* Return true if the channel is protected by authentication.
*
* @param string $channel
* @return bool
*/
public function isGuardedChannel($channel)
{
... | php | github | https://github.com/laravel/framework | src/Illuminate/Broadcasting/Broadcasters/UsePusherChannelConventions.php |
// should only use types from @babel/types
// do not import runtime methods
import type {
BlockStatement,
ForInStatement,
ForOfStatement,
ForStatement,
Function,
Identifier,
Node,
ObjectProperty,
Program,
SwitchCase,
SwitchStatement,
} from '@babel/types'
import { walk } from 'estree-walker'
/**
... | typescript | github | https://github.com/vuejs/core | packages/compiler-core/src/babelUtils.ts |
import os
import stat
import sys
import tempfile
from os.path import join, normcase, normpath, abspath, isabs, sep, dirname
from django.core.exceptions import SuspiciousFileOperation
from django.utils.encoding import force_text
from django.utils import six
try:
WindowsError = WindowsError
except NameError:
cl... | unknown | codeparrot/codeparrot-clean | ||
# آليات الانتباه
تستخدم معظم نماذج المحول (Transformer) الانتباه الكامل بحيث تكون مصفوفة الانتباه ذات الأبعاد المتساوية. ويمكن أن يمثل ذلك عقبة حسابية كبيرة عندما تكون لديك نصوص طويلة. ويعد Longformer وReformer من النماذج التي تحاول أن تكون أكثر كفاءة وتستخدم نسخة مخففة من مصفوفة الانتباه لتسريع التدريب.
## انتباه LS... | unknown | github | https://github.com/huggingface/transformers | docs/source/ar/attention.md |
/*
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 | pkg/controller/volume/attachdetach/config/v1alpha1/conversion.go |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
''' Script to check the correctness of the analysis. The analysis is done on raw data and all results are compared to a recorded analysis.
'''
import os
import shutil
import unittest
from testbeam_analysis import track_analysis
from testbeam_analysis.tools import analysis_utils, test_tools
testing_path = os.path.dirn... | unknown | codeparrot/codeparrot-clean | ||
import os
import pytest
from vcr import VCR, use_cassette
from vcr.compat import mock
from vcr.request import Request
from vcr.stubs import VCRHTTPSConnection
def test_vcr_use_cassette():
record_mode = mock.Mock()
test_vcr = VCR(record_mode=record_mode)
with mock.patch(
'vcr.cassette.Cassette.loa... | 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
"""Tests for metrics.py"""
from dataclasses import dataclass
import requests
import unittest
import unittest.mock
import... | python | github | https://github.com/llvm/llvm-project | .ci/metrics/metrics_test.py |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
js_to_json,
unified_strdate,
)
class SportBoxIE(InfoExtractor):
_VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P<display_i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import json
from django.contrib.auth import get_permission_codename
from django.contrib.sites.models import Site
from django.http import HttpResponse
from django.shortcuts import render
from django.utils.encoding import smart_str
from cms.constants import PUBLISHER_STATE_PENDING, PUBLISHER_STA... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2025 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package backup
import (
"context"
"math"
"github.com/cockroachdb/cockroach/pkg/backup/backuppb"
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockro... | go | github | https://github.com/cockroachdb/cockroach | pkg/backup/compaction_policy.go |
from django.test import TestCase
from .models import BigS, UnicodeSlugField
class SlugFieldTests(TestCase):
def test_slugfield_max_length(self):
"""
SlugField honors max_length.
"""
bs = BigS.objects.create(s="slug" * 50)
bs = BigS.objects.get(pk=bs.pk)
self.assertE... | python | github | https://github.com/django/django | tests/model_fields/test_slugfield.py |
from datetime import timedelta
import numpy as np
import pytest
from pandas._libs.tslibs.period import IncompatibleFrequency
from pandas import (
NaT,
Period,
Timedelta,
Timestamp,
offsets,
)
class TestPeriodArithmetic:
def test_add_overflow_raises(self):
# GH#55503
per = Tim... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/scalar/period/test_arithmetic.py |
"""Skeletons for Python 3 built-in symbols."""
import os
def abs(number):
"""Return the absolute value of the argument.
:type number: T
:rtype: T | unknown
"""
return number
def all(iterable):
"""Return True if bool(x) is True for all values x in the iterable.
:type iterable: collection... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# vim: tabstop=4 shiftwidth=4
# 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; only version 2 of the License is applicable.
#
# This program is distributed in the hope th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Compare capillary vs. lobSTR calls
This script is part of lobSTR_validation_suite.sh and
is not mean to be called directly.
"""
import argparse
import numpy as np
import pandas as pd
import sys
from scipy.stats import pearsonr
def ConvertSample(x):
"""
Convert HGDP samples numbers t... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .chat import (
Chat,
AsyncChat,
ChatWithRawResponse,
AsyncChatWithRawResponse,
ChatWithStreamingResponse,
AsyncChatWithStreamingResponse,
)
from .completions import (
Completions,
AsyncCompletions... | python | github | https://github.com/openai/openai-python | src/openai/resources/chat/__init__.py |
// Copyright 2018 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
// Package keys manages the construction of keys for CockroachDB's key-value
// layer.
//
// The keys package is necessarily tightly coupled to the storage package. In
/... | go | github | https://github.com/cockroachdb/cockroach | pkg/keys/doc.go |
from __future__ import unicode_literals
template = {
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template Route53_RoundRobin: Sample template showing how to use weighted round robin (WRR) DNS entried via Amazon Route 53. This contrived sample uses weighted CNAME records t... | unknown | codeparrot/codeparrot-clean | ||
'''
class Aniaml:
count = 10
def __init__(self,name):
self.name = name
self.num = None
hobbie = 'meat'
@classmethod #类方法,不能访问实例变量
def talk(self):
print('%s is talking ...'%self.hobbie )
@staticmethod #静态方法,不能访问类变量及实例变量
def walk():
print('is walking ...')
... | unknown | codeparrot/codeparrot-clean | ||
from datetime import date, datetime, timedelta
from django.test import TestCase
from django_date_validators import validators
class DateIsFutureTestCase(TestCase):
"""
"""
def test_valid(self):
past_date = date.today() - timedelta(days=1)
present_date = date.today()
future_date = d... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import re
from django.db import models, connection, transaction
from django.db.utils import IntegrityError
from django.core.exceptions import ValidationError
from django.forms.models import model_to_dict
from ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.distrib}.
"""
from os.path import abspath
from xml.dom.minidom import parseString
try:
import pwd
except ImportError:
pwd = None
from zope.interface.verify import verifyObject
from twisted.python import log, ... | unknown | codeparrot/codeparrot-clean | ||
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# FoFiX #
# Copyright (C) 2009 Pascal Giard <evily... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# Timeout long-running blocks
#
# == Synopsis
#
# require 'timeout'
# status = Timeout.timeout(5) {
# # Something that should be interrupted if it takes more than 5 seconds...
# }
#
# == Description
#
# Timeout provides a way to auto-terminate a potentially long-running
# operati... | ruby | github | https://github.com/ruby/ruby | lib/timeout.rb |
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | unknown | codeparrot/codeparrot-clean | ||
from flask import Flask, render_template
from requests import Session, RequestException
import json
import os
from werkzeug.routing import BaseConverter
app = Flask(__name__)
class RegexConverter(BaseConverter):
def __init__(self, url_map, *items):
super(RegexConverter, self).__init__(url_map)
se... | unknown | codeparrot/codeparrot-clean | ||
import { jsonToReadableText } from "../helpers.js";
import { verifyTsc } from "../helpers/tsc.js";
import { TestServerHost } from "../helpers/virtualFileSystemWithWatch.js";
describe("unittests:: tsbuild:: configFileExtends:: when tsconfig extends another config", () => {
function getConfigExtendsWithIncludeSys() ... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/tsbuild/configFileExtends.ts |
<!--Copyright 2021 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/layoutlmv2.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-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/INestedTestBean.java |
---
name: Bug report
about: Let us know about a bug!
title: ''
labels: ''
assignees: ''
---
<!-- Please reserve GitHub issues for bug reports and feature requests.
For questions, the best place to get answers is on our [discussion forum](https://discuss.hashicorp.com/c/vault), as they will get more visibility from e... | unknown | github | https://github.com/hashicorp/vault | .github/ISSUE_TEMPLATE/bug_report.md |
import datetime
from unittest import mock
from django.contrib.postgres.indexes import OpClass
from django.core.checks import Error
from django.core.exceptions import ValidationError
from django.db import IntegrityError, connection, transaction
from django.db.models import (
CASCADE,
CharField,
CheckConstra... | python | github | https://github.com/django/django | tests/postgres_tests/test_constraints.py |
"""Local Nest authentication."""
import asyncio
from functools import partial
from homeassistant.core import callback
from . import config_flow
from .const import DOMAIN
@callback
def initialize(hass, client_id, client_secret):
"""Initialize a local auth provider."""
config_flow.register_flow_implementation(
... | unknown | codeparrot/codeparrot-clean | ||
use std::fs::OpenOptions;
use std::io::prelude::*;
use rustc_middle::ty::{self, ClosureSizeProfileData, Instance, TyCtxt};
/// For a given closure, writes out the data for the profiling the impact of RFC 2229 on
/// closure size into a CSV.
///
/// During the same compile all closures dump the information in the same... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_monomorphize/src/util.rs |
# -*- 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 | ||
"""Support for KNX/IP sensors."""
import voluptuous as vol
from xknx.devices import Sensor as XknxSensor
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_TYPE
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from hom... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2025 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.platform.java
import com.intellij.openapi.components.service
import... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-platform-interface/src/org/jetbrains/kotlin/analysis/api/platform/java/KotlinJavaModuleAccessibilityChecker.kt |
#!/usr/bin/env python
#Copyright (C) 2009-2010 :
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
#This file is part of Shinken.
#
#Shinken is free software: you can redistribute it and/or modify... | unknown | codeparrot/codeparrot-clean | ||
#
# BitBake Toaster Implementation
#
# Copyright (C) 2014 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it... | 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.fe10.test.cases.generated.cases.components.symbolInfoProvider;
impo... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fe10/tests-gen/org/jetbrains/kotlin/analysis/api/fe10/test/cases/generated/cases/components/symbolInfoProvider/Fe10IdeNormalAnalysisSourceModuleAnnotationApplicableTargetsTestGenerated.java |
import os
from openlego.core.abstract_discipline import AbstractDiscipline
from openlego.test_suite.test_examples.sellar_competences_virtual.sellar_code import d1, d2, d12, f1, g1, g2
__all__ = ['D1Discipline', 'D2Discipline', 'D12Discipline', 'F1Discipline', 'G1Discipline', 'G2Discipline']
class AbstractSellarDiscip... | unknown | codeparrot/codeparrot-clean | ||
from django.core.management.base import BaseCommand, CommandError
from api import models
from django.db.models import Count, Q
class Command(BaseCommand):
can_import_settings = True
def handle(self, *args, **options):
if 'NR' in args:
print 'Delete activities of N/R cards'
act... | unknown | codeparrot/codeparrot-clean | ||
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | unknown | codeparrot/codeparrot-clean | ||
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | cpp | github | https://github.com/opencv/opencv | modules/core/src/dxt.cpp |
//===- llvm/ADT/FixedBitSet.h - Fixed-length bitset -------------*- C++ -*-===//
//
// 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/apple/swift | include/swift/Basic/FixedBitSet.h |
# -*- coding: utf-8 -*-
# Copyright (c) 2007, 2008, Benoît Chesneau
#
# 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
# ... | unknown | codeparrot/codeparrot-clean | ||
use std::{
error::Error as StdError,
pin::Pin,
task::{Context, Poll},
};
use bytes::Bytes;
use futures_core::{ready, Stream};
use pin_project_lite::pin_project;
use super::{BodySize, MessageBody};
pin_project! {
/// Known sized streaming response wrapper.
///
/// This body implementation shou... | rust | github | https://github.com/actix/actix-web | actix-http/src/body/sized_stream.rs |
# encoding: 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):
# Deleting field 'DMUserProfile.major'
db.delete_column('accounts_dmuserprofile', 'major')
def backwards(self... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, 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... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012-2014, 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) an... | unknown | codeparrot/codeparrot-clean | ||
import html5lib
import html5lib.treebuilders.dom
# Expected use:
# curl --compressed http://www.whatwg.org/specs/web-apps/current-work/ >current-work
# python specextract.py
#
# Generates current-work-canvas.xhtml, for use by gentest.py to create the annotated spec document
def extract():
parser = html5lib.ht... | unknown | codeparrot/codeparrot-clean | ||
#ifndef Py_INTERNAL_OBJECT_DEFERRED_H
#define Py_INTERNAL_OBJECT_DEFERRED_H
#ifdef __cplusplus
extern "C" {
#endif
#include "pycore_gc.h"
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
// Mark an object as supporting deferred reference counting. This is a no-op
// in the default (... | c | github | https://github.com/python/cpython | Include/internal/pycore_object_deferred.h |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
use Symfony\Co... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlCompleteConfigurationTest.php |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
from django.views.decorators.http import require_POST
from django.contrib import messages
from django.http import Http404
from djc... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are appl... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package main
import (
"bytes"
"fmt"
"log"
"sort"
"strings"
"github.com/hashicorp/cli"
)
// helpFunc is a cli.HelpFunc that can be used to output the help CLI instructions for Terraform.
func helpFunc(commands map[string]cli.CommandFactory) ... | go | github | https://github.com/hashicorp/terraform | help.go |
"""Implements various algorithms."""
import numpy as _nmp
import tqdm as _tqdm
def gibbs(mdl, **args):
"""A Gibbs sampler."""
n_iters, n_burnin, hide_progress = args['n_iters'], args['n_burnin'], args['hide_progress']
state = _nmp.r_[0, [_nmp.nan] * n_iters]
sums = {_: _nmp.zeros_like(mdl.state[_]) f... | unknown | codeparrot/codeparrot-clean | ||
<?php
$container->loadFromExtension('framework', [
'semaphore' => 'redis://localhost',
]); | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/semaphore.php |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
import json
from datetime import datetime
import re
import unittest
from xml.dom import minidom
try:
import yaml
HAS_YAML = True
except ImportError:
HAS_YAML = False
from django.core import management, serializers
from django... | unknown | codeparrot/codeparrot-clean | ||
from bok_choy.page_object import PageLoadError, PageObject, unguarded
from bok_choy.promise import BrokenPromise, EmptyPromise
from selenium.webdriver.common.action_chains import ActionChains
from common.test.acceptance.pages.common.paging import PaginatedUIMixin
from common.test.acceptance.pages.lms.course_page impor... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "abstract_unit"
require "active_support/core_ext/integer/time"
class DateHelperDistanceOfTimeInWordsI18nTests < ActiveSupport::TestCase
include ActionView::Helpers::DateHelper
attr_reader :request
def setup
@from = Time.utc(2004, 6, 6, 21, 45, 0)
end
# distance_of... | ruby | github | https://github.com/rails/rails | actionview/test/template/date_helper_i18n_test.rb |
'''
Created on Feb 20, 2013
@author: Maribel Acosta
@author: Fabian Floeck
@author: Andriy Rodchenko
'''
from wmf import dump
from difflib import Differ
from time import time
from structures.Revision import Revision
from structures.Paragraph import Paragraph
from structures.Sentence import Sentence
from structures.W... | unknown | codeparrot/codeparrot-clean | ||
import httplib
import myparser
import time
import sys
class search_dogpile:
def __init__(self, word, limit):
self.word = word
self.total_results = ""
self.server = "www.dogpile.com"
self.hostname = "www.dogpile.com"
self.userAgent = "(Mozilla/5.0 (Windows; U; Windows NT 6.0... | unknown | codeparrot/codeparrot-clean | ||
'''
AceProxy configuration script
Edit this file.
'''
import logging
import acedefconfig
from aceclient.acemessages import AceConst
class AceConfig(acedefconfig.AceDefConfig):
# ----------------------------------------------------
# Ace Stream Engine configuration
# ---------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package dbplugin
import (
"context"
"errors"
"sync"
log "github.com/hashicorp/go-hclog"
plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/vault/sdk/helper/pluginutil"
)
// DatabasePluginClient embeds a databasePluginRPCClient an... | go | github | https://github.com/hashicorp/vault | sdk/database/dbplugin/client.go |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | unknown | codeparrot/codeparrot-clean | ||
# encoding=utf-8
# Copyright © 2017 Dylan Baker
#
# 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 di... | unknown | codeparrot/codeparrot-clean | ||
import { test, expect } from "@playwright/test";
import {
css,
js,
createFixture,
createAppFixture,
} from "./helpers/create-fixture.js";
import type { Fixture, AppFixture } from "./helpers/create-fixture.js";
import { type TemplateName } from "./helpers/vite.js";
import { PlaywrightFixture } from "./helpers/p... | typescript | github | https://github.com/remix-run/react-router | integration/link-test.ts |
"""
This is a middleware layer which keeps a log of all requests made
to the server. It is responsible for removing security tokens and
similar from such events, and relaying them to the event tracking
framework.
"""
import hashlib
import hmac
import json
import logging
import re
import sys
from django.conf import se... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.