repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pforret/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/test/test_filetransfer.py | 78 | # -*- test-case-name: twisted.conch.test.test_filetransfer -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE file for details.
import os
import re
import struct
import sys
from twisted.trial import unittest
try:
from twisted.conch import unix
unix # shut up pyflakes
except ImportError:... |
gtracy/madison-transit-api | refs/heads/master | gdata/docs/service.py | 53 | #!/usr/bin/python
#
# Copyright 2009 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 b... |
brandond/ansible | refs/heads/devel | test/units/executor/module_common/test_recursive_finder.py | 13 | # (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
throwable-one/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/modeltests/reserved_names/tests.py | 92 | import datetime
from django.test import TestCase
from models import Thing
class ReservedNameTests(TestCase):
def generate(self):
day1 = datetime.date(2005, 1, 1)
t = Thing.objects.create(when='a', join='b', like='c', drop='d',
alter='e', having='f', where=day1, has_hyphen='h')
... |
pusher/pusher-http-python | refs/heads/master | examples/trigger_tornado.py | 1 | import pusher
import pusher.tornado
import tornado.ioloop
ioloop = tornado.ioloop.IOLoop.instance()
def show_response(response):
print(response.result())
ioloop.stop()
pusher_client = pusher.Pusher.from_env(
backend=pusher.tornado.TornadoBackend,
timeout=50
)
response = pushe... |
naziris/HomeSecPi | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py | 316 | # urllib3/connectionpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sys
import errno
import logging
from socket import error as SocketError, timeout... |
sbidoul/odoo | refs/heads/8.0 | addons/crm_claim/__openerp__.py | 260 | # -*- 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... |
nimengyu2/dm3730-android-gingerbread-2.3-dk1.0-kernel | refs/heads/dm3730-android-gingerbread-2.3-dk1.0-first | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
SlimRemix/android_external_chromium_org | refs/heads/lp5.1 | tools/prepare-bisect-perf-regression.py | 84 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prepare Performance Test Bisect Tool
This script is used by a try bot to create a working directory and sync an
initial copy of... |
TheWardoctor/Wardoctors-repo | refs/heads/master | script.module.covenant/lib/resources/lib/sources/pl/paczamy.py | 7 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
Copyright (C) 2017 homik
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 ... |
HackerTool/vivisect | refs/heads/master | vstruct/defs/windows/win_6_2_amd64/win32k.py | 12 | # Version: 6.2
# Architecture: amd64
import vstruct
from vstruct.primitives import *
|
jaddison/ansible-modules-core | refs/heads/devel | cloud/digital_ocean/digital_ocean_sshkey.py | 133 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 later version.
#... |
fentas/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/bindings/main.py | 117 | # Copyright (C) 2011 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
uw-it-aca/nagios_registration | refs/heads/master | nagios_registration/migrations/0008_host_contact_groups.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nagios_registration', '0007_contact_contactgroup'),
]
operations = [
migrations.AddField(
model_name='host',
... |
duqiao/django | refs/heads/master | django/conf/locale/uk/formats.py | 565 | # -*- 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'
DA... |
fangxingli/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/forms/models.py | 45 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import absolute_import, unicode_literals
import warnings
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS, FieldError
from django.forms.fields import Field, ChoiceField
from django.fo... |
myerpengine/odoo | refs/heads/master | openerp/tools/yaml_tag.py | 105 | import yaml
import logging
class YamlTag(object):
"""
Superclass for constructors of custom tags defined in yaml file.
__str__ is overriden in subclass and used for serialization in module recorder.
"""
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def __getitem__(self, key... |
rigetticomputing/pyquil | refs/heads/master | pyquil/api/_wavefunction_simulator.py | 1 | ##############################################################################
# Copyright 2018 Rigetti Computing
#
# 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://ww... |
hajuuk/asuswrt | refs/heads/master | release/src/router/asusnatnl/pjproject-1.12/pjsip-apps/src/py_pjsua/pjsua_app.py | 32 | # $Id: pjsua_app.py 1438 2007-09-17 15:44:47Z bennylp $
#
# Sample and simple Python script to make and receive calls, and do
# presence and instant messaging/IM using PJSUA-API binding for Python.
#
# Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
#
import py_pjsua
import sys
import thread
#
# Configuratio... |
AnhellO/DAS_Sistemas | refs/heads/development | Ago-Dic-2017/Ivan Carreon/practica-1/Vendedor.py | 1 | from Persona import Persona
class Vendedor(Persona):
def __init__(self,nombre,apellidoPaterno,apellidoMaterno,sexo,edad,domicilio,telefono,idVendedor):
super().__init__(nombre,apellidoPaterno,apellidoMaterno,sexo,edad,domicilio,telefono)
self.idVendedor = idVendedor
def getIDVendedor(self):
... |
SpectraLogic/samba | refs/heads/master | wintest/wintest.py | 36 | #!/usr/bin/env python
'''automated testing library for testing Samba against windows'''
import pexpect, subprocess
import optparse
import sys, os, time, re
class wintest():
'''testing of Samba against windows VMs'''
def __init__(self):
self.vars = {}
self.list_mode = False
self.vms =... |
dacjames/docker-graphite-statsd | refs/heads/master | conf/opt/graphite/webapp/graphite/local_settings.py | 1 | ## Graphite local_settings.py
# Edit this file to customize the default Graphite webapp settings
#
# Additional customizations to Django settings can be added to this file as well
#####################################
# General Configuration #
#####################################
# Set this to a long, random unique s... |
RevolutionMC/Revolution | refs/heads/master | plugin.video.PsychoTV/_ytplist.py | 173 | import urllib
import urllib2,json
import xbmcvfs
import requests,time
import os,xbmc,xbmcaddon,xbmcgui,re
addon = xbmcaddon.Addon('plugin.video.live.streamspro')
profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
cacheDir = os.path.join(profile, 'cachedir')
clean_cache=os.path.join(cacheDir,'cl... |
dknlght/dkodi | refs/heads/master | src/plugin.video.animehere/servers/filebox.py | 35 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para filebox
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... |
VisheshHanda/production_backup | refs/heads/master | erpnext/patches/repair_tools/set_stock_balance_as_per_serial_no.py | 90 | # 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
def execute():
from erpnext.stock.stock_balance import set_stock_balance_as_per_serial_no
frappe.db.auto_commit_on_many_writes = 1
se... |
lhfei/spark-in-action | refs/heads/master | spark-2.x/src/main/python/ml/bisecting_k_means_example.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 n... |
SeattleTestbed/repy_v2 | refs/heads/master | emulfile.py | 1 | """
Author: Justin Cappos, Armon Dadgar
Start Date: 27 June 2008
V.2 Start Date: January 14th 2009
Description:
This is a collection of functions, etc. that need to be emulated in order
to provide the programmer with a reasonable environment. This is used
by repy.py to provide a highly restric... |
ahamilton55/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_selfip.py | 59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# 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
# ... |
shead-custom-design/pipecat | refs/heads/master | pipecat/record.py | 1 | # Copyright 2016 Timothy M. Shead
#
# This file is part of Pipecat.
#
# Pipecat 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.
#
# Pip... |
lichi6174/django-api-lab | refs/heads/master | src/posts/22.py | 2 | #!/usr/bin/env python
#encoding:utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
__author__ = 'lichi6174'
|
jojanper/draalcore | refs/heads/master | draalcore/auth/tests/test_templatetags.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mock import MagicMock
from django.conf import settings
from draalcore.auth.templatetags.tags import social_auth
from draalcore.test_utils.basetest import BaseTest
class TemplateTagsTestCase(BaseTest):
def test_social_auth(self):
"""Test user's social au... |
ycl2045/nova-master | refs/heads/master | 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... |
lukas-hetzenecker/home-assistant | refs/heads/dev | homeassistant/components/notify/nma.py | 2 | """
NMA (Notify My Android) notification service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.nma/
"""
import logging
import xml.etree.ElementTree as ET
import requests
import voluptuous as vol
from homeassistant.components.notify import (
... |
jk1/intellij-community | refs/heads/master | python/testData/intentions/paramTypeInNumpyDocStringCombinedParams.py | 52 | def f(x, <caret>y, z):
"""
Parameters
----------
x, y, z
Description
""" |
gonzolino/heat | refs/heads/master | heat_integrationtests/scenario/test_server_software_config.py | 4 | # 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... |
ff-/pineal | refs/heads/master | thirdparty/OSC.py | 10 | #!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based
(somewhat) on the good old 'SimpleOSC' implementation by Daniel Holth & Clinton
McChesney.
This implementation is intended to still be 'simple' to the user, but much more
complete (with OSCServer & OSCClient classes) ... |
eyeseast/python-frontmatter | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("README.md") as f:
readme = f.read()
VERSION = "1.0.0"
setup(
name="python-frontmatter",
version=VERSION,
description="Parse and manage posts with... |
orangeduck/PyAutoC | refs/heads/master | Python27/Lib/test/test_class.py | 17 | "Test the functionality of Python classes implementing operators."
import unittest
from test import test_support
testmeths = [
# Binary operations
"add",
"radd",
"sub",
"rsub",
"mul",
"rmul",
"div",
"rdiv",
"mod",
"rmod",
"divmod",
"rdivmod",
"pow",
"rpow",
... |
meta-it/misc-addons | refs/heads/10.0 | hr_public_holidays_ics_import/__openerp__.py | 1 | # -*- coding: utf-8 -*-
{
"name": """Import Holiday ICS""",
"summary": """
No need for import holidays manually anymore""",
"category": "Human Resources",
"images": ['images/ics_import.png'],
"version": "1.0.0",
"author": "IT-Projects LLC, Ildar Nasyrov",
"website": "https://it-projects... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/unittest/test/test_program.py | 71 | import io
import os
import sys
from test import support
import unittest
import unittest.test
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test._... |
ESS-LLP/erpnext-medical | refs/heads/develop | erpnext/crm/doctype/lead/lead_dashboard.py | 37 | from frappe import _
def get_data():
return {
'fieldname': 'lead',
'transactions': [
{
'items': ['Opportunity', 'Quotation']
},
]
} |
cemmanouilidis/go.platform | refs/heads/master | test/test.py | 1 | #!/usr/bin/env python3
import unittest
import subprocess
class TestLinuxDistribution(unittest.TestCase):
def testUbuntu1404(self):
_, output = subprocess.getstatusoutput(
"docker run --rm -it -v `pwd`:/pkg ubuntu:14.04 /pkg/platform"
)
self.assertEqual("ubuntu 14.04 trusty", o... |
leppa/home-assistant | refs/heads/dev | homeassistant/components/wirelesstag/switch.py | 6 | """Switch implementation for Wireless Sensor Tags (wirelesstag.net)."""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
from . import DOMAIN... |
drj11/pdftables | refs/heads/dev | test/test_ground.py | 3 | from pdftables.pdf_document import PDFDocument
from pdftables.pdftables import page_to_tables
import lxml.etree
from collections import Counter
from nose.tools import assert_equals
class ResultTable(object):
def __sub__(self, other):
r = ResultTable()
r.cells = self.cells
r.cells.subtract(... |
TriOptima/tri.table | refs/heads/master | examples/examples/urls.py | 2 | from django.conf.urls import include, url
from django.contrib import admin
from examples import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^readme_example_1/$', views.readme_example_1, name='readme_example_1'),
url(r'^readme_example_2/$', views.readme_example_2, name='readme_example... |
andrewsmedina/django | refs/heads/master | tests/aggregation_regress/tests.py | 5 | from __future__ import absolute_import, unicode_literals
import datetime
import pickle
from decimal import Decimal
from operator import attrgetter
from django.core.exceptions import FieldError
from django.contrib.contenttypes.models import ContentType
from django.db.models import Count, Max, Avg, Sum, StdDev, Varianc... |
Theer108/invenio | refs/heads/master | invenio/modules/groups/user_settings.py | 13 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2015 CERN.
#
# Invenio 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... |
loafbaker/django_matchmaker | refs/heads/master | jobs/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
timothypage/etor | refs/heads/master | etor/samples/models.py | 1 | from django.db import models
from picker.models import Race, Ethnicity, TestReason, SpecimenSource
# TODO move this to picker?
GENDER_CHOICES = (
(u'M', u'Male'),
(u'F', u'Female'),
(u'U', u'Unknown'),
)
SUFFIX_CHOICES = (
(u'JR.',u'JR.'),
(u'SR.',u'SR.'),
(u'I', u'I'),
(u'II', u'II'),
... |
zrs233/ursula | refs/heads/master | library/ceph_pool.py | 5 | #!/usr/bin/python
#coding: utf-8 -*-
DOCUMENTATION = """
---
author: Michael Sambol
module: ceph_pool
short_description: Creates ceph pool and ensures correct pg count
description:
There are three possible outcomes:
1/ Create a new pool if it doesn't exist
2/ Set the pool's pg count to correct number
3/ ... |
egineering-llc/egat | refs/heads/master | examples/example_jqueryui/tabs.py | 2 | __author__ = 'Brenda'
from egat.testset import SequentialTestSet
from webdriver_resource import WebDriverResource
from selenium import webdriver
class Test8(SequentialTestSet):
def testStep1(self):
# We can access the configuration parameters from inside any test function.
base_url = self.configur... |
orhankislal/incubator-madlib | refs/heads/master | src/madpack/yaml/composer.py | 120 |
__all__ = ['Composer', 'ComposerError']
from error import MarkedYAMLError
from events import *
from nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer(object):
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if se... |
linktlh/Toontown-journey | refs/heads/master | toontown/suit/DistributedBossCog.py | 1 | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import *
from direct.directnotify import DirectNotifyGlobal
from otp.avatar import DistributedAvatar
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import ToontownBattleGlobals
from to... |
sam-m888/addons-source | refs/heads/master | LastChange/LastChangeGramplet.py | 2 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Jakim Friant
#
# 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)... |
nirgal/ngw | refs/heads/master | core/views/logs.py | 1 | '''
Log managing views
'''
from django.utils import formats
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from ngw.core.models import Log
from ngw.core.nav import Navbar
from ngw.core.views.generic import NgwAdminAcl, NgwListView
__all__ = ['LogListView']
cla... |
medspx/QGIS | refs/heads/master | python/plugins/processing/algs/gdal/ColorRelief.py | 5 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ColorRelief.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*************... |
rmcgibbo/conda-build | refs/heads/master | conda_build/main_pipbuild.py | 2 | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import print_function, division, absolute_import
import sys
import os.path
import subp... |
NicWayand/OpenSfM | refs/heads/master | opensfm/features.py | 2 | # -*- coding: utf-8 -*-
import os, sys
import tempfile
import time
import logging
from subprocess import call
import numpy as np
import json
import uuid
import cv2
import csfm
logger = logging.getLogger(__name__)
def resized_image(image, config):
feature_process_size = config.get('feature_process_size', -1)
... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/Lib/distutils/command/build.py | 250 | """distutils.command.build
Implements the Distutils 'build' command."""
__revision__ = "$Id$"
import sys, os
from distutils.util import get_platform
from distutils.core import Command
from distutils.errors import DistutilsOptionError
def show_compilers():
from distutils.ccompiler import show_compilers
show... |
zapcoop/vertex | refs/heads/master | vertex_api/service/viewsets/__init__.py | 1 | from .ticket import *
from .team import *
from .update import *
from .note import *
from .ticket_subscriber import *
|
SimonWang2014/DockerConsoleApp | refs/heads/master | libs/stormed-amqp/build/lib.linux-x86_64-2.7/stormed/method/__init__.py | 4 | from stormed.method.codegen import id2class
|
citrix-openstack-build/nova | refs/heads/master | nova/servicegroup/drivers/zk.py | 13 | # Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com>
# Copyright 2012 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/licenses/LICENSE-2.0
#
# Unle... |
bokeh/bokeh | refs/heads/branch-2.4 | tests/unit/bokeh/application/handlers/test_handler.py | 1 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
GUBotDev/mavlink | refs/heads/master | pymavlink/tools/mavtomfile.py | 45 | #!/usr/bin/env python
'''
convert a MAVLink tlog file to a MATLab mfile
'''
import sys, os
import re
from pymavlink import mavutil
def process_tlog(filename):
'''convert a tlog to a .m file'''
print("Processing %s" % filename)
mlog = mavutil.mavlink_connection(filename, dialect=args.dialect, zero_time_... |
YihaoLu/statsmodels | refs/heads/master | statsmodels/examples/ex_scatter_ellipse.py | 39 | '''example for grid of scatter plots with probability ellipses
Author: Josef Perktold
License: BSD-3
'''
from statsmodels.compat.python import lrange
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.graphics.plot_grids import scatter_ellipse
nvars = 6
mmean = np.arange(1.,nvars+1)/nvars * 1.5
... |
andrejb/cloudant_bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/sgilink.py | 61 | """SCons.Tool.sgilink
Tool-specific initialization for the SGI MIPSPro linker on SGI.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2... |
LeeKamentsky/CellProfiler | refs/heads/master | cellprofiler/tests/test_cellprofiler.py | 1 | '''test_cellprofiler - test the CellProfiler command-line interface
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Broad Institute
All rights reserved.
Please see the AUTHORS file for credits.
Website: http://www.cellprofiler.org
'''
import datetime
import dateutil.parser
impo... |
eugenehp/bootstrap | refs/heads/master | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 292 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... |
zakandrewking/cobrapy | refs/heads/master | cobra/solvers/esolver.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from fractions import Fraction
from os import devnull, unlink
from os.path import isfile
from subprocess import CalledProcessError, check_call, check_output
from tempfile import NamedTemporaryFile
from six.moves import zip
from cobra.core.solution impor... |
christianurich/VIBe2UrbanSim | refs/heads/master | 3rdparty/opus/src/opus_gui/scenarios_manager/__init__.py | 538 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
|
afonsinoguimaraes/repository.magellan | refs/heads/master | plugin.video.SportsDevil/lib/downloader.py | 25 | # -*- coding: utf-8 -*-
import common
import urllib
import os.path
import xbmc, xbmcgui
class Downloader(object):
def __init__(self):
self.pDialog = None
def downloadWithJDownloader(self, url, title):
common.runPlugin('plugin://plugin.program.jdownloader/?action=addlink&url=' + url)
... |
BlakeTeam/VHDLCodeGenerator | refs/heads/master | blocks/Standard Library/Multiplexer.py | 1 | #-------------------------------------------------------------------------------
# PROJECT: VHDL Code Generator
# NAME: Dynamic Multiplexer
#
# LICENSE: GNU-GPL V3
#-------------------------------------------------------------------------------
__isBlock__ = True
__className__ = "Multiplexer"
__win__ = ... |
BeiLuoShiMen/nupic | refs/heads/master | tests/swarming/__init__.py | 175 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... |
openshine/ModemManager | refs/heads/master | test/enable.py | 3 | #!/usr/bin/python
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# 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 ... |
thePugalist/MozDef | refs/heads/master | alerts/bro_notice.py | 12 | #!/usr/bin/env python
# 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/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Anthony Verez averez@mozilla.com
fro... |
Semi-global/edx-platform | refs/heads/master | lms/djangoapps/notifier_api/tests.py | 115 | import itertools
import ddt
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from openedx.core.djangoapps.course_groups.models import CourseUserGroup
from django_comment_common.models import Role, Permission
from lang_pref import LANGUAGE_K... |
bwsblake/lettercounter | refs/heads/master | django-norel-env/lib/python2.7/site-packages/django/utils/unittest/util.py | 751 | """Various utility functions."""
__unittest = True
_MAX_LENGTH = 80
def safe_repr(obj, short=False):
try:
result = repr(obj)
except Exception:
result = object.__repr__(obj)
if not short or len(result) < _MAX_LENGTH:
return result
return result[:_MAX_LENGTH] + ' [truncated]...'... |
hanzz/qsimkit | refs/heads/master | 3rdparty/pythonqt21-qt462/examples/PyCustomMetaTypeExample/example.py | 3 | from PythonQt.example import CustomObject
# create a new object
custom = CustomObject("John","Doe")
# print the methods available
print dir(custom)
# set a name
custom.setFirstName("Mike")
custom.setLastName("Michels")
# get the name
print custom.firstName() + " " + custom.lastName();
|
gohin/django | refs/heads/master | tests/forms_tests/views.py | 452 | from django import forms
from django.views.generic.edit import UpdateView
from .models import Article
class ArticleForm(forms.ModelForm):
content = forms.CharField(strip=False, widget=forms.Textarea)
class Meta:
model = Article
fields = '__all__'
class ArticleFormView(UpdateView):
mode... |
eliben/code-for-blog | refs/heads/master | 2017/parsing-rst/rst-link-check.py | 1 | # Simple link checker for reStructuredText (.rst) files.
#
# Run with Python 3.4+
#
# Eli Bendersky [http://eli.thegreenplace.net]
# This code is in the public domain.
import argparse
import sys
import urllib.error
import urllib.request
import docutils.frontend
import docutils.nodes
import docutils.parsers.rst
import ... |
keerts/home-assistant | refs/heads/dev | tests/components/notify/test_apns.py | 6 | """The tests for the APNS component."""
import os
import unittest
from unittest.mock import patch
from unittest.mock import Mock
from apns2.errors import Unregistered
import homeassistant.components.notify as notify
from homeassistant.bootstrap import setup_component
from homeassistant.components.notify.apns import A... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.2/tests/regressiontests/templates/loaders.py | 39 | """
Test cases for the template loaders
Note: This test requires setuptools!
"""
from django.conf import settings
if __name__ == '__main__':
settings.configure()
import unittest
import sys
import pkg_resources
import imp
import StringIO
import os.path
import warnings
from django.template import TemplateDoesNot... |
turbomanage/training-data-analyst | refs/heads/master | courses/machine_learning/deepdive2/structured/solutions/serving/application/lib/pyasn1_modules/rfc4210.py | 7 | #
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# Certificate Management Protocol structures as per RFC4210
#
# Based on Alex Railean's work
#
from pyasn1.type import char
from pyasn1.type import constra... |
Nebucatnetzer/tamagotchi | refs/heads/master | pygame/lib/python3.4/site-packages/faker/providers/address/sk_SK/__init__.py | 19 | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
city_formats = ('{{city_name}}', )
street_name_formats = ('{{street_name}}', )
street_address_formats = ('{{street_name}} {{building_number}}', )
address_formats = ('{{st... |
stevekuznetsov/ansible | refs/heads/devel | lib/ansible/module_utils/docker_common.py | 24 | #
# Copyright 2016 Red Hat | Ansible
#
# 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 later version.
#
# ... |
t-tran/libcloud | refs/heads/trunk | libcloud/test/compute/test_ovh.py | 15 | # 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 use ... |
ta2-1/pootle | refs/heads/master | pootle/core/contextmanagers.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from contextlib import contextmanager, neste... |
jing-bao/pa-chromium | refs/heads/master | chrome/browser/ui/libgtk2ui/PRESUBMIT.py | 67 | #!/usr/bin/python
# 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.
"""Chromium presubmit script for src/chrome/browser/externsions.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-... |
jbenden/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_ami_copy.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 later version.
#
... |
jtorrents/networkx | refs/heads/master | networkx/algorithms/components/tests/test_attracting.py | 35 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestAttractingComponents(object):
def setUp(self):
self.G1 = nx.DiGraph()
self.G1.add_edges_from([(5,11),(11,2),(11,9),(11,10),
(7,11),(7,8),(8,9),(3,8),(3,10)])
self.G2 = nx.DiGraph(... |
cryptobanana/ansible | refs/heads/devel | lib/ansible/modules/database/influxdb/influxdb_database.py | 46 | #!/usr/bin/python
# (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.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',
... |
caphrim007/ansible | refs/heads/devel | lib/ansible/modules/storage/infinidat/infini_host.py | 70 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@gmail.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': '... |
sdague/home-assistant | refs/heads/dev | homeassistant/components/kiwi/lock.py | 14 | """Support for the KIWI.KI lock platform."""
import logging
from kiwiki import KiwiClient, KiwiException
import voluptuous as vol
from homeassistant.components.lock import PLATFORM_SCHEMA, LockEntity
from homeassistant.const import (
ATTR_ID,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_PASSWORD,
CONF_USER... |
srm912/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_cookies.py | 299 | import os
import unittest
import urllib2
import json
import wptserve
from base import TestUsingServer, doc_root
class TestResponseSetCookie(TestUsingServer):
def test_name_value(self):
@wptserve.handlers.handler
def handler(request, response):
response.set_cookie("name", "value")
... |
kmike/django-easy-maps | refs/heads/master | runtests.py | 1 | #!test/usr/bin/env python
import os
import sys
from django.core.management import execute_from_command_line
os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings'
def runtests():
argv = [sys.argv[0], 'test']
return execute_from_command_line(argv)
if __name__ == '__main__':
sys.exit(runtests())
|
jabbalaci/PrimCom | refs/heads/master | data/python/PATH.py | 1 | import os
# root directory of the application
ROOT = os.path.dirname(os.path.abspath(__file__))
|
kenshay/ImageScripter | refs/heads/master | Script_Runner/PYTHON/Lib/this.py | 948 | s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpg... |
chfw/moban | refs/heads/master | tests/test_reporter.py | 1 | import sys
from mock import patch
from nose.tools import eq_
from moban.externals import reporter
PY2 = sys.version_info[0] == 2
if PY2:
from StringIO import StringIO
else:
from io import StringIO
def test_partial_run():
patcher = patch("sys.stdout", new_callable=StringIO)
fake_stdout = patcher.sta... |
eleonrk/SickRage | refs/heads/master | lib/chardet/sbcsgroupprober.py | 273 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
mitsuhiko/pip | refs/heads/develop | pip/_vendor/colorama/__init__.py | 450 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from .initialise import init, deinit, reinit
from .ansi import Fore, Back, Style
from .ansitowin32 import AnsiToWin32
VERSION = '0.2.7'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.