repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
paultcochrane/pyvisi
examples/simpleLinePlotMovie.py
1
5232
# Copyright (C) 2004-2008 Paul Cochrane # # 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 is distribut...
gpl-2.0
tuxxy/CloudBot
plugins/wikipedia.py
22
1792
"""Searches wikipedia and returns first sentence of article Scaevolus 2009""" import re import requests from lxml import etree from cloudbot import hook from cloudbot.util import formatting # security parser = etree.XMLParser(resolve_entities=False, no_network=True) api_prefix = "http://en.wikipedia.org/w/api.php" ...
gpl-3.0
lucashmorais/x-Bench
mozmill-env/python/Lib/site-packages/mercurial/httpconnection.py
91
10916
# httpconnection.py - urllib2 handler for new http support # # Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com> # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # Copyright 2011 Google, Inc. # # This software may be used and distribu...
mit
mrshelly/openerp71313
openerp/addons/mail/wizard/__init__.py
438
1075
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Kryz/sentry
src/sentry/templatetags/sentry_react.py
8
1878
from __future__ import absolute_import import sentry from django import template from django.conf import settings from django.core.urlresolvers import reverse from django.utils.html import mark_safe from pkg_resources import parse_version from sentry import features, options from sentry.api.serializers.base import s...
bsd-3-clause
dufferzafar/picard-plugins-testing
plugins/viewvariables/__init__.py
5
4148
# -*- coding: utf-8 -*- PLUGIN_NAME = u'View script variables' PLUGIN_AUTHOR = u'Sophist' PLUGIN_DESCRIPTION = u'''Display a dialog box listing the metadata variables for the track / file.''' PLUGIN_VERSION = '0.5' PLUGIN_API_VERSIONS = ['1.0'] from PyQt4 import QtGui, QtCore try: from picard.util.tags import PRE...
gpl-3.0
tejasnikumbh/ThesisCode
lib/python2.7/site-packages/numpy/distutils/unixccompiler.py
55
4106
""" unixccompiler - can handle very long argument lists for ar. """ from __future__ import division, absolute_import, print_function import os from distutils.errors import DistutilsExecError, CompileError from distutils.unixccompiler import * from numpy.distutils.ccompiler import replace_method from numpy.distutils....
mit
hmgaudecker/econ-project-templates
{{cookiecutter.project_slug}}/.mywaflib/waflib/extras/scala.py
55
3327
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2010 (ita) """ Scala support scalac outputs files a bit where it wants to """ import os from waflib import Task, Utils, Node from waflib.TaskGen import feature, before_method, after_method from waflib.Tools import ccroot ccroot.USELIB_VARS['scalac'] = set(['CLA...
bsd-3-clause
krivenko/pomerol2triqs
test/python/slater_gf.py
1
2761
from h5 import HDFArchive from triqs.gf import * from triqs.operators import * from triqs.operators.util.op_struct import set_operator_structure, get_mkind from triqs.operators.util.U_matrix import U_matrix from triqs.operators.util.hamiltonians import h_int_slater from triqs.operators.util.observables import N_op, S_o...
gpl-3.0
suninsky/ReceiptOCR
Python/server/bin/pilprint.py
1
2635
#!/home/haop/code/ReceiptOCR/Python/server/bin/python2.7 # # The Python Imaging Library. # $Id$ # # print image files to postscript printer # # History: # 0.1 1996-04-20 fl Created # 0.2 1996-10-04 fl Use draft mode when converting. # 0.3 2003-05-06 fl Fixed a typo or two. # from __future__ import print_fu...
mit
shenqicang/openmc
tests/test_statepoint_interval/test_statepoint_interval.py
4
3054
#!/usr/bin/env python import os import glob from subprocess import Popen, STDOUT, PIPE, call import filecmp import glob from optparse import OptionParser parser = OptionParser() parser.add_option('--mpi_exec', dest='mpi_exec', default='') parser.add_option('--mpi_np', dest='mpi_np', default='3') parser.add_option('--...
mit
tudorvio/tempest
tempest/services/network/resources.py
82
5543
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
shinglyu/ns3-h264-svc
src/applications/.waf-1.5.16-e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Tools/msvc.py
6
20977
#! /usr/bin/env python # encoding: utf-8 import os,sys,re,string,optparse import Utils,TaskGen,Runner,Configure,Task,Options from Logs import debug,info,warn,error from TaskGen import after,before,feature from Configure import conftest,conf import ccroot,cc,cxx,ar,winres from libtool import read_la_file import _winreg...
gpl-2.0
jcasner/nupic
src/nupic/data/record_stream.py
39
15221
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/tests/test_install_scripts.py
152
2555
"""Tests for distutils.command.install_scripts.""" import os import unittest from distutils.command.install_scripts import install_scripts from distutils.core import Distribution from distutils.tests import support class InstallScriptsTestCase(support.TempdirManager, support.LoggingSil...
apache-2.0
Shelo/cmdoc
section/views.py
1
4266
from time import strptime from django.contrib.auth.decorators import login_required from django.db.models import F from django.http import JsonResponse from django.shortcuts import redirect, get_object_or_404 from edit import decorators from section import forms, utils, models import edit.models import json @decorato...
mit
google/fhir-examples
py/google/fhir_examples/validation_example.py
1
2786
# # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
josephkirk/PipelineTools
sample/qt_ui.py
1
3109
import maya.cmds as cm import maya.mel as mm import pymel.core as pm try: from PySide2 import QtWidgets, QtCore, QtGui except ImportError: from PySide import QtCore, QtGui QtWidgets = QtGui # Get Maya Main Window mayaMainWindow = pm.ui.Window('MayaWindow').asQtObject() # Wrapper SIGNAL = QtCore.Signal # UI...
bsd-2-clause
BeDjango/intef-openedx
lms/djangoapps/lti_provider/tests/test_outcomes.py
48
18771
""" Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py """ import unittest from django.test import TestCase from lxml import etree from mock import patch, MagicMock, ANY import requests_oauthlib import requests from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator from stud...
agpl-3.0
freakboy3742/django
tests/template_tests/filter_tests/test_wordwrap.py
176
2032
from django.template.defaultfilters import wordwrap from django.test import SimpleTestCase from django.utils.functional import lazystr from django.utils.safestring import mark_safe from ..utils import setup class WordwrapTests(SimpleTestCase): @setup({ 'wordwrap01': '{% autoescape off %}{{ a|wordwrap:"3...
bsd-3-clause
40223133/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/select.py
730
9440
""" borrowed from jython https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py """ #import java.nio.channels.SelectableChannel #import java.nio.channels.SelectionKey #import java.nio.channels.Selector #from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ...
gpl-3.0
lmmsoft/LeetCode
LeetCode-Algorithm/0039. Combination Sum/0039.py
1
1769
from typing import List class Solution1: def combinationSum(self, nums: List[int], target: int) -> List: dp2: dict = {0: [[]]} for n in nums: for i in range(n, target + 1): if (i - n) in dp2: li: list = dp2[i - n] li2 = [l + [n] ...
gpl-2.0
endlessm/chromium-browser
native_client/site_scons/site_tools/naclsdk.py
1
28469
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """NaCl SDK tool SCons.""" from __future__ import print_function import __builtin__ import re import os import shutil import sys...
bsd-3-clause
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/vars/manager.py
1
29075
# (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...
bsd-3-clause
nderituedwin/django-user-accounts
account/utils.py
11
3918
from __future__ import unicode_literals import functools try: from urllib.parse import urlparse, urlunparse except ImportError: # python 2 from urlparse import urlparse, urlunparse from django.core import urlresolvers from django.core.exceptions import SuspiciousOperation from django.http import HttpResponse...
mit
chrislit/abydos
abydos/distance/_rouge_s.py
1
2866
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
Edraak/edx-platform
lms/envs/sauce.py
67
2208
""" This config file extends the test environment configuration so that we can run the lettuce acceptance tests on SauceLabs. """ from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import os PORTS = [ 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001, 3030, 3210, 3333, 4000, 4001, 404...
agpl-3.0
susundberg/arduino-simple-unittest
src/tools/cpp/nonvirtual_dtors.py
2
2101
# 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 or agreed to in writing,...
mit
UserXXX/CuBolt
cubolt/exceptions.py
1
1551
# The MIT License (MIT) # # Copyright (c) 2014-2015 Bjoern Lange # # 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,...
mit
starbucks2010/N915F_kernel_permissive
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
DarrenRainey/volatility
volatility/plugins/linux/flags.py
58
1831
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
cmtm/networkx
networkx/algorithms/reciprocity.py
8
3042
# -*- coding: utf-8 -*- # # Copyright (C) 2015 by # Haochen Wu <wuhaochen42@gmail.com> # All rights reserved. # BSD license. """Algorithms to calculate reciprocity in a directed graph.""" from networkx import NetworkXError from ..utils import not_implemented_for __author__ = """\n""".join(['Haochen Wu <wu...
bsd-3-clause
CT-Data-Collaborative/ctdata-mailchimp
ctdata_mailchimp/migrations/0004_auto__add_field_subscriptionplugin_assign_language.py
2
2971
# -*- 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 'SubscriptionPlugin.assign_language' db.add_column(u'cmsplugin_subscriptionplugin', 'assign_l...
bsd-3-clause
isb-cgc/ISB-CGC-Webapp
bq_data_access/v1/feature_search/mirna.py
1
2416
# # Copyright 2015-2019, Institute for Systems Biology # # 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
adlai/p2pool
SOAPpy/NS.py
289
3724
from __future__ import nested_scopes """ ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (Gregory.R.Warnes@Pfizer.com) # Christopher Blunck (blunck...
gpl-3.0
xyuanmu/XX-Net
python3.8.2/Lib/encodings/cp1140.py
272
13105
""" Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='stri...
bsd-2-clause
hashworks/CouchPotatoServer
libs/tornado/log.py
124
9469
#!/usr/bin/env python # # Copyright 2012 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
gpl-3.0
fmaguire/ete
ete3/tools/phylobuild_lib/workflow/common.py
1
25974
from __future__ import absolute_import from __future__ import print_function # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify...
gpl-3.0
bkeepers/pygments.rb
vendor/pygments-main/external/moin-parser.py
118
3600
# -*- coding: utf-8 -*- """ The Pygments MoinMoin Parser ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a MoinMoin parser plugin that renders source code to HTML via Pygments; you need Pygments 0.7 or newer for this parser to work. To use it, set the options below to match your setup and put this file in ...
mit
40223119/2015cda
static/Brython3.1.1-20150328-091302/Lib/html/entities.py
814
75240
"""HTML character entity references.""" # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1 'Acirc': 0x00c2, # latin capit...
gpl-3.0
arifsetiawan/edx-platform
cms/djangoapps/contentstore/features/course-outline.py
24
4642
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, step from common import * from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module from logging import getLogger logger = getLogger(__name__) @step(u'I have a course with no sections$')...
agpl-3.0
saurvs/servo
tests/wpt/css-tests/css-fonts-3_dev/html/reference/support/fonts/makegsubfonts.py
1616
14125
import os import textwrap from xml.etree import ElementTree from fontTools.ttLib import TTFont, newTable from fontTools.misc.psCharStrings import T2CharString from fontTools.ttLib.tables.otTables import GSUB,\ ScriptList, ScriptRecord, Script, DefaultLangSys,\ FeatureList, FeatureRecord, Feature,\ LookupLi...
mpl-2.0
hbrunn/OCB
addons/account/wizard/account_invoice_refund.py
10
13046
# -*- 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
ARM-software/lisa
external/workload-automation/doc/source/conf.py
4
11132
# -*- coding: utf-8 -*- # Copyright 2018 ARM 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 # WA3 documentation build configuration file. # # Unless required by applicable law or agree...
apache-2.0
thebjorn/pymagic
magicmethods.py
1
4244
# -*- coding: utf-8 -*- """ From http://www.wellho.net/mouth/3002_a-list-of-special-method-and-attribute-names-in-python.html and also http://www.rafekettler.com/magicmethods.html __new__ True constructor - usually wraps __init__ __init__ Object constructor __call__ __getattr__ Handling object attributes [example] an...
lgpl-2.1
JeanKossaifi/scikit-learn
benchmarks/bench_tree.py
297
3617
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
bsd-3-clause
StelixROM/android_kernel_google_msm
scripts/gcc-wrapper.py
473
3422
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain th...
gpl-2.0
ScalaInc/exp-python2-sdk
tests/enterpriceSDKTestScript/RssReader/expmessage.py
1
1524
import exp_sdk import scala5 import scalalib from scalalib import sharedvars scalaVars = sharedvars() scala5.ScalaPlayer.Log('Starting EXP message listen') try: # authentication exp = exp_sdk.start(uuid=scalaVars.uuid, api_key=scalaVars.api_key, host=scalaVars.host) # Wait for a connection. ...
mit
ShownX/incubator-mxnet
tests/python/unittest/test_optimizer.py
1
26312
# 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
atplanet/ansible-modules-extras
database/postgresql/postgresql_ext.py
29
5803
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
sloede/config
vim/vim/AutomaticTexPlugin_12.1/ftplugin/ATP_files/atplib/check_bracket.py
1
21903
#!/usr/bin/env python """ Check if a bracket '(' is closed. Return the (line, col) of a not closed bracket. """ __all__ = [ 'byte_pos', 'line_pos', 'check_bracket_frompos', 'check_bracket' ] DEBUG = False def byte_pos(text, line, col): """ Return position index of (line, col) line is line index, col is colum...
unlicense
shakamunyi/neutron-vrrp
neutron/plugins/ofagent/agent/ports.py
4
2816
# Copyright (C) 2014 VA Linux Systems Japan K.K. # 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 # # ...
apache-2.0
ds-hwang/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
3
27322
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
bsd-3-clause
cherub0526/codecombat
scripts/devSetup/downloader.py
70
1628
from __future__ import print_function __author__ = 'schmatz' from configuration import Configuration import sys if sys.version_info.major < 3: import urllib else: import urllib.request as urllib from dependency import Dependency class Downloader: def __init__(self,dependency): assert isinstance(depe...
mit
xforce/jc3-handling-editor
tools/gyp/test/mac/gyptest-xcode-gcc.py
15
1838
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that xcode-style GCC_... settings are handled properly. """ import TestGyp import os import subprocess import sys def Ignore...
mit
kcrisman/git-trac-command
git_trac/py26_compat.py
1
4359
""" Python 2.6 hacks """ import sys import subprocess ######################################################################################## def check_output(*popenargs, **kwargs): """ Emulation of check_output """ if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it w...
gpl-3.0
jefffohl/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/bezier.py
70
14387
""" A module providing some utility functions regarding bezier path manipulation. """ import numpy as np from math import sqrt from matplotlib.path import Path from operator import xor # some functions def get_intersection(cx1, cy1, cos_t1, sin_t1, cx2, cy2, cos_t2, sin_t2): """ return a...
gpl-3.0
shaunstanislaus/differential-line
main_collapse.py
3
2402
#!/usr/bin/python # -*- coding: utf-8 -*- from numpy import pi, zeros, linspace, cos, sin from numpy.random import random, seed from modules.growth import spawn, spawn_curl NMAX = 10**7 SIZE = 2000 ONE = 1./SIZE STP = ONE*0.01 NEARL = 3*ONE FARL = 150*ONE FREEZE_DISTANCE = ONE*5 PROCS = 4 MID = 0.5 LINEWIDTH = 5....
mit
soltanmm-google/grpc
tools/buildgen/plugins/expand_bin_attrs.py
31
2515
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
minrk/jupyter
docs/source/development_guide/template.py
5
1524
"""A one-line description. A longer description that spans multiple lines. Explain the purpose of the file and provide a short list of the key classes/functions it contains. This is the docstring shown when some does 'import foo;foo?' in IPython, so it should be reasonably useful and informative. """ # Copyright (c)...
bsd-3-clause
mcus/SickRage
sickbeard/providers/scenetime.py
3
6631
# Author: Idan Gutman # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 o...
gpl-3.0
hassaanaliw/flaskbook
app/helpers.py
1
1376
__author__ = 'hassaanaliw' ''' Includes several helper functions for the main app that are used a number of times to avoid using code multiple times. ''' from app.posts.models import Posts from app.user.models import User class Messages(): LOGIN_ERROR_MESSAGE = "Email/Password is Wrong. Please Try Again." L...
mit
Gateworks/platform-external-chromium_org
tools/gdb/gdb_chrome.py
23
10110
# Copyright (c) 2011 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. """GDB support for Chrome types. Add this to your gdb by amending your ~/.gdbinit as follows: python import sys sys.path.insert(0, "/path/to/tools...
bsd-3-clause
lamby/live-studio
contrib/django_extensions/management/commands/export_emails.py
22
4801
from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User, Group from optparse import make_option from sys import stdout from csv import writer FORMATS = [ 'address', 'google', 'outlook', 'linkedin', 'vcard', ] def full_name(first_name, last_nam...
agpl-3.0
jainanisha90/WeVoteServer
support_oppose_deciding/views.py
1
6621
# support_oppose_deciding/views.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.http import JsonResponse from django_user_agents.utils import get_user_agent from position.models import PositionManager from voter.models import fetch_voter_id_from_voter_device_link import wevote_functions.ad...
mit
pbrazdil/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/rebaselineserver.py
127
4570
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
olivierdalang/stdm
data/pg_utils.py
1
14720
""" /*************************************************************************** Name : PostgreSQL/PostGIS util functions Description : Contains generic util functions for accessing the PostgreSQL/PostGIS STDM database. Date : 1/April/2014 copyright...
gpl-2.0
auduny/home-assistant
tests/helpers/test_intent.py
8
1499
"""Tests for the intent helpers.""" import unittest import voluptuous as vol from homeassistant.core import State from homeassistant.helpers import (intent, config_validation as cv) import pytest class MockIntentHandler(intent.IntentHandler): """Provide a mock intent handler.""" def __init__(self, slot_sch...
apache-2.0
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/django/core/servers/basehttp.py
62
6111
""" HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE! """ from __f...
mit
fabiking/plugin.video.Mfabiking
resources/tools/resolvers.py
1
77059
# -*- coding: utf-8 -*- #------------------------------------------------------------ # PalcoTV (juarrox@gmail.com) # Conectores multimedia para PalcoTV #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Gracias a las librerías de pelisalacarta de J...
gpl-2.0
vitaly4uk/django
tests/defer_regress/tests.py
269
12479
from __future__ import unicode_literals from operator import attrgetter from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore from django.db.models import Count from django.db.models.query_utils import ( DeferredAttribu...
bsd-3-clause
LinusU/ansible
lib/ansible/executor/task_queue_manager.py
52
9846
# (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
forseti-security/forseti-security
tests/services/api_tests/inventory_test.py
1
6154
# Copyright 2017 The Forseti Security 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 ap...
apache-2.0
cga-harvard/worldmap
wm_extra/accounts/views.py
1
11290
from __future__ import unicode_literals from django.contrib.auth.models import Group from django.http import Http404, HttpResponseForbidden from django.shortcuts import redirect, get_object_or_404 from django.utils.http import base36_to_int, int_to_base36 from django.views.generic.base import TemplateResponseMixin, Vie...
gpl-3.0
sanethd/device-cloud-appliances
DigitalDisplay/modules/colorstreamhandler.py
5
3827
#!/usr/bin/env python # encoding: utf-8 import logging # now we patch Python code to add color support to logging.StreamHandler def add_coloring_to_emit_windows(fn): # add methods we need to the class def _out_handle(self): import ctypes return ctypes.windll.kernel32.GetStdHandle(self.STD_OU...
apache-2.0
jswrenn/xtreemfs
cpp/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/type_checkers.py
527
12163
# 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
ktritz/vispy
vispy/scene/cameras/turntable.py
20
5029
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from .perspective import Base3DRotationCamera class TurntableCamera(Base3DRotationCamera): """ 3D camera class that ...
bsd-3-clause
smunaut/gnuradio
gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
223
6551
# # Copyright 2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
hsaputra/tensorflow
tensorflow/python/kernel_tests/sparse_add_op_test.py
80
9362
# 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
farodin91/servo
tests/wpt/update/tree.py
167
6560
# 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/. import re import tempfile from wptrunner import update as wptupdate from wptrunner.update.tree import Commit, CommitMe...
mpl-2.0
danielvdende/incubator-airflow
tests/ti_deps/deps/test_not_running_dep.py
15
1506
# -*- coding: utf-8 -*- # # 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
rakeshmi/tempest
tempest/api/object_storage/test_object_formpost_negative.py
15
5117
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
40223136/20150616test1
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/color.py
603
4330
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
gpl-3.0
DazWorrall/ansible
lib/ansible/modules/cloud/cloudstack/cs_account.py
33
10806
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.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 Lice...
gpl-3.0
KMK-ONLINE/ansible
lib/ansible/utils/module_docs.py
20
5467
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () 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...
gpl-3.0
keen99/SickRage
lib/hachoir_core/field/link.py
95
3176
from hachoir_core.field import Field, FieldSet, ParserError, Bytes, MissingField from hachoir_core.stream import FragmentedStream class Link(Field): def __init__(self, parent, name, *args, **kw): Field.__init__(self, parent, name, 0, *args, **kw) def hasValue(self): return True def creat...
gpl-3.0
jamesbulpin/xcp-xen-4.1
tools/python/logging/logging-0.4.9.2/test/log_test12.py
42
1951
#!/usr/bin/env python # # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright n...
gpl-2.0
40423109/2017springcd_hw
plugin/summary/summary.py
317
2852
""" Summary ------- This plugin allows easy, variable length summaries directly embedded into the body of your articles. """ from __future__ import unicode_literals from pelican import signals from pelican.generators import ArticlesGenerator, StaticGenerator, PagesGenerator def initialized(pelican): from pelican...
agpl-3.0
dsemi/Flexget
flexget/webserver.py
2
7364
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin import hashlib import logging import random import socket import threading import cherrypy import safe from flask import Flask, abort, redirect from flask_login import UserMixi...
mit
martinspeleo/dicomlayers
src/dicom/test/test_filewriter.py
4
8121
# test_filewriter.py """unittest cases for dicom.filewriter module""" # Copyright (c) 2008-2012 Darcy Mason # This file is part of pydicom, released under a modified MIT license. # See the file license.txt included with this distribution, also # available at http://pydicom.googlecode.com import sys import os.pat...
gpl-2.0
mwiebe/numpy
numpy/linalg/__init__.py
84
2343
""" Core Linear Algebra Tools ========================= =============== ========================================================== Linear algebra basics ========================================================================== norm Vector or matrix norm inv Inverse of a square matrix solve ...
bsd-3-clause
gregorschatz/pymodbus3
examples/functional/base_runner.py
3
3135
import os import time from subprocess import Popen as execute from twisted.internet.defer import Deferred #---------------------------------------------------------------------------# # configure the client logging #---------------------------------------------------------------------------# import logging log = log...
bsd-3-clause
cchurch/ansible
lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py
5
17494
#!/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
sparkslabs/kamaelia_
Code/Python/Kamaelia/Tools/DocGen/TestSuiteRun.py
9
10078
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
apache-2.0
colinnewell/odoo
openerp/report/render/simple.py
324
3152
# -*- 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
devs4v/devs4v-information-retrieval15
project/venv/lib/python2.7/site-packages/django/conf/locale/it/formats.py
115
2079
# -*- 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 = 'd F Y' # 25 Ottobre 2006 TIME_FO...
mit
lpsinger/astropy
astropy/utils/console.py
2
35859
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Utilities for console input and output. """ import codecs import locale import re import math import multiprocessing import os import struct import sys import threading import time from concurrent.futures import ProcessPoolExec...
bsd-3-clause
whitepyro/debian_server_setup
lib/chardet/euctwprober.py
2994
1676
######################## 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...
gpl-3.0
artmusic0/theano-learning.part02
fixed_official_convolutional_v3(pickle_out_best_W&B)/code/DBN.py
31
17088
""" """ import os import sys import timeit import numpy import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams from logistic_sgd import LogisticRegression, load_data from mlp import HiddenLayer from rbm import RBM # start-snippet-1 class DBN(object): """Deep Belief Network...
gpl-3.0
josepht/snapcraft
integration_tests/test_after.py
2
3073
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2017 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0