code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# 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 | ||
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit https://code.google.com/p/feedparser/ for the latest version
Visit http://packages.python.org/feedparser/ for the latest documentation
Required: Python 2.4 or later
Recommended: iconv_codec <http://cjkpython.i18n.org... | unknown | codeparrot/codeparrot-clean | ||
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | unknown | codeparrot/codeparrot-clean | ||
/**
* \file mbedtls/config_psa.h
* \brief PSA crypto configuration options (set of defines)
*
* This set of compile-time options takes settings defined in
* include/mbedtls/mbedtls_config.h and include/psa/crypto_config.h and uses
* those definitions to define symbols used in the library code.
*
* Users and... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/mbedtls/config_psa.h |
"""
Instantiate a db connection.
"""
import mysql.connector as mysql
from mysql.connector.pooling import MySQLConnectionPool
class Db(object):
"""
Instantiate a db connection.
"""
def __init__(self):
dbconfig = {
"database": "geoDev",
"user": "geo",
"passw... | unknown | codeparrot/codeparrot-clean | ||
package kotlinx.coroutines.test
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.testing.*
import kotlin.test.*
import kotlin.test.assertFailsWith
/** Copy of [RunTestTest], but for [runBlockingTestOnTestScope], where applicable. */
@Suppress(... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-test/jvm/test/migration/RunBlockingTestOnTestScopeTest.kt |
# 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 | ||
"""
homeassistant.helpers.state
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Helpers that help with state related things.
"""
import logging
from homeassistant import State
import homeassistant.util.dt as dt_util
from homeassistant.const import (
STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF, ATTR_ENTITY_ID)
_LOGGER = l... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import EdenAiTextToSpeechTool
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional im... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/tools/edenai/audio_text_to_speech.py |
/*-------------------------------------------------------------------------
*
* noblock.c
* set a file descriptor as blocking or non-blocking
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* ... | c | github | https://github.com/postgres/postgres | src/port/noblock.c |
"""
Scrapy Item
See documentation in docs/topics/item.rst
"""
from pprint import pformat
from collections import MutableMapping
from abc import ABCMeta
import six
from scrapy.utils.trackref import object_ref
class BaseItem(object_ref):
"""Base class for all scraped items."""
pass
class Field(dict):
""... | unknown | codeparrot/codeparrot-clean | ||
This example shows how to create an explicit vendor chunk as well as a common chunk for code shared among entry points. In this example, we have 3 entry points: `pageA`, `pageB`, and `pageC`. Those entry points share some of the same utility modules, but not others. This configuration will pull out any modules common t... | unknown | github | https://github.com/webpack/webpack | examples/common-chunk-and-vendor-chunk/template.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-context/src/test/java/org/springframework/scripting/TestBeanAwareMessenger.java |
<!---
Copyright 2020 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 ... | unknown | github | https://github.com/huggingface/transformers | docs/source/es/pr_checks.md |
/* Copyright 2022 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/jit/device_compiler_client.h |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package workdir
import (
"path/filepath"
)
// NormalizePath attempts to transform the given path so that it's relative
// to the working directory, which is our preferred way to present and store
// paths to files and directories within a configu... | go | github | https://github.com/hashicorp/terraform | internal/command/workdir/normalize_path.go |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
from six.moves import cStringIO as StringIO
import traceback
import threading
import pdb
import six
import sys
exec_lock = threading.Lock()
class Eva... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0+ OR MIT)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/rockchip-isp1.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Rockchip SoC Image Signal Processing unit v1
maintainers:
- Helen Koike <helen.koike@collabora.com>
description: |
Rockchip ISP1 is... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/media/rockchip-isp1.yaml |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Core units classes and functions
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..extern import six
from ..extern.six.moves import zip
import inspect
impo... | unknown | codeparrot/codeparrot-clean | ||
from Burst import Burst
import numpy as np
class SB(Burst):
def __init__(self):
self.syncbits = [
0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01,
0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x00, 0x00, 0x01, 0x00, 0x... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | 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/api/src/test/java/org/apache/kafka/connect/data/FieldTest.java |
'''
Created on Nov 2012
@authors: James Robert Lloyd (jrl44@cam.ac.uk)
David Duvenaud (dkd23@cam.ac.uk)
Roger Grosse (rgrosse@mit.edu)
'''
import flexiblekernel as fk
import grammar
import gpml
import utils.latex
import numpy as np
import pylab
import scipy.io
import sys
import os
from job_contr... | unknown | codeparrot/codeparrot-clean | ||
'''
Integration Test for creating KVM VM in MN HA mode after destroying MN VM.
@author: Mirabel
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.node_operations as node_ops
import zstack... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.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_version': '1.1',
's... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins.cache.tests
import io.ktor.client.call.*
import io.ktor.client.plugins.cache.*
import io.ktor.client.statement.*
import io.ktor.client.utils.*
import io.ktor.ht... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/common/test/CacheExpiresTest.kt |
#! /usr/bin/python
#Copyright 2010, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
This script contains the beacon server.
This script should be programmed to the RF200 of the whisper box.
@author: albert
"""
from atmega128rfa1_math import *
from atmega128rfa1_temperature import *
from synapse.RF200 import *
ATT_SERIAL = 1
ATT_DOUBLE_SERIAL = 2 # TBD not yet supported
... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Midokura Japan K.K.
# Copyright (C) 2013 Midokura PTE LTD
# 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 th... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""Stars lights up random LEDs
Try running with optional config name.
ex. ./stars.py blackberry
"""
__author__ = 'plong0 <plong00@gmail.com>'
import sys
import time
import random
from pprint import pprint
from LED_Tunnel import Tunnel
# fun settings - try adding your own config and playing wit... | unknown | codeparrot/codeparrot-clean | ||
import pyjd
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas.ui.Label import Label
from pyjamas.ui.Button import Button
from pyjamas.ui.HorizontalPanel import HorizontalPanel
from pyjamas.ui.AbsolutePanel import AbsolutePanel
from pyjamas.ui.ScrollPanel import ScrollPanel
from p... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/diagnostics/analyzer/NoSuchBeanDefinitionFailureAnalyzer.java |
import base64
import logging
from django.conf import settings
from django.contrib import auth
from django.core.exceptions import ValidationError
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.utils.six import text_type
from django.utils.translation import ugettext_lazy as _
from d... | 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 applicable law or a... | go | github | https://github.com/tensorflow/tensorflow | tensorflow/go/signature.go |
# Tests invocation of the interpreter with various command line arguments
# Most tests are executed with environment variables ignored
# See test_cmd_line_script.py for testing of script execution
import test.support, unittest
import os
import sys
import subprocess
import tempfile
from test.script_helper import spawn_... | unknown | codeparrot/codeparrot-clean | ||
/*
* $Id: phix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved... | c | github | https://github.com/opencv/opencv | 3rdparty/openjpeg/openjp2/phix_manager.c |
#!/usr/bin/env python
import sys
import mar_collection
def exact_accuracy(bpm_detected, bpm_ground):
tolerance = 0.04
diff = abs(bpm_detected - bpm_ground)
if diff <= tolerance * bpm_ground:
return True
return False
def major_extended_harmonic_accuracy(bpm_detected, bpm_ground):
tolerance... | unknown | codeparrot/codeparrot-clean | ||
import io
import re
import textwrap
from typing import Iterable, Optional
from mitmproxy.contentviews import base
from mitmproxy.utils import sliding_window
"""
A custom XML/HTML prettifier. Compared to other prettifiers, its main features are:
- Implemented in pure Python.
- Modifies whitespace only.
- Works with a... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 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 by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2021 The Tensor2Robot 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 ... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
import re
import json
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
parse_iso8601,
str_to_int,
une... | unknown | codeparrot/codeparrot-clean | ||
# File: mbari_campaigns.py
#
# Create a symbolic link named campaigns.py to tell the Django server
# to serve these databases: ln -s mbari_campaigns.py campaigns.py.
# The stoqs/loaders/load.py script uses the load commands associated
# with each database to execute the load and record the provenance.
# Execute 'stoqs/... | unknown | codeparrot/codeparrot-clean | ||
import gym
import numpy as np
import random
import unittest
import uuid
import ray
from ray.rllib.agents.dqn import DQNTrainer
from ray.rllib.agents.pg import PGTrainer
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.env.external_env import ExternalEnv
from ray.rllib.tests.test_rollout_wor... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | cmd/kubeadm/app/cmd/phases/reset/preflight.go |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Werror',
'-pendantic-errors',
'-std=c++0x',
'-fno-strict-aliasing... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# anaconda: The Red Hat Linux Installation program
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... | unknown | codeparrot/codeparrot-clean | ||
name: 🧪 Test
on:
push:
branches:
- main
- dev
tags-ignore:
- v*
paths-ignore:
- "docs/**"
- "**/README.md"
pull_request:
paths-ignore:
- "docs/**"
- "**/*.md"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:... | unknown | github | https://github.com/remix-run/react-router | .github/workflows/test.yml |
from scapy.all import *
import os
import time
from subprocess import *
print '*'*20
print '*'*20
print 'Evil Twin Attack Reburn'
import create_db_hotspot
import urllib2, httplib, redirecthandle
####### SET UP A MONITORING INTERFACE
print '*'*20
print 'Creating a monitoring interface'
output = Popen(["iwconfig"], std... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
from nose.plugins.skip i... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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):
# Removing unique constraint on 'BadgeAssertion', fields ['course_id', 'user']
... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
import random, os.path
#import basic pygame modules
import pygame
from pygame.locals import *
#see if we can load more than standard BMP
if not pygame.image.get_extended():
raise SystemExit("Sorry, extended image module required")
#game constants
MAX_SHOTS = 2 #most player bulle... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#coding:utf-8
# Created: 27.03.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
__author__ = "mozman <mozman@gmx.at>"
try:
# Python 2.6 and earlier need the unittest2 package
# try: easy_install unittest2
# or download source from: http://pypi.python.org/pypi/unittest... | unknown | codeparrot/codeparrot-clean | ||
from tiledrasterio._virtualraster import Band, VirtualRaster, Source
import numpy as np
def create_virtual_raster():
src_path = "tests/data/dummy.asc"
source_band = 1
source_window = ( (1,4),(1,4) )
destination_window = ( (3,6),(3,6) )
band = Band(1,'int64')
for r, c in np.ndindex((3,3)):
... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/st,spear-spics-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ST Microelectronics SPEAr SPI CS GPIO Controller
maintainers:
- Viresh Kumar <vireshk@kernel.org>
description: >
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/gpio/st,spear-spics-gpio.yaml |
#!/bin/sh
#
# Copyright (c) 2008 Brad King
test_description='git svn dcommit honors auto-props'
. ./lib-git-svn.sh
generate_auto_props() {
cat << EOF
[miscellany]
enable-auto-props=$1
[auto-props]
*.sh = svn:mime-type=application/x-shellscript; svn:eol-style=LF
*.txt = svn:mime-type=text/plain; svn:eol-style = nati... | unknown | github | https://github.com/git/git | t/t9124-git-svn-dcommit-auto-props.sh |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/DTensorState.h>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/Functions.h>
#include <ATen/NativeFunctions.h>
#else
#include <ATen/ops/arange.h>
#include <ATen/ops/empty.h>
#include <ATen/ops/eq.h>
#include <ATen/ops/one_hot_native... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/Onehot.cpp |
#!/usr/bin/env python
import argparse
import glob
import gc
import os
import time
import multiprocessing as mp
#pip installed libs
import numpy as np
#local libs
import fusorsv.svu_utils as su
import fusorsv.read_utils as ru
import fusorsv.fusor_utils as fusor
des = """
FusorSV - A Data Fusion Method for Multi Source ... | unknown | codeparrot/codeparrot-clean | ||
// enums are compiled away via custom transform so no real dependency here
import { ReactiveFlags } from '@vue/reactivity'
import {
isArray,
isFunction,
isMap,
isObject,
isPlainObject,
isSet,
isString,
isSymbol,
objectToString,
} from './general'
// can't use isRef here since @vue/shared has no deps
... | typescript | github | https://github.com/vuejs/core | packages/shared/src/toDisplayString.ts |
#!/usr/bin/env bash
set -e
set -x
# Decide what kind of documentation build to run, and run it.
#
# If the last commit message has a "[doc skip]" marker, do not build
# the doc. On the contrary if a "[doc build]" marker is found, build the doc
# instead of relying on the subsequent rules.
#
# We always build the docum... | unknown | github | https://github.com/scikit-learn/scikit-learn | build_tools/circle/build_doc.sh |
"""
Views used by XQueue certificate generation.
"""
import json
import logging
from django.contrib.auth.models import User
from django.db import transaction
from django.http import Http404, HttpResponse, HttpResponseForbidden
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http impor... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2024 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | github | https://github.com/tensorflow/tensorflow | .github/dependabot.yml |
/*
* 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/main/java/org/apache/kafka/common/metrics/Measurable.java |
# 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 | ||
{
"applyable": true,
"complete": true,
"configuration": {
"provider_config": {
"tfcoremock": {
"full_name": "registry.terraform.io/hashicorp/tfcoremock",
"name": "tfcoremock",
"version_constraint": "0.1.1"
}
},
"root_module": {
"resources": [
{
... | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/outputs/replace_within_object/plan.json |
# frozen_string_literal: true
class Organization < ActiveRecord::Base
has_many :member_details
has_many :members, through: :member_details
has_many :authors, primary_key: :name
has_many :author_essay_categories, through: :authors, source: :essay_categories
has_one :author, primary_key: :name
has_one :aut... | ruby | github | https://github.com/rails/rails | activerecord/test/models/organization.rb |
#**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package promising
type ptrSet[T any] map[*T]struct{}
func (s ptrSet[T]) Add(p *T) {
s[p] = struct{}{}
}
func (s ptrSet[T]) Remove(p *T) {
delete(s, p)
}
func (s ptrSet[T]) Has(p *T) bool {
_, ret := s[p]
return ret
}
type promiseSet = ptrSe... | go | github | https://github.com/hashicorp/terraform | internal/promising/ptr_set.go |
from bokeh.models import StaticLayoutProvider, ColumnDataSource, HoverTool, TapTool
from bokeh.models.graphs import NodesAndLinkedEdges
from bokeh.palettes import Set3_12
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.us_states import data as us_states
from bokeh.sampledata.airport_routes im... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
In an earlier exercise we looked at the cities dataset and asked which region in India contains
the most cities. In this exercise, we'd like you to answer a related question regarding regions in
India. What is the average city population for a region in India? Calculate your answer by first
fi... | unknown | codeparrot/codeparrot-clean | ||
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
import unittest
from test.test_support import run_unittest, have_unicode
class UnaryOpTestCase(unittest.TestCase):
def test_negative(self):
self.assert_(-2 == 0 - 2)
self.assert_(-0 == 0)
self.assert_(--2 == 2)
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package pluginutil
import (
"time"
)
const redactedTokenString = "ey***"
type IdentityTokenRequest struct {
// Audience identifies the recipient of the token. The requested
// value will be in the "aud" claim. Required.
Audience string
// TT... | go | github | https://github.com/hashicorp/vault | sdk/helper/pluginutil/identity_token.go |
# Copyright 2008 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | unknown | codeparrot/codeparrot-clean | ||
/*
* 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 | core/spring-boot/src/test/java/org/springframework/boot/info/GitPropertiesTests.java |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import MongodbLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional ... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/mongodb.py |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# parts taken from weirdtx.py
import test_framework.loginit
import time
import sys
if sys.version_... | unknown | codeparrot/codeparrot-clean | ||
"""
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import sys
import Tkinter
from os import path
_appbundle = None
def runningAsOSXApp():
"""
Returns True if Python is running from within an app on OSX.
If so, assume that P... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, Inc.
#
# 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
# (... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import time
from collections import defaultdict
import django_filters
from django.conf import settings
from rest_framework import (exceptions,
filters,
pagination,
viewsets)
from rest_framework.response import Response
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import unirest
import time
import json
import pprint
import logging
import argparse
unirest.timeout(120)
IODAPIKEY = os.environ.get('IODAPIKEY')
parser = argparse.ArgumentParser(description='Delete an IOD web connector and its associated text index')
parser.add_argument('--apikey', d... | unknown | codeparrot/codeparrot-clean | ||
"""
Extra HTML Widget classes
"""
from django.newforms.widgets import Widget, Select
from django.utils.dates import MONTHS
import datetime
__all__ = ('SelectDateWidget',)
class SelectDateWidget(Widget):
"""
A Widget that splits date input into three <select> boxes.
This also serves as an example of a Wi... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import werks.bus
class TestEventHandler(object):
def __init__(self):
self.triggered = False
self.arg = None
self.kw = None
def callback(self):
self.triggered = True
def cb_arg(self, arg):
self.arg = arg
def cb_kw(self, kw=None):
self.... | unknown | codeparrot/codeparrot-clean | ||
"""The tests for the mFi sensor platform."""
from mficlient.client import FailedToLogin
import pytest
import requests
import homeassistant.components.mfi.sensor as mfi
import homeassistant.components.sensor as sensor_component
from homeassistant.const import TEMP_CELSIUS
from homeassistant.setup import async_setup_com... | unknown | codeparrot/codeparrot-clean | ||
__all__ = ('override_settings',)
try:
from django.test.utils import override_settings
except ImportError:
# we are in Django 1.3
from django.conf import settings, UserSettingsHolder
from django.utils.functional import wraps
class override_settings(object):
"""
Acts as either a deco... | unknown | codeparrot/codeparrot-clean | ||
Title: pandas 3.0.0 release candidate ready for testing!
Date: 2025-12-12
# pandas 3.0.0 release candidate ready for testing!
We're excited to announce the release candidate for pandas 3.0. This major
release brings significant improvements to pandas, but also features some
potentially breaking changes.
To ensure a ... | unknown | github | https://github.com/pandas-dev/pandas | web/pandas/community/blog/pandas-3.0-release-candidate.md |
from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query class
to hand... | unknown | codeparrot/codeparrot-clean | ||
```{eval-rst}
.. currentmodule:: torch.profiler
```
# torch.profiler
## Overview
```{eval-rst}
.. automodule:: torch.profiler
```
## API Reference
```{eval-rst}
.. autoclass:: torch.profiler._KinetoProfile
:members:
.. autoclass:: torch.profiler.profile
:members:
.. autoclass:: torch.profiler.ProfilerAction
... | unknown | github | https://github.com/pytorch/pytorch | docs/source/profiler.md |
# 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 | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2013, Paul Durivage <paul.durivage@rackspace.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
# (a... | unknown | codeparrot/codeparrot-clean | ||
DOCUMENTATION:
name: config | unknown | github | https://github.com/ansible/ansible | lib/ansible/_internal/ansible_collections/ansible/_protomatter/plugins/lookup/config.yml |
import re
import string
from datetime import datetime
import random
from uuid import uuid4
from boto3 import Session
from moto.core import BaseBackend, BaseModel, ACCOUNT_ID
from moto.core.utils import unix_time
from moto.organizations import organizations_backends
from moto.ram.exceptions import (
MalformedArnExc... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/LegacyRestTestBasePlugin.java |
# -*- coding: utf-8 -*-
import base64
import web
import gecoc.gecolib as gecolib
def authenticated(function):
session = web.ses
def new_function(*args, **kwargs):
username = session.get('username', '')
if username:
return function(*args, **kwargs)
else:
raise web... | unknown | codeparrot/codeparrot-clean | ||
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Router - SSR Example</title>
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/entry.client.tsx"></script>
<... | html | github | https://github.com/remix-run/react-router | examples/ssr/index.html |
/*
* 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/common/record/internal/InvalidMemoryRecordsProvider.java |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | unknown | codeparrot/codeparrot-clean | ||
"""
Utilities for django models.
"""
import unicodedata
import re
from eventtracking import tracker
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from django_countries.fields import Country
# The setting name used for events when "sett... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package addrs
import (
"fmt"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/hashicorp/terraform/internal/tfdiags"
)
// Target describes a targeted address with source location information.
type Target struc... | go | github | https://github.com/hashicorp/terraform | internal/addrs/parse_target.go |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v40.refresh_string.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v40.refresh_string.v42.v2alpha1.json |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.