code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
from os import path
from flask import Response, jsonify
from auslib.global_state import dbo
def _heartbeat_database_fn(dbo):
return dbo.dockerflow.incrementWatchdogValue(changed_by="dockerflow")
def heartbeat_response(heartbeat_database_fn):
"""Per the Dockerflow spec:
Respond to /__heartbeat__ with a H... | unknown | codeparrot/codeparrot-clean | ||
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("lookuperror_a", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="A2",
fields=[
(
"id",
models.Au... | python | github | https://github.com/django/django | tests/migrations/migrations_test_apps/lookuperror_a/migrations/0002_a2.py |
# 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 u... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
""" Plexus (c) 2015 enen92
This file contains a single function. It's a function that will run on the addon first boot to download and configure the system for acestream/sopcast. The platform will be automatically detected and the necessary files downloaded and extracted to the userdata.... | unknown | codeparrot/codeparrot-clean | ||
###
# Copyright (c) 2004, Jeremiah Fincher
# 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 conditi... | unknown | codeparrot/codeparrot-clean | ||
"""
Forms and validation code for user user_registration.
"""
from django.contrib.auth.models import User
from django import forms
from django.utils.translation import ugettext_lazy as _
# I put this on all required fields, because it's easier to pick up
# on them with CSS or JavaScript if they have a class of "requ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 requir... | unknown | codeparrot/codeparrot-clean | ||
# Copyright(C) 2014 by Abe developers.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distr... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// 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... | cpp | github | https://github.com/apple/swift | lib/Refactoring/ExtractExpr.cpp |
extension Request {
/// Creates a redirect `Response`.
///
/// router.get("redirect") { req in
/// return req.redirect(to: "https://vapor.codes")
/// }
///
/// Set type to '.permanently' to allow caching to automatically redirect from browsers.
/// Defaulting to non-perma... | swift | github | https://github.com/vapor/vapor | Sources/Vapor/Request/Redirect.swift |
base_suite: change_streams_whole_cluster_passthrough
overrides:
- "change_streams.mongos_passthrough"
- "change_streams.secondary_reads"
- "change_streams.disable_write_noops"
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.whole_cluster_eval"
excludes:
- "chan... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_whole_cluster_secondary_reads_passthrough.yml |
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
from tastypie.authorization import DjangoAuthorization
from tastypie.exceptions import Unauthorized
from guardian.shortcuts import get_objects_for_user
class GeoNodeAuthorization(DjangoAuthorization):
"""Object level API authorization based on GeoNode granular
permission system"""
def read_list(self, ob... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import logging
import warnings
from bitfield import BitField
from django.contrib.auth.signals import user_logged_out
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.core.urlresolvers import reverse
from django.dispatch import receiver
from django... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Contracts\Foundation;
use Illuminate\Contracts\Container\Container;
interface Application extends Container
{
/**
* Get the version number of the application.
*
* @return string
*/
public function version();
/**
* Get the base path of the Laravel insta... | php | github | https://github.com/laravel/framework | src/Illuminate/Contracts/Foundation/Application.php |
# -*- coding: utf-8 -*-
"""
RDFa 1.1 parser, also referred to as a “RDFa Distiller”. It is
deployed, via a CGI front-end, on the U{W3C RDFa 1.1 Distiller page<http://www.w3.org/2012/pyRdfa/>}.
For details on RDFa, the reader should consult the U{RDFa Core 1.1<http://www.w3.org/TR/rdfa-core/>}, U{XHTML+RDFa1.1<http://w... | 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/util/WeakReferenceMap.java |
//===--- NecessaryBindings.h - Optimizing archetype bindings ----*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | lib/IRGen/NecessaryBindings.h |
<!---
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 | github | https://github.com/apache/hadoop | hadoop-cloud-storage-project/hadoop-gcp/src/site/markdown/tools/hadoop-gcp/testing.md |
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime as dt
import numpy as np
import logging
log = logging.getLogger(__name__)
from .base_format import BaseFormat, FormatError
from .. import __version__
from ..ssp_dicts import Dicts
class Unb(BaseFormat):
def __ini... | 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 | ||
DOCUMENTATION:
name: dirname
author: ansible core team
version_added: "historical"
short_description: get a path's directory name
description:
- Returns the 'head' component of a path, basically everything that is not the 'basename'.
notes:
- The result of this filter is different from the Unix dirn... | unknown | github | https://github.com/ansible/ansible | lib/ansible/plugins/filter/dirname.yml |
import unittest, sys
class SimpleTypesTestCase(unittest.TestCase):
def setUp(self):
import ctypes
try:
from _ctypes import set_conversion_mode
except ImportError:
pass
else:
self.prev_conv_mode = set_conversion_mode("ascii", "strict")
def te... | unknown | codeparrot/codeparrot-clean | ||
apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequest
metadata:
name: foo
spec:
request: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0KTUlJQ2d6Q0NBV3NDQVFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlMxaFpHMXBiakNDQVNJd0RRWUpLb1pJaHZjTgpBUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTlJ5dFhkcWV6ZTFBdXFjZkpWYlFBY1BJejZWY2pXSTZ5Wm... | unknown | github | https://github.com/kubernetes/kubernetes | hack/testdata/csr.yml |
#ifndef LINE_RANGE_H
#define LINE_RANGE_H
struct index_state;
/*
* Parse one item in an -L begin,end option w.r.t. the notional file
* object 'cb_data' consisting of 'lines' lines.
*
* The 'nth_line_cb' callback is used to determine the start of the
* line 'lno' inside the 'cb_data'. The caller is expected to a... | c | github | https://github.com/git/git | line-range.h |
<p align="center">
<a href="https://getbootstrap.com/">
<img src="https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap logo" width="200" height="165">
</a>
</p>
<h3 align="center">Bootstrap</h3>
<p align="center">
Sleek, intuitive, and powerful front-end framework for fas... | unknown | github | https://github.com/twbs/bootstrap | README.md |
import logging
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView
from django.http import HttpResponsePermanentRedirect
from django.conf import settings
from django.core.urlresolvers import reverse
from rest_framework.renderers import JSONRenderer
from readthedocs.bui... | unknown | codeparrot/codeparrot-clean | ||
# 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 the... | unknown | codeparrot/codeparrot-clean | ||
"""Unsupervised nearest neighbors learner"""
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import RadiusNeighborsMixin
from .base import UnsupervisedMixin
class NearestNeighbors(NeighborsBase, KNeighborsMixin,
RadiusNeighborsMixin, UnsupervisedMixin):
"""Unsup... | 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-beans/src/main/java/org/springframework/beans/factory/xml/NamespaceHandlerResolver.java |
"""
SecureTranport support for urllib3 via ctypes.
This makes platform-native TLS available to urllib3 users on macOS without the
use of a compiler. This is an important feature because the Python Package
Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL
that ships with macOS is not capable... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2021 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 applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/update-conformance-yaml.sh |
"""Module for SymPy containers
(SymPy objects that store other SymPy objects)
The containers implemented in this module are subclassed to Basic.
They are supposed to work seamlessly within the SymPy framework.
"""
from __future__ import print_function, division
from sympy.core.basic import Basic
from sy... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
r"""
werkzeug.contrib.iterio
~~~~~~~~~~~~~~~~~~~~~~~
This module implements a :class:`IterIO` that converts an iterator into
a stream object and the other way round. Converting streams into
iterators requires the `greenlet`_ module.
To convert an iterator into a stream... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Jefferson Girão <jefferson@girao.net>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
/* See endianconv.c top comments for more information
*
* ----------------------------------------------------------------------------
*
* Copyright (c) 2011-Present, Redis Ltd.
* All rights reserved.
*
* Licensed under your choice of (a) the Redis Source Available License 2.0
* (RSALv2); or (b) the Server Side... | c | github | https://github.com/redis/redis | src/endianconv.h |
#!/usr/bin/python
# -*- 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 absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['... | unknown | codeparrot/codeparrot-clean | ||
import re
import sys
from io import StringIO
import numpy as np
import pytest
from sklearn.datasets import load_digits
from sklearn.neural_network import BernoulliRBM
from sklearn.utils._testing import (
assert_allclose,
assert_almost_equal,
assert_array_equal,
)
from sklearn.utils.fixes import CSC_CONTAI... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/neural_network/tests/test_rbm.py |
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
package v0alpha1
// +k8s:openapi-gen=true
type DummystatusOperatorState struct {
// lastEvaluation is the ResourceVersion last evaluated
LastEvaluation string `json:"lastEvaluation"`
// state describes the state of the lastEvaluation.
// It is limited to three p... | go | github | https://github.com/grafana/grafana | apps/alerting/historian/pkg/apis/alertinghistorian/v0alpha1/dummy_status_gen.go |
/*
* Copyright (C) 2012 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/hash/ChecksumHashFunctionTest.java |
from __future__ import unicode_literals
from django.db import models
def check_test_runner():
"""
Checks if the user has *not* overridden the ``TEST_RUNNER`` setting &
warns them about the default behavior changes.
If the user has overridden that setting, we presume they know what they're
doing &... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/es6/computedProperties/computedPropertyNames2_ES5.ts] ////
//// [computedPropertyNames2_ES5.ts]
var methodName = "method";
var accessorName = "accessor";
class C {
[methodName]() { }
static [methodName]() { }
get [accessorName]() { }
set [accessorName](v) { }
static ge... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/computedPropertyNames2_ES5(target=es2015).js |
#!/usr/bin/env python
import roslib; #roslib.load_manifest('smach_tutorials')
import rospy
import smach
import smach_ros
# define state Foo
class Foo(smach.State):
def __init__(self):
smach.State.__init__(self, outcomes=['outcome1','outcome2'])
self.counter = 0
def execute(self, userdata):
... | unknown | codeparrot/codeparrot-clean | ||
name: linux-test
inputs:
build-environment:
required: true
type: string
description: Top-level label for what's being built/tested.
test-matrix:
required: true
type: string
description: JSON description of what test configs to run.
docker-image:
required: true
type: string
des... | unknown | github | https://github.com/pytorch/pytorch | .github/actions/linux-test/action.yml |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
use Symfon... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AssetsContextPass.php |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/abilis,tb10x-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Abilis TB10x GPIO controller
maintainers:
- Christian Ruppert <christian.ruppert@abilis.com>
properties:
compatible... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/gpio/abilis,tb10x-gpio.yaml |
"""Output and/or upload a TestRun or MfgEvent proto for mfg-inspector.com.
"""
import json
import logging
import threading
import time
import zlib
import httplib2
import oauth2client.client
from openhtf.output import callbacks
from openhtf.output.proto import test_runs_converter
from openhtf.output.proto import guz... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division
from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I,
sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify,
WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo,
Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, radsim... | unknown | codeparrot/codeparrot-clean | ||
"""
wc_server v0.01
web client server
Copyright 2011 Brian Monkaba
This file is part of ga-bitbot.
ga-bitbot 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 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/JavaBeanBinder.java |
use std::fmt::Write;
use rustc_hir::attrs::AttributeKind;
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
use rustc_hir::find_attr;
use rustc_middle::ty::{GenericArgs, TyCtxt};
fn format_variances(tcx: TyCtxt<'_>, def_id: LocalDefId) -> String {
let variances = tcx.variances_of(def_id);
let generics = Gene... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_hir_analysis/src/variance/dump.rs |
import numpy as np
from scipy import ndimage, misc
from matplotlib import pyplot as plt
import glob
from MyViola import MyViolaClassifier
from Svm import Svm
import funcs
def find_face(img, shape, mv):
res_i = (0, 0)
res_j = (0, 0)
res_scl = 1
max_ = 0
scales = np.arange(.2, .35, .025)
m, n = s... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.network.selector
import kotlinx.coroutines.*
import java.util.concurrent.atomic.*
public class InterestSuspensionsMap {
@Volatile
private var readHandlerReference: Ca... | kotlin | github | https://github.com/ktorio/ktor | ktor-network/jvm/src/io/ktor/network/selector/InterestSuspensionsMap.kt |
#!/usr/bin/env python
'''
Ansible module for zabbix graphprototypes
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix graphprototypes ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... | unknown | codeparrot/codeparrot-clean | ||
__copyright__ = 'Copyright(c) Gordon Elliott 2017'
"""
"""
import logging
from datetime import datetime
from glod.db.person import Person
from glod.db.organisation import Organisation, OrganisationCategory, OrganisationStatus
from glod.model.communication_permission import CommunicationPermission
from glod.db.organ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
BackdoorFactory (BDF) v3 - FOUNTAINPATCH
Many thanks to Ryan O'Neill --ryan 'at' codeslum <d ot> org--
Without him, I would still be trying to do stupid things
with the elf format.
Also thanks to Silvio Cesare with his 1998 paper
(http://vxheaven.org/lib/vsc01.html) which these ELF patching
... | 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 | ||
# -*- coding: utf-8 -*-
"""
pygments.lexers.go
~~~~~~~~~~~~~~~~~~
Lexers for the Google Go language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words
from pygments.token... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django import forms
from django.contrib.auth import get_user_... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Platypus documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 16 16:15:02 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | unknown | codeparrot/codeparrot-clean | ||
from html5lib.constants import scopingElements, tableInsertModeElements, namespaces
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import Set as set
from sets import ImmutableSet as frozenset
# The scope markers are inserted when entering object elements,
# marq... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/c/experimental/ops/gen/model/arg_spec.h |
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])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "style-src 'none'"
... | 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
* "Lice... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/concurrent/HadoopScheduledThreadPoolExecutor.java |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Stéphane Bidoul
# Copyright (c) 2012 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
import copy
import datetime
from snisi_core.models.Periods import MonthPeriod
# from snisi_core.models.ReportingPeri... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <limits.h>
/*
... | c | github | https://github.com/torvalds/linux | usr/gen_init_cpio.c |
/**
* @param {string} str
* @returns {string}
*/
export function sanitize_template_string(str) {
return str.replace(/(`|\${|\\)/g, '\\$1');
} | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/compiler/utils/sanitize_template_string.js |
/*
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 | pkg/controller/volume/pvprotection/pv_protection_controller.go |
from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
cm_data = [[0., 0., 0.],
[0.0156863, 0., 0.0117647],
[0.0352941, 0., 0.027451],
[0.0509804, 0., 0.0392157],
[0.0705882, 0., 0.054902],
[0.0862745, 0., 0.0745098],
[0.105882, 0., 0.0901961],
[0.121569, 0., 0.109804],
[0.141176, 0., 0.12549]... | unknown | codeparrot/codeparrot-clean | ||
# helper to load url
# runs webserver and loads url with webbrowswer module
import sys
def load_url(path):
PORT = 8000
httpd = StoppableHTTPServer(("127.0.0.1",PORT), handler)
thread.start_new_thread(httpd.serve, ())
webbrowser.open_new('http://localhost:%s/%s'%(PORT,path))
input("Press <RETURN> to... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
import operator
from optparse import make_option
from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.db.migrations import Migration
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.autodetector import Migration... | unknown | codeparrot/codeparrot-clean | ||
from collections import defaultdict
from time import time
import numpy as np
from numpy import random as nr
from sklearn.cluster import KMeans, MiniBatchKMeans
def compute_bench(samples_range, features_range):
it = 0
results = defaultdict(lambda: [])
chunk = 100
max_it = len(samples_range) * len(fea... | python | github | https://github.com/scikit-learn/scikit-learn | benchmarks/bench_plot_fastkmeans.py |
import logging
from django.contrib.sessions.backends.base import (
CreateError, SessionBase, UpdateError,
)
from django.core.exceptions import SuspiciousOperation
from django.db import DatabaseError, IntegrityError, router, transaction
from django.utils import timezone
from django.utils.encoding import force_text
... | unknown | codeparrot/codeparrot-clean | ||
#ifndef TREES_H_
#define TREES_H_
/* Constants */
#define DIST_CODE_LEN 512
/* see definition of array dist_code in trees.c */
#define MAX_BL_BITS 7
/* Bit length codes must not exceed MAX_BL_BITS bits */
#define REP_3_6 16
/* repeat previous bit length 3-6 times (2 bits of repeat count) */
#define REPZ_3_10... | c | github | https://github.com/opencv/opencv | 3rdparty/zlib-ng/trees.h |
from sklearn.ensemble import (
GradientBoostingClassifier,
HistGradientBoostingClassifier,
RandomForestClassifier,
)
from .common import Benchmark, Estimator, Predictor
from .datasets import (
_20newsgroups_highdim_dataset,
_20newsgroups_lowdim_dataset,
_synth_classification_dataset,
)
from .ut... | python | github | https://github.com/scikit-learn/scikit-learn | asv_benchmarks/benchmarks/ensemble.py |
#!/usr/bin/env python
import os
import sys
import subprocess
from optparse import OptionParser
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
def doCMD(cmd):
print "-->> \"%s\"" % cmd
output = []
cmd_return_code = 1
cmd_proc = subprocess.Popen(
cmd, stdout=subproces... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2015 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.
"""This test uses vtgateclienttest to test the vtdb python vtgate client.
"""
import logging
import struct
import unittest
import environment
... | unknown | codeparrot/codeparrot-clean | ||
#
#
# Copyright (C) 2007, 2011, 2012, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This progr... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2020 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 ignore
package main
/*
typedef struct A A;
typedef struct {
struct A *next;
struct A **prev;
} N;
struct A
{
N n;
};
typedef struct B
{
A* a... | go | github | https://github.com/golang/go | src/cmd/cgo/internal/testgodefs/testdata/issue37479.go |
"""Test tracing"""
import asyncio
import numpy as np
import pytest
from gameanalysis import gamegen
from gameanalysis import paygame
from gameanalysis import rsgame
from egta import gamesched
from egta import innerloop
from egta import savesched
from egta import asyncgame
from egta import schedgame
from egta import t... | unknown | codeparrot/codeparrot-clean | ||
"""
This file is part of Giswater 3
The 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 option) any later version.
"""
# -*- coding: utf-8 -*-
""" Module with u... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#encoding:utf8
import json
import time,random
import datetime
import MySQLdb
import MySQLdb.cursors
class DB:
conn = None
db = None
host = None
def __init__(self, host, mysql_user, mysql_pass, mysql_db):
self.host = host
self.mysql_user = mysql_user
self.m... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/cix.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: CIX platforms
maintainers:
- Peter Chen <peter.chen@cixtech.com>
- Fugang Duan <fugang.duan@cixtech.com>
properties:
$nodename:
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/arm/cix.yaml |
# -*- coding: utf-8 -*-
from twisted.spread import pb
from twisted.internet import endpoints, task, defer
from os import environ
import functools
import treq
import lxml.html
import re
import Levenshtein
from urllib import parse as urlparse
import json
import sqlite3
import codecs
import simple_eval
import ipaddress
fr... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
***************************************************************************
postgis.py - Postgis widget wrappers
---------------------
Date : December 2016
Copyright : (C) 2016 by Arnaud Morvan
Email : arnaud dot morvan at campto... | unknown | codeparrot/codeparrot-clean | ||
"""
Tools for the instructor dashboard
"""
import json
import dateutil
from django.contrib.auth.models import User
from django.http import HttpResponseBadRequest
from pytz import UTC
from django.utils.translation import ugettext as _
from opaque_keys.edx.keys import UsageKey
from six import text_type
from courseware.... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/dma/marvell,orion-xor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell XOR engine
maintainers:
- Andrew Lunn <andrew@lunn.ch>
- Gregory Clement <gregory.clement@bootlin.com>
prope... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/dma/marvell,orion-xor.yaml |
"""
Support gathering system information of hosts which are running glances.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.glances/
"""
import logging
from datetime import timedelta
import requests
import voluptuous as vol
import homeassistant.... | unknown | codeparrot/codeparrot-clean | ||
{
// "regular": Bencharks are run on small to medium datasets. Each benchmark
// is run multiple times and averaged.
// "fast": Benchmarks are run on small to medium datasets. Each benchmark
// is run only once. May provide unstable benchmarks.
// "large_scale": Benchmarks are run... | json | github | https://github.com/scikit-learn/scikit-learn | asv_benchmarks/benchmarks/config.json |
#!/usr/bin/python
#
#
#
import sys
sys.path.append('..')
from rhn.rpclib import Server, GETServer
SERVER = "http://xmlrpc.rhn.redhat.com/XMLRPC"
system_id_file = "/etc/sysconfig/rhn/systemid"
try:
SERVER = "http://%s/XMLRPC" % sys.argv[1]
system_id_file = sys.argv[2]
except:
pass
print "SERVER = %s" % SER... | unknown | codeparrot/codeparrot-clean | ||
"""
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | python | github | https://github.com/scikit-learn/scikit-learn | examples/covariance/plot_covariance_estimation.py |
use rustc_hir::limit::Limit;
use rustc_infer::infer::InferCtxt;
use rustc_infer::traits::PredicateObligations;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::def_id::{LOCAL_CRATE, LocalDefId};
use rustc_span::{ErrorGuaranteed, Span};
use rustc_trait_selection::traits::ObligationCtxt;
use tr... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_hir_analysis/src/autoderef.rs |
{
"description": "tests adding and removing elements from a simple list",
"include_files": [],
"ignore_fields": {}
} | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/tests/basic_list_update/spec.json |
#!/usr/bin/env python
'''
------------------------------------------------------------------------
Multicore Parallel Sub-Sampled Deconvolution
Deconvolve HST WFPC2/ACS images with spatially varying point spread function.
As each section of image is independent of the other sections, they... | unknown | codeparrot/codeparrot-clean | ||
import pygame, sys
from pygame.locals import *
TIMER = 30
SCREEN_X = 200
SCREEN_Y = 200
screen = pygame.display.set_mode((SCREEN_X, SCREEN_Y))
clock = pygame.time.Clock() #tick-tock
ending = button1 = button2 = False
corner1 = (28,18) #Top Left corner of button 1
corner2 = (56,18) #Top Left corner of button 2
im... | unknown | codeparrot/codeparrot-clean | ||
"""
Alarm Clock - A simple clock where it plays a sound after
X number of minutes/seconds or at a particular time.
Dependencies:
pyglet
pip install pyglet
"""
import time
import winsound
import pyglet
def play(hh, mm):
not_alarmed = 1
while(not_alarmed):
cur_time = list(time.localtime()) # get t... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.