code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# importing db_connection has the side effect of setting the test database. from spec.python import db_connection from sam.models.user import User sub_id = db_connection.default_sub session = {} def logout(): session.clear() def login(): user = User(session) user.logged_in = True user.name = 'Test Us...
unknown
codeparrot/codeparrot-clean
"""Utilities to discover scikit-learn objects.""" # Authors: The scikit-learn developers # SPDX-License-Identifier: BSD-3-Clause import inspect import pkgutil from importlib import import_module from operator import itemgetter from pathlib import Path _MODULE_TO_IGNORE = { "tests", "externals", "setup", ...
python
github
https://github.com/scikit-learn/scikit-learn
sklearn/utils/discovery.py
"""This is the docstring for the example.py module. Modules names should have short, all-lowercase names. The module name may have underscores if this improves readability. Every module should have a docstring at the very top of the file. The module's docstring may extend over multiple lines. If your docstring doe...
unknown
codeparrot/codeparrot-clean
import pystache css = """\ /*--------------------- Layout and Typography ----------------------------*/ body { font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; font-size: 16px; line-height: 24px; color: #252519; margin: 0; padding: 0; background: #f5f5ff; } a { color: #261a3b...
unknown
codeparrot/codeparrot-clean
from cartodb_services.refactor.storage.redis_connection_config import RedisMetadataConnectionConfigBuilder from cartodb_services.refactor.storage.redis_connection import RedisConnectionBuilder from cartodb_services.refactor.storage.redis_config import RedisUserConfigStorageBuilder class UserConfigBackendFactory(object...
unknown
codeparrot/codeparrot-clean
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/core/framework/full_type_util.h
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import errno import ...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("setup", 'doctype', "company") frappe.reload_doc("accounts", 'doctype', "account") frappe.db.sql("""...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com> # # This is derived from test_db_servicegroup.py. # Copyright 2012 IBM Corp. # # 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 t...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """Install the built package and run the tests.""" import os # FIXME: Should handle relative import better! #from .build import DIST_DIR from build import SRC_DIR, DIST_DIR, shellcmd clrgreen = '\033[0;32m' clrnull = '\033[0m' # print '\033[0;32m foobar \033[0m' def color_print(msg): """Add...
unknown
codeparrot/codeparrot-clean
//! HTTP response builder. use std::{cell::RefCell, fmt, str}; use crate::{ body::{EitherBody, MessageBody}, error::{Error, HttpError}, header::{self, TryIntoHeaderPair, TryIntoHeaderValue}, responses::{BoxedResponseHead, ResponseHead}, ConnectionType, Extensions, Response, StatusCode, }; /// An ...
rust
github
https://github.com/actix/actix-web
actix-http/src/responses/builder.rs
<?php namespace Illuminate\Support\Facades; use Mockery; /** * @method static \Illuminate\Contracts\Cache\Repository store(string|null $name = null) * @method static \Illuminate\Contracts\Cache\Repository driver(string|null $driver = null) * @method static \Illuminate\Contracts\Cache\Repository memo(string|null $...
php
github
https://github.com/laravel/framework
src/Illuminate/Support/Facades/Cache.php
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
c
github
https://github.com/tensorflow/tensorflow
tensorflow/compiler/mlir/lite/utils/arithmetic_count_util.h
""" Tests for miscellaneous (non-magic) ``np.ndarray``/``np.generic`` methods. More extensive tests are performed for the methods' function-based counterpart in `../from_numeric.py`. """ from __future__ import annotations import operator from collections.abc import Hashable from typing import Any, cast import nump...
python
github
https://github.com/numpy/numpy
numpy/typing/tests/data/pass/ndarray_misc.py
# # 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 2010-2012 RethinkDB, all rights reserved. import time, sys, os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'test', 'common'))) import workload_common num_keys = 10000 class TestError(Exception): def __init__(self, str): self.str = str...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package schema import ( "fmt" ) // DataSourceResourceShim takes a Resource instance describing a data source // (with a Read implementation and a Schema, at least) and returns a new // Resource instance with additional Create and Delete implement...
go
github
https://github.com/hashicorp/terraform
internal/legacy/helper/schema/data_source_resource_shim.go
from test.support import run_unittest, open_urlresource import unittest from http.client import HTTPException import sys import os from unicodedata import normalize, unidata_version TESTDATAFILE = "NormalizationTest.txt" TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE def ch...
unknown
codeparrot/codeparrot-clean
/* Copyright 2017 - 2025 R. Thomas * Copyright 2017 - 2025 Quarkslab * * 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 req...
unknown
github
https://github.com/nodejs/node
deps/LIEF/include/LIEF/MachO/EnumToString.hpp
#!/usr/bin/env python """ Handler of timestamps which operation type is insert op=insert """ __author__ = "Yaroslav Litvinov" __copyright__ = "Copyright 2016, Rackspace Inc." __email__ = "yaroslav.litvinov@rackspace.com" ENCODE_ESCAPE = 1 ENCODE_ONLY = 0 NO_ENCODE_NO_ESCAPE = None def format_string_insert_query(tab...
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. import os import unittest from telemetry import value from telemetry.page import page_set from telemetry.value import skip class TestBase(unittest.TestCase...
unknown
codeparrot/codeparrot-clean
"""Tests for high-level polynomials manipulation functions. """ from sympy.polys.polyfuncs import ( symmetrize, horner, interpolate, viete, ) from sympy.polys.polyerrors import ( MultivariatePolynomialError, ) from sympy import symbols from sympy.utilities.pytest import raises from sympy.abc import a, b, c,...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # # Paste documentation build configuration file, created by # sphinx-quickstart on Tue Apr 22 22:08:49 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleabl...
unknown
codeparrot/codeparrot-clean
use anyhow::Result; use async_trait::async_trait; use next_custom_transforms::transforms::lint_codemod_comments::lint_codemod_comments; use swc_core::ecma::{ast::Program, visit::VisitWith}; use turbopack::module_options::ModuleRule; use turbopack_ecmascript::{CustomTransformer, TransformContext}; use super::get_ecma_t...
rust
github
https://github.com/vercel/next.js
crates/next-core/src/next_shared/transforms/next_lint.rs
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-12-18 20:15 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uploadedfiles.models class Migration(migrations.Migration): initial = True depend...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( ExtractorError, determine_ext, int_or_none, sanitized_Request, ) class VoiceRepublicIE(InfoExtractor): _VALID_URL = r'https?://vo...
unknown
codeparrot/codeparrot-clean
/* Generated file to emulate the ts.JsTyping namespace. */ export * from "../jsTyping.js";
typescript
github
https://github.com/microsoft/TypeScript
src/jsTyping/_namespaces/ts.JsTyping.ts
apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: labels: addonmanager.kubernetes.io/mode: Reconcile name: felixconfigurations.crd.projectcalico.org spec: group: crd.projectcalico.org names: kind: FelixConfiguration listKind: FelixConfigurationList plural: felixconfigu...
unknown
github
https://github.com/kubernetes/kubernetes
cluster/addons/calico-policy-controller/felixconfigurations-crd.yaml
# -*- coding: utf-8 -*- """ Eve ~~~ An out-of-the-box REST Web API that's as dangerous as you want it to be. :copyright: (c) 2015 by Nicola Iarocci. :license: BSD, see LICENSE for more details. .. versionchanged:: 0.5 'SERVER_NAME' removed. 'QUERY_WHERE' added. 'QUERY_SO...
unknown
codeparrot/codeparrot-clean
/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
go
github
https://github.com/kubernetes/kubernetes
cmd/prune-junit-xml/prunexml.go
import urllib import simplejson from hashlib import sha1 class Stripe: """ Usage: key='<api key>' d = Stripe(key).charge( amount=100, # 1 dollar!!!! currency='usd', card_number='4242424242424242', card_exp_month='5', card_exp_ye...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 from setuptools import setup, find_packages try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: from distutils.command.build_py import build_py import os with open('README.rst') as file: long_description = file.read() MAJOR = 1 MINOR = 11 MICRO = 0 ...
unknown
codeparrot/codeparrot-clean
//===--- SILIsolationInfo.h -----------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2024 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/SILOptimizer/Utils/SILIsolationInfo.h
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
unknown
codeparrot/codeparrot-clean
# This file defines our primary CI workflow that runs on pull requests # and also on pushes to special branches (auto, try). # # The actual definition of the executed jobs is calculated by the # `src/ci/citool` crate, which # uses job definition data from src/ci/github-actions/jobs.yml. # You should primarily modify th...
unknown
github
https://github.com/rust-lang/rust
.github/workflows/ci.yml
--- title: Nested <style> elements --- There can only be one top-level `<style>` tag per component. However, it is possible to have a `<style>` tag nested inside other elements or logic blocks. In that case, the `<style>` tag will be inserted as-is into the DOM; no scoping or processing will be done on the `<style>`...
unknown
github
https://github.com/sveltejs/svelte
documentation/docs/04-styling/04-nested-style-elements.md
#!/bin/env python # -*- coding: utf-8 -*- import re #返回英文单词列表 def list1(string): words = re.findall(r'[a-zA-Z]+\b',string) #修改了正则表达式 return words #从文件中读取数据 def file_read(filename): with open(filename,'r') as fp: article = fp.read() return article #计算出出现最多的单词 def most_word_number(word_list): str_dict = {} ...
unknown
codeparrot/codeparrot-clean
"""Abstraction form AEMET OpenData sensors.""" from homeassistant.components.sensor import SensorEntity from homeassistant.const import ATTR_ATTRIBUTION from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import ATTRIBUTION, SENSOR_DEVICE_CLASS, SENSOR_NAME, SENSOR_UNIT from .weather_upd...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ %prog obo_file Parses obo_file and plot GO lineage """ import sys import logging from collections import deque from maize.formats.base import read_until typedef_tag, term_tag = "[Typedef]", "[Term]" def after_colon(line): # macro for getting anything after the...
unknown
codeparrot/codeparrot-clean
# mysql/mysqldb.py # Copyright (C) 2005-2013 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:: mysql+mysqldb :name: MySQL-Python :dbapi: mysqldb :conn...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2016 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
guava-testlib/src/com/google/common/collect/testing/testers/MapReplaceAllTester.java
import json import re from django.contrib.auth.decorators import user_passes_test from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from cripts.config.config import CRIPTsConfig from cripts.config.forms import ConfigGeneralForm, ConfigLDAPFo...
unknown
codeparrot/codeparrot-clean
global: scrape_native_histograms: true scrape_configs: - job_name: prometheus scrape_native_histograms: false static_configs: - targets: ['localhost:8080']
unknown
github
https://github.com/prometheus/prometheus
config/testdata/local_disable_scrape_native_hist.good.yml
# 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. import math import mojo_unittest # pylint: disable=E0611,F0401 import mojo_bindings.serialization as serialization import mojo_system # Generated files # ...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.llms import Modal # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional imports. DEPRECATED_...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/llms/modal.py
#!/bin/env python2 # Copyright (c) 2016 Baidu, 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 ...
unknown
codeparrot/codeparrot-clean
from datetime import date from mock import patch, Mock from nose.tools import assert_true from twilio.rest.resources import Calls, Call from tests.tools import create_mock_json BASE_URI = "https://api.twilio.com/2010-04-01/Accounts/AC123" ACCOUNT_SID = "AC123" AUTH = (ACCOUNT_SID, "token") CALL_SID = "CA47e13748ed59a5...
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
tsdb/head_append_v2.go
{ "kind": "Dashboard", "apiVersion": "dashboard.grafana.app/v2alpha1", "metadata": { "name": "v0alpha1.timeseries-stacking.v42" }, "spec": { "annotations": [ { "kind": "AnnotationQuery", "spec": { "query": { "kind": "", "spec": {} }, ...
json
github
https://github.com/grafana/grafana
apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-timeseries/v0alpha1.timeseries-stacking.v42.v2alpha1.json
""" ******************************************************************************* * Ledger Blue * (c) 2016 Ledger * * 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....
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import argparse import sys import platform from cmark import CMark if __name__ == "__main__": parser = argparse.ArgumentParser(description='Run cmark tests.') parser.add_argument('--program', dest='program', nargs='?', default=None, help='pro...
unknown
codeparrot/codeparrot-clean
use std::{fmt, str}; use super::common_header; use crate::http::header; common_header! { /// `Cache-Control` header, defined /// in [RFC 7234 §5.2](https://datatracker.ietf.org/doc/html/rfc7234#section-5.2). /// /// The `Cache-Control` header field is used to specify directives for /// caches alon...
rust
github
https://github.com/actix/actix-web
actix-web/src/http/header/cache_control.rs
""" Support for IKEA Tradfri. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ikea_tradfri/ """ import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.const import EVENT_HOMEASSISTANT_STOP import homeassista...
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
# coding: utf-8 from __future__ import absolute_import from _ruamel_yaml import CParser, CEmitter try: from .constructor import * # NOQA from .serializer import * # NOQA from .representer import * # NOQA from .r...
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. // // // License Agreement // For Open Source Computer Vision Library // // Copyright ...
unknown
github
https://github.com/opencv/opencv
modules/core/include/opencv2/core/dualquaternion.hpp
# -*- coding: utf-8 -*- """Base module for unittesting.""" from plone.app.testing import applyProfile from plone.app.testing import FunctionalTesting from plone.app.testing import IntegrationTesting from plone.app.testing import login from plone.app.testing import PLONE_FIXTURE from plone.app.testing import PloneSandb...
unknown
codeparrot/codeparrot-clean
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Union from typing_extensions import Annotated, TypeAlias from ...._utils import PropertyInfo from .text_delta_block import TextDeltaBlock from .refusal_delta_block import RefusalDeltaBlock from .image_url_delta_bl...
python
github
https://github.com/openai/openai-python
src/openai/types/beta/threads/message_content_delta.py
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
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
import calendar import datetime import math from django.apps import apps from django.conf import settings from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Group, Permission from django.core.exceptions import ValidationError from django.utils import timezone def abso...
unknown
codeparrot/codeparrot-clean
# ext/compiler.py # Copyright (C) 2005-2015 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 """Provides an API for creation of custom ClauseElements and compilers. Synopsis ==...
unknown
codeparrot/codeparrot-clean
# packetGenerator_test import traceback import threading import unittest import Queue import time import sys import os if __name__ == '__main__': importDirectory = os.getcwd() if os.path.basename(importDirectory) in ['tests']: importDirectory = os.path.dirname(importDirectory) sys.path = [importDir...
unknown
codeparrot/codeparrot-clean
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package os_test import ( "fmt" "internal/syscall/windows" "internal/testenv" "os" "path/filepath" "strings" "syscall" "testing" ) func TestAddExtended...
go
github
https://github.com/golang/go
src/os/path_windows_test.go
#pragma once #include <ATen/core/Dimname.h> #include <c10/core/TensorImpl.h> namespace at { class TensorBase; // XXX: This file exists because TensorImpl is in c10, but Dimname is in ATen. // Due to the c10/ATen library split, TensorImpl cannot depend on Dimname, // so we have a couple of workarounds. // // In the ...
c
github
https://github.com/pytorch/pytorch
aten/src/ATen/core/NamedTensor.h
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.util}. """ from twisted.trial.unittest import TestCase from twisted.web.util import _hasSubstring class HasSubstringTestCase(TestCase): """ Test regular expression-based substring searching. """ ...
unknown
codeparrot/codeparrot-clean
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
unknown
codeparrot/codeparrot-clean
''' Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. The MIT 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 restriction, including without limitati...
unknown
codeparrot/codeparrot-clean
import leftHelixPrime from "./leftHelixPrime"; export function run() { return import(/* webpackChunkName: "right" */ "./rightHelix"); } export default { leftHelixPrime: () => leftHelixPrime };
javascript
github
https://github.com/webpack/webpack
test/cases/chunks/import-circle/rightHelixPrime.js
# Generated by Django 1.11.24 on 2019-10-16 22:48 from typing import Any, Set, Union import orjson from django.conf import settings from django.contrib.auth.hashers import check_password, make_password from django.db import migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.d...
unknown
codeparrot/codeparrot-clean
"""Constants related to IStorage and related interfaces This file was generated by h2py from d:\msdev\include\objbase.h then hand edited, a few extra constants added, etc. """ STGC_DEFAULT = 0 STGC_OVERWRITE = 1 STGC_ONLYIFCURRENT = 2 STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4 STGC_CONSOLIDATE = 8 S...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python # -*- coding: utf-8 -*- # Call Web2py scheduler in app models context and run a specified task using # its scheduled arguments. Two options for running this script: # # cd web2py # python applications/<app>/static/scripts/tools/run_scheduler_tasks.py --app=<app> --task=<task> # -- or -- # export...
unknown
codeparrot/codeparrot-clean
/* * Copyright (c) 2007 Mockito contributors * This program is made available under the terms of the MIT License. */ package org.mockito.internal.runners.util; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import org.mockito.internal.runners.InternalRunner; public class...
java
github
https://github.com/mockito/mockito
mockito-core/src/main/java/org/mockito/internal/runners/util/RunnerProvider.java
#!/usr/bin/env python2.5 from optparse import OptionParser import subprocess from rosettautil.rosetta import rosettaScore from rosettautil.util import fileutil class ClusterItem: def __init__(self,tag,cluster_id,struct_index): self.tag = tag self.cluster_id = cluster_id self.struct_index =...
unknown
codeparrot/codeparrot-clean
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>). # $Id$ # # This program is free ...
unknown
codeparrot/codeparrot-clean
use std::fmt::{self, Display, Write}; use super::{ from_one_raw_str, EntityTag, Header, HeaderName, HeaderValue, HttpDate, InvalidHeaderValue, TryIntoHeaderValue, Writer, }; use crate::{error::ParseError, http::header, HttpMessage}; /// `If-Range` header, defined /// in [RFC 7233 §3.2](https://datatracker.iet...
rust
github
https://github.com/actix/actix-web
actix-web/src/http/header/if_range.rs
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
unknown
codeparrot/codeparrot-clean
import os # toolchains options ARCH='arm' CPU='cortex-m0' CROSS_TOOL='gcc' # bsp lib config BSP_LIBRARY_TYPE = None if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute...
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...
typescript
github
https://github.com/apache/airflow
airflow-core/src/airflow/ui/src/constants/urlRegex.ts
import { ShapeFlags } from '@vue/shared' import Vue from '@vue/compat' import { createComponentInstance } from '../../runtime-core/src/component' import { setCurrentRenderingInstance } from '../../runtime-core/src/componentRenderContext' import type { DirectiveBinding } from '../../runtime-core/src/directives' import {...
typescript
github
https://github.com/vuejs/core
packages/vue-compat/__tests__/renderFn.spec.ts
#!/usr/bin/env python # Run AEM model on Omniperf traces # # Usage: # cd OmniperfTools # python rumAEM.py trace_folder # import os import sys from PyOmniMisc.traffic.http import HTTPLogReader from PyOmniMisc.model.aem import AEM def print_usage(): print("Usage: python rumAEM.py <omniperf_trace>") if len(...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package funcs import ( "encoding/base64" "fmt" "io" "os" "path/filepath" "unicode/utf8" "github.com/bmatcuk/doublestar" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" homedir "github.com/mitchellh/go-homedir" "git...
go
github
https://github.com/hashicorp/terraform
internal/lang/funcs/filesystem.go
from __future__ import absolute_import from django.db.models.query_utils import DeferredAttribute, InvalidQuery from django.test import TestCase from .models import Secondary, Primary, Child, BigChild, ChildProxy class DeferTests(TestCase): def assert_delayed(self, obj, num): count = 0 for field ...
unknown
codeparrot/codeparrot-clean
# Copyright IBM Corp. 2016, 2025 # SPDX-License-Identifier: BUSL-1.1 regions: - eu-north-1 - ap-south-1 - eu-west-3 - eu-west-2 - eu-west-1 - ap-northeast-3 - ap-northeast-2 - ap-northeast-1 - sa-east-1 - ca-central-1 - ap-southeast-1 - ap-southeast-2 - eu-central-1 - us-east-1 - us-east-2 - us-west-1 - us-west-2 - gl...
unknown
github
https://github.com/hashicorp/vault
enos/ci/aws-nuke.yml
""" Constructor functions intended to be shared by pd.array, Series.__init__, and Index.__new__. These should not depend on core.internals. """ from __future__ import annotations from typing import ( TYPE_CHECKING, cast, overload, ) import numpy as np from numpy import ma from pandas._config import usi...
python
github
https://github.com/pandas-dev/pandas
pandas/core/construction.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy from test import support, script_helper # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None # Used by FinalizeTestCase as a global that may be replaced by None # when the ...
unknown
codeparrot/codeparrot-clean
import sys import pymongo from billy.core import db def main(state): spec = dict(state=state) print('fixing bills') bill_spec = dict(spec, session=108) for bill_109th in db.bills.find(bill_spec): print(bill_109th['bill_id']) # print(bill_109th['session']) # Reset session and ...
unknown
codeparrot/codeparrot-clean
import unittest import unittest.mock from pathlib import Path from g1.containers import bases from g1.containers import images from g1.containers import models from g1.containers import xars from g1.texts import jsons try: from g1.devtools.tests import filelocks except ImportError: filelocks = None from tes...
unknown
codeparrot/codeparrot-clean
""" ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ~ Poisson(n_labels) - n times, choose a class c: c ~ Multinomial(thet...
python
github
https://github.com/scikit-learn/scikit-learn
examples/miscellaneous/plot_multilabel.py
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
unknown
codeparrot/codeparrot-clean
## Input ```javascript import {useIdentity, ValidateMemoization} from 'shared-runtime'; /** * Fixture for granular iterator semantics: * 1. ConditionallyMutate the iterator itself, depending on whether the iterator * is a mutable iterator. * 2. Capture effect on elements within the iterator. */ function Valid...
unknown
github
https://github.com/facebook/react
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-granular-iterator-semantics.expect.md
# Copyright 2024 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
python
github
https://github.com/huggingface/transformers
utils/split_doctest_jobs.py
from socket import socket, AF_INET, SOCK_STREAM from cambouis.utils import throttle class IRC(object): def __init__(self, host, port=6667, nick=None, realname=None): self.host = host self.port = port self.nick = nick # TODO: raise if nick is None self.realname = realname or nick ...
unknown
codeparrot/codeparrot-clean
# Tests invocation of the interpreter with various command line arguments # Most tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution import os import subprocess import sys import sysconfig import tempfile import textwrap import unittest from test import s...
python
github
https://github.com/python/cpython
Lib/test/test_cmd_line.py
/* * Copyright (C) 2009 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava-tests/test/com/google/common/xml/XmlEscapersTest.java
# # Lancet core # import os, itertools, copy import re, glob, string import json import param try: import numpy as np np_ftypes = np.sctypes['float'] except: np, np_ftypes = None, [] try: from pandas import DataFrame except: DataFrame = None # pyflakes:ignore (try/except import) try: from holoviews ...
unknown
codeparrot/codeparrot-clean
# FreeCAD init script of the Web module # (c) 2001 Juergen Riegel #*************************************************************************** #* (c) Juergen Riegel (juergen.riegel@web.de) 2002 * #* * #* This file is part...
unknown
codeparrot/codeparrot-clean
__kupfer_name__ = _("Thunar") __kupfer_sources__ = ("ThunarObjects", ) __kupfer_actions__ = ( "Reveal", "GetInfo", "SendTo", "CopyTo", "LinkTo", "MoveTo", ) __description__ = _("File manager Thunar actions") __version__ = "" __author__ = "Ulrik Sverdrup <ulrik.sverdrup@gmail.com>" import os import dbus import g...
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
# file openpyxl/cell.py # Copyright (c) 2010 openpyxl # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
unknown
codeparrot/codeparrot-clean