repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
jasonseminara/OpenSourceFinal
refs/heads/master
myvenv/lib/python3.5/site-packages/django/db/models/sql/datastructures.py
270
""" Useful auxiliary data structures for query construction. Not useful outside the SQL domain. """ from django.db.models.sql.constants import INNER, LOUTER class EmptyResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-val...
citrix-openstack-build/keystone
refs/heads/master
keystone/credential/routers.py
8
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation # # 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 # # Unle...
dmitriy0611/django
refs/heads/master
django/http/cookie.py
460
from __future__ import unicode_literals import sys from django.utils import six from django.utils.encoding import force_str from django.utils.six.moves import http_cookies # Some versions of Python 2.7 and later won't need this encoding bug fix: _cookie_encodes_correctly = http_cookies.SimpleCookie().value_encode(';...
rizaon/limbo
refs/heads/master
test/test_plugins/test_gif.py
11
# -*- coding: UTF-8 -*- import os import sys from nose.tools import eq_ import vcr DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins')) from gif import on_message # The set of valid gifs given the bananas fixture bananas_gifs = [u'http://fc05.deviantart.net/...
FEDEVEL/openrex-linux-3.14
refs/heads/jethro
tools/perf/scripts/python/event_analyzing_sample.py
4719
# 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...
PearsonIOKI/compose-forum
refs/heads/master
askbot/tests/__init__.py
13
from askbot.tests.cache_tests import * from askbot.tests.email_alert_tests import * from askbot.tests.on_screen_notification_tests import * from askbot.tests.page_load_tests import * from askbot.tests.permission_assertion_tests import * from askbot.tests.db_api_tests import * from askbot.tests.skin_tests import * from ...
Lemma1/MAC-POSTS
refs/heads/master
doc_builder/sphinx-contrib/googlechart/sphinxcontrib/googlechart/regions.py
2
# -*- coding: utf-8 -*- region_code_map = { 'aichi': 'JP-23', 'akita': 'JP-05', 'aomori': 'JP-02', 'chiba': 'JP-12', 'ehime': 'JP-38', 'fukui': 'JP-18', 'fukuoka': 'JP-40', 'fukushima': 'JP-07', 'gifu': 'JP-21', 'gunma': 'JP-10', 'hiroshima': 'JP-34', 'hokkaido': 'JP-01'...
aam-at/tensorflow
refs/heads/master
tensorflow/lite/testing/op_tests/unique.py
16
# Copyright 2019 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...
markeTIC/OCB
refs/heads/8.0
addons/stock_account/__openerp__.py
269
# -*- 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...
Shanec132006/project
refs/heads/master
lib/flask/testsuite/testing.py
561
# -*- coding: utf-8 -*- """ flask.testsuite.testing ~~~~~~~~~~~~~~~~~~~~~~~ Test client and more. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase from flask._compat import text_type c...
pratikmallya/heat
refs/heads/master
heat/tests/test_hot.py
2
# # 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 # ...
Noviat/odoo
refs/heads/8.0
addons/crm_project_issue/project_issue.py
380
from openerp.osv import osv, fields class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ _name = "crm.lead2projectissue.wizard" _inherit = 'crm.partner.binding' _columns = { "lead_id": fields.many2one("crm....
edx-solutions/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py
4
""" Tests for ProctoredExamTransformer. """ import ddt import six from milestones.tests.utils import MilestonesTestCaseMixin from mock import Mock, patch from gating import api as lms_gating_api from lms.djangoapps.course_blocks.api import get_course_blocks from lms.djangoapps.course_blocks.transformers.tests.helper...
jacshfr/mozilla-bedrock
refs/heads/master
vendor-local/packages/pytz/pytz/tests/test_tzinfo.py
12
# -*- coding: ascii -*- import sys, os, os.path import unittest, doctest try: import cPickle as pickle except ImportError: import pickle from datetime import datetime, time, timedelta, tzinfo import warnings if __name__ == '__main__': # Only munge path if invoked as a script. Testrunners should have setup...
CLOUGH/info3180-project-3
refs/heads/master
lib/werkzeug/debug/console.py
314
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
clickyspinny/clickyspinny
refs/heads/master
website/urls.py
2
from django.conf.urls import patterns, include, url from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('django.views.generic.simple', # Examples: # url(r'^$', 'website.views.home', name='home'), ...
nirs/vdsm
refs/heads/master
lib/vdsm/network/link/bond/sysfs_options.py
2
# Copyright 2016-2017 Red Hat, 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 Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in...
SFPD/rlreloaded
refs/heads/master
control4/misc/func_utils.py
1
import cPickle ################################ # Basic stuff def identity(x): return x ################################ # Mapreduce def sum_reducer(it_sum): total_sum = None for vec in it_sum: if total_sum is None: total_sum = vec else: total_sum += vec return total_sum def sum_cou...
robbi/pyload
refs/heads/stable
module/plugins/internal/Container.py
4
# -*- coding: utf-8 -*- from __future__ import with_statement import os import urlparse from .Crypter import Crypter from .misc import encode, exists class Container(Crypter): __name__ = "Container" __type__ = "container" __version__ = "0.13" __status__ = "stable" __pattern__ = r'^unmatchable$...
indictranstech/trufil-frappe
refs/heads/develop
frappe/patches/v4_0/enable_scheduler_in_system_settings.py
73
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.utils.scheduler import disable_scheduler, enable_scheduler from frappe.utils import cint def execute(): frappe.reload_doc("core", "doctype", "system_se...
briancurtin/python-openstacksdk
refs/heads/master
openstack/tests/unit/workflow/test_execution.py
1
# 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...
Brunux/shityjobs
refs/heads/master
categories/admin.py
13848
from django.contrib import admin # Register your models here.
vesellov/bitdust.devel
refs/heads/master
storage/backup.py
1
#!/usr/bin/python # backup.py # # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (backup.py) is part of BitDust Software. # # BitDust 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 Found...
jur/linux
refs/heads/master
tools/perf/scripts/python/event_analyzing_sample.py
4719
# 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...
HiSPARC/station-software
refs/heads/master
user/python/Lib/lib2to3/pygram.py
6
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Export the Python grammar and symbols.""" # Python imports import os # Local imports from .pgen2 import token from .pgen2 import driver from . import pytree # The grammar file _GRAMMAR_FILE = os.path.join(os.path....
ehouarn-perret/EhouarnPerret.Python.HackerRank
refs/heads/master
2 - Data Structures/2 - Linked Lists/8 - Compare two linked lists.py
1
""" Merge two linked list head could be None as well for empty list. Return back the head of the linked list in the below method. """ from . import Node def compare_recursive(head_a, head_b): if not head_a and not head_b: # return True return 1 elif (head_a and head_b) and (head_a.data == head_b.data): return...
lache/RacingKingLee
refs/heads/master
monitor/engine.win64/2.74/python/lib/json/__init__.py
83
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally m...
listamilton/supermilton.repository
refs/heads/supermilton.repository
script.areswizard/requests/packages/urllib3/request.py
853
try: from urllib.parse import urlencode except ImportError: from urllib import urlencode from .filepost import encode_multipart_formdata __all__ = ['RequestMethods'] class RequestMethods(object): """ Convenience mixin for classes who implement a :meth:`urlopen` method, such as :class:`~urllib3....
EricNeedham/assignment-1
refs/heads/master
venv/lib/python2.7/site-packages/jinja2/environment.py
614
# -*- 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 BLOCK_S...
BizzCloud/PosBox
refs/heads/master
addons/google_calendar/controllers/main.py
420
import openerp.addons.web.http as http from openerp.addons.web.http import request class google_calendar_controller(http.Controller): @http.route('/google_calendar/sync_data', type='json', auth='user') def sync_data(self, arch, fields, model, **kw): """ This route/function is called when ...
jhaux/tensorflow
refs/heads/master
tensorflow/python/tools/strip_unused_lib.py
104
# pylint: disable=g-bad-file-header # 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/LICENS...
uberamd/NGECore2
refs/heads/master
scripts/object/static/item/item_vibroaxe.py
85615
import sys def setup(core, object): return
uberamd/NGECore2
refs/heads/master
scripts/object/building/kashyyyk/grievous_encounter_cell_production.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/tcg/series6/painting_travel_ad_coruscant.py
85615
import sys def setup(core, object): return
totalgood/nlpia
refs/heads/master
src/nlpia/talk.py
1
""" Speech recognition and generation tools based on pocketsphinx and wavenet """ import os import numpy as np import pyaudio as pa from pocketsphinx import pocketsphinx as ps # from sphinxbase import sphinxbase as sb import logging try: from nlpia.constants import DATA_PATH except ImportError: DATA_PATH=os....
chuan9/chromium-crosswalk
refs/heads/master
build/toolchain/win/setup_toolchain.py
38
# Copyright (c) 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. # # Copies the given "win tool" (which the toolchain uses to wrap compiler # invocations) and the environment blocks for the 32-bit and 64-bit builds on #...
pbromwelljr/crack_py
refs/heads/master
processes/whois.py
1
"""Contains classes used to interact with the 'whois' program.""" import processes.base class WhoIsProcess(processes.base.BaseProcess): """ Class used to interact with the 'whois' program. :q """ # TODO: Docstrings def __init__(self, query, *, display_version=False, display_help_text=F...
Naereen/mazhe
refs/heads/master
phystricksToreRevolution.py
1
from phystricks import * def ToreRevolution(): pspict,fig = SinglePicture("ToreRevolution") a=3 R=1 C = Point(0,a) cercle = Circle(C,R) cercle.parameters.color="brown" O = Point(0,0) measure = MeasureLength(Segment(O,C),R+0.5) measure.put_mark(0.3,measure.advised_mark_angle(pspict)...
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping
refs/heads/master
src/dev/x86/Cmos.py
69
# Copyright (c) 2008 The Regents of The University of Michigan # 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 ...
arnavd96/Cinemiezer
refs/heads/master
myvenv/lib/python3.4/site-packages/django/core/management/commands/flush.py
115
from __future__ import unicode_literals import sys from importlib import import_module from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_style from django.core.management.sql import emit_post_migrate_signal, sql_flush from django...
naototty/vagrant-lxc-ironic
refs/heads/master
ironic/tests/drivers/ilo/test_inspect.py
2
# Copyright 2014 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 required by applicabl...
danielkupco/PyMaJORME
refs/heads/master
pymajorme/generators/sql_gen.py
1
import os import jinja2 import helpers.javatype as javatype import datetime import pymajorme_config import hashlib from helpers.pack import pack from helpers.constraints import * TEMPLATE_NAME = 'sql.template' def filter_sql_type(attribute_type): sql_types = { 'Integer' : 'INT', 'String' : 'VA...
vandenheuvel/tribler
refs/heads/master
Tribler/Core/Modules/channel/cache.py
2
import codecs import json import logging import os class SimpleCache(object): """ This is a cache for recording the keys that we have seen before. """ def __init__(self, file_path): self._logger = logging.getLogger(self.__class__.__name__) self._file_path = file_path self._cac...
unigent/OpenWrt-Firefly-SDK
refs/heads/master
staging_dir/host/lib/scons-2.3.1/SCons/Tool/sunlink.py
11
"""SCons.Tool.sunlink Tool-specific initialization for the Sun Solaris (Forte) linker. 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, 2...
xin3liang/platform_external_chromium_org_third_party_WebKit
refs/heads/master
Source/devtools/PRESUBMIT.py
2
# Copyright (C) 2014 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 ...
asgard-lab/neutron
refs/heads/master
neutron/tests/unit/extensions/test_flavors.py
16
# # 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 # ...
jjdmol/LOFAR
refs/heads/master
LCU/StationTest/tc/rsr_overwrite.py
2
"""Overwrite and readback RSR""" ################################################################################ # - Verify options rspId = tc.rspId value = 0xBC value = arg_data[0] & 0xFF # Use overwrite byte value from arg_data list if not (arg_procid in ['rsp', 'eth', ...
sankhesh/VTK
refs/heads/master
ThirdParty/Twisted/twisted/plugins/twisted_portforward.py
83
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.application.service import ServiceMaker TwistedPortForward = ServiceMaker( "Twisted Port-Forwarding", "twisted.tap.portforward", "A simple port-forwarder.", "portforward")
MicroPyramid/Django-CRM
refs/heads/master
leads/migrations/0012_lead_company.py
1
# Generated by Django 2.2.10 on 2020-04-27 10:41 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("common", "0020_auto_20200409_1653"), ("leads", "0011_auto_20200401_0937"), ] operations = [ migrat...
dgzurita/odoo
refs/heads/8.0
addons/pos_restaurant/restaurant.py
325
# -*- 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...
ojake/django
refs/heads/master
tests/model_options/test_tablespaces.py
337
from __future__ import unicode_literals from django.apps import apps from django.conf import settings from django.db import connection from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from .models.tablespaces import ( Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef, ) def ...
arju88nair/projectCulminate
refs/heads/master
venv/lib/python3.5/site-packages/pip/vcs/mercurial.py
514
from __future__ import absolute_import import logging import os import tempfile from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip._vendor.six.moves import configparser logger = logging.getLogger(__name__) class Mercurial(VersionControl...
userYKK/pythonTry
refs/heads/master
python27/Basic/demo7.py
1
#!/usr/bin/python # -*- coding: UTF-8 -*- # 文件 I/O print "############################## 1. raw_input函数,input函数" print ' input 可以接收一个Python表达式作为输入,并将运算结果返回' print "############################## 2. open打开文件,close(),File文件操作,OS文件夹/目录操作" fo = open("tempDel.py", "rb") print "文件名: ", fo.name print "是否已关闭 : ", fo.closed...
SchrodingersGat/InvenTree
refs/heads/master
InvenTree/company/migrations/0032_auto_20210403_1837.py
2
# Generated by Django 3.0.7 on 2021-04-03 18:37 import InvenTree.fields import company.models import django.core.validators from django.db import migrations, models import django.db.models.deletion import markdownx.models import stdimage.models class Migration(migrations.Migration): dependencies = [ ('c...
ButterflyNetwork/bazel
refs/heads/master
examples/py_native/fibonacci/fib.py
36
"""An example binary to test the imports attribute of native Python rules.""" def Fib(n): if n == 0 or n == 1: return 1 else: return Fib(n-1) + Fib(n-2)
shubhamdhama/zulip
refs/heads/master
zerver/management/commands/restore_messages.py
4
from typing import Any from django.core.management.base import CommandParser from zerver.lib.management import ZulipBaseCommand from zerver.lib.retention import ( restore_all_data_from_archive, restore_data_from_archive, restore_data_from_archive_by_realm, ) from zerver.models import ArchiveTransaction ...
ojengwa/sympy
refs/heads/master
sympy/series/tests/test_nseries.py
4
from sympy import (Symbol, Rational, ln, exp, log, sqrt, E, O, pi, I, sinh, sin, cosh, cos, tanh, coth, asinh, acosh, atanh, acoth, tan, cot, Integer, PoleError, floor, ceiling, asin, symbols, limit, Piecewise, Eq, sign, Derivative) from sympy.abc import x, y, z from sympy.utilities.pytest import raises, X...
mattBrzezinski/Hydrogen
refs/heads/master
robot-controller/Study/EmpathyRandomButton.py
1
from PyQt4 import QtGui from Action import BaseAction from Action import Motion from Action import Stiffness from EmpathyMotionList import EmpathyMotionList import random class EmpathyRandomButton(QtGui.QPushButton): INDEX_ACTIONS = 0 INDEX_MOTION = 1 def __init__(self, label): super(EmpathyRando...
klshxsh/docker
refs/heads/master
vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1233
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
CouchPotato/CouchPotatoV1
refs/heads/master
library/git/__init__.py
121
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
Fafou/Sick-Beard
refs/heads/development
cherrypy/_cptools.py
39
"""CherryPy tools. A "tool" is any helper, adapted to CP. Tools are usually designed to be used in a variety of ways (although some may only offer one if they choose): Library calls: All tools are callables that can be used wherever needed. The arguments are straightforward and should be detai...
shermanng10/superathletebuilder
refs/heads/master
env/lib/python2.7/site-packages/psycopg2/tests/test_copy.py
39
#!/usr/bin/env python # test_copy.py - unit test for COPY support # # Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 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,...
ste616/atca
refs/heads/master
atsenscalc/code/refract.py
1
###################################################################### # The ATCA Sensitivity Calculator # Atmospheric refraction calculation routines. # Copyright 2015 Jamie Stevens, CSIRO # # This file is part of the ATCA Sensitivity Calculator. # # The ATCA Sensitivity Calculator is free software: you can # redistri...
ucrawler/cp-uc
refs/heads/master
couchpotato/core/_base/_core.py
1
from uuid import uuid4 import os import platform import signal import time import traceback import webbrowser import sys from couchpotato.api import addApiView from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.variable import cleanHost, md5, isSubFolder, compareVersions from couchpot...
strint/tensorflow
refs/heads/master
tensorflow/contrib/graph_editor/tests/select_test.py
109
# 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...
yewang15215/django
refs/heads/master
django/utils/translation/trans_null.py
53
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text def ngettext...
jortel/pulp_puppet
refs/heads/master
pulp_puppet_extensions_consumer/pulp_puppet/extensions/consumer/structure.py
4
from gettext import gettext as _ SECTION_ROOT = 'puppet' DESC_ROOT = _('manage Puppet bindings') def ensure_puppet_root(cli): """ Verifies that the root of puppet-related commands exists in the CLI, creating it using constants from this module if it does not. :param cli: CLI instance being configure...
angryrancor/kivy
refs/heads/master
kivy/core/window/window_pygame.py
28
''' Window Pygame: windowing provider based on Pygame ''' __all__ = ('WindowPygame', ) # fail early if possible import pygame from kivy.compat import PY2 from kivy.core.window import WindowBase from kivy.core import CoreCriticalException from os import environ from os.path import exists, join from kivy.config import...
nishad-jobsglobal/odoo-marriot
refs/heads/master
addons/project_issue_sheet/__openerp__.py
260
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
jvdm/AutobahnPython
refs/heads/master
autobahn/websocket/test/test_protocol.py
4
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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...
adieu/django-nonrel
refs/heads/master
django/conf/locale/en/formats.py
318
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'N j, Y' TIME_FORMAT = 'P' DATETIME_FORMAT = 'N j, Y, P' YEAR_MONTH_FORMAT...
wri/gfw-sync
refs/heads/master
api/metadata_api.py
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import os import sys import gspread from oauth2client.service_account import ServiceAccountCredentials import io import markdown2 lkpColName_to_mdName = {'Map Service URL': u'map_service', 'Title': u'title', ...
lbishal/scikit-learn
refs/heads/master
examples/cluster/plot_mini_batch_kmeans.py
265
""" ==================================================================== Comparison of the K-Means and MiniBatchKMeans clustering algorithms ==================================================================== We want to compare the performance of the MiniBatchKMeans and KMeans: the MiniBatchKMeans is faster, but give...
tiwanacote/simpleDSO-V4.0
refs/heads/master
math_operations (copy).py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # import math class Math: # init def __init__(self): """ Init of basic data. Chanel data is not expressed as volts, it seems to be expressed as pixels dots (Useful way to make easy to draw wave). In Y direction, zero (Dot) is at bottom (Not at middle of ...
VaybhavSharma/commons
refs/heads/master
tests/python/twitter/checkstyle/plugins/test_newlines.py
13
from twitter.checkstyle.common import Nit, PythonFile from twitter.checkstyle.plugins.newlines import Newlines TOPLEVEL = """ def foo(): pass%s %s pass """ def test_newlines(): for toplevel_def in ('def bar():', 'class Bar(object):'): for num_newlines in (0, 1, 3, 4): newlines = Newlines(PythonFile.f...
chennan47/osf.io
refs/heads/develop
osf/migrations/0028_auto_20170504_1548.py
28
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-04 20:48 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0027_auto_20170428_1435'), ] operations = [ migrations.AlterModelOptions( ...
AnishShah/tensorflow
refs/heads/master
tensorflow/tools/api/tests/api_compatibility_test.py
1
# 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...
mrtequino/JSW
refs/heads/master
nodejs/asincronia1/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
1835
#!/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. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
rcurtin/shogun
refs/heads/develop
examples/undocumented/python_modular/graphical/lda.py
16
from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect from modshogun import * from modshogun import * import util util.set_title('LDA') util.DISTANCE=0.5 gamma=0.1 # positive examples pos=util.get_realdata(True) plot(pos[0,:], pos[1,:], "r.") # negative examples neg=util.get_realdata(Fa...
Comunitea/CMNT_00040_2016_ELN_addons
refs/heads/master
eln_edi/report/__init__.py
2
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2017 QUIVAL, S.A. All Rights Reserved # $Pedro Gómez Campos$ <pegomez@elnogal.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
Faraaz54/python_training_problems
refs/heads/master
codecademy_scripts/download.py
1
import urllib2 # needed for functions,classed for opening urls. url = raw_input( "enter the url needed for downloading file(pdf,mp3,zip...etc)\n"); usock = urllib2.urlopen(url) #function for opening desired url file_name = url.split('/...
SerpentCS/odoo
refs/heads/8.0
addons/l10n_cr/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # __init__.py # l10n_cr_account # First author: Carlos Vásquez <carlos.vasquez@clearcorp.co.cr> (ClearCorp S.A.) # Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved....
bnsgeyer/Copter3_4
refs/heads/master
mk/PX4/Tools/genmsg/src/genmsg/deps.py
216
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
moijes12/oh-mainline
refs/heads/master
vendor/packages/Django/tests/modeltests/str/tests.py
52
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime from django.test import TestCase from django.utils import six from django.utils.unittest import skipIf from .models import Article, BrokenArticle, InternationalArticle class SimpleTests(TestCase): @skipIf(six.PY3...
djmitche/moto
refs/heads/master
moto/cloudformation/responses.py
1
from __future__ import unicode_literals import json from jinja2 import Template from moto.core.responses import BaseResponse from .models import cloudformation_backend class CloudFormationResponse(BaseResponse): def create_stack(self): stack_name = self._get_param('StackName') stack_body = self...
nfallen/servo
refs/heads/master
tests/wpt/css-tests/tools/webdriver/webdriver/exceptions.py
263
"""Definition of WebDriverException classes.""" def create_webdriver_exception_strict(status_code, message): """Create the appropriate WebDriverException given the status_code.""" if status_code in _exceptions_strict: return _exceptions_strict[status_code](message) return UnknownStatusCodeException...
cydenix/OpenGLCffi
refs/heads/master
OpenGLCffi/GLX/EXT/MESA/query_renderer.py
1
from OpenGLCffi.GLX import params @params(api='glx', prms=['attribute', 'value']) def glXQueryCurrentRendererIntegerMESA(attribute): pass @params(api='glx', prms=['attribute']) def glXQueryCurrentRendererStringMESA(attribute): pass @params(api='glx', prms=['dpy', 'screen', 'renderer', 'attribute', 'value']) def g...
FilWisher/distributed-project
refs/heads/master
icarus/icarus/scenarios/test/test_workload.py
1
import sys if sys.version_info[:2] >= (2, 7): import unittest else: try: import unittest2 as unittest except ImportError: raise ImportError("The unittest2 package is needed to run the tests.") del sys import icarus.scenarios as workload class TestYCBS(unittest.TestCase): @classmetho...
Beeblio/django
refs/heads/master
django/contrib/messages/constants.py
837
DEBUG = 10 INFO = 20 SUCCESS = 25 WARNING = 30 ERROR = 40 DEFAULT_TAGS = { DEBUG: 'debug', INFO: 'info', SUCCESS: 'success', WARNING: 'warning', ERROR: 'error', } DEFAULT_LEVELS = { 'DEBUG': DEBUG, 'INFO': INFO, 'SUCCESS': SUCCESS, 'WARNING': WARNING, 'ERROR': ERROR, }
ShashaQin/erpnext
refs/heads/develop
erpnext/buying/doctype/purchase_common/__init__.py
37694
from __future__ import unicode_literals
roycyt/google-gtags
refs/heads/master
local_gentags.py
7
#!/usr/bin/python2.4 # # Copyright 2007 Google Inc. All Rights Reserved. # # 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 2 # of the License, or (at your option) any later versio...
LethusTI/supportcenter
refs/heads/master
vendor/django/tests/regressiontests/delete_regress/tests.py
42
from __future__ import absolute_import import datetime from django.conf import settings from django.db import backend, transaction, DEFAULT_DB_ALIAS from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .models import (Book, Award, AwardNote, Person, Child, Toy, PlayedWith, PlayedWithNo...
donnydevito/py-academicstoday
refs/heads/master
academicstoday_project/teacher/views/quiz.py
3
from django.shortcuts import render from django.core import serializers from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.conf import settings import json import datetime from registrar.models import Teacher from regist...
ehealthafrica-ci/rapidsms
refs/heads/develop
rapidsms/router/db/tests.py
3
from mock import patch from django.test import TestCase from django.test.utils import override_settings from rapidsms.models import Connection from rapidsms.tests import harness from rapidsms.router.db import DatabaseRouter from rapidsms.router.db.models import Message, Transmission from rapidsms.router.db.tasks impo...
ZachRiegel/scriptbin
refs/heads/master
pypyjs/modules/test/test_new.py
130
import unittest from test import test_support import sys new = test_support.import_module('new', deprecated=True) class NewTest(unittest.TestCase): def test_spam(self): class Eggs: def get_yolks(self): return self.yolks m = new.module('Spam') m.Eggs = Eggs ...
WhireCrow/openwrt-mt7620
refs/heads/master
staging_dir/host/lib/python2.7/test/test_errno.py
92
#! /usr/bin/env python """Test the errno module Roger E. Masse """ import errno from test import test_support import unittest std_c_errors = frozenset(['EDOM', 'ERANGE']) class ErrnoAttributeTests(unittest.TestCase): def test_for_improper_attributes(self): # No unexpected attributes should be on the ...
Airphrame/ardupilot
refs/heads/master
Tools/autotest/apm_unit_tests/dev/arducopter_Loiter.py
250
import arducopter def unit_test(mavproxy, mav): '''A scripted flight plan''' if ( arducopter.calibrate_level(mavproxy, mav) and arducopter.arm_motors(mavproxy, mav) and arducopter.takeoff(mavproxy,mav, alt_min=30, takeoff_throttle=1510) and arducopter.hover(mavproxy,mav, hov...
MechCoder/sympy
refs/heads/master
sympy/concrete/tests/test_gosper.py
100
"""Tests for Gosper's algorithm for hypergeometric summation. """ from sympy import binomial, factorial, gamma, Poly, S, simplify, sqrt, exp, log, Symbol, pi from sympy.abc import a, b, j, k, m, n, r, x from sympy.concrete.gosper import gosper_normal, gosper_sum, gosper_term def test_gosper_normal(): assert gosp...
wavicles/pycode-browser
refs/heads/master
Code/PythonBook/chap2/point.py
3
class Point: xpos = 0 ypos = 0 def __init__(self, x=0, y=0): self.xpos = x self.ypos = y def __str__(self): return 'Point at (%f,%f)'%(self.xpos, self.ypos) def __add__(self, other): xpos = self.xpos + other.xpos ypos = self.ypos + other.ypos res = Point(xpos,ypos) return res ...
amboxer21/scrapy
refs/heads/master
scrapy/linkextractors/sgml.py
9
""" SGMLParser-based Link extractors """ from six.moves.urllib.parse import urljoin import warnings from sgmllib import SGMLParser from w3lib.url import safe_url_string from scrapy.selector import Selector from scrapy.link import Link from scrapy.linkextractors import FilteringLinkExtractor from scrapy.utils.misc impo...