code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# Copyright (c) 2010 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
unknown
codeparrot/codeparrot-clean
1000000.times.map{|i| a={}; 2.times{|j| a[j]=j}; a}
ruby
github
https://github.com/ruby/ruby
benchmark/hash_small2.rb
"Dialog to specify or edit the parameters for a user configured help source." import os import sys from Tkinter import * import tkMessageBox import tkFileDialog class GetHelpSourceDialog(Toplevel): def __init__(self, parent, title, menuItem='', filePath=''): """Get menu entry and url/ local file location...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import logging from metrics import Metric from telemetry.value import scalar _COUNTER_NAMES = [ 'V8.OsMemoryAllocated', 'V8.MemoryNewSp...
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\Bridge\Doctrine\Validator\Constraints; use Symfony\Component\Va...
php
github
https://github.com/symfony/symfony
src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional from typing_extensions import Literal from ..._models import BaseModel __all__ = ["PythonGrader"] class PythonGrader(BaseModel): """A PythonGrader object that runs a python script on the input.""" ...
python
github
https://github.com/openai/openai-python
src/openai/types/graders/python_grader.py
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
unknown
codeparrot/codeparrot-clean
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
unknown
codeparrot/codeparrot-clean
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import six from django.conf import settings from django.contrib import messages from django.contrib.messages.api import MessageFailure from django.shortcuts import redirect from django.utils.http import urlquote from social.exceptions import SocialAuthBaseException class SocialAuthExceptionMi...
unknown
codeparrot/codeparrot-clean
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
unknown
codeparrot/codeparrot-clean
""" FEniCS tutorial demo program: Diffusion equation with Dirichlet conditions and a solution that will be exact at all nodes. As d1_d2D.py, but here we do all assembly prior to the time loop (for increased efficiency). """ from dolfin import * import numpy # Create mesh and define function space nx = ny = 2 mesh = U...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('finance', '0001_initial'), ] operations = [ migrations.AlterField( model_name='bourse', name='company...
unknown
codeparrot/codeparrot-clean
""" Created on Wed Jun 24 11:04:10 2015 Learn T1 NMR experiement run on TOPSPIN T1 inversion recovery model defined in find_T1_model class includes calls to run TOPSPIN commands- NMR experiment @author: Kissan Mistry """ #imports and intializations from __future__ import division from t1_model import T1Model from qi...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals from django.db import models from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.utils.encoding import python_2_unicode_compatible from taggit.models import TaggedItemBase from taggit.managers import TaggableManager from modelcluster.fields imp...
unknown
codeparrot/codeparrot-clean
Vault API ================= This provides the `github.com/hashicorp/vault/api` package which contains code useful for interacting with a Vault server. For examples of how to use this module, see the [vault-examples](https://github.com/hashicorp/vault-examples) repo. For a step-by-step walkthrough on using these clien...
unknown
github
https://github.com/hashicorp/vault
api/README.md
//===--- HTTP2StateMachine.swift ------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
swift
github
https://github.com/apple/swift
benchmark/single-source/HTTP2StateMachine.swift
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/compress/DirectDecompressor.java
from mongoengine import * from datetime import datetime from mongoengine.base import BaseField connect('infoneige') class StreetProperties(EmbeddedDocument): A = StringField() SENS_CIR = IntField() DE = StringField() SUR = StringField() TRC_ID = IntField() class Street(Document): trcId = IntField() geometry =...
unknown
codeparrot/codeparrot-clean
//===--- NoDiscard.h ------------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
c
github
https://github.com/apple/swift
include/swift/Basic/NoDiscard.h
# Copyright (c) 2012 VMware, Inc. # Copyright (c) 2011 Citrix Systems, Inc. # Copyright 2011 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://w...
unknown
codeparrot/codeparrot-clean
package cluster import ( "context" types "github.com/moby/moby/api/types/swarm" "github.com/moby/moby/v2/daemon/cluster/convert" "github.com/moby/moby/v2/daemon/server/swarmbackend" "github.com/moby/moby/v2/errdefs" swarmapi "github.com/moby/swarmkit/v2/api" "google.golang.org/grpc" ) // GetNodes returns a li...
go
github
https://github.com/moby/moby
daemon/cluster/nodes.go
--- title: Custom 404 Page author: ashmaroli date: 2017-03-11 17:23:24 +0530 --- You can easily serve custom 404 error pages with Jekyll to replace the default **Error 404 -- File Not Found** page displayed when one tries to access a broken link on your site. ## On GitHub Pages Any `404.html` at the **root of your `...
unknown
github
https://github.com/jekyll/jekyll
docs/_tutorials/custom-404-page.md
# -*- coding: utf-8 -*- # pylint: disable=W0102 from datetime import datetime, date import nose import numpy as np import re import itertools from pandas import (Index, MultiIndex, DataFrame, DatetimeIndex, Series, Categorical) from pandas.compat import OrderedDict, lrange from pandas.sparse.arra...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('statmaps', '0046_auto_20150428_0616'), ] operations = [ migrations.AddField( model_name='nidmresultstatisticmap',...
unknown
codeparrot/codeparrot-clean
#!/bin/sh for nm in `cat $1` ; do n=`echo ${nm} |tr ':' ' ' |awk '{print $1}'` echo "#undef je_${n}" done
unknown
github
https://github.com/redis/redis
deps/jemalloc/include/jemalloc/internal/public_unnamespace.sh
/* * Copyright 2014-2023 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.server.auth internal actual suspend fun OAuthAuthenticationProvider.oauth1a( authProviderName: String?, context: AuthenticationContext ) { throw NotImplementedErro...
kotlin
github
https://github.com/ktorio/ktor
ktor-server/ktor-server-plugins/ktor-server-auth/posix/src/OAuthNative.kt
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 Big Switch Networks, 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 ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 import sys, os, argparse def format_n(x): x = float(x) x = '{:.3g}'.format(x) x = x.replace('e-0', 'e-') if x.startswith('0.'): x = x[1:] if x.startswith('-0.'): x = '-' + x[2:] return x if __name__ == "__main__": parser = argparse.ArgumentParser( ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that i...
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 distributed...
unknown
codeparrot/codeparrot-clean
import numpy as np from astropy.coordinates import ICRS, SkyCoord import cdshealpix from astropy.wcs.utils import skycoord_to_pixel from matplotlib.path import Path from matplotlib.patches import PathPatch from .utils import build_plotting_moc from . import culling_backfacing_cells from . import axis_viewport def c...
unknown
codeparrot/codeparrot-clean
# promoteUsedTemporaries ## File `src/ReactiveScopes/PromoteUsedTemporaries.ts` ## Purpose This pass promotes temporary variables (identifiers with no name) to named variables when they need to be referenced across scope boundaries or in code generation. Temporaries are intermediate values that the compiler creates d...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/docs/passes/29-promoteUsedTemporaries.md
//===--- IndexAction.h - Run the indexer as a frontend action ----*- C++-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
clang-tools-extra/clangd/index/IndexAction.h
<option value="{{ widget.value }}"{% include "django/forms/widgets/attrs.html" %}>{{ widget.label }}</option>
html
github
https://github.com/django/django
django/forms/jinja2/django/forms/widgets/select_option.html
# fly ArduCopter in SITL # Flight mode switch positions are set-up in arducopter.param to be # switch 1 = Circle # switch 2 = Land # switch 3 = RTL # switch 4 = Auto # switch 5 = Loiter # switch 6 = Stabilize import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavut...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package consul import ( "sync" "testing" realtesting "testing" "github.com/hashicorp/go-hclog" "github.com/hashicorp/vault/helper/testhelpers/consul" physConsul "github.com/hashicorp/vault/physical/consul" "github.com/hashicorp/vault/vault...
go
github
https://github.com/hashicorp/vault
helper/testhelpers/teststorage/consul/consul.go
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. from __future__ import print_function ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import unittest2 import openerp.tests.common as common from openerp.addons.connector.backend import (Backend, get_backend, BACKENDS) from openerp.addons.connector.exception import NoConnectorUnitError f...
unknown
codeparrot/codeparrot-clean
import rospy import roslib import subprocess from functools import partial from os import path import actionlib from rqt_robot_dashboard.widgets import IconToolButton from python_qt_binding.QtCore import QSize from std_srvs.srv import Empty from rqt_robot_dashboard import util class DriversStatusWidget(IconToolButton)...
unknown
codeparrot/codeparrot-clean
- hosts: host1,host2 gather_facts: no tasks: - block: - block: - name: EXPECTED FAILURE host1 fails fail: when: inventory_hostname == 'host1' - set_fact: only_host2_fact: yes - name: should not fail fail: when: only...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/blocks/72725.yml
- name: create test directories file: path: '{{ remote_tmp_dir }}/dir-traversal/{{ item }}' state: directory loop: - source - target - roles - name: create test content copy: dest: '{{ remote_tmp_dir }}/dir-traversal/source/content.txt' content: | some content to write - name: ...
unknown
github
https://github.com/ansible/ansible
test/integration/targets/ansible-galaxy-role/tasks/dir-traversal.yml
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package vault import ( "context" "encoding/json" "fmt" "strings" "github.com/golang/protobuf/proto" wrapping "github.com/hashicorp/go-kms-wrapping/v2" "github.com/hashicorp/vault/sdk/physical" "github.com/hashicorp/vault/vault/seal" ) //...
go
github
https://github.com/hashicorp/vault
vault/seal_util.go
# -*- coding: utf-8 -*-; # # gmail2kayac.py --- notify new mail comming in gmail inbox to iPhone user # through im.kayac.com # # external packages # - Universal Feed Parser # http://www.feedparser.org/ # - Pit # # API reference # 1. im.kayac.com # http://im.kayac.com # __author__ = 'y...
unknown
codeparrot/codeparrot-clean
# Grafana Dashboards The files in this directory contain example Grafana dashboard configurations to act as a starting point for users looking to monitor CockroachDB via Grafana. Note that while the CockroachDB team provides these dashboards as an example, these dashboards are not guaranteed to function out of the bo...
unknown
github
https://github.com/cockroachdb/cockroach
monitoring/grafana-dashboards/by-cluster/README.md
//// [tests/cases/compiler/ambientEnumElementInitializer6.ts] //// //// [ambientEnumElementInitializer6.ts] declare namespace M { enum E { e = 3 } } //// [ambientEnumElementInitializer6.js] "use strict";
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/ambientEnumElementInitializer6.js
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( parse_duration, unified_strdate, str_to_int, int_or_none, float_or_none, ISO639Utils, determine_ext, ) class AdobeTVBaseIE(InfoExtractor): _API_BAS...
unknown
codeparrot/codeparrot-clean
from django import oldforms from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.forms import PasswordResetForm, PasswordChangeForm from django.contrib.sites.models import Site, Req...
unknown
codeparrot/codeparrot-clean
/* Copyright 2021 - 2025 R. Thomas * * 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 t...
cpp
github
https://github.com/nodejs/node
deps/LIEF/src/DEX/Field.cpp
''' These classes are based on starter code from CS 221 class at Stanford ''' import collections, random from math import sqrt # Abstract class: an RLAlgorithm performs reinforcement learning. All it needs # to know is the set of available actions to take. The simulator (see # simulate()) will call getAction() to g...
unknown
codeparrot/codeparrot-clean
import { flushSync } from 'svelte'; import { test } from '../../test'; export default test({ html: ` <label><input type="checkbox" value="x"> x</label> <label><input type="checkbox" value="y"> y</label> <label><input type="checkbox" value="z"> z</label> <p></p> <label><input type="checkbox" value="x"> x</la...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/binding-input-group-each-6/_config.js
#!/usr/bin/python2.4 # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://w...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # Copyright (C) 2022 Renesas Electronics Corp. %YAML 1.2 --- $id: http://devicetree.org/schemas/media/renesas,rzg2l-cru.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Renesas RZ/G2L (and alike SoC's) Camera Data Receiving Unit (CRU) Image proces...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/media/renesas,rzg2l-cru.yaml
#!/usr/bin/env python #-*- coding:utf-8 -*- #author:lijian #date: 2016 #Copyright: free import os import re from yuelibs import errno from yuelibs import constants from yuelibs import utils class LocalFsStorage(object): def __init__(self, path='', flag=False): self.path = path self.meta = os.path....
unknown
codeparrot/codeparrot-clean
import { withPageAuthRequired } from "@auth0/nextjs-auth0"; import Layout from "../../components/layout"; import { User } from "../../interfaces"; type ProfileProps = { user: User; }; export default function Profile({ user }: ProfileProps) { return ( <Layout user={user}> <h1>Profile</h1> <div> ...
typescript
github
https://github.com/vercel/next.js
examples/auth0/pages/advanced/ssr-profile.tsx
/* 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/core/tfrt/fallback/op_kernel_runner_cache.h
"""Custom install scripts for CloudMan environment. From Enis Afgan: https://bitbucket.org/afgane/mi-deployment """ import os import contextlib from fabric.api import cd from fabric.contrib.files import settings, hide from cloudbio.custom.shared import (_make_tmp_dir, _setup_conf_file) from cloudbio.cloudman import ...
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
# 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...
python
github
https://github.com/tensorflow/tensorflow
tensorflow/compiler/tests/xla_dump_to_test.py
import collections import weakref from . import math from ._SDL import * from ._GL import * from ._Window import * UserQuitEvent = collections.namedtuple("UserQuitEvent", []) ResizeEvent = collections.namedtuple("ResizeEvent", ["window", "new_size"]) KeyPressEvent = collections.namedtuple("KeyPressEvent", ["window", ...
unknown
codeparrot/codeparrot-clean
# Volatility # Copyright (c) 2008-2013 Volatility Foundation # Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu> # # This file is part of Volatility. # # Volatility 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...
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
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Minimal controler for 433Mhz RF Wireless Power Outlets FROM: http://timleland.com/wireless-power-outlets/ https://github.com/timleland/rfoutlet """ import argparse from pyoutlet import Switcher def _args_parser(): """ Argument parser """ p = argparse.ArgumentPars...
unknown
codeparrot/codeparrot-clean
from ctypes import c_void_p from types import NoneType from django.contrib.gis.geos.error import GEOSException, GEOSIndexError # Trying to import GDAL libraries, if available. Have to place in # try/except since this package may be used outside GeoDjango. try: from django.contrib.gis import gdal except ImportErro...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
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
package kotlinx.coroutines.exceptions import platform.posix.* import kotlin.native.concurrent.* actual inline fun yieldThread() { sched_yield() } actual fun currentThreadName(): String = Worker.current.name
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/native/test/ConcurrentTestUtilities.kt
""" Block Structure Transformer Registry implemented using the platform's PluginManager. """ from base64 import b64encode from hashlib import sha1 from openedx.core.lib.api.plugins import PluginManager from openedx.core.lib.cache_utils import memoized class TransformerRegistry(PluginManager): """ Registry for...
unknown
codeparrot/codeparrot-clean
import decimal import enum import json import unittest import uuid from django import forms from django.core import checks, exceptions, serializers, validators from django.core.exceptions import FieldError from django.core.management import call_command from django.db import IntegrityError, connection, models from dja...
unknown
codeparrot/codeparrot-clean
from django.views import generic from accounts.models import Menu from django.http import HttpResponse from django.shortcuts import render from carton.cart import Cart class HomePage(generic.TemplateView): template_name = "home.html" class AboutPage(generic.TemplateView): template_name = "about.html" def tru...
unknown
codeparrot/codeparrot-clean
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package stackmigrate import ( "fmt" "io" "net/http" "net/http/httptest" "os" "path" "path/filepath" "strings" "testing" svchost "github.com/hashicorp/terraform-svchost" "github.com/hashicorp/terraform-svchost/auth" "github.com/hashicor...
go
github
https://github.com/hashicorp/terraform
internal/stacks/stackmigrate/load_test.go
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: Tix.py 81008 2010-05-08 20:59:42Z benjamin.peterson $ # # Tix.py -- Tix widget wrappers. # # For Tix, see http://tix.sourceforge.net # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. # based on an idea of Jean-Ma...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/vitmatte.md
import sys import platform import _pytest._code import pytest def runpdb_and_get_report(testdir, source): p = testdir.makepyfile(source) result = testdir.runpytest_inprocess("--pdb", p) reports = result.reprec.getreports("pytest_runtest_logreport") assert len(reports) == 3, reports # setup/call/teardo...
unknown
codeparrot/codeparrot-clean
# 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. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
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 unittest import os from tvcm import fake_fs class FakeFSUnittest(unittest.TestCase): def testBasic(self): fs = fake_fs.FakeFS() fs.AddFile(...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2011 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 agreed ...
java
github
https://github.com/google/guava
guava/src/com/google/common/cache/Cache.java
#!/bin/sh test_description='avoid rewriting packed-refs unnecessarily' . ./test-lib.sh if test_have_prereq !REFFILES then skip_all='skipping files-backend specific pack-refs tests' test_done fi # Add an identifying mark to the packed-refs file header line. This # shouldn't upset readers, and it should be omitte...
unknown
github
https://github.com/git/git
t/t1409-avoid-packing-refs.sh
#!/usr/bin/env python # # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs Android's lint tool.""" import optparse import os import sys from xml.dom import minidom from util import build_utils ...
unknown
codeparrot/codeparrot-clean
""" Account constants """ from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ # The minimum and maximum length for the name ("full name") account field NAME_MIN_LENGTH = 2 NAME_MAX_LENGTH = 255 # The minimum and maximum length for the username account field USERNAME_MIN_...
unknown
codeparrot/codeparrot-clean
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v1beta1", "metadata": { "name": "v24.table-angular.v42" }, "spec": { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dashboards_from_v0_to_v2/v2beta1.v24.table-angular.v1beta1.json
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', 'status': ['stableinterface'],...
unknown
codeparrot/codeparrot-clean
--- applyTo: "vault/ui/**/*.hbs" description: "HashiCorp Ember.js UI Handlebars template coding standards" --- # HashiCorp Ember.js Handlebars Template Guidelines This document provides Handlebars template coding standards for HashiCorp Ember.js UI applications. > **Note**: For general project context, framework inf...
unknown
github
https://github.com/hashicorp/vault
.github/instructions/generic/ember_hbs.instructions.md
/* * Copyright 2020 Google LLC * * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file or at * https://developers.google.com/open-source/licenses/bsd */ #ifndef BLOCK_H #define BLOCK_H #include "basics.h" #include "record.h" #include "reftable-block.h" #include "re...
c
github
https://github.com/git/git
reftable/block.h
# -*- coding: utf-8 -*- """ @author: Fabio Erculiani <lxnay@sabayon.org> @contact: lxnay@sabayon.org @copyright: Fabio Erculiani @license: GPL-2 B{Entropy Package Manager Client Core Interface}. """ import os import shutil import threading from entropy.core import Singleton from entropy.locks im...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 (<http://www.erpsystems.ro>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under the...
unknown
codeparrot/codeparrot-clean
from __future__ import absolute_import import sys import types from django.apps import AppConfig from django.test import TestCase from tenant_schemas import utils class AppLabelsTestCase(TestCase): def setUp(self): self._modules = set() def tearDown(self): for name in self._modules: ...
unknown
codeparrot/codeparrot-clean
import subprocess import os import shutil import re import multiprocessing as mp from praatio import tgio from .config import TEMP_DIR from .helper import thirdparty_binary from .multiprocessing import transcribe, transcribe_fmllr from .corpus import AlignableCorpus from .helper import score, log_kaldi_errors, parse_lo...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licen...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/env python # Copyright 2019 Google # # 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 ag...
unknown
codeparrot/codeparrot-clean
import socket import time import pickle import os from functools import partial class Sender: def __init__(self, client_ip, filename, verbose=False): self.sock = socket.socket() self.host = client_ip self.port = 6000 self.filename = filename self.filesize = os.path.getsize(self.filename) self.verbose = v...
unknown
codeparrot/codeparrot-clean
import json from django.views.generic import View from django.utils.safestring import mark_safe from django.shortcuts import render_to_response, RequestContext from django.core.exceptions import PermissionDenied from rest_framework.views import Response from rest_framework_swagger.urlparser import UrlParser from rest...
unknown
codeparrot/codeparrot-clean
import json import requests from requests.exceptions import HTTPError class SmartLogic(object): BASE_URL = 'https://cloud.smartlogic.com/' SERVICE_URL = 'svc/0dcee7c7-1667-4164-81e5-c16e46f2f74c/ses/v1.2/CombinedModel/' def __init__(self, api_key): self.api_key = api_key self._token = sel...
unknown
codeparrot/codeparrot-clean
import bz2, re from lib.stringutil import StringUtil class TermState: Invalid, Known, Unknown, Ignored, NotSeen = range(5) @staticmethod def ToString(state): if state==0: return "Invalid" elif state==1: return "Known" elif state==2: return "Unkno...
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
/********************************************************************** vm_insnhelper.c - instruction helper functions. Included into vm.c. $Author$ Copyright (C) 2007 Koichi Sasada **********************************************************************/ #include "ruby/internal/config.h" #include <math.h> #...
c
github
https://github.com/ruby/ruby
vm_insnhelper.c