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 |
|---|---|---|---|---|---|
grantsewell/nzbToMedia | libs/unidecode/x065.py | 252 | 4638 | data = (
'Pan ', # 0x00
'Yang ', # 0x01
'Lei ', # 0x02
'Sa ', # 0x03
'Shu ', # 0x04
'Zan ', # 0x05
'Nian ', # 0x06
'Xian ', # 0x07
'Jun ', # 0x08
'Huo ', # 0x09
'Li ', # 0x0a
'La ', # 0x0b
'Han ', # 0x0c
'Ying ', # 0x0d
'Lu ', # 0x0e
'Long ', # 0x0f
'Qian ', # 0x10
'Qi... | gpl-3.0 |
ngannguyen/aimseqtk | src/normalize/normalize.py | 1 | 8169 | #Copyright (C) 2013 by Ngan Nguyen
#
#Released under the MIT license, see LICENSE.txt
'''
Using Bioconductor's metagenomeSeq package normalization to normalize
the samples
'''
import os
import sys
import rpy2.robjects as robjs
import rpy2.robjects.numpy2ri as rpyn
from rpy2.rinterface import NARealType
import gzip
i... | mit |
flyingwip/zoekdeverschillen | node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # Copyright (c) 2013 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | mit |
sudheesh001/oh-mainline | mysite/profile/migrations/0045_remove_static_slash_static_photos.py | 17 | 10858 | # This file is part of OpenHatch.
# Copyright (C) 2009 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later v... | agpl-3.0 |
xxhank/namebench | nb_third_party/dns/rdtypes/nsbase.py | 248 | 2995 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
lhilt/scipy | scipy/special/spfun_stats.py | 27 | 3499 | # Last Change: Sat Mar 21 02:00 PM 2009 J
# Copyright (c) 2001, 2002 Enthought, 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:
#
# a. Redistributions of source code must retain the abov... | bsd-3-clause |
winzard/django-seo2 | tests/settings.py | 3 | 2490 | """
Django settings for tests project.
"""
from __future__ import unicode_literals
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.c... | mit |
ToonTownInfiniteRepo/ToontownInfinite | toontown/hood/MailboxTwoAnimatedProp.py | 5 | 1508 | from toontown.hood import ZeroAnimatedProp
from toontown.toonbase import ToontownGlobals
from direct.directnotify import DirectNotifyGlobal
class MailboxTwoAnimatedProp(ZeroAnimatedProp.ZeroAnimatedProp):
notify = DirectNotifyGlobal.directNotify.newCategory('MailboxTwoAnimatedProp')
PauseTimeMult = base.config... | mit |
samuelchong/libcloud | libcloud/test/loadbalancer/test_slb.py | 4 | 25613 | # 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 |
ellio167/lammps | tools/i-pi/ipi/inputs/thermostats.py | 8 | 9093 | """Deals with creating the thermostats class.
Copyright (C) 2013, Joshua More and Michele Ceriotti
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option... | gpl-2.0 |
girving/tensorflow | tensorflow/contrib/legacy_seq2seq/__init__.py | 165 | 2433 | # 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 |
mdietrichc2c/carrier-delivery | __unported__/delivery_carrier_label_postlogistics/postlogistics/web_service.py | 2 | 14347 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
shankarathi07/linux_motorola_lollipop | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
cloudbase/nova-virtualbox | nova/tests/unit/network/security_group/test_neutron_driver.py | 1 | 13344 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
onitake/ansible | test/units/parsing/test_unquote.py | 298 | 1602 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o... | gpl-3.0 |
google/packet-queue | packet_queue/simulation.py | 1 | 3507 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/django/core/cache/backends/filebased.py | 114 | 4904 | "File-based cache backend"
import hashlib
import os
import shutil
import time
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.utils.encoding import force_bytes
class FileBasedCache(... | bsd-3-clause |
feroda/gasistafelice | gasistafelice/lib/shortcuts.py | 6 | 1242 |
# Copyright (C) 2008 Laboratori Guglielmo Marconi S.p.A. <http://www.labs.it>
#
# This file is part of SANET
# SANET is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License
#
# SANET ... | agpl-3.0 |
p0cisk/Quantum-GIS | python/ext-libs/pygments/lexers/trafficscript.py | 23 | 1546 | # -*- coding: utf-8 -*-
"""
pygments.lexers.trafficscript
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for RiverBed's TrafficScript (RTS) language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexe... | gpl-2.0 |
sestrella/ansible | lib/ansible/modules/network/check_point/cp_mgmt_application_site_category.py | 20 | 5115 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... | gpl-3.0 |
DinoCow/airflow | airflow/migrations/versions/fe461863935f_increase_length_for_connection_password.py | 10 | 1787 | #
# 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... | apache-2.0 |
guijomatos/SickRage | sickbeard/autoPostProcesser.py | 18 | 2060 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/api_lib/app/runtimes/python.py | 3 | 1232 | # 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 |
rosslagerwall/xen | tools/libxl/idl.py | 32 | 12682 | import sys
PASS_BY_VALUE = 1
PASS_BY_REFERENCE = 2
DIR_NONE = 0
DIR_IN = 1
DIR_OUT = 2
DIR_BOTH = 3
_default_namespace = ""
def namespace(s):
if type(s) != str:
raise TypeError, "Require a string for the default namespace."
global _default_namespace
_default_namespace = s
def _get_default_nam... | gpl-2.0 |
Simage/shinken | test/test_reactionner_tag_get_notif.py | 18 | 6785 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | agpl-3.0 |
liangazhou/django-rdp | packages/eclipse/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/_pyio.py | 28 | 68854 | """
Python implementation of the io module.
"""
from __future__ import (print_function, unicode_literals)
import os
import abc
import codecs
import warnings
import errno
# Import thread instead of threading to reduce startup cost
try:
from thread import allocate_lock as Lock
except ImportError:
from dummy_thr... | apache-2.0 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/scons-2.0.1/engine/SCons/Tool/SCCS.py | 61 | 2381 | """SCons.Tool.SCCS.py
Tool-specific initialization for SCCS.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
... | bsd-3-clause |
mmbtba/odoo | addons/document/wizard/__init__.py | 444 | 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... | agpl-3.0 |
reinout/ansible | lib/ansible/plugins/strategy/free.py | 47 | 9177 | # (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 |
sandeepgupta2k4/tensorflow | tensorflow/python/kernel_tests/matrix_triangular_solve_op_test.py | 19 | 5617 | # 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 |
dyn888/youtube-dl | youtube_dl/extractor/europa.py | 48 | 3416 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
orderedSet,
parse_duration,
qualities,
unified_strdate,
xpath_text
)
class EuropaIE(InfoExtractor):
_VALID_URL = r'https?://ec\... | unlicense |
idncom/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/compile_all.py | 384 | 1193 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
BhallaLab/moose-examples | paper-2015/Fig2_elecModels/Fig2A.py | 2 | 23553 |
#/**********************************************************************
#** This program is part of 'MOOSE', the
#** Messaging Object Oriented Simulation Environment.
#** Copyright (C) 2003-2014 Upinder S. Bhalla. and NCBS
#** It is made available under the terms of the
#** GNU Lesser General Public License... | gpl-2.0 |
a-veitch/grpc | src/python/grpcio/grpc/framework/foundation/callable_util.py | 21 | 3960 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
VRToxin-AOSP/android_external_skia | platform_tools/android/gyp_gen/tool_makefile_writer.py | 28 | 3741 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code for generating Android.mk for a tool."""
import android_framework_gyp
import gypd_parser
import makefile_writer
import os
import vars_dict_lib
SKIA_RESOURCE... | bsd-3-clause |
82d28a/laikaboss | laikaboss/modules/explode_ole.py | 3 | 3065 | # Copyright 2015 Lockheed Martin Corporation
#
# 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 agr... | apache-2.0 |
ms-iot/python | cpython/Tools/scripts/findnocoding.py | 48 | 2951 | #!/usr/bin/env python3
"""List all those Python files that require a coding directive
Usage: findnocoding.py dir1 [dir2...]
"""
__author__ = "Oleg Broytmann, Georg Brandl"
import sys, os, re, getopt
# our pysource module finds Python source files
try:
import pysource
except ImportError:
# emulate the modul... | bsd-3-clause |
tuxx42/linux-3.1PNX8550 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
pylixm/sae-django-demo | django1.7-sae/site-packages/django/core/management/commands/createcachetable.py | 55 | 3782 | from optparse import make_option
from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from djan... | apache-2.0 |
EliasTouil/simpleBlog | simpleBlog/Lib/encodings/base64_codec.py | 58 | 2371 | """ Python 'base64_codec' Codec - base64 content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, base64
### Codec APIs
def base64_encode(i... | gpl-3.0 |
dapuck/pyleus | pyleus/cli/topologies.py | 9 | 1835 | """Logic for topologies management.
"""
from __future__ import absolute_import
import zipfile
from pyleus.cli.storm_cluster import LocalStormCluster
from pyleus.cli.storm_cluster import StormCluster
def add_nimbus_arguments(parser):
"""Add Nimbus host/port arguments to the command parser."""
parser.add_argu... | apache-2.0 |
Biktorgj/Gear_1_Kernel | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
proby/ansible-modules-core | cloud/amazon/ec2.py | 10 | 44332 | #!/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 |
ApuliaSoftware/l10n-italy | __unported__/account_vat_period_end_statement/__init__.py | 5 | 1206 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C)... | agpl-3.0 |
mwangaben/spendkit | node_modules/node-gyp/gyp/pylib/gyp/input.py | 713 | 115880 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
pculture/unisubs | apps/videos/decorators.py | 6 | 3137 | from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models
from django.http import Http404
from django.utils.functional import wraps
from videos.models import Video
from subtitles.models import SubtitleVersion
def get_object_or_403(request, qs, **params):
"""Get an object... | agpl-3.0 |
Jarob22/selenium | py/test/selenium/webdriver/safari/conftest.py | 41 | 1087 | # 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
# "License"); you may not... | apache-2.0 |
AlbertoPeon/invenio | modules/webmessage/lib/webmessage.py | 20 | 19732 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 t... | gpl-2.0 |
rafaelmartins/rst2pdf | rst2pdf/tests/test.py | 10 | 5615 | # -*- coding: utf-8 -*-
from autotest import MD5Info, PathInfo, globjoin
from autotest import run_single, dirname, checkmd5
import sys, os
import nose.plugins.skip
class RunTest:
def __init__(self,f):
basename = os.path.basename(f)
self.description = basename
mprefix = os.path.join(PathI... | mit |
charlesmastin/django-simple-cms | simple_cms/contrib/translated_model/haystack/solr.py | 2 | 1654 | from pysolr import SolrError
from haystack.backends.solr_backend import SolrSearchBackend, SolrSearchQuery
from haystack.backends import BaseEngine
from haystack.utils import get_identifier
from simple_cms.contrib.translated_model.models import Language
class MultiLanguageSolrBackend(SolrSearchBackend):
def update... | mit |
stenskjaer/scrapy | scrapy/utils/misc.py | 37 | 3350 | """Helper functions which doesn't fit anywhere else"""
import re
import hashlib
from importlib import import_module
from pkgutil import iter_modules
import six
from w3lib.html import replace_entities
from scrapy.utils.python import flatten, to_unicode
from scrapy.item import BaseItem
_ITERABLE_SINGLE_VALUES = dict,... | bsd-3-clause |
vhazali/cs5331 | assignment3/verifier/scapy-2.3.1/scapy/contrib/ikev2.py | 13 | 14616 | #!/usr/bin/env python
# http://trac.secdev.org/scapy/ticket/353
# scapy.contrib.description = IKEv2
# scapy.contrib.status = loads
from scapy.all import *
import logging
## Modified from the original ISAKMP code by Yaron Sheffer <yaronf.ietf@gmail.com>, June 2010.
import struct
from scapy.packet import *
from sca... | mit |
ClaudeZoo/iDashBoardWeb | Web/views.py | 2 | 4833 | from django.shortcuts import render
from django.shortcuts import HttpResponse
from django.shortcuts import HttpResponseRedirect
from django.contrib.auth.models import User, Group
from django.shortcuts import render_to_response
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.decorators im... | unlicense |
ChameleonCloud/blazar | blazar/api/v1/request_log.py | 3 | 2908 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
knehez/edx-platform | common/djangoapps/terrain/stubs/video_source.py | 181 | 1368 | """
Serve HTML5 video sources for acceptance tests
"""
from SimpleHTTPServer import SimpleHTTPRequestHandler
from .http import StubHttpService
from contextlib import contextmanager
import os
from logging import getLogger
LOGGER = getLogger(__name__)
class VideoSourceRequestHandler(SimpleHTTPRequestHandler):
"""
... | agpl-3.0 |
jam891/omim | 3party/protobuf/python/google/protobuf/pyext/descriptor_cpp2_test.py | 73 | 2506 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... | apache-2.0 |
waseem18/oh-mainline | vendor/packages/Django/django/contrib/gis/db/models/manager.py | 505 | 3578 | from django.db.models.manager import Manager
from django.contrib.gis.db.models.query import GeoQuerySet
class GeoManager(Manager):
"Overrides Manager to return Geographic QuerySets."
# This manager should be used for queries on related fields
# so that geometry columns on Oracle and MySQL are selected
... | agpl-3.0 |
anandology/pyjamas | pygtkweb/demos/022-spinbutton.py | 7 | 5150 | #!/usr/bin/env python
# example spinbutton.py
import pygtk
pygtk.require('2.0')
import gtk
class SpinButtonExample:
def toggle_snap(self, widget, spin):
spin.set_snap_to_ticks(widget.get_active())
def toggle_numeric(self, widget, spin):
spin.set_numeric(widget.get_active())
def change_d... | apache-2.0 |
thodoris/djangoPharma | djangoPharma/env/Lib/encodings/gb2312.py | 816 | 1027 | #
# gb2312.py: Python Unicode Codec for GB2312
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_cn, codecs
import _multibytecodec as mbc
codec = _codecs_cn.getcodec('gb2312')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | apache-2.0 |
alextreme/Django-Bingo | contrib/xlwt/xlwt/Formatting.py | 87 | 8347 | #!/usr/bin/env python
'''
The XF record is able to store explicit cell formatting attributes or the
attributes of a cell style. Explicit formatting includes the reference to
a cell style XF record. This allows to extend a defined cell style with
some explicit attributes. The formatting attributes are div... | bsd-3-clause |
chialiang-8/cloudbase-init | cloudbaseinit/tests/plugins/common/test_createuser.py | 2 | 4376 | # Copyright 2013 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 |
ios-xr/iosxr-ansible | local/library/xr32_install_package.py | 1 | 9451 | #!/usr/bin/python
#------------------------------------------------------------------------------
#
# Copyright (C) 2016 Cisco Systems, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fou... | gpl-3.0 |
mr-daydream/boss | collector/serial/rs485.py | 37 | 3265 | #!/usr/bin/env python
# RS485 support
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
The settings for RS485 are stored in a dedicated object that can be applied to
serial ports (where supported).
NOT... | gpl-3.0 |
TridevGuha/django | tests/gis_tests/distapp/models.py | 259 | 1365 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
from ..utils import gisfield_may_be_null
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
... | bsd-3-clause |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/social/tests/backends/test_dummy.py | 80 | 3932 | import json
import datetime
import time
from httpretty import HTTPretty
from social.actions import do_disconnect
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthForbidden
from social.tests.models import User
from social.tests.backends.oauth import OAuth2Test
class DummyOAuth2(BaseOAu... | agpl-3.0 |
yinquan529/platform-external-chromium_org | tools/nocompile_driver.py | 105 | 16982 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Implements a simple "negative compile" test for C++ on linux.
Sometimes a C++ API needs to ensure that various usages cannot co... | bsd-3-clause |
Vudentz/zephyr | boards/xtensa/intel_adsp_cavs15/tools/lib/platforms.py | 6 | 1736 | #!/usr/bin/env python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
from enum import Enum
# BXT
# CORE ID MASK
CORE_0 = 0x1
CORE_1 = 0x2
CORE_MASK = 0x3
# Number of Input Streams Supported (GCAP[11:8])
NUM_ISS = 6
# Number of Output Streams Supported (GCAP[15:12])
NUM_OSS = 7
# To... | apache-2.0 |
davisein/jitsudone | django/django/db/models/__init__.py | 248 | 1500 | from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from django.db import connection
from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models
from django.db.models.query import Q
from django.db.models.expressions import F
fro... | bsd-3-clause |
caseydavenport/calico-docker | tests/st/bgp/peer.py | 3 | 1090 | # Copyright (c) 2015-2016 Tigera, 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 applicabl... | apache-2.0 |
pelya/commandergenius | project/jni/python/src/Lib/email/parser.py | 392 | 3300 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser']
import warnings
from cStringIO import StringIO
from email.feedparser import FeedParser
... | lgpl-2.1 |
gengwg/leetcode | 474_ones_and_zeros.py | 1 | 3159 | # 474. Ones and Zeroes
# In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.
#
# For now, suppose you are a dominator of m 0s and n 1s respectively.
# On the other hand, there is an array with strings consisting of only 0s and 1s.
#
# Now your task is t... | apache-2.0 |
rvalyi/geraldo | site/newsite/django_1_0/django/contrib/databrowse/sites.py | 11 | 5648 | from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
class AlreadyRegistered(Exception):
pass
class NotRegistered(Exception):
pass
class DatabrowsePlugi... | lgpl-3.0 |
daniel-leschkowski/generateDSv2 | tests/people_procincl1_sub.py | 2 | 11411 | #!/usr/bin/env python
#
# Generated by generateDS.py.
#
import sys
import people_procincl2_sup as supermod
etree_ = None
Verbose_import_ = False
( XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_library = None
try:
# lxml
from lxml import e... | mit |
PsychoTV/PsychoTeam.repository | plugin.video.specto/resources/lib/resolvers/v_vids.py | 23 | 1385 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
joe-parente/CheckRecon | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distrib... | bsd-3-clause |
hackerbot/DjangoDev | django/contrib/gis/db/models/query.py | 4 | 36670 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... | bsd-3-clause |
yorvic/.vim | bundle/python-mode/pylibs/ropemode/environment.py | 9 | 1925 | class Environment(object):
def ask(self, prompt, default=None, starting=None):
pass
def ask_values(self, prompt, values, default=None, starting=None):
pass
def ask_directory(self, prompt, default=None, starting=None):
pass
def ask_completion(self, prompt, values, starting=Non... | gpl-3.0 |
nightjean/Deep-Learning | tensorflow/python/estimator/canned/dnn.py | 3 | 15021 | # 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 |
harisbal/pandas | pandas/tests/series/test_asof.py | 4 | 5228 | # coding=utf-8
import numpy as np
import pytest
from pandas import Series, Timestamp, date_range, isna, notna, offsets
import pandas.util.testing as tm
class TestSeriesAsof():
def test_basic(self):
# array or list or dates
N = 50
rng = date_range('1/1/1990', periods=N, freq='53s')
... | bsd-3-clause |
gsb-eng/asyncio | asyncio/selectors.py | 16 | 18697 | """Selectors module.
This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
"""
from abc import ABCMeta, abstractmethod
from collections import namedtuple, Mapping
import math
import select
import sys
# generic events, that must be mapped to implementation-specific... | apache-2.0 |
supracd/pygal | pygal/svg.py | 3 | 13554 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2015 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 |
glennw/servo | tests/wpt/web-platform-tests/webvtt/webvtt-file-format-parsing/webvtt-cue-text-parsing-rules/buildtests.py | 75 | 1952 | #!/usr/bin/python
import os
import urllib
import hashlib
doctmpl = """<!doctype html>
<title>WebVTT cue data parser test %s</title>
<style>video { display:none }</style>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/html/syntax/parsing/template.js><... | mpl-2.0 |
manelore/django-haystack | tests/whoosh_tests/tests/forms.py | 10 | 1285 | # To ensure spelling suggestions work...
from django.conf import settings
from django.http import HttpRequest
from haystack.forms import SearchForm
from haystack.views import SearchView
from whoosh_tests.tests.whoosh_backend import LiveWhooshRoundTripTestCase
# Whoosh appears to flail on providing a useful suggestion... | bsd-3-clause |
sunqb/oa_qian | flask/Lib/site-packages/openid/extensions/draft/pape5.py | 156 | 16391 | """An implementation of the OpenID Provider Authentication Policy
Extension 1.0, Draft 5
@see: http://openid.net/developers/specs/
@since: 2.1.0
"""
__all__ = [
'Request',
'Response',
'ns_uri',
'AUTH_PHISHING_RESISTANT',
'AUTH_MULTI_FACTOR',
'AUTH_MULTI_FACTOR_PHYSICAL',
'LEVELS_NIST',
... | apache-2.0 |
fernandezcuesta/ansible | lib/ansible/modules/system/debconf.py | 9 | 5418 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Brian Coca <briancoca+ansible@gmail.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... | gpl-3.0 |
aalmah/pylearn2 | pylearn2/config/old_config.py | 45 | 1417 | import yaml
import inspect
import types
from pylearn2.utils.exc import reraise_as
global resolvers
def load(json_file_path):
""" given a file path to a json file, returns the dictionary definde by the json file """
f = open(json_file_path)
lines = f.readlines()
f.close()
content = ''.join(lines... | bsd-3-clause |
trosa/forca | gluon/contrib/pyrtf/Renderer.py | 2 | 26037 | from types import StringType, ListType, TupleType
from copy import deepcopy
from Elements import *
DEFAULT_TAB_WIDTH = 720
ParagraphAlignmentMap = { ParagraphPropertySet.LEFT : 'ql',
ParagraphPropertySet.RIGHT : 'qr',
ParagraphPropertySet.CENTER : 'qc... | gpl-2.0 |
MoamerEncsConcordiaCa/tensorflow | tensorflow/python/util/future_api_test.py | 173 | 1177 | # 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 |
nerdvegas/rez | src/rez/cli/help.py | 4 | 2625 | """
Utility for displaying help for the given package.
"""
from __future__ import print_function
def setup_parser(parser, completions=False):
parser.add_argument("-m", "--manual", dest="manual", action="store_true",
default=False,
help="Load the rez technical user m... | lgpl-3.0 |
ttindell2/openshift-ansible | roles/lib_openshift/src/class/oc_adm_registry.py | 45 | 17506 | # pylint: skip-file
# flake8: noqa
class RegistryException(Exception):
''' Registry Exception Class '''
pass
class RegistryConfig(OpenShiftCLIConfig):
''' RegistryConfig is a DTO for the registry. '''
def __init__(self, rname, namespace, kubeconfig, registry_options):
super(RegistryConfig, s... | apache-2.0 |
appleseedhq/gaffer | startup/GafferScene/parentCompatibility.py | 8 | 2548 | ##########################################################################
#
# Copyright (c) 2019 Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | bsd-3-clause |
jaggu303619/asylum | openerp/addons/account/report/account_aged_partner_balance.py | 13 | 21106 | # -*- 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 |
nicfit/nicfit.py | tests/test_console.py | 1 | 4219 | import os
import types
import logging
from unittest.mock import patch
import pytest
from nicfit.console import pout, perr
from nicfit.console.ansi import Fg, Bg, Style, init as ansi_init
import contextlib
@contextlib.contextmanager
def envvars(*vars):
saved = {}
for v in vars:
saved[v] = os.environ[v]... | mit |
svenkreiss/decouple | Decouple/fullModel_utils.py | 1 | 4848 | #!/usr/bin/env python
# Created on: October 8, 2013
__author__ = "Sven Kreiss, Kyle Cranmer"
__version__ = "0.1"
import ROOT
def getNll( pdf, data, minStrategy=0, enableOffset=True, globObs=None ):
""" Generic functions to use with minimize() from BatchProfileLikelihood. """
# config minimizer
ROOT.RooAbsRea... | mit |
seem-sky/kbengine | kbe/src/lib/python/Lib/test/test_sort.py | 169 | 9164 | from test import support
import random
import sys
import unittest
from functools import cmp_to_key
verbose = support.verbose
nerrors = 0
def check(tag, expected, raw, compare=None):
global nerrors
if verbose:
print(" checking", tag)
orig = raw[:] # save input in case of error
if compar... | lgpl-3.0 |
tperrier/mwachx | contacts/urls.py | 1 | 1223 | from django.conf.urls import patterns, include, url
from rest_framework import routers
import views
from serializers import router
# from views import angular_views
urlpatterns = patterns('',
# DRF API viewer
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^api/v0.1... | apache-2.0 |
apyrgio/snf-ganeti | test/py/cmdlib/testsupport/lock_manager_mock.py | 1 | 2465 | #
#
# Copyright (C) 2013 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and ... | bsd-2-clause |
maxdeliso/elevatorSim | Lib/idlelib/ClassBrowser.py | 67 | 6371 | """Class browser.
XXX TO DO:
- reparse when source changed (maybe just a button would be OK?)
(or recheck on window popup)
- add popup menu with more options (e.g. doc strings, base classes, imports)
- show function argument list? (have to do pattern matching on source)
- should the classes and methods lists also... | bsd-2-clause |
katyushacccp/ISN_projet_final | alpha 1.3 (graphique lag, abandon)/test.py | 1 | 1507 | from time import *
from tkinter import *
from random import *
from modules.affichage import *
from modules.mouvements import *
def melange(root,cube,can,nombre):
global timeur
root.config(cursor="wait")
melangeur(cube,can,nombre)
root.after(nombre*timeur,lambda:root.config(cursor="gumby"))
def test():... | cc0-1.0 |
revmischa/boto | boto/cognito/identity/exceptions.py | 135 | 1125 | # The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOS... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.