code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
import {
base64decode,
computeLineAndCharacterOfPosition,
createDocumentPositionMapper,
createGetCanonicalFileName,
DocumentPosition,
DocumentPositionMapper,
DocumentPositionMapperHost,
Extension,
getDeclarationEmitOutputFilePathWorker,
getDirectoryPath,
getDocumentPositionMa... | typescript | github | https://github.com/microsoft/TypeScript | src/services/sourcemaps.ts |
import json
import logging
import mongoengine as me
import rmc.shared.util as util
class AggregateRating(me.EmbeddedDocument):
rating = me.FloatField(min_value=0.0, max_value=1.0, default=0.0)
count = me.IntField(min_value=0, default=0)
sorting_score_positive = me.FloatField(
min_value=0.0, max_v... | unknown | codeparrot/codeparrot-clean | ||
# This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# tests controllers/summary/gui.py
#
# Copyright 2016 Canonical, Ltd.
import unittest
from unittest.mock import MagicMock, call, patch, sentinel
from conjureup.controllers.summary.gui import SummaryController
class SummaryGUIRenderTestCase(unittest.TestCase):
def setUp(self):
se... | unknown | codeparrot/codeparrot-clean | ||
use std::io::{self, IoSlice};
use std::ops::DerefMut;
use std::pin::Pin;
use std::task::{Context, Poll};
/// Writes bytes asynchronously.
///
/// This trait is analogous to the [`std::io::Write`] trait, but integrates with
/// the asynchronous task system. In particular, the [`poll_write`] method,
/// unlike [`Write::... | rust | github | https://github.com/tokio-rs/tokio | tokio/src/io/async_write.rs |
#!/usr/bin/env python
############################################################################
#
# Copyright (c) 2012-2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2021 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 applicabl... | python | github | https://github.com/huggingface/transformers | src/transformers/pipelines/audio_classification.py |
"""
Views to support exchange of authentication credentials.
The following are currently implemented:
1. AccessTokenExchangeView:
3rd party (social-auth) OAuth 2.0 access token -> 1st party (open-edx) OAuth 2.0 access token
2. LoginWithAccessTokenView:
1st party (open-edx) OAuth 2.0 access token -... | unknown | codeparrot/codeparrot-clean | ||
/* Implementation helper: a struct that looks like a tuple.
See timemodule and posixmodule for example uses.
The structseq helper is considered an internal CPython implementation
detail. Docs for modules using structseqs should call them
"named tuples" (be sure to include a space between the two
words ... | c | github | https://github.com/python/cpython | Objects/structseq.c |
from pyttsx.drivers import _espeak
import ctypes
import wave
import time
import threading
import StringIO
class Synth(object):
_done = False
def __init__(self):
self.rate = _espeak.Initialize(_espeak.AUDIO_OUTPUT_RETRIEVAL, 1000)
assert self.rate != -1, 'could not initialize espeak'
_esp... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
... | unknown | codeparrot/codeparrot-clean | ||
#!/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 distributed... | unknown | codeparrot/codeparrot-clean | ||
from .named import NamedExtensionManager
class HookManager(NamedExtensionManager):
"""Coordinate execution of multiple extensions using a common name.
:param namespace: The namespace for the entry points.
:type namespace: str
:param name: The name of the hooks to load.
:type name: str
:param i... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class AccountPaymentRegister(models.TransientModel):
_name = 'account.payment.register'
_description = 'Register Payment'
# == Business fields ==
payment_date = fields.Date(string="Payment Date", req... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 NEC Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import json
import sys
def check_hosts(contrib, plugin):
contrib_hosts = sorted(contrib['_meta']['hostvars'].keys())
plugin_hosts = sorted(plugin['_meta']['hostvars'].keys())
assert contrib_hosts == plugin_hosts
return contrib_hosts, plugin_hosts
def check_groups(contrib, plugin... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 by appli... | unknown | codeparrot/codeparrot-clean | ||
#include <ruby.h>
static VALUE
bug_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arg))
{
rb_notimplement();
return ID2SYM(rb_frame_this_func());
}
static VALUE
bug_start(VALUE self)
{
VALUE ary = rb_ary_new3(1, Qnil);
rb_block_call(ary, rb_intern("map"), 0, 0, bug_i, self);
return ary;
}
void
Init_bug_3571(voi... | c | github | https://github.com/ruby/ruby | ext/-test-/bug-3571/bug.c |
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.analysis.api.platform.packages
import com.intellij.openapi.project.Project
impor... | kotlin | github | https://github.com/JetBrains/kotlin | analysis/analysis-api-platform-interface/src/org/jetbrains/kotlin/analysis/api/platform/packages/KotlinPackageProviderBase.kt |
from setuptools import setup, find_packages
from chamber.version import get_version
setup(
name='django-chamber',
version=get_version(),
description='Utilities library meant as a complement to django-is-core.',
author='Lubos Matl, Oskar Hollmann',
author_email='matllubos@gmail.com, oskar@hollmann.... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2018 Nemanja Trifunovic
/*
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivat... | c | github | https://github.com/nodejs/node | deps/LIEF/include/LIEF/third-party/internal/utfcpp/utf8/cpp17.h |
#!/usr/bin/env bash
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | github | https://github.com/kubernetes/kubernetes | hack/verify-owners-fmt.sh |
# Copyright 2016 Twitter. 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 agree... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from nose.tools import *
from utilities import execution_path, Todo
import os, sys, glob, mapnik
import itertools
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
def compare_shape_betw... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... | unknown | codeparrot/codeparrot-clean | ||
import os, sys
class IntegerLinearProgram:
# this class handles a basic ILP for glpsol from the Gnu linear programming toolkit, in cpxlp format
# note that:
# - only binary and integer variables are supported
# - the behavior is not defined if no solution is found
# - the solver might run for a lon... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Cameras are responsible for determining which part of a scene is displayed
in a viewbox and for handling user input to change the view.
Several Camera subclasses are avail... | unknown | codeparrot/codeparrot-clean | ||
import os
from ruamel.yaml import YAML
from bot import defaults as bot_defaults
from bot.lib.logger import create_logger
log = create_logger('Configuration')
yaml = YAML(typ='safe')
yaml.default_flow_style = False
class Configuration:
"""
Manages a YAML configuration file
"""
def __init__(self, path... | unknown | codeparrot/codeparrot-clean | ||
#ifndef SETUP_H
#define SETUP_H
#include "refs.h"
#include "string-list.h"
int is_inside_git_dir(void);
int is_inside_work_tree(void);
int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
int get_common_dir(struct strbuf *sb, const char *gitdir);
/*
* Return true if the given path is a git directory; no... | c | github | https://github.com/git/git | setup.h |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) 2011-2013, 'pq' Contributors Portions Copyright (C) 2011 Blake
// Mizerany
//
// 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 limita... | go | github | https://github.com/hashicorp/vault | sdk/database/helper/dbutil/parseurl.go |
"""
Subscribe all registered OSF users to the 'Open Science Framework General'
mailing list on mailchimp. From the API docs:
1. Grab the users to be updated or created
2. For each user's status, sort them into two batches:
Users to be subscribed or updated
Users to be unsubscribed
3. For each of those batches,... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
import unittest
import sys
import os.path
from copy import copy
sys.path.append(os.path.dirname(__file__) + "/../../..")
from pox.openflow.libopenflow_01 import *
from pox.openflow.switch_impl import *
class MockConnection(object):
def __init__(self):
self.ofp_handlers = {}
self.rece... | unknown | codeparrot/codeparrot-clean | ||
# PyTIS is a Python implementation of transition interface sampling.
# Copyright (C) 2010 Titus Van Erp <Titus.VanErp@biw.kuleuven.be>,
# Toon Verstraelen <Toon.Verstraelen@UGent.be>
#
# This file is part of PyTIS.
#
# PyTIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General... | unknown | codeparrot/codeparrot-clean | ||
# setup.py
# Install script for ConfigObj
# Copyright (C) 2005-2014:
# (name) : (email)
# Michael Foord: fuzzyman AT voidspace DOT org DOT uk
# Mark Andrews: mark AT la-la DOT com
# Nicola Larosa: nico AT tekNico DOT net
# Rob Dennis: rdennis AT gmail DOT com
# Eli Courtwright: eli AT courtwright DOT org
# This softwa... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2017 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 requir... | unknown | codeparrot/codeparrot-clean | ||
""" Copyright (C) 2010-2011 ST-Ericsson SA """
""" Author: Szymon Janc <szymon.janc@tieto.com> for ST-Ericsson. """
""" 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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
package server
import (
"context"
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroa... | go | github | https://github.com/cockroachdb/cockroach | pkg/server/server_internal_executor_factory_test.go |
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package graph
import (
"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/dag"
"github.com/hashicorp/terraform/internal/terraform"
)
type GraphNodeReferenceable interface {
Referenceable() addrs.Referencea... | go | github | https://github.com/hashicorp/terraform | internal/moduletest/graph/transform_references.go |
#
# Python documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
import os
import sys
fr... | python | github | https://github.com/python/cpython | Doc/conf.py |
"""
sqmpy.job.constants
~~~~~~~~~~~~~~~~
Constants to be used in job package
"""
from enum import Enum, unique
import saga
__author__ = 'Mehdi Sadeghi'
JOB_MANAGER = 'sqmpy.job.manager'
# TODO Could be replaced with Enum class in python 3.4 (is back ported)
class JobStatus(object):
"""
Represen... | unknown | codeparrot/codeparrot-clean | ||
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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 | ||
#
# gdb helper commands and functions for Linux kernel debugging
#
# task & thread tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
task_type = utils.CachedType("... | unknown | codeparrot/codeparrot-clean | ||
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | unknown | codeparrot/codeparrot-clean | ||
# 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 distributed in the hope that ... | python | github | https://github.com/ansible/ansible | lib/ansible/module_utils/facts/system/python.py |
import base64
import json
import activity
import os
import requests
import boto.sqs
from boto.sqs.message import Message
from provider import eif
"""
ConvertJATS.py activity
"""
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
class activity_ApprovePublication(a... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012-2013 Eric Ptak - trouch.com
#
# 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 | ||
//! Multipart testing utilities.
use actix_web::{
http::header::{self, HeaderMap},
web::{BufMut as _, Bytes, BytesMut},
};
use mime::Mime;
use rand::distr::{Alphanumeric, SampleString as _};
const CRLF: &[u8] = b"\r\n";
const CRLF_CRLF: &[u8] = b"\r\n\r\n";
const HYPHENS: &[u8] = b"--";
const BOUNDARY_PREFIX:... | rust | github | https://github.com/actix/actix-web | actix-multipart/src/test.rs |
import pytest
def test_audit_biosample_characterization_review_lane_not_required(
testapp,
biosample_characterization,
review,
):
testapp.patch_json(
biosample_characterization['@id'],
{
'review': review,
'characterization_method': 'immunoprecipitatio... | unknown | codeparrot/codeparrot-clean | ||
{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v2alpha1",
"metadata": {
"name": "v0alpha1.gauge_tests.v42"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"query": {
"kind": "",
"spec": {}
},
... | json | github | https://github.com/grafana/grafana | apps/dashboard/pkg/migration/conversion/testdata/output/migrated_dev_dashboards/panel-gauge/v0alpha1.gauge_tests.v42.v2alpha1.json |
#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_PENDING_COUNTS_H_
#define TENSORFLOW_CORE_COMMON_RUNTIME_PENDING_COUNTS_H_
/* Copyright 2015 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 obta... | c | github | https://github.com/tensorflow/tensorflow | tensorflow/core/common_runtime/pending_counts.h |
# iSCSI configuration dialog
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribute... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (C) 2011 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 ... | 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 | ||
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
from test import test_support
import marshal
import sys
import unittest
import os
class IntTestCase(unittest.TestCase):
def test_ints(self):
# Test the full range of Python ints.
n = sys.maxint
while n:
for expected in (-n, n):... | unknown | codeparrot/codeparrot-clean | ||
"""Support for RESTful binary sensors."""
import logging
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassistant.const import (
CONF_AUTHENTICA... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | unknown | codeparrot/codeparrot-clean | ||
from django.db import models
from django.contrib.auth.models import User
from apps.rss_feeds.models import Feed
class RecommendedFeed(models.Model):
feed = models.ForeignKey(Feed, related_name='recommendations')
user = models.ForeignKey(User, related_name='recommendations')
description ... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright (c) 2016 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.util.concurrent;
/**
* <p>
* A detached local that allows for explicit control of setting and removing values from a thread-local
* context.
* </p>
* Instances of th... | java | github | https://github.com/mockito/mockito | mockito-core/src/main/java/org/mockito/internal/util/concurrent/DetachedThreadLocal.java |
import pandas as pd
import numpy as np
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import SGDClassifier
from sklearn.pipeline import Pipeline
from embedding import MeanEmbeddingVectorizer
from tokenizer import Tokenizer
from sklearn.model_selection import cross_val_score, cross_val_predict
... | 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 u... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import sys
def main():
for path in sys.argv[1:] or sys.stdin.read().splitlines():
with open(path, 'rb') as path_fd:
lines = path_fd.read().splitlines()
missing = Tr... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts a single file from a CAB archive."""
import os
import shutil
import subprocess
import sys
import tempfile
def run_qui... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2019 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.
import test_util
import time
from absl import app, flags
FLAGS = flags.FLAGS
flags.DEFINE_string('url', None, 'The url to open in Chrome.')
flags.mark_flag... | unknown | codeparrot/codeparrot-clean | ||
# $Id: _compat.py 7486 2012-07-11 12:25:14Z milde $
# Author: Georg Brandl <georg@python.org>
# Copyright: This module has been placed in the public domain.
"""
Python 2/3 compatibility definitions.
This module currently provides the following helper symbols:
* bytes (name of byte string type; str in 2.x, bytes in 3... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Evan Purkhiser
# 2014 Ben Ockmore
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""AIFF audio stream information a... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2018 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | unknown | codeparrot/codeparrot-clean | ||
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistribu... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# This file is part of CERN Open Data Portal.
# Copyright (C) 2014 CERN.
#
# CERN Open Data Portal 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, o... | 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 release
import (
"archive/tar"
"archive/zip"
"bytes"
"compress/gzip"
"crypto/sha256"
"fmt"
"io"
"log"
"mime"
"os"
"path/filepath"
"strings"
"githu... | go | github | https://github.com/cockroachdb/cockroach | pkg/release/upload.go |
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/rockchip.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Rockchip platforms
maintainers:
- Heiko Stuebner <heiko@sntech.de>
properties:
$nodename:
const: '/'
compatible:
oneOf:
- descripti... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/arm/rockchip.yaml |
"""SCons.Tool.sunc++
Tool-specific initialization for C++ on SunOS / Solaris.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Founda... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('news', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='eventrelatedtonews',
opt... | unknown | codeparrot/codeparrot-clean | ||
# DatabaseStorage for django.
# 2009 (c) GameKeeper Gambling Ltd, Ivanov E.
import StringIO
import urlparse
from django.conf import settings
from django.core.files import File
from django.core.files.storage import Storage
from django.core.exceptions import ImproperlyConfigured
try:
import pyodbc
except ImportErro... | unknown | codeparrot/codeparrot-clean | ||
from sqlalchemy.orm import validates
from sqlalchemy import UniqueConstraint
from eachday import app, db, bcrypt
from datetime import datetime, date, timedelta
import jwt
import marshmallow
from marshmallow import Schema, fields, validate, ValidationError
class User(db.Model):
__tablename__ = 'user'
TOKEN_EXPI... | unknown | codeparrot/codeparrot-clean | ||
"""
This module provides views that proxy to the staff grading backend service.
"""
import json
import logging
from django.conf import settings
from django.http import HttpResponse, Http404
from django.utils.translation import ugettext as _
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.o... | unknown | codeparrot/codeparrot-clean | ||
package command
import (
"bytes"
"encoding/json"
"fmt"
"os"
"strconv"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/moby/moby/v2/daemon/config"
"github.com/moby/sys/reexec"
"golang.org/x/sys/unix"
"gotest.tools/v3/assert"
)
const (
testListenerNoAddrCmdPhase1 = "test-listener-no-addr1"
testListen... | go | github | https://github.com/moby/moby | daemon/command/daemon_linux_test.go |
#include <c10/util/WaitCounter.h>
#include <c10/util/Synchronized.h>
#include <c10/util/WaitCounterDynamicBackend.h>
#include <chrono>
#include <memory>
#include <string>
#include <string_view>
#include <unordered_map>
#include <vector>
#ifndef _WIN32
#include <dlfcn.h>
#endif
namespace c10::monitor {
namespace de... | cpp | github | https://github.com/pytorch/pytorch | c10/util/WaitCounter.cpp |
from __future__ import with_statement, absolute_import
import re
from contextlib import closing
import MySQLdb
import MySQLdb.cursors
re_column_length = re.compile(r'\((\d+)\)')
re_column_precision = re.compile(r'\((\d+),(\d+)\)')
re_key_1 = re.compile(r'CONSTRAINT `(\w+)` FOREIGN KEY \(`(\w+)`\) REFERENCES `(\w+)` ... | unknown | codeparrot/codeparrot-clean | ||
from markdown.preprocessors import Preprocessor
from markdown.blockprocessors import BlockProcessor
from markdown.postprocessors import Postprocessor
from markdown.util import etree
from markdown.util import AtomicString
from markdown.extensions import Extension
import re
class TabbedNavPre(Preprocessor):
"""
*Boots... | unknown | codeparrot/codeparrot-clean | ||
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* RSA Signature Scheme with Appendix - PKCS #1 v1.5 (RFC 8017 sec 8.2)
*
* https://www.rfc-editor.org/rfc/rfc8017#section-8.2
*
* Copyright (c) 2015 - 2024 Intel Corporation
*/
#include <linux/module.h>
#include <linux/scatterlist.h>
#include <crypto/akcipher.h>
#i... | c | github | https://github.com/torvalds/linux | crypto/rsassa-pkcs1.c |
from common_fixtures import * # NOQA
from requests.auth import AuthBase
from selenium import webdriver
from test_github import URL
from common_fixtures import _client_for_user
if_ldap = pytest.mark.skipif(not os.environ.get('API_AUTH_OPEN_LDAP_SERVER'),
reason='API_AUTH_OPEN_LDAP_SERVER i... | unknown | codeparrot/codeparrot-clean | ||
from langchain_core.agents import AgentAction
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
def format_log_to_messages(
intermediate_steps: list[tuple[AgentAction, str]],
template_tool_response: str = "{observation}",
) -> list[BaseMessage]:
"""Construct the scratchpad that lets ... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/agents/format_scratchpad/log_to_messages.py |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Written in place of AboutBlocks in the Ruby Koans
#
# Note: Both blocks and generators use a yield keyword, but they behave
# a lot differently
#
from runner.koan import *
class AboutGenerators(Koan):
def test_generating_values_on_the_fly(self):
result =... | unknown | codeparrot/codeparrot-clean | ||
#!/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 distributed... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import json
import random
import re
from .common import InfoExtractor
from ..compat import (
compat_b64decode,
compat_HTTPError,
compat_str,
)
from ..utils import (
ExtractorError,
orderedSet,
unescapeHTML,
urlencode_postdata,
urljoin,
)
class L... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
module ActiveJob
class Continuation
module Validation # :nodoc:
private
def validate_step!(name)
validate_step_symbol!(name)
validate_step_not_encountered!(name)
validate_step_not_nested!(name)
validate_step_resume_expected!(name... | ruby | github | https://github.com/rails/rails | activejob/lib/active_job/continuation/validation.rb |
"""
JSONField automatically serializes most Python terms to JSON data.
Creates a TEXT field with a default value of "{}". See test_json.py for
more information.
from django.db import models
from django_extensions.db.fields import json
class LOL(models.Model):
extra = json.JSONField()
"""
import six
import d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from __future__ import annotations
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
from ansible.module_utils.basic import AnsibleModule
def main():
module = AnsibleModule(
argument_spec=dict(),... | python | github | https://github.com/ansible/ansible | test/integration/targets/ansible-doc/library/test_no_docs.py |
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import ZillizRetriever
from langchain_community.retrievers.zilliz import ZillizRetreiver
# Create a way to dynamically look up deprecated imports.
# Used to consolida... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/zilliz.py |
"""
Feature agglomeration. Base classes and functions for performing feature
agglomeration.
"""
# Author: V. Michel, A. Gramfort
# License: BSD 3 clause
import numpy as np
from ..base import TransformerMixin
from ..utils import check_array
from ..utils.validation import check_is_fitted
##############################... | unknown | codeparrot/codeparrot-clean | ||
import { isArray, isObject, isString } from '@vue/shared'
import { warn } from '@vue/runtime-core'
export function ssrRenderList(
source: unknown,
renderItem: (value: unknown, key: string | number, index?: number) => void,
): void {
if (isArray(source) || isString(source)) {
for (let i = 0, l = source.length... | typescript | github | https://github.com/vuejs/core | packages/server-renderer/src/helpers/ssrRenderList.ts |
/*
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/policy/fuzzer/fuzzer.go |
#!/bin/bash
set -ex
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
sysctl -w net.ipv6.conf.lo.disable_ipv6=1
cat /etc/hosts
ruby -e "hosts = File.read('/etc/hosts').sub(/^::1\s*localhost.*$/, ''); File.write('/etc/hosts', hosts)"
cat /etc/hosts | unknown | github | https://github.com/ruby/ruby | tool/disable_ipv6.sh |
//// [tests/cases/conformance/statements/VariableStatements/usingDeclarations/awaitUsingDeclarations.3.ts] ////
//// [awaitUsingDeclarations.3.ts]
{
await using d1 = { async [Symbol.asyncDispose]() {} },
d2 = null,
d3 = undefined,
d4 = { [Symbol.dispose]() {} };
}
e... | javascript | github | https://github.com/microsoft/TypeScript | tests/baselines/reference/awaitUsingDeclarations.3(target=es5).js |
# -*- coding: utf-8 -*-
from .baserequest import BaseRequest
from oandapyV20.types import TradeID, PriceValue
from oandapyV20.definitions.orders import TimeInForce, OrderType
class StopLossOrderRequest(BaseRequest):
"""create a StopLossOrderRequest.
StopLossOrderRequest is used to build the body for a StopLo... | unknown | codeparrot/codeparrot-clean | ||
/* 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/core/tfrt/kernels/stream_ops_util.h |
"""Tests for binary operators on subtypes of built-in types."""
import unittest
from test import test_support
def gcd(a, b):
"""Greatest common divisor using Euclid's algorithm."""
while a:
a, b = b%a, a
return b
def isint(x):
"""Test whether an object is an instance of int or long."""
re... | unknown | codeparrot/codeparrot-clean | ||
import numpy
from tsr.tsrlibrary import TSRFactory
from tsr.tsr import TSR, TSRChain
@TSRFactory('herb', 'block_bin', 'point_on')
def point_on(robot, block_bin, manip=None, padding=0.04):
'''
This creates a TSR that allows you to sample poses on the tray.
The samples from this TSR should be used to find po... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.