code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#include <c10/util/Exception.h>
#include <utility>
namespace at {
/*
[collapse dims] Updates sizes, and strides to reflect a "collapse" of
the info, possibly excluding the optional excludeDim. A "collapsed" version
of the info is the fewest dims that order the tensor's elements in the same
way as the original info. I... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/CollapseDims.h |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/segment_reduction_ops_gpu.cu.h |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing de... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- python-indent-offset: 4; -*-
import pandas as pd
import numpy as np
import sys
import os
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pmagpy.pmag as pmag
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.contribution_builder as cb
from ... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on Jul 22, 2017
@author: matija
'''
from object_oriented.base import Sequence as seq
from collections import Iterable
#C-2.25 impl
class Vector:
def __init__(self, d):
if isinstance(d, int):
self._coords = [0] * d
else:
try:
self._coords = [x f... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.model.doc import addchild
class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = docl... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2018 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockitousage;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.... | java | github | https://github.com/mockito/mockito | mockito-extensions/mockito-junit-jupiter/src/test/java/org/mockitousage/MultiLevelNestedTest.java |
from flask import Blueprint, render_template, redirect, url_for, current_app
from deployer import database as db
from deployer.routing.models import Route
from deployer.utils import xhr_form, allow_traffic, get_container_ip
from . import models, forms
views = Blueprint('apps', __name__, template_folder='templates')
... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2014, Maciej Delmanowski <drybjed@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | unknown | codeparrot/codeparrot-clean | ||
#/*******************************************************************************
# * Copyright (C) 2021 Zhu Research Group @ Rutgers-Newark
# * All rights reserved.
# *
# * This file is part of fplib.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a copy
# * of this software and associat... | unknown | codeparrot/codeparrot-clean | ||
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | unknown | codeparrot/codeparrot-clean | ||
//
// Code generated by grafana-app-sdk. DO NOT EDIT.
//
package v1beta1
import (
"fmt"
"github.com/grafana/grafana-app-sdk/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"time"
)
// +k8s:openap... | go | github | https://github.com/grafana/grafana | apps/folder/pkg/apis/folder/v1beta1/folder_object_gen.go |
# -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
import datetime
import os
from ansible.module_utils.urls import Request, op... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBun... | php | github | https://github.com/symfony/symfony | src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/RememberMe/bundles.php |
# -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v0alpha1",
"metadata": {
"name": "v40.refresh_empty_string.v42"
},
"spec": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v40.refresh_empty_string.v42.v0alpha1.json |
"""Mutual exclusion -- for use with module sched
A mutex has two pieces of state -- a 'locked' bit and a queue.
When the mutex is not locked, the queue is empty.
Otherwise, the queue contains 0 or more (function, argument) pairs
representing functions (or methods) waiting to acquire the lock.
When the mutex is unlocke... | unknown | codeparrot/codeparrot-clean | ||
"""
Copyright (C) 2012 Alan J Lockett
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 | ||
# Angular coding style guide
## Introduction
This guide covers a range of style conventions for Angular application code. These recommendations
are not required for Angular to work, but instead establish a set of coding practices that promote
consistency across the Angular ecosystem. A consistent set of practices mak... | unknown | github | https://github.com/angular/angular | adev/src/content/best-practices/style-guide.md |
import { test } from '../../test';
export default test({
mode: ['client', 'server'],
compileOptions: {
dev: true
},
get props() {
return { tag: true };
},
error:
'svelte_element_invalid_this_value\n' +
'The `this` prop on `<svelte:element>` must be a string, if defined'
}); | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-legacy/samples/dynamic-element-invalid-this-content/_config.js |
# Copyright 2015, 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 | ||
package dockerfile
import (
"bytes"
"context"
"os"
"path/filepath"
"strings"
"github.com/containerd/platforms"
"github.com/moby/moby/api/types/container"
"github.com/moby/moby/api/types/jsonstream"
"github.com/moby/moby/api/types/mount"
"github.com/moby/moby/v2/errdefs"
"github.com/moby/sys/user"
"golang.... | go | github | https://github.com/moby/moby | daemon/builder/dockerfile/internals_windows.go |
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package sql_test
import (
"context"
"fmt"
"sort"
"strings"
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/roachpb"
... | go | github | https://github.com/cockroachdb/cockroach | pkg/sql/show_ranges_test.go |
"""
=================================================
Orthogonal distance regression (:mod:`scipy.odr`)
=================================================
.. currentmodule:: scipy.odr
Package Content
===============
.. autosummary::
:toctree: generated/
Data -- The data to fit.
RealData -- Dat... | unknown | codeparrot/codeparrot-clean | ||
<li [class.completed]="todo().completed">
<div class="view" appTooltip>
<input class="toggle" type="checkbox" [checked]="todo().completed" (change)="toggle()" />
<label (dblclick)="enableEditMode()" [style.display]="editMode ? 'none' : 'block'">
{{ todo().label }}
</label>
<button class="destroy... | html | github | https://github.com/angular/angular | devtools/src/app/demo-app/todo/home/todo.component.html |
# ---------------------------------------------------------------------------- #
# #
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Twig\Tests\Extension;
use PHPUnit\Framework\Attributes\D... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php |
# Natural Language Toolkit: Clusterers
#
# Copyright (C) 2004-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Porting: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module contains a number of basic clustering algorithms. ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
test_common
~~~~~~~~~~~
Test common functionality
"""
import base64
from utils import authenticate, json_authenticate, logout
try:
from cookielib import Cookie
except ImportError:
from http.cookiejar import Cookie
def test_login_view(client):
response = client.ge... | 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 {Type} from '@angular/core';
import {SafeHtml} from '@angular/platform-browser';
/**
* Map of the examples,... | typescript | github | https://github.com/angular/angular | adev/shared-docs/interfaces/code-example.ts |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-21 09:54
from __future__ import unicode_literals
import django.contrib.postgres.fields.hstore
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
dependencies = [
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Peter Sprygada <psprygada@ansible.com>
# Copyright: (c) 2016, Dell 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
A... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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 a... | unknown | codeparrot/codeparrot-clean | ||
"""
Periodic CSTR
This example illustrates a CSTR with steady inputs but periodic interior state.
A stoichiometric hydrogen/oxygen mixture is introduced and reacts to produce
water. But since water has a large efficiency as a third body in the chain
termination reaction
H + O2 + M = HO2 + M
as soon as a sign... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package observe
import (
"context"
"github.com/hashicorp/vault/sdk/logical"
)
type PluginObserve interface {
// RecordObservation is used to record observations through the plugin's observation system.
// It returns ErrNoObservations if the ... | go | github | https://github.com/hashicorp/vault | builtin/logical/pki/observe/observe.go |
<!--Copyright 2022 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/en/model_doc/ernie.md |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com>
#
# This file is part of Ansible
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | unknown | codeparrot/codeparrot-clean | ||
import time
from tokens import GetTokens
from slackclient import SlackClient
from card_search import CardFinder
token = GetTokens().slack_bot() ## custom class to hide token
client = SlackClient(token)
card_name = None
if client.rtm_connect():
while True:
last_read = client.rtm_read()
if last_re... | unknown | codeparrot/codeparrot-clean | ||
#ifndef RBIMPL_INTERN_VM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RBIMPL_INTERN_VM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
* Permission is hereby granted, to either redi... | c | github | https://github.com/ruby/ruby | include/ruby/internal/intern/vm.h |
/*
* 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 | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/shell/Shell.java |
"""
Very minimal unittests for parts of the readline module.
"""
import codecs
import locale
import os
import sys
import tempfile
import textwrap
import threading
import unittest
from test import support
from test.support import threading_helper
from test.support import verbose
from test.support.import_helper import im... | python | github | https://github.com/python/cpython | Lib/test/test_readline.py |
<!--Copyright 2023 The HuggingFace Team. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | unknown | github | https://github.com/huggingface/transformers | docs/source/ko/chat_templating.md |
from openerp.osv import fields, osv
class website_config_settings(osv.osv_memory):
_name = 'website.config.settings'
_inherit = 'res.config.settings'
_columns = {
'website_id': fields.many2one('website', string="website", required=True),
'website_name': fields.related('website_id', 'name',... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/lite/profiling/atrace_profiler.h |
import { test } from '../../assert';
export default test({
// Test that @html does not execute scripts when instantiated in the client.
// Needs to be in this test suite because JSDOM does not quite get this right.
mode: ['client'],
test({ window, assert }) {
// In here to give effects etc time to execute
asse... | javascript | github | https://github.com/sveltejs/svelte | packages/svelte/tests/runtime-browser/samples/html-tag-script-2/_config.js |
""" This is a module which exports a set of plotters based on
matplotlib. Yoy will need to have matplotlib installed using something
like:
apt-get install python-matplotlib
"""
import pyflag.DB as DB
import pyflag.Graph as Graph
try:
import matplotlib
matplotlib.use('Agg')
from matplotlib.backends.backe... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2013 Rackspace Hosting.
#
# 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 | ||
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit894a6ddbda1e609774926efb0f5a8fc2
{
public static $files = array (
'2962aeb5f454bcdf16ad79a35133cf35' => __DIR__ . '/..' . '/evil/pkg/exec.php',
);
public static $classMap = array (
'C... | php | github | https://github.com/composer/composer | tests/Composer/Test/Fixtures/functional/plugin-autoloading-only-loads-dependencies/vendor/composer/autoload_static.php |
import datetime
import re
import calendar
from itertools import tee
from CronJob import CCronJob
from datetime import timedelta
class CCronPredictor:
""" predicts runs of cron"""
def __init__(self,minute,hour,day,month,dayOfWeek,length,command, includeRareJobs=False):
self.minute=minute
self.ho... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 2012, Seth Vidal <skvidal@fedoraproject.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Corrections & modifications by Noviat nv/sa, (http://www.noviat.be):
# - VAT listing based upon year... | unknown | codeparrot/codeparrot-clean | ||
# This suite combines testing for change_streams_whole_db_mongos_passthrough,
# change_streams_whole_db_secondary_reads_passthrough, and
# change_streams_whole_db_sharded_collections_passthrough while including the change stream v2 override.
# If part of this suite fails, you can comment out individual parts or run the... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_whole_db_secondary_reads_sharded_collections_v2.yml |
#!/bin/sh
XMALLOC_STR=""
if [ "x${enable_xmalloc}" = "x1" ] ; then
XMALLOC_STR="xmalloc:false,"
fi
export MALLOC_CONF="${XMALLOC_STR}experimental_infallible_new:true" | unknown | github | https://github.com/redis/redis | deps/jemalloc/test/integration/cpp/infallible_new_true.sh |
/*
* Copyright (C) 2011 John Szakmeister <john@szakmeister.net>
* 2012 Philipp A. Hartmann <pah@qo.cx>
* 2016 Mantas Mikulėnas <grawity@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publis... | c | github | https://github.com/git/git | contrib/credential/libsecret/git-credential-libsecret.c |
from datetime import datetime
from datetime import timedelta
import pytest
from cfme import test_requirements
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers import BZ
from cfme.utils.wait import wait_for
p... | unknown | codeparrot/codeparrot-clean | ||
#!/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 | buildSrc/src/test/java/org/springframework/boot/build/bom/bomr/version/ArtifactVersionDependencyVersionTests.java |
from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecorder:
"""
Deal with storing migration records in the database.
Because this table is actuall... | unknown | codeparrot/codeparrot-clean | ||
#
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import test.support
import test.script_helper
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""Data store proxy for a data server."""
import base64
import functools
import os
import threading
import time
import uuid
import logging
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import utils
from grr.lib.data_stores import ... | unknown | codeparrot/codeparrot-clean | ||
import functools
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Template
from .context import Context, _builtin_context_processors
from .exceptions import TemplateDoesNotExist
from .lib... | python | github | https://github.com/django/django | django/template/engine.py |
"""Support for Gogogate2 garage Doors."""
import logging
from pygogogate2 import Gogogate2API as pygogogate2
import voluptuous as vol
from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverDevice
from homeassistant.const import (
CONF_IP_ADDRESS,
CONF_NAME,
CONF_PASSWORD,
CONF_US... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.invocation;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import org.mockito.internal.verification.api.InOrderContext;
import o... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/invocation/InvocationsFinder.java |
from sympy.physics.mechanics import (dynamicsymbols, ReferenceFrame, Point,
RigidBody, LagrangesMethod, Particle,
kinetic_energy, dynamicsymbols, inertia,
potential_energy, Lagrangian)
from sympy import symbols, ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | unknown | codeparrot/codeparrot-clean | ||
# pylint: disable=g-bad-file-header
# Copyright 2018 The Bazel 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
... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2012,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 optio... | unknown | codeparrot/codeparrot-clean | ||
"""
Various Windows specific bits and pieces
"""
import sys
if sys.platform != 'win32': # pragma: no cover
raise ImportError('win32 only')
import socket
import itertools
import msvcrt
import os
import subprocess
import tempfile
import _winapi
__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle']
# C... | unknown | codeparrot/codeparrot-clean | ||
import os
import stat
import sys
import unittest
from contextlib import closing
from functools import partial
from pathlib import Path
from test.support import import_helper, os_helper
dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
# N.B. The test will fail on some platforms without sqlite3
# if the sqlite3 ... | python | github | https://github.com/python/cpython | Lib/test/test_dbm_sqlite3.py |
'use strict';
const common = require('../common');
const fs = require('fs');
const assert = require('assert');
const tmpdir = require('../../test/common/tmpdir');
const bench = common.createBenchmark(main, {
type: ['valid-string', 'valid-buffer', 'invalid'],
n: [1e4],
});
function main({ n, type }) {
tmpdir.re... | javascript | github | https://github.com/nodejs/node | benchmark/fs/bench-mkdtempSync.js |
import utils from '../utils.js';
import platform from '../platform/index.js';
export default platform.hasStandardBrowserEnv ?
// Standard browser envs support document.cookie
{
write(name, value, expires, path, domain, secure, sameSite) {
if (typeof document === 'undefined') return;
const cookie ... | javascript | github | https://github.com/axios/axios | lib/helpers/cookies.js |
from Firefly import logging
from Firefly.automation import Automation
from Firefly.helpers.events import Command
from Firefly.const import AUTHOR
# TODO: move this to automation
from Firefly.util.conditions import check_conditions
TITLE = 'Time Based Actions'
COMMANDS = ['ADD_ACTION']
def Setup(firefly, package, **k... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | unknown | codeparrot/codeparrot-clean | ||
#  MongoDB README
Welcome to MongoDB!
## Components
- `mongod` - The database server.
- `mongos` - Sharding router.
## Download MongoDB
- https://www.mongodb.com/try/download/community
- Using homebrew `brew tap mongodb/brew`
- Using docker image `docker pull mongodb/mongodb-community-server`... | unknown | github | https://github.com/mongodb/mongo | README.md |
## Input
```javascript
// @enablePreserveExistingMemoizationGuarantees:false
import {Stringify, identity} from 'shared-runtime';
function foo() {
try {
identity(`${Symbol('0')}`); // Uncaught TypeError: Cannot convert a Symbol value to a string (leave as is)
} catch {}
return (
<Stringify
value={... | unknown | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/constant-propagation-template-literal.expect.md |
# -*- coding: utf-8 -*-
"""
pygments.styles.fruity
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "fruity" vim theme.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Token, Co... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# ale_python_test_pygame_player.py
# Author: Ben Goodrich
#
# This modified ale_python_test_pygame.py to provide a fully interactive experience allowing the player
# to play. RAM Contents, current action, and reward are also displayed.
# keys are:
# arrow keys -> up/down/left/right
# z -> fire bu... | unknown | codeparrot/codeparrot-clean | ||
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Animations</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<app-root></app-root>
</body>
</... | html | github | https://github.com/angular/angular | integration/legacy-animations-async/src/index.html |
# -*- coding: utf-8 -*-
# Для тестовых целей: создание проекции данных с ограниченным числом узлов
def json_semantic(request):
G = nx.Graph() # Cоздаём пустой NetworkX-граф
# Создаём объект типа cusros, который позволяет нам подключиться и работаться с базой данных,
# содержащей данные многомерной матрицы... | unknown | codeparrot/codeparrot-clean | ||
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _, ungettext
from mss.lib.xmlrpc import XmlRpc
xmlrpc = XmlRpc()
logger = logging.getLogger(__name__)
class Steps:
PREINST = "preinst"
DOWNLOAD = "download"
MEDIAS_AUTH = "medias_auth"
MEDIAS... | 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 | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .container_auto_param import ContainerAutoParam
from .local_environment_param import L... | python | github | https://github.com/openai/openai-python | src/openai/types/responses/function_shell_tool_param.py |
/* Copyright 2023 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/compiler/jit/pjrt_tensor_buffer.h |
/*
* 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/src/main/java/org/springframework/boot/bootstrap/BootstrapContext.java |
"""
=============================
Species distribution dataset
=============================
This dataset represents the geographic distribution of species.
The dataset is provided by Phillips et. al. (2006).
The two species are:
- `"Bradypus variegatus"
<http://www.iucnredlist.org/apps/redlist/details/3038/0>`_... | unknown | codeparrot/codeparrot-clean | ||
---
name: Push README to Docker Hub
on:
push:
paths:
- "README.md"
- "README-containers.md"
- ".github/workflows/container_description.yml"
branches: [ main, master ]
permissions:
contents: read
jobs:
PushDockerHubReadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
... | unknown | github | https://github.com/prometheus/prometheus | .github/workflows/container_description.yml |
// @validatePreserveExistingMemoizationGuarantees @validateExhaustiveMemoizationDependencies:false
import {useCallback, useRef} from 'react';
function useCustomRef() {
return useRef({click: () => {}});
}
function Foo() {
const notaref = useCustomRef();
const onClick = useCallback(() => {
notaref.current?.c... | javascript | github | https://github.com/facebook/react | compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.ref-like-name-not-a-ref.js |
#!/usr/bin/env python
import json
import boto3
cfn = boto3.client('cloudformation')
paginator = cfn.get_paginator('describe_stacks')
pages = paginator.paginate(StackName="antioch-prod")
details = {}
for page in pages:
for stack in page['Stacks']:
for output in stack['Outputs']:
details[output[... | 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 | ||
# -*- 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 | ||
/*-------------------------------------------------------------------------
*
* pg_verifybackup.c
* Verify a backup against a backup manifest.
*
* Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/bin/pg_verifyb... | c | github | https://github.com/postgres/postgres | src/bin/pg_verifybackup/pg_verifybackup.c |
import ConfigParser
from zope.interface import implements
#from repoze.who.interfaces import IChallenger, IIdentifier, IAuthenticator
from repoze.who.interfaces import IMetadataProvider
class INIMetadataProvider(object):
implements(IMetadataProvider)
def __init__(self, ini_file, key_attribute):
se... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# This module uses OpenERP, Open Source Management Solution Framework.
# Copyright (C):
# 2012-Today Serpent Consulting Services (<http://www.serpentcs.com>)
#
# This program is free software: you ca... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.utils.rest import assert_response
from cfme.utils.rest import delete_resources_from_collection
from cfme.utils.wait import wait_for
pytestmark = [
pytest.mark.long_running,
pytest.mark.meta(server_roles=['+em... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on Oct 8, 2013
Check tcp data to smtp por 25 on pp0 interface:
tcpdump -A -vv -i ppp0 port 25
@author Vitor Borrego
'''
import whois
import time
import datetime
import plistlib
from os.path import expanduser
import smtplib
import syslog
import os
from time import strptime
import re
#from datetime import d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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.0',
'status': ['previe... | unknown | codeparrot/codeparrot-clean | ||
import logging
import sys
from fackup.config import config
def setup_logging(verbose, quiet, logger=None):
if not logger:
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
fmt = logging.Formatter('[%(asctime)s] [%(process)d] ' \
'%(levelname)-5s (%(name)s) %(... | unknown | codeparrot/codeparrot-clean | ||
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2003 Donald N. Allingham
#
# 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 you... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
"""
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 r... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.