code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
"""
Dropbox OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/dropbox.html
"""
from social.backends.oauth import BaseOAuth1, BaseOAuth2
class DropboxOAuth(BaseOAuth1):
"""Dropbox OAuth authentication backend"""
name = 'dropbox'
ID_KEY = 'uid'
AUTHORIZATION_URL = 'https://www.dropb... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
import paramiko
import time
def connect(command, ip, user, passwd, port=22):
remote_conn_pre = paramiko.SSHClient()
remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy())
remote_conn_pre.connect(ip, username=user, password=passwd, look_for_keys=False, allow_agent=F... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
import json
import logging
from readthedocs.projects.models import Project
from readthedocs.projects import tasks
log = logging.getLogger(__name__)
class GitLabWebHookTest(TestCase):
fixtures = ["eric", "test_data"]
def tearDown(self):
tasks.update_docs = self.old_bd... | unknown | codeparrot/codeparrot-clean | ||
contact_links:
- name: Ask the community
url: https://github.com/twbs/bootstrap/discussions/new
about: Ask and discuss questions with other Bootstrap community members. | unknown | github | https://github.com/twbs/bootstrap | .github/ISSUE_TEMPLATE/config.yml |
#ifndef RBIMPL_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_ATTR_ALLOC_SIZE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to eithe... | c | github | https://github.com/ruby/ruby | include/ruby/internal/attr/alloc_size.h |
//! Parks the runtime.
//!
//! A combination of the various resource driver park handles.
use crate::loom::sync::atomic::AtomicUsize;
use crate::loom::sync::{Arc, Condvar, Mutex};
use crate::runtime::driver::{self, Driver};
use crate::util::TryLock;
use std::sync::atomic::Ordering::SeqCst;
use std::time::{Duration, I... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/runtime/scheduler/multi_thread/park.rs |
# -*- coding: utf-8 -*-
"""
JSON 2 HTML Converter
=====================
(c) Varun Malhotra 2013-2021
Source Code: https://github.com/softvar/json2html
Contributors:
-------------
1. Michel Müller (@muellermichel), https://github.com/softvar/json2html/pull/2
2. Daniel Lekic (@lekic), https://github.com/softvar/json2h... | unknown | codeparrot/codeparrot-clean | ||
#-----------------------------------------------------------------------------
# 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 | ||
// Copyright 2014 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"
"hash/fnv"
"math"
"math/rand"
"reflect"
"slices"
"strconv"
"strings"
"testing"
"time"
"github.com/cockroa... | go | github | https://github.com/cockroachdb/cockroach | pkg/storage/mvcc_test.go |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep
class MenuItem:
def __init__(self, name, action):
self.name = name
self.action = action
def get_text(self):
return self.name
def get_action(self):
return self.action
def set_lcd(self, lcd):
self.lcd = lcd
class Menu(MenuItem):
it... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | unknown | codeparrot/codeparrot-clean | ||
class Waveband(dict):
"""Base class to define a waveband"""
def __init__(self):
super(Waveband,self).__init__()
self.ucd = None
class Radio(Waveband):
def __init__(self):
super(Radio,self).__init__()
self.ucd = 'em.radio'
class Millimeter(Waveband):
def __init__(self):
... | unknown | codeparrot/codeparrot-clean | ||
import pytest
from tests.support.asserts import assert_error, assert_success
from tests.support.inline import inline
def is_element_enabled(session, element_id):
return session.transport.send(
"GET",
"session/{session_id}/element/{element_id}/enabled".format(
session_id=session.session... | 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.tests.auth
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.serialization.jackson.*
import io.ktor.server.auth.*
import io.ktor.server.plugins.contentnegot... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-auth/jvm/test/io/ktor/tests/auth/AuthWithPlugins.kt |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.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 vers... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python3
# 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 | ||
from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... | unknown | codeparrot/codeparrot-clean | ||
"""
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
import hashlib
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_orig... | unknown | codeparrot/codeparrot-clean | ||
from future import standard_library
standard_library.install_aliases()
from builtins import str
import logging
from queue import Queue
import mesos.interface
from mesos.interface import mesos_pb2
import mesos.native
from airflow import configuration
from airflow.executors.base_executor import BaseExecutor
from airflo... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2021 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/it/debugging.md |
/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
/* eslint-env node */
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const config = require('./config/environment')();
const environment = EmberApp.env();
const isProd = environment === 'production';
const isT... | javascript | github | https://github.com/hashicorp/vault | ui/ember-cli-build.js |
# -*- coding: utf-8 -*-
"""
Python evaluation of blaze AIR.
"""
from __future__ import absolute_import, division, print_function
from pykit.ir import interp
import blaze
# Use numpy for now until dynd supports reshape
import numpy as np
#------------------------------------------------------------------------
# I... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2008
"""
Nasm processing
"""
import os
import TaskGen, Task
from TaskGen import taskgen, before, extension
nasm_str = '${NASM} ${NASM_FLAGS} ${NASM_INCLUDES} ${SRC} -o ${TGT}'
EXT_NASM = ['.s', '.S', '.asm', '.ASM', '.spp', '.SPP']
@taskgen
@before('apply_link... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
import sys
import pickle
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
from tester import dump_classifier_and_data
### Task 1: Select what features you'll use.
### features_list is a list of strings, each of which is a feature name.
### The first feature ... | 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/ipc/protocolPB/GenericRefreshProtocolServerSideTranslatorPB.java |
//===--- TBDGenRequests.cpp - Requests for TBD Generation ----------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.... | cpp | github | https://github.com/apple/swift | lib/IRGen/TBDGenRequests.cpp |
import os
import threading
import time
import warnings
from django.apps import apps
from django.core.signals import setting_changed
from django.db import connections, router
from django.db.utils import ConnectionRouter
from django.dispatch import Signal, receiver
from django.utils import timezone
from django.utils.fun... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/generic/AbstractGenericProperties.java |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
unites = {
0: '', 1:'un', 2:'deux', 3:'trois', 4:'quatre', 5:'cinq', 6:'six', 7:'sept', 8:'huit', 9:'neuf',
10:'dix', 11:'onze', 12:'douze', 13:'treize', 14:'quatorze', 15:'quinze', 16:'seize',
21:'vingt et u... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand - XBMC Plugin
# Canal para sports-main
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from cor... | unknown | codeparrot/codeparrot-clean | ||
# ==================================================================================================
# Copyright 2015 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import psycopg2
conn = psycopg2.connect(database="hpc", user="hpc", password="123456", host="localhost", port="5432")
print "Open database successfully"
cursor = conn.cursor()
data_list = [(2, '2003.txt'), (3, '2004.txt'), (4, '2005.txt'), (5, '2006.txt'), (6, '2007.txt'), (7, '2008.txt'), (8, '... | 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 use ... | unknown | codeparrot/codeparrot-clean | ||
"""Tests for Incremental PCA."""
import itertools
import warnings
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
from sklearn.utils._testing import (
assert_allclose_dense_sparse,
... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py |
from django.utils import copycompat as copy
from django.conf import settings
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, *... | unknown | codeparrot/codeparrot-clean | ||
#-----------------------------------------------------------------------------
# class used to store graded responses to CAPA questions
#
# Used by responsetypes and capa_problem
class CorrectMap(object):
"""
Stores map between answer_id and response evaluation result for each question
in a capa problem. ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-08 16:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('UserManagement', '0036_staff_staffprofile'),
]
oper... | unknown | codeparrot/codeparrot-clean | ||
import locale
import pytest
from pandas._config import detect_console_encoding
class MockEncoding:
"""
Used to add a side effect when accessing the 'encoding' property. If the
side effect is a str in nature, the value will be returned. Otherwise, the
side effect should be an exception that will be ra... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/io/formats/test_console.py |
"""
Created on 30 Jun 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import optparse
# --------------------------------------------------------------------------------------------------------------------
class CmdVerbose(object):
"""unix command line handler"""
def __init__(self):
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2023 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | tests/e2e/utils.go |
__source__ = 'https://leetcode.com/problems/maximum-width-ramp/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 962. Maximum Width Ramp
#
# Given an array A of integers, a ramp is a tuple (i, j) for which i < j and A[i] <= A[j].
# The width of such a ramp is j - i.
#
# Find the maximum width of a ramp in A. If ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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
#
# Unle... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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.
"""
Verifies that LD_DYLIB_INSTALL_NAME and DYLIB_INSTALL_NAME_BASE are handled
correctly.
"""
import TestGyp
import re
import subprocess
... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2024 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/deepspeed.md |
#!/usr/bin/python
#
# 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 b... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 dotCloud inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 la... | unknown | codeparrot/codeparrot-clean | ||
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
)
// JSONSchema descriptions help the enrichment suggest API to generate enrichment configurations.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Objec... | go | github | https://github.com/grafana/grafana | apps/alerting/alertenrichment/pkg/apis/alertenrichment/v1beta1/types.go |
# -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | unknown | codeparrot/codeparrot-clean | ||
#define VQSORT_ONLY_STATIC 1
#include "hwy/highway.h"
#include "hwy/contrib/sort/vqsort-inl.h"
#include "highway_qsort.hpp"
#include "quicksort.hpp"
namespace np::highway::qsort_simd {
template <typename T>
void NPY_CPU_DISPATCH_CURFX(QSort)(T *arr, npy_intp size)
{
#if VQSORT_ENABLED
using THwy = std::conditiona... | cpp | github | https://github.com/numpy/numpy | numpy/_core/src/npysort/highway_qsort_16bit.dispatch.cpp |
/*
* Copyright (C) 2009 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 agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/util/concurrent/UninterruptibleFutureTest.java |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
clean_html,
float_or_none,
int_or_none,
try_get,
)
class HitRecordIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hitrecord\.org/records/(?P<id>\d+)'
_TEST = {
... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* user.c
* Commands for manipulating roles (formerly called users).
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/backend/com... | c | github | https://github.com/postgres/postgres | src/backend/commands/user.c |
# frozen_string_literal: true
class CustomReader
include ActiveModel::Validations
def initialize(data = {})
@data = data
end
def []=(key, value)
@data[key] = value
end
def read_attribute_for_validation(key)
@data[key]
end
end | ruby | github | https://github.com/rails/rails | activemodel/test/models/custom_reader.rb |
def get_product(val) :
res = 1
for ele in val:
res *= ele
return res
def find_k_product(test_list, K):
res = get_product([sub[K] for sub in test_list])
return (res) | unknown | mbpp | ||
This error code indicates a mismatch between the lifetimes appearing in the
function signature (i.e., the parameter types and the return type) and the
data-flow found in the function body.
Erroneous code example:
```compile_fail,E0621
fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 { // error: explicit lifetime
... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0621.md |
"""
=============================================================
Online Latent Dirichlet Allocation with variational inference
=============================================================
This implementation is modified from Matthew D. Hoffman's onlineldavb code
Link: http://matthewdhoffman.com/code/onlineldavb.tar... | unknown | codeparrot/codeparrot-clean | ||
---
applies_to:
stack:
serverless:
navigation_title: "Date"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html
---
# Date field type [date]
JSON doesn’t have a date data type, so dates in Elasticsearch can either be:
* strings containing formatted dates, e.g. `"2015-01-01... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/mapping-reference/date.md |
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | unknown | codeparrot/codeparrot-clean | ||
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the fol... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/IlmImf/ImfCompressionAttribute.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 may n... | java | github | https://github.com/apache/kafka | connect/api/src/main/java/org/apache/kafka/connect/connector/policy/ConnectorClientConfigOverridePolicy.java |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Cryptographic API.
*
* HMAC: Keyed-Hashing for Message Authentication (RFC2104).
*
* Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
* Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
*
* The HMAC implementation is derived from USAGI.
* Co... | c | github | https://github.com/torvalds/linux | crypto/hmac.c |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package pki
import (
"fmt"
"github.com/hashicorp/vault/builtin/logical/pki/observe"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
)
func pathAcmeAuthorization(b *backend, baseUrl string, opts acmeWrapper... | go | github | https://github.com/hashicorp/vault | builtin/logical/pki/path_acme_authorizations.go |
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set("Content-Security-Policy", "default-src 'self'; script-src 'self' 'unsafe-in... | unknown | codeparrot/codeparrot-clean | ||
//===--- Headers.cpp - Include headers ---------------------------*- 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/Headers.cpp |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : Versioning plugin for DB Manager
Description : Set up versioning support for a table
Date : Mar 12, 2012
copyright : (C) 2012 by Giuseppe Sucameli
email ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt
class UnableToSelectBatchError(frappe.Valida... | unknown | codeparrot/codeparrot-clean | ||
__author__ = 'michael'
import threading
class Player():
def __init__(self, game_type, ruleset, name):
self.game_type = game_type
self.ruleset = ruleset
self.name = name
def info(self, infoview):
pass
def move(self, moveview):
pass
def reset(self):
pass... | unknown | codeparrot/codeparrot-clean | ||
/*
* SHA1 routine optimized to do word accesses rather than byte accesses,
* and to avoid unnecessary copies into the context array.
*
* This was initially based on the Mozilla SHA1 implementation, although
* none of the original Mozilla code remains.
*/
typedef struct {
unsigned long long size;
unsigned int H... | c | github | https://github.com/git/git | block-sha1/sha1.h |
"""
Doctest example from the official Python documentation.
https://docs.python.org/3/library/doctest.html
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30) # doctest: +ELLIPSIS
26525285981219105... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2022 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 | pkg/apis/resource/doc.go |
# DllReference
[DllPlugin documentation](https://webpack.js.org/plugins/dll-plugin)
This is the _reference_ bundle (with the manifests) for [dll user example](https://github.com/webpack/webpack/tree/main/examples/dll-user)
# webpack.config.js
```javascript
"use strict";
const path = require("path");
const webpack ... | unknown | github | https://github.com/webpack/webpack | examples/dll/README.md |
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package transit
import (
"context"
"fmt"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
)
const keysConfigPath = "config/keys"
type keysConfig struct {
DisableUpsert bool `json:"disable_upsert"`
}
var ... | go | github | https://github.com/hashicorp/vault | builtin/logical/transit/path_config_keys.go |
'''
SASSIE Copyright (C) 2011 Joseph E. Curtis
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it under certain
conditions; see http://www.gnu.org/licenses/gpl-3.0.html for details.
'''
# System imports
from distutils.core import *
from distuti... | unknown | codeparrot/codeparrot-clean | ||
from sympy.mpmath import *
def test_matrix_basic():
A1 = matrix(3)
for i in range(3):
A1[i,i] = 1
assert A1 == eye(3)
assert A1 == matrix(A1)
A2 = matrix(3, 2)
assert not A2._matrix__data
A3 = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
assert list(A3) == list(range(1, 10))
A3... | unknown | codeparrot/codeparrot-clean | ||
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.gi... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/compute/kernel.hpp |
'''
Boneh-Franklin Identity Based Encryption
| From: "D. Boneh, M. Franklin Identity-Based Encryption from the Weil Pairing", Section 4.2.
| Published in: Crypto 2003
| Available from: http://.../bfibe.pdf
| Notes: This is the IBE .
* type: encryption (identity-based)
* setting: bilinear groups (asym... | unknown | codeparrot/codeparrot-clean | ||
import uuid
import kombu
import lymph
from lymph.events.kombu import KombuEventSystem
from lymph.discovery.static import StaticServiceRegistryHub
from lymph.testing import LymphIntegrationTestCase, AsyncTestsMixin
class TestInterface(lymph.Interface):
def __init__(self, *args, **kwargs):
super(TestInterf... | 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-support/src/main/java/org/springframework/cache/jcache/config/JCacheConfigurer.java |
# frozen_string_literal: true
require "active_support/core_ext/hash/except"
require "active_support/core_ext/hash/slice"
require "active_record/relation/merger"
module ActiveRecord
module SpawnMethods
def spawn # :nodoc:
already_in_scope?(model.scope_registry) ? model.all : clone
end
# Merges in ... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/relation/spawn_methods.rb |
/* Copyright 2021 - 2025 R. Thomas
* Copyright 2021 - 2025 Quarkslab
*
* 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 req... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/PE/signature/attributes/PKCS9AtSequenceNumber.cpp |
""" Python 'utf-16' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_16_encode
def decode(input, errors='strict'):
return codecs.utf_16_decode(input, errors, True)
class IncrementalEncoder(co... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Description**
Simplifies the input geometry by applying the Douglas-Peucker algorithm with a specified tolerance. Vertices that fall within the tolerance distance from the simplified shape are removed.... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/description/st_simplify.md |
import {
codeFixAll,
createCodeFixAction,
registerCodeFix,
} from "../_namespaces/ts.codefix.js";
import {
cast,
Diagnostics,
factory,
getTokenAtPosition,
isIdentifier,
isPropertySignature,
isTypeLiteralNode,
SourceFile,
textChanges,
TypeLiteralNode,
TypeNode,
} f... | typescript | github | https://github.com/microsoft/TypeScript | src/services/codefixes/convertLiteralTypeToMappedType.ts |
"""Test zha lock."""
from unittest.mock import patch
import zigpy.zcl.clusters.closures as closures
import zigpy.zcl.clusters.general as general
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.lock import DOMAIN
from homeassistant.const import STATE_LOCKED, STATE_UNAVAILABLE, STATE_UNLOCKED
from .... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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 la... | unknown | codeparrot/codeparrot-clean | ||
# -*- mode:python -*-
# Copyright (c) 2009 The University of Edinburgh
# 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, t... | 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/src/airflow/migrations/versions/0090_3_2_0_add_fail_fast_to_dag_table.py |
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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 app... | unknown | codeparrot/codeparrot-clean | ||
import os
import subprocess
import sys
import shutil
# parse command line
if len(sys.argv) < 5:
print "usage: " + sys.argv[0] + " <x86|x64> <BinDir> <SourceDir> <Name> [NeededJarFiles] [MainClass]"
exit(1)
platform_string = ""
if sys.argv[1] == "" or sys.argv[1] == "x86":
platform_string = "Win32"
elif sy... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This file should be compatible with both Python 2 and 3.
# If it is not, please file a bug report.
"""
High level operations on subusers.
"""
#external imports
import sys
#internal imports
import subuserlib.classes.user,subuserlib.resolve,subuserlib.classes.subuser,subuserlib.verify,subuserlib... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# 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 cStringIO
import logging
import os
import sys
import unittest
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file... | unknown | codeparrot/codeparrot-clean | ||
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | unknown | codeparrot/codeparrot-clean | ||
{
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"dev": "yarn --cwd packages/web-app dev",
"build": "yarn --cwd packages/web-app build",
"start": "yarn --cwd packages/web-app start"
}
} | json | github | https://github.com/vercel/next.js | examples/with-stencil/package.json |
#!/usr/bin/env python
#
# Copyright 2007 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 | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import UnstructuredOrgModeLoader
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handli... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/document_loaders/org_mode.py |
###########################################################################
#
# Copyright 2021 Google LLC
#
# 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/l... | unknown | codeparrot/codeparrot-clean | ||
module.exports = function a() {
return "This is a";
}; | javascript | github | https://github.com/webpack/webpack | test/fixtures/a.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.