repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jkugler/ansible | lib/ansible/playbook/__init__.py | 108 | 3720 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
dya2/python-for-android | python3-alpha/python3-src/Lib/http/cookies.py | 47 | 20357 | #!/usr/bin/env python3
#
####
# 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... | apache-2.0 |
krikru/tensorflow-opencl | tensorflow/python/ops/linalg_grad.py | 61 | 8371 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ohmini/thaifoodapi | lib/django/contrib/gis/geos/collections.py | 292 | 4986 | """
This module houses the Geometry Collection objects:
GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon
"""
import json
from ctypes import byref, c_int, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateM... | bsd-3-clause |
jetskijoe/headphones | lib/unidecode/x091.py | 252 | 4655 | data = (
'Ruo ', # 0x00
'Bei ', # 0x01
'E ', # 0x02
'Yu ', # 0x03
'Juan ', # 0x04
'Yu ', # 0x05
'Yun ', # 0x06
'Hou ', # 0x07
'Kui ', # 0x08
'Xiang ', # 0x09
'Xiang ', # 0x0a
'Sou ', # 0x0b
'Tang ', # 0x0c
'Ming ', # 0x0d
'Xi ', # 0x0e
'Ru ', # 0x0f
'Chu ', # 0x10
'Zi ... | gpl-3.0 |
liu602348184/django | tests/staticfiles_tests/settings.py | 147 | 1039 | from __future__ import unicode_literals
import os.path
from django.utils._os import upath
TEST_ROOT = os.path.dirname(upath(__file__))
TESTFILES_PATH = os.path.join(TEST_ROOT, 'apps', 'test', 'static', 'test')
TEST_SETTINGS = {
'DEBUG': True,
'MEDIA_URL': '/media/',
'STATIC_URL': '/static/',
'MEDIA... | bsd-3-clause |
gpoulin/luigi | test/contrib/sqla_test.py | 5 | 12958 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Gouthaman Balaraman
#
# 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 applic... | apache-2.0 |
Supermaster34/3.0-Kernel-Galaxy-Player-US | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
precedenceguo/mxnet | example/image-classification/symbols/inception-bn.py | 57 | 7598 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
openfun/edx-platform | common/lib/xmodule/xmodule/randomize_module.py | 54 | 3690 | import logging
import random
from xmodule.x_module import XModule, STUDENT_VIEW
from xmodule.seq_module import SequenceDescriptor
from lxml import etree
from xblock.fields import Scope, Integer
from xblock.fragment import Fragment
log = logging.getLogger('edx.' + __name__)
class RandomizeFields(object):
choic... | agpl-3.0 |
chokribr/PIST | modules/webcomment/lib/webcomment_washer.py | 27 | 4062 | from invenio.htmlutils import HTMLWasher
import htmlentitydefs
import cgi
import re
RE_HTML_FIRST_NON_QUOTATION_CHAR_ON_LINE = re.compile('[^>]')
class EmailWasher(HTMLWasher):
"""
Wash comments before being sent by email
"""
line_quotation = ''
def handle_starttag(self, tag, attrs):
"""... | gpl-2.0 |
Changaco/oh-mainline | vendor/packages/Pygments/pygments/lexers/foxpro.py | 335 | 26220 | # -*- coding: utf-8 -*-
"""
pygments.lexers.foxpro
~~~~~~~~~~~~~~~~~~~~~~
Simple lexer for Microsoft Visual FoxPro source code.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygm... | agpl-3.0 |
Evfro/polara | polara/recommender/external/turi/turiwrapper.py | 1 | 8039 | import numpy as np
import turicreate as tc
from polara import RecommenderModel
class TuriFactorizationRecommender(RecommenderModel):
def __init__(self, *args, **kwargs):
self.item_side_info = kwargs.pop('item_side_info', None)
self.user_side_info = kwargs.pop('user_side_info', None)
super(... | mit |
philoniare/horizon | openstack_dashboard/dashboards/identity/groups/urls.py | 64 | 1248 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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... | apache-2.0 |
2014c2g2/2015cdag2_0421 | static/Brython3.1.1-20150328-091302/Lib/ui/widget.py | 706 | 1774 | import random
from browser import doc
def getMousePosition(e):
if e is None:
e=win.event
if e.pageX or e.pageY:
return {'x': e.pageX, 'y': e.pageY}
if e.clientX or e.clientY:
_posx=e.clientX + doc.body.scrollLeft + doc.documentElement.scrollLeft;
_posy=e.clientY + doc.body.scr... | agpl-3.0 |
JIoJIaJIu/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py | 89 | 13047 | import cgi
import json
import os
import traceback
import urllib
import urlparse
from constants import content_types
from pipes import Pipeline, template
from ranges import RangeParser
from request import Authentication
from response import MultipartContent
from utils import HTTPException
__all__ = ["file_handler", "p... | mpl-2.0 |
OpenUpgrade/OpenUpgrade | addons/project_timesheet/__init__.py | 441 | 1084 | # -*- 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 |
SujaySKumar/django | tests/db_functions/tests.py | 193 | 18491 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from unittest import skipIf, skipUnless
from django.db import connection
from django.db.models import CharField, TextField, Value as V
from django.db.models.expressions import RawSQL
from django.db.models.functions import (
Coalesce,... | bsd-3-clause |
smscannell/crazyflie-clients-python | lib/cfclient/ui/widgets/ai.py | 5 | 8202 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
sqlanywhere/sqlany-django | sqlany_django/introspection.py | 1 | 5278 | from django import VERSION as djangoVersion
if djangoVersion[:2] >= (1, 8):
from django.db.backends.base.introspection import BaseDatabaseIntrospection, TableInfo
else:
from django.db.backends import BaseDatabaseIntrospection
from sqlanydb import ProgrammingError, OperationalError
import re
import sqlanydb
cl... | bsd-3-clause |
jtyuan/racetrack | src/cpu/BaseCPU.py | 2 | 13784 | # Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... | bsd-3-clause |
wufulin/PyMusicPlayer | src/util/SongManager.py | 1 | 2318 | #encoding=utf-8
'''
@author: wufulin
'''
import os
import sys
sys.path.append("..")
from util.Tool import *
####################################
#SongManager
#歌曲列表管理类
####################################
class SongManager(object):
'''
播放列表管理器
'''
def __init__(self):
self.__SongList ... | mit |
carsongee/edx-platform | common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py | 40 | 6727 | """
Unit tests for stub XQueue implementation.
"""
import mock
import unittest
import json
import requests
import time
import copy
from ..xqueue import StubXQueueService, StubXQueueHandler
class FakeTimer(object):
"""
Fake timer implementation that executes immediately.
"""
def __init__(self, delay, ... | agpl-3.0 |
scippio/bitcoin | qa/rpc-tests/maxuploadtarget.py | 27 | 10783 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framew... | mit |
rockneurotiko/django | tests/aggregation_regress/tests.py | 82 | 54019 | from __future__ import unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
F, Q, Avg, Coun... | bsd-3-clause |
eeshangarg/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_decorations.py | 19 | 1847 | #! /usr/bin/env python
# $Id: test_decorations.py 4667 2006-07-12 21:40:56Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for the "header" & "footer" directives.
"""
from __init__ import DocutilsTestSupport
def suite():
s = Docuti... | agpl-3.0 |
jinglining/flink | flink-python/setup.py | 5 | 12946 | ################################################################################
# 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... | apache-2.0 |
rlabrecque/CSteamworks | CSteamworks2.py | 1 | 4593 | #!/usr/bin/env python3
import os
from SteamworksParser import steamworksparser
CPP_HEADER = "// This file is automatically generated!\n\n"
g_SkippedFiles = (
# We don't currently support the following interfaces because they don't provide a factory of their own.
# You are expected to call GetISteamGeneric to ... | mit |
sahiljain/catapult | third_party/gsutil/third_party/apitools/apitools/base/py/stream_slice_test.py | 23 | 1677 | """Tests for stream_slice."""
import string
import six
import unittest2
from apitools.base.py import exceptions
from apitools.base.py import stream_slice
class StreamSliceTest(unittest2.TestCase):
def setUp(self):
self.stream = six.StringIO(string.ascii_letters)
self.value = self.stream.getval... | bsd-3-clause |
kiran/bart-sign | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | mit |
rhnvrm/iot-hackerearth | py/sim/wo/work.py | 1 | 5919 | from __future__ import division
import requests
import random
import time
import threading
import rethinkdb as r
import math
import numpy as np
import cv2
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.patches as patches
from scipy.misc import imread
import os
plt.scatter([0,5],[0,5])
plt.io... | mit |
40223226/2015cdbg8 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/process.py | 694 | 2304 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Process', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import itert... | gpl-3.0 |
jymannob/CouchPotatoServer | libs/rtorrent/tracker.py | 173 | 5212 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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, ... | gpl-3.0 |
xzturn/tensorflow | tensorflow/python/autograph/converters/function_scopes.py | 3 | 4844 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
aronparsons/spacewalk | backend/server/rhnServer/satellite_cert.py | 2 | 7227 | #
# 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... | gpl-2.0 |
CENDARI/scrapy | tests/test_log.py | 15 | 5670 | from io import BytesIO
from twisted.python import log as txlog, failure
from twisted.trial import unittest
from scrapy import log
from scrapy.spider import Spider
from scrapy.settings import default_settings
from scrapy.utils.test import get_crawler
class LogTest(unittest.TestCase):
def test_get_log_level(self)... | bsd-3-clause |
Anonymouslemming/ansible | lib/ansible/plugins/action/iosxr_config.py | 46 | 4184 | #
# (c) 2017, 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... | gpl-3.0 |
peihe/incubator-beam | sdks/python/apache_beam/examples/complete/juliaset/juliaset_main.py | 18 | 2269 | #
# 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 us... | apache-2.0 |
romanz/python-trezor | trezorlib/tests/device_tests/test_msg_lisk_getaddress.py | 3 | 1383 | # This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | lgpl-3.0 |
munyirik/python | cpython/Lib/asyncio/queues.py | 3 | 8955 | """Queues"""
__all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty']
import collections
import heapq
from . import events
from . import futures
from . import locks
from .tasks import coroutine
class QueueEmpty(Exception):
"""Exception raised when Queue.get_nowait() is called on a Queue obj... | bsd-3-clause |
gauribhoite/personfinder | env/google_appengine/lib/jinja2-2.6/jinja2/parser.py | 171 | 35218 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.utils impo... | apache-2.0 |
JioCloud/nova | nova/tests/functional/v3/test_volumes.py | 30 | 14313 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 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
#
# Unless required... | apache-2.0 |
MagnetoTesting/magneto | magneto/utils/adb.py | 3 | 11444 | import os
import subprocess
import re
import threading
from functools import wraps
from concurrent.futures import Future, wait
import time
from ..logger import Logger
class ADB(object):
"""
Wrapper for adb commands.
Import::
from magneto.utils.adb import ADB
:required: Android SDK installe... | apache-2.0 |
likelyzhao/mxnet | python/mxnet/_ctypes/symbol.py | 2 | 7644 | # coding: utf-8
# pylint: disable=invalid-name, protected-access, too-many-arguments, global-statement
"""Symbolic configuration API."""
from __future__ import absolute_import as _abs
import ctypes
import sys
import numpy as _numpy
from ..base import _LIB
from ..base import c_array, c_str, mx_uint, py_str
from ..base... | apache-2.0 |
clovis/PhiloLogic4 | python/philologic/runtime/DB.py | 2 | 8445 | """DB class containing many niceties to retrieve data from SQL"""
import hashlib
import os
import sqlite3
from philologic.Config import Config, db_locals_defaults, db_locals_header
from philologic.runtime import Query
from . import HitList
from . import MetadataQuery
from . import QuerySyntax
from .HitWrapper import... | gpl-3.0 |
x2Ident/x2Ident | mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py | 2 | 1832 | #!/usr/bin/env python
'''
@author: David Shaw, david.shaw.aw@gmail.com
Inspired by EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com
----- The MIT License (MIT) -----
Filename: ASWBXMLCodePage.py
Copyright (c) 2014, David P. Shaw
Permission is hereby granted, free of charge, to any pe... | gpl-3.0 |
ryano144/intellij-community | plugins/hg4idea/testData/bin/mercurial/bookmarks.py | 91 | 9671 | # Mercurial bookmark support code
#
# Copyright 2008 David Soria Parra <dsp@php.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from mercurial.i18n import _
from mercurial.node import hex
from mercurial import encoding, error... | apache-2.0 |
AICP/external_chromium_org | tools/check_ecs_deps/check_ecs_deps.py | 43 | 4858 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
''' Verifies that builds of the embedded content_shell do not included
unnecessary dependencies.'''
import os
import re
import string
... | bsd-3-clause |
Gchorba/Ask | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py | 172 | 6278 | from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from co... | mit |
ixc/django-fluent-contents | fluent_contents/plugins/twitterfeed/south_migrations/0001_initial.py | 3 | 6928 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
("fluent_contents", "0001_initial"),
)
def forwards(self, orm):
# Adding model 'TwitterRecentEntriesItem'
... | apache-2.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/module_utils/urls.py | 2 | 44764 | # 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... | bsd-3-clause |
recipy/recipy | integration_test/process.py | 1 | 1547 | """
Functions to execute commands via the operating system.
"""
# Copyright (c) 2016 University of Edinburgh.
from __future__ import (nested_scopes, generators, division,
absolute_import, with_statement,
print_function, unicode_literals)
from subprocess import call
fro... | apache-2.0 |
adereis/avocado | selftests/unit/test_sysinfo.py | 1 | 3553 | import os
import sys
import tempfile
import shutil
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.core import sysinfo
class SysinfoTest(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp(prefix="sysinfo_unittest")
def tes... | gpl-2.0 |
pandaxcl/gyp | test/mac/gyptest-postbuild.py | 345 | 1708 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Verifies that postbuild steps work.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['nin... | bsd-3-clause |
Troyhy/django-registration | registration/backends/simple/urls.py | 63 | 1259 | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | bsd-3-clause |
rande/python-shirka | shirka/responders/math.py | 1 | 1027 | # vim: set fileencoding=utf-8 :
from shirka.responders import Responder
from sympy.parsing.sympy_parser import parse_expr
import exceptions
from shirka.consumers import BaseTestCase
class MathResponder(Responder):
def name(self):
return 'math'
def generate(self, request):
"""
usage: m... | mit |
barbarubra/Don-t-know-What-i-m-doing. | python/src/Lib/ctypes/_endian.py | 153 | 2041 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys
from ctypes import *
_array_type = type(c_int * 3)
def _other_endian(typ):
"""Return the t... | apache-2.0 |
RebuiltBits/django-paypal | paypal/standard/ipn/south_migrations/0004_auto__chg_field_paypalipn_ipaddress.py | 12 | 14525 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'PayPalIPN.ipaddress'
db.alter_column(u'paypal_ipn', 'i... | mit |
phalt/django | django/templatetags/tz.py | 57 | 5411 | from datetime import datetime, tzinfo
import pytz
from django.template import Library, Node, TemplateSyntaxError
from django.utils import six, timezone
register = Library()
# HACK: datetime is an old-style class, create a new-style equivalent
# so we can define additional attributes.
class datetimeobject(datetime,... | bsd-3-clause |
patmcb/odoo | openerp/workflow/instance.py | 314 | 5594 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 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 |
heisencoder/route-finder | third_party/lib/python/django/contrib/sessions/backends/cached_db.py | 103 | 2723 | """
Cached, database-backed sessions.
"""
import logging
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from django.utils.encoding import force_text
KEY_PREFIX = "djan... | mit |
GovReady/govready-q | loadtesting/web.py | 1 | 5269 | import logging
import requests
import structlog
import parsel
from random import sample
import re
from django.test import Client
from django.test import RequestFactory
from siteapp.urls import urlpatterns
from django.urls.exceptions import Resolver404 as Resolver404
from siteapp.models import *
from guidedmodules.m... | gpl-3.0 |
glennhickey/toil-vg | src/toil_vg/test/test_vg.py | 1 | 49176 | import logging
import shlex
import shutil
import subprocess
import tempfile
import textwrap
import filecmp
import shutil
from contextlib import closing
from unittest import TestCase, skip
from urlparse import urlparse
from uuid import uuid4
import urllib2, gzip
import os, sys
import posixpath
import pytest
from toil... | apache-2.0 |
simonwydooghe/ansible | lib/ansible/module_utils/facts/other/ohai.py | 232 | 2307 | # 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 in the hope that ... | gpl-3.0 |
kmcginn/advent-of-code | 2017/day05/jump.py | 1 | 2214 | """
from: http://adventofcode.com/2017/day/5
--- Day 5: A Maze of Twisty Trampolines, All Alike ---
An urgent interrupt arrives from the CPU: it's trapped in a maze of jump instructions, and it would
like assistance from any programs with spare cycles to help find the exit.
The message includes a list of the offsets f... | mit |
rschaad/owlmonitor | docs/conf.py | 1 | 9173 | # -*- coding: utf-8 -*-
#
# OWL Monitor documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 29 14:54:08 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | mit |
davidzchen/jsonnet | case_studies/micromanage/cmds.py | 6 | 2679 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 |
abma/pr-downloader | scripts/update-repos.py | 2 | 1875 | #!/usr/bin/python3
# updates repos.gz
import gzip
import os
wwwroot = "/home/packages/www/repos.springrts.com"
prefix = "http://repos.springrts.com/"
streamer = "/home/packages/bin/Streamer"
repos = {
"main": "http://packages.springrts.com"
}
assert(os.path.isfile(streamer))
def SetupStreamer(repodir):
streamerc... | gpl-2.0 |
Maximilian-Reuter/SickRage-1 | lib/hachoir_parser/program/prc.py | 86 | 2766 | """
PRC (Palm resource) parser.
Author: Sebastien Ponce
Creation date: 29 october 2008
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt16, UInt32, TimestampMac32,
String, RawBytes)
from hachoir_core.endian import BIG_ENDIAN
class PRCHeader(FieldSet):
static_size = 78*8... | gpl-3.0 |
tiagofrepereira2012/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py | 52 | 69800 | # 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 |
lehmannro/pootle | external_apps/profiles/utils.py | 21 | 1467 | """
Utility functions for retrieving and generating forms for the
site-specific user profile model specified in the
``AUTH_PROFILE_MODULE`` setting.
"""
from django import forms
from django.conf import settings
from django.contrib.auth.models import SiteProfileNotAvailable
from django.db.models import get_model
def... | gpl-2.0 |
chuijiaolianying/robotx | robotx/core/__init__.py | 4 | 3209 | """Dealing with all general issues about command line tool set.
And this is command entry point.
"""
import sys
import inspect
import optparse
from robotx.core.base import BaseCommand
from robotx.utils.misc import walk_modules
from robotx.core.exceptions import UsageError
def _iter_command_classes(module_name):
... | mit |
arifgursel/pyglet | examples/programming_guide/hello_world.py | 30 | 2206 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | bsd-3-clause |
MiltosD/CEF-ELRC | misc/tools/generateDS-2.7a/tests/literal1.py | 12 | 6179 | #from out2_sup import *
import out2_sup as model_
rootObj = model_.rootTag(
comments=[
model_.comments(
content_ = [
model_.MixedContainer(1, 0, "", "1. This is a "),
model_.MixedContainer(2, 2, "emp", "foolish"),
model_.MixedContainer(1, 0, "", " comment. ... | bsd-3-clause |
sergiorua/libcloud | libcloud/compute/ssh.py | 10 | 16719 | # 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 |
OsirisSPS/osiris-sps | client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/curses/has_key.py | 154 | 5627 |
#
# Emulation of has_key() function for platforms that don't use ncurses
#
import _curses
# Table mapping curses keys to the terminfo capability name
_capability_names = {
_curses.KEY_A1: 'ka1',
_curses.KEY_A3: 'ka3',
_curses.KEY_B2: 'kb2',
_curses.KEY_BACKSPACE: 'kbs',
_curses.KEY_BEG: 'kbeg',
... | gpl-3.0 |
shanzhenren/ClusType | src/algorithm.py | 1 | 10630 | from collections import defaultdict
from operator import itemgetter
from math import log, sqrt
import random as rn
import time
from numpy import * # install numpy
from scipy import * # install scipy
from numpy.linalg import norm
import numpy.linalg as npl
from scipy.sparse import *
import scipy.sparse.linalg as spsl
fr... | gpl-3.0 |
hakatashi/youtube-dl | youtube_dl/extractor/dw.py | 84 | 4098 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
)
from ..compat import compat_urlparse
class DWIE(InfoExtractor):
IE_NAME = 'dw'
_VALID_URL = r'https?://(?:www\.)?dw\.com/(?:[^/]+/)+(?:av|e)-(?P<id>\d+)'
... | unlicense |
DataReplyUK/datareplyuk | GenesAssociation/spark-2.0.0-bin-hadoop2.7/python/pyspark/ml/param/shared.py | 4 | 21476 | #
# 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 us... | apache-2.0 |
hsaputra/tensorflow | tensorflow/python/saved_model/saved_model.py | 18 | 1768 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
cacahootie/geophoto | geophoto/oembed.py | 1 | 1254 |
from json import loads
from urlparse import urlparse
from flask import current_app as app
from flask import request
def thumbUrl(thumb):
return "https://venturelog.imgix.net/articles/" + thumb + \
"?w=200&h=150&fit=crop&crop=entropy&auto=compress,format"
def html(article):
return '<div><p>' + articl... | mit |
ArmyOfPirates/openwrt | scripts/cfe-partition-tag.py | 27 | 5514 | #!/usr/bin/env python3
"""
CFE Partition Tag
{
u32 part_id;
u32 part_size;
u16 flags;
char part_name[33];
char part_version[21];
u32 part_crc32;
}
"""
import argparse
import os
import struct
PART_NAME_SIZE = 33
PART_VERSION_SIZE = 21
CRC32_INIT = 0xFFFFFFFF
CRC32_TABLE = [
0x00000000, 0x77073096, 0xEE0E612... | gpl-2.0 |
cms-externals/openloops | scons-local/scons-local-2.3.0/SCons/Tool/gettext.py | 11 | 2093 | """gettext tool
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 Software with... | gpl-3.0 |
evancich/apm_min_arm_tone | Tools/scripts/update_wiki.py | 275 | 2870 | #!/usr/bin/env python
'''
update a wordpress wiki page
Andrew Tridgell
May 2013
See http://codex.wordpress.org/XML-RPC_WordPress_API/Posts
'''
import xmlrpclib, sys
from optparse import OptionParser
parser = OptionParser("update_wiki.py [options] <file>")
parser.add_option("--username", help="Wordpress username", de... | gpl-3.0 |
psaylor/ORCA | server/node_modules/binaryjs/node_modules/binarypack/node_modules/buffercursor/node_modules/verror/node_modules/extsprintf/deps/javascriptlint/javascriptlint/jsparse.py | 21 | 15686 | #!/usr/bin/env python2.6
# vim: ts=4 sw=4 expandtab
""" Parses a script into nodes. """
import bisect
import re
import unittest
import spidermonkey
from spidermonkey import tok, op
from util import JSVersion
_tok_names = dict(zip(
[getattr(tok, prop) for prop in dir(tok)],
['tok.%s' % prop for prop in dir(tok... | mit |
qsnake/werkzeug | werkzeug/http.py | 25 | 19243 | # -*- coding: utf-8 -*-
"""
werkzeug.http
~~~~~~~~~~~~~
Werkzeug comes with a bunch of utilities that help Werkzeug to deal with
HTTP data. Most of the classes and functions provided by this module are
used by the wrappers, but they are useful on their own, too, especially if
the response and ... | bsd-3-clause |
tectronics/dojango | dojango/data/__init__.py | 12 | 6298 | import re
__all__ = ('QueryInfo', 'QueryReadStoreInfo',
'JsonRestStoreInfo', 'JsonQueryRestStoreInfo',)
class QueryInfoFeatures(object):
sorting = True
paging = False
class QueryInfo(object):
'''Usage (is that the right solution?):
info = QueryInfo(request)
info.extract()
... | bsd-3-clause |
inuyasha2012/tornado-cat-example | example/main.py | 1 | 8865 | # coding=utf-8
from psycopg2.extras import NamedTupleCursor, Json
from tornado.web import Application, HTTPError
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.httpserver import HTTPServer
from tornado.options import parse_command_line
import momoko
import os
from bank import SelectQuestion, get... | mit |
leishiran/shadowsocks-1 | setup.py | 929 | 1321 | import codecs
from setuptools import setup
with codecs.open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name="shadowsocks",
version="2.8.2",
license='http://www.apache.org/licenses/LICENSE-2.0',
description="A fast tunnel proxy that help you get through firewalls",
... | apache-2.0 |
metaron-uk/xbmc | lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsoleMulticast.py | 202 | 3159 | #!/usr/bin/env python
from struct import *
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_MULTICAST_ADDR = "239.255.255.100"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ... | gpl-2.0 |
MagicSolutions/django-cms | cms/migrations/0001_initial.py | 15 | 30501 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
2014c2g12/c2g12 | wsgi/exts/w2/static/Brython2.0.0-20140209-164925/Lib/_imp.py | 115 | 2013 | """(Extremely) low-level import machinery bits as used by importlib and imp."""
class __loader__(object):pass
def _fix_co_filename(*args,**kw):
raise NotImplementedError("%s:not implemented" % ('_imp.py:_fix_co_filename'))
def acquire_lock(*args,**kw):
"""acquire_lock() -> None Acquires the interpreter's... | gpl-2.0 |
iDTLabssl/kitsune | kitsune/announcements/tests/test_models.py | 17 | 2316 | from datetime import datetime, timedelta
from nose.tools import eq_
from kitsune.announcements.models import Announcement
from kitsune.announcements.tests import announcement
from kitsune.sumo.tests import TestCase
from kitsune.users.tests import user, group, profile
from kitsune.wiki.tests import locale
class Anno... | bsd-3-clause |
fbradyirl/home-assistant | homeassistant/components/vera/sensor.py | 2 | 3569 | """Support for Vera sensors."""
from datetime import timedelta
import logging
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.helpers.entity import Entity
from homeassistant.util import convert
from . import VERA_CONTROLLER,... | apache-2.0 |
Dfelker/ansible | v1/ansible/runner/action_plugins/unarchive.py | 109 | 5211 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Dylan Martin <dmartin@seattlecentral.edu>
#
# 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 v... | gpl-3.0 |
hslee16/ansible-modules-extras | system/pam_limits.py | 22 | 8998 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Sebastien Rohaut <sebastien.rohaut@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | gpl-3.0 |
open-synergy/reporting-engine | report_qweb_element_page_visibility/__openerp__.py | 9 | 1825 | # -*- coding: utf-8 -*-
#########################################################################
# #
# Copyright (C) 2015 Agile Business Group #
# #
... | agpl-3.0 |
mingwpy/scipy | scipy/sparse/linalg/matfuncs.py | 62 | 25583 | """
Sparse matrix functions
"""
#
# Authors: Travis Oliphant, March 2002
# Anthony Scopatz, August 2012 (Sparse Updates)
# Jake Vanderplas, August 2012 (Sparse Updates)
#
from __future__ import division, print_function, absolute_import
__all__ = ['expm', 'inv']
import math
import numpy as np
imp... | bsd-3-clause |
bmanojlovic/ansible | lib/ansible/modules/windows/win_package.py | 9 | 5063 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Trond Hindenes <trond@hindenes.com>, and others
#
# 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 versio... | gpl-3.0 |
TangentMicroServices/ApplicationService | templates/settings.py | 2 | 3541 | """
Django settings for hoursservice project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.