code stringlengths 1 25.8M | language stringclasses 18
values | source stringclasses 4
values | repo stringclasses 78
values | path stringlengths 0 268 |
|---|---|---|---|---|
# -*- coding: iso-8859-1 -*-
"""
Implementing the Field class
"""
import numpy as np
class Field:
"""
Classical physical field on cells or nodes. Owning current and future values in numpy.arrays
"""
def __init__(self, size, current_value=0., new_value=0.):
"""
:param size: size of arra... | 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.plugins.resources
import io.ktor.client.*
import io.ktor.client.plugins.*
import io.ktor.http.*
import io.ktor.resources.*
import io.ktor.util.*
import io.ktor.resource... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-plugins/ktor-client-resources/common/src/io/ktor/client/plugins/resources/Resources.kt |
# frozen_string_literal: true
module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module OID # :nodoc:
class Inet < Cidr # :nodoc:
def type
:inet
end
end
end
end
end
end | ruby | github | https://github.com/rails/rails | activerecord/lib/active_record/connection_adapters/postgresql/oid/inet.rb |
# -*- python -*-
# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
# 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 of the License, or
# (at your option) any later versi... | unknown | codeparrot/codeparrot-clean | ||
from django.test import TestCase
from .models import Person
class SaveDeleteHookTests(TestCase):
def test_basic(self):
p = Person(first_name="John", last_name="Smith")
self.assertEqual(p.data, [])
p.save()
self.assertEqual(
p.data,
[
"Before ... | python | github | https://github.com/django/django | tests/save_delete_hooks/tests.py |
#!/usr/bin/python
#####
# macro_safe.py
#####
#
# Takes Veil powershell batch file and outputs into a text document
# macro safe text for straight copy/paste.
#
import os, sys
import re
def formStr(varstr, instr):
holder = []
str1 = ''
str2 = ''
str1 = varstr + ' = "' + instr[:54] + '"'
for i in xrange(54, len(... | unknown | codeparrot/codeparrot-clean | ||
//===--- SwiftNameTranslation.h - Swift Name Translation --------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | c | github | https://github.com/apple/swift | include/swift/AST/SwiftNameTranslation.h |
#
# Copyright (c) 2010 Mikhail Gusarov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Copyright 2013 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.
"""Pushes native libraries to a device.
"""
import json
import optparse
import os
import sys
from util import build_utils
from uti... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import absolute_import
from typing import Any, Dict, List, Set, Tuple, TypeVar, Text, \
Union, Optional, Sequence, AbstractSet, Pattern, AnyStr
from typing.re import Match
from zerver.lib.str_utils import NonBinaryStr
from django.db import models
from django.db.models.query import QuerySet
from dja... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# mdflush Trace md flush events.
# For Linux, uses BCC, eBPF.
#
# Todo: add more details of the flush (latency, I/O count).
#
# Copyright 2016 Netflix, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 13-Feb-2015 Brend... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
from openerp.tools.translate import _
class mrp_config_settings(osv.osv_memory):
_name = 'mrp.config.settings'
_inherit = 'res.config.settings'
_columns = {
'grou... | unknown | codeparrot/codeparrot-clean | ||
//===--- FindTarget.h - What does an AST node refer to? ---------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c | github | https://github.com/llvm/llvm-project | clang-tools-extra/clangd/FindTarget.h |
#
# Migration test command line shell integration
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your opt... | unknown | codeparrot/codeparrot-clean | ||
#pragma once
#ifdef USE_VULKAN_API
#include <ATen/native/vulkan/ops/Common.h>
#include <ATen/native/vulkan/ops/VulkanPackedContext.h>
#include <torch/library.h>
namespace at {
namespace native {
namespace vulkan {
namespace ops {
class LayernormPackedContext final : virtual public VulkanPackedContext,
... | c | github | https://github.com/pytorch/pytorch | aten/src/ATen/native/vulkan/ops/Layernorm.h |
# 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 | ||
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Support for plugins."""
import os
import os.path
import sys
from coverage.misc import CoverageException, isolate_module
from coverage.plugin import CoveragePlu... | unknown | codeparrot/codeparrot-clean | ||
'''
Created on Oct 19, 2010
@author: Peter
'''
from numpy import *
def loadDataSet():
postingList=[['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'],
['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'],
['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org>
# Copyright: (c) 2017, Ansible Project
# 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_... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
"""
Copyright (C) 2007-2008 Matthew Perry
Copyright (C) 2008-2010 Borys Jurgiel
/***************************************************************************
* *
* This program is free software; you can redistribute it a... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/int... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | unknown | codeparrot/codeparrot-clean | ||
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | unknown | codeparrot/codeparrot-clean | ||
"""
The Ramer-Douglas-Peucker algorithm roughly ported from the pseudo-code provided
by http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm
"""
from math import sqrt
def distance(a, b):
return sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
def point_line_distance(point, start, end):
if (start == end... | unknown | codeparrot/codeparrot-clean | ||
"""Support for remote Python debugging.
Some ASCII art to describe the structure:
IN PYTHON SUBPROCESS # IN IDLE PROCESS
#
# oid='gui_adapter'
+----------+ # +------------+ ... | unknown | codeparrot/codeparrot-clean | ||
/* Copyright 2017 - 2025 R. Thomas
* Copyright 2017 - 2025 Quarkslab
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | cpp | github | https://github.com/nodejs/node | deps/LIEF/src/MachO/DyldExportsTrie.cpp |
import sys,getpass
import ldap
#l = ldap.open("localhost", 31001)
l = ldap.open("marta.it.uq.edu.au")
login_dn = "cn=root,ou=CSEE,o=UQ,c=AU"
login_pw = getpass.getpass("Password for %s: " % login_dn)
l.simple_bind_s(login_dn, login_pw)
#
# create a new sub organisation
#
try:
dn = "ou=CSEE,o=UQ,c=AU"
print ... | unknown | codeparrot/codeparrot-clean | ||
import os
import sh
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
from pythonforandroid.util import (current_directory, ensure_dir)
from pythonforandroid.logger import (info, shprint)
class ReportLabRecipe(CompiledComponentsPythonRecipe):
version = 'c088826211ca'
url = 'https://bitbucket.o... | unknown | codeparrot/codeparrot-clean | ||
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | java | github | https://github.com/spring-projects/spring-framework | spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractJCacheKeyOperation.java |
"""
Support for displaying the current CPU speed.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.cpuspeed/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CO... | unknown | codeparrot/codeparrot-clean | ||
class ZengineError(Exception):
""" pass """
pass
class SuspiciousOperation(ZengineError):
"""The user did something suspicious"""
pass
class SecurityInfringementAttempt(ZengineError):
"""Someone tried to do something nasty"""
pass
class PermissionDenied(ZengineError):
"""The user did not ... | unknown | codeparrot/codeparrot-clean | ||
""" Define the routes that show all the posts.
This includes:
- /feed
- /cluster
- /table
- /favorites
"""
import os
import json
from collections import namedtuple
from flask import request, render_template, redirect, Blueprint, current_app, make_response
from flask_login import login_required
from sqlalchemy ... | unknown | codeparrot/codeparrot-clean | ||
macro_rules! crate_root {
() => {
/// A facade around all the types we need from the `std`, `core`, and `alloc`
/// crates. This avoids elaborate import wrangling having to happen in every
/// module.
mod lib {
mod core {
#[cfg(not(feature = "std"))]
... | rust | github | https://github.com/serde-rs/serde | serde_core/src/crate_root.rs |
########################################################################
#
# This module contains classes for controlling and GUI representation of
# spectrometer Shamrok SR303i connected to camera iDUS DU401A-BV
#
########################################################################
from libs.gui.hardware_control ... | unknown | codeparrot/codeparrot-clean | ||
from ctypes import *
import unittest, sys
def callback_func(arg):
42 // arg
raise ValueError(arg)
@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
class call_function_TestCase(unittest.TestCase):
# _ctypes.call_function is deprecated and private, but used by
# Gary Bishp's readli... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
import random
import hmac, hashlib, time
from melee.core import json
def format_ok_response(data=None):
from flask import jsonify
return jsonify(meta={'code': 200, 'message': 'ok'}, data=data) if data is not None else jsonify(meta={'code': 200, 'message': 'ok'})
def format_str_respons... | unknown | codeparrot/codeparrot-clean | ||
import sys
import os
softletters=set(u"’яїюіьє")
startsyl=set(u"#'ьаяоїуюеєіи-")
others = set(["#", "+", "-", u"ь", u"ъ", u"’"])
softhard_cons = {
u"б" : u"b",
u"в" : u"v",
u"г" : u"g",
u"ґ" : u"g",
u"д" : u"d",
u"з" : u"z",
u"к" : u"k",
u"л" : u"l",
u"м" : u"m",
u"н" : u"n",
... | unknown | codeparrot/codeparrot-clean | ||
# coding=utf-8
# Copyright 2018 The Dopamine 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... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import os
from urlparse import parse_qs, urlparse
from django.conf import settings... | unknown | codeparrot/codeparrot-clean | ||
use futures::pin_mut;
use futures_test::task::noop_context;
use std::io::IoSlice;
use std::task::Poll;
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf};
use tokio_test::task::spawn;
use tokio_test::{assert_pending, assert_ready};
use tokio_util::io::simplex;
/// Sanity check for single-thre... | rust | github | https://github.com/tokio-rs/tokio | tokio-util/tests/io_simplex.rs |
/*
* 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/consumer/internals/StreamsRebalanceListenerInvokerTest.java |
#define USE_THE_REPOSITORY_VARIABLE
#define DISABLE_SIGN_COMPARE_WARNINGS
#include "builtin.h"
#include "abspath.h"
#include "config.h"
#include "dir.h"
#include "environment.h"
#include "gettext.h"
#include "object-file.h"
#include "object-name.h"
#include "parse-options.h"
#include "path.h"
#include "pathspec.h"
#in... | c | github | https://github.com/git/git | builtin/sparse-checkout.c |
/*
* Copyright 2014-2026 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.plugins.websocket
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.http.websocket.*
import io.ktor.util.*
import io.ktor.utils.io.*
import kotlin.io.e... | kotlin | github | https://github.com/ktorio/ktor | ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSocketContent.kt |
from django.urls import path, re_path
from django.views.debug import default_urlconf
from . import views
urlpatterns = [
path("noslash", views.empty_view),
path("slash/", views.empty_view),
path("needsquoting#/", views.empty_view),
# Accepts paths with two leading slashes.
re_path(r"^(.+)/security... | python | github | https://github.com/django/django | tests/middleware/urls.py |
# 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 | ||
# Copyright 2014-2015 Nathan West
#
# This file is part of autocommand.
#
# autocommand is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python3
from setuptools import setup
long_desc = '''autopwn is designed to make a pentester's life easier and more consistent by allowing them to specify tools they would like to run against targets, without having to type them in a shell or write a script. This tool will probably be useful during cert... | unknown | codeparrot/codeparrot-clean | ||
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Context, Lexer, Par... | unknown | codeparrot/codeparrot-clean | ||
# Copyright (c) 2013 Andreas Sandberg
# 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 fol... | unknown | codeparrot/codeparrot-clean | ||
import logging
logging.basicConfig(level=logging.DEBUG)
from plex_metadata import Guid
def test_tvdb_show():
guids = [
'com.plexapp.agents.thetvdb://12345?lang=en'
]
for item in guids:
r = Guid.parse(item)
assert r.agent == 'tvdb'
assert r.sid == '12345'
assert r... | unknown | codeparrot/codeparrot-clean | ||
try:
from urllib.parse import urlparse, urlunparse
except ImportError: # Python 2
from urlparse import urlparse, urlunparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.template.response import TemplateResp... | unknown | codeparrot/codeparrot-clean | ||
"""Functions for accessing docker via the docker cli."""
from __future__ import absolute_import, print_function
import json
import os
import time
from lib.executor import (
SubprocessError,
)
from lib.util import (
ApplicationError,
run_command,
common_environment,
display,
find_executable,
... | unknown | codeparrot/codeparrot-clean | ||
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
use Doctrine\ORM\Mapping as ORM... | php | github | https://github.com/symfony/symfony | src/Symfony/Bridge/Doctrine/Tests/Fixtures/DoctrineLoaderNestedEmbed.php |
# -*- coding: utf-8 -*-
#
# non_dale.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
# ... | unknown | codeparrot/codeparrot-clean | ||
/* Generated file to emulate the vfs namespace. */
export * from "../vfsUtil.js"; | typescript | github | https://github.com/microsoft/TypeScript | src/harness/_namespaces/vfs.ts |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | java | github | https://github.com/apache/kafka | clients/src/test/java/org/apache/kafka/common/network/PlaintextSender.java |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | unknown | codeparrot/codeparrot-clean | ||
# 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 | ||
"""
Spells (magic item effects) and targeting utility functions.
Could be folded into actions.py.
"""
# Copyright 2016 Thomas C. Hudson
# Governed by the license described in LICENSE.txt
import libtcodpy as libtcod
import log
from components import *
import actions
import ai
import interface
HEAL_AMOUNT = 40
LIGHTNI... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 of the Lic... | 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 (inclu... | sql | github | https://github.com/mysql/mysql-server | scripts/mysql_system_tables_data_fix.sql |
"""Sublime commands for configuring Cargo execution.
See `cargo_settings` for more details on how settings work.
"""
import getpass
import os
import re
import sublime
import sublime_plugin
from .cargo_settings import CargoSettings, CARGO_COMMANDS
from .util import index_with, get_cargo_metadata
from . import rust_pro... | unknown | codeparrot/codeparrot-clean | ||
import scrapy
from scrapy.crawler import AsyncCrawlerProcess
from scrapy.utils.reactor import (
install_reactor,
is_asyncio_reactor_installed,
is_reactor_installed,
)
if is_reactor_installed():
raise RuntimeError(
"Reactor already installed before is_asyncio_reactor_installed()."
)
try:
... | python | github | https://github.com/scrapy/scrapy | tests/AsyncCrawlerProcess/asyncio_enabled_reactor.py |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | cpp | github | https://github.com/llvm/llvm-project | clang-tools-extra/clang-tidy/readability/MathMissingParenthesesCheck.cpp |
from __future__ import absolute_import, division, print_function
from operator import getitem
from itertools import product
from toolz import merge, pipe, concat, partition, partial
from toolz.curried import map
from ..base import tokenize
from ..core import flatten
from ..utils import concrete
from .core import Arr... | unknown | codeparrot/codeparrot-clean | ||
from __future__ import unicode_literals
import datetime
from django.core import signing
from django.test import SimpleTestCase
from django.test.utils import freeze_time
from django.utils import six
from django.utils.encoding import force_str
class TestSigner(SimpleTestCase):
def test_signature(self):
"s... | unknown | codeparrot/codeparrot-clean | ||
//
// random_access_file.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_RAND... | unknown | github | https://github.com/mysql/mysql-server | extra/boost/boost_1_87_0/boost/asio/random_access_file.hpp |
"""
.. todo::
WRITEME
"""
__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 theano import tensor as T
from pylearn2.linear.linear_transf... | unknown | codeparrot/codeparrot-clean | ||
# (C) British Crown Copyright 2011 - 2012, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | unknown | codeparrot/codeparrot-clean | ||
# 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 later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | unknown | codeparrot/codeparrot-clean | ||
'''
xbmcswift2.request
------------------
This module contains the Request class. This class represents an incoming
request from XBMC.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
from xbmcswift2.common import unpickle_args
import urlparse
try:
... | unknown | codeparrot/codeparrot-clean | ||
import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_exec, h2o_glm, h2o_jobs
import h2o_print as h2p
SCIPY_INSTALLED = True
try:
import scipy as sp
import numpy as np
import sklearn as sk
import statsmodels as sm
import statsmodels.... | unknown | codeparrot/codeparrot-clean | ||
"""Factor Analysis.
A latent linear variable model.
FactorAnalysis is similar to probabilistic PCA implemented by PCA.score
While PCA assumes Gaussian noise with the same variance for each
feature, the FactorAnalysis model assumes different variances for
each of them.
This implementation is based on David Barber's B... | python | github | https://github.com/scikit-learn/scikit-learn | sklearn/decomposition/_factor_analysis.py |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 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 REST interface
#
from test_framework.test_framework import BitcoinTestFramework
from test_frame... | unknown | codeparrot/codeparrot-clean | ||
"""
An updated CRYSTAL logs parser
wrapping a standalone parser called pycrystal
Authors: Evgeny Blokhin and Andrey Sobolev
"""
import os.path
from pycrystal import CRYSTOUT as _CRYSTOUT, CRYSTOUT_Error
from tilde.parsers import Output
class CRYSTOUT(Output):
def __init__(self, filename):
Output.__init__(... | unknown | codeparrot/codeparrot-clean | ||
import sys
from os.path import dirname, join
import pygame
from rx import operators as ops
from rx.subject import Subject
from rx.scheduler.mainloop import PyGameScheduler
#FORMAT = '%(asctime)-15s %(threadName)s %(message)s'
#logging.basicConfig(format=FORMAT, level=logging.DEBUG)
#log = logging.getLogger('Rx')
de... | 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/api_fastapi/auth/managers/simple/ui/src/login/LoginForm.tsx |
from .main import FTDWorld
def start():
return FTDWorld()
config = [{
'name': 'ftdworld',
'groups': [
{
'tab': 'searcher',
'subtab': 'providers',
'list': 'nzb_providers',
'name': 'FTDWorld',
'description': 'Free provider, less accurate. S... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-15 08:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
# This flag is used to mark that a migration shouldn't be automatically run in
# production. We set this to True for... | unknown | codeparrot/codeparrot-clean | ||
- name: Test max recursion depth
hosts: testhost
tasks:
- import_role:
name: role1
tasks_from: r1t01.yml | unknown | github | https://github.com/ansible/ansible | test/integration/targets/include_import/test_role_recursion.yml |
# -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import collections
import datetime
from io import BytesIO, UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict
from .auth import HTTPBasicAuth
... | unknown | codeparrot/codeparrot-clean | ||
""" Test Iterator Length Transparency
Some functions or methods which accept general iterable arguments have
optional, more efficient code paths if they know how many items to expect.
For instance, map(func, iterable), will pre-allocate the exact amount of
space required whenever the iterable can report its length.
T... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2012 OpenStack Foundation
# 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 requ... | unknown | codeparrot/codeparrot-clean | ||
#!/usr/bin/env python
version = "1.3.4.1"
###############################################################################
#
# 17 Jun 2013
#
# A commandline script to configure the FK firewall. Can be used to set up and
# tear down the default rules, and add rules allowing traffic to a specific IP.
#
##################... | unknown | codeparrot/codeparrot-clean | ||
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | java | github | https://github.com/apache/hadoop | hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystemLinkResolver.java |
import random
import pytest
from easy_cache_async import ecached
from easy_cache_async.core import DEFAULT_TIMEOUT, MetaCallable, create_cache_key
from .fixtures import (
AsyncUser,
User,
__name__ as __test_name__,
custom_cache_key,
)
from .tools import BaseTest, CacheMock
cache_mock = CacheMock()
... | unknown | codeparrot/codeparrot-clean | ||
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
# !! This is the configuration of Nikola. !!#
# !! You should edit it to your liking. !!#
# ! Some settings can be different in different languages.
# ! A comment stating (translatable) is used to denote those.
# ! There are two ways to sp... | unknown | codeparrot/codeparrot-clean | ||
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | c | github | https://github.com/curl/curl | src/tool_listhelp.c |
from __future__ import nested_scopes
from __future__ import division
import unittest
x = 2
def nester():
x = 3
def inner():
return x
return inner()
class TestFuture(unittest.TestCase):
def test_floor_div_operator(self):
self.assertEqual(7 // 2, 3)
def test_true_div_as_default(se... | python | github | https://github.com/python/cpython | Lib/test/test_future_stmt/test_future_single_import.py |
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import copy
from test.helper import FakeYDL, assertRegexpMatches
from youtube_dl import YoutubeDL
from youtube_d... | unknown | codeparrot/codeparrot-clean | ||
import re, commands, logging, os
from autotest.client.shared import error, utils
from autotest.client.virt import base_installer
def run_module_probe(test, params, env):
"""
load/unload kernel modules several times.
The test can run in two modes:
- based on previous 'build' test: in case kernel modul... | unknown | codeparrot/codeparrot-clean | ||
from io import StringIO
import logging
from ..log import (
Loggable,
setup_logger,
)
class SampleLoggable(Loggable):
name = "loggable"
class TestSetupLogger:
def test_setup_with_name(self, caplog):
"""If a name is specified for the logger, it is set up."""
with caplog.at_level(loggin... | unknown | codeparrot/codeparrot-clean | ||
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ContainerType, Descriptor, NestedProp, PropType} from '../../../../protocol';
import {isSignal, safelyReadS... | typescript | github | https://github.com/angular/angular | devtools/projects/ng-devtools-backend/src/lib/state-serializer/serialized-descriptor-factory.ts |
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... | unknown | codeparrot/codeparrot-clean | ||
import numpy as np
import numpy.testing as npt
try:
import unittest.mock as mock # py3
except ImportError:
import mock
import unittest
import pymc3
from pymc3 import sampling
from pymc3.sampling import sample
from .models import simple_init
# Test if multiprocessing is available
import multiprocessing
try:
... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | unknown | codeparrot/codeparrot-clean | ||
# Copyright 2024 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/integrations/liger.py |
# Non-dependencies that pandas utilizes or has compatibility with pandas objects
name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.13
# build dependencies
- versioneer
- cython<4.0.0a0
- meson=1.10.0
- meson-python=0.18.0
# test dependencies
- pytest>=8.3.4
- pytest-cov
- pytest-... | unknown | github | https://github.com/pandas-dev/pandas | ci/deps/actions-313-downstream_compat.yaml |
# (c) The James Hutton Institute 2013
# Author: Leighton Pritchard
#
# Contact:
# leighton.pritchard@hutton.ac.uk
#
# Leighton Pritchard,
# Information and Computing Sciences,
# James Hutton Institute,
# Errol Road,
# Invergowrie,
# Dundee,
# DD6 9LH,
# Scotland,
# UK
#
# The MIT License
#
# Copyright (c) 2010-2014 The... | unknown | codeparrot/codeparrot-clean |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.