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
luispedro/particles
particles/position.py
1
1422
# -*- coding: utf-8 -*- # Copyright (C) 2009 Particle Authors (see AUTHORS.txt) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the righ...
mit
GyrosOfWar/servo
tests/wpt/css-tests/css-fonts-3_dev/html/reference/support/fonts/makegsubfonts.py
820
14309
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
jrabbit/ubotu-fr
plugins/plugins/Protector/plugin.py
7
6948
### # Copyright (c) 2004, Jeremiah Fincher # 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 conditi...
bsd-3-clause
mikeckennedy/asq
asq/test/test_all.py
5
1342
import unittest from asq.queryables import Queryable __author__ = "Robert Smallshire" class TestAll(unittest.TestCase): def test_all_positive(self): a = [True, True, True, True] b = Queryable(a).all() self.assertTrue(b) def test_all_negative(self): a = [True, True, True, Fals...
mit
GinnyN/Team-Fortress-RPG-Generators
tests/regressiontests/model_inheritance_regress/models.py
75
4389
import datetime from django.db import models class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Meta: ordering = ('name',) def __unicode__(self): return u"%s the place" % self.name class Restaurant(Place): serves_hot...
bsd-3-clause
code4futuredotorg/reeborg_tw
src/libraries/brython/Lib/encodings/mac_iceland.py
272
13498
""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
agpl-3.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/lib2to3/fixes/fix_xrange.py
198
2694
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer that changes xrange(...) into range(...).""" # Local imports from .. import fixer_base from ..fixer_util import Name, Call, consuming_calls from .. import patcomp class FixXrange(fixer_base.BaseFix): BM_...
apache-2.0
hoburg/gpkit
gpkit/interactive/plot_sweep.py
1
3478
"Implements plot_sweep1d function" import matplotlib.pyplot as plt from ..exceptions import InvalidGPConstraint def assign_axes(var, posys, axes): "Assigns axes to posys, creating and formatting if necessary" if not hasattr(posys, "__iter__"): posys = [posys] N = len(posys) if axes is None: ...
mit
40223108/w18
static/Brython3.1.0-20150301-090019/Lib/importlib/__init__.py
610
3472
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirectly). Since...
gpl-3.0
sungkim11/mhargadh
django/middleware/cache.py
241
9078
""" Cache middleware. If enabled, each Django-powered page will be cached based on URL. The canonical way to enable cache middleware is to set ``UpdateCacheMiddleware`` as your first piece of middleware, and ``FetchFromCacheMiddleware`` as the last:: MIDDLEWARE_CLASSES = [ 'django.middleware.cache.UpdateCa...
bsd-3-clause
thetomcraig/python-withings
withings/__init__.py
1
8148
# -*- coding: utf-8 -*- # """ Python library for the Withings API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Withings Body metrics Services API <http://www.withings.com/en/api/wbsapiv2> Uses Oauth 1.0 to authentify. You need to obtain a consumer key and consumer secret from Withings by creating an application here: <https:/...
mit
kylazhang/virt-test
virttest/libvirt_xml/accessors.py
1
34276
""" Specializations of base.AccessorBase for particular XML manipulation types """ import logging import re import sys from virttest import xml_utils from virttest.propcan import PropCanBase from virttest.libvirt_xml import xcepts, base # Adapted from http://code.activestate.com/recipes/576847/ # :codeauthor: Vishal...
gpl-2.0
sbellem/django
tests/invalid_models_tests/test_backend_specific.py
191
1024
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.core.checks import Error from django.db import connections, models from django.test import mock from .base import IsolatedModelsTestCase def dummy_allow_migrate(db, app_label, **hints): # Prevent checks from being run on the 'other' d...
bsd-3-clause
kmee/l10n-brazil
l10n_br_account_product/models/res_partner.py
3
9941
# -*- coding: utf-8 -*- # Copyright (C) 2013 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api from openerp.addons.l10n_br_account_product.models.product import \ PRODUCT_ORIGIN class AccountFiscalPositionTemplate(models.Model): _...
agpl-3.0
SuLab/genewiki
genewiki/bio/images.py
1
7651
from django.conf import settings import urllib, subprocess, os, sys, datetime, mwclient ''' Handles linking PDB structure images to ProteinBox templates. ''' description_skeleton = '''== {{{{int:filedesc}} == {{{{Information | Description={{{{en | 1=Structure of protein {symbol}. Based on [[w:PyMol | PyMol]] rende...
mit
bzennn/blog_flask
python/lib/python3.5/site-packages/bs4/tests/test_builder_registry.py
176
5582
"""Tests of the builder registry.""" import unittest import warnings from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HT...
gpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/utils/version.py
320
1361
import django import os.path import re def get_svn_revision(path=None): """ Returns the SVN revision in the form SVN-XXXX, where XXXX is the revision number. Returns SVN-unknown if anything goes wrong, such as an unexpected format of internal SVN files. If path is provided, it should be a dir...
bsd-3-clause
BoltzmannBrain/nupic.research
projects/sequence_prediction/continuous_sequence/model_params/nyc_taxi_model_params.py
2
4891
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
n4hy/gnuradio
gr-vocoder/python/qa_g721_vocoder.py
6
1229
#!/usr/bin/env python # # Copyright 2011 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 option) ...
gpl-3.0
open-craft/opencraft
instance/tests/management/test_activity_csv.py
1
1606
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015-2019 OpenCraft <contact@opencraft.com> # # This program 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 Fre...
agpl-3.0
Kasual666/WebGl
utils/converters/msgpack/msgpack/fallback.py
641
26403
"""Fallback pure Python implementation of msgpack""" import sys import array import struct if sys.version_info[0] == 3: PY3 = True int_types = int Unicode = str xrange = range def dict_iteritems(d): return d.items() else: PY3 = False int_types = (int, long) Unicode = unicode ...
mit
kerr-huang/Testerman
qtesterman/LogViewer.py
2
62001
# -*- coding: utf-8 -*- ## # This file is part of Testerman, a test automation system. # Copyright (c) 2009, 2010 QTesterman contributors # # 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...
gpl-2.0
pwoodworth/intellij-community
plugins/hg4idea/testData/bin/mercurial/store.py
90
16865
# store.py - repository store handling for Mercurial # # Copyright 2008 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import scmutil, util, parsers import os, stat, errno _sha =...
apache-2.0
klonage/nlt-gcs
Lib/symbol.py
53
2170
#! /usr/bin/env python """Non-terminal symbols of Python grammar (from "graminit.h").""" # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # python Lib/...
gpl-3.0
somsak/youtube-dl
youtube_dl/extractor/vidme.py
49
3430
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, str_to_int, ) class VidmeIE(InfoExtractor): _VALID_URL = r'https?://vid\.me/(?:e/)?(?P<id>[\da-zA-Z]+)' _TESTS = [{ 'url': 'https://vid.me/QNB', 'md5': 'f42d...
unlicense
shubhamdhama/zulip
zilencer/management/commands/compare_messages.py
7
1191
from typing import Any import ijson from django.core.management.base import BaseCommand, CommandParser class Command(BaseCommand): help = """ Render messages to a file. Usage: ./manage.py render_messages <destination> <--amount> """ def add_arguments(self, parser: CommandParser) -> None: ...
apache-2.0
jassycliq/flo-kernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
evro/CouchPotatoServer
couchpotato/core/downloaders/transmission.py
6
14359
from base64 import b64encode from datetime import timedelta import httplib import json import os.path import re import urllib2 from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList from couchpotato.core.helpers.encoding import isInt, sp from couchpotato.core.helpers.variable import try...
gpl-3.0
xzYue/odoo
addons/hr_timesheet_invoice/hr_timesheet_invoice.py
80
18148
# -*- 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...
agpl-3.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.4/django/core/management/commands/test.py
111
2965
import sys import os from optparse import make_option, OptionParser from django.conf import settings from django.core.management.base import BaseCommand from django.test.utils import get_runner class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noinput', actio...
mit
salaria/odoo
addons/edi/models/edi.py
277
31944
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2014 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
alexsalo/genenetwork2
wqflask/wqflask/marker_regression/gemma_mapping.py
1
1699
import os from base import webqtlConfig def run_gemma(this_dataset, samples, vals): """Generates p-values for each marker using GEMMA""" print("INSIDE GEMMA_MAPPING") gen_pheno_txt_file(this_dataset, samples, vals) os.chdir("{}gemma".format(webqtlConfig.HTMLPATH)) gemma_command = './g...
agpl-3.0
ronabop/cobbler
cobbler/modules/install_pre_puppet.py
14
2013
""" This module removes puppet certs from the puppet master prior to reinstalling a machine if the puppet master is running on the cobbler server. Based on: http://www.ithiriel.com/content/2010/03/29/writing-install-triggers-cobbler """ import distutils.sysconfig import re import sys import utils plib = distutils.sy...
gpl-2.0
navcoindev/navcoin-core
qa/rpc-tests/coldstaking_spending.py
1
8717
#!/usr/bin/env python3 # Copyright (c) 2018 The Navcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import decimal from test_framework.test_framework import NavCoinTestFramework from test_framework.staticr_util...
mit
mhrivnak/crane
tests/views/test_images.py
7
2165
from . import base class TestImages(base.BaseCraneAPITest): def test_invalid_file_name(self): response = self.test_client.get('/v1/images/abc123/notvalid') self.assertEqual(response.status_code, 404) self.assertTrue(response.headers['Content-Type'].startswith('text/html')) def test_a...
gpl-2.0
research-team/robot-dream
somatosensory_columns/parameters.py
1
6123
import nest import numpy.random as random from property import * # E_L L2_EL_mu = -79.3 L2_EL_sigma = 4.27 / 4 L3_EL_mu = -79.3 L3_EL_sigma = 4.27 / 4 L4_EL_mu = -71.8 L4_EL_sigma = 4.20 / 4 L5A_EL_mu = -69.9 L5A_EL_sigma = 4.18 / 4 L5B_EL_mu = -68.5 L5B_EL_sigma = 3.98 / 4 L6_EL_mu = -69.9 L6_EL_sigma = 4.18 / 4...
mit
fflo/sixeleven
client/DNS/__init__.py
40
1895
# -*- encoding: utf-8 -*- # $Id: __init__.py,v 1.8.2.7 2009/06/09 18:05:29 customdesigned Exp $ # # This file is part of the pydns project. # Homepage: http://pydns.sourceforge.net # # This code is covered by the standard Python License. # # __init__.py for DNS class. __version__ = '2.3.4' import Type,Opcode,Status,...
mit
topic2k/EventGhost
lib27/site-packages/tornado/platform/interface.py
387
2244
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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 a...
gpl-2.0
openstack/dragonflow
dragonflow/tests/fullstack/test_l3_flows.py
1
3321
# 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...
apache-2.0
dlam26/django-filer
filer/admin/patched/admin_utils.py
23
2917
#-*- coding: utf-8 -*- """ Copy of ``django.contrib.admin.utils.get_deleted_objects`` and a subclass of ``django.contrib.admin.utils.NestedObjects`` that work with djongo_polymorphic querysets. Ultimatly these should go directly into django_polymorphic or, in a more generic way, into django itself. This code has been ...
bsd-3-clause
ryokochang/Slab-GCS
packages/IronPython.StdLib.2.7.5-beta1/content/Lib/tabnanny.py
394
11336
#! /usr/bin/env python """The Tab Nanny despises ambiguous indentation. She knows no mercy. tabnanny -- Detection of ambiguous indentation For the time being this module is intended to be called as a script. However it is possible to import it into an IDE and use the function check() described below. Warning: The ...
gpl-3.0
thomasrogers03/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checker.py
120
35144
# Copyright (C) 2009 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # Copyright (C) 2010 ProFUSION embedded systems # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
rebelact/mailsync-app
mailsync/api/mailchimp.py
1
2198
import datetime import logging from mailsnake import MailSnake from mailsync.models.customfield import CustomField class MailChimp(object): def __init__(self, apikey): self.api_key = apikey self.provider = MailSnake(self.api_key) def test_connection(self): try: self.provider.ping() except Exception,...
mit
incaser/odoo-odoo
addons/auth_signup/__init__.py
446
1039
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
LaurentClaessens/phystricks
src/MathConstructions.py
1
5139
# -*- coding: utf8 -*- ########################################################################### # This is part of the module phystricks # # phystricks 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...
gpl-3.0
Aristocles/CouchPotatoServer
libs/git/commit.py
110
3498
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
pycook/cmdb
cmdb-api/api/models/cmdb.py
1
12011
# -*- coding:utf-8 -*- import datetime from api.extensions import db from api.lib.cmdb.const import CIStatusEnum from api.lib.cmdb.const import OperateType from api.lib.cmdb.const import ValueTypeEnum from api.lib.database import Model # template class RelationType(Model): __tablename__ = "c_relation_types" ...
gpl-2.0
moorescloud/holideck
iotas/drawlight.py
3
7320
#!/usr/bin/python # """Integration of drawlight with IoTAS for the Light by MooresCloud Homepage and documentation: http://dev.moorescloud.com/ Copyright (c) 2013, Mark Pesce. License: MIT (see LICENSE for details)""" __author__ = 'Mark Pesce' __version__ = '0.01.dev' __license__ = 'MIT' awt_colors = dict( black=0x...
mit
68foxboris/enigma2-openpli-vuplus
lib/python/Components/TuneTest.py
8
11267
from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable, eDVBFrontendParametersATSC, eDVBFrontendParameters, eDVBResourceManager, eTimer class Tuner: def __init__(self, frontend, ignore_rotor=False): self.frontend = frontend self.ignore_rotor = ignore_rot...
gpl-2.0
vongochung/buiquocviet
appconf/tests/models.py
10
1121
from appconf import AppConf class CustomHolder(object): HOLDER_VALUE = True custom_holder = CustomHolder() class TestConf(AppConf): SIMPLE_VALUE = True CONFIGURED_VALUE = 'wrong' def configure_configured_value(self, value): return 'correct' def configure(self): self.configur...
bsd-3-clause
rs/petl
src/petl/test/io/test_pickle.py
1
1689
from __future__ import absolute_import, print_function, division __author__ = 'Alistair Miles <alimanfoo@googlemail.com>' from tempfile import NamedTemporaryFile import cPickle as pickle from petl.testutils import ieq from petl.io.pickle import frompickle, topickle, appendpickle def test_frompickle(): """Te...
mit
galaxy-iuc/parsec
parsec/commands/libraries/upload_file_from_url.py
1
1148
import click from parsec.cli import pass_context, json_loads from parsec.decorators import custom_exception, list_output @click.command('upload_file_from_url') @click.argument("library_id", type=str) @click.argument("file_url", type=str) @click.option( "--folder_id", help="id of the folder where to place the ...
apache-2.0
Treefunder/pycoin
pycoin/scripts/bitcoin_utils.py
21
4803
#!/usr/bin/env python import argparse import binascii import sys from pycoin import ecdsa, encoding from pycoin.serialize import b2h, h2b from pycoin.ecdsa import secp256k1 def parse_as_number(s): try: return int(s) except ValueError: pass try: return int(s, 16) except ValueEr...
mit
bytor99999/vertx-web
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/unittest2/test/test_setups.py
17
16713
import sys from six.moves import StringIO import unittest2 import unittest2 as unittest from unittest2.test.support import resultFactory class TestSetups(unittest2.TestCase): def getRunner(self): return unittest2.TextTestRunner(resultclass=resultFactory, stream...
apache-2.0
stefan-jonasson/home-assistant
homeassistant/components/device_tracker/automatic.py
4
12994
""" Support for the Automatic platform. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.automatic/ """ import asyncio from datetime import timedelta import json import logging import os from aiohttp import web import voluptuous as vol fro...
mit
wiltonlazary/arangodb
3rdParty/boost/1.61.0/libs/python/pyste/src/Pyste/EnumExporter.py
54
2156
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) from Exporter import Exporter from settings import * import utils #====================...
apache-2.0
efabless/openlane
scripts/remove_empty_pins.py
1
1606
#!/usr/bin/env python3 # Copyright 2020 Efabless 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 applica...
apache-2.0
Emergya/icm-openedx-educamadrid-platform-basic
common/test/acceptance/tests/studio/test_studio_library_container.py
111
14006
""" Acceptance tests for Library Content in LMS """ import ddt from nose.plugins.attrib import attr import textwrap from .base_studio_test import StudioLibraryTest from ...fixtures.course import CourseFixture from ..helpers import UniqueCourseTest, TestWithSearchIndexMixin from ...pages.studio.library import StudioLib...
agpl-3.0
markrawlingson/SickRage
lib/sqlalchemy/event/api.py
75
3844
# event/api.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Public API functions for the event system. """ from __future__ import absolute_import...
gpl-3.0
qitaos/robotframework-mabot
lib/robot/output/output.py
4
2663
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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...
apache-2.0
pymo/pymo
symbian/PythonForS60_1.9.6/module-repo/standard-modules/encodings/iso2022_jp.py
816
1053
# # iso2022_jp.py: Python Unicode Codec for ISO2022_JP # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncod...
mit
osborne6/luminotes
tools/initdb.py
1
6857
#!/usr/bin/python2.4 import os import os.path import sys from controller.Database import Database from controller.Schema_upgrader import Schema_upgrader from model.Notebook import Notebook from model.Note import Note from model.User import User from config.Version import VERSION class Initializer( object ): HTML_P...
gpl-3.0
aioue/ansible
lib/ansible/module_utils/facts/system/pkg_mgr.py
46
3045
# Collect facts related to the system package manager # # 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
RTHMaK/RPGOne
Documents/skflow-master/skflow/ops/embeddings_ops.py
4
3064
"""TensorFlow Ops to work with embeddings. Note: categorical variables are handled via embeddings in many cases. For example, in case of words. """ # Copyright 2015-present Scikit Flow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file excep...
apache-2.0
Zhaoyanzhang/-myflasky
venv/lib/python2.7/site-packages/markdown/extensions/headerid.py
122
3321
""" HeaderID Extension for Python-Markdown ====================================== Auto-generate id attributes for HTML headers. See <https://pythonhosted.org/Markdown/extensions/header_id.html> for documentation. Original code Copyright 2007-2011 [Waylan Limberg](http://achinghead.com/). All changes Copyright 2011-...
mit
etos/django
tests/auth_tests/test_checks.py
44
7996
from django.contrib.auth.checks import ( check_models_permissions, check_user_model, ) from django.contrib.auth.models import AbstractBaseUser from django.core import checks from django.db import models from django.test import ( SimpleTestCase, override_settings, override_system_checks, ) from django.test.utils...
bsd-3-clause
GLolol/variety
tests/TestQuotationsPageSource.py
1
2071
#!/usr/bin/python2 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (c) 2012, Peter Levi <peterlevi@peterlevi.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as publishe...
gpl-3.0
jptomo/rpython-lang-scheme
rpython/rlib/test/test_rzlib.py
1
8890
""" Tests for the rzlib module. """ import py from rpython.rlib import rzlib from rpython.rlib.rarithmetic import r_uint import zlib expanded = 'some bytes which will be compressed' compressed = zlib.compress(expanded) def test_crc32(): """ When called with a string, rzlib.crc32 should compute its CRC32 an...
mit
cluckmaster/MissionPlanner
Lib/site-packages/scipy/stats/tests/test_mstats_basic.py
61
20295
""" Tests for the stats.mstats module (support for maskd arrays) """ import numpy as np from numpy import nan import numpy.ma as ma from numpy.ma import masked, nomask import scipy.stats.mstats as mstats from numpy.testing import TestCase, run_module_suite from numpy.ma.testutils import assert_equal, assert_almost_e...
gpl-3.0
jeyraof/python-social-auth
social/backends/soundcloud.py
83
2156
""" Soundcloud OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/soundcloud.html """ from social.p3 import urlencode from social.backends.oauth import BaseOAuth2 class SoundcloudOAuth2(BaseOAuth2): """Soundcloud OAuth authentication backend""" name = 'soundcloud' AUTHORIZATION_URL = ...
bsd-3-clause
schumi2004/NOT_UPDATED_Sick-Beard-Dutch
lib/hachoir_parser/file_system/iso9660.py
90
4966
""" ISO 9660 (cdrom) file system parser. Documents: - Standard ECMA-119 (december 1987) http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf Author: Victor Stinner Creation: 11 july 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, ParserError, UInt8, UInt32, ...
gpl-3.0
masamichi/bite-project
server/models/suite_test_map.py
17
3454
# Copyright 2010 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 a...
apache-2.0
Avikalp7/image-aesthetics-learning
src/ScraperScripts/TwitterScraping.py
1
4020
import tweepy import wget from tweepy import OAuthHandler import json import shutil import csv import os consumer_key = '<We can\'t make our key public here, please enter your own key here :D :)' consumer_secret = '...' access_token = '...' access_secret = '...' from pandas import DataFrame # from tweet import comput...
mit
PRJosh/kernel_samsung_manta
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
scztt/sc-debug
Psycollider/Psycollider/Psycollider.py
4
60542
# File: Psycollider.py # Copyright (c) Benjamin Golinvaux # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # Thi...
gpl-2.0
g8ecj/bertos
wizard/toolchain_validation.py
7
2302
#!/usr/bin/env python # encoding: utf-8 # # This file is part of BeRTOS. # # Bertos is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # #...
gpl-2.0
gale320/newfies-dialer
newfies/dialer_contact/migrations/0004_change_type_address.py
4
6461
# -*- coding: 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): # Changing field 'Contact.address' db.alter_column(u'dialer_contact', 'address', self.gf('django.db.models....
mpl-2.0
gh2o/rk3066-linux
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
EchO-KID/google-breakpad
src/tools/gyp/test/sibling/gyptest-all.py
104
1078
#!/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. """ """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('build/all.gyp', chdir='src') test.build('build/all.gyp', test.ALL, chdir='...
bsd-3-clause
google/fuzzbench
database/alembic/versions/8c237d2acbc4_add_crash_table.py
1
1224
"""add crash table Revision ID: 8c237d2acbc4 Revises: eec6e5667b87 Create Date: 2020-12-01 15:04:15.172873 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8c237d2acbc4' down_revision = 'eec6e5667b87' branch_labels = None depends_on = None def upgrade(): ...
apache-2.0
bonitadecker77/python-for-android
python3-alpha/python3-src/Lib/xml/etree/ElementInclude.py
784
5146
# # ElementTree # $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xinclude support for element trees # # history: # 2003-08-15 fl created # 2003-11-14 fl fixed default loader # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware...
apache-2.0
Softmotions/edx-platform
common/test/acceptance/pages/lms/peer_calibrate.py
206
1526
""" Page that allows the student to grade calibration essays (requirement for being allowed to grade peers). """ from bok_choy.page_object import PageObject from bok_choy.promise import Promise from .rubric import RubricPage class PeerCalibratePage(PageObject): """ Grade calibration essays. """ url ...
agpl-3.0
home-assistant/home-assistant
homeassistant/components/zha/climate.py
5
23686
""" Climate on Zigbee Home Automation networks. For more details on this platform, please refer to the documentation at https://home-assistant.io/components/zha.climate/ """ from __future__ import annotations from datetime import datetime, timedelta import enum import functools from random import randint from homeas...
apache-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/gis/db/backends/spatialite/base.py
59
3621
import sys from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import ( Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper, ) from django.utils import six from .client import SpatiaL...
gpl-3.0
alianmohammad/pd-gem5
src/arch/x86/isa/insts/x87/control/wait_for_exceptions.py
91
2150
# Copyright (c) 2007 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 implemen...
bsd-3-clause
gibiansky/tensorflow
tensorflow/python/util/future_api.py
199
1367
# 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 applica...
apache-2.0
blaze33/django
django/db/models/sql/datastructures.py
118
1115
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was attempted (if the caller wants to treat that ...
bsd-3-clause
ovresko/erpnext
erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
1
12517
# 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, erpnext import frappe.defaults from frappe import msgprint, _ from frappe.utils import cstr, flt, cint from erpnext.stock.stock_ledger im...
gpl-3.0
nickpack/reportlab
tests/test_crypto_algorithms.py
1
6382
#copyright ReportLab Europe Limited. 2000-2012 #see license.txt for license details __version__=''' $Id: test_crypto_algorithms.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__=""" This contains tests for the encryption algorithms. The algorithmic approach is to take values from a known readable-but-secured PDF...
bsd-3-clause
jaddison/django-simple-templates
test_project/test_project/settings.py
1
5065
import os import sys # grab the base path so that we can test the simple_templates app PROJECT_PATH = os.path.dirname(os.path.realpath(__file__)) if PROJECT_PATH not in sys.path: sys.path.insert(0, os.path.dirname(os.path.dirname(PROJECT_PATH))) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', ...
bsd-3-clause
OpenInkpot-archive/linux-2.6
tools/perf/scripts/python/sched-migration.py
185
11668
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf trace event handlers have been generated by perf trace -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free ...
gpl-2.0
xiaoyuanW/gem5
tests/configs/switcheroo.py
33
5775
# Copyright (c) 2012 ARM Limited # 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 implementation of the functionality ...
bsd-3-clause
embeddedarm/android_external_chromium_org
build/android/pylib/utils/timeout_retry.py
26
1458
# Copyright 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. """A utility to run functions with timeouts and retries.""" import functools import threading import reraiser_thread import watchdog_timer def Run(func, ...
bsd-3-clause
steveklabnik/servo
tests/wpt/css-tests/tools/pywebsocket/src/example/echo_noext_wsh.py
465
2404
# Copyright 2013, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
therealbnut/swift
benchmark/scripts/compare_perf_tests.py
5
13006
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- compare_perf_tests.py -------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library...
apache-2.0
abdullah2891/remo
remo/dashboard/migrations/0002_auto__del_field_actionitem_name__del_field_actionitem_slug__add_field_.py
3
7193
# -*- coding: 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): # Deleting field 'ActionItem.slug' db.delete_column(u'dashboard_actionitem', 'slug') # Adding field...
bsd-3-clause
RohitDas/cubeproject
lib/django/contrib/gis/db/backends/mysql/introspection.py
700
1771
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. ...
bsd-3-clause
Therp/odoo
addons/l10n_do/__openerp__.py
309
2992
# -*- coding: utf-8 -*- # ############################################################################# # # First author: Jose Ernesto Mendez <tecnologia@obsdr.com> (Open Business Solutions SRL.) # Copyright (c) 2012 -TODAY Open Business Solutions, SRL. (http://obsdr.com). All rights reserved. # # This is a fork to upg...
agpl-3.0
mikewiebe-ansible/ansible
test/units/modules/cloud/misc/virt_net/test_virt_net.py
38
1081
# -*- coding: utf-8 -*- # # Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from units.compat import mock def test_virt_net_create_already_active(virt_net_obj, dummy_libvirt): virt_net_obj.conn.create = mock.Mock() assert virt_n...
gpl-3.0
jsierles/maestro-ng
setup.py
4
1209
#!/usr/bin/env python # Copyright (C) 2013 SignalFuse, Inc. # Setuptools install description file. import os from setuptools import setup, find_packages with open('README.md') as readme: long_description = readme.read() with open('maestro/version.py') as f: exec(f.read()) setup( name=name, version=...
lgpl-3.0