code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Template = require("../Template");
const WebAssemblyImportDependency = require("../dependencies/WebAssemblyImportDependency");
/** @typedef {import("../Module")} Module */
/** @typedef {import("../... | javascript | github | https://github.com/webpack/webpack | lib/wasm-sync/WebAssemblyUtils.js |
uassert(1, "words");
uasserted(2, "words");
massert(3, "words");
masserted(4, "words");
msgassert(5, "words");
msgasserted(6, "words");
uassertNoTrace(7, "words");
uassertedNoTrace(8, "words");
massertNoTrace(9, "words");
massertedNoTrace(10, "words");
msgassertNoTrace(11, "words");
msgassertedNoTrace(12, "words");
DBE... | cpp | github | https://github.com/mongodb/mongo | buildscripts/tests/data/errorcodes/regex_matching/regex_matching.cpp |
# -*- coding: utf-8 -*-
from enigma import eTimer
from Components.Language import language
class NumericalTextInput:
def __init__(self, nextFunc=None, handleTimeout = True, search = False):
self.mapping = []
self.lang = language.getLanguage()
self.useableChars=None
self.nextFunction=nextFunc
if handleTimeo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 rig... | unknown | codeparrot/codeparrot-clean | ||
# Natural Language Toolkit: Arc-Standard and Arc-eager Transition Based Parsers
#
# Author: Long Duong <longdt219@gmail.com>
#
# Copyright (C) 2001-2015 NLTK Project
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import absolute_import
from __future__ import division
from __future... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.admin import FieldListFilter
try:
from django.contrib.admin.utils import prepare_lookup_value
except ImportError:
# django < 1.7
from django.contrib.admin.util import prepare_lookup_value
from django.utils.translation impor... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Yahoo! 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... | unknown | codeparrot/codeparrot-clean | ||
"""Fixer for sys.exc_{type, value, traceback}
sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""
# By Jeff Balogh and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms
clas... | unknown | codeparrot/codeparrot-clean | ||
## Automatically adapted for numpy Sep 19, 2005 by convertcode.py
__all__ = ['iscomplexobj','isrealobj','imag','iscomplex',
'isreal','nan_to_num','real','real_if_close',
'typename','asfarray','mintypecode','asscalar',
'common_type']
import numpy.core.numeric as _nx
from numpy.core.num... | unknown | codeparrot/codeparrot-clean | ||
from test_support import verbose
import string, sys
# XXX: kludge... short circuit if strings don't have methods
try:
''.join
except AttributeError:
raise ImportError
def test(name, input, output, *args):
if verbose:
print 'string.%s%s =? %s... ' % (name, (input,) + args, output),
try:
... | unknown | codeparrot/codeparrot-clean | ||
/* 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 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/lib/strings/stringprintf.h |
<!---
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 ... | unknown | github | https://github.com/huggingface/transformers | docs/README.md |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# 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... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
import unittest
from yotta.lib import version
# test the extra things we add to python-semanticversion by subclassing Version
# and Spec
class VersionTestCase(unittest.TestCase):
... | unknown | codeparrot/codeparrot-clean | ||
# The MIT License
#
# Copyright (c) 2011 Wyss Institute at Harvard University
#
# 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 | ||
<?php
namespace Illuminate\View\Concerns;
use Illuminate\Support\Arr;
use Illuminate\Support\LazyCollection;
trait ManagesLoops
{
/**
* The stack of in-progress loops.
*
* @var array
*/
protected $loopsStack = [];
/**
* Add new loop to the stack.
*
* @param \Countable... | php | github | https://github.com/laravel/framework | src/Illuminate/View/Concerns/ManagesLoops.php |
#!/usr/bin/env python
# LatitudePlot.py
# Created 30 July 2013
# Created by snowdonjames@googlemail.com
import os, time, math
from datetime import datetime
from time import mktime
import xml.etree.ElementTree as ET
from PIL import Image, ImageDraw
def GetKmlFiles():
"""Locates and reads local .kml files, returns... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/main/java/org/apache/kafka/common/network/NetworkSend.java |
# 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
__all__ = ["RealtimeTranscriptionSessionAudioInputTurnDetectionParam", "ServerVad", "Semant... | python | github | https://github.com/openai/openai-python | src/openai/types/realtime/realtime_transcription_session_audio_input_turn_detection_param.py |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@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... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | tests/e2e/ctl_v3_make_mirror_test.go |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | unknown | codeparrot/codeparrot-clean | ||
<!--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/es/pipeline_tutorial.md |
// Copyright 2018 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | go | github | https://github.com/etcd-io/etcd | tests/integration/clientv3/concurrency/election_test.go |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any, Union, overload
from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging, requires_backends
from .base import Pipeline, build_pipeline_init_args
if is_vision_available():
from ..image_utils import load_image
if is_torch_available():
impor... | python | github | https://github.com/huggingface/transformers | src/transformers/pipelines/object_detection.py |
from dal import autocomplete
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.validators import MaxLengthValidator, MinLengthValidator
from .models import Event, Question
QUESTION = "Ask your question in 280 characters"
ANSWER = "... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) - 2015, Tom Barron. 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
#
# ht... | unknown | codeparrot/codeparrot-clean | ||
'''
Creating the needed environments for creating the pre-compiled distribution on Windods:
1. Download:
* conda32 at C:\tools\Miniconda32
* conda64 at C:\tools\Miniconda
Create the environments:
C:\tools\Miniconda32\Scripts\conda create -y -f -n py27_32 python=2.7 cython numpy nose ipython pip
C:\tools\Miniconda3... | unknown | codeparrot/codeparrot-clean | ||
import json
import re
import requests
from urllib.parse import quote
from db.models import User
from logger import storage
from .basic import get_page
from page_parse import is_404
from config import get_samefollow_uid
from db.dao import (
UserOper, SeedidsOper)
from page_parse.user import (
enterprise, person... | unknown | codeparrot/codeparrot-clean | ||
# Class definition:
# RunJob
# This is the main RunJob class; RunJobEvent etc will inherit from this class
# Note: at the moment, this class is essentially the old runJob module turned object oriented.
# The class will later become RunJobNormal, ie responible for running normal PanDA jobs.
# At th... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2024, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including... | c | github | https://github.com/mysql/mysql-server | components/connection_control/connection_control_interfaces.h |
base_suite: replica_sets_jscore_passthrough_base
description: >-
Test the correctness of query settings application by emulating cursor hints with
'setQuerySettings' commands. This suite runs jscore tests using a replica set fixture.
excludes:
- "query_settings.common_core_excludes"
- "query_settings.hints_core... | unknown | github | https://github.com/mongodb/mongo | buildscripts/resmokeconfig/matrix_suites/mappings/replica_sets_jscore_pqs_hints.yml |
from django import template
from django.conf import settings
from django.db import models
from django.contrib.sites.models import Site
from django.template import Context, loader
register = template.Library()
Analytics = models.get_model('googleanalytics', 'analytics')
def do_get_analytics(parser, token):
conten... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import datetime
import logging
import requests
import os.path
import time
from utils import mongo
class FetchLordsInterests:
def __init__(self, **kwargs):
self._logger = logging.getLogger('spud')
# local directory to save fetched files to
self.STORE_DIR = "store"
... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from __future__ import print_function
from datetime import timedelta
from django.db import connection, transaction
from django.forms.models import model_to_dict
from django.utils.timezone import now as timezone_now
from zerver.models import Realm, Message, UserMessage, ArchivedM... | 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... | typescript | github | https://github.com/apache/airflow | airflow-core/src/airflow/ui/src/components/ui/ActionBar/index.ts |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Natural Language Toolkit: TGrep search
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Will Roberts <wildwilhelm@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
'''
============================================
TGrep search implementa... | unknown | codeparrot/codeparrot-clean | ||
"""
问题描述: 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。
省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只
要互相间接通过道路可达即可)。问最少还需要建设多少条道路?
输入描述:
测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和
道路数目M;随后的M行对应M条道路,每行给出一对正整数,分别是该条道路直接连通的两个城镇的编号。
为简单起见,城镇从1到N编号。
注意:两个城市之间可以有多条道路相通,也就是说
3 3
1 2
1 2
2 1
这种输入也是合法的
当N为0时,输入结束,该用例不被处理。... | unknown | codeparrot/codeparrot-clean | ||
from flask import Flask, request, render_template, send_from_directory, Response, current_app, Blueprint
from flask.ext.login import LoginManager, UserMixin, login_required, current_user
from bson.objectid import ObjectId
from collections import OrderedDict
from html.parser import HTMLParser
import threading
import epu... | unknown | codeparrot/codeparrot-clean | ||
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Nick Hall
#
# 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 your option) any la... | unknown | codeparrot/codeparrot-clean | ||
from os.path import dirname, join
from bokeh.core.properties import Any, Dict, Instance, String
from bokeh.models import ColumnDataSource, LayoutDOM
# This defines some default options for the Graph3d feature of vis.js
# See: http://visjs.org/graph3d_examples.html for more details. Note
# that we are fixing the size ... | 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 | ||
# -*- coding: utf-8 -*-
#
# RBF documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 18 17:39:42 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | unknown | codeparrot/codeparrot-clean | ||
// TODO: this file can be removed safely in v6 when `@import "variables-dark"` will be removed at the end of _variables.scss
@import "../../functions";
@import "../../variables";
// Voluntarily not importing _variables-dark.scss
@import "../../maps";
@import "../../mixins"; | unknown | github | https://github.com/twbs/bootstrap | scss/tests/mixins/_auto-import-of-variables-dark.test.scss |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .. import base
from ..base.fields import Text, Date, Json
# Module API
class Record(base.Record):
# Config
table = 'isrctn'
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2015 MongoDB, 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 agreed to in writing, so... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# Copyright (c) 2002-2005 ActiveState Software Ltd.
"""preprocess: a multi-language preprocessor
There are millions of templating systems out there (most of them
developed for the web). This isn't one of those, though it does share
some basics: a markup syntax for templates that are processed to... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.engine.darwin.certificates
import io.ktor.client.engine.darwin.certificates.CertificatePinner.*
import io.ktor.client.engine.darwin.certificates.CertificatesInfo.HASH_ALG... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-darwin/darwin/src/io/ktor/client/engine/darwin/certificates/PinnedCertificate.kt |
import time
import pytest
from tests.support import platform_name
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_success
def navigate_to(session, url):
return session.transport.send(
"POST", "session/{session_id}/url".format(**vars(session)),
{"ur... | unknown | codeparrot/codeparrot-clean | ||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from ..responses.response_output_refusal_param import ResponseOutputRefusalParam
RefusalContentParam = ResponseOutputRefusalParam | python | github | https://github.com/openai/openai-python | src/openai/types/conversations/refusal_content_param.py |
{
"signing": {
"default": {
"usages": [
"digital signature",
"cert sign",
"crl sign",
"signing",
"key encipherment",
"client auth"
],
"expiry": "876000h",
"ca_const... | json | github | https://github.com/kubernetes/kubernetes | pkg/kubeapiserver/options/testdata/intermediate.config.json |
from __future__ import unicode_literals
from django.db.migrations import (
AddField, AlterField, AlterIndexTogether, AlterModelTable,
AlterOrderWithRespectTo, AlterUniqueTogether, CreateModel, DeleteModel,
RemoveField, RenameField, RenameModel,
)
from django.utils import six
class MigrationOptimizer(objec... | unknown | codeparrot/codeparrot-clean | ||
import sys
import yappi
import unittest
class YappiUnitTestCase(unittest.TestCase):
def setUp(self):
# reset everything back to default
yappi.stop()
yappi.clear_stats()
yappi.set_clock_type('cpu') # reset to default clock type
yappi.set_context_id_callback(None)
yapp... | unknown | codeparrot/codeparrot-clean | ||
############################################################################
# Copyright (C) 2005 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
#
# faces 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 | ||
import yaml
from pywb.cdx.cdxserver import create_cdx_server, CDXServer, RemoteCDXServer
from pywb.cdx.cdxsource import CDXFile, RemoteCDXSource, RedisCDXSource
from pywb.cdx.zipnum import ZipNumCluster
from pywb import get_test_dir
yaml_config = r"""
test_1:
index_paths:
# local cdx paths
- {0}cd... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: -utf8
import user_input as ui
import random
def validate_number(s):
return int(s)
def generate_password(num_special, num_number, num_min):
assert(num_special + num_number <= num_min)
alphabets = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
numbers = "0123456... | unknown | codeparrot/codeparrot-clean | ||
# frozen_string_literal: true
require_relative "../helper"
class Arel::Nodes::SelectStatementTest < Arel::Spec
describe "#clone" do
it "clones cores" do
statement = Arel::Nodes::SelectStatement.new %w[a b c]
dolly = statement.clone
_(dolly.cores).must_equal statement.cores
_(dolly.... | ruby | github | https://github.com/rails/rails | activerecord/test/cases/arel/nodes/select_statement_test.rb |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/impl/package-info.java |
# -*- coding: utf-8 -*-
"""
resolver.py - A fast multi-threaded DNS resolver using the dnspython library
Examples:
# Importing the library
# from fastdns import resolver
# Resolving many DNS hosts
# >>> from pprint import pprint
# >>> r = resolver.Resolver(domain='cisco.com')
# >>> r.hostnames... | unknown | codeparrot/codeparrot-clean | ||
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package stackeval
import (
"context"
"time"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/instances"
"github.com/hashicorp/terraform/internal/lang"
"github.com/hashicorp/terraform/internal/plans"
"github.com/hash... | go | github | https://github.com/hashicorp/terraform | internal/stacks/stackruntime/internal/stackeval/removed_stack_call_instance.go |
# --------------------------------------------------------
# Caffe @ Dragon
# Copyright(c) 2017 SeetaTech
# Written by Ting Pan
# --------------------------------------------------------
from dragon.ops import MPIBroadcast, MPIGather
from ..layer import Layer
class MPIBroadcastLayer(Layer):
"""The implementation... | unknown | codeparrot/codeparrot-clean | ||
# Author: Mr_Orange
#
# This file is part of SickRage.
#
# SickRage 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.
#
# SickRage is dis... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
"""tests.io.transcrtiptome_dicts.py: variables for testing"""
TRANSCRIPTOME_EMPTY_DICT = {}
TRANSCRIPTOME_SIMPLE_DICT = {
"ENSDART00000161035.1":
"TGCACGGGTTTATTGTTCACAAAGAGATCGACAATGTGCGCAACTAAAATAAACATAGTACATTTTGATT"
"ATACACGAACTTAAACTAAAGTCCAATCACACCTCCGCCCCGTTTCCACAGCAGC... | unknown | codeparrot/codeparrot-clean | ||
"""
How to reference supporting evidence for some object in the database.
See: "Metadata in PyOpenWorm" for discussion on semantics of what giving
evidence for an object means.
"""
import sys
import PyOpenWorm as P
#Create dummy database configuration.
d = P.Data({})
#Connect to database with dummy configuration
P.... | unknown | codeparrot/codeparrot-clean | ||
"""Python implementation of Programs/_freeze_module.c
The pure Python implementation uses same functions and arguments as the C
implementation.
The generated byte code is slightly different because
compile() sets the PyCF_SOURCE_IS_UTF8 flag and objects have a
reference count > 1. Marshal adds the `FLAG_REF` flag and... | python | github | https://github.com/python/cpython | Programs/_freeze_module.py |
#!/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.
import os
from urlparse import urlparse
import pyauto_functional # Must be imported before pyauto
import pyauto
import test_utils... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 by Ladislav Lhotka, CZ.NIC <lhotka@nic.cz>
#
# Python class representing a node in a RELAX NG schema.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice a... | unknown | codeparrot/codeparrot-clean | ||
"""
NeuralNet class creates a neural network.
"""
from convnet import *
import numpy as np
import time
from collections import OrderedDict
class SimpleDataProvider:
dims = None
def __init__(self, data_dir, batch_range=None, init_epoch=1, init_batchnum=None, dp_params=None, test=False):
pass
de... | unknown | codeparrot/codeparrot-clean | ||
# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
# This file was automatically generated from src/transformers/models/glm_image/modular_glm_image.py.
# Do NOT edit this file manually as any edits will be overwritten by the generati... | python | github | https://github.com/huggingface/transformers | src/transformers/models/glm_image/configuration_glm_image.py |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test descendant package tracking code."""
from test_framework.test_framework import BitcoinTestFramewo... | 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 | build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/package-info.java |
# Copyright 2010-2011 Google
# 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, so... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
"""
This is a script that gathers tags from instances and reports the status of the tags to zabbix
Usage:
ops-ec2-check-tags.py --aws-creds-profile profile1 --clusterid=testcluster --region=us-east-1
"""
# Ignoring module name
# pylint: disable=inval... | unknown | codeparrot/codeparrot-clean | ||
#! /usr/bin/env python
"""\
UnitTest runner. This one searches for all files named test_*.py and collects
all test cases from these files. Finally it runs all tests and prints a
summary.
"""
import unittest
import sys
import os
import time
# inject local copy to avoid testing the installed version instead of the
# w... | unknown | codeparrot/codeparrot-clean | ||
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.query_constructors.opensearch import OpenSearchTranslator
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
... | python | github | https://github.com/langchain-ai/langchain | libs/langchain/langchain_classic/retrievers/self_query/opensearch.py |
#!/usr/bin/python
###############################################################################
# NAME: new_db_sqa.py
# VERSION: 2.0.0b15 (23MAY2006)
# AUTHOR: John B. Cole, PhD (jcole@aipl.arsusda.gov)
# LICENSE: LGPL
###############################################################################
from PyPedal impo... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
# coding: utf-8
"""
Author : weaming
Created Time : 2016-12-06 00:51:08
File Name : cleanpics.py
Description :
My downloaded picture archive tool.
"""
import os
import shutil
from filetree import File
dirs = [
'io',
]
cwd = os.path.expanduser('~/Downloads')
os.chdir(cwd)
F = F... | unknown | codeparrot/codeparrot-clean | ||
"""Testing for K-means"""
import sys
import numpy as np
from scipy import sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing i... | unknown | codeparrot/codeparrot-clean | ||
import unittest
import numpy as np
from op_test import OpTest
class TestAdadeltaOp1(OpTest):
def setUp(self):
self.op_type = "adadelta"
param = np.random.uniform(-1, 1, (102, 105)).astype("float32")
grad = np.random.uniform(-1, 1, (102, 105)).astype("float32")
# The squared gradient... | unknown | codeparrot/codeparrot-clean | ||
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/clients/MockClient.java |
from scrapy.tests import test_utils_queue as t
from scrapy.squeue import MarshalFifoDiskQueue, MarshalLifoDiskQueue, PickleFifoDiskQueue, PickleLifoDiskQueue
from scrapy.item import Item, Field
from scrapy.http import Request
from scrapy.contrib.loader import ItemLoader
class TestItem(Item):
name = Field()
def te... | 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 | ||
# 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 | ||
#!/usr/bin/env python
# Demonstrate how to use the vtkBoxWidget to translate, scale, and
# rotate actors. The basic idea is that the box widget controls an
# actor's transform. A callback which modifies the transform is
# invoked as the box widget is manipulated.
import vtk
# Start by creating some simple geometry;... | unknown | codeparrot/codeparrot-clean | ||
// This file was automatically generated from cancellation-and-timeouts.md by Knit tool. Do not edit.
package kotlinx.coroutines.guide.exampleCancel09
import kotlinx.coroutines.*
var acquired = 0
class Resource {
init { acquired++ } // Acquire the resource
fun close() { acquired-- } // Release the resource
}... | kotlin | github | https://github.com/Kotlin/kotlinx.coroutines | kotlinx-coroutines-core/jvm/test/guide/example-cancel-09.kt |
import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classification, load_digits, make_blobs
from sklearn.svm.tests import te... | unknown | codeparrot/codeparrot-clean | ||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/bus/socionext,uniphier-system-bus.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: UniPhier System Bus
description: |
The UniPhier System Bus is an external bus that connects on-board devices ... | unknown | github | https://github.com/torvalds/linux | Documentation/devicetree/bindings/bus/socionext,uniphier-system-bus.yaml |
#!/usr/bin/python
# Copyright 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that a chain of libraries works ok, no matter if we use static or shared
# linking.
import BoostBuil... | unknown | codeparrot/codeparrot-clean | ||
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | unknown | codeparrot/codeparrot-clean | ||
bugfixes:
- package, service, gather_facts - fix templating module_defaults for modules executed by these action plugins. (https://github.com/ansible/ansible/issues/85848) | unknown | github | https://github.com/ansible/ansible | changelogs/fragments/module_defaults-action-plugin-templating.yml |
#![warn(rust_2018_idioms)]
#![cfg(not(target_os = "wasi"))] // Wasi doesn't support threads
use std::rc::Rc;
use std::sync::Arc;
use tokio::sync::Barrier;
use tokio_util::task;
/// Simple test of running a !Send future via spawn_pinned
#[tokio::test]
async fn can_spawn_not_send_future() {
let pool = task::LocalPo... | rust | github | https://github.com/tokio-rs/tokio | tokio-util/tests/spawn_pinned.rs |
"""Provide configuration end points for Customize."""
from homeassistant.components.homeassistant import SERVICE_RELOAD_CORE_CONFIG
from homeassistant.config import DATA_CUSTOMIZE
from homeassistant.core import DOMAIN
import homeassistant.helpers.config_validation as cv
from . import EditKeyBasedConfigView
CONFIG_PAT... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
This module contains abstract classes and decorators.
"""
from future import standard_library
standard_library.install_aliases()
from builtins import object
import logging
from abc import ABCMeta, abstractmethod, abstractproperty
from functools import wraps
from threading import Thread
fro... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | unknown | codeparrot/codeparrot-clean | ||
// Copyright 2011 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be... | c | github | https://github.com/opencv/opencv | 3rdparty/libwebp/src/enc/cost_enc.h |
__all__ = ['Composer', 'ComposerError']
from error import MarkedYAMLError
from events import *
from nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer(object):
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if sel... | unknown | codeparrot/codeparrot-clean | ||
# 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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright (c) 2016, 2025, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is designed to work with certain software (including
b... | c | github | https://github.com/mysql/mysql-server | include/pfs_error_provider.h |
#![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // WASI does not support all fs operations
use tokio::fs;
use std::io::Write;
use tempfile::tempdir;
#[tokio::test]
#[cfg_attr(miri, ignore)] // No `linkat` in miri.
async fn test_hard_link() {
let dir = tempdir().unwrap();
le... | rust | github | https://github.com/tokio-rs/tokio | tokio/tests/fs_link.rs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.