code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
#-------------------------------------------------------------------------------
# Name: Preprocessing for the EVI reference
# Inputs: EVI for each 8-day from all tiles and quality layers
#
# Author: Yao Zhang
#
# Created: 3/29/2017
# Modified:
# Copyright: (c) eomf 2015
# Licence: <your lice... | unknown | codeparrot/codeparrot-clean | ||
<?php
namespace Illuminate\Contracts\Support;
use ArrayAccess;
use IteratorAggregate;
interface ValidatedData extends Arrayable, ArrayAccess, IteratorAggregate
{
//
} | php | github | https://github.com/laravel/framework | src/Illuminate/Contracts/Support/ValidatedData.php |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | lib/llist.c |
"""
Author: Jyler Menard
USES DOUBLE Q-LEARNING which is NOT the same as a double DQN.
Purpose implement a Deep Q Network that uses double Q-learning rather than Q-learning.
Q-learning can easily overestimate the value of an action from a state, resulting in overoptimistic value estimates.
Double Q-learning decouples t... | unknown | codeparrot/codeparrot-clean | ||
basic = __lazy_import__('test.test_import.data.lazy_imports',
fromlist=("basic2", ))
basic | python | github | https://github.com/python/cpython | Lib/test/test_import/data/lazy_imports/dunder_lazy_import_used.py |
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2beta1",
"metadata": {
"name": "v40.refresh_numeric.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "grafana",
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/migrated_dashboards_output/v1beta1-mig-v40.refresh_numeric.v42.v2beta1.json |
from django import forms
from . import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class SearchJourney(forms.Form):
city_from = forms.CharField()
city_to = forms.CharField()
class Journey(forms.ModelForm):
#def __init__(self, user, *args, **kw... | unknown | codeparrot/codeparrot-clean | ||
# `actix-web-actors`
> Actix actors support for Actix Web.
>
> This crate is deprecated. Migrate to [`actix-ws`](https://crates.io/crates/actix-ws).
<!-- prettier-ignore-start -->
[](https://crates.io/crates/actix-web-actors)
[![Documentation... | unknown | github | https://github.com/actix/actix-web | actix-web-actors/README.md |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding:utf-8 -*-
"""
/***************************************************************************
qgsplugininstallerinstallingdialog.py
Plugin Installer module
-------------------
Date : June 2013
Copyright ... | unknown | codeparrot/codeparrot-clean | ||
name: autoclose comment
# Post comment on PRs when labeled with "autoclose".
permissions:
contents: read
pull-requests: write
on:
pull_request_target:
types:
- labeled
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_req... | unknown | github | https://github.com/scikit-learn/scikit-learn | .github/workflows/autoclose-comment.yml |
#!/usr/bin/python
# (c) 2018, 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 | ||
import array
import unittest
from test.test_support import run_unittest, import_module, get_attribute
import os, struct
fcntl = import_module('fcntl')
termios = import_module('termios')
get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature
try:
tty = open("/dev/tty", "r")
except IOError:
ra... | unknown | codeparrot/codeparrot-clean | ||
#// screen manager imported from http://kivy.org/docs/api-kivy.uix.screenmanager.html
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from random import random
from kivy.uix.widget import Widget
from kivy.graphics import Color... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import argparse
import json
from collections import defaultdict
from luigi import six
from luigi.six.moves.urllib.request import urlopen
class LuigiGrep(object):
def __init__(self, host, port):
self._host = host
self._port = port
@property
def graph_url(self):
... | unknown | codeparrot/codeparrot-clean | ||
parameters:
kind: nuget
extraOpts: --precompile
fulltest: false
steps:
- script: .\python.bat PC\layout -vv -s "$(Build.SourcesDirectory)" -b "$(Py_OutDir)\$(arch)" -t "$(Build.BinariesDirectory)\layout-tmp-${{ parameters.kind }}-$(arch)" --copy "$(Build.BinariesDirectory)\layout-${{ parameters.kind }}-$(arch)" ... | unknown | github | https://github.com/python/cpython | .azure-pipelines/windows-layout-steps.yml |
#
# 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 | ||
# encoding:utf-8
"""
All constants could be used in other modules
For reasons that models, views can't have unicode
text in this project, all unicode text go here.
"""
from django.utils.translation import ugettext_lazy as _
import re
CLOSE_REASONS = (
(1, _('duplicate question')),
(2, _('question is off-topic ... | unknown | codeparrot/codeparrot-clean | ||
"""
MPEG-2 Transport Stream parser.
Documentation:
- MPEG-2 Transmission
http://erg.abdn.ac.uk/research/future-net/digital-video/mpeg2-trans.html
Author: Victor Stinner
Creation date: 13 january 2007
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError, MissingField,
UInt... | unknown | codeparrot/codeparrot-clean | ||
[
{
"pk": 1,
"model": "composite_pk.tenant",
"fields": {
"id": 1,
"name": "Tenant 1"
}
},
{
"pk": 2,
"model": "composite_pk.tenant",
"fields": {
"id": 2,
"name": "Tenant 2"
}
},
{
... | json | github | https://github.com/django/django | tests/composite_pk/fixtures/tenant.json |
# MongoDB Development with Dev Containers
**⚠️ IMPORTANT:** This guide has been replaced with comprehensive documentation.
**👉 Please visit the new [Dev Container Documentation](./devcontainer/README.md) for:**
- 📖 [**Getting Started Guide**](./devcontainer/getting-started.md) - Step-by-step setup instructions
- �... | unknown | github | https://github.com/mongodb/mongo | docs/devcontainer-setup.md |
"""
==========================================
IsolationForest benchmark
==========================================
A test of IsolationForest on classical anomaly detection datasets.
"""
print(__doc__)
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import IsolationFore... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
class Hardback < ActiveRecord::Base
end
class BestHardback < Hardback
end | ruby | github | https://github.com/rails/rails | activerecord/test/models/hardback.rb |
from datetime import datetime
from django.core.exceptions import FieldError
from django.db import DEFAULT_DB_ALIAS, connection
from django.db.models import BooleanField, CharField, F, Q
from django.db.models.expressions import (
Col,
Exists,
ExpressionWrapper,
Func,
RawSQL,
Value,
)
from django... | python | github | https://github.com/django/django | tests/queries/test_query.py |
import unittest
try:
from unittest.mock import *
except ImportError:
from mock import *
from msgpack import *
from cvra_bootloader.read_config import main
from cvra_bootloader.commands import *
import sys
import json
class ReadConfigToolTestCase(unittest.TestCase):
@patch('cvra_bootloader.utils.write_co... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import json
from ..base.decrypter import BaseDecrypter
class MediafireComFolder(BaseDecrypter):
__name__ = "MediafireComFolder"
__type__ = "decrypter"
__version__ = "0.25"
__status__ = "testing"
__pattern__ = (
r"https?://(?:www\.)?mediafire\.com/(?:folder/|\?shar... | 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 | cmd/kubeadm/app/util/dryrun/dryrun.go |
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from pylearn2.testing.skip import skip_if_no_gpu
skip_if_no_gpu()
import numpy as np
from theano ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# (c) 2016, NetApp, 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.... | unknown | codeparrot/codeparrot-clean | ||
# orm/collections.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for collections of mapped entities.
The collections package supplies ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import os
import re
import cgi
import dateutil
import time
import socket
import subprocess
import sys
import logging
import requests
from base64 import b64encode
from collections import OrderedDict
# Django
from django.conf import settings
from django... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on 22 Apr 2013
@author: maxz
'''
import unittest
import numpy
import GPy
import itertools
from GPy.core import Model
from GPy.core.parameterization.param import Param
from GPy.core.parameterization.transformations import Logexp
from GPy.core.parameterization.variational import NormalPosterior
class PsiSt... | unknown | codeparrot/codeparrot-clean | ||
import binascii
import math
import struct
import sys
import unittest
from ctypes import (Structure, Union, LittleEndianUnion, BigEndianUnion,
BigEndianStructure, LittleEndianStructure,
POINTER, sizeof, cast,
c_byte, c_ubyte, c_char, c_wchar, c_void_p,
... | python | github | https://github.com/python/cpython | Lib/test/test_ctypes/test_byteswap.py |
# Copyright 2017 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 | ||
import postcss, { type ChildNode, type Plugin, type Root } from 'postcss'
import { format, type Options } from 'prettier'
import { walk } from '../../utils/walk'
const FORMAT_OPTIONS: Options = {
parser: 'css',
semi: true,
singleQuote: true,
}
// Prettier is used to generate cleaner output, but it's only used o... | typescript | github | https://github.com/tailwindlabs/tailwindcss | packages/@tailwindcss-upgrade/src/codemods/css/format-nodes.ts |
from django import template
from django.template import Node, Token, TemplateSyntaxError
from django.template import resolve_variable
from django.template.defaultfilters import stringfilter
from django.templatetags import future
from localeurlcustom import utils
register = template.Library()
def chlocale(url, locale... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team
connection: delegation_connection
short_description: Test connection for delegated host check
description:
- Some further description that you don't care about.
options:
remote_passwo... | unknown | codeparrot/codeparrot-clean | ||
# datatasks\destinations\DatabaseDestination.py
import os
from datatasks.db.SQLBuilderMixin import SQLBuilderMixin
from datatasks.db.DatabaseFactory import DatabaseFactory
from datatasks import settings
from .FileDestination import FileDestination
class DatabaseDestination(FileDestination, SQLBuilderMixin):
"""Ca... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v0alpha1.xychart-migrations.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"datasource": {
"type": "grafana",
"uid": "-- Graf... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-xychart/v0alpha1.xychart-migrations.v42.v2alpha1.json |
# Generated by Django 2.0.7 on 2018-07-12 17:10
import django.contrib.auth.validators
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('ui', '0020_auto_20180608_1144'),
]
operations = [
migrations.AddField(
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Hackerland is a one-dimensional city with n houses, where each house i is
# located at some xi on the x-axis. The Mayor wants to install radio
# transmitters on the roofs of the city's houses. Each transmitter has a range,
# k, meaning it can transmit a signal to all houses <=k units of distance away.
#
# Given a map... | unknown | codeparrot/codeparrot-clean | ||
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Targeting'
db.create_table('facebook_ads_targeting', (
('id', self.gf('django.db.model... | unknown | codeparrot/codeparrot-clean | ||
#!/bin/bash
# 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 ... | unknown | github | https://github.com/apache/kafka | bin/kafka-groups.sh |
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import datetime as dt
import mock
import httplib as http
from dateutil.parser import parse as parse_date
from nose.tools import * # noqa PEP8 asserts
from modularodm import Q
from framework.exceptions import HTTPError
from framewo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# This is free and unencumbered software released into the public domain.
import erlang, os, struct
def send(term, stream):
"""Write an Erlang term to an output stream."""
payload = erlang.term_to_binary(term)
header = struct.pack('!I', len(payload))
stream.write(header)
stre... | unknown | codeparrot/codeparrot-clean | ||
from calyptos.plugins.validator.validatorplugin import ValidatorPlugin
class Storage(ValidatorPlugin):
def validate(self):
self.topology = self.environment['default_attributes']['eucalyptus']['topology']
if 'system-properties' in self.environment['default_attributes']['eucalyptus']:
sel... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# Copyright (c) 2010 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | unknown | codeparrot/codeparrot-clean | ||
(function(QUnit) {
var sync = Backbone.sync;
var ajax = Backbone.ajax;
var emulateHTTP = Backbone.emulateHTTP;
var emulateJSON = Backbone.emulateJSON;
var history = window.history;
var pushState = history.pushState;
var replaceState = history.replaceState;
QUnit.config.noglobals = true;
QUnit.testS... | javascript | github | https://github.com/lodash/lodash | vendor/backbone/test/setup/environment.js |
# Base classes for ASN.1 types
import sys
from pyasn1.type import constraint, tagmap
from pyasn1 import error
class Asn1Item: pass
class Asn1ItemBase(Asn1Item):
# Set of tags for this ASN.1 type
tagSet = ()
# A list of constraint.Constraint instances for checking values
subtypeSpec = constraint.Const... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2014, HashFast Technologies 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... | unknown | codeparrot/codeparrot-clean | ||
<!--Copyright 2020 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/internal/tokenization_utils.md |
# Copyright 2025 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/core_model_loading.py |
#!/usr/bin/python
#
# 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 distribut... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright (C) 2015, Cumulus Networks www.cumulusnetworks.com
#
#
DOCUMENTATION = '''
---
module: cl_ports
author: Cumulus Networks
short_description: Configure Cumulus Switch port attributes (ports.conf)
description:
- Set the initial port attribute defined in the Cumulus Linux ports.conf,... | unknown | codeparrot/codeparrot-clean | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: BUSL-1.1
package vault
import (
"context"
"crypto/ecdsa"
"crypto/elliptic"
"encoding/json"
"errors"
"fmt"
"time"
"github.com/armon/go-metrics"
"github.com/go-jose/go-jose/v3"
"github.com/go-jose/go-jose/v3/jwt"
"github.com/hashicorp/vault/api"
... | go | github | https://github.com/hashicorp/vault | vault/wrapping.go |
'''
This module defines :class:`Block`, the main container gathering all the data,
whether discrete or continous, for a given recording session. base class
used by all :module:`neo.core` classes.
:class:`Block` derives from :class:`Container`,
from :module:`neo.core.container`.
'''
from datetime import datetime
from... | unknown | codeparrot/codeparrot-clean | ||
""" CS4HS Website Generator
AUTHOR: Jack Morgan
REQUIRES: Python >= 3.4.1
"""
CURRENT_DIRECTORY = '.'
OUTPUT_DIRECTORY = './output/'
TEXT_FOLDER = './text/'
FOLDERS_TO_COPY = ['css', 'files', 'img', 'js']
"""Check and install dependencies"""
import pip
# Update pip if needed and install dependencies
pip.main(['instal... | unknown | codeparrot/codeparrot-clean | ||
"""
Iterators providing indices for different kinds of iteration over
datasets.
Presets:
- sequential: iterates through fixed slices of the dataset in sequence
- shuffled_sequential: iterates through a shuffled version of the dataset
in sequence
- random_slice: on each call to next, returns a slice of the dataset,
... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/data/map_defun_op.h |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Mate Soos
#
# 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; version 2
# of the License.
#
# This program is distributed in th... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2014-2019 The PySCF Developers. 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... | unknown | codeparrot/codeparrot-clean | ||
# (c) 2020 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
import os
import pkgutil
import sys
import warnings
# This package exists to host vendored top-level Python packages for downstream packaging. Any Python packages... | python | github | https://github.com/ansible/ansible | lib/ansible/_vendor/__init__.py |
"""
=========================================
Adapting gray-scale filters to RGB images
=========================================
There are many filters that are designed to work with gray-scale images but not
with color images. To simplify the process of creating functions that can adapt
to RGB images, scikit-image p... | 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/c/experimental/filesystem/plugins/gcs/cleanup.h |
// Code generated by "stringer -type Quality"; DO NOT EDIT.
package plans
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Errored-0]
_ = x[NoChanges-1]
}
const ... | go | github | https://github.com/hashicorp/terraform | internal/plans/quality_string.go |
use rustc_data_structures::fx::FxIndexMap;
use rustc_hir::def_id::DefId;
use rustc_middle::ty::{self, OutlivesPredicate, TyCtxt};
use super::utils::*;
#[derive(Debug)]
pub(crate) struct ExplicitPredicatesMap<'tcx> {
map: FxIndexMap<DefId, ty::EarlyBinder<'tcx, RequiredPredicates<'tcx>>>,
}
impl<'tcx> ExplicitPre... | rust | github | https://github.com/rust-lang/rust | compiler/rustc_hir_analysis/src/outlives/explicit.rs |
from django.db import models
from django.contrib.auth.models import AbstractUser
class Guild(models.Model):
name = models.CharField(max_length=40, unique=True, db_index=True)
owner = models.ForeignKey('Hero')
def __unicode__(self):
return self.name
class Title(models.Model):
name = models.Cha... | unknown | codeparrot/codeparrot-clean | ||
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import __version__
from ansible.errors import AnsibleError
from distutils.version import LooseVersion
from operator import eq, ge, gt
from sys import version_info
try:
from __main__ ... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2021 - 2025 R. Thomas
* Copyright 2021 - 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... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/PE/signature/RsaInfo.cpp |
from __future__ import annotations
import importlib.util
import os
import sys
import typing as t
from datetime import datetime
from functools import cache
from functools import update_wrapper
import werkzeug.utils
from werkzeug.exceptions import abort as _wz_abort
from werkzeug.utils import redirect as _wz_redirect
f... | python | github | https://github.com/pallets/flask | src/flask/helpers.py |
# Owner(s): ["module: unknown"]
from torch.testing import FileCheck
from torch.testing._internal.common_utils import run_tests, TestCase
class TestFileCheck(TestCase):
def test_not_run(self):
stdout, _ = self.run_process_no_exception(
"""\
from torch.testing import FileCheck
file_check = FileC... | python | github | https://github.com/pytorch/pytorch | test/test_file_check.py |
# frozen_string_literal: true
require "concurrent/map"
require "active_support/core_ext/module/attribute_accessors"
require "action_view/template/resolver"
module ActionView
# = Action View Lookup Context
#
# <tt>LookupContext</tt> is the object responsible for holding all information
# required for looking u... | ruby | github | https://github.com/rails/rails | actionview/lib/action_view/lookup_context.rb |
# coding: utf8
from __future__ import unicode_literals
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
from .stop_words import STOP_WORDS
from .lex_attrs import LEX_ATTRS
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ..norm_exceptions import BASE_NORMS
from ...util import update_exc, add_lookups
from... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import division, print_function, absolute_import
#from pnet.vzlog import default as vz
import numpy as np
import amitgroup as ag
import itertools as itr
import sys
import os
import pnet
import time
def test(ims, labels, net):
yhat = net.classify(ims)
return yhat == labels
if pnet.parallel.ma... | unknown | codeparrot/codeparrot-clean | ||
---
title: Webhooks
# can make a quick how-to on creating a webhook, this was copy/pasted from another doc, needs to be reviewed first
hidden: true
---
# Webhooks
Resource routes can be used to handle webhooks. For example, you can create a webhook that receives notifications from GitHub when a new commit is pushed t... | unknown | github | https://github.com/remix-run/react-router | docs/how-to/webhook.md |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | unknown | codeparrot/codeparrot-clean | ||
# Building Swift SDK for Android on Windows
Visual Studio 2019 or newer is needed to build the Swift SDK for Android on
Windows.
## 1. Install Dependencies
- Install the latest version of [Visual Studio](https://www.visualstudio.com/downloads/)
- Make sure to include the android NDK in your installation.
## 1. Clone... | unknown | github | https://github.com/apple/swift | docs/AndroidBuild.md |
import os, re, logging, time, socket
from autotest.client.shared import error, utils
from autotest.client.shared.barrier import listen_server
from autotest.client.shared.syncdata import SyncData
from virttest import utils_test, utils_misc
def run_migration_multi_host_with_speed_measurement(test, params, env):
"""
... | unknown | codeparrot/codeparrot-clean | ||
""" version info, help messages, tracing configuration. """
import py
import pytest
import os, sys
def pytest_addoption(parser):
group = parser.getgroup('debugconfig')
group.addoption('--version', action="store_true",
help="display pytest lib version and import information.")
group._addoption(... | unknown | codeparrot/codeparrot-clean | ||
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Title: CURLOPT_MAIL_RCPT
Section: 3
Source: libcurl
See-also:
- CURLOPT_MAIL_AUTH (3)
- CURLOPT_MAIL_FROM (3)
Protocol:
- SMTP
Added-in: 7.20.0
---
# NAME
CURLOPT_MAIL_RCPT - list of SMTP mail recipients
# SYNOPSIS
~~... | unknown | github | https://github.com/curl/curl | docs/libcurl/opts/CURLOPT_MAIL_RCPT.md |
import datetime
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
import haystack
from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery, log_query
from haystack.constants import ID, DJANGO_CT, DJ... | unknown | codeparrot/codeparrot-clean | ||
{
"openapi": "3.1.0",
"info": {
"title": "WolframAlpha",
"version": "v1.7"
},
"servers": [
{
"url": "https://www.wolframalpha.com",
"description": "The WolframAlpha server"
}
],
"paths": {
"/api/v1/spoken.jsp": {
"get": {
"operationI... | json | github | https://github.com/langchain-ai/langchain | libs/langchain/tests/unit_tests/examples/test_specs/wolframcloud/apispec.json |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 | ||
// Copyright IBM Corp. 2016, 2025
// SPDX-License-Identifier: MPL-2.0
package api
import (
"context"
"fmt"
"net/http"
)
// SSH is used to return a client to invoke operations on SSH backend.
type SSH struct {
c *Client
MountPoint string
}
// SSH returns the client for logical-backend API calls.
func (... | go | github | https://github.com/hashicorp/vault | api/ssh.go |
/*
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 | cmd/kubeadm/app/cmd/phases/init/markcontrolplane.go |
# Tests that require installed backends go into
# sympy/test_external/test_autowrap
import os
import tempfile
import shutil
from sympy.utilities.autowrap import autowrap, binary_function, CythonCodeWrapper, \
ufuncify
from sympy.utilities.codegen import Routine, CCodeGen, CodeGenArgumentListError
from sympy.utili... | unknown | codeparrot/codeparrot-clean | ||
import {Component, model, ChangeDetectionStrategy} from '@angular/core';
import {CustomCheckbox} from './custom-checkbox';
@Component({
selector: 'app-root',
imports: [CustomCheckbox],
template: `
<div class="shopping-app">
<h1>Custom Checkbox Example</h1>
<div class="demo-section">
<!--... | typescript | github | https://github.com/angular/angular | adev/src/content/tutorials/signals/steps/6-two-way-binding-with-model-signals/answer/src/app/app.ts |
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/apertus/modular_apertus.py.
# Do NOT edit this file manually as any edits will be overwritten by the generation o... | python | github | https://github.com/huggingface/transformers | src/transformers/models/apertus/modeling_apertus.py |
# frozen_string_literal: true
module Jekyll
class LiquidRenderer
class Table
GAUGES = [:count, :bytes, :time].freeze
def initialize(stats)
@stats = stats
end
def to_s(num_of_rows = 50)
Jekyll::Profiler.tabulate(data_for_table(num_of_rows))
end
private
... | ruby | github | https://github.com/jekyll/jekyll | lib/jekyll/liquid_renderer/table.rb |
#!/usr/bin/env python
# Copyright 2014 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.
"""Unit tests for git_rebase_update.py"""
import os
import sys
DEPOT_TOOLS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__f... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import warnings
import zipfile
from distutils.util import change_root
from distutils import sysconfig
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from pip._vendor.dist... | unknown | codeparrot/codeparrot-clean | ||
name: Close stale pull requests
on:
workflow_dispatch:
inputs:
endDate:
description: stop processing PRs after this date
required: false
type: string
# yamllint disable rule:empty-lines
env:
CLOSE_MESSAGE: >
This pull request was opened more than a year ago and there has
b... | unknown | github | https://github.com/nodejs/node | .github/workflows/close-stale-pull-requests.yml |
# -*- coding: utf-8 -*-
import gc
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="application/x-so... | unknown | codeparrot/codeparrot-clean | ||
"""Test Z-Wave lights."""
from unittest.mock import patch, MagicMock
from homeassistant.components import zwave
from homeassistant.components.zwave import const, light
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
SUPPORT_BRIGHTNESS,
... | 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 applicable law or a... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/kernels/fake_quant_ops_functor.h |
import sys
from types import MethodType, ModuleType, FunctionType, InstanceType, ClassType
class Dummy: pass
class Patcher:
def __init__(self, entity):
self.ent_type = None
self.entity = entity
self.__determine_type()
def __determine_type(self):
if isinstance(self.entity, Clas... | unknown | codeparrot/codeparrot-clean | ||
# Two Gold Stars
# Question 2: Combatting Link Spam
# One of the problems with our page ranking system is pages can
# collude with each other to improve their page ranks. We consider
# A->B a reciprocal link if there is a link path from B to A of length
# equal to or below the collusion level, k. The length of a lin... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.