code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# -*- coding: utf-8 -*- import uuid from openerp import api, fields, models, _ class Rating(models.Model): _name = "rating.rating" _description = "Rating" _order = 'create_date desc' _rec_name = 'res_name' _sql_constraints = [ ('rating_range', 'check(rating >= -1 and rating <= 10)', 'Ratin...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # Copyright 2008 the V8 project authors. # Copyright 2023 Microsoft Inc. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys from utils import SearchFiles if __name__ == '__main__': try: files = SearchFiles(*sys.argv[...
python
github
https://github.com/nodejs/node
tools/search_files.py
import * as ts from "../../_namespaces/ts.js"; import { jsonToReadableText } from "../helpers.js"; describe("unittests:: services:: PreProcessFile:", () => { function test(sourceText: string, readImportFile: boolean, detectJavaScriptImports: boolean, expectedPreProcess: ts.PreProcessedFileInfo): void { con...
typescript
github
https://github.com/microsoft/TypeScript
src/testRunner/unittests/services/preProcessFile.ts
# frozen_string_literal: true require "active_support/log_subscriber" module ActiveJob class LogSubscriber < ActiveSupport::EventReporter::LogSubscriber # :nodoc: class_attribute :backtrace_cleaner, default: ActiveSupport::BacktraceCleaner.new self.namespace = "active_job" def enqueued(event) pa...
ruby
github
https://github.com/rails/rails
activejob/lib/active_job/log_subscriber.rb
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import from django.conf import settings from django.test import TestCase from zerver.lib import bugdown from zerver.lib.actions import ( check_add_realm_emoji, do_remove_realm_emoji, do_set_alert_words, get_re...
unknown
codeparrot/codeparrot-clean
''' Created on 10/11/2009 @author: Fernando Copyright 2009-2013 Fernando J. V. da Silva This file is part of centering_py. centering_py 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, eithe...
unknown
codeparrot/codeparrot-clean
""" Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application. """ import json import logging import os import re import sys import warnings try: from django.core.exceptions import ImproperlyConfigured except ImportError: class ImproperlyConfigured(Except...
unknown
codeparrot/codeparrot-clean
# Copyright 2014 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. """The testing Environment class. It holds the WebsiteTest instances, provides them with credentials, provides clean browser environment, runs the tests, an...
unknown
codeparrot/codeparrot-clean
package v0alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" common "k8s.io/kube-openapi/pkg/common" spec "k8s.io/kube-openapi/pkg/validation/spec" ) func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ AlertRule{}....
go
github
https://github.com/grafana/grafana
apps/alerting/rules/pkg/apis/alerting/v0alpha1/zz_openapi_gen.go
import os from django.test import RequestFactory from onadata.apps.api.tests.viewsets.test_abstract_viewset import \ TestAbstractViewSet from onadata.apps.api.viewsets.osm_viewset import OsmViewSet from onadata.apps.api.viewsets.xform_viewset import XFormViewSet from onadata.apps.logger.models import Attachment ...
unknown
codeparrot/codeparrot-clean
{ "title": "Add routing", "type": "local", "answerSrc": "../11-details-page/src", "answerRootDir": "../11-details-page/", "openFiles": ["src/main.ts", "src/app/app.ts"] }
json
github
https://github.com/angular/angular
adev/src/content/tutorials/first-app/steps/10-routing/config.json
""" Enhanced Metafile backend. See http://pyemf.sourceforge.net for the EMF driver library. """ from __future__ import division try: import pyemf except ImportError: raise ImportError('You must first install pyemf from http://pyemf.sf.net') import os,sys,math,re from matplotlib import verbose, __version__,...
unknown
codeparrot/codeparrot-clean
{ "description": "i18n", "files":[ "!**/*.d.ts", "!**/*.js", "!**/*.[0-9].*", "!doc-files/**/*", "**/*.xlf" ], "file": "src/app/app.component.ts", "tags": ["Angular", "i18n", "internationalization"], "devDependencies": ["@angular/compiler-cli", "typescript"] }
json
github
https://github.com/angular/angular
adev/src/content/examples/i18n/stackblitz.json
# 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) from pants.backend.p...
unknown
codeparrot/codeparrot-clean
import pytest import numpy as np from numpy._core.multiarray import _vec_string from numpy.testing import ( assert_, assert_array_equal, assert_equal, assert_raises, assert_raises_regex, ) kw_unicode_true = {'unicode': True} # make 2to3 work properly kw_unicode_false = {'unicode': False} ignore_...
python
github
https://github.com/numpy/numpy
numpy/_core/tests/test_defchararray.py
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ..._models import BaseModel __all__ = ["ResponseMcpCallInProgress"] class ResponseMcpCallInProgress(BaseModel): """Returned when an MCP tool call has started and is in progress.""" ...
python
github
https://github.com/openai/openai-python
src/openai/types/realtime/response_mcp_call_in_progress.py
import attr import importscan import sentaku from cfme.generic_objects.definition.button_groups import GenericObjectButtonGroupsCollection from cfme.generic_objects.definition.button_groups import GenericObjectButtonsCollection from cfme.generic_objects.instance import GenericObjectInstanceCollection from cfme.modelin...
unknown
codeparrot/codeparrot-clean
--- mapped_pages: - https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-icu-normalization.html --- # ICU normalization token filter [analysis-icu-normalization] Normalizes characters as explained [here](https://unicode-org.github.io/icu/userguide/transforms/normalization/). It registers itself as...
unknown
github
https://github.com/elastic/elasticsearch
docs/reference/elasticsearch-plugins/analysis-icu-normalization.md
""" This module parse an UPnP device's XML definition in an Object. @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from xml.dom import minidom import logging # Allowed UPnP services to use when ...
unknown
codeparrot/codeparrot-clean
#include <c10/util/Exception.h> #include <c10/util/ThreadLocal.h> #include <c10/util/ThreadLocalDebugInfo.h> #include <utility> namespace c10 { C10_DEFINE_TLS_static(std::shared_ptr<ThreadLocalDebugInfo>, tls_debug_info); #define debug_info (tls_debug_info.get()) /* static */ DebugInfoBase* ThreadLocalDebugInfo::ge...
cpp
github
https://github.com/pytorch/pytorch
c10/util/ThreadLocalDebugInfo.cpp
{ "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "esModuleInterop": true, "declaration": false, "experimentalDecorators": true, "module": "es2022", "moduleResolution": "bundler", "importHelpers": true, "target": "e...
json
github
https://github.com/angular/angular
integration/cli-hello-world-ivy-i18n/tsconfig.json
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 Softwa...
unknown
codeparrot/codeparrot-clean
# -*- encoding: 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 G...
unknown
codeparrot/codeparrot-clean
#!/bin/bash # Script used only in CD pipeline set -eux ACL_VERSION=${ACL_VERSION:-"v52.6.0"} ACL_INSTALL_DIR="/acl" # Clone ACL git clone https://github.com/ARM-software/ComputeLibrary.git -b "${ACL_VERSION}" --depth 1 --shallow-submodules ACL_CHECKOUT_DIR="ComputeLibrary" # Build with scons pushd $ACL_CHECKOUT_DIR...
unknown
github
https://github.com/pytorch/pytorch
.ci/docker/common/install_acl.sh
//===--- ArgsToFrontendOutputsConverter.cpp -------------------------------===// // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICE...
cpp
github
https://github.com/apple/swift
lib/Frontend/ArgsToFrontendOutputsConverter.cpp
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time import math import argparse import pickle import jieba import numpy as np import tensorflow as tf from data_loader import TextLoader from rnn_model import RNNModel from rnn_model import BIDIRNNModel from cnn_model import CNNModel class RNNClassif...
unknown
codeparrot/codeparrot-clean
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import codecs import logging import os import chardet import pysrt from .score import get_equivalent_release_groups from .video import Episode, Movie from .utils import sanitize, sanitize_release_group logger = logging.getLogger(__name__) #: Subtitle extensions SUBTITLE_EXTENSIONS = ('.srt',...
unknown
codeparrot/codeparrot-clean
"""Routine to "compile" a .py file to a .pyc (or .pyo) file. This module has intimate knowledge of the format of .pyc files. """ import builtins import errno import imp import marshal import os import sys import tokenize import traceback MAGIC = imp.get_magic() __all__ = ["compile", "main", "PyCompileError"] class...
unknown
codeparrot/codeparrot-clean
#ifndef NUMPY_SRC_COMMON_NPYSORT_QUICKSORT_HPP #define NUMPY_SRC_COMMON_NPYSORT_QUICKSORT_HPP #include "heapsort.hpp" #include "common.hpp" namespace np::sort { // pushing largest partition has upper bound of log2(n) space // we store two pointers each time constexpr size_t kQuickStack = sizeof(intptr_t) * 8 * 2; co...
unknown
github
https://github.com/numpy/numpy
numpy/_core/src/npysort/quicksort.hpp
# -*- coding: utf8 -*- from PyQt5.QtWidgets import QPushButton, QWidget from PyQt5.QtWidgets import QComboBox, QLabel, QLineEdit, QDoubleSpinBox from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QFormLayout from PyQt5.QtWidgets import QSpinBox from PyQt5.QtCore import Qt from PDielec.Constants import ...
unknown
codeparrot/codeparrot-clean
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
unknown
codeparrot/codeparrot-clean
# encoding: utf-8 import sys import datetime from south.db import db from south.v2 import DataMigration from django.db import models from askbot.utils.console import ProgressBar class Migration(DataMigration): def forwards(self, orm): # ContentType for Post model should be created no later than in migrati...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
unknown
codeparrot/codeparrot-clean
# 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. """Wrappers for gsutil, for basic interaction with Google Cloud Storage.""" import cStringIO import hashlib import logging import os import subprocess i...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # 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 Lic...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """sdist tests""" import locale import os import shutil import sys import tempfile import unittest import unicodedata import re from setuptools.tests import environment, test_svn from setuptools.tests.py26compat import skipIf from setuptools.compat import StringIO, unicode from setuptools.test...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
unknown
codeparrot/codeparrot-clean
package usergroup import ( "github.com/moby/sys/user" ) const ( subuidFileName = "/etc/subuid" subgidFileName = "/etc/subgid" ) func parseSubuid(username string) ([]user.SubID, error) { return user.ParseSubIDFileFilter(subuidFileName, func(sid user.SubID) bool { return sid.Name == username }) } func parseSub...
go
github
https://github.com/moby/moby
daemon/internal/usergroup/parser.go
#ifndef JEMALLOC_INTERNAL_ATOMIC_C11_H #define JEMALLOC_INTERNAL_ATOMIC_C11_H #include <stdatomic.h> #define ATOMIC_INIT(...) ATOMIC_VAR_INIT(__VA_ARGS__) #define atomic_memory_order_t memory_order #define atomic_memory_order_relaxed memory_order_relaxed #define atomic_memory_order_acquire memory_order_acquire #defi...
c
github
https://github.com/redis/redis
deps/jemalloc/include/jemalloc/internal/atomic_c11.h
# -*- coding: utf-8 -*- """ S3 Logging Facility @copyright: (c) 2015 Sahana Software Foundation @license: MIT 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 rest...
unknown
codeparrot/codeparrot-clean
import pytest from thefuck.rules.fab_command_not_found import match, get_new_command from thefuck.types import Command output = ''' Warning: Command(s) not found: extenson deloyp Available commands: update_config prepare_extension Template A string class for supporting $-substitutio...
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
# Copyright 2014 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. from telemetry.page import action_runner from telemetry.page import page_test from telemetry.timeline.model import TimelineModel from telemetry.timeline impo...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_socialprofiles # Purpose: Obtains social media profiles of any identified human names. # # Author: Steve Micallef <steve@binarypool.com> # # Created: 12/04/2014 # Copyright: (c) ...
unknown
codeparrot/codeparrot-clean
"""Let's Encrypt compatibility test interfaces""" import zope.interface import letsencrypt.interfaces # pylint: disable=no-self-argument,no-method-argument class IPluginProxy(zope.interface.Interface): """Wraps a Let's Encrypt plugin""" http_port = zope.interface.Attribute( "The port to connect to on...
unknown
codeparrot/codeparrot-clean
""" ================================================== Probability Calibration for 3-class classification ================================================== This example illustrates how sigmoid :ref:`calibration <calibration>` changes predicted probabilities for a 3-class classification problem. Illustrated is the sta...
python
github
https://github.com/scikit-learn/scikit-learn
examples/calibration/plot_calibration_multiclass.py
it("should allow to import an async module twice", async () => { const result = await require("./main"); expect(result.default).toBe("hello world, hello world"); });
javascript
github
https://github.com/webpack/webpack
test/cases/async-modules/double-import/index.js
############################################################################### # # # 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 # ...
unknown
codeparrot/codeparrot-clean
# mssql/pyodbc.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 """ .. dialect:: mssql+pyodbc :name: PyODBC :dbapi: pyodbc :connectstrin...
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...
java
github
https://github.com/spring-projects/spring-framework
integration-tests/src/test/java/org/springframework/expression/spel/support/BeanFactoryTypeConverter.java
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Database; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model as Eloquent; use Illuminate\Database\Eloqu...
php
github
https://github.com/laravel/framework
tests/Database/DatabaseEloquentInverseRelationHasOneTest.php
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockitousage.bugs.injection; import static org.junit.Assert.*; import java.lang.reflect.Field; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; im...
java
github
https://github.com/mockito/mockito
mockito-core/src/test/java/org/mockitousage/bugs/injection/InjectionByTypeShouldFirstLookForExactTypeThenAncestorTest.java
export const enum WalkAction { // Continue walking the tree. Default behavior. Continue, // Skip walking into the current node. Skip, // Stop walking the tree entirely. Stop, } interface Walkable<T> { each(cb: (node: T, index: number) => void): void } // Custom walk implementation where we can skip go...
typescript
github
https://github.com/tailwindlabs/tailwindcss
packages/@tailwindcss-upgrade/src/utils/walk.ts
# coding=utf-8 ############################################################################### ## ## Copyright 2011 Tavendo GmbH ## ## 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 ## ##...
unknown
codeparrot/codeparrot-clean
from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import NotFound from modularodm import Q from framework.auth.core import User from framework.auth.oauth_scopes import CoreScopes from website.models import NodeLog, Node from api.nodes.permissions import ( Contribut...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python3 # # sleep_sort.py - A unique approach to sorting numbers :-) # Usage: sleep_sort.py 6 1 9 7 # 1 # 6 # 7 # 9 # # Copyright (C) 2019 Michael Davies <michael@the-davies.net> # # This program is free software; you can red...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import logging import re import warnings from typing import TYPE_CHECKING from scrapy import Request, Spider, signals from scrapy.exceptions import IgnoreRequest from scrapy.utils.decorators import _warn_spider_arg from scrapy.utils.httpobj import urlparse_cached if TYPE_CHECKING: ...
python
github
https://github.com/scrapy/scrapy
scrapy/downloadermiddlewares/offsite.py
import zlib __doc__ = zlib.__doc__ del zlib from zlib import *
python
github
https://github.com/python/cpython
Lib/compression/zlib.py
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from...
unknown
codeparrot/codeparrot-clean
""" Defines a form for providing validation of CourseEmail templates. """ import logging from django import forms from django.core.exceptions import ValidationError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from six import text_type from bulk_email.models import COURSE_EMAIL_M...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.analysis.api.platform import com.intellij.openapi.components.service import com....
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-platform-interface/src/org/jetbrains/kotlin/analysis/api/platform/KotlinPlatformSettings.kt
# -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS 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 script provides CLI access to run security tests on a Chrome OS images. The entry point is available as image_lib.Securit...
unknown
codeparrot/codeparrot-clean
"""report.py - Utilities for reporting statistics about benchmark results """ import os import re import copy class BenchmarkColor(object): def __init__(self, name, code): self.name = name self.code = code def __repr__(self): return '%s%r' % (self.__class__.__name__, ...
unknown
codeparrot/codeparrot-clean
""" The httplib2 algorithms ported for use with requests. """ import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer URI = re.compile(r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#...
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 sys from nose.plugins.skip import SkipTest i...
unknown
codeparrot/codeparrot-clean
# Just like ThreadedResolver, but doesn't suck # # The contents of this file are subject to the Python Software Foundation # License Version 2.3 (the License). You may not copy or use this file, in # either source code or executable form, except in compliance with the License. # You may obtain a copy of the License at...
unknown
codeparrot/codeparrot-clean
import pytest from unittest import mock import json # AWX models from awx.main.models import ( ActivityStream, Organization, JobTemplate, Credential, CredentialType, Inventory, InventorySource, Project, User ) # other AWX from awx.main.utils import model_to_dict, model_instance_di...
unknown
codeparrot/codeparrot-clean
/* Copyright 2021 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/sparse_reorder_op.h
# -*- coding: utf-8 -*- from xhtml2pdf.context import pisaContext from xhtml2pdf.default import DEFAULT_CSS from xhtml2pdf.parser import pisaParser from reportlab.platypus.flowables import Spacer from reportlab.platypus.frames import Frame from xhtml2pdf.xhtml2pdf_reportlab import PmlBaseDoc, PmlPageTemplate from xhtml...
unknown
codeparrot/codeparrot-clean
#### Note: this error code is no longer emitted by the compiler. More than one function was declared with the `#[main]` attribute. Erroneous code example: ```compile_fail #![feature(main)] #[main] fn foo() {} #[main] fn f() {} // error: multiple functions with a `#[main]` attribute ``` This error indicates that t...
unknown
github
https://github.com/rust-lang/rust
compiler/rustc_error_codes/src/error_codes/E0137.md
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
unknown
codeparrot/codeparrot-clean
package client import ( "context" "encoding/json" "errors" "net/url" "github.com/distribution/reference" "github.com/moby/moby/api/types/container" ) // ContainerCommitOptions holds parameters to commit changes into a container. type ContainerCommitOptions struct { Reference string Comment string Author ...
go
github
https://github.com/moby/moby
client/container_commit.go
#!/usr/bin/python # # # # # Usage: $0 SERVER PROXY:PORT [SYSTEMID] [PROXY_USER] [PROXY_PASS] import sys import httplib sys.path.append('..') from rhn.rpclib import Server SERVER = "xmlrpc.rhn.redhat.com" HANDLER = "/XMLRPC" PROXY = "proxy.example.com:8080" PROXY_USERNAME = None PROXY_PASSWORD = None system_id_file = ...
unknown
codeparrot/codeparrot-clean
// This file is part of ICU4X. For terms of use, please see the file // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). mod fixtures; mod helpers; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use icu_locale_c...
rust
github
https://github.com/nodejs/node
deps/crates/vendor/icu_locale_core/benches/locale.rs
#! /usr/bin/env python from __future__ import absolute_import import json import re import os import logging from validator import Validator from validator.utils import find_file PAT = re.compile('\s+-->\s(?P<fname>.*?):(?P<lnum>\d+):(?P<col>\d+)') logger = logging.getLogger('validator') class Cargo(Validator): ...
unknown
codeparrot/codeparrot-clean
# Copyright 2000-2004 Michael Hudson-Doyle <micahel@gmail.com> # # All Rights Reserved # # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose is hereby granted without fee, # provided that the above copyright notice appear in all copies and #...
python
github
https://github.com/python/cpython
Lib/_pyrepl/console.py
number_string = """08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 2...
unknown
codeparrot/codeparrot-clean
use crate::internals::ast::{Container, Data, Field, Style, Variant}; use crate::private; use proc_macro2::TokenStream; use quote::{format_ident, quote}; // Suppress dead_code warnings that would otherwise appear when using a remote // derive. Other than this pretend code, a struct annotated with remote derive // never...
rust
github
https://github.com/serde-rs/serde
serde_derive/src/pretend.rs
# SPDX-License-Identifier: GPL-2.0-only %YAML 1.2 --- $id: http://devicetree.org/schemas/crypto/qcom,prng.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: Qualcomm Pseudo Random Number Generator maintainers: - Vinod Koul <vkoul@kernel.org> properties: compatible: oneOf: - enum: ...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/crypto/qcom,prng.yaml
from __future__ import division, absolute_import, print_function from numpy.testing import * import numpy as np class TestFinancial(TestCase): def test_rate(self): assert_almost_equal(np.rate(10, 0, -3500, 10000), 0.1107, 4) def test_irr(self): v = [-150000, 15000,...
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
from . import AbstractIndicator # this class is responsible for estimating distance to the next extremum (minimum or maximum) # on the x axis class ExtremumFinder(AbstractIndicator): def __init__(self): AbstractIndicator.__init__(self) self.reset() def reset(self): self.__all_input_va...
unknown
codeparrot/codeparrot-clean
name: Performance Issue description: Report slow performance or memory issues when running pandas code title: "PERF: " labels: [Performance, Needs Triage] body: - type: checkboxes id: checks attributes: label: Pandas version checks options: - label: > I have checked that this ...
unknown
github
https://github.com/pandas-dev/pandas
.github/ISSUE_TEMPLATE/performance_issue.yaml
/*------------------------------------------------------------------------- * * toasting.c * This file contains routines to support creation of toast tables * * * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * I...
c
github
https://github.com/postgres/postgres
src/backend/catalog/toasting.c
#!/usr/bin/python # -*- coding:utf-8 -*- # Copyright(c) 2015-2016 JmGo Company # All rights reserved. # # 文件名 : yoke_command.py # 作者 : YuanRong # 电子邮箱 : ryuan@jmgo.com # 日期 : 2017/5/5 17:47 # # 描述 : 命令模式 —— 将一个请求封装成对象,从而可以使用不同的请求对用户进行参数化 # 对请求排队、记录请求日志和撤销操作; # import o...
unknown
codeparrot/codeparrot-clean
/* * ginfuncs.c * Functions to investigate the content of GIN indexes * * Copyright (c) 2014-2026, PostgreSQL Global Development Group * * IDENTIFICATION * contrib/pageinspect/ginfuncs.c */ #include "postgres.h" #include "access/gin_private.h" #include "access/htup_details.h" #include "catalog/pg_type.h" #in...
c
github
https://github.com/postgres/postgres
contrib/pageinspect/ginfuncs.c
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Save Tower CSV data as NetCDF # <markdowncell> # ### Set local variables # <codecell> url='http://geoport.whoi.edu/thredds/fileServer/usgs/data2/notebook/data/CR3000_SN3557_Table1_MainTowerCR3000_ground_V6.CR3.txt' input_data="data.txt" ...
unknown
codeparrot/codeparrot-clean
""" Test Codecs (used by test_charmapcodec) Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def deco...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package workdir import ( "testing" version "github.com/hashicorp/go-version" tfaddr "github.com/hashicorp/terraform-registry-address" svchost "github.com/hashicorp/terraform-svchost" ) // getTestProviderState is a test helper that returns a s...
go
github
https://github.com/hashicorp/terraform
internal/command/workdir/testing.go
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'connect.ui' # # Created: Wed Jul 24 12:42:01 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attribut...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals, division, absolute_import import logging import os from flexget import plugin from flexget.event import event log = logging.getLogger('free_space') def get_free_space(folder): """ Return folder/drive free space (in megabytes)""" if os.name == 'nt': import ctyp...
unknown
codeparrot/codeparrot-clean
/* SPDX-License-Identifier: MIT */ /* origin: musl src/math/fma.c. Ported to generic Rust algorithm in 2025, TG. */ use crate::support::{ CastFrom, CastInto, DInt, Float, FpResult, HInt, Int, IntTy, MinInt, Round, Status, }; /// Fused multiply-add that works when there is not a larger float size available. Comput...
rust
github
https://github.com/nodejs/node
deps/crates/vendor/libm/src/math/generic/fma.rs
''' https://leetcode.com/contest/weekly-contest-174/problems/maximum-product-of-splitted-binary-tree/ ''' # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def maxProduct(self, root: Tree...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- import io from setuptools import setup, find_packages setup( name='django-pipeline', version='1.5.1', description='Pipeline is an asset packaging library for Django.', long_description=io.open('README.rst', encoding='utf-8').read() + '\n\n' + io.open('HISTORY.rst', enco...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
unknown
codeparrot/codeparrot-clean
import copy class equation(): def __init__(self, operand, operations = None): self.operand = operand self.operations = operations def __str__(self): out = "Operand : " + self.operand +'\n' out += "Operations :" + ','.join(self.operations) return out def __eq__(sel...
unknown
codeparrot/codeparrot-clean