repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
d5nguyenvan/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/__init__.py
61
1623
"""SCons The main package for the SCons software construction utility. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "S...
apache-2.0
jkokorian/ODMAnalysis
odmanalysis/scripts/ViewIntensityProfilesInteractive.py
1
3189
""" Copyright (C) 2014 Delft University of Technology, The Netherlands 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 lat...
gpl-3.0
tensorflow/probability
tensorflow_probability/python/distributions/chi2.py
1
9670
# Copyright 2018 The TensorFlow Probability Authors. # # 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...
apache-2.0
40223123/raven
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_case.py
738
51689
import difflib import pprint import pickle import re import sys import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from .support import ( TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun ) class Test(object): "Ke...
gpl-3.0
matthiasdiener/spack
var/spack/repos/builtin/packages/xdriinfo/package.py
5
1880
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
FusionWorks/adam
scripts/make-flag-values-sam.py
17
2426
#!/usr/bin/python """ Script for generating the 'flag-values.sam' file used by ViewSuite. Generates a SAM file with one contig and one read for every possible flag-field value that HTSJDK's SAM-parsing logic accepts (i.e. it rejects reads that are listed as "unpaired" (0x1) but have bits set that are only relevant to...
apache-2.0
Instagram/django
tests/regressiontests/humanize/tests.py
50
3315
from datetime import timedelta, date from django.template import Template, Context, add_to_builtins from django.utils import unittest from django.utils.dateformat import DateFormat from django.utils.translation import ugettext as _ from django.utils.html import escape add_to_builtins('django.contrib.humanize.template...
bsd-3-clause
fishstamp82/loprop-1
setup.py
1
1504
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup import os #if submodules have not been initiated, just update them os.system( 'git submodule update --init --recursive' ) reqs = ['argparse>=1.2.1', 'numpy>=1.9.2', 'sci...
gpl-3.0
joshainglis/sa-tools
bp_includes/external/wtforms/widgets/core.py
67
8340
from __future__ import unicode_literals from cgi import escape from wtforms.compat import text_type, string_types, iteritems __all__ = ( 'CheckboxInput', 'FileInput', 'HiddenInput', 'ListWidget', 'PasswordInput', 'RadioInput', 'Select', 'SubmitInput', 'TableWidget', 'TextArea', 'TextInput', 'Option' ) ...
lgpl-3.0
cuongkta/login_logout_elixir
node_modules/sass-brunch/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
apache-2.0
ewindisch/nova
nova/tests/api/openstack/compute/contrib/test_config_drive.py
20
2442
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
DONIKAN/django
django/contrib/gis/gdal/srs.py
366
12043
""" The Spatial Reference class, represents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print(srs) GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY...
bsd-3-clause
walterbender/portfolio
odf/meta.py
3
2138
# -*- 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...
gpl-3.0
wwitzel3/awx
awx/main/migrations/0002_squashed_v300_release.py
1
37085
# -*- coding: utf-8 -*- # Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. from __future__ import unicode_literals import awx.main.fields from django.db import migrations, models import django.db.models.deletion from django.conf import settings from django.utils.timezone import now import jsonfield.fields i...
apache-2.0
erh3cq/hyperspy
hyperspy/tests/learn/test_export.py
4
1961
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
MackZxh/OCA-Choice
management-system/mgmtsystem_hazard/models/mgmtsystem_hazard_type.py
3
1272
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it und...
lgpl-3.0
draperjames/bokeh
bokeh/sphinxext/bokeh_prop.py
13
2429
""" Thoroughly document Bokeh property attributes. The ``bokeh-prop`` directive generates useful type information for the property attribute, including cross links to the relevant property types. Additionally, any per-attribute docstrings are also displayed. This directive takes the path to an attribute on a Bokeh mo...
bsd-3-clause
wikimedia/pywikibot-core
pywikibot/interwiki_graph.py
2
8824
# -*- coding: utf-8 -*- """Module with the Graphviz drawing calls.""" # # (C) Pywikibot team, 2006-2018 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, division, unicode_literals from collections import Counter import itertools import threading try: import pydot excep...
mit
dxwu/BinderFilter
resources/android-toolchain-16/lib/python2.7/tokenize.py
76
16542
"""Tokenization help for Python programs. generate_tokens(readline) is a generator that breaks a stream of text into Python tokens. It accepts a readline-like method which is called repeatedly to get the next line of input (or "" for EOF). It generates 5-tuples with these members: the token type (see token.py) ...
mit
ecederstrand/django
tests/template_tests/syntax_tests/test_basic.py
252
12482
from django.template.base import Context, TemplateSyntaxError from django.test import SimpleTestCase from ..utils import SilentAttrClass, SilentGetItemClass, SomeClass, setup basic_templates = { 'basic-syntax01': 'something cool', 'basic-syntax02': '{{ headline }}', 'basic-syntax03': '{{ first }} --- {{ s...
bsd-3-clause
Stranger6667/postmarker
src/postmarker/models/triggers.py
1
2150
# pylint: disable=redefined-builtin from .base import Model, ModelManager, SubModelManager class InboundRule(Model): def delete(self): return self._manager.delete(self.ID) class InboundRulesManager(ModelManager): name = "inboundrules" model = InboundRule def all(self, count=500, offset=0): ...
mit
dsajkl/123
common/djangoapps/embargo/tests/test_forms.py
36
9268
# -*- coding: utf-8 -*- """ Unit tests for embargo app admin forms. """ from django.test import TestCase from django.test.utils import override_settings # Explicitly import the cache from ConfigurationModel so we can reset it after each test from config_models.models import cache from embargo.forms import EmbargoedCo...
agpl-3.0
andim27/magiccamp
build/lib/django/contrib/markup/templatetags/markup.py
20
3522
""" Set of "markup" template filters for Django. These filters transform plain text markup syntaxes to HTML; currently there is support for: * Textile, which requires the PyTextile library available at http://loopcore.com/python-textile/ * Markdown, which requires the Python-markdown library from ...
bsd-3-clause
prune998/ansible
lib/ansible/modules/cloud/openstack/os_ironic_node.py
49
13750
#!/usr/bin/python # coding: utf-8 -*- # (c) 2015, Hewlett-Packard Development Company, L.P. # # 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 optio...
gpl-3.0
DualSpark/ansible
lib/ansible/plugins/lookup/file.py
28
2570
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 lat...
gpl-3.0
geoscixyz/em_examples
em_examples/LinearInversion.py
1
17361
import numpy as np from SimPEG import Mesh from SimPEG import Problem from SimPEG import Survey from SimPEG import DataMisfit from SimPEG import Directives from SimPEG import Optimization from SimPEG import Regularization from SimPEG import InvProblem from SimPEG import Inversion import matplotlib.pyplot as plt import ...
mit
zjutjsj1004/third
boost/libs/geometry/doc/doxy/doxygen_enhance.py
8
1607
#! /usr/bin/env python # -*- coding: utf-8 -*- # =========================================================================== # Copyright (c) 2010 Barend Gehrels, Amsterdam, the Netherlands. # # Use, modification and distribution is subject to the Boost Software License, # Version 1.0. (See accompanying file L...
mit
erolanda/muCI-Arduino
simulationCar/Python/sEMGCar.py
1
3087
# -*- coding: utf-8 -*- """ Created on Mon Jul 20 11:53:39 2015 @author: eroland """ # INTIALISATION import pygame import math import serial import serial.tools.list_ports from pygame.locals import * # This method try to auto detect the Arduino´s serial port def serial_ports(): ports = list(serial.tools.list_por...
gpl-2.0
hubsaysnuaa/odoo
addons/base_action_rule/tests/base_action_rule_test.py
395
7455
from openerp import SUPERUSER_ID from openerp.tests import common from .. import test_models class base_action_rule_test(common.TransactionCase): def setUp(self): """*****setUp*****""" super(base_action_rule_test, self).setUp() cr, uid = self.cr, self.uid self.demo = self.registry(...
agpl-3.0
huahang/typhoon-blade
src/blade/fbthrift_helper.py
5
3782
# Copyright (c) 2012 iQIYI Inc. # Copyright (c) 2013 Tencent Inc. # Copyright (c) 2014 Huahang Liu # # All rights reserved. # # Author: Jingxu Chen <chenjingxu@qiyi.com> # Feng Chen <chen3feng@gmail.com> # Huahang Liu <liuhuahang@zerus.co> # # Date: June 28, 2014 """ A helper class to get the files...
bsd-3-clause
deepsrijit1105/edx-platform
lms/djangoapps/email_marketing/models.py
13
3899
""" Email-marketing-related models. """ from django.db import models from django.utils.translation import ugettext_lazy as _ from config_models.models import ConfigurationModel class EmailMarketingConfiguration(ConfigurationModel): """ Email marketing configuration """ class Meta(object): app_label ...
agpl-3.0
jdhp-sap/data-pipeline-standalone-scripts
datapipe/image/signal_to_border_distance.py
2
2847
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org) # This script is provided under the terms and conditions of the MIT license: # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (th...
mit
CALlanoR/virtual_environments
scrapy/web_scraper/spiders/live_code_stream.py
1
1193
import scrapy class LiveCodeStreamSpider(scrapy.Spider): # to define a unique name for your spider using a variable called name # It must be unique throughout this project. name = "lcs" # we passed the website URL using the start_urls list start_urls = [ "https://livecodestream.dev/" ...
apache-2.0
opoplawski/ansible-modules-core
cloud/amazon/ec2_tag.py
28
5604
#!/usr/bin/python # 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. # # Ansible is distributed...
gpl-3.0
coderb0t/CouchPotatoServer
libs/subliminal/api.py
106
5646
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
gpl-3.0
Bryukh/ajenti
plugins/services/widget.py
17
1701
from ajenti.ui import * from ajenti.utils import * from ajenti import apis from ajenti.com import implements, Plugin from api import * class ServiceWidget(Plugin): implements(apis.dashboard.IWidget) icon = '/dl/services/icon.png' name = 'Service control' title = None style = 'linear' def __in...
lgpl-3.0
TheNathanBlack/moviepy
moviepy/tools.py
15
4833
""" Misc. useful functions that can be used at many places in the program. """ import subprocess as sp import sys import warnings import re import os try: from subprocess import DEVNULL # py3k except ImportError: DEVNULL = open(os.devnull, 'wb') def sys_write_flush(s): """ Writes and flushes without de...
mit
deanhiller/databus
webapp/play1.3.x/python/Lib/site-packages/pyreadline/lineeditor/lineobj.py
3
25140
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2006 Jorgen Stenarson. <jorgen.stenarson@bostream.nu> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software....
mpl-2.0
a170785/wpa_supplicant-0.7.3
wpa_supplicant/examples/wpas-test.py
189
2571
#!/usr/bin/python import dbus import sys, os import time WPAS_DBUS_SERVICE = "fi.epitest.hostap.WPASupplicant" WPAS_DBUS_INTERFACE = "fi.epitest.hostap.WPASupplicant" WPAS_DBUS_OPATH = "/fi/epitest/hostap/WPASupplicant" WPAS_DBUS_INTERFACES_INTERFACE = "fi.epitest.hostap.WPASupplicant.Interface" WPAS_DBUS_INTERFACES...
gpl-2.0
Nirvedh/CoarseCoherence
src/arch/x86/isa/insts/general_purpose/input_output/string_io.py
89
4418
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
rspavel/spack
var/spack/repos/builtin/packages/blaspp/package.py
1
3532
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Blaspp(CMakePackage, CudaPackage): """C++ API for the Basic Linear Algebra Subroutines. De...
lgpl-2.1
PeterWangIntel/blink-crosswalk
Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
680
3709
#!/usr/bin/env python # # Copyright 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...
bsd-3-clause
thoas/django-basic-apps
basic/blog/tests.py
12
1954
""" >>> from django.test import Client >>> from basic.blog.models import Post, Category >>> import datetime >>> from django.core.urlresolvers import reverse >>> client = Client() >>> category = Category(title='Django', slug='django') >>> category.save() >>> category2 = Category(title='Rails', slug='rails') >>> categor...
bsd-3-clause
joan2937/pigpio
pigpio.py
1
163423
""" pigpio is a Python module for the Raspberry which talks to the pigpio daemon to allow control of the general purpose input outputs (GPIO). [http://abyz.me.uk/rpi/pigpio/python.html] *Features* o the pigpio Python module can run on Windows, Macs, or Linux o controls one or more Pi's o hardware timed PWM on any ...
unlicense
kbc-developers/android_kernel_htc_m7wlj
scripts/gcc-wrapper.py
1
3956
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
morganism/ingress-total-conversion
buildsettings.py
1
1718
# settings file for builds. # if you want to have custom builds, copy this file to "localbuildsettings.py" and make changes there. buildSettings = { # local: use this build if you're not modifying external resources # no external resources allowed - they're not needed any more 'local': { 'resource...
isc
ddico/odoo
addons/delivery/tests/test_delivery_stock_move.py
1
4170
# -*- coding: utf-8 -*- from odoo.addons.account.tests.common import AccountTestCommon from odoo.tests import tagged, Form @tagged('post_install', '-at_install') class StockMoveInvoice(AccountTestCommon): def setUp(self): super(StockMoveInvoice, self).setUp() self.ProductProduct = self.env['prod...
agpl-3.0
daviswhitehead/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py
95
1161
import sys import numpy as np from IPython.core.display import Image import praw reddit = praw.Reddit("BayesianMethodsForHackers") subreddit = reddit.get_subreddit( "pics" ) top_submissions = subreddit.get_top() n_pic = int( sys.argv[1] ) if sys.argv[1] else 1 i = 0 while i < n_pic: top_submission = top_su...
mit
BuildingLink/sentry
src/sentry/api/endpoints/group_notes.py
6
2146
from __future__ import absolute_import from datetime import timedelta from django.utils import timezone from rest_framework import status from rest_framework.response import Response from sentry.api.base import DocSection from sentry.api.bases.group import GroupEndpoint from sentry.api.serializers import serialize fr...
bsd-3-clause
40223125/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/inspect.py
637
78935
"""Get useful information from live Python objects. This module encapsulates the interface provided by the internal special attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion. It also provides some help for examining source code and class layout. Here are some of the useful functions provided by this module:...
gpl-3.0
sdague/home-assistant
homeassistant/components/qvr_pro/camera.py
16
2675
"""Support for QVR Pro streams.""" import logging from pyqvrpro.client import QVRResponseError from homeassistant.components.camera import Camera from .const import DOMAIN, SHORT_NAME _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the QVR ...
apache-2.0
itomg/node-gyp
gyp/pylib/gyp/ninja_syntax.py
217
5286
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
mit
UniversalMasterEgg8679/ansible
test/units/modules/cloud/amazon/test_s3.py
49
1262
import pytest boto = pytest.importorskip("boto") import unittest import ansible.modules.cloud.amazon.s3 as s3 from ansible.module_utils.six.moves.urllib.parse import urlparse class TestUrlparse(unittest.TestCase): def test_urlparse(self): actual = urlparse("http://test.com/here") self.assertEqual...
gpl-3.0
cfei18/incubator-airflow
tests/contrib/executors/test_kubernetes_executor.py
4
5007
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
dazuma/google-cloud-ruby
google-cloud-dialogflow-v2/synth.py
2
1046
# Copyright 2020 Google LLC # # 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, s...
apache-2.0
Aralicia/Tybalt-DiscordBot
cogs/tybalt/gw2embed.py
1
6355
import discord from discord.utils import get from .database import database from .gw2api import gw2api import os class GW2Embed: async def invalid(self, client, message): dev = await client.get_user_info(client.settings.co_owners[0]) await client.send_message(dev, message) em = discord...
gpl-3.0
realms-team/solmanager
libs/smartmeshsdk-REL-1.3.0.1/libs/VManagerSDK/vmanager/models/user_channel_type.py
3
2489
# coding: utf-8 """ Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applica...
bsd-3-clause
zhuwenping/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_dep_util.py
147
2832
"""Tests for distutils.dep_util.""" import unittest import os import time from distutils.dep_util import newer, newer_pairwise, newer_group from distutils.errors import DistutilsFileError from distutils.tests import support from test.support import run_unittest class DepUtilTestCase(support.TempdirManager, unittest.T...
apache-2.0
sdague/home-assistant
homeassistant/components/alexa/state_report.py
7
7933
"""Alexa state report code.""" import asyncio import json import logging import aiohttp import async_timeout from homeassistant.const import HTTP_ACCEPTED, MATCH_ALL, STATE_ON import homeassistant.util.dt as dt_util from .const import API_CHANGE, Cause from .entities import ENTITY_ADAPTERS, generate_alexa_id from .m...
apache-2.0
BlueBrain/NeuroM
neurom/check/runner.py
1
5845
#!/usr/bin/env python # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
bsd-3-clause
kontrafiktion/ansible
lib/ansible/plugins/action/unarchive.py
6
4613
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2013, Dylan Martin <dmartin@seattlecentral.edu> # # 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 v...
gpl-3.0
clarete/python-taningia
src/scanner.py
1
22120
# -*- coding: utf-8; -*- # # Copyright (C) 2009, 2010 Lincoln de Sousa <lincoln@comum.org> # # 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 optio...
gpl-2.0
lokirius/python-for-android
python-modules/twisted/twisted/spread/jelly.py
56
36247
# -*- test-case-name: twisted.test.test_jelly -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ S-expression-based persistence of python objects. It does something very much like L{Pickle<pickle>}; however, pickle's main goal seems to be efficiency (both in space and time); jel...
apache-2.0
dimid/ansible-modules-extras
files/blockinfile.py
7
10060
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org> # # 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 ...
gpl-3.0
cgstudiomap/cgstudiomap
main/parts/odoo/addons/account_test/report/account_test_report.py
194
3819
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
MichaelNedzelsky/intellij-community
python/lib/Lib/mutex.py
99
1749
"""Mutual exclusion -- for use with module sched A mutex has two pieces of state -- a 'locked' bit and a queue. When the mutex is not locked, the queue is empty. Otherwise, the queue contains 0 or more (function, argument) pairs representing functions (or methods) waiting to acquire the lock. When the mutex is unlocke...
apache-2.0
gary-pickens/HouseMonitor
housemonitor/steps/maxvalue.py
1
1514
''' Created on Jan 17, 2013 @author: Gary ''' from housemonitor.lib.common import Common from housemonitor.lib.constants import Constants from abc_step import abcStep def instantuate_me( data ): ''' This function will be called to instantiate this class. ''' return MaxValue() class MaxValue( abcStep ): ...
mit
Endika/server-tools
users_ldap_groups/__openerp__.py
13
1473
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2012 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
defance/edx-platform
lms/djangoapps/lti_provider/outcomes.py
46
9158
""" Helper functions for managing interactions with the LTI outcomes service defined in LTI v1.1. """ from hashlib import sha1 from base64 import b64encode import logging import uuid from lxml import etree from lxml.builder import ElementMaker from oauthlib.oauth1 import Client from oauthlib.common import to_unicode ...
agpl-3.0
SeedScientific/polio
datapoints/migrations/0006_auto__add_field_historicaldatapoint_source_id__add_field_historicaldat.py
1
15582
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'HistoricalDataPoint.source_id' # Adding field 'Historical...
agpl-3.0
Belxjander/Kirito
Python-3.5.0-main/Lib/test/test_sundry.py
11
2128
"""Do a minimal test of all the modules that aren't otherwise tested.""" import importlib import sys from test import support import unittest class TestUntestedModules(unittest.TestCase): def test_untested_modules_can_be_imported(self): untested = ('bdb', 'encodings', 'formatter', 'ntur...
gpl-3.0
gavincabbage/mongoengine
tests/test_datastructures.py
23
3606
import unittest from mongoengine.base.datastructures import StrictDict, SemiStrictDict class TestStrictDict(unittest.TestCase): def strict_dict_class(self, *args, **kwargs): return StrictDict.create(*args, **kwargs) def setUp(self): self.dtype = self.strict_dict_class(("a", "b", "c")) d...
mit
Prashant-Surya/addons-server
src/olympia/addons/views.py
1
32173
import functools import hashlib import json import random import re import uuid from operator import attrgetter from django import http from django.conf import settings from django.db.transaction import non_atomic_requests from django.shortcuts import get_list_or_404, get_object_or_404, redirect from django.utils.tran...
bsd-3-clause
pkimber/crm
crm/admin.py
1
1069
# -*- encoding: utf-8 -*- from django.contrib import admin from .models import ( # Contact, Industry, Priority, # UserContact, ) # class ContactAdmin(admin.ModelAdmin): # pass # # admin.site.register(Contact, ContactAdmin) class IndustryAdmin(admin.ModelAdmin): pass admin.site.register(In...
apache-2.0
laurent-george/weboob
modules/lefigaro/pages/article.py
7
3464
"ArticlePage object for lefigaro" # -*- coding: utf-8 -*- # Copyright(C) 2011 Julien Hebert # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3...
agpl-3.0
deathping1994/sendmail-api
venv/lib/python2.7/site-packages/jinja2/nodes.py
342
28954
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
apache-2.0
gnuhub/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/backends.py
230
4582
from django.db import connection from django.contrib.auth.models import User, Permission class ModelBackend(object): """ Authenticates against django.contrib.auth.models.User. """ supports_object_permissions = False supports_anonymous_user = True supports_inactive_user = True # TODO: Mode...
apache-2.0
benvanwerkhoven/kernel_tuner
test/test_cuda_mocked.py
1
4939
import numpy as np try: from mock import patch, Mock except ImportError: from unittest.mock import patch, Mock from kernel_tuner import cuda from kernel_tuner.core import KernelSource, KernelInstance def setup_mock(drv): context = Mock() devprops = {'MAX_THREADS_PER_BLOCK': 1024, 'CO...
apache-2.0
aperigault/ansible
lib/ansible/modules/cloud/packet/packet_device.py
4
21541
#!/usr/bin/python # (c) 2016, Tomas Karasek <tom.to.the.k@gmail.com> # (c) 2016, Matt Baldwin <baldwin@stackpointcloud.com> # (c) 2016, Thibaud Morel l'Horset <teebes@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, divisi...
gpl-3.0
pansapiens/mytardis
tardis/tardis_portal/south_migrations/0005_auto__add_field_schema_immutable.py
3
16153
# 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 'Schema.immutable' db.add_column('tardis_portal_schema', 'immutable', self.gf('django.db.models.fie...
bsd-3-clause
diazjf/reddit-sentiment-analyzer
setup.py
1
1269
#!/usr/bin/env python from setuptools import setup, find_packages PROJECT = 'reddit-analyze' VERSION = '2.0' setup( name=PROJECT, version=VERSION, description='Reddit Sentiment Analyzer', long_description='Obtains Sentiment Score of various reddit objects.', author='Fernando Diaz', author_...
mit
longman88/kernel-qspinlock
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
SuicSoft/stk-code
tools/remove-whitespaces.py
16
4502
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # 2014, By konstin (http://github/konstin) # 2015, Modified by leyyin # # Removes all trailing whitespaces and replaces all tabs with four spaces, the # files with a given extension in a recursively searched directory. # It can also count the number of code lines ex...
gpl-3.0
Kromey/fbxnano
prosodyauth/views.py
2
5819
import binascii from django.shortcuts import render, redirect, get_object_or_404 from django.contrib import messages from django.db import IntegrityError, transaction from django.db.models import Q from django.conf import settings from django.template.loader import render_to_string from django.core.mail import send_m...
mit
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/pip/_vendor/requests/models.py
410
29176
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
bsd-3-clause
mmccoo/kicad_mmccoo
menus_and_buttons/menus_and_buttons.py
1
2271
import pcbnew import wx import wx.aui # get the path of this script. Will need it to load the png later. import inspect import os filename = inspect.getframeinfo(inspect.currentframe()).filename path = os.path.dirname(os.path.abspath(filename)) print("running {} from {}".format(filename, path)) def findPcbnewWind...
apache-2.0
dwdm/splash
splash/kernel/kernelbase.py
3
5114
# -*- coding: utf-8 -*- """ Refactored from IPython.kernel.zmq.kernelbase.Kernel with async execution support. See https://github.com/ipython/ipython/pull/7713. """ from __future__ import absolute_import import functools import time import sys from ipython_genutils import py3compat from ipykernel.jsonutil import json_...
bsd-3-clause
cms-externals/openloops
scons-local/scons-local-2.3.0/SCons/Executor.py
11
21452
"""SCons.Executor A module for executing actions with specific lists of target and source Nodes. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software ...
gpl-3.0
vinchoi/fishplay
flask/lib/python2.7/site-packages/wheel/test/test_wheelfile.py
327
4585
import os import wheel.install import wheel.archive import hashlib try: from StringIO import StringIO except ImportError: from io import BytesIO as StringIO import codecs import zipfile import pytest import shutil import tempfile from contextlib import contextmanager @contextmanager def environ(key, value): ...
gpl-3.0
ChristosChristofidis/bokeh
bokeh/cli/help_messages.py
42
2008
from __future__ import absolute_import from ..palettes import brewer ERR_MSG_TEMPL = "##### ERRORS OCCURRED! #####\n" \ "An error occurred while building the Chart. No series filtering" \ " specified (using all series found: %s. " \ "If you have series with non numeric ...
bsd-3-clause
alexm92/sentry
src/sentry/south_migrations/0021_auto__del_message__del_groupedmessage__del_unique_groupedmessage_proje.py
36
10712
# 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): pass def backwards(self, orm): pass models = { 'sentry.user': { 'Meta': {'object_nam...
bsd-3-clause
brchiu/tensorflow
tensorflow/contrib/stat_summarizer/python/stat_summarizer_test.py
22
2886
# 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 ...
apache-2.0
AustinRoy7/Pomodoro-timer
venv/Lib/importlib/abc.py
45
10782
"""Abstract base classes related to import.""" from . import _bootstrap from . import _bootstrap_external from . import machinery try: import _frozen_importlib except ImportError as exc: if exc.name != '_frozen_importlib': raise _frozen_importlib = None try: import _frozen_importlib_external exc...
mit
ErinCall/sync-engine
inbox/crispin.py
2
34220
""" IMAPClient wrapper for the Nilas Sync Engine. """ import contextlib import re import time import imaplib import imapclient # Even though RFC 2060 says that the date component must have two characters # (either two digits or space+digit), it seems that some IMAP servers only # return one digit. Fun times. imaplib.I...
agpl-3.0
fairbird/OpenPLI-BlackHole
lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py
13
16407
from enigma import eTimer, eEnv from Screens.Screen import Screen from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap, MultiPixmap from Components.Label import Label from Components.Sources.StaticText import StaticText from Components.Sources.List import List from Components...
gpl-2.0
KMK-ONLINE/ansible-modules-core
cloud/azure/azure_rm_subnet.py
46
11544
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
fernandog/Medusa
medusa/clients/torrent/mlnet_client.py
1
1426
# coding=utf-8 """MLDonkey Client.""" from __future__ import unicode_literals from medusa.clients.torrent.generic import GenericClient class MLNetAPI(GenericClient): """MLDonkey API class.""" def __init__(self, host=None, username=None, password=None): """Constructor. :param host: ...
gpl-3.0
Mushirahmed/gnuradio
gnuradio-core/src/examples/network/dial_tone_sink.py
18
2640
#!/usr/bin/env python # # Copyright 2006,2007,2010 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 ...
gpl-3.0
HEPData/hepdata-query
server-aggregator/aggregator/harmonizing.py
2
2831
from math import isinf, isnan import re class NotNumeric(Exception): pass class NotFound(Exception): pass class TooManyResults(Exception): pass def coerce_float_or_null(value): if value == '-': return None else: return coerce_float(value) # All this to parse a floating poin...
gpl-2.0
Nebla/cylindricalParkingPrototype
parking_app/UI/SlotUI.py
1
2206
__author__ = 'adrian' from PyQt4 import QtGui from PyQt4 import QtCore from parking_app.UI.WarningConfirmationUI import WarningConfirmationUI import parking_app.Common as Common import random class SlotUI(QtGui.QWidget): def __init__(self): super(SlotUI, self).__init__() self.initUI() def...
mit