code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
"""Module for singleton pattern""" class Singleton(object): """ A non-thread-safe helper class to ease implementing singletons. This should be used as a decorator -- not a metaclass -- to the class that should be a singleton. The decorated class can define one `__init__` function that takes on...
unknown
codeparrot/codeparrot-clean
import copy import multiprocessing import unittest from unittest import mock from django.db import DEFAULT_DB_ALIAS, NotSupportedError, connection, connections from django.test import SimpleTestCase @unittest.skipUnless(connection.vendor == "sqlite", "SQLite tests") class TestDbSignatureTests(SimpleTestCase): def...
python
github
https://github.com/django/django
tests/backends/sqlite/test_creation.py
//// [tests/cases/compiler/baseClassImprovedMismatchErrors.ts] //// //// [baseClassImprovedMismatchErrors.ts] class Base { n: Base | string; fn() { return 10; } } class Derived extends Base { n: Derived | string; fn() { return 10 as number | string; } } class DerivedInterface im...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/baseClassImprovedMismatchErrors.js
#=========================================================================== # # EpochConverter # #=========================================================================== """EpochConverter module containing class EpochConverter.""" #=========================================================================== # Pla...
unknown
codeparrot/codeparrot-clean
import { readFileSync } from 'node:fs' import { fileURLToPath } from 'node:url' import { bench } from 'vitest' import * as CSS from './css-parser.ts' const currentFolder = fileURLToPath(new URL('..', import.meta.url)) const cssFile = readFileSync(currentFolder + './preflight.css', 'utf-8') bench('css-parser on prefl...
typescript
github
https://github.com/tailwindlabs/tailwindcss
packages/tailwindcss/src/css-parser.bench.ts
#!/usr/bin/env python import copy import operator import os import os.path import pickle import string import sys # Constant for C++ files. FILETYPE_CPP = 2 # Constant for DDDOC files. FILETYPE_DDDOC = 1 # Constant for none of the above. FILETYPE_OTHER = 0 SOURCE_ENCODING = 'iso8859-1' # Extension of C++ files. CPP...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Test links: # http://remixshare.com/download/p946u # # Note: # The remixshare.com website is very very slow, so # if your download not starts because of pycurl timeouts: # Adjust timeouts in /usr/share/pyload/module/network/HTTPRequest.py import re from module.plugins.internal.SimpleHoster...
unknown
codeparrot/codeparrot-clean
#see http://stackoverflow.com/questions/10391123/how-to-run-two-python-blocking-functions-matplotlib-show-and-twisted-reactor-r if __name__ == '__main__': from level1 import main raise SystemExit(main()) from matplotlib import use use('GTK') from matplotlib import pyplot from matplotlib.backends import backe...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2011 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/collect/TreeRangeMapTest.java
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z =...
unknown
codeparrot/codeparrot-clean
from mtpy.gui.SmartMT.visualization import MultipleMTResponses from tests.SmartMT import SmartMTGUITestCase, _click_area class TestGUIPlotMultipleMTResponse(SmartMTGUITestCase): def test_multiple_mt_response_compare_type_1(self): plot_config = self._switch_to_plot(MultipleMTResponses, 2) # type: MultipleMT...
unknown
codeparrot/codeparrot-clean
from django import forms from .models import * from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ import json class PersonnelForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput) class Meta: model = Personnel fields = ('Pe...
unknown
codeparrot/codeparrot-clean
""" Graph isomorphism functions. """ import networkx as nx from networkx.exception import NetworkXError __author__ = """\n""".join(['Aric Hagberg (hagberg@lanl.gov)', 'Pieter Swart (swart@lanl.gov)', 'Christopher Ellison cellison@cse.ucdavis.edu)']) # Copyright...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python from unittest import main, TestCase from cogent import LoadTree from cogent.parse.tree import DndParser from picrust.make_test_datasets import exclude_tip, yield_test_trees,\ make_distance_based_exclusion_fn, make_distance_based_tip_label_randomizer from collections import defaultdict """ Tests...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import logging from enum import Enum from io import BytesIO from typing import TYPE_CHECKING, Any from h2.errors import ErrorCodes from h2.exceptions import H2Error, ProtocolError, StreamClosedError from twisted.internet.defer import Deferred from twisted.internet.error import Conne...
python
github
https://github.com/scrapy/scrapy
scrapy/core/http2/stream.py
# 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
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v2beta1", "metadata": { "name": "v16.grid_layout_upgrade.v42" }, "spec": { "annotations": [ { "kind": "AnnotationQuery", "spec": { "query": { "kind": "DataQuery", "group": "grafana", ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v16.grid_layout_upgrade.v42.v2beta1.json
# Copyright (C) 2012,2013,2016 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of ...
unknown
codeparrot/codeparrot-clean
""" kombu.utils.finalize ==================== Execute cleanup handlers when objects go out of scope. Taken from :class:`multiprocessing.util.Finalize`. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import weakref from itertools im...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> #include <ngx_event.h> #include <ngx_iocp_module.h> static ngx_int_t ngx_iocp_init(ngx_cycle_t *cycle, ngx_msec_t timer); static ngx_thread_value_t __stdcall ngx_iocp_timer(void *data); static void ngx_iocp_...
c
github
https://github.com/nginx/nginx
src/event/modules/ngx_iocp_module.c
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ This module provides support for Twisted to interact with the PyGTK mainloop. In order to use this support, simply do the following:: | from twisted.internet import gtkreactor | gtkreactor.install() Then use twisted.inte...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2012-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-boot
buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/package-info.java
# Copyright 2013, Big Switch 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 applic...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ DNS server framework - intended to simplify creation of custom resolvers. Comprises the following components: DNSServer - socketserver wrapper (in most cases you should just need to pass this an appropriate resolver instance an...
unknown
codeparrot/codeparrot-clean
# 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
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { CachedSource, ConcatSource, RawSource } = require("webpack-sources"); const { UsageState } = require("./ExportsInfo"); const Template = require("./Template"); const CssModulesPlugin = require("./c...
javascript
github
https://github.com/webpack/webpack
lib/ModuleInfoHeaderPlugin.js
from __future__ import unicode_literals import copy import inspect import sys import warnings from itertools import chain from django.apps import apps from django.apps.config import MODELS_MODULE_NAME from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ER...
unknown
codeparrot/codeparrot-clean
from sklearn.neighbors import KNeighborsClassifier from .common import Benchmark, Estimator, Predictor from .datasets import _20newsgroups_lowdim_dataset from .utils import make_gen_classif_scorers class KNeighborsClassifierBenchmark(Predictor, Estimator, Benchmark): """ Benchmarks for KNeighborsClassifier. ...
python
github
https://github.com/scikit-learn/scikit-learn
asv_benchmarks/benchmarks/neighbors.py
# -*- coding: utf-8 -*- from fuel.datasets import H5PYDataset from fuel.transformers.defaults import uint8_pixels_to_floatX from fuel.utils import find_in_data_path class SVHN(H5PYDataset): """The Street View House Numbers (SVHN) dataset. SVHN [SVHN] is a real-world image dataset for developing machine le...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.server.engine import java.lang.reflect.* import java.net.* internal fun ClassLoader.allURLs(): Set<URL> { val parentUrls = parent?.allURLs() ?: emptySet() if (this is...
kotlin
github
https://github.com/ktorio/ktor
ktor-server/ktor-server-core/jvm/src/io/ktor/server/engine/ClassLoaders.kt
#include "jemalloc/internal/jemalloc_preamble.h" /* * The hooks are a little bit screwy -- they're not genuinely exported in the * sense that we want them available to end-users, but we do want them visible * from outside the generated library, so that we can use them in test code. */ JEMALLOC_EXPORT void (*test_h...
c
github
https://github.com/redis/redis
deps/jemalloc/src/test_hooks.c
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # Note: To use the 'upload' functionality of this file, you must: # $ pip install twine import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command # Package meta-data. NAME = 'prince' DESCRIPTION = 'Statistical factor...
unknown
codeparrot/codeparrot-clean
#! /usr/bin/python2 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys first = True s = 2e-5 eta_contour_levels = np.append(np.arange(-1e-4, 0, s), np.arange(s, 1e-4, s)) zoom_lat = True zoom_lat = False zoom_lat = 'eta' in sys.argv[1] fontsize=8 figsize=(9, 3)...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/clock/qcom,gcc-sm6115.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Qualcomm Global Clock & Reset Controller on SM6115 and SM4250 maintainers: - Iskren Chernev <iskren.chernev@gmail.com> ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/clock/qcom,gcc-sm6115.yaml
""" code from nanophotonics/npmie repository url: https://github.com/nanophotonics/npmie code by Alan Sanders modified to use in MSTM-studio by L.Aavakyan """ import numpy as np from mstm_studio.mstm_spectrum import Material try: from scipy.special import sph_jnyn except: from scipy.special import sp...
unknown
codeparrot/codeparrot-clean
{ "html": { "type": "Fragment", "start": 0, "end": 15, "children": [ { "type": "Element", "start": 0, "end": 15, "name": "!doctype", "attributes": [ { "type": "Attribute", "start": 10, "end": 14, "name": "html", "name_loc": { "start": { "...
json
github
https://github.com/sveltejs/svelte
packages/svelte/tests/parser-legacy/samples/elements/output.json
# -*- coding: utf-8 -*- from __future__ import with_statement import copy from cms.utils.urlutils import admin_reverse from django.contrib.sites.models import Site from cms.api import create_page from cms.models import Page, Placeholder from cms.utils import get_cms_setting from cms.test_utils.testcases import CMSTes...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "active_support/core_ext/module" require "action_view/model_naming" module ActionView # = Action View \Record \Identifier # # RecordIdentifier encapsulates methods used by various ActionView helpers # to associate records with DOM elements. # # Consider for example th...
ruby
github
https://github.com/rails/rails
actionview/lib/action_view/record_identifier.rb
from abc import abstractmethod, ABCMeta import logging from typing import Dict, Optional from ray.rllib.evaluation.episode import MultiAgentEpisode from ray.rllib.utils.typing import AgentID, EpisodeID, PolicyID, \ TensorType logger = logging.getLogger(__name__) class _SampleCollector(metaclass=ABCMeta): """...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-30 03:08 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion def 初始狀況表(app, editor): 狀況陣列 = [ "範例", "愛討論", "品質:講袂清楚", "品質:有...
unknown
codeparrot/codeparrot-clean
/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
go
github
https://github.com/kubernetes/kubernetes
pkg/controlplane/controller/leaderelection/election_test.go
import unittest from neo4j.v1 import basic_auth from evolvingdag.neo4j_connector import Neo4jConnector class Test(unittest.TestCase): """Tests Neo4jConnector TODO: basic auth is consistent with Travis' setup; use https://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travi...
unknown
codeparrot/codeparrot-clean
import unittest import bob.learn.boosting import numpy import bob import bob.learn.boosting.utils class TestBoosting(unittest.TestCase): """Class to test the LUT trainer """ def _data(self, digits = [3, 0], count = 20): self.database = bob.learn.boosting.utils.MNIST() # get the data inputs, targets...
unknown
codeparrot/codeparrot-clean
""" This module implements the upload and remove endpoints of the profile image api. """ from contextlib import closing import datetime import itertools import logging from django.utils.translation import ugettext as _ from django.utils.timezone import utc from rest_framework import permissions, status from rest_frame...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Daniel Korn <korndaniel1@gmail.com> # (c) 2017, Yaacov Zamir <yzamir@redhat.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__ = type ANSI...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # Copyright (C) 2007, 2008 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 applicabl...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
unknown
codeparrot/codeparrot-clean
#![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(miri)))] use tokio::io::AsyncReadExt; #[tokio::test] async fn repeat_poll_read_is_cooperative() { tokio::select! { biased; _ = async { loop { let mut buf = [0u8; 4096]; tokio::io::repeat(0b101)....
rust
github
https://github.com/tokio-rs/tokio
tokio/tests/io_repeat.rs
/* * The only function exported here is `PyArray_LegacyCanCastTypeTo`, which * is currently still in use when first registering a userdtype. * * The extremely limited use means that it can probably remain unmaintained * until such a time where legay user dtypes are deprecated and removed * entirely. */ #define N...
c
github
https://github.com/numpy/numpy
numpy/_core/src/multiarray/legacy_dtype_implementation.c
#!/usr/bin/env python # -*- coding: utf-8 -*- # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trademark of Inse...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Balazs Pocze <banyek@gawker.com> # Certain parts are taken from Mark Theunissen's mysqldb module # # 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 __metac...
unknown
codeparrot/codeparrot-clean
import { render } from "@testing-library/react"; import * as React from "react"; import { Links, Outlet, createRoutesStub } from "../../../index"; describe("<Links>", () => { describe("crossOrigin", () => { it("renders stylesheet links with crossOrigin attribute when provided", () => { let RoutesStub = cr...
typescript
github
https://github.com/remix-run/react-router
packages/react-router/__tests__/dom/ssr/links-test.tsx
# -*- coding: utf-8 -*- from __future__ import absolute_import from flask import abort import mongoengine from mongoengine.queryset import MultipleObjectsReturned, DoesNotExist, QuerySet from mongoengine.base import ValidationError from .sessions import * from .pagination import * def _include_mongoengine(obj): ...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, unescapeHTML, ) class TVN24IE(InfoExtractor): _VALID_URL = r'https?://(?:(?:[^/]+)\.)?tvn24(?:bis)?\.pl/(?:[^/]+/)*(?P<id>[^/]+)\.html' _TESTS = [{ 'url': 'http://www.tv...
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...
python
github
https://github.com/apache/airflow
airflow-core/src/airflow/example_dags/example_assets.py
<?php namespace Illuminate\View\Compilers\Concerns; trait CompilesIncludes { /** * Compile the each statements into valid PHP. * * @param string $expression * @return string */ protected function compileEach($expression) { return "<?php echo \$__env->renderEach{$expressi...
php
github
https://github.com/laravel/framework
src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php
ktor: deployment: port : 4244
unknown
github
https://github.com/ktorio/ktor
ktor-server/ktor-server-core/jvm/test-resources/custom.config.yaml
# # euc_jp.py: Python Unicode Codec for EUC_JP # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jp') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
unknown
codeparrot/codeparrot-clean
package local // This package contains the legacy in-proc calls in HCS using the v1 schema // for Windows runtime purposes. import ( "context" "fmt" "io" "os" "path/filepath" "regexp" "runtime" "strings" "sync" "syscall" "time" "github.com/Microsoft/hcsshim" containerd "github.com/containerd/containerd/...
go
github
https://github.com/moby/moby
daemon/internal/libcontainerd/local/local_windows.go
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
unknown
codeparrot/codeparrot-clean
.content { @apply text-lg leading-relaxed; } .content p, .content ul, .content ol, .content blockquote { @apply my-6; } .content a { @apply underline; } .content ul, .content ol { @apply pl-4; } .content ul { @apply list-disc; } .content ol { @apply list-decimal; } .content ul > li > ul, .content ol >...
css
github
https://github.com/vercel/next.js
examples/cms-drupal/components/post-body.module.css
# Copyright 2019 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/einsum_op_test.py
from tornado import websocket, web, ioloop import json import motor cl = [] commands = {"left": motor.left, "right": motor.right, "forward": motor.forward, "reverse": motor.reverse, "stop": motor.stop, "exit": motor.cleanup } class IndexHandler(web.RequestHandle...
unknown
codeparrot/codeparrot-clean
import {Component} from '@angular/core'; import {RouterOutlet} from '@angular/router'; @Component({ selector: 'app-root', template: ` <nav> <a href="/">Home</a> | <a href="/user">User</a> </nav> <router-outlet /> `, imports: [RouterOutlet], }) export class App {}
typescript
github
https://github.com/angular/angular
adev/src/content/tutorials/learn-angular/steps/12-enable-routing/answer/src/app/app.ts
/* Unobtrusive JavaScript https://github.com/rails/rails/blob/main/actionview/app/javascript Released under the MIT license */ const linkClickSelector = "a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]"; const buttonClickSelector = { selector: "button[data-remo...
javascript
github
https://github.com/rails/rails
actionview/app/assets/javascripts/rails-ujs.esm.js
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
// Copyright 2011 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be...
c
github
https://github.com/opencv/opencv
3rdparty/libwebp/src/enc/analysis_enc.c
"""Bisection algorithms.""" def insort_right(a, x, lo=0, hi=None): """Insert item x in list a, and keep it sorted assuming a is sorted. If x is already in a, insert it to the right of the rightmost x. Optional args lo (default 0) and hi (default len(a)) bound the slice of a to be searched. """ ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='PayPalIPN', fields=[ ('id', models.AutoField(ver...
unknown
codeparrot/codeparrot-clean
{ "name": "@tailwindcss/oxide-darwin-x64", "version": "4.1.18", "repository": { "type": "git", "url": "git+https://github.com/tailwindlabs/tailwindcss.git", "directory": "crates/node/npm/darwin-x64" }, "os": [ "darwin" ], "cpu": [ "x64" ], "main": "tailwindcss-oxide.darwin-x64.node...
json
github
https://github.com/tailwindlabs/tailwindcss
crates/node/npm/darwin-x64/package.json
#!/bin/bash set -euxo pipefail export DEBIAN_FRONTEND=noninteractive curl -L --proto '=https' --tlsv1.2 -sSf \ https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh \ | bash cargo binstall cargo-nextest --secure apt-get update apt-get -y install --no-install-recommends ...
unknown
github
https://github.com/vercel/next.js
.devcontainer/rust/install.sh
# oppia/templatetags/display_functions.py import hashlib import json import math import urllib from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe register = template.Library() @register.filter(name='get_index') def get_index(start,index):...
unknown
codeparrot/codeparrot-clean
from homeassistant.helpers.entity import Entity import voluptuous as vol import homeassistant.components.remote as remote import homeassistant.helpers.config_validation as cv from homeassistant.components.remote import (DOMAIN) DATA_BROADLINK = 'broadlink' DEPENDENCIES = ['broadlink'] SERVICE_LEARN = 'broadlink_lear...
unknown
codeparrot/codeparrot-clean
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v2alpha1", "metadata": { "name": "v4.no-op.v42" }, "spec": { "annotations": [ { "kind": "AnnotationQuery", "spec": { "datasource": { "type": "grafana", "uid": "-- Grafana --" }...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v4.no-op.v42.v2alpha1.json
# frozen_string_literal: true class Wheel < ActiveRecord::Base belongs_to :wheelable, polymorphic: true, counter_cache: true, touch: :wheels_owned_at end
ruby
github
https://github.com/rails/rails
activerecord/test/models/wheel.rb
# Copyright (c) 2006 The Regents of The University of Michigan # 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 ...
unknown
codeparrot/codeparrot-clean
test_kind: fsm_workload_test selector: roots: - jstests/concurrency/fsm_workloads/**/*.js - src/mongo/db/modules/*/jstests/concurrency/fsm_workloads/*.js exclude_files: # SERVER-14669 Multi-removes that use $where miscount removed documents # Disabled due to MongoDB restrictions and/or workload re...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/suites/concurrency_sharded_replication_with_balancer.yml
"""Aggregate_tracefiles module. This script aggregates several tracefiles into one tracefile. All but the last argument are input tracefiles or .txt files which list tracefiles. The last argument is the tracefile to which the output will be written. """ import os import subprocess import sys from optparse import Opti...
python
github
https://github.com/mongodb/mongo
buildscripts/aggregate_tracefiles.py
from __future__ import unicode_literals import warnings from functools import partial from operator import attrgetter from django import forms from django.apps import apps from django.core import checks, exceptions from django.core.exceptions import FieldDoesNotExist from django.db import connection, connections, rou...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, Inc. # # 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 #...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2017 OSGeo # # 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 ...
unknown
codeparrot/codeparrot-clean
# mysql/__init__.py # Copyright (C) 2005-2016 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 from . import base, mysqldb, oursql, \ pyodbc, zxjdbc, mysqlconnector, pymysql...
unknown
codeparrot/codeparrot-clean
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") else: access = Serv...
unknown
codeparrot/codeparrot-clean
import os from functools import wraps from django.template.engine import Engine from django.test.utils import override_settings from django.utils.safestring import mark_safe ROOT = os.path.dirname(os.path.abspath(__file__)) TEMPLATE_DIR = os.path.join(ROOT, "templates") def setup(templates, *args, test_once=False, d...
python
github
https://github.com/django/django
tests/template_tests/utils.py
# This file is part of Androguard. # # Copyright (C) 2012, Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # 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:/...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 // The version package provides a location to set the release versions for all // packages to consume, without creating import cycles. // // This package should not import any other terraform packages. package version import ( _ "embed" "fmt" "s...
go
github
https://github.com/hashicorp/terraform
version/version.go
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-07-25 20:51 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('campaign', '0003_auto_20160725_2119'), ] operations ...
unknown
codeparrot/codeparrot-clean
/* Copyright 2019 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/admissionregistration/v1beta1/defaults_test.go
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse from ..utils import ( ExtractorError, sanitized_Request, ) class PrimeShareTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?primeshare\.tv/download/(?P<id>[\da-zA-Z]+)' _TEST = { ...
unknown
codeparrot/codeparrot-clean
"""This is a second, slightly harder problem on the same theme as the first.""" # This is for Python 3 import html as html_converter # for Python 2 uncomment this line #import cgi as html_converter class HtmlPagesConverter: def __init__(self, filename): """Read the file and note the positions of the pag...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # SelfTest/Protocol/test_KDF.py: Self-test for key derivation functions # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is...
unknown
codeparrot/codeparrot-clean
#!/bin/sh # # Copyright (c) 2008 Deskin Miller # test_description='git svn partial-rebuild tests' . ./lib-git-svn.sh test_expect_success 'initialize svnrepo' ' mkdir import && ( (cd import && mkdir trunk branches tags && (cd trunk && echo foo > foo ) && svn_cmd import -m "import for git-svn" . "$svnrep...
unknown
github
https://github.com/git/git
t/t9127-git-svn-partial-rebuild.sh
/* * 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 ...
kotlin
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/kotlin/org/springframework/docs/web/webfluxfnhandlerclasses/Person.kt
from django.core.management.base import BaseCommand class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument("--list", action="store_true", help="Print all options") def handle(self, *args, **options): pass
python
github
https://github.com/django/django
tests/bash_completion/management/commands/test_command.py
name: 🐛 Bug Report description: Create a report to help us reproduce and fix the bug body: - type: markdown attributes: value: > #### Before submitting, please review the [contribution guide](https://github.com/pytorch/pytorch/wiki/The-Ultimate-Guide-to-PyTorch-Contributions) and [AI-Assisted Development]...
unknown
github
https://github.com/pytorch/pytorch
.github/ISSUE_TEMPLATE/bug-report.yml
/*! * 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...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/src/components/SearchDags/SearchDags.tsx