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
ioana-delaney/spark
dev/pip-sanity-check.py
80
1384
# # 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
ScreamingUdder/mantid
scripts/HFIRPowderReduction/HfirPDReductionGUI.py
1
91448
# pylint: disable=invalid-name, relative-import, too-many-lines,too-many-instance-attributes,too-many-arguments,C901 ################################################################################ # Main class for HFIR powder reduction GUI # Key word for future developing: FUTURE, NEXT, REFACTOR, RELEASE 2.0 #########...
gpl-3.0
windyuuy/opera
chromium/src/third_party/python_26/Lib/encodings/cp500.py
593
13377
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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...
bsd-3-clause
whitehats/monitowl-agent
whmonit/client/sensors/ping/linux_01.py
1
1198
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' network ping sensor. ''' from ping import do_one as ping from whmonit.client.sensors import TaskSensorBase from whmonit.common.units import unit_reg class Sensor(TaskSensorBase): '''Generic 'ping' sensor.''' # W0232: Class has no __init__ method # R0201:...
apache-2.0
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/json/tests/__init__.py
145
2452
import os import sys import json import doctest import unittest from test import test_support # import json with and without accelerations cjson = test_support.import_fresh_module('json', fresh=['_json']) pyjson = test_support.import_fresh_module('json', blocked=['_json']) # create two base classes that will be used...
gpl-3.0
UniMOOC/AAClassroom
tests/functional/um_asmdates_service.py
1
2567
from datetime import datetime from datetime import timedelta from mock import patch from mock import MagicMock from functional import actions from modules.um_assessments.model import AsmDateDAO from modules.um_assessments.service import AsmDates START = datetime.utcnow() - timedelta(days=1) END = datetime.utcnow(...
apache-2.0
Antiun/stock-logistics-workflow
stock_ownership_by_move/model/picking.py
17
2156
# -*- coding: utf-8 -*- # Author: Leonardo Pistone # Copyright 2015 Camptocamp SA # # 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 the # License, or...
agpl-3.0
josschne/BabyWomp
cocos2d/tools/android-mk-generator/android_mk_generator.py
16
3306
#!/usr/bin/python import sys import os import os.path import cStringIO import re def get_cur_dir(): path = sys.path[0] if os.path.isdir(path): return path elif os.path.isfile(path): return os.path.dirname(path) CUR_DIR = get_cur_dir() COCOS_ROOT = os.path.abspath(os.path.join(CUR_DIR, ".....
mit
jeffreywolf/afproj
afproj.py
1
6530
#! /usr/bin/env python """ Affine spatial transformation """ import numpy as np from numpy.linalg import inv import argparse, sys, csv, os, time def getArgs(): parser = argparse.ArgumentParser( description = """Affine spatial transformation""" ) parser.add_argument( "-c", "--controlPoints", type = str, re...
mit
TieWei/nova
nova/scheduler/filters/image_props_filter.py
9
3909
# Copyright (c) 2011-2012 OpenStack Foundation # Copyright (c) 2012 Canonical Ltd # Copyright (c) 2012 SUSE LINUX Products GmbH # 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 o...
apache-2.0
tdtrask/ansible
lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py
22
24179
#!/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
raildo/keystone
keystone/token/backends/sql.py
5
7517
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
apache-2.0
joopert/home-assistant
homeassistant/components/feedreader/__init__.py
2
8552
"""Support for RSS/Atom feeds.""" from datetime import datetime, timedelta from logging import getLogger from os.path import exists from threading import Lock import pickle import voluptuous as vol import feedparser from homeassistant.const import EVENT_HOMEASSISTANT_START, CONF_SCAN_INTERVAL from homeassistant.helpe...
apache-2.0
bq/web2board
res/common/Scons/sconsFiles/SCons/Tool/docbook/__init__.py
7
30087
"""SCons.Tool.docbook Tool-specific initialization for Docbook. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001-7,2010 The SCons Foundation # # Permission is hereby granted, free of c...
lgpl-3.0
raviflipsyde/servo
tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/genshistream.py
1730
2278
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
mpl-2.0
chrizandr/ITS_feedback
feedback_portal/main/forms.py
1
4400
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import * from django.forms import CharField from django.forms import FileField from django.forms import FileInput from django.forms import Form from django.forms imp...
gpl-3.0
ramitsurana/boto
boto/rds/vpcsecuritygroupmembership.py
177
3131
# Copyright (c) 2013 Anthony Tonns http://www.corsis.com/ # # 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...
mit
mplpl/m7z
lib7z/googletest/test/gtest_break_on_failure_unittest.py
2140
7339
#!/usr/bin/env python # # Copyright 2006, 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...
lgpl-2.1
moonboots/tensorflow
tensorflow/contrib/ctc/ctc_loss_op_test.py
14
8764
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
ahmetdaglarbas/e-commerce
oscar/apps/offer/south_migrations/0001_initial.py
17
19312
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ('catalogue', '0001_initial'), ('order', '0001_initial'), ) def forwards(self, orm): # Adding model ...
bsd-3-clause
liangazhou/django-rdp
packages/Django-1.8.6/django/middleware/clickjacking.py
36
1995
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP head...
apache-2.0
CourseTalk/edx-platform
cms/djangoapps/contentstore/views/import_export.py
5
21168
""" These views handle all actions in Studio related to import and exporting of courses """ import base64 import logging import os import re import shutil import tarfile from path import Path as path from tempfile import mkdtemp from django.conf import settings from django.contrib.auth.decorators import login_required...
agpl-3.0
MindsIgnited/libjingle
talk/site_scons/site_tools/talk_linux.py
22
11731
# Copyright 2010 Google Inc. # All Rights Reserved. # Author: tschmelcher@google.com (Tristan Schmelcher) """Tool for helpers used in linux building process.""" import os import SCons.Defaults import subprocess def _OutputFromShellCommand(command): process = subprocess.Popen(command, shell=True, stdout=subprocess...
bsd-3-clause
vCentre/vFRP-6233
frappe/tests/test_email.py
37
3558
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import unittest, frappe from frappe.test_runner import make_test_records make_test_records("User") make_test_records("Email Account") class TestEmail(unittest.TestCase): def s...
mit
fenginx/django
tests/auth_tests/client.py
85
1414
import re from django.contrib.auth.views import ( INTERNAL_RESET_SESSION_TOKEN, INTERNAL_RESET_URL_TOKEN, ) from django.test import Client def extract_token_from_url(url): token_search = re.search(r'/reset/.*/(.+?)/', url) if token_search: return token_search.group(1) class PasswordResetConfirm...
bsd-3-clause
bitcommoditiz/P2Pool
p2pool/__init__.py
278
1595
import os import re import sys import traceback import subprocess def check_output(*popenargs, **kwargs): process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs) output, unused_err = process.communicate() retcode = process.poll() if retcode: raise ValueError((retcode, output)) ...
gpl-3.0
PredictiveScienceLab/inverse-bgo
pydes/_prior.py
2
1157
""" Some priors for GPy. Author: Ilias Bilionis Date: 5/5/2015 """ __all__ = ['LogLogisticPrior', 'JeffreysPrior'] import GPy import numpy as np class LogLogisticPrior(GPy.priors.Prior): """ Log-Logistic prior suitable for lengthscale parameters. From Conti & O'Hagan (2010) """ ...
mit
jamesob/bitcoin
test/functional/wallet_upgradewallet.py
13
16487
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """upgradewallet RPC functional test Test upgradewallet RPC. Download node binaries: test/get_previous_r...
mit
r-owen/stui
TUI/Scripts/Observations/Fiducial Monitor.py
1
5425
# fiducialMon.py import time import RO.Wdg import Tkinter import TUI.Models import TUI.PlaySound class ScriptClass(object): def __init__(self, sr): # if True, run in debug-only mode (which doesn't DO anything) # if False, real time run sr.debug = False self.name="fiducialMon" ...
bsd-3-clause
revanthkolli/osf.io
tests/test_addons_oauth.py
21
8289
from nose.tools import * from framework.auth.core import Auth from framework.exceptions import PermissionsError from website import settings from website.addons.base import AddonConfig from website.addons.base import AddonOAuthNodeSettingsBase from website.addons.base import AddonOAuthUserSettingsBase from website.oa...
apache-2.0
makelove/OpenCV-Python-Tutorial
cv-Tkinter-GUI/Displaying-video-feed-with-OpenCV-and-Tkinter.py
1
1115
# -*- coding: utf-8 -*- # @Time : 2018/2/8 16:09 # @Author : play4fun # @File : Displaying a video feed with OpenCV and Tkinter.py # @Software: PyCharm """ Displaying a video feed with OpenCV and Tkinter.py: https://www.pyimagesearch.com/2016/05/30/displaying-a-video-feed-with-opencv-and-tkinter/ """ # import...
mit
guileschool/BEAGLEBONE-tutorials
BBB-firmware/u-boot-v2015.10-rc2/tools/patman/checkpatch.py
25
6127
# Copyright (c) 2011 The Chromium OS Authors. # # SPDX-License-Identifier: GPL-2.0+ # import collections import command import gitutil import os import re import sys import terminal def FindCheckPatch(): top_level = gitutil.GetTopLevel() try_list = [ os.getcwd(), os.path.join(os.getcwd(), '..'...
mit
dodger487/MIST
data/magnetak_detectors.py
1
14236
""" Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
apache-2.0
CodingCat/mxnet
example/dsd/mlp.py
52
5126
# 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
ibab/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/mvn_test.py
8
11058
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
addgene/giraffe
src/django/giraffe/blat/models.py
2
11010
from django.db import models from django.db import utils import datetime import hashlib import re class BadSequenceError(Exception): def __init__(self,why): self.why = why def __str__(self): return repr(self.why) class Giraffe_Mappable_Model(models.Model): """ This is an abstract cla...
mit
Sunsoo/incodom
lib/bzrlib/merge3.py
5
16871
# Copyright (C) 2004, 2005 Canonical Ltd # # 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-3.0
wannabeCitizen/quantifiedSelf
app/services_auth/spotify_auth.py
2
1324
from tornado import gen from . import spotifyMix as spot from lib.database.auth import save_token from lib.basehandler import OAuthRequestHandler class SpotifyAuth(OAuthRequestHandler, spot.SpotifyOAuth2Mixin): scope = [ 'playlist-read-private', 'playlist-read-collaborative', 'user-follow...
mit
grilo/ansible-1
lib/ansible/plugins/action/set_stats.py
61
2792
# Copyright 2016 Ansible (RedHat, 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. # #...
gpl-3.0
tkasp/osmose-backend
analysers/analyser_osmosis_highway_motorway.py
4
3109
#!/usr/bin/env python #-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Frédéric Rodrigo 2016 ## ## ...
gpl-3.0
NeCTAR-RC/neutron
neutron/plugins/vmware/dbexts/nsx_models.py
26
10891
# Copyright 2015 VMware, 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 agree...
apache-2.0
ice9js/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py
44
13193
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
mpl-2.0
Proxmark/proxmark3
tools/xorcheck.py
26
1624
#!/usr/bin/python # xorcheck.py - find xor values for 8-bit LRC # # Adam Laurie <adam@algroup.co.uk> # http://rfidiot.org/ # # This code is copyright (c) Adam Laurie, 2009, All rights reserved. # For non-commercial use only, the following terms apply - for all other # uses, please contact the author: # # Th...
gpl-2.0
cemc/python3jail
static/maketrace/p4_encoder.py
1
6708
#!/usr/bin/python3 -u # given an arbitrary piece of Python data, encode it in such a manner # that it can be later encoded into JSON. # http://json.org/ # # Format: # * None, int, float, str, bool - unchanged (long is removed in Python 3) # (json.dumps encodes these fine verbatim) # * list - ['LIST', ...
gpl-3.0
tuhangdi/django
django/contrib/syndication/views.py
137
8793
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import Templat...
bsd-3-clause
peterm-itr/edx-platform
lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py
114
9755
# -*- 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 'Order.refunded_time' db.add_column('shoppingcart_order', 'refunded_time', ...
agpl-3.0
abartlet/samba-old
third_party/dnspython/dns/rcode.py
100
3105
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
jsynacek/systemd
test/networkd-test.py
5
45254
#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1+ # # networkd integration test # This uses temporary configuration in /run and temporary veth devices, and # does not write anything on disk or change any system configuration; # but it assumes (and checks at the beginning) that networkd is not currently # runn...
gpl-2.0
tigersirvine/occtigerscricket
django/contrib/syndication/views.py
85
7622
from django.conf import settings from django.contrib.sites.models import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import HttpResponse, Http404 from django.template import loader, TemplateDoesNotExist, RequestContext from django.utils import feedgenera...
bsd-3-clause
wisechengyi/pants
src/python/pants/backend/jvm/targets/java_library.py
2
1370
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from pants.backend.jvm.targets.exportable_jvm_library import ExportableJvmLibrary from pants.backend.jvm.targets.junit_tests import JUnitTests class JavaLibrary(ExportableJvmLibrary): ...
apache-2.0
smunaut/gnuradio
gr-audio/examples/python/audio_fft.py
68
4596
#!/usr/bin/env python # # Copyright 2004,2005,2007 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 ...
gpl-3.0
rven/odoo
addons/sale/tests/test_onchange.py
5
12358
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import Form from odoo.tests.common import TransactionCase class TestOnchangeProductId(TransactionCase): """Test that when an included tax is mapped by a fiscal position, the included tax must be ...
agpl-3.0
garg10may/youtube-dl
youtube_dl/extractor/techtalks.py
170
2432
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( get_element_by_attribute, clean_html, ) class TechTalksIE(InfoExtractor): _VALID_URL = r'https?://techtalks\.tv/talks/[^/]*/(?P<id>\d+)/' _TEST = { 'url': 'http://techtalks.tv/talks/lea...
unlicense
Tokyo-Buffalo/tokyosouth
env/lib/python3.6/site-packages/twisted/python/test/test_appdirs.py
16
1081
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the data directory support. """ from __future__ import division, absolute_import try: from twisted.python import _appdirs except ImportError: _appdirs = None from twisted.trial import unittest class AppdirsTests(unittest...
mit
barrywardell/git-module
GitSuperRepository.py
1
15137
# GitSuperRepository.py # # Copyright (C) 2011 Barry Wardell <barry.wardell@gmail.com> # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your opt...
gpl-2.0
jitendra29/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/hybi00.py
675
11294
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
jjscarafia/odoo
addons/resource/__init__.py
448
1086
# -*- 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
charithag/iot-server-appliances
IU_workshop/Step 7/python_client/ControlAndPublish/BAMPythonPublisher/Publisher.py
15
3361
#!/usr/bin/env python import sys, time # sys.path.append('gen-py') from ThriftSecureEventTransmissionService import ThriftSecureEventTransmissionService from ThriftSecureEventTransmissionService.ttypes import * from thrift import Thrift from thrift.transport import TSSLSocket from thrift.transport import TTransport ...
apache-2.0
mbauskar/internal-hr
erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py
10
2769
# 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 frappe from frappe import msgprint, _ def execute(filters=None): if not filters: filters = {} columns = get_columns(filters) data = get_...
agpl-3.0
rnowling/pop-gen-models
single-pop/calculate_phist.py
2
3690
import sys import numpy as np import matplotlib.pyplot as plt def ssdwpfunc(individuals, frequencies): """ Returns the sums squares deviation within populations from the population frequencies. individuals[pop] = counts frequencies[pop, haplotype] = freq """ ssdwp = 0.0 n_pop = frequencie...
apache-2.0
PaddlePaddle/Paddle
tools/diff_use_default_grad_op_maker.py
2
1758
# Copyright (c) 2019 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 appli...
apache-2.0
GodBlessPP/W17test_2nd_1
static/Brython3.1.1-20150328-091302/Lib/xml/sax/__init__.py
637
3505
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
gpl-3.0
czgu/opendataexperience
env/lib/python2.7/site-packages/django/contrib/contenttypes/fields.py
43
22826
from __future__ import unicode_literals from collections import defaultdict from django.core import checks from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db import models, router, transaction, DEFAULT_DB_ALIAS from django.db.models import signals, FieldDoesNotExist,...
apache-2.0
jonathankablan/prestashop-1.6
prestashop_1.7/vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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. ...
gpl-3.0
shurihell/testasia
common/test/acceptance/tests/studio/test_studio_settings.py
32
19688
# coding: utf-8 """ Acceptance tests for Studio's Setting pages """ from __future__ import unicode_literals from nose.plugins.attrib import attr from base_studio_test import StudioCourseTest from bok_choy.promise import EmptyPromise from ...fixtures.course import XBlockFixtureDesc from ..helpers import create_user_par...
agpl-3.0
sagersmith8/ai_graph_coloring
ai_graph_color/algorithms/min_conflicts.py
1
3360
import random params = {} def run(graph, setup, params): """ Color a graph using min-conflicts: First generate a random coloring for the graph. Until there are no conflicts in the graph, choose a random node in the graph, and change it to have the color which reduces the number of co...
mit
camptocamp/ngo-addons-backport
addons/account/wizard/account_move_line_reconcile_select.py
56
2399
# -*- 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
marios-zindilis/musicbrainz-django-models
musicbrainz_django_models/models/editor_subscribe_label_deleted.py
1
1251
""" .. module:: editor_subscribe_label_deleted The **Editor Subscribe Label Deleted** Model. PostgreSQL Definition --------------------- The :code:`editor_subscribe_label_deleted` table is defined in the MusicBrainz Server as: .. code-block:: sql CREATE TABLE editor_subscribe_label_deleted ( editor...
gpl-2.0
legnaleurc/tornado
demos/facebook/facebook.py
12
4412
#!/usr/bin/env python # # Copyright 2009 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...
apache-2.0
Vrturo/FrontEndLabz
techTutorials/webpack/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py
1446
65937
#!/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. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
mit
SunghanKim/numpy
numpy/_import_tools.py
93
13292
from __future__ import division, absolute_import, print_function import os import sys import warnings __all__ = ['PackageLoader'] class PackageLoader(object): def __init__(self, verbose=False, infunc=False): """ Manages loading packages. """ if infunc: _level = 2 else...
bsd-3-clause
Moth-Tolias/LetterBoy
backend/jumbles nontrobo/jumbles nontrobo - last working.py
1
3870
"""return a jumbled version of a string. eg, the lazy hamster is jumping becomes the lzay hmasetr si jmunipg shuffles insides of words. """ import random #okay, so this will be the jmuble algorythim #variables, passed #string_to_jumble = "" #yeah #jumble_mode = true # do u switch words of two letters d...
gpl-3.0
jsaveta/Lance
src/rescal/build/lib.linux-x86_64-2.7/setuptools/tests/test_resources.py
42
24620
#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove from unittest import TestCase, makeSuite; from pkg_resources import * from setuptools.command.easy_install import get_script_header, is_sh import os, pkg_resources, sys, StringIO, tempfile, shutil t...
apache-2.0
vxsx/django-cms
cms/tests/test_plugins.py
1
80142
# -*- coding: utf-8 -*- import base64 import datetime import json import os from django import http from django.conf import settings from django.conf.urls import url from django.contrib import admin from django.core import urlresolvers from django.core.cache import cache from django.core.exceptions import ( Valida...
bsd-3-clause
kedz/cuttsum
trec2015/sbin/l2s/apsal-dev.py
1
9067
import cuttsum.events import cuttsum.corpora from cuttsum.pipeline import InputStreamResource from cuttsum.classifiers import NuggetRegressor import cuttsum.judgements import pandas as pd import numpy as np from datetime import datetime from cuttsum.misc import event2semsim from sklearn.cluster import AffinityPropagat...
apache-2.0
rtindru/django
django/conf/locale/ml/formats.py
1007
1815
# -*- 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 = 'N j, Y' TIME_FORMAT = 'P' DATETIM...
bsd-3-clause
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/purchase_requisition_analytic/__init__.py
10
1507
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com). # # WARNING: This program as such is intended to be used by professional # programmers who take t...
agpl-3.0
ekasitk/sahara
sahara/swift/utils.py
1
2014
# Copyright (c) 2013 Red Hat, 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 writ...
apache-2.0
vipulkanade/EventbriteDjango
lib/python2.7/encodings/iso8859_10.py
593
13845
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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...
mit
domenicosolazzo/practice-django
venv/lib/python2.7/distutils/__init__.py
1211
3983
import os import sys import warnings import imp import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory dirname = os.path.dirname distutils_path = o...
mit
codrut3/tensorflow
tensorflow/contrib/specs/python/params_ops.py
186
3104
# 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 applicable ...
apache-2.0
linucks/ample
ample/ensembler/truncation_util.py
1
17337
"""Truncation utility module""" __author__ = "Jens Thomas, and Felix Simkovic" __date__ = "10 Jul 2018" __version__ = "1.0" import collections from enum import Enum import logging import os import sys from ample.ensembler._ensembler import model_core_from_fasta from ample.util import ample_util, pdb_edit, theseus lo...
bsd-3-clause
hizardapp/Hizard
hyrodactil/customisable_emails/views.py
1
1940
from django.core.urlresolvers import reverse_lazy from django.template import Context, Template, TemplateSyntaxError from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import View from braces.views import LoginRequiredMixin, AjaxResponseM...
mit
knowledgepoint-devs/askbot-devel
askbot/management/commands/createsuperuser.py
6
4589
from django.contrib.auth.management.commands.createsuperuser import * from django.db.models.signals import pre_save, post_save class Command(Command): def handle(self, *args, **options): username = options.get('username', None) email = options.get('email', None) interactive = options.get('...
gpl-3.0
gamahead/nupic
nupic/encoders/scalar.py
8
25295
# ---------------------------------------------------------------------- # 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...
gpl-3.0
jamespcole/home-assistant
homeassistant/components/weather/__init__.py
10
5177
"""Weather component that handles meteorological data for your location.""" from datetime import timedelta import logging from homeassistant.const import PRECISION_TENTHS, PRECISION_WHOLE, TEMP_CELSIUS from homeassistant.helpers.config_validation import ( # noqa PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE) from homeass...
apache-2.0
ksmit799/Toontown-Source
toontown/coghq/PromotionManagerAI.py
1
3193
from otp.ai.AIBaseGlobal import * from direct.directnotify import DirectNotifyGlobal import random from toontown.suit import SuitDNA import CogDisguiseGlobals from toontown.toonbase.ToontownBattleGlobals import getInvasionMultiplier MeritMultiplier = 0.5 class PromotionManagerAI: notify = DirectNotifyGlobal.direct...
mit
SlimRoms/android_external_chromium
net/tools/testserver/testserver.py
66
51380
#!/usr/bin/python2.4 # 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. """This is a simple HTTP server used for testing Chrome. It supports several test URLs, as specified by the handlers in TestPageHan...
bsd-3-clause
riddlezyc/geolab
src/structure/metricC.py
1
12965
import pickle import matplotlib.pyplot as plt from datetime import datetime criteriaA = 4.0 criteriaB = 4.0 criteriaC = 10.0 dirName = r'F:\simulations\asphaltenes\production\longtime\athInHeptane\nvt\analysis\fullmatrix/' # dirName = r'F:\simulations\asphaltenes\production\longtime\athInHeptane-illite\nvt\a...
gpl-3.0
LChristakis/chalice-hunter
lib/python3.4/site-packages/scss/extension/compass/helpers.py
4
19696
"""Miscellaneous helper functions ported from Compass. See: http://compass-style.org/reference/compass/helpers/ This collection is not necessarily complete or up-to-date. """ from __future__ import absolute_import from __future__ import unicode_literals import logging import math import os.path import six from . i...
mit
HydrelioxGitHub/home-assistant
homeassistant/components/weather/metoffice.py
2
3688
"""Support for UK Met Office weather service.""" import logging import voluptuous as vol from homeassistant.components.sensor.metoffice import ( CONDITION_CLASSES, ATTRIBUTION, MetOfficeCurrentData) from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity from homeassistant.const import ( C...
apache-2.0
bbc/kamaelia
Sketches/RJL/Packages/Kamaelia/Community/RJL/Kamaelia/Util/LineSplit.py
9
1318
#!/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
ecohealthalliance/EpiTator
epitator/annospan.py
1
6496
#!/usr/bin/env python # coding=utf8 from __future__ import absolute_import EMPTY_LIST = [] class AnnoSpan(object): """ A span of text with an annotation applied to it. """ __slots__ = ["start", "end", "doc", "metadata", "label", "base_spans"] def __init__(self, start, end, doc, label=None, meta...
apache-2.0
christabor/MoAL
MOAL/software_engineering/problem_solving/design_patterns/grasp/pattern_polymorphism.py
1
1104
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section DEBUG = True if __name__ == '__main__' else False class BlobOfMatter(object): def __s...
apache-2.0
syrrim/werkzeug
examples/plnt/views.py
52
1145
# -*- coding: utf-8 -*- """ plnt.views ~~~~~~~~~~ Display the aggregated feeds. :copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ from datetime import datetime, date from plnt.database import Blog, Entry from plnt.utils import Pagination, expose, render_te...
bsd-3-clause
saulpw/visidata
visidata/loaders/html.py
1
4860
import html from visidata import * option('html_title', '<h2>{sheet.name}</h2>', 'table header when saving to html') def open_html(p): return HtmlTablesSheet(p.name, source=p) open_htm = open_html class HtmlTablesSheet(IndexSheet): rowtype = 'sheets' # rowdef: HtmlTableSheet (sheet.html = lxml.html.HtmlEle...
gpl-3.0
krisdages/ultisnips
test/test_MultipleMatches.py
29
2438
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * # Selecting Between Same Triggers {{{# class _MultipleMatches(_VimTest): snippets = (('test', 'Case1', 'This is Case 1'), ('test', 'Case2', 'This is Case 2')) class Multiple_SimpleCaseSelectFirst_ECR(_MultipleMa...
gpl-3.0
mlyundin/scikit-learn
sklearn/decomposition/tests/test_incremental_pca.py
297
8265
"""Tests for Incremental PCA.""" import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_raises from sklearn import datasets from sklearn.decomposition import PCA, IncrementalPCA iris = datasets.load...
bsd-3-clause
zhukaixy/kbengine
kbe/src/lib/python/Lib/test/test_mimetypes.py
111
4279
import io import locale import mimetypes import sys import unittest from test import support # Tell it we don't know about external files: mimetypes.knownfiles = [] mimetypes.inited = False mimetypes._default_mime_types() class MimeTypesTestCase(unittest.TestCase): def setUp(self): self.db = mimetypes.M...
lgpl-3.0
weizhenwei/qemu
scripts/qapi.py
66
19807
# # QAPI helper library # # Copyright IBM, Corp. 2011 # Copyright (c) 2013 Red Hat Inc. # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. import re from o...
gpl-2.0