code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-29 15:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('markets', '0045_auto_20161028_1109'),
]
operations = [
migrations.AlterModelO... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""implementation of the Socorro data service
deprecated by socorro/dataservice/dataservice_ap... | unknown | codeparrot/codeparrot-clean | ||
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def AccountUpdatedEvent(vim, *args, **kwargs):
'''This event records that an account was u... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division
import errno
import json
import os
import sys
import time
import traceback
from twisted.internet import defer, reactor
from twisted.python import log
from twisted.web import resource, static
import p2pool
from bitcoin import data as bitcoin_data
from . import data as p2pool_data, p2p
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# 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',
... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
//===- bolt/Core/BinaryBasicBlock.h - Low-level basic block -----*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | bolt/include/bolt/Core/BinaryBasicBlock.h |
#!/usr/bin/python
#
# Copyright (C) 2010, 2013 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this l... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | unknown | codeparrot/codeparrot-clean | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/native/quantized/cpu/QuantizedOps.h>
#ifndef AT_PER_OPERATOR_HEADERS
#include <ATen/NativeFunctions.h>
#else
#include <ATen/ops/gelu_native.h>
#endif
namespace at::native {
DEFINE_DISPATCH(qgelu_stub);
Tensor gelu_quantized_cpu(... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qgelu.cpp |
# coding: utf-8
# <mongotor - An asynchronous driver and toolkit for accessing MongoDB with Tornado>
# Copyright (C) <2012> Marcel Nicolay <marcel.nicolay@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by ... | 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/src/com/google/common/collect/ImmutableMapValues.java |
# Copyright 2011 Isaku Yamahata <yamahata@valinux co jp>
# 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... | unknown | codeparrot/codeparrot-clean | ||
---
applyTo: "**/*.go"
description: "Practical guidance for Golang programming"
---
# Go Programming Instructions
## Code Style and Formatting
- Use `gofmt` and `goimports` to format all Go code automatically
- Follow standard Go naming conventions:
- camelCase for unexported identifiers
- PascalCase for exported... | unknown | github | https://github.com/hashicorp/vault | .github/instructions/generic/golang.instructions.md |
//===--- GenCast.cpp - Swift IR Generation for dynamic casts --------------===//
//
// 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... | cpp | github | https://github.com/apple/swift | lib/IRGen/GenCast.cpp |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Kluster - A clustering Web Service
#
# Copyright (C) 2011 Atizo AG and individual contributors (see AUTHORS).
#
# 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 Softw... | unknown | codeparrot/codeparrot-clean | ||
""" Support for ISY994 lights. """
# system imports
import logging
# homeassistant imports
from homeassistant.components.isy994 import (ISYDeviceABC, ISY, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const impor... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
encode_dict,
get_element_by_attribute,
int_or_none,
)
class MiTeleIE(InfoExtractor):
IE_DESC = 'mitele.es'
_VALID_URL = r'http://www\.mitele\.es/[^/]+/[^/]+/[^/]... | unknown | codeparrot/codeparrot-clean | ||
from swampdragon.route_handler import BaseModelRouter, SUCCESS
from swampdragon.serializers.model_serializer import ModelSerializer
from swampdragon.testing.dragon_testcase import DragonTestCase
from .models import TwoFieldModel
class Serializer(ModelSerializer):
class Meta:
update_fields = ('text', 'numbe... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com>
# (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 annotations
DOCUMENTATION = """
name: env
author: Jan-Piet Mens (@jpmens) <jpmens(at)gmail.com>
version_added: "0.9"... | python | github | https://github.com/ansible/ansible | lib/ansible/plugins/lookup/env.py |
from functools import wraps
from django.core.exceptions import ObjectDoesNotExist # NOQA
from django.db.models import signals # NOQA
from django.db.models.aggregates import * # NOQA
from django.db.models.deletion import ( # NOQA
CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedError,
)
from d... | unknown | codeparrot/codeparrot-clean | ||
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2015 Red Hat, 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 r... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014, Big Switch Networks
# 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 requ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# Copyright (C) 2015-2016 Comunitea Servicios Tecnológicos All Rights Reserved
# ... | 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 agre... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import collections
class WebDriverException(Exception):
http_status = None
status_code = None
class ElementNot... | unknown | codeparrot/codeparrot-clean | ||
# This Python module is part of the PyRate software package.
#
# Copyright 2020 Geoscience Australia
#
# 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/... | 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/h3/H3Benchmark.java |
"""Serializers for defcon.status."""
from rest_framework import serializers
from defcon.status import models
# Models for the full API.
class ComponentSerializer(serializers.HyperlinkedModelSerializer):
"""Serializer for Component."""
class Meta:
"""Configuration."""
model = models.Component... | unknown | codeparrot/codeparrot-clean | ||
"""rename this to test_assumptions.py when the old assumptions system is deleted"""
from sympy.core import symbols
from sympy.assumptions import AppliedPredicate, global_assumptions, Predicate
from sympy.assumptions.ask import _extract_facts
from sympy.printing import pretty
from sympy.assumptions.ask import Q
from sym... | unknown | codeparrot/codeparrot-clean | ||
import os
import logging
import re
import tempfile
from autotest.client.shared import error
from virttest import data_dir
from virttest.libvirt_xml import network_xml, xcepts
from virttest import virsh
def run(test, params, env):
net_name = params.get("net_update_net_name", "updatenet")
net_section = params.g... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# Copyright 2018 ACSONE SA/NV.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import os
import tempfile
import mock
from openerp.modules import get_module_path
from openerp.tests import common
from openerp.tests.common import TransactionCase
fro... | unknown | codeparrot/codeparrot-clean | ||
"""
This file is part of the 'Elements' Project
Elements is a 2D Physics API for Python (supporting Box2D2)
Copyright (C) 2008, The Elements Team, <elements@linuxuser.at>
Home: http://elements.linuxuser.at
IRC: #elements on irc.freenode.org
Code: http://www.assembla.com/wiki/show/elements
svn co http://sv... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
import binascii
import sys
from xprint import to_hex, to_x, to_x_32
_python3 = sys.version_info.major == 3
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x0... | unknown | codeparrot/codeparrot-clean | ||
import { describe, expect, test, vi } from 'vitest'
import { compile } from '..'
import plugin from '../plugin'
import { optimizeCss } from '../test-utils/run'
import defaultTheme from './default-theme'
import type { CssInJs, PluginAPI } from './plugin-api'
const css = String.raw
describe('theme', async () => {
tes... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/compat/plugin-api.test.ts |
# Copyright 2018 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
#
# Copyright 2014 The Oppia 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 requi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
'''
Module for viewing and modifying sysctl parameters
'''
# Import python libs
import logging
import os
import re
# Import salt libs
import salt.utils
from salt._compat import string_types
from salt.exceptions import CommandExecutionError
from salt.modules.systemd import _sd_booted
log = log... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.forms import (
BooleanField, Char... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal
from .response import Response
from ..._models import BaseModel
__all__ = ["ResponseIncompleteEvent"]
class ResponseIncompleteEvent(BaseModel):
"""An event that is emitted when a response ... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/response_incomplete_event.py |
<?php
namespace Illuminate\Http\Client\Promises;
use Closure;
use GuzzleHttp\Promise\PromiseInterface;
use RuntimeException;
class LazyPromise implements PromiseInterface
{
/**
* The callbacks to execute after the Guzzle Promise has been built.
*
* @var list<callable>
*/
protected array $... | php | github | https://github.com/laravel/framework | src/Illuminate/Http/Client/Promises/LazyPromise.php |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Big Switch Networks, 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
... | unknown | codeparrot/codeparrot-clean | ||
import os
import re
import glob as g
import shutil
import tempfile
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
class MetaOESourceMirroring(OESelftestTestCase):
# Can we download everything from the OpenEmbedded Sources Mirror over http ... | 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/common/util/CodePointCountBenchmark.java |
<?php
$container->loadFromExtension('twig'); | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/empty.php |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/hi/pipeline_tutorial.md |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011 CERN.
#
# Invenio 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Verify that a link time only dependency will get pulled into the set of built
targets, even if no executable uses it.
"""
import TestGy... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context/src/main/java/org/springframework/context/event/ContextStartedEvent.java |
#!/usr/bin/env python
# Copyright 2014 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.
"""Removes ViewHostMsg_Close and alike from testcases. These messages are an
annoyance for corpus distillation. They cause the browser ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.admin import AdminSite
from django.contrib.contenttypes.admin import GenericStackedInline
from django.core import checks
from django.test import SimpleTestCase, override_settings
from .models import A... | unknown | codeparrot/codeparrot-clean | ||
# Generated by Django 2.2.13 on 2020-12-18 12:06
import django.db.models.deletion
import django_fsm
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('marketplace', '0035_offeringpermission'),
('google', '0001_initial'),
]
operations = [
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
from frappe.utils impor... | unknown | codeparrot/codeparrot-clean | ||
import matplotlib
import inspect
import warnings
# ipython relies on interactive_bk being defined here
from matplotlib.rcsetup import interactive_bk
__all__ = ['backend','show','draw_if_interactive',
'new_figure_manager', 'backend_version']
backend = matplotlib.get_backend() # validates, to match all_back... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# 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... | unknown | github | https://github.com/apache/airflow | dev/sign.sh |
# (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
#
# 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 l... | unknown | codeparrot/codeparrot-clean | ||
package ioutils
import (
"bytes"
"context"
"testing"
"time"
)
type blockingReader struct{}
func (r blockingReader) Read(p []byte) (int, error) {
time.Sleep(time.Second)
return 0, nil
}
func TestCopyCtx(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*5)
defer cancel(... | go | github | https://github.com/moby/moby | daemon/internal/ioutils/copy_test.go |
// 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 ... | go | github | https://github.com/prometheus/prometheus | util/almost/almost_test.go |
# Copyright (c) 2018 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
from runners.core import ZephyrBinaryRunner
def test_runner_imports():
# Ensure that all runner modules are imported and returned by
# get_runners().
#
# This is just a basic sanity check against errors introduced by
# tree-... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2015 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/controlplane/import_known_versions.go |
# -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN.
#
# Invenio 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... | unknown | codeparrot/codeparrot-clean | ||
#@PydevCodeAnalysisIgnore
# XXX This module needs cleanup.
from ctypes import *
DWORD = c_ulong
WORD = c_ushort
BYTE = c_byte
ULONG = c_ulong
LONG = c_long
LARGE_INTEGER = c_longlong
ULARGE_INTEGER = c_ulonglong
HANDLE = c_ulong # in the header files: void *
HWND = HANDLE
HDC = HANDLE
HMODULE = HANDLE
HINSTANCE =... | unknown | codeparrot/codeparrot-clean | ||
"""Support for BME280 temperature, humidity and pressure sensor."""
from datetime import timedelta
from functools import partial
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.const import TEMP... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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 unittest
from telemetry.core.platform import process_statistic_timeline_data
class ProcessStatisticTimelineDataTest(unittest.TestCase):
def testP... | unknown | codeparrot/codeparrot-clean | ||
import io
from os import path
import unittest
import numpy as np
from Orange.data import Table, ContinuousVariable, DiscreteVariable
from Orange.data.io import TabFormat
class TestTabReader(unittest.TestCase):
def setUp(self):
DiscreteVariable._clear_cache()
def test_read_easy(self):
simple... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2012 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.
package strings_test
import (
"fmt"
"strings"
"unicode"
"unsafe"
)
func ExampleClone() {
s := "abc"
clone := strings.Clone(s)
fmt.Println(s == clone)
... | go | github | https://github.com/golang/go | src/strings/example_test.go |
#!/usr/bin/env python3
#-*- mode: Python;-*-
import sys
import time
import traceback
import socket
import datetime
import http.client
import subprocess
import tempfile
import json
import gzip
import statistics
try:
import requests
except:
sys.stderr.write('ERROR: Could not import requests module. Ensure it i... | unknown | codeparrot/codeparrot-clean | ||
########################################################################
# $Id$
########################################################################
""" SandboxHandler is the implementation of the Sandbox service
in the DISET framework
"""
__RCSID__ = "$Id$"
import os
import time
import random
import types
imp... | unknown | codeparrot/codeparrot-clean | ||
# Natural Language Toolkit: Detect Features
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (porting)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Functions for detecting a token'... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | unknown | codeparrot/codeparrot-clean | ||
"""Iterative methods for solving linear systems"""
from __future__ import division, print_function, absolute_import
__all__ = ['bicg','bicgstab','cg','cgs','gmres','qmr']
from . import _iterative
from scipy.sparse.linalg.interface import LinearOperator
from scipy._lib.decorator import decorator
from .utils import m... | unknown | codeparrot/codeparrot-clean | ||
"""Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import collections.abc
import contextlib
import errno
import fnmatch
import functools
import gc
import importlib
import importlib.util
import logging.han... | unknown | codeparrot/codeparrot-clean | ||
# 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... | python | github | https://github.com/tensorflow/tensorflow | tensorflow/compiler/tests/momentum_test.py |
/* 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/core/tpu/kernels/tpu_compilation_cache_service.h |
from flexget.components.variables.variables import Variables
from flexget.manager import Session
from flexget.utils import json
class TestVariablesAPI:
config = 'tasks: {}'
variables_dict = {'test_variable_db': True}
def test_variables_get(self, api_client):
with Session() as session:
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailsearch.utils import normalise_query_string, MAX_QUERY_STRING... | 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/admin/ListClientMetricsResourcesOptions.java |
/**
* 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/test/java/org/apache/hadoop/security/TestDoAsEffectiveUser.java |
# Copyright 2012-2014 eNovance <licensing@enovance.com>
#
# 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 | ||
"Dummy cache backend"
from django.core.cache.backends.base import BaseCache
class DummyCache(BaseCache):
def __init__(self, host, *args, **kwargs):
BaseCache.__init__(self, *args, **kwargs)
def add(self, key, value, timeout=None, version=None):
key = self.make_key(key, version=version)
... | 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 distribut... | unknown | codeparrot/codeparrot-clean | ||
"""
Service interface adapted to work with tornado, must be used only by tornado service handlers
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
from tornado import gen
from tornado.ioloop import IOLoop
from DIRAC.ConfigurationSys... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Federico Ceratto <federico.ceratto@hp.com>
#
# 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.or... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations | python | github | https://github.com/openai/openai-python | src/openai/types/beta/chat/__init__.py |
"""
Django settings for {{ project_name }} project.
Common settings for all environments. Don't directly use this settings file,
use environments/development.py or environments/production.py and import this
file from there.
"""
import sys
from path import path
from django.conf import global_settings
PROJECT_ROOT = pa... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2023 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package server
import (
"context"
"fmt"
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
_ "github.com/cockroachdb/cockroach/pkg/cloud/impl" // register Exte... | go | github | https://github.com/cockroachdb/cockroach | pkg/server/job_profiler_test.go |
"""
This module contains EXPERIMENTAL support for storing a Whoosh index's files in
the Google App Engine blobstore. This will use a lot of RAM since all files are
loaded into RAM, but it potentially useful as a workaround for the lack of file
storage in Google App Engine.
Use at your own risk, but please report any p... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2016 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/verify-licenses.sh |
""" A simple benchmark comparing the ALS model here to QMF from Quora.
Compares the running time of this package vs the QMF library from Quora.
On my desktop (Intel Core i7 7820x) running with 50 factors for 15 iterations
on the last.fm 360k dataset, this is the output:
QMF finished in 279.32511353492737
Imp... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.
set -xeuo pipefail
dir="$(dirname $(dirname $(dirname $(dirname $(dirname $(dirname "${0}"))))))"
source "$dir/teamcity-support.sh" # For $root
sourc... | unknown | github | https://github.com/cockroachdb/cockroach | build/teamcity/internal/cockroach/build/ci/generate-profile.sh |
//// [tests/cases/compiler/arrayAssignmentTest4.ts] ////
//// [arrayAssignmentTest4.ts]
class C3 {
CM3M1() { return 3;}
}
/*
This behaves unexpectedly with teh following types:
Type 1 of any[]:
* Type 2 of the following throws an error but shouldn't: () => void[], SomeClass[], and {one: 1}[].
* Type 2 of the ... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/arrayAssignmentTest4.js |
# -*- coding: utf8
"""Random Projection transformers
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Ra... | 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 Li... | unknown | codeparrot/codeparrot-clean | ||
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
addonmanager.kubernetes.io/mode: Reconcile
name: ipamblocks.crd.projectcalico.org
spec:
group: crd.projectcalico.org
names:
kind: IPAMBlock
listKind: IPAMBlockList
plural: ipamblocks
singular: ipamblock
sc... | unknown | github | https://github.com/kubernetes/kubernetes | cluster/addons/calico-policy-controller/ipamblock-crd.yaml |
<?php
namespace Illuminate\Auth\Passwords;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
class DatabaseTokenRepository imple... | php | github | https://github.com/laravel/framework | src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php |
# 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 | ||
function Component(props) {
let x = [1, 2, 3];
let ret = [];
do {
let item = x.pop();
ret.push(item * 2);
} while (x.length && props.cond);
return ret;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
}; | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/do-while-compound-test.js |
import numpy as np
from copy import deepcopy
from equadratures.parameter import Parameter
from equadratures import Weight
from equadratures.poly import Poly
from equadratures.basis import Basis
import equadratures.plot as plot
from urllib.parse import quote
class PolyTree(object):
""" Definition of a polynomia... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp |
#include "git-compat-util.h"
#include "strvec.h"
#include "strbuf.h"
const char *empty_strvec[] = { NULL };
void strvec_init(struct strvec *array)
{
struct strvec blank = STRVEC_INIT;
memcpy(array, &blank, sizeof(*array));
}
void strvec_push_nodup(struct strvec *array, char *value)
{
if (array->v == empty_strvec)... | c | github | https://github.com/git/git | strvec.c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.