repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Microsoft/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/requests/exceptions.py
63
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request. """ ...
kenshay/ImageScripter
refs/heads/master
Script_Runner/PYTHON/Lib/_sitebuiltins.py
137
""" The objects used by the site module to add custom builtins. """ # Those objects are almost immortal and they keep a reference to their module # globals. Defining them in the site module would keep too many references # alive. # Note this means this module should also avoid keep things alive in its # globals. imp...
TakeshiTseng/ryu
refs/heads/master
ryu/tests/unit/packet/test_vxlan.py
9
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation. # # 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 appli...
gkarlin/django-jenkins
refs/heads/master
build/Django/tests/modeltests/model_package/models/article.py
150
from django.contrib.sites.models import Site from django.db import models class Article(models.Model): sites = models.ManyToManyField(Site) headline = models.CharField(max_length=100) publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,) class Meta: app_la...
sensbio/sensbiotk
refs/heads/master
examples/pedometer/pedometer.py
1
# -*- coding: utf-8; -*- # This file is a part of sensbiotk # Contact : sensbio@inria.fr # Copyright (C) 2014 INRIA (Contact: sensbiotk@inria.fr) # # 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 Foundatio...
adambrenecki/django
refs/heads/master
django/conf/locale/ka/formats.py
118
# -*- 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 = 'l, j F, Y' TIME_FORMAT = 'h:i:s a...
aidanlister/django
refs/heads/master
django/conf/app_template/apps.py
411
from django.apps import AppConfig class {{ camel_case_app_name }}Config(AppConfig): name = '{{ app_name }}'
ohgodscience/LearningPython
refs/heads/master
stimuligenerator/tests.py
3
import unittest from stimuligenerator import GenerateSelf, GeneratePartner, GenerateGroupvsPartner from stimuligenerator import GenerateGroupvsSelf, GenerateSelfvsPartner #These 4 classes simply test if the first object returns what it should #(e.g., that the self-interest stimuli give more to the self than the #othe...
monikasulik/django-oscar
refs/heads/master
src/oscar/apps/shipping/models.py
32
from oscar.core.loading import is_model_registered from oscar.apps.shipping import abstract_models __all__ = [] if not is_model_registered('shipping', 'OrderAndItemCharges'): class OrderAndItemCharges(abstract_models.AbstractOrderAndItemCharges): pass __all__.append('OrderAndItemCharges') if not i...
xiandiancloud/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_navigation.py
11
""" This test file will run through some LMS test scenarios regarding access and navigation of the LMS """ import time from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from xmodule.modulestore.tests.factories import CourseFactory, ItemFactor...
konstruktoid/ansible-upstream
refs/heads/devel
lib/ansible/modules/windows/win_disk_facts.py
52
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Marc Tschapek <marc.tschapek@itelligence.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supp...
baylee-d/osf.io
refs/heads/develop
addons/figshare/serializer.py
14
from addons.base.serializer import StorageAddonSerializer from addons.figshare.client import FigshareClient from website.util import api_url_for, web_url_for class FigshareSerializer(StorageAddonSerializer): addon_short_name = 'figshare' def credentials_are_valid(self, user_settings, client): if use...
ohio813/libforensics
refs/heads/master
unittests/tests/win/shell/link/objects.py
13
# Copyright 2010 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 3 of the License, or # (at your option) any later ver...
adrienbrault/home-assistant
refs/heads/dev
homeassistant/components/zwave_js/binary_sensor.py
3
"""Representation of Z-Wave binary sensors.""" from __future__ import annotations import logging from typing import Callable, TypedDict from zwave_js_server.client import Client as ZwaveClient from zwave_js_server.const import CommandClass from homeassistant.components.binary_sensor import ( DEVICE_CLASS_BATTERY...
bzhou26/EdmontonChinaSearch
refs/heads/master
requests/packages/chardet/__init__.py
1777
######################## BEGIN LICENSE BLOCK ######################## # 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 ve...
hryamzik/ansible
refs/heads/devel
lib/ansible/playbook/become.py
87
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an...
telminov/django-shuffler
refs/heads/master
__init__.py
161
# coding=utf-8
RoboDonut/landsat-util
refs/heads/develop
landsat/utils.py
5
# Landsat Util # License: CC0 1.0 Universal import os import sys import time import re from cStringIO import StringIO from datetime import datetime from mixins import VerbosityMixin class Capturing(list): """ Captures a subprocess stdout. :Usage: >>> with Capturing(): ... subprocess...
prisis/sublime-text-packages
refs/heads/master
Packages/SublimeCodeIntel/libs/codeintel2/phpdoc.py
10
#!/usr/bin/env python """ Utility class used for the parsing of PHPDocumenter comments, aka PHPDoc. PHPDocumenter is documented online here: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/li_phpDocumentor.html /** * Method for creating a slider. * * @static * @param string $arg1 The first argument descripti...
eduNEXT/edx-platform
refs/heads/master
openedx/core/djangoapps/user_authn/urls_common.py
3
""" Common URLs for User Authentication Note: The split between urls.py and urls_common.py is hopefully temporary. For now, this is needed because of difference in CMS and LMS that have not yet been cleaned up. This is also home to urls for endpoints that have been consolidated from other djangoapps, which leads to i...
arne-cl/pattern
refs/heads/master
pattern/web/pdf/pdfdevice.py
56
#!/usr/bin/env python2 import sys from utils import mult_matrix, translate_matrix from utils import enc, bbox2str from pdffont import PDFUnicodeNotDefined ## PDFDevice ## class PDFDevice(object): debug = 0 def __init__(self, rsrcmgr): self.rsrcmgr = rsrcmgr self.ctm = None return ...
lucafavatella/intellij-community
refs/heads/cli-wip
python/testData/inspections/PyPackageRequirementsInspection/TypingNotInRequirements/test1.py
40
import typing print(typing)
ismailsunni/inasafe
refs/heads/develop
safe/gui/tools/help/extent_selector_help.py
8
# coding=utf-8 """Help text for the extent selector dialog.""" from safe import messaging as m from safe.messaging import styles from safe.utilities.i18n import tr from safe.utilities.resources import resources_path SUBSECTION_STYLE = styles.SUBSECTION_LEVEL_3_STYLE INFO_STYLE = styles.BLUE_LEVEL_4_STYLE SMALL_ICON_S...
greghogan/flink
refs/heads/master
flink-python/pyflink/table/tests/test_environment_completeness.py
6
################################################################################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
bartvm/pylearn2
refs/heads/master
pylearn2/datasets/debug.py
45
""" .. todo:: WRITEME """ import numpy as N from pylearn2.datasets import dense_design_matrix class DebugDataset(dense_design_matrix.DenseDesignMatrix): """ .. todo:: WRITEME """ def __init__(self): """ .. todo:: WRITEME """ view_converter ...
wtanaka/beam
refs/heads/master
sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_client.py
25
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
isislovecruft/torflow
refs/heads/master
CircuitAnalysis/BuildTimes/binomial-10.py
2
#!/usr/bin/python # # Uses the binomial distribution to estimate the expected number of # circuit 10-circ groups before a false positive that discards all of our # 10-circ groups for a few different parameters. import math def fact(n): if n==1: return 1 return n*fact(n-1) def choose(n, k): return fact(n)/(fact(...
huynhlc100/mean-on-openshift
refs/heads/master
node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
379
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys im...
Gumtree/Kookaburra_scripts
refs/heads/master
Internal/KKB_Scan_KEEPSAFE_lastversionbeforeKKB_Scan2.py
1
__script__.title = 'KKB Measurement Script' __script__.version = '2.1' from gumpy.commons import sics from org.gumtree.gumnix.sics.control import ServerStatus from pickle import Pickler, Unpickler import time from math import log as ln from math import exp, isnan, isinf, sin from __builtin__ import max ...
CitrineInformatics/python-citrination-client
refs/heads/develop
citrination_client/util/tests/test_credentials.py
1
from citrination_client.util.credentials import * from citrination_client.util import env as citr_env_vars from citrination_client.base.errors import CitrinationClientError import os mock_credentials_path = './citrination_client/util/tests/mock_credentials' # Save these, to be restored later original_env_api_key = Non...
nguyenhongson03/scrapy
refs/heads/master
tests/test_urlparse_monkeypatches.py
155
from six.moves.urllib.parse import urlparse import unittest class UrlparseTestCase(unittest.TestCase): def test_s3_url(self): p = urlparse('s3://bucket/key/name?param=value') self.assertEquals(p.scheme, 's3') self.assertEquals(p.hostname, 'bucket') self.assertEquals(p.path, '/key/...
fhaoquan/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/msilib/__init__.py
86
# Copyright (C) 2005 Martin v. Löwis # Licensed to PSF under a Contributor Agreement. from _msi import * import os, string, re, sys AMD64 = "AMD64" in sys.version Itanium = "Itanium" in sys.version Win64 = AMD64 or Itanium # Partially taken from Wine datasizemask= 0x00ff type_valid= 0x0100 type_localizabl...
GitHublong/hue
refs/heads/master
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/draw.py
56
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 you...
vishnu-kumar/ec2-api
refs/heads/master
ec2api/tests/functional/api/test_network_interfaces.py
2
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
TimBuckley/effective_django
refs/heads/master
tests/save_delete_hooks/tests.py
453
from __future__ import unicode_literals from django.test import TestCase from django.utils import six from .models import Person class SaveDeleteHookTests(TestCase): def test_basic(self): p = Person(first_name="John", last_name="Smith") self.assertEqual(p.data, []) p.save() self....
dstufft/sqlalchemy
refs/heads/master
lib/sqlalchemy/testing/suite/test_sequence.py
114
from .. import fixtures, config from ..config import requirements from ..assertions import eq_ from ... import testing from ... import Integer, String, Sequence, schema from ..schema import Table, Column class SequenceTest(fixtures.TablesTest): __requires__ = ('sequences',) __backend__ = True run_creat...
cliftonmcintosh/openstates
refs/heads/master
openstates/il/tests/test_vote_parsing.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import * import unittest from openstates.il import metadata from openstates.il.bills import find_columns, find_columns_and_parse import logging log = logging.getLogger('openstates.il.tests.test_bill_metadata') TEST_LINES1 = [ 'E Acevedo Y Da...
andreyvit/pyjamas
refs/heads/master
library/pyjamas/ui/Label.py
1
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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/...
FrancescoCeruti/linux-show-player
refs/heads/master
lisp/layouts/list_layout/cue_list_view.py
3
# -*- coding: utf-8 -*- # # This file is part of Linux Show Player # # Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com> # # Linux Show Player 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 ...
huangsam/ciscochef
refs/heads/master
places/views.py
1
from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic import TemplateView from django.views.generic.detail import DetailView from django.views.generic.edit import UpdateView from django.views.generic.list import ListView from places.models import Restaurant class HomeView(TemplateView):...
django-wiki/django-wiki
refs/heads/main
src/wiki/plugins/editsection/wiki_plugin.py
2
from django.conf.urls import url from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin from wiki.plugins.editsection.markdown_extensions import EditSectionExtension from . import settings from . import views class EditSectionPlugin(BasePlugin): slug = settings.SLUG urlpatterns...
vikatory/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_importlib/frozen/test_finder.py
81
from .. import abc from .. import util machinery = util.import_importlib('importlib.machinery') import unittest class FindSpecTests(abc.FinderTests): """Test finding frozen modules.""" def find(self, name, path=None): finder = self.machinery.FrozenImporter return finder.find_spec(name, pat...
craigschmidt/rpy2-2.3.9
refs/heads/master
rpy/robjects/__init__.py
2
""" R objects as Python objects. The module is structured around the singleton r of class R, that represents an embedded R. License: GPLv3.0 (although a dual license can be worked out) """ import os, sys import array import itertools from datetime import datetime import rpy2.rinterface as rinterface import rpy2.rli...
fengzhe29888/gnuradio-old
refs/heads/master
gr-digital/python/digital/qa_cpm.py
57
#!/usr/bin/env python # # Copyright 2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your opt...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/furniture/decorative/wod_pro_ns_tree_04.py
85615
import sys def setup(core, object): return
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/mobile/bordok.py
85615
import sys def setup(core, object): return
mewtaylor/django
refs/heads/master
tests/migrations/test_migrations_squashed_complex_multi_apps/app2/1_auto.py
770
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("app1", "1_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
mrquim/mrquimrepo
refs/heads/master
script.module.youtube.dl/lib/youtube_dl/extractor/anysex.py
224
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, int_or_none, ) class AnySexIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?anysex\.com/(?P<id>\d+)' _TEST = { 'url': 'http://anysex.com/156592/', 'md5': '023...
tfmorris/freebase-python-samples
refs/heads/master
json-rpc/text.py
1
import urllib import urllib2 import json import os api_key = open(os.environ['HOME'] + "/.freebase_api_key").read() url = 'https://www.googleapis.com/rpc' request = { 'method': 'freebase.text.get', 'apiVersion': 'v1', 'params': { 'id': ['en','bob_dylan'], ...
nekulin/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/framework/help.py
17
# help.py - help utilities for PythonWin. import win32api import win32con import win32ui import string import sys import regutil import string, os htmlhelp_handle = None html_help_command_translators = { win32con.HELP_CONTENTS : 1, # HH_DISPLAY_TOC win32con.HELP_CONTEXT : 15, # HH_HELP_CONTEXT win32con.HELP_FINDE...
Gargamel1989/Seasoning-old
refs/heads/master
Seasoning/recipes/sitemaps.py
1
from django.contrib import sitemaps from django.core.urlresolvers import reverse from recipes.models import Recipe class RecipeViewsSitemap(sitemaps.Sitemap): priority = 0.5 changefreq = 'weekly' def items(self): return Recipe.objects.filter(accepted=True).values('id') def ...
t9nf/google-cloud-datastore
refs/heads/master
python/googledatastore/__init__.py
3
# # 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...
SUSE/teuthology
refs/heads/master
teuthology/orchestra/test/test_opsys.py
3
from textwrap import dedent from teuthology.orchestra.opsys import OS import pytest class TestOS(object): str_centos_7_os_release = dedent(""" NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)"...
olavurmortensen/gensim
refs/heads/develop
gensim/examples/dmlcz/gensim_xml.py
82
#!/usr/bin/env python # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s LANGUAGE METHOD Generate similar.xml files, using a previously built model for METHOD. Example: ./gensim_xml.py eng lsi """ import...
gencer/sentry
refs/heads/master
src/sentry/metrics/dummy.py
22
from __future__ import absolute_import __all__ = ['DummyMetricsBackend'] from .base import MetricsBackend class DummyMetricsBackend(MetricsBackend): def incr(self, key, instance=None, tags=None, amount=1, rate=1): pass def timing(self, key, value, instance=None, tags=None, rate=1): pass
qiulimao/weblocust
refs/heads/master
pyspider/libs/log.py
82
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2012-10-24 16:08:17 import logging try: import curses except ImportError: curses = None from tornado.log import LogFormatter as _LogFormatter c...
awensaunders/BuSHAX0rZ
refs/heads/master
parseBigCSV.py
1
import csv import json with open("evidata.csv", "r") as bigCSV: with open("file.json", "w") as outFile: reader = csv.DictReader(bigCSV) output = json.dumps(list(reader)) outFile.write(output)
seem-sky/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/compat.py
357
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source - Copy/Lib/colorsys.py
144
"""Conversion functions between RGB and other color systems. This modules provides two functions for each color system ABC: rgb_to_abc(r, g, b) --> a, b, c abc_to_rgb(a, b, c) --> r, g, b All inputs and outputs are triples of floats in the range [0.0...1.0] (with the exception of I and Q, which covers a slightly...
ahartz1/python_koans
refs/heads/master
python2/_runner_tests.py
211
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import unittest from runner.runner_tests.test_mountain import TestMountain from runner.runner_tests.test_sensei import TestSensei from runner.runner_tests.test_helper import TestHelper def suite(): suite = unittest.TestSuite() suite.addTests(unittest.T...
synbiomine/synbiomine-tools
refs/heads/master
tools/extractModel.py
1
#!/usr/bin/env python3 import argparse import psycopg2 ############ ### MAIN ### ############ parser = argparse.ArgumentParser('Extract an InterMine model from an existing database.') parser.add_argument('dbName', help='name of the database.') parser.add_argument('modelPath', help='path to save the InterMine model xm...
ukanga/SickRage
refs/heads/master
lib/decorator.py
18
# ######################### LICENSE ############################ # # Copyright (c) 2005-2016, Michele Simionato # 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 so...
rosarior/mayan
refs/heads/master
apps/project_setup/api.py
2
from __future__ import absolute_import from . import setup_link setup_items = [] def register_setup(link): setup_items.append(link) # Append the link's children_view_regex to the setup main menu children view regex setup_link.setdefault('children_view_regex', []) setup_link['children_view_regex'].e...
yosukesuzuki/calendar-app
refs/heads/master
project/kay/utils/test.py
8
import os import sys from werkzeug import Client as WerkZeugClient from werkzeug import EnvironBuilder from kay.utils import local from jinja2 import Template wrapped = False render_orig = Template.render class Client(WerkZeugClient): def __init__(self, application, response_wrapper=None, use_cookies=True): ...
programadorjc/django
refs/heads/master
tests/urlpatterns_reverse/included_app_urls.py
405
from django.conf.urls import url from . import views app_name = 'inc-app' urlpatterns = [ url(r'^normal/$', views.empty_view, name='inc-normal-view'), url(r'^normal/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$', views.empty_view, name='inc-normal-view'), url(r'^\+\\\$\*/$', views.empty_view, name='inc-special-vie...
bingosummer/azure-linux-extensions
refs/heads/master
OSPatching/patch/OraclePatching.py
8
#!/usr/bin/python # # Copyright 2014 Microsoft Corporation # # 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...
mccdaq/mcculw
refs/heads/master
mcculw/device_info/daq_device_info.py
1
from __future__ import absolute_import, division, print_function from builtins import * # @UnusedWildImport from mcculw import ul from mcculw.ul import ULError from mcculw.enums import (BoardInfo, InfoType, ErrorCode, EventType, ExpansionInfo) from .ai_info import AiInfo from .ao_info import...
emesene/emesene
refs/heads/master
emesene/e3/xmpp/SleekXMPP/sleekxmpp/plugins/xep_0033.py
2
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp import Message from sleekxmpp.xmlstream.handler.callback import Callback from sleekxmpp.xmlstream...
davidfraser/sqlalchemy
refs/heads/master
test/sql/test_operators.py
10
from sqlalchemy.testing import fixtures, eq_, is_, is_not_ from sqlalchemy import testing from sqlalchemy.testing import assert_raises_message from sqlalchemy.sql import column, desc, asc, literal, collate, null, \ true, false, any_, all_ from sqlalchemy.sql.expression import BinaryExpression, \ ClauseList, Gro...
SomethingExplosive/android_kernel_asus_flo
refs/heads/somex-4.4
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
BinPy/BinPy
refs/heads/develop
BinPy/tools/oscilloscope.py
4
from __future__ import print_function import time from itertools import chain from BinPy.connectors import * from BinPy.draw import symbols import threading import sys try: range = xrange # This is to make the sampler more efficient in python2 except: pass class Oscilloscope(threading.Thread): """ ...
pfnet/chainercv
refs/heads/master
chainercv/links/connection/separable_conv_2d_bn_activ.py
3
import chainer from chainer.functions import identity from chainer.functions import relu from chainer.links import BatchNormalization from chainer.links import Convolution2D try: from chainermn.links import MultiNodeBatchNormalization except ImportError: pass class SeparableConv2DBNActiv(chainer.Chain): ...
KyleJamesWalker/ansible
refs/heads/devel
lib/ansible/modules/network/ldap_entry.py
28
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Peter Sagerson <psagers@ignorare.net> # (c) 2016, Jiri Tyr <jiri.tyr@gmail.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 So...
fxia22/ASM_xf
refs/heads/master
PythonD/lib/python2.4/formatter.py
13
"""Generic output formatting. Formatter objects transform an abstract flow of formatting events into specific output events on writer objects. Formatters manage several stack structures to allow various properties of a writer object to be changed and restored; writers need not be able to handle relative changes nor an...
photoninger/ansible
refs/heads/devel
test/integration/targets/module_utils/module_utils/spam8/ham/bacon.py
298
data = 'spam8:bacon'
bplancher/odoo
refs/heads/9.0
addons/account/report/account_general_ledger.py
21
# -*- coding: utf-8 -*- import time from openerp import api, models class ReportGeneralLedger(models.AbstractModel): _name = 'report.account.report_generalledger' def _get_account_move_entry(self, accounts, init_balance, sortby, display_account): """ :param: accounts: the rec...
mozilla/marketpulse
refs/heads/master
marketpulse/main/__init__.py
2
import moneyed FFXOS_ACTIVITY_NAME = 'Submit FirefoxOS device price' FFXOS_MEDIA_ACTIVITY_NAME = 'Upload FirefoxOS media' def get_currency_choices(): return sorted(((currency, data.code) for currency, data in moneyed.CURRENCIES.items()))
CompMusic/essentia
refs/heads/master
test/src/unittest/standard/test_startstopsilence_streaming.py
10
#!/usr/bin/env python # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
paulnovo/yaml-cpp-debian
refs/heads/master
test/gmock-1.7.0/gtest/scripts/fuse_gtest_files.py
2577
#!/usr/bin/env python # # Copyright 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...
RafaelRMachado/qtwebkit
refs/heads/dev
Tools/QueueStatusServer/handlers/recentstatus.py
143
# 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...
pixelgremlins/ztruck
refs/heads/master
dj/lib/python2.7/site-packages/pip/_vendor/packaging/_compat.py
901
# Copyright 2014 Donald Stufft # # 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, so...
walmis/APMLib
refs/heads/master
Tools/LogAnalyzer/tests/TestDualGyroDrift.py
273
from LogAnalyzer import Test,TestResult import DataflashLog # import scipy # import pylab #### TEMP!!! only for dev # from scipy import signal class TestDualGyroDrift(Test): '''test for gyro drift between dual IMU data''' def __init__(self): Test.__init__(self) self.name = "Gyro Drift" self.enable = Fals...
lqdc/pyew
refs/heads/master
plugins/url.py
2
#!/usr/bin/env python """ This file is part of Pyew Copyright (C) 2009, 2010 Joxean Koret 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 la...
ioam/svn-history
refs/heads/master
dispatch/examples/topographica/3-advanced.py
1
""" ../../topographica topo_analysis.py """ import os, random import numpy as np import topo from dispatch import QLauncher, Launcher, Spec, LinearSpecs, ListSpecs from dispatch.topographica import RunBatchAnalysis, RunBatchCommand, launch_batch_analysis CLUSTER = True#False if CLUSTER: Launcher = QLauncher ...
jdar/phantomjs-modified
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/reftests/__init__.py
6014
# Required for Python to search this directory for module files
337529542/dsf-utils
refs/heads/master
dsf_skey_fetch.py
2
# get a shapekey class dsf_skey_fetch (object): """utility class to get morph data from an object. """ def __init__ (self): pass @classmethod def convert (self, obj): """collect the required data from the shape-key. """ skey = obj.active_shape_key if skey is None: raise Exception ("...
goliate/sarakha63-persomov
refs/heads/master
couchpotato/core/media/movie/charts/main.py
37
from CodernityDB.database import RecordNotFound from couchpotato import Env, get_db from couchpotato.core.helpers.variable import getTitle, splitString from couchpotato.core.logger import CPLog from couchpotato.api import addApiView from couchpotato.core.event import fireEvent from couchpotato.core.plugins.base import...
hectord/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/modeltests/m2m_recursive/tests.py
92
from operator import attrgetter from django.test import TestCase from models import Person class RecursiveM2MTests(TestCase): def test_recursive_m2m(self): a, b, c, d = [ Person.objects.create(name=name) for name in ["Anne", "Bill", "Chuck", "David"] ] # ...
suda/micropython
refs/heads/master
tests/basics/builtin_override.py
70
# test overriding builtins import builtins # override generic builtin builtins.abs = lambda x: x + 1 print(abs(1)) # __build_class__ is handled in a special way builtins.__build_class__ = lambda x, y: ('class', y) class A: pass print(A)
bjlittle/iris
refs/heads/pre-commit-ci-update-config
lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_cf_bounds_var.py
5
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Test function :func:`iris.fileformats._pyke_rules.compiled_krb.\ fc_rules_cf_fc.get_cf_bounds_var`. """ # import iris tes...
Ehtaga/partner-contact
refs/heads/8.0
base_location/models/better_zip.py
26
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi. Copyright Camptocamp SA # Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com> # Ignacio Ibeas <ignacio@acysos.com> # Alejandro Santana <alejandrosantana@anubia.es> # # This program is free software: you can redist...
Team-IronFist/TeamWork-JavaScript-Applications
refs/heads/master
IronFist Dealership/public/bower_components/systemjs/utils/builder.py
5
import os source = '../src/System.js' output = '../build/system.min.js' os.system('java -jar compiler/compiler.jar --language_in=ECMASCRIPT5_STRICT --js ' + source + ' --js_output_file ' + output) with open(output,'r') as f: text = f.read() with open(output,'w') as f: f.write("// system.js - http://github.com/mrdoob...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.4.3/Lib/plat-mac/PixMapWrapper.py
8
"""PixMapWrapper - defines the PixMapWrapper class, which wraps an opaque QuickDraw PixMap data structure in a handy Python class. Also provides methods to convert to/from pixel data (from, e.g., the img module) or a Python Imaging Library Image object. J. Strout <joe@strout.net> February 1999""" from Carbon import...
goal/uwsgi
refs/heads/master
plugins/msgpack/uwsgiplugin.py
21
NAME = 'msgpack' CFLAGS = [] LDFLAGS = [] LIBS = [] GCC_LIST = ['msgpack']
saisai/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/crashlogs.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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
bbuckingham/katello
refs/heads/master
cli/src/katello/client/main.py
2
#!/usr/bin/python # # Katello Shell # Copyright (c) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. ...
lukeiwanski/tensorflow
refs/heads/master
tensorflow/contrib/specs/python/specs_lib.py
166
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
yencarnacion/ansible-role-scipy
refs/heads/master
print_version.py
1
import numpy import scipy import matplotlib import IPython import pandas print 'NumPy version %s' % numpy.version.version print 'SciPy version %s' % scipy.version.version print 'Matplotlib version %s' % matplotlib.__version__ print 'IPython version %s' % IPython.__version__ print 'Pandas version %s' % pandas.version.v...
mlufei/depot_tools
refs/heads/master
recipes/infra_internal.py
22
# 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 sys import recipe_util # pylint: disable=F0401 # This class doesn't need an __init__ method, so we disable the warning # pylint: disable=W0232 cla...
pekeler/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/taskscheduler/test/test_addtask_1.py
35
import pythoncom, time, win32api from win32com.taskscheduler import taskscheduler test_task_name='test_addtask_1.job' ts=pythoncom.CoCreateInstance(taskscheduler.CLSID_CTaskScheduler,None, pythoncom.CLSCTX_INPROC_SERVER,taskscheduler.IID_ITaskScheduler) tasks=ts.Enum() for task in tasks:...