repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
Endika/django | tests/order_with_respect_to/models.py | 61 | 1248 | """
Tests for the order_with_respect_to Meta attribute.
"""
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Question(models.Model):
text = models.CharField(max_length=200)
@python_2_unicode_compatible
class Answer(models.Model):
... | bsd-3-clause |
matiasb/django | tests/fixtures/tests.py | 112 | 38691 | from __future__ import unicode_literals
import os
import sys
import tempfile
import unittest
import warnings
from django.apps import apps
from django.contrib.sites.models import Site
from django.core import management
from django.core.files.temp import NamedTemporaryFile
from django.core.serializers.base import Progr... | bsd-3-clause |
saketkc/statsmodels | statsmodels/sandbox/tests/datamlw.py | 69 | 17628 | import numpy as np
from numpy import array
class Holder(object):
pass
data = Holder()
data.comment = 'generated data, divide by 1000'
data.name = 'data'
data.xo = array([[ -419, -731, -1306, -1294],
[ 6, 529, -200, -437],
[ -27, -833, -6, -564],
[ -304, -273, -502, -739],
... | bsd-3-clause |
buke/odoo-web-cleditor | web_cleditor/controllers/main.py | 2 | 1567 | # -*- coding: utf-8 -*-
##############################################################################
#
# Better WYSIWYG Cleditor
# Copyright 2014 wangbuke <wangbuke@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
mobinseven/poraj | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 601 | 12116 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
zarelit/nodeshot | nodeshot/community/notifications/tasks.py | 8 | 1088 | from celery import task
from django.core import management
from .settings import TEXTS
@task
def purge_notifications():
"""
deletes old notifications
"""
management.call_command('purge_notifications')
# ------ Asynchronous tasks ------ #
@task
def create_notifications(users, notification_model, n... | gpl-3.0 |
zhaohuaw/stock-logistics-warehouse | __unported__/stock_reord_rule/stock_reord_rule.py | 19 | 3291 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Automatic Stock Procurement by days for OpenERP
# Copyright (C) 2012 Sergio Corato (<http://www.icstools.it>)
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | agpl-3.0 |
JimCircadian/ansible | lib/ansible/modules/network/f5/bigiq_utility_license.py | 9 | 13928 | #!/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',
... | gpl-3.0 |
SoftwareMaven/django | tests/auth_tests/test_tokens.py | 297 | 2551 | import unittest
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.test import TestCase
from django.utils.six import PY3
class TokenGeneratorTest(TestCase):
def test_make... | bsd-3-clause |
redhat-cip/dci-control-server | dci/alembic/versions/3750c0221184_add_rh_role_employee.py | 2 | 2197 | #
# Copyright (C) 2018 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
timcastelijn/three.js | utils/converters/fbx/convert_to_threejs.py | 16 | 77099 | # @author zfedoran / http://github.com/zfedoran
import os
import sys
import math
import operator
import re
import json
import types
import shutil
# #####################################################
# Globals
# #####################################################
option_triangulate = True
option_textures = True
o... | mit |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.3/django/utils/termcolors.py | 417 | 6885 | """
termcolors.py
"""
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = dict([(color_names[x], '3%s' % x) for x in range(8)])
background = dict([(color_names[x], '4%s' % x) for x in range(8)])
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink': '5', 'rever... | gpl-3.0 |
caisq/tensorflow | tensorflow/examples/learn/random_forest_mnist.py | 46 | 4095 | # 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 |
cogeorg/BlackRhino | networkx/algorithms/coloring/greedy_coloring_with_interchange.py | 23 | 6665 | import networkx as nx
import itertools
__all__ = ['greedy_coloring_with_interchange']
class Node(object):
__slots__ = ['node_id', 'color', 'adj_list', 'adj_color']
def __init__(self, node_id, n):
self.node_id = node_id
self.color = -1
self.adj_list = None
self.adj_color = [N... | gpl-3.0 |
BollMose/sensor | pms7003.py | 1 | 1949 | #encoding=utf-8
import os
import time
import serial
import sqlite3
from struct import *
def open_device(dev):
return serial.Serial(dev, baudrate=9600, timeout=2.0)
def close_device(ser):
ser.close()
def read_one_data(ser):
rv = b''
while True:
ch1 = ser.read()
if ch1 == b'\x42':
... | apache-2.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/runner/test/test_procmon.py | 49 | 18690 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.runner.procmon}.
"""
from twisted.trial import unittest
from twisted.runner.procmon import LoggingProtocol, ProcessMonitor
from twisted.internet.error import (ProcessDone, ProcessTerminated,
... | apache-2.0 |
ehealthafrica-ci/python-for-android | src/buildlib/jinja2.egg/jinja2/environment.py | 199 | 43213 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... | mit |
wallnerryan/quantum_migrate | quantum/plugins/cisco/db/network_db_v2.py | 2 | 12446 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Cisco Systems, 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... | apache-2.0 |
willizambranoback/evolution_CM13 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
ging/keystone | keystone/tests/unit/common/test_utils.py | 7 | 1897 | # 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 t... | apache-2.0 |
lightcn/odoo | addons/product/__openerp__.py | 262 | 2504 | # -*- 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 |
elopezga/ErrorRate | ivi/agilent/agilentMSO7032A.py | 7 | 1689 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
GyrosOfWar/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | mpl-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/search_engine_results_page_type.py | 1 | 1203 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
yewang15215/django | tests/forms_tests/tests/test_formsets.py | 4 | 59392 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from collections import Counter
from django.forms import (
BaseForm, CharField, DateField, FileField, Form, IntegerField,
SplitDateTimeField, ValidationError, formsets,
)
from django.forms.formsets import BaseFormSet, formset_fact... | bsd-3-clause |
comocheng/RMG-Py | rmgpy/kinetics/falloffTest.py | 4 | 29977 | #!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... | mit |
camptocamp/c2c-rd-addons | c2c_account_payment_extension/account_move_line.py | 4 | 2765 | # -*- coding: utf-8 -*-
##############################################
#
# Swing Entwicklung betrieblicher Informationssysteme GmbH
# (<http://www.swing-system.com>)
# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH
# all rights reserved
# 08-JUN-2012 (GK) created
#
# WARNING: This program as such is intende... | agpl-3.0 |
aristotle-tek/cuny-bdif | AWS/ec2/lib/boto-2.34.0/boto/cognito/sync/__init__.py | 128 | 1675 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
edgarli/proj8 | env/lib/python3.4/site-packages/pymongo/bulk.py | 19 | 21511 | # Copyright 2014-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | artistic-2.0 |
HH890612/MiliCloud | lib/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
ilpianista/ansible | lib/ansible/module_utils/facts/system/service_mgr.py | 38 | 6617 | # Collect facts related to system service manager and init.
#
# 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) a... | gpl-3.0 |
grbd/GBD.Build.BlackJack | blackjack/cmake/storage/SetList.py | 1 | 1558 | from blackjack.cmake.ScriptBase import ScriptBase
class SetList(ScriptBase):
"""
Represents a collection of source files to be passed to a Target
"""
def __init__(self, name: str, srcs: [] = None, parentscope: bool = False):
super().__init__()
self._Name = None
self.Name = na... | apache-2.0 |
tgerdes/toolbot | toolbot/adapter/shell.py | 1 | 1382 | import asyncio
import sys
from toolbot.adapter import Adapter
from toolbot.message import TextMessage
class ShellAdapter(Adapter):
def __init__(self, bot):
super().__init__(bot)
def send(self, envelope, *strings):
for string in strings:
# TODO: async print?
print("\x... | mit |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/Pyevolve-0.6-py2.7.egg/pyevolve/Crossovers.py | 1 | 21075 | """
:mod:`Crossovers` -- crossover methods module
=====================================================================
In this module we have the genetic operators of crossover (or recombination) for each chromosome representation.
"""
from random import randint as rand_randint, choice as rand_choice
from random i... | gpl-2.0 |
stevearc/stiny | fabfile.py | 1 | 5084 | import os
import fabric.api as fab
import jinja2
import json
from fabric.context_managers import path
from fabric.decorators import roles
from pyramid.settings import aslist
from stiny.gutil import normalize_email
fab.env.roledefs = {
'door': ['pi@192.168.86.200'],
'web': ['stevearc@stevearc.com'],
}
def _... | mit |
nowls/gnuradio | gnuradio-runtime/python/gnuradio/gr/qa_hier_block2.py | 25 | 4728 | #
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... | gpl-3.0 |
alisdair/pygments.rb | vendor/pygments-main/pygments/styles/perldoc.py | 135 | 2175 | # -*- coding: utf-8 -*-
"""
pygments.styles.perldoc
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the `perldoc`_ code blocks.
.. _perldoc: http://perldoc.perl.org/
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from... | mit |
DazWorrall/ansible | test/units/modules/system/test_pamd.py | 43 | 10554 | from ansible.compat.tests import unittest
from ansible.modules.system.pamd import PamdRule
from ansible.modules.system.pamd import PamdService
from ansible.modules.system.pamd import update_rule
from ansible.modules.system.pamd import insert_before_rule
from ansible.modules.system.pamd import insert_after_rule
from ans... | gpl-3.0 |
divyekapoor/grepurls | .ycm_extra_conf.py | 1 | 4740 | # Generated by YCM Generator at 2016-02-07 13:10:00.249398
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publis... | mit |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Doc/conf.py | 2 | 5995 | #
# Python documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
import sys, os, time
sy... | lgpl-3.0 |
smi96/django-blog_website | lib/python2.7/site-packages/django/utils/dateformat.py | 110 | 11592 | """
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
from __future__ import unicode_literals
import calendar
import datetime
import re
impo... | mit |
hef/samba | lib/dnspython/tests/flags.py | 68 | 2092 | # Copyright (C) 2003-2007, 2009-2011 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 "... | gpl-3.0 |
ecino/compassion-modules | printer_custom_options/models/printer_option_choice.py | 3 | 1495 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nicolas Bornand
#
# The licence is in the file __manifest__.py
#
################... | agpl-3.0 |
pawelmhm/AutobahnPython | examples/twisted/wamp/basic/pubsub/basic/frontend.py | 15 | 1518 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... | apache-2.0 |
gaboflowers/mallador_v3 | unidecode/x06a.py | 252 | 4674 | data = (
'Di ', # 0x00
'Zhuang ', # 0x01
'Le ', # 0x02
'Lang ', # 0x03
'Chen ', # 0x04
'Cong ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Qing ', # 0x08
'Shuang ', # 0x09
'Fan ', # 0x0a
'Tong ', # 0x0b
'Guan ', # 0x0c
'Ji ', # 0x0d
'Suo ', # 0x0e
'Lei ', # 0x0f
'Lu ', # 0x1... | gpl-3.0 |
vxvinh1511/djangoproject.com | dashboard/views.py | 11 | 1982 | import datetime
import operator
from django.core.cache import cache
from django.forms.models import model_to_dict
from django.http.response import Http404, JsonResponse
from django.shortcuts import render
from .models import Metric
from .utils import generation_key
def index(request):
generation = generation_ke... | bsd-3-clause |
drpngx/tensorflow | tensorflow/contrib/opt/python/training/multitask_optimizer_wrapper_test.py | 33 | 5436 | # 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 |
aboutsajjad/Bridge | app_packages/youtube_dl/extractor/tva.py | 19 | 1894 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
smuggle_url,
)
class TVAIE(InfoExtractor):
_VALID_URL = r'https?://videos\.tva\.ca/details/_(?P<id>\d+)'
_TEST = {
'url': 'https://videos.tva.ca/details/_559681147000... | mit |
scieloorg/articles_meta | articlemeta/decorators.py | 2 | 1782 | # coding: utf-8
import pyramid.httpexceptions as exc
from functools import wraps
class LogHistoryChange(object):
"""
This decorator operate after decorated functions been invoked,
logging information about the event made in the decorated view.
The decorator must receive 2 params:
@param document_... | bsd-2-clause |
exynosS5/android_kernel_samsung_universal5422-stock | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
PetterKun/biblioteca | principal/views.py | 1 | 8531 | #encoding:utf-8
from principal.models import Obra, Video
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.core.mail import EmailMessage
from dja... | apache-2.0 |
mikacashman/CallingApp | lib/CallingApp/CallingAppServer.py | 1 | 23270 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... | mit |
havard024/prego | venv/lib/python2.7/site-packages/whoosh/query/qcore.py | 40 | 22638 | # Copyright 2007 Matt Chaput. 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 the... | mit |
MebiusHKU/flask-web | flask/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 500 | 4208 | from __future__ import absolute_import, division, unicode_literals
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
class Filter(_base.Filter):
def __i... | bsd-3-clause |
robomakery/a20 | src/networkmonitor/netmon.py | 2 | 2791 | #!/usr/bin/env python
# Required python-networkmanager package:
# https://pypi.python.org/pypi/python-networkmanager
# or apt-get install python-networkmanager
"""Listen to StateChanged signal from NetworkManager an
(re)start/stop the application"""
import dbus.mainloop.glib; dbus.mainloop.glib.DBusGMainLoop(set_as_... | gpl-3.0 |
rgommers/numpy | numpy/core/numeric.py | 7 | 76727 | import functools
import itertools
import operator
import sys
import warnings
import numbers
import numpy as np
from . import multiarray
from .multiarray import (
_fastCopyAndTranspose as fastCopyAndTranspose, ALLOW_THREADS,
BUFSIZE, CLIP, MAXDIMS, MAY_SHARE_BOUNDS, MAY_SHARE_EXACT, RAISE,
WRAP, arange, arr... | bsd-3-clause |
ksachs/invenio | modules/bibauthorid/lib/bibauthorid_templates.py | 1 | 142829 | ## -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 the
# License, or (at your option) any late... | gpl-2.0 |
chanyoonzhu/eatquik | requests/auth.py | 109 | 9728 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import threading
import warnings
from base64 import b64encode
from .compat import urlparse, str, basestring
from .cookies import extract_cookies_... | mit |
rspavel/spack | lib/spack/external/_pytest/_code/source.py | 23 | 14218 | from __future__ import absolute_import, division, generators, print_function
from bisect import bisect_right
import sys
import inspect
import tokenize
import py
cpy_compile = compile
try:
import _ast
from _ast import PyCF_ONLY_AST as _AST_FLAG
except ImportError:
_AST_FLAG = 0
_ast = None
class Sour... | lgpl-2.1 |
iw3hxn/LibrERP | mrp_bom_history/wizard/bom_add_note.py | 1 | 1132 | from mail.mail_message import truncate_text
from openerp.osv import orm, fields
from tools.translate import _
class bom_add_note(orm.TransientModel):
"""Adds a new note to the case."""
_name = 'bom.add.note'
_description = "Add Internal Note"
_columns = {
'body': fields.text('Note Body', requ... | agpl-3.0 |
Serag8/Bachelor | google_appengine/lib/django-1.4/django/contrib/gis/geos/mutable_list.py | 405 | 10386 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://www.aryehleib.com/MutableLists.html
Author: Aryeh Leib Taurog.
"""
class ListMixin(obj... | mit |
isandlaTech/cohorte-demos | led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/bundles/cohorte/debug/servlet.py | 4 | 9794 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
COHORTE debug servlet, to visualize the state of the framework in a browser
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not us... | apache-2.0 |
vaas-krish/openthread | tests/scripts/thread-cert/Cert_8_2_01_JoinerRouter.py | 4 | 4608 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# ... | bsd-3-clause |
abhi11/dak | dak/dakdb/update92.py | 7 | 1843 | #!/usr/bin/env python
# coding=utf8
"""
remove per-fingerprint ACLs that are identical to keyring ACL
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2012 Ansgar Burchardt <ansgar@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistrib... | gpl-2.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/prompt_toolkit/key_binding/manager.py | 15 | 3724 | """
DEPRECATED:
Use `prompt_toolkit.key_binding.defaults.load_key_bindings` instead.
:class:`KeyBindingManager` is a utility (or shortcut) for loading all the key
bindings in a key binding registry, with a logic set of filters to quickly to
quickly change from Vi to Emacs key bindings at runtime.
You don't have to us... | gpl-3.0 |
ramanajee/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/dispatch.py | 652 | 14786 | # Copyright 2012, 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 |
opendatateam/udata | udata/core/activity/models.py | 2 | 2070 | from datetime import datetime
from blinker import Signal
from mongoengine.signals import post_save
from udata.models import db
from udata.auth import current_user
from .signals import new_activity
__all__ = ('Activity', )
_registered_activities = {}
class EmitNewActivityMetaClass(db.BaseDocumentMetaclass):
... | agpl-3.0 |
myd7349/Ongoing-Study | python/fileutil.py | 1 | 9062 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# 2015-03-24T08:33+08:00
# 2015-07-07T11:26+08:00 Use temporary file when running unit test
import contextlib
import functools
import hashlib
import io
import os
import sys
try:
import chardet.universaldetector
_chardet_available = True
except ImportError:
... | lgpl-3.0 |
glennguy/plugin.video.9now | resources/lib/menu.py | 1 | 4419 | import xbmcgui
import xbmcplugin
import comm
import config
import sys
import urlparse
import urllib
from aussieaddonscommon import utils
_url = sys.argv[0]
_handle = int(sys.argv[1])
def list_categories():
"""
Make initial list
"""
try:
listing = []
categories = config.CATEGORIES
... | gpl-3.0 |
vrde/pandora | pandora/migrations/0001_initial.py | 1 | 2086 | # -*- 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):
# Adding model 'Item'
db.create_table(u'pandora_item', (
(u'i... | mit |
acil-bwh/SlicerCIP | Scripted/attic/CIP_GetImage/CIP_GetImage.py | 1 | 28162 | """ACIL_GetImage is a module developed for the internal use of the Applied Chest Imaging Laboratory to download
cases stored in MAD server via ssh.
It works both in Unix/Mac/Windows, and it uses an internal SSH key created specifically for this purpose, so it
doesn't need that the user has an authorized SSH key install... | bsd-3-clause |
ahmadia/bokeh | examples/plotting/server/abstractrender.py | 11 | 1708 | from bokeh.plotting import figure, output_server, show
from bokeh.models import ServerDataSource
import bokeh.transforms.ar_downsample as ar
from blaze.server.client import Client
from blaze import Data
output_server("abstractrender")
c = Client('http://localhost:5006')
d = Data(c)
source = ServerDataSource()
source... | bsd-3-clause |
iuliat/nova | nova/cmd/dhcpbridge.py | 41 | 4778 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | apache-2.0 |
j-faria/OPEN | scons/scons-local-2.3.4/SCons/Options/PathOption.py | 9 | 2736 | #
# Copyright (c) 2001 - 2014 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 without restriction, including
# without limitation the rights to use, copy, modify, merge... | mit |
manfredu/gnucash | src/optional/python-bindings/example_scripts/simple_business_create.py | 4 | 6105 | #!/usr/bin/env python
# simple_business_create.py -- Set up a set of books for business feature use
#
# Copyright (C) 2010 ParIT Worker Co-operative <transparency@parit.ca>
# 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... | gpl-2.0 |
patmcb/odoo | addons/point_of_sale/report/pos_invoice.py | 317 | 2393 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
romain-dartigues/ansible | lib/ansible/plugins/callback/timer.py | 143 | 1529 | # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: timer
callback_type: aggregate
requir... | gpl-3.0 |
xkmato/yowsup | yowsup/layers/protocol_groups/protocolentities/notification_groups_create.py | 60 | 4787 | from .notification_groups import GroupsNotificationProtocolEntity
from yowsup.structs import ProtocolTreeNode
class CreateGroupsNotificationProtocolEntity(GroupsNotificationProtocolEntity):
'''
<notification notify="WhatsApp" id="{{id}}" t="1420402514" participant="{{participant_jiid}}" from="{{group_jid}}" type="w... | gpl-3.0 |
calfonso/ansible | lib/ansible/plugins/terminal/eos.py | 24 | 3304 | #
# (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... | gpl-3.0 |
Stane1983/kernel-amlogic-mx | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
Nikpolik/apm | node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
spasovski/zamboni | mkt/collections/tests/test_authorization.py | 3 | 8127 | import json
from urllib import urlencode
from django.contrib.auth.models import User
from nose.tools import ok_
from rest_framework.generics import GenericAPIView
from rest_framework.request import Request
from rest_framework.settings import api_settings
from access.middleware import ACLMiddleware
from amo.tests imp... | bsd-3-clause |
WhireCrow/openwrt-mt7620 | staging_dir/host/lib/python2.7/_pyio.py | 31 | 68418 | """
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... | gpl-2.0 |
shaunstanislaus/grab | test/spider_proxy.py | 11 | 5679 | from test_server import TestServer
import six
from grab import Grab
from grab.spider import Spider, Task
from test.util import BaseGrabTestCase, TEST_SERVER_PORT, build_spider, ADDRESS
from grab.proxylist import BaseProxySource, Proxy
EXTRA_PORT1 = TEST_SERVER_PORT + 1
EXTRA_PORT2 = TEST_SERVER_PORT + 2
PROXY1 = '%s:... | mit |
lunafeng/django | django/contrib/gis/utils/wkt.py | 589 | 1923 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated t... | bsd-3-clause |
mvtuong/mysite | v1/blog/models.py | 1 | 2011 | from django.db import models
from django.db.models import permalink
# Create your models here.
class Blog(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
content = models.TextField(default='', blank=True)
description = models.TextField(default='', blank=True... | apache-2.0 |
fabianbergmark/linux-sctp | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
vlachoudis/sl4a | python/gdata/tests/gdata_tests/calendar/service_test.py | 87 | 15026 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
arnabgho/sklearn-theano | sklearn_theano/externals/google/protobuf/internal/reflection_test.py | 73 | 120413 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 f... | bsd-3-clause |
dpendl00/headphones | lib/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | gpl-3.0 |
MarilyGunnersLab/MCCE | mcce_stable/bin/pdbdict2tpl.py | 1 | 1624 | #!/usr/bin/python2
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
print 'Usage:'
print ' ', sys.argv[0], 'hicup_pdbdict_file'
sys.exit(0)
fin = open(sys.argv[1]).readlines()
for i_line in range(0, len(fin)):
if (fin[i_line][:7] == 'RESIDUE'):
res... | mit |
EvanK/ansible-modules-extras | database/vertica/vertica_role.py | 148 | 8202 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
thejordan95/Groovebot2 | lib/GitPython-0.3.2.RC1/git/index/typ.py | 7 | 4394 | """Module with additional types used by the index"""
from util import (
pack,
unpack
)
from binascii import (
b2a_hex,
)
from git.objects import Blob
__all__ = ('BlobFilter', 'BaseIndexEntry', 'IndexEntry')
#{ Invariants
CE_NAMEMASK = 0x0fff
CE_STAGEMASK = 0x3000
CE_EXTENDED = 0x4000
CE_VA... | gpl-3.0 |
crs4/ProMort | promort/reviews_manager/serializers.py | 2 | 9872 | # Copyright (c) 2019, CRS4
#
# 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, distribu... | mit |
ericgarrigues/ansible-modules-extras | system/modprobe.py | 78 | 3464 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
#
# This file is part of Ansible
#
# This module 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 ... | gpl-3.0 |
enddo/HatKey | Lib/web/contrib/template.py | 3 | 3580 | """
Interface to various templating engines.
"""
import os.path
__all__ = [
"render_cheetah", "render_genshi", "render_mako",
"cache",
]
class render_cheetah:
"""Rendering interface to Cheetah Templates.
Example:
render = render_cheetah('templates')
render.hello(name... | gpl-3.0 |
open-homeautomation/home-assistant | homeassistant/components/input_slider.py | 11 | 5295 | """
Component to offer a way to select a value from a slider.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_slider/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_UNIT_OF_ME... | apache-2.0 |
tjxiter/flask | flask/views.py | 149 | 5644 | # -*- coding: utf-8 -*-
"""
flask.views
~~~~~~~~~~~
This module provides class-based views inspired by the ones in Django.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from .globals import request
from ._compat import with_metaclass
http_method_funcs =... | bsd-3-clause |
athoik/e2openplugin-OpenWebif | plugin/controllers/ER.py | 6 | 2362 | # -*- coding: utf-8 -*-
##############################################################################
# 2013 E2OpenPlugins #
# #
# This file is open source software; you can redistribute... | gpl-2.0 |
ProstoMaxim/incubator-airflow | tests/api/common/experimental/test_pool.py | 27 | 5241 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.