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
freeflightsim/fg-flying-club
google_appengine/lib/django/django/newforms/util.py
32
2624
from django.conf import settings from django.utils.html import escape # Converts a dictionary to a single string with key="value", XML-style with # a leading space. Assumes keys do not need to be XML-escaped. flatatt = lambda attrs: u''.join([u' %s="%s"' % (k, escape(v)) for k, v in attrs.items()]) def smart_unicode(...
gpl-2.0
umbraclet16/ardupilot
mk/VRBRAIN/Tools/genmsg/src/genmsg/gentools.py
51
6819
#! /usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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 ...
gpl-3.0
ssssam/ansible-modules-core
packaging/language/easy_install.py
73
6261
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # # 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...
gpl-3.0
NetApp/cinder
cinder/volume/drivers/nexenta/ns5/jsonrpc.py
5
3097
# Copyright 2011 Nexenta Systems, 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 req...
apache-2.0
svn2github/gyp
pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
bsd-3-clause
bliti/django-nonrel-1.5
tests/regressiontests/templates/filters.py
52
30861
# coding: utf-8 """ Tests for template filters (as opposed to template tags). The tests are hidden inside a function so that things like timestamps and timezones are only evaluated at the moment of execution and will therefore be consistent. """ from __future__ import unicode_literals from datetime import date, datet...
bsd-3-clause
bitmagnet/mehcoin
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
ybellavance/python-for-android
python3-alpha/python3-src/Lib/test/test_site.py
49
16063
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest from test.support import run_unittest, TESTFN, EnvironmentVarGuard from test.support import captured_stderr import builtins import os import sys import re import encoding...
apache-2.0
paramsingh/listenbrainz-server
listenbrainz/tests/integration/test_api.py
1
19685
import sys import os import uuid from listenbrainz.tests.integration import IntegrationTestCase from flask import url_for from redis import Redis import listenbrainz.db.user as db_user import time import json from listenbrainz.webserver.views.api_tools import is_valid_uuid class APITestCase(IntegrationTestCase): ...
gpl-2.0
krmahadevan/selenium
py/test/selenium/webdriver/chrome/chrome_network_emulation_tests.py
29
1252
# 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
nicolas-petit/website
website_no_crawler/__init__.py
26
1025
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 B-Informed (<http://www.b-informed.nl>). # Author: Roel Adriaans # # This program is free software: you can redistribute it a...
agpl-3.0
shubhdev/openedx
common/djangoapps/terrain/stubs/youtube.py
39
6111
""" Stub implementation of YouTube for acceptance tests. To start this stub server on its own from Vagrant: 1.) Locally, modify your Vagrantfile so that it contains: config.vm.network :forwarded_port, guest: 8031, host: 8031 2.) From within Vagrant dev environment do: cd common/djangoapps/terrain pyth...
agpl-3.0
nchursin/json2apex
helpers/pyyaml/reader.py
272
6854
# This module contains abstractions for the input stream. You don't have to # looks further, there are no pretty code. # # We define two classes here. # # Mark(source, line, column) # It's just a record and its only use is producing nice error messages. # Parser does not use it for any other purposes. # # Reader(so...
apache-2.0
beni55/django
django/core/mail/backends/console.py
696
1477
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend from django.utils import six class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream',...
bsd-3-clause
bswartz/manila
manila/tests/share/drivers/netapp/dataontap/client/fakes.py
1
86084
# Copyright (c) 2015 Clinton Knight. 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 requir...
apache-2.0
ashleyjune/SM-G360T1_kernel
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
domibarton/ansible
lib/ansible/playbook/taggable.py
23
3293
# (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
drkitty/arim
arim/udm.py
2
6265
from hashlib import md5 from string import hexdigits from time import time import urllib2 from django.conf import settings from arim.conrad import Conrad from arim.constants import ( API_KEY, BASE_URL, CTNR_ENDPOINT, USER_QUERY_KEY, SYSTEM_ENDPOINT, DESC_ATTR, SYSTEM_QUERY_KEY, DYNINTR_ENDPOINT, USER_ATTR, SY...
bsd-3-clause
Drvanon/Game
venv/lib/python3.3/site-packages/sqlalchemy/engine/interfaces.py
11
29197
# engine/interfaces.py # Copyright (C) 2005-2013 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 """Define core interfaces used by the engine system.""" from .. import util, eve...
apache-2.0
fitermay/intellij-community
python/lib/Lib/compiler/misc.py
100
1806
def flatten(tup): elts = [] for elt in tup: if isinstance(elt, tuple): elts = elts + flatten(elt) else: elts.append(elt) return elts class Set: def __init__(self): self.elts = {} def __len__(self): return len(self.elts) def __contains__(s...
apache-2.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/jupyter_client/client.py
5
15619
"""Base class to manage the interaction with a running kernel""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import from jupyter_client.channels import major_protocol_version from ipython_genutils.py3compat import string_types, i...
apache-2.0
tseaver/google-cloud-python
recommender/google/cloud/recommender_v1beta1/proto/recommender_service_pb2.py
2
35581
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/recommender_v1beta1/proto/recommender_service.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.pr...
apache-2.0
roadmapper/ansible
test/units/modules/network/fortios/test_fortios_spamfilter_iptrust.py
21
7959
# Copyright 2019 Fortinet, 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 later version. # # This program is distributed in the...
gpl-3.0
epeios-q37/epeios
other/exercises/Hangman/workshop/en/k.py
1
1311
# coding: utf-8 """ MIT License Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49) 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 limit...
agpl-3.0
saurabh6790/pow-app
buying/doctype/quality_inspection/quality_inspection.py
30
2040
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.model.doc import addchild class DocType: def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = docl...
agpl-3.0
ioam/svn-history
topo/misc/inlinec.py
1
10466
""" Interface class for inline C/C++ functions. Based on the SciPy Weave package. Weave (from SciPy) allows programmers to implement Python methods or functions using C code written as a string in the Python file. This is generally done to speed up code that would be slow if written directly in Python. Because not ...
bsd-3-clause
agriffis/django-allauth
allauth/account/templatetags/account.py
43
1159
from django import template from allauth.account.utils import user_display register = template.Library() class UserDisplayNode(template.Node): def __init__(self, user, as_var=None): self.user_var = template.Variable(user) self.as_var = as_var def render(self, context): user = self....
mit
Lh4cKg/sl4a
python/src/Lib/bsddb/test/test_dbshelve.py
33
11290
""" TestCases for checking dbShelve objects. """ import os, string import random import unittest from test_all import db, dbshelve, test_support, verbose, \ get_new_environment_path, get_new_database_path #---------------------------------------------------------------------- # We want the objects to be ...
apache-2.0
EduPepperPD/pepper2013
lms/djangoapps/courseware/mock_xqueue_server/test_mock_xqueue_server.py
3
3099
import mock import unittest import threading import json import urllib import time from mock_xqueue_server import MockXQueueServer, MockXQueueRequestHandler from nose.plugins.skip import SkipTest class MockXQueueServerTest(unittest.TestCase): ''' A mock version of the XQueue server that listens on a local ...
agpl-3.0
yuvadm/rhizi
src/server-tests/test_db_controller.py
4
15290
# This file is part of rhizi, a collaborative knowledge graph editor. # Copyright (C) 2014-2015 Rhizi # # 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 Free Software Foundation, either version 3 of...
agpl-3.0
chaen/DIRAC
Resources/Catalog/ConditionPlugins/FilenamePlugin.py
4
1394
""" Defines the plugin to perform evaluation on the lfn name """ __RCSID__ = "$Id $" from DIRAC.Resources.Catalog.ConditionPlugins.FCConditionBasePlugin import FCConditionBasePlugin class FilenamePlugin( FCConditionBasePlugin ): """ This plugin is to be used when filtering based on the LFN name """ def...
gpl-3.0
mezz64/home-assistant
tests/components/ovo_energy/test_config_flow.py
2
3180
"""Test the OVO Energy config flow.""" import aiohttp from homeassistant import config_entries, data_entry_flow from homeassistant.components.ovo_energy.const import DOMAIN from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.core import HomeAssistant from tests.async_mock import patch FIX...
apache-2.0
code4bones/androguard
tools/permissions/extract_api_permission_mappings.py
14
9326
#!/usr/bin/env python # This file is part of Androguard. # # This is a tool to extract permissions and permission groups from Android Open Source Project. # The information about the permissions and permission groups is appended to a file, which is # later used in Androguard project. # # Author: Yury Zhauniarovich #...
apache-2.0
davislidaqing/Mcoderadius
toughradius/console/admin/online_stat.py
5
2448
#!/usr/bin/env python # coding:utf-8 from bottle import Bottle from bottle import request from bottle import response from bottle import redirect from bottle import static_file from bottle import mako_template as render from tablib import Dataset from toughradius.console.websock import websock from toughradius.console...
agpl-3.0
ltucker/giblets
giblets/policy.py
1
3816
import fnmatch import re from giblets.core import _component_id __all__ = ['Blacklist', 'Whitelist', 'Patterns'] class Blacklist(object): """ policy that activates all Components that have not been specifically disabled. """ def __init__(self): self.blacklist = set() def enable_comp...
bsd-3-clause
fernandog/Medusa
ext/feedparser/html.py
43
7922
from __future__ import absolute_import, unicode_literals import re try: from html.entities import name2codepoint except ImportError: from htmlentitydefs import name2codepoint from .sgml import * _cp1252 = { 128: '\u20ac', # euro sign 130: '\u201a', # single low-9 quotation mark 131: '\u0192', # ...
gpl-3.0
gregkcarson/sapmdbret
sapmdbret.py
1
6385
import sys import socket import random import getopt from optparse import OptionParser from scapy.all import * import os import signal from time import sleep, ctime def main(): print " ^^ just ignore that :) " print print "***************************************************************************" ...
gpl-2.0
jinzishuai/learn2deeplearn
deeplearning.ai/C2.ImproveDeepNN/week3/tensorflow_assignment/tf_utils.py
5
4710
import h5py import numpy as np import tensorflow as tf import math def load_dataset(): train_dataset = h5py.File('datasets/train_signs.h5', "r") train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train s...
gpl-3.0
roadmapper/ansible
test/integration/targets/want_json_modules_posix/library/helloworld.py
62
1047
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
servo-highfive/highfive
highfive/event_handlers/pull_request/path_watcher_notifier/__init__.py
2
1385
from ... import EventHandler import re class PathWatcherNotifier(EventHandler): '''Checks the paths in PR diff and notifies the watchers of those paths (if any).''' def on_issue_open(self): config = self.get_matched_subconfig() if not (config and self.api.is_pull): return ...
mpl-2.0
miiicmueller/android_kernel_raspberryPi_rpiv2
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
koditraquinas/koditraquinas.repository
plugin.video.traquinas/resources/lib/libraries/simpledownloader.py
22
7995
''' Simple XBMC Download Script Copyright (C) 2013 Sean Poyser (seanpoyser@gmail.com) 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 y...
gpl-2.0
alanjw/GreenOpenERP-Win-X86
openerp/addons/sale_crm/report/sales_crm_account_invoice_report.py
103
1614
# -*- 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
hacklab-fi/hhlevents
hhlevents/apps/hhlregistrations/migrations/0003_auto_20150411_1919.py
3
1300
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('hhlregistrations', '0002_auto_20150411_1912'), ] operations = [ migrations.AddField( model_name='event', ...
bsd-3-clause
DrDub/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/wordnet/synset.py
9
25090
# Natural Language Toolkit: Wordnet Interface: Wordnet Module # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Oliver Steele <steele@osteele.com> # David Ormiston Smith <daosmith@csse.unimelb.edu.au>> # Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license inform...
gpl-3.0
ptemplier/ansible
lib/ansible/modules/monitoring/zabbix_host.py
11
22176
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # 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', ...
gpl-3.0
nanolearning/edx-platform
common/xml_cleanup.py
67
3431
#!/usr/bin/env python """ Victor's xml cleanup script. A big pile of useful hacks. Do not use without carefully reading the code and deciding that this is what you want. In particular, the remove-meta option is only intended to be used after pulling out a policy using the metadata_to_json management command. """ i...
agpl-3.0
kwlzn/pants
contrib/node/src/python/pants/contrib/node/targets/node_preinstalled_module.py
18
1883
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.payl...
apache-2.0
mbareta/edx-platform-ft
openedx/core/djangoapps/course_groups/tests/test_cohorts.py
11
33670
""" Tests for cohorts """ # pylint: disable=no-member import ddt from mock import call, patch from nose.plugins.attrib import attr import before_after from django.contrib.auth.models import User from django.db import IntegrityError from django.http import Http404 from django.test import TestCase from opaque_keys.edx....
agpl-3.0
kashif/scikit-learn
examples/linear_model/plot_sgd_loss_functions.py
73
1232
""" ========================== SGD: convex loss functions ========================== A plot that compares the various convex loss functions supported by :class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z ...
bsd-3-clause
brianjmiller/TinCanPython
test/typedlist_test.py
2
1028
# Copyright 2014 Rustici Software # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
lmazuel/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_location.py
39
6774
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
aam-at/tensorflow
tensorflow/python/training/proximal_adagrad.py
21
5744
# Copyright 2015 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
daviddeng/azrael
pyassimp/postprocess.py
47
23509
# <hr>Calculates the tangents and bitangents for the imported meshes. # # Does nothing if a mesh does not have normals. You might want this post # processing step to be executed if you plan to use tangent space calculations # such as normal mapping applied to the meshes. There's a config setting, # <tt>#AI_CONFIG_P...
agpl-3.0
sabi0/intellij-community
python/testData/MockSdk2.7/python_stubs/exceptions.py
27
24263
# encoding: utf-8 # module exceptions # from (built-in) # by generator 1.138 """ Python's standard exception class hierarchy. Exceptions found here are defined both in the exceptions module and the built-in namespace. It is recommended that user-defined exceptions inherit from Exception. See the documentation for th...
apache-2.0
shobhitmittal/textract
tests/run.py
7
1076
#!/usr/bin/env python """Run the test suite that is specified in the .travis.yml file """ import os import subprocess import yaml from textract.colors import green, red root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def run_test(command): wrapped_command = "cd %s && %s" % (root_dir, com...
mit
cleverpiggy/pokyr
setup.py
1
1383
""" Poker hand evaluating modules that provide fast enumerations. Both C Extension module it's pure python analogies are included. """ from distutils.core import setup, Extension import os if not os.path.exists(os.path.join("src", "cpokertables.h")): from poker import poker_lite poker_lite.write_ctables(os.p...
gpl-3.0
wwj718/edx-platform
cms/djangoapps/contentstore/views/component.py
4
14215
from __future__ import absolute_import import logging from django.http import HttpResponseBadRequest, Http404 from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_GET from django.core.exceptions import PermissionDenied from django.conf import settings from opaque_...
agpl-3.0
GdZ/scriptfile
software/googleAppEngine/google/appengine/api/rdbms_mysqldb.py
5
2957
#!/usr/bin/env python # # Copyright 2007 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...
mit
yask123/django
django/core/management/commands/startapp.py
513
1040
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand class Command(TemplateCommand): help = ("Creates a Django app directory structure for the given app " "name in the current directory or optionally in t...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/tests/frame/test_axis_select_reindex.py
1
44950
# -*- coding: utf-8 -*- from __future__ import print_function from datetime import datetime import numpy as np import pytest from pandas.compat import lrange, lzip, u from pandas.errors import PerformanceWarning import pandas as pd from pandas import ( Categorical, DataFrame, Index, MultiIndex, Series, compat,...
bsd-3-clause
d/hamster-applet
src/docky_control/2.0/hamster_control.py
1
3556
#!/usr/bin/env python # # Copyright (C) 2010 Toms Baugis # # Original code from Banshee control, # Copyright (C) 2009-2010 Jason Smith, Rico Tzschichholz # # 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 Soft...
gpl-3.0
uperetz/AstroTools
lc.py
1
3601
#Object for handling numerical functions from plotInt import Iplot from re import split class lightCurve: x = 0 y = 1 dy = 2 class lcOutOfBound(Exception): pass def __init__(self,table = []): self.table = [] try: for line in open(table): try: ...
apache-2.0
tkdchen/Nitrate
src/tests/xmlrpc/test_testplan.py
2
18477
# -*- coding: utf-8 -*- import unittest from django import test from tcms.testcases.models import TestCase from tcms.testcases.models import TestCasePlan from tcms.testplans.models import TCMSEnvPlanMap, TestPlan, TestPlanType from tcms.xmlrpc.api import testplan as XmlrpcTestPlan from tcms.xmlrpc.api.testplan impor...
gpl-2.0
alok760/Algorithms_Example
Dijkstra's/Python/Dijakstra.py
9
3333
def Dijkstra(G, start, end=None): """ Find shortest paths from the start vertex to all vertices nearer than or equal to the end. The input graph G is assumed to have the following representation: A vertex can be any object that can be used as an index into a dictionary. G is a dictionary, inde...
apache-2.0
aparo/django-nonrel
django/contrib/admindocs/views.py
14
15302
from django import template, templatetags from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_response from django.core.exceptions import ImproperlyConfigur...
bsd-3-clause
flyapen/UgFlu
flumotion/common/poller.py
2
4013
# -*- Mode: Python; test-case-name: flumotion.test.test_common -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Pub...
gpl-2.0
baixuexue123/note
python/concurrency/process_threads.py
1
2227
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import threading import multiprocessing import datetime import time class WriteFileWorker(multiprocessing.Process): def __init__(self, queue, name=None): super(WriteFileWorker, self).__init__(name=name) self.daemo...
bsd-2-clause
Mirantis/mos-horizon
horizon/site_urls.py
7
1659
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
jmehnle/ansible
lib/ansible/modules/network/fortios/fortios_config.py
50
5677
#!/usr/bin/python # # Ansible module to manage configuration on fortios devices # (c) 2016, Benjamin Jolivot <bjolivot@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 Softwar...
gpl-3.0
ryfeus/lambda-packs
Tensorflow_OpenCV_Nightly/source/tensorflow/python/debug/lib/stepper.py
61
35351
# 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...
mit
maxence-diblasi/www.tropeesdeleau.fr
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
45
99890
# Copyright (c) 2013 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 collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
mit
jacquesd/indico
indico/modules/vc/notifications.py
2
2446
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
mavit/ansible
lib/ansible/modules/net_tools/nios/nios_dns_view.py
12
4187
#!/usr/bin/python # Copyright (c) 2018 Red Hat, Inc. # 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': ['preview...
gpl-3.0
czgu/opendataexperience
server/api/views/query.py
1
1608
from django.forms.models import model_to_dict from django.http import JsonResponse from django.http import Http404 from api.models import DetailedFoodNutritions from api.models import FoodCategory from api.models import FoodCategorySpec def food_handler(request): if request.method != 'GET': return JsonRe...
apache-2.0
camilonos77/bootstrap-form-python-generator
enviroment/lib/python2.7/site-packages/pip/download.py
328
22580
import cgi import email.utils import hashlib import getpass import mimetypes import os import platform import re import shutil import sys import tempfile import pip from pip.backwardcompat import urllib, urlparse, raw_input from pip.exceptions import InstallationError, HashMismatch from pip.util import (splitext, rmt...
gpl-2.0
sjlehtin/django
tests/forms_tests/widget_tests/test_selectmultiple.py
38
5366
from django.forms import SelectMultiple from .base import WidgetTest class SelectMultipleTest(WidgetTest): widget = SelectMultiple numeric_choices = (('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('0', 'extra')) def test_format_value(self): widget = self.widget(choices=self.numeric_choices) ...
bsd-3-clause
cm-a7lte/device_samsung_a7lte
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
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyQt4/QtGui/QToolBar.py
2
6912
# encoding: utf-8 # module PyQt4.QtGui # from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so # by generator 1.135 # no doc # imports import PyQt4.QtCore as __PyQt4_QtCore from QWidget import QWidget class QToolBar(QWidget): """ QToolBar(QString, QWidget parent=None) QToolBar(QWidget parent=None) ""...
gpl-2.0
mewtaylor/django
tests/model_meta/models.py
192
5039
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models class Relation(models.Model): pass class AbstractPerson(models.Model): # DATA fields data_abstract = models.CharField(max_len...
bsd-3-clause
PaddlePaddle/Paddle
python/paddle/dataset/wmt16.py
1
13611
# Copyright (c) 2016 PaddlePaddle 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 applic...
apache-2.0
40223105/w16b_test
static/Brython3.1.1-20150328-091302/Lib/importlib/abc.py
743
14595
"""Abstract base classes related to import.""" from . import _bootstrap from . import machinery try: import _frozen_importlib except ImportError as exc: if exc.name != '_frozen_importlib': raise _frozen_importlib = None import abc import imp import marshal import sys import tokenize import warnings ...
gpl-3.0
stuarteberg/lazyflow
tests/testOpRawBinaryFileReader.py
1
2714
############################################################################### # lazyflow: data flow based lazy parallel computation framework # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/o...
lgpl-3.0
eezee-it/account-invoicing
account_invoice_merge_purchase/tests/test_account_invoice_merge_purchase.py
3
8037
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of account_invoice_merge_purchase, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_invoice_merge_purchase is free software: # you can re...
agpl-3.0
fau-fablab/FabLabKasse
FabLabKasse/UI/LoadFromMobileAppDialogCode.py
1
3567
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # # FabLabKasse, a Point-of-Sale Software for FabLabs and other public and trust-based workshops. # Copyright (C) 2015 Julian Hammer <julian.hammer@fablab.fau.de> # Maximilian Gaukler <max@fablab.fau.de> # Timo Voigt <timo@fablab....
gpl-3.0
jeckersb/Proton
proton-j/src/main/resources/cengine.py
2
28835
# # 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...
apache-2.0
ShiYw/Sigil
3rdparty/python/Lib/test/test_linecache.py
107
4133
""" Tests for the linecache module """ import linecache import unittest import os.path from test import support FILENAME = linecache.__file__ INVALID_NAME = '!@$)(!@#_1' EMPTY = '' TESTS = 'inspect_fodder inspect_fodder2 mapping_tests' TESTS = TESTS.split() TEST_PATH = os.path.dirname(__file__) MODULES = "linecache ...
gpl-3.0
ssaeger/scikit-learn
examples/bicluster/bicluster_newsgroups.py
142
7183
""" ================================================================ Biclustering documents with the Spectral Co-clustering algorithm ================================================================ This example demonstrates the Spectral Co-clustering algorithm on the twenty newsgroups dataset. The 'comp.os.ms-windows...
bsd-3-clause
nugget/home-assistant
homeassistant/components/tesla/climate.py
2
3315
"""Support for Tesla HVAC system.""" import logging from homeassistant.components.climate import ClimateDevice, ENTITY_ID_FORMAT from homeassistant.components.climate.const import ( SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE) from homeassistant.components.tesla import DOMAIN as TESLA_DOMAIN from homeassist...
apache-2.0
frocentus/offenewahlen-nrw17
src/viz/views.py
1
3312
import json import csv import os from django.conf import settings from django.core import serializers from django.core.cache import cache from django.http import HttpResponse, JsonResponse, FileResponse from django.shortcuts import render from django.template import loader from django.template.context_processors import...
mit
Jutarul/ppcoin-tournament
src/share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
jymannob/CouchPotatoServer
couchpotato/core/plugins/renamer.py
4
69077
import fnmatch import os import re import shutil import time import traceback from couchpotato import get_db from couchpotato.api import addApiView from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode, ss, sp from couchpotato.core.helpers.variab...
gpl-3.0
dennis-sheil/commandergenius
project/jni/python/src/Demo/curses/xmas.py
34
25499
# asciixmas # December 1989 Larry Bartz Indianapolis, IN # # $Id: xmas.py 46623 2006-06-03 22:59:23Z andrew.kuchling $ # # I'm dreaming of an ascii character-based monochrome Christmas, # Just like the ones I used to know! # Via a full duplex communications channel, # At 9600 bits per second, # Ev...
lgpl-2.1
yukisakurai/hhana
statstools/tests/test_finalfit_uncerband_plot.py
5
2790
from array import array import rootpy import ROOT rootpy.log.basic_config_colorized() from rootpy.io import root_open from rootpy.plotting import Canvas,Graph from rootpy.plotting import set_style from statstools.finalfit_uncertband_plot import getPostFitPlottingObjects from statstools.finalfit_uncertband_plot import ...
gpl-3.0
simmetria/sentry
src/sentry/permissions.py
2
4737
""" sentry.permissions ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from functools import wraps from sentry.conf import settings from sentry.constants import MEMBER_OWNER from sentry.plugins import plugins def perm_ove...
bsd-3-clause
ar45/django
tests/messages_tests/test_api.py
337
1453
from django.contrib import messages from django.test import RequestFactory, SimpleTestCase class DummyStorage(object): """ dummy message-store to test the api methods """ def __init__(self): self.store = [] def add(self, level, message, extra_tags=''): self.store.append(message) ...
bsd-3-clause
varunagrawal/azure-services
varunagrawal/site-packages/django/contrib/comments/moderation.py
95
13544
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
gpl-2.0
Leatherface75/xbmc
lib/libUPnP/Neptune/Build/Tools/SCons/gcc-generic.py
199
1249
import os def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None): if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning'] ### compiler flags if gcc_strict: env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long']) ...
gpl-2.0
jtopjian/st2
st2common/st2common/models/system/common.py
13
3366
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
codekaki/odoo
addons/point_of_sale/wizard/pos_details.py
55
2439
# -*- 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