code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of t... | unknown | codeparrot/codeparrot-clean | ||
# torch.utils.deterministic
```{eval-rst}
.. py:module:: torch.utils.deterministic
.. currentmodule:: torch.utils.deterministic
.. attribute:: fill_uninitialized_memory
A :class:`bool` that, if True, causes uninitialized memory to be filled with
a known value when :meth:`torch.use_deterministic_algorithms()`... | unknown | github | https://github.com/pytorch/pytorch | docs/source/deterministic.md |
import raptureAPI
import multipart
import json
import time
import base64
# TODO These need to be parameters
repo = '//nightly_python'
seriesRepoUri = 'series:'+repo
site = 'localhost:8665/rapture'
username = 'rapture'
password = 'rapture'
rapture = raptureAPI.raptureAPI(site, username, password)
def test_delete_al... | unknown | codeparrot/codeparrot-clean | ||
/// Consumes a unit of budget and returns the execution back to the Tokio
/// runtime *if* the task's coop budget was exhausted.
///
/// The task will only yield if its entire coop budget has been exhausted.
/// This function can be used in order to insert optional yield points into long
/// computations that do not us... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/task/coop/consume_budget.rs |
remote_write:
- url: localhost:9090
queue_config:
retry_on_http_429: true
- url: localhost:9201 | unknown | github | https://github.com/prometheus/prometheus | config/testdata/remote_write_retry_on_rate_limit.good.yml |
/*
* 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/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageConfigTests.java |
# ------------------------------------------------------------------------
# Copyright 2015 Intel Corporation
#
# 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/li... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright (c) 2016 Keith Sterling
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 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.
"""Presubmit script for Chromium WebUI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the pre... | unknown | codeparrot/codeparrot-clean | ||
#
# (c) 2016 Red Hat 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 version.
#
# Ansible is d... | unknown | codeparrot/codeparrot-clean | ||
#include "redismodule.h"
#include <pthread.h>
#include <assert.h>
#define UNUSED(V) ((void) V)
RedisModuleUser *user = NULL;
int call_without_user(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (argc < 2) {
return RedisModule_WrongArity(ctx);
}
const char *cmd = RedisModule_String... | c | github | https://github.com/redis/redis | tests/modules/usercall.c |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# FoFiX #
# Copyright (C) 2009 Team FoFiX ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# File: generate.py ; This file is part of Twister.
# version: 2.003
# Copyright (C) 2013 , Luxoft
# Authors:
# Adrian Toader <adtoader@luxoft.com>
# Andrei Costachi <acostachi@luxoft.com>
# Andrei Toma <atoma@luxoft.com>
# Cristi Constantin <crconstantin@luxoft.com>
# Daniel Ci... | unknown | codeparrot/codeparrot-clean | ||
from django.conf.urls import include, patterns, url
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import redirect
from reviews.urls import review_patterns
from stats.urls import stats_patterns
from . import views
ADDON_ID = r"""(?P<addon_id>[^/<>"']+)"""
# These will all start with /addo... | unknown | codeparrot/codeparrot-clean | ||
import threading
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import (
CONTEXT_PTR, error_h, lgeos, notice_h,
)
class GEOSContextHandle(GEOSBase):
"""
Python object representing a GEOS context handle.
"""
ptr_type = CONTEXT_PTR
destructor = lgeos.finis... | unknown | codeparrot/codeparrot-clean | ||
import json
from django.test import TestCase
from django.core import signing
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponse
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.formtools.wizard.storage.cookie import CookieStorage
from django.con... | unknown | codeparrot/codeparrot-clean | ||
import {Directive, forwardRef, inject, Injectable} from '@angular/core';
import {
AsyncValidator,
AbstractControl,
NG_ASYNC_VALIDATORS,
ValidationErrors,
} from '@angular/forms';
import {catchError, map} from 'rxjs/operators';
import {ActorsService} from './actors.service';
import {Observable, of} from 'rxjs';
... | typescript | github | https://github.com/angular/angular | adev/src/content/examples/form-validation/src/app/shared/role.directive.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... | unknown | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/site/markdown/release/0.15.4/RELEASENOTES.0.15.4.md |
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/ernie4_5_vl_moe/modular_ernie4_5_vl_moe.py.
# Do NOT edit this file manually as any edits will be overwritten by ... | python | github | https://github.com/huggingface/transformers | src/transformers/models/ernie4_5_vl_moe/image_processing_ernie4_5_vl_moe.py |
# Copyright (C) 2014, 2015 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
from django.contrib.auth.models import User, AnonymousUser
from django.core.management import call_command
from StringIO import StringIO
class BasicTestCase(TestCase):
def test_user(self):
"Check that users can be created and can set their password"
u = User.objects... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class Helicopter
include ActiveModel::Conversion
end
class Helicopter::Comanche
include ActiveModel::Conversion
end
class Helicopter::Apache
include ActiveModel::Conversion
class << self
def model_name
@model_name ||= ActiveModel::Name.new(self).tap do |model_name|
... | ruby | github | https://github.com/rails/rails | activemodel/test/models/helicopter.rb |
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSch... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
#undef FD_SETSIZE
/* redefine smaller size then default 64 */
#define FD_SETSIZE 32
#include <ruby.h>
static VALUE
test_select(VALUE self)
{
int sd = socket(AF_INET, SOCK_DGRAM, 0);
struct timeval zero;
fd_set read;
fd_set write;
fd_set error;
zero.tv_sec = 0;
zero.tv_usec = 0;
FD_ZER... | c | github | https://github.com/ruby/ruby | ext/-test-/win32/fd_setsize/fd_setsize.c |
/*
* Copyright 2002-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-framework | spring-aop/src/test/java/org/springframework/aop/config/TopLevelAopTagTests.java |
//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/flowcontrol/v1beta2/zz_generated.defaults.go |
# Generated by h2py from /usr/include/sys/socket.h
SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
SO_DEBUG = 0x0001
SO_ACCEPTCONN = 0x0002
SO_REUSEADDR = 0x0004
SO_KEEPALIVE = 0x0008
SO_DONTROUTE = 0x0010
SO_BROADCAST = 0x0020
SO_USELOOPBACK = 0x0040
SO_LINGER = 0x0080
SO_OOBINLINE = 0x0100... | unknown | codeparrot/codeparrot-clean | ||
import os
import tempfile
import unittest
from nose.tools import raises
from nose.tools import timed
from ansible import errors
from ansible.module_common import ModuleReplacer
from ansible.module_utils.basic import heuristic_log_sanitize
from ansible.utils import checksum as utils_checksum
TEST_MODULE_DATA = """
fr... | unknown | codeparrot/codeparrot-clean | ||
# PyIdGen - User Profile Generation Library for Quality Assurance and Information Security Testing
# Copyright (C) 2013 Paul Greenberg <paul@greenberg.pro>
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python2
""" Python implementation of Rijndael encryption algorithm.
This code is in the public domain.
This code is based on a public domain C implementation
by Philip J. Erdelsky:
http://www.efgh.com/software/rijndael.htm
"""
import sys
import struct
def KEYLENGTH(keybits): return (keybits)/8
de... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import render_to_string
from mongoengine.base import Vali... | unknown | codeparrot/codeparrot-clean | ||
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | 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/crypto/key/JavaKeyStoreProvider.java |
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, api, exceptions, _
class Sa... | unknown | codeparrot/codeparrot-clean | ||
from django.db import models
from django.db.migrations.operations.base import Operation
from django.db.migrations.state import ModelState
from django.db.models.fields.related import RECURSIVE_RELATIONSHIP_CONSTANT
from django.db.models.options import normalize_together
from django.utils.functional import cached_propert... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
What is the greatest product of four adjacent numbers in the same direction
(up, down, left, right, or diagonally) in the 20×20 grid?
"""
from time import time
start = time()
getal = '''08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
49 49 99 40 17 81 18 57 60 87 17 40 98 43 ... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package cli
import (
"archive/zip"
"bytes"
"compress/gzip"
"context"
_ "embed"
"encoding/gob"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
"sor... | go | github | https://github.com/cockroachdb/cockroach | pkg/cli/tsdump_upload.go |
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Antonio Espinosa
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class ResPartnerNuts(models.Model):
_name = 'res.partner.nuts'
_order = "parent_left... | unknown | codeparrot/codeparrot-clean | ||
"""
csv.py - read/write/investigate CSV files
"""
import re
from functools import reduce
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONN... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | unknown | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/Abstract.hpp |
# -*- coding: utf-8 -*-
from openerp.osv import orm, fields
class test_converter(orm.Model):
_name = 'web_editor.converter.test'
# disable translation export for those brilliant field labels and values
_translate = False
_columns = {
'char': fields.char(),
'integer': fields.integer(),... | unknown | codeparrot/codeparrot-clean | ||
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | go | github | https://github.com/kubernetes/kubernetes | pkg/apis/apps/v1beta1/defaults_test.go |
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 versio... | unknown | codeparrot/codeparrot-clean | ||
{
"env": [
"bom",
"cssom",
"dom",
"geometry",
"html",
"node",
"serviceworkers",
"streams",
"web-animations"
],
"ignore": [
"create-react-class",
"jest",
"regenerator-runtime",
"webpack",
"ws"
]
} | json | github | https://github.com/facebook/react | flow-typed.config.json |
#!/usr/bin/python
import os
import unittest
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared.settings import settings
from autotest.client.shared.test_utils import mock
from autotest.scheduler import drone_manager, drones
from autotest.scheduler import schedul... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 | ||
/* Interfaces to configure, query, create & destroy the Python runtime */
#ifndef Py_PYLIFECYCLE_H
#define Py_PYLIFECYCLE_H
#ifdef __cplusplus
extern "C" {
#endif
/* Initialization and finalization */
PyAPI_FUNC(void) Py_Initialize(void);
PyAPI_FUNC(void) Py_InitializeEx(int);
PyAPI_FUNC(void) Py_Finalize(void);
#if ... | c | github | https://github.com/python/cpython | Include/pylifecycle.h |
import { test } from '../../assert';
export default test({
mode: ['client'],
async test({ assert, window }) {
// wait the script to load (maybe there a better way)
await new Promise((resolve) => setTimeout(resolve, 100));
assert.htmlEqual(
window.document.body.innerHTML,
`<main><b id="r1">1</b><b id="r2"... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-browser/samples/head-scripts/_config.js |
import flask
from gitmostwanted.app import db
from gitmostwanted.tasks.github import repo_starred_star
from gitmostwanted.models.user import User, UserAttitude
from gitmostwanted.models.repo import Repo
user_profile = flask.Blueprint('user_profile', __name__)
@user_profile.route('/<name>')
def overview(name):
ent... | 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 {Pipe, PipeTransform} from '@angular/core';
import {NavigationItem} from '../interfaces/index';
@Pipe({
na... | typescript | github | https://github.com/angular/angular | adev/shared-docs/pipes/is-active-navigation-item.pipe.ts |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, random
from frappe.utils.make_random import how_many, get_random
from frappe.desk import query_report
from erpnext.setup.utils import ge... | unknown | codeparrot/codeparrot-clean | ||
//===--- ChaCha.swift -----------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014-2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LIC... | swift | github | https://github.com/apple/swift | benchmark/single-source/ChaCha.swift |
/*
* Copyright (C) 2014 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | java | github | https://github.com/google/guava | android/guava-tests/test/com/google/common/graph/AbstractGraphTest.java |
#
# 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 | ||
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package tfdiags
// diagnosticBase can be embedded in other diagnostic structs to get
// default implementations of Severity and Description. This type also
// has default implementations of Source and FromExpr that return no source
// location or e... | go | github | https://github.com/hashicorp/terraform | internal/tfdiags/diagnostic_base.go |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import socialregistration.models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
migrations.swappable_dependency(settings.AU... | unknown | codeparrot/codeparrot-clean | ||
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2009-2014 DreamWorks Animation LLC.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * ... | c | github | https://github.com/opencv/opencv | 3rdparty/openexr/IlmImf/ImfDwaCompressor.h |
#!/usr/bin/env python
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
import boto.ec2
from boto.ec2.connection import EC2Connection
class TestEC2ConnectionBase(AWSMockServiceTestCase):
connection_class = EC2Connection
def setUp(self):
super(TestEC2ConnectionBase, self).... | unknown | codeparrot/codeparrot-clean | ||
import datetime
import hashlib
import os
import sys
import redis
# import modules from common folder
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common'))
from news_api_client import NewsApiClient
import configuration_service_client
from cloudAMQP_client import CloudAMQPClient
from logger import L... | unknown | codeparrot/codeparrot-clean | ||
from functools import update_wrapper, wraps
from unittest import TestCase
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import (
login_required, permission_required, user_passes_test,
)
from django.http import HttpRequest, HttpResponse, HttpResponseNotA... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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
#... | unknown | codeparrot/codeparrot-clean | ||
import { __unstable__loadDesignSystem } from '@tailwindcss/node'
import { expect, test, vi } from 'vitest'
import * as versions from '../../utils/version'
import { migrateSimpleLegacyClasses } from './migrate-simple-legacy-classes'
vi.spyOn(versions, 'isMajor').mockReturnValue(true)
test.each([
['overflow-ellipsis',... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/@tailwindcss-upgrade/src/codemods/template/migrate-simple-legacy-classes.test.ts |
##########################################################################
# Copyright (c) 2009, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092... | unknown | codeparrot/codeparrot-clean | ||
# 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 applica... | 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 | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2025 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.
package runtime_test
import (
"runtime"
"testing"
)
func TestPrintQuoted(t *testing.T) {
for _, tbl := range []struct {
in, expected string
}{
{in: "b... | go | github | https://github.com/golang/go | src/runtime/print_quoted_test.go |
import os
from dotgit.__main__ import main
from dotgit.git import Git
class TestMain:
def setup_repo(self, tmp_path, flist):
home = tmp_path / 'home'
repo = tmp_path / 'repo'
os.makedirs(home)
os.makedirs(repo)
main(args=['init'], cwd=str(repo))
with open(repo / 'fil... | 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/oncrpc/security/CredentialsNone.java |
# -*- coding: utf-8 -*-
import datetime, time, csv, os, shutil
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import MultiCursor
from utils.db import SqliteDB
from utils.rwlogging import log
from trader import Trader
import dataloader
from indicator import ma, macd, bolling, rsi, kdj
from st... | unknown | codeparrot/codeparrot-clean | ||
"""Test functionality of mldata fetching utilities."""
import os
import shutil
import tempfile
import scipy as sp
from sklearn import datasets
from sklearn.datasets import mldata_filename, fetch_mldata
from sklearn.utils.testing import assert_in
from sklearn.utils.testing import assert_not_in
from sklearn.utils.test... | unknown | codeparrot/codeparrot-clean | ||
from pandas import Series
class TestSparseAccessor:
def test_sparse_accessor_updates_on_inplace(self):
ser = Series([1, 1, 2, 3], dtype="Sparse[int]")
return_value = ser.drop([0, 1], inplace=True)
assert return_value is None
assert ser.sparse.density == 1.0 | python | github | https://github.com/pandas-dev/pandas | pandas/tests/series/accessors/test_sparse_accessor.py |
"""
The main QuerySet implementation. This provides the public API for the ORM.
"""
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
from copy import deepcopy
from django.db import connection, transaction, IntegrityError
from django.db.models.aggregates import Aggregate
from d... | unknown | codeparrot/codeparrot-clean | ||
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from django.conf import settings
from django.utils.translation import ugettext
from notification import backends
MOBILE_NUMBER_SETTING_KEY = "NOTIFICATION_TWILIO_USER_MOBILE_NUMBER"
TWILIO_ACCOUNT_SETTING_KEY = "TWILIO_ACCOUNT_SID"
TWILIO_AUTH_SETTING_KEY = "TWILIO_AUTH_TOKEN"
TWILIO_FROM_SETT... | unknown | codeparrot/codeparrot-clean | ||
# Simple latent factor model with biais.
import logging
import sys
import numpy
from netflix_utils import NetflixUtils
import netflix_data
import tensorflow as tf
BATCH_SIZE = 512
DEFAULT_N_ITER = int(40 * netflix_data.NUM_RATING / BATCH_SIZE)
REGULARIZATION_FACTOR = 0.01
LEARNING_SPEED = 0.5
MODEL_NAME = "netflix_... | unknown | codeparrot/codeparrot-clean | ||
# d3-hierarchy
Many datasets are intrinsically hierarchical: [geographic entities](https://www.census.gov/programs-surveys/geography/guidance/hierarchy.html), such as census blocks, census tracts, counties and states; the command structure of businesses and governments; file systems; software packages. And even non-hi... | unknown | github | https://github.com/d3/d3 | docs/d3-hierarchy.md |
#!/usr/bin/env python
# encoding: utf-8
import json
import requests
import urllib
import hashlib
import io
from cortexutils.analyzer import Analyzer
class OTXQueryAnalyzer(Analyzer):
def __init__(self):
Analyzer.__init__(self)
self.otx_key = self.get_param('config.key', None, 'Missing OTX API key')... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql
import (
"context"
"strings"
"github.com/cockroachdb/cockroach/pkg/security/username"
"github.com/cockroachdb/cockroach/pkg/sql/decodeusername"
"githu... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/grant_role.go |
/*!
* Bootstrap Reboot v5.3.8 (https://getbootstrap.com/)
* Copyright 2011-2025 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/:root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7... | css | github | https://github.com/twbs/bootstrap | dist/css/bootstrap-reboot.min.css |
import bpy
from bpy.props import BoolProperty, StringProperty, PointerProperty, FloatProperty, EnumProperty
import os, sys, subprocess
from . common import *
from . light_data import *
from itertools import chain
from . operators.modal import close_control_panel
from . import light_list
_ = os.sep
class ListItem(bpy.... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
import csv
import os
import sys
from collections import defaultdict
APP_HOME = os.environ['APP_HOME']
# Load the spouse dictionary for distant supervision
spouses = defaultdict(lambda: None)
with open (APP_HOME + "/../../data/spouses.csv") as csvfile:
reader = csv.reader(csvfile)
for line ... | unknown | codeparrot/codeparrot-clean | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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
#
... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from typing_extensions import Literal
from ...._models import BaseModel
__all__ = ["TranscriptionSession", "ClientSecret", "InputAudioTranscription", "TurnDetection"]
class ClientSecret(BaseModel)... | python | github | https://github.com/openai/openai-python | src/openai/types/beta/realtime/transcription_session.py |
// Copyright 2010 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/dec.c |
from __future__ import annotations
import warnings
from typing import TYPE_CHECKING, Any, cast
from urllib.parse import urlparse
import pytest
from scrapy.downloadermiddlewares.redirect import RedirectMiddleware
from scrapy.http import Request, Response
from scrapy.settings import Settings
from scrapy.spidermiddlewa... | python | github | https://github.com/scrapy/scrapy | tests/test_spidermiddleware_referer.py |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Execute Patch Files
To run directly
python lib/wnf.py patch patch1, patch2 etc
python lib/wnf.py patch -f patch1, patch2 etc
where patch1, patch2 is module name
"""... | 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/.
'''jarmaker.py provides a python class to package up chrome content by
processing jar.mn files.
See the documentation f... | unknown | codeparrot/codeparrot-clean | ||
"""Suite Text Suite: A set of basic classes for text processing
Level 1, version 1
Generated from /Volumes/Sap/System Folder/Extensions/AppleScript
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'TEXT'
class Text_Suite_Events:
pass
class text_flow(aetools.Componen... | unknown | codeparrot/codeparrot-clean | ||
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | unknown | codeparrot/codeparrot-clean | ||
"""Demonstrates : OptionParser command line parsing, File writes, and string replacement"""
import fileinput
from optparse import OptionParser
__author__ = 'kgraham'
__version__ = 'this is the version'
out_file_name = 'replaced.txt'
tokens = {
'tok1': 'val1',
'tok2': 'val2',
'tok3': 'val3'
}
def parse_c... | unknown | codeparrot/codeparrot-clean | ||
exports.fn = a => a + 1;
exports.value = 41; | javascript | github | https://github.com/webpack/webpack | test/cases/cjs-tree-shaking/parsing/module.js |
---
navigation_title: "Enrich"
mapped_pages:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html
---
# Enrich processor [enrich-processor]
The `enrich` processor can enrich documents with data from another index. See [enrich data](docs-content://manage-data/ingest/transform-enric... | unknown | github | https://github.com/elastic/elasticsearch | docs/reference/enrich-processor/enrich-processor.md |
# Copyright 2022 The OpenBMB Team 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
#
# Un... | python | github | https://github.com/huggingface/transformers | src/transformers/models/cpmant/tokenization_cpmant.py |
from pandac.PandaModules import *
import random
OFF = 0
FLYING = 1
LANDED = 2
states = {OFF: 'off',
FLYING: 'Flying',
LANDED: 'Landed'}
NUM_BUTTERFLIES = (6, 36, 5)
NUM_BUTTERFLY_AREAS = (4, 1, 4)
BUTTERFLY_SPEED = 2.0
BUTTERFLY_HEIGHT = (2.2, 3.2, 2.2)
BUTTERFLY_TAKEOFF = (1.4, 1.8, 1.4)
BUTTERFLY_LANDING = (1.4, 1.... | unknown | codeparrot/codeparrot-clean | ||
base_suite: replica_sets_jscore_passthrough_base
overrides:
- "kill_primary.replica_sets_shell_options"
- "kill_primary.replica_sets_oplog_application_lag_hooks"
- "kill_primary.replica_sets_oplog_application_lag_archive"
- "kill_primary.replica_sets_fixture"
- "replica_sets_stepdown_selector.kill_primary_jsc... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/replica_sets_kill_primary_jscore_passthrough.yml |
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from os.path import join, isfile
import six
from asv import config
from asv.commands.publish import Publish
... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.