code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
* 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-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/package-info.java |
import uuid
from html2text import html2text
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from django.conf import settings
from django.core.cache import cache
from django.core.mail import EmailMultiAlternatives
from airmozilla.base.utils import fix_base_url
from .mo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2018-2019, 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 | ||
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholiqu... | c | github | https://github.com/opencv/opencv | 3rdparty/openjpeg/openjp2/bio.h |
#!/usr/bin/env python
#
# Copyright 2013 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 | ||
# -*- encoding: utf-8 -*-
from openerp import models, fields, api, _
class product_template(models.Model):
_inherit = ['product.template']
attachment_count = fields.Integer(compute='_compute_attachment_count', string="File")
@api.multi
def _compute_attachment_count(self):
IrAttachment = self.... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# EditXT
# Copyright 2007-2013 Daniel Miller <millerdev@gmail.com>
#
# This file is part of EditXT, a programmer's text editor for Mac OS X,
# which can be found at http://editxt.org/.
#
# EditXT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
#
# Copyright 2015 Guanrenfu
#
# 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 | ||
#!/usr/bin/env python
# Copyright 2011 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2003 Python Software Foundation
import unittest
import plistlib
import os
import datetime
from test import test_support
# This test data was generated through Cocoa's NSDictionary class
TESTDATA = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" \
"http://... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import qualities
class UnistraIE(InfoExtractor):
_VALID_URL = r'https?://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://utv.unistra.fr/video.php?id_... | unknown | codeparrot/codeparrot-clean | ||
"""
==========================================
Author: Tyler Brockett
Username: /u/tylerbrockett
Description: Alert Bot (Formerly sales__bot)
Date Created: 11/13/2015
Date Last Edited: 01/08/2017
Version: v2.0
==========================================
"""
from datetime ... | 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 | buildSrc/src/main/java/org/springframework/boot/build/antora/Extensions.java |
# !/usr/bin/env python
from setuptools import setup, find_packages
requirements = [
'pandas',
'parse',
'pymongo',
]
setup_requirements = [
'bumpversion',
]
test_requirements = [
'flake8',
'mongomock',
'mypy'
'pytest',
'unittest-data-provider',
]
description = 'A fast API for stor... | 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 f... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""IMDB movie searcher.
"""
from __future__ import print_function
import logging
import os
import re
import sys
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
import omdb
import requests
from .config import config, FIELDS
# Regex ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014 Google Inc. All Rights Reserved.
"""Utilities for subcommands that need to SSH into virtual machine guests."""
import logging
import os
import subprocess
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import constants... | unknown | codeparrot/codeparrot-clean | ||
"""
Courseware page.
"""
from .course_page import CoursePage
class CoursewarePage(CoursePage):
"""
Course info.
"""
url_path = "courseware/"
xblock_component_selector = '.vert .xblock'
def is_browser_on_page(self):
return self.q(css='body.courseware').present
@property
def n... | unknown | codeparrot/codeparrot-clean | ||
import os
import time
import socket
from resource import getrusage, RUSAGE_SELF
from twisted.application.service import Service
from twisted.internet.task import LoopingCall
from carbon.conf import settings
stats = {}
HOSTNAME = socket.gethostname().replace('.','_')
PAGESIZE = os.sysconf('SC_PAGESIZE')
rusage = getru... | 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/test/java/org/apache/kafka/common/security/oauthbearer/OAuthBearerTokenCallbackTest.java |
import { describe, expect, test, vi } from 'vitest'
import { compile, type Config } from '..'
import { default as plugin } from '../plugin'
import flattenColorPalette from './flatten-color-palette'
const css = String.raw
test('Config files can add content', async () => {
let input = css`
@tailwind utilities;
... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/tailwindcss/src/compat/config.test.ts |
# This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... | unknown | codeparrot/codeparrot-clean | ||
# -*- encoding: utf-8 -*-
from functools import partial
import itertools
import unittest2
from lxml import etree as ET
from lxml.builder import E
from psycopg2 import IntegrityError
from openerp.tests import common
import openerp.tools
Field = E.field
class ViewCase(common.TransactionCase):
def setUp(self):
... | unknown | codeparrot/codeparrot-clean | ||
from lib.mBot import *
import os, sys
import pygame
from pygame.locals import *
import navigator
# R G B
WHITE = (255, 255, 255)
BLACK = ( 0, 0, 0)
RED = (255, 0, 0)
BLUE = ( 0, 0, 255)
GREEN = ( 0, 255, 0)
DARKGREEN = ( 0, 155, 0)
DARKGRAY = ( 40, 40, 40)
... | unknown | codeparrot/codeparrot-clean | ||
'use strict'
/**
* Module dependencies.
*/
var express = require('../..');
var logger = require('morgan');
var vhost = require('vhost');
/*
edit /etc/hosts:
127.0.0.1 foo.example.com
127.0.0.1 bar.example.com
127.0.0.1 example.com
*/
// Main server app
var main = express();
if (!module.parent... | javascript | github | https://github.com/expressjs/express | examples/vhost/index.js |
"""
******
Layout
******
Node positioning algorithms for graph drawing.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import collections
import networkx as nx
__author__ = """... | unknown | codeparrot/codeparrot-clean | ||
#include <ATen/core/Dict.h>
#include <ATen/ATen.h>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <string>
using std::string;
using c10::Dict;
#define ASSERT_EQUAL(t1, t2) ASSERT_TRUE(t1.equal(t2));
TEST(DictTest, givenEmptyDict_whenCallingEmpty_thenReturnsTrue) {
Dict<int64_t, string> dict;
EXPE... | cpp | github | https://github.com/pytorch/pytorch | aten/src/ATen/test/Dict_test.cpp |
# 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 | ||
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be... | c | github | https://github.com/opencv/opencv | 3rdparty/libwebp/src/dsp/msa_macro.h |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
{
"name": "vue",
"version": "3.5.28",
"description": "The progressive JavaScript framework for building modern web UI.",
"main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js",
"types": "dist/vue.d.ts",
"unpkg": "dist/vue.global.js",
"jsdelivr": "dist/vue.global.js",
"files": [
"index.js"... | json | github | https://github.com/vuejs/core | packages/vue/package.json |
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-boot | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java |
#ifndef PACK_OBJECTS_H
#define PACK_OBJECTS_H
#include "odb.h"
#include "thread-utils.h"
#include "pack.h"
#include "packfile.h"
struct repository;
#define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024)
#define DEFAULT_DELTA_BASE_CACHE_LIMIT (96 * 1024 * 1024)
#define OE_DFS_STATE_BITS 2
#define OE_DEPTH_BITS ... | c | github | https://github.com/git/git | pack-objects.h |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/amd,ccp-seattle-v1a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: AMD Cryptographic Coprocessor (ccp)
maintainers:
- Tom Lendacky <thomas.lendacky@amd.com>
properties:
compatible:
... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/crypto/amd,ccp-seattle-v1a.yaml |
#!/usr/bin/python
# Copyright (c) 2016 IBM
#
# This module 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 software is distrib... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.server.routing
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.plugins.*
import io.ktor.server.request.*
import kotlin.math.*
private const va... | kotlin | github | https://github.com/ktorio/ktor | ktor-server/ktor-server-core/common/src/io/ktor/server/routing/RoutingResolveContext.kt |
"""Tests covering the Programs listing on the Studio home."""
import json
from django.conf import settings
from django.core.urlresolvers import reverse
import httpretty
import mock
from oauth2_provider.tests.factories import ClientFactory
from provider.constants import CONFIDENTIAL
from openedx.core.djangoapps.progra... | unknown | codeparrot/codeparrot-clean | ||
import subprocess
import sys
from django.db.backends.base.creation import BaseDatabaseCreation
from .client import DatabaseClient
class DatabaseCreation(BaseDatabaseCreation):
def sql_table_creation_suffix(self):
suffix = []
test_settings = self.connection.settings_dict['TEST']
if test_s... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2026 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | python | github | https://github.com/huggingface/transformers | utils/aggregate_failure_reports.py |
#include <windows.h>
int main(int argc, char** argv)
{
CreateWindow(NULL /*lpClassName*/, NULL /*lpWindowName*/, 0 /*dwStyle*/, 0 /*x*/,
0 /*y*/, 0 /*nWidth*/, 0 /*nHeight*/, NULL /*hWndParent*/, NULL /*hMenu*/,
NULL /*hInstance*/, NULL /*lpParam*/);
DeleteDC(NULL);
retur... | cpp | github | https://github.com/opencv/opencv | cmake/checks/win32uitest.cpp |
# coding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
class VierIE(InfoExtractor):
IE_NAME = 'vier'
_VALID_URL = r'https?://(?:www\.)?vier\.be/(?:[^/]+/videos/(?P<display_id>[^/]+)(?:/(?P<id>\d+))?|video/v3/embed/(?P<embed_id>\d+))'
_TESTS = ... | unknown | codeparrot/codeparrot-clean | ||
from ctypes import *
import unittest
# IMPORTANT INFO:
#
# Consider this call:
# func.restype = c_char_p
# func(c_char_p("123"))
# It returns
# "123"
#
# WHY IS THIS SO?
#
# argument tuple (c_char_p("123"), ) is destroyed after the function
# func is called, but NOT before the result is actually built.
#
# If... | unknown | codeparrot/codeparrot-clean | ||
import json
import logging
import pytz
import datetime
import dateutil.parser
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import redirect
from django.conf import settings
from mitxmako.shortcuts import render_to_response
from django_future.csrf ... | unknown | codeparrot/codeparrot-clean | ||
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {CompilerError} from '../CompilerError';
import {Effect, HIRFunction, IdentifierId, makeInstructionId} from '../HIR';
imp... | typescript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/Inference/AnalyseFunctions.ts |
/*
* 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 | buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/StackId.java |
---
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-client-apps-dbvis.html
applies_to:
stack: ga
serverless: ga
products:
- id: elasticsearch
---
# DbVisualizer [sql-client-apps-dbvis]
You can use the {{es}} JDBC driver to access {{es}} data from DbVisualizer.
::::{importa... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/query-languages/sql/sql-client-apps-dbvis.md |
<?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\Monolog\Handler;
use Monolog\Formatter\FormatterInterfac... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php |
# This file is part of BHMM (Bayesian Hidden Markov Models).
#
# Copyright (c) 2016 Frank Noe (Freie Universitaet Berlin)
# and John D. Chodera (Memorial Sloan-Kettering Cancer Center, New York)
#
# BHMM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Licens... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import pytest
from pandas.errors import Pandas4Warning
from pandas import (
Categorical,
DataFrame,
Index,
Series,
Timestamp,
date_range,
period_range,
timedelta_range,
)
import pandas._testing as tm
from pandas.core.arrays.categorical import CategoricalAccessor
from... | python | github | https://github.com/pandas-dev/pandas | pandas/tests/series/accessors/test_cat_accessor.py |
import numpy as np
import pytest
from pandas import DataFrame, SparseDataFrame, SparseSeries
from pandas.util import testing as tm
@pytest.mark.xfail(reason='Wrong SparseBlock initialization (GH#17386)')
def test_quantile():
# GH 17386
data = [[1, 1], [2, 10], [3, 100], [np.nan, np.nan]]
q = 0.1
spar... | unknown | codeparrot/codeparrot-clean | ||
import filecmp
import hashlib
import os
import random
import requests
import string
import tempfile
import traceback
import uuid
from io import open
from unittest import mock, skip
from synapseclient import File
import synapseclient.core.config
import synapseclient.core.utils as utils
from synapseclient.core.upload.m... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
try:
from html import escape
except ImportError:
from cgi import escape
from wtforms.compat import text_type, iteritems
__all__ = (
'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput',
'RadioInput', 'Select', 'SubmitInput', 'TableWidget',... | unknown | codeparrot/codeparrot-clean | ||
# Disable Flake8 because of all the sphinx imports
#
# 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 ... | python | github | https://github.com/apache/airflow | airflow-ctl/docs/conf.py |
"""
Can be run as a script or imported as a module.
Module exposes the run_pyflakes method which returns a dictionary.
As a script:
python run_pyflakes.py <no_warnings>
prints out all the errors in the library
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
_... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2021 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitoproxy;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import stat... | java | github | https://github.com/mockito/mockito | mockito-extensions/mockito-proxy/src/test/java/org/mockitoproxy/MocksTest.java |
// This code has been modified from its original form by The Cockroach Authors.
// All modifications are Copyright 2024 The Cockroach Authors.
//
// Copyright 2019 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
/... | go | github | https://github.com/cockroachdb/cockroach | pkg/raft/interaction_test.go |
/*
Copyright 2023 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 | cmd/kubemark/app/hollow_node_test.go |
#!/usr/bin/python
#
# Scaleway Security Group Rule management module
#
# Copyright (C) 2018 Antoine Barbare (antoinebarbare@gmail.com).
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
import { jsonToReadableText } from "../helpers.js";
import { getSysForTransitiveReferences } from "../helpers/transitiveReferences.js";
import { verifyTsc } from "../helpers/tsc.js";
import { TestServerHost } from "../helpers/virtualFileSystemWithWatch.js";
describe("unittests:: tsbuild:: transitiveReferences:: when p... | typescript | github | https://github.com/microsoft/TypeScript | src/testRunner/unittests/tsbuild/transitiveReferences.ts |
"""
This module contains generic base85 encoding and decoding functions. The
whoosh.util.numeric module contains faster variants for encoding and
decoding integers.
Modified from:
http://paste.lisp.org/display/72815
"""
import struct
from whoosh.compat import xrange
# Instead of using the character set from the asc... | unknown | codeparrot/codeparrot-clean | ||
//===--- Concurrency.h - Runtime interface for concurrency ------*- 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/Runtime/Concurrency.h |
# Copyright 2024 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 required by appl... | python | github | https://github.com/huggingface/transformers | src/transformers/models/deit/image_processing_deit_fast.py |
"""Config flow for habitica integration."""
from __future__ import annotations
import logging
from aiohttp import ClientResponseError
from habitipy.aio import HabitipyAsync
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_API_KEY, CONF_NAME, CON... | unknown | codeparrot/codeparrot-clean | ||
# BER encoder
from pyasn1.type import base, tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import int2oct, oct2int, ints2octs, null, str2octs
from pyasn1 import debug, error
class Error(Exception): pass
class AbstractItemEncoder:
supportIndefLenMode = 1
def encodeTag(self, ... | unknown | codeparrot/codeparrot-clean | ||
# © 2020 James R. Barlow: github.com/jbarlow83
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, pu... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import argparse
import logging
import os
import re
import subprocess
import sys
import time
from codecs import open
from six.moves.urllib.error import URLError
from six.moves.urllib.parse import urlparse
from six.mo... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... | unknown | codeparrot/codeparrot-clean | ||
import sys
from pymongo import MongoClient
if len(sys.argv) < 5:
print("Not enough arguments.")
print("addSequenceStartEndDates.py <mongoURL> <mongoPort> <userName> <password>")
sys.exit(0)
mongoURL = sys.argv[1]
mongoPort = sys.argv[2]
userName = sys.argv[3]
password = sys.argv[4]
connString = "mongodb:... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A bare-bones test server for testing cloud policy support.
This implements a simple cloud policy test server that can be used to test
chrome's device... | unknown | codeparrot/codeparrot-clean | ||
###############################################################################
##
## Copyright (C) 2013 Tavendo GmbH
##
## 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:/... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'AuctionDocuments.max_price_substantiation_rec'
db.alter... | unknown | codeparrot/codeparrot-clean | ||
/*-------------------------------------------------------------------------
*
* blvalidate.c
* Opclass validator for bloom.
*
* Copyright (c) 2016-2026, PostgreSQL Global Development Group
*
* IDENTIFICATION
* contrib/bloom/blvalidate.c
*
*------------------------------------------------------------------... | c | github | https://github.com/postgres/postgres | contrib/bloom/blvalidate.c |
## Input
```javascript
// @enableInferEventHandlers
import {useRef} from 'react';
// Simulates a handler wrapper
function handleClick(value: any) {
return () => {
console.log(value);
};
}
function Component() {
const ref = useRef(null);
// This should still error: passing ref.current directly to a wrapp... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.ref-value-in-event-handler-wrapper.expect.md |
package etchosts
import (
"bufio"
"bytes"
"fmt"
"io"
"net/netip"
"os"
"regexp"
"strings"
"sync"
)
// Record Structure for a single host record
type Record struct {
Hosts string
IP netip.Addr
}
// WriteTo writes record to file and returns bytes written or error
func (r Record) WriteTo(w io.Writer) (int6... | go | github | https://github.com/moby/moby | daemon/libnetwork/etchosts/etchosts.go |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyradar.filters.frost import frost_filter
from pyradar.filters.kuan import kuan_filter
from pyradar.filters.lee import lee_filter
from pyradar.filters.lee_enhanced import lee_enhanced_filter
from pyradar.filters.median import median_filter
from pyradar.filters.mean im... | unknown | codeparrot/codeparrot-clean | ||
"""
Serializers for all Course Enrollment related return objects.
"""
import logging
from rest_framework import serializers
from student.models import CourseEnrollment
from course_modes.models import CourseMode
log = logging.getLogger(__name__)
class StringListField(serializers.CharField):
"""Custom Serializer ... | unknown | codeparrot/codeparrot-clean | ||
# A demo plugin for Microsoft Outlook (NOT Outlook Express)
#
# This addin simply adds a new button to the main Outlook toolbar,
# and displays a message box when clicked. Thus, it demonstrates
# how to plug in to Outlook itself, and hook outlook events.
#
# Additionally, each time a new message arrives in the Inbox, ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2026 The HuggingFace Inc. team
#
# 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 t... | python | github | https://github.com/huggingface/transformers | src/transformers/generation/continuous_batching/input_ouputs.py |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | unknown | codeparrot/codeparrot-clean | ||
#Datos del problema.
competencia = {
'pista': {'v100mt','v400mt','v800mt','v3000mt','d100mt','d400mt'},
'campo': {'vbala','vdisco','vlargo','dbala'}
}
puntaje = {
'lugar 1': 12, #Medalla
'lugar 2': 9, #Medalla
'lugar 3': 7, #Medalla
'lugar 4': 5,
'lugar 5': 4,
'lugar 6': 3,
'lugar 7': 2,
'lugar 8': 1
}
re... | unknown | codeparrot/codeparrot-clean | ||
// File generated by `rustc_codegen_gcc/tools/generate_intrinsics.py`
// DO NOT EDIT IT!
/// Translate a given LLVM intrinsic name to an equivalent GCC one.
fn map_arch_intrinsic(full_name: &str) -> &'static str {
let Some(name) = full_name.strip_prefix("llvm.") else {
unimplemented!("***** unsupported LLVM... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_codegen_gcc/src/intrinsic/archs.rs |
# -*- 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 | ||
import re
import sys
from decimal import Decimal
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter
from django.contrib.gis.geometry.backe... | unknown | codeparrot/codeparrot-clean | ||
function Component(props) {
const f = () => {
props.value = true;
};
const g = () => {
f();
};
g();
} | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.invalid-prop-mutation-indirect.js |
scrape_configs:
- job_name: "test"
metric_relabel_configs:
- | unknown | github | https://github.com/prometheus/prometheus | config/testdata/empty_metric_relabel_config.bad.yml |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
#from urbansim.estimation.config import config
from urbansim_parcel.configs.controller_config import UrbansimParcelConfiguration
from urbansim.configurations.creating_baseyear_cache_configuration impor... | unknown | codeparrot/codeparrot-clean | ||
export { getStaticProps, default } from 'a' | javascript | github | https://github.com/vercel/next.js | crates/next-custom-transforms/tests/fixture/ssg/getStaticProps/should-support-full-re-export/input.js |
name: 🐛 torch.compile Bug Report
description: Create a report to help us reproduce and fix the bug
labels: ["oncall: pt2"]
body:
- type: markdown
attributes:
value: >
#### Before submitting, please review the [contribution guide](https://github.com/pytorch/pytorch/wiki/The-Ultimate-Guide-to-PyTorc... | unknown | github | https://github.com/pytorch/pytorch | .github/ISSUE_TEMPLATE/pt2-bug-report.yml |
#
# LIME documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 5 23:34:05 2015.
#
# 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.
#
# All configuration values hav... | unknown | codeparrot/codeparrot-clean | ||
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from logging import getLogger as getSysLogger
from logging import *
# Some of the build slave environments don't see the... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !windows && !static && !(darwin && internal)
#include <stdint.h>
#include <dlfcn.h>
// Write our own versions of dlopen/dlsym/dlclose so that we re... | c | github | https://github.com/golang/go | src/cmd/cgo/internal/test/issue4029.c |
"""
Records who we trust to sign feeds.
Trust is divided up into domains, so that it is possible to trust a key
in some cases and not others.
@var trust_db: Singleton trust database instance.
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall i... | unknown | codeparrot/codeparrot-clean | ||
# -*- 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 | ||
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | unknown | codeparrot/codeparrot-clean | ||
import { test } from '../../test';
export default test({
html: 'one',
test({ assert, component, target }) {
component.text = 'two';
assert.htmlEqual(target.innerHTML, 'two');
}
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/component-slot-chained/_config.js |
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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 reta... | unknown | codeparrot/codeparrot-clean | ||
.a.svelte-xyz ~ .b:where(.svelte-xyz) { color: green; }
.a.svelte-xyz ~ .c:where(.svelte-xyz) { color: green; }
.a.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; }
.b.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; }
.c.svelte-xyz ~ .d:where(.svelte-xyz) { color: green; }
.a.svelte-xyz ~ .c:where(.svelte-x... | css | github | https://github.com/sveltejs/svelte | packages/svelte/tests/css/samples/general-siblings-combinator-if-not-exhaustive-with-each/expected.css |
__author__ = 'Amin'
import sys
import math
# convert value provided as HH:MM to a number of minutes
def hours_and_minutes_to_minutes():
d=input()
print((int(d[0])*60+int(d[1])*6+int(d[3])*10+int(d[4])))
# check if provided number is lucky - sum of first three digits is equal to sum of next three digits
# eg.
# 111... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
# In[ ]:
import argparse
import sys
from pgltools_library import *
# In[ ]:
def _formatContacts(contacts,delim):
if len(contacts[0])==6:
return [delim.join([str(y) for y in x]) for x in contacts]
else:
return [delim.join([str(y) for y in x[:-1]])+delim+delim.join([str(y) for ... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.