repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
gladsonvm/haystackdemo
refs/heads/master
lib/python2.7/site-packages/django/contrib/gis/sitemaps/georss.py
314
from django.core import urlresolvers from django.contrib.sitemaps import Sitemap class GeoRSSSitemap(Sitemap): """ A minimal hook to produce sitemaps for GeoRSS feeds. """ def __init__(self, feed_dict, slug_dict=None): """ This sitemap object initializes on a feed dictionary (as would b...
kbrebanov/ansible
refs/heads/devel
test/units/module_utils/basic/test_heuristic_log_sanitize.py
66
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <[email protected]> # # 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 # (a...
yeming233/horizon
refs/heads/master
openstack_dashboard/dashboards/project/instances/console.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 # ...
brianlorenz/COSMOS_IMACS_Redshifts
refs/heads/master
PlotCodes/Plot_AvStructMassCut_paper.py
1
#Creates a BPT diagram for all objects, and a second figure that shows objects for which single lines are low import numpy as np import matplotlib.pyplot as plt from astropy.io import ascii import sys, os, string import pandas as pd from astropy.io import fits import collections from astropy.cosmology import WMAP9 as c...
pramasoul/micropython
refs/heads/master
tests/extmod/ubinascii_unhexlify.py
14
try: try: import ubinascii as binascii except ImportError: import binascii except ImportError: print("SKIP") raise SystemExit print(binascii.unhexlify(b"0001020304050607")) print(binascii.unhexlify(b"08090a0b0c0d0e0f")) print(binascii.unhexlify(b"7f80ff")) print(binascii.unhexlify(b"313...
svohara/pyvision
refs/heads/master
samples/WACV2012_Tutorial/tutorials/TutorialAnnotations.py
4
import pyvision as pv import scipy as sp if __name__ == '__main__': im = pv.Image(sp.zeros((128,128))) pts = [pv.Point(48,55),pv.Point(80,55)] im.annotatePoints(pts) elipse = pv.CenteredRect(64,64,96,96) im.annotateEllipse(elipse) im.annotateLabel(pv.Point(40,36),"MMM") im.annota...
thanhpete/selenium
refs/heads/master
py/selenium/webdriver/ie/__init__.py
2454
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
cuongnv23/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py
21
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright IBM Corp. 2016 # Author(s): Andreas Nafpliotis <[email protected]> # # 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_META...
NetApp/cinder
refs/heads/master
cinder/tests/unit/test_volume_throttling.py
13
# Copyright (c) 2015 Hitachi Data Systems, 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 # # U...
dvliman/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.4/django/core/management/commands/sql.py
90
from optparse import make_option from django.core.management.base import AppCommand from django.core.management.sql import sql_create from django.db import connections, DEFAULT_DB_ALIAS class Command(AppCommand): help = "Prints the CREATE TABLE SQL statements for the given app name(s)." option_list = AppComm...
uwosh/UWOshMusicRecruiting
refs/heads/master
content/SchoolFolder.py
1
# -*- coding: utf-8 -*- # # File: SchoolFolder.py # # Copyright (c) 2008 by [] # Generator: ArchGenXML Version 2.0-beta10 # http://plone.org/products/archgenxml # # GNU General Public License (GPL) # __author__ = """unknown <unknown>""" __docformat__ = 'plaintext' from AccessControl import ClassSecurityInf...
bkahlert/seqan-research
refs/heads/master
raw/workshop11/workshop2011-data-20110925/trunk/misc/seqan_instrumentation/bin/classes/flushfile.py
21
class Flushfile(object): def __init__(self, fd): self.fd = fd def write(self, x): ret=self.fd.write(x) self.fd.flush() return ret def writelines(self, lines): ret=self.writelines(line) self.fd.flush() return ret def flush(self): ...
corbt/twitter-geo-visuals
refs/heads/master
get_subset.py
1
# Gets N randomly-selected lines without replacement from the input file and saves them to the output file import os, random, json in_file = "raw/2013-11-27-05.11.56.569021.json" out_file = "processed/24h_5k.json" num_selected = 5000 lines_with_location = [] with open(in_file) as f: for i,line in enumerate(f): ...
Tehsmash/nova
refs/heads/master
nova/virt/xenapi/vm_utils.py
20
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2012 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 # # ...
Danielhiversen/home-assistant
refs/heads/master
tests/components/geo_location/test_geo_json_events.py
1
"""The tests for the geojson platform.""" import unittest from unittest import mock from unittest.mock import patch, MagicMock import homeassistant from homeassistant.components import geo_location from homeassistant.components.geo_location import ATTR_SOURCE from homeassistant.components.geo_location.geo_json_events ...
jamesroutley/formation
refs/heads/master
setup.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup( name="formation", version="0.1.0", author="James Routley", author_email="[email protected]", license="Apache2", packages=[ "formation" ], package_dir={ "formation": "formation" }, ...
hornn/interviews
refs/heads/pairing_sizeunit_AT120115
tools/bin/gppylib/test/regress/test_regress_gpexpand.py
30
#!/usr/bin/env python import unittest2 as unittest import os, socket from gppylib.commands.base import Command, ExecutionError from gppylib.commands.gp import GpStart from gppylib.db import dbconn class GpExpandTestCase(unittest.TestCase): EXPANSION_INPUT_FILE = 'test_expand.input' GP_COMMAND_FAULT_POIN...
germs-lab/RefSoil
refs/heads/master
script_google_api/scripts/getting-soil-genomes/parse-the-giant-excel.py
3
import sys for n, line in enumerate(open(sys.argv[1], 'rU')): if n < 2: continue else: dat = line.rstrip().split('\t') if len(dat) == 36: strain = dat[9] strain = strain.replace('"', '') print strain
LohithBlaze/scikit-learn
refs/heads/master
doc/datasets/mldata_fixture.py
367
"""Fixture module to skip the datasets loading when offline Mock urllib2 access to mldata.org and create a temporary data folder. """ from os import makedirs from os.path import join import numpy as np import tempfile import shutil from sklearn import datasets from sklearn.utils.testing import install_mldata_mock fr...
jxw1102/Projet-merou
refs/heads/master
ModelChecker/make-package.py
1
import sys from subprocess import call import os import shutil """Prints the syntax and options to the user""" def print_usage(): print("\nThis command packs the relevant binary files in a jar. The output jar is stored in the release folder.") print("\nSyntax : make-package release-name [options]","\n\nrelease...
Alphadelta14/ansible
refs/heads/devel
lib/ansible/plugins/action/script.py
67
# (c) 2012, Michael DeHaan <[email protected]> # # 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 lat...
libyal/libqcow
refs/heads/main
tests/pyqcow_test_support.py
1
#!/usr/bin/env python # # Python-bindings support functions test script # # Copyright (C) 2010-2021, Joachim Metz <[email protected]> # # Refer to AUTHORS for acknowledgements. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as ...
aisworld/mailmanclient
refs/heads/master
src/mailmanclient/testing/documentation.py
1
# Copyright (C) 2007-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
takis/django
refs/heads/master
tests/forms_tests/widget_tests/base.py
192
from django.test import SimpleTestCase class WidgetTest(SimpleTestCase): beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')) def check_html(self, widget, name, value, html='', attrs=None, **kwargs): output = widget.render(name, value, attrs=attrs, **kwargs) self.assertHT...
BCGamer/CheckIn-Server
refs/heads/master
registration/migrations/0005_auto_20140913_0515.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('registration', '0004_registereduser_reg_erros'), ] operations = [ migrations.RenameField( model_name='registered...
cchurch/ansible-modules-core
refs/heads/devel
network/netvisor/pn_vrouter.py
19
#!/usr/bin/python """ PN CLI vrouter-create/vrouter-delete/vrouter-modify """ # # 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 #...
irwinlove/django
refs/heads/master
django/contrib/flatpages/migrations/0001_initial.py
134
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='FlatPage', fields=[ ...
ryfeus/lambda-packs
refs/heads/master
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/distributions/python/ops/deterministic.py
18
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
rolandgeider/wger
refs/heads/master
wger/manager/tests/test_pdf.py
1
# This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # wger W...
mateon1/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/chunked.py
219
def main(request, response): chunks = ["First chunk\r\n", "Second chunk\r\n", "Yet another (third) chunk\r\n", "Yet another (fourth) chunk\r\n", ] response.headers.set("Transfer-Encoding", "chunked"); response.headers.set("Trailer", "X-Test-Me"); r...
ShownX/incubator-mxnet
refs/heads/master
python/mxnet/test_utils.py
1
# 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 u...
jimi-c/ansible
refs/heads/devel
lib/ansible/utils/module_docs_fragments/digital_ocean.py
60
# Copyright (c) 2018, Ansible Project # Copyright (c) 2018, Abhijeet Kasurde ([email protected]) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Parameters for DigitalOcean modules DOCUMENTATION = ''' options: oauth_token: ...
MartinPetkov/django-security
refs/heads/master
security/password_expiry.py
3
# Copyright (c) 2011, SD Elements. See LICENSE.txt for details. from .models import PasswordExpiry from django.conf import settings def password_is_expired(user): password_expiry, _ = PasswordExpiry.objects.get_or_create(user=user) password_settings = getattr(settings, 'MANDATORY_PASSWORD_CHANGE', {}) ...
mayoub/hhana
refs/heads/master
statstools/plotting.py
5
# python imports from itertools import cycle import os import pickle import re # root/rootpy imports from rootpy import ROOT from rootpy.plotting import Canvas, Legend, Hist, Graph from rootpy.plotting.hist import _HistBase from rootpy.plotting.graph import _Graph1DBase from rootpy.plotting.shapes import Line from ro...
ciber96/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/generator-output/actions/subdir2/make-file.py
973
#!/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. import sys contents = "Hello from make-file.py\n" open(sys.argv[1], 'wb').write(contents)
jspraul/bite-project
refs/heads/master
deps/gdata-python-client/src/gdata/tlslite/utils/compat.py
361
"""Miscellaneous functions to mask Python version differences.""" import sys import os if sys.version_info < (2,2): raise AssertionError("Python 2.2 or later required") if sys.version_info < (2,3): def enumerate(collection): return zip(range(len(collection)), collection) class Set: def ...
qnub/django-cms
refs/heads/develop
cms/south_migrations/0069_static_placeholder_permissions.py
48
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = ...
sopier/django
refs/heads/master
django/contrib/gis/serializers/geojson.py
275
from __future__ import unicode_literals from django.contrib.gis.gdal import HAS_GDAL from django.core.serializers.base import ( SerializationError, SerializerDoesNotExist, ) from django.core.serializers.json import Serializer as JSONSerializer if HAS_GDAL: from django.contrib.gis.gdal import CoordTransform, S...
ECESeniorDesign/lazy_record
refs/heads/master
lazy_record/repo.py
1
import re import sqlite3 from itertools import chain from inflector import Inflector, English inflector = Inflector(English) class Invalid(Exception): pass class Repo(object): """ Wrapper object around the database. """ db = None def __init__(self, table_name): """ Instanti...
jart/tensorflow
refs/heads/master
tensorflow/tools/git/gen_git_source.py
16
#!/usr/bin/env python # 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 # # Unle...
eaas-framework/virtualbox
refs/heads/master
src/VBox/GuestHost/OpenGL/error/error.py
22
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys import apiutil apiutil.CopyrightC() print """#include <stdio.h> #include "cr_error.h" #include "cr_spu.h" #include "state/cr_statetypes.h" #if defined(WINDOWS)...
vnc-biz/openerp-server
refs/heads/master
bin/openerp-server.py
6
#! /usr/bin/env python # -*- coding: UTF-8 -*- import os import sys if __name__ == "__main__": print '-' * 70 print "DEPRECATED: you are starting the OpenERP server with its old path," print "please use the new executable (available in the parent directory)." print '-' * 70 # Change to the parent...
dannykopping/mysql-utilities
refs/heads/master
mysql-test/t/diff_sql_views.py
1
# # Copyright (c) 2010, 2013, Oracle and/or its affiliates. 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; version 2 of the License. # # This program is distributed in th...
avicizhu/Load-balancer
refs/heads/master
test.py
7
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # # Copyright (c) 2009 University of Washington # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free ...
anaran/kuma
refs/heads/master
vendor/packages/logilab/astng/test/unittest_builder.py
24
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:[email protected] # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
stone5495/NewsBlur
refs/heads/master
apps/social/migrations/0006_guid_hash.py
18
# -*- coding: utf-8 -*- import datetime import hashlib from south.db import db from south.v2 import DataMigration from django.db import models from apps.social.models import MSharedStory class Migration(DataMigration): def forwards(self, orm): shared_stories = MSharedStory.objects.all() count = sh...
dunkhong/grr
refs/heads/master
grr/core/grr_response_core/lib/parsers/windows_persistence.py
2
#!/usr/bin/env python """Parse various Windows persistence mechanisms into PersistenceFiles.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from grr_response_core.lib import artifact_utils from grr_response_core.lib import parser from grr_response_cor...
wscullin/spack
refs/heads/qmcpack
var/spack/repos/builtin.mock/packages/flake8/package.py
3
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [email protected], All rights reserved. # LLNL-CODE-64...
barbuza/django
refs/heads/master
tests/model_regress/tests.py
326
from __future__ import unicode_literals import datetime from operator import attrgetter from django.core.exceptions import ValidationError from django.db import router from django.db.models.sql import InsertQuery from django.test import TestCase, skipUnlessDBFeature from django.utils import six from django.utils.time...
ric2b/Vivaldi-browser
refs/heads/master
chromium/chrome/common/extensions/docs/server2/platform_bundle_test.py
44
#!/usr/bin/env python # 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. import json import unittest from extensions_paths import CHROME_API, CHROME_EXTENSIONS, EXTENSIONS_API from mock_file_system import Mo...
kawamuray/ganeti
refs/heads/build
test/py/ganeti.confd.client_unittest.py
8
#!/usr/bin/python # # Copyright (C) 2009 Google 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...
florian-dacosta/OpenUpgrade
refs/heads/master
addons/analytic/__openerp__.py
112
# -*- 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...
catapult-project/catapult-csm
refs/heads/master
third_party/gsutil/third_party/rsa/rsa/pem.py
216
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <[email protected]> # # 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 # # Unl...
mov-q/dumpy
refs/heads/master
discariche/model/reallocation.py
1
"""Person model""" from sqlalchemy import Column, UniqueConstraint, ForeignKey from sqlalchemy import schema as saschema from sqlalchemy.types import Integer, String, Unicode, Float, UnicodeText, DateTime from discariche.model.meta import Base class Reallocation(Base): __tablename__ = "reallocation" id = Col...
hnakamur/site-alive-checker
refs/heads/master
wtforms/form.py
15
__all__ = ( 'BaseForm', 'Form', ) class BaseForm(object): """ Base Form Class. Provides core behaviour like field construction, validation, and data and error proxying. """ def __init__(self, fields, prefix=''): """ :param fields: A dict or sequence of 2-tuples...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/draft_schematic/clothing/shared_clothing_wke_hat_s01.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 = Intangible() result.template = "object/draft_schematic/clothing/shared_clothing_wke_hat_s01.iff" result.attribute...
yakovenkodenis/rethinkdb
refs/heads/next
test/rql_test/connections/connection_star.py
34
#!/usr/bin/env python '''Basic test that `from rethinkdb import *` works''' import os, sys sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, "common")) import driver, utils dbName, tableName = utils.get_test_db_table() # -- import rethikndb driver via star method p...
JoelSjostrand/counttrie
refs/heads/master
tests/counttrie_test.py
1
#! /usr/bin/env python """ Unit-test for run-tests """ import unittest import counttrie.counttrie as ct class TestCountTrie(unittest.TestCase): def test_counttrie(self): print "Creating tree" t = ct.CountTrie() t.add("AGAAT") t.add("AGAGG") t.add("AGAAG") t.add("...
jaredly/pyjamas
refs/heads/master
pygtkweb/demos/039-itemfactory.py
7
#!/usr/bin/env python # example itemfactory.py import pygtk pygtk.require('2.0') import gtk class ItemFactoryExample: # Obligatory basic callback def print_hello(self, w, data): print "Hello, World!" # This is the ItemFactoryEntry structure used to generate new menus. # Item 1: The menu path...
alpeware/gcms
refs/heads/master
lib/tests/test_service_account.py
5
# Copyright 2014 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 ...
kubernetes-client/python
refs/heads/master
kubernetes/client/models/v2beta2_external_metric_source.py
1
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.18 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
benoitc/bigcouch
refs/heads/master
couchjs/scons/scons-local-2.0.1/SCons/Variables/EnumVariable.py
61
"""engine.SCons.Variables.EnumVariable This file defines the option type for SCons allowing only specified input-values. Usage example: opts = Variables() opts.Add(EnumVariable('debug', 'debug output and symbols', 'no', allowed_values=('yes', 'no', 'full'), map={}, ign...
darktears/chromium-crosswalk
refs/heads/master
chrome/common/extensions/docs/server2/file_system.py
53
# Copyright (c) 2012 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. import posixpath import traceback from future import Future from path_util import ( AssertIsDirectory, AssertIsValid, IsDirectory, IsValid, SplitPar...
bgxavier/nova
refs/heads/master
nova/tests/unit/image/fake.py
22
# Copyright 2011 Justin Santa Barbara # 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/l...
darkoc/clowdflows
refs/heads/master
tweepy/__init__.py
9
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. """ Tweepy Twitter API library """ __version__ = '2.0' __author__ = 'Joshua Roesslein' __license__ = 'MIT' from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResult, ModelFactory, Category from tweepy.error i...
ehickox2012/bitraider
refs/heads/master
bitraider/trader_template.py
2
import sys import pytz import time import calendar import configparser import cmd from datetime import date, datetime, timedelta from strategy import strategy from exchange import cb_exchange_sim, cb_exchange class runner(cmd.Cmd): def __init__(self): """Create a new runner with provided CLI commands. Def...
gigitux/lollypop
refs/heads/master
src/player_linear.py
2
# Copyright (c) 2014-2015 Cedric Bellegarde <[email protected]> # 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...
bowlofstew/changes
refs/heads/master
changes/api/build_index.py
2
from __future__ import absolute_import, division, unicode_literals import json import logging import uuid from cStringIO import StringIO from flask.ext.restful import reqparse from sqlalchemy.orm import joinedload, subqueryload_all from werkzeug.datastructures import FileStorage from changes.api.base import APIView,...
RossBrunton/django
refs/heads/master
tests/gis_tests/gis_migrations/migrations/0001_initial.py
46
from django.db import connection, migrations, models from ...models import models as gis_models ops = [ migrations.CreateModel( name='Neighborhood', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.C...
remap/ndn-flow
refs/heads/master
framework/ndn_iot_python/examples/test_producing.py
1
#!/usr/bin/python from pyndn import Name, Interest, Data from pyndn.util.memory_content_cache import MemoryContentCache from pyndn.security import KeyChain from pyndn.threadsafe_face import ThreadsafeFace from ndn_iot_python.bootstrap.bootstrap import Bootstrap import time import sys import json import logging try...
shin-/compose
refs/heads/master
tests/unit/timeparse_test.py
11
from __future__ import absolute_import from __future__ import unicode_literals from compose import timeparse def test_milli(): assert timeparse.timeparse('5ms') == 0.005 def test_milli_float(): assert timeparse.timeparse('50.5ms') == 0.0505 def test_second_milli(): assert timeparse.timeparse('200s5ms...
XiaodunServerGroup/ddyedx
refs/heads/master
common/lib/xmodule/xmodule/lti_module.py
6
""" Learning Tools Interoperability (LTI) module. Resources --------- Theoretical background and detailed specifications of LTI can be found on: http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html This module is based on the version 1.1.1 of the LTI specifications by the IMS Global authority. For authenticat...
ActiveState/code
refs/heads/master
recipes/Python/286165_ilines__universal_newlines_any/recipe-286165.py
1
def ilines(source_iterable): '''yield lines as in universal-newlines from a stream of data blocks''' tail = '' for block in source_iterable: if not block: continue if tail.endswith('\015'): yield tail[:-1] + '\012' if block.startswith('\012'): ...
xtopsoft/grpc
refs/heads/master
src/python/interop/interop/methods.py
8
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
apache/incubator-mxnet
refs/heads/master
tests/python/unittest/test_gluon_rnn.py
1
# 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 u...
GarySparrow/mFlaskWeb
refs/heads/master
venv/Lib/site-packages/werkzeug/local.py
148
# -*- coding: utf-8 -*- """ werkzeug.local ~~~~~~~~~~~~~~ This module implements context-local objects. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import update_wrapper from werkzeug.wsgi import ClosingIt...
abantam/pmtud
refs/heads/master
utils/python-unit-tests.py
155
import unittest from ns.core import Simulator, Seconds, Config, int64x64_t import ns.core import ns.network import ns.internet import ns.mobility import ns.csma import ns.applications class TestSimulator(unittest.TestCase): def testScheduleNow(self): def callback(args): self._args_received = ...
tchellomello/home-assistant
refs/heads/dev
tests/components/dyson/test_vacuum.py
13
"""Test the Dyson 360 eye robot vacuum component.""" import unittest from unittest import mock from libpurecool.const import Dyson360EyeMode, PowerMode from libpurecool.dyson_360_eye import Dyson360Eye from homeassistant.components.dyson import vacuum as dyson from homeassistant.components.dyson.vacuum import Dyson36...
codrut3/tensorflow
refs/heads/master
tensorflow/contrib/estimator/python/estimator/dnn_linear_combined_test.py
17
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
schelleg/PYNQ
refs/heads/master
pynq/lib/arduino/arduino_grove_dlight.py
4
# Copyright (c) 2016, NECST Laboratory, Politecnico di Milano # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright not...
michi88/Zappa
refs/heads/master
tests/test_handler.py
4
import unittest from zappa.handler import LambdaHandler def no_args(): return def one_arg(first): return first def two_args(first, second): return first, second def var_args(*args): return args def var_args_with_one(first, *args): return first, args[0] def unsupported(first, second, third...
KokareIITP/django
refs/heads/master
tests/schema/fields.py
203
from django.db import models from django.db.models.fields.related import ( RECURSIVE_RELATIONSHIP_CONSTANT, ManyRelatedObjectsDescriptor, ManyToManyField, ManyToManyRel, RelatedField, create_many_to_many_intermediary_model, ) from django.utils.functional import curry class CustomManyToManyField(RelatedFie...
wiltonlazary/arangodb
refs/heads/devel
3rdParty/boost/1.61.0/tools/build/test/example_gettext.py
64
#!/usr/bin/python # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Test the 'gettext' example. import BoostBuild import os import string t = BoostBuild.Tester() t.set_tree("...
marioidival/pyramid_mongoengine
refs/heads/master
pyramid_mongoengine/__init__.py
1
# Copyright (c) 2015 Idival, Mario <[email protected]> # # 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, modif...
delinhabit/django
refs/heads/master
tests/auth_tests/test_remote_user.py
275
from datetime import datetime from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.backends import RemoteUserBackend from django.contrib.auth.middleware import RemoteUserMiddleware from django.contrib.auth.models import User from django.test import TestCase, modify_set...
ZeroEpoch1969/RubyRoseBot
refs/heads/master
utils/mysql.py
1
import sqlite3 conn = sqlite3.connect("data/data.db") conn.row_factory = sqlite3.Row cur = conn.cursor() def create_tables(): cur.execute("""CREATE TABLE IF NOT EXISTS guilds(id INTEGER, type TEXT, value TEXT)""") cur.execute("""CREATE TABLE IF NOT EXISTS blacklist(id INTEGER, name TEXT, discrim TEXT, reason ...
Curso-OpenShift/Formulario
refs/heads/master
OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/core/management/commands/startapp.py
117
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand class Command(TemplateCommand): help = ( "Creates a Django app directory structure for the given app name in " "the current directory or optionally...
2013Commons/HUE-SHARK
refs/heads/master
desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/contrib/localflavor/us/models.py
83
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import CharField from django.contrib.localflavor.us.us_states import STATE_CHOICES class USStateField(CharField): description = _("U.S. state (two uppercase letters)") def __init__(self, *arg...
xuru/pyvisdk
refs/heads/master
pyvisdk/do/dvs_summary.py
1
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def DVSSummary(vim, *args, **kwargs): '''Summary of the switch configuration.''' ...
hiteshwadekar/ns-3-dev-ndnSIM
refs/heads/ndnSIM
doc/tutorial/pickle-to-xml.py
392
#!/usr/bin/python # output xml format: # <pages> # <page url="xx"><prev url="yyy">zzz</prev><next url="hhh">lll</next><fragment>file.frag</fragment></page> # ... # </pages> import pickle import os import codecs def dump_pickles(out, dirname, filename, path): f = open(os.path.join(dirname, filename), 'r') da...
mineo/abzer
refs/heads/master
setup.py
1
#!/usr/bin/env python from __future__ import print_function from codecs import open from setuptools import setup setup(name="abzer", author="Wieland Hoffmann", author_email="[email protected]", packages=["abzer"], package_dir={"abzer": "abzer"}, download_url="https://github.com/mineo/ab...
xsynergy510x/android_external_chromium_org
refs/heads/cm-12.1
tools/perf/metrics/system_memory.py
46
# 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. from metrics import memory from metrics import Metric from telemetry.value import scalar class SystemMemoryMetric(Metric): """SystemMemoryMetric gathers ...
mralext20/apex-sigma
refs/heads/master
config_example.py
1
# Sigma's internal version control. sigma_version = 'Beta 0.41b' # 0 - Bot Application; 1 - User Account; Must be either 0 or 1. StartupType = '0' # Bot Application Token; Must be filled if the startup type is 0. Token = '' ClientID = '' # GitHub WebHook Server Settings. GitHubWebserverPort = 37812 GitHubWebserverAddr ...
gmarke/erpnext
refs/heads/develop
erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py
66
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class SalaryStructureDeduction(Document): pass
Mediamoose/django-svg-templatetag
refs/heads/master
tests/test_templatetags.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_django-svg-templatetag --------------------------- Tests for `django-svg-templatetag`. """ from django.template import Context, Template, TemplateSyntaxError from django.test.testcases import TestCase from svg_templatetag.templatetags.svg import SvgNode class ...
xadahiya/django
refs/heads/master
django/contrib/contenttypes/forms.py
376
from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.db import models from django.forms import ModelForm, modelformset_factory from django.forms.models import BaseModelFormSet class BaseGenericInlineFormSet(BaseModelFormSet): """ A formset for generic...
michaelaye/vispy
refs/heads/master
vispy/ext/six.py
9
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # This shim has been imported from Astropy. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Handle loading six package from system or from the bundled copy """ try: import importlib except ImportError: importli...
zxytim/pynojo
refs/heads/master
pynojo/lib/acl/__init__.py
3
# $File: __init__.py # $Date: Mon Mar 05 19:45:19 2012 +0800 # # Copyright (C) 2012 the pynojo development team <see AUTHORS file> # # Contributors to this file: # Kai Jia <[email protected]> # # This file is part of pynojo # # pynojo is free software: you can redistribute it and/or modify # it under the terms o...
BeegorMif/HTPC-Manager
refs/heads/master
lib/unidecode/x0c6.py
253
data = ( 'yeoss', # 0x00 'yeong', # 0x01 'yeoj', # 0x02 'yeoc', # 0x03 'yeok', # 0x04 'yeot', # 0x05 'yeop', # 0x06 'yeoh', # 0x07 'ye', # 0x08 'yeg', # 0x09 'yegg', # 0x0a 'yegs', # 0x0b 'yen', # 0x0c 'yenj', # 0x0d 'yenh', # 0x0e 'yed', # 0x0f 'yel', # 0x10 'yelg', ...
certik/pyjamas
refs/heads/master
examples/timesheet/view/components/FileOpenDlg.py
5
# vim: set ts=4 sw=4 expandtab: from ApplicationConstants import Notification from pyjamas.ui.HorizontalPanel import HorizontalPanel from pyjamas.ui.VerticalPanel import VerticalPanel from pyjamas.ui.Label import Label from pyjamas.ui.Button import Button from pyjamas.ui.DialogBox import DialogBox from pyjamas.ui.Fo...