code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
import six from chainer import backend from chainer import function_node from chainer.utils import type_check def _normalize_axis_tuple(axis, ndim): ret = [] for ax in axis: ret.append(ax % ndim) return ret def _moveaxis(a, source, destination, xp): if hasattr(xp, 'moveaxis'): return ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python import xmlrpclib import socket plc_host='www.planet-lab.eu' slice_name='certhple_purs1' auth = { 'AuthMethod' : 'password', 'Username' : '<planetlab user name>', 'AuthString' : '<planetlab user passwd>', } api_url="https://%s:443/PLCAPI/"%plc_host plc_api = xmlrpclib.Server...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2026 the HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/glm_ocr.md
# frozen_string_literal: true require "cases/helper" require "models/post" require "models/author" require "models/comment" require "models/rating" require "models/member" require "models/member_type" require "models/pirate" require "models/treasure" require "models/parrot" require "models/hotel" require "models/de...
ruby
github
https://github.com/rails/rails
activerecord/test/cases/associations/has_many_through_disable_joins_associations_test.rb
import cStringIO, zipfile from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = cStringIO.StringIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('doc....
unknown
codeparrot/codeparrot-clean
"""Alignment with SNAP: http://snap.cs.berkeley.edu/ """ import os from bcbio import bam, utils from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import config_utils from bcbio.ngsalign import novoalign, postalign from bcbio.provenance import do def align(fastq_file, pair_file, index_dir,...
unknown
codeparrot/codeparrot-clean
import {browser, by, element} from 'protractor'; import {bootstrapClientApp, navigateTo, verifyNoBrowserErrors} from './util'; describe('App E2E Tests', () => { beforeEach(async () => { // Don't wait for Angular since it is not bootstrapped automatically. await browser.waitForAngularEnabled(false); // L...
typescript
github
https://github.com/angular/angular
integration/platform-server-hydration/e2e/src/app.e2e-spec.ts
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package forwarding import ( "bufio" "bytes" "net/http" "os" "reflect" "testing" ) func Test_ForwardedRequest_GenerateParse(t *testing.T) { testForwardedRequestGenerateParse(t) } func Benchmark_ForwardedRequest_GenerateParse_JSON(b *testin...
go
github
https://github.com/hashicorp/vault
helper/forwarding/util_test.go
/* * Copyright 2020 Google LLC * * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file or at * https://developers.google.com/open-source/licenses/bsd */ #ifndef REFTABLE_WRITER_H #define REFTABLE_WRITER_H #include "reftable-record.h" #include <stdint.h> #include <...
c
github
https://github.com/git/git
reftable/reftable-writer.h
# # 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 us...
unknown
codeparrot/codeparrot-clean
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v2alpha1", "metadata": { "name": "library-panel-repeat-options-test", "labels": { "test": "library-panel-repeat" } }, "spec": { "annotations": [], "cursorSync": "Off", "description": "Testing library panel repeat options...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/v1beta1.library-panel-repeat-options.v2alpha1.json
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import int_or_none class MporaIE(InfoExtractor): _VALID_URL = r'^https?://(www\.)?mpora\.(?:com|de)/videos/(?P<id>[^?#/]+)' IE_NAME = 'MPORA' _TEST = { 'url': 'http://mpora.de/videos/AAdo...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import asyncio import contextlib import logging import pprint import signal import warnings from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, TypeVar from twisted.internet.defer import Deferred, DeferredList, inlineCallbacks from scrapy import Spider from s...
python
github
https://github.com/scrapy/scrapy
scrapy/crawler.py
# -*- coding: utf-8 -*- """ Asset management plugin for Pelican =================================== This plugin allows you to use the `webassets`_ module to manage assets such as CSS and JS files. The ASSET_URL is set to a relative url to honor Pelican's RELATIVE_URLS setting. This requires the use of SITEURL in the ...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.http /** * A message either from the client or the server, * that has [headers] associated. * * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.http.HttpMessage)...
kotlin
github
https://github.com/ktorio/ktor
ktor-http/common/src/io/ktor/http/HttpMessage.kt
#see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/widgets/eventcal.py # Event Calendar widget # author: Andy Robinson __version__=''' $Id: eventcal.py 3345 2008-12-12 17:55:22Z damian $ ''' __doc__="""This file is a """ from reportla...
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 use ...
unknown
codeparrot/codeparrot-clean
# Disable Flake8 because of all the sphinx imports # # 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 ...
python
github
https://github.com/apache/airflow
docker-stack-docs/conf.py
/* Copyright 2022 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/flowcontrol/v1beta2/conversion.go
# Copyright 2015 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
# Copyright 2017 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. """Logic for parsing a function signatures. Much of this logic is duplicated at tools/binary_size/libsupersize/caspian/function_signature.cc.""" def _FindP...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
connect/runtime/src/main/java/org/apache/kafka/connect/converters/LongConverter.java
from axelrod import Player, Actions C, D = Actions.C, Actions.D class Punisher(Player): """ A player starts by cooperating however will defect if at any point the opponent has defected, but forgets after meme_length matches, with 1<=mem_length<=20 proportional to the amount of time the opponent has ...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """Tests of GLSAR and diagnostics against Gretl Created on Thu Feb 02 21:15:47 2012 Author: Josef Perktold License: BSD-3 """ import os import numpy as np from numpy.testing import (assert_almost_equal, assert_equal, assert_approx_equal, assert_array_less) from s...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/clients/admin/DescribeLogDirsResult.java
<!--Copyright 2025 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/tasks/training_vision_backbone.md
/* * 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
framework-docs/src/main/java/org/springframework/docs/dataaccess/jdbc/jdbccomplextypes/SqlTypeValueFactory.java
# coding: utf-8 from flask_wtf import Form from wtforms import StringField, PasswordField from wtforms.validators import DataRequired, Email, EqualTo from ..models import User class SigninForm(Form): """Form for signin""" email = StringField('Email', validators=[ ...
unknown
codeparrot/codeparrot-clean
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Joel Denning @joeldenning */ "use strict"; const { ConcatSource } = require("webpack-sources"); const { UsageState } = require("../ExportsInfo"); const ExternalModule = require("../ExternalModule"); const Template = require("../Template"); con...
javascript
github
https://github.com/webpack/webpack
lib/library/SystemLibraryPlugin.js
import torch from torch._inductor import ir from torch._inductor.runtime.benchmarking import benchmarker def to_channels_last(x): if x.dim() != 4: raise AssertionError(f"Expected 4D tensor, but got {x.dim()}D") # NCHW -> NHWC stride_order = [3, 0, 2, 1] y = x.clone().as_strided( x.shap...
python
github
https://github.com/pytorch/pytorch
benchmarks/dynamo/microbenchmarks/tensor_layout_mini_benchmark.py
from __future__ import absolute_import from django.core.exceptions import ValidationError from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from six import text_type from zerver.decorator import to_non_negative_int from zerver.lib.actions import do_update_pointer fro...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/blockScopedNamespaceDifferentFile.ts] //// //// [test.ts] namespace C { export class Name { static funcData = A.AA.func(); static someConst = A.AA.foo; constructor(parameters) {} } } //// [typings.d.ts] declare namespace A { namespace AA { functi...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/blockScopedNamespaceDifferentFile(target=es5).js
# coding=utf-8 __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' from octoprint.settings import settings import os import threading import urllib import time import subprocess import fnmatch def getFinishedTimelapses(): files = [] ba...
unknown
codeparrot/codeparrot-clean
/* ae.c module for illumos event ports. * * Copyright (c) 2012, Joyent, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyr...
c
github
https://github.com/redis/redis
src/ae_evport.c
import Avatar from "../components/avatar"; import DateFormatter from "../components/date-formatter"; import CoverImage from "./cover-image"; import Link from "next/link"; export default function PostPreview({ title, coverImage, date, excerpt, author, slug, }) { return ( <div> <div className="mb...
javascript
github
https://github.com/vercel/next.js
examples/cms-tina/components/post-preview.js
// Copyright Joyent, Inc. and other Node contributors. // // 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 to use, copy, modi...
javascript
github
https://github.com/nodejs/node
lib/_http_incoming.js
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # Copyright 2019 Linaro Ltd. %YAML 1.2 --- $id: http://devicetree.org/schemas/misc/intel,ixp4xx-ahb-queue-manager.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Intel IXP4xx AHB Queue Manager maintainers: - Linus Walleij <linusw@kernel.org> ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml
#!/usr/bin/env python3 import argparse import tarfile import os import urllib2 import shutil METAPHLAN2_URL = 'https://bitbucket.org/biobakery/metaphlan2/get/2.5.0.tar.gz' def download_file(url): """Download a file from a URL Fetches a file from the specified URL. Returns the name that the file is saved ...
unknown
codeparrot/codeparrot-clean
package build import ( "context" "os" "testing" "github.com/moby/moby/v2/internal/testutil" "github.com/moby/moby/v2/internal/testutil/environment" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/codes" ) var ( testEnv *environment.Execution baseContext context.Context ) func TestMain(m *testing.M...
go
github
https://github.com/moby/moby
integration/build/main_test.go
// 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. //go:build unix || (js && wasm) || wasip1 package os import ( "errors" "syscall" "time" ) const ( // Special values for Process.Pid. pidUnset = 0 pi...
go
github
https://github.com/golang/go
src/os/exec_unix.go
from scipy.stats import maxwell import matplotlib.pyplot as plt fig, ax = plt.subplots(1, 1) # Calculate a few first moments: mean, var, skew, kurt = maxwell.stats(moments='mvsk') # Display the probability density function (``pdf``): x = np.linspace(maxwell.ppf(0.01), maxwell.ppf(0.99), 100) ax.plot...
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/ElasticsearchTestBasePlugin.java
/* * 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
framework-docs/src/main/java/org/springframework/docs/testing/mockmvc/assertj/mockmvctesterassertionsjson/FamilyControllerTests.java
import sys _gui_libs = [] try: import gi gi.require_version('Gtk', '3.0') # nopep8 _gui_libs.append("gi") except Exception as e: print("import dans_pymodules: Exception caught when trying to import gi: {}".format(e)) print("label_combo, and mpl_canvas_wrapper will not be available!") try: i...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import os import sys import logging import crontab from website import settings logger = logging.getLogger(__name__) logging.basicConfig(level=logging.INFO) def app_prefix(path): return os.path.join(settings.APP_PATH, path) def ensure_item(cron, command): items = list(cron.find_com...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2007 - Nando Vieira # # 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, or (at your option) # any later version. # # This program is distributed in the hope that ...
unknown
codeparrot/codeparrot-clean
import re def match_num(string): text = re.compile(r"^5") if text.match(string): return True else: return False
unknown
mbpp
# Copyright 2014 Donald Stufft # # 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, so...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/main/java/org/apache/kafka/common/header/package-info.java
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package terraform import ( "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/configs/configschema" ) // ResourceProvider is a legacy interface for providers. // // This is retained only for compatibility wi...
go
github
https://github.com/hashicorp/terraform
internal/legacy/terraform/resource_provider.go
function Component(props) { const user = useFragment( graphql` fragment F on T { id } `, props.user ) ?? {}; return user.name; }
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hook-inside-logical-expression.js
from chainer.training.triggers import EarlyStoppingTrigger from chainermn.extensions import ObservationAggregator class MultiNodeEarlyStoppingTrigger(object): """__init__(\ self, comm, check_trigger=(1, 'epoch'), monitor='main/loss', \ patience=3, mode='auto', verbose=False, \ max_trigger=(...
unknown
codeparrot/codeparrot-clean
""" Tools for sending email. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the int...
unknown
codeparrot/codeparrot-clean
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
python
github
https://github.com/huggingface/transformers
src/transformers/data/__init__.py
#!/usr/bin/python2.7 # Copyright 2011 Google Inc. All Rights Reserved. """Targets class describes which languages/platforms we support.""" __author__ = 'wclarkso@google.com (Will Clarkson)' import logging import os from googleapis.codegen.filesys import files from googleapis.codegen.utilities import json_expander f...
unknown
codeparrot/codeparrot-clean
{ "backfill": { "affected_many": "Se activarán {{count}} ejecuciones.", "affected_one": "1 ejecución será activada.", "affected_other": "Se activarán {{count}} ejecuciones.", "affectedNone": "No hay ejecuciones que coincidan con los criterios seleccionados.", "allRuns": "Todas las Ejecuciones", ...
json
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/public/i18n/locales/es/components.json
from .gpu import * from .staffboundary import distance_transform_kernel from pyopencl import LocalMemory from . import bitimage, staffsize from .page import Page from scipy.optimize import minimize import glob import metaomr prg = build_program(['clrand32', 'kanungo']) def normalized_page(page): if not hasattr(pa...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Database; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Contracts\Support\DeferrableProvider; use Illuminate\Database\Console\Migrations\FreshCommand; use Illuminate\Database\Console\Migrations\InstallCommand; use Illuminate\Database\Console\Migrations\MigrateCommand; use Illum...
php
github
https://github.com/laravel/framework
src/Illuminate/Database/MigrationServiceProvider.php
# -*- coding: utf-8 -*- # # Authors: MNE Developers # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # # License: BSD (3-clause) import hashlib import os.path as op import pytest import numpy as np from numpy.testing import assert_array_equal, assert_allclose from scipy import sparse from mne import Epoc...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse, os, subprocess from PIL import Image def parse_argument(): parser = argparse.ArgumentParser() parser.add_argument( 'filename', metavar='filename', action='store', ) return parser.parse_args() def convert_to_...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from datetime import datetime from dateutil import relativedelta import json import random from openerp import tools from openerp.exceptions import Warning from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.translate import _ from openerp.tools import ustr from openerp.os...
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
configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/generic/MixGenericNameProperties.java
import numbers from copy import copy import theano.tensor as tt from ..model import modelcontext from .. import distributions as pm_dists __all__ = ['Normal', 'StudentT', 'Binomial', 'Poisson', 'NegativeBinomial'] # Define link functions # Hack as assigning a function in the class definition automatically binds # i...
unknown
codeparrot/codeparrot-clean
import datetime from django.core.exceptions import ValidationError from django.forms import TimeField from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class TimeFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_timefield_1(self): f = TimeField() self.asser...
python
github
https://github.com/django/django
tests/forms_tests/field_tests/test_timefield.py
import org.gradle.api.* import org.jetbrains.kotlin.gradle.plugin.* import org.gradle.kotlin.dsl.* fun KotlinSourceSet.configureDirectoryPaths() { if (project.isMultiplatform) { val srcDir = if (name.endsWith("Main")) "src" else "test" val platform = name.dropLast(4) kotlin.srcDir("$platfor...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
buildSrc/src/main/kotlin/SourceSets.kt
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
unknown
codeparrot/codeparrot-clean
""" WSGI config for votainteligente 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_APPLIC...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # This file is part of Invenio Demosite. # Copyright (C) 2011, 2012 CERN. # # Invenio Demosite is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at...
unknown
codeparrot/codeparrot-clean
#define TORCH_ASSERT_NO_OPERATORS #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #include <ATen/native/Activation.h> #include <cmath> #include <functional> #include <ATen/Dispatch.h> #include <ATen/OpMathType.h> #include <ATen/core/TensorBase.h> #include <ATen/cpu/vec/functional.h> #include <ATen/cpu/vec...
cpp
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/cpu/Activation.cpp
# sqlalchemy/naming.py # Copyright (C) 2005-2014 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 """Establish constraint and index naming conventions. """ from .schema import...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # 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': ['p...
unknown
codeparrot/codeparrot-clean
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/kernels/ragged_utils.h
// Copyright 2021 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. //go:build !amd64 && !arm64 && !loong64 && !riscv64 && !s390x package math const haveArchMax = false func archMax(x, y float64) float64 { panic("not impleme...
go
github
https://github.com/golang/go
src/math/dim_noasm.go
import numpy class MRSData(numpy.ndarray): """ numpy.ndarray subclass with additional metadata like sampling rate and echo time. """ def __new__(cls, input_array, dt, f0, te=30, ppm0=4.7, voxel_dimensions=(10, 10, 10), transform=None, metadata=None): # Input array is an already formed ndar...
unknown
codeparrot/codeparrot-clean
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bundle\WebProfilerBundle\Tests\Profiler; use Symfony\Bundle\Web...
php
github
https://github.com/symfony/symfony
src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php
# -*- 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
# -*- coding: utf-8 -*- """ test all other .agg behavior """ from __future__ import print_function import pytest from datetime import datetime, timedelta from functools import partial import numpy as np import pandas as pd from pandas import date_range, DataFrame, Index, MultiIndex, Series from pandas.core.groupb...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- """Logging module for the Multivio application.""" #============================================================================== # This file is part of the Multivio software. # Project : Multivio - https://www.multivio.org/ # Copyright: (c) 2009-2011 RERO (http://www...
unknown
codeparrot/codeparrot-clean
import re from time import time from livestreamer.plugin import Plugin, PluginError from livestreamer.plugin.api import http, validate from livestreamer.stream import RTMPStream, HLSStream SWF_URL = "http://play.streamingvideoprovider.com/player2.swf" API_URL = "http://player.webvideocore.net/index.php" _url_re = r...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is largely copied from the Nagios module included in the # Func project. Original copyright follows: # # func-nagios - Schedule downtime and enables/disable notifications # Copyright 2011, Red Hat, Inc. # Tim Bielawa <tbielawa@redhat.com> # # This software may be ...
unknown
codeparrot/codeparrot-clean
--- title: "Preview Mode for Static Generation" excerpt: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus." co...
unknown
github
https://github.com/vercel/next.js
examples/blog-starter/_posts/preview.md
#!/usr/bin/env python ##Copyright 2008-2017 Thomas Paviot (tpaviot@gmail.com) ## ##This file is part of pythonOCC. ## ##pythonOCC is free software: you can redistribute it and/or modify ##it under the terms of the GNU Lesser General Public License as published by ##the Free Software Foundation, either version 3 of the...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 # Author: Marvin Pinto <me@marvinp.ca> # Author: Dennis Lutter <lad1337@gmail.com> # Author: Aaron Bieber <deftly@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 from peacock.utils import ExeLauncher import json import mooseutils from PyQt5.QtWidgets import QApplication class JsonData(object): """ Class that holds the json produced by an executable. """ def __init__(self, app_path="", extra_args=[], **kwds): """ Constructo...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright: (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com> # Copyright: (c) 2014, Ahti Kitsik <ak@ahtik.com> # 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 annotations DOCUMENTATI...
python
github
https://github.com/ansible/ansible
lib/ansible/modules/lineinfile.py
""" Helper functions for loading environment settings. """ from __future__ import print_function import os import sys import json from lazy import lazy from path import path import memcache class Env(object): """ Load information about the execution environment. """ # Root of the git repository (edx-p...
unknown
codeparrot/codeparrot-clean
import os import pathlib import unittest from maildaemon.config import load_config from maildaemon.connection_group import ConnectionGroup _HERE = pathlib.Path(__file__).parent _TEST_CONFIG_PATH = _HERE.joinpath('maildaemon_test_config.json') @unittest.skipUnless(os.environ.get('TEST_COMM') or os.environ.get('CI'), ...
unknown
codeparrot/codeparrot-clean
//// [tests/cases/compiler/commentLeadingCloseBrace.ts] //// //// [commentLeadingCloseBrace.ts] declare function commentedParameters(...args): any; function ifelse() { if (commentedParameters(1, 2)) { /*comment1*/ commentedParameters(3, 4); /*comment2*/ } else { commentedParame...
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/commentLeadingCloseBrace.js
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: MPL-2.0 package framework import ( "context" "sort" "strings" "github.com/hashicorp/vault/sdk/logical" ) // DEPRECATED: Don't use this. It's too inflexible, nearly impossible to use // with some modern Vault features, and imposes specific API designs...
go
github
https://github.com/hashicorp/vault
sdk/framework/policy_map.go
#!/usr/bin/env python # Tests for dtella/common/ipv4.py import fix_path import unittest from dtella.common.ipv4 import CidrNumToMask from dtella.common.ipv4 import CidrStringToIPMask from dtella.common.ipv4 import IsSubsetOf from dtella.common.ipv4 import MaskToCidrNum from dtella.common.ipv4 import SubnetMatcher cla...
unknown
codeparrot/codeparrot-clean
DomCrawler Component ==================== The DomCrawler component eases DOM navigation for HTML and XML documents. Resources --------- * [Documentation](https://symfony.com/doc/current/components/dom_crawler.html) * [Contributing](https://symfony.com/doc/current/contributing/index.html) * [Report issues](https:/...
unknown
github
https://github.com/symfony/symfony
src/Symfony/Component/DomCrawler/README.md
#! /usr/bin/env python # Copyright (c) 2009-2014, The Linux Foundation. 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 # ...
unknown
codeparrot/codeparrot-clean
from random import random from kivy.app import App from kivy.uix.button import Button from kivy.uix.widget import Widget from kivy.graphics import Color from kivy.graphics import Ellipse from kivy.graphics import Line class PaintWidget(Widget): def...
unknown
codeparrot/codeparrot-clean
from functools import wraps from django.utils.decorators import available_attrs def xframe_options_deny(view_func): """ Modifies a view function so its response has the X-Frame-Options HTTP header set to 'DENY' as long as the response doesn't already have that header set. e.g. @xframe_option...
unknown
codeparrot/codeparrot-clean
"""Dispatcher Please see policy.py for a discussion on dispatchers and policies """ import pythoncom, traceback, win32api from sys import exc_info # from win32com.server.exception import IsCOMServerException from win32com.util import IIDToInterfaceName import win32com class DispatcherBase: """ The base class for a...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
# Linting in the MongoDB codebase ## C++ Linters ### `clang-tidy` The `buildscripts/clang_tidy.py` shell script runs the `clang-tidy` linter. In order to run `clang-tidy` you must have a compilation database (`compile_commands.json` file). Ex: `python3 buildscripts/clang_tidy.py` | Linter | Configuration Fil...
unknown
github
https://github.com/mongodb/mongo
docs/linting.md
''' Text annotation module ''' from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xblock.core import Scope, String from xmodule.annotator_mixin import get_instructions from xmodule.annotator_token import retrieve_toke...
unknown
codeparrot/codeparrot-clean