code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
<docs-callout title="Default callout title" id="test">
<span id="default-marker"></span>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</docs-callout>
<docs-callout critical title="Callout title for critical">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</docs-callout>
<docs-callout impo... | unknown | github | https://github.com/angular/angular | adev/shared-docs/pipeline/shared/marked/test/docs-callout/docs-callout.md |
//===--- SILDebugInfoExpression.h - DIExpression for SIL --------*- 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/SIL/SILDebugInfoExpression.h |
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011-2016 Serge Noiraud
#
# 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 ver... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java |
<?php
namespace Illuminate\Auth;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\UserProvider;
/**
* These methods are typically the same across all guards.
*/
trait GuardHelpers
{
/**
* The currently authenticated user.
*
* @var \Illuminat... | php | github | https://github.com/laravel/framework | src/Illuminate/Auth/GuardHelpers.php |
from anytree import Node, RenderTree
class SitemapNode(Node):
"""
A SitemapNode represents a node of the sitemap. The root node
(the homepage) is available as a property of the Site class,
e.g. site.sitemaps["en"] for the English sitemap. This class
is an extension of Node, from the anytree library... | unknown | codeparrot/codeparrot-clean | ||
"""Classes and functions required for smali codeblock insertion."""
import re
ARG_TYPE = {'L': 'object', 'Z': 'data32', 'B': 'data32',
'S': 'data32', 'C': 'data32', 'I': 'data32',
'J': 'data64', 'F': 'data32', 'D': 'data64',
'U': 'undefined', '[': 'object'}
# instruction arg1,arg2... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# read.py file is part of slpkg.
# Copyright 2014-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
# https://gitlab.com/dslackw/slpkg
# Slpkg is free software: you can redistrib... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/* Diffie-Hellman Key Agreement Method [RFC2631]
*
* Copyright (c) 2016, Intel Corporation
* Authors: Salvatore Benedetto <salvatore.benedetto@intel.com>
*/
#include <linux/fips.h>
#include <linux/module.h>
#include <crypto/internal/kpp.h>
#include <crypto/kpp.h>
#incl... | c | github | https://github.com/torvalds/linux | crypto/dh.c |
# -*- test-case-name: twisted.test.test_rebuild -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
*Real* reloading support for Python.
"""
# System Imports
import sys
import types
import time
import linecache
# Sibling Imports
from twisted.python import log, reflect
lastRebuild = time.... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2014 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.
//go:build linux && !386 && !amd64 && !arm && !arm64 && !loong64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !riscv64 && !s390x
package runtime
func vdso... | go | github | https://github.com/golang/go | src/runtime/os_linux_novdso.go |
# Copyright 2012 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 BaseHTTPServer
from collections import namedtuple
import errno
import gzip
import mimetypes
import os
import SimpleHTTPServer
import socket
import Soc... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package schema
import (
"errors"
"fmt"
"reflect"
"strings"
"sync"
"github.com/hashicorp/terraform/internal/legacy/terraform"
)
// newValueWriter is a minor re-implementation of MapFieldWriter to include
// keys that should be marked as comp... | go | github | https://github.com/hashicorp/terraform | internal/legacy/helper/schema/resource_diff.go |
from cromosoma.webmodel import PhangoField
from cromosoma import coreforms
from citoplasma.i18n import I18n
class IntegerField(PhangoField):
def __init__(self, name, size=11, required=False):
super(IntegerField, self).__init__(name, size, required)
def check(self, value):
self.error=None
... | unknown | codeparrot/codeparrot-clean | ||
## Using GoogleTest from various build systems
GoogleTest comes with pkg-config files that can be used to determine all
necessary flags for compiling and linking to GoogleTest (and GoogleMock).
Pkg-config is a standardised plain-text format containing
* the includedir (-I) path
* necessary macro (-D) definitions
... | unknown | github | https://github.com/google/googletest | docs/pkgconfig.md |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2015 Agile Business Group <http://www.agilebg.com>
# Copyright (C) 2015 Alessio Gerace <alesiso.gerace@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2018 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 main
// #include "libtestgo2c2go.h"
import "C"
import (
"fmt"
"os"
)
func main() {
got := C.GoFunc()
const want = 1
if got != want {
fmt.Print... | go | github | https://github.com/golang/go | src/cmd/cgo/internal/testcshared/testdata/go2c2go/m2/main.go |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | unknown | codeparrot/codeparrot-clean | ||
import dbus
from gabbletest import exec_test, GoogleXmlStream, acknowledge_iq, BaseXmlStream,\
sync_stream
from servicetest import call_async, EventPattern
from twisted.words.protocols.jabber.client import IQ
from twisted.words.xish import xpath
import constants as cs
import ns
# PEP supports is advertised in Se... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v0alpha1.polystat_test.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "",
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-polystat/v0alpha1.polystat_test.v42.v2beta1.json |
import json
import mock
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from wagtail.wagtailimages.models import get_image_model
from wagtail.contrib.wagtailapi import signal_handlers
class TestImageListing(TestCase):
fixtures = ['dem... | unknown | codeparrot/codeparrot-clean | ||
"""Support for IHC binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.const import CONF_TYPE
from . import IHC_CONTROLLER, IHC_INFO
from .const import CONF_INVERTING
from .ihcdevice import IHCDevice
def setup_platform(hass, config, add_entities, discovery_info=... | unknown | codeparrot/codeparrot-clean | ||
"""Cisco Webex Teams notify component."""
import logging
import voluptuous as vol
from homeassistant.components.notify import (
PLATFORM_SCHEMA, BaseNotificationService, ATTR_TITLE)
from homeassistant.const import (CONF_TOKEN)
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__nam... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/sp810.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: ARM Versatile Express SP810 System Controller
maintainers:
- Andre Przywara <andre.przywara@arm.com>
description:
The Arm SP810 ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/arm/sp810.yaml |
# pygraph_tst.py
#!/usr/bin/env python
# Copyright (c) 2007-2008 Pedro Matiello <pmatiello@gmail.com>
# License: MIT (see COPYING file)
# Import graphviz
import sys
sys.path.append('..')
sys.path.append('/usr/lib/graphviz/python/')
sys.path.append('/usr/lib64/graphviz/python/')
import gv
# Import pygraph
from pygra... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2019 Google LLC
#
# 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, ... | unknown | codeparrot/codeparrot-clean | ||
import sys
from setuptools import setup, find_packages
install_requires = [
'boto>=2.35.0',
'termcolor>=1.1',
'gevent>=1.0',
'python-dateutil>=2.4.0'
]
tests_require = []
# as of Python >= 2.7 argparse module is maintained within Python.
if sys.version_info < (2, 7):
install_requires.append('arg... | unknown | codeparrot/codeparrot-clean | ||
import { isArray, looseEqual, looseIndexOf } from '@vue/shared'
import { ssrRenderAttr } from './ssrRenderAttrs'
export const ssrLooseEqual = looseEqual as (a: unknown, b: unknown) => boolean
export function ssrLooseContain(arr: unknown[], value: unknown): boolean {
return looseIndexOf(arr, value) > -1
}
// for <i... | typescript | github | https://github.com/vuejs/core | packages/server-renderer/src/helpers/ssrVModelHelpers.ts |
from datetime import (
datetime,
timedelta,
)
from pandas import (
DatetimeIndex,
NaT,
Timestamp,
)
import pandas._testing as tm
def test_unique(tz_naive_fixture):
idx = DatetimeIndex(["2017"] * 2, tz=tz_naive_fixture)
expected = idx[:1]
result = idx.unique()
tm.assert_index_equal... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexes/datetimes/methods/test_unique.py |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "v23.multi_variable_alignment.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dashboards_from_v0_to_v2/v2beta1.v23.multi_variable_alignment.v0alpha1.json |
"""
This module defines default legend handlers.
It is strongly encouraged to have read the :ref:`legend guide
<plotting-guide-legend>` before this documentation.
Legend handlers are expected to be a callable object with a following
signature. ::
legend_handler(legend, orig_handle, fontsize, handlebox)
Where *l... | unknown | codeparrot/codeparrot-clean | ||
from unit_test_common import execute_csv2_request, initialize_csv2_request, ut_id, sanity_requests
from sys import argv
# lno: GV - error code identifier.
def main(gvar):
if not gvar:
gvar = {}
if len(argv) > 1:
initialize_csv2_request(gvar, selections=argv[1])
else:
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
/**
* Whatever helps in debugging failed tests.
*/
package org.mockito.internal.debugging; | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/debugging/package-info.java |
/*
* Copyright (C) 2013 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/src/com/google/common/collect/ImmutableMapEntry.java |
## Input
```javascript
// @expectNothingCompiled @compilationMode:"infer"
import {useIdentity, identity} from 'shared-runtime';
function Component(fakeProps: number) {
const x = useIdentity(fakeProps);
return identity(x);
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [42],
};
```
## Code
``... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/infer-no-component-annot.expect.md |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/arm,coresight-cpu-debug.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: CoreSight CPU Debug Component
maintainers:
- Mathieu Poirier <mathieu.poirier@linaro.org>
- Mike Leach <mike.leac... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/arm/arm,coresight-cpu-debug.yaml |
/*
Copyright 2017 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/checkpointmanager/errors/errors.go |
CHANGELOG
=========
8.0
---
* Remove `MastermindsParser`; use `NativeParser` instead
* Add argument `$context` to `ParserInterface::parse()`
7.4
---
* Use the native HTML5 parser when using PHP 8.4+
* Deprecate `MastermindsParser`; use `NativeParser` instead
* [BC BREAK] `ParserInterface::parse()` can now retu... | unknown | github | https://github.com/symfony/symfony | src/Symfony/Component/HtmlSanitizer/CHANGELOG.md |
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2021 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... | swift | github | https://github.com/realm/realm-swift | Realm/Tests/Swift/SwiftRLMDictionaryTests.swift |
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | framework-docs/src/main/java/org/springframework/docs/integration/jms/jmsreceivingasyncmessagelisteneradapter/JmsConfiguration.java |
#**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2006, 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 | ||
"""
Helpers for the API
"""
import re
from jedi.parser import tree as pt
from jedi.evaluate import imports
def completion_parts(path_until_cursor):
"""
Returns the parts for the completion
:return: tuple - (path, dot, like)
"""
match = re.match(r'^(.*?)(\.|)(\w?[\w\d]*)$', path_until_cursor, flags... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapUnitScale.
.. note:: 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 License, or
(at your option) any later version.
"""
_... | unknown | codeparrot/codeparrot-clean | ||
from direct.gui.DirectGui import *
import xml.etree.ElementTree as et
class Menu:
"""menu manager"""
def __init__(self, xml):
self.frames = []
self.directObjects = []
self.menuConfigDir = "config/menu/"
self.menuCodeDir = "plugins.core.menu.controllers"
self.currentMenu ... | unknown | codeparrot/codeparrot-clean | ||
import sys
import shlex
from io import BytesIO, TextIOWrapper
from os import WEXITSTATUS, listdir, system
from subprocess import Popen, PIPE
from os.path import isfile, join
from unittest.mock import patch
import self as grader
def list_files(path, extension=''):
return [f for f in listdir(path) if isfile(join(pa... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from typing_extensions import Literal, TypeAlias
from ...._models import BaseModel
__all__ = [
"Session",
"InputAudioNoiseReduction",
"InputAudioTranscription",
"Tool",
"... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/realtime/session.py |
from django.contrib.postgres.indexes import BrinIndex, GinIndex, GistIndex
from django.db import connection
from django.test import skipUnlessDBFeature
from . import PostgreSQLTestCase
from .models import CharFieldModel, DateTimeArrayModel, IntegerArrayModel
@skipUnlessDBFeature('has_brin_index_support')
class BrinIn... | unknown | codeparrot/codeparrot-clean | ||
"""Provides device automations for Philips Hue events."""
import voluptuous as vol
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.components.device_automation.exceptions import (
InvalidDeviceAutomationConfig,
)
from homeassistant.components.homeassistant.triggers imp... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[cfg(mobile)]
#[error(transparent)]
PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
#[error(transpare... | rust | github | https://github.com/tauri-apps/tauri | examples/api/src-tauri/tauri-plugin-sample/src/error.rs |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2013 CERN.
##
## Invenio 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
## License, or (at yo... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2019 PaddlePaddle 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 app... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
html: `
<p></p>
`
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-slot-let-missing-prop/_config.js |
# This file is part of 'NTLM Authorization Proxy Server'
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# NTLM APS 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 License, or... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 Ansible Project
# 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
... | unknown | codeparrot/codeparrot-clean | ||
"""
libChEBIpy (c) University of Manchester 2015-2020
libChEBIpy is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
"""
import calendar
import datetime
import gzip
import io
import os.path
import re
import zipfile
import tempfile
... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
1_000_000.times.map { { "foo" => "bar", "bar" => "baz" } } | ruby | github | https://github.com/ruby/ruby | benchmark/hash_literal_small2.rb |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# 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 by applicable law... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# -*- coding: utf-8 -*-
##
# Copyright 2010,2011 Stephen Kelly <steveire@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above c... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 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.... | unknown | codeparrot/codeparrot-clean | ||
class PhoneNumberParseException(Exception):
pass
class PhoneNumber(object):
def __init__(self, country_code, national_number):
self.country_code = country_code
self.national_number = national_number
def parse_phone_number(number, region=None, failhard=True):
from phonenumbers.phonenumberut... | unknown | codeparrot/codeparrot-clean | ||
"""
Base class for ensemble-based estimators.
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from ..base import clone
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..utils import _get_n_jobs
class BaseEnsemble(BaseEstimator, MetaEstimatorMixin):
"""Base cla... | unknown | codeparrot/codeparrot-clean | ||
import { atRule } from '../ast'
import type { DesignSystem } from '../design-system'
import type { ResolvedConfig } from './config/types'
export function registerScreensConfig(userConfig: ResolvedConfig, designSystem: DesignSystem) {
let screens = userConfig.theme.screens || {}
// We want to insert the breakpoint... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/compat/screens-config.ts |
# -*- coding: utf-8 -*-
"""
sphinx.ext.doxytag
~~~~~~~~~~~~~~~~~~
Link to named tags in a Doxygen tagfile.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. Pierre de
Buyl for this extension, based on todo.py and extlinks.py from the
Sphinx distribution.
:license: BS... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
sphinx.util.osutil
~~~~~~~~~~~~~~~~~~
Operating system-related utility functions for Sphinx.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import sys
import time
import errno
import shut... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
'''
Module for running vmadm command on SmartOS
'''
from __future__ import absolute_import
# Import Python libs
import logging
import json
import os
try:
from shlex import quote as _quote_args # pylint: disable=E0611
except ImportError:
from pipes import quote as _quote_args
# Import ... | unknown | codeparrot/codeparrot-clean | ||
scrape_configs:
- job_name: prometheus
relabel_configs:
- regex: abcdef
action: hashmod | unknown | github | https://github.com/prometheus/prometheus | config/testdata/modulus_missing.bad.yml |
# coding: utf-8
#
# Copyright 2018 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 (c) 2017 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.invocation;
import java.io.Serializable;
import java.lang.reflect.Method;
import org.mockito.MockitoFramework;
import org.mockito.mock.MockCreationSettings;
/**
* Available via... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/invocation/InvocationFactory.java |
# Copyright 2017 gRPC 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... | unknown | codeparrot/codeparrot-clean | ||
import sys,os
import interpreter
import emccanon
if 'emctask' in sys.builtin_module_names:
import emctask
import task
from embedding import *
#define EMC_DEBUG_CONFIG 0x00000002
#define EMC_DEBUG_VERSIONS 0x00000008
#define EMC_DEBUG_TASK_ISSUE 0x00000010
#define EMC_DEBUG_NML ... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import random
from argparse import ArgumentParser
from keras.models import Model
from keras.utils import plot_model, to_categorical
from keras import backend as K
import tensorflow as tf
import os, shutil
from data import load_npz, convert_to_npz
from net import attach_classifier, create_base_networ... | unknown | codeparrot/codeparrot-clean | ||
import datetime
from unittest import mock
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.models import Site
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpRequest
from django.t... | python | github | https://github.com/django/django | tests/contenttypes_tests/test_views.py |
from django.db import models
from django.db.models import QuerySet
from django.db.models.manager import BaseManager
from django.urls import reverse
class Artist(models.Model):
name = models.CharField(max_length=100)
class Meta:
ordering = ["name"]
verbose_name = "professional artist"
v... | python | github | https://github.com/django/django | tests/generic_views/models.py |
# Copyright (c) 2010-2011 OpenStack, LLC.
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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 o... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright 2013 Red Hat, 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... | unknown | codeparrot/codeparrot-clean | ||
"""
JP-specific Form helpers
"""
from __future__ import absolute_import
from django.contrib.localflavor.jp.jp_prefectures import JP_PREFECTURES
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
class JPPostalCodeField(RegexField):
"""
A form field that... | unknown | codeparrot/codeparrot-clean | ||
/** @import { CallExpression, Expression, Identifier, Literal, VariableDeclaration, VariableDeclarator } from 'estree' */
/** @import { Binding } from '#compiler' */
/** @import { ComponentContext } from '../types' */
import { dev, is_ignored, locate_node } from '../../../../state.js';
import { extract_paths, save } fr... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["ResponseError"]
class ResponseError(BaseModel):
"""An error object returned when the model fails to generate a Response."""
code: Literal[... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/response_error.py |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http://... | unknown | codeparrot/codeparrot-clean | ||
'''
This file get eid from db,
and add 'eid' field to each json object of each comment
Usage: python geteid.py database user password source startdate enddate
source could be: imdb, MF
date in the format like: 2015-01-01
Note: Make sure you have already get sentiment score before running this script
A... | unknown | codeparrot/codeparrot-clean | ||
"""
Rough outline of how this module finds times of phenomena:
* Split the time interval evenly into partitions. The partitions
should be small enough that no partitions contain multiple target values.
* Evaluate the objective function at the partition edges to determine which
partitions contain the po... | 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 | ||
<?php
namespace Illuminate\Tests\Support;
enum TestEnum
{
case A;
}
enum TestBackedEnum: int
{
case A = 1;
case B = 2;
}
enum TestStringBackedEnum: string
{
case A = 'A';
case B = 'B';
} | php | github | https://github.com/laravel/framework | tests/Support/Enums.php |
"""Benchmarking module for AlignmentFile functionality"""
import os
import pytest
from TestUtils import BAM_DATADIR, force_str, flatten_nested_list
from AlignmentFileFetchTestUtils import *
def test_build_fetch_from_bam_with_samtoolsshell(benchmark):
result = benchmark(build_fetch_with_samtoolsshell,
... | unknown | codeparrot/codeparrot-clean | ||
import Author from "./author";
import Picture from "./picture";
type Post = {
id: string;
slug: string;
title: string;
coverImage: Picture;
date: string;
author: Author;
excerpt: string;
content: string;
tags: string[];
};
export default Post; | typescript | github | https://github.com/vercel/next.js | examples/cms-umbraco/types/post.ts |
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
. "$DIR/prelude.sh"
cd src
set -o errexit
set -o verbose
activate_venv
$python buildscripts/idl/run_tests.py | unknown | github | https://github.com/mongodb/mongo | evergreen/idl_tests_run.sh |
/*
Copyright 2018 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/apis/scheduling/v1beta1/register.go |
#!/usr/bin/python -u
from optparse import OptionParser
import commands
import ConfigParser
import os
import re
import controller
conf_file="/opt/ncit-cloud/vm.ini"
debug=1
class VMUserInterface:
def __init__(self):
self.parser=OptionParser()
self.opts=None
def getConf(self):
config = ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import argparse
import logging
from phantasm import Utils, Transforms
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
transformations = {
"none": "x",
"neg": "-x",
"log": "log(x)",
"ln": "ln(x)",
"inv": "1/x",
"abs": "abs",
... | unknown | codeparrot/codeparrot-clean | ||
// RUN: %check_clang_tidy %s bugprone-copy-constructor-mutates-argument %t
// Example test cases from CERT rule
// https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP58-CPP.+Copy+operations+must+not+mutate+the+source+object
namespace test_mutating_noncompliant_example {
class A {
mutable int m;
public:
A() ... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/copy-constructor-mutates-argument.cpp |
from core.himesis import Himesis
import uuid
class HMapHeirarchyOfStates2HeirarchyOfProcs(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule MapHeirarchyOfStates2HeirarchyOfProcs.
"""
# Flag this instance as compiled now
self.is_compiled = True
super(HMapHeirarchyO... | 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 applica... | unknown | codeparrot/codeparrot-clean | ||
from abc import ABC
from enum import IntEnum
from dataclasses import dataclass, field
from typing import Dict
class OpenSslEvpPkeyEnum(IntEnum):
"""Constants which map to the EVP_PKEY_XXX OpenSSL constants (obj_mac.h) used as the temporary key during key exchange"""
DH = 28
EC = 408
X25519 = 1034
... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.