repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
samael65535/quick-ng
tools/cocos2d-console/plugins/package/package_info.py
6
1905
import time from helper import PackageHelper import cocos class PackageInfo(object): @staticmethod def plugin_name(): return "info" @staticmethod def brief_description(): return cocos.MultiLanguage.get_string('PACKAGE_INFO_BRIEF') def parse_args(self, argv): from argpar...
mit
edx/edx-platform
common/djangoapps/student/migrations/0033_userprofile_state.py
8
1586
# Generated by Django 2.2.12 on 2020-04-30 20:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0032_removed_logout_view_configuration'), ] operations = [ migrations.AddField( model_name='userprofile', ...
agpl-3.0
mjabri/holoviews
holoviews/plotting/mpl/annotation.py
1
4406
import matplotlib from matplotlib import patches as patches from ...core.util import match_spec from .element import ElementPlot class AnnotationPlot(ElementPlot): """ AnnotationPlot handles the display of all annotation elements. """ def __init__(self, annotation, **params): self._annotatio...
bsd-3-clause
gkotton/neutron
neutron/plugins/ml2/plugin.py
3
58218
# Copyright (c) 2013 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 ...
apache-2.0
robclark/stk-code
tools/nightbuilder/send.py
20
1702
#!/bin/python # From Supertuxkart SVN revision $Revision$ # Copyright (C) 2012 Jean-manuel clemencon (samuncle) # Class used to package the project ################################################################################ from subprocess import check_output import os from utils import * class Send: """ ...
gpl-3.0
darkfoxprime/foxCAT
src/fpg.py
1
5633
#!/usr/bin/python # # fpg - FOX parser generator. # # usage: # fpg [ -l,--language=<outputlanguage> ] [ -n,--name=<name> ] # [ -o,--outputfile=<filename> ] [ -v,--showtables ] <inputfile>|- # # options: # -l,--language=<outputlanguage> # What language to output the parser in. Currently, only "python" # ...
isc
sbrichards/rockstor-core
src/rockstor/smart_manager/views/ts_service.py
5
2140
""" Copyright (c) 2012-2014 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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...
gpl-3.0
xuxiao19910803/edx
common/lib/capa/capa/tests/test_answer_pool.py
196
27058
""" Tests the logic of the "answer-pool" attribute, e.g. <choicegroup answer-pool="4"> """ import unittest import textwrap from . import test_capa_system, new_loncapa_problem from capa.responsetypes import LoncapaProblemError class CapaAnswerPoolTest(unittest.TestCase): """Capa Answer Pool Test""" def setU...
agpl-3.0
Livit/Livit.Learn.EdX
lms/djangoapps/mailing/management/commands/mailchimp_id.py
155
1629
""" mailchimp_id: Returns whether or not a given mailchimp key represents a valid list. """ import sys from optparse import make_option from django.core.management.base import BaseCommand, CommandError from mailsnake import MailSnake class Command(BaseCommand): """ Given a mailchimp key, validates that a li...
agpl-3.0
konono/equlipse
openstack-install/charm/trusty/charm-keystone/tests/charmhelpers/__init__.py
6
1285
# Copyright 2014-2015 Canonical Limited. # # 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 ...
mit
ryfeus/lambda-packs
Shapely_numpy/source/numpy/core/tests/test_shape_base.py
40
11724
from __future__ import division, absolute_import, print_function import numpy as np from numpy.compat import long from numpy.core import (array, arange, atleast_1d, atleast_2d, atleast_3d, vstack, hstack, newaxis, concatenate, stack) from numpy.testing import (TestCase, assert_, assert_raises, ...
mit
roadmapper/ansible
lib/ansible/modules/network/netvisor/pn_snmp_community.py
35
5161
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['...
gpl-3.0
rhyolight/nupic.son
app/soc/modules/seeder/logic/providers/integer.py
1
6187
# Copyright 2010 the Melange 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 or agreed to in wr...
apache-2.0
mzizzi/ansible
lib/ansible/plugins/lookup/dnstxt.py
46
2169
# (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
amondot/QGIS
python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py
13
6638
# -*- coding: utf-8 -*- ############################################################################### # # CSW Client # --------------------------------------------------------- # QGIS Catalogue Service client. # # Copyright (C) 2010 NextGIS (http://nextgis.org), # Alexander Bruy (alexander.bruy@gma...
gpl-2.0
sdague/home-assistant
tests/components/gogogate2/test_config_flow.py
7
5038
"""Tests for the GogoGate2 component.""" from gogogate2_api import GogoGate2Api from gogogate2_api.common import ApiError from gogogate2_api.const import GogoGate2ApiErrorCode from homeassistant import config_entries, setup from homeassistant.components.gogogate2.const import ( DEVICE_TYPE_GOGOGATE2, DEVICE_TY...
apache-2.0
mrpau/kolibri
kolibri/core/auth/test/test_morango_integration.py
1
15437
""" Tests related specifically to integration with Morango. """ import os import sys import unittest import uuid import requests from django.test import TestCase from morango.models import InstanceIDModel from morango.models import Store from morango.models import syncable_models from morango.sync.controller import Mo...
mit
shubhdev/edx-platform
common/djangoapps/terrain/stubs/tests/test_edxnotes.py
116
7012
""" Unit tests for stub EdxNotes implementation. """ import json import unittest import requests from uuid import uuid4 from ..edxnotes import StubEdxNotesService class StubEdxNotesServiceTest(unittest.TestCase): """ Test cases for the stub EdxNotes service. """ def setUp(self): """ S...
agpl-3.0
google-research/google-research
aqt/jax/flax/struct.py
1
5704
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
SujaySKumar/django
django/contrib/staticfiles/management/commands/collectstatic.py
94
13969
from __future__ import unicode_literals import os from collections import OrderedDict from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseComman...
bsd-3-clause
BackupGGCode/python-for-android
python3-alpha/python3-src/Lib/test/test_doctest.py
47
79281
""" Test script for doctest. """ from test import support import doctest import os # NOTE: There are some additional tests relating to interaction with # zipimport in the test_zipimport_support test module. ###################################################################### ## Sample Objects (used by test ...
apache-2.0
sujithshankar/anaconda
tests/lib/gladecheck.py
2
7078
# # Copyright (C) 2015 Red Hat, Inc. # # This program 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 version. # # This program is di...
gpl-2.0
topic2k/EventGhost
plugins/Phoner/__init__.py
1
36063
# -*- coding: utf-8 -*- # # /plugins/Phoner/__init__.py # # Copyright (C) 2009 Pako <lubos.ruckl@quick.cz> # # This file is a plugin for EventGhost. # Copyright © 2005-2019 EventGhost Project <http://www.eventghost.net/> # # EventGhost is free software: you can redistribute it and/or modify it under # the terms of th...
gpl-2.0
waseem18/bedrock
bedrock/legal/urls.py
1
1752
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from django.conf.urls import patterns, url from bedrock.mozorg.util import page from bedrock.legal import views from b...
mpl-2.0
DigitalSlideArchive/HistomicsTK
tests/test_nuclei_segmentation.py
1
3346
#!/usr/bin/env python ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
apache-2.0
bryancall/trafficserver
tests/gold_tests/redirect/redirect.test.py
3
7502
''' Test redirection ''' # 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 (t...
apache-2.0
dnkn/rk3188_tablet
omegamoon/toolchain/linaro/share/gdb/python/gdb/command/explore.py
137
26824
# GDB 'explore' command. # Copyright (C) 2012-2013 Free Software Foundation, Inc. # 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 late...
gpl-2.0
jnovinger/django
django/conf/locale/sr_Latn/formats.py
1008
2011
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y.' TIME_FORMAT = 'H:i' DATE...
bsd-3-clause
nikhilprathapani/python-for-android
python-build/python-libs/gdata/src/atom/auth.py
297
1199
#!/usr/bin/env python # # Copyright (C) 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
thientu/scikit-learn
sklearn/manifold/isomap.py
229
7169
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
bsd-3-clause
georglind/babusca
tests/test2.py
1
5725
from __future__ import division, print_function import numpy as np import sys sys.path.append('/Users/kim/Science/Software/bosehubbard/bosehubbard') # import bosehubbard # import scattering as scat # import utilities as util # import scipy.linalg as linalg # import scipy.sparse as sparse import smatrix import matplotli...
mit
si618/pi-time
node_modules/grunt-nose/tasks/lib/nose/pyversion.py
20
7424
""" This module contains fixups for using nose under different versions of Python. """ import sys import os import traceback import types import inspect import nose.util __all__ = ['make_instancemethod', 'cmp_to_key', 'sort_list', 'ClassType', 'TypeType', 'UNICODE_STRINGS', 'unbound_method', 'ismethod', ...
gpl-3.0
rolando-contrib/scrapy
tests/test_utils_misc/__init__.py
151
2976
import sys import os import unittest from scrapy.item import Item, Field from scrapy.utils.misc import load_object, arg_to_iter, walk_modules __doctests__ = ['scrapy.utils.misc'] class UtilsMiscTestCase(unittest.TestCase): def test_load_object(self): obj = load_object('scrapy.utils.misc.load_object') ...
bsd-3-clause
Naeka/vosae-app
www/account/api/resources/api_key.py
1
3781
# -*- coding:Utf-8 -*- from django.db import IntegrityError from django.http import HttpResponse from django import forms from tastypie import fields from tastypie.resources import ModelResource from tastypie.validation import FormValidation from tastypie.exceptions import BadRequest, ImmediateHttpResponse from tastyp...
agpl-3.0
WilliamRen/AutobahnPython
autobahn/autobahn/util.py
19
4342
############################################################################### ## ## Copyright 2011-2013 Tavendo GmbH ## ## 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:...
apache-2.0
LittleRichard/sormtger
server/enum/SortingMachineTypes.py
1
1618
class SortingMachineTypes(object): """ Represents a machine composed of motors that feeds cards, takes images, and moves them to the carousel. """ class SortingMachineType(object): def __init__(self, name, friendly_name): """ @type name: str ...
gpl-3.0
mbrukman/mapnik
scons/scons-local-2.3.6/SCons/Tool/docbook/__init__.py
20
30069
"""SCons.Tool.docbook Tool-specific initialization for Docbook. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001-7,2010 The SCons Foundation # # Permission is hereby granted, free of c...
lgpl-2.1
alqfahad/odoo
addons/resource/__openerp__.py
261
1941
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/lib2to3/pygram.py
320
1118
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Export the Python grammar and symbols.""" # Python imports import os # Local imports from .pgen2 import token from .pgen2 import driver from . import pytree # The grammar file _GRAMMAR_FILE = os.path.join(os.path....
mit
adrienbrault/home-assistant
homeassistant/components/stream/hls.py
2
5554
"""Provide functionality to stream HLS.""" import io from aiohttp import web from homeassistant.core import callback from .const import FORMAT_CONTENT_TYPE, MAX_SEGMENTS, NUM_PLAYLIST_SEGMENTS from .core import PROVIDERS, HomeAssistant, IdleTimer, StreamOutput, StreamView from .fmp4utils import get_codec_string, get...
mit
pastebt/dwm
post.py
1
3635
#! /usr/bin/python -B # -*- coding: utf8 -*- import os import re import sys try: from httplib import HTTPConnection from urllib import quote, unquote from urlparse import urlparse py3 = False except ImportError: from http.client import HTTPConnection from urllib.parse import quote, unquote, url...
gpl-3.0
DirtyUnicorns/android_kernel_motorola_msm8992
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
florian-dacosta/OpenUpgrade
addons/account_budget/wizard/account_budget_crossovered_report.py
375
2089
# -*- 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
dergraaf/xpcc
tools/system_design/xmlparser/utils.py
1
1943
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import re import copy from parser_exception import ParserException def check_name(name): """ Checks if a string comply with some rules for the notation of a name. """ if not re.match("^([A-Z]?[a-z0-9]* )*([A-Z]?[a-z0-9]*)$", name): raise ParserException("Error i...
bsd-3-clause
jgcaaprom/android_external_chromium_org
tools/json_schema_compiler/idl_schema.py
43
17296
#! /usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import itertools import json import os.path import re import sys from json_parse import OrderedDict # This file is a peer to jso...
bsd-3-clause
lad1337/Sick-Beard
lib/hachoir_parser/misc/word_doc.py
90
11320
""" Documents: * libwx source code: see fib.c source code * "Microsoft Word 97 Binary File Format" http://bio.gsi.de/DOCS/AIX/wword8.html Microsoft Word 97 (aka Version 8) for Windows and Macintosh. From the Office book, found in the Microsoft Office Development section in the MSDN Online Library. HTMLifi...
gpl-3.0
jandecaluwe/urubu
urubu/processors.py
1
7916
# Copyright 2014 Jan Decaluwe # # This file is part of Urubu. # # Urubu 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 of the License, or # (at your option) any later version. # # Urub...
agpl-3.0
ianblu1/alexandria
manage.py
1
1170
# manage.py from flask_script import Manager, prompt_bool from flask_migrate import MigrateCommand from alexandria.app import create_app from alexandria.extensions import db, bcrypt from alexandria.models.users import User, UserEmail app = create_app() manager = Manager(app) manager.add_command('db', MigrateComman...
mit
shadyueh/pyranking
env/lib/python2.7/site-packages/django/contrib/postgres/forms/ranges.py
393
3005
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
mit
JLHwung/shadowsocks-org
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
alanjw/GreenOpenERP-Win-X86
openerp/addons/account/project/report/inverted_analytic_balance.py
56
5710
# -*- 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
benob/chainer
cupy/statistics/meanvar.py
6
2267
# TODO(okuta): Implement median # TODO(okuta): Implement average def mean(a, axis=None, dtype=None, out=None, keepdims=False): """Returns the arithmetic mean along an axis. Args: a (cupy.ndarray): Array to compute mean. axis (int): Along which axis to compute mean. The flattened array is ...
mit
exul/semesterarbeit
lib/winwin/writer.py
1
3057
from winwin.graph import Graph class Writer: ''' Write a graph or a list of nodes into a file. ''' def write_nodes(self, nodes, file_location): ''' Writes a list of nodes into a file with their x and y coordinates @type nodes: list @param nodes: a list of nodes. ...
isc
jbaayen/sympy
sympy/simplify/sqrtdenest.py
9
3669
from sympy.utilities import all, any from sympy.functions import sqrt, sign from sympy.core import Pow, S, Number, Wild, Rational, sympify def sqrtdenest (expr): """ Denests an expression that contains nested square roots. This algorithm is based on <http://www.almaden.ibm.com/cs/people/fagin/symb85.pdf>. ...
bsd-3-clause
elyast/marathon-python
marathon/util.py
6
1707
import collections import datetime import types try: import json except ImportError: import simplejson as json import re def is_stringy(obj): return isinstance(obj, str) or isinstance(obj, unicode) class MarathonJsonEncoder(json.JSONEncoder): """Custom JSON encoder for Marathon object serialization...
mit
ofgulban/tetrahydra
examples/conversions/rgb_to_aitchison_metrics.py
1
2031
"""Export metrics related to barycentric coordinates of MRI Data.""" import os import numpy as np from nibabel import load, save, Nifti1Image import compoda.core as coda # Load data nii1 = load('/path/to/file1.nii.gz') nii2 = load('/path/to/file2.nii.gz') nii3 = load('/path/to/file3.nii.gz') basename = nii1.get_file...
gpl-3.0
mengxn/tensorflow
tensorflow/contrib/session_bundle/gc_test.py
113
4489
# 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
gcca/plaft
backend/infraestructure/utils.py
1
3991
# encoding: utf-8 import sys import os sys.path.append(os.path.dirname(os.path.abspath(__file__))) import random import re import hmac import logging import json import infraestructure.bcrypt as bcrypt from google.appengine.ext import ndb as db from collections import namedtuple from datetime import date, datetime f...
gpl-2.0
revarbat/mufsim
mufsim/insts/connections.py
1
3190
import mufsim.gamedb as db import mufsim.stackitems as si from mufsim.interface import network_interface as netifc from mufsim.logger import log # from mufsim.errors import MufRuntimeError from mufsim.insts.base import Instruction, instr @instr("awake?") class InstAwakeP(Instruction): def execute(self, fr): ...
bsd-2-clause
sahiljain/catapult
dashboard/dashboard/pinpoint/handlers/isolated_test.py
1
3350
# Copyright 2016 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 json import unittest import mock import webapp2 import webtest from google.appengine.ext import ndb from google.appengine.ext import testbed from d...
bsd-3-clause
pyfisch/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_argcomplete.py
30
3753
from __future__ import absolute_import, division, print_function import subprocess import sys import pytest # test for _argcomplete but not specific for any application def equal_with_bash(prefix, ffc, fc, out=None): res = ffc(prefix) res_bash = set(fc(prefix)) retval = set(res) == res_bash if out: ...
mpl-2.0
adviti/melange
thirdparty/google_appengine/lib/django_1_2/django/core/management/sql.py
46
7941
import os import re from django.conf import settings from django.core.management.base import CommandError from django.db import models from django.db.models import get_models def sql_create(app, style, connection): "Returns a list of the CREATE TABLE SQL statements for the given app." if connection.settings_...
apache-2.0
blink1073/phosphor-playground
examples/term-sidecar/term-sidecar.py
4
3465
""" Copyright (c) 2015 Phosphor Contributors Distributed under the terms of the BSD 3-Clause License. The full license is in the file LICENSE, distributed with this software. """ from __future__ import absolute_import, print_function import json import logging import webbrowser import tornado.websocket import tornado...
bsd-3-clause
kobejean/tensorflow
tensorflow/contrib/distribute/python/warm_starting_util_test.py
9
3748
# Copyright 2018 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
danic85/virtual_assistant
behaviours/tests/test_weather.py
2
2420
import datetime, unittest import os, sys from mock import Mock, call, patch from freezegun import freeze_time from lib import feeds import json from behaviours import weather import re class TestWeatherMethods(unittest.TestCase): @freeze_time("2017-06-07") def test_forecast(self): # output to console ...
gpl-3.0
mkrautz/external-protobuf
python/google/protobuf/service.py
590
9131
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
carlosroh/selenium
py/selenium/webdriver/ie/webdriver.py
25
2186
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
Muzer/python-xbee
examples/led_adc_example.py
43
2732
#! /usr/bin/python """ led_adc_example.py By Paul Malmsten, 2010 pmalmsten@gmail.com A simple example which sets up a remote device to read an analog value on ADC0 and a digital output on DIO1. It will then read voltage measurements and write an active-low result to the remote DIO1 pin. """ from xbee import XBee i...
mit
agepoly/mezzanine
mezzanine/blog/migrations/0005_auto__del_comment__add_field_blogpost_comments_count__chg_field_blogpo.py
8
10953
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label = '%s...
bsd-2-clause
salaria/odoo
addons/auth_oauth/res_users.py
121
5240
import logging import werkzeug.urls import urlparse import urllib2 import simplejson import openerp from openerp.addons.auth_signup.res_users import SignupError from openerp.osv import osv, fields from openerp import SUPERUSER_ID _logger = logging.getLogger(__name__) class res_users(osv.Model): _inherit = 'res....
agpl-3.0
siliconsmiley/QGIS
tests/src/python/test_provider_memory.py
1
6031
# -*- coding: utf-8 -*- """QGIS Unit tests for the memory layer provider. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later vers...
gpl-2.0
Thingee/cinder
cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py
11
2207
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 OpenStack Foundation # # 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 # # ...
apache-2.0
OCA/commission
sale_commission_delegated_partner/models/sale_commission_settlement.py
1
1105
# Copyright 2021 Creu Blanca # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, _ class SaleCommissionSettlement(models.Model): _inherit = 'sale.commission.settlement' def _prepare_invoice_header(self, settlement, journal, date=False): vals = super()._prepare_in...
agpl-3.0
Kazade/NeHe-Website
google_appengine/lib/graphy/graphy/backends/google_chart_api/__init__.py
28
2009
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
hlange/LogSoCR
pysc/usi/core/test1.py
2
1457
from __future__ import print_function import pysc import json #@pysc.on("end_of_elaboration") #def do_elab(phase): # print "Elab" #print json.dumps(pysc.gc.readValueDict(), indent=2, sort_keys=True) #print pysc.gc.readDict() #def elf_file(name="", value="", time=None, type=None): # print "XX", name, val...
agpl-3.0
natemacfadden/math121
geneticGreed/All Files/ThirdWeights/NateToolbox.py
6
7621
#doing explicit importing to try to speed up code from numpy import percentile import string from collections import Iterable as IterableType import math import json from random import randrange #vvvvvvvvvvvvvvv Filename Functions vvvvvvvvvvvvvvv def convert_valid(oneChar): """Convert a character into '_...
mit
GeorgyFirsov/Nitrogen-Kernel
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
fedral/ITK
Utilities/Maintenance/UpdateCopyrightStatementsInITK.py
12
6488
#!/usr/bin/python #========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
stuntman723/rap-analyzer
rap_analyzer/lib/python2.7/site-packages/gunicorn/workers/base.py
25
7331
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. from datetime import datetime import os import signal import sys import time from random import randint from gunicorn import util from gunicorn.workers.workertmp import WorkerTmp from gunico...
mit
unioslo/cerebrum
Cerebrum/rest/api/utils.py
1
9791
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016-2018 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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...
gpl-2.0
lifemapper/LmQGIS
lifemapperTools/icons/icons_deprecated.py
2
73243
# -*- coding: utf-8 -*- """ @author: Jeff Cavner @contact: jcavner@ku.edu @license: gpl2 @copyright: Copyright (C) 2014, University of Kansas Center for Research Lifemapper Project, lifemapper [at] ku [dot] edu, Biodiversity Institute, 1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, US...
gpl-2.0
daijia/fetch-flight
website/fetch_csair.py
1
3129
#!/usr/bin/env python # -*- coding: utf-8 -*- import util from selenium import webdriver from constant import Website, CITY_TO_AIRPORTS, AIRLINE_NAME from setting.fetch_settings import AIRPORT_NAME_PARAMS, URL_PARAMS def dig_info(flight, pair): try: elements = [x.strip() for x in flight.text.split('\n')] ...
mit
google-code-export/los-cocos
test/test_transition_flipx.py
6
1247
from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 0.5, s, t 1, s, t 1.5, s, t 2.1, s, q" tags = "FlipX3DTransition" import...
bsd-3-clause
goodguy/satchmo
satchmo/apps/satchmo_store/shop/config.py
6
4259
# -*- coding: utf-8 -*- import os import urlparse from decimal import Decimal from django.conf import settings from django.utils.translation import ugettext_lazy as _ from livesettings import config_register, BooleanValue, StringValue, \ ConfigurationGroup, PositiveIntegerValue, \ DecimalValue SHOP_GROUP = C...
bsd-3-clause
aferr/LatticeMemCtl
src/mem/slicc/ast/TypeFieldAST.py
92
1754
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
Psychedelic-Engineering/sleep-machine
audio/playlist.py
1
2812
from gstplayer import AudioPlayer import time, logging, random from scloud import SCloud # Umbau zur Playlist Klasse # Fade-In und Out in sec # playlist-Suche nach Tag und NAme # Max Playtime # Playlistmanager klasse # FindMatchingPlaylists(Mood/Activity) # Next/PreviousPlaylist class PlaylistSoundCloud: def __in...
mit
always-waiting/exercism-python
circular-buffer/circular_buffer_test.py
3
3083
import unittest from circular_buffer import ( CircularBuffer, BufferFullException, BufferEmptyException ) class CircularBufferTest(unittest.TestCase): def test_read_empty_buffer(self): buf = CircularBuffer(1) with self.assertRaises(BufferEmptyException): buf.read() de...
mit
bearstech/ansible
lib/ansible/modules/network/illumos/ipadm_addr.py
8
11648
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', ...
gpl-3.0
KitKatXperience/platform_external_chromium_org
chrome/test/functional/chromeos_retail_mode.py
42
1755
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import pyauto_functional # Must come before pyauto (and thus, policy_base). import policy_base class ChromeosRetailMode(policy_base.PolicyTestBase): ...
bsd-3-clause
kpkhxlgy0/SublimeText3
Packages/SublimeCodeIntel/libs/chardet/mbcssm.py
63
18215
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
bocaaust/FreshLife
django_project/env/lib/python2.7/site-packages/django/db/models/sql/query.py
60
90134
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
apache-2.0
JosephGoulden/PyBitmessageF2F
src/l10n.py
11
2882
import logging import time import shared #logger = logging.getLogger(__name__) logger = logging.getLogger('file_only') DEFAULT_ENCODING = 'ISO8859-1' DEFAULT_LANGUAGE = 'en_US' DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S' encoding = DEFAULT_ENCODING language = DEFAULT_LANGUAGE try: import locale encoding =...
mit
roques/bitcoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
MebiusHKU/flask-web
flask/lib/python2.7/site-packages/pip/vcs/bazaar.py
280
4427
from __future__ import absolute_import import logging import os import tempfile import re # TODO: Get this into six.moves.urllib.parse try: from urllib import parse as urllib_parse except ImportError: import urlparse as urllib_parse from pip.utils import rmtree, display_path from pip.vcs import vcs, VersionC...
bsd-3-clause
ojengwa/oh-mainline
vendor/packages/distribute/setuptools/command/alias.py
135
2477
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in ...
agpl-3.0
hechaoyuyu/swinst
src/pypack/altgraph/Graph.py
9
19562
""" Base Graph class #--Version 2.1 #--Bob Ippolito October, 2004 #--Version 2.0 #--Istvan Albert June, 2004 #--Version 1.0 #--Nathan Denny, May 27, 1999 """ from altgraph import GraphError from compat import * class Graph(object): """ The Graph class represents a directed graph with C{N} nodes and C{E} ...
gpl-2.0
alff0x1f/Misago
misago/forums/lists.py
8
2714
from misago.acl import add_acl from misago.readtracker import forumstracker from misago.forums.models import Forum __all__ = ['get_forums_list', 'get_forum_path'] def get_forums_list(user, parent=None): if not user.acl['visible_forums']: return [] if parent: queryset = parent.get_descendan...
gpl-2.0
epeios-q37/epeios
tools/xdhq/examples/PYH/MatPlotLib/main.py
1
11970
import os, sys os.chdir(os.path.dirname(os.path.realpath(__file__))) sys.path.append("../../atlastk") import atlastk import matplotlib.pyplot as plt from io import StringIO from mpl_toolkits.mplot3d import axes3d import numpy as np from cycler import cycler import matplotlib as mpl import matplotlib.tri as tri impor...
agpl-3.0
ruuk/script.module.youtube.dl
lib/youtube_dl/extractor/tube8.py
20
3087
from __future__ import unicode_literals import re from ..utils import ( int_or_none, str_to_int, ) from .keezmovies import KeezMoviesIE class Tube8IE(KeezMoviesIE): _VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.tube8...
gpl-2.0
mancoast/CPythonPyc_test
cpython/277_test_types.py
112
29723
# Python test set -- part 6, built-in types from test.test_support import run_unittest, have_unicode, run_with_locale, \ check_py3k_warnings import unittest import sys import locale class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is...
gpl-3.0