code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from django import forms
from django.contrib import admin
from django.contrib.admin import AdminSite
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.contenttypes.admin import GenericStackedInline
from django.contrib.messages.m... | python | github | https://github.com/django/django | tests/admin_checks/tests.py |
# This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
import string
# Declarations that cha... | unknown | codeparrot/codeparrot-clean | ||
from django_filters import rest_framework as filters
from entitlements.models import CourseEntitlement
class CharListFilter(filters.CharFilter):
""" Filters a field via a comma-delimited list of values. """
def filter(self, qs, value): # pylint: disable=method-hidden
if value not in (None, ''):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2025 The Nari Labs and HuggingFace Inc. 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 re... | python | github | https://github.com/huggingface/transformers | src/transformers/models/dia/configuration_dia.py |
import sys
from artiq.experiment import *
class Mandelbrot(EnvExperiment):
"""Mandelbrot set demo"""
def build(self):
self.setattr_device("core")
def col(self, i):
sys.stdout.write(" .,-:;i+hHM$*#@ "[i])
def row(self):
print("")
# based on: http://warp.povusers.org/Mand... | 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 python
# -*- coding: utf-8 -*-
# file lyx_pot.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# \author Bo Peng
#
# Full author contact details are available in file CREDITS
# Usage: use
# lyx_pot.py -h
# to get usage message
# This scri... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
class ModuleDocFragment(object):
# Standard documentation fragment
DOCUMENTATION = r"""
attributes:
check_mode:
descrip... | python | github | https://github.com/ansible/ansible | lib/ansible/plugins/doc_fragments/action_common_attributes.py |
- hosts: localhost
gather_facts: false
tasks:
- name: test missing role rescue
vars:
rescue_1: false
block:
- name: Include a role that doesn't exist
include_role:
name: missing_role
rescuable: '{{ rescueme | default(omit) }}'
rescue:
... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/includes/include_role_error_handling.yml |
from awacs.aws import (
Allow,
Condition,
Policy,
Statement,
StringEquals,
StringLike,
)
import awacs.logs
import awacs.s3
import awacs.firehose
import awacs.kms
from awacs.helpers.trust import make_simple_assume_statement
from stacker.blueprints.base import Blueprint
from troposphere import ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""Base classes for statistical test results
Created on Mon Apr 22 14:03:21 2013
Author: Josef Perktold
"""
from statsmodels.compat.python import lzip, zip
import numpy as np
class AllPairsResults(object):
'''Results class for pairwise comparisons, based on p-values
Parameters
--... | unknown | codeparrot/codeparrot-clean | ||
"""passlib.exc -- exceptions & warnings raised by passlib"""
#=============================================================================
# exceptions
#=============================================================================
class MissingBackendError(RuntimeError):
"""Error raised if multi-backend handler ha... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | kotlin | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/kotlin/org/springframework/docs/web/websocket/stomp/websocketstomporderedmessages/PublishOrderWebSocketConfiguration.kt |
"""
VimPdb.py
Pdb simulation within Vim (in an IDE like fashion).
Author:
Yaron Budowski
"""
import bdb
import vim
import time
import sys
import os
class PdbIDE(bdb.Bdb):
"""Simulates a Python debugger in an IDE-like mode (unlike PDB, which acts as a command-line console debugger)."""
#
# Constants
#
# T... | unknown | codeparrot/codeparrot-clean | ||
"""
destroy_cached_images.py
This script is used to clean up Glance images that are cached in the SR. By
default, this script will only cleanup unused cached images.
Options:
--dry_run - Don't actually destroy the VDIs
--all_cached - Destroy all cached images instead of just unused cached
... | unknown | codeparrot/codeparrot-clean | ||
"""
WSGI config for icecreamratings_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSG... | unknown | codeparrot/codeparrot-clean | ||
###########################################################
#
# Copyright (c) 2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | unknown | codeparrot/codeparrot-clean | ||
class DictDiff:
"""
Represents the difference between two dictionaries
"""
__slots__ = ('added', 'removed', 'intersection', 'changed', 'unchanged')
def __init__(self, added, removed, intersection, changed, unchanged):
self.added = added
"""
`set` ( `mixed` ) : Keys that were... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | unknown | codeparrot/codeparrot-clean | ||
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# Derived from source in PyFlag developed by:
# Copyright 2004: Commonwealth of Australia.
# Michael Cohen <scudette@users.sourceforge.net>
# David Collett <daveco@users.sourceforge.net>
#
# Subclassing plugin code developed by:
#
# Mike Auty <mike.auty@gma... | unknown | codeparrot/codeparrot-clean | ||
use rustc_hir::def_id::LocalDefId;
use rustc_middle::mir;
use rustc_middle::mir::interpret::{AllocInit, Allocation, GlobalAlloc, InterpResult, Pointer};
use rustc_middle::ty::layout::TyAndLayout;
use rustc_middle::ty::{TyCtxt, TypeVisitable, TypeVisitableExt};
use tracing::debug;
use super::{InterpCx, MPlaceTy, Memory... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_const_eval/src/interpret/util.rs |
from ryu.services.protocols.bgp.rtconf.base import ConfWithStats
from ryu.services.protocols.bgp.rtconf.common import CommonConfListener
from ryu.services.protocols.bgp.rtconf.neighbors import NeighborsConfListener
from ryu.services.protocols.bgp.rtconf import vrfs
from ryu.services.protocols.bgp.rtconf.vrfs import Vrf... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
from skimage.feature.util import (FeatureDetector, DescriptorExtractor,
_mask_border_keypoints,
_prepare_grayscale_input_2D)
from skimage.feature import (corner_fast, corner_orientations, corner_peaks,
... | unknown | codeparrot/codeparrot-clean | ||
"""Unit tests for feature_flag_tags_check.py."""
import unittest
from unittest.mock import patch
from buildscripts import feature_flag_tags_check
class TestFindTestsInGitDiff(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.requires_fcv_tag = "requires_fcv_51"
cls.original_requires_f... | python | github | https://github.com/mongodb/mongo | buildscripts/tests/test_feature_flag_tags_check.py |
import base64
import json
import os
import uuid
from multiprocessing import Process
from multiprocessing.managers import BaseManager, DictProxy
class ServerDictManager(BaseManager):
shared_data = {}
def _get_shared():
return ServerDictManager.shared_data
ServerDictManager.register("get_dict",
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
'''
Copyright (c) 2015 Jacob Mendt
Created on 22.01.16
@author: mendt
The following scripts compresses all files within a tms cache. It is based on the PIL library.
'''
import argparse
import os
from PIL import Image
def compressTMSCache(path):
""" Functions runs a pngs compression on th... | unknown | codeparrot/codeparrot-clean | ||
import gtk
class PageDrawer (gtk.DrawingArea):
def __init__(self, page_width=None, page_height=None,
sub_areas=[],xalign=0.5,yalign=0.5
):
"""Draw a page based on page areas given to us.
The areas can be given in any scale they like.
sub_areas are each (... | unknown | codeparrot/codeparrot-clean | ||
import logging
import sys
import openerp
from openerp import tools
from openerp.modules import module
_logger = logging.getLogger(__name__)
commands = {}
class CommandType(type):
def __init__(cls, name, bases, attrs):
super(CommandType, cls).__init__(name, bases, attrs)
name = getattr(cls, name,... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
use crate::loom::sync::Arc;
use crate::runtime::context;
use crate::runtime::scheduler::{self, current_thread, Inject};
use crate::task::Id;
use backtrace::BacktraceFrame;
use std::cell::Cell;
use std::collections::VecDeque;
use std::ffi::c_void;
use std::fmt;
use std::future::Future;
use std::pin::Pin;
use std::ptr::... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/task/trace/mod.rs |
#!/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.
import argparse
import subprocess
import requests
import sys
parser = argparse.ArgumentParser(description='Sc... | unknown | codeparrot/codeparrot-clean | ||
//===--- FunctionConvention.swift - function conventions ------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2023 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 | SwiftCompilerSources/Sources/SIL/FunctionConvention.swift |
# 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 | ||
# -*- coding: utf-8 -*-
# Copyright 2014-16 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# Copyright 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
class AccountInvoice(models.Model):
_inherit = ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/classMemberInitializerWithLamdaScoping3.ts] ////
//// [classMemberInitializerWithLamdaScoping3_0.ts]
var field1: string;
//// [classMemberInitializerWithLamdaScoping3_1.ts]
declare var console: {
log(msg?: any): void;
};
export class Test1 {
constructor(private field1: string) {
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/classMemberInitializerWithLamdaScoping3.js |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# 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
... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
#
# This program resolves merge conflicts in git
#
# Copyright (c) 2006 Theodore Y. Ts'o
# Copyright (c) 2009-2016 David Aguilar
#
# This file is licensed under the GPL v2, or a later version
# at the discretion of Junio C Hamano.
#
USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [-g|--gui|--no-... | unknown | github | https://github.com/git/git | git-mergetool.sh |
#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2016, Mathieu Bultel <mbultel@redhat.com>
# (c) 2016, Steve Baker <sbaker@redhat.com>
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
llvm_target: "arm-unknown-linux-musleabihf".into(),
metadata: TargetMetadata {
description: Some("Armv6 Linux with musl 1.2.5, hardfloat".into()),
... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs |
test_kind: js_test
selector:
roots:
- jstests/change_streams/**/*.js
exclude_files:
# This test creates a collection (and index) inside a transaction. Even though the collections are
# unsharded this suite enables sharding in the test database which makes transactions against
# it distributed. This... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/suites/change_streams_mongos_sessions_passthrough_v2.yml |
# coding: utf-8
from __future__ import unicode_literals
import os
import re
import sys
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..compat import (
compat_etree_fromstring,
compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exercise 8.18 from Kane 1985."""
from __future__ import division
from sympy import symbols
from sympy.physics.mechanics import ReferenceFrame
from sympy.physics.mechanics import cross, dot, dynamicsymbols, inertia
from util import msprint
print("\n part a")
Ia, Ib, Ic,... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from runtest import TestBase
import subprocess as sp
import os.path
import random
TDIR = 'xxx'
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'abc', """
# DURATION TID FUNCTION
62.202 us [28141] | __cxa_atexit();
[28141] | main() {
... | unknown | codeparrot/codeparrot-clean | ||
from sympy.polys.domains import QQ, EX, RR
from sympy.polys.rings import ring
from sympy.polys.ring_series import (_invert_monoms, rs_integrate,
rs_trunc, rs_mul, rs_square, rs_pow, _has_constant_term, rs_hadamard_exp,
rs_series_from_list, rs_exp, rs_log, rs_newton, rs_series_inversion,
rs_compose_add, rs_a... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # pylint:disable=redefined-builtin,unused-wildcard-import,wildcard-import,wrong-import-order
import logging
import re
import sys
... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
/** @typedef {import("../../declarations/WebpackOptions").Falsy} Falsy */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetLoader} RuleSetLoader */
/** @type... | javascript | github | https://github.com/webpack/webpack | lib/rules/UseEffectRulePlugin.js |
"""
Plot the scaling of the nearest neighbors algorithms with k, D, and N
"""
from time import time
import numpy as np
import pylab as pl
from matplotlib import ticker
from sklearn import neighbors, datasets
def get_data(N, D, dataset='dense'):
if dataset == 'dense':
np.random.seed(0)
return np.r... | unknown | codeparrot/codeparrot-clean | ||
#include "numpy/numpyconfig.h" // for NPY_VISIBILITY_HIDDEN
#include <stdbool.h>
/*
* NPY_BLAS_CHECK_FPE_SUPPORT controls whether we need a runtime check
* for floating-point error (FPE) support in BLAS.
* The known culprit right now is SVM likely only on mac, but that is not
* quite clear.
* This checks always ... | c | github | https://github.com/numpy/numpy | numpy/_core/src/common/blas_utils.h |
//===-- DumpSymbolTests.cpp -------------------------------------*- 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/unittests/tweaks/DumpSymbolTests.cpp |
# -*- coding: utf-8 -*-
"""
#DSpaceLoader V2
/scripts/generadorPaquetes.py
#########
# 31/08/2015
# Sistema desarrollado por el GIL, Instituto de Ingenieria UNAM
# cgonzalezg@iingen.unam.mx
# Crea los archivos necesarios para DSpace
# return: un diccionario con información referente a la colección a la
# que pertenece ... | unknown | codeparrot/codeparrot-clean | ||
from .bases import _ScandinavianStemmer
from whoosh.compat import u
class SwedishStemmer(_ScandinavianStemmer):
"""
The Swedish Snowball stemmer.
:cvar __vowels: The Swedish vowels.
:type __vowels: unicode
:cvar __s_ending: Letters that may directly appear before a word final 's'.
:type __s_... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Copyright (c) 2011, Daniele Esposti <expo@expobrain.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* pg_shdepend.h
* definition of the "shared dependency" system catalog (pg_shdepend)
*
* pg_shdepend has no preloaded contents, so there is no pg_shdepend.dat
* file; dependencies for system-defined objects are loaded into it
* on-th... | c | github | https://github.com/postgres/postgres | src/include/catalog/pg_shdepend.h |
from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.db.models import F
from django.test import TestCase
from .models import Article, Author, Reference
class OrderingTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 1 16:54:05 2016
@author: alex
"""
import numpy as np
def main():
posList = generate_benzene_sites()
nList,zList = get_neighbors()
return posList, nList, zList
def generate_benzene_sites():
"""Generate the locations of a benzene ring, one without hydr... | 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... | python | github | https://github.com/apache/airflow | airflow-core/tests/unit/security/test_permissions_deprecation_warning.py |
import math
from itertools import product
import numpy as np
import pytest
from scipy.sparse import rand as sparse_rand
from sklearn import clone, datasets, manifold, neighbors, pipeline, preprocessing
from sklearn.datasets import make_blobs
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.utils._... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/manifold/tests/test_isomap.py |
"""Code for html rendering
"""
import sys
# Import the html parser code, maintaing compatibility with older versions of python
try:
oldpython = False
from html.parser import HTMLParser
htmllib = None
except:
import htmllib
from htmllib import HTMLParser
import re
import pygame
from pygame.locals ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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 | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
# delete wrong gle entries created due to a bug in make_gl_entries of Account Controller
# when using payment reconciliation
res = webnotes.conn.sql_list("""select distinc... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2020 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.utils.io.core.internal
@Suppress("RedundantModalityModifier")
internal class CharArraySequence(
private val array: CharArray,
private val offset: Int,
final overri... | kotlin | github | https://github.com/ktorio/ktor | ktor-io/common/src/io/ktor/utils/io/core/internal/CharArraySequence.kt |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | 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 | ||
"""
Set operations for 1D numeric arrays based on sorting.
:Contains:
ediff1d,
unique,
intersect1d,
setxor1d,
in1d,
union1d,
setdiff1d
:Notes:
For floating point arrays, inaccurate results may appear due to usual round-off
and floating point comparison issues.
Speed could be gained in some operations ... | unknown | codeparrot/codeparrot-clean | ||
//===- bolt/Profile/DataAggregator.cpp - Perf data aggregator -------------===//
//
// 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | bolt/lib/Profile/DataAggregator.cpp |
import os
import sys
import urlparse
import subprocess
import shutil
import contextlib
from os import makedirs
from os.path import exists, join, abspath, basename, dirname, islink
import dockerfile
import util
import platforms
__all__ = ['merge', 'generate']
RELDIR = "library"
ESPB_SCRIPT = "https://github.com/ack/... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
import sys
import os.path
import pybindgen.settings
from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning
from pybindgen.typehandlers.codesink import FileCodeSink
from pygccxml.declarations import templates
from pygccxml.declarations.class_declaration im... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import multiprocessing
import serial
import signal
import argparse
def start_dosenet(mode):
if mode == 0:
os.system('sudo -E bash /home/pi/dosenet-raspberrypi/pocket.sh start')
if mode == 1:
os.system('sudo -E bash /home/pi/dosenet-raspberrypi/pocket.sh test')
d... | 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... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/codec/package-info.java |
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changed 'CourseCohortsSettings.cohorted_discussions' to 'CourseCohortsSettings._cohorted_discussions' without
... | unknown | codeparrot/codeparrot-clean | ||
"""SCons.Tool.ilink32
XXX
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation
#
# 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 with... | unknown | codeparrot/codeparrot-clean | ||
# RAVEn Plugin
#
# Author: Dnpwwo, 2016
#
#
# Plugin parameter definition below will be parsed during startup and copied into Manifest.xml, this will then drive the user interface in the Hardware web page
#
"""
<plugin key="RAVEn" name="RAVEn Zigbee energy monitor" author="dnpwwo" version="1.3... | unknown | codeparrot/codeparrot-clean | ||
"""Set ON DELETE CASCADE on Build.*
Revision ID: 403b3fb41569
Revises: 4732741c7696
Create Date: 2013-12-23 16:07:02.202873
"""
# revision identifiers, used by Alembic.
revision = '403b3fb41569'
down_revision = '4732741c7696'
from alembic import op
def upgrade():
op.drop_constraint('build_author_id_fkey', 'bui... | unknown | codeparrot/codeparrot-clean | ||
"""Base for PAD plugins."""
from __future__ import absolute_import
from builtins import tuple
from builtins import object
try:
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
except ImportError:
create_engine = None
sessionmaker = None
from collections import defaultdict... | unknown | codeparrot/codeparrot-clean | ||
# 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 compliance with the License. You may obtain
# a ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# SelfTest/st_common.py: Common functions for SelfTest modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicati... | unknown | codeparrot/codeparrot-clean | ||
#ifndef BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
#define BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_binary_iarchive.hpp
//
// archives stored... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/archive/basic_binary_iarchive.hpp |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Union
from typing_extensions import Literal, Annotated, TypeAlias
from ...._utils import PropertyInfo
from ...._models import BaseModel
from .error_event import ErrorEvent
from .conversation_item import Conversati... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/realtime/realtime_server_event.py |
from cm.exception import UnauthorizedException
from cm.message import display_message
from cm.models import ApplicationConfiguration, Notification, Configuration, UserRole
from cm.models_base import generate_key
from cm.views import get_text_by_keys_or_404
from cm.utils.embed import embed_html
from cm.security import g... | unknown | codeparrot/codeparrot-clean | ||
{
"User": "root",
"Image": "pack.local/ephemeral-builder",
"Cmd": [
"/cnb/lifecycle/creator",
"-app",
"/workspace",
"-platform",
"/platform",
"-run-image",
"docker.io/cloudfoundry/run:latest",
"-layers",
"/layers",
"-cache-dir",
"/cache",
"-launch-cache",
"/laun... | json | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/build/lifecycle-creator-cache-volumes.json |
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import Http404, HttpResponseRedirect
from django.views.generic import list_detail
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.core.urlresolver... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# 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 | ||
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para vodbeast
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
from core import logger
from core import scraper... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/cache/support/AbstractCacheManager.java |
# Copyright 2025 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 applicabl... | python | github | https://github.com/huggingface/transformers | src/transformers/initialization.py |
# -*- 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 | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "v0alpha1.opentsdb_v23.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"uid": "-- Grafana --"
},
"enable": true,
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/datasource-opentsdb/v0alpha1.opentsdb_v23.v42.v1beta1.json |
"""Testing utils"""
import sys
import abc
import json
from contextlib import contextmanager
import traceback
from unittest.mock import Mock
import csv
import tempfile
from importlib import reload, import_module
import pytest
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls.base import cle... | 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 ma... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/prefetch/ExecutorServiceFuturePool.java |
import sys
from datetime import datetime
from django.apps import apps
from django.db import models
from django.utils import six
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from .abstract_mixin import Abstrac... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# posts to youtube
from process import process
import youtube_v3_uploader
import ia_uploader
# import rax_uploader
import os
import pprint
import re
import pw
from django.template.defaultfilters import slugify
# from add_to_richard import get_video_id
from main.models import Show, Location, Ep... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
#
# 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)... | 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 | ||
# To run this script with Windows or SLES, you have to modify setupCmdLine
#
# setupCmdLine.bat|sh
# add on line 40: "SET WAS_USER_SCRIPT=d:\ibm\wasuserscript.cmd"
#
# Create d:\ibm\wasuserscript.cmd:
# "SET WAS_EXT_DIRS=%WAS_EXT_DIRS%;c:\ibm\sqllib\java"
#
import os
import sys
from java.util import Properties
# Load... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.