code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
Copyright 2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/probe/util_test.go |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eithe... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2014 Michael DeHaan, <michael@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, or
# (at your option) any later ve... | unknown | codeparrot/codeparrot-clean | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | unknown | codeparrot/codeparrot-clean | ||
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | unknown | codeparrot/codeparrot-clean | ||
import { createContext } from 'react';
export const AnimateLogoContext = createContext<boolean>(false); | typescript | github | https://github.com/prometheus/prometheus | web/ui/react-app/src/contexts/AnimateLogoContext.tsx |
/* This module provides the necessary stubs for when dynamic loading is
not present. */
#include "Python.h"
#include "pycore_importdl.h"
const char *_PyImport_DynLoadFiletab[] = {NULL}; | c | github | https://github.com/python/cpython | Python/dynload_stub.c |
"""
Tests for defer() and only().
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Secondary(models.Model):
first = models.CharField(max_length=50)
second = models.CharField(max_length=50)
@python_2_unicode_compatible
class Primary(models.Model):
name =... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2014 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 | ||
#include "git-compat-util.h"
#include "lockfile.h"
#include "unix-socket.h"
#include "unix-stream-server.h"
#define DEFAULT_LOCK_TIMEOUT (100)
/*
* Try to connect to a unix domain socket at `path` (if it exists) and
* see if there is a server listening.
*
* We don't know if the socket exists, whether a server die... | c | github | https://github.com/git/git | unix-stream-server.c |
#include <gtest/gtest.h>
#include <torch/types.h>
#include <torch/utils.h>
using namespace at;
TEST(ReduceOpsTest, MaxValuesAndMinValues) {
const int W = 10;
const int H = 10;
if (hasCUDA()) {
for (const auto dtype : {kHalf, kFloat, kDouble}) {
auto a = at::rand({H, W}, TensorOptions(kCUDA).dtype(dty... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/test/reduce_ops_test.cpp |
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.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, ... | unknown | codeparrot/codeparrot-clean | ||
// @validateRefAccessDuringRender
import {useRef} from 'react';
function Component() {
const ref = useRef(null);
const setRef = () => {
if (ref.current !== null) {
ref.current.value = '';
}
};
const onClick = () => {
setRef();
};
return (
<>
<input ref={ref} />
<button ... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-mutating-ref-property-in-callback-passed-to-jsx-indirect.tsx |
import re
from inspect import signature
from typing import Optional
import pytest
# make it possible to discover experimental estimators when calling `all_estimators`
from sklearn.experimental import (
enable_halving_search_cv, # noqa: F401
enable_iterative_imputer, # noqa: F401
)
from sklearn.utils.discove... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/tests/test_docstrings.py |
import json
from datetime import datetime
from dateutil.relativedelta import relativedelta
import click
from flask.cli import FlaskGroup, run_command
from flask import current_app
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from random import randint
from redash import crea... | unknown | codeparrot/codeparrot-clean | ||
import UserDict
import logging
import ast
from abc import ABCMeta, abstractmethod
class DataStore(UserDict.DictMixin, object):
""" Interface for classes implementing physical storage (for data
published via the "STORE" RPC) for the Kademlia DHT
@note: This provides an interface for a dict-like object
... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* seqdesc.c
* rmgr descriptor routines for commands/sequence.c
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
*... | c | github | https://github.com/postgres/postgres | src/backend/access/rmgrdesc/seqdesc.c |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectMetrics.java |
# Copyright 2015-2016 Internap.
#
# 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 writin... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v36.ds_name_to_ref.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "grafana",
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v36.ds_name_to_ref.v42.v2beta1.json |
//// [tests/cases/conformance/types/tuple/castingTuple.ts] ////
//// [castingTuple.ts]
interface I { }
class A { a = 10; }
class C implements I { c };
class D implements I { d };
class E extends A { e };
class F extends A { f };
enum E1 { one }
enum E2 { one }
// no error
var numStrTuple: [number, string] = [5, "foo"... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/castingTuple.js |
#!/usr/bin/env python
# David Hoover, based on gatk by Dan Blankenberg
"""
A wrapper script for running the GenomeAnalysisTK.jar commands.
"""
import optparse
import os
import shutil
import subprocess
import sys
import tempfile
from binascii import unhexlify
GALAXY_EXT_TO_GATK_EXT = { 'gatk_interval': 'intervals', 'b... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | unknown | codeparrot/codeparrot-clean | ||
/*!
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/pages/Dag/Calendar/index.ts |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
class RUHDIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?ruhd\.ru/play\.php\?vid=(?P<id>\d+)'
_TEST = {
'url': 'http://www.ruhd.ru/play.php?vid=207',
'md5': 'd1a9ec4edf8598e3fbd92bb16072ba83',... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Romanian specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError, Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class ROCIFField(RegexField):
"""
A Romanian fiscal identity co... | unknown | codeparrot/codeparrot-clean | ||
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | unknown | codeparrot/codeparrot-clean | ||
package networkdb
import (
"context"
"encoding/hex"
"fmt"
"os"
"strings"
"github.com/containerd/log"
)
func logEncKeys(ctx context.Context, keys ...[]byte) {
klpath := os.Getenv("NETWORKDBKEYLOGFILE")
if klpath == "" {
return
}
die := func(err error) {
log.G(ctx).WithFields(log.Fields{
"error": err... | go | github | https://github.com/moby/moby | daemon/libnetwork/networkdb/debug.go |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
ATTRIBUTES = {
'bold': 1,
'dark': 2,
'underline': 4,
'blink': 5,
'reverse': 7,
'concealed': 8,
}
HIGHLIGHTS = {
'grey': 40,
'red': 41,
'green': 42,
'yellow': 43,
'blue': 44,
'magenta': 45,
'cyan': 46,
'whi... | unknown | codeparrot/codeparrot-clean | ||
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
InvalidCacheBackendError, cache... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for bimatrix_generators.py
"""
import numpy as np
from scipy.special import comb
from numpy.testing import assert_array_equal
from nose.tools import eq_, ok_, raises
from quantecon.gridtools import num_compositions
from quantecon.game_theory import pure_nash_brute
from quantecon.game_theory import (
blo... | unknown | codeparrot/codeparrot-clean | ||
"""
Django admin page for embargo models
"""
from django.contrib import admin
import textwrap
from config_models.admin import ConfigurationModelAdmin
from embargo.models import IPFilter, CountryAccessRule, RestrictedCourse
from embargo.forms import IPFilterForm, RestrictedCourseForm
class IPFilterAdmin(ConfigurationM... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools
class TestMassMailing(models.TransientModel):
_name = 'mail.mass_mailing.test'
_description = 'Sample Mail Wizard'
email_to = fields.Char(string='Recipients', req... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveRecord
module AttributeMethods
# = Active Record Attribute Methods \Write
module Write
extend ActiveSupport::Concern
included do
attribute_method_suffix "=", parameters: "value"
end
module ClassMethods # :nodoc:
private
... | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/attribute_methods/write.rb |
# -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request."""... | unknown | codeparrot/codeparrot-clean | ||
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
**Example**
Generate text embeddings using the 'test_dense_inference' inference endpoint.
```esql
FROM dense_vector_text METADATA _score
| WHERE KNN(text_embedding_field, TEXT_EMBEDDING("be excellent to... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/esql/_snippets/functions/examples/text_embedding.md |
#!/usr/bin/env python2
import sys, importlib
if len(sys.argv) < 2:
print("please provide mapping modulde as first argument, e.g schunk_mapping or elmo_mapping");
exit()
PDOs = importlib.import_module(sys.argv[1]).PDOs
def hex_reverse(data):
return ''.join(reversed([data[i:i+2] for i in xrange(0, len(data... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 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 by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
import time
import os
import sys
import numpy
import h5py
#from PnSC_ui import *
#from PnSC_dataimport import *
from PnSC_SCui import *
#from PnSC_math import *
from PnSC_h5io import *
from PnSC_main import *
from matplotlib.ticker import FuncFormatter
def myexpformat(x, pos):
for ndigs in range(2):
lab=((... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
import frappe
from frappe.utils import add_to_date
@frappe.whitelist()
def get_leaderboard(doctype, timespan, company, field):
"""return top 10 items for that do... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# prevent the tk window from showing up then start the event loop
renWin = vtk.vtkRenderWindow()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin.AddRenderer(r... | unknown | codeparrot/codeparrot-clean | ||
import logging
from virttest import utils_config
from virttest import utils_libvirtd
from autotest.client.shared import error
def run(test, params, env):
"""
Test clear_emulator_capabilities parameter in qemu.conf.
1) Change clear_emulator_capabilities in qemu.conf;
2) Restart libvirt daemon;
3) C... | unknown | codeparrot/codeparrot-clean | ||
from django.contrib.messages.api import get_messages
from django.contrib.messages.constants import DEFAULT_LEVELS
def messages(request):
"""
Return a lazy 'messages' context variable as well as
'DEFAULT_MESSAGE_LEVELS'.
"""
return {
"messages": get_messages(request),
"DEFAULT_MESSAG... | python | github | https://github.com/django/django | django/contrib/messages/context_processors.py |
#!/bin/bash
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | unknown | github | https://github.com/tensorflow/tensorflow | tensorflow/lite/tools/build_aar.sh |
"""Asyncio backports for Python 3.6 compatibility."""
from asyncio import coroutines, ensure_future, get_running_loop
from asyncio.events import AbstractEventLoop
import concurrent.futures
import functools
import logging
import threading
from traceback import extract_stack
from typing import Any, Callable, Coroutine, T... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "v0alpha1.linked-viz.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"uid": "-- Grafana --"
},
"enable": true,
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-common/v0alpha1.linked-viz.v42.v1beta1.json |
/*
Copyright (c) Ivan Matek, Marshall Clow 2021.
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
/// \file is_clamped.hpp
/// \brief IsClamped algorithm
/// \authors Ivan Matek, Marshall Clow
///
#ifndef B... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/algorithm/is_clamped.hpp |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2008-2015 Canonical
#
# This program 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 option) any later version.
#
# This program is distributed... | 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 | ||
#!/usr/bin env python
import json
import mock
from tests.unit import AWSMockServiceTestCase
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
from boto.cloudsearchdomain.layer1 import CloudSearchDomainConnection
class CloudSearchDomainConnectionTest(AWSMockServiceTe... | unknown | codeparrot/codeparrot-clean | ||
package v0alpha1
import (
"context"
"github.com/grafana/grafana-app-sdk/resource"
)
type CoreRoleClient struct {
client *resource.TypedClient[*CoreRole, *CoreRoleList]
}
func NewCoreRoleClient(client resource.Client) *CoreRoleClient {
return &CoreRoleClient{
client: resource.NewTypedClient[*CoreRole, *CoreRol... | go | github | https://github.com/grafana/grafana | apps/iam/pkg/apis/iam/v0alpha1/corerole_client_gen.go |
# Import future print
from __future__ import print_function
import boto3
import datetime
import dateutil.parser
import json
import fileinput
import os
import re
import requests # TODO: get rid of that and make sure urllib2 validates certs ?
import string
from opinel.utils.console import printException, printError, pr... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright 2010-2012 Fabric Engine Inc. All rights reserved.
#
import fabric
FABRIC = fabric.createClient()
parent = FABRIC.DependencyGraph.createNode( "Parent" )
child = FABRIC.DependencyGraph.createNode( "Child" )
try:
child.setDependency( parent, "" )
except Exception:
print( "parentName must be non-empt... | unknown | codeparrot/codeparrot-clean | ||
## This file is part of Invenio.
## Copyright (C) 2011, 2012, 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 your option) any later versio... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use tauri_build::WindowsAttributes;
fn main() {
tauri_build::try_build(
tauri_build::Attributes::new()
.codegen(tauri_build::CodegenContext::new())
.windows_at... | rust | github | https://github.com/tauri-apps/tauri | examples/api/src-tauri/build.rs |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Project'
db.create_table(u'projects_project', (
(u'id', self.gf('django.db.models... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package main
import (
"context"
"os"
"os/signal"
"github.com/hashicorp/cli"
"github.com/hashicorp/go-plugin"
svchost "github.com/hashicorp/terraform-svchost"
"github.com/hashicorp/terraform-svchost/auth"
"github.com/hashicorp/terraform-svc... | go | github | https://github.com/hashicorp/terraform | commands.go |
import marshal
import bkfile
# Write a file containing frozen code for the modules in the dictionary.
header = """
#include "Python.h"
static struct _frozen _PyImport_FrozenModules[] = {
"""
trailer = """\
{0, 0, 0} /* sentinel */
};
"""
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test staging.
import BoostBuild
t = BoostBuild.Tester(use_test_conf... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (C) 2019 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava/src/com/google/common/collect/CompactHashing.java |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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
#
# ... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
get props() {
return { hidden: true };
},
html: '<div hidden></div>',
test({ assert, component, target }) {
component.hidden = false;
assert.htmlEqual(target.innerHTML, '<div></div>');
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/attribute-boolean-hidden/_config.js |
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... | unknown | codeparrot/codeparrot-clean | ||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
... | unknown | codeparrot/codeparrot-clean | ||
'''
Mouse provider implementation
=============================
On linux systems, the mouse provider can be annoying when used with another
multitouch provider (hidinput or mtdev). The Mouse can conflict with them: a
single touch can generate one event from the mouse provider and another
from the multitouch provider.
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2014 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 | ||
# Copyright (C) 2009, 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 | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Björn Edström <be@bjrn.se>
import unittest
from numbertheory import sqrt_modp, inverse_of
class NumbertheoryTest(unittest.TestCase):
def _test_square_roots(self, p):
all_squares = set()
not_squares = set(range(1, p))
for x in xrange(1, p):
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | unknown | codeparrot/codeparrot-clean | ||
import * as ts from "../../_namespaces/ts.js";
import { jsonToReadableText } from "../helpers.js";
import { commandLineCallbacks } from "../helpers/baseline.js";
import { verifyTsc } from "../helpers/tsc.js";
import { TestServerHost } from "../helpers/virtualFileSystemWithWatch.js";
describe("unittests:: tsbuild:: Pub... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/tsbuild/publicApi.ts |
package container
import "github.com/moby/moby/v2/daemon/server/router"
// containerRouter is a router to talk with the container controller
type containerRouter struct {
backend Backend
routes []router.Route
}
// NewRouter initializes a new container router
func NewRouter(b Backend) router.Router {
r := &contai... | go | github | https://github.com/moby/moby | daemon/server/router/container/container.go |
'''
Datalink / Network / Transport layer headers
'''
import socket
import struct
import vstruct
from vstruct.primitives import *
ETH_P_IP = 0x0800
IPPROTO_ICMP = 1
IPPROTO_TCP = 6
IPPROTO_UDP = 17
IPPROTO_IPV6 = 41
TCP_F_FIN = 0x01
TCP_F_SYN = 0x02
TCP_F_RST = 0x04
TCP_F_PUSH = 0x08
TCP_F_ACK =... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
i8 = np.int64(1)
u8 = np.uint64(1)
i4 = np.int32(1)
u4 = np.uint32(1)
b_ = np.bool(1)
b = bool(1)
i = 1
AR = np.array([0, 1, 2], dtype=np.int32)
AR.setflags(write=False)
i8 << i8
i8 >> i8
i8 | i8
i8 ^ i8
i8 & i8
i << AR
i >> AR
i | AR
i ^ AR
i & AR
i8 << AR
i8 >> AR
i8 | AR
i8 ^ AR
i8 & AR
i... | python | github | https://github.com/numpy/numpy | numpy/typing/tests/data/pass/bitwise_ops.py |
import logging
import math
from collections import Counter, namedtuple
from io import BytesIO
from types import SimpleNamespace
from fontTools.cffLib import (
CharStrings,
GlobalSubrsIndex,
IndexedStrings,
PrivateDict,
SubrsIndex,
TopDict,
TopDictIndex,
)
from fontTools.misc.arrayTools impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import dataloader
import pickle
import os.path
import dataloader
import dataprocessor
import numpy
class DataProvider(object):
def __init__(self, order=1, use_pca=False, pca_nodes_path=None,
db_host="localhost", db_user="root", db_password="",
db_name="andrew", device_list=None, start_t... | unknown | codeparrot/codeparrot-clean | ||
import { type ComponentInternalInstance, ssrContextKey } from 'vue'
import {
type PushFn,
type SSRBufferItem,
type SSRContext,
createBuffer,
} from '../render'
export function ssrRenderTeleport(
parentPush: PushFn,
contentRenderFn: (push: PushFn) => void,
target: string,
disabled: boolean,
parentComp... | typescript | github | https://github.com/vuejs/core | packages/server-renderer/src/helpers/ssrRenderTeleport.ts |
//===--- SILLayout.cpp - Defines SIL-level aggregate layouts --------------===//
//
// 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... | cpp | github | https://github.com/apple/swift | lib/AST/SILLayout.cpp |
# -*- coding: utf-8 -*-
"""
sphinx.util.osutil
~~~~~~~~~~~~~~~~~~
Operating system-related utility functions for Sphinx.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import os
import re
import sy... | unknown | codeparrot/codeparrot-clean | ||
########################################################################
# $HeadURL $
# File: StorageElementHandler.py
########################################################################
"""
:mod: StorageElementHandler
.. module: StorageElementHandler
:synopsis: StorageElementHandler is the implementation of a ... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2009-2010 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided... | unknown | codeparrot/codeparrot-clean | ||
# 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)
import os
import sub... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* nodeForeignscan.c
* Routines to support scans of foreign tables
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION... | c | github | https://github.com/postgres/postgres | src/backend/executor/nodeForeignscan.c |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | 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 | ||
/**
* 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/test/java/org/apache/hadoop/util/TestCacheableIPList.java |
# Generated by Django 2.2.6 on 2020-02-17 18:49
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0045_assign_unlock_grouppagepermission'),
... | unknown | codeparrot/codeparrot-clean | ||
#ifndef Py_INTERNAL_STACKREF_H
#define Py_INTERNAL_STACKREF_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_object.h" // Py_DECREF_MORTAL
#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount()
#include ... | c | github | https://github.com/python/cpython | Include/internal/pycore_stackref.h |
#!/usr/bin/env python
from __future__ import print_function
import importlib
import logging
import optparse
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, our_dir)
from bot_lib import run_message_handler_for_bot
def get_lib_module(bots_fn):
bots_fn = os.path.abspath... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 Intel
# 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 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | unknown | codeparrot/codeparrot-clean | ||
//===--- SILRemarkStreamer.h - Interface for streaming remarks --*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2020 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/SILRemarkStreamer.h |
<!---
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 ... | unknown | github | https://github.com/huggingface/transformers | i18n/README_te.md |
# -*- coding: utf-8 -*-
#
# 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
#... | unknown | codeparrot/codeparrot-clean | ||
from tqdm import tqdm
class LogMode(object):
PBAR = 0
PARALLEL = 1
class Logger(object):
MODE = LogMode.PBAR
def __init__(self, *args, **kwargs):
if Logger.MODE == LogMode.PBAR:
self.logger = PbarLogger(*args, **kwargs)
elif Logger.MODE == LogMode.PARALLEL:
sel... | unknown | codeparrot/codeparrot-clean | ||
// RUN: %check_clang_tidy %s bugprone-suspicious-memset-usage %t
void *memset(void *, int, __SIZE_TYPE__);
namespace std {
using ::memset;
}
template <typename T>
void mtempl(int *ptr) {
memset(ptr, '0', sizeof(T));
// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: memset fill value is char '0', potentially mistaken ... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-memset-usage.cpp |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.