code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Viewfinder watchdog scenario.
"""
__author__ = 'matt@emailscrubbed.com (Matt Tracy)'
import logging
import json
import os
import re
import time
import urllib
from viewfinder.backend.base import util, secrets
from viewfinder.backend.base.environ import ServerE... | unknown | codeparrot/codeparrot-clean | ||
{
"values": {
"id": {
"string": "7da63aeb-f908-a112-9886-f29a0b0bd4ad"
},
"string": {
"string": "Hello, world!"
}
}
} | json | github | https://github.com/hashicorp/terraform | testing/equivalence-tests/tests/moved_with_update/terraform.resource/7da63aeb-f908-a112-9886-f29a0b0bd4ad.json |
// errorcheck
// Copyright 2009 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.
// Verify overflow is detected when using numeric constants.
// Does not compile.
package main
import "unsafe"
type I interface{}
const (
//... | go | github | https://github.com/golang/go | test/const1.go |
# validateNoSetStateInRender
## File
`src/Validation/ValidateNoSetStateInRender.ts`
## Purpose
Validates that a component does not unconditionally call `setState` during render, which would cause an infinite update loop. This pass is conservative and may miss some cases (false negatives) but avoids false positives.
... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/docs/passes/44-validateNoSetStateInRender.md |
//// [tests/cases/compiler/alwaysStrictModule6.ts] ////
//// [alwaysStrictModule6.ts]
// Targeting ES5
export const a = 1;
//// [alwaysStrictModule6.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.a = void 0;
// Targeting ES5
exports.a = 1; | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/alwaysStrictModule6(target=es2015).js |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = '''
---
module: proxysql_backend_servers
v... | unknown | codeparrot/codeparrot-clean | ||
'''
Problem
You recive a credit C at a local sotre and would like to buy two items. You first walk
through the store and create a list L of all available items. From this list you woluld like to
buy two items that add up to the entire value of the credit. The solution you provide will
consist of the two integers in... | unknown | codeparrot/codeparrot-clean | ||
import unittest
from test import test_support
from contextlib import closing
import gc
import pickle
import select
import signal
import subprocess
import traceback
import sys, os, time, errno
if sys.platform in ('os2', 'riscos'):
raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
class HandlerBCall... | unknown | codeparrot/codeparrot-clean | ||
#include <ruby.h>
static VALUE
recursive_i(VALUE obj, VALUE mid, int recur)
{
if (recur) return Qnil;
return rb_funcallv(obj, rb_to_id(mid), 0, 0);
}
static VALUE
exec_recursive(VALUE self, VALUE mid)
{
return rb_exec_recursive(recursive_i, self, mid);
}
static VALUE
exec_recursive_outer(VALUE self, VALU... | c | github | https://github.com/ruby/ruby | ext/-test-/recursion/recursion.c |
#!/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 | ||
# -*- coding: utf-8 -*-
"""
Create a subject set and upload new subjects to it
Created on Mon Jul 11 15:34:53 2016
@author: stijnc
Copyright (C) 2016 Stijn Calders
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 Softwa... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "custom-filter-link",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "custom-filter-link",
"dependencies": {
"@reach/visually-hidden": "0.18.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.15.0"
},
... | json | github | https://github.com/remix-run/react-router | examples/custom-filter-link/package-lock.json |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FOR... | unknown | codeparrot/codeparrot-clean | ||
"""
This is the testing module for Calm applications.
This defines a handy subclass with its utilities, so that you can use them to
test your Calm applications more conveniently and with less code.
"""
import json
from tornado.testing import AsyncHTTPTestCase
from tornado.websocket import websocket_connect
from calm... | unknown | codeparrot/codeparrot-clean | ||
import json
import logging
from django.conf import settings
from django.http import JsonResponse
from django.shortcuts import render
from django.utils.html import strip_tags
from django.views.decorators.csrf import csrf_exempt
logging.basicConfig(format="[%(asctime)s] %(module)s: %(levelname)s - %(message)s")
logger ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 Metaswitch 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 ap... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env bash
set -euo pipefail
PACKAGE_TYPE=${PACKAGE_TYPE:-wheel}
PKG_DIR=${PKG_DIR:-/tmp/workspace/final_pkgs}
# Designates whether to submit as a release candidate or a nightly build
# Value should be `test` when uploading release candidates
# currently set within `designate_upload_channel`
UPLOAD_CHANNEL... | unknown | github | https://github.com/pytorch/pytorch | .circleci/scripts/binary_upload.sh |
import unittest
import random
import time
from functools import partial
from boto.beanstalk.wrapper import Layer1Wrapper
import boto.beanstalk.response as response
class BasicSuite(unittest.TestCase):
def setUp(self):
self.random_id = str(random.randint(1, 1000000))
self.app_name = 'app-' + self.r... | unknown | codeparrot/codeparrot-clean | ||
## Input
```javascript
function foo(a, b, c, d) {
let x = someObj();
if (a) {
const y = someObj();
const z = y;
x = z;
} else {
x = someObj();
}
x.f = 1;
return x;
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function foo(a, b, c, d) {
const $ = _c(2);... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/obj-mutated-after-if-else-with-alias.expect.md |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Nokia
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': [... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
def get_user(request):
if not hasattr(request, '_cached_user'):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env
'''
I HATE REGULAR EXPRESSION :(
So.. the following code is a very preliminary word processing,
it won't split abbrevations, like "I'd", nor it won't split words
concatenated with underscore, like "bad_game"
'''
import os
import re
def word_count(file_path):
word_dict = {}
with open(file_path) as txt... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from typing_extensions import Literal, TypeAlias
from ..._models import BaseModel
from .grader_inputs import GraderInputs
from ..shared.reasoning_effort import ReasoningEffort
from ..response... | python | github | https://github.com/openai/openai-python | src/openai/types/graders/score_model_grader.py |
#include <ruby.h>
static VALUE
invalid_call(VALUE obj, VALUE address)
{
typedef VALUE (*func_type)(VALUE);
return (*(func_type)NUM2PTR(address))(obj);
}
static VALUE
invalid_access(VALUE obj, VALUE address)
{
return *(VALUE *)NUM2PTR(address) == obj ? Qtrue : Qfalse;
}
void
Init_invalid(VALUE mBug)
{
... | c | github | https://github.com/ruby/ruby | ext/-test-/fatal/invalid.c |
#pragma once
#include <ATen/Tensor.h>
#include <ATen/TensorUtils.h>
#include <ATen/core/List.h>
#include <c10/core/TensorOptions.h>
/*
* [Note: hacky wrapper removal for optional tensor]
*
* The kernel implementation takes an optional tensor marked in the schema as
* Tensor? but the C++ function takes Tensor inst... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/core/op_registration/adaption.h |
# engine/reflection.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
"""Provides an abstraction for obtaining database schema information.
Usage No... | unknown | codeparrot/codeparrot-clean | ||
"""
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
Basically identical to the django default caching loader, but takes
into account the blog id.
"""
from django.core.exceptions import ImproperlyConfigured
from django.template i... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package e2etest
import (
"bytes"
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/terraform/internal/e2e"
)
func TestInitProviders(t *testing.T) {
t.Parallel()
// This test... | go | github | https://github.com/hashicorp/terraform | internal/command/e2etest/init_test.go |
import datetime
from django.conf import settings
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from registration import forms
from registration.models import RegistrationProfile
from registration import get_user_model
TEST_USER_MODEL = get_user_model()
cl... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# $Id$
#
# Copyright 2012 Quantcast Corp.
#
# 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 | ||
#!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#####################
import datetime
import threading
import time
import os
try:
import socks
NO_SOCKS = False
except ImportError:
NO_SOCKS = True
import socket
#####################
from parsers.base import SiteParserBase
from parsers.factory import SiteParserFactory
from util import isIma... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python2.5
# -*- coding: utf-8 -*-
#
# Copyright 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 requir... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | unknown | codeparrot/codeparrot-clean | ||
import functools
import operator
import unittest
from itertools import count
import six
from scrapy.utils.python import (
memoizemethod_noargs, isbinarytext, equal_attributes,
WeakKeyCache, stringify_dict, get_func_args, to_bytes, to_unicode)
__doctests__ = ['scrapy.utils.python']
class ToUnicodeTest(unittes... | unknown | codeparrot/codeparrot-clean | ||
use std::mem;
use rustc_ast::visit::Visitor;
use rustc_ast::{Crate, EnumDef, ast, visit};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
use rustc_middle::middle::privacy::{EffectiveVisibilities, EffectiveVisibility, Level};
use rustc_middle::ty::Visibility;
use tracing::i... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_resolve/src/effective_visibilities.rs |
"""
Server Density plugin
MySQL
https://www.serverdensity.com/plugins/mysql/
https://github.com/serverdensity/sd-agent-plugins/
version: 0.1
"""
import traceback
import re
try:
import MySQLdb
except ImportError:
pass
# com commands.
COMMANDS = [
'Com_select',
'Com_delete',
'Com_update',
'Com... | unknown | codeparrot/codeparrot-clean | ||
"""
Very simple and basic mathematical expressions used often throughout the library.
"""
__authors__ = "Ian Goodfellow and Razvan Pascanu"
__copyright__ = "Copyright 2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow and Razvan Pascanu"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "p... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | unknown | codeparrot/codeparrot-clean | ||
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Jayson Vantuyl <jayson@aggressive.ly>
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalIndex,
Index,
Interval,
)
import pandas._testing as tm
class TestReindex:
def test_reindex_list_non_unique(self):
# GH#11586
msg = "cannot reindex on an axis with duplicate labels"
ci = Categorica... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexes/categorical/test_reindex.py |
# coding=utf-8
from __future__ import absolute_import
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import unittest
import mock
import os
import ddt
import sys
import octo... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage.stubbing;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import java.util.List;
import org... | java | github | https://github.com/mockito/mockito | mockito-core/src/test/java/org/mockitousage/stubbing/CloningParameterTest.java |
from PIL import Image, ImageEnhance, ImageOps
import matplotlib as mpl
import matplotlib.pyplot as plt
def histogram(slika, pokazi=True):
"""Izriše histogram za dano sliko. Ta je lahko sivinska ali barvna.
Args:
slika (object): PIL/Pillow objekt
pokazi (bool): Če želimo takoj videti graf. (Def... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteral.ts] ////
//// [binaryIntegerLiteral.ts]
var bin1 = 0b11010;
var bin2 = 0B11010;
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
var bin4 = 0B11111111111111111111111111111111111111111111... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/binaryIntegerLiteral(target=es2015).js |
"use strict";
const path = require("path");
const webpack = require("../../");
/** @type {import("webpack").Configuration} */
const config = {
// mode: "development" || "production",
resolve: {
extensions: [".js", ".jsx"]
},
entry: {
alpha: ["./alpha", "./a", "module"],
beta: ["./beta", "./b", "./c"]
},
o... | javascript | github | https://github.com/webpack/webpack | examples/dll/webpack.config.js |
# 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
# d... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
SubRip's subtitle parser
"""
from pysrt.srtexc import InvalidItem, InvalidIndex
from pysrt.srttime import SubRipTime
from pysrt.comparablemixin import ComparableMixin
from pysrt.compat import str, is_py2
import re
class SubRipItem(ComparableMixin):
"""
SubRipItem(index, start, end,... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import scipy.sparse as sp
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.conditions import EqualsCondition, InCondition
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | server/etcdserver/api/v3rpc/metrics.go |
#!/usr/bin/env python
import os
import glob
import struct
# Format:
#trace_defs['dest_keyword']=[source_keyword, struct_input_sample, struct_output_sample, [bits_per_output_sample]]
# struct definitions are those of struct python module
trace_defs={}
# Bytes written on stack:
#trace_defs['stack_w'] =['stack_bytes_w',... | unknown | codeparrot/codeparrot-clean | ||
# --------------------------------------------------------------------------- #
# MODULE DESCRIPTION #
# --------------------------------------------------------------------------- #
"""RedBrick Configuration Module; contains local configuration information."""
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
int_or_none,
unified_timestamp,
)
class ESPNIE(InfoExtractor):
_VALID_URL = r'https?://(?:espn\.go|(?:www\.)?espn)\.com/video/clip(?:\?.*?\bid=|/_/id/)(?P<id>\... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Code for Life
#
# Copyright (C) 2015, Ocado Innovation Limited
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your o... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Felipe Gallego. All rights reserved.
#
# This file is part of code-snippets: https://github.com/felgari/snippets
#
# This 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 Found... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# 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_... | unknown | codeparrot/codeparrot-clean | ||
//===--- SILCloner.h - Defines the SILCloner class --------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/SIL/SILCloner.h |
# PyTorch Copilot Instructions
This is the PyTorch machine learning framework codebase. These instructions help AI agents navigate and contribute effectively.
## Architecture Overview
### Core Components
- **c10/** - Core library (C++-10 compatible) for essential, binary-size-conscious functionality
- **aten/** - A... | unknown | github | https://github.com/pytorch/pytorch | .github/copilot-instructions.md |
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {TestBed} from '@angular/core/testing';
import {ThemeManager} from './theme-manager.service';
import {LOCAL_... | typescript | github | https://github.com/angular/angular | adev/src/app/core/services/theme-manager.service.spec.ts |
import sys
import sysconfig
import pytest
import numpy as np
from numpy.testing import IS_EDITABLE, IS_WASM, extbuild
@pytest.fixture
def get_module(tmp_path):
""" Some codes to generate data and manage temporary buffers use when
sharing with numpy via the array interface protocol.
"""
if sys.platfor... | python | github | https://github.com/numpy/numpy | numpy/_core/tests/test_array_interface.py |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='EmailUser',
... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import numpy as np
from op_test import OpTest
class TestSeqAvgPool(OpTest):
def set_data(self):
self.op_type = 'sequence_pool'
# one level, batch size is 4
x = np.random.uniform(0.1, 1, [11, 23]).astype('float32')
lod = [[0, 4, 5, 8, 11]]
self.inputs = {'X': ... | unknown | codeparrot/codeparrot-clean | ||
# Pretty-printer commands.
# Copyright (C) 2010-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any la... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2026 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.plugins.compression.zstd
import io.ktor.encoding.zstd.*
import io.ktor.server.plugins.compression.*
import io.ktor.utils.io.*
/**
* Appends the 'zstd' encoder with [b... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-plugins/ktor-server-compression/ktor-server-compression-zstd/jvm/src/io/ktor/server/plugins/compression/zstd/Zstd.kt |
# Copyright 2014 OpenStack Foundation
# 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 | ||
#!/usr/bin/python3
import os
import sys
from random import random
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from naturepy.pvector import PVector
from naturepy.mover import Mover
from naturepy.particle import Particle
import tkinter
C_HEIGHT = 512
C_WIDTH = 512
D_STEP = 10
class Par... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require_relative '../handler'
module Psych
module Handlers
###
# This handler will capture an event and record the event. Recorder events
# are available vial Psych::Handlers::Recorder#events.
#
# For example:
#
# recorder = Psych::Handlers::Recorder.new
... | ruby | github | https://github.com/ruby/ruby | ext/psych/lib/psych/handlers/recorder.rb |
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005-2012, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that th... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/IlmThread/IlmThreadMutex.h |
// Copyright 2009 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 runtime
import (
"internal/abi"
"internal/goarch"
"internal/goexperiment"
"internal/runtime/math"
"internal/runtime/sys"
"unsafe"
)
type slice s... | go | github | https://github.com/golang/go | src/runtime/slice.go |
## Input
```javascript
function Component(props) {
const x = {a: props.a, b: props.b};
delete x.b;
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: ['TodoAdd'],
isComponent: 'TodoAdd',
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Componen... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/delete-property.expect.md |
# -*- coding: utf-8 -*-
"""
github3.repos.hook
==================
This module contains only the Hook object for GitHub's Hook API.
"""
from __future__ import unicode_literals
from json import dumps
from ..decorators import requires_auth
from ..models import GitHubCore
class Hook(GitHubCore):
"""The :class:`Hook... | unknown | codeparrot/codeparrot-clean | ||
import {
BinaryExpression,
Bundle,
chainBundle,
Expression,
isElementAccessExpression,
isExpression,
isPropertyAccessExpression,
Node,
setTextRange,
SourceFile,
SyntaxKind,
TransformationContext,
TransformFlags,
visitEachChild,
visitNode,
VisitResult,
} fr... | typescript | github | https://github.com/microsoft/TypeScript | src/compiler/transformers/es2016.ts |
# -*- coding: utf-8 -*-
#This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Foundation.
"... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Warning: UNDER_CONSTRUCTION
This is a modified code from Kjell Magne Fauske initial code
...with requirements:
- fit on one python file (avoid library complex setup for user)
- only used for Python API
- no need to store SVG input in a file (use serializing string)
- n... | 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 | ||
#!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (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 os
import sys
from telemetry.page import block_page_measurement_results
from telemetry.page import buildbot_page_measurement_results
from telemetr... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
import ctypes
import os
import gc
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decima... | 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/apis/core/annotation_key_constants.go |
from __future__ import division
import numpy as np
from functools import partial
from builtins import zip
from pybasicbayes.distributions import DiagonalRegression, Gaussian, Regression
import pyhsmm
from pyhsmm.util.general import list_split
from pyslds.states import HMMSLDSStatesPython, HMMSLDSStatesEigen, HSMMSLD... | unknown | codeparrot/codeparrot-clean | ||
"""
WSGI config for venezuela_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPL... | unknown | codeparrot/codeparrot-clean | ||
//===--- Selection.h - What's under the cursor? -------------------*-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 | clang-tools-extra/clangd/Selection.h |
#! /usr/bin/env python
"""copen detects and opens compressed files for reading and writing.
Copyright:
copen.py Detects and opens compressed files for reading and writing.
Copyright (C) 2017 Alex Hyer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import unittest
import random
import time
import pickle
import warnings
from math import log, exp, pi, fsum, sin
from functools import reduce
from test import test_support
class TestBasicOps(unittest.TestCase):
# Superclass with tests common to all generators.
# Subclasses must arrange f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
try:
from _version import __version__
except ImportError:
__version__ = "0.1.a1"
readme = open('README.rst').read()
history = open('HISTOR... | unknown | codeparrot/codeparrot-clean | ||
/*!
* Bootstrap swipe.js v5.3.8 (https://getbootstrap.com/)
* Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
(function (global, factory) {
typeof exports === 'object' && typeof modu... | javascript | github | https://github.com/twbs/bootstrap | js/dist/util/swipe.js |
<?php
namespace Illuminate\Bus;
use Aws\DynamoDb\DynamoDbClient;
use Aws\DynamoDb\Marshaler;
use Carbon\CarbonImmutable;
use Closure;
use Illuminate\Support\Str;
class DynamoBatchRepository implements BatchRepository
{
/**
* The batch factory instance.
*
* @var \Illuminate\Bus\BatchFactory
*/... | php | github | https://github.com/laravel/framework | src/Illuminate/Bus/DynamoBatchRepository.php |
import numpy as np
from neupy.utils import format_data
from .base import BaseAssociative
__all__ = ('Kohonen',)
class Kohonen(BaseAssociative):
"""Kohonen unsupervised associative Neural Network.
This algorith similar to :network:`Instar`. Like the instar rule, the
Kohonen rule allows the weights of a ne... | 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 | build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPlugin.java |
# Copyright 2019 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | unknown | codeparrot/codeparrot-clean | ||
## \file
## \ingroup tutorial_pyroot
## \notebook
## Draw the geometry using the x3d viewver.
## Note that this viewver may also be invoked from the "View" menu in
## the canvas tool bar
##
## once in x3d viewer, type m to see the menu.
## For example typing r will show a solid model of this geometry.
##
## \macro_c... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# 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
... | unknown | codeparrot/codeparrot-clean | ||
import errno
import os
from datetime import datetime
from django.conf import settings
from django.core.exceptions import SuspiciousFileOperation
from django.core.files import File, locks
from django.core.files.move import file_move_safe
from django.utils._os import abspathu, safe_join
from django.utils.crypto import g... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Database;
use BadMethodCallException;
use Carbon\Carbon;
use Faker\Generator;
use Illuminate\Container\Container;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Database\Eloquent\Attributes\UseFactory;
use Illuminate\Data... | php | github | https://github.com/laravel/framework | tests/Database/DatabaseEloquentFactoryTest.php |
# Copyright 2022 The HuggingFace Inc. 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 appl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/deformable_detr/image_processing_deformable_detr.py |
# 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 optparse
import unittest
from telemetry import android
from telemetry import benchmark
from telemetry.testing import options_for_unittests
from telem... | unknown | codeparrot/codeparrot-clean | ||
import sys
import imp
import os
import subprocess
USER_TESTS = "userTests"
TEST_FAILED = "FAILED"
TEST_PASSED = "PASSED"
INPUT = "input"
OUTPUT = "output"
def get_index(logical_name, full_name):
logical_name_len = len(logical_name)
if full_name[:logical_name_len] == logical_name:
return int(full_na... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.