code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* 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/test/java/org/springframework/beans/factory/config/TestTypes.java |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
import os
import subprocess
import sys
makeenvout = subprocess.Popen('cd ../../environment; make clean; make all', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8')
if "Error 1" in makeenvout:
print('Environment build failed. Make output:\n#######################################################')... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CherryMusic - a standalone music server
# Copyright (c) 2012-2014 Tom Wallroth & Tilman Boerner
#
# Project page:
# http://fomori.org/cherrymusic/
# Sources on github:
# http://github.com/devsnd/cherrymusic/
#
# CherryMusic is based on
# jPlayer (GPL/MIT license)... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package blocktoattr
import (
"log"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/hashicorp/terraform/internal/configs/configschema"
"github.com/zclconf/go-cty/cty"
)
// FixUpBlockAttrs takes a raw HCL body an... | go | github | https://github.com/hashicorp/terraform | internal/lang/blocktoattr/fixup.go |
# Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# $Id:$
import ctypes
import math
import sys
import threading
import time
import lib_dsound as lib
from pyglet.media import MediaException, MediaThread, AbstractAudioDriver, \
AbstractAudioPlayer, MediaEvent
from pyglet.window.win32 import _user32, _kernel32
import pyglet
_debug = pyglet.option... | unknown | codeparrot/codeparrot-clean | ||
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
# Copyright (C) 2006 - 2007 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License versi... | unknown | codeparrot/codeparrot-clean | ||
import { NextRequest, NextResponse } from "next/server";
import { revalidatePath, revalidateTag } from "next/cache";
export async function PUT(request: NextRequest) {
const requestBody = await request.text();
const { paths, tags } = requestBody
? JSON.parse(requestBody)
: { paths: [], tags: [] };
let rev... | typescript | github | https://github.com/vercel/next.js | examples/cms-wordpress/src/app/api/revalidate/route.ts |
import requests
from flask import current_app, request, jsonify
from flask_cors import cross_origin
from alerta.app.exceptions import ApiError, NoCustomerMatch
from alerta.app.models.customer import Customer
from alerta.app.models.token import Jwt
from alerta.app.auth.utils import create_token
from . import auth
@... | unknown | codeparrot/codeparrot-clean | ||
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Welcome to Tauri!</title>
</head>
<body>
<h1>Welcome to Tauri!</h1>
</body>
</html> | html | github | https://github.com/tauri-apps/tauri | examples/multiwebview/index.html |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.client.Agent} and related new client APIs.
"""
import cookielib
import zlib
from StringIO import StringIO
from zope.interface.verify import verifyObject
from twisted.trial.unittest import TestCase
from twisted.web im... | unknown | codeparrot/codeparrot-clean | ||
import random
import uuid
from datetime import date
from freezegun import freeze_time
from tests.conftest import normalize_spaces
def _get_example_performance_data():
return {
"total_notifications": 1_789_000_000,
"email_notifications": 1_123_000_000,
"sms_notifications": 987_654_321,
"le... | unknown | codeparrot/codeparrot-clean | ||
###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 option) any l... | unknown | codeparrot/codeparrot-clean | ||
int use_FREE_AND_NULL(int *v)
{
free(*v);
*v = NULL;
}
int need_no_if(int *v)
{
if (v)
free(v);
} | c | github | https://github.com/git/git | contrib/coccinelle/tests/free.c |
import mock
import pytest
from praw.models import Comment, Submission, Subreddit
from ... import IntegrationTest
class TestMultireddit(IntegrationTest):
@mock.patch("time.sleep", return_value=None)
def test_add(self, _):
self.reddit.read_only = False
with self.recorder.use_cassette("TestMulti... | unknown | codeparrot/codeparrot-clean | ||
# This file implements polynomial regression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from sklearn.metrics import mean_squared_error
#Set number of samples and seed
NUM_SAMPLES = 1... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from .common import InfoExtractor
class ThisAmericanLifeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?thisamericanlife\.org/(?:radio-archives/episode/|play_full\.php\?play=)(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.thisamericanlife.org/radio-archives/ep... | unknown | codeparrot/codeparrot-clean | ||
'''
IDE: Eclipse (PyDev)
Python version: 2.7
Operating system: Windows 8.1
@author: Emil Carlsson
@copyright: 2015 Emil Carlsson
@license: This program is distributed under the terms of the GNU General Public License
'''
from View import GlobalFunc
from View.Board import Board
class GameView(object):
__root = No... | unknown | codeparrot/codeparrot-clean | ||
/*
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/apis/config/v1alpha1/defaults.go |
/*
* 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 ... | java | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/java/org/springframework/docs/web/webmvcview/mvcviewjspresolver/WebConfiguration.java |
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from fpuf.apps.ufs.models import Familia, Cicle, MP, UF, ResultatAprenentatge,\
Contingut
import random
import string
from django.contrib.auth.models import User
class Command(BaseCommand):
args = '<poll_id poll_id ...>'
... | unknown | codeparrot/codeparrot-clean | ||
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
import time
from django.core import mail
from nose.tools import eq_
import amo
import amo.tests
from amo.tests import addon_factory
from addons.models import Addon
from versions.models import Version, version_uploaded, ApplicationsVersions
from files.models import File
from ap... | 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 rpc
import (
"context"
"time"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/co... | go | github | https://github.com/cockroachdb/cockroach | pkg/rpc/heartbeat.go |
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.test.cases.generated.cases.components.resolver;
import com.inte... | java | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/resolver/FirIdeNormalAnalysisSourceModuleResolveCandidatesByFileTestGenerated.java |
# Copyright 2021 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
# Common logic used by the nightly roachtest scripts (Bazel and non-Bazel).
# Set up Google credentials. Note that we need this for all clouds since we upload
# perf artifa... | unknown | github | https://github.com/cockroachdb/cockroach | build/teamcity/util/roachtest_util.sh |
# pylint: skip-file
# pylint: disable=too-many-instance-attributes
class FirewallRule(GCPResource):
'''Object to represent a gcp forwarding rule'''
resource_type = "compute.v1.firewall"
# pylint: disable=too-many-arguments
def __init__(self,
rname,
project,
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/sh
test_description='test combined/stat/moved interaction'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
# This test covers a weird 3-way interaction between "--cc -p", which will run
# the combined diff code, along with "--stat", which will be computed ... | unknown | github | https://github.com/git/git | t/t4066-diff-emit-delay.sh |
//// [tests/cases/compiler/asyncArrowInClassES5.ts] ////
//// [asyncArrowInClassES5.ts]
// https://github.com/Microsoft/TypeScript/issues/16924
// Should capture `this`
class Test {
static member = async (x: string) => { };
}
//// [asyncArrowInClassES5.js]
"use strict";
// https://github.com/Microsoft/TypeScript... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/asyncArrowInClassES5(target=es2015).js |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/coder/ErasureEncoder.java |
# -*- coding: utf-8 -*-
"""
Contraction map, used to expand contractions in text
@author: Eric
"""
CONTRACTION_MAP = {
"ain't": "is not",
"aren't": "are not",
"can't": "cannot",
"can't've": "cannot have",
"'cause": "because",
"could've": "could have",
"couldn't": "could not",
"couldn't've": "could not have",
"didn't"... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 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.
"""Traffic control library for constraining the network configuration on a port.
The traffic controller sets up a constrained network configuration on a... | unknown | codeparrot/codeparrot-clean | ||
"""Sparse Equations and Least Squares.
The original Fortran code was written by C. C. Paige and M. A. Saunders as
described in
C. C. Paige and M. A. Saunders, LSQR: An algorithm for sparse linear
equations and sparse least squares, TOMS 8(1), 43--71 (1982).
C. C. Paige and M. A. Saunders, Algorithm 583; LSQR: Sparse... | unknown | codeparrot/codeparrot-clean | ||
"""HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (C) 2009 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 ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, ... | java | github | https://github.com/elastic/elasticsearch | benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/BlockKeepMaskBenchmark.java |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
@pytest.mark.online
class TestInputSites(object):
config = ("""
templates:
global:
headers:
User-Agent: "Mozi... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | lib/request.c |
# 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 program is distributed in the hope that it will be useful,
# but... | unknown | codeparrot/codeparrot-clean | ||
import gzip
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from representation import parseJsonLineWithPlace
def docs2chars(docs, char2Idx):
#We create a three dimensional tensor with
#Number of samples; Max number of tokens; Max number of characters
nSamples = len(docs) ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 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 base64
from appengine_wrappers import urlfetch
from future import Future
class _AsyncFetchDelegate(object):
def __init__(self, rpc):
self.... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 Datera
# 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 applic... | 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 | ||
# -*- coding: utf-8 -*-
# (c) 2015 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import openerp.tests.common as common
class TestSaleOrderType(common.TransactionCase):
def setUp(self):
super(TestSaleOrderType, self).setUp()
self.sale_type_model = s... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
#For baseline and redundacy-detecion to prepare message size picture
def MessageSize(typePrefix, directory):
wf = open("%(typePrefix)s-message.data"%vars(), 'w')
wf.write("#Suggest Filename: %(typePrefix)s-message.data\n#Data for drawing message overall size"%vars())
wf.write("#Timeout:... | unknown | codeparrot/codeparrot-clean | ||
from .base import Browser, ExecutorBrowser, require_arg
from ..webdriver_server import ChromeDriverServer
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorselenium import (SeleniumTestharnessExecutor, # noqa: F401
SeleniumRefTestExecutor... | unknown | codeparrot/codeparrot-clean | ||
prelude: |
# frozen_string_literal
unless Time.method_defined?(:xmlschema)
class Time
def xmlschema(fraction_digits=0)
fraction_digits = fraction_digits.to_i
s = strftime("%FT%T")
if fraction_digits > 0
s << strftime(".%#{fraction_digits}N")
end
s << (utc?... | unknown | github | https://github.com/ruby/ruby | benchmark/time_xmlschema.yml |
from six.moves.urllib.parse import urljoin
import funcy as fn
import json
import logging
import requests
import html2text
from cachecontrol import CacheControl
from django.http import StreamingHttpResponse
from oauthlib.oauth2 import WebApplicationClient #, BackendApplicationClient
from requests_oauthlib import OAu... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/env python
from error import SaveError,LoadError,CompressedError
from zipfs import fsopen,isZip,GetFileNameInZip
import os
import pygame
class TextureConverter:
def __init__(self,palette=None):
if palette is not None:
self.palette_surf=palette
else:
self.palette_surf=pygame.image.load('code/palette.bm... | unknown | codeparrot/codeparrot-clean | ||
module.exports = {
images: {
// add the Umbraco server domain as allowed domain for serving images
domains: [process.env.UMBRACO_SERVER_URL.match(/.*\/\/([^:/]*).*/)[1]],
},
}; | javascript | github | https://github.com/vercel/next.js | examples/cms-umbraco/next.config.js |
- hosts: testhost
gather_facts: false
tasks:
- name: template in register warns, but no template should not
debug: msg=unimportant
register: thisshouldnotwarn | unknown | github | https://github.com/ansible/ansible | test/integration/targets/templating_settings/dont_warn_register.yml |
/*-------------------------------------------------------------------------
*
* BIG5 <--> UTF8
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* src/backend/utils/mb/conversion_procs/utf8_and_... | c | github | https://github.com/postgres/postgres | src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c |
# <License type="Sun Cloud BSD" version="2.2">
#
# Copyright (c) 2005-2009, Sun Microsystems, 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:
#
# 1. Redistributions of source code must reta... | unknown | codeparrot/codeparrot-clean | ||
"""
BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21).
Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. Don't use it for production use.
"""
from BaseHTTPSe... | unknown | codeparrot/codeparrot-clean | ||
import sys
import zipfile
from django.contrib.contenttypes.models import ContentType
from django.db import models
from file_import.compat import AUTH_USER_MODEL
if sys.version_info >= (3,0):
unicode = str
class ImportLog(models.Model):
""" A log of all import attempts """
name = models.CharField(max_lengt... | unknown | codeparrot/codeparrot-clean | ||
"""Unit tests for evaluators."""
import deepchem as dc
import numpy as np
import unittest
import sklearn
from deepchem.utils.evaluate import Evaluator
from deepchem.utils.evaluate import GeneratorEvaluator
def test_multiclass_threshold_predictions():
"""Check prediction thresholding works correctly."""
# Construct... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean | ||
import logging
import shutil
import threading
import os
import xml.etree.ElementTree as etree
from datetime import datetime
import requests
import vlc
from dateutil import parser
from dateutil.tz import tzutc
from i3pystatus import IntervalModule
from i3pystatus.core.desktop import DesktopNotification
from i3pystatus.... | unknown | codeparrot/codeparrot-clean | ||
from boxbranding import getMachineBrand
from enigma import ePicLoad, eTimer, getDesktop, gMainDC, eSize
from Screens.Screen import Screen
from Tools.Directories import resolveFilename, pathExists, SCOPE_MEDIA, SCOPE_ACTIVE_SKIN
from Components.Pixmap import Pixmap, MovingPixmap
from Components.ActionMap import Actio... | unknown | codeparrot/codeparrot-clean | ||
from typing import Optional
from ctypes import *
from vcx.common import do_call, create_cb
from vcx.error import VcxError, ErrorCode
from vcx.api.vcx_stateful import VcxStateful
import json
class Schema(VcxStateful):
"""
Object that represents a schema written on the ledger.
Attributes:
source_id... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
Lists all the unique parts and their colors in a .mpd file. This
is sometimes useful for determining the name of a part and/or a
color.
Hazen 04/15
"""
import os
import re
import sys
import opensdraw.lcad_lib.datFileParser as datFileParser
if (len(sys.argv) != 2):
print("usage: <ldraw ... | unknown | codeparrot/codeparrot-clean | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/Config.h>
#include <c10/util/error.h>
#include <thread>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/Functions.h>
#include <ATen/NativeFunctions.h>
#else
#include <ATen/ops/_nnpack_available_native.h>
#include <ATen/ops/_nnpack... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/NNPACK.cpp |
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import unittest
class UserListA(ListMix... | unknown | codeparrot/codeparrot-clean | ||
{
"definitions": {
"rule": {
"description": "Condition used to match resource (string, RegExp or Function).",
"anyOf": [
{
"instanceof": "RegExp",
"tsType": "RegExp"
},
{
"type": "string",
"minLength": 1
},
{
"in... | json | github | https://github.com/webpack/webpack | schemas/plugins/SourceMapDevToolPlugin.json |
"""This module exists for purists who believe that ``unipath.Path`` shouldn't
inherit from ``unipath.PathName``. It provides an ``FSPath`` class that
mimics ``Path``. This current implementation punts by subclassing ``Path`` and
disabling the forbidden methods/properies, but there are instructions below to
make it a t... | unknown | codeparrot/codeparrot-clean | ||
import tensorflow as tf
import urllib.request
def load_image(url):
"""Read in the image_data to be classified."""
response = urllib.request.urlopen(url)
return response.read()
def load_labels(filename):
"""Read in labels, one label per line."""
return [line.rstrip() for line in tf.gfile.GFile(filename)]
de... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | unknown | codeparrot/codeparrot-clean | ||
use std::collections::hash_map::Entry;
use std::marker::PhantomData;
use std::ops::Range;
use rustc_abi::{BackendRepr, FieldIdx, FieldsShape, Size, VariantIdx};
use rustc_data_structures::fx::FxHashMap;
use rustc_index::IndexVec;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::ty::lay... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_ssa/src/mir/debuginfo.rs |
#!/bin/sh
test_description='check quarantine of objects during push'
. ./test-lib.sh
test_expect_success 'create picky dest repo' '
git init --bare dest.git &&
test_hook --setup -C dest.git pre-receive <<-\EOF
while read old new ref; do
test "$(git log -1 --format=%s $new)" = reject && exit 1
done
exit 0
EOF... | unknown | github | https://github.com/git/git | t/t5547-push-quarantine.sh |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-08-11 20:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('stats', '0002_auto_20151109_0319'),
('counties', '00... | unknown | codeparrot/codeparrot-clean | ||
{
"columns": {
"description": "Descripció",
"key": "Clau",
"name": "Nom",
"team": "Equip",
"value": "Valor"
},
"config": {
"columns": {
"section": "Secció"
},
"title": "Configuració d'Airflow"
},
"connections": {
"add": "Afegir connexió",
"columns": {
"conne... | json | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/public/i18n/locales/ca/admin.json |
"""Flexible enumeration of C types."""
from Enumeration import *
# TODO:
# - struct improvements (flexible arrays, packed &
# unpacked, alignment)
# - objective-c qualified id
# - anonymous / transparent unions
# - VLAs
# - block types
# - K&R functions
# - pass arguments of different types (test extension... | unknown | codeparrot/codeparrot-clean | ||
"""Filename globbing utility."""
import os
import fnmatch
import re
__all__ = ["glob"]
def glob(pathname):
"""Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la fnmatch.
"""
if not has_magic(pathname):
if os.path.exists(pathname):
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser engine for the grammar tables generated by pgen.
The grammar table must be loaded first.
See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.
... | unknown | codeparrot/codeparrot-clean | ||
//===--- ArrayCallKind.h -------------------------------------- -*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2025 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 | include/swift/SILOptimizer/Analysis/ArrayCallKind.h |
import yaml, canonical
def test_canonical_scanner(canonical_filename, verbose=False):
data = open(canonical_filename, 'rb').read()
tokens = list(yaml.canonical_scan(data))
assert tokens, tokens
if verbose:
for token in tokens:
print token
test_canonical_scanner.unittest = ['.canoni... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado #
# (pacoqueen@users.sourceforge.net) #
# ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import urllib
import urllib2
class RestClient:
def get(self,url,headers):
req = urllib2.Request(url,headers=headers)
response = urllib2.urlopen(req)
return response.read()
def post(self,url,para,headers):
#value = urllib.u... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2018, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | python | github | https://github.com/google/googletest | googletest/test/gtest_json_test_utils.py |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import DBMS
from lib.core.settings import SQLITE_SYSTEM_DBS
from lib.core.unescaper import unescaper
from plugins.dbms.sqlite.enumeration import Enumeratio... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2016 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 13 13:06:14 2013
Author: Josef Perktold
"""
from __future__ import print_function
from statsmodels.stats.power import TTestPower, TTestIndPower, tt_solve_power
if __name__ == '__main__':
effect_size, alpha, power = 0.5, 0.05, 0.8
ttest_pow = TTestPower()
p... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
/***************************************************************************
vfkPluginDialog
A QGIS plugin
Plugin umoznujici praci s daty katastru nemovitosti
-------------------
begin : 2015-06-11
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import os
import platform
import hyperspeed.utils
import shutil
from distutils.spawn import find_executable
import hyperspeed
import hyperspeed.utils
from hyperspeed import mistika
desktop_template = '''[Desktop Entry]
Categories=Multimedia;Mistika;
Exec=%s %%f
Icon=%s
MimeType=
Name=%s
Path=%s... | unknown | codeparrot/codeparrot-clean | ||
from setuptools import setup, find_packages
import platform
with open('README.rst') as f:
readme = f.read()
with open('substance/_version.py') as versionFile:
exec(versionFile.read())
install_requires = [
'setuptools>=1.1.3',
'PyYAML',
'tabulate',
'paramiko>=2.4.1',
'netaddr',
'reques... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# pyechonest documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 30 15:51:03 2010.
#
# 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 | ||
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | unknown | codeparrot/codeparrot-clean | ||
import os
import sys
def load_setup_modules(client_dir):
try:
sys.path.insert(0, client_dir)
import setup_modules
finally:
sys.path.pop(0)
return setup_modules
dirname = os.path.dirname(sys.modules[__name__].__file__)
virt_test_dir = os.path.abspath(os.path.join(dirname, ".."))
sys... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2008, 2009 Intel Corporation
* Authors: Andi Kleen, Fengguang Wu
*
* High level machine check handler. Handles pages reported by the
* hardware as being corrupted usually due to a multi-bit ECC memory or cache
* failure.
*
* In addition there is a "sof... | c | github | https://github.com/torvalds/linux | mm/memory-failure.c |
from __future__ import absolute_import
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2015 by the BurnMan team, released under the GNU
# GPL v2 or later.
import os.path
import sys
sys.path.insert(1, os.path.abspath('../..'))
import... | 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 n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicIdPartitionSet.java |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLINFO_NAMELOOKUP_TIME
Section: 3
Source: libcurl
See-also:
- CURLINFO_NAMELOOKUP_TIME_T (3)
- curl_easy_getinfo (3)
- curl_easy_setopt (3)
Protocol:
- All
Added-in: 7.4.1
---
# NAME
CURLINFO_NAMELOOKUP_TIME ... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLINFO_NAMELOOKUP_TIME.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.