code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
# Copyright (C) 2010 Google 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 la... | Acimaz/Google_Apple_Financial_Reporter | lib/third_party/apiclient/oauth.py | Python | mit | 14,260 |
#!/usr/bin/python
#
# Copyright (C) 2013-2017 Free Software Foundation, Inc.
#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# This s... | mickael-guene/gcc | contrib/update-copyright.py | Python | gpl-2.0 | 26,824 |
from django.test import TestCase
from misago.markup import checksums
class ChecksumsTests(TestCase):
def test_checksums(self):
fake_message = "<p>Woow, thats awesome!</p>"
post_pk = 231
checksum = checksums.make_checksum(fake_message, [post_pk])
self.assertTrue(
chec... | 390910131/Misago | misago/markup/tests/test_checksums.py | Python | gpl-2.0 | 476 |
import sys
if hasattr(sys, 'gettotalrefcount'):
from _sysconfigdata_d import *
else:
from _sysconfigdata_nd import *
| gautamMalu/rootfs_xen_arndale | usr/lib/python2.7/_sysconfigdata.py | Python | gpl-2.0 | 126 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pootle_language', '0002_case_insensitive_schema'),
('pootle_project', '0010_add_reserved_code_validator'),
('virtualfolder', ... | ta2-1/pootle | pootle/apps/virtualfolder/migrations/0011_add_projects_languages.py | Python | gpl-3.0 | 831 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | adityacs/ansible | lib/ansible/modules/cloud/ovirt/ovirt_nics.py | Python | gpl-3.0 | 7,984 |
#! /usr/bin/env python
import os
import sys
import multiprocessing as mp
import subprocess
import csv
import datetime
from contextlib import contextmanager
# define a field list for csv writing output
F_LIST = [
'__job__activity',
'job_num',
'job_tot',
'duration_sec',
'duration_min',
'pid',
... | micahhausler/pandashells | pandashells/lib/parallel_lib.py | Python | bsd-2-clause | 4,747 |
# -*- coding: utf-8 -*-
import os
import hashlib
from datetime import datetime
from flask import Blueprint, render_template, current_app, request, flash
from flask.ext.login import login_required, current_user
from ..extensions import db
from ..user import User
from ..utils import allowed_file, make_dir
from .forms... | wandonye/vshare | vshare/settings/views.py | Python | bsd-3-clause | 2,765 |
""" Load and save pickles """
import pickle
def save_pickle(fname, dix):
"""Save `dix` to `fname` as pickle.
Parameters
------------
fname : str
filename to save object e.g. a dictionary
dix : str
dictionary or other object
Examples
----------
>>> import os
>>> from... | FrancoisRheaultUS/dipy | dipy/io/pickles.py | Python | bsd-3-clause | 1,239 |
"""
Sane parameters for stats.distributions.
"""
distcont = [
['alpha', (3.5704770516650459,)],
['anglit', ()],
['arcsine', ()],
['beta', (2.3098496451481823, 0.62687954300963677)],
['betaprime', (5, 6)],
['bradford', (0.29891359763170633,)],
['burr', (10.5, 4.3)],
['burr12', (10, 4)],
... | chatcannon/scipy | scipy/stats/_distr_params.py | Python | bsd-3-clause | 4,313 |
from featuredetection import SphericalCoordinateGeneration
from landmarkscompare import LandmarksCompare
from generateaveragelmkfile import GenerateAverageLmkFile
| grlee77/nipype | nipype/interfaces/semtools/testing/__init__.py | Python | bsd-3-clause | 163 |
##########################################################################
#
# Copyright (c) 2019, 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:
#
# * Redistrib... | hradec/gaffer | python/GafferArnoldTest/ArnoldLightFilterTest.py | Python | bsd-3-clause | 6,503 |
# -*- coding: utf-8 -*-
import sys
import time
if '__pypy__' not in sys.builtin_module_names:
# pypy's gc really is different
from boltons.gcutils import get_all, toggle_gc_postcollect
def test_get_all():
class TestType(object):
pass
tt = TestType()
assert len(get_... | neuropil/boltons | tests/test_gcutils.py | Python | bsd-3-clause | 765 |
# -*- coding: utf-8 -*-
import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'ubuntutw' #Set the family name; this should be the same as in the filename.
self.langs = {
'zh': None,
}
self.namespaces[-2] = {... | hasteur/UAABOT | families/ubuntutw_family.py | Python | gpl-3.0 | 1,780 |
# 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/.
from selenium.webdriver.common.by import By
from pages.contribute.base import ContributeBasePage
class TwitterTaskPag... | glogiotatidis/bedrock | tests/pages/contribute/task/twitter.py | Python | mpl-2.0 | 807 |
from __future__ import unicode_literals
import json
import random
import re
import time
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_filesize,
unescapeHTML,
update_url_que... | fluxw42/youtube-dl | youtube_dl/extractor/bandcamp.py | Python | unlicense | 8,756 |
"""Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
del bz2
_... | 2014c2g9/c2g9 | wsgi/static/reeborg/src/libraries/brython/Lib/shutil.py | Python | gpl-2.0 | 39,100 |
## @file
# Routines for generating AutoGen.h and AutoGen.c
#
# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of... | carmark/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/AutoGen/GenC.py | Python | gpl-2.0 | 82,332 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | ntt-sic/nova | nova/virt/powervm/lpar.py | Python | apache-2.0 | 5,106 |
# -*- coding: utf-8 -*-
#
# test_quantal_stp_synapse.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 th... | hesam-setareh/nest-simulator | pynest/nest/tests/test_quantal_stp_synapse.py | Python | gpl-2.0 | 4,049 |
def func():
value = "not-none"
# Is none
# If it's none
<caret>if value is None:
print("None")
# Is not none
# If it's not none
else:
print("Not none") | smmribeiro/intellij-community | python/testData/intentions/PyInvertIfConditionIntentionTest/commentsMultilineBoth.py | Python | apache-2.0 | 196 |
my_expr = 42
s = 'foo{my_e<caret>'.format(my_expr='spam') | siosio/intellij-community | python/testData/completion/fStringLikeCompletionNotAvailableInStrFormatCalls.py | Python | apache-2.0 | 57 |
import pytest
import numpy as np
from numpy.testing import assert_allclose
import scipy.special as sc
class TestExp1(object):
def test_branch_cut(self):
assert np.isnan(sc.exp1(-1))
assert sc.exp1(complex(-1, 0)).imag == (
-sc.exp1(complex(-1, -0.0)).imag
)
assert_al... | pizzathief/scipy | scipy/special/tests/test_exponential_integrals.py | Python | bsd-3-clause | 1,892 |
def app(req):
print(req)
ret = {"status": 200,
"headers": {"content_type": "text/html", "foo":['bar0','bar1','bar2']},
"body": "<h1>Hello!</h1>"}
print(ret)
return ret
| jyotikamboj/container | uw-tests/pump.py | Python | mit | 196 |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.stanza import Message, Presence
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins i... | danielvdao/facebookMacBot | venv/lib/python2.7/site-packages/sleekxmpp/plugins/xep_0091/legacy_delay.py | Python | mit | 739 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
__author__ = 'Kxrr'
from PIL import Image,ImageDraw,ImageFont
import random
msgNum = str(random.randint(1,99))
# Read image
im = Image.open('kxrr.png')
w,h = im.size
wDraw = 0.8 * w
hDraw = 0.08 * w
# Draw image
font = ImageFont.truetype('/usr/share/fonts/truetype/droid/... | DanielShangHai/python | Kxrr/0000/0000.py | Python | mit | 536 |
from model import *
from draw import *
# ------------- helpers --------------
# some on-policy data generation
def full_output_to_trace(full_out, Img, S):
obs = [x[0] for x in full_out[1:]]
return Trace(Img, S, obs)
# start the training process some arguments
restart = True
impnet = Implynet("imp")
invnet = Invne... | evanthebouncy/nnhmm | uai_sushi/script_train_invert.py | Python | mit | 2,203 |
#
# This file is part of the LibreOffice project.
#
# 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/.
#
# This file incorporates work covered by the following license noti... | sbbic/core | wizards/com/sun/star/wizards/common/ConfigSet.py | Python | gpl-3.0 | 2,731 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
# Nicolas Dupeux, nicolas.dupeux@arkea.com
#
# This file is part of Shinke... | dfranco/shinken | shinken/clients/LSB.py | Python | agpl-3.0 | 5,436 |
# 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... | tornadozou/tensorflow | tensorflow/python/keras/_impl/keras/models_test.py | Python | apache-2.0 | 13,935 |
# Copyright 2011 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 req... | yuewko/neutron | neutron/db/sqlalchemyutils.py | Python | apache-2.0 | 4,470 |
# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | endlessm/chromium-browser | third_party/webrtc/sdk/android/PRESUBMIT.py | Python | bsd-3-clause | 1,285 |
import asyncio
import asyncpg
import os
import jinja2
import orjson
from logging import getLogger
from random import randint
from operator import itemgetter
from apidaora.asgi.app import asgi_app
from apidaora.asgi.responses import (
JSON_RESPONSE, HTML_RESPONSE, PLAINTEXT_RESPONSE
)
from apidaora.asgi.router impor... | sumeetchhetri/FrameworkBenchmarks | frameworks/Python/apidaora/coreapp.py | Python | bsd-3-clause | 4,203 |
import base64
from datetime import timedelta
import os
import shutil
import string
import tempfile
import unittest
import warnings
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSes... | helenst/django | django/contrib/sessions/tests.py | Python | bsd-3-clause | 24,051 |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | xkollar/spacewalk | backend/server/action_extra_data/errata.py | Python | gpl-2.0 | 970 |
# orm/__init__.py
# Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Functional constructs for ORM configuration.
See the SQLAlchemy object relational... | intelie/pycollector | src/third/sqlalchemy/orm/__init__.py | Python | bsd-3-clause | 66,938 |
"""
github3.repos
=============
This module contains the classes relating to repositories.
See also: http://developer.github.com/v3/repos/
"""
from .repo import Repository
__all__ = [Repository]
| liresearchgroup/submtr | submtr/lib/github3/repos/__init__.py | Python | mit | 199 |
#!/usr/bin/env python
# File created on 09 Feb 2013
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
impor... | ssorgatem/qiime | tests/test_workflow/test_core_diversity_analyses.py | Python | gpl-2.0 | 9,588 |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for ``flocker.cli._sshconfig``.
"""
from os.path import expanduser
from socket import socket
from subprocess import CalledProcessError
from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath, Permissions
from twis... | jml/flocker | flocker/cli/functional/test_sshconfig.py | Python | apache-2.0 | 9,942 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Blogs',
'category': 'Website',
'sequence': 140,
'website': 'https://www.odoo.com/page/blog-engine',
'summary': 'News, Blogs, Announces, Discussions',
'version': '1.0',
'description'... | Aravinthu/odoo | addons/website_blog/__manifest__.py | Python | agpl-3.0 | 789 |
from tapiriik.services.rollback import RollbackTask
from django.http import HttpResponse
from django.views.decorators.http import require_GET
from django.shortcuts import redirect, render
def account_rollback_initiate(req):
if not req.user:
return HttpResponse(status=403)
task = RollbackTask.Create(re... | mduggan/tapiriik | tapiriik/web/views/rollback.py | Python | apache-2.0 | 776 |
"""DigitalOcean plugin for integration tests."""
from __future__ import annotations
import configparser
from ....util import (
display,
)
from ....config import (
IntegrationConfig,
)
from . import (
CloudEnvironment,
CloudEnvironmentConfig,
CloudProvider,
)
class DigitalOceanCloudProvider(Clo... | privateip/ansible | test/lib/ansible_test/_internal/commands/integration/cloud/digitalocean.py | Python | gpl-3.0 | 1,529 |
#!/usr/bin/python -tt
# An incredibly simple agent. All we do is find the closest enemy tank, drive
# towards it, and shoot. Note that if friendly fire is allowed, you will very
# often kill your own tanks with this code.
#################################################################
# NOTE TO STUDENTS
# This is... | dnorth/BZRFlag | src/test_agent.py | Python | gpl-3.0 | 3,850 |
#!/usr/bin/env python
# $Id: rst2odt.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
A front end to the Docutils Publisher, producing OpenOffice documents.
"""
import sys
try:
import locale
locale.setlocale(... | sudheesh001/oh-mainline | vendor/packages/docutils/tools/rst2odt.py | Python | agpl-3.0 | 767 |
"""SCons.Defaults
Builders and other things for the local site. Here's where we'll
duplicate the functionality of autoconf until we move it into the
installation procedure or use something like qmconf.
The code that reads the registry to find MSVC components was borrowed
from distutils.msvccompiler.
"""
#
# Copyri... | BenLand100/rat-pac | python/SCons/Defaults.py | Python | bsd-3-clause | 16,745 |
#!/usr/bin/env python3
import sys
from testrunner import run
def testfunc(child):
# The default image of the test application contains a 7 (e.g. it's the
# first image in the MNIST test dataset)
child.expect_exact("Digit prediction: 7")
if __name__ == "__main__":
sys.exit(run(testfunc))
| jia200x/RIOT | tests/pkg_tensorflow-lite/tests/01-run.py | Python | lgpl-2.1 | 309 |
# (c) 2016 Dag Wieers <dag@wieers.com>
# (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__ = type
DOCUMENTATION = """
lookup: filetree
author: Dag Wieers (@dagwieers) <da... | Jorge-Rodriguez/ansible | lib/ansible/plugins/lookup/filetree.py | Python | gpl-3.0 | 5,862 |
# 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 License, or
# (at your option) any later version.
#
# This program is distributed in the... | simonwydooghe/ansible | test/units/modules/network/fortios/test_fortios_system_password_policy_guest_admin.py | Python | gpl-3.0 | 8,660 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | bjolivot/ansible | lib/ansible/modules/network/nxos/nxos_rollback.py | Python | gpl-3.0 | 5,721 |
# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | nikesh-mahalka/nova | nova/tests/unit/objects/test_image_meta.py | Python | apache-2.0 | 11,225 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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... | mrquim/mrquimrepo | service.xbmc.versioncheck/service.py | Python | gpl-2.0 | 4,122 |
from unittest import TestCase
from django.template import Context, Template
from django.template.base import VariableNode
from django.test import override_settings
class NodelistTest(TestCase):
def test_for(self):
template = Template('{% for i in 1 %}{{ a }}{% endfor %}')
vars = template.nodelis... | pquentin/django | tests/template_tests/test_nodelist.py | Python | bsd-3-clause | 2,326 |
#!/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.
"""code generator for GL/GLES extension wrangler."""
import optparse
import os
import collections
import re
import sys
GL_FUNCTIO... | Philippe12/external_chromium_org | ui/gl/generate_bindings.py | Python | bsd-3-clause | 68,888 |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | xtopsoft/grpc | src/python/src/grpc/framework/foundation/relay.py | Python | bsd-3-clause | 5,651 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | Akasurde/ansible | lib/ansible/module_utils/json_utils.py | Python | gpl-3.0 | 3,423 |
"""Delegate test execution to another environment."""
from __future__ import absolute_import, print_function
import os
import re
import sys
import tempfile
import lib.pytar
import lib.thread
from lib.executor import (
SUPPORTED_PYTHON_VERSIONS,
IntegrationConfig,
ShellConfig,
SanityConfig,
Units... | andreaso/ansible | test/runner/lib/delegation.py | Python | gpl-3.0 | 11,372 |
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys;
import cPickle;
import types;
import string;
import re;
sys.path.append( "../opengl_stub" )
import stub_common;
parsed_file = open( "../glapi_parser/gl_header.pa... | alown/chromium | unpacker/unpack_header.py | Python | bsd-3-clause | 716 |
from __future__ import division, print_function, absolute_import
import warnings
from . import _zeros
from numpy import finfo, sign, sqrt
_iter = 100
_xtol = 2e-12
_rtol = 4*finfo(float).eps
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth']
CONVERGED = 'converged'
SIGNERR = 'sign error'
CONVERR = 'conve... | asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/scipy/optimize/zeros.py | Python | mit | 19,902 |
'''
This module provides support for defining several options on your Elixir
entities. There are three different kinds of options that can be set
up, and for this there are three different statements: using_options_,
using_table_options_ and using_mapper_options_.
Alternatively, these options can be set on all Elixir... | coolbombom/CouchPotatoServer | libs/elixir/options.py | Python | gpl-3.0 | 14,462 |
# this is a virtual module that is entirely implemented server side
# 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 op... | andreaso/ansible | lib/ansible/modules/files/fetch.py | Python | gpl-3.0 | 4,058 |
# ext/associationproxy.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... | wildchildyn/autism-website | yanni_env/lib/python3.6/site-packages/sqlalchemy/ext/associationproxy.py | Python | gpl-3.0 | 33,423 |
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | ROGUE-JCTD/geonode | geonode/maps/management/__init__.py | Python | gpl-3.0 | 2,334 |
class A:
def foo(self):
pa<caret>ss | asedunov/intellij-community | python/testData/breadcrumbs/method.py | Python | apache-2.0 | 47 |
from ctypes import c_char_p, c_float, c_int, string_at, Structure, POINTER
from django.contrib.gis.geoip.libgeoip import lgeoip, free
#### GeoIP C Structure definitions ####
class GeoIPRecord(Structure):
_fields_ = [('country_code', c_char_p),
('country_code3', c_char_p),
('country... | edisonlz/fruit | web_project/base/site-packages/django/contrib/gis/geoip/prototypes.py | Python | apache-2.0 | 3,887 |
from __future__ import absolute_import
from datetime import datetime
from django.test import TestCase
from .models import Article
class DefaultTests(TestCase):
def test_field_defaults(self):
a = Article()
now = datetime.now()
a.save()
self.assertTrue(isinstance(a.id, (int, long... | LethusTI/supportcenter | vendor/django/tests/modeltests/field_defaults/tests.py | Python | gpl-3.0 | 437 |
#!/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... | andreaso/ansible | lib/ansible/modules/cloud/amazon/elasticache_subnet_group.py | Python | gpl-3.0 | 5,238 |
import re
def flatten_result(result):
return re.sub(r'[\s\r\n]+', ' ', result).strip()
def result_lines(result):
return [x.strip() for x in re.split(r'\r?\n', re.sub(r' +', ' ', result)) if x.strip() != ''] | kindy61/mako | test/util.py | Python | mit | 216 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, Marc-Aurèle Brothier @marcaurele
# (c) 2017, René Moser <mail@renemoser.net>
#
# 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 Soft... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/cloudstack/cs_instance_nic.py | Python | bsd-3-clause | 8,254 |
import copy
import sys
from django.core.management.validation import get_validation_errors
from django.db.models.loading import cache, load_app
from django.test.utils import override_settings
from django.utils import unittest
from django.utils.six import StringIO
class InvalidModelTestCase(unittest.TestCase):
"... | waseem18/oh-mainline | vendor/packages/Django/tests/modeltests/invalid_models/tests.py | Python | agpl-3.0 | 2,378 |
"""
An auto-completion window for IDLE, used by the AutoComplete extension
"""
from Tkinter import *
from MultiCall import MC_SHIFT
import AutoComplete
HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>")
KEYPRESS_VIRTUAL_EVENT_NAME = "<<autocompletewindow-keypress>>... | leighpauls/k2cro4 | third_party/python_26/Lib/idlelib/AutoCompleteWindow.py | Python | bsd-3-clause | 17,282 |
# -*- 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... | jeffery9/mixprint_addons | project/wizard/__init__.py | Python | agpl-3.0 | 1,107 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/keras/api/keras/datasets/mnist/__init__.py | Python | bsd-2-clause | 983 |
"""Module with functions operating on IndexedBase, Indexed and Idx objects
- Check shape conformance
- Determine indices in resulting expression
etc.
Methods in this module could be implemented by calling methods on Expr
objects instead. When things stabilize this could be a useful
refactori... | kaichogami/sympy | sympy/tensor/index_methods.py | Python | bsd-3-clause | 15,106 |
# 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, software
# distributed under the... | cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/pbr/tests/__init__.py | Python | gpl-3.0 | 985 |
# 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.
# This file helps gyp_chromium and landmines correctly set up the gyp
# environment from chromium.gyp_env on disk
import os
SCRIPT_DIR = os.path.dirnam... | Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/build/gyp_helper.py | Python | mit | 2,220 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | BorgERP/borg-erp-6of3 | server/openerp/exceptions.py | Python | agpl-3.0 | 2,138 |
#!/usr/bin/python
#
# Copyright (C) 2007 Google 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 ... | cristiana214/cristianachavez214-cristianachavez | python/gdata/tests/gdata_tests/spreadsheet/service_test.py | Python | apache-2.0 | 7,761 |
#!/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... | garyjyao1/ansible | lib/ansible/modules/core/cloud/rackspace/rax_cbs_attachments.py | Python | gpl-3.0 | 6,622 |
import warnings
from django import template
from ..readers import get_asset_path
register = template.Library()
@register.simple_tag
def asset(logical_path):
"""
Usage:
<script src="{% asset "logical_path" %}"></script>
:param logical_path:
:return: an asset path
"""
asset = get_ass... | opbeat/django-assets-bundles | django_asset_bundles/templatetags/assets_url.py | Python | isc | 898 |
import redis
class DataStore(object):
def __init__(self, *args, **kwargs):
pass
class RedisDataStore(DataStore):
def __init__(self, *args, **kwargs):
self.store = redis.Redis(kwargs['redis_host'], kwargs['redis_port'])
super(RedisDataStore, self).__init__(*args, **kwargs)
def g... | marcoslhc/xyvio | xyvio/datastore.py | Python | isc | 830 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from .base import RedisTestCase
from redis_collections import List
class ListTest(RedisTestCase):
def create_list(self, *args, **kwargs):
kwargs['redis'] = self.redis
return List(*args, **kwargs)
def test_init(self):
l ... | burakbostancioglu/redis-collections | tests/test_lists.py | Python | isc | 4,551 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | linusg/rpi-backlight | docs/conf.py | Python | mit | 2,184 |
# encoding=utf-8
# vim: fenc=utf-8 et sw=4 ts=4 sts=4 ai
from .byte import ByteRule
from .bytebonus import ByteBonusRule
from .contrib import ContribRule
from .external_link import ExternalLinkRule
from .image import ImageRule
from .new import NewPageRule
from .qualified import QualiRule
from .redirect import RedirectR... | danmichaelo/UKBot | ukbot/rules/__init__.py | Python | mit | 821 |
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
@login_required
def dashboard(request):
return render(request, 'gontend/gontend.html')
| akx/gentry | gontend/views.py | Python | mit | 187 |
rhost="127.0.0.1"
rport=443
import socket,os
s=socket.socket()
s.connect((rhost ,rport))
s.send('''
###########################
# Backdoor #
# Arduino device #
###########################''')
while 1:
data = s.recv(512)
if "q" == data.l... | bluewitch/Code-Blue-Python | rshell.py | Python | mit | 732 |
from numbers import Real
from xml.etree import ElementTree as ET
import openmc.checkvalue as cv
from openmc.stats.multivariate import UnitSphere, Spatial
from openmc.stats.univariate import Univariate
from ._xml import get_text
class Source:
"""Distribution of phase space coordinates for source sites.
Param... | liangjg/openmc | openmc/source.py | Python | mit | 6,489 |
#!/usr/bin/env python3
from collections import defaultdict
from pysblgnt import morphgnt_rows
from morphgnt_utils import bcv_tuple, convert_parse
BOOK_NUM = 4
VERBS = defaultdict(lambda: defaultdict(set))
for row in morphgnt_rows(BOOK_NUM):
b, c, v = bcv_tuple(row["bcv"])
if c == 2 and v <= 11:
... | jtauber/greek-inflexion | make_morphgnt_test.py | Python | mit | 688 |
import sublime, sublime_plugin
import os, re
import threading
import json
from .Libraries import Libraries
try:
from urllib.request import urlopen, Request
except ImportError:
from urllib2 import urlopen, URLError
def downloadLib(folder, lib):
settings = sublime.load_settings("AddLibrary.sublime-settings")
defa... | caiofsouza/AddLibrary | AddLibrary.py | Python | mit | 8,436 |
# -*- coding: utf-8 -*-
from twisted.plugin import IPlugin
from pymoronbot.moduleinterface import IModule
from pymoronbot.modules.commandinterface import BotCommand
from zope.interface import implementer
from pymoronbot.message import IRCMessage
from pymoronbot.response import IRCResponse, ResponseType
tang = {'A': '... | MatthewCox/PyMoronBot | pymoronbot/modules/commands/Tango.py | Python | mit | 1,775 |
import mysql.connector
import csv
# Make RDS table and add rows from CSV file
cnx = mysql.connector.connect(user='galleryhop', password='galleryhop', host='galleryhop2.crflf9mu2uwj.us-east-1.rds.amazonaws.com',database='galleryhop2')
cursor = cnx.cursor()
t = """CREATE TABLE galleries_formatted_4(
shows VARCHAR(50)... | mdiscenza/gallery_hop_2 | make_table.py | Python | mit | 825 |
from celery.backends import get_backend_by_url
from celery.backends.cache import CacheBackend
from celery.backends.redis import RedisBackend
from .base import BaseCache, WrappedCache
CACHES = []
try:
from django.core.cache import InvalidCacheBackendError
CACHES.append('Django')
# Now we know we have a Djan... | PolicyStat/jobtastic | jobtastic/cache/__init__.py | Python | mit | 2,369 |
import aedsdk
import time
import random
class Mickey(aedsdk.Paradigm):
def __init__(self):
aedsdk.Paradigm.__init__(self)
class LeverPress(aedsdk.Action):
def __init__(self):
pass
def detect(self):
if random.randint(1,1e4)==3:
return True
else:
return False
class Reward(aedsdk.Event)... | algobunny/aed | paradigms/Mickey.py | Python | mit | 2,790 |
# -*- coding: utf-8 -*-
#
# svviz documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 23 15:31:35 2015.
#
# 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... | svviz/svviz | docs/conf.py | Python | mit | 8,170 |
from bs4 import BeautifulSoup
import csv
import feedparser
import json
import os
import re
import urllib
from django.core.management.base import BaseCommand
from colourlens.models import Artwork
from optparse import make_option
import io
def itunes_rss_color(rss_url):
print rss_url
d = feedparser.parse(rss_u... | torchbox/colourlens | colourlens/management/commands/imagecolour.py | Python | mit | 13,075 |
from __future__ import unicode_literals
import logging
from api.errors import InvalidTokenError, AuthenticationException
from config import TRANSPORT_ID, IDENTIFIER
from friends import get_friend_jid
from api.vkapi import Api
import database
from cystanza.stanza import SubscribePresence, AvailablePresence, Unavailable... | cydev/cyvk | user.py | Python | mit | 5,566 |
import json
import pytest
from pycards import CreditCard
from datetime import datetime
from pycards.settings import FIXTURES_PATH
@pytest.fixture(scope="session")
def data():
with open(FIXTURES_PATH) as data_file:
return json.load(data_file)['HIPERCARD']
def test_init(data):
assert len(data) > 0
... | MrLucasCardoso/pycards | tests/tets_hipercard.py | Python | mit | 2,461 |
"""Module containing kernel related classes"""
from __future__ import division
from builtins import str
from past.utils import old_div
from builtins import object
from future.utils import with_metaclass
__author__ = 'wittawat'
from abc import ABCMeta, abstractmethod
import autograd
import autograd.numpy as np
#impor... | wittawatj/kernel-gof | kgof/kernel.py | Python | mit | 22,155 |
import sys
from twisted.internet import defer, reactor, error
from twisted.python.failure import Failure
from twisted.python.filepath import FilePath
from twisted.conch.endpoints import SSHCommandClientEndpoint, _CommandChannel
from twisted.internet.protocol import Factory, Protocol
from blinker import signal
from p... | dustinlacewell/plait | plait/worker.py | Python | mit | 6,779 |
# coding: utf-8
import codecs
import logging
import pickle
import re
from math import fsum, sqrt
from flection import basic_form
from gensim import corpora, models
__author__ = "Michał Ciołczyk"
_TEXT_SEPARATOR = re.compile('\n#[0-9]{6}\n')
_NOT_LETTERS = re.compile('[^a-ząćęłóńśżź]+')
_SPACES = re.compile('\s+')
_S... | salceson/PJN | lab8/utils.py | Python | mit | 3,895 |
"""
Small app demonstrating a dynamic UI
Author: ZenCODE
Date: 22/10/2013
"""
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.factory import Factory
class DataSource(object):
"""
This class would be an abstraction of your data source:
the MySQLdb... | Zen-CODE/kivybits | Examples/DynamicUI/main.py | Python | mit | 3,087 |