repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
tcheehow/MissionPlanner
refs/heads/master
Lib/distutils/unixccompiler.py
53
"""distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib *...
blaggacao/OpenUpgrade
refs/heads/8.0
addons/product_margin/product_margin.py
194
# -*- 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...
valerymelou/django-active-link
refs/heads/master
runtests.py
45
#!/usr/bin/env python # -*- coding: utf-8 from __future__ import unicode_literals, absolute_import import os import sys import django from django.conf import settings from django.test.utils import get_runner def run_tests(*test_args): if not test_args: test_args = ['tests'] os.environ['DJANGO_SETTI...
Philippe12/external_chromium_org
refs/heads/kitkat
third_party/tlslite/tlslite/utils/dateFuncs.py
407
import os #Functions for manipulating datetime objects #CCYY-MM-DDThh:mm:ssZ def parseDateClass(s): year, month, day = s.split("-") day, tail = day[:2], day[2:] hour, minute, second = tail[1:].split(":") second = second[:2] year, month, day = int(year), int(month), int(day) hour, minute, secon...
Abi1ity/uniclust2.0
refs/heads/master
flask/lib/python2.7/site-packages/django/contrib/flatpages/__init__.py
808
default_app_config = 'django.contrib.flatpages.apps.FlatPagesConfig'
atosatto/ansible
refs/heads/devel
lib/ansible/modules/network/netvisor/pn_ospfarea.py
59
#!/usr/bin/python """ PN-CLI vrouter-ospf-add/remove """ # # 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...
stvstnfrd/edx-platform
refs/heads/master
openedx/core/djangoapps/bookmarks/migrations/0001_initial.py
5
# -*- coding: utf-8 -*- from django.db import migrations, models import model_utils.fields import jsonfield.fields import django.utils.timezone from django.conf import settings from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField class Migration(migrations.Migration): dependencies = [ ...
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/django-extensions/django_extensions/tests/utils.py
47
# -*- coding: utf-8 -*- UTILS_TRUNCATE_LETTERS_TESTS = """ >>> from django_extensions.utils.text import truncate_letters >>> truncate_letters("hello tests", 100) u'hello tests' >>> truncate_letters("hello tests", 5) u'hello...' >>> for i in range(10,-1,-1): truncate_letters("hello tests", i),i (u'hello test...', 10) (...
adieu/django-nonrel
refs/heads/master
django/core/management/commands/validate.py
449
from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Validates all installed models." requires_model_validation = False def handle_noargs(self, **options): self.validate(display_num_errors=True)
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.4/tests/modeltests/aggregation/models.py
139
# coding: utf-8 from django.db import models class Author(models.Model): name = models.CharField(max_length=100) age = models.IntegerField() friends = models.ManyToManyField('self', blank=True) def __unicode__(self): return self.name class Publisher(models.Model): name = models.CharField...
JaneliaSciComp/osgpyplusplus
refs/heads/master
examples/rough_translated1/osglightpoint.py
1
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osglightpoint" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osg from osgpypp import osgDB from osgpypp import osgSim from osgpypp import osgUtil from osgpypp import ...
zstyblik/infernal-twin
refs/heads/master
build/reportlab/docs/userguide/ch7_custom.py
16
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/docs/userguide/ch7_custom.py from tools.docco.rl_doc_utils import * heading1("Writing your own $Flowable$ Objects") disc(""" Flowables are intended to...
aronysidoro/django-angular
refs/heads/master
examples/server/forms/model_scope.py
15
# -*- coding: utf-8 -*- from __future__ import unicode_literals # start tutorial from django.core.exceptions import ValidationError from djangular.forms import NgModelFormMixin from . import subscribe_form class SubscribeForm(NgModelFormMixin, subscribe_form.SubscribeForm): scope_prefix = 'subscribe_data' for...
nhomar/odoo-mirror
refs/heads/8.0
addons/payment_paypal/models/res_company.py
422
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class ResCompany(osv.Model): _inherit = "res.company" def _get_paypal_account(self, cr, uid, ids, name, arg, context=None): Acquirer = self.pool['payment.acquirer'] company_id = self.pool['res.users'].browse(cr, uid, uid, context=co...
amarouni/incubator-beam
refs/heads/master
sdks/python/apache_beam/runners/dataflow/internal/clients/dataflow/message_matchers.py
21
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Grirrane/odoo
refs/heads/master
addons/portal_project/tests/test_access_rights.py
4
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
zayneanderson/aima-python
refs/heads/master
submissions/Karman/vaccuum.py
18
import agents as ag import envgui as gui import random # ______________________________________________________________________________ loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world def RandomVacuumAgent(): "Randomly choose one of the actions from the vacuum environment." p = ag.Ra...
alvin319/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/idlelib/textView.py
71
"""Simple text browser for IDLE """ from Tkinter import * import tkMessageBox class TextViewer(Toplevel): """A simple text viewer dialog for IDLE """ def __init__(self, parent, title, text, modal=True): """Show the given text in a scrollable window with a 'close' button """ Topl...
evanma92/routeh
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py
214
## Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(self, pool, message): self.pool ...
bheinzelman/NBAShotPredictor
refs/heads/master
lib/Test.py
1
from random import randint, shuffle import copy from tabulate import tabulate from Table import Table from Samples import StratifiedSample ''' Author Bert Heinzelman, Brad Carrion Date: 10/14/16 Description: file to hold all test classes ''' ''' Base class for Test hierarchy. Given a classifier ...
alsaeng/foamRemote
refs/heads/master
paramiko_mods.py
1
'''paramiko_mods.py - Library to work with remote controls, mainly with paramiko''' import paramiko from functools import update_wrapper #DECORATORS def decorator(d): """Make function d a decorator: d wraps a function fn""" def _d(fn): return update_wrapper(d(fn), fn) update_wrapper(_d, d) re...
cuongnv23/ansible
refs/heads/devel
test/units/module_utils/basic/test__symbolic_mode_to_octal.py
42
# -*- coding: utf-8 -*- # Copyright: # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016-2017 Ansible Project # License: 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) __m...
Kefkius/scallop
refs/heads/master
lib/synchronizer.py
1
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # 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 y...
kenrachynski/powerline
refs/heads/develop
powerline/segments/i3wm.py
2
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import re from powerline.theme import requires_segment_info from powerline.bindings.wm import get_i3_connection WORKSPACE_REGEX = re.compile(r'^[0-9]+: ?') def calcgrp(w): group = [] if w['focused'...
ashgti/parrot
refs/heads/gsoc_nci
examples/benchmarks/oo1.py
3
class Foo: def __init__(self): self.i = 10 self.j = 20 class main: for i in range(1,100000): o = Foo() o = Foo() print o.i
jcherqui/searx
refs/heads/master
tests/unit/engines/test_frinkiac.py
4
# -*- coding: utf-8 -*- from collections import defaultdict import mock from searx.engines import frinkiac from searx.testing import SearxTestCase class TestFrinkiacEngine(SearxTestCase): def test_request(self): query = 'test_query' request_dict = defaultdict(dict) params = frinkiac.reque...
SoftwareMaven/django
refs/heads/master
django/contrib/admindocs/urls.py
574
from django.conf.urls import url from django.contrib.admindocs import views urlpatterns = [ url('^$', views.BaseAdminDocsView.as_view(template_name='admin_doc/index.html'), name='django-admindocs-docroot'), url('^bookmarklets/$', views.BookmarkletsView.as_view(), name='django-ad...
goodwinnk/intellij-community
refs/heads/master
python/lib/Lib/encodings/idna.py
540
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep) import stringprep, re, codecs from unicodedata import ucd_3_2_0 as unicodedata # IDNA section 3.1 dots = re.compile(u"[\u002E\u3002\uFF0E\uFF61]") # IDNA section 5 ace_prefix = "xn--" uace_prefix = unicode(ace_prefix, "ascii") # This assumes query st...
Zhongqilong/mykbengineer
refs/heads/master
kbe/res/scripts/common/Lib/ctypes/test/test_random_things.py
73
from ctypes import * import unittest, sys def callback_func(arg): 42 / arg raise ValueError(arg) @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') class call_function_TestCase(unittest.TestCase): # _ctypes.call_function is deprecated and private, but used by # Gary Bishp's readlin...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/static/structure/general/shared_prp_junk_s5.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/structure/general/shared_prp_junk_s5.iff" result.attribute_template_id ...
goodian/SSQ
refs/heads/master
get_data_163.py
1
# coding=utf-8 import urllib2 import re import time from selenium import webdriver OUT_FILE = "./result.txt" URL = "http://zx.caipiao.163.com/trend/ssq_historyPeriod.html" CUR = 114 JOU_MAP = {2003 : 89, 2004 : 123, 2005 : 154, 2006 : 154, 2007 : 154, 2008 : 15...
Teamxrtc/webrtc-streaming-node
refs/heads/master
examples/xrtc-meet/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
# 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. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
bhermanmit/cdash
refs/heads/ctests
src/utils/track.py
5
#!/usr/bin/env python2 """Convert binary particle track to VTK poly data. Usage information can be obtained by running 'track.py --help': usage: track.py [-h] [-o OUT] IN [IN ...] Convert particle track file to a .pvtp file. positional arguments: IN Input particle track data filena...
onitake/ansible
refs/heads/devel
test/units/modules/storage/netapp/test_netapp_e_global.py
45
# (c) 2018, NetApp Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from ansible.modules.storage.netapp.netapp_e_global import GlobalSettings from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type from un...
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/distutils/tests/test_msvccompiler.py
12
"""Tests for distutils._msvccompiler.""" import sys import unittest import os from distutils.errors import DistutilsPlatformError from distutils.tests import support from test.support import run_unittest SKIP_MESSAGE = (None if sys.platform == "win32" else "These tests are only for win32") @unittest...
vphilippon/python-mode
refs/heads/develop
pymode/libs3/rope/base/fscommands.py
29
"""Project file system commands. This modules implements file system operations used by rope. Different version control systems can be supported by implementing the interface provided by `FileSystemCommands` class. See `SubversionCommands` and `MercurialCommands` for example. """ import os, re import shutil import ...
fanzhanggoogle/three.js
refs/heads/dev
utils/converters/msgpack/msgpack/fallback.py
641
"""Fallback pure Python implementation of msgpack""" import sys import array import struct if sys.version_info[0] == 3: PY3 = True int_types = int Unicode = str xrange = range def dict_iteritems(d): return d.items() else: PY3 = False int_types = (int, long) Unicode = unicode ...
pajlada/tyggbot
refs/heads/master
pajbot/migration_revisions/db/0011_fix_login_last_updated_trigger.py
2
def up(cursor, bot): # The trigger was previously set to run AFTER UPDATE, we want it to run BEFORE UPDATE though to be correct. # Running the trigger AFTER the update means the data changes we wanted to have take place never took place. # The return value/modified row created inside the trigger procedure w...
arush0311/scrapy
refs/heads/master
scrapy/commands/check.py
40
from __future__ import print_function import time import sys from collections import defaultdict from unittest import TextTestRunner, TextTestResult as _TextTestResult from scrapy.commands import ScrapyCommand from scrapy.contracts import ContractsManager from scrapy.utils.misc import load_object from scrapy.utils.con...
studentofdata/market_share_mccvb
refs/heads/master
src/visualization/anas_hotel_metrics.py
1
# coding: utf-8 # In[12]: import os import pandas as pd from ggplot import * import numpy as np import matplotlib.pyplot as plt import seasonal import seaborn as sns sns.set(style="whitegrid", color_codes=True) # Data Location within CC DS data_location = os.path.join("..","..","data","external") #############...
aferr/LatticeMemCtl
refs/heads/master
src/mem/slicc/ast/FormalParamAST.py
33
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
whtsky/WeRoBot
refs/heads/develop
werobot/utils.py
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import io import json import os import random import re import string import time from functools import wraps from hashlib import sha1 import six try: from secrets import choice except ImportError: from random import choice str...
qbuat/rootpy
refs/heads/master
rootpy/io/tests/test_file.py
1
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License """ Tests for the file module. """ from rootpy.context import invisible_canvas from rootpy.io import TemporaryFile, DoesNotExist, MemFile, File, Directory from rootpy.io import root_open from rootpy.plotting import H...
tempbottle/pulsar
refs/heads/master
tests/http/external.py
5
import socket import unittest from pulsar import get_actor from .base import TestHttpClientBase class ExternalBase(TestHttpClientBase): with_httpbin = False def after_response(self, response): pass def ___test_http_get_timeit(self): client = self.client() N = 20 respons...
ZECTBynmo/notnode-gyp
refs/heads/master
gyp/test/copies/gyptest-default.py
264
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies file copies using the build tool default. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies.gyp', chdir='src'...
KappaEtaKappa/Sound-2-Disco
refs/heads/master
KHK Light Show/KHK LightShow Versions/0.0.0/KHK LightShow.py
1
################################ KHK LightShow ################################# # Author: Dan Boehm # # Version: 0.0.0 # # Description: KHK LightShow is a set of software and hardware designed # specifically for KHK's Delta Chapter House Basement. For # ...
arcyfelix/ML-DL-AI
refs/heads/master
Supervised Learning/Image Recognition/SimpleParallelCNN/network.py
1
import tflearn import numpy as np from tqdm import tqdm from tflearn.layers.merge_ops import merge from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.conv import conv_2d, max_pool_2d from tflearn.layers.estimator import regression from tflearn.data_utils import to_categorical from...
richardbeare/SimpleITK
refs/heads/master
Examples/Python/SimpleGaussianProcedural.py
4
#!/usr/bin/env python # ========================================================================= # # Copyright NumFOCUS # # 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:/...
Thor77/youtube-dl
refs/heads/master
youtube_dl/extractor/everyonesmixtape.py
88
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, sanitized_Request, ) class EveryonesMixtapeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?everyonesmixtape\.com/#/mix/(?P<id>[0-9a-zA-Z]+)(?:/(?P<songnr>[0-9]))?$' _TESTS ...
DaanHoogland/cloudstack
refs/heads/patch-2
systemvm/debian/root/health_checks/dns_check.py
3
#!/usr/bin/python # 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 # "Licens...
danithaca/mxnet
refs/heads/master
example/reinforcement-learning/dqn/replay_memory.py
16
from __future__ import absolute_import, division, print_function import mxnet as mx import mxnet.ndarray as nd import numpy import copy from utils import * class ReplayMemory(object): def __init__(self, history_length, memory_size=1000000, replay_start_size=100, state_dim=(), action_dim=(), stat...
savoirfairelinux/odoo
refs/heads/master
openerp/addons/base/module/module.py
29
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
marcore/edx-platform
refs/heads/master
lms/djangoapps/course_api/blocks/transformers/tests/test_student_view.py
35
""" Tests for StudentViewTransformer. """ # pylint: disable=protected-access from openedx.core.lib.block_structure.factory import BlockStructureFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import ToyCourseFactory from ..student_view import St...
lixt/lily2-gem5
refs/heads/master
ext/ply/setup.py
92
try: from setuptools import setup except ImportError: from distutils.core import setup setup(name = "ply", description="Python Lex & Yacc", long_description = """ PLY is yet another implementation of lex and yacc for Python. Some notable features include the fact that its implemented en...
arachnegl/python-koans
refs/heads/master
runner/mockable_test_result.py
278
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest # Needed to stop unittest.TestResult itself getting Mocked out of existence, # which is a problem when testing the helper classes! (It confuses the runner) class MockableTestResult(unittest.TestResult): pass
keithroe/vtkoptix
refs/heads/master
IO/GeoJSON/Testing/Python/TestGeoJSONWriter.py
8
from __future__ import print_function import vtk, os, sys from vtk.test import Testing ss = vtk.vtkSphereSource() #make mesh to test with af = vtk.vtkElevationFilter() #add some attributes af.SetInputConnection(ss.GetOutputPort()) ef = vtk.vtkExtractEdges() #make lines to test ef.SetInputConnection(af.GetOutputPort...
myerpengine/odoo
refs/heads/master
addons/stock_dropshipping/__openerp__.py
61
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
Ebiroll/qemu_esp32
refs/heads/master
gdb/python/gdb/command/prompt.py
68
# Extended prompt. # Copyright (C) 2011-2015 Free Software Foundation, 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 3 of the License, or # (at your option) any later vers...
wikibootup/CleanSSU
refs/heads/develop
app/__init__.py
1
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) # Fix location This code from app import models, controllers
gennad/Django-nonrel-stub-for-Google-App-Engine
refs/heads/master
djangoappengine/setup.py
94
from setuptools import setup, find_packages DESCRIPTION = 'App Engine backends for Django-nonrel' LONG_DESCRIPTION = None try: LONG_DESCRIPTION = open('README.rst').read() except: pass setup(name='djangoappengine', version='1.0', package_dir={'djangoappengine': '.'}, packages=['djangoappengi...
Summerotter/dawnofworlds
refs/heads/master
app/game/points_table.py
1
points_table = { 1: { "Shape Land":3, "Shape Climate":2, "Create Race":22, "Create Subrace": 12, "Command Race": 8, "Command City": 6, "Advance Race": 10, "Advance City": 8, "Purify Civ": 5, "Corrupt Civ": 4, "Purify City": 4, ...
wrouesnel/ansible
refs/heads/devel
test/legacy/cleanup_gce.py
83
''' Find and delete GCE resources matching the provided --match string. Unless --yes|-y is provided, the prompt for confirmation prior to deleting resources. Please use caution, you can easily delete your *ENTIRE* GCE infrastructure. ''' import optparse import os import re import sys import yaml try: from libclo...
nophead/Skeinforge50plus
refs/heads/master
skeinforge_application/skeinforge_plugins/craft_plugins/temperature.py
7
""" This page is in the table of contents. Temperature is a plugin to set the temperature for the entire extrusion. The temperature manual page is at: http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Temperature ==Operation== The default 'Activate Temperature' checkbox is on. When it is on, the functions desc...
dr0pz0ne/sibble
refs/heads/add_block_rescue_task_variables
test/units/parsing/test_unquote.py
80
# 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...
mohsenSy/zulip
refs/heads/master
zerver/migrations/0013_realmemoji.py
41
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('zerver', '0012_remove_appledevicetoken'), ] operations = [ migrations.AlterField( ...
savoirfairelinux/django
refs/heads/master
tests/many_to_one_null/tests.py
59
from django.test import TestCase from .models import Article, Car, Driver, Reporter class ManyToOneNullTests(TestCase): def setUp(self): # Create a Reporter. self.r = Reporter(name='John Smith') self.r.save() # Create an Article. self.a = Article(headline="First", reporter...
PolicyStat/django
refs/heads/master
django/conf/project_template/manage.py
1070
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Qgap/zulip
refs/heads/master
zerver/migrations/0002_django_1_8.py
126
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('zerver', '0001_initial'), ] operations = [ migrations.AlterModelManagers( name...
ofer43211/unisubs
refs/heads/staging
apps/webdriver_testing/pages/site_pages/user_messages_page.py
5
#!/usr/bin/env python from webdriver_testing.pages.site_pages import UnisubsPage class UserMessagesPage(UnisubsPage): """ Search page is the main search page stub. Watch Page and Search Results page """ _URL = "messages/" _MESSAGE = 'li.message p:nth-child(3)' _MESSAGE_SUBJECT = 'li.messag...
shepdelacreme/ansible
refs/heads/devel
lib/ansible/modules/cloud/rackspace/rax_clb.py
65
#!/usr/bin/python # Copyright: Ansible Project # 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', 'status': ['preview'], ...
ray-project/ray
refs/heads/master
rllib/examples/models/neural_computer.py
1
import torch import gym from torch import nn from collections import OrderedDict from typing import Union, Dict, List, Tuple from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.models.torch.misc import SlimFC from ray.rllib.utils.typing import ModelConfigDict, TensorType try: from dnc impo...
CoderBotOrg/coderbotsrv
refs/heads/master
server/lib/cffi/verifier.py
8
import sys, os, binascii, imp, shutil from . import __version__ from . import ffiplatform class Verifier(object): def __init__(self, ffi, preamble, tmpdir=None, modulename=None, ext_package=None, tag='', force_generic_engine=False, **kwds): self.ffi = ffi self.preamble = preamble...
alexandrebarachant/mne-python
refs/heads/master
mne/channels/layout.py
2
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Marijn van Vliet <w.m.vanvliet@gmail.com> # Jona Sassenhagen <jona.sass...
siosio/intellij-community
refs/heads/master
python/testData/findUsages/UnresolvedClassInit.py
83
class <caret>B(C): def __init__(self): C.__init__(self)
takeshineshiro/django
refs/heads/master
tests/generic_views/test_edit.py
199
from __future__ import unicode_literals import warnings from django import forms from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.test import ( SimpleTestCase, TestCase, ignore_warnings, override_settings, ) from django.test.client import RequestFact...
mm1ke/portage
refs/heads/master
pym/portage/tests/emerge/test_simple.py
3
# Copyright 2011-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import subprocess import sys import portage from portage import os from portage import _unicode_decode from portage.const import (BASH_BINARY, PORTAGE_BASE_PATH, PORTAGE_PYM_PATH, USER_CONFIG_PATH) from portage...
ebukoz/thrive
refs/heads/develop
erpnext/stock/doctype/material_request/test_material_request.py
4
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # ERPNext - web based ERP (http://erpnext.com) # For license information, please see license.txt from __future__ import unicode_literals import frappe, unittest, erpnext from frappe.utils imp...
absoludity/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/py/_path/svnurl.py
192
""" module defining a subversion path object based on the external command 'svn'. This modules aims to work with svn 1.3 and higher but might also interact well with earlier versions. """ import os, sys, time, re import py from py import path, process from py._path import common from py._path import svnwc as svncommon...
vrenaville/ngo-addons-backport
refs/heads/master
addons/account_followup/tests/__init__.py
175
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
kevinharvey/ci-jmad
refs/heads/master
tunes/templatetags/add_css.py
1
from django import template register = template.Library() def add_class_to_field(field, css): return field.as_widget(attrs={"class":css}) register.filter('add_class_to_field', add_class_to_field)
CyberTaoFlow/scirius
refs/heads/master
rules/migrations/0016_auto_20141229_1629.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('rules', '0015_auto_20141229_1610'), ] operations = [ migrations.AlterField( model_name='category...
xxsergzzxx/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_tempfile.py
46
# tempfile.py unit tests. import tempfile import os import sys import re import warnings import unittest from test import support if hasattr(os, 'stat'): import stat has_stat = 1 else: has_stat = 0 has_textmode = (tempfile._text_openflags != tempfile._bin_openflags) has_spawnl = hasattr(os, 'spawnl') #...
tomi77/bizzfuzz
refs/heads/master
accounts/tests/test_add.py
1
from django.core.urlresolvers import reverse from django.test import TestCase class AccountsAddViewTestCase(TestCase): fixtures = ['users_views_testdata.yaml'] def test_add(self): url = reverse('add') resp = self.client.get(url) self.assertEqual(resp.status_code, 200)
Krolov18/Languages
refs/heads/master
soxCutting/DecoupeurChaine.py
2
from Decoupeur import Decoupeur class DecoupeurChaine(Decoupeur): def __init__(self,chaine): self.chaine = chaine self.liste = [] def decouper(self): return self.chaine.split()
taknevski/tensorflow-xsmm
refs/heads/master
tensorflow/python/kernel_tests/edit_distance_op_test.py
139
# 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...
laslabs/vertical-medical
refs/heads/release/10.0
medical_pathology/tests/__init__.py
1
# -*- coding: utf-8 -*- # Copyright 2016 LasLabs Inc. # License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import test_medical_pathology_category from . import test_medical_pathology_group from . import test_medical_pathology
barma1309/Kalista
refs/heads/master
.virtualenvs/Kalista/lib/python3.4/site-packages/django/contrib/admin/templatetags/admin_modify.py
342
from django import template register = template.Library() @register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True) def prepopulated_fields_js(context): """ Creates a list of prepopulated_fields that should render Javascript for the prepopulated fields for both the admin form and i...
pong3489/TEST_Mission
refs/heads/master
Lib/smtpd.py
50
#! /usr/bin/env python """An RFC 2821 smtp proxy. Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]] Options: --nosetuid -n This program generally tries to setuid `nobody', unless this flag is set. The setuid call will fail if this program is not run as root...
zuowang/Paddle
refs/heads/master
demo/seqToseq/dataprovider.py
2
# Copyright (c) 2016 Baidu, 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 o...
NikNitro/Python-iBeacon-Scan
refs/heads/master
sympy/printing/mathematica.py
11
""" Mathematica code printer """ from __future__ import print_function, division from sympy.printing.codeprinter import CodePrinter from sympy.printing.str import StrPrinter from sympy.printing.precedence import precedence # Used in MCodePrinter._print_Function(self) known_functions = { "exp": [(lambda x: True, "...
marcy-terui/lamvery
refs/heads/master
lamvery/clients/__init__.py
1
from lamvery.clients.events import EventsClient from lamvery.clients.kms import KmsClient from lamvery.clients.function import LambdaClient from lamvery.clients.logs import LogsClient from lamvery.clients.apigateway import ApiGatewayClient
ilri/genebank-gg_server
refs/heads/master
db_scripts/model_generator/grin/models.py
2
# NOTE: this was autogenerated from django, but already edited to rearrange the models. # DO NOT OVERWRITE USING OUTPUT FROM manage.py inspectdb !!!! # Fill in code as appropriate by hand... from django.db import models #""" class MainSite(models.Model): id = models.IntegerField(primary_key=True...
rmaz/buck
refs/heads/master
test/com/facebook/buck/features/python/testdata/python_binary/main_with_native_libs.py
10
import ctypes import platform lib = "libfoo" if platform.system() == "Linux": lib += ".so" elif platform.system() == "Darwin": lib += ".dylib" elif platform.system() == "Windows": lib += ".dll" else: raise Exception("unknown system: " + platform.system()) ctypes.CDLL(lib).foo()
acsone/website
refs/heads/8.0
setup/website_crm_quick_answer/odoo_addons/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
Anty-Lemon/mgba
refs/heads/master
src/platform/python/cinema/test.py
1
import os, os.path import mgba.core, mgba.image import cinema.movie import itertools import glob import re import yaml from copy import deepcopy from cinema import VideoFrame from cinema.util import dictMerge class CinemaTest(object): TEST = 'test.(mvl|gb|gba|nds)' def __init__(self, path, root, settings={}):...
akeyong/vnpy
refs/heads/master
vn.api/vn.lts/vnltsqry/test/lts_data_type.py
167
# encoding: UTF-8 defineDict = {} typedefDict = {} #////////////////////////////////////////////////////////////////////// #@company shanghai liber information Technology Co.,Ltd #@file SecurityFtdcUserApiDataType.h #@brief 定义业务数据类型 #////////////////////////////////////////////////////////////////////// #/////////...
ThreatConnect-Inc/tcex
refs/heads/master
tcex/validators/in_range.py
2
"""in_range argument validator.""" # standard library from typing import Any, Callable from .validation_exception import ValidationError def in_range( min: float, max: float, **kwargs # pylint: disable=redefined-builtin ) -> Callable[..., None]: """Validate a value is in the range min <= value <= max. ...
Aaron1992/tornado
refs/heads/master
tornado/platform/windows.py
387
# NOTE: win32 support is currently experimental, and not recommended # for production use. from __future__ import absolute_import, division, print_function, with_statement import ctypes import ctypes.wintypes # See: http://msdn.microsoft.com/en-us/library/ms724935(VS.85).aspx SetHandleInformation = ctypes.windll.ker...
ricsatjr/mplstereonet
refs/heads/master
examples/polar_overlay.py
2
""" Demonstrates adding both polar and arbitrary grid overlays on a stereonet. Changing the grid overlay does not change the representation of the data. Notice that the plane, pole, and rake are all displayed identically in each case. Only the grid lines change. """ import matplotlib.pyplot as plt import mplstereonet ...
40223243/0000000
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/inspect.py
637
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...