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 os import markdown from string import atof,atoi class MDHist(object): def __init__(self, text): self.text = text.replace('\t', ' ') self.fname = self.text.split(' ')[0] self.hname = self.text.split(' ')[1] #self.title = self.get('title') #self.title = self['title'] def __geti...
unknown
codeparrot/codeparrot-clean
"""Tests for grudger strategies.""" import random import axelrod from .test_player import TestPlayer C, D = axelrod.Actions.C, axelrod.Actions.D class TestGrudger(TestPlayer): name = "Grudger" player = axelrod.Grudger expected_classifier = { 'memory_depth': float('inf'), # Long memory ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
unknown
codeparrot/codeparrot-clean
package v0alpha1 import ( "fmt" "strings" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/registry/fieldselectors" ) const ( GROUP = "iam....
go
github
https://github.com/grafana/grafana
apps/iam/pkg/apis/iam/v0alpha1/register.go
"""The tests for the Group components.""" # pylint: disable=protected-access from collections import OrderedDict import unittest from unittest.mock import patch from homeassistant.bootstrap import setup_component from homeassistant.const import ( STATE_ON, STATE_OFF, STATE_HOME, STATE_UNKNOWN, ATTR_ICON, ATTR_HIDD...
unknown
codeparrot/codeparrot-clean
function Component(props) { const count = new MaybeMutable(); return ( <View> <View> {<span>Text</span>} {<span>{maybeMutate(count)}</span>} </View> </View> ); }
javascript
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-memo-value-not-promoted-to-outer-scope-static.js
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author) # Mathieu Blondel (partial_fit support) # # License: BSD 3 clause """Classification and regression using Stochastic Gradient Descent (SGD).""" import numpy as np import warnings from abc import ABCMeta, abstractmethod from ..utils im...
unknown
codeparrot/codeparrot-clean
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #ifndef OPENCV_CORE_BINDINGS_UTILS_HPP #define OPENCV_CORE_BINDINGS_UTILS_HPP #include <opencv2/core/async.hpp> #include <op...
unknown
github
https://github.com/opencv/opencv
modules/core/include/opencv2/core/bindings_utils.hpp
#ifndef JEMALLOC_INTERNAL_PROF_EXTERNS_H #define JEMALLOC_INTERNAL_PROF_EXTERNS_H #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/prof_hook.h" extern bool opt_prof; extern bool opt_prof_active; extern bool opt_prof_thread_active_init; extern size_t opt_lg_prof_sample; /* Mean bytes between samples...
c
github
https://github.com/redis/redis
deps/jemalloc/include/jemalloc/internal/prof_externs.h
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (c) 2013 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. """Add all generated lint_result.xml files to suppressions.xml""" import collections import optparse import os import sys from x...
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...
python
github
https://github.com/tensorflow/tensorflow
tensorflow/lite/testing/zip_test_utils.py
# encoding: UTF-8 ''' vn.femas的gateway接入 考虑到飞马只对接期货(目前只有中金所), vtSymbol直接使用symbol ''' import os import json from vnpy.api.femas import MdApi, TdApi, defineDict from vnpy.trader.vtFunction import getTempPath, getJsonPath from vnpy.trader.vtGateway import * # 以下为一些VT类型和CTP类型的映射字典 # 价格类型映射 priceTypeMap = {} priceTypeM...
unknown
codeparrot/codeparrot-clean
"""Handle Konnected messages.""" import logging from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_STATE, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, ) from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.util import decorator from .const import CONF_INVERSE, ...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.test.test_reflect -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Standardized versions of various cool and/or strange things that you can do with Python's reflection capabilities. """ import sys from .compat import PY3 class _NoModuleFound(Exception): ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''This utility cleans up the html files as emitted by doxygen so that they are suitable for publication on a Google documentation ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Howto Square # Generated: Thu Nov 12 11:26:07 2009 ################################################## import howto from gnuradio import eng_notation from gnuradio import gr from gnuradio.eng_option import eng...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 // This program is the generator for the gRPC service wrapper types in the // parent directory. It's not suitable for any other use. // // This makes various assumptions about how the protobuf compiler and // gRPC stub generators produce code. If th...
go
github
https://github.com/hashicorp/terraform
internal/rpcapi/dynrpcserver/generator/main.go
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
unknown
codeparrot/codeparrot-clean
"""Test that lldb command 'process signal SIGUSR1' to send a signal to the inferior works.""" import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class SendSignalTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(...
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
github
https://github.com/apache/kafka
.github/actions/gh-api-approve-run/action.yml
# Prepare component for translation To prepare your project for translation, complete the following actions. - Use the `i18n` attribute to mark text in component templates - Use the `i18n-` attribute to mark attribute text strings in component templates - Use the `$localize` tagged message string to mark text strings...
unknown
github
https://github.com/angular/angular
adev/src/content/guide/i18n/prepare.md
from django.contrib.gis.db.models import Collect, Count, Extent, F, MakeLine, Q, Union from django.contrib.gis.db.models.functions import Centroid from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point from django.db import NotSupportedError, connection from django.test import TestCase, skipUnlessDBFeature...
python
github
https://github.com/django/django
tests/gis_tests/relatedapp/tests.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
unknown
codeparrot/codeparrot-clean
/* * Copyright 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-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/AnyNestedConditionTests.java
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urllib.parse # Convert an IRI to a URI following the rules in RFC 3987 # # The charac...
unknown
codeparrot/codeparrot-clean
{ "name": "antora", "lockfileVersion": 3, "requires": true, "packages": { "": { "dependencies": { "@antora/atlas-extension": "1.0.0-alpha.5", "@antora/cli": "3.2.0-alpha.11", "@antora/site-generator": "3.2.0-alpha.11", "@asciidoctor/tabs": "1.0.0-beta.6", "@spri...
json
github
https://github.com/spring-projects/spring-boot
antora/package-lock.json
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
unknown
codeparrot/codeparrot-clean
name: Release Sources permissions: contents: read on: workflow_dispatch: inputs: release-version: description: Release Version required: true type: string workflow_call: inputs: release-version: description: Release Version required: true type:...
unknown
github
https://github.com/llvm/llvm-project
.github/workflows/release-sources.yml
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import slugify from django.test import SimpleTestCase from django.utils import six from django.utils.encoding import force_text from django.utils.functional import lazy from django.utils.safestring import mark_safe fro...
unknown
codeparrot/codeparrot-clean
/* * 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...
kotlin
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/kotlin/org/springframework/docs/dataaccess/jdbc/jdbccomplextypes/TestItemStoredProcedure.kt
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
unknown
codeparrot/codeparrot-clean
import random import unittest import uuid import time import yaml import os.path from sync.synchronizer import Synchronizer, es_scan ASSETS_DIR = os.path.join(os.path.dirname(__file__), "..", "assets") def load_config_dict(): with file(os.path.join(ASSETS_DIR, "config.yaml")) as f: return yaml.load(f) c...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ Desc: 如何将原有的《Python Cookbook》3rd edition.pdf文件转换为我自己的cookbook翻译项目格式 1. 首先使用在线PDF文件切割截取出自己想要的pdf文件部分:http://smallpdf.com/split-pdf 2. 安装PDFMiner依赖,然后使用:pdf2txt.py -o pc.txt /home/mango/work/perfect.pdf生成的txt文件 3. 把生成的txt文件放到idea中,去除某些没用的符号,比如'口'字符,全局replace 4. 调用beaut...
unknown
codeparrot/codeparrot-clean
//go:build windows package windows import ( "context" "encoding/json" "errors" "fmt" "net" "github.com/containerd/log" "github.com/moby/moby/v2/daemon/libnetwork/datastore" "github.com/moby/moby/v2/daemon/libnetwork/types" ) const ( windowsPrefix = "windows" windowsEndpointPrefix = "windows-endpoi...
go
github
https://github.com/moby/moby
daemon/libnetwork/drivers/windows/windows_store.go
/* @file remove_transaction_safe @Copyright Barrett Adair 2015-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP #define BOOST_CLBL_TRTS_REMOVE_TRANSACTION_SAFE_HPP #in...
unknown
github
https://github.com/mysql/mysql-server
extra/boost/boost_1_87_0/boost/callable_traits/remove_transaction_safe.hpp
//===--- TestTU.h - Scratch source files for testing -------------*- C++-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
clang-tools-extra/clangd/unittests/TestTU.h
// Code generated by "enumer -type=RolePathPolicy -text -json -transform=kebab-case"; DO NOT EDIT. package pki_backend import ( "encoding/json" "fmt" ) const _RolePathPolicyName = "RPPUnknownRPPSignVerbatimRPPRole" var _RolePathPolicyIndex = [...]uint8{0, 10, 25, 32} func (i RolePathPolicy) String() string { if...
go
github
https://github.com/hashicorp/vault
builtin/logical/pki/pki_backend/rolepathpolicy_enumer.go
# -*- coding: utf-8 -*- from __future__ import with_statement import itertools from django.conf import settings from django.contrib import admin from django.contrib.auth import get_user_model, get_permission_codename from django.contrib.auth.models import Permission from django.contrib.messages.storage import default_...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ flask.ext.wtf ~~~~~~~~~~~~ Flask-WTF extension :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ try: import sqlalchemy _is_sqlalchemy = True except ImportError: _is_sqlalchemy = False from wtforms import fields, widgets, ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python2 import requests import os import getpass import argparse from os.path import expanduser def main(): home = expanduser("~") config = os.path.join(home,'.wa_api_key') parser = argparse.ArgumentParser() parser.add_argument('-s','--short', action="store_true",help="Return just the answe...
unknown
codeparrot/codeparrot-clean
from fabric import colors from fabric import api as fab from fabric import decorators from fabric.contrib import files from termcastTemplates import termcastTemplate, termcastPlayTemplate import os, getpass fab.env.colors = True COMMANDS = ('sudo apt-get install ttyrec screen', ) SCRIPTS = ('termcast', 'ter...
unknown
codeparrot/codeparrot-clean
""" urllib3 - Thread-safe connection pooling and re-using. """ from __future__ import absolute_import import warnings from .connectionpool import ( HTTPConnectionPool, HTTPSConnectionPool, connection_from_url ) from . import exceptions from .filepost import encode_multipart_formdata from .poolmanager impo...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true # :markup: markdown module AbstractController module Caching # # Abstract Controller Caching Fragments # # Fragment caching is used for caching various blocks within views without # caching the entire action as a whole. This is useful when certain elements of # an a...
ruby
github
https://github.com/rails/rails
actionpack/lib/abstract_controller/caching/fragments.rb
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
unknown
codeparrot/codeparrot-clean
# Emulates GDAL's gdal_polygonize.py import argparse import logging import subprocess import sys import fiona import numpy as np import rasterio from rasterio.features import shapes logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger('rasterio_polygonize') def main(raster_file, vec...
unknown
codeparrot/codeparrot-clean
import * as ts from "../../_namespaces/ts.js"; import { dedent } from "../../_namespaces/Utils.js"; import { jsonToReadableText } from "../helpers.js"; import { verifyAlternateResultScenario } from "../helpers/alternateResult.js"; import { solutionBuildWithBaseline } from "../helpers/solutionBuilder.js"; import { b...
typescript
github
https://github.com/microsoft/TypeScript
src/testRunner/unittests/tsserver/moduleResolution.ts
"""Extract, format and print information about Python stack traces.""" import linecache import sys import types __all__ = ['extract_stack', 'extract_tb', 'format_exception', 'format_exception_only', 'format_list', 'format_stack', 'format_tb', 'print_exc', 'format_exc', 'print_exception', ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import sys sys.path[0:0] = [""] import unittest from mongoengine import * from mongoengine.connection import get_db __all__ = ("GeoFieldTest", ) class GeoFieldTest(unittest.TestCase): def setUp(self): connect(db='mongoenginetest') self.db = get_db() def _test_for_ex...
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 # dist...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- DOCUMENTATION = ''' --- module: campfire version_added: "1.2" short_description: Send a message to Campfire description: - Send a message to Campfire. - Messages with newlines will result in a "Paste" message being sent. version_added: "1.2" options: subscription: ...
unknown
codeparrot/codeparrot-clean
# -*- 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 -*- from django.test import TestCase from django.test.client import RequestFactory from djangular.core.urlresolvers import get_all_remote_methods, get_current_remote_methods from .urls import RemoteMethodsView class TemplateRemoteMethods(TestCase): urls = 'server.tests.urls' def setUp(self...
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/test/java/org/apache/kafka/common/telemetry/internals/SinglePointMetricTest.java
import time import traceback from datetime import date, datetime, timedelta from threading import Thread from django.core.exceptions import FieldError from django.db import DatabaseError, IntegrityError, connection from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, ignore_warnings, skipUn...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2.7 # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
unknown
codeparrot/codeparrot-clean
{ "groups": [ { "name": "relaxed", "type": "com.example.SourceType" } ], "properties": [ { "name": "test.two", "type": "java.lang.String" }, { "name": "test.four", "type": "java.util.Map<java.lang.String,java.lang.String>" }, { "name": "wrong.o...
json
github
https://github.com/spring-projects/spring-boot
core/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json
//===--- RelativePointer.h - Relative Pointer Support -----------*- 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/RelativePointer.h
# -*- coding: utf-8 -*- # Copyright 2010-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...
unknown
codeparrot/codeparrot-clean
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import tempfile import unittest from telemetry.core import browser_credentials SIMPLE_CREDENTIALS_STRING = """ { "google": { "username": "ex...
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\Component\HttpClient; use Symfony\Component\HttpClient\Exceptio...
php
github
https://github.com/symfony/symfony
src/Symfony/Component/HttpClient/NoPrivateNetworkHttpClient.php
/* Copyright 2016 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/api/testing/defaulting_test.go
//===--- ASTBridging.h - header for the swift SILBridging module ----------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2022 - 2025 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/AST/ASTBridging.h
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: MPL-2.0 package plugin import ( "crypto/tls" "math" "os" log "github.com/hashicorp/go-hclog" plugin "github.com/hashicorp/go-plugin" "github.com/hashicorp/vault/sdk/helper/pluginutil" "github.com/hashicorp/vault/sdk/logical" "google.golang.org/grp...
go
github
https://github.com/hashicorp/vault
sdk/plugin/serve.go
# -*- coding: utf-8 -*- # # This file is part of Bika LIMS # # Copyright 2011-2016 by it's authors. # Some rights reserved. See LICENSE.txt, AUTHORS.txt. from plone import api from bika.lims import logger def SetDepartmentCookies(event): """Login event handler. When user logs in for the first time, we are set...
unknown
codeparrot/codeparrot-clean
# UrbanFootprint v1.5 # Copyright (C) 2017 Calthorpe Analytics # # This file is part of UrbanFootprint version 1.5 # # UrbanFootprint is distributed under the terms of the GNU General # Public License version 3, as published by the Free Software Foundation. This # code is distributed WITHOUT ANY WARRANTY, without impli...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2.7 """ File : update_db.py Author : Bjorn Barrefors <bjorn dot peter dot barrefors AT cern dot ch> Description: Update database and keep learning """ # system modules import logging import sys import getopt import datetime from logging.handlers import TimedRotatingFileHandler # package...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- MISC_HTML_SOURCE = """ <font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font> <div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo...
unknown
codeparrot/codeparrot-clean
import os import codecs from os import path from docutils import nodes from docutils.parsers.rst import Directive, directives class IncludeCode(Directive): """ Include a code example from a file with sections delimited with special comments. """ has_content = False required_arguments = 1 opti...
unknown
codeparrot/codeparrot-clean
package client import ( "context" "fmt" "io" "net/url" "time" "github.com/moby/moby/client/internal/timestamp" ) // ContainerLogsOptions holds parameters to filter logs with. type ContainerLogsOptions struct { ShowStdout bool ShowStderr bool Since string Until string Timestamps bool Follow ...
go
github
https://github.com/moby/moby
client/container_logs.go
# -*- coding: utf-8 -*- import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import models from picklefield.fields import PickledObjectField import hashlib, random, sys, os, time VERIFIER_EXPIRE_DAYS = getattr(settings, 'VERIFIER_EXPIRE_DAYS', 3) __all__ = ['N...
unknown
codeparrot/codeparrot-clean
from django.contrib.auth.hashers import make_password from django.contrib.auth.templatetags.auth import render_password_as_hash from django.test import SimpleTestCase, override_settings class RenderPasswordAsHashTests(SimpleTestCase): @override_settings( PASSWORD_HASHERS=["django.contrib.auth.hashers.PBKDF...
python
github
https://github.com/django/django
tests/auth_tests/test_templatetags.py
//===-- Import.h - Representation of imports --------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2020 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/AST/Import.h
# NOTE: This is a common file that is overwritten by realm/ci-actions sync service # and should only be modified in that repository. name: No Response # Both `issue_comment` and `scheduled` event types are required for this Action # to work properly. on: issue_comment: types: [created] schedule: # Schedul...
unknown
github
https://github.com/realm/realm-swift
.github/workflows/no-response.yml
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis...
unknown
codeparrot/codeparrot-clean
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
c
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.h
""" Evaluate expressions. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.geometry_utilities.evaluate_elements im...
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 (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
unknown
codeparrot/codeparrot-clean
# IMAP folder support # Copyright (C) 2002-2007 John Goerzen # <jgoerzen@complete.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 you...
unknown
codeparrot/codeparrot-clean
from django.conf import settings """ This file attempts to automatically load the denorm backend for your chosen database adaptor. Currently only mysql, postgresql and sqlite3 are supported. If your database is not detected then you can specify the backend in your settings file: # Django < 1.2 DATABASE_DENORM_BACKEN...
unknown
codeparrot/codeparrot-clean
""" NCL User Guide Python Example: PyNGL_curvilinear_contour.py - curvilinear data - colormap - draw edges 04.06.15 kmf """ import Ngl,Nio import os,sys #-- define variables diri = "./" #-- data directory fname = "tos_ocean_bipolar_grid.nc" #-- curvilinear ...
unknown
codeparrot/codeparrot-clean
# Scanner produces tokens of the following types: # STREAM-START # STREAM-END # DIRECTIVE(name, value) # DOCUMENT-START # DOCUMENT-END # BLOCK-SEQUENCE-START # BLOCK-MAPPING-START # BLOCK-END # FLOW-SEQUENCE-START # FLOW-MAPPING-START # FLOW-SEQUENCE-END # FLOW-MAPPING-END # BLOCK-ENTRY # FLOW-ENTRY # KEY # VALUE # ALI...
unknown
codeparrot/codeparrot-clean
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the CockroachDB Software License // included in the /LICENSE file. package server import ( "context" "fmt" "sort" "strconv" "strings" "testing" "time" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockro...
go
github
https://github.com/cockroachdb/cockroach
pkg/server/pagination_test.go
from twisted.plugin import IPlugin from txircd.module_interface import IMode, IModuleData, Mode, ModuleData from txircd.utils import ModeType from zope.interface import implements class InvisibleMode(ModuleData, Mode): implements(IPlugin, IModuleData, IMode) name = "InvisibleMode" core = True affectedActions = { ...
unknown
codeparrot/codeparrot-clean
{ "compilerOptions": { "target": "es5", "module": "esnext", "jsx": "react-jsx", "strict": false, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "noEmit": true, "moduleResolu...
json
github
https://github.com/vercel/next.js
examples/cms-sitefinity/tsconfig.json
from browser import window, alert def _randint(a, b): return int(window.Math.random()*(b-a+1)+a) def _rand_with_seed(x, rand_obj): x = window.Math.sin(rand_obj._state) * 10000 # Adding 1 is not reliable because of current integer implementation # If rand_obj._state is not a "safe integer" in the range...
unknown
codeparrot/codeparrot-clean
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
unknown
codeparrot/codeparrot-clean
export const runtime = 'edge'; export const dynamic = 'force-dynamic'; export const dynamicParams = false; export const fetchCache = 'force-no-store'; export const revalidate = 1;
javascript
github
https://github.com/vercel/next.js
crates/next-custom-transforms/tests/errors/react-server-components/server-graph/cache-components/output.js
//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
cpp
github
https://github.com/llvm/llvm-project
clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
use std::collections::BTreeMap; use anyhow::Result; use indoc::formatdoc; use turbo_rcstr::rcstr; use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ chunk::{AsyncModuleInfo, ChunkableModule, ChunkingContext, ModuleChunkItemIdExt}, ident::AssetIdent, module::{Module...
rust
github
https://github.com/vercel/next.js
crates/next-core/src/next_server_utility/server_utility_module.rs
#!/bin/sh test_description="recursive merge with directory renames" # includes checking of many corner cases, with a similar methodology to: # t6042: corner cases with renames but not criss-cross merges # t6036: corner cases with both renames and criss-cross merges # # The setup for all of them, pictorially, is: #...
unknown
github
https://github.com/git/git
t/t6423-merge-rename-directories.sh
--- title: "@react-router/{adapter}" --- # Server Adapters ## Official Adapters Idiomatic React Router apps can generally be deployed anywhere because React Router adapts the server's request/response to the [Web Fetch API][web-fetch-api]. It does this through adapters. We maintain a few adapters: - `@react-router/...
unknown
github
https://github.com/remix-run/react-router
docs/api/other-api/adapter.md
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from numpy import (abs, sum, sin, cos, sqrt, log, prod, where, pi, exp, arange, floor, log10, atleast_2d, zeros) from .go_benchmark import Benchmark class Parsopoulos(Benchmark): r""" Parsopoulos objec...
unknown
codeparrot/codeparrot-clean
/*------------------------------------------------------------------------- * * tupdesc.h * POSTGRES tuple descriptor definitions. * * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/access/tupdesc....
c
github
https://github.com/postgres/postgres
src/include/access/tupdesc.h
"""Tests for distutils.command.check.""" import unittest from test.support import run_unittest from distutils.command.check import check, HAS_DOCUTILS from distutils.tests import support from distutils.errors import DistutilsSetupError class CheckTestCase(support.LoggingSilencer, support.TempdirMa...
unknown
codeparrot/codeparrot-clean
// Copyright The Prometheus 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 w...
go
github
https://github.com/prometheus/prometheus
cmd/prometheus/main_unix_test.go
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package command import ( "fmt" "os" "path/filepath" "runtime" "strings" "testing" "github.com/hashicorp/cli" "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/depsfile" "github.com/hashicorp/terraf...
go
github
https://github.com/hashicorp/terraform
internal/command/providers_lock_test.go
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'SoftwareSecurePhotoVerification.window' db.delete_column...
unknown
codeparrot/codeparrot-clean