code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_connectivity_getconnectiondetails_input import TapiConnectivityGetconnectiondetailsInput ... | unknown | codeparrot/codeparrot-clean | ||
<!---
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, software
distributed under t... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/InterfaceClassification.md |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Derek Carter<goozbach@friocorte.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 ... | unknown | codeparrot/codeparrot-clean | ||
"""**Embeddings** interface."""
from abc import ABC, abstractmethod
from langchain_core.runnables.config import run_in_executor
class Embeddings(ABC):
"""Interface for embedding models.
This is an interface meant for implementing text embedding models.
Text embedding models are used to map text to a ve... | python | github | https://github.com/langchain-ai/langchain | libs/core/langchain_core/embeddings/embeddings.py |
#!/usr/bin/env python
""" generated source for module MarketDataType """
#
# Original file copyright original author(s).
# This file copyright Troy Melhase, troy@gci.net.
#
# WARNING: all changes to this file will be lost.
#
# * MarketDataType.java
# *
#
# package: com.ib.client
class MarketDataType(object):
"""... | unknown | codeparrot/codeparrot-clean | ||
from django.db import models
from django.template import Context, Template
from django.test import SimpleTestCase, TestCase, override_settings
from django.test.utils import isolate_apps
from .models import (
AbstractBase1, AbstractBase2, AbstractBase3, Child1, Child2, Child3,
Child4, Child5, Child6, Child7, Re... | unknown | codeparrot/codeparrot-clean | ||
#-
# Copyright (c) 2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2025 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/compiler/mlir/stablehlo/transforms/mhlo_passes/fuse_convolution_pass.h |
"""Test the customize helper."""
import homeassistant.helpers.customize as customize
from voluptuous import MultipleInvalid
import pytest
class MockHass(object):
"""Mock object for HassAssistant."""
data = {}
class TestHelpersCustomize(object):
"""Test homeassistant.helpers.customize module."""
def ... | unknown | codeparrot/codeparrot-clean | ||
"""
Sphinx extension to generate profiler trace data during docs build.
This extension executes a demo Python program with sys.settrace() to capture
the execution trace and injects it into the profiling visualization JS file.
"""
import json
import re
import sys
from io import StringIO
from pathlib import Path
from ... | python | github | https://github.com/python/cpython | Doc/tools/extensions/profiling_trace.py |
import decimal
from StringIO import StringIO
from collections import OrderedDict
from json.tests import PyTest, CTest
class TestDecode(object):
def test_decimal(self):
rval = self.loads('1.1', parse_float=decimal.Decimal)
self.assertTrue(isinstance(rval, decimal.Decimal))
self.assertEqual(r... | unknown | codeparrot/codeparrot-clean | ||
// Copyright The Prometheus 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 i... | go | github | https://github.com/prometheus/prometheus | tsdb/wlog/reader.go |
# postgresql/ext.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from ...sql import expression
from ...sql import elements
from ...sql import funct... | unknown | codeparrot/codeparrot-clean | ||
# the implementation here is a bit crappy.
import time
from Directories import resolveFilename, SCOPE_CONFIG
from boxbranding import getBoxType
boxtype = getBoxType()
PERCENTAGE_START = 50
PERCENTAGE_END = 100
profile_start = time.time()
profile_data = {}
total_time = 1
profile_file = None
try:
f = open(resolveFi... | unknown | codeparrot/codeparrot-clean | ||
import sys
import cherrypy
if sys.version_info >= (2, 6):
# Python 2.6: simplejson is part of the standard library
import json
else:
try:
import simplejson as json
except ImportError:
json = None
if json is None:
def json_decode(s):
raise ValueError('No JSON library is avai... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import os
import pkgutil
import sys
from collections import OrderedDict, defaultdict
from importlib import import_module
import django
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.manageme... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.document import Document
class EmployeeAttendanceTool(Document):
pass
@frappe.whitelist()... | unknown | codeparrot/codeparrot-clean | ||
#
# tohtml.py
#
# A sub-class container of the `Formatter' class to produce HTML.
#
# Copyright 2002, 2003, 2005-2008, 2013, 2014 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. ... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActionView
class Template
module Sources
extend ActiveSupport::Autoload
eager_autoload do
autoload :File
end
end
end
end | ruby | github | https://github.com/rails/rails | actionview/lib/action_view/template/sources.rb |
## Input
```javascript
function Component(props) {
let x = [];
x.push(props.p0);
let y = x;
x = [];
let _ = <Component x={x} />;
y.push(props.p1);
return <Component x={x} y={y} />;
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component(props) {
const $ = ... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/reassignment.expect.md |
{
"status": "success",
"data": [
"demo"
]
} | json | github | https://github.com/prometheus/prometheus | web/ui/module/codemirror-promql/src/test/label_env_values.json |
/*
* 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.sessions
import com.intellij.openapi.progress.ProgressMan... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/src/org/jetbrains/kotlin/analysis/api/impl/base/sessions/KaBaseSessionProvider.kt |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import include, url
from . import admin_views
from . import views
urlpatterns = [
url(r'^$', views.AssignmentListView.as_view(), name='assignment-list'),
url(r'^assignment/(?P<assignment_id>[^/]+)/', include([
url(r... | unknown | codeparrot/codeparrot-clean | ||
extern crate autocfg;
use autocfg::AutoCfg;
mod support;
fn core_std(ac: &AutoCfg, path: &str) -> String {
let krate = if ac.no_std() { "core" } else { "std" };
format!("{}::{}", krate, path)
}
fn assert_std(ac: &AutoCfg, probe_result: bool) {
assert_eq!(!ac.no_std(), probe_result);
}
fn assert_min(ac:... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/autocfg/tests/tests.rs |
---
navigation_title: "Sort"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-processor.html
---
# Sort processor [sort-processor]
Sorts the elements of an array ascending or descending. Homogeneous arrays of numbers will be sorted numerically, while arrays of strings or heteroge... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/enrich-processor/sort-processor.md |
# (C) Copyright 2016 Voyager Search
#
# 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 writi... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2010-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2009 Lorenzo Gil Sanchez <lorenzo.gil.sanchez@gmail.com>
#
# 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
#
# ... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
import functools
import logging
import simplejson
import urlparse
import werkzeug.utils
from werkzeug.exceptions import BadRequest
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.addons.web.controllers.main import db_monodb, ensure_db, set_cookie_... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
__author__ = 'Tom Schaul, tom@idsia.ch; Justin Bayer, bayerj@in.tum.de'
import gc
import pickle
import logging
import threading
import os
import operator
from itertools import count
from math import sqrt
from random import random, choice
from scipy import where, array, exp, zer... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 - 2020 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
# pylint: disable=invalid-name
import pytest
from ..testing import make_dataset, marv, run_nodes
class Falsish:
def __bool__(self):
return False
def __eq__(self, other):
return type(other) is type(self)
def __r... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | unknown | codeparrot/codeparrot-clean | ||
import json
import logging
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db.models.signals import pre_save
from django.dispatch import receiver
from googleapiclient.errors import HttpError
from apps.gsuite.mail_syncer.utils import insert_email_into_g_suite_group
from .ma... | unknown | codeparrot/codeparrot-clean | ||
import json
import os
import csv
import psycopg2
import psycopg2.extras
from collections import OrderedDict
from parsing import parse_inputs as parse
from connector import connect_DB as connect
from builder import build_JSON as build
from aggregation import aggregate as agg
from queries import queries
from selector imp... | unknown | codeparrot/codeparrot-clean | ||
from pathlib import Path
import typer
import yaml
from typing_extensions import Annotated
def main(
output: Annotated[Path, typer.Option()],
test_list: Annotated[Path, typer.Option()],
base_config: Annotated[Path, typer.Option()],
exclude_with_any_tags: Annotated[str, typer.Option()] = "",
include... | python | github | https://github.com/mongodb/mongo | bazel/resmoke/resmoke_config_generator.py |
import {
type VNode,
computed,
createApp,
defineComponent,
h,
nextTick,
nodeOps,
onErrorCaptured,
onMounted,
ref,
render,
watch,
watchEffect,
} from '@vue/runtime-test'
import { ErrorCodes, ErrorTypeStrings } from '../src/errorHandling'
describe('error handling', () => {
test('propagation',... | typescript | github | https://github.com/vuejs/core | packages/runtime-core/__tests__/errorHandling.spec.ts |
import { registerServerReference } from "private-next-rsc-server-reference";
import { encryptActionBoundArgs, decryptActionBoundArgs } from "private-next-rsc-action-encryption";
import { cache as $$cache__ } from "private-next-rsc-cache-wrapper";
import { cache as $$reactCache__ } from "react";
const $$RSC_SERVER_CACHE... | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/server-actions/server-graph/54/output.js |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package ssh
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"os"
"path/filepath"
"testing"
"golang.org/x/crypto/ssh"
)
// verify that we can locate public key data
func TestFindKeyData(t *testing.T) ... | go | github | https://github.com/hashicorp/terraform | internal/communicator/ssh/ssh_test.go |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package getproviders
import (
"context"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform/internal/addrs"
)
func TestMemoizeSource(t *testing.T) {
provider := addrs.NewDefaultProvider("foo")
version := MustParseVersio... | go | github | https://github.com/hashicorp/terraform | internal/getproviders/memoize_source_test.go |
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/st,led1202.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ST LED1202 LED controllers
maintainers:
- Vicentiu Galanopulo <vicentiu.galanopulo@remote-tech.co.uk>
description: |
The LED... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/leds/st,led1202.yaml |
import unittest
import json
from nose.plugins.skip import SkipTest
from dummyserver.server import HAS_IPV6
from dummyserver.testcase import (HTTPDummyServerTestCase,
IPv6HTTPDummyServerTestCase)
from urllib3.poolmanager import PoolManager
from urllib3.connectionpool import port_by_sch... | unknown | codeparrot/codeparrot-clean | ||
# -*- Mode: Python; test-case-name: flumotion.test.test_flavors -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified un... | unknown | codeparrot/codeparrot-clean | ||
base_suite: sharded_collections_jscore_passthrough_base
description: >-
Test the correctness of the query settings fallback mechanism by introducing planner
failures and then expecting that the fallback-generated plan is identical to the
original plan. This suite runs jscore tests using a sharded cluster fixture ... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/sharded_collections_pqs_fallback.yml |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package s3
import (
"context"
"encoding/base64"
"fmt"
"os"
"regexp"
"strings"
"time"
"unicode"
"unicode/utf8"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
"github.com/aws/aws-sdk-go-v2/service/dyna... | go | github | https://github.com/hashicorp/terraform | internal/backend/remote-state/s3/backend.go |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
import urlparse
import werkzeug.urls
from openerp import tools
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
URL_REGEX = r'(\bhref=[\'"]([^\'"]+)[\'"])'
class MailMail(osv.Model):
... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import time
import csv
import copy
from operator import itemgetter, attrgetter, methodcaller
from django.db.models import Q
from django.http import HttpResponse, HttpResponseServerError, Http404, HttpResponseNotFound, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_4... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Test;
use Symfony\Bundle\FrameworkBundle... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php |
#ifndef Py_INTERNAL_PYSTATS_H
#define Py_INTERNAL_PYSTATS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#ifdef Py_STATS
extern int _Py_StatsOn(void);
extern void _Py_StatsOff(void);
extern void _Py_StatsClear(void);
extern int _Py_PrintSpeci... | c | github | https://github.com/python/cpython | Include/internal/pycore_pystats.h |
/*
* Copyright 2010-2023 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.fir.types
import org.jetbrains.kotlin.analysis.api.KaExperimentalAp... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/types/KaFirIntersectionType.kt |
# Copyright 2014 Cloudbase Solutions Srl
# 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 r... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import re
import subprocess
import sys
class MockInputApi(object):
"""Mock class for the InputApi class.
This class can be used f... | 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 | ||
from test import support
support.requires('audio')
from test.support import findfile
ossaudiodev = support.import_module('ossaudiodev')
import errno
import sys
import sunau
import time
import audioop
import unittest
# Arggh, AFMT_S16_NE not defined on all platforms -- seems to be a
# fairly recent addition to OSS.
... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/mmc/mmc-pwrseq-sd8787.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell SD8787 power sequence provider
maintainers:
- Ulf Hansson <ulf.hansson@linaro.org>
properties:
compatible:
enum:
- mmc-pw... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/mmc/mmc-pwrseq-sd8787.yaml |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from typing_extensions import Literal
from ..._models import BaseModel
from .dpo_method import DpoMethod
from ..shared.metadata import Metadata
from .supervised_method import SupervisedMethod... | python | github | https://github.com/openai/openai-python | src/openai/types/fine_tuning/fine_tuning_job.py |
package main
import (
"context"
"fmt"
"strings"
"testing"
"time"
"github.com/moby/moby/v2/integration-cli/cli"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/icmd"
)
type DockerCLIStartSuite struct {
ds *DockerSuite
}
func (s *DockerCLIStartSuite) TearDownTest(ctx context.Contex... | go | github | https://github.com/moby/moby | integration-cli/docker_cli_start_test.go |
"""Buffers allocated on the stack."""
from bgenBuffer import FixedInputBufferType, FixedOutputBufferType
class StackOutputBufferType(FixedOutputBufferType):
"""Fixed output buffer allocated on the stack -- passed as (buffer, size).
Instantiate with the buffer size as parameter.
"""
def passOutput(s... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from collections import namedtuple
from btgym.research.model_based.model.rec import Zscore, ZscoreState, Covariance, CovarianceState
from btgym.research.model_based.model.rec import OUEstimatorState
from btgym.research.model_based.model.univariate import OUProcess, TimeSeriesModel
BivariateTSModel... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2014 Quantopian, 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 wr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2015 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
# Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
#
# This program is free software: you can redistribute it a... | unknown | codeparrot/codeparrot-clean | ||
// Copyright Joyent, Inc. and other Node contributors.
//
// 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, modi... | javascript | github | https://github.com/nodejs/node | lib/fs.js |
# reduce_sum
tf.reset_default_graph()
one_to_ten = tf.constant(np.arange(1,11), name="one_to_ten")
node = tf.reduce_sum(one_to_ten)
with tf.Session() as sess:
print("reduce_sum", node.eval())
display(tfdot())
# add_n
tf.reset_default_graph()
node = tf.add_n(list(range(1,11)))
with tf.Session() as sess:
print("... | unknown | codeparrot/codeparrot-clean | ||
from django.apps import apps
from django.apps.registry import Apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.checks import check_site_id
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddlew... | python | github | https://github.com/django/django | tests/sites_tests/tests.py |
* Restore ADC when signing URLs with IAM for GCS
ADC was previously used for automatic authorization when signing URLs with IAM.
Now it is again, but the auth client is memoized so that new credentials are only
requested when the current ones expire. Other auth methods can now be used
instead by sett... | unknown | github | https://github.com/rails/rails | activestorage/CHANGELOG.md |
/* Copyright 2019 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/data/flat_map_dataset_op.h |
#!/usr/bin/env python
import boto
import boto.route53
import boto.route53.record
import boto.ec2.elb
import boto.rds2
import time
from argparse import ArgumentParser, RawTextHelpFormatter
import datetime
import sys
from vpcutil import rds_subnet_group_name_for_stack_name, all_stack_names
import os
description = """
... | unknown | codeparrot/codeparrot-clean | ||
from django.urls import path
from .admin import site
urlpatterns = [
path("admin/", site.urls),
] | python | github | https://github.com/django/django | tests/proxy_models/urls.py |
# Lint as: python2, python3
# Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ve... | unknown | codeparrot/codeparrot-clean | ||
DOCUMENTATION:
name: success
author: Ansible Core
version_added: "1.9"
short_description: check task success
aliases: [succeeded, successful]
description:
- Tests if task finished successfully, opposite of C(failed).
- This test checks for the existence of a C(failed) key in the input dictionary and... | unknown | github | https://github.com/ansible/ansible | lib/ansible/plugins/test/succeeded.yml |
#!/usr/bin/env bash
# Copyright 2021 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
# NOTE: After a new release has been cut, update this to the appropriate
# Cockroach branch name (i.e. release-23.2, etc.), and corresponding Pebble
# b... | unknown | github | https://github.com/cockroachdb/cockroach | scripts/bump-pebble.sh |
/*!
* 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/pages/Dag/Code/index.ts |
#---------------------------------------------------------------------
# IDAPython - Python plugin for Interactive Disassembler
#
# Copyright (c) 2004-2010 Gergely Erdelyi <gergely.erdelyi@d-dome.net>
#
# All rights reserved.
#
# For detailed copyright information see the file COPYING in
# the root of the distribution ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2019 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 | ||
# Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# PEP 263 -- Defining Python Source Code Encodings https://www.python.org/dev/peps/pep-0263/
# PEP 3120 -- Using UTF-8 as the default source encoding https://www.python.org/dev/peps/pep-3120/
"""At least once a day, get all booki... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Number & PhoneNumber classes - along with their list classes
"""
from plivo.base import (ListResponseObject, PlivoResource,
PlivoResourceInterface)
from plivo.utils import to_param_dict
from plivo.utils.validators import *
class Number(PlivoResource):
_name = 'N... | unknown | codeparrot/codeparrot-clean | ||
""" Modified version of build_ext that handles fortran source files.
"""
from __future__ import division, absolute_import, print_function
import os
import sys
from glob import glob
from distutils.dep_util import newer_group
from distutils.command.build_ext import build_ext as old_build_ext
from distutils.errors impo... | unknown | codeparrot/codeparrot-clean | ||
import pygame as pg
import tilerenderer
from tower import Tower, CannonTower, ExplosiveTower, FireTower, SlowTower, MultiTower, LaserTower, CrescentTower
from trap import Mine
from creep import Creep, Worm, Behemoth, SwiftWalker
from os import path, pardir
import random
Vector = pg.math.Vector2
CREEP = 0
WORM = 1
BE... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from functools import wraps
from flask import Flask, flash, redirect
from sipa.utils import redirect_url
app = Flask('sipa')
def password_changeable(user):
"""A decorator used to disable functions (routes) if a certain feature
is not provided by the User class.
given_features has ... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests dtype specification during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
import os
import numpy as np
import pytest
from pandas._libs import parsers as libparsers
from pandas.errors import Pandas4Warning
from pandas.core.dtypes.dtypes import CategoricalDtype
import pand... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/io/parser/dtypes/test_categorical.py |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | unknown | codeparrot/codeparrot-clean | ||
import json
from django.core.mail import mail_admins
from django.http import HttpResponse, HttpResponseBadRequest
from django.template import loader, Context
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from csp import build_policy
@csrf_exempt
@require_P... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
SAMI Make Cube
This file gets several FITS images and put them together inside a single
FITS file with three dimensions (data-cube).
Todo
----
- Treat error case multiple extensions.
"""
import astropy.io.fits as pyfits
import argparse
import ... | unknown | codeparrot/codeparrot-clean | ||
extension Validator {
/// Validates nothing. Can be used as placeholder to validate successful decoding
public static var valid: Validator<T> {
.init { _ in
ValidatorResults.Valid()
}
}
}
extension ValidatorResults {
/// `ValidatorResult` of a validator that validates that t... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Validation/Validators/Valid.swift |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/mediatek,uart-dma.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek UART APDMA controller
maintainers:
- Long Cheng <long.cheng@mediatek.com>
description: |
The MediaTek UART ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/dma/mediatek,uart-dma.yaml |
import os, sys
import tokenize
from k_script import BaseScript, ParseError, HTTP_ERROR
from k_encodings import k_encoding
import urllib
class Error:
def __init__(self,msg,errorLine):
self.msg = msg
self.errorLine = errorLine
class Script(BaseScript):
"""Karrigell Service"""
def __init__(... | 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 | ||
#!/usr/bin/env bash
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/build-go.sh |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package dbplugin_test
import (
"context"
"errors"
"os"
"testing"
"time"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/helper/testhelpers/cor... | go | github | https://github.com/hashicorp/vault | builtin/logical/database/dbplugin/plugin_test.go |
# (c) 2016, Matt Martz <matt@sivel.net>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: json
... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi
from django.contrib.gis.gdal.prototy... | python | github | https://github.com/django/django | django/contrib/gis/gdal/feature.py |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils.nestedset import NestedSet
class CostCenter(NestedSet):
nsm_parent_field = 'parent_co... | unknown | codeparrot/codeparrot-clean | ||
const a = 2;
export var __N_SSG = true;
export default function Test() {
return __jsx("div", null);
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/should-remove-re-exported-variable-declarations-safe/output.js |
#!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test BIP 37
"""
from test_framework.messages import (
CInv,
MAX_BLOOM_FILTER_SIZE,
MAX_BLOOM_H... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.