repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
rec/echomesh | refs/heads/master | code/python/echomesh/util/math/WeightedRandom_test.py | 1 | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.util.math.WeightedRandom import WeightedRandom
from echomesh.util.TestCase import TestCase
class WeighedRandomTest(TestCase):
def test_empty(self):
wr = WeightedRandom([None])
self.assertEqual(wr.selec... |
ndaniel/fusioncatcher | refs/heads/master | bin/get_ucsc.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
It downloads the lastest available genes annotations (chromosomal positions and gene symbols) from UCSC.
Author: Daniel Nicorici, Daniel.Nicorici@gmail.com
Copyright (c) 2009-2021 Daniel Nicorici
This file is part of FusionCatcher.
FusionCatcher is free software:... |
p2pu/learning-circles | refs/heads/master | studygroups/migrations/0022_remove_contact_options.py | 1 | # -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0021_auto_20150506_0036'),
]
operations = [
migrations.AlterField(
model_name='application',
name='contact_method',
... |
dgoedkoop/QGIS | refs/heads/master | tests/src/python/test_qgsextentgroupbox.py | 12 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsExtentGroupBox
.. note:: 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.
"""
... |
hxx0215/shadowsocks | refs/heads/master | tests/coverage_server.py | 1072 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... |
Learningtribes/edx-platform | refs/heads/master | common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py | 29 | """
Javascript tests for the crowdsourcehinter xblock
"""
from textwrap import dedent
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.pages.lms.courseware import CoursewarePage
from common.test.acceptance.pages.xblock.crowdsourcehinter_problem import Crowd... |
tinkhaven-organization/odoo | refs/heads/8.0 | addons/anonymization/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
moas/rpcviaredis | refs/heads/master | rpcviaredis/example.py | 1 | from rpcviaredis import *
class DummyServer(ServerRPC):
def sum(self, x, y):
return Response(response=x+y, exception=None, reason=None, return_code=200)
def naive_div(self, x, y):
return Response(response=x/y, exception=None, reason=None, return_code=200)
def multiplication(self, x, y):... |
dhcrzf/zulip | refs/heads/master | zerver/migrations/0158_realm_video_chat_provider.py | 9 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0157_userprofile_is_guest'),
]
operations = [
migrations.AddFiel... |
pymedusa/SickRage | refs/heads/master | ext/twitter/parse_tweet.py | 7 | #!/usr/bin/env python
import re
class Emoticons:
POSITIVE = ["*O", "*-*", "*O*", "*o*", "* *",
":P", ":D", ":d", ":p",
";P", ";D", ";d", ";p",
":-)", ";-)", ":=)", ";=)",
":<)", ":>)", ";>)", ";=)",
"=}", ":)", "(:;)",
... |
cainmatt/django | refs/heads/master | tests/migrations/test_migrations_squashed_erroneous/6_auto.py | 770 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "5_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
eloquence/unisubs | refs/heads/staging | apps/teams/migrations/0117_auto__add_field_teammember_created.py | 5 | # 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):
# Adding field 'TeamMember.created'
db.add_column('teams_teammember', 'created', self.gf('django.db.mo... |
dsiddharth/access-keys | refs/heads/master | keystone/tests/test_backend_ldap.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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/li... |
gstiebler/odemis | refs/heads/master | src/odemis/model/test/futures_test.py | 2 | # -*- coding: utf-8 -*-
'''
Created on 10 Dec 2013
@author: Éric Piel
Copyright © 2013 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Odemis is... |
demisto/content | refs/heads/master | Packs/GetServerURL/Scripts/GetServerURL/GetServerURL_test.py | 1 | import demistomock as demisto
from CommonServerPython import *
import GetServerURL
def test_get_url(mocker):
# Set
mocker.patch.object(demisto, 'demistoUrls', return_value={'server': 'https://www.eizelulz.com:8443'})
mocker.patch.object(demisto, 'results')
# Arrange
GetServerURL.main()
output... |
brysontyrrell/EncryptedStrings | refs/heads/master | EncryptedStrings_Python.py | 1 | #!/usr/bin/python2.7
# Python wrapper for 'openssl' to create an encrypted Base64 string for script parameters
# Additional layer of security when passing account credentials from the JSS to a client
import subprocess
# Use GenerateEncryptedString() locally - DO NOT include in the script!
# The 'Encrypted String' wil... |
surhudm/scipy | refs/heads/master | scipy/constants/codata.py | 54 | # Compiled by Charles Harris, dated October 3, 2002
# updated to 2002 values by BasSw, 2006
# Updated to 2006 values by Vincent Davis June 2010
# Updated to 2014 values by Joseph Booker, 2015
"""
Fundamental Physical Constants
------------------------------
These constants are taken from CODATA Recommended Values of ... |
google/llvm-propeller | refs/heads/bb-clusters | lldb/test/API/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py | 3 | """
Test lldb data formatter subsystem.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class DataFormatterVarScriptFormatting(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setU... |
sniemi/SamPy | refs/heads/master | sandbox/src1/TCSE3-3rd-examples/src/py/examples/canvas/canvas1.py | 1 | #!/usr/bin/env python
from Tkinter import *
# the first canvas encounter:
root = Tk()
c = Canvas(root,width=400, height=400)
c.pack()
c.create_oval(100, 100, 200, 200, fill='red', outline='blue')
c.create_text(100, 100, text='(100,100)')
c.create_text(200, 200, text='(200,200)')
c.create_line(100,100, 100,200, 20... |
spring-week-topos/nova-week | refs/heads/spring-week | nova/openstack/common/processutils.py | 8 | # Copyright 2011 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 req... |
irkru/python-twitter | refs/heads/master | tests/test_api.py | 16 | # encoding: utf-8
import twitter
import time
import unittest
from apikey import (CONSUMER_KEY,
CONSUMER_SECRET,
ACCESS_TOKEN_KEY,
ACCESS_TOKEN_SECRET)
@unittest.skipIf(not CONSUMER_KEY and not CONSUMER_SECRET, "No tokens provided")
class ApiTest(unittest.T... |
ariabuckles/pyobjc-core | refs/heads/master | PyObjCTest/test_metadata.py | 2 | """
Tests for the new-style metadata format interface.
Note: Tests for calling from ObjC into python are in test_metadata_py.py
TODO:
- Add tests for calling functions instead of methods
- The python->C interface (that is the contents of the metadata object) is
likely to change when the bridge is feature-complete.
... |
konstruktoid/ansible-upstream | refs/heads/devel | test/units/modules/cloud/amazon/test_ec2_group.py | 49 | import pytest
from ansible.modules.cloud.amazon import ec2_group as group_module
def test_from_permission():
internal_http = {
u'FromPort': 80,
u'IpProtocol': 'tcp',
u'IpRanges': [
{
u'CidrIp': '10.0.0.0/8',
u'Description': 'Foo Bar Baz'
... |
axsauze/eventsfinder | refs/heads/master | django/utils/copycompat.py | 124 | """
Fixes Python 2.4's failure to deepcopy unbound functions.
"""
import copy
import types
import warnings
warnings.warn("django.utils.copycompat is deprecated; use the native copy module instead",
DeprecationWarning)
# Monkeypatch copy's deepcopy registry to handle functions correctly.
if (hasattr(cop... |
dhruvagarwal/django | refs/heads/master | tests/servers/test_basehttp.py | 42 | from django.core.handlers.wsgi import WSGIRequest
from django.core.servers.basehttp import WSGIRequestHandler
from django.test import SimpleTestCase
from django.test.client import RequestFactory
from django.test.utils import captured_stderr
from django.utils.six import BytesIO
class Stub(object):
def __init__(sel... |
jeffrey4l/nova | refs/heads/master | nova/objects/quotas.py | 29 | # Copyright 2013 Rackspace Hosting.
#
# 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... |
laiquwuhen/p2pool | refs/heads/master | wstools/__init__.py | 293 | #! /usr/bin/env python
"""WSDL parsing services package for Web Services for Python."""
ident = "$Id$"
import WSDLTools
import XMLname
import logging
|
martinbuc/missionplanner | refs/heads/master | Lib/site-packages/numpy/distutils/fcompiler/absoft.py | 89 |
# http://www.absoft.com/literature/osxuserguide.pdf
# http://www.absoft.com/documentation.html
# Notes:
# - when using -g77 then use -DUNDERSCORE_G77 to compile f2py
# generated extension modules (works for f2py v2.45.241_1936 and up)
import os
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompile... |
snazy2000/netbox | refs/heads/develop | netbox/dcim/urls.py | 1 | from __future__ import unicode_literals
from django.conf.urls import url
from extras.views import ImageAttachmentEditView
from ipam.views import ServiceCreateView
from secrets.views import secret_add
from .models import Device, Rack, Site
from . import views
app_name = 'dcim'
urlpatterns = [
# Regions
url(... |
scorphus/scrapy | refs/heads/master | scrapy/extensions/debug.py | 152 | """
Extensions for debugging Scrapy
See documentation in docs/topics/extensions.rst
"""
import sys
import signal
import logging
import traceback
import threading
from pdb import Pdb
from scrapy.utils.engine import format_engine_status
from scrapy.utils.trackref import format_live_refs
logger = logging.getLogger(__n... |
vmindru/ansible | refs/heads/devel | lib/ansible/modules/network/layer2/net_l2_interface.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
Azulinho/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/debug.py | 76 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# 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',
... |
melodous/designate | refs/heads/stable/juno | designate/__init__.py | 1 | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... |
ahaym/eden | refs/heads/master | modules/test_utils/find_JSON_format_data_structure.py | 44 |
import re
from json.decoder import JSONDecoder
__all__ = (
"not_found",
"cannot_parse_JSON",
"find_JSON_format_data_structure"
)
def not_found(name, string):
raise Exception(
u"Cannot find %s in %s" % (name, string)
)
def cannot_parse_JSON(string):
raise Exception(
u"Cann... |
eliran-stratoscale/rackattack-physical | refs/heads/master | rackattack/physical/tests/integration/use_local_inaugurator.py | 2 | import os
import sys
def setupPath():
inauguratorDir = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..', "inaugurator")
sys.path.insert(0, inauguratorDir)
def verify():
import inaugurator
for pathComponent in ('usr', 'build'):
assert pathComponent not in inaugurator.__fil... |
pombreda/pyMIC | refs/heads/master | benchmarks/dgemm.py | 3 | #!/usr/bin/python
# Copyright (c) 2014-2015, Intel Corporation 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
# notic... |
ansp-2015/arquea | refs/heads/master | financeiro/__init__.py | 269 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
AliLozano/django-guardian | refs/heads/master | guardian/tests/utils_test.py | 35 | from django.test import TestCase
from django.contrib.auth.models import User, Group, AnonymousUser
from guardian.tests.core_test import ObjectPermissionTestCase
from guardian.utils import get_anonymous_user, get_identity
from guardian.exceptions import NotUserNorGroup
class GetAnonymousUserTest(TestCase):
def te... |
vcelis/cs253 | refs/heads/master | lesson2/homework2/login.py | 1 | """
Udacity CS253 - Lesson 2 - Homework 2
"""
import webapp2, jinja2, os, re
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir), autoescape = True)
def render_temp(template, **params):
t = jinja_env.get_template(template)
... |
charbeljc/account-financial-tools | refs/heads/8.0 | account_credit_control_dunning_fees/model/__init__.py | 46 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
nicobustillos/odoo | refs/heads/8.0 | addons/mrp_repair/wizard/make_invoice.py | 172 | # -*- 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... |
dylansmithing/leader-of-rock-wordpress | refs/heads/master | wp-content/themes/rock/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | #!/usr/bin/env python
# Copyright 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... |
basilrormose/ud032 | refs/heads/master | Lesson_5_Analyzing_Data/05-Using_group/tweet_sources.py | 9 | #!/usr/bin/env python
"""
The tweets in our twitter collection have a field called "source". This field describes the application
that was used to create the tweet. Following the examples for using the $group operator, your task is
to modify the 'make-pipeline' function to identify most used applications for creating ... |
toshywoshy/ansible | refs/heads/devel | lib/ansible/module_utils/network/junos/config/interfaces/interfaces.py | 19 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The junos_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary ... |
BillKeenan/lets-encrypt-preview | refs/heads/master | letsencrypt-apache/docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# letsencrypt-apache documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 18 13:39:26 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... |
rottenbytes/Sick-Beard | refs/heads/master | lib/bencode/BTL.py | 278 | class BTFailure(Exception):
pass
|
zenoss/Community-Zenpacks | refs/heads/master | ZenPacks.community.HPBladeChassis/ZenPacks/community/HPBladeChassis/BladeChassisPsu.py | 5 | from Globals import InitializeClass
# from AccessControl import ClassSecurityInfo
from Products.ZenRelations.RelSchema import *
from Products.ZenModel.DeviceComponent import DeviceComponent
from Products.ZenModel.ManagedEntity import ManagedEntity
from Products.ZenUtils.Utils import convToUnits
from Products.ZenModel... |
jean/sentry | refs/heads/master | tests/sentry/api/endpoints/test_project_details.py | 1 | from __future__ import absolute_import
import mock
import six
from django.core.urlresolvers import reverse
from sentry.models import Project, ProjectBookmark, ProjectStatus, UserOption
from sentry.testutils import APITestCase
class ProjectDetailsTest(APITestCase):
def test_simple(self):
project = self.... |
hamdigdoura/django-survey-formset | refs/heads/master | django_questionnaire/__init__.py | 1 | __author__ = 'hamdi'
|
flwh/KK_mt6589_iq451 | refs/heads/master | prebuilts/python/linux-x86/2.7.5/lib/python2.7/ctypes/macholib/framework.py | 268 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic framework path manipulation
"""
import re
__all__ = ['framework_info']
STRICT_FRAMEWORK_RE =... |
arielrossanigo/tota | refs/heads/master | tota/heroes/noob.py | 2 | from random import choice
from tota.utils import adjacent_positions
def create():
def noob_hero_logic(self, things, t):
actions = 'move', 'attack', 'fireball', 'heal', 'stun'
positions = adjacent_positions(self.position)
return choice(actions), choice(positions)
return noob_hero_lo... |
artur-shaik/qutebrowser | refs/heads/master | qutebrowser/config/textwrapper.py | 8 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
Luavis/SOS | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
NickDaly/GemRB-MultipleConfigs | refs/heads/master | gemrb/GUIScripts/bg2/GUIOPT10.py | 5 | # GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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 versi... |
alt-core/sheetbot | refs/heads/master | models.py | 1 | # coding: utf-8
import json
import random
import string
from google.appengine.ext import ndb
class GlobalBotVariables(ndb.Model):
scenario_uri = ndb.StringProperty()
class GroupMembers(ndb.Model):
members = ndb.StringProperty(repeated=True)
class PlayerStatus(ndb.Model):
scene = ndb.StringProperty()
... |
xcore995/lge_h502_kernel | refs/heads/master | tools/perf/scripts/python/net_dropmonitor.py | 2669 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
yanheven/nova | refs/heads/master | nova/tests/unit/virt/libvirt/test_remotefs.py | 36 | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_binhex.py | 193 | #! /usr/bin/env python
"""Test script for the binhex C module
Uses the mechanism of the python binhex module
Based on an original test by Roger E. Masse.
"""
import binhex
import os
import unittest
from test import test_support
class BinHexTestCase(unittest.TestCase):
def setUp(self):
self.fname1 ... |
galtys/odoo | refs/heads/8.0 | addons/account_budget/tests/test_theoreticalamount.py | 53 | # -*- coding: utf-8 -*-
from datetime import datetime
from mock import patch
from openerp.tests.common import TransactionCase
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_compare
# ---------------------------------------------------------
# Tests
# -------------------------------------------------... |
naucoin/VTKSlicerWidgets | refs/heads/master | Examples/DataManipulation/Python/CreateStrip.py | 15 | #!/usr/bin/env python
# This script shows how to manually create a vtkPolyData with a
# triangle strip.
import vtk
# First we'll create some points.
points = vtk.vtkPoints()
points.InsertPoint(0, 0.0, 0.0, 0.0)
points.InsertPoint(1, 0.0, 1.0, 0.0)
points.InsertPoint(2, 1.0, 0.0, 0.0)
points.InsertPoint(3, 1.0, 1.0, ... |
Stanford-Online/edx-platform | refs/heads/master | scripts/xblock/xblock_counts.py | 12 | import argparse
import csv
import json
import os
import sys
from datetime import datetime
import requests
from six import text_type
# Keys for the CSV and JSON interpretation
PAGINATION_KEY = 'pagination'
NUM_PAGES_KEY = 'num_pages'
NEXT_PAGE_URL_KEY = 'next'
RESULTS_KEY = 'results'
BLOCKS_URL_KEY = 'blocks_url'
BLOC... |
crossbario/autobahn-python | refs/heads/master | autobahn/wamp/test/test_wamp_uri_pattern.py | 3 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in ... |
betoesquivel/flaskTriviaPrototype | refs/heads/master | mongohqtest.py | 1 | import os
import pymongo
from pymongo import MongoClient
cQuestions = "collQuestions"
cQuizzes = "collQuizzes"
cResults = "collResults"
MONGO_URL = os.environ.get('MONGOHQ_URL')
client = MongoClient(MONGO_URL)
db = client['rapid-quiz']
print "Connected to the database..."
print db.collection_names()
print "Getting... |
40023247/2015cd_0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/dom/domreg.py | 841 | """Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
# This is a list of well-known implementations. Well-known names
# should be published by posting to xml-sig@python.org, and are
# ... |
apavlo/h-store | refs/heads/master | tools/getjava.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys, re, string, commands
jvmVersion = None
output = commands.getoutput("java -version")
regex = re.compile("(?:java|openjdk) version \"(1\.\d)\..*?\"", re.IGNORECASE)
m = regex.search(output)
if m: jvmVersion = m.group(1)
assert not jvmVersion is None
print ... |
jackjshin/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/RT.py | 248 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
tux-mind/platform_external_subversion | refs/heads/master | tools/server-side/test_svn_server_log_parse.py | 5 | #!/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 ... |
mozilla/splice | refs/heads/master | migrations/versions/3cc07fb28766_.py | 3 | """empty message
Revision ID: 3cc07fb28766
Revises: 16fa35dd63a2
Create Date: 2015-09-22 14:39:21.811450
"""
# revision identifiers, used by Alembic.
revision = '3cc07fb28766'
down_revision = '16fa35dd63a2'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialect... |
fdroidtravis/repomaker | refs/heads/master | repomaker/admin.py | 1 | from django.contrib import admin
from hvad.admin import TranslatableAdmin
from .models import Repository, RemoteRepository, App, RemoteApp, Apk, ApkPointer, \
RemoteApkPointer, Category, Screenshot, RemoteScreenshot
from .models.storage import StorageManager
admin.site.register(Repository)
admin.site.register(Rem... |
lthurlow/Network-Grapher | refs/heads/master | proj/external/matplotlib-1.2.1/examples/pylab_examples/errorbar_demo.py | 3 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
# example data
x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)
# example variable error bar values
yerr = 0.1 + 0.2*np.sqrt(x)
xerr = 0.1 + yerr
# First illustrate basic pyplot interface, using defaults where possible.
plt.figure()
plt.errorbar(x, y,... |
hristy93/FallingRocks | refs/heads/master | gameplay/falling_rocks_tests.py | 1 | import unittest
from gameplay.rock import Rock
from gameplay.player import Player
from gameplay.bullet import Bullet
from gameplay.field import Field
from gameplay.game import Game
from gui.user_interface import UserInterface
from gui.bullet_ui import BulletUI
from gui.powerup_ui import PowerupUI, PowerupType
class R... |
ClaudioGranatiero/ClyphX_CG | refs/heads/master | ClyphX/MacrobatUserConfig.py | 1 | """
# Copyright (C) 2013-2015 Stray <stray411@hotmail.com>
#
# This library 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 (at your option) any later versi... |
brianmay/python-tldap-debian | refs/heads/master | tldap/test/slapd.py | 1 | """
Utilities for starting up a test slapd server
and talking to it with ldapsearch/ldapadd.
"""
import sys
import os
import socket
import time
import subprocess
import logging
import tempfile
import base64
_log = logging.getLogger("slapd")
def quote(s):
'''
Quotes the '"' and '\' characters in a string and ... |
lcw/occa | refs/heads/master | make.py | 2 | import sys, os, imp
import numpy as np
from distutils import sysconfig
import os.path as osp
occadir = osp.abspath(osp.dirname(__file__))
py_major = str(sys.version_info.major)
py_minor = str(sys.version_info.minor)
pythonName = 'python' + py_major + '.' + py_minor
if py_major == '3':
pythonName += 'm'... |
erikld/Bobo | refs/heads/master | python3/koans/about_list_assignments.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutArrayAssignments in the Ruby Koans
#
from runner.koan import *
class AboutListAssignments(Koan):
def test_non_parallel_assignment(self):
names = ["John", "Smith"]
self.assertEqual(['John', 'Smith'], names)
def test_parallel_assi... |
lz1988/django-web2015 | refs/heads/master | build/lib/django/contrib/gis/gdal/prototypes/srs.py | 219 | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, int_output, srs_output, string_output, void_output)
## Shortcut generation for routines with known paramet... |
armaan/openstack-dashboard | refs/heads/master | django-openstack/django_openstack/dash/views/ports.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
Lochlan/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py | 121 | # Copyright (C) 2009 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... |
40223220/2015ca | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/encodings/aliases.py | 726 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... |
jobscry/vz-blog | refs/heads/master | posts/admin.py | 1 | # -*- mode: python; coding: utf-8; -*-
from django.contrib import admin
from posts.models import Post
from posts.forms import PostAdminForm
class PostAdmin(admin.ModelAdmin):
class Media:
css = {
'all': (
"js/markitup/skins/markitup/style.css",
"js/markitup/sets/... |
dpyro/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/etree.py | 658 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import gettext
_ = gettext.gettext
import re
from six import text_type
from . im... |
luvit/gyp | refs/heads/luvit-dev | test/same-source-file-name/gyptest-default.py | 502 | #!/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.
"""
Build a .gyp with two targets that share a common .c source file.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('all.gyp',... |
sahilshekhawat/sympy | refs/heads/master | sympy/core/benchmarks/bench_sympify.py | 121 | from __future__ import print_function, division
from sympy.core import sympify, Symbol
x = Symbol('x')
def timeit_sympify_1():
sympify(1)
def timeit_sympify_x():
sympify(x)
|
GinnyN/Team-Fortress-RPG-Generators | refs/heads/master | build/lib/django/contrib/gis/utils/layermapping.py | 78 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... |
masci/django-appengine-toolkit | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
east825/pot | refs/heads/master | pot.py | 1 | # vim: fileencoding=utf-8
# Copyright (c) 2013 Mikhail Golubev
#
# 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, ... |
ramondelafuente/ansible-modules-extras | refs/heads/devel | cloud/openstack/os_zone.py | 37 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# T... |
LoveOrange/paradise | refs/heads/master | src/command_handler.py | 1 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import subprocess
class Command(object):
def __init__(self, command):
self.command = command
def run(self):
process = subprocess.Popen(self.command, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.P... |
openmv/micropython | refs/heads/master | tests/wipy/sd.py | 14 | """
SD card test for the CC3200 based boards.
"""
from machine import SD
import os
mch = os.uname().machine
if "LaunchPad" in mch:
sd_pins = ("GP16", "GP17", "GP15")
elif "WiPy" in mch:
sd_pins = ("GP10", "GP11", "GP15")
else:
raise Exception("Board not supported!")
sd = SD(pins=sd_pins)
print(sd)
sd.dei... |
minesense/VisTrails | refs/heads/master | vistrails/db/versions/v0_9_2/persistence/__init__.py | 2 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
kant/inasafe | refs/heads/develop | safe/impact_statistics/function_options_dialog.py | 3 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Impact Functions Dialog.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Soft... |
witchcorestudios/PW-OSP-SCRIPTS-by-witchcorestudios | refs/heads/master | process_meshes.py | 6 | import process_common as pc
import process_operations as po
import module_meshes
def process_entry(processor, txt_file, entry, index):
txt_file.write("mesh_%s %d %s %f %f %f %f %f %f %f %f %f\r\n" % (entry[0:2] +
(pc.replace_spaces(entry[2]),) + entry[3:12]))
export = po.make_export(data=module_meshes.meshes,... |
otherness-space/myProject | refs/heads/master | my_project_001/lib/python2.7/site-packages/django/conf/locale/te/formats.py | 433 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =... |
Mlieou/oj_solutions | refs/heads/master | leetcode/python/ex_725.py | 3 | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def splitListToParts(self, root, k):
"""
:type root: ListNode
:type k: int
:rtype: List[ListNode]
"""
... |
ProfessionalIT/maxigenios-website | refs/heads/master | sdk/google_appengine/google/pyglib/singleton.py | 6 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
alon/polinax | refs/heads/master | libs/external_libs/gdata.py-1.0.13/src/gdata/spreadsheet/service.py | 10 | #!/usr/bin/python
#
# Copyright (C) 2007 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 ... |
hellhovnd/django | refs/heads/master | tests/dispatch/tests/test_dispatcher.py | 56 | import gc
import sys
import time
from django.dispatch import Signal, receiver
from django.utils import unittest
if sys.platform.startswith('java'):
def garbage_collect():
# Some JVM GCs will execute finalizers in a different thread, meaning
# we need to wait for that to complete before we go on l... |
wavemind/gcb17ml | refs/heads/master | common/jinja_utils.py | 1 | # 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 ... |
goofwear/Emby.Kodi | refs/heads/master | resources/lib/WriteKodiMusicDB.py | 1 | # -*- coding: utf-8 -*-
#################################################################################################
# WriteKodiMusicDB
#################################################################################################
import sqlite3
from datetime import datetime
from ntpath import split as ntspli... |
Comcast/neutron | refs/heads/master | neutron/plugins/embrane/__init__.py | 160 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Embrane, 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/l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.