code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const makeSerializable = require("../util/makeSerializable");
const ModuleDependency = require("./ModuleDependency");
const ModuleDependencyTemplateAsId = require("./ModuleDependencyTemplateAsId");
/** @... | javascript | github | https://github.com/webpack/webpack | lib/dependencies/ModuleHotDeclineDependency.js |
# Copyright (c) 2017 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
DOCUMENTATION = '''
name: generator
plugin_type: inventory
version_added: "2.6"
shor... | unknown | codeparrot/codeparrot-clean | ||
trigger:
branches:
include:
- release-*
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
variables:
Codeql.InitParameters: '--codescanning-config=$(Build.SourcesDirectory)/.github/codeql/codeql-co... | unknown | github | https://github.com/microsoft/TypeScript | azure-pipelines.release.yml |
#!/usr/bin/env python
# ******************************************************************************
# Copyright (c) 2015 UT-Battelle, LLC.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, ... | unknown | codeparrot/codeparrot-clean | ||
"""
Base class for Scrapy commands
"""
import os
from optparse import OptionGroup
from twisted.python import failure
from scrapy.utils.conf import arglist_to_dict
from scrapy.exceptions import UsageError
class ScrapyCommand(object):
requires_project = False
crawler_process = None
# default settings to b... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2016 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/graph/GraphMutationTest.java |
import {useIdentity, Stringify, identity} from 'shared-runtime';
function Foo({val1}) {
// `x={inner: val1}` should be able to be memoized
const x = {inner: val1};
// Any references to `x` after this hook call should be read-only
const cb = useIdentity(() => x.inner);
// With enableTransitivelyFreezeFuncti... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-call-freezes-captured-memberexpr.tsx |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#include <ATen/core/function.h>
#include <ATen/core/ivalue.h>
#include <c10/util/Exception.h>
#include <c10/util/intrusive_ptr.h>
#include <functional>
#include <utility>
namespace torch::jit {
struct BuiltinOpFunction : public Function {
BuiltinOpFunction(
c10::QualifiedName qualname,
c10... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/core/builtin_function.h |
import numpy as np
import pytest
from sklearn.metrics import euclidean_distances
from sklearn.neighbors import KNeighborsTransformer, RadiusNeighborsTransformer
from sklearn.neighbors._base import _is_sorted_by_data
from sklearn.utils._testing import assert_array_equal
def test_transformer_result():
# Test the nu... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/neighbors/tests/test_graph.py |
from django.conf import settings
from django import forms
from oscar.core.loading import get_model
from oscar.views.generic import PhoneNumberMixin
UserAddress = get_model('address', 'useraddress')
class AbstractAddressForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
"""
Set fields in... | 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 | ||
# 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 | ||
import scrapy
from scrapy import log
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from rcbi.items import Part
import os
import urlparse
import urllib
MANUFACTURERS = ["Cobra", "DTF-UHF", "EMAX", "FatShark", "Foxeer", "FrSky", "Gemfan", "ImmersionRC", "XHover"]
CORRECT =... | 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 | ||
""" Hangman Game (v1.0)
Name: Joe Young
Date: 24/09/2016
"""
#Joe Young
#06/09/2016
import sys
import platform
if "windows" == platform.system():
sys.path.append(sys.path[0]+'\\Extra')
else:
sys.path.append(sys.path[0]+'//Extra')
from random import *
from time import *
import hangmanp
def load_file... | 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 | framework-docs/src/main/java/org/springframework/docs/core/aop/aopatconfigurable/ApplicationConfiguration.java |
# -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: cp1252 -*-
import csv
import sys
from xml.dom import minidom
def get_attributes(file_xml):
out = []
dom1 = minidom.parse(file_xml)
for node in dom1.getElementsByTagName('attribute'):
out.append({
'name': node.getAttribute('name') ,
'atype': node.getAttribute('a... | unknown | codeparrot/codeparrot-clean | ||
# This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
import unittest
class PEP3120Test(unittest.TestCase):
def test_pep3120(self):
self.assertEqual(
"Питон".encode("utf-8"),
b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd'
)
self.assertEqual(
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package command
import (
"io"
"strings"
"testing"
"github.com/hashicorp/cli"
"github.com/hashicorp/vault/api"
)
func testWriteCommand(tb testing.TB) (*cli.MockUi, *WriteCommand) {
tb.Helper()
ui := cli.NewMockUi()
return ui, &WriteComma... | go | github | https://github.com/hashicorp/vault | command/write_test.go |
#!/usr/bin/env python
# This script aims to help developers locate forms and view code that needs to
# use the new CSRF protection in Django 1.2. It tries to find all the code that
# may need the steps described in the CSRF documentation. It does not modify
# any code directly, it merely attempts to locate it. Deve... | 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-test/src/test/java/org/springframework/boot/test/system/OutputCaptureRuleTests.java |
def strip_headers(post):
"""Find the first blank line and drop the headers to keep the body"""
if '\n\n' in post:
headers, body = post.split('\n\n', 1)
return body.lower()
else:
# Unexpected post inner-structure, be conservative
# and keep everything
return post.lower... | unknown | codeparrot/codeparrot-clean | ||
"""The tests for the pushbullet notification platform."""
import json
import unittest
from unittest.mock import patch
from pushbullet import PushBullet
import requests_mock
from homeassistant.setup import setup_component
import homeassistant.components.notify as notify
from tests.common import (
assert_setup_comp... | unknown | codeparrot/codeparrot-clean | ||
"""
Aliases for functions which may be accelerated by Scipy.
Scipy_ can be built to use accelerated or otherwise improved libraries
for FFTs, linear algebra, and special functions. This module allows
developers to transparently support these accelerated functions when
scipy is available but still support users who hav... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.webrtc
import kotlinx.serialization.Serializable
/**
* An object containing WebRTC protocol entities and abstractions.
* Provides the core types and interfaces neede... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-webrtc/common/src/io/ktor/client/webrtc/WebRtc.kt |
"""
Tests common to list and UserList.UserList
"""
import sys
import os
from functools import cmp_to_key
from test import support, seq_tests
class CommonTest(seq_tests.CommonTest):
def test_init(self):
# Iterable arg is optional
self.assertEqual(self.type2test([]), self.type2test())
# I... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2010 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
/* Entropy encoding (Huffman) utilities. */
#ifndef BROTLI_ENC_ENTROPY_ENCODE_H_
#define BROTLI_ENC_ENTROPY_ENCODE_H_
#include "../common/platform.h"
... | c | github | https://github.com/nodejs/node | deps/brotli/c/enc/entropy_encode.h |
#!/usr/bin/python
# Copyright (c) 2015 VMware, Inc. All Rights Reserved.
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# orm/evaluator.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from ..sql import operators
class UnevaluatableError(Exception):
... | unknown | codeparrot/codeparrot-clean | ||
from base64 import urlsafe_b64encode, urlsafe_b64decode
from hashlib import sha256
import json
from Crypto.Cipher import AES
from Crypto import Random
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.http import Http404, HttpRe... | unknown | codeparrot/codeparrot-clean | ||
from string import *
import urllib, re
'''
RaiClick for XBMC 1.1.1
Copyright (C) 2005-2011 Angelo Conforti <angeloxx@angeloxx.it>
http://www.angeloxx.it
Lo script e' un semplice browser del sito rai.tv, tutti i diritti
sono di proprieta' della RAI
'''
urlBase = "http://www.rai.tv/%s"
urlBaseTheme... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import sys
import time
sys.path.append("./src")
from dataset import get_moive1m
from similarities import PhiMatrix, DeltaMatrix
from models import Model
from pylab import *
def get_model():
raw_data = get_moive1m()
model = Model(raw_data)
return model
def get_matrix_delta(model,phi_ma... | unknown | codeparrot/codeparrot-clean | ||
#
# The Python Imaging Library.
# $Id$
#
# XV Thumbnail file handler by Charles E. "Gene" Cash
# (gcash@magicnet.net)
#
# see xvcolor.c and xvbrowse.c in the sources to John Bradley's XV,
# available from ftp://ftp.cis.upenn.edu/pub/xv/
#
# history:
# 98-08-15 cec created (b/w only)
# 98-12-09 cec added color palette... | unknown | codeparrot/codeparrot-clean | ||
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2024 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/selinuxwarning/cache/volumecache.go |
#![cfg(feature = "experimental-introspection")]
use actix_web::{guard, test, web, App, HttpResponse};
async fn introspection_handler(
tree: web::Data<actix_web::introspection::IntrospectionTree>,
) -> HttpResponse {
HttpResponse::Ok()
.content_type("application/json")
.body(tree.report_as_json... | rust | github | https://github.com/actix/actix-web | actix-web/tests/introspection.rs |
import numpy as np
import mxnet as mx
import json
import utils
import math
import sys
def calc_complexity(ishape, node):
y, x = map(int, eval(node['param']['kernel']))
N = int(node['param']['num_filter'])
C, Y, X = ishape
return x*(N+C)*X*Y, x*y*N*C*X*Y
def calc_eigenvalue(model, node):
W = model.arg_params... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Flex Messaging implementation.
This module contains the message classes used with Flex Data Services.
@see: U{RemoteObject on OSFlash (external)
<http://osflash.org/documentation/amf3#remoteobject>}
@since: 0.1
"""
import uuid
import pyamf.util... | unknown | codeparrot/codeparrot-clean | ||
{
"components": {
"schemas": {
"io.k8s.apimachinery.pkg.apis.meta.v1.APIGroup": {
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned... | json | github | https://github.com/kubernetes/kubernetes | api/openapi-spec/v3/apis__resource.k8s.io_openapi.json |
goldalign = [ ([0], [0]),
([1], [1]),
([2], [2]),
([3], [3]),
([4], [4]),
([5], [5]),
([6], [6, 7, 8]),
([7], [9]),
([8, 9], [10, 11, 12]),
([10, 11], [13]),
([12], [14]),
([13], [15]),
([], [16]),
([], [17]),
([], [18]),
([], [19]),
([], [20]),
([],... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://setuptools.readthedocs.io/en/latest/easy_install.html
""... | unknown | codeparrot/codeparrot-clean | ||
// Test bolt instrumentation won't generate a binary with any segment that
// is writable and executable. Basically we want to put `.bolt.instr.counters`
// section into its own segment, separated from its surrounding RX sections.
// REQUIRES: system-linux
void foo() {}
void bar() { foo(); }
// RUN: %clang %cflags -... | c | github | https://github.com/llvm/llvm-project | bolt/test/avoid-wx-segment.c |
/**
* \file psa/crypto_struct.h
*
* \brief PSA cryptography module: Mbed TLS structured type implementations
*
* \note This file may not be included directly. Applications must
* include psa/crypto.h.
*
* This file contains the definitions of some data structures with
* implementation-specific definitions.
*
... | c | github | https://github.com/nodejs/node | deps/LIEF/third-party/mbedtls/include/psa/crypto_struct.h |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
import json
import uuid
from django.core.exceptions import NON_FIELD_ERRORS
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.validators import RegexValidator
from django.forms import (
Boolean... | unknown | codeparrot/codeparrot-clean | ||
#
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 't... | 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 applicable law or a... | java | github | https://github.com/tensorflow/tensorflow | tensorflow/java/src/main/java/org/tensorflow/Graph.java |
#!/usr/bin/env python3
import unittest
from test import support
import contextlib
import socket
import urllib.request
import sys
import os
import email.message
import time
class URLTimeoutTest(unittest.TestCase):
# XXX this test doesn't seem to test anything useful.
TIMEOUT = 30.0
def setUp(self):
... | unknown | codeparrot/codeparrot-clean | ||
from django.utils.translation import ugettext, ugettext_lazy as _
from simple_accounting.exceptions import MalformedTransaction
from simple_accounting.models import AccountingProxy, Transaction, LedgerEntry, account_type
from simple_accounting.utils import register_transaction
from consts import (
INCOME, EXPENSE... | unknown | codeparrot/codeparrot-clean | ||
dict.py v1.0
import sys
import itertools
def lworld0x00():
print "***************************"
print "*******Code For Fun********"
print " /\____________/\ "
print " \ / "
print " \ hello / "
print " \ world / "
print " \_... | unknown | codeparrot/codeparrot-clean | ||
import re
import sys
import traceback
from fuzzywuzzy import fuzz
import requests
import TweetPoster
from TweetPoster import rehost
from raven.processors import SanitizePasswordsProcessor
class SanitizeCredentialsProcessor(SanitizePasswordsProcessor):
FIELDS = frozenset([
'authorization',
'passw... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#-------------------------------------------------------------------------------------------------
#Get useful information from the Mapped candidates Info.
#Like: What is the frequence of archives.How many mapped files are per archive.
#The archive with most mapping files.
#Which domains are more ... | unknown | codeparrot/codeparrot-clean | ||
##########################################################################
#
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms o... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2017 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/kubelet/checkpointmanager/testing/util.go |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
*/
"use strict";
const { RawSource } = require("webpack-sources");
const Module = require("../Module");
const { REMOTE_AND_SHARE_INIT_TYPES } = require("../ModuleSourceTypeConstants");... | javascript | github | https://github.com/webpack/webpack | lib/container/RemoteModule.js |
# -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('http://python.org')
>>> r.sta... | unknown | codeparrot/codeparrot-clean | ||
# util
import types
from zlib import compress as _compress, decompress
import threading
import warnings
import errno
try:
from dpark.portable_hash import portable_hash as _hash
except ImportError:
import pyximport
pyximport.install(inplace=True)
from dpark.portable_hash import portable_hash as _hash
tr... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2003-2004 Gerard Vermeulen
#
# This file is part of PyQwt
#
# PyQwt 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.
#... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2011 anatanokeitai.com(sakurai_youhei)
#
# 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 rights... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
module.exports = function supportsUsing() {
try {
const f = eval(`(function f() {
let disposed = false;
{
const getResource = () => {
return {
[Symbol.dispose]: () => {
disposed = true;
}
}
}
using resource = getResource();
}
return disposed;
})... | javascript | github | https://github.com/webpack/webpack | test/helpers/supportsUsing.js |
import pytest
from conftest import assert_complete
class TestSudo:
@pytest.mark.complete("sudo -", require_cmd=True)
def test_1(self, completion):
assert completion
@pytest.mark.complete("sudo cd foo", cwd="shared/default")
def test_2(self, completion):
assert completion == ".d/"
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: UTF-8
'''This scirpt builds the seafile command line client (With no gui).
Some notes:
'''
import sys
####################
### Requires Python 2.6+
####################
if sys.version_info[0] == 3:
print 'Python 3 not supported yet. Quit now.'
sys.exit(1)
if sys.version_info... | unknown | codeparrot/codeparrot-clean | ||
// 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 | discovery/stackit/stackit.go |
# Copyright 2012 NTT Data
# 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 appl... | unknown | codeparrot/codeparrot-clean | ||
from typing import Any, Dict
from uuid import uuid4
JSON = Dict[str, Any]
# class GroupUser:
#
# def __init__(self, id: str, login: str, name: str, status: str) -> None:
# self.id = id
# self.login = login
# self.name = name
# self.status = status
#
# class GroupUsers:
#
# def... | unknown | codeparrot/codeparrot-clean | ||
/* origin: FreeBSD /usr/src/lib/msun/src/e_asin.c */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freel... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/asin.rs |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | unknown | codeparrot/codeparrot-clean | ||
#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2001 Al Riddoch (See the file COPYING for details).
from cyphesis.Thing import Thing
from atlas import *
from Vector3D import Vector3D
# bbox = 8,8,2.5
# bmedian = 7.5,7.5,2.5
# offset = SW corner = -0.5,-0.5,0
class Farmhous... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 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/saved_model/core/revived_types/partially_revived_objects.h |
##############################################################################
#
# PROJECT: ownCloud v1.0
# LICENSE: See LICENSE in the top level directory
#
##############################################################################
import collections
import os
import polib
from optparse import OptionPars... | unknown | codeparrot/codeparrot-clean | ||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwit... | json | github | https://github.com/angular/angular | integration/platform-server-hydration/tsconfig.json |
#! /usr/bin/env python
# This script translates a list of arguments into one value specified by a rule file. Usage:
# translate ruleFilename key1 key2 ...
# It prints out the value corresponds to [key1, key2, ...] from a dictionary read from ruleFilename.
# To see how the dictionary is generated, see readRules function... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import re
from .base import Filter
# not all of these agents are guaranteed to execute JavaScript, but to avoid
# overhead of identifying which ones do, and which ones will over time we simply
# target all of the major ones
CRAWLERS = re.compile(r'|'.join((
# various Google... | unknown | codeparrot/codeparrot-clean | ||
## Copyright (C) 2017 Oscar Diaz Barriga
## This file is part of Comp-Process-STPatterns.
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your op... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2011, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2018 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 js
package runtime
// resetMemoryDataView signals the JS front-end that WebAssembly's memory.grow instruction has been used.
// This allows the fro... | go | github | https://github.com/golang/go | src/runtime/mem_js.go |
"""
Model to store a microsite in the database.
The object is stored as a json representation of the python dict
that would have been used in the settings.
"""
import collections
from django.contrib.sites.models import Site
from django.db import models
from django.db.models.base import ObjectDoesNotExist
from django... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, subprocess, sys
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "..", "..", "..", "..", "..", "tools"))
import traci, sumolib
sumoBinary = sumolib.checkBinary('sumo')
sumoProcess = subprocess.Popen("%s -c sumo.sumocfg" % (sumoBinary), shell=True, std... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 | ||
/* SPDX-License-Identifier: MIT OR Apache-2.0 */
//! IEEE 754-2008 `minNum`. This has been superseded by IEEE 754-2019 `minimumNumber`.
//!
//! Per the spec, returns the canonicalized result of:
//! - `x` if `x < y`
//! - `y` if `y < x`
//! - The other number if one is NaN
//! - Otherwise, either `x` or `y`, canonicali... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/generic/fmin.rs |
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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 | ||
#
# 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/ti_deps/deps/dag_unpaused_dep.py |
'use strict';
const common = require('../common.js');
const {
PerformanceObserver,
performance,
} = require('perf_hooks');
const bench = common.createBenchmark(main, {
n: [1e6],
observe: ['all', 'measure'],
});
function test() {
performance.mark('a');
performance.mark('b');
performance.measure('a to b... | javascript | github | https://github.com/nodejs/node | benchmark/perf_hooks/usertiming.js |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools.office365.base import O365BaseTool
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling option... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/tools/office365/base.py |
"use server";
export async function log() {
console.log("hello from server");
} | typescript | github | https://github.com/remix-run/react-router | playground/rsc-vite-framework/app/routes/_index/actions.ts |
"""Config Flow for PlayStation 4."""
from collections import OrderedDict
import logging
from pyps4_2ndscreen.errors import CredentialTimeout
from pyps4_2ndscreen.helpers import Helper
from pyps4_2ndscreen.media_art import COUNTRIES
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.c... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 NEC 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 applicable law or ag... | unknown | codeparrot/codeparrot-clean | ||
/* Descriptors -- a new, flexible way to describe attributes */
#include "Python.h"
#include "pycore_abstract.h" // _PyObject_RealIsSubclass()
#include "pycore_call.h" // _PyStack_AsDict()
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
#include "pycore_emscripten_trampoline.h" // des... | c | github | https://github.com/python/cpython | Objects/descrobject.c |
# Outspline - A highly modular and extensible outliner.
# Copyright (C) 2011 Dario Giovannetti <dev@dariogiovannetti.net>
#
# This file is part of Outspline.
#
# Outspline 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 F... | unknown | codeparrot/codeparrot-clean | ||
# Temporary suites to assists the development of primary-driven index builds.
# Run all tests in replica set jscore passthrough suite with
# PrimaryDrivenIndexBuilds feature flag enabled.
#
# TODO(SERVER-108818): remove this temporary suite and all its usages.
base_suite: replica_sets_jscore_passthrough_base
overrides:... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/replica_sets_jscore_passthrough_primary_driven_index_builds.yml |
'''
Build your own deep network using TensorFlow library.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
Code references:
https://github.com/shouvikmani/Tensorflow-Deep-Learning-Tutorial/blob/master/tutorial.ipynb
https://github.com/aymericdamien/TensorFlow-Examples/... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackruntime
import (
"context"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/stacks/stackaddrs"
"github.com... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/eval_expr.go |
//
// DispatchQueue+Alamofire.swift
//
// Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/)
//
// 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 rest... | swift | github | https://github.com/Alamofire/Alamofire | Source/Extensions/DispatchQueue+Alamofire.swift |
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.append... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2008 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-testlib/src/com/google/common/collect/testing/TestMapGenerator.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.