repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
BMJHayward/django | django/utils/translation/trans_null.py | 467 | 1408 | # These are versions of the functions in django.utils.translation.trans_real
# that don't actually do anything. This is purely for performance, so that
# settings.USE_I18N = False can use this module rather than trans_real.py.
from django.conf import settings
from django.utils.encoding import force_text
def ngettext... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/boto-2.46.1/boto/services/result.py | 153 | 5596 | #!/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... | apache-2.0 |
ArianaGashi/Techstitution | venv/lib/python2.7/site-packages/jinja2/debug.py | 335 | 11553 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | cc0-1.0 |
Wuteyan/VTK | Examples/Modelling/Python/constrainedDelaunay.py | 15 | 4503 | #!/usr/bin/env python
# This example demonstrates how to use a constraint polygon in
# Delaunay triangulation.
import vtk
from vtk.util.colors import peacock
# Generate the input points and constrained edges/polygons.
points = vtk.vtkPoints()
points.InsertPoint(0, 1, 4, 0)
points.InsertPoint(1, 3, 4, 0)
points.Inser... | bsd-3-clause |
GitAngel/django | tests/field_subclassing/fields.py | 35 | 2704 | from __future__ import unicode_literals
import json
import warnings
from django.db import models
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, python_2_unicode_compatible
# Catch warning about subfieldbase -- remove in Djang... | bsd-3-clause |
slozier/ironpython2 | Src/StdLib/Lib/test/test_wait3.py | 136 | 1062 | """This test checks for correct wait3() behavior.
"""
import os
import time
import unittest
from test.fork_wait import ForkWait
from test.test_support import run_unittest, reap_children
try:
os.fork
except AttributeError:
raise unittest.SkipTest, "os.fork not defined -- skipping test_wait3"
try:
os.wait3... | apache-2.0 |
nhippenmeyer/django | tests/field_subclassing/tests.py | 214 | 4475 | from __future__ import unicode_literals
import inspect
from django.core import exceptions, serializers
from django.db import connection
from django.test import SimpleTestCase, TestCase
from .fields import CustomTypedField, Small
from .models import ChoicesModel, DataModel, MyModel, OtherModel
class CustomField(Tes... | bsd-3-clause |
theo-l/django | django/views/static.py | 6 | 4553 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
import mimetypes
import posixpath
import re
from pathlib import Path
from django.http import (
FileResponse, Http404, HttpResponse, HttpResponseNotModified,
)
from dja... | bsd-3-clause |
ajvpot/CTFd | migrations/versions/75e8ab9a0014_add_fields_and_fieldentries_tables.py | 4 | 1867 | """Add Fields and FieldEntries tables
Revision ID: 75e8ab9a0014
Revises: 0366ba6575ca
Create Date: 2020-08-19 00:36:17.579497
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "75e8ab9a0014"
down_revision = "0366ba6575ca"
branch_labels = None
depends_on = None
... | apache-2.0 |
WorldViews/Spirals | KinPy/KinOSCWatcher.py | 2 | 5277 |
import os, socket, time
import threading
#import MessageBoard
import traceback
import OSC
OSC_SERVER = None
ALL_JOINTS = {
'HandRight': 'RIGHT_HAND',
'HandLeft': 'LEFT_HAND',
'WristRight': 'RIGHT_WRIST',
'WristLeft': 'LEFT_WRIST',
'ElbowRight': 'RIGHT_ELBOW',
'ElbowLeft': 'LEFT_ELBOW',
'Shoulder... | mit |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/heapq.py | 14 | 23017 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... | apache-2.0 |
xlqian/navitia | release/script_release.py | 1 | 16196 | # -*- coding: utf-8 -*-
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobilit... | agpl-3.0 |
levilucio/SyVOLT | GM2AUTOSAR_MM/graph_MT_post__directLink_T.py | 2 | 3614 | """
__graph_MT_post__directLink_T.py___________________________________________________________
Automatically generated LINK for entity MT_post__directLink_T
DO NOT MODIFY DIRECTLY
___________________________________________________________________________________________
"""
from graphLink import *
from stickylink im... | mit |
pycrystem/pycrystem | pyxem/signals/tensor_field.py | 1 | 3246 | # -*- coding: utf-8 -*-
# Copyright 2016-2020 The pyXem developers
#
# This file is part of pyXem.
#
# pyXem 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 optio... | gpl-3.0 |
srm912/servo | tests/wpt/web-platform-tests/html/tools/update_html5lib_tests.py | 125 | 5358 | import sys
import os
import hashlib
import urllib
import itertools
import re
import json
import glob
import shutil
try:
import genshi
from genshi.template import MarkupTemplate
from html5lib.tests import support
except ImportError:
print """This script requires the Genshi templating library and html5l... | mpl-2.0 |
NSAmelchev/ignite | modules/platforms/python/pyignite/cache.py | 11 | 22098 | # 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 use ... | apache-2.0 |
mabushadi/dpxdt | dpxdt/tools/diff_my_urls.py | 7 | 6027 | #!/usr/bin/env python
# Copyright 2014 Brett Slatkin
#
# 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 o... | apache-2.0 |
Osmose/kitsune | kitsune/sumo/tests/test_utils.py | 11 | 7012 | # -*- coding: utf8 -*-
import json
from django.contrib.auth.models import Permission
from django.test.client import RequestFactory
from mock import patch, Mock
from nose.tools import eq_
from kitsune.journal.models import Record
from kitsune.sumo.utils import (
chunked, get_next_url, is_ratelimited, smart_int, t... | bsd-3-clause |
rpm-software-management/librepo | examples/python/download_packages_with_fastestmirror.py | 1 | 1645 | #!/usr/bin/env python3
"""
librepo - download packages
"""
import os
import os.path
import time
import librepo
CACHE = "fastestmirror.cache"
LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm"
LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm"
if __name__ == "__main__":
# Setup logging
def debug_function(msg, _):
... | lgpl-2.1 |
mizuy/mizwiki | mizwiki/utils/conv_pukiwiki.py | 1 | 4421 | # -*- coding: utf-8 -*-
import codecs, os, cStringIO as StringIO, re, sys
class IStreamBuffer:
@staticmethod
def _conv(v):
return v.rstrip(u'\n\r')
def __init__(self,inputfile):
self.input = codecs.getreader('utf-8')(inputfile)
self.stack = []
def __iter__(self):
r... | mit |
fabian4/trove | trove/guestagent/strategies/backup/experimental/mongo_impl.py | 1 | 4132 | # Copyright (c) 2014 eBay Software Foundation
# Copyright 2015 Hewlett-Packard Development Company, L.P. and Tesora, 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 L... | apache-2.0 |
eciis/web | backend/handlers/resend_invite_handler.py | 1 | 1157 | # -*- coding: utf-8 -*-
"""Resend Invite Handler."""
import json
from util import login_required
from utils import json_response
from utils import Utils
from custom_exceptions import NotAuthorizedException
from . import BaseHandler
from google.appengine.ext import ndb
__all__ = ['ResendInviteHandler']
class ResendIn... | gpl-3.0 |
marcusmartins/compose | compose/cli/verbose_proxy.py | 67 | 1691 |
import functools
from itertools import chain
import logging
import pprint
import six
def format_call(args, kwargs):
args = (repr(a) for a in args)
kwargs = ("{0!s}={1!r}".format(*item) for item in six.iteritems(kwargs))
return "({0})".format(", ".join(chain(args, kwargs)))
def format_return(result, ma... | apache-2.0 |
ritchyteam/odoo | addons/purchase/wizard/purchase_line_invoice.py | 205 | 5419 | # -*- 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... | agpl-3.0 |
runefriborg/pycsp | test/unix/multiprocesstest.py | 1 | 7496 | """
Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>,
Brian Vinter <vinter@diku.dk>, Rune M. Friborg <runef@diku.dk>
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 restrict... | mit |
alvarolopez/nova | nova/cmd/network.py | 27 | 2415 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
quinot/ansible-modules-core | cloud/amazon/iam_cert.py | 20 | 11703 | #!/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... | gpl-3.0 |
gnowxilef/Wox | PythonHome/Lib/site-packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
huijunwu/heron | heron/shell/src/python/handlers/pmaphandler.py | 5 | 1352 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
NixaSoftware/CVis | venv/lib/python2.7/site-packages/pygments/lexers/_vim_builtins.py | 31 | 57090 | # -*- coding: utf-8 -*-
"""
pygments.lexers._vim_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file is autogenerated by scripts/get_vimkw.py
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Split up in multiple functions so it's import... | apache-2.0 |
tudorvio/nova | nova/api/openstack/compute/schemas/v3/image_metadata.py | 95 | 1177 | # Copyright 2014 IBM Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
PHOTOX/fuase | ase/ase/dft/pars_beefvdw.py | 7 | 23666 | import numpy as np
"""
BEEF-vdW ensemble matrix
"""
uiOmega = np.array([
[ 9.238289896663336e-02 , 1.573812432079919e-01 , 1.029935738540308e-01 , 1.366003143143216e-02 , -2.170819634832974e-02 , -1.971473025898487e-03 , 6.694499988752175e-03 , -1.436837103528228e-03 , -1.894288263659829e-03 , 1.620730202731354e-03 , ... | gpl-2.0 |
Asquera/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/packaging/msi.py | 61 | 20261 | """SCons.Tool.packaging.msi
The msi packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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... | apache-2.0 |
johnkit/vtk-dev | Filters/Hybrid/Testing/Python/TestGridWarp3D.py | 20 | 2154 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Image pipeline
reader = vtk.vtkImageReader()
reader.ReleaseDataFlagOff()
reader.SetDataByteOrderToLittleEndian()
reader.SetDataExtent(0,63,0,63,1,93)
reader.SetDataSpacing(3.2,3.2,1... | bsd-3-clause |
cossacklabs/acra | wrappers/python/acrawriter/django/__init__.py | 1 | 3334 | # Copyright 2016, Cossack Labs Limited
#
# 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 wri... | apache-2.0 |
ds-hwang/chromium-crosswalk | tools/android/loading/resource_sack_display.py | 3 | 4182 | # Copyright 2016 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.
"""Utilities for displaying a ResourceSack.
When run standalone, takes traces on the command line and produces a dot file to
stdout.
"""
def ToDot(sack, o... | bsd-3-clause |
overra/node-gyp | gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... | mit |
yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/vm/manual/custom.py | 1 | 1298 | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | mit |
neiudemo1/django | docs/conf.py | 54 | 11938 | # -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | bsd-3-clause |
oskopek/devassistant | test/test_actions.py | 1 | 9352 | import os
import subprocess
import pytest
from flexmock import flexmock
from devassistant import actions, exceptions
from devassistant.dapi import dapicli
from test.logger import LoggingHandler
class TestActions(object):
def setup_class(self):
self.ha = actions.HelpAction
def test_get_help_contain... | gpl-2.0 |
jjingrong/PONUS-1.2 | venv/build/django/django/db/models/options.py | 104 | 24269 | from __future__ import unicode_literals
import re
from bisect import bisect
import warnings
from django.conf import settings
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy import OrderWrt
from django.db.mode... | mit |
jwalgran/otm-core | opentreemap/treemap/lib/user.py | 4 | 8019 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.db.models import Q
from treemap.audit import Audit, Authorizable, get_auditable_class
from treemap.models import Instance, MapFeature, InstanceUser, User
from treemap.util ... | gpl-3.0 |
kienpham2000/ansible-modules-core | packaging/rpm_key.py | 60 | 7339 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to import third party repo keys to your rpm db
# (c) 2013, Héctor Acosta <hector.acosta@gazzang.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 ... | gpl-3.0 |
bartQu9/fallenmua | resolvers.py | 1 | 3740 | from urllib.error import URLError, HTTPError
from xml.dom import minidom
from dns import resolver
import urllib.request
import logging
def parse_thunderbird_autoconfig(xml_autoconfig):
mx_servers = []
dom_tree = minidom.parseString(xml_autoconfig)
c_nodes = dom_tree.childNodes
for i in c_nodes[0].ge... | gpl-3.0 |
AnimeshSinha1309/WebsiteEdunet | WebsiteEdunet/env/Lib/site-packages/django/shortcuts.py | 135 | 7957 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
import warnings
from django.core import urlresolvers
from django.db.models.base import ModelBase
from django.db.models.manager imp... | mit |
aperigault/ansible | lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py | 24 | 10519 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
britcey/ansible | lib/ansible/modules/network/dellos9/dellos9_command.py | 46 | 7781 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
emonty/vhd-util | tools/python/logging/logging-0.4.9.2/test/log_test11.py | 42 | 2993 | #!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | gpl-2.0 |
kooksee/TIOT | test/project/src/app/proto/protocol/XBeeProtocol.py | 1 | 11235 | # encoding=utf-8
import binascii
import json
from twisted.internet.protocol import Protocol
from app.proto.controller.XbeeController import XBeeController
class XBeeProtocol(Protocol):
def __init__(self):
self.ip = ''
self.port = ''
def connectionMade(self):
#import soc... | gpl-2.0 |
ruthger/Archipel | ArchipelAgent/archipel-agent-action-scheduler/archipelagentactionscheduler/__init__.py | 5 | 2236 | # -*- coding: utf-8 -*-
#
# __init__.py
#
# Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
# Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com>
# This file is part of ArchipelProject
# http://archipelproject.org
#
# This program is free software: you can redistribute it and/or modi... | agpl-3.0 |
LeandroRoberto/sapl | sapl/relatorios/templates/pdf_pauta_sessao_preparar_pysc.py | 1 | 9023 | import os
request=context.REQUEST
response=request.RESPONSE
session= request.SESSION
if context.REQUEST['data']!='':
dat_inicio_sessao = context.REQUEST['data']
pauta = [] # lista contendo a pauta da ordem do dia a ser impressa
data = context.pysc.data_converter_pysc(dat_inicio_sessao) # converte data... | gpl-3.0 |
dwaynebailey/pootle | pootle/apps/pootle_word/utils.py | 5 | 2811 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
import re
import Levenshtein
impo... | gpl-3.0 |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/distutils/command/upload.py | 176 | 7002 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from distutils.errors... | mit |
fitermay/intellij-community | python/lib/Lib/_threading_local.py | 91 | 6946 | """Thread-local objects.
(Note that this module provides a Python version of the threading.local
class. Depending on the version of Python you're using, there may be a
faster one available. You should always import the `local` class from
`threading`.)
Thread-local objects support the management of thread-local d... | apache-2.0 |
virgree/odoo | addons/l10n_uy/__openerp__.py | 260 | 1807 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net>
# Proyecto de Localización de OperERP para Uruguay
# $Id$
#
# This program i... | agpl-3.0 |
simonwydooghe/ansible | test/units/modules/storage/netapp/test_na_ontap_nvme_namespace.py | 48 | 7361 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests ONTAP Ansible module: na_ontap_nvme_namespace'''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
fr... | gpl-3.0 |
icereval/osf.io | api/requests/serializers.py | 1 | 3573 | from django.db import IntegrityError
from rest_framework import exceptions
from rest_framework import serializers as ser
from api.base.exceptions import Conflict
from api.base.utils import absolute_reverse, get_user_auth
from api.base.serializers import JSONAPISerializer, LinksField, VersionedDateTimeField, Relationsh... | apache-2.0 |
shsingh/ansible | lib/ansible/modules/database/postgresql/postgresql_ext.py | 2 | 13576 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
DayGitH/Python-Challenges | DailyProgrammer/DP20160323B.py | 1 | 5877 | """
[2016-03-23] Challenge #259 [Intermediate] Mahjong Hands
https://www.reddit.com/r/dailyprogrammer/comments/4bmdwz/20160323_challenge_259_intermediate_mahjong_hands/
# Description
You are the biggest, baddest mahjong player around. Your enemies tremble at your presence on the battlefield, and you
can barely walk t... | mit |
waldocarter/p2pool | nattraverso/pynupnp/soap.py | 288 | 3547 | """
This module is a SOAP client using twisted's deferreds.
It uses the SOAPpy package.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
import SOAPpy, logging
from SOAPpy.Config import Config
from... | gpl-3.0 |
tiagofrepereira2012/tensorflow | tensorflow/python/debug/cli/readline_ui_test.py | 81 | 5646 | # 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... | apache-2.0 |
RaRe-Technologies/gensim | gensim/test/test_lee.py | 5 | 4277 | #!/usr/bin/env python
# encoding: utf-8
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated test to reproduce the results of Lee et al. (2005)
Lee et al. (2005) compares different models for semantic
similarity and verifies the results with similarity judgements from humans.
As... | lgpl-2.1 |
vodik/pytest | testing/acceptance_test.py | 4 | 23849 | import sys
import _pytest._code
import py
import pytest
from _pytest.main import EXIT_NOTESTSCOLLECTED, EXIT_USAGEERROR
class TestGeneralUsage:
def test_config_error(self, testdir):
testdir.makeconftest("""
def pytest_configure(config):
import pytest
raise pyte... | mit |
vasyarv/edx-platform | lms/djangoapps/django_comment_client/management/commands/assign_role.py | 251 | 1144 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django_comment_common.models import Role
from django.contrib.auth.models import User
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--remove',
ac... | agpl-3.0 |
thepaul/uftrace | tests/t217_no_libcall_dump.py | 1 | 1525 | #!/usr/bin/env python
from runtest import TestBase
import subprocess as sp
TDIR='xxx'
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'signal', """
uftrace file header: magic = 4674726163652100
uftrace file header: version = 4
uftrace file header: header size = 40
uf... | gpl-2.0 |
datakortet/django-cms | cms/plugins/teaser/models.py | 1 | 1148 | from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin, Page
class Teaser(CMSPlugin):
"""
A Teaser
"""
title = models.CharField(_("title"), max_length=255)
image = models.ImageField(_("image"), upload... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.0/Lib/dos-8x3/test_win.py | 11 | 5449 | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
from _winreg import *
import os, sys
test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
test_data = [
("Int Value", 45, REG_DWORD),
("Strin... | mit |
JshWright/home-assistant | tests/components/switch/test_command_line.py | 25 | 7031 | """The tests for the Command line switch platform."""
import json
import os
import tempfile
import unittest
from homeassistant.setup import setup_component
from homeassistant.const import STATE_ON, STATE_OFF
import homeassistant.components.switch as switch
import homeassistant.components.switch.command_line as command... | apache-2.0 |
cloudfoundry/php-buildpack-legacy | builds/runtimes/python-2.7.6/lib/python2.7/rexec.py | 228 | 20148 | """Restricted execution facilities.
The class RExec exports methods r_exec(), r_eval(), r_execfile(), and
r_import(), which correspond roughly to the built-in operations
exec, eval(), execfile() and import, but executing the code in an
environment that only exposes those built-in operations that are
deemed safe. To t... | mit |
c0hen/django-venv | lib/python3.4/site-packages/django/contrib/admin/helpers.py | 27 | 15048 | from __future__ import unicode_literals
import json
import warnings
from django import forms
from django.conf import settings
from django.contrib.admin.utils import (
display_for_field, flatten_fieldsets, help_text_for_field, label_for_field,
lookup_field,
)
from django.core.exceptions import ObjectDoesNotExi... | gpl-3.0 |
hoangt/gem5v | src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py | 18 | 3743 | # Copyright (c) 2008 Princeton University
# Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above c... | bsd-3-clause |
cryptickp/troposphere | examples/CloudFront_S3.py | 22 | 1622 | # Converted from CloudFront_S3.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
from troposphere import GetAtt, Join, Output
from troposphere import Parameter, Ref, Template
from troposphere.cloudfront import Distribution, DistributionConfig
from troposphere.cloudfront import O... | bsd-2-clause |
nelmiux/CarnotKE | jyhton/Lib/test/clamp.py | 12 | 2254 | import java
import os
import os.path
from java.lang.reflect import Modifier
from org.python.util import CodegenUtils
from org.python.compiler import CustomMaker, ProxyCodeHelpers
__all__ = ["PackageProxy", "SerializableProxies"]
class SerializableProxies(CustomMaker):
# NOTE: SerializableProxies is itself a j... | apache-2.0 |
minifirocks/nifi-minifi-cpp | thirdparty/rocksdb/buckifier/targets_cfg.py | 6 | 3002 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
rocksdb_target_header = """
import os
TARGETS_PATH = os.path.dirname(__file__)
REPO_PATH = "rocksdb/src/"
BUCK_BINS = "buck-out/gen/" + REPO_PATH
TEST_RUNNER = REPO_PATH ... | apache-2.0 |
YufeiZhang/Principles-of-Programming-Python-3 | Lectures/Lecture_6/k_means_clustering.py | 1 | 10239 | # Written by Eric Martin for COMP9021
import tkinter as tk
import tkinter.messagebox
class KMeansClustering(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.title('k-means clustering')
menubar = tk.Menu()
help_menu = tk.Menu(menubar)
menubar.add_cascade(label = 'k-me... | gpl-3.0 |
aerval/blast_comparison | main.py | 1 | 16353 | #!/bin/env python
##############################################
# CompareBLASTs #
# A tool to compare the found hits from two #
# BLAST searches with the same search query. #
# #
# by Philipp B. Rentzsch #
# BCCDC Vancouver, ... | mit |
makinacorpus/pygal | pygal/test/test_interpolate.py | 4 | 3200 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# 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... | lgpl-3.0 |
jit/pyew | pymsasid/decode.py | 16 | 31254 | # -----------------------------------------------------------------------------
# decode.py
#
# author: matthieu.kaczmarek@mines-nancy.org
# Mainly rewrited from udis86 -- Vivek Mohan <vivek@sig9.com>
# -----------------------------------------------------------------------------
from common import DecodeException, VE... | gpl-2.0 |
jemofthewest/mykoans | python2/libs/colorama/win32.py | 86 | 2730 |
# from winbase.h
STDOUT = -11
STDERR = -12
try:
from ctypes import windll
except ImportError:
windll = None
SetConsoleTextAttribute = lambda *_: None
else:
from ctypes import (
byref, Structure, c_char, c_short, c_uint32, c_ushort
)
handles = {
STDOUT: windll.kernel32.GetStdHa... | mit |
ztrautt/tutorials | TEM-image-simple/mdcs/explore.py | 10 | 1530 | #! /usr/bin/env python
import requests
from collections import OrderedDict
def select_all(host,user,pswd,cert=None,format=None):
url = host + "/rest/explore/select/all"
params = dict()
if format: params['dataformat'] = format
r = requests.get(url, params=params, auth=(user, pswd), verify=cert)
retu... | cc0-1.0 |
HBehrens/feedsanitizer | django/contrib/gis/utils/wkt.py | 419 | 1846 | """
Utilities for manipulating Geometry WKT.
"""
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to that number:
>>> pnt =... | mit |
manumathewthomas/Chat-with-Joey | chatbot/chatbot.py | 1 | 31681 | # Copyright 2015 Conchylicultor. 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 ... | apache-2.0 |
codemeow5/PyPack | pypack/protocol.py | 1 | 2657 | """ Class and function related to protocol operation
"""
import datetime
import struct
MSG_TYPE_SEND = 0x1
MSG_TYPE_ACK = 0x2
MSG_TYPE_RECEIVED = 0x3
MSG_TYPE_RELEASE = 0x4
MSG_TYPE_COMPLETED = 0x5
QOS0 = 0
QOS1 = 1
QOS2 = 2
# MAX_DATETIME = int((datetime.datetime(2500, 1, 1) - datetime.datetime(1970, 1, 1)).total... | mit |
ioanaantoche/muhaha | ioana/examples/feet.py | 1 | 1624 | import sys
from naoqi import ALProxy
import time
def main(robotIP):
PORT = 9559
try:
motionProxy = ALProxy("ALMotion", robotIP, PORT)
except Exception,e:
print "Could not create proxy to ALMotion"
print "Error was: ",e
sys.exit(1)
try:
postureProxy = ALProxy("A... | gpl-2.0 |
seomoz/gevent-soup | bs4/element.py | 438 | 61538 | import collections
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backward compatibility"""
@property
def alias... | mit |
BreakawayConsulting/pyxmlerrors | pyxmlerrors.py | 1 | 3091 | """
Copyright (c) 2013 Breakaway Consulting Pty. Ltd.
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, publ... | mit |
blakfeld/ansible | v1/ansible/runner/action_plugins/synchronize.py | 86 | 8449 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012-2013, Timothy Appnel <tim@appnel.com>
#
# 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) an... | gpl-3.0 |
LaurentClaessens/phystricks | manual/phystricksIllusionNHwEtp.py | 1 | 1130 | # -*- coding: utf8 -*-
from phystricks import *
def IllusionNHwEtp():
pspict,fig = SinglePicture("IllusionNHwEtp")
pspict.dilatation(0.7)
perspective=ObliqueProjection(45,sqrt(2)/2)
l=2
P=(0,0)
cubesP=[]
cubesL=[]
cubesH=[]
profondeur=7
longueur=4
hauteur=4
for i in ran... | gpl-3.0 |
czgu/metaHack | env/lib/python2.7/site-packages/django/core/checks/compatibility/django_1_7_0.py | 91 | 1368 | from __future__ import unicode_literals
from .. import Warning, register, Tags
@register(Tags.compatibility)
def check_1_7_compatibility(**kwargs):
errors = []
errors.extend(_check_middleware_classes(**kwargs))
return errors
def _check_middleware_classes(app_configs=None, **kwargs):
"""
Checks ... | apache-2.0 |
tempbottle/gunicorn | gunicorn/app/django_wsgi.py | 87 | 4363 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
""" module used to build the django wsgi application """
from __future__ import print_function
import os
import re
import sys
import time
try:
from StringIO import StringIO
except:
fr... | mit |
nttdata-osscloud/ceilometer | ceilometer/tests/api/v1/test_list_sources_scenarios.py | 2 | 1184 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 Julien Danjou
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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/lice... | apache-2.0 |
thilbern/scikit-learn | sklearn/neighbors/base.py | 7 | 25049 | """Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output... | bsd-3-clause |
mjgrav2001/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 142 | 5990 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
Baekalfen/Helmholtz-Coil-Simulator | main_grid_treaded.py | 1 | 7586 | # -*- coding: utf-8 -*-
##from multiprocessing import Process
##from multiprocessing import Pool
from visual import *
from math import *
from sys import platform
import time
#######################################
# #
# Author: Mads Ynddal #
# All Rights Reserved ... | gpl-2.0 |
gemini-testing/selenium | py/selenium/webdriver/opera/webdriver.py | 5 | 3372 | #!/usr/bin/python
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | apache-2.0 |
kpurusho/mbed | workspace_tools/host_tests/host_tests_plugins/host_test_plugins.py | 92 | 4881 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
kmonsoor/python-for-android | python-modules/twisted/twisted/words/im/ircsupport.py | 49 | 9263 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
IRC support for Instance Messenger.
"""
import string
from twisted.words.protocols import irc
from twisted.words.im.locals import ONLINE
from twisted.internet import defer, reactor, protocol
from twisted.internet.defer import succe... | apache-2.0 |
karlbright/beets | beets/mediafile.py | 1 | 36961 | # This file is part of beets.
# Copyright 2011, Adrian Sampson.
#
# 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, ... | mit |
Ramanujakalyan/Inherit | gis-tools-101/rev_geo.py | 29 | 6294 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = "Brian Lehman, Scott Hendrickson"
import sys
import re
import codecs
reload(sys)
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
sys.stdin = codecs.getreader('utf-8')(sys.stdin)
import math
import pprint
import json
import fiona
from shapely.geometry imp... | unlicense |
kennedyshead/home-assistant | tests/components/pushbullet/test_notify.py | 8 | 8722 | """The tests for the pushbullet notification platform."""
import json
from unittest.mock import patch
from pushbullet import PushBullet
import pytest
import homeassistant.components.notify as notify
from homeassistant.setup import async_setup_component
from tests.common import assert_setup_component, load_fixture
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.