code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from examples/modular-transformers/modular_my_new_model.py.
# Do NOT edit this file manually as any edits will be overwritten by the generatio... | python | github | https://github.com/huggingface/transformers | examples/modular-transformers/configuration_my_new_model.py |
import { DEV } from 'esm-env';
export * from '../shared/errors.js';
/**
* MESSAGE
* @param {string} PARAMETER
* @returns {never}
*/
export function CODE(PARAMETER) {
if (DEV) {
const error = new Error(`${'CODE'}\n${MESSAGE}\nhttps://svelte.dev/e/${'CODE'}`);
error.name = 'Svelte error';
throw error;
} els... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/scripts/process-messages/templates/client-errors.js |
# coding: utf-8
# # MDOF to equivalent SDOF using the first mode only
# This IPython notebook converts a pushover curve for an MDOF system into an equivalent SDOF capacity curve, considering the first mode of vibration only. The supplied pushover curve, which is in terms of base shear and roof displacement, is transf... | unknown | codeparrot/codeparrot-clean | ||
# ------------------------------------------------------------------------------
# Copyright (c) 2010 Evan Fosmark
#
# 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, inclu... | unknown | codeparrot/codeparrot-clean | ||
#-*- coding: utf-8 -*-
import sys
from django.conf import settings
from django.core import exceptions
from django.utils.importlib import import_module
CLASS_PATH_ERROR = 'django-shop is unable to interpret settings value for %s. '\
'%s should be in the form of a tupple: '\
'(\'pat... | unknown | codeparrot/codeparrot-clean | ||
'''
Code by Richard Jones, released into the public domain.
Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game)
'''
import sys
import math
import euclid
import primitives
import pyglet
from pyglet.window import key
from pyglet.gl import *
window = pyglet.window.Window(fullscreen='-fs' in ... | unknown | codeparrot/codeparrot-clean | ||
import collections, datetime, os
from . import server
from .. journals import keeper
from .. util import check, hasher
class RequestHandler:
def __init__(self, url_prefixes, root, organization=None):
self.keeper = keeper.Keeper(root, organization)
self.url_prefixes = url_prefixes
def receive(s... | unknown | codeparrot/codeparrot-clean | ||
"""
python _generate_pyx.py
Generate Ufunc definition source files for scipy.special. Produces
files '_ufuncs.c' and '_ufuncs_cxx.c' by first producing Cython.
This will generate both calls to PyUFunc_FromFuncAndData and the
required ufunc inner loops.
The functions signatures are contained in 'functions.json', the ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Production Configurations
"""
from __future__ import absolute_import, unicode_literals
from django.utils import six
from .common import * # noqa
# Enable social integration plugins
SOCIAL_ACCOUNTS = (
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.face... | unknown | codeparrot/codeparrot-clean | ||
import timeit
import torch.fx
from torch._inductor.codecache import FxGraphHashDetails
N = 10000
K = 100
def huge_graph():
def fn(x):
for _ in range(N):
x = x.sin()
return x
return torch.fx.symbolic_trace(fn)
def main():
g = huge_graph()
details = FxGraphHashDetails(g, [... | python | github | https://github.com/pytorch/pytorch | benchmarks/dynamo/microbenchmarks/cache_debug_microbenchmarks.py |
# -*- coding: utf-8 -*-
"""
Tests for auth manager WMS/WFS using QGIS Server through HTTP Basic
enabled qgis_wrapped_server.py.
This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider
and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth
configuration to access an HTTP Ba... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import print_function
from fabric.api import local, run, env, parallel, roles, hide, sudo, hosts, \
task, execute, cd, warn_only
from fabric.contrib.files import exists
from fabric.contrib.console import confirm
from fabric.colors import red, green, yellow
from datetime import timedelta
import json
... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2010, 2011 Patrick Crews
#
# 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 Sof... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __str... | unknown | codeparrot/codeparrot-clean | ||
from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os
import glob
import io
from setuptools.extern import six
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_in... | unknown | codeparrot/codeparrot-clean | ||
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('verify_student', '0004_delete_historical_records'),
]
operations = [
migrations.RemoveField(
model_name='icrvstatusemailsconfiguration',
name='changed_by',
),... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, 2017 Jasper Lievisse Adriaanse <j@jasper.la>
# 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':... | unknown | codeparrot/codeparrot-clean | ||
:host {
font-family: var(--inter-font);
display: flex;
justify-content: center;
}
[ngTabs] {
overflow: hidden;
width: 600px;
border-radius: 0.5rem;
border: 1px solid color-mix(in srgb, var(--primary-contrast) 10%, transparent);
}
[ngTabList] {
padding: 0;
display: flex;
list-style: none;
positio... | css | github | https://github.com/angular/angular | adev/src/content/examples/aria/tabs/src/disabled/app/app.css |
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: fail-with-body
Protocols: HTTP
Help: Fail on HTTP errors but save the body
Category: http output
Added: 7.76.0
Mutexed: fail
Multi: boolean
See-also:
- fail
- fail-early
Example:
- --fail-with-body $URL
---
# `--fa... | unknown | github | https://github.com/curl/curl | docs/cmdline-opts/fail-with-body.md |
"""test fancy indexing & misc"""
import array
from datetime import datetime
import re
import weakref
import numpy as np
import pytest
from pandas.errors import IndexingError
from pandas.core.dtypes.common import (
is_float_dtype,
is_integer_dtype,
is_object_dtype,
)
import pandas as pd
from pandas impo... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/indexing/test_indexing.py |
# Copyright 2011-2013 Splunk, 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 or agreed to in wri... | unknown | codeparrot/codeparrot-clean | ||
"""
Read graphs in LEDA format.
LEDA is a C++ class library for efficient data types and algorithms.
Format
------
See http://www.algorithmic-solutions.info/leda_guide/graphs/leda_native_graph_fileformat.html
"""
# Original author: D. Eppstein, UC Irvine, August 12, 2003.
# The original code at http://www.ics.uci.ed... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Tests\Container;
use Attribute;
use Illuminate\Auth\AuthManager;
use Illuminate\Cache\CacheManager;
use Illuminate\Cache\Repository as CacheRepository;
use Illuminate\Config\Repository;
use Illuminate\Container\Attributes\Auth;
use Illuminate\Container\Attributes\Authenticated;
use Illumina... | php | github | https://github.com/laravel/framework | tests/Container/ContextualAttributeBindingTest.php |
"""BleBox switch implementation."""
from homeassistant.components.switch import SwitchEntity
from . import BleBoxEntity, create_blebox_entities
from .const import BLEBOX_TO_HASS_DEVICE_CLASSES
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a BleBox switch entity."""
create_bleb... | unknown | codeparrot/codeparrot-clean | ||
import subprocess
import sys
import os
from init import tb
import re
import time
# for better output from bash execs
def prety_b(_list):
ansi_escape = re.compile(rb'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]')
# print(b''.join(_list).decode('ascii'))
return b"```\n" + ansi_escape.sub(b'', b''.join(_list)) + b"\n```"
... | 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 | ||
use crate::fs::asyncify;
use std::io;
use std::path::Path;
/// Recursively creates a directory and all of its parent components if they
/// are missing.
///
/// This is an async version of [`std::fs::create_dir_all`].
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `mkdir` func... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/fs/create_dir_all.rs |
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | unknown | codeparrot/codeparrot-clean | ||
framework:
session:
storage_factory_id: session.storage.factory.native
handler_id: ~
cookie_secure: false
cookie_samesite: lax | unknown | github | https://github.com/symfony/symfony | src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/session_cookie_secure_auto.yml |
import sys
import pstats
import inspect
import cProfile
from timeit import default_timer
from pychess.compat import basestring
def fident(f):
'''
Get an identifier for a function or method
'''
joinchar = '.'
if hasattr(f, 'im_class'):
fparent = f.im_class.__name__
else:
joincha... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import copy
import json
import operator
from collections import OrderedDict
from functools import partial, reduce, update_wrapper
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import helpers, widgets
from... | unknown | codeparrot/codeparrot-clean | ||
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | unknown | codeparrot/codeparrot-clean | ||
# $Id$
#
# Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, string='') - returns a new hash object implementing the
given hash function; initializing th... | unknown | codeparrot/codeparrot-clean | ||
"""The tests for SleepIQ binary sensor platform."""
import unittest
from unittest.mock import MagicMock
import requests_mock
from homeassistant.setup import setup_component
from homeassistant.components.sleepiq import binary_sensor as sleepiq
from tests.components.sleepiq.test_init import mock_responses
from tests.c... | unknown | codeparrot/codeparrot-clean | ||
""" Support for MBTiles file format, version 1.1.
MBTiles (http://mbtiles.org) is a specification for storing tiled map data in
SQLite databases for immediate use and for transfer. The files are designed for
portability of thousands, hundreds of thousands, or even millions of standard
map tile images in a single file.... | unknown | codeparrot/codeparrot-clean | ||
//===--- Decl.h - Swift Language Declaration ASTs ---------------*- 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/AST/Effects.h |
//===--- DirectiveTree.cpp - Find and strip preprocessor directives -------===//
//
// 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
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/support/DirectiveTree.cpp |
/* Generated file to emulate the ts namespace. */
export * from "../../compiler/_namespaces/ts.js";
export * from "../../jsTyping/_namespaces/ts.js";
export * from "../../services/_namespaces/ts.js";
// Pull this in here so that plugins loaded by the server see compat wrappers.
export * from "../../deprecatedCompat/_n... | typescript | github | https://github.com/microsoft/TypeScript | src/server/_namespaces/ts.ts |
#
# 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/serialization/decoders.py |
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#[cfg(test)]
mod tests {
use std::{
collections::BTreeMap,
env::temp_dir,
fs::{read_dir, read_to_string},
path::Path,
};
use tauri_utils::{
acl::{build... | rust | github | https://github.com/tauri-apps/tauri | crates/tests/acl/src/lib.rs |
# -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# Luis Felipe Mileo <mileo@kmee.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields
from odoo.addons.financial.tests.financial_test_classes import \
FinancialTestCase
class ManualFinancialProcess(FinancialTestCase):
""... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from subprocess import call
from time import sleep
from game import Game
from test_helpers import heuristic_gen, get_successors
from node import Node
import heuristics
import random
import time
from multiprocessing import Pool
import math
cache = {}
found_in_cache = 0
class Test_Engine():
... | unknown | codeparrot/codeparrot-clean | ||
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { SyncWaterfallHook } = require("tapable");
const Compilation = require("../Compilation");
const Generator = require("../Generator");
const { tryRunOrWebpackError } = require("../HookWebpackError");... | javascript | github | https://github.com/webpack/webpack | lib/wasm-async/AsyncWebAssemblyModulesPlugin.js |
#!/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 | ||
/*
* 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-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/lifecycle/ResetStartablesExtension.java |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! The tauri plugin to create and manipulate windows from JS.
use crate::{
plugin::{Builder, TauriPlugin},
Runtime,
};
#[cfg(desktop)]
mod desktop_commands {
use tauri_r... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri/src/window/plugin.rs |
# 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... | python | github | https://github.com/apache/airflow | airflow-core/src/airflow/cli/commands/triggerer_command.py |
"""
Implementation of custom django template tags for
automatically caching template fragments.
"""
from django import template
from django.core.cache import cache
from django.template import Node, TemplateSyntaxError, Variable
from django.template import resolve_variable # lint-amnesty, pylint: disable=no-name-in-mo... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import numpy as np
from pydl.models.pipeline import BaseFilterSelect
class BaseFilterSelectTestCase(unittest.TestCase):
def test_get_config(self):
r = BaseFilterSelect(indexes=[0, 1])
config = r.get_config()
expected_config = dict(
indexes=[0, 1],
n... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | unknown | codeparrot/codeparrot-clean | ||
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002-2012, Industrial Light & Magic, a division of Lucas
// Digital Ltd. LLC
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that th... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/Iex/IexThrowErrnoExc.h |
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/grappler/optimizers/data/map_and_batch_fusion.h |
# Import the Python Imaging Library if it is available. On error, ignore
# the problem and continue. PIL being absent should only affect the
# graphic lump loading/saving methods and the user may not be interested
# in installing PIL just to pass this line if not interested in using the
# graphics functionality at all.... | unknown | codeparrot/codeparrot-clean | ||
import ocl
import pyocl
import camvtk
import time
if __name__ == "__main__":
myscreen = camvtk.VTKScreen()
a=ocl.Point(1,0,0)
myscreen.addActor(camvtk.Point(center=(1,0,0), color=(1,1,1)));
b=ocl.Point(0,1,0)
myscreen.addActor(camvtk.Point(center=(0,1,0), color=(1,1,1)));
c=ocl.Point(0,0,0.2)
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 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 a... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
from django.db.utils import DatabaseError
from django.utils.encoding import python_2_unicode_compatible
class AmbiguityError(Exception):
"""
Raised when more than one migration matches a name prefix.
"""
pass
class BadMigrationError(Exception):
"""
Rais... | unknown | codeparrot/codeparrot-clean | ||
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 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... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/rbac/v1beta1/zz_generated.defaults.go |
from chimera.core.constants import DEFAULT_PROGRAM_DATABASE
from sqlalchemy import (Column, String, Integer, DateTime, Boolean, ForeignKey,
Float, PickleType, MetaData, create_engine)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relation, back... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""QGIS Unit tests for the WFS provider. GUI part
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later vers... | unknown | codeparrot/codeparrot-clean | ||
from datetime import date
from django.forms import DateField, Form, SelectDateWidget
from django.test import override_settings
from django.utils import translation
from django.utils.dates import MONTHS_AP
from .base import WidgetTest
class SelectDateWidgetTest(WidgetTest):
maxDiff = None
widget = SelectDateW... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A "Test Server Spawner" that handles killing/stopping per-test test servers.
It's used to accept requests from the device to spawn and kill instances of ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, 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/lice... | unknown | codeparrot/codeparrot-clean | ||
import unittest
class PassingTest(unittest.TestCase):
"""Dummy test case that always passes."""
def test_pass(self):
"""A test that always passes."""
self.assertTrue(True) | python | github | https://github.com/mongodb/mongo | buildscripts/tests/resmokelib/testing/testcases/testfiles/passing.py |
"""fastube URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | unknown | codeparrot/codeparrot-clean | ||
//go:build linux
/*
Copyright 2021 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 agre... | go | github | https://github.com/kubernetes/kubernetes | pkg/kubelet/cm/internal_container_lifecycle_linux.go |
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone import templ... | unknown | codeparrot/codeparrot-clean | ||
/*===-- include/llvm-c/DataTypes.h - Define fixed size types ------*- C -*-===*\
|* *|
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
|* Exceptions. ... | c | github | https://github.com/apple/swift | include/swift/RemoteInspection/RuntimeHeaders/llvm-c/DataTypes.h |
from connections.base_connection import BaseConnection
from psycopg2 import connect
import os
class PostgresConnection(BaseConnection):
def __enter__(self):
kwargs = {
'host': self.host,
'port': self.port,
'user': self.user,
'dbname': self.dbname,
... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::{fmt, str::FromStr};
const CONFIDENCE_THRESHOLD: f64 = 0.8;
const MACOS_APP... | rust | github | https://github.com/tauri-apps/tauri | crates/tauri-bundler/src/bundle/category.rs |
"""Constants for Synology DSM."""
from synology_dsm.api.core.security import SynoCoreSecurity
from synology_dsm.api.core.upgrade import SynoCoreUpgrade
from synology_dsm.api.core.utilization import SynoCoreUtilization
from synology_dsm.api.dsm.information import SynoDSMInformation
from synology_dsm.api.storage.storage... | unknown | codeparrot/codeparrot-clean | ||
# Benchmarking v2
A comprehensive benchmarking framework for transformer models that supports multiple execution modes (eager, compiled, kernelized), detailed performance metrics collection, and structured output format.
## Quick Start
### Running All Benchmarks
```bash
# Run all benchmarks with default settings
py... | unknown | github | https://github.com/huggingface/transformers | benchmark_v2/README.md |
#!/usr/bin/env python
from setuptools import setup, find_packages
from nodeshot import get_version
def get_install_requires():
"""
parse requirements.txt, ignore links, exclude comments
"""
requirements = []
for line in open('requirements.txt').readlines():
# skip to next iteration if comme... | unknown | codeparrot/codeparrot-clean | ||
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/QuotaUsage.java |
"""
===================================
Examples of Using `FrozenEstimator`
===================================
This example showcases some use cases of :class:`~sklearn.frozen.FrozenEstimator`.
:class:`~sklearn.frozen.FrozenEstimator` is a utility class that allows to freeze a
fitted estimator. This is useful, for i... | python | github | https://github.com/scikit-learn/scikit-learn | examples/frozen/plot_frozen_examples.py |
#!/usr/bin/env python
# File created on 02 May 2012
from __future__ import division
__author__ = "William Van Treuren"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["William Van Treuren", "Jose Carlos Clemente Litran",
"Jose Antonio Navas Molina", "Yoshiki Vazquez Baeza",
... | unknown | codeparrot/codeparrot-clean | ||
export { getStaticPaths, a as getStaticProps, foo, bar as baz } from '.'
export default function Test() {
return <div />
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/should-remove-extra-named-export-speicifers/input.js |
from base import *
DIR = "QA262"
CONF = """
vserver!1!rule!2620!match = directory
vserver!1!rule!2620!match!directory = /%(DIR)s
vserver!1!rule!2620!handler = redir
vserver!1!rule!2620!handler!rewrite!1!show = 1
vserver!1!rule!2620!handler!rewrite!1!regex = ^/(.*)$
vserver!1!rule!2620!handler!rewrite!1!substring = /F... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
##
# Copyright 2009-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | unknown | codeparrot/codeparrot-clean | ||
use cranelift_codegen::isa::TargetFrontendConfig;
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext, Variable};
use rustc_abi::{Float, Integer, Primitive};
use rustc_index::IndexVec;
use rustc_middle::ty::TypeFoldable;
use rustc_middle::ty::layout::{
self, FnAbiError, FnAbiOfHelpers, FnAbiRequest, La... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_cranelift/src/common.rs |
# -*- coding: utf-8 -*-
from openerp import tools
from openerp import models, fields, api
class AccountInvoiceReport(models.Model):
_name = "account.invoice.report"
_description = "Invoices Statistics"
_auto = False
_rec_name = 'date'
@api.multi
@api.depends('currency_id', 'date', 'price_tota... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/ti,tmp464.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: TMP464 and TMP468 temperature sensors
maintainers:
- Guenter Roeck <linux@roeck-us.net>
description: |
±0.0625°C Remote and Loc... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/hwmon/ti,tmp464.yaml |
## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# encoding: utf-8
import tabulate
from modularodm import Q
from website.app import init_app
from website.models import User, NodeLog
LOG_THRESHOLD = 11
def get_active_users(extra=None):
query = (
Q('is_registered', 'eq', True) &
Q('password', 'ne', None) &
Q('merged... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 NEC Corporation.
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import base64
import numpy as np
import csv
import sys
import zlib
import time
import mmap
csv.field_size_limit(sys.maxsize)
FIELDNAMES = ['image_id', 'image_w', 'image_h', 'num_boxes', 'boxes', 'features']
infile = '/data/coco/tsv/trainval/karpathy_val_resnet101_faster_rcnn_genome.tsv'
infile ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2013 Google Inc.
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# First Python Notebook documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 11 12:41:58 2017.
#
# 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
# autogenerat... | unknown | codeparrot/codeparrot-clean | ||
from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet, inlineformset_factory, modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from django.test import TestCase
from .models imp... | 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... | javascript | github | https://github.com/apache/airflow | airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/rules/off.js |
"""
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | unknown | codeparrot/codeparrot-clean | ||
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class SiteMapsConfig(AppConfig):
default_auto_field = "django.db.models.AutoField"
name = "django.contrib.sitemaps"
verbose_name = _("Site Maps") | python | github | https://github.com/django/django | django/contrib/sitemaps/apps.py |
// @validateRefAccessDuringRender @compilationMode:"infer"
function Component(props) {
const value = props.ref.current;
return <div>{value}</div>;
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-read-ref-prop-in-render-property-load.js |
'''
Created on 2 févr. 2014
@author: inso
'''
import time
import logging
from PyQt5.QtWidgets import QWidget, QMessageBox
from PyQt5.QtCore import QModelIndex, pyqtSlot, QDateTime
from PyQt5.QtGui import QIcon
from ..gen_resources.currency_tab_uic import Ui_CurrencyTabWidget
from .community_tab import CommunityTabWi... | unknown | codeparrot/codeparrot-clean | ||
#ifndef RECORD_BUFFER_INCLUDED
#define RECORD_BUFFER_INCLUDED
/*
Copyright (c) 2016, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
... | c | github | https://github.com/mysql/mysql-server | sql/record_buffer.h |
export async function fn() {
console.log('foo');
'use cache';
} | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/errors/server-actions/server-graph/19/output.js |
#!/usr/bin/python
# (c) 2017, NetApp, 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',
'status': ['preview'],
... | unknown | codeparrot/codeparrot-clean | ||
# wordsToNum.py
# Copyright 2006, Paul McGuire
#
# Sample parser grammar to read a number given in words, and return the numeric value.
#
from pyparsing import *
from operator import mul
def makeLit(s,val):
ret = CaselessLiteral(s).setName(s)
return ret.setParseAction( replaceWith(val) )
unitDefinitions = [
... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (C) 2014 Dell, 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 or agreed to in wri... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.