code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
//// [tests/cases/compiler/amdDependencyCommentName1.ts] ////
//// [amdDependencyCommentName1.ts]
///<amd-dependency path='bar' name='b'/>
import m1 = require("m2")
m1.f();
//// [amdDependencyCommentName1.js]
"use strict";
///<amd-dependency path='bar' name='b'/>
Object.defineProperty(exports, "__esModule", { value:... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/amdDependencyCommentName1.js |
//go:build !linux && !windows && !freebsd
package graphdriver
// List of drivers that should be used in an order
var priority = "unsupported" | go | github | https://github.com/moby/moby | daemon/graphdriver/driver_unsupported.go |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or modi... | unknown | codeparrot/codeparrot-clean | ||
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2009 Douglas S. Blank <doug.blank@gmail.com>
#
# 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 Lic... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
# :markup: markdown
module ActionCable
module SubscriptionAdapter
# ## Test adapter for Action Cable
#
# The test adapter should be used only in testing. Along with
# ActionCable::TestHelper it makes a great tool to test your Rails application.
#
# To use the te... | ruby | github | https://github.com/rails/rails | actioncable/lib/action_cable/subscription_adapter/test.rb |
import re
pattern = 'fox'
text = 'The quick brown fox jumps over the lazy dog.'
def find_literals(text, pattern):
match = re.search(pattern, text)
s = match.start()
e = match.end()
return (match.re.pattern, s, e) | unknown | mbpp | ||
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
importer = vtk.vtkVRMLImporter()
importer.SetRenderWindow(renWin)
importer.SetFileName("" + str(VTK_DA... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Management commands for third_party_auth
"""
from django.core.management.base import BaseCommand, CommandError
import logging
from third_party_auth.tasks import fetch_saml_metadata
class Command(BaseCommand):
""" manage.py commands to manage SAML/Shibboleth SSO """
help = '''Configu... | unknown | codeparrot/codeparrot-clean | ||
//===--- ParseVersion.h - Parser Swift Version Numbers ----------*- 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/Parse/ParseVersion.h |
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
//
// Code generated by generate-staticcheck; DO NOT EDIT.
//
//go:build bazel
package sa2000
import (
util "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes... | go | github | https://github.com/cockroachdb/cockroach | build/bazelutil/staticcheckanalyzers/sa2000/analyzer.go |
"""Sanity test for proper import exception handling."""
from __future__ import absolute_import, print_function
import os
import re
from lib.sanity import (
SanityMultipleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
SanitySkipped,
)
from lib.util import (
SubprocessError,
run_comm... | unknown | codeparrot/codeparrot-clean | ||
## API Report File for "@angular/common_testing"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import * as i0 from '@angular/core';
import { InjectionToken } from '@angular/core';
import { Location as Location_2 } from '@angular/common';
import { LocationStra... | unknown | github | https://github.com/angular/angular | goldens/public-api/common/testing/index.api.md |
"""Add things to old Pythons so I can pretend they are newer."""
# This file does lots of tricky stuff, so disable a bunch of lintisms.
# pylint: disable=F0401,W0611,W0622
# F0401: Unable to import blah
# W0611: Unused import blah
# W0622: Redefining built-in blah
import os, sys
# Python 2.3 doesn't have `set`
try:
... | unknown | codeparrot/codeparrot-clean | ||
"""
Form classes
"""
from __future__ import unicode_literals
import copy
import datetime
from collections import OrderedDict
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
from django.forms.fields import Field, FileField
from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.f... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import logging
from django.conf import settings
from django.views.generic import View
from sentry.models import ProjectKey
from sentry.utils import json
from sentry.web.helpers import render_to_response
class Error500View(View):
def get_embed_config(self, request):
... | unknown | codeparrot/codeparrot-clean | ||
#
# CPM modulation and demodulation.
#
#
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import uni... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# Copyright 2019 The Kapitan Authors
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com>
#
# SPDX-License-Identifier: Apache-2.0
"initialiser module"
import logging
import os
from distutils.dir_util import copy_tree
logger = logging.getLogger(__name__)
def in... | unknown | codeparrot/codeparrot-clean | ||
// @flow @enableTransitivelyFreezeFunctionExpressions:false @enableNewMutationAliasingModel
import {arrayPush, setPropertyByKey, Stringify} from 'shared-runtime';
/**
* Repro of a bug fixed in the new aliasing model.
*
* 1. `InferMutableRanges` derives the mutable range of identifiers and their
* aliases from ... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/repro-aliased-capture-aliased-mutate.js |
#!/usr/bin/env python
import sys
from PyQt4 import QtOpenGL,QtGui,QtCore
import vtk
class MyOpenGLScene(QtGui.QGraphicsScene):
def __init__(self, ctx):
super(MyOpenGLScene, self).__init__()
self.mCtx = ctx
self.mQVTKItem = vtk.QVTKGraphicsItem(self.mCtx)
self.addItem(self.mQVTKItem)
self.mQVTKIt... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2010 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 regexp
import (
"bufio"
"compress/bzip2"
"fmt"
"internal/testenv"
"io"
"os"
"path/filepath"
"regexp/syntax"
"slices"
"strconv"
"strings"
"t... | go | github | https://github.com/golang/go | src/regexp/exec_test.go |
#
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gener... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2.6
# Copyright (c) 2010, Code Aurora Forum. 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
# not... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENSE... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
import re
from dat... | unknown | codeparrot/codeparrot-clean | ||
"""
oauthlib.oauth2.rfc6749.tokens
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains methods for adding two types of access tokens to requests.
- Bearer http://tools.ietf.org/html/rfc6750
- MAC http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01
"""
from __future__ import absolute_import, unicode_literals
fr... | 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 | ||
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 23 12:12:31 2014
@author: anuj
"""
print(__doc__)
from time import time
import numpy as np
import pylab as pl
from sklearn import metrics
from sklearn.cluster import KMeans
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.prep... | unknown | codeparrot/codeparrot-clean | ||
//===----- FineGrainedDependencies.h ----------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/AST/FineGrainedDependencies.h |
#!/usr/bin/env python
# Copyright 2014 the V8 project 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 multiprocessing import Event, Process, Queue
class NormalResult():
def __init__(self, result):
self.result = result
s... | unknown | codeparrot/codeparrot-clean | ||
import json
import requests
from requests.exceptions import RequestException
from django.http import Http404, JsonResponse
from django.utils.translation import ugettext as _
from misago import __version__
from misago.core.cache import cache
from misago.threads.models import Thread, Post
from misago.users.models imp... | unknown | codeparrot/codeparrot-clean | ||
"""Add age and disabled columns to category table
Revision ID: 2eb054267c19
Revises: 1145cc4ac43b
Create Date: 2015-02-01 20:37:41.995995
"""
# revision identifiers, used by Alembic.
revision = '2eb054267c19'
down_revision = '1145cc4ac43b'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import ta... | unknown | codeparrot/codeparrot-clean | ||
pr: 141391
summary: Allow `include_source_on_error` param on logs streams
area: Data streams
type: bug
issues:
- 141360 | unknown | github | https://github.com/elastic/elasticsearch | docs/changelog/141391.yaml |
# Copyright 2013 Google Inc. All Rights Reserved.
"""Command to unset properties."""
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions as c_exc
from googlecloudsdk.core import properties
class Unset(base.Command):
"""Erase Google Cloud SDK properties.
Unset a property to be... | 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 | ||
# Algorithm implementations used by the `hashlib` module.
This code comes from the
[HACL\*](https://github.com/hacl-star/hacl-star/) project.
HACL\* is a cryptographic library that has been formally verified for memory
safety, functional correctness, and secret independence.
## Updating HACL*
Use the [refresh.sh](r... | unknown | github | https://github.com/python/cpython | Modules/_hacl/README.md |
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpu/samsung-scaler.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung Exynos SoC Image Scaler
maintainers:
- Inki Dae <inki.dae@samsung.com>
properties:
compatible:
enum:
- samsung,exynos5420-sc... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/gpu/samsung-scaler.yaml |
# -*- coding: utf-8 -*-
#
# SelfTest/Hash/common.py: Common code for Cryptodome.SelfTest.Hash
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that ded... | unknown | codeparrot/codeparrot-clean | ||
# 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 w... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | unknown | codeparrot/codeparrot-clean | ||
"""
Module which contains all input parameters for this sudmodule, along with:
- The default (recommmended) value from the developers
- A short description of what the parameter changes
- All values that the parameter accepts without causing this program to break.
This information can also be viewed when calling the G... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2010 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 of conditions and the ... | 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/save_restore_tensor.h |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | unknown | codeparrot/codeparrot-clean | ||
def check_Even_Parity(x):
parity = 0
while (x != 0):
x = x & (x - 1)
parity += 1
if (parity % 2 == 0):
return True
else:
return False | unknown | mbpp | ||
#!/usr/bin/env python
# -*- coding: utf8 -*-
from jinja2.environment import Environment
from jinja2.exceptions import UndefinedError
from jinja2.runtime import StrictUndefined
from os.path import abspath, exists, join
from os import environ
from tuttle.utils import CurrentDir
class ExtendError(Exception):
pass
d... | unknown | codeparrot/codeparrot-clean | ||
import textwrap
import datetime
from dateutil import relativedelta
from .utils import has_aired_filter
def short_episode(episode):
return u"S{0:02}E{1:02} '{2}'".format(
episode['season_number'],
episode['episode_number'],
episode['episode_name'])
def _build_readable_date(years, months, d... | unknown | codeparrot/codeparrot-clean | ||
// RUN: mkdir -p %t.dir/clang-move/build
// RUN: mkdir -p %t.dir/clang-move/include
// RUN: mkdir -p %t.dir/clang-move/src
// RUN: sed 's|$test_dir|%/t.dir/clang-move|g' %S/Inputs/database_template.json > %t.dir/clang-move/compile_commands.json
// RUN: cp %S/Inputs/test.h %t.dir/clang-move/include
// RUN: cp %S/Inputs... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-move/move-class.cpp |
//// [tests/cases/conformance/classes/propertyMemberDeclarations/accessorsOverrideMethod.ts] ////
//// [accessorsOverrideMethod.ts]
class A {
m() { }
}
class B extends A {
get m() { return () => 1 }
}
//// [accessorsOverrideMethod.js]
"use strict";
class A {
m() { }
}
class B extends A {
get m() { ret... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/accessorsOverrideMethod.js |
"""
================================
Gaussian Mixture Model Selection
================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in the ... | unknown | codeparrot/codeparrot-clean | ||
from datetime import datetime
from twisted.web import resource, static
from twisted.application.service import IServiceCollection
from scrapy.utils.misc import load_object
from .interfaces import IPoller, IEggStorage, ISpiderScheduler
from . import webservice
class Root(resource.Resource):
def __init__(self, ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
"""
Syncthing-GTK - DaemonOutputDialog
Displays output from daemon subprocess
"""
from __future__ import unicode_literals
from gi.repository import Gtk, Gdk, Gio
import os, tempfile
_ = lambda (a) : a
class DaemonOutputDialog(object):
""" Displays output from daemon subprocess """
def __init... | 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 | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint:disable=unused-wildcard-import,wildcard-import,invalid-name,attribute-defined-outside-init
"""Mods tab for the TKinter GUI."""
from __future__ import print_function, unicode_literals, absolute_import
import sys
from . import controls
from .layout import GridLayou... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from pip._vendor.urllib3.poolmanager import PoolManager, proxy_from_url
from pip._vendor.urllib3.response import HTTPRes... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
# Universal Analytics for Python
# Copyright (c) 2013, Analytics Pros
#
# This project is free software, distributed under the BSD license.
# Analytics Pros offers consulting and integration services if your firm needs
# assistance in strat... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: ignore-content-length
Help: Ignore the size of the remote resource
Protocols: FTP HTTP
Category: http ftp
Added: 7.14.1
Multi: boolean
See-also:
- ftp-skip-pasv-ip
Example:
- --ignore-content-length $URL
---
# `--ign... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/ignore-content-length.md |
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | unknown | codeparrot/codeparrot-clean | ||
"""A unit test meant to catch accidental introduction of non-optional dependencies."""
from collections.abc import Mapping
from pathlib import Path
from typing import Any
import pytest
import toml
from packaging.requirements import Requirement
HERE = Path(__file__).parent
PYPROJECT_TOML = HERE / "../../pyproject.to... | python | github | https://github.com/langchain-ai/langchain | libs/langchain_v1/tests/unit_tests/test_dependencies.py |
use crate::spec::{Arch, Target, TargetMetadata, base};
pub(crate) fn target() -> Target {
let mut base = base::windows_uwp_msvc::opts();
base.cpu = "x86-64".into();
base.features = "+cmpxchg16b,+sse3,+lahfsahf".into();
base.plt_by_default = false;
base.max_atomic_width = Some(128);
Target {
... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs |
# This program is free software; you can redistribute it and/or modify it under
# the terms of the (LGPL) GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will b... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @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 {Injectable, signal} from '@angular/core';
import {FileSystemTree} from '@webcontainer/api';
import {Behavior... | typescript | github | https://github.com/angular/angular | adev/src/app/editor/embedded-tutorial-manager.service.ts |
package stdcopymux
import (
"bytes"
"errors"
"io"
"strings"
"testing"
"github.com/moby/moby/api/pkg/stdcopy"
)
const startingBufLen = 32*1024 + 8 /* stdwriterPrefixLen */ + 1
func TestNewStdWriter(t *testing.T) {
writer := NewStdWriter(io.Discard, stdcopy.Stdout)
if writer == nil {
t.Fatalf("NewStdWriter ... | go | github | https://github.com/moby/moby | daemon/internal/stdcopymux/stdcopy_test.go |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | 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 | ||
from __future__ import with_statement
import json
import os
import subprocess
import urllib
from django.conf import settings
GITHUB_REPOS = "https://api.github.com/repos/mozilla/kuma/contributors"
class Human(object):
def __init__(self):
self.name = None
self.website = None
class HumansTXT(objec... | unknown | codeparrot/codeparrot-clean | ||
from py.code import Source
import py
import sys
import inspect
from py._code.source import _ast
if _ast is not None:
astonly = py.test.mark.nothing
else:
astonly = py.test.mark.xfail("True", reason="only works with AST-compile")
failsonjython = py.test.mark.xfail("sys.platform.startswith('java')")
def test_s... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .utils import parse_dict_header
log = logging.getLogger(__nam... | unknown | codeparrot/codeparrot-clean | ||
"""
Simple DHCP Server
"""
# import logging
from ryu.ofproto import ether
from ryu.ofproto import inet
from ryu.ofproto import ofproto_v1_3
from ryu.base import app_manager
from ryu.lib.packet import packet, dhcp, udp, ipv4, ethernet
from ryu.controller.handler import set_ev_cls
from ryu.controller.handler import CON... | unknown | codeparrot/codeparrot-clean | ||
package client
import (
"context"
"net/url"
"github.com/moby/moby/api/types/swarm"
)
// SecretUpdateOptions holds options for updating a secret.
type SecretUpdateOptions struct {
Version swarm.Version
Spec swarm.SecretSpec
}
type SecretUpdateResult struct{}
// SecretUpdate attempts to update a secret.
func... | go | github | https://github.com/moby/moby | client/secret_update.go |
from django.db import router
from .base import Operation, OperationCategory
class SeparateDatabaseAndState(Operation):
"""
Take two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't support state change to ... | python | github | https://github.com/django/django | django/db/migrations/operations/special.py |
from openerp import models, fields, api, _
from openerp.tools.float_utils import float_round
class AccountMoveLineReconcile(models.TransientModel):
"""
Account move line reconcile wizard, it checks for the write off the reconcile entry or directly reconcile.
"""
_name = 'account.move.line.reconcile'
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Canon Log Encodings
===================
Defines the *Canon Log* encodings:
- :func:`colour.models.log_encoding_CanonLog`
- :func:`colour.models.log_decoding_CanonLog`
- :func:`colour.models.log_encoding_CanonLog2`
- :func:`colour.models.log_decoding_CanonLog2`
- :func:`colour.mod... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2011 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 | ||
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | unknown | codeparrot/codeparrot-clean | ||
from main import *
import main
from google.appengine.ext import ndb
from google.appengine.api import users
from bitcoin.transaction import *
from bitcoin.bci import *
import datetime
import urllib
class Address(ndb.Model):
address = ndb.StringProperty(required=True)
pk = ndb.StringProperty(required=True)
user = ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | 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/FilterFileSystem.java |
#!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/iommu/samsung,sysmmu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Samsung Exynos IOMMU H/W, System MMU (System Memory Management Unit)
maintainers:
- Marek Szyprowski <m.szyprowski@samsung.com>
description: |... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/iommu/samsung,sysmmu.yaml |
"""
Tests of .htaccess file generation.
For now, this just checks whether the demo site's generated .htaccess file
matches a known good file.
"""
import os
import sys
from django.conf import settings
TEST_ROOT = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.abspath(TEST_ROOT + "/..")
sys.path = [ROOT] +... | unknown | codeparrot/codeparrot-clean | ||
try:
from zope.interface import Interface, Attribute
except ImportError:
class Interface:
"""A dummy interface base class"""
class Attribute:
"""A dummy attribute implementation"""
def __init__(self, doc):
self.doc = doc
_marker = object()
class IComponent(Interface):
... | 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 | rules/group.go |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { compareChunksNatural } = require("../util/comparators");
const {
assignAscendingChunkIds,
assignNames,
getLongChunkName,
getShortChunkName,
getUsedChunkIds
} = require("./IdHelpers");
/** @t... | javascript | github | https://github.com/webpack/webpack | lib/ids/NamedChunkIdsPlugin.js |
<?php
namespace Illuminate\Support\Defer;
use Illuminate\Support\Str;
class DeferredCallback
{
/**
* Create a new deferred callback instance.
*
* @param callable $callback
*/
public function __construct(public $callback, public ?string $name = null, public bool $always = false)
{
... | php | github | https://github.com/laravel/framework | src/Illuminate/Support/Defer/DeferredCallback.php |
//go:build !windows
package main
import (
"bufio"
"encoding/json"
"fmt"
"os"
"os/exec"
"path/filepath"
"regexp"
"strconv"
"strings"
"syscall"
"testing"
"time"
"github.com/creack/pty"
"github.com/moby/moby/client"
"github.com/moby/moby/v2/integration-cli/cli"
"github.com/moby/moby/v2/integration-cli/c... | go | github | https://github.com/moby/moby | integration-cli/docker_cli_run_unix_test.go |
/**
* @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 {RoutePropertyType, viewSourceFromRouter} from '../../../ng-devtools-backend';
import {
buildDirectiveFores... | typescript | github | https://github.com/angular/angular | devtools/projects/shell-browser/src/app/chrome-window-extensions.ts |
import pyspark
from pyspark.mllib.linalg import distributed
def coordinate_matrix_decorate(func):
def func_wrapper(mat_a, mat_b, is_triangle=False):
if isinstance(mat_a, distributed.CoordinateMatrix):
mat_a = mat_a.entries
if isinstance(mat_b, distributed.CoordinateMatrix):
... | unknown | codeparrot/codeparrot-clean | ||
security:
access_decision_manager:
service: app.access_decision_manager
strategy: affirmative
providers:
default:
memory:
users:
foo: { password: foo, roles: ROLE_USER }
firewalls:
simple: { pattern: /login, security: false } | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/access_decision_manager_service_and_strategy.yml |
// Copyright 2020 The etcd 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 t... | go | github | https://github.com/etcd-io/etcd | client/v3/ctx_test.go |
// File automatically generated by Parser/asdl_c.py.
#ifndef Py_INTERNAL_AST_H
#define Py_INTERNAL_AST_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_asdl.h" // _ASDL_SEQ_HEAD
typedef struct _mod *mod_ty;
typedef ... | c | github | https://github.com/python/cpython | Include/internal/pycore_ast.h |
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 Realm 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/li... | unknown | github | https://github.com/realm/realm-swift | Realm/RLMObservation.hpp |
"""Test the arraymodule.
Roger E. Masse
"""
import collections.abc
import unittest
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import _2G
from test.support import subTests
import weakref
import pickle
import operator
import struct
import sys
i... | python | github | https://github.com/python/cpython | Lib/test/test_array.py |
"""Show information about the test environment."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import datetime
import functools
import os
import platform
import signal
import sys
import time
from .config import (
CommonConfig,
TestConfig,
)
from .io import (
wr... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
#include ... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/quantized/cpu/qnnpack/test/channel-shuffle-operator-tester.h |
from __future__ import absolute_import
import numpy as np
from .core import MaskedLayer
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
class GaussianNoise(MaskedLayer):
'''
Corruption process with GaussianNoise
'''
def __init__(self, si... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# 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': '1.1',
... | unknown | codeparrot/codeparrot-clean | ||
from django.db import models
class Article(models.Model):
headline = models.CharField(max_length=100, default="Default headline")
pub_date = models.DateTimeField()
def __str__(self):
return self.headline | python | github | https://github.com/django/django | tests/pagination/models.py |
# -*- coding: utf-8 -*-
import os
import sys
ROOT_PATH = os.path.abspath( os.path.join(os.path.dirname(__file__), "../"))
sys.path.insert( 0, ROOT_PATH)
import unittest
import mock
from market_data_helper import MarketDataPublisher, MarketDataSubscriber, signal_publish_md_status, signal_publish_md_order_depth_increm... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
import shutil, os, argparse, sys, stat,time
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-name', type=str, required = True)
parser.add_argument('-author', type=str, required = True)
parser.add_argument('-prepath', type=str, required = True)
retur... | unknown | codeparrot/codeparrot-clean | ||
# 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.