repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Titulacion-Sistemas/PythonTitulacion-EV | refs/heads/master | Lib/site-packages/django/contrib/auth/signals.py | 865 | from django.dispatch import Signal
user_logged_in = Signal(providing_args=['request', 'user'])
user_login_failed = Signal(providing_args=['credentials'])
user_logged_out = Signal(providing_args=['request', 'user'])
|
zlargon/mosquitto | refs/heads/master | test/broker/03-publish-b2c-disconnect-qos2.py | 18 | #!/usr/bin/env python
import subprocess
import socket
import time
from os import environ
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[... |
linkedin/luminol | refs/heads/master | src/luminol/modules/correlation_result.py | 1 | # coding=utf-8
"""
© 2015 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed ... |
clumsy/intellij-community | refs/heads/master | python/testData/quickdoc/ClassUndocumentedEmptyConstructor.py | 83 | class Moo(object):
def __init__(self):
"Doc of Moo()"
pass
class Foo(Moo):
# no doc to inherit
def __init__(self):
# no direct doc
pass
<the_ref>Foo()
|
yoki/phantomjs | refs/heads/master | src/qt/qtbase/src/3rdparty/freetype/src/tools/docmaker/sources.py | 367 | # Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
#
# this file contains definitions of classes needed to decompose
# C sources files into a series of multi-line "blocks". There are
# two kinds of blocks:
#
# - normal blocks, which contain source code or ordinary comment... |
gbaty/pyside2 | refs/heads/master | tests/QtWidgets/bug_389.py | 3 | ''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''
import sys
import unittest
from helper import UsesQApplication
from PySide2 import QtCore, QtGui, QtWidgets
class BugTest(UsesQApplication):
def testCase(self):
s = QtWidgets.QWidget().style()
i = s.standardIcon(QtWidgets.QStyle.SP... |
petebachant/MakeWaves | refs/heads/master | create_shortcut.py | 1 | #!/usr/bin/env python
"""This script creates Windows shortcuts."""
from __future__ import division, print_function
import os
from win32com.client import Dispatch
import sys
python_dir = os.path.split(sys.executable)[0]
shortcut_path = "MakeWaves.lnk"
pythonw_path = os.path.join(python_dir, "pythonw.exe")
makewaves_pa... |
AlexGrig/GPy | refs/heads/master | GPy/models/sparse_gp_classification.py | 12 | # Copyright (c) 2013, Ricardo Andrade
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from ..core import SparseGP
from .. import likelihoods
from .. import kern
from ..likelihoods import likelihood
from ..inference.latent_function_inference import expectation_propagation_dtc
class Spar... |
waytai/odoo | refs/heads/8.0 | addons/edi/__init__.py | 437 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# 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 GN... |
azurestandard/django | refs/heads/master | tests/modeltests/many_to_many/models.py | 43 | """
5. Many-to-many relationships
To define a many-to-many relationship, use ``ManyToManyField()``.
In this example, an ``Article`` can be published in multiple ``Publication``
objects, and a ``Publication`` has multiple ``Article`` objects.
"""
from django.db import models
class Publication(models.Model):
tit... |
elijah513/django | refs/heads/master | tests/files/tests.py | 277 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import os
import struct
import tempfile
import unittest
from io import BytesIO, StringIO
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.move import file_move_safe
from django.core.file... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/SQLAlchemy-1.0.6/lib/sqlalchemy/util/__init__.py | 47 | # util/__init__.py
# Copyright (C) 2005-2015 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
from .compat import callable, cmp, reduce, \
threading, py3k, py33, py2k, jyth... |
bradfa/python_koans | refs/heads/master | python3/koans/about_string_manipulation.py | 84 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStringManipulation(Koan):
def test_use_format_to_interpolate_variables(self):
value1 = 'one'
value2 = 2
string = "The values are {0} and {1}".format(value1, value2)
self.assertEqual(__, string)
... |
Comunitea/OCB | refs/heads/8.0 | addons/account/account_invoice.py | 2 | # -*- 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... |
rooshilp/CMPUT410W15-project | refs/heads/master | social_distribution/authors/migrations/0006_auto_20150304_2002.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('authors', '0005_remove_profile_follows'),
]
operations = [
migrations.CreateModel(
name='Follow',
fi... |
DiegoQueiroz/scriptLattes | refs/heads/master | scriptLattes/internacionalizacao/depuradorDOIhtml.py | 3 | #!/usr/bin/python
# encoding: utf-8
# filename: depuradorDOIhtml.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um software livre; você pode redistribui-lo e/ou
# modifica-lo dentro dos termos da Licença Públic... |
ramondelafuente/ansible | refs/heads/devel | lib/ansible/plugins/shell/fish.py | 37 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
GunoH/intellij-community | refs/heads/master | python/testData/resolve/UnresolvedImport.py | 83 | import NonExistingModule
NonExistingModule.foo()
#<ref>
|
shuggiefisher/django-on-google-app-engine-base | refs/heads/master | django/contrib/gis/geos/coordseq.py | 411 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import c_double, c_uint, byref
from django.contrib.gis.geos.base import GEOSBase, numpy
from django.contrib.gis.geos.error impo... |
mitchcapper/mythbox | refs/heads/master | resources/lib/IMDbPY/imdb/Person.py | 143 | """
Person module (imdb package).
This module provides the Person class, used to store information about
a given person.
Copyright 2004-2010 Davide Alberani <da@erlug.linux.it>
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
th... |
otaviomorcegao/speakerfight | refs/heads/master | api/models.py | 10644 | from django.db import models
# Create your models here.
|
akashsinghal/Speech-Memorization-App | refs/heads/master | Python_Backend/lib/jinja2/_compat.py | 214 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... |
XiaJieCom/change | refs/heads/master | stu103151/days08/ftpserver/socket_client.py | 2 | import socket,os,sys,time
class FTPClient(object):
'''
定义FTPClient类
'''
def __init__(self,host,port):
self.sk = socket.socket()
self.sk.connect((host,port))
#初始化连接
#msg = self.sk.recv(1024)
#print(str(msg.decode()))
def start(self):
self.active()
... |
pedro2d10/SickRage-FR | refs/heads/develop | lib/imdb/parser/http/movieParser.py | 40 | """
parser.http.movieParser module (imdb package).
This module provides the classes (and the instances), used to parse the
IMDb pages on the akas.imdb.com server about a movie.
E.g., for Brian De Palma's "The Untouchables", the referred
pages would be:
combined details: http://akas.imdb.com/title/tt0094226/combi... |
yaojenkuo/BuildingMachineLearningSystemsWithPython | refs/heads/master | ch02/knn.py | 22 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import numpy as np
# This function was called ``learn_model`` in the first edition
def fit_model(k, fe... |
blademainer/intellij-community | refs/heads/master | python/testData/joinLines/ListRBracket.py | 83 | a = [
111,
<caret>222
]
|
koyuawsmbrtn/eclock | refs/heads/master | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/Demos/c_extension/setup.py | 40 | # A sample distutils script to show to build your own
# extension module which extends pywintypes or pythoncom.
#
# Use 'python setup.py build' to build this extension.
import os
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_lib
sources = ["win32_extension.cpp"]
# Specify the ... |
yahman72/robotframework | refs/heads/master | rundevel.py | 23 | #!/usr/bin/env python
"""rundevel.py -- script to run current code
Usage: [interpreter] rundevel.py [run|rebot] [options] [arguments]
Examples:
./rundevel.py --name Example tests.txt # run with python
./rundevel.py run --name Example tests.txt # same as above
jython rundevel.py --name Examp... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/admin_custom_urls/models.py | 67 | from functools import update_wrapper
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.db import models
from django.http import HttpResponseRedirect
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Action(models.Model):
name ... |
inkasjasonk/rs | refs/heads/master | research/base/__init__.py | 175 | """Application base, containing global templates."""
|
nhenezi/kuma | refs/heads/master | vendor/packages/sqlalchemy/lib/sqlalchemy/orm/strategies.py | 6 | # strategies.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related Mapper... |
kmonsoor/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/auth.py | 190 | #!/usr/bin/python
#
# Copyright (C) 2007 - 2009 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 applicab... |
red-rocket-dev/pyplwnxml | refs/heads/master | pyplwnxml/__init__.py | 1 | from pyplwnxml.wordnet import *
from pyplwnxml.parser import *
from pyplwnxml.enums import * |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/cssutils/tests/test_cssstylerule.py | 3 | """Testcases for cssutils.css.CSSStyleRuleTestCase"""
import xml.dom
import test_cssrule
import cssutils
class CSSStyleRuleTestCase(test_cssrule.CSSRuleTestCase):
def setUp(self):
super(CSSStyleRuleTestCase, self).setUp()
self.r = cssutils.css.CSSStyleRule()
self.rRO = cssutils.css.CSSSty... |
OPM/opm-cmake | refs/heads/master | python/pybind11/tests/test_operator_overloading.py | 19 | import pytest
from pybind11_tests import operators as m
from pybind11_tests import ConstructorStats
def test_operator_overloading():
v1 = m.Vector2(1, 2)
v2 = m.Vector(3, -1)
assert str(v1) == "[1.000000, 2.000000]"
assert str(v2) == "[3.000000, -1.000000]"
assert str(v1 + v2) == "[4.000000, 1.00... |
indictranstech/focal-erpnext | refs/heads/develop | erpnext/stock/page/stock_ledger/__init__.py | 37694 | from __future__ import unicode_literals
|
gangadharkadam/v6_erp | refs/heads/master | erpnext/accounts/doctype/period_closing_voucher/__init__.py | 37694 | from __future__ import unicode_literals
|
swannapa/erpnext | refs/heads/develop | erpnext/patches/v8_0/__init__.py | 37694 | from __future__ import unicode_literals
|
PeterDaveHello/eden | refs/heads/master | modules/s3db/sit.py | 16 | # -*- coding: utf-8 -*-
""" Sahana Eden Situation Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 wit... |
nan86150/ImageFusion | refs/heads/master | ENV2.7/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.py | 559 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Class representing the list of files in a distribution.
Equivalent to distutils.filelist, but fixes some problems.
"""
import fnmatch
import logging
import os
import re
from . import DistlibEx... |
cculianu/gemuo | refs/heads/master | src/kindling.py | 1 | #!/usr/bin/python
from uo.entity import TREES
from gemuo.simple import simple_run
from gemuo.data import TileCache
from gemuo.entity import Position
from gemuo.exhaust import ExhaustDatabase
from gemuo.resource import find_resource
from gemuo.engine import Engine
from gemuo.engine.messages import PrintMessages
from ge... |
CENDARI/editorsnotes | refs/heads/master | editorsnotes/main/migrations/0122_add_revision_project_metadata.py | 1 | # -*- coding: utf-8 -*-
import datetime
import json
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.utils.functional import memoize
def project_from_id(pid, orm):
return orm['main.Project'].objects.get(id=pid)
project_from_id = memoize(project_from_id, {}, 1)
de... |
parinck/cook | refs/heads/master | euler/p6.py | 2 | #!/usr/bin/env python
firstN = 100
def fn(n):
return n*(n+1)/2
def fnsqr(n):
return n * (n+1) * (2*n + 1) / 6
print pow(fn(firstN),2) - fnsqr(firstN) |
AustereCuriosity/astropy | refs/heads/master | astropy/io/ascii/connect.py | 1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file connects the readers/writers to the astropy.table.Table class
from __future__ import absolute_import, division, print_function
import re
import functools
from .. import registry as io_registry
from ...table import Table
from ...extern.six.mo... |
GIC-de/pyrad | refs/heads/master | pyrad/tests/testProxy.py | 3 | import select
import socket
import unittest
from pyrad.proxy import Proxy
from pyrad.packet import AccessAccept
from pyrad.packet import AccessRequest
from pyrad.server import ServerPacketError
from pyrad.server import Server
from pyrad.tests.mock import MockFd
from pyrad.tests.mock import MockPoll
from pyrad.tests.moc... |
Theer108/invenio | refs/heads/master | invenio/ext/sso/__init__.py | 13 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio 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... |
b3ngmann/python-pastime | refs/heads/master | ps10/graph.py | 1 | # 6.00x Problem Set 10
# Graph optimization
#
# A set of data structures to represent graphs
#
class Node(object):
def __init__(self, name):
self.name = str(name)
def getName(self):
return self.name
def __str__(self):
return self.name
def __repr__(self):
r... |
tkarabela/pysubs2 | refs/heads/master | pysubs2/tmp.py | 1 | import re
from .formatbase import FormatBase
from .ssaevent import SSAEvent
from .ssastyle import SSAStyle
from .substation import parse_tags
from .time import ms_to_times, make_time, tmptimestamp_to_ms
#: Pattern that matches TMP timestamp
TMPTIMESTAMP = re.compile(r"(\d{1,2}):(\d{2}):(\d{2})")
#: Pattern that matche... |
fkenjikamei/python-exercises | refs/heads/master | aula14-2-while.py | 1 | numero = 10
while numero != 0:
numero = int(input("Digite um numero? "))
print(numero)
print("Fim do programa!") |
graingert/le_python | refs/heads/master | logentries/__init__.py | 5 | from .utils import LogentriesHandler
|
tvibliani/odoo | refs/heads/8.0 | addons/account_budget/__init__.py | 444 | # -*- 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... |
blademainer/intellij-community | refs/heads/master | python/lib/Lib/Cookie.py | 91 | #!/usr/bin/env python
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# 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 ... |
Johnzero/OE7 | refs/heads/master | openerp/addons-modules/account/account_bank.py | 6 | # -*- 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... |
JianyuWang/neutron | refs/heads/master | neutron/pecan_wsgi/app.py | 10 | # Copyright (c) 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
stonegithubs/odoo | refs/heads/8.0 | addons/l10n_pt/__init__.py | 439 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Thinkopen Solutions, Lda. All Rights Reserved
# http://www.thinkopensolutions.com.
# $Id$
#
# This program is free software: you can r... |
fhgwright/fs-uae | refs/heads/master | docs/scripts/build.py | 2 | #!/usr/bin/env python3
import os
import html
import shutil
import sys
if not os.path.exists("docs/scripts"):
print("Run this script from the project root directory")
sys.exit(1)
IGNORED = [".gitignore", "Makefile", "build.py", "update.py"]
option_names = set()
out_dir = "docs/html"
if os.path.exists(out_di... |
thumbimigwe/echorizr | refs/heads/master | lib/python2.7/site-packages/django/test/runner.py | 60 | import collections
import ctypes
import itertools
import logging
import multiprocessing
import os
import pickle
import textwrap
import unittest
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS, connection... |
murfz/Sick-Beard | refs/heads/development | lib/imdb/parser/sql/__init__.py | 52 | """
parser.sql package (imdb package).
This package provides the IMDbSqlAccessSystem class used to access
IMDb's data through a SQL database. Every database supported by
the SQLObject _AND_ SQLAlchemy Object Relational Managers is available.
the imdb.IMDb function will return an instance of this class when
called wit... |
afrolov1/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/237_placeholder.py | 338 | # 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
# d... |
apprentice3d/Wox | refs/heads/master | PythonHome/Lib/site-packages/setuptools/command/develop.py | 450 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os
import glob
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_install
from setuptools.compat import PY3
impor... |
jlmucb/cloudproxy | refs/heads/master | src/third_party/googlemock/scripts/generator/cpp/tokenize.py | 679 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 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... |
Morwenn/BipComposer | refs/heads/master | bipcomposer/reader.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the BipComposer project.
# Copyright (C) 2013 Morwenn
# Contact: Morwenn <morwenn29@hotmail.fr>
#
# 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... |
maxsocl/django | refs/heads/master | tests/custom_methods/models.py | 66 | """
Giving models custom methods
Any method you add to a model will be available to instances.
"""
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100)
... |
paolo215/problems | refs/heads/master | Euler/4.py | 1 | #Largest palindrome product
a = []
for i in range(100, 1000):
for j in range(100, 1000):
a.append(i*j)
a = map(str, reversed(sorted(list(set(a)))))
for z in a:
if z == "".join(reversed(list(z))):
print z
break
|
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/django-extensions/django_extensions/management/commands/set_fake_emails.py | 44 | """
set_fake_emails.py
Give all users a new email account. Useful for testing in a
development environment. As such, this command is only available when
setting.DEBUG is True.
"""
from optparse import make_option
from django.conf import settings
from django.core.management.base import NoArgsCommand, Comm... |
dstroppa/openstack-smartos-nova-grizzly | refs/heads/master | nova/virt/baremetal/db/api.py | 10 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 NTT DOCOMO, INC.
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed un... |
kenorb/BitTorrent | refs/heads/master | twisted/words/test/test_jabberjid.py | 3 | # Copyright (c) 2001-2005 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.words.protocols.jabber import jid
class JIDParsingTest(unittest.TestCase):
def testParse(self):
# Basic forms
self.assertEquals(jid.parse("user@host/resource"),
... |
user-none/calibre | refs/heads/master | src/calibre/ebooks/docx/lcid.py | 16 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
lcid = {
1078: 'af', # Afrikaans - South Africa
1052: 'sq', # Alba... |
proxysh/Safejumper-for-Mac | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/zope/interface/tests/test_element.py | 79 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
helldorado/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_policy.py | 38 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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',
... |
hanasoo/django-allauth | refs/heads/master | allauth/socialaccount/providers/windowslive/models.py | 4209 | # Create your models here.
|
NStep/android_kernel_motorola_msm8226 | refs/heads/cm-14.1-nx | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
TrueSkills/django-mongo-rest | refs/heads/master | django_mongo_rest/crypto.py | 1 | import calendar
from django.conf import settings
from django.core import signing
from django.utils import timezone
from urllib import urlencode
TIMESTAMP_QUERY_PARAM = 'tmstmp'
SIGNATURE_QUERY_PARAM = 'sign'
SALT_QUERY_PARAM = 'salt'
class InvalidSig(Exception):
pass
class ExpiredSig(Exception):
pass
def _s... |
hfutsuchao/Python2.6 | refs/heads/master | work_tools/own_demand/own_demand.py | 1 | #coding:utf-8
import pandas as pd
sales = pd.read_csv('sales.txt')
count = pd.read_csv('count.txt')
sales_count = sales[['director_id','id']].groupby('director_id').count()
own_count = count[['director_id','count']].groupby('director_id').sum()
sales_count.to_csv('sales_count.csv')
own_count.to_csv('own_count.csv')
|
christophlsa/odoo | refs/heads/8.0 | addons/web/tests/test_serving_base.py | 329 | # -*- coding: utf-8 -*-
import random
import unittest2
from openerp.tools import topological_sort
def sample(population):
return random.sample(
population,
random.randint(0, min(len(population), 5)))
class TestModulesLoading(unittest2.TestCase):
def setUp(self):
self.mods = map(s... |
brownharryb/erpnext | refs/heads/develop | erpnext/accounts/doctype/chart_of_accounts_importer/chart_of_accounts_importer.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, csv
from frappe import _
from frappe.utils import cstr
from frappe.model.document import Document
from frappe.utils.csvut... |
airtimemedia/abrt | refs/heads/master | tests/runtests/ureport/fakefaf.py | 4 | #!/usr/bin/env python
# Single purpose HTTP server
# - accepts POST of ureport JSON and dumps it to a file
import sys
import json
import BaseHTTPServer, cgi
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
# parse form data
form = cgi.FieldStorage(
fp=self.rfile... |
jsma/django-cms | refs/heads/develop | cms/test_utils/project/emailuserapp/migrations/0002_auto_20150419_1745.py | 49 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('emailuserapp', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='emailuser',
name... |
adelina-t/neutron | refs/heads/master | neutron/plugins/embrane/l2base/support_base.py | 59 | # Copyright 2013 Embrane, 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... |
KiranJKurian/XScheduler | refs/heads/master | venv/lib/python2.7/site-packages/pyasn1_modules/rfc3412.py | 127 | #
# SNMPv3 message syntax
#
# ASN.1 source from:
# http://www.ietf.org/rfc/rfc3412.txt
#
from pyasn1.type import univ, namedtype, namedval, tag, constraint
from pyasn1_modules import rfc1905
class ScopedPDU(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType('contextEngineId', univ.Oc... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/views.py | 231 | from __future__ import unicode_literals
from django.http import Http404
from django.utils.translation import ugettext as _
def feed(request, url, feed_dict=None):
"""Provided for backwards compatibility."""
if not feed_dict:
raise Http404(_("No feeds are registered."))
try:
slug, param = ... |
shoyer/xarray | refs/heads/master | doc/gallery/plot_rasterio_rgb.py | 4 | """
.. _recipes.rasterio_rgb:
============================
imshow() and map projections
============================
Using rasterio's projection information for more accurate plots.
This example extends :ref:`recipes.rasterio` and plots the image in the
original map projection instead of relying on pcolormesh and a ... |
undoware/neutron-drive | refs/heads/master | neutron-drive/django/core/management/commands/createcachetable.py | 81 | from optparse import make_option
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import LabelCommand
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.db.utils import DatabaseError
class Command(LabelCommand):
help = "Creates ... |
ray-project/ray | refs/heads/master | python/ray/_private/utils.py | 1 | import binascii
import errno
import functools
import hashlib
import importlib
import logging
import math
import multiprocessing
import os
import signal
import subprocess
import sys
import tempfile
import threading
import time
from typing import Optional
import uuid
import warnings
import inspect
from inspect import si... |
nordaux/tornado | refs/heads/master | demos/benchmark/gen_benchmark.py | 15 | #!/usr/bin/env python
#
# A simple benchmark of the tornado.gen module.
# Runs in two modes, testing new-style (@coroutine and Futures)
# and old-style (@engine and Tasks) coroutines.
from timeit import Timer
from tornado import gen
from tornado.options import options, define, parse_command_line
define('num', defaul... |
mcanthony/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/win/gyptest-link-nodefaultlib.py | 344 | #!/usr/bin/env python
# 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.
"""
Make sure nodefaultlib setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.Test... |
OkayDave/misc_python | refs/heads/master | quote.py | 1 | #!/usr/bin/env python
import requests
#import random
import json
import textwrap
mashape_key = ""
url = "https://andruxnet-random-famous-quotes.p.mashape.com/?cat=famous"
headers = {"X-Mashape-Authorization": mashape_key}
r = requests.get(url, headers=headers)
data = json.loads(r.text)
q = textwrap.fill(data["quo... |
hassanibi/erpnext | refs/heads/develop | erpnext/accounts/doctype/budget/test_budget.py | 12 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.accounts.doctype.budget.budget import get_actual_expense, BudgetError
from erpnext.accounts.doctype.journal_entry.test_journa... |
jmankoff/data | refs/heads/master | Assignments/jmankoff-fusion/lib/jinja2/defaults.py | 336 | # -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import range_type
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
# defaults for ... |
grpc/grpc | refs/heads/master | tools/run_tests/python_utils/filter_pull_request_tests.py | 5 | #!/usr/bin/env python
# Copyright 2015 gRPC 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 o... |
GoogleChrome/big-rig | refs/heads/master | app/src/thirdparty/telemetry/core/os_version.py | 10 | # Copyright 2014 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.
# pylint: disable=W0212
class OSVersion(str):
def __new__(cls, friendly_name, sortable_name, *args, **kwargs):
version = str.__new__(cls, friendly_name... |
RandallDW/Aruba_plugin | refs/heads/Aruba_plugin | plugins/org.python.pydev.refactoring/tests/python/coderefactoring/extractmethod/testExtractMethod2.py | 8 | class A:
def test(self):
a = 10
##|print a##|
attribute = "hello"
def my_method(self):
print self.attribute
a = A()
a.test()
##r
class A:
def extracted_method(self, a):
print a
def test(self):
a = 10
self.extracted_method(a)
... |
jaromil/FreeJ | refs/heads/master | scripts/python/video_test.py | 2 | import threading
import freej
import time
import sys
#freej.set_debug(3)
# init context
cx = freej.Context()
cx.init()
# init screen
scr = freej.SdlScreen()
scr.init( 400, 300 )
cx.add_screen(scr)
cx.config_check("keyboard.js")
cx.plugger.refresh(cx)
# add a layer
# lay = freej.create_layer(cx,sys.argv[1])
#lay = ... |
andersk/zulip | refs/heads/master | zproject/wsgi.py | 126 | """
WSGI config for zulip project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
naslanidis/ansible | refs/heads/devel | lib/ansible/plugins/terminal/nxos.py | 22 | #
# (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
# (at your option) any later version.
#
# Ansible is d... |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/lair/kusak/lair_kusak.py | 85615 | import sys
def setup(core, object):
return |
IronLanguages/ironpython3 | refs/heads/master | Src/StdLib/Lib/ctypes/test/test_buffers.py | 97 | from ctypes import *
from ctypes.test import need_symbol
import unittest
class StringBufferTestCase(unittest.TestCase):
def test_buffer(self):
b = create_string_buffer(32)
self.assertEqual(len(b), 32)
self.assertEqual(sizeof(b), 32 * sizeof(c_char))
self.assertIs(type(b[0]), bytes)... |
xiandiancloud/edxplaltfom-xusong | refs/heads/master | cms/djangoapps/contentstore/features/upload.py | 23 | # pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from lettuce.django import django_url
from django.conf import settings
import requests
import string
import random
import os
from django.contrib.auth.models import User
from student.models import CourseEnrollment
from nose.tools import ass... |
pjryan126/solid-start-careers | refs/heads/master | store/api/zillow/venv/lib/python2.7/site-packages/psycopg2/_json.py | 48 | """Implementation of the JSON adaptation objects
This module exists to avoid a circular import problem: pyscopg2.extras depends
on psycopg2.extension, so I can't create the default JSON typecasters in
extensions importing register_json from extras.
"""
# psycopg/_json.py - Implementation of the JSON adaptation object... |
bq1990/weigh-in | refs/heads/master | weigh_in/settings/common.py | 1 | import os
DEBUG = True
WTF_CSRF_SECRET_KEY = 'a random string'
SECRET_KEY = 'another string'
DEBUG_TB_INTERCEPT_REDIRECTS = False
user = os.environ.get('DATA_DB_USER')
password = os.environ.get('DATA_DB_PASS')
host = os.environ.get('DATA_DB_HOST')
if host:
SQLALCHEMY_DATABASE_URI = 'postgres://{}:{}@{}/gonano'.fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.