code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import { Routes, Route, Outlet, Link } from "react-router-dom";
export default function App() {
return (
<div>
<h1>Server Rendering Example</h1>
<p>
If you check out the HTML source of this page, you'll notice that it
already contains the HTML markup of the app that was sent from the... | typescript | github | https://github.com/remix-run/react-router | examples/ssr/src/App.tsx |
# Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2011-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | unknown | codeparrot/codeparrot-clean | ||
"""Access point for the HomematicIP Cloud component."""
import asyncio
import logging
from homematicip.aio.auth import AsyncAuth
from homematicip.aio.home import AsyncHome
from homematicip.base.base_connection import HmipConnectionError
from homematicip.base.enums import EventType
from homeassistant.config_entries im... | unknown | codeparrot/codeparrot-clean | ||
// A contrived example to test the double jump removal peephole.
extern "C" unsigned long bar(unsigned long count) {
return count + 1;
}
unsigned long foo(unsigned long count) {
asm(
" cmpq $1,%0\n"
" je .L7\n"
" incq %0\n"
" jmp .L1\n"
".L1: jmp .L2\n"
... | cpp | github | https://github.com/llvm/llvm-project | bolt/test/X86/Inputs/double_jump.cpp |
# -*- coding: utf-8 -*-
"""
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.token import String, Comment, Ke... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import numpy as np
from .. import getisord
from ...weights.Distance import DistanceBand
from ...common import pandas
POINTS = [(10, 10), (20, 10), (40, 10), (15, 20), (30, 20), (30, 30)]
W = DistanceBand(POINTS, threshold=15)
Y = np.array([2, 3, 3.2, 5, 8, 7])
PANDAS_EXTINCT = pandas is None
class G... | unknown | codeparrot/codeparrot-clean | ||
from django.db.models import Q, Sum
from django.db.models.deletion import ProtectedError
from django.db.utils import IntegrityError
from django.forms.models import modelform_factory
from django.test import TestCase, skipIfDBFeature
from .models import (
A, Address, B, Board, C, CharLink, Company, Contact, Content,... | unknown | codeparrot/codeparrot-clean | ||
// Package ipbits contains utilities for manipulating [netip.Addr] values as
// numbers or bitfields.
package ipbits
import (
"encoding/binary"
"net/netip"
"github.com/moby/moby/v2/daemon/libnetwork/internal/uint128"
)
// Add returns ip + (x << shift).
func Add(ip netip.Addr, x uint64, shift uint) netip.Addr {
i... | go | github | https://github.com/moby/moby | daemon/libnetwork/ipbits/ipbits.go |
<?php
namespace Illuminate\Log\Events;
class MessageLogged
{
/**
* Create a new event instance.
*
* @param "emergency"|"alert"|"critical"|"error"|"warning"|"notice"|"info"|"debug" $level The log "level".
* @param string $message The log message.
* @param array $context The log co... | php | github | https://github.com/laravel/framework | src/Illuminate/Log/Events/MessageLogged.php |
"""
Filters that accept a `CommandLineInterface` as argument.
"""
from __future__ import unicode_literals
from .base import Filter
from prompt_toolkit.enums import EditingMode
from prompt_toolkit.key_binding.vi_state import InputMode as ViInputMode
from prompt_toolkit.cache import memoized
__all__ = (
'HasArg',
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright: (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 annotations
class ModuleDocFragment(object):
DOCUMENTATION = r"""
options:
display_skipped_hosts:
name: Show skipped... | python | github | https://github.com/ansible/ansible | lib/ansible/plugins/doc_fragments/default_callback.py |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... | 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 "Licens... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: iso-8859-15 -*-
"""Immutable integer set type.
Integer set class.
Copyright (C) 2006, Heiko Wundram.
Released under the MIT license.
"""
import six
# Version information
# -------------------
__author__ = "Heiko Wundram <me@modelnine.org>"
__version__ = "0.2"
__revision__ = "6"
__date__ = "2006-01-20"... | unknown | codeparrot/codeparrot-clean | ||
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
from toontown.building.ElevatorConstants import *
from toontown.building.ElevatorUtils import *
from toontown.building import DistributedElevatorExt
from toontown.building import DistributedElevator
from toontown.toonbase import To... | unknown | codeparrot/codeparrot-clean | ||
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ExampleViewer} from './example-viewer.compo... | typescript | github | https://github.com/angular/angular | adev/shared-docs/components/viewers/example-viewer/example-viewer.component.spec.ts |
#!/usr/bin/python3
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GFlow
from gi.repository import GtkFlow
import sys
class CalculatorNode(GFlow.SimpleNode):
def __new__(cls, *args, **kwargs):
x = GFlow.SimpleNode.new()
x.__class__ = cls
return x
cl... | unknown | codeparrot/codeparrot-clean | ||
from functools import partial
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
def my_kde_bandwidth(obj, fac=1./5):
"""We use Scott's Rule, multiplied by a constant factor."""
return np.power(obj.n, -1./(obj.d+4)) * fac
loc1, scale1, size1 = (-2, 1, 175)
loc2, scale2, size2 = (2, 0.... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2017 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | unknown | codeparrot/codeparrot-clean | ||
from pymaptools.queue import OrderedSet, Heap
import time
import pickle
import unittest
class TestOrderedSet(unittest.TestCase):
def test_serialize(self):
set1 = OrderedSet('abracadabra')
roundtrip = pickle.loads(pickle.dumps(set1))
self.assertEqual(roundtrip, set1)
empty_oset = Ord... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from hashlib import md5
from time import time
from django.core.cache import cache
from django.utils.cache import _i18n_cache_key_suffix
from mezzanine.conf import settings
from mezzanine.utils.device import device_from_request
from mezzanine.utils.sites import current_site_id
... | unknown | codeparrot/codeparrot-clean | ||
from django.urls import include, path
from . import views
urlpatterns = [
path("extra/<extra>/", views.empty_view, name="inner-extra"),
path("", include("urlpatterns.more_urls")),
] | python | github | https://github.com/django/django | tests/urlpatterns/included_urls.py |
# Warning: Just in developing
# Theoretical this version supports all sizes of fields
# with the condition that size%2 = 1
import random
import os
import copy
# TODO:
# more cheater
# invincible AI
# nicer output
# nicer input
# fix the semantic bugs!!!
# a user function with a manual
# fix the printField function
de... | unknown | codeparrot/codeparrot-clean | ||
# ----------------------------------------------------------------------
# clex.py
#
# A lexer for ANSI C.
# ----------------------------------------------------------------------
import sys
sys.path.insert(0, "../..")
import ply.lex as lex
# Reserved words
reserved = (
'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', ... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v30.value_mappings_and_tooltip_options.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "grafana",
"uid... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v30.value_mappings_and_tooltip_options.v42.v2alpha1.json |
import pandas as pd
from bs4 import BeautifulSoup
import re
import hazm
import numpy as np
from sklearn.cross_validation import train_test_split
train = None
def fetch_data():
df = pd.DataFrame(data={'c1': [1111111, 2, 3], 'c2': [4, 5, 6]})
df.to_csv('test.tsv', sep="\t", index=False)
print(df)
def balan... | unknown | codeparrot/codeparrot-clean | ||
# $Id: ca.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Ivan Vilata i Balaguer <ivan@selidor.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# tra... | unknown | codeparrot/codeparrot-clean | ||
import itertools
import os
import posixpath
import sys
import unittest
import warnings
from posixpath import realpath, abspath, dirname, basename
from test import support, test_genericpath
try:
import posix
except ImportError:
posix = None
# An absolute path to a temporary filename for testing. We can't rely ... | unknown | codeparrot/codeparrot-clean | ||
"""Multiple-producer-multiple-consumer signal-dispatching.
``dispatcher`` is the core of Louie, providing the primary API and the
core logic for the system.
Internal attributes:
- ``WEAKREF_TYPES``: Tuple of types/classes which represent weak
references to receivers, and thus must be dereferenced on retrieval
to... | 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\Component\DependencyInjection\Loader\Configurator;
use Symfony\... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.php |
# (c) 2015, Andrew Gaffney <andrew@agaffney.org>
#
# 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 | ||
import type { AppConfig } from '../apiCreateApp'
import {
DeprecationTypes,
softAssertCompatEnabled,
warnDeprecation,
} from './compatConfig'
import { isCopyingConfig } from './global'
import { internalOptionMergeStrats } from '../componentOptions'
// legacy config warnings
export type LegacyConfig = {
/**
... | typescript | github | https://github.com/vuejs/core | packages/runtime-core/src/compat/globalConfig.ts |
//// [tests/cases/conformance/internalModules/DeclarationMerging/EnumAndModuleWithSameNameAndCommonRoot.ts] ////
//// [EnumAndModuleWithSameNameAndCommonRoot.ts]
enum enumdule {
Red, Blue
}
namespace enumdule {
export class Point {
constructor(public x: number, public y: number) { }
}
}
var x: e... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.js |
# Tests command line execution of scripts
import unittest
import os
import os.path
import test.test_support
from test.script_helper import (run_python,
temp_dir, make_script, compile_script,
assert_python_failure, make_pkg,
... | unknown | codeparrot/codeparrot-clean | ||
from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_picture import PictureIqProtocolEntity
class ListPicturesIqProtocolEntity(PictureIqProtocolEntity):
'''
<iq type="get" id="{{id}}" xmlns="w:profile:picture", to="self.jid">
<list>
<user jid="{{user_jid}}"></user>
... | unknown | codeparrot/codeparrot-clean | ||
"""
=================================================================
Test with permutations the significance of a classification score
=================================================================
In order to test if a classification score is significative a technique
in repeating the classification procedure aft... | unknown | codeparrot/codeparrot-clean | ||
"""
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import datetime
import sys
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.core.cache import cache
from django.core.management.base import CommandError
from django.c... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import pymysql
import sys, os, json, time, pymongo
app_dir = os.path.abspath("../")
sys.path.append(app_dir)
from gjqyxyxxcxxt import settings
from gjqyxyxxcxxt.database.my_redis import QueueRedis
conn = None
def connect_db():
global conn
conn = pymysql.connect(host="172.16.16.15",port... | unknown | codeparrot/codeparrot-clean | ||
"""
Pages page for a course.
"""
from common.test.acceptance.pages.common.utils import click_css, confirm_prompt
from common.test.acceptance.pages.studio.course_page import CoursePage
from bok_choy.promise import EmptyPromise
from selenium.webdriver import ActionChains
class PagesPage(CoursePage):
"""
Pages pa... | unknown | codeparrot/codeparrot-clean | ||
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="nodejs.org:node-version" content="__VERSION__">
<title>__SECTION__ | Node.js __VERSION__ Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lat... | html | github | https://github.com/nodejs/node | doc/template.html |
#ifndef COMMIT_H
#define COMMIT_H
#include "object.h"
#include "add-interactive.h"
struct signature_check;
struct strbuf;
struct tree;
#define COMMIT_NOT_FROM_GRAPH 0xFFFFFFFF
#define GENERATION_NUMBER_INFINITY ((1ULL << 63) - 1)
#define GENERATION_NUMBER_V1_MAX 0x3FFFFFFF
#define GENERATION_NUMBER_ZERO 0
#define GE... | c | github | https://github.com/git/git | commit.h |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from stencil_kernel import *
import sys
import numpy
import math
width = int(sys.argv[2])
height = int(sys.argv[3])
image_in = open(sys.argv[1], 'rb')
stdev_d = 3
radius = stdev_d * 3
class Kernel(StencilKernel):
def run(self, in_grid, out_grid):
self.kernel(in_grid, self.gaussian(stdev_d, radius*2), self.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# getting_started documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 16 11:19:12 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | 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 us... | unknown | codeparrot/codeparrot-clean | ||
//// [tests/cases/conformance/classes/propertyMemberDeclarations/autoAccessor7.ts] ////
//// [autoAccessor7.ts]
abstract class C1 {
abstract accessor a: any;
}
class C2 extends C1 {
accessor a = 1;
}
class C3 extends C1 {
get a() { return 1; }
}
//// [autoAccessor7.js]
"use strict";
var __classPrivateFi... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/autoAccessor7(target=es2015,usedefineforclassfields=true).js |
from __future__ import division, absolute_import, print_function
import sys
import re
from numpy.testing.utils import jiffies, memusage
def cmdline():
m=re.compile(r'\A\d+\Z')
args = []
repeat = 1
for a in sys.argv[1:]:
if m.match(a):
repeat = eval(a)
else:
arg... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.default... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
"""Authors: Łukasz Opioła, Konrad Zemek
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
A custom utils library used across docker scripts.
"""
from __future__ import print_function
import argparse
import inspect
import json
import os
import req... | unknown | codeparrot/codeparrot-clean | ||
import abc
import contextlib
from ._core import MultiOpen, READ, WRITE
from ..core_types import NativeType
from ..variables import Variable
from ..holder import HolderHolder
import commands as c
class ExecChain(HolderHolder, NativeType, MultiOpen):
def __init__(self):
self.components = []
MultiOp... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2024 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/emu3.md |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ivr', '0001_initial'),
('flows', '0001_initial'),
('orgs', '0001_initial'),
]
operat... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf-8 -*-
# pyswip -- Python SWI-Prolog bridge
# Copyright (c) 2007-2012 Yüce Tekol
#
# 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 limi... | 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/Asset/AssetGraph.tsx |
#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008, 2018 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boos... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/detail/lightweight_thread.hpp |
/*
* 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-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 6/2/2015
@author: Antonio Hermosilla Rodrigo.
@contact: anherro285@gmail.com
@organization: Antonio Hermosilla Rodrigo.
@copyright: (C) 2011 by Antonio Hermosilla Rodrigo
@version: 1.0.0
"""
from math import cos,sin,tan,sqrt
import Geometrias.Angulo as an... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2006-2009 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 | ||
#!/usr/bin/env python
# BCET Workflow
__author__ = 'Sam Brooke'
__date__ = 'September 2017'
__copyright__ = '(C) 2017, Sam Brooke'
__email__ = "sbrooke@tuta.io"
import os
import gdal
from geopandas import GeoDataFrame
from shapely.geometry import Polygon
import georasters as gr
import matplotlib.pyplot as plt
import... | unknown | codeparrot/codeparrot-clean | ||
"""Test PbenchConfig class and objects
"""
import pytest
from pathlib import Path
from pbench import PbenchConfig
from pbench.common.exceptions import BadConfig
_config_path_prefix = Path("lib/pbench/test/unit/common/config")
class TestPbenchConfig:
def test_empty_config(self):
config = PbenchConfig(_c... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import pytest
from obviousli.defs import State, Truth
from obviousli.models.LexicalModel import LexicalModel
from keras import backend as K
@pytest.fixture
def word_map():
words = "we eat bananas for lunch do n't .".split()
return {word : i for i, word in... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration options for various cbuildbot builders."""
# Disable relative import warning from pylint.
# pylint: disable=W0403
... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
# torch.utils.dlpack
```{eval-rst}
.. currentmodule:: torch.utils.dlpack
```
```{eval-rst}
.. autofunction:: from_dlpack
```
```{eval-rst}
.. autofunction:: to_dlpack
``` | unknown | github | https://github.com/pytorch/pytorch | docs/source/dlpack.md |
# encoding: utf-8
# Copyright 2012–2020 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
'''LabCAS RDF Generator.
'''
from .rdfgenerator import IRDFGenerator
from .utils import validateAccessibleURL
from Acquisition import aq_inner
from edrn.rdf import _
from pysolr... | 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... | unknown | codeparrot/codeparrot-clean | ||
//===----------------------------------------------------------------------===//
//
// 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/altera/IdDependentBackwardBranchCheck.h |
# Copyright 2024 Descript and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | python | github | https://github.com/huggingface/transformers | src/transformers/models/dac/feature_extraction_dac.py |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-06 12:40
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('quran_text', '0001_initial'),
]
... | unknown | codeparrot/codeparrot-clean | ||
import os
from setuptools import setup, find_packages
import librarian_dashboard as pkg
def read(fname):
""" Return content of specified file """
return open(os.path.join(os.path.dirname(__file__), fname)).read()
VERSION = pkg.__version__
setup(
name='librarian-dashboard',
version=VERSION,
licen... | 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/proxy/serviceport.go |
# App.py
# Application stuff.
# The application is responsible for managing the main frame window.
#
# We also grab the FileOpen command, to invoke our Python editor
" The PythonWin application code. Manages most aspects of MDI, etc "
import win32con
import win32api
import win32ui
import sys
import string
import os
fro... | unknown | codeparrot/codeparrot-clean | ||
"""
Tests for Course API forms.
"""
from itertools import product
from urllib import urlencode
import ddt
from django.contrib.auth.models import AnonymousUser
from django.http import QueryDict
from openedx.core.djangoapps.util.test_forms import FormTestMixin
from student.tests.factories import UserFactory
from xmodu... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# +---------+
# | echo.py |
# +---------+
# A simple ICMP-8 ping test.
#
# @authors: Isis Lovecruft, <isis@torproject.org>
# @version: 0.0.2-pre-alpha
# @license: copyright (c) 2012 Isis Lovecruft
# see attached LICENCE file
#
import os
from twisted.pyth... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (c) 2017 Hewlett Packard Enterprise, L.P.
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, 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/licenses/LICENSE-2.0
#
# Unless ... | unknown | codeparrot/codeparrot-clean | ||
@import "vars/colors";
@import "vars/margins";
@import "vars/fontSizes"; | unknown | github | https://github.com/vercel/next.js | examples/cms-sitecore-xmcloud/src/assets/sass/abstracts/_vars.scss |
use serde_derive::{Deserialize, Serialize};
use serde_test::{assert_tokens, Token};
#[test]
fn test_raw_identifiers() {
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
enum r#type {
r#type { r#type: () },
}
assert_tokens(
&r#type::r#type { r#type:... | rust | github | https://github.com/serde-rs/serde | test_suite/tests/unstable/mod.rs |
<?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\Bridge\PsrHttpMessage\Tests\Factory;
use PHPUnit\Framework\Test... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/PsrHttpMessage/Tests/Factory/HttpFoundationFactoryTest.php |
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/loongson,cpu-interrupt-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: LoongArch CPU Interrupt Controller
maintainers:
- Liu Peibao <liupeibao@loongson.cn>
pr... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/interrupt-controller/loongson,cpu-interrupt-controller.yaml |
"""Suite Metrowerks Shell Suite: Events supported by the Metrowerks Project Shell
Level 1, version 1
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code =... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import testing
from chainer.testing import attr
from chainer.utils import force_array
@testing.parameterize(*testing.product_dict(
[{'shape': (3,), 'dtype': 'f', 'axis': 0, 'inv': False},
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: UTF-8 -*-
# Copyright (C) 2016 Sylvain Taverne <sylvain@agicia.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | unknown | codeparrot/codeparrot-clean | ||
"use strict";
const path = require("path");
module.exports = ({ outputDirectory }) =>
class Worker {
constructor(resource, options = {}) {
const isFileURL = /^file:/i.test(resource);
const isBlobURL = /^blob:/i.test(resource);
if (!isFileURL && !isBlobURL) {
expect(resource.origin).toBe("https://test... | javascript | github | https://github.com/webpack/webpack | test/helpers/createFakeWorker.js |
import { flushSync } from 'svelte';
import { ok, test } from '../../test';
export default test({
html: `
<button>action</button>
`,
test({ assert, target, window }) {
const button = target.querySelector('button');
ok(button);
const enter = new window.MouseEvent('mouseenter');
const leave = new window.Mo... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/action-update/_config.js |
package v0alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
)
// This is returned from the POST command
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type DashboardSnapshotWithDeleteKey struct {
Snapshot... | go | github | https://github.com/grafana/grafana | apps/dashboard/pkg/apis/dashboard/v0alpha1/snapshot.go |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
const NormalModule = require("./NormalModule");
const makeSerializable = require("./util/makeSerializable");
/** @typedef {import("./Module")} Module */
/** @typedef {import("./NormalModule").... | javascript | github | https://github.com/webpack/webpack | lib/CssModule.js |
#include <ATen/core/TensorBase.h>
#include <ATen/core/TensorBody.h>
#include <c10/util/OptionalArrayRef.h>
#include <c10/util/Exception.h>
#ifdef AT_PER_OPERATOR_HEADERS
#include <ATen/ops/_assert_tensor_metadata_native.h>
#endif
namespace at {
class Tensor;
namespace native {
template<typename O, typename C>
stat... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/ComparisonUtils.cpp |
from translate.convert import test_convert, txt2po
from translate.misc import wStringIO
from translate.storage import txt
class TestTxt2PO(object):
def txt2po(self, txtsource, template=None):
"""helper that converts txt source to po source without requiring files"""
inputfile = wStringIO.StringIO(... | unknown | codeparrot/codeparrot-clean | ||
use crate::spec::{Abi, Arch, FloatAbi, Target, TargetMetadata, TargetOptions, base};
pub(crate) fn target() -> Target {
Target {
llvm_target: "arm-unknown-linux-gnueabihf".into(),
metadata: TargetMetadata {
description: Some("Armv6 Linux, hardfloat (kernel 3.2, glibc 2.17)".into()),
... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Thomas Amland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | unknown | codeparrot/codeparrot-clean | ||
from openerp import api, models, fields, SUPERUSER_ID, exceptions
class replace_rule(models.Model):
_name = 'base_replace_ref.rule'
name = fields.Char('Name', required=True)
draft = fields.Boolean('Draft', default=True)
model_id = fields.Many2one('ir.model', 'Model', required=True)
value_line_ids... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/errors/IllegalGenerationException.java |
# See documentation in:
# http://doc.scrapy.org/topics/spiders.html
from scrapy.contrib.loader.processor import Compose
from rho_blogs.processors import StringToDatetime
from rho_blogs.spider import (ElggBlogArchiveSpider,
ElggBlogPostLoader,
ElggCommentPost... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
import sys
import argparse
import time
import socket
from socket import socket as Socket
def main():
# Command line arguments. Use a server_port > 1024 by default so that we can run
# server without sudo.
parser = argparse.ArgumentParser()
parser.add_argument('--server-port',... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.