repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringclasses
981 values
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
DataCanvasIO/example-modules
modules/modeling/basic/linear_svc_estimator/main.py
2
1630
#!/usr/bin/env python # -*- coding: utf-8 -*- import random from specparser import get_settings_from_file from pprint import pprint import csv from sklearn.svm import LinearSVC import numpy as np from sklearn.externals import joblib import matplotlib matplotlib.use('Agg') import datetime from matplotlib.backends.ba...
bsd-3-clause
pablo-co/insight-jobs
process_stops.py
1
3206
import sys import traceback from bhulan.processVehicles import importTrucks, initCompute from bhulan.processStops import saveComputedStops from bhulan.util import notify, getTime from pymongo import MongoClient from bhulan.constants import WATTS_DATA_DB_KEY from bhulan.inputOutput import saveStopsToFile import numpy as...
mit
Matty-Downing2169/opencamlib
scripts/batchdropcutter_test_2.py
7
2142
import ocl import pyocl import camvtk import time import vtk import datetime import math if __name__ == "__main__": print ocl.revision() myscreen = camvtk.VTKScreen() stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl") #stl = camvtk.STLSurf("../stl/beet_mm.stl") #stl = camvtk.STLSurf("../stl/Blade.stl...
gpl-3.0
spisneha25/django
django/utils/dateformat.py
365
10712
""" PHP date() style date formatting See http://www.php.net/date for format strings Usage: >>> import datetime >>> d = datetime.datetime.now() >>> df = DateFormat(d) >>> print(df.format('jS F Y H:i')) 7th October 2003 11:39 >>> """ from __future__ import unicode_literals import calendar import datetime import re impo...
bsd-3-clause
mfherbst/spack
var/spack/repos/builtin/packages/bwa/package.py
2
2458
############################################################################## # 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
grupoprog3/proyecto_final
Entrega Final/flask/Lib/site-packages/click/_termui_impl.py
64
16377
""" click._termui_impl ~~~~~~~~~~~~~~~~~~ This module contains implementations for the termui module. To keep the import time of Click down, some infrequently used functionality is placed in this module and only imported as needed. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, se...
apache-2.0
crawfordsm/pysalt
lib/saltstat.py
2
7174
################################# LICENSE ################################## # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. # # # # Redistribu...
bsd-3-clause
cybem/graphite-web-iow
webapp/graphite/logger.py
23
3767
"""Copyright 2008 Orbitz WorldWide 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
partizand/bankparser
setup.py
1
3023
#!/usr/bin/python3 """Setup """ #import distutils.cmd import re from setuptools import setup, find_packages # import build # import src.bankparser # class GenFiles(distutils.cmd.Command): # """Генерация некоторых файлов проекта и справки # """ # user_options = [] # description = 'generate .py and rea...
gpl-3.0
tima/ansible
lib/ansible/modules/messaging/rabbitmq_plugin.py
85
4566
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chatham Financial <oss@chathamfinancial.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'...
gpl-3.0
GeotrekCE/Geotrek-admin
geotrek/api/v2/functions.py
2
1450
from django.db.models import Func from django.db.models.fields import FloatField, CharField from django.contrib.gis.db.models import GeometryField, PointField def Transform(geom, srid): """ ST_Transform postgis function """ return Func(geom, srid, function='ST_Transform') def Buffer(geom, radius, nu...
bsd-2-clause
ahmadiga/min_edx
openedx/core/djangoapps/content/course_overviews/management/commands/generate_course_overview.py
29
2115
""" Command to load course overviews. """ import logging from optparse import make_option from django.core.management.base import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.django import modulestore from openedx.core.djangoapps...
agpl-3.0
CloverHealth/airflow
airflow/contrib/kubernetes/kubernetes_request_factory/pod_request_factory.py
1
3983
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
1st/django-social-auth
social_auth/backends/contrib/douban.py
3
2462
""" Douban OAuth support. This adds support for Douban OAuth service. An application must be registered first on douban.com and the settings DOUBAN_CONSUMER_KEY and DOUBAN_CONSUMER_SECRET must be defined with they corresponding values. By default account id is stored in extra_data field, check OAuthBackend c...
bsd-3-clause
sestrella/ansible
test/units/modules/network/ios/ios_module.py
50
2516
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
jordanemedlock/psychtruths
temboo/core/Library/eBay/Trading/GetMemberMessages.py
4
6986
# -*- coding: utf-8 -*- ############################################################################### # # GetMemberMessages # Retrieves a list of the messages that buyers have posted about your active item listings. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache Licen...
apache-2.0
openhatch/oh-mainline
vendor/packages/scrapy/scrapy/http/response/dammit.py
16
11593
""" This module contains a fork of the UnicodeDammit class from BeautifulSoup, that expliclty disabled any usage of chardet library. The UnicodeDammit class is used as a last resource for detecting the encoding of a response. """ import re import codecs chardet = None # we don't want to use chardet since it's very s...
agpl-3.0
fly19890211/edx-platform
docs/en_us/platform_api/source/conf.py
6
7106
# -*- coding: utf-8 -*- # pylint: disable=invalid-name # pylint: disable=redefined-builtin # pylint: disable=protected-access # pylint: disable=unused-argument import os from path import Path as path import sys import mock MOCK_MODULES = [ 'lxml', 'requests', 'xblock', 'fields', 'xblock.fields', ...
agpl-3.0
bjlittle/iris
docs/gallery_code/oceanography/plot_atlantic_profiles.py
2
3317
""" Oceanographic Profiles and T-S Diagrams ======================================= This example demonstrates how to plot vertical profiles of different variables in the same axes, and how to make a scatter plot of two variables. There is an oceanographic theme but the same techniques are equally applicable to atmosph...
lgpl-3.0
davidjb/sqlalchemy
test/engine/test_reflection.py
21
59908
import operator import unicodedata import sqlalchemy as sa from sqlalchemy import schema, events, event, inspect from sqlalchemy import MetaData, Integer, String from sqlalchemy.testing import (ComparesTables, engines, AssertsCompiledSQL, fixtures, skip) from sqlalchemy.testing.schema import Table, Column from sql...
mit
datjwu/rbtools
rbtools/api/errors.py
4
1553
from __future__ import unicode_literals import six class APIError(Exception): def __init__(self, http_status, error_code, rsp=None, *args, **kwargs): Exception.__init__(self, *args, **kwargs) self.http_status = http_status self.error_code = error_code self.rsp = rsp def __str...
mit
shakamunyi/tensorflow
tensorflow/contrib/framework/python/ops/audio_ops.py
80
1186
# Copyright 2017 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
wbond/subversion
tools/dist/release.py
2
22908
#!/usr/bin/env python # # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
rouault/Quantum-GIS
tests/src/python/test_qgsserver_wms_getlegendgraphic.py
4
18330
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer WMS. From build dir, run: ctest -R PyQgsServerWMS -V .. 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 Licen...
gpl-2.0
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/modules/rvm.py
2
11310
# -*- coding: utf-8 -*- ''' Manage ruby installations and gemsets with RVM, the Ruby Version Manager. ''' from __future__ import absolute_import # Import python libs import re import os import logging # Import salt libs import salt.utils from salt.exceptions import CommandExecutionError log = logging.getLogger(__nam...
apache-2.0
dwalton76/ev3dev-lang-python
tests/motor/motor_param_unittest.py
1
24419
#!/usr/bin/env python # Based on the parameterized test case technique described here: # # http://eli.thegreenplace.net/2011/08/02/python-unit-testing-parametrized-test-cases import unittest import time import sys import ev3dev.ev3 as ev3 import parameterizedtestcase as ptc from motor_info import motor_info clas...
mit
janmtl/pypsych
tests/data/generators/eprime.py
1
2106
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Script for generating mock EPrime test data """ import pandas as pd import numpy as np import io pd.set_option('display.max_rows', 50) pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1000) from pypsych.config import Config def generate_mock_...
bsd-3-clause
lbin/nexar-2
lib/utils/visualization.py
1
3989
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Xinlei Chen # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ impor...
mit
liangjiaxing/sympy
sympy/galgebra/stringarrays.py
50
3306
# sympy/galgebra/stringarrays.py """ stringarrays.py are a group of helper functions to convert string input to vector and multivector class function to arrays of SymPy symbols. """ import operator from sympy.core.compatibility import reduce from itertools import combinations from sympy import S, Symbol, Function f...
bsd-3-clause
DXCanas/content-curation
contentcuration/contentcuration/viewsets/channelset.py
1
4021
from django.core.exceptions import PermissionDenied from django.db.models import CharField from django.db.models import Q from rest_framework import serializers from rest_framework.permissions import IsAuthenticated from contentcuration.models import Channel from contentcuration.models import ChannelSet from contentcu...
mit
wemanuel/smry
server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/boto/ec2/elb/securitygroup.py
152
1576
# Copyright (c) 2010 Reza Lotun http://reza.lotun.name # # 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 rights to use, copy, modify, m...
apache-2.0
kargakis/test-infra
gubernator/github/main_test.py
19
5233
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 appli...
apache-2.0
Onirik79/aaritmud
data/proto_rooms/villaggio-zingaro/villaggio-zingaro_room_locanda.py
1
1355
# -*- coding: utf-8 -*- #= DESCRIZIONE ================================================================= """ Inietta una bimba in locanda. """ #= IMPORT ====================================================================== import random from src.database import database from src.defer import defer_random_time...
gpl-2.0
Donkyhotay/MoonPy
zope/security/tests/test_checker.py
1
24043
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
gpl-3.0
listamilton/supermilton.repository
plugin.video.supermiltonflix/lib/keyring/backends/file.py
5
9728
from __future__ import with_statement import abc import base64 import getpass import json import os import sys from ..backend import KeyringBackend from ..errors import PasswordDeleteError from ..py27compat import configparser from ..util import platform_, properties from ..util.escape import escape as escape_for_ini...
gpl-2.0
jay3sh/vispy
examples/basics/scene/isocurve_updates.py
17
4424
# -*- coding: utf-8 -*- # vispy: gallery 30 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------...
bsd-3-clause
hackendless/heekscnc
nc/hpgl3d.py
34
2237
# hpgl3d.py # # Copyright (c) 2009, Dan Heeks # This program is released under the BSD license. See the file COPYING for details. # import nc import hpgl2d import math class Creator(hpgl2d.Creator): def __init__(self): hpgl2d.Creator.__init__(self) self.z = int(0) self.metri...
bsd-3-clause
chauhanhardik/populo
common/lib/xmodule/xmodule/assetstore/__init__.py
124
11966
""" Classes representing asset metadata. """ from datetime import datetime import dateutil.parser import pytz import json from contracts import contract, new_contract from opaque_keys.edx.keys import CourseKey, AssetKey from lxml import etree new_contract('AssetKey', AssetKey) new_contract('CourseKey', CourseKey) ne...
agpl-3.0
michaelpri10/WelcomeBot
google_search.py
2
1336
import urllib2 import json def google_search(search_term): """ Searches for a `search_term` which should be a string or a value convertable to string. Parameters: - str `search_term`: a string to search for Returns a tuple (on success): - first value is a list of search results for t...
mit
snowmantw/AutobahnTestSuite
autobahntestsuite/autobahntestsuite/case/case7_3_2.py
14
1535
############################################################################### ## ## Copyright 2011 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 ## ## ht...
apache-2.0
colemanja91/PyEloqua-Examples
venv/lib/python3.4/site-packages/pkg_resources/_vendor/packaging/requirements.py
454
4355
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pkg_resources.extern.pyparsing import string...
gpl-2.0
dpo/nlpy
nlpy/model/adolcmodel.py
3
9361
from nlpy.model import NLPModel from nlpy.krylov import SimpleLinearOperator import adolc import numpy as np has_colpack = False class AdolcModel(NLPModel): """ A class to represent optimization problems in which derivatives are computed via algorithmic differentiation through ADOL-C. See the documen...
gpl-3.0
pshen/ansible
test/units/mock/yaml_helper.py
209
5267
import io import yaml from ansible.module_utils.six import PY3 from ansible.parsing.yaml.loader import AnsibleLoader from ansible.parsing.yaml.dumper import AnsibleDumper class YamlTestUtils(object): """Mixin class to combine with a unittest.TestCase subclass.""" def _loader(self, stream): """Vault r...
gpl-3.0
c4mb0t/django-setman
testproject/core/migrations/0001_initial.py
2
4372
# 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 model 'UserProfile' db.create_table('core_userprofile', ( ('id', self.gf('django.db.m...
bsd-3-clause
andela-ifageyinbo/django
tests/m2m_intermediary/tests.py
381
1334
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from django.utils import six from .models import Article, Reporter, Writer class M2MIntermediaryTests(TestCase): def test_intermeiary(self): r1 = Reporter.objects.create(first_name="John", last_name="...
bsd-3-clause
sbyoun/i-mapreduce
src/contrib/hod/hodlib/RingMaster/idleJobTracker.py
182
9106
#Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you under the Apache License, Version 2.0 (the #"License"); you may not use thi...
apache-2.0
MichaelVL/osm-analytic-tracker
HumanTime.py
1
2895
import datetime, pytz import re import tzlocal def date2human(when, slack_secs=180): """ Convert timestamp to human-friendly times, like '3 minutes ago' """ if not when: return None now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc) diff = now-when secs = diff.seconds days = diff...
gpl-2.0
apark263/tensorflow
tensorflow/python/kernel_tests/distributions/multinomial_test.py
22
14730
# 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
wikimedia/operations-debs-python-diamond
src/collectors/mongodb/mongodb.py
5
12712
# coding=utf-8 """ Collects all number values from the db.serverStatus() command, other values are ignored. #### Dependencies * pymongo #### Example Configuration MongoDBCollector.conf ``` enabled = True hosts = localhost:27017, alias1@localhost:27018, etc ``` """ import diamond.collector from diamond.c...
mit
DataViva/dataviva-site
dataviva/apps/build_graph/views.py
1
3965
# -*- coding: utf-8 -*- import re from flask import Blueprint, render_template, g, jsonify, request from dataviva.apps.general.views import get_locale from dataviva.apps.embed.models import Build, App from dataviva.api.rais.services import Industry as CnaeService from dataviva.api.secex.services import Product as Secex...
mit
polyaxon/polyaxon-api
polyaxon_lib/polyaxonfile/local_runner.py
1
4049
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import atexit import json import os import signal import subprocess import sys import time from six.moves import xrange from multiprocessing import Process from tensorflow.python.platform import tf_logging as logging from po...
mit
actuaryzhang/spark
examples/src/main/python/ml/dct_example.py
123
1509
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
FreeScienceCommunity/rt-thread
tools/package.py
45
2209
# # File : package.py # This file is part of RT-Thread RTOS # COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team # # 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 ...
gpl-2.0
tomhughes/mapnik
scons/scons-time.py
3
47967
#!/usr/bin/env python # # scons-time - run SCons timings and collect statistics # # A script for running a configuration through SCons with a standard # set of invocations to collect timing and memory statistics and to # capture the results in a consistent set of output files for display # and analysis. # # # Copyrigh...
lgpl-2.1
sagarpabba/robotframework-seleniumlibrary
src/SeleniumLibrary/screenshot.py
9
3763
# Copyright 2008-2011 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
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/vm/_completers.py
9
1524
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
isaac-s/cloudify-manager
rest-service/manager_rest/flask_utils.py
1
3338
######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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
joakim-hove/ert
python/python/ert_gui/tools/export/export_tool.py
4
1955
# Copyright (C) 2014 Statoil ASA, Norway. # # The file 'export_tool.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 Lic...
gpl-3.0
aabbox/kbengine
kbe/res/scripts/common/Lib/rlcompleter.py
100
5763
"""Word completion for GNU readline. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its attributes. It's very cool to do "import sys" type "sys.", hit the com...
lgpl-3.0
Yearcoin-dev/yearcoin
qa/rpc-tests/invalidateblock.py
104
3077
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test InvalidateBlock code # from test_framework.test_framework import BitcoinTestFramework from test...
mit
fafaman/django
django/template/utils.py
308
4736
import os import warnings from collections import Counter, OrderedDict from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache from django.utils._os import upath from django.utils.deprecation import RemovedInDjango110Warni...
bsd-3-clause
huangciyin/youtube-dl
youtube_dl/extractor/rtbf.py
44
1654
# coding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor class RTBFIE(InfoExtractor): _VALID_URL = r'https?://www.rtbf.be/video/[^\?]+\?id=(?P<id>\d+)' _TEST = { 'url': 'https://www.rtbf.be/video/detail_les-diables-au-coeur-episode-2?id=1921274'...
unlicense
forevernull/incubator-airflow
airflow/ti_deps/deps/runnable_exec_date_dep.py
42
1941
# -*- 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
Tecnativa/website
website_event_register_free_with_sale/controllers/website_event.py
28
2630
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # # This program is free software: you can redistribute it a...
agpl-3.0
NoahFlowa/glowing-spoon
venv/lib/python2.7/site-packages/pip/_vendor/__init__.py
329
4670
""" pip._vendor is for vendoring dependencies of pip to prevent needing pip to depend on something external. Files inside of pip._vendor should be considered immutable and should only be updated to versions from upstream. """ from __future__ import absolute_import import glob import os.path import sys # Downstream r...
apache-2.0
sameetb-cuelogic/edx-platform-test
common/djangoapps/course_about/data.py
16
1855
"""Data Aggregation Layer for the Course About API. This is responsible for combining data from the following resources: * CourseDescriptor * CourseAboutDescriptor """ import logging from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from course_about.serializers import serialize_content...
agpl-3.0
sbidoul/odoo
addons/project/__openerp__.py
259
2562
# -*- 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
skalk/linux
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
rh-s/heat
heat_integrationtests/functional/test_hooks.py
3
13215
# 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
dcraft2/dcraft1127-myclone
gui/dialog.py
14
5395
#!/usr/bin/python # -*- coding: utf-8 -*- "Common dialogs (function wrappers for wxPython dialogs)" __author__ = "Mariano Reingart (reingart@gmail.com)" __copyright__ = "Copyright (C) 2013- Mariano Reingart" import wx from wx.lib import dialogs from .font import Font def alert(message, title="", par...
lgpl-3.0
ecdpalma/napscheduler
napscheduler/scheduler.py
1
16056
""" This module is the main part of the library. It houses the Scheduler class and related exceptions. """ from threading import Thread, Event, Lock from datetime import datetime, timedelta from logging import getLogger import os import sys from napscheduler.util import * from napscheduler.triggers import SimpleTrigg...
mit
bukalov/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/queueengine.py
120
6867
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 abov...
bsd-3-clause
Zimbra-Community/python-zimbra
tests/test_request_json.py
3
10019
""" Request tests """ import json from unittest import TestCase from pythonzimbra.request_json import RequestJson from pythonzimbra.exceptions.request import RequestHeaderContextException class TestRequestJson(TestCase): """ Request tests """ request = None """ The request to be tested against """ ...
bsd-2-clause
liulion/mayavi
tvtk/tests/test_indenter.py
2
9233
"""Tests for indenter.py.""" # Author: Prabhu Ramachandran # License: BSD style # Copyright (c) 2004, Enthought, Inc. import unittest import cStringIO from tvtk import indenter class TestIndent(unittest.TestCase): def test_basic(self): """Simple tests for indenter.""" id = indenter.Indent() ...
bsd-3-clause
adit-chandra/tensorflow
tensorflow/lite/tutorials/mnist_tflite.py
5
2870
# 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
Sir-Henry-Curtis/Ironworks
lib/jinja2/testsuite/regression.py
90
7583
# -*- coding: utf-8 -*- """ jinja2.testsuite.regression ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests corner cases and bugs. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Template, Enviro...
mit
vertigo235/Sick-Beard-XEM
cherrypy/_cptools.py
35
19648
"""CherryPy tools. A "tool" is any helper, adapted to CP. Tools are usually designed to be used in a variety of ways (although some may only offer one if they choose): Library calls: All tools are callables that can be used wherever needed. The arguments are straightforward and should b...
gpl-3.0
SetBased/py-etlt
test/helper/AllenTest.py
1
2762
import unittest from etlt.helper.Allen import Allen class AllenTest(unittest.TestCase): """ Test cases for class Allen algebra. """ # ------------------------------------------------------------------------------------------------------------------ def _test1(self, expected, x, y): relat...
mit
nikesh-mahalka/nova
nova/api/openstack/compute/schemas/fixed_ips.py
79
1027
# Copyright 2015 Intel Corporation # 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 require...
apache-2.0
msebire/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/context_i386.py
102
16108
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
apache-2.0
h4ck3rm1k3/pywikibot-core
scripts/maintenance/make_i18n_dict.py
3
5239
#!/usr/bin/python # -*- coding: utf-8 -*- """ Generate a i18n file from a given script. usage: run IDLE at topmost level >>> import pwb >>> from scripts.maintenance.make_i18n_dict import i18nBot >>> bot = i18nBot('<scriptname>', '<msg dict>') >>> bot.run() If you have more than one message dictionary, give all thes...
mit
whereismyjetpack/ansible
lib/ansible/compat/selectors/_selectors2.py
124
24265
# This file is from the selectors2.py package. It backports the PSF Licensed # selectors module from the Python-3.5 stdlib to older versions of Python. # The author, Seth Michael Larson, dual licenses his modifications under the # PSF License and MIT License: # https://github.com/SethMichaelLarson/selectors2#license #...
gpl-3.0
USGSDenverPychron/pychron
pychron/rpc/rpcable.py
1
1606
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
apache-2.0
Johnzero/erp
openerp/addons/base/res/report/__init__.py
79
1201
# -*- 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...
agpl-3.0
vdenPython/wwwgaseng
wwwgaseng/settings.py
1
3071
""" Django settings for wwwgaseng project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
apache-2.0
modicum/wyoming
source/conf.py
1
11524
# -*- coding: utf-8 -*- # # wyoming documentation build configuration file, created by # sphinx-quickstart on Mon Jan 25 11:12:20 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
SlimRemix/android_external_chromium_org
tools/usb_gadget/server.py
91
3886
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """WSGI application to manage a USB gadget. """ import datetime import hashlib import re import subprocess import sys import time import urllib2 from torna...
bsd-3-clause
Shaps/ansible
test/units/inventory/test_group.py
53
5176
# Copyright 2018 Alan Rominger <arominge@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 Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
fnouama/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_has_key.py
326
3227
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for has_key(). Calls to .has_key() methods are expressed in terms of the 'in' operator: d.has_key(k) -> k in d CAVEATS: 1) While the primary target of this fixer is dict.has_key(), the fixer will chan...
apache-2.0
scottdangelo/RemoveVolumeMangerLocks
cinder/volume/drivers/srb.py
2
33438
# Copyright (c) 2014 Scality # # 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...
apache-2.0
vismartltd/edx-platform
lms/djangoapps/shoppingcart/migrations/0024_auto__add_field_courseregistrationcode_mode_slug.py
109
18586
# -*- 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): # Adding field 'CourseRegistrationCode.mode_slug' db.add_column('shoppingcart_courseregistrationcode', 'mode...
agpl-3.0
Lothilius/python-jumble
Permutations.py
1
2071
# Files: Permutations.py # # Description: Creats permutations of an entered word. # __author__ = 'lothilius' import math class Permutations(): """This module contains functions to generate all unique permutations of a string, and to count permutations. """ def countOccurrences(word): # c...
mit
hexlism/xx_net
gae_proxy/local/gae_handler.py
1
28513
#!/usr/bin/env python # coding:utf-8 import errno import time import struct import zlib import functools import re import io import string import socket import ssl import httplib import Queue import urlparse import threading from proxy import xlog from connect_manager import https_manager from appids_manager import ...
bsd-2-clause
sam-tsai/django-old
django/contrib/gis/sitemaps/views.py
20
4249
from django.http import HttpResponse, Http404 from django.template import loader from django.contrib.sites.models import Site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.contrib.gis.db.models.fields import GeometryField from django.db import connections...
bsd-3-clause
ranqingfa/ardupilot
Tools/autotest/autotest.py
1
18485
#!/usr/bin/env python """ APM automatic test suite Andrew Tridgell, October 2011 """ from __future__ import print_function import atexit import fnmatch import glob import optparse import os import shutil import signal import sys import time import traceback import apmrover2 import arducopter import arduplane import ...
gpl-3.0
hainm/scipy
scipy/special/setup.py
77
4626
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import os import sys from os.path import join from distutils.sysconfig import get_python_inc import numpy from numpy.distutils.misc_util import get_numpy_include_dirs try: from numpy.distutils.misc_util import get_info except ...
bsd-3-clause
ergs/transmutagen
transmutagen/origen.py
1
19764
# PYTHON_ARGCOMPLETE_OK import argparse import os from subprocess import run import logging from itertools import combinations import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.linalg import use_solver import tables from pyne.utils import toggle_warnings import warnings toggle_warnings() warni...
bsd-3-clause
artnavsegda/avrnavsegda
xmega/bmp/bmp/src/ASF/common/services/gfx_mono/tools/bitmap.py
73
2301
## # \file # # \brief Output a 2 color bitmap as an uint8_t array # # Copyright (C) 2011-2014 Atmel Corporation. All rights reserved. # # \page License # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributi...
lgpl-3.0
mbareta/edx-platform-ft
lms/djangoapps/courseware/tests/test_module_render.py
8
86350
# -*- coding: utf-8 -*- """ Test for lms courseware app, module render unit """ import ddt import itertools import json from nose.plugins.attrib import attr from functools import partial from bson import ObjectId from django.http import Http404, HttpResponse from django.core.urlresolvers import reverse from django.con...
agpl-3.0
DevOps4Networks/ansible
test/units/playbook/test_play.py
118
3933
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0