code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
# I, Danny Milosavljevic, hereby place this file into the public domain.
import sys
import memory
# TODO actually the memory is separated into pages of 256 bytes each on a real C64.
# $0000-$00FF, 0-256 zero page (without $0 and $1).
# $0100-$01FF, 256-511 processor stack.
# $0200-$02FF, buffe... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2013 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
#include "fast_log.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* ", ".join(["%.16ff" % x for x in [0.0]+[log2(x) for x in ... | c | github | https://github.com/nodejs/node | deps/brotli/c/enc/fast_log.c |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import copy
import datetime
import pytest
import processors.euctr.extractors as extractors
class TestEUCTRExtractors(object):
def test_stub_r... | unknown | codeparrot/codeparrot-clean | ||
BIG5_UAO_TO_UCS_TBL = [
["8140",0x4E17],
["8141",0x4E22],
["8142",0x4E2C],
["8143",0x4E55],
["8144",0x4E62],
["8145",0x4E8A],
["8146",0x4EB0],
["8147",0x4EEB],
["8148",0x4EED],
["8149",0x4EFC],
["814A",0x4F1C],
["814B",0x4F8A],
["814C",0x4FFF],
["814D",0x5042],
["814E",0x5050],
["814F",0... | ruby | github | https://github.com/ruby/ruby | enc/trans/big5-uao-tbl.rb |
/*
* Totally braindamaged mbox splitter program.
*
* It just splits a mbox into a list of files: "0001" "0002" ..
* so you can process them further from there.
*/
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "builtin.h"
#include "gettext.h"
#include "string-list.h"
#include "strbuf.h"
static const char git_ma... | c | github | https://github.com/git/git | builtin/mailsplit.c |
## Input
```javascript
function Component() {
const x = {};
{
const x = [];
const fn = function () {
mutate(x);
};
fn();
}
return x; // should return {}
}
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component() {
const $ = _c(1);
let t0;
i... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/lambda-mutate-shadowed-object.expect.md |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinding.java |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/Elements.java |
/*
* Copyright (C) 2012 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 agreed ... | java | github | https://github.com/google/guava | android/guava-testlib/src/com/google/common/collect/testing/google/ListMultimapPutTester.java |
# coding=utf-8
"""
Openstack Swift Recon collector. Reads any present recon cache files and
reports their current metrics.
#### Dependencies
* Running Swift services must have a recon enabled
"""
import os
try:
import json
except ImportError:
import simplejson as json
import diamond.collector
class Open... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | unknown | codeparrot/codeparrot-clean | ||
{% extends "basic/search.html" %}
{% block bodyclass %}{% endblock %}
{% block sidebarwrapper %}{% endblock %} | html | github | https://github.com/django/django | docs/_theme/djangodocs/search.html |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import sys
from django.core import exceptions
from django.utils import six
from django.utils.six import print_
from eecont import models
from eecont import transform
import remoteecont
###############
# Log He... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# (c) 2016, Julian Barnett <jbarnett@tableau.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
>>> data = (("a", "b", ), )
>>> check_result_length(Formatter().format(data, num_columns=2, ), )
True
>>> check_result_length(Formatter().format(data, num_columns=2, ), )
True
>>> _p(Formatter().format(data, num_columns=2, ), )
==================================================
|a ... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "cases/helper"
require "support/schema_dumping_helper"
class TimePrecisionTest < ActiveRecord::TestCase
if supports_datetime_with_precision?
include SchemaDumpingHelper
self.use_transactional_tests = false
class Foo < ActiveRecord::Base; end
setup do
@co... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/time_precision_test.rb |
module.exports = function(page) {
console.log(page());
}; | javascript | github | https://github.com/webpack/webpack | examples/hybrid-routing/render.js |
'''Baidu voice API'''
import logging
import requests
from telegram.conf.settings import SETTINGS
class Bdvoice(object):
logger = logging.getLogger('bdvoice')
taurl = 'http://tsn.baidu.com/text2audio'
aturl = 'http://vop.baidu.com/server_api'
tok = ''
def __init__(self, token):
self.tok =... | unknown | codeparrot/codeparrot-clean | ||
import re,threading,time
def basicThread():
global looping
looping = True
while True:
i = input()
if i == 'exit':
looping = False
print('Loop will close on next iteration.')
else:
print('>>', i)
t1 = threading.Thread(target=basicThread)
t1.daemon = True
t1.start()
### CONFIGURATION ###
version = ... | unknown | codeparrot/codeparrot-clean | ||
import io
from django.core.management import call_command
from django.test import TestCase
class CoreCommandsNoOutputTests(TestCase):
available_apps = ["empty_models"]
def test_sqlflush_no_tables(self):
out = io.StringIO()
err = io.StringIO()
call_command("sqlflush", stdout=out, stder... | python | github | https://github.com/django/django | tests/empty_models/test_commands.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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 | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwinfo/renesas,prr.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas Product Register
maintainers:
- Geert Uytterhoeven <geert+renesas@glider.be>
- Magnus Damm <magnus.damm@gmail.co... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml |
import lcm
import lcmt_scope_data
from numpy import *
from pylab import *
import time
def fieldChanged(scope_var,data):
return (data.resetOnXval and data.xdata < scope_var.x[-1]) or (data.scope_id != scope_var.scope_id) or (data.num_points != length(scope_var.x)) or not (data.linespec == scope_var.linespec)
def m... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import re
from urllib.parse import quote
import mock
import pyquery
from django.conf import settings
from ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
'''
Created on 29 Jun 2012
@author: charles
'''
import socket, select, json, os, traceback, time, sys, random
import posixpath
from coll... | unknown | codeparrot/codeparrot-clean | ||
"""Support for Proliphix NT10e Thermostats."""
import voluptuous as vol
from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA
from homeassistant.components.climate.const import (
HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_OFF, SUPPORT_TARGET_TEMPERATURE)
from homeassistant.const import (
C... | unknown | codeparrot/codeparrot-clean | ||
# 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 required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
Some linking kinds are target-specific and not supported on all platforms.
Linking with `kind=framework` is only supported when targeting macOS,
as frameworks are specific to that operating system.
Similarly, `kind=raw-dylib` is only supported when targeting Windows-like
platforms.
Erroneous code example:
```ignore... | unknown | github | https://github.com/rust-lang/rust | compiler/rustc_error_codes/src/error_codes/E0455.md |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from abc import abst... | unknown | codeparrot/codeparrot-clean | ||
package images
import (
"context"
"os"
"path/filepath"
"testing"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/leases"
"github.com/containerd/containerd/v2/core/metadata"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/p... | go | github | https://github.com/moby/moby | daemon/images/store_test.go |
"""
Pushbullet platform for sensor component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.pushbullet/
"""
import logging
import voluptuous as vol
from homeassistant.const import (CONF_API_KEY, CONF_MONITORED_CONDITIONS)
from homeassistant.com... | unknown | codeparrot/codeparrot-clean | ||
//! A "tiny database" and accompanying protocol
//!
//! This example shows the usage of shared state amongst all connected clients,
//! namely a database of key/value pairs. Each connected client can send a
//! series of GET/SET commands to query the current value of a key or set the
//! value of a key.
//!
//! This ex... | rust | github | https://github.com/tokio-rs/tokio | examples/tinydb.rs |
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.fir.generator.rendererrs
import org.jetbrains.kotlin.analysis.api.f... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-fir/analysis-api-fir-generator/src/org/jetbrains/kotlin/analysis/api/fir/generator/rendererrs/AbstractDiagnosticsDataClassRenderer.kt |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/misc/MultipleInheritanceCheck.h |
# coding: utf-8
"""
Trakerr API
Get your application events and errors to Trakerr via the *Trakerr API*.
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file exc... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from decimal import Decimal
import pytest
from django.test import ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import httplib as http
from boto.exception import S3ResponseError
import mock
from nose.tools import (assert_equal, assert_equals,
assert_true, assert_in, assert_false)
import pytest
from framework.auth import Auth
from tests.base import OsfTestCase, get_default_metaschema
from osf_tests.f... | unknown | codeparrot/codeparrot-clean | ||
"""$Id: author.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from b... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=R0903,R0922,W0232,print-statement
"""test detection of method which could be a function"""
__revision__ = None
class Toto(object):
"""bla bal abl"""
def __init__(self):
self.aaa = 2
def regular_method(self):
"""this method is a real method since it access to self"""
... | unknown | codeparrot/codeparrot-clean | ||
// run
// 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.
// Test reorderings; derived from fixedbugs/bug294.go.
package main
var log string
type TT int
func (t TT) a(s string) TT {
log += "a(" + s + ")"
... | go | github | https://github.com/golang/go | test/reorder2.go |
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
array as pd_array,
date_range,
)
import pandas._testing as tm
@pytest.fixture
def df():
"""
base dataframe for testing
"""
return DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
def test_case_when_caselist_is_not_a_l... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/series/methods/test_case_when.py |
# -*- coding: utf-8 -*-
import json
import unittest
try:
from email.message import EmailMessage
except ImportError:
# Python2
from email import message
EmailMessage = message.Message
from sendgrid.helpers.mail import (
Asm, Attachment,
ClickTracking, Content,
DynamicTemplateData, Email, Fr... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import annotations
import sys
from typing import TYPE_CHECKING, List, Optional, cast
from argparse import ArgumentParser
from typing_extensions import Literal, NamedTuple
from ..._utils import get_client
from ..._models import BaseModel
from ...._streaming import Stream
from ....types.chat import (
... | python | github | https://github.com/openai/openai-python | src/openai/cli/_api/chat/completions.py |
# Copyright 2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
class SlotConflictWithBlockerTestCase(TestCase):
def testBlocker(self):
ebui... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package pki
import (
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/base64"
"fmt"
"math/big"
"testing"
"time"
"github.com/hashicorp/vault/api"
vaulthttp "github.com/hashicorp/vault/http"
"github.com/hashicorp/vault/sdk/help... | go | github | https://github.com/hashicorp/vault | builtin/logical/pki/path_resign_crls_test.go |
# test code for the group_by module
# (c) 2014, Chris Church <cchurch@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | unknown | github | https://github.com/ansible/ansible | test/integration/targets/group_by/test_group_by_skipped.yml |
# -*- coding: utf-8 -*-
"""
@author: Patrick Alves
"""
from matplotlib import pyplot as plt
import numpy as np
import os
##### Modulo que cria gráficos com os resultados
# Diretório onde as figuras serão salvas
fig_dir = os.path.join('resultados', 'figuras')
if not os.path.isdir(fig_dir):
os.makedirs(fig_dir)
de... | unknown | codeparrot/codeparrot-clean | ||
import sys
import abc
import operator
import logging
from seance.datatypes import IUPAC
class FilterError(Exception) :
pass
class Filter(object) :
__metaclass__ = abc.ABCMeta
def __init__(self) :
pass
@abc.abstractmethod
def accept(self, seq) :
pass
class NullFilter(object) :
... | unknown | codeparrot/codeparrot-clean | ||
import { useEffect } from "react";
import { useRouter } from "next/router";
export default function usePreviewRedirect() {
const router = useRouter();
const { agilitypreviewkey, contentid } = router.query;
useEffect(() => {
// kickout if we don't have an agilityPreviewKey
if (!agilitypreviewkey) return;... | typescript | github | https://github.com/vercel/next.js | examples/cms-agilitycms/lib/use-preview-redirect.ts |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils._text import to_native
from ansible.plugins.connection import ConnectionBase
DOCUMENTATION = """
connection: localconn
short_description: do stuff local
description:
- does stuff
o... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require "abstract_unit"
class ContentSecurityPolicyTest < ActiveSupport::TestCase
def setup
@policy = ActionDispatch::ContentSecurityPolicy.new
end
def test_build
assert_equal "", @policy.build
@policy.script_src :self
assert_equal "script-src 'self'", @policy.bui... | ruby | github | https://github.com/rails/rails | actionpack/test/dispatch/content_security_policy_test.rb |
import haystack
from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery
"""
The "disabled" backend goes further than Haystack's "simple" backend
in not providing any useful search functionality. Configuring Haystack
to use this backend for a connection not only means that search won't
work, but in... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2007 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 agreed ... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/base/FinalizableReference.java |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/LevelSettings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AuthIdentity.last_verified'
db.add_column('sentry_authiden... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package api
import (
"fmt"
"net/http"
"strings"
"github.com/hashicorp/go-retryablehttp"
)
const (
ErrOutputStringRequest = "output a string, please"
)
var LastOutputStringError *OutputStringError
type OutputStringError struct {
*retryable... | go | github | https://github.com/hashicorp/vault | api/output_string.go |
"""
:author: Gary Ruben, 2009
:license: modified BSD
"""
__all__ = ["frt2", "ifrt2"]
import numpy as np
from numpy import roll, newaxis
def frt2(a):
"""Compute the 2-dimensional finite radon transform (FRT) for an n x n
integer array.
Parameters
----------
a : array_like
A 2-D square n x... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on May 25, 2012
@author:Malik Ehsanullah
'''
from django.core import validators
import re
from django.core.exceptions import ValidationError
#This will validate name check for char A-Z a-Z 0-9 and space and -
def validate_name(valueStr):
if not re.match(r'^[0-9a-z_.A-Z\s-]*$', valueStr):
raise ... | 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 | ||
"""
This file contains tasks that are designed to perform background operations on the
running state of a course.
At present, these tasks all operate on StudentModule objects in one way or another,
so they share a visitor architecture. Each task defines an "update function" that
takes a module_descriptor, a particula... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2015-2017 Flavio Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | unknown | codeparrot/codeparrot-clean | ||
@import "~payload/scss";
.rich-text-large-body {
font-size: base(0.8);
} | unknown | github | https://github.com/vercel/next.js | examples/cms-payload/payload/fields/richText/largeBody/Element/index.scss |
---
applies_to:
stack:
serverless:
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html
---
# Field data types [mapping-types]
Each field has a *field data type*, or *field type*. This type indicates the kind of data the field contains, such as strings or boolean va... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/elasticsearch/mapping-reference/field-data-types.md |
# -*- coding: utf-8 -*-
"""
Pygments basic API tests
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import random
import unittest
from pygments import lexers, formatters, filters, format
from pygments.t... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Licensed to Pioneers in Engineering under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Pioneers in Engineering licenses
# this file to you under the Apache License, Version 2.0 (the
#... | unknown | codeparrot/codeparrot-clean | ||
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from electrum_nvc.i18n import _
class ReceivingWidget(QTreeWidget):
def toggle_used(self):
if self.hide_used:
self.hide_used = False
self.setColumnHidden(2, False)
else:
self.hide_used = True
self.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | unknown | codeparrot/codeparrot-clean | ||
# stdlib
import json
# 3p
from mock import patch
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest, Fixtures, get_check_class
def _mocked_get_master_state(*args, **kwargs):
state = json.loads(Fixtures.read_file('state.json'))
return state
def _mocked_get_master_st... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014 Cloudera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean | ||
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
pub fn modff(x: f32) -> (f32, f32) {
let rv2: f32;
let mut u: u32 = x.to_bits();
let mask: u32;
let e = (((u >> 23) & 0xff) as i32) - 0x7f;
/* no fractional part */
if e >= 23 {
rv2 = x;
if e == 0x80 && (u << 9) != 0 {
... | rust | github | https://github.com/nodejs/node | deps/crates/vendor/libm/src/math/modff.rs |
from __future__ import unicode_literals
import copy
from django.conf import settings
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.core.exceptions import FieldError
from django.db import models, DEFAULT_DB_ALIAS
from django.db... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2011 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 darwin || dragonfly || freebsd || netbsd || openbsd
package net
import (
"os"
"runtime"
"syscall"
)
func setDefaultSockopts(s, family, sotype i... | go | github | https://github.com/golang/go | src/net/sockopt_bsd.go |
//// [tests/cases/compiler/collisionThisExpressionAndLocalVarInAccessors.ts] ////
//// [collisionThisExpressionAndLocalVarInAccessors.ts]
class class1 {
get a(): number {
var x2 = {
doStuff: (callback) => () => {
var _this = 2;
return callback(this);
... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/collisionThisExpressionAndLocalVarInAccessors(target=es5).js |
{
"name": "commonjs-typings-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "npm i --no-save --no-package-lock && tsc -v && npm run test:types",
"test:types": "tsc --noEmit"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@type... | json | github | https://github.com/axios/axios | test/module/typings/cjs/package.json |
#!/usr/bin/env python
import os
import sys
import cookiecutter
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst').read()
history = open('HISTORY.rst').r... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
'''
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")... | unknown | codeparrot/codeparrot-clean | ||
# Utility methods for use in an Xcode project.
#
# An iOS XCframework cannot include any content other than the library binary
# and relevant metadata. However, Python requires a standard library at runtime.
# Therefore, it is necessary to add a build step to an Xcode app target that
# processes the standard library an... | unknown | github | https://github.com/python/cpython | Apple/testbed/Python.xcframework/build/utils.sh |
#!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils import translation
from ...utils import setup
class GetLanguageInfoListTests(SimpleTestCase):
libraries = {
"custom": "template_tests.templatetags.custom",
"i18n": "django.templatetags.i18n",
... | python | github | https://github.com/django/django | tests/template_tests/syntax_tests/i18n/test_get_language_info_list.py |
{
"errors": [
{
"code": "TEST1",
"message": "Test One",
"detail": 123
},
{
"code": "TEST2",
"message": "Test Two",
"detail": "fail"
}
]
} | json | github | https://github.com/spring-projects/spring-boot | buildpack/spring-boot-buildpack-platform/src/test/resources/org/springframework/boot/buildpack/platform/docker/transport/errors.json |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | 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/internal/modeling_utils.md |
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/src/ELF/DataHandler/Node.hpp |
from rest_framework import permissions
from ..accounts.models import AccountCollaborator
from .models import Board
class BoardPermission(permissions.BasePermission):
def is_authenticated(self, request):
return request.user and request.user.is_authenticated()
def has_permission(self, request, view):
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package api
import (
"bufio"
"context"
"fmt"
"net/http"
)
// Monitor returns a channel that outputs strings containing the log messages
// coming from the server.
func (c *Sys) Monitor(ctx context.Context, logLevel string, logFormat string) (c... | go | github | https://github.com/hashicorp/vault | api/sys_monitor.go |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from useradmin.models import HuePermission
try:
perm = HuePermission.objects.get(app='metastore', act... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# 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
# "Lic... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Command;
use Symfony\Component\Console\A... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php |
# orm/attributes.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines instrumentation for class attributes and their interaction
with instanc... | unknown | codeparrot/codeparrot-clean | ||
#Copyright (c) 2009 Eugene Kaznacheev <qetzal@gmail.com>
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation
#files (the "Software"), to deal in the Software without
#restriction, including without limitation the rights to use,
#copy, modify, mer... | 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/ha/SshFenceByTcpPort.java |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class OktoberfestTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?oktoberfest-tv\.de/[^/]+/[^/]+/video/(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.oktoberfest-tv.de/de/kameras/video/hb-zelt',
'in... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | unknown | codeparrot/codeparrot-clean | ||
/*
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/apis/admission/v1beta1/doc.go |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols
import org.jetbrains.kotlin.analysis.a... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-impl-base/testFixtures/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/symbols/AbstractSymbolByPsiTest.kt |
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/mediatek,mt8186-fhctl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek frequency hopping and spread spectrum clocking control
maintainers:
- Edward-JW Yang <edward-jw.yang@mediatek... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/clock/mediatek,mt8186-fhctl.yaml |
import re
from livestreamer.plugin import Plugin, PluginError, PluginOptions
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HLSStream
LOGIN_PAGE_URL = "http://www.livestation.com/en/users/new"
LOGIN_POST_URL = "http://www.livestation.com/en/sessions.json"
_csrf_token_re = re.compi... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.