code
stringlengths
1
25.8M
language
stringclasses
18 values
source
stringclasses
4 values
repo
stringclasses
78 values
path
stringlengths
0
268
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.test import TestCase, override_settings from django.test.client import RequestFactory from django.views.generic.base import View from django.views.gen...
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
DEBUG = False import os import sys import re import ast try: from MirroredDirectory import MirroredDirectory from Std import Std from FileSystem import FileSystem from Importer import Importer except ImportError: from .MirroredDirectory import MirroredDirectory from .Std import Std from .F...
unknown
codeparrot/codeparrot-clean
from __future__ import print_function import collections import itertools import json import os import os.path import re import shutil import string import subprocess import sys import cgi class BuildDesc: def __init__(self, prepend_envs=None, variables=None, build_type=None, generator=None): self.prepend_...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python2 #encoding:utf-8 #author:dbr/Ben (ripped from tvdb:echel0n) #project:tvrage_api #license:unlicense (http://unlicense.org/) """ urllib2 caching handler Modified from http://code.activestate.com/recipes/491261/ """ from __future__ import with_statement import os import time import errno import htt...
unknown
codeparrot/codeparrot-clean
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import re import time from requests import RequestException from flexget import plugin from flexget.entry import Entry from flexget.event import event from...
unknown
codeparrot/codeparrot-clean
from unittest import TestCase from mock import Mock from katello.client.i18n_optparse import OptionParser, OptionParserExitError from katello.client.core.base import KatelloOption from cli_test_utils import ColoredAssertionError class KatelloOptionTestCase(TestCase): failureException = ColoredAssertionError ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ Created on 2013-02-24 :author: Andreas Kaiser (disko) """ import os from setuptools import find_packages from setuptools import setup version = '5.14.1.dev0' def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() long_description = ( read('READM...
unknown
codeparrot/codeparrot-clean
use rustc_ast::ast::ParamKindOrd; use rustc_errors::codes::*; use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, struct_span_code_err}; use rustc_hir::def::{DefKind, Res}; use rustc_hir::def_id::DefId; use rustc_hir::{self as hir, GenericArg}; use rustc_middle::ty::{ self, GenericArgsRef, GenericPa...
rust
github
https://github.com/rust-lang/rust
compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs
import { flushSync } from 'svelte'; import { test } from '../../test'; export default test({ html: ` <p>_0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_25_26_27_28_29_30_31_32_33_34_35_36_37_38_39_40</p> <p>0</p> <p>0</p> <button></button> `, test({ assert, component, target, window }) { ...
javascript
github
https://github.com/sveltejs/svelte
packages/svelte/tests/runtime-legacy/samples/bitmask-overflow-slot-4/_config.js
#!/usr/bin/env bash # Copyright 2014 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 applica...
unknown
github
https://github.com/kubernetes/kubernetes
cluster/kube-up.sh
""" Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
unknown
codeparrot/codeparrot-clean
import sys; sys.path.append("../") import unittest from collections import OrderedDict from baemo.delimited import DelimitedDict from baemo.sort import Sort from baemo.sort import SortOperator from baemo.references import References from baemo.exceptions import SortMalformed class TestSort(unittest.TestCase): ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright 2015 Objectif Libre # # 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
#!/usr/bin/env python # # Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import sys, subprocess, re, signal, time, atexit, os from gnuradio import gr class monitor(object): def __init__(self,tool="gr-ctrlport-monitor"): pr...
unknown
codeparrot/codeparrot-clean
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package plugin import ( "context" "reflect" "testing" "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform/internal/terraform" ) func TestUIInput_impl(t *testing.T) { var _ terraform.UIInput = new(UIInput) } func TestUIInput_in...
go
github
https://github.com/hashicorp/terraform
internal/plugin/ui_input_test.go
<table border="1" class="dataframe"> <thead> <tr style="text-align: right;"> <th></th> <th>x</th> </tr> </thead> <tbody> <tr> <th>0</th> <td>0.200</td> </tr> </tbody> </table>
html
github
https://github.com/pandas-dev/pandas
pandas/tests/io/formats/data/html/gh21625_expected_output.html
#!/usr/bin/env python # 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 # # Authors: # - Mario Lassnig, mario.lassnig@cern.ch, 2016-2017 # - Daniel Dr...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # gRefer is a Bibliographic Management System that uses Google Docs # as shared storage. # # Copyright (C) 2011 NigelB # # 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...
unknown
codeparrot/codeparrot-clean
# Copyright 2011 James McCauley # # This file is part of POX. # # POX is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # POX is distri...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2016 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
unknown
codeparrot/codeparrot-clean
"""Download handlers for http and https schemes""" from __future__ import annotations import warnings from typing import TYPE_CHECKING from scrapy.exceptions import ScrapyDeprecationWarning from scrapy.utils.defer import maybe_deferred_to_future from scrapy.utils.misc import build_from_crawler, load_object from scra...
python
github
https://github.com/scrapy/scrapy
scrapy/core/downloader/handlers/http10.py
# -*- coding: utf-8 -*- # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: import unittest import gdb from crash.exceptions import DelayedAttributeError from crash.infra.callback import ObjfileEventCallback from crash.infra.lookup import SymbolCallback, TypeCallback from crash.infra.lookup import MinimalSym...
unknown
codeparrot/codeparrot-clean
<script setup> import * as d3 from "d3"; import {ref} from "vue"; import ExampleEase from "./components/ExampleEase.vue"; const amplitude = ref(1); const exponent = ref(2); const period = ref(0.3); const overshoot = ref(1.7); </script> # d3-ease [Examples](https://observablehq.com/@d3/easing) · *Easing* is a metho...
unknown
github
https://github.com/d3/d3
docs/d3-ease.md
# -*- coding: utf-8 -*- from datetime import timedelta from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from cms.constants import PUBLISHER_STATE_DIRTY from cms.models.managers import Ti...
unknown
codeparrot/codeparrot-clean
/* * Copyright (C) 2014 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
java
github
https://github.com/google/guava
android/guava/src/com/google/common/collect/TopKSelector.java
<?php namespace Illuminate\Tests\Database; use Illuminate\Tests\Database\Fixtures\Models\EloquentResourceTestResourceModel; use Illuminate\Tests\Database\Fixtures\Models\EloquentResourceTestResourceModelWithGuessableResource; use Illuminate\Tests\Database\Fixtures\Models\EloquentResourceTestResourceModelWithUseResour...
php
github
https://github.com/laravel/framework
tests/Database/DatabaseEloquentResourceModelTest.php
# Authors: Robert Luke <mail@robertluke.net> # Eric Larson <larson.eric.d@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) import os.path as op import numpy as np from ...io import BaseRaw from ...io.constants import FIFF from ...utils import _validate_type ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # file openpyxl/writer/theme.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 ...
unknown
codeparrot/codeparrot-clean
/* Copyright 2024 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/tfrt/ifrt/ifrt_serving_core_selector.h
# coding=utf-8 """ Common UI (tkinter) related stuff. """ # Copyright (c) 2016 Stefan Braun # # 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 limit...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json from frappe.model.document import Document from frappe import _ from frappe.desk.search import sanitize_searchfield ...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2002-present the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required b...
kotlin
github
https://github.com/spring-projects/spring-framework
framework-docs/src/main/kotlin/org/springframework/docs/dataaccess/jdbc/jdbcembeddeddatabase/JdbcEmbeddedDatabaseConfiguration.kt
# coding=utf-8 """Request handler for series operations.""" from __future__ import unicode_literals from medusa.server.api.v2.base import BaseRequestHandler from medusa.server.api.v2.series import SeriesHandler from medusa.tv.series import Series, SeriesIdentifier from tornado.escape import json_decode class SeriesO...
unknown
codeparrot/codeparrot-clean
# Copyright 2010 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
unknown
codeparrot/codeparrot-clean
#-*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
unknown
codeparrot/codeparrot-clean
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
unknown
codeparrot/codeparrot-clean
/* Copyright 2025 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/kubelet/kubelet_nodecache_test.go
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import import logging from oauthlib import common from oauthlib.uri_validate import is_absolute_uri from .base import GrantTypeBase from .. import errors from ..r...
unknown
codeparrot/codeparrot-clean
from abc import ABCMeta, abstractmethod, abstractproperty from collections import Hashable import logging import json import math import requests from requests_oauthlib import OAuth1 from api.config import Configuration from api.core.data_structures.tree import Tree from api.core.data_structures.timestamp import Timest...
unknown
codeparrot/codeparrot-clean
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.embeddings import DashScopeEmbeddings # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional ...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/embeddings/dashscope.py
############################################################################### # # Copyright (c) 2011 Ruslan Spivak # # 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, inc...
unknown
codeparrot/codeparrot-clean
/* * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ package io.ktor.client.plugins import io.ktor.client.* import io.ktor.client.engine.* import io.ktor.client.network.sockets.* import io.ktor.client.plugins.api.* import io.ktor.client.plugins...
kotlin
github
https://github.com/ktorio/ktor
ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpTimeout.kt
from contextlib import closing from io import StringIO import pytest from sklearn import config_context from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClassifier from sklearn.impute import SimpleImputer from sklearn.decomposition import PCA from sklearn.decomposition import ...
unknown
codeparrot/codeparrot-clean
# Copyright (C) 2008 Robert C. Kirby (Texas Tech University) # Modified by Colin Cotter (Imperial College London) # David Ham (Imperial College London) # # This file is part of FIAT (https://www.fenicsproject.org) # # SPDX-License-Identifier: LGPL-3.0-or-later from FIAT import finite_element, polynomial...
unknown
codeparrot/codeparrot-clean
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-DisableMachineAcctChange', 'Author': ['@harmj0y'], 'Description': ('Disables the machine account for the target system ' 'f...
unknown
codeparrot/codeparrot-clean
# Copyright (c) 2009 NHN Inc. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the follow...
unknown
codeparrot/codeparrot-clean
from django.shortcuts import render, get_object_or_404, redirect from django.core.urlresolvers import reverse from django.http import HttpResponse,HttpResponseRedirect, Http404 from .forms import CommunitiesForm from .models import Communities from posts.models import Post from django.contrib import messages from djang...
unknown
codeparrot/codeparrot-clean
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
java
github
https://github.com/apache/kafka
clients/src/test/java/org/apache/kafka/test/MockDeserializer.java
import os from plenum.common.signer_did import DidSigner from plenum.common.util import friendlyToRaw, rawToFriendly from indy_client.client.wallet.wallet import Wallet from indy_common.config_util import getConfig from stp_core.crypto.util import ed25519PkToCurve25519 def processInvAccept(wallet, msg): pass de...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2017-05-16 22:32 from __future__ import unicode_literals import django.core.validators import django.db.models.deletion import morango.models from django.db import migrations from django.db import models import kolibri.core.fields class Migration(migrations.Migr...
unknown
codeparrot/codeparrot-clean
// Copyright 2021 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...
typescript
github
https://github.com/prometheus/prometheus
web/ui/module/codemirror-promql/src/parser/path-finder.test.ts
/* * Test to validate the privileges of using $listClusterCatalog stage. * * @tags: [ * # TODO (SERVER-98651) remove the tag * requires_fcv_81, * ] */ import {ShardingTest} from "jstests/libs/shardingtest.js"; const AUTHORIZED = true; const UNAUTHORIZED = false; const st = new ShardingTest({shards: 1, key...
javascript
github
https://github.com/mongodb/mongo
jstests/auth/list_cluster_catalog_auth.js
""" This module is indended to provide a pluggable way to add assertions about the rendered content of XBlocks. For each view on the XBlock, this module defines a @singledispatch function that can be used to test the contents of the rendered html. The functions are of the form: @singledispatch def assert_stu...
unknown
codeparrot/codeparrot-clean
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestInfixOperation < Arel::Test def test_construct operation = InfixOperation.new :+, 1, 2 assert_equal :+, operation.operator assert_equal 1, operation.left assert_equal 2, operation....
ruby
github
https://github.com/rails/rails
activerecord/test/cases/arel/nodes/infix_operation_test.rb
# Copyright 2014 NEC Corporation. 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
# 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. """ Wrapper that allows method execution in parallel. This class wraps a list of objects of the same type, emulates their interface, and executes any functi...
unknown
codeparrot/codeparrot-clean
# Copyright 2024 The HuggingFace Inc. 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 appl...
python
github
https://github.com/huggingface/transformers
src/transformers/models/clip/image_processing_clip_fast.py
package portmapper import ( "context" "errors" "fmt" "io" "os" "os/exec" "runtime" "strconv" "sync/atomic" "syscall" "time" "github.com/containerd/log" "github.com/moby/moby/v2/daemon/libnetwork/types" ) // StartProxy starts the proxy process at proxyPath. // If listenSock is not nil, it must be a bound...
go
github
https://github.com/moby/moby
daemon/libnetwork/portmapper/proxy_linux.go
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 package configload import ( "fmt" "path/filepath" "github.com/hashicorp/terraform-svchost/disco" "github.com/hashicorp/terraform/internal/configs" "github.com/hashicorp/terraform/internal/modsdir" "github.com/hashicorp/terraform/internal/reg...
go
github
https://github.com/hashicorp/terraform
internal/configs/configload/loader.go
// Copyright IBM Corp. 2016, 2025 // SPDX-License-Identifier: BUSL-1.1 package consul import ( "math/rand" "time" ) // DurationMinusBuffer returns a duration, minus a buffer and jitter // subtracted from the duration. This function is used primarily for // servicing Consul TTL Checks in advance of the TTL. func D...
go
github
https://github.com/hashicorp/vault
physical/consul/helpers.go
# Python's datetime strftime doesn't handle dates before 1900. # These classes override date and datetime to support the formatting of a date # through its full "proleptic Gregorian" date range. # # Based on code submitted to comp.lang.python by Andrew Dalke # # >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- from __future__ import absolute_import from sentry.api.serializers import serialize from sentry.testutils import TestCase class DebugFileSerializerTest(TestCase): def test_simple(self): file = self.create_file( name="baz.dSYM", size=42, headers=...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ This is part of HashBruteStation software Docs EN: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station_en Docs RU: http://hack4sec.pro/wiki/index.php/Hash_Brute_Station License: MIT Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en) Class of unit tests...
unknown
codeparrot/codeparrot-clean
"""SimpleStore Flask Blueprint""" from flask import Blueprint, render_template from flask.ext.breadcrumbs import register_breadcrumb from invenio.base.i18n import _ from flask import redirect import markdown, os CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) blueprint = Blueprint('docs', __name__, url_pref...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Auth\Notifications; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Lang; class ResetPassword extends Notification { /** * The password reset token. * * @var string */ public $token; ...
php
github
https://github.com/laravel/framework
src/Illuminate/Auth/Notifications/ResetPassword.php
########################################################## # THIS IS A GENERATED FILE -- DO NOT MODIFY. # IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE # AND REGENERATE THE MATRIX SUITES. # # matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/sharded_coll...
unknown
github
https://github.com/mongodb/mongo
buildscripts/resmokeconfig/matrix_suites/generated_suites/sharded_collections_pqs_index_filters.yml
"""The unittest.TestCase for Server Selection JSON tests.""" import os import os.path from typing import Optional from buildscripts.resmokelib import config, core, errors, logging, utils from buildscripts.resmokelib.testing.testcases import interface class ServerSelectionJsonTestCase(interface.ProcessTestCase): ...
python
github
https://github.com/mongodb/mongo
buildscripts/resmokelib/testing/testcases/server_selection_json_test.py
class Solution(object): def partition(self, s): """ :type s: str :rtype: List[List[str]] """ """ the python way is not gernal, like do it like java and c++ using dp and backtracking """ # the dp is record substring[i,j] is a palindrome...
unknown
codeparrot/codeparrot-clean
import time from openerp import api, models import datetime class ReportDataEntryDayBook(models.AbstractModel): _name = 'report.olims.report_dataentrydaybook' @api.multi def render_html(self, data): startdate = datetime.datetime.strptime(data['form'].get('date_from'), \ "%Y-%m-%d %H:%M...
unknown
codeparrot/codeparrot-clean
<div class="unit one-fifth hide-on-mobiles"> <aside> {% for section in site.data.docs_nav %} <h4>{{ section.title }}</h4> <ul> {%- for item in section.docs -%} {%- assign item_page = site.docs | where: "url", item.link | first -%} {%- capture item_html -%} <a hr...
html
github
https://github.com/jekyll/jekyll
docs/_includes/docs_contents.html
"""Factories of the ``object_events`` app.""" import factory from django.utils.timezone import now from django_libs.tests.factories import UserFactory from ..models import ObjectEvent, ObjectEventType from .test_app.models import DummyModel, TestProfile class DummyModelFactory(factory.DjangoModelFactory): """Fa...
unknown
codeparrot/codeparrot-clean
<!--Copyright 2020 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
unknown
github
https://github.com/huggingface/transformers
docs/source/en/model_doc/xlnet.md
""" Extension functions to discard all moderated messages in a SourceForge-based mailman queue. (Currently there is no way to do this without manually selecting 'discard' for each and every message.) """ import twill, twill.utils import re # export: __all__ = ['discard_all_messages', 'exit_if_empty' ...
unknown
codeparrot/codeparrot-clean
extension Application { public struct Services { public let application: Application } public var services: Services { .init(application: self) } }
swift
github
https://github.com/vapor/vapor
Sources/Vapor/Services/App+Service.swift
from typing import TYPE_CHECKING, Any from langchain_classic._api import create_importer if TYPE_CHECKING: from langchain_community.document_loaders import GitLoader # Create a way to dynamically look up deprecated imports. # Used to consolidate logic for raising deprecation warnings and # handling optional impo...
python
github
https://github.com/langchain-ai/langchain
libs/langchain/langchain_classic/document_loaders/git.py
""" imdb package. This package can be used to retrieve information about a movie or a person from the IMDb database. It can fetch data through different media (e.g.: the IMDb web pages, a SQL database, etc.) Copyright 2004-2014 Davide Alberani <da@erlug.linux.it> This program is free software; you can redistribute i...
unknown
codeparrot/codeparrot-clean
lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false importers: .: dependencies: '@angular/animations': specifier: link:./in-existing-linked-by-bazel version: link:in-existing-linked-by-bazel '@angular/common': specifier: link:./in-exis...
unknown
github
https://github.com/angular/angular
integration/legacy-animations/pnpm-lock.yaml
# -*- test-case-name: twisted.test.test_internet -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Very basic functionality for a Reactor implementation. """ import socket # needed only for sync-dns from zope.interface import implements, classImplements import sys import warnings from h...
unknown
codeparrot/codeparrot-clean
"""SciUnit tests live in this module.""" import inspect import traceback from copy import deepcopy from typing import Any, List, Optional, Tuple, Union import quantities as pq from .base import SciUnit, config from .capabilities import ProducesNumber from .errors import ( CapabilityError, Error, InvalidS...
unknown
codeparrot/codeparrot-clean
// Copyright 2009 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 net import ( "internal/syscall/windows" "os" "runtime" "syscall" "time" "unsafe" ) // Default values of KeepAliveTime and KeepAliveInterval on W...
go
github
https://github.com/golang/go
src/net/tcpsockopt_windows.go
# -*- 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
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """Wordcount exercise Google's Python class The main() below is already defined and comp...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- """ pygments.lexers.text ~~~~~~~~~~~~~~~~~~~~ Lexers for non-source code file types. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from bisect import bisect from pygments.lexer import Lexer, LexerC...
unknown
codeparrot/codeparrot-clean
from selenium import webdriver import selenium.webdriver.common.desired_capabilities from selenium.webdriver.common.proxy import Proxy import os import sys import copy import time import pytest def setup_module(module): sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) class TestW...
unknown
codeparrot/codeparrot-clean
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/ipmi/ipmb-dev.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: The Intelligent Platform Management Bus(IPMB) Device description: | The IPMB is an I2C bus which provides interconnection betwe...
unknown
github
https://github.com/torvalds/linux
Documentation/devicetree/bindings/ipmi/ipmb-dev.yaml
#!python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozilla.org/MPL/ #...
unknown
codeparrot/codeparrot-clean
#!/usr/bin/env python """ Translation from a C code posted to a forum on the Internet. @translator Thomas Schmid """ from array import array def reflect(crc, bitnum): # reflects the lower 'bitnum' bits of 'crc' j=1 crcout=0 for b in range(bitnum): i=1<<(bitnum-1-b) if crc ...
unknown
codeparrot/codeparrot-clean
<?php namespace Illuminate\Tests\Database; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Eloquent\Model as Eloquent; use Illuminate\Database\Query\Expression; use PHPUnit\Framework\TestCase; class DatabaseEloquentBelongsToManyAggregateTest extends TestCase { protected function setUp(): v...
php
github
https://github.com/laravel/framework
tests/Database/DatabaseEloquentBelongsToManyAggregateTest.php
//// [tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts] //// //// [ArrowFunction4.ts] var v = (a, b) => { }; //// [ArrowFunction4.js] "use strict"; var v = (a, b) => { };
javascript
github
https://github.com/microsoft/TypeScript
tests/baselines/reference/ArrowFunction4.js
/*! * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {DOCUMENT, isPlatformBrowser} from '@angular/common'; import { ChangeDetectionStrategy, Component, inje...
typescript
github
https://github.com/angular/angular
adev/src/app/app.component.ts
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
unknown
codeparrot/codeparrot-clean
""" Cache901 - GeoCaching Software for the Asus EEE PC 901 Copyright (C) 2007, Michael J. Pedersen <m.pedersen@icelus.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the Lice...
unknown
codeparrot/codeparrot-clean
#************************************************************************* # This is a Python library for the Adafruit Thermal Printer. # Pick one up at --> http://www.adafruit.com/products/597 # These printers use TTL serial to communicate, 2 pins are required. # IMPORTANT: On 3.3V systems (e.g. Raspberry Pi), use a 1...
unknown
codeparrot/codeparrot-clean
""" lxml-based doctest output comparison. Note: normally, you should just import the `lxml.usedoctest` and `lxml.html.usedoctest` modules from within a doctest, instead of this one:: >>> import lxml.usedoctest # for XML output >>> import lxml.html.usedoctest # for HTML output To use this module directly, yo...
unknown
codeparrot/codeparrot-clean
# # smemlcd - Sharp Memory LCDs library # # Copyright (C) 2014-2017 by Artur Wroblewski <wrobell@riseup.net> # # 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...
unknown
codeparrot/codeparrot-clean
from django.conf import settings from django.utils.six.moves.urllib.parse import urlparse from wagtail.wagtailcore.models import Page class BadRequestError(Exception): pass class URLPath(object): """ This class represents a URL path that should be converted to a full URL. It is used when the domain ...
unknown
codeparrot/codeparrot-clean
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'dialog.ui' # # Created: Thu Aug 20 18:29:13 2015 # by: pyside-uic 0.2.15 running on PySide 1.2.1 # # WARNING! All changes made in this file will be lost! """ BOUT gui is designed as a graphical interface for running BOUT++ simulations ...
unknown
codeparrot/codeparrot-clean
"""Common exceptions, classes, and functions.""" import argparse import logging import os import sys import time import log from . import settings class WideHelpFormatter(argparse.HelpFormatter): """Command-line help text formatter with wider help text.""" def __init__(self, *args, **kwargs): kwarg...
unknown
codeparrot/codeparrot-clean