code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
/* Copyright 2017 - 2025 R. Thomas * Copyright 2017 - 2025 Quarkslab * * 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 req...
cpp
github
https://github.com/nodejs/node
deps/LIEF/src/ELF/NoteDetails/core/CoreAuxv.cpp
""" Tests sklearn matrix decomposition converters """ import unittest import warnings import sys from distutils.version import LooseVersion import numpy as np import torch import sklearn from sklearn.decomposition import FastICA, KernelPCA, PCA, TruncatedSVD from sklearn.model_selection import train_test_split from sk...
unknown
codeparrot/codeparrot-clean
# example.js ```javascript const inc = require("./increment").increment; var a = 1; inc(a); // 2 ``` # increment.js ```javascript const add = require("./math").add; exports.increment = function increment(val) { return add(val, 1); }; exports.incrementBy2 = function incrementBy2(val) { return add(val, 2); }; export...
unknown
github
https://github.com/webpack/webpack
examples/cjs-tree-shaking/README.md
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, 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 the fol...
cpp
github
https://github.com/opencv/opencv
3rdparty/openexr/IlmImf/ImfTimeCode.cpp
import React from "react"; import { formatRelative, subDays } from "date-fns"; const Component = ({ locale }) => ( <div style={{ border: "5px solid darkred" }}> <p>I'm a Component exposed from container C!</p> <p> Using date-fn in Remote:{" "} {formatRelative(subDays(new Date(), 3), new Date(), { locale })}...
javascript
github
https://github.com/webpack/webpack
examples/module-federation/src-c/Component.js
//! A Collection of Header implementations for common HTTP Headers. //! //! ## Mime Types //! Several header fields use MIME values for their contents. Keeping with the strongly-typed theme, //! the [mime] crate is used in such headers as [`ContentType`] and [`Accept`]. use std::fmt; // re-export from actix-http // -...
rust
github
https://github.com/actix/actix-web
actix-web/src/http/header/mod.rs
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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 witho...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (C) 2014 Canonical # # Authors: # Didier Roche # # 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; version 3. # # This program is distributed in the hope that ...
unknown
codeparrot/codeparrot-clean
# pkg-config overrides for RHEL 7 and CentOS 7 RHEL 7 and CentOS 7 do not provide pkg-config `.pc` files for Tcl/Tk. The OpenSSL 1.1.1 pkg-config file is named `openssl11.pc` and not picked up by Python's `configure` script. To build Python with system Tcl/Tk libs and OpenSSL 1.1 package, first install the develope...
unknown
github
https://github.com/python/cpython
Misc/rhel7/README.md
from sqlobject import * from sqlobject.tests.dbtest import * class myid_sqlmeta(sqlmeta): idName = "my_id" class TestSqlmeta1(SQLObject): class sqlmeta(myid_sqlmeta): pass class TestSqlmeta2(SQLObject): class sqlmeta(sqlmeta): style = MixedCaseStyle(longID=True) class TestSqlmeta3(SQLObj...
unknown
codeparrot/codeparrot-clean
{ "private": true, "scripts": { "dev": "next", "build": "next build", "start": "next start", "toolbox": "react-toolbox-themr" }, "dependencies": { "classnames": "^2.2.5", "next": "latest", "react": "^18.2.0", "react-addons-css-transition-group": "^15.5.2", "react-dom": "^18.2...
json
github
https://github.com/vercel/next.js
examples/with-react-toolbox/package.json
// Copyright 2019 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package sql_test import ( "context" gosql "database/sql" "strings" "testing" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/kv...
go
github
https://github.com/cockroachdb/cockroach
pkg/sql/unsplit_test.go
import struct from pymod.constants import * from pymod.module import * from pymod.tables import * from pymod.util import * MOD_TYPES = ( ('M.K.', 'Amiga-NewTracker', 4), ('M!K!', 'Amiga-ProTracker', 4), ('M&K!', 'Amiga-NoiseTracker', 4), ('N.T.', 'Amiga-NoiseTracker?', 4), # ???, mentioned in libMod...
unknown
codeparrot/codeparrot-clean
/*[clinic input] preserve [clinic start generated code]*/ #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) # include "pycore_gc.h" // PyGC_Head # include "pycore_runtime.h" // _Py_ID() #endif #include "pycore_abstract.h" // _PyNumber_Index() #include "pycore_modsupport.h" // _PyArg_U...
c
github
https://github.com/python/cpython
Modules/clinic/_interpqueuesmodule.c.h
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT use crate::cli::Args; use anyhow::Error; use futures_util::TryFutureExt; use http_body_util::{BodyExt, Full}; use hyper::{ body::{Bytes, Incoming}, header::CONTENT_LENGTH, ...
rust
github
https://github.com/tauri-apps/tauri
crates/tauri-driver/src/server.rs
import os import socket from django.utils.translation import ugettext_lazy as _ from .base import * # noqa SERVER_ENV = os.getenv('DJANGO_SERVER_ENV') SECRET_KEY = os.getenv('SECRET_KEY') DEBUG = TEMPLATE_DEBUG = False ALLOWED_HOSTS = [ # the server's IP (for monitors) socket.gethostbyname(socket.gethostnam...
unknown
codeparrot/codeparrot-clean
/* * An async IO implementation for Linux * Written by Benjamin LaHaise <bcrl@kvack.org> * * Implements an efficient asynchronous io interface. * * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved. * Copyright 2018 Christoph Hellwig. * * See ../COPYING for licensing terms. */ #define pr_fmt(fmt) ...
c
github
https://github.com/torvalds/linux
fs/aio.c
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
unknown
codeparrot/codeparrot-clean
import lightblue from nxt import Motor, find_one_brick, PORT_A, PORT_B, PORT_C, PORT_1, PORT_2, PORT_3, PORT_4 from nxt.sensor import Touch, Sound, Ultrasonic, Light from time import sleep class PortMap(dict): def __init__(self, ports, factory): self.factory = factory self.ports = ports def __m...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true module ActiveRecord # This is a thread locals registry for Active Record. For example: # # ActiveRecord::RuntimeRegistry.stats.sql_runtime # # returns the connection handler local to the current unit of execution (either thread of fiber). module RuntimeRegistry # :nodoc: ...
ruby
github
https://github.com/rails/rails
activerecord/lib/active_record/runtime_registry.rb
#!/usr/bin/python # # -*- coding: utf-8 -*- # # Copyright (c) 2012--2015 Red Hat, Inc. # # Lookup package dependencies in a yum repository # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied w...
unknown
codeparrot/codeparrot-clean
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2019 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
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...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/src/components/Graph/JoinNode.tsx
# encoding: utf-8 """Tests for traitlets.traitlets.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. # # Adapted from enthought.traits, Copyright (c) Enthought, Inc., # also under the terms of the Modified BSD License. import pickle import re import sys from ._wa...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * dest.c * support for communication destinations * * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backen...
c
github
https://github.com/postgres/postgres
src/backend/tcop/dest.c
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing_extensions import Literal, Required, TypedDict __all__ = ["ResponseFormatText"] class ResponseFormatText(TypedDict, total=False): """Default response format. Used to generate text...
python
github
https://github.com/openai/openai-python
src/openai/types/shared_params/response_format_text.py
/* * 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-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java
lazy import test.test_import.data.lazy_imports.basic2 as basic2 def f(): x = globals() return x['basic2'].resolve() f()
python
github
https://github.com/python/cpython
Lib/test/test_import/data/lazy_imports/lazy_get_value.py
#ifndef __HIREDIS_IVYKIS_H__ #define __HIREDIS_IVYKIS_H__ #include <iv.h> #include "../hiredis.h" #include "../async.h" typedef struct redisIvykisEvents { redisAsyncContext *context; struct iv_fd fd; } redisIvykisEvents; static void redisIvykisReadEvent(void *arg) { redisAsyncContext *context = (redisAsyn...
c
github
https://github.com/redis/redis
deps/hiredis/adapters/ivykis.h
## Description: class NeuroML for loading NeuroML from single file into MOOSE ## Version 1.0 by Aditya Gilra, NCBS, Bangalore, India, 2011 for serial MOOSE ## Version 1.5 by Niraj Dudani, NCBS, Bangalore, India, 2012, ported to parallel MOOSE ## Version 1.6 by Aditya Gilra, NCBS, Bangalore, India, 2012, further changes...
unknown
codeparrot/codeparrot-clean
from urllib import urlencode import six from requests_oauthlib import OAuth1 from social.backends.oauth import BaseOAuth2 class NKOAuth2(BaseOAuth2): """NK OAuth authentication backend""" name = 'nk' AUTHORIZATION_URL = 'https://nk.pl/oauth2/login' ACCESS_TOKEN_URL = 'https://nk.pl/oauth2/token' ...
unknown
codeparrot/codeparrot-clean
import math import numpy def normalise(a): ''' Normalises a vector Accepts: a numpy vector Returns: a numpy vector pointing in the same direction with magnitude 1 ''' a_norm = numpy.linalg.norm(a) return numpy.array([float(each)/a_norm for each in a]) def rotation_axis_angle(axis, angle): ...
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/models/referencemixin.py
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package vault import ( "context" "testing" "time" "github.com/hashicorp/vault/version" ) // TestVersionStore_StoreMultipleVaultVersions writes multiple versions of 1.9.0 and verifies that only // the original timestamp is stored. func TestVe...
go
github
https://github.com/hashicorp/vault
vault/version_store_test.go
""" differential_evolution: The differential evolution global optimization algorithm Added by Andrew Nelson 2014 """ from __future__ import division, print_function, absolute_import import numpy as np from scipy.optimize import OptimizeResult, minimize from scipy.optimize.optimize import _status_message import numbers ...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.test.test_udp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorUDP} and L{IReactorMulticast}. """ from twisted.trial import unittest from twisted.internet.defer import Deferred, gatherResults, maybeDeferred from twist...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 """ Very basic player.dat inspection script """ import os import sys import argparse from pathlib import Path # incantation to be able to import overviewer_core if not hasattr(sys, "frozen"): sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0], '..'))) from overviewe...
unknown
codeparrot/codeparrot-clean
/* Copyright 2014 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/kubeapiserver/options/plugins.go
/* * 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-cloud-storage-project/hadoop-tos/src/test/java/org/apache/hadoop/fs/tosfs/object/tos/auth/TestSimpleCredentialsProvider.java
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2004 José Matos <jamatos@lyx.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- '''Define model res.partner.relation''' ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it a...
unknown
codeparrot/codeparrot-clean
# Copyright 2016 Mellanox Technologies, Ltd # # 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...
unknown
codeparrot/codeparrot-clean
"""A generally useful event scheduler class. Each instance of this class manages its own queue. No multi-threading is implied; you are supposed to hack that yourself, or use a single instance per application. Each instance is parametrized with two functions, one that is supposed to return the current time, one that i...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # 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 argparse from functools import partial, reduce import json import operator import os impo...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # 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 # witho...
unknown
codeparrot/codeparrot-clean
import urllib.request as ur import http.client import sys def get_realm(ip): realm_router = "" try: conn = http.client.HTTPConnection(ip) conn.request("GET", "/") res = conn.getresponse() realm_router = res.getheader("WWW-Authenticate") realm_router = realm_router.split(...
unknown
codeparrot/codeparrot-clean
# Copyright 2011,2012 James McCauley # # 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 ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python __all__ = ['veoh_download'] from ..common import * import urllib.error def veoh_download(url, output_dir = '.', merge = False, info_only = False, **kwargs): '''Get item_id''' if re.match(r'http://www.veoh.com/watch/\w+', url): item_id = match1(url, r'http://www.veoh.com/watch/(\...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import json from django.contrib.gis.geos import LinearRing, Point, Polygon from django.core import serializers from django.test import TestCase, mock, skipUnlessDBFeature from django.utils import six from .models import City, MultiFields, PennsylvaniaCity @skipUnlessDBFeature...
unknown
codeparrot/codeparrot-clean
/*! * @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 {AppComponent} from './app.component'; import {provideRouter, ...
typescript
github
https://github.com/angular/angular
adev/src/app/app.component.spec.ts
from __future__ import unicode_literals from __future__ import absolute_import from functools import reduce import logging from docker.errors import APIError from .config import get_service_name_from_net, ConfigurationError from .const import DEFAULT_TIMEOUT, LABEL_PROJECT, LABEL_SERVICE, LABEL_ONE_OFF from .containe...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # Copyright 2013 Google 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 # (at your option) any later vers...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python from distutils.core import setup, Extension import glob #from compiler.pycodegen import compileFile #import distutils #import distutils.sysconfig #import distutils.core import os NAME='pyfann' VERSION='2.0.0' LONG_DESCRIPTION="""\ Fast Artificial Neural Network Library implements multilayer artific...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class OrTest < Arel::Spec describe "#or" do it "makes an OR node" do attr = Table.new(:users)[:id] left = attr.eq(10) right = attr.eq(11) node = left.or right _(n...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/arel/nodes/or_test.rb
-- int4 check CREATE TABLE int4tmp (a int4); \copy int4tmp from 'data/int2.data' SET enable_seqscan=on; SELECT count(*) FROM int4tmp WHERE a < 237; SELECT count(*) FROM int4tmp WHERE a <= 237; SELECT count(*) FROM int4tmp WHERE a = 237; SELECT count(*) FROM int4tmp WHERE a >= 237; SELECT count(*) FROM int4tmp...
sql
github
https://github.com/postgres/postgres
contrib/btree_gist/sql/int4.sql
# frozen_string_literal: true module Arel # :nodoc: all module Visitors class Dot < Arel::Visitors::Visitor class Node # :nodoc: attr_accessor :name, :id, :fields def initialize(name, id, fields = []) @name = name @id = id @fields = fields end ...
ruby
github
https://github.com/rails/rails
activerecord/lib/arel/visitors/dot.rb
//Backgrounds colors $bg-transparent: transparent !default; $bg-basic-color: #ffffff !default; $bg-basic-color-active: #cccccc !default; $bg-light-gray: #f7f7f7 !default; $bg-light-gray-active: #dadada !default; $bg-blue: #89c6cc; $bg-blue-active: #15909c !default; $bg-submenu: #edebeb !default; $bg-submenu-active: #f6...
unknown
github
https://github.com/vercel/next.js
examples/cms-sitecore-xmcloud/src/assets/sass/abstracts/vars/_colors.scss
/* * 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/clients-integration-tests/src/test/java/org/apache/kafka/clients/ClientRebootstrapTest.java
/* Copyright 2014 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/scheduler/scheduler_test.go
############################################################################### # kBaseGenbankToGFF.py # Copyright (c) 2017, Joshua J Hamilton and Katherine D McMahon # Affiliation: Department of Bacteriology # University of Wisconsin-Madison, Madison, Wisconsin, USA # URL: http://http://mcmahonlab.wisc.ed...
unknown
codeparrot/codeparrot-clean
from openerp.tests.common import TransactionCase class TestOnchangeProductId(TransactionCase): """Test that when an included tax is mapped by a fiscal position, the included tax must be subtracted to the price of the product. """ def setUp(self): super(TestOnchangeProductId, self).setUp() ...
unknown
codeparrot/codeparrot-clean
"""Question-answering with sources over an index.""" from typing import Any from langchain_core.callbacks import ( AsyncCallbackManagerForChainRun, CallbackManagerForChainRun, ) from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever from pydantic import Field from l...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/chains/qa_with_sources/retrieval.py
var app = require('../../examples/route-separation') var request = require('supertest') describe('route-separation', function () { describe('GET /', function () { it('should respond with index', function (done) { request(app) .get('/') .expect(200, /Route Separation Example/, done) }) }) ...
javascript
github
https://github.com/expressjs/express
test/acceptance/route-separation.js
# 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
# -*- coding: utf-8 -*- """ *************************************************************************** AddScriptFromTemplateAction.py --------------------- Date : August 2012 Copyright : (C) 2018 by Matteo Ghetta Email : matteo dot ghetta at gmail dot com ...
unknown
codeparrot/codeparrot-clean
import {Component} from '@angular/core'; import {HEROES} from './mock-heroes'; import {HeroListEnterLeave} from './hero-list-enter-leave'; @Component({ selector: 'app-hero-list-enter-leave-page', template: ` <section> <h2>Enter/Leave</h2> <app-hero-list-enter-leave [heroes]="heroes" ...
typescript
github
https://github.com/angular/angular
adev/src/content/examples/animations/src/app/hero-list-enter-leave-page.ts
from django.core.management.base import BaseCommand from django.db.models import F from django.utils.translation import ugettext as _ from oioioi.problems.models import Problem from oioioi.programs.models import ModelProgramSubmission class Command(BaseCommand): help = str( _( "Prints problems ...
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/tests/unit/cli/commands/test_api_server_command.py
""" Unit tests for \ landlab.components.soil_moisture.soil_moisture_dynamics """ import numpy as np import pytest from numpy.testing import assert_array_almost_equal (_SHAPE, _SPACING, _ORIGIN) = ((20, 20), (10e0, 10e0), (0.0, 0.0)) _ARGS = (_SHAPE, _SPACING, _ORIGIN) def test_name(sm): assert sm.name == "Soi...
unknown
codeparrot/codeparrot-clean
#!/bin/sh test_description='read-tree -m -u checks working tree files' GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh # two-tree test test_expect_success 'two-way setup' ' mkdir subdir && echo >file1 file one && echo >f...
unknown
github
https://github.com/git/git
t/t1004-read-tree-m-u-wf.sh
package conversion import ( "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/runtime" dashv0 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" dashv1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1" dashv2alpha1 "github.com/grafana/grafana/apps/dashboard/p...
go
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/conversion.go
""" This simple code is desinged to teach a basic user to read in the files in python, simply find what proportion of males and females survived and make a predictive model based on this Author : AstroDave Date : 18 September 2012 Revised: 28 March 2014 """ import csv as csv import numpy as np csv_file_object = csv....
unknown
codeparrot/codeparrot-clean
/* 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 applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/lite/kernels/cpu_backend_gemm_eigen.h
"""Concrete date/time and related types -- prototype implemented in Python. See http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage See also http://dir.yahoo.com/Reference/calendars/ For a primer on DST, including many current DST rules, see http://webexhibits.org/daylightsaving/ For more about DST than you e...
unknown
codeparrot/codeparrot-clean
// Copyright 2011 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 zip import ( "bytes" "compress/flate" "encoding/binary" "fmt" "hash/crc32" "io" "io/fs" "math/rand" "os" "strings" "testing" "testing/fstes...
go
github
https://github.com/golang/go
src/archive/zip/writer_test.go
#! /usr/bin/env python # Script to convert grounding files in TSV format to binary format for dimmwitted sampler # Usage: python tobinary.py [input folder] transform_script [output folder] # It split the specific files in the input folder and for each of them calls the C++ binary to convert the format import sys impo...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # import necessary library. import threading import sys import rados import socket import time import os import getopt # create an interface class. class multithread (threading.Thread): # define init process. def __init__(self, threadID, name, size, number): threading.Thread.__init__(self) # t...
unknown
codeparrot/codeparrot-clean
@import url('https://fonts.googleapis.com/icon?family=Material+Symbols+Outlined'); :host { display: flex; justify-content: center; font-family: var(--inter-font, system-ui, sans-serif); --border-color: color-mix(in srgb, var(--full-contrast, #000) 20%, var(--page-background, #fff)); --primary: var(--vivid-pi...
css
github
https://github.com/angular/angular
adev/src/content/examples/aria/combobox/src/dialog/material/app/app.css
import scrapy from scrapy.crawler import CrawlerProcess class AsyncioReactorSpider1(scrapy.Spider): name = "asyncio_reactor1" custom_settings = { "TWISTED_REACTOR": "twisted.internet.asyncioreactor.AsyncioSelectorReactor", } class AsyncioReactorSpider2(scrapy.Spider): name = "asyncio_reactor2"...
python
github
https://github.com/scrapy/scrapy
tests/CrawlerProcess/twisted_reactor_custom_settings_same.py
- assert: that: - 'secret_var == "secret"' - copy: src=vault-secret.txt dest={{output_dir}}/secret.txt - name: cleanup decrypted file file: path={{ output_dir }}/secret.txt state=absent
unknown
github
https://github.com/ansible/ansible
test/integration/targets/ansible-vault/roles/test_vault/tasks/main.yml
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import cint, flt, cstr from webnotes import msgprint, _ import webnotes.defaults from controllers.accounts_contr...
unknown
codeparrot/codeparrot-clean
/********************************************************************* * Filename: sha256.c * Author: Brad Conte (brad AT bradconte.com) * Copyright: * Disclaimer: This code is presented "as is" without any guarantees. * Details: Implementation of the SHA-256 hashing algorithm. SHA-256 is one of ...
c
github
https://github.com/redis/redis
src/sha256.c
//===--- ThreadSafeRefCounted.h - Thread-safe Refcounting Base --*- 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/Basic/ThreadSafeRefCounted.h
from django.db import models class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) class Bar(models.Model): name = models.CharField(max_length=50) normal = models.ForeignKey(Foo, models.CASCADE, related_name="normal_foo") fwd = models....
python
github
https://github.com/django/django
tests/string_lookup/models.py
/* * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.analysis.api.fir.diagnostics import com.intellij.psi.PsiElement import org.jetbr...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/diagnostics/KaCompilerPluginDiagnosticImpl.kt
@file:JvmMultifileClass @file:JvmName("FlowKt") @file:Suppress("UNCHECKED_CAST") package kotlinx.coroutines.flow import kotlinx.coroutines.* import kotlinx.coroutines.flow.internal.* import kotlin.jvm.* // ------------------ WARNING ------------------ // These emitting operators must use safe flow builder, because...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/common/src/flow/operators/Emitters.kt
from __future__ import unicode_literals import datetime import re from itertools import chain from django.conf import settings from django.db import models from django.db.migrations import operations from django.db.migrations.migration import Migration from django.db.migrations.operations.models import AlterModelOpti...
unknown
codeparrot/codeparrot-clean
# Copyright 2007 Matt Chaput. 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 list of conditions and the...
unknown
codeparrot/codeparrot-clean
# Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com> # # 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)...
unknown
codeparrot/codeparrot-clean
## Input ```javascript function Component() { let callback = () => { callback = null; }; return <div onClick={callback} />; } ``` ## Error ``` Found 1 error: Error: Cannot reassign variable after render completes Reassigning `callback` after render has completed can cause inconsistent behavior on subseq...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.function-expression-references-variable-its-assigned-to.expect.md
# ssh_server_known_e SSH_SERVER_ERROR = -1 SSH_SERVER_NOT_KNOWN = 0 SSH_SERVER_KNOWN_OK = 1 SSH_SERVER_KNOWN_CHANGED = 2 SSH_SERVER_FOUND_OTHER = 3 SSH_SERVER_FILE_NOT_FOUND = 4 # ssh_options_e SSH_OPTIONS_HOST = 0x0 SSH_OPTIONS_PORT = 0x1 SSH_OPTIONS_PORT_STR ...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 Intel Corporation # 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 require...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.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 ANSIBLE_METADATA = {'metadata_version'...
unknown
codeparrot/codeparrot-clean
# Twisted, the Framework of Your Internet # Copyright (C) 2001-2002 Matthew W. Lefkowitz # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed i...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import typing as t from contextvars import ContextVar from werkzeug.local import LocalProxy if t.TYPE_CHECKING: # pragma: no cover from .app import Flask from .ctx import _AppCtxGlobals from .ctx import AppContext from .sessions import SessionMixin from .wrappe...
python
github
https://github.com/pallets/flask
src/flask/globals.py
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
unknown
codeparrot/codeparrot-clean
# torch.mtia.mtia_graph The MTIA backend is implemented out of the tree, only interfaces are defined here. ```{eval-rst} .. automodule:: torch.mtia.mtia_graph ``` ```{eval-rst} .. currentmodule:: torch.mtia.mtia_graph ``` ```{eval-rst} .. autofunction:: graph_pool_handle ``` ```{eval-rst} .. autoclass:: MTIAGraph ...
unknown
github
https://github.com/pytorch/pytorch
docs/source/mtia.mtia_graph.md