code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# -*- python -*- # This file is part of Fusion-icon. # Fusion-icon is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Fusion-icon is ...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true module ActiveRecord include ActiveSupport::Deprecation::DeprecatedConstantAccessor # = Active Record Errors # # Generic Active Record exception class. class ActiveRecordError < StandardError end # Raised when the single-table inheritance mechanism fails to locate the subcl...
ruby
github
https://github.com/rails/rails
activerecord/lib/active_record/errors.rb
#!/usr/bin/env python #-*- coding: utf-8 -*- #update:2014-09-25 by liufeily@163.com from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def SelfPaginator(request,List,Limit): '''分页模块,用法: 1.view中引入: ex:from website.common.CommonPaginator import SelfPaginator 2.SelfPagi...
unknown
codeparrot/codeparrot-clean
"""Integration tests for acquisition of COVID hospitalization.""" # standard library import unittest from unittest.mock import MagicMock # first party from delphi.epidata.acquisition.covid_hosp.common.database import Database from delphi.epidata.acquisition.covid_hosp.common.test_utils import UnitTestUtils from delph...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
unknown
codeparrot/codeparrot-clean
__author__ = 'jianxun' import db_config from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String from sqlalchemy.orm import sessionmaker import json_wrapper engine = create_engine('mysql://%s:%s@%s:%s/%s?charset=utf8' % (db_config.USERNAME, ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.10.1' # utilities we import from Werkzeug and...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2009, Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
unknown
codeparrot/codeparrot-clean
--- - name: Include tasks that have a failure in a block hosts: localhost tasks: - include_tasks: block_fail_tasks.yml
unknown
github
https://github.com/ansible/ansible
test/integration/targets/blocks/block_fail.yml
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it. **Example** ```esql FROM airports | EVAL geohex = ST_GEOHEX(location, 1) | STATS count = COUNT(geohex), centroid = ST_CENTROID_AGG(location) BY geohex | WHERE count >= 10 | EVAL geohexStrin...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/query-languages/esql/_snippets/functions/examples/st_geohex.md
# -*- coding: utf-8 -*- ################################################################ ### common functions for data structures, file name manipulation, etc. ################################################################ import os,os.path import re import numpy import unicodedata import sys import warnings import ...
unknown
codeparrot/codeparrot-clean
# kube-dns `kube-dns` schedules DNS Pods and Service on the cluster, other pods in cluster can use the DNS Service’s IP to resolve DNS names. * [Administrators guide](http://kubernetes.io/docs/admin/dns/) * [Code repository](http://www.github.com/kubernetes/dns) ## Manually scale kube-dns Deployment kube-dns create...
unknown
github
https://github.com/kubernetes/kubernetes
cluster/addons/dns/kube-dns/README.md
from __future__ import absolute_import from django import template from sentry import features register = template.Library() @register.tag def feature(parser, token): bits = token.split_contents() if len(bits) < 2: raise template.TemplateSyntaxError("%r tag requires an argument" % token.contents.spl...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright 2011 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
// RUN: clang-reorder-fields -record-name ::bar::Foo -fields-order z,y,x %s -- | FileCheck %s namespace bar { // The order of fields should not change. struct Foo { int x, y; // CHECK: {{^ int x, y;}} double z; // CHECK-NEXT: {{^ double z;}} }; } // end namespace bar
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/test/clang-reorder-fields/MultipleFieldDeclsInStatement.cpp
/* 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/kernels/reduction_ops_common.h
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/bus/palmbus.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Ralink PalmBus maintainers: - Sergio Paracuellos <sergio.paracuellos@gmail.com> description: | The ralink palmbus controller c...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/bus/palmbus.yaml
test_kind: js_test selector: roots: - src/mongo/db/modules/*/jstests/streams/aspio/iceberg/iceberg_benchmark_one_partition.js - src/mongo/db/modules/*/jstests/streams/aspio/iceberg/iceberg_benchmark_many_partitions.js - src/mongo/db/modules/*/jstests/streams/aspio/iceberg/iceberg_benchmark_tpcc_orders.js...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/streams_aspio_iceberg_4.yml
# coding: utf-8 from unittest.mock import patch from django.test import TestCase from spectator.core.apps import Apps, spectator_apps class SpectatorAppsTestCase(TestCase): def test_all(self): all_apps = spectator_apps.all() self.assertEqual(2, len(all_apps)) self.assertEqual(all_apps[0],...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################### # # GetLocationElevation # Obtain elevation information for a path generated by a set of geo-coordinates. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Vers...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, api, _ from openerp.ex...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( ...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import, unicode_literals import datetime import re from mopidy.models import TlTrack from mopidy.mpd.protocol import tagtype_list # TODO: special handling of local:// uri scheme normalize_path_re = re.compile(r'[^/]+') def normalize_path(path, relative=False): parts = normalize_p...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true module ActiveModel module Validations class PresenceValidator < EachValidator # :nodoc: def validate_each(record, attr_name, value) record.errors.add(attr_name, :blank, **options) if value.blank? end end module HelperMethods # Validates that the sp...
ruby
github
https://github.com/rails/rails
activemodel/lib/active_model/validations/presence.rb
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (C) 2015 Odoo S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Aff...
unknown
codeparrot/codeparrot-clean
import logging import asyncio from aiohttp.web import Response from api_hour.plugins.aiohttp import JSON import aiohttp_jinja2 from ..services import queries_number from ..services.world import get_random_record, get_random_records, update_random_records, get_fortunes from ..services import mysql LOG = logging.getLo...
unknown
codeparrot/codeparrot-clean
''' Copyright 2013 Cosnita Radu Viorel 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 use, copy, modify, merge, publish, distribute...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true # :enddoc: # :markup: markdown require "rack/cache" require "rack/cache/context" require "active_support/cache" module ActionDispatch class RailsMetaStore < Rack::Cache::MetaStore def self.resolve(uri) new end def initialize(store = Rails.cache) @store = stor...
ruby
github
https://github.com/rails/rails
actionpack/lib/action_dispatch/http/rack_cache.rb
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict: # Maps SQL types to Django...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 // Package depsfile contains the logic for reading and writing Terraform's // dependency lock and development override configuration files. // // These files are separate from the main Terraform configuration files (.tf) // for a number of reasons. ...
go
github
https://github.com/hashicorp/terraform
internal/depsfile/doc.go
class FeatureSet(object): """ An implementation of features as loaded from an ISUPPORT server directive. Each feature is loaded into an attribute of the same name (but lowercased to match Python sensibilities). >>> f = FeatureSet() >>> f.load(['target', 'PREFIX=(abc)+-/', 'your message sir']) ...
unknown
codeparrot/codeparrot-clean
package kotlinx.coroutines.flow import kotlinx.coroutines.testing.* import kotlinx.coroutines.* import kotlin.test.* class CombineStressTest : TestBase() { @Test fun testCancellation() = runTest { withContext(Dispatchers.Default + CoroutineExceptionHandler { _, _ -> expectUnreached() }) { ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/concurrent/test/flow/CombineStressTest.kt
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import absolute_import, unicode_literals from flask import render_template from markupsaf...
unknown
codeparrot/codeparrot-clean
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ..._models import BaseModel __all__ = ["TextSimilarityGrader"] class TextSimilarityGrader(BaseModel): """A TextSimilarityGrader object which grades text based on similarity metrics.""...
python
github
https://github.com/openai/openai-python
src/openai/types/graders/text_similarity_grader.py
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Dummy Socks5 server for testing. ''' import socket, threading, queue import traceback, sys ### Proto...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessor6.ts] //// //// [autoAccessor6.ts] class C1 { accessor a: any; } class C2 extends C1 { a = 1; } class C3 extends C1 { get a() { return super.a; } } //// [autoAccessor6.js] "use strict"; class C1 { accessor a; } class C2 ext...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/autoAccessor6(target=esnext,usedefineforclassfields=false).js
from django.db import connection from django.db.models import Max from django.test import TestCase from .models import Cash, CashModel class FromDBValueTest(TestCase): @classmethod def setUpTestData(cls): CashModel.objects.create(cash="12.50") def test_simple_load(self): instance = CashMo...
python
github
https://github.com/django/django
tests/from_db_value/tests.py
#!/usr/bin/env python """ @package mi.instrument.teledyne.pd0_parser @file marine-integrations/mi/instrument/teledyne/pd0_parser.py @author Peter Cable @brief Parser for ADCP PD0 data Release notes: """ from collections import namedtuple import pprint import struct import sys namedtuple_store = {} bitmapped_namedtupl...
unknown
codeparrot/codeparrot-clean
# import the necessary packages from keras.models import Sequential from keras.layers.convolutional import Conv2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Activation from keras.layers.core import Flatten from keras.layers.core import Dense class LeNet: @staticmethod def...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> /* * It seems that Darwin 9.4 (Mac OS X 1.5) sendfile() has the same * old bug as early FreeBSD sendfile() syscall: * http://bugs.freebsd.org/33771 * * Besides sendfile() has anot...
c
github
https://github.com/nginx/nginx
src/os/unix/ngx_darwin_sendfile_chain.c
#include "git-compat-util.h" #include "fetch-negotiator.h" #include "negotiator/default.h" #include "negotiator/skipping.h" #include "negotiator/noop.h" #include "repository.h" void fetch_negotiator_init(struct repository *r, struct fetch_negotiator *negotiator) { prepare_repo_settings(r); switch(r->settings.f...
c
github
https://github.com/git/git
fetch-negotiator.c
'use strict'; const common = require('../common.js'); const networkInterfaces = require('os').networkInterfaces; const bench = common.createBenchmark(main, { n: [1e4], }); function main({ n }) { bench.start(); for (let i = 0; i < n; ++i) networkInterfaces(); bench.end(n); }
javascript
github
https://github.com/nodejs/node
benchmark/os/networkInterfaces.js
/* * 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.http import io.ktor.util.* /** Separator symbols listed in RFC https://tools.ietf.org/html/rfc2616#section-2.2 */ private val HeaderFieldValueSeparators = setOf('(', ')', '...
kotlin
github
https://github.com/ktorio/ktor
ktor-http/common/src/io/ktor/http/HeaderValueWithParameters.kt
package kotlinx.coroutines import kotlinx.coroutines.testing.* import org.junit.* class CancelledAwaitStressTest : TestBase() { private val n = 1000 * stressTestMultiplier /** * Tests that memory does not leak from cancelled [Deferred.await] */ @Test fun testCancelledAwait() = runTest { ...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/jvm/test/CancelledAwaitStressTest.kt
import pickle from django import forms from django.core.exceptions import ValidationError from django.db import models from django.test import SimpleTestCase, TestCase from django.utils.choices import CallableChoiceIterator from django.utils.functional import lazy from .models import ( Bar, Choiceful, Foo...
python
github
https://github.com/django/django
tests/model_fields/tests.py
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title><%= title %></title> <link rel="stylesheet" href="/stylesheets/style.css"> </head> <body>
html
github
https://github.com/expressjs/express
examples/ejs/views/header.html
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the inotify wrapper in L{twisted.internet.inotify}. """ from twisted.internet import defer, reactor from twisted.python import filepath, runtime from twisted.trial import unittest try: from twisted.python import _inotify except...
unknown
codeparrot/codeparrot-clean
import json from django.conf import settings from django_statsd.clients import statsd import commonware.log import jwt import requests log = commonware.log.getLogger('z.crypto') class SigningError(Exception): pass def sign(receipt): """ Send the receipt to the signing service. This could possibly ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2011 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 glob import os import re import sys import subprocess # TODO(timurrrr): we may use it on POSIX too to avoid code duplication once we # support la...
unknown
codeparrot/codeparrot-clean
# Copyright 2021 The HuggingFace Inc. team. # # 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 ...
python
github
https://github.com/huggingface/transformers
src/transformers/dynamic_module_utils.py
# 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 u...
python
github
https://github.com/apache/airflow
airflow-ctl/src/airflowctl/ctl/commands/pool_command.py
# -*- coding: utf-8 -*- import logging from box import CredentialsV2, BoxClient from box.client import BoxClientException from modularodm import fields from framework.auth import Auth from framework.exceptions import HTTPError from website.addons.base import exceptions from website.addons.base import AddonOAuthUserS...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "cases/helper" require "models/contact" require "models/helicopter" class ConversionTest < ActiveModel::TestCase test "to_model default implementation returns self" do contact = Contact.new assert_equal contact, contact.to_model end test "to_key default implementat...
ruby
github
https://github.com/rails/rails
activemodel/test/cases/conversion_test.rb
# 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
# -*- coding: utf-8 -*- """The file object file input/output (IO) object implementation.""" import abc import os from dfvfs.file_io import file_io class FileObjectIO(file_io.FileIO): """Base class for file object-based file input/output (IO) object.""" # pylint: disable=redundant-returns-doc def __init__(sel...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/media/mediatek,mdp3-tdshp.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: MediaTek Media Data Path 3 Two-Dimensional Sharpness maintainers: - Matthias Brugger <matthias.bgg@gmail.com> - M...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/media/mediatek,mdp3-tdshp.yaml
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package terraform import "context" // UIInput is the interface that must be implemented to ask for input // from this user. This should forward the request to wherever the user // inputs things to ask for values. type UIInput interface { Input(co...
go
github
https://github.com/hashicorp/terraform
internal/terraform/ui_input.go
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ @file:OptIn(ExperimentalKotlinGradlePluginApi::class) import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.NamedDomainObjectProvider import org.gradle.api.NamedDomainObjectS...
kotlin
github
https://github.com/ktorio/ktor
build-logic/src/main/kotlin/ktorbuild/dsl/KotlinSourceSets.kt
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package addrs import ( "fmt" "strings" "unicode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/gocty" ) // InstanceKey represents the key of an instance within an object that // contains multiple instances due to using "coun...
go
github
https://github.com/hashicorp/terraform
internal/addrs/instance_key.go
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
unknown
codeparrot/codeparrot-clean
{ "apiVersion": "dashboard.grafana.app/v1beta1", "kind": "Dashboard", "metadata": { "name": "ad5vfcn", "namespace": "default", "uid": "dlMZZl6GndU8gJLUQSmgZxXBPCNXyXhNBeQJhHXl0r4X", "resourceVersion": "2", "generation": 2, "creationTimestamp": "2025-11-28T10:14:21Z", "labels": { ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/input/v1beta1.panel-datasource-type-datasource.json
#!/usr/bin/python3 # -*- coding: utf-8 -*- # This file is part of Cockpit. # # Copyright (C) 2015 Red Hat, Inc. # # Cockpit 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 Lic...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # hl_api_info.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2007 Thomas Schueppel <stain@acm.org> # Copyright 2003-2007 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
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
#!/usr/bin/env python # # Copyright 2016 The BigDL 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 applicab...
unknown
codeparrot/codeparrot-clean
from .cli import main main()
python
github
https://github.com/pallets/flask
src/flask/__main__.py
#!/usr/bin/python # -*- coding: utf-8 -*- ####################################################################### ### Diálogo de definición de molinos, UI_grinder ### ##########################################################...
unknown
codeparrot/codeparrot-clean
import sys from collections import defaultdict import django.db.models.deletion from django.conf import settings from django.db import migrations, models import kpi.fields.kpi_uid from kpi.model_utils import disable_auto_field_update def migrate_collections_to_assets(apps, schema_editor): Asset = apps.get_model(...
unknown
codeparrot/codeparrot-clean
""" Support for the Locative platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.locative/ """ import logging from homeassistant.components.device_tracker import DOMAIN from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY, STATE...
unknown
codeparrot/codeparrot-clean
## @file # Generate PCD table for 'Patchable In Module' type PCD with given .map file. # The Patch PCD table like: # # PCD Name Offset in binary # ======== ================ # # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licen...
unknown
codeparrot/codeparrot-clean
import hashlib import json from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import HttpResponse from django.shortcuts import get_object_or_404, redirect, render from .forms import ProfileForm from .models import Pro...
unknown
codeparrot/codeparrot-clean
from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Anatoly Shipitsin <norguhtar at gmail.com>' """ Convert .fb2 files to .lrf """ import os, re from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation from calibre import guess_type FB2NS = 'http://www.gribuse...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # 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 distribut...
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 u...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2012 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/io/CharSourceTester.java
"ArticlePage object for presseurope" # -*- coding: utf-8 -*- # Copyright(C) 2012 Florent Fourcot # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either versi...
unknown
codeparrot/codeparrot-clean
__author__ = 'Cedric' # each information will be used to sort the properties for the given policy #import random from monopyly import * from .Memory import * from .Policy import * class VSSmartBuyerNeutral(PlayerAIBase): ''' ''' def __init__(self): ''' ctor ''' # memory in...
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 import value as value_module class SkipValue(value_module.Value): def __init__(self, page, reason, description=None): """A value repre...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2004,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
unknown
codeparrot/codeparrot-clean
#****************************************************************************** # MAC path finder - Server part # equivalent to traceroute but based on MAC address # Version: 1.0 # Revision history: # 1.0 - 30/06/2014 : Initial coding (Yannick Castano, Hewlett-Packard) # # Pre-requisite: LLDP enables on all switch t...
unknown
codeparrot/codeparrot-clean
import os import argparse from unittest import mock from OpenSSL import SSL import pytest from mitmproxy.tools import cmdline from mitmproxy import options from mitmproxy.proxy import ProxyConfig from mitmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler from mitmproxy.proxy import config from mitm...
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 2013 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* Block split point selection utilities. */ #ifndef BROTLI_ENC_BLOCK_SPLITTER_H_ #define BROTLI_ENC_BLOCK_SPLITTER_H_ #include "../common/platform.h"...
c
github
https://github.com/nodejs/node
deps/brotli/c/enc/block_splitter.h
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies build of an executable with C++ define specified by a gyp define, and the use of the environment during regeneration when the g...
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
#pragma once #include <c10/core/impl/DeviceGuardImplInterface.h> namespace c10::impl { /** * An implementation of DeviceGuardImplInterface which delegates * to virtual dispatch on the DeviceGuardImpl registry. */ class VirtualGuardImpl final : public DeviceGuardImplInterface { public: VirtualGuardImpl(DeviceTy...
c
github
https://github.com/pytorch/pytorch
c10/core/impl/VirtualGuardImpl.h
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py. """ # " import codecs # ## Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return codecs.charmap_encode(input, errors, encoding_map) def decode(self, input, errors='str...
unknown
codeparrot/codeparrot-clean
<?php declare(strict_types=1); /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Advisor...
php
github
https://github.com/composer/composer
src/Composer/Advisory/SecurityAdvisory.php
""" This module contains ordinary kalman filter classes """ from regression import * import csv, scipy from timeSeriesFrame import TimeSeriesFrame, StylusReader try: from clibregression import kalman_predict, kalman_upd, kalman_filter except ImportError: print "Cannot import clibregression" from libregres...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) from .kern import Kern import numpy as np from ...core.parameterization import Param from ...core.parameterization.transformations import Logexp class Static(Kern): def __init__(self, input_dim, varian...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function, unicode_literals from io import BytesIO from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.urlresolvers import reverse from ...base import ArticleWebTestBase class AttachmentTests(ArticleWebTestBase): def setUp(self): super(Attachment...
unknown
codeparrot/codeparrot-clean
# -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Publ...
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
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ShareFetchMetricsManagerTest.java
# -*- 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 field 'TruffeUser.email_perso' db.add_column(u'users_truffeuser',...
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-indexer/src/test/java/org/springframework/context/index/sample/SampleComponent.java
/* * Copyright 2012-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, api class StockPicking(models....
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.callbacks.human import ( AsyncHumanApprovalCallbackHandler, HumanApprovalCallbackHandler, HumanRejectedException, ) # Create a way to dynamically look up...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/callbacks/human.py
from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.encoding import smart_str from django.views.generic.base import TemplateResponseMixin, View class MultipleObjectMixin(object): allow_empty = True qu...
unknown
codeparrot/codeparrot-clean