code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() def GetRGBColor(colorName): ''' Return the red, green and blue components for a color as doubles. ''' rgb = [0.0, 0.0, 0.0] # black vtk.vtkNamedColors...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import sys import random import os from builtins import range import time sys.path.insert(1, "../../../") import h2o from tests import pyunit_utils from h2o.estimators.kmeans import H2OKMeansEstimator from h2o.grid.grid_search import H2OGridSearch class Test_kmeans_grid_search:...
unknown
codeparrot/codeparrot-clean
import os import platform from unittest.mock import Mock, patch, PropertyMock from EPPs.common import SendMailEPP from scripts.email_container_dispatched import ContainerDispatchComplete from scripts.email_container_ready_for_dispatch import ContainerReadyDispatch from scripts.email_data_release import DataReleaseEmai...
unknown
codeparrot/codeparrot-clean
import struct from config import config, ConfigSelection, ConfigYesNo, ConfigSubsection, ConfigText from enigma import eHdmiCEC, eTimer from Screens.Standby import inStandby import Screens.Standby from Tools import Notifications import time from os import system from Tools.Directories import fileExists class HdmiCec: ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com> # Copyright (C) 2012 Rackspace US, Inc., # Justin Shepherd <jshepher@rackspace.com> # Copyright (C) 2013 Red Hat, Inc., Jeremy Agee <jagee@redhat.com> # Copyright (C) 2015 Red Hat, Inc., Abhijeet Kasurde <akasurde@redhat.com> # Copyri...
unknown
codeparrot/codeparrot-clean
from opcode import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname, hasname, hasjrel, haslocal, \ hascompare, hasfree, cmp_op import dis import sys from collections import namedtuple try: xrange except NameError: xrange = range class TryExceptInfo(object): def __init__(self, try_line, is_finally=False)...
unknown
codeparrot/codeparrot-clean
# Basic signature scan module. This is the default (and primary) feature of binwalk. import binwalk.core.magic from binwalk.core.module import Module, Option, Kwarg class Signature(Module): TITLE = "Signature Scan" ORDER = 10 CLI = [ Option(short='B', long='signature', ...
unknown
codeparrot/codeparrot-clean
""" Essential implementation of the Store interface defined by RDF lib. """ from django.db.utils import IntegrityError import rdflib from rdflib.store import VALID_STORE from rdflib.term import Literal, Identifier from rdflib_django import models from rdflib_django.models import NamespaceModel DEFAULT_STORE = "Default...
unknown
codeparrot/codeparrot-clean
import numpy as np from skimage.draw import random_shapes from skimage._shared import testing from skimage._shared.testing import expected_warnings def test_generates_color_images_with_correct_shape(): image, _ = random_shapes((128, 128), max_shapes=10) assert image.shape == (128, 128, 3) def test_generates...
unknown
codeparrot/codeparrot-clean
# coding=utf-8 from django.test import Client, TestCase from django.core.urlresolvers import reverse from django.conf import settings from model_mommy import mommy from accounts.models import User class RegisterViewTestCase(TestCase): def setUp(self): self.client = Client() self.register_url = ...
unknown
codeparrot/codeparrot-clean
package app import ( "bytes" "errors" "fmt" "strconv" "github.com/grafana/grafana-app-sdk/k8s" "github.com/grafana/grafana-app-sdk/resource" "github.com/grafana/grafana-app-sdk/simple" "github.com/grafana/grafana/apps/example/pkg/apis/example/v0alpha1" "github.com/grafana/grafana/apps/example/pkg/apis/exampl...
go
github
https://github.com/grafana/grafana
apps/example/pkg/app/conversion.go
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # IMPORTANT NOTE: If you make local mods to this file, you must run: # % pnacl/build.sh driver # in order for them to take eff...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from amzqr.mylibs.constant import alig_location, format_info_str, version_info_str, lindex def get_qrmatrix(ver, ecl, bits): num = (ver - 1) * 4 + 21 qrmatrix = [[None] * num for i in range(num)] # [([None] * num * num)[i:i+num] for i in range(num * num) if i % num == 0] # Ad...
unknown
codeparrot/codeparrot-clean
# $Id: __init__.py 82 2011-01-10 03:43:38Z timur.alperovich@gmail.com $ """fast, simple packet creation and parsing.""" __author__ = 'Dug Song <dugsong@monkey.org>' __copyright__ = 'Copyright (c) 2004 Dug Song' __license__ = 'BSD' __url__ = 'http://dpkt.googlecode.com/' __version__ = '1.8' from dpkt import * import...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 NEC Corporation # # 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
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.15.1) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x03\xed\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x40\x...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # (c) 2015, Dagobert Michelsen <dam@baltic-online.de> # # 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
from collections import namedtuple import json import logging import pprint import re (STATUS_OK, STATUS_ERROR) = xrange(2) CommandsResponse = namedtuple('CommandsResponse', ['status', 'value']) LOG = logging.getLogger('bgpspeaker.operator.command') def default_help_formatter(quick_helps): """Apply default form...
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...
python
github
https://github.com/apache/airflow
airflow-core/src/airflow/example_dags/tutorial_dag.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import threading imp...
unknown
codeparrot/codeparrot-clean
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will b...
unknown
codeparrot/codeparrot-clean
use rustc_hir::attrs::{AttributeKind, CoverageAttrKind}; use rustc_hir::find_attr; use rustc_index::bit_set::DenseBitSet; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; use rustc_middle::mir::coverage::{BasicCoverageBlock, CoverageIdsInfo, CoverageKind, MappingKind}; use rustc_middle::mir::{Body, State...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_mir_transform/src/coverage/query.rs
#!/usr/bin/env python # -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2003-2014 Ulrich von Zadow # # This library 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 # vers...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * be-secure-gssapi.c * GSSAPI encryption support * * Portions Copyright (c) 2018-2026, PostgreSQL Global Development Group * * IDENTIFICATION * src/backend/libpq/be-secure-gssapi.c * *----------------------------------------------...
c
github
https://github.com/postgres/postgres
src/backend/libpq/be-secure-gssapi.c
import { jsonToReadableText } from "../helpers.js"; import { verifyTscWatch } from "../helpers/tscWatch.js"; import { TestServerHost } from "../helpers/virtualFileSystemWithWatch.js"; describe("unittests:: tscWatch:: resolveJsonModule:: emit file --incremental", () => { verifyTscWatch({ scenario: "resolveJ...
typescript
github
https://github.com/microsoft/TypeScript
src/testRunner/unittests/tscWatch/resolveJsonModuleWithIncremental.ts
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import time from django.conf import settings from django.test import TestCase from django.test.client import FakePayload, Client from django.utils.encoding import force_text from tastypie.serializers import Serializer try: from urllib.parse import urlparse except ImportErr...
unknown
codeparrot/codeparrot-clean
# import numpy as np from hmm import posterior_decoding, prob_data, compare_statepath, max_and_index ''' 3 state HMM Notes In each emission matrix, the emissions for A,C, and G should be the same. It is the emissions for T, T1, and T2 that change. In the unlabeled state, it is predominantly T....
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import copy import sys from functools import update_wrapper from future_builtins import zip import django.db.models.manager # Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, MultipleObjectsRet...
unknown
codeparrot/codeparrot-clean
# Copyright 2010 United States Government as represented by the # 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/LICE...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python ############################################################################ # # 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 A...
unknown
codeparrot/codeparrot-clean
import re import unicodedata from django.db.models import Model from django.apps import apps from django.utils.encoding import force_text from django.utils.text import slugify from django.utils.six import string_types def camelcase_to_underscore(str): # http://djangosnippets.org/snippets/585/ return re.sub('(...
unknown
codeparrot/codeparrot-clean
package convert import ( "context" "encoding/json" "fmt" "net/netip" "strings" "github.com/containerd/log" gogotypes "github.com/gogo/protobuf/types" "github.com/moby/moby/api/types/container" mounttypes "github.com/moby/moby/api/types/mount" types "github.com/moby/moby/api/types/swarm" "github.com/moby/mo...
go
github
https://github.com/moby/moby
daemon/cluster/convert/container.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 may not...
python
github
https://github.com/apache/airflow
airflow-core/src/airflow/example_dags/example_setup_teardown_taskflow.py
# -*- coding: utf-8 -*- """Plist parser plugin for Safari history plist files.""" from dfdatetime import cocoa_time as dfdatetime_cocoa_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import plist from plaso.parsers.plist_plugins i...
unknown
codeparrot/codeparrot-clean
from twisted.internet import threads, reactor from time import sleep, time, strftime, localtime, mktime import redis import serial from redis import Redis import logging import logging.handlers import logging.config logging.config.fileConfig('logging.ini') log = logging.getLogger("welding") from singleton impo...
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
core/spring-boot/src/main/java/org/springframework/boot/context/event/ApplicationPreparedEvent.java
# 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
def generate_matrix(n): if n<=0: return [] matrix=[row[:] for row in [[0]*n]*n] row_st=0 row_ed=n-1 col_st=0 col_ed=n-1 current=1 while (True): if current>n*n: break for c in range (col_st, col_ed+1): ...
unknown
mbpp
/* * 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/src/com/google/common/hash/Funnel.java
import * as Harness from "../_namespaces/Harness.js"; import * as ts from "../_namespaces/ts.js"; import * as Utils from "../_namespaces/Utils.js"; import { createTestCompilerHost, jsonToReadableText, NamedSourceText, newLine, newProgram, ProgramWithSourceTexts, SourceText, TestCompilerH...
typescript
github
https://github.com/microsoft/TypeScript
src/testRunner/unittests/reuseProgramStructure.ts
######################################################################## # $HeadURL $ # File: TracedTests.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2012/08/08 15:21:32 ######################################################################## """ :mod: TracedTests ======================= .. module: Tr...
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
core/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java
//////////////////////////////////////////////////////////////////////////// // // Copyright 2020 Realm 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/li...
unknown
github
https://github.com/realm/realm-swift
Realm/RLMObjectId_Private.hpp
from urlparse import urlparse from django.contrib.auth.models import Group from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from factories import UserFactory, CategoryFactory, ApplicationFactory from factories import DeploymentFactory, StageFactory from...
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
client/benchmark/src/main/java/org/elasticsearch/client/benchmark/ops/bulk/BulkBenchmarkTask.java
# # Module providing the `Process` class which emulates `threading.Thread` # # multiprocessing/process.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = ['BaseProcess', 'current_process', 'active_children'] # # Imports # import os import sys import signal import i...
unknown
codeparrot/codeparrot-clean
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("sites", "0001_initial"), ] operations = [ migrations.CreateModel( name="Redirect", fields=[ ( "id", models.Auto...
python
github
https://github.com/django/django
django/contrib/redirects/migrations/0001_initial.py
/*! * Bootstrap component-functions.js v5.3.8 (https://getbootstrap.com/) * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ (function (global, factory) { typeof exports === 'object' ...
javascript
github
https://github.com/twbs/bootstrap
js/dist/util/component-functions.js
#!/usr/bin/env python # -*- coding: utf8 -*- import time import datetime import pickle import uuid import binascii import zlib import hashlib import json import random import string import __init__ as nomagic from setting import conn def connect_index_and_entity(table_index, index_name, index_connection_name, enti...
unknown
codeparrot/codeparrot-clean
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # \file config.py # \brief Process configuration # \date 2010-08-27 17:02GMT # \author Jan Boon (Kaetemi) # Python port of game data build pipeline. # Process configuration. # # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/> # Copyright (C) 2010 Winch Gate Property Limited # # This pro...
unknown
codeparrot/codeparrot-clean
"""Tests for distutils.command.install_headers.""" import sys import os import unittest import getpass from distutils.command.install_headers import install_headers from distutils.tests import support from test.test_support import run_unittest class InstallHeadersTestCase(support.TempdirManager, ...
unknown
codeparrot/codeparrot-clean
import Head from "next/head"; import { CMS_NAME, HOME_OG_IMAGE_URL } from "../lib/constants"; export default function Meta() { return ( <Head> <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" /> <link rel="icon" type="imag...
typescript
github
https://github.com/vercel/next.js
examples/cms-agilitycms/components/meta.tsx
#pragma once #ifdef USE_XNNPACK #include <ATen/Tensor.h> #include <ATen/native/xnnpack/Common.h> #include <ATen/native/xnnpack/OpContext.h> namespace at::native::xnnpack { namespace internal::convolution2d { c10::intrusive_ptr<xnnpack::Conv2dOpContext> createConv2dClampPrePackOpContext( Tensor weight, ...
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/native/xnnpack/Convolution.h
# Copyright (c) 2014 OpenStack Foundation, all rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
unknown
codeparrot/codeparrot-clean
// Copyright 2023 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. #include "libgo9.h" void use(int *x) { (*x)++; } void callGoFWithDeepStack(int p) { int x[10000]; use(&x[0]); use(&x[9999]); GoF(p); use(&x[0]); use(...
c
github
https://github.com/golang/go
src/cmd/cgo/internal/testcarchive/testdata/main9.c
#!/usr/bin/python # # Open SoundControl for Python # Copyright (C) 2002 Daniel Holth, Clinton McChesney # # This library 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 2.1 of the Licen...
unknown
codeparrot/codeparrot-clean
""" API function for retrieving course blocks data """ import lms.djangoapps.course_blocks.api as course_blocks_api from lms.djangoapps.course_blocks.transformers.access_denied_filter import AccessDeniedMessageFilterTransformer from lms.djangoapps.course_blocks.transformers.hidden_content import HiddenContentTransform...
unknown
codeparrot/codeparrot-clean
import { ApplicableRefactorInfo, ArrowFunction, Block, ConciseBody, copyComments, copyTrailingAsLeadingComments, Debug, Diagnostics, emptyArray, factory, FileTextChanges, FindAllReferences, first, forEachChild, FunctionExpression, getCombinedModifierFlags,...
typescript
github
https://github.com/microsoft/TypeScript
src/services/refactors/convertArrowFunctionOrFunctionExpression.ts
from distutils.version import StrictVersion as Ver from django.contrib.auth.models import AnonymousUser from django.template import RequestContext from django.utils.crypto import get_random_string import pytest try: import cms from cms import api from cms.models import Page, Placeholder from form_des...
unknown
codeparrot/codeparrot-clean
"""eCIP URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
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...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.tests import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.client.test.base.* import io.ktor.http.* import kotlin.test.Test import kotlin.te...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-tests/common/test/io/ktor/client/tests/QueryTest.kt
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # siphash.py - Specialized SipHash-2-4 implementations # # This implements SipHash-2-4 for 256-bit integers....
unknown
codeparrot/codeparrot-clean
from django.test import TestCase from django.contrib.contenttypes.models import ContentType from wagtail.wagtailadmin import widgets from wagtail.wagtailcore.models import Page from wagtail.tests.testapp.models import SimplePage, EventPage class TestAdminPageChooserWidget(TestCase): def setUp(self): self...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 2015 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. """ Unit tests for the contents of device_utils.py (mostly DeviceUtils). The test will invoke real devices """ import os import tempfi...
unknown
codeparrot/codeparrot-clean
upper_tabs: # Tabs left of dropdown menu - include: /_upper_tabs_left.yaml - include: /api_docs/_upper_tabs_api.yaml # Dropdown menu - name: Resources path: /resources is_default: true menu: - include: /resources/_menu_toc.yaml lower_tabs: # Subsite tabs other: - name: Guide contents: ...
unknown
github
https://github.com/tensorflow/tensorflow
tensorflow/compiler/mlir/g3doc/_book.yaml
"""Server tests.""" import copy import logging from atilla.server import ( Application, create_app, httplib, ) def test_create_app(): """Test create app shortcut.""" app = create_app(name='test', mode='test', settings_module='tests.settings') assert isinstance(app, Application) class TestConf...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- ''' zen Add-on Copyright (C) 2016 zen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later v...
unknown
codeparrot/codeparrot-clean
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/lite/core/api/error_reporter.h
# Copyright 2014-2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.network.selector import kotlinx.coroutines.* import kotlinx.io.* import kotlin.coroutines.* internal class WorkerSelectorManager(context: CoroutineContext) : SelectorManager ...
kotlin
github
https://github.com/ktorio/ktor
ktor-network/posix/src/io/ktor/network/selector/WorkerSelectorManager.kt
#! /usr/bin/env python # # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # # pylint: disable=invalid-name,missing-docstring """ Sequence trim...
unknown
codeparrot/codeparrot-clean
# -*- 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 import os import json import pytest import sys if sys.version_info < (2, ...
unknown
codeparrot/codeparrot-clean
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
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 applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/ko/model_doc/barthez.md
# mako/codegen.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides functionality for rendering a parsetree constructing into module source code.""" impo...
unknown
codeparrot/codeparrot-clean
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v0alpha1", "metadata": { "name": "v35.ensure_x_axis_visibility.v42" }, "spec": { "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dashboards_from_v0_to_v2/v2beta1.v35.ensure_x_axis_visibility.v0alpha1.json
from numpy import matrix import numpy as np import random import collections # findClosestCentroids(X, centroids) returns the index of the closest # centroids for a dataset X where each row is a single example. # idx = m x 1 is a vector of centroid assignments # (i.e., each entry in range [0..k-1]) def findCl...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python #============================================================================ # 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 distribu...
unknown
codeparrot/codeparrot-clean
""" ============================================ Reading BEM surfaces from a forward solution ============================================ Plot BEM surfaces used for forward solution generation. """ # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # # License: BSD (3-clause) import mne from mne....
unknown
codeparrot/codeparrot-clean
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
unknown
codeparrot/codeparrot-clean
# 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
#if defined(DETECT_FEATURES) && defined(__INTEL_COMPILER) /* * Unlike GCC and CLANG, Intel Compiler exposes all supported intrinsics, * whether or not the build options for those features are specified. * Therefore, we must test #definitions of CPU features when option native/host * is enabled v...
c
github
https://github.com/numpy/numpy
numpy/_core/src/_simd/checks/cpu_f16c.c
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, print_function import os import subprocess import sys import tempfile from pkg_resources import Distribution, PathMetadata from .common import sa...
unknown
codeparrot/codeparrot-clean
import { test } from '../../test'; export default test({ html: ` <span>1</span> <span>2</span> `, test({ assert, component, target }) { component.list = [3, 4]; assert.htmlEqual( target.innerHTML, ` <span>3</span> <span>4</span> ` ); } });
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/component-name-deconflicted/_config.js
@file:Suppress("UNUSED") package kotlinx.coroutines.debug.internal import java.io.Serializable import kotlin.coroutines.* import kotlinx.coroutines.* /* * This class represents all the data required by IDEA debugger. * It is serializable in order to speedup JDWP interactions. * **DO NOT MAKE BINARY-INCOMPATIBLE C...
kotlin
github
https://github.com/Kotlin/kotlinx.coroutines
kotlinx-coroutines-core/jvm/src/debug/internal/DebuggerInfo.kt
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import logging from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import pars...
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 applica...
unknown
codeparrot/codeparrot-clean
""" An extension module for click to enable registering CLI commands via setuptools entry-points. from pkg_resources import iter_entry_points import click from click_plugins import with_plugins @with_plugins(iter_entry_points('entry_point.name')) @click.group() def cli(): '''Commandli...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # BrodyHopfield.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, ...
unknown
codeparrot/codeparrot-clean
"""This is the main module for AAMs, containing base class `AAM` as long as functions to build and fit the model. Based on ICAAM implementation by Luca Vezzaro. """ from __future__ import print_function from procrustes import procrustes from numpy import * from helpers import * class AAM(object): def __init_...
unknown
codeparrot/codeparrot-clean
import datetime from dataclasses import dataclass from functools import wraps from django.contrib.sites.shortcuts import get_current_site from django.core.paginator import EmptyPage, PageNotAnInteger from django.http import Http404 from django.template.response import TemplateResponse from django.urls import reverse f...
python
github
https://github.com/django/django
django/contrib/sitemaps/views.py
/* * Copyright (C) 2014 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import os import os.path import time from fabric.api import abort, run, prefix, warn_only, cd, settings, sudo, put from fabric.contrib.files import exists, append, contains, sed, upload_template from fabric.colors import yellow, red, gre...
unknown
codeparrot/codeparrot-clean
// SPDX-License-Identifier: GPL-2.0-or-later /* * A generic kernel FIFO implementation * * Copyright (C) 2009/2010 Stefani Seibold <stefani@seibold.net> */ #include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/export.h> #include <linux/kfifo.h> #include <linux/log2.h> #include <linux/scatterlist.h>...
c
github
https://github.com/torvalds/linux
lib/kfifo.c
// This file configures the initialization of Sentry on the server. // The config you add here will be used whenever middleware or an Edge route handles a request. // https://docs.sentry.io/platforms/javascript/guides/nextjs/ import * as Sentry from "@sentry/nextjs"; const SENTRY_DSN = process.env.SENTRY_DSN || proce...
javascript
github
https://github.com/vercel/next.js
examples/with-sentry/sentry.edge.config.js