code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#
# Python stuff to improve portability
#
from __future__ import print_function
#
# Generic python packages used
#
from collections import OrderedDict
from math import ceil, log10, floor, pow
import os
import stat
import subprocess
import sqlite3
import time
#
#
#
class ProfileVisualizer:
"""
ProfileVisualize... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: curl_global_trace
Section: 3
Source: libcurl
See-also:
- curl_global_init (3)
- libcurl (3)
Protocol:
- All
Added-in: 8.3.0
---
# NAME
curl_global_trace - log configuration
# SYNOPSIS
~~~c
#include <curl/curl.h... | unknown | github | https://github.com/curl/curl | docs/libcurl/curl_global_trace.md |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
The documentation has been moved to the [https://kotlinlang.org/docs/select-expression.html](https://kotlinlang.org/docs/select-expression.html) page.
To edit the documentation, open the [topics/select-expression.md](topics/select-expression.md) page. | unknown | github | https://github.com/Kotlin/kotlinx.coroutines | docs/select-expression.md |
# -*- coding: utf-8 -*-
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Lupusec Home Security system."""
import logging
import lupupy
from lupupy.exceptions import LupusecException
import voluptuous as vol
from homeassistant.const import CONF_IP_ADDRESS, CONF_NAME, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import config_validation as cv, discovery
from homeas... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import copy
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.test import TestCase
fro... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camtocamp SA
# @author Joël Grand-Guillaume
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# ... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
)
class PatreonIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?patreon\.com/creation\?hid=(.+)'
_TESTS = [
{
'url': 'http://www.patr... | unknown | codeparrot/codeparrot-clean | ||
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
__all__ = ['letv_download', 'letvcloud_download', 'letvcloud_download_by_vu']
import base64
import hashlib
import random
import urllib
from ..common import *
# @DEPRECATED
def get_timestamp():
tn = random.random()
url = 'http://api.letv.com/time?tn={}'.format(tn)
result = get_conte... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import ugettext_lazy as _
from jingo.helpers import urlparams
import kuma.wiki.content
from kum... | unknown | codeparrot/codeparrot-clean | ||
"""
Benchmark models.
"""
import json
import psycopg2
from collections import Iterable
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import QueuePool
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
D... | unknown | codeparrot/codeparrot-clean | ||
"""template tags and filters
for the :mod:`grid` app"""
from django import template
from django.conf import settings
from django.template.defaultfilters import escape, truncatewords
from django.template.loader import render_to_string
import re
register = template.Library()
static_url = settings.STATIC_URL
plus_two... | unknown | codeparrot/codeparrot-clean | ||
"""
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('KA', 'Karnataka'),
('AP', 'Andhra Pr... | unknown | codeparrot/codeparrot-clean | ||
#
# CDR-Stats License
# http://www.cdr-stats.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The Initial Develope... | 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... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/lite/kernels/cpu_backend_threadpool.h |
/*
* 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-cloud-storage-project/hadoop-huaweicloud/src/test/java/org/apache/hadoop/fs/obs/TestOBSContractMkdir.java |
from __future__ import unicode_literals
import datetime
from xml.dom import minidom
from django.contrib.sites.models import Site
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.test.utils import requir... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Literal, Required, TypedDict
from .chat_completion_allowed_tools_param import ChatCompletionAllowedToolsParam
__all__ = ["ChatCompletionAllowedToolChoiceParam"]
cla... | python | github | https://github.com/openai/openai-python | src/openai/types/chat/chat_completion_allowed_tool_choice_param.py |
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/Functions.h>
#include <ATen/NativeFunctions.h>
#else
#include <ATen/ops/_backward_native.h>
#include <ATen/ops/_fw_primal_native.h>
#include <ATen/ops/_version_native.h>
#include <ATen/ops/alias.h>
#... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/VariableMethodStubs.cpp |
# Copyright (c) Mathias Kaerlev 2011-2012.
# This file is part of pyspades.
# pyspades 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... | 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 | ||
# Copyright 2021 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 | ||
"""
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/expressions/asOperator/asOperatorNames.ts] ////
//// [asOperatorNames.ts]
var a = 20;
var b = a as string;
var as = "hello";
var as1 = as as string;
//// [asOperatorNames.js]
"use strict";
var a = 20;
var b = a;
var as = "hello";
var as1 = as; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asOperatorNames.js |
<!---
# 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... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/0.9.1/CHANGELOG.0.9.1.md |
from __future__ import division, print_function, absolute_import
import itertools
import numpy as np
from numpy.testing import (assert_, assert_allclose, assert_raises,
assert_equal, run_module_suite)
from scipy import linalg
import scipy.linalg._decomp_update as _decomp_update
from scipy.linalg._decomp_upda... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: UTF-8 -*-
"""
Lastship Add-on (C) 2019
Credits to Placenta and Covenant; our thanks go to their creators
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 vers... | unknown | codeparrot/codeparrot-clean | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __GUP_TEST_H
#define __GUP_TEST_H
#include <linux/types.h>
#define GUP_FAST_BENCHMARK _IOWR('g', 1, struct gup_test)
#define PIN_FAST_BENCHMARK _IOWR('g', 2, struct gup_test)
#define PIN_LONGTERM_BENCHMARK _IOWR('g', 3, struct gup_test)
#define GUP_BASIC_TEST _... | c | github | https://github.com/torvalds/linux | mm/gup_test.h |
import importlib
import inspect
from abc import ABC, abstractmethod
from ray import cloudpickle
from ray.streaming.runtime import gateway_client
class Partition(ABC):
"""Interface of the partitioning strategy."""
@abstractmethod
def partition(self, record, num_partition: int):
"""Given a record a... | unknown | codeparrot/codeparrot-clean | ||
import { defineCliConfig } from "sanity/cli";
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID;
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET;
export default defineCliConfig({
api: { projectId, dataset },
vite: {
define: {
"process.env.NEXT_PUBLIC_SANITY_PROJECT_ID": JSON.stringify(p... | typescript | github | https://github.com/vercel/next.js | examples/cms-sanity/sanity.cli.ts |
<?php
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Validator;
use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Validator\DefinitionValidatorInterface;
class DefinitionValidator implements DefinitionValidatorInterface
{
public static bool $called = ... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/Workflow/Validator/DefinitionValidator.php |
# Copyright 2015 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.
"""Defines the task controller library."""
import argparse
import datetime
import logging
import os
import socket
import subprocess
import sys
import tempfi... | unknown | codeparrot/codeparrot-clean | ||
<!--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 agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/zh/main_classes/logging.md |
# rfc1751.py : Converts between 128-bit strings and a human-readable
# sequence of words, as defined in RFC1751: "A Convention for
# Human-Readable 128-bit Keys", by Daniel L. McDonald.
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling and others
#
# =========================================... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2011 Edgewall Software
# Copyright (C) 2003-2004 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class FreakhareComFolder(SimpleCrypter):
__name__ = "FreakhareComFolder"
__type__ = "crypter"
__version__ = "0.04"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?frea... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.com/
#
# Author: Ryan Jennings
# Author: Chris Usey
# Author: Todd Giles (todd@lightshowpi.com)
"""Control the raspberry pi hardware.
The hardware controller handles all interaction with the raspberry ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import re
import sre_constants
from anki.utils import ids2str, splitFields, joinFields, intTime, fieldChecksum, stripHTMLMedia
from anki.consts import *
from anki.hooks imp... | unknown | codeparrot/codeparrot-clean | ||
<!DOCTYPE html>
<html lang="en">
<head>
<title>MultipartUpload Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
... | html | github | https://github.com/Alamofire/Alamofire | docs/Classes/MultipartUpload.html |
"""Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipula... | unknown | codeparrot/codeparrot-clean | ||
from collections import namedtuple
from datetime import datetime
from flask import request
from flask.ext.restful import Resource
Collection = namedtuple("Collection", ["items", "count", "updated_at"])
class AbstractCollectionResource(Resource):
COLLECTION_LIMIT_MAX = 100
COLLECTION_LIMIT_DEFAULT = 20
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Benjamin Kalman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2020 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.plugins;
/**
* A mock resolver offers an opportunity to resolve a mock from any instance that is
* provided to the {@link org.mockito.Mockito}-DSL. This mechanism can be used by... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/plugins/MockResolver.java |
#!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.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 ... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Database\Console\Migrations;
use Illuminate\Database\Migrations\Migrator;
use Illuminate\Support\Collection;
use Illuminate\Support\Stringable;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
#[AsCommand(name: 'migrate:status')]
class Sta... | php | github | https://github.com/laravel/framework | src/Illuminate/Database/Console/Migrations/StatusCommand.php |
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | go | github | https://github.com/prometheus/prometheus | tsdb/index/postings.go |
# -*- coding: utf-8 -*-
# /***************************************************************************
# Irmt
# A QGIS plugin
# OpenQuake Integrated Risk Modelling Toolkit
# -------------------
# begin : 2013-10-24
# copyright ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
def __str__(self):
return "%s... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import osv
from openerp.report import report_sxw
class analytic_account_budget_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(analytic_account_bu... | unknown | codeparrot/codeparrot-clean | ||
import sys
import unittest
import subprocess
from flower.command import FlowerCommand
from tornado.options import options
from tests import AsyncHTTPTestCase
# python 2.6 support
if not hasattr(unittest, 'skipUnless'):
import unittest2 as unittest
class TestFlowerCommand(AsyncHTTPTestCase):
def test_port(sel... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from operator import attrgetter
from colorama import Fore
import itertools
import warnings
import socket
import time
import sys
import re
import os
if sys.version_info >= (3, 0, 0,):
from collections.abc import MutableSequence
else:
## This syntax is not supported in Pyth... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux && loong64
package runtime
import (
"internal/goarch"
"unsafe"
)
type sigctxt struct {
info *siginfo
ctxt unsafe.Pointer
}
//go:nosplit... | go | github | https://github.com/golang/go | src/runtime/signal_linux_loong64.go |
AClassThatDoesNotExist_FWB_CacheWarmer_SerializerCacheWarmerTest: ~ | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Serialization/Resources/does_not_exist.yaml |
"""Generic interface to all dbm clones.
Use
import dbm
d = dbm.open(file, 'w', 0o666)
The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the cr... | unknown | codeparrot/codeparrot-clean | ||
import flask
from . import main
from . import forms
import os
from werkzeug import secure_filename
from flask import Flask, render_template, request
from . import activeCampaign
@main.route('/', methods=['GET', 'POST'])
def index():
""""Login form to enter a room."""
form = forms.LoginForm()
if form.valida... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import logging
import google.appengine.api.memcache
def memoize(key, seconds_to_keep=600):
'''Use the memcache to memoize a callable's results. Returns a
function that will check to see if a result is stored in the
memcache. If not, it will call the original function and store the
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2014 Statoil ASA, Norway.
#
# The file 'job_queue_manager.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 t... | unknown | codeparrot/codeparrot-clean | ||
import xbmc, xbmcgui, xbmcplugin
import urllib2,urllib,cgi, re, urlresolver, sys
import urlparse
import HTMLParser
import xbmcaddon
from operator import itemgetter
import traceback,os
__addon__ = xbmcaddon.Addon()
__addonname__ = __addon__.getAddonInfo('name')
__icon__ = __addon__.getAddonInfo('icon')
a... | unknown | codeparrot/codeparrot-clean | ||
# third_party vendored sources in Angular
## TL;DR: don't copy sources into this repo
All sources in this repo should be authored from scratch by the committer.
Don't copy sources you've found in any other location.
## What if I have a good reason?
We do "vendor in" some sources, in cases where we do not want our u... | unknown | github | https://github.com/angular/angular | third_party/README.md |
/*
Copyright 2018 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/kube-scheduler/app/options/deprecated.go |
//
// AUTOGENERATED, DO NOT EDIT
//
#ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP
#error "Invalid usage"
#endif
// generated by parser_cl.py
#define clBuildProgram clBuildProgram_
#define clCompileProgram clCompileProgram_
#define clCreateBuffer clCreateBuffer_
#define clCreateCommandQueue clCreateCommandQueue_
#def... | unknown | github | https://github.com/opencv/opencv | modules/core/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp |
/*
* 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/jmx/ParentAwareNamingStrategy.java |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java |
# # # WARNING # # #
# This list must also be updated in doc/_templates/autosummary/class.rst if it
# is changed here!
_doc_special_members = ('__contains__', '__getitem__', '__iter__', '__len__',
'__add__', '__sub__', '__mul__', '__div__',
'__neg__', '__hash__')
from ._b... | unknown | codeparrot/codeparrot-clean | ||
- name: generate revocation certificate
expect:
command: "gpg --homedir {{ gpg_homedir }} --pinentry-mode loopback --output {{ gpg_homedir }}/revoke.asc --gen-revoke {{ fingerprint }}"
responses:
"Create a revocation certificate for this key": "y"
"Please select the reason for the revocation": "0"... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/ansible-galaxy-collection/tasks/revoke_gpg_key.yml |
import * as ts from "../../_namespaces/ts.js";
import { jsonToReadableText } from "../helpers.js";
import { createBaseline } from "../helpers/baseline.js";
import {
getFsContentsForSampleProjectReferencesLogicConfig,
getSysForSampleProjectReferences,
} from "../helpers/sampleProjectReferences.js";
import {
... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/tsbuildWatch/programUpdates.ts |
#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
def setup():
global args, workdir
programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget']
if args.kvm:
programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils']
elif args.docker:
dockers = ['docker.io',... | unknown | codeparrot/codeparrot-clean | ||
from ctypes import *
import unittest
import struct
def valid_ranges(*types):
# given a sequence of numeric types, collect their _type_
# attribute, which is a single format character compatible with
# the struct module, use the struct module to calculate the
# minimum and maximum value allowed for this... | unknown | codeparrot/codeparrot-clean | ||
"""
USA-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits... | unknown | codeparrot/codeparrot-clean | ||
"""
Sponge Knowledge Base
Action category selection
"""
def onInit():
sponge.addCategories(
CategoryMeta("myActions").withLabel("My actions").withDescription("My actions description")
.withPredicate(lambda processor: processor.adapter.type == ProcessorType.ACTION and processor.meta.name in ("My... | unknown | codeparrot/codeparrot-clean | ||
from deterministic_encryption_utils.encryption.VirtualFile import VirtualFile
import os
from encviewfuse_decryptorui.decryptorui.FilenameUtils import FilenameUtils
class SegmentedVirtualFile(VirtualFile):
def __init__(self, absRootPathNotSegmented):
super(SegmentedVirtualFile, self).__init__(absRootPathNo... | unknown | codeparrot/codeparrot-clean | ||
#ifndef Py_CPYTHON_BYTEARRAYOBJECT_H
# error "this header file must not be included directly"
#endif
/* Object layout */
typedef struct {
PyObject_VAR_HEAD
/* How many bytes allocated in ob_bytes
In the current implementation this is equivalent to Py_SIZE(ob_bytes_object).
The value is always l... | c | github | https://github.com/python/cpython | Include/cpython/bytearrayobject.h |
import copy
import datetime
from django.conf import settings
from django.core.exceptions import FieldError
from django.db.backends import utils as backend_utils
from django.db.models import fields
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import Q, refs_aggregate
from django.u... | unknown | codeparrot/codeparrot-clean | ||
VERSION = '0.1'
import os
import sys
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
# Provided as an attribute, so you can append to these instead
# of replicat... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Orthanc - A Lightweight, RESTful DICOM Store
# Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
# Department, University Hospital of Liege, Belgium
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Publ... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/compiler/arrayFlatNoCrashInference.ts] ////
//// [arrayFlatNoCrashInference.ts]
function foo<T>(arr: T[], depth: number) {
return arr.flat(depth);
}
//// [arrayFlatNoCrashInference.js]
"use strict";
function foo(arr, depth) {
return arr.flat(depth);
} | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/arrayFlatNoCrashInference.js |
# Copyright 2013 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Generated by Django 1.11.16 on 2018-12-22 21:05
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("corporate", "0002_customer_default_discount"),
]
operations = [
migrations.CreateModel(
name="... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package storage
import (
"bytes"
"context"
"fmt"
"math"
"math/rand"
"path/filepath"
"testing"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroac... | go | github | https://github.com/cockroachdb/cockroach | pkg/storage/mvcc_incremental_iterator_test.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Chatham Financial <oss@chathamfinancial.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 = {
'me... | 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 | ||
import datetime
from django import forms
from django.http import QueryDict
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import pgettext_lazy
from oscar.apps.address.forms import AbstractAddressForm
from oscar.core.loading import get_model
from oscar.forms.widgets import DatePi... | unknown | codeparrot/codeparrot-clean | ||
#include <ATen/native/vulkan/ops/Common.h>
#include <torch/library.h>
namespace at {
namespace native {
namespace vulkan {
namespace ops {
namespace {
using namespace api::utils;
Tensor glu(const at::Tensor& input_arg, const int64_t dim = -1) {
TORCH_CHECK(input_arg.dim() == 4, "Vulkan glu only supports 4-dim inpu... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/vulkan/ops/Glu.cpp |
// Copyright The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... | go | github | https://github.com/prometheus/prometheus | notifier/manager.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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 | ||
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
# Complutense de Madrid (dsa-research.org)
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
from collections import defaultdict
from . import dataformat
from .util import dbg
class StringResource(dataformat.Exportable):
name_struct = "string_resource"
name_struct_file = "string_resource"
struct_description = "string id/language to text mapping, extracted from language.dll file."
dat... | unknown | codeparrot/codeparrot-clean | ||
from langchain_core.output_parsers.json import (
SimpleJsonOutputParser,
)
from langchain_core.utils.json import (
parse_and_check_json_markdown,
parse_json_markdown,
parse_partial_json,
)
__all__ = [
"SimpleJsonOutputParser",
"parse_and_check_json_markdown",
"parse_json_markdown",
"par... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/output_parsers/json.py |
# -*- coding: utf-8 -*-
#################################################################################################
import logging
import os
import shutil
import urllib
import xml.etree.ElementTree as etree
import xbmc
import xbmcvfs
import downloader as server
from database import Database, emby_db, get_sync... | unknown | codeparrot/codeparrot-clean | ||
#!ruby -s
# frozen_string_literal: true
require 'mkmf'
require 'rbconfig'
def main
$objs = %w(eventids1.o eventids2.o ripper.o ripper_init.o)
$distcleanfiles.concat %w(ripper.y ripper.c eventids1.c eventids1.h eventids2table.c ripper_init.c)
$cleanfiles.concat %w(ripper.E ripper.output y.output .eventids2-check... | ruby | github | https://github.com/ruby/ruby | ext/ripper/extconf.rb |
from . import AWSObject, AWSProperty
from .validators import positive_integer
class Destination(AWSProperty):
resource_type = "AWS::Logs::Destination"
props = {
'DestinationName': (basestring, True),
'DestinationPolicy': (basestring, True),
'RoleArn': (basestring, True),
'Targe... | unknown | codeparrot/codeparrot-clean | ||
use std::iter::Step;
use std::marker::PhantomData;
use std::ops::{Bound, Range, RangeBounds};
use smallvec::SmallVec;
use crate::idx::Idx;
use crate::vec::IndexVec;
#[cfg(test)]
mod tests;
/// Stores a set of intervals on the indices.
///
/// The elements in `map` are sorted and non-adjacent, which means
/// the se... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_index/src/interval.rs |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2016-2017 Alex Forencich
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... | unknown | codeparrot/codeparrot-clean | ||
"""
These are some functions to help work with kinect camera calibration and projective
geometry.
Tasks:
- Convert the kinect depth image to a metric 3D point cloud
- Convert the 3D point cloud to texture coordinates in the RGB image
Notes about the coordinate systems:
There are three coordinate systems to worry abo... | unknown | codeparrot/codeparrot-clean | ||
# (C) 2016, Ievgen Khmelenko <ujenmr@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 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 | ||
#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.