code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
import pytest import numpy as np info = np.__array_namespace_info__() def test_capabilities(): caps = info.capabilities() assert caps["boolean indexing"] is True assert caps["data-dependent shapes"] is True # This will be added in the 2024.12 release of the array API standard. # assert caps["ma...
python
github
https://github.com/numpy/numpy
numpy/_core/tests/test_array_api_info.py
from .. import types from ._runtime_segment import runtime_weaver class weaver(object): identifier = None def __init__(self, type, *inputs): self.type = types.typeclass(type).get_tuple() if len(self.type) != len(inputs): raise TypeError("Weaver is declared as a tuple of %d inputs, ...
unknown
codeparrot/codeparrot-clean
""" Miscellaneous view helpers -------------------------- Helper functions for view handlers. All items in this module can be imported directly from :mod:`coaster.views`. """ from urllib.parse import urlsplit import re from flask import Response, current_app, json, request from flask import session as request_sessi...
unknown
codeparrot/codeparrot-clean
/* Copyright 2022 - 2025 R. Thomas * * 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 t...
unknown
github
https://github.com/nodejs/node
deps/LIEF/include/LIEF/asm/x86/operands/Register.hpp
# frozen_string_literal: true module Bundler module ForcePlatform # The `:force_ruby_platform` value used by dependencies for resolution, and # by locked specifications for materialization is `false` by default, except # for TruffleRuby. TruffleRuby generally needs to force the RUBY platform # varian...
ruby
github
https://github.com/ruby/ruby
lib/bundler/force_platform.rb
"""Tools for model inspection.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from sklearn.inspection._partial_dependence import partial_dependence from sklearn.inspection._permutation_importance import permutation_importance from sklearn.inspection._plot.decision_boundary import De...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/inspection/__init__.py
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( find_xpath_attr, fix_xml_ampersands ) class ClipsyndicateIE(InfoExtractor): _VALID_URL = r'http://www\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)' _TEST = { 'url': 'http://www....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # Copyright 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. from copy import deepcopy import unittest from file_system import FileSystem, FileNotFoundError, StatInfo from future import Future fr...
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 # ...
unknown
codeparrot/codeparrot-clean
# Copyright 2007 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # 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
# 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 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/json/WritableJson.java
/* Copyright 2018 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/util/stat_summarizer_options.h
# Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause from numbers import Real from sklearn.linear_model._stochastic_gradient import BaseSGDClassifier from sklearn.utils._param_validation import Interval, StrOptions class Perceptron(BaseSGDClassifier): """Linear perceptron classifier. ...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/linear_model/_perceptron.py
''' Decoding integers ''' # Useful functions import math # A simple function to convert bit strings to number in base 10 def ConvertBitString( x ): # Length of the string nbit = len(x) # output out = 0 # Reverse the string so the lowest order bit is at index 0 x = x[::-1] # Iterate o...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python from sciwonc.dataflow.DataStoreClient import DataStoreClient import ConfigDB_SessionCompute_0 import pprint # connector and config client = DataStoreClient("mongodb", ConfigDB_SessionCompute_0) config = ConfigDB_SessionCompute_0 # according to config dataList = client.getData() # return an array...
unknown
codeparrot/codeparrot-clean
#include "git-compat-util.h" /* * A merge sort implementation, simplified from the qsort implementation * by Mike Haertel, which is a part of the GNU C Library. */ static void msort_with_tmp(void *b, size_t n, size_t s, int (*cmp)(const void *, const void *), char *t) { char *tmp; char *b1, *b2; siz...
c
github
https://github.com/git/git
stable-qsort.c
import datetime import re import logging from taskmator.factory import TaskFactory class TaskContainer: """ In this context a Task is an instance of a task loaded in memory. The task template is called task specification. """ logger = logging.getLogger(__name__) def __init__(self, task_ast): ...
unknown
codeparrot/codeparrot-clean
//===- bolt/Rewrite/MetadataRewriter.h --------------------------*- 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
bolt/include/bolt/Rewrite/MetadataRewriter.h
// created by cgo -cdefs and then converted to Go // cgo -cdefs defs_netbsd.go defs_netbsd_amd64.go package runtime const ( _EINTR = 0x4 _EFAULT = 0xe _EAGAIN = 0x23 _O_WRONLY = 0x1 _O_NONBLOCK = 0x4 _O_CREAT = 0x200 _O_TRUNC = 0x400 _O_CLOEXEC = 0x400000 _PROT_NONE = 0x0 _PROT_READ = 0x1 _PR...
go
github
https://github.com/golang/go
src/runtime/defs1_netbsd_amd64.go
Email sent
html
github
https://github.com/django/django
tests/auth_tests/templates/registration/password_reset_done.html
## Input ```javascript // @panicThreshold:"none" import {useHook} from 'shared-runtime'; function InvalidComponent(props) { if (props.cond) { useHook(); } return <div>Hello World!</div>; } function ValidComponent(props) { return <div>{props.greeting}</div>; } ``` ## Code ```javascript import { c as _c...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/multiple-components-first-is-invalid.expect.md
"""W3C Document Object Model implementation for Python. The Python mapping of the Document Object Model is documented in the Python Library Reference in the section on the xml.dom package. This package contains the following modules: minidom -- A simple implementation of the Level 1 DOM with namespace sup...
unknown
codeparrot/codeparrot-clean
from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import ( _sqlite_extract, _sqlite_date_trunc, _sqlite_regexp, _sqlite_format_dtdelta, connection_created, Database, DatabaseWrapper as SQLiteDatabas...
unknown
codeparrot/codeparrot-clean
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
unknown
codeparrot/codeparrot-clean
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package vault import ( "context" "errors" "fmt" "math/rand" "sort" "strings" "sync" "testing" "time" metrics "github.com/armon/go-metrics" "github.com/golang/protobuf/ptypes" "github.com/hashicorp/errwrap" memdb "github.com/hashicorp...
go
github
https://github.com/hashicorp/vault
vault/identity_store_util.go
# Moby project governance Moby is the open-source project used to build Docker, jointly maintained by Docker and the community. As a [community project](https://www.docker.com/community/open-source/), we abide by a [Code of Conduct](https://github.com/docker/code-of-conduct) and define a governance which ensures the p...
unknown
github
https://github.com/moby/moby
project/GOVERNANCE.md
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
unknown
codeparrot/codeparrot-clean
from picklable_itertools import iter_, chain from fuel.datasets import Dataset class TextFile(Dataset): r"""Reads text files and numberizes them given a dictionary. Parameters ---------- files : list of str The names of the files in order which they should be read. Each file is expect...
unknown
codeparrot/codeparrot-clean
/* Copyright 2023 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/controlplane/apiserver/apiextensions.go
//===--- PrettyStackTrace.h - Crash trace information -----------*- 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/AST/PrettyStackTrace.h
import threading import weakref from django.utils.inspect import func_accepts_kwargs def _make_id(target): if hasattr(target, '__func__'): return (id(target.__self__), id(target.__func__)) return id(target) NONE_ID = _make_id(None) # A marker for caching NO_RECEIVERS = object() class Signal: ""...
unknown
codeparrot/codeparrot-clean
import pytest import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as splin from numpy.testing import assert_allclose try: import sparse except Exception: sparse = None pytestmark = pytest.mark.skipif(sparse is None, reason="pydata/sparse not installed") m...
unknown
codeparrot/codeparrot-clean
""" # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Cisco Systems, 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.ap...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2011, Anthon van der Neut <anthon@mnt.org>' __docformat__ = 'restructuredtext en' import os from subprocess import Popen, PIPE from cStringIO imp...
unknown
codeparrot/codeparrot-clean
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the fol...
c
github
https://github.com/opencv/opencv
3rdparty/openexr/IlmImf/ImfAutoArray.h
""" Script for converting a tar.gz file representing an exported course to the archive format used by a different version of export. Sample invocation: ./manage.py export_convert_format mycourse.tar.gz ~/newformat/ """ import os from path import path from django.core.management.base import BaseCommand, CommandError f...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This program 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 of the Lic...
unknown
codeparrot/codeparrot-clean
import unittest from anchore_engine.services.policy_engine.engine.policy.gate import Gate, BaseTrigger from anchore_engine.subsys import logger logger.enable_test_logging() class TriggerForTest(BaseTrigger): __description__ = "Testing trigger" __trigger_name__ = "testtrigger" __msg__ = "Some msg" class G...
unknown
codeparrot/codeparrot-clean
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases covering L{twisted.python.filepath}. """ from __future__ import division, absolute_import import os, time, pickle, errno, stat import contextlib from pprint import pformat from twisted.python.compat import _PY3 from twisted.pytho...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Copyright 2008, 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...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ celery.abstract ~~~~~~~~~~~~~~~ Implements components and boot-steps. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from collections import defaultdict from importlib import import_mod...
unknown
codeparrot/codeparrot-clean
module.exports = { content: [ "./app/**/*.{js,ts,jsx,tsx}", // For App Router "./components/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {}, }, plugins: [], };
javascript
github
https://github.com/vercel/next.js
examples/with-orbit-components/tailwind.config.js
"""Period tasks related to events.""" from happening.tasks import periodic_task from datetime import timedelta from .models import TicketOrder, WaitingListSubscription, TicketType from payments.models import Payment from datetime import datetime from .configuration import TicketTimeout from events.notifications import...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python3 import argparse import traceback import sys import netaddr import requests from flask import Flask, request from jinja2 import Environment, FileSystemLoader, TemplateNotFound endpoints = "read/networks read/oplog read/snmp read/switches-management public/distro-tree public/config public/dhcp publ...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "mail" module ActionMailbox module TestHelper # Create an InboundEmail record using an eml fixture in the format of message/rfc822 # referenced with +fixture_name+ located in +test/fixtures/files/fixture_name+. def create_inbound_email_from_fixture(fixture_name, sta...
ruby
github
https://github.com/rails/rails
actionmailbox/lib/action_mailbox/test_helper.rb
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, ...
java
github
https://github.com/elastic/elasticsearch
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rerun/model/TestCase.java
import unittest import Tkinter as tkinter from Tkinter import TclError import ttk from test.test_support import requires, run_unittest import sys from test_functions import MockTclObj from support import (AbstractTkTest, tcl_version, get_tk_patchlevel, simulate_mouse_click) from widget_tests impor...
unknown
codeparrot/codeparrot-clean
import occi from render_base import Renderer, check_url class URIListRenderer(Renderer): """URI list OCCI Renderer Empty array is always returned as headers during rendering. """ def render_categories(self, categories): """Render OCCI Category collection This method can't be used in ...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package stackconfig import ( "github.com/apparentlymart/go-versions/versions/constraints" "github.com/hashicorp/go-slug/sourceaddrs" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/terraform/interna...
go
github
https://github.com/hashicorp/terraform
internal/stacks/stackconfig/embedded_stack.go
#! /usr/bin/env python # # Copyright (C) 2012-2014 Michael Waskom <mwaskom@stanford.edu> import os # temporarily redirect config directory to prevent matplotlib importing # testing that for writeable directory which results in sandbox error in # certain easy_install versions os.environ["MPLCONFIGDIR"] = "." DESCRIPTIO...
unknown
codeparrot/codeparrot-clean
from pandac.PandaModules import * from toontown.toontowngui import TTDialog from toontown.toonbase import TTLocalizer from direct.showbase import Transitions from direct.gui.DirectGui import * from pandac.PandaModules import * import LaffMeter class DeathForceAcknowledge: def __init__(self, doneEvent): fa...
unknown
codeparrot/codeparrot-clean
# # test cases for fields access, etc. # import common from openerp.osv import fields class TestRelatedField(common.TransactionCase): def setUp(self): super(TestRelatedField, self).setUp() self.partner = self.registry('res.partner') self.company = self.registry('res.company') def tes...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import typing as t from werkzeug.exceptions import BadRequest from werkzeug.exceptions import HTTPException from werkzeug.wrappers import Request as RequestBase from werkzeug.wrappers import Response as ResponseBase from . import json from .globals import current_app from .helpers ...
python
github
https://github.com/pallets/flask
src/flask/wrappers.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
unknown
codeparrot/codeparrot-clean
# 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 compliance with the License. You may obtain # a ...
unknown
codeparrot/codeparrot-clean
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
unknown
codeparrot/codeparrot-clean
import sys import operator import functools try: import builtins except ImportError: import __builtin__ as builtins PY2 = sys.version_info[0] == 2 _identity = lambda x: x if PY2: unichr = unichr text_type = unicode string_types = (str, unicode) integer_types = (int, long) int_to_byte = ch...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env bash START_DIR=$PWD # gets last argument which should be the project dir for PROJECT_DIR in $@;do :;done if [ -z $PROJECT_DIR ];then echo "No project directory provided, exiting..." exit 1; fi; if [ ! -d $PROJECT_DIR ];then echo "Invalid project directory provided, exiting..." exit 1; fi; if ...
unknown
github
https://github.com/vercel/next.js
scripts/next-with-deps.sh
""" Plugin for built-in commands. This script works just like any of the plugins in plugins/ """ import importlib import inspect import logging import random from datetime import datetime, timedelta import discord import asyncio from pcbot import utils, Config, Annotate, config import plugins client = plugins.clien...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ RealWorldish Benchmark ~~~~~~~~~~~~~~~~~~~~~~ A more real-world benchmark of Jinja2. Like the other benchmark in the Jinja2 repository this has no real-world usefulnes (despite the name). Just go away and ignore it. NOW! :copyright: (c) 2009 by the Jinja Team. ...
unknown
codeparrot/codeparrot-clean
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/kernels/string_to_hash_bucket_fast_op.h
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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-2017 Insight Software Consortium. # Copyright 2004-2009 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt import re from .. import utils from .. import declarations from ..declarations import type_traits class default_argument_pat...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGX_BUF_H_INCLUDED_ #define _NGX_BUF_H_INCLUDED_ #include <ngx_config.h> #include <ngx_core.h> typedef void * ngx_buf_tag_t; typedef struct ngx_buf_s ngx_buf_t; struct ngx_buf_s { u_char *pos; u_char *la...
c
github
https://github.com/nginx/nginx
src/core/ngx_buf.h
# 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. """Helper class for instrumenation test jar.""" import collections import logging import os import pickle import re from pylib import cmd_helper from p...
unknown
codeparrot/codeparrot-clean
package datastore import ( "errors" "path" "strings" "sync" store "github.com/moby/moby/v2/daemon/libnetwork/internal/kvstore" "github.com/moby/moby/v2/daemon/libnetwork/internal/kvstore/boltdb" "github.com/moby/moby/v2/daemon/libnetwork/types" ) // ErrKeyModified is raised for an atomic update when the updat...
go
github
https://github.com/moby/moby
daemon/libnetwork/datastore/datastore.go
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, 2017 Jasper Lievisse Adriaanse <j@jasper.la> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version':...
unknown
codeparrot/codeparrot-clean
"""Test the HVV Departures config flow.""" import json from pygti.exceptions import CannotConnect, InvalidAuth from homeassistant import data_entry_flow from homeassistant.components.hvv_departures.const import ( CONF_FILTER, CONF_REAL_TIME, CONF_STATION, DOMAIN, ) from homeassistant.config_entries im...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, api import logging _logger = logging.getLogger(__name__) class SaleOrder(models.Model): _name = 'sale.order' _inherit = ['sale.order'] def _amount_all(self): if len(self) ...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2014 ## ## ...
unknown
codeparrot/codeparrot-clean
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
unknown
codeparrot/codeparrot-clean
# -*- test-case-name: twisted.mail.test.test_mailmail -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation module for the I{mailmail} command. """ import os import sys import rfc822 import getpass from ConfigParser import ConfigParser try: import cStringIO as S...
unknown
codeparrot/codeparrot-clean
""" """ import sys import logging import os.path import datetime import platform import pandas import numpy from sklearn.neural_network import MLPRegressor from sklearn.metrics import mean_squared_error from filter_weather_data import PROCESSED_DATA_DIR from interpolation.interpolator.logger import StreamToLogger ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2012,2013 # Max Planck Institute for Polymer Research # Copyright (C) 2008,2009,2010,2011 # Max-Planck-Institute for Polymer Research & Fraunhofer SCAI # # This file is part of ESPResSo++. # # ESPResSo++ is free software: you can redistribute it and/or modify # it under the terms of the G...
unknown
codeparrot/codeparrot-clean
import pyuaf import unittest from pyuaf.util.unittesting import parseArgs, TestResults import thread, time ARGS = parseArgs() def suite(args=None): if args is not None: global ARGS ARGS = args return unittest.TestLoader().loadTestsFromTestCase(ClientDiscoveryTest) def testParallel(c, results...
unknown
codeparrot/codeparrot-clean
#ifndef RUBY_VM_OPTS_H/*-*-c-*-*/ #define RUBY_VM_OPTS_H /********************************************************************** vm_opts.h - VM optimize option $Author$ Copyright (C) 2004-2007 Koichi Sasada **********************************************************************/ /* Compile options. * You can...
c
github
https://github.com/ruby/ruby
vm_opts.h
/* * 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.impl.base.test.cases.components.typeProvider import org.jetbrains.k...
kotlin
github
https://github.com/JetBrains/kotlin
analysis/analysis-api-impl-base/testFixtures/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/typeProvider/AbstractAnalysisApiGetSuperTypesTest.kt
# OCFS2Console - GUI frontend for OCFS2 management and debugging # Copyright (C) 2005 Oracle. All rights reserved. # # 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 Lice...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Created on Tue May 31 17:03:56 2016 @author: rmondoncancel """ import copy def sign(a) : """Helper returning the sign of a """ return (a>0) - (a<0) def nextAction(state) : """Returns the state at the next action """ newState = copy.deepcopy(state) # Updates th...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2009, Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 abov...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ This module contains the :class:`MappedSequence` class that forms the foundation for agate's :class:`.Row` and :class:`.Column` as well as for named sequences of rows and columns. """ from collections import OrderedDict, Sequence import six from six.moves import range # pylint: disable=W06...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require "arel/errors" require "arel/crud" require "arel/factory_methods" require "arel/expressions" require "arel/predications" require "arel/filter_predications" require "arel/window_predications" require "arel/math" require "arel/alias_predication" require "arel/order_predications" re...
ruby
github
https://github.com/rails/rails
activerecord/lib/arel.rb
""" Tests for cmptest base test class. """ __author__ = "Martin Blais <blais@furius.ca>" import textwrap import re import unittest from beancount.parser import parser from beancount.parser import cmptest from beancount.parser import booking class TestCompareTestFunctions(unittest.TestCase): def test_read_string...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ collectr.models --------------- This module contains the main models used by collectr. :copyright: (c) 2013 Cory Benfield :license: MIT License, see LICENSE for details. """ from .utils import (tree_walk, match_regexes, move_path, minified_filename, get_extension, defa...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2014 Mirantis 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 law or agreed to in writ...
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...
java
github
https://github.com/apache/hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalFileSystemConfigKeys.java
from tastypie.serializers import Serializer from tastypie.authentication import Authentication from tastypie.http import HttpUnauthorized from django.utils.timezone import is_naive class ISOSerializer(Serializer): """ Our own serializer to format datetimes in ISO 8601 but with timezone offset. """ ...
unknown
codeparrot/codeparrot-clean
# NgAddLocalize This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0-next.7. ## Development server Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. ## Code scaffolding Run ...
unknown
github
https://github.com/angular/angular
integration/ng-add-localize/README.md
# 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 ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # cloudscope.console.commands.traces # Generates random traces to pass directly to the simulations (as input). # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Thu Mar 10 22:39:58 2016 -0500 # # Copyright (C) 2016 University of Maryland # For license information, see LICENSE.txt...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python ''' This Python script interprets interrupt values. Validates Ideal load balancer runs in same package where workload is running ''' import os import sys LIB_DIR = "%s/lib" % os.path.dirname(__file__) sys.path.append(LIB_DIR) from optparse import OptionParser from sched_mc import * __author__ = ...
unknown
codeparrot/codeparrot-clean
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # 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) an...
unknown
codeparrot/codeparrot-clean
from __future__ import annotations import json import logging import re import sys from io import StringIO from typing import TYPE_CHECKING, Any import pytest from testfixtures import LogCapture from twisted.python.failure import Failure from scrapy.utils.log import ( LogCounterHandler, SpiderLoggerAdapter, ...
python
github
https://github.com/scrapy/scrapy
tests/test_utils_log.py
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
java
github
https://github.com/spring-projects/spring-framework
spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/SideEffectBean.java
"""Support for Vera sensors.""" from datetime import timedelta import logging from homeassistant.components.sensor import ENTITY_ID_FORMAT from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT from homeassistant.helpers.entity import Entity from homeassistant.util import convert from . import VERA_CONTROLLER,...
unknown
codeparrot/codeparrot-clean
use crate::cursor; use crate::extractor::arbitrary_property_machine::ArbitraryPropertyMachine; use crate::extractor::machine::{Machine, MachineState}; use crate::extractor::modifier_machine::ModifierMachine; use crate::extractor::named_utility_machine::NamedUtilityMachine; use classification_macros::ClassifyBytes; #[d...
rust
github
https://github.com/tailwindlabs/tailwindcss
crates/oxide/src/extractor/utility_machine.rs
name: Build and test on: [push, pull_request] jobs: ubuntu: name: Ubuntu runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install dependencies run: | curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring....
unknown
github
https://github.com/redis/redis
deps/hiredis/.github/workflows/build.yml