repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
dhh1128/intent
refs/heads/master
old/grammar/ply/ply/intent_tokens.py
1
import lex # Regular expression rules for simple tokens t_PLUS = r'\+' t_PLUS_EQUALS = r'\+=' t_MINUS = r'-' t_MINUS_EQUALS = r'-=' t_TIMES = r'\*' t_TIMES_EQUALS = r'\*=' t_DIVIDE = r'/' t_DIVIDE_EQUALS = r'/=' t_MODULO = r'%' t_MODULO_EQUALS = r'%=' t_TILDE = r'~' t_DOT = r'.' t_COMMA = r',' t_QUOTE = r'"' t_BIT_AND...
hill1303/CCGParaphraseGenerator
refs/heads/master
novel_disambiguation/models/sentence.py
1
from xml.etree import cElementTree as ElementTree __author__ = 'Ethan A. Hill' class Sentence: def __init__(self, parent_file_name, top_parse, next_best_parse=None): self.parent_file_name = parent_file_name self.top_parse = top_parse self.next_best_parse = next_best_parse self.re...
OpenAcademy-OpenStack/nova-scheduler
refs/heads/master
nova/virt/xenapi/__init__.py
126
# Copyright (c) 2010 Citrix 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-2.0 # # Unless required by applicable ...
ahhh/NTP_Trojan
refs/heads/master
client.py
2
import ntplib import sys, os, subprocess from time import ctime HostIP = '127.0.0.1' # Essential shell functionality def run_command(cmd): proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) stdoutput = proc.stdout.read() + proc.stderr.read() retur...
jocave/snapcraft
refs/heads/master
integration_tests/test_store_download.py
1
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
byte-up/custom-filter-django-oscar
refs/heads/master
shop/catalogue/__init__.py
1
default_app_config = 'shop.catalogue.config.CatalogueConfig'
dqnykamp/sympy
refs/heads/master
sympy/polys/domains/ring.py
103
"""Implementation of :class:`Ring` class. """ from __future__ import print_function, division from sympy.polys.domains.domain import Domain from sympy.polys.polyerrors import ExactQuotientFailed, NotInvertible, NotReversible from sympy.utilities import public @public class Ring(Domain): """Represents a ring dom...
40223219/w16_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/calendar.py
828
"""Calendar printing functions Note when comparing these calendars to the ones printed by cal(1): By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week (0=Monday, 6=Sunday).""" import sys import da...
BorgERP/borg-erp-6of3
refs/heads/master
addons/crm_profiling/crm_profiling.py
9
# -*- 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...
rickhurst/Django-non-rel-blog
refs/heads/master
django/contrib/gis/geos/prototypes/topology.py
311
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ __all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull', 'geos_difference', 'geos_envelope', 'geos_intersection', 'geos_linemerge', 'geos_pointonsurface', 'geos_pre...
mjkoster/HypermediaToolkit
refs/heads/master
MachineHypermediaToolkit/server/coap/__init__.py
12133432
MatthewWilkes/django
refs/heads/master
tests/admin_scripts/custom_templates/project_template/project_name/__init__.py
12133432
looooo/pivy
refs/heads/master
scons/scons-local-1.2.0.d20090919/SCons/Platform/cygwin.py
2
"""SCons.Platform.cygwin Platform-specific initialization for Cygwin systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Th...
fuselock/odoo
refs/heads/8.0
addons/gamification_sale_crm/__openerp__.py
320
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
sodexis/odoo
refs/heads/8.0
addons/payment_adyen/models/adyen.py
165
# -*- coding: utf-'8' "-*-" import base64 try: import simplejson as json except ImportError: import json from hashlib import sha1 import hmac import logging import urlparse from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_adyen.controllers.main import Adye...
saitoha/trachet
refs/heads/master
trachet/output.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ***** BEGIN LICENSE BLOCK ***** # Copyright (C) 2012-2014 Hayaki Saito <user@zuse.jp> # # 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 ...
rangadi/beam
refs/heads/master
sdks/python/apache_beam/runners/worker/logger.py
6
# # 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...
leafclick/intellij-community
refs/heads/master
python/testData/quickFixes/PyRemoveStatementQuickFixTest/only_after.py
80
class B(object): def __init__(self): # error pass
mancoast/CPythonPyc_test
refs/heads/master
cpython/251_test_new.py
13
from test.test_support import verbose, verify, TestFailed import sys import new class Eggs: def get_yolks(self): return self.yolks print 'new.module()' m = new.module('Spam') if verbose: print m m.Eggs = Eggs sys.modules['Spam'] = m import Spam def get_more_yolks(self): return self.yolks + 3 pri...
bsmedberg/socorro
refs/heads/master
socorro/cron/jobs/ftpscraper.py
1
import re import urllib2 import lxml.html import json import time from configman import Namespace from crontabber.base import BaseCronApp from crontabber.mixins import ( as_backfill_cron_app, with_postgres_transactions ) from socorro.lib import buildutil import os """ Socket timeout to prevent FTP from hangin...
Fireblend/chromium-crosswalk
refs/heads/master
build/android/pylib/results/__init__.py
1201
# Copyright 2014 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.
winnerineast/Origae-6
refs/heads/master
origae/dataset/generic/test_views.py
1
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import json import os import tempfile import unittest from bs4 import BeautifulSoup import numpy as np import PIL.Image import origae.test_views from origae import extensions from origae import test_utils from...
wangli1426/heron
refs/heads/master
heron/tools/tracker/src/python/config.py
9
# Copyright 2016 Twitter. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
AutorestCI/azure-sdk-for-python
refs/heads/master
azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py
2
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
THEMVFFINMAN/PyttleShip
refs/heads/master
PYTRON/main.py
2
import copy import math import pygame import random import sys pygame.init() # Initializing some colors for cleaner looks throughout BLACK = (0, 0, 0) WHITE = (255, 255, 255) GREEN = (0, 80, 0) RED = (255, 0, 0) LIGHTBLUE = (0, 255, 255) # I've tried to program this in it's entirety based # on these variables so tha...
chipx86/reviewboard
refs/heads/master
reviewboard/reviews/markdown_utils.py
1
from __future__ import unicode_literals import warnings import pymdownx.emoji from bleach.sanitizer import Cleaner from django.core.exceptions import ObjectDoesNotExist from django.db.models import Model from django.utils.encoding import force_text from django.utils.html import escape from djblets import markdown as ...
michalliu/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/tkinter/test/test_ttk/test_widgets.py
8
import unittest import tkinter from tkinter import ttk, TclError from test.support import requires import sys from tkinter.test.test_ttk.test_functions import MockTclObj from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel, simulate_mouse_click) from tkinte...
albmarvil/The-Eternal-Sorrow
refs/heads/master
dependencies/luabind/boost-build/test/alternatives.py
4
#!/usr/bin/python # Copyright 2003 Dave Abrahams # Copyright 2003, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test main target alternatives. from BoostBuild import Tester from string import fi...
calincru/marble
refs/heads/master
tools/gen-sat-catalog/lib/ObjectCatalog.py
9
# # This file is part of the Marble Virtual Globe. # # This program is free software licensed under the GNU LGPL. You can # find a copy of this license in LICENSE.txt in the top directory of # the source code. # # Copyright 2012 Rene Kuettner <rene@bitkanal.net> # from __future__ import print_function from lxml imp...
bennylope/django-site-contacts
refs/heads/master
contact/urls.py
1
from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView from .views import SimpleContactView urlpatterns = patterns('', url(r'^$', view=SimpleContactView.as_view(), name="contact_form"), url(r'^sent/$', view=TemplateView.as_view(template_name="contact/contact...
tirsen/vitess
refs/heads/master
py/vtctl/vtctl_client.py
12
# Copyright 2017 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 or agreed to in writin...
jdurbin/sandbox
refs/heads/master
python/heatmap/heatest_scipi.py
1
#!/usr/bin/env python import scipy import pylab import scipy.cluster.hierarchy as sch # Generate random features and distance matrix. x = scipy.rand(40) D = scipy.zeros([40,40]) for i in range(40): for j in range(40): D[i,j] = abs(x[i] - x[j]) # Compute and plot first dendrogram. fig = pylab.figure(figs...
asm-products/cloudroutes-service
refs/heads/master
src/web/reactionforms/docker-restart-container/__init__.py
2
"""Reactions form class for email notifications.""" from wtforms import SelectField, TextAreaField, TextField from wtforms.validators import DataRequired, Optional from ..base import BaseReactForm class ReactForm(BaseReactForm): #pylint: disable=no-init ''' Class that creates an form for the reaction Docker: S...
lmiccini/sos
refs/heads/master
sos/plugins/postgresql.py
3
# Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola <sbonazzo@redhat.com> # Copyright (C) 2013 Chris J Arges <chris.j.arges@canonical.com> # Copyright (C) 2012-2013 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com> # Copyright (C) 2011 Red Hat, Inc., Jesse Jaggars <jjaggars@redhat.com> # This program is free software; y...
smart-techs/you-get
refs/heads/develop
src/you_get/cli_wrapper/player/wmp.py
12133432
elkingtonmcb/django
refs/heads/master
tests/gis_tests/data/rasters/__init__.py
12133432
feliperfranca/django-nonrel-example
refs/heads/master
django/conf/locale/es/__init__.py
12133432
ukanga/SickRage
refs/heads/master
lib/hachoir_core/event_handler.py
188
class EventHandler(object): """ Class to connect events to event handlers. """ def __init__(self): self.handlers = {} def connect(self, event_name, handler): """ Connect an event handler to an event. Append it to handlers list. """ try: self.hand...
atollena/commons
refs/heads/master
src/python/twitter/checkstyle/plugins/newlines.py
14
# ================================================================================================== # Copyright 2014 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
orbitfp7/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/contrib/test_flavorextradata.py
63
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
abhmul/PyJet
refs/heads/master
docs/autogen.py
1
# -*- coding: utf-8 -*- ''' General documentation architecture (Still more work to do here): Home Index - Getting started Getting started FAQ - Models About PyJet models explain designing and building a model explain weight saving, weight loading SLModel - Layers About PyJet layers ...
brianzelip/militarization
refs/heads/gh-pages
css/basscss/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/inferno.py
52
# -*- coding: utf-8 -*- """ pygments.lexers.inferno ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for Inferno os and all the related stuff. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, by...
TathagataChakraborti/resource-conflicts
refs/heads/master
PLANROB-2015/seq-sat-lama/py2.5/lib/python2.5/wsgiref/validate.py
162
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php # Licensed to PSF under a Contributor Agreement """ Middlew...
ville-k/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/utils/export.py
48
# 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...
394954369/horizon
refs/heads/master
openstack_dashboard/test/integration_tests/pages/changepasswordpage.py
13
# 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 # d...
mglukhikh/intellij-community
refs/heads/master
python/testData/psi/BlockWithoutColon.py
80
def foo(): while True x = 1 x = 2 return x
BehavioralInsightsTeam/edx-platform
refs/heads/release-bit
openedx/core/djangoapps/content/course_overviews/migrations/0005_delete_courseoverviewgeneratedhistory.py
80
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('course_overviews', '0004_courseoverview_org'), ] operations = [ migrations.DeleteModel( name='CourseOverviewGene...
mihail-morosan/OCAPE
refs/heads/master
Utils/gcc/lib/gcc/mingw32/4.8.1/libstdc++.dll.a-gdb.py
8
# -*- python -*- # Copyright (C) 2009-2013 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 versio...
cytec/SickRage
refs/heads/master
lib/pysrt/srtitem.py
73
# -*- coding: utf-8 -*- """ SubRip's subtitle parser """ from pysrt.srtexc import InvalidItem, InvalidIndex from pysrt.srttime import SubRipTime from pysrt.comparablemixin import ComparableMixin from pysrt.compat import str, is_py2 import re class SubRipItem(ComparableMixin): """ SubRipItem(index, start, end...
holmberd/three.js
refs/heads/master
utils/exporters/blender/tests/scripts/exporter.py
295
import os import argparse import sys import io_three from io_three.exporter import constants try: separator = sys.argv.index('--') except IndexError: print('ERROR: no parameters specified') sys.exit(1) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('filepath') for k...
aleksandra-tarkowska/django
refs/heads/master
django/core/cache/utils.py
121
from __future__ import unicode_literals import hashlib from django.utils.encoding import force_bytes from django.utils.http import urlquote TEMPLATE_FRAGMENT_KEY_TEMPLATE = 'template.cache.%s.%s' def make_template_fragment_key(fragment_name, vary_on=None): if vary_on is None: vary_on = () key = ':'....
hoyjustin/ScopusAdapter
refs/heads/master
CorsTests/test_allow_headers.py
1
# -*- coding: utf-8 -*- """ test ~~~~ Flask-Cors tests module """ from tests.base_test import FlaskCorsTestCase, AppConfigTest from flask import Flask try: # this is how you would normally import from flask.ext.cors import * except: # support local usage without installed package from fla...
mboeru/maraschino
refs/heads/master
lib/werkzeug/wrappers.py
85
# -*- coding: utf-8 -*- """ werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains al...
ajgallegog/gem5_arm
refs/heads/master
src/arch/x86/X86TLB.py
61
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
luojxxx/handsfree
refs/heads/master
PyTribe-master/pytribe.py
2
# PyTribe: classes to communicate with EyeTribe eye trackers # # author: Edwin Dalmaijer # email: edwin.dalmaijer@psy.ox.ac.uk # # version 3 (11-Aug-2014) import os import copy import json import time import socket from threading import Thread, Lock from multiprocessing import Queue class EyeTribe: ...
selboo/paramiko
refs/heads/master
paramiko/ber.py
11
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
ccnmtl/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/m2m_regress/models.py
92
from django.db import models from django.contrib.auth import models as auth # No related name is needed here, since symmetrical relations are not # explicitly reversible. class SelfRefer(models.Model): name = models.CharField(max_length=10) references = models.ManyToManyField('self') related = models.ManyT...
freekh/three.js
refs/heads/master
utils/exporters/blender/addons/io_three/exporter/geometry.py
124
""" Module for creating Three.js geometry JSON nodes. """ import os from .. import constants, logger from . import base_classes, io, api FORMAT_VERSION = 3 class Geometry(base_classes.BaseNode): """Class that wraps a single mesh/geometry node.""" def __init__(self, node, parent=None): logger.debug(...
sauloal/pycluster
refs/heads/master
pypy-1.9_64/lib-python/2.7/test/test_int_literal.py
139
"""Test correct treatment of hex/oct constants. This is complex because of changes due to PEP 237. """ import unittest from test import test_support class TestHexOctBin(unittest.TestCase): def test_hex_baseline(self): # A few upper/lowercase tests self.assertEqual(0x0, 0X0) self.assertE...
yashodhank/frappe
refs/heads/develop
frappe/print/doctype/print_format/print_format.py
9
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.utils import json from frappe.utils.jinja import validate_template from frappe.model.document import Document class PrintFormat(Document): def valid...
StefaFaerb1/Stefanie
refs/heads/master
py/openage/convert/cabextract/cab.py
46
import os from struct import Struct from bisect import bisect from . import lzxd class Error(Exception): pass class Namespace: def __init__(self, *mappings, **kwargs): self._update(*mappings, **kwargs) def _update(self, *mappings, **kwargs): for mapping in mappings: if type(ma...
martinribelotta/micropython
refs/heads/master
tests/basics/closure_defargs.py
118
# test closure with default args def f(): a = 1 def bar(b = 10, c = 20): print(a + b + c) bar() bar(2) bar(2, 3) print(f())
synergeticsedx/deployment-wipro
refs/heads/oxa/master.fic
common/djangoapps/util/config_parse.py
197
""" Helper functions for configuration parsing """ import collections def convert_tokens(tokens): """ This function is called on the token dictionary that is imported from a yaml file. It returns a new dictionary where all strings containing 'None' are converted to a literal None due to a bug ...
farhaadila/django-cms
refs/heads/develop
cms/test_utils/project/mti_pluginapp/migrations/__init__.py
12133432
seann1/portfolio5
refs/heads/master
.meteor/dev_bundle/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
1843
#!/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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
dashpay/electrum-dash
refs/heads/master
lib/interface.py
7
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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 witho...
RedhawkSDR/FrontEndController
refs/heads/master
python/FrontEndController.py
1
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK FrontEndController. # # REDHAWK FrontEndController is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesse...
Whatsit2yaa/vast-tundra-84597
refs/heads/master
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
1824
# 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
srottem/indy-sdk
refs/heads/master
wrappers/python/tests/pool/test_create_pool_ledger_config.py
3
import pytest from indy import pool from indy.error import ErrorCode, IndyError @pytest.mark.asyncio async def test_create_pool_ledger_config_works(pool_ledger_config): pass @pytest.mark.asyncio async def test_create_pool_ledger_config_works_for_empty_name(): with pytest.raises(IndyError) as e: awa...
weijia/obj_sys
refs/heads/master
obj_sys/views.py
1
# Create your views here. from obj_tagging import * from obj_operator import ObjOperator, ObjListOperator, handle_operation_request from djangoautoconf.django_utils import retrieve_param from models import UfsObj from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect lo...
CSCI1200Course/csci1200OnlineCourse
refs/heads/master
tests/unit/models_transforms.py
5
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
S0lll0s/powerline
refs/heads/develop
powerline/lint/checks.py
17
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import os import re import logging from collections import defaultdict from powerline.lib.threaded import ThreadedSegment from powerline.lib.unicode import unicode from powerline.lint.markedjson.markedv...
opendatakosovo/undp-gender-survey-of-corruption-data-importer
refs/heads/master
gender_survey.py
1
from pymongo import MongoClient import csv import re mongo = MongoClient() db = mongo.undp collection = db.gsc collection.remove({}) def parse(): print "\nImporting data..." with open('data/undpGenderSurveyOfCorruption.csv', 'rb') as csvfile: reader = csv.reader(csvfile, delimiter=',') # S...
ghdk/networkx
refs/heads/master
fixcoverage.py
30
import pickle import re import sys def main(argv): source = argv[1] dest = argv[2] with open('.coverage', 'rb') as f: coverage_data = pickle.load(f) # Prefilter to filenames in NetworkX filenames = [filename for filename in coverage_data['lines'].keys() if 'networkx' in fi...
bsmedberg/socorro
refs/heads/master
alembic/versions/1495b7307dd3_bug_1005326_filter_out_null.py
14
"""bug 1005326 - filter out NULL Revision ID: 1495b7307dd3 Revises: 1961d1f70175 Create Date: 2014-05-06 16:40:36.199526 """ # revision identifiers, used by Alembic. revision = '1495b7307dd3' down_revision = '1961d1f70175' from alembic import op from socorro.lib import citexttype, jsontype, buildtype from socorro.l...
harmy/kbengine
refs/heads/master
kbe/src/lib/python/Lib/encodings/palmos.py
647
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,inp...
overra/node-gyp
refs/heads/master
gyp/test/sibling/gyptest-all.py
104
#!/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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
Joshndroid/kernel_samsung_lt03wifi
refs/heads/test1
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
TobiasLohner/SkyLines
refs/heads/master
skylines/commands/import_/welt2000.py
3
from flask.ext.script import Command, Option from skylines.database import db from skylines.model import Airport from skylines.lib.waypoints.welt2000 import get_database from datetime import datetime from sqlalchemy.sql.expression import or_, and_ class Welt2000(Command): """ Import all airports from the WELT200...
drbild/boto
refs/heads/develop
tests/unit/ec2/test_snapshot.py
114
from tests.compat import OrderedDict from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection from boto.ec2.snapshot import Snapshot class TestDescribeSnapshots(AWSMockServiceTestCase): connection_class = EC2Connection def default_body(self): return b""" ...
osvalr/odoo
refs/heads/8.0
addons/base_import_module/tests/test_module/__openerp__.py
377
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
enthought/pikos
refs/heads/master
pikos/monitors/function_monitor.py
1
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # Package: Pikos toolkit # File: monitors/function_monitor.py # License: LICENSE.TXT # # Copyright (c) 2012, Enthought, Inc. # All rights reserved. #--------------------------------------------------------------...
driftx/Telephus
refs/heads/master
examples/deferreds/supercolumn.py
12133432
helenst/django
refs/heads/master
tests/empty/no_models/__init__.py
12133432
yetilinux/yetiweb
refs/heads/master
packages/migrations/0010_auto__add_signoffspecification.py
4
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): db.create_table('packages_signoffspecification', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_...
fschaefer/android-samsung-3.0-jb
refs/heads/android-samsung-3.0-jb-mr0
Documentation/target/tcm_mod_builder.py
3119
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
kenshay/ImageScripter
refs/heads/master
Script_Runner/PYTHON/Lib/site-packages/pip/_vendor/distlib/util.py
24
# # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl ...
lastralab/Statistics
refs/heads/master
Specialization/Dr. Chuck-s Code/count1.py
2
fname = raw_input('Enter the file name: ') try: fhand = open(fname) except: print 'File cannot be opened:', fname exit() counts = dict() for line in fhand: words = line.split() for word in words: if word not in counts: counts[word] = 1 else: counts[word] += 1...
jhbradley/moose
refs/heads/devel
framework/contrib/nsiqcppstyle/nsiqcppstyle_reporter.py
43
# Copyright (c) 2009 NHN 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 follow...
marinho/geraldo
refs/heads/master
site/newsite/site-geraldo/django/core/cache/backends/__init__.py
12133432
Radagast-red/golem
refs/heads/develop
golem/rpc/mapping/__init__.py
12133432
hellofreedom/ansible-modules-core
refs/heads/devel
cloud/amazon/__init__.py
12133432
sodafree/backend
refs/heads/master
build/ipython/build/lib.linux-i686-2.7/IPython/utils/dir2.py
5
# encoding: utf-8 """A fancy version of Python's builtin :func:`dir` function. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, di...
jonludlam/planex
refs/heads/master
tests/test_planex_spec.py
2
# Run these tests with 'nosetests': # install the 'python-nose' package (Fedora/CentOS or Ubuntu) # run 'nosetests' in the root of the repository import unittest import platform import planex.spec def get_rpm_machine(): if platform.machine() == 'x86_64': return 'x86_64' return 'i386' def get_...
ptoraskar/django
refs/heads/master
django/contrib/admindocs/tests/test_fields.py
638
from __future__ import unicode_literals import unittest from django.contrib.admindocs import views from django.db import models from django.db.models import fields from django.utils.translation import ugettext as _ class CustomField(models.Field): description = "A custom field type" class DescriptionLackingFi...
nopjmp/SickRage
refs/heads/master
lib/rtorrent/err.py
182
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
concordusapps/python-xmlsec
refs/heads/master
setup.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import absolute_import, unicode_literals, division from os import path from pkgutil import get_importer from setuptools import setup, Extension from functools import wraps def lazy(function): @wraps(function) def wrapped(*args, **kwargs): ...
mpasternak/pyglet-fix-issue-518-522
refs/heads/master
experimental/input/linux_const.py
28
#!/usr/bin/env python '''Event constants from /usr/include/linux/input.h ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' EV_SYN = 0x00 EV_KEY = 0x01 EV_REL = 0x02 EV_ABS = 0x03 EV_MSC = 0x04 EV_LED = 0x11 EV_SND = 0x12 EV_REP = 0x14 EV_FF = 0x15 EV_PWR = 0x16 EV_FF_STATUS = 0x17 EV_MAX = 0x1f # Synchro...
HIPERCUBE/ReturnA
refs/heads/master
DataCrawler/lib/build/lib/pdfminer/setup.py
5
#!/usr/bin/env python from distutils.core import setup from pdfminer import __version__ setup( name='pdfminer', version=__version__, description='PDF parser and analyzer', long_description='''PDFMiner is a tool for extracting information from PDF documents. Unlike other PDF-related tools, it focuses en...
marcelocure/django
refs/heads/master
django/conf/locale/pl/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i' DATETI...