repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/pandas/core/panelnd.py
14
4605
""" Factory methods to create N-D panels """ import warnings from pandas.compat import zip import pandas.compat as compat def create_nd_panel_factory(klass_name, orders, slices, slicer, aliases=None, stat_axis=2, info_axis=0, ns=None): """ manufacture a n-d class: DEPRECATED. Pan...
mit
1013553207/django
django/db/models/options.py
149
36502
from __future__ import unicode_literals import warnings from bisect import bisect from collections import OrderedDict, defaultdict from itertools import chain from django.apps import apps from django.conf import settings from django.core.exceptions import FieldDoesNotExist from django.db import connections from djang...
bsd-3-clause
MungoRae/home-assistant
homeassistant/components/ecobee.py
1
3654
""" Support for Ecobee. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ecobee/ """ import logging import os from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.helpers import ...
apache-2.0
wolfskaempf/ga_statistics
lib/python2.7/site-packages/django/template/utils.py
41
4662
import os import warnings from collections import Counter, OrderedDict from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache from django.utils._os import upath from django.utils.deprecation import RemovedInDjango20Warnin...
mit
sfischer13/python-arpa
tests/test_model_base.py
1
2958
import arpa from arpa.models.base import ARPAModel from arpa.models.simple import ARPAModelSimple import pytest from test_arpa import PARSERS from test_arpa import TEST_ARPA def test_manual_log_p_unk(): lm = arpa.loadf(TEST_ARPA)[0] assert lm.log_p('UnladenSwallow') == -1.995635 def test_manual_p(): l...
mit
cgstudiomap/cgstudiomap
main/parts/odoo/addons/purchase_double_validation/__openerp__.py
260
1920
# -*- 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
alshedivat/tensorflow
tensorflow/contrib/batching/python/ops/batch_ops.py
15
7839
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
mahak/cinder
cinder/tests/unit/backup/fake_google_client2.py
2
3730
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (C) 2016 Vedams Inc. # Copyright (C) 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 ...
apache-2.0
landryb/QGIS
python/plugins/db_manager/db_plugins/spatialite/data_model.py
30
2332
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
AmperificSuperKANG/lge-kernel-d802
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
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/http/multipartparser.py
332
24331
""" Multi-part parsing for file uploads. Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to file upload handlers for processing. """ from __future__ import unicode_literals import base64 import binascii import cgi import sys from django.conf import settings from django.core.exceptions imp...
artistic-2.0
kaiweifan/horizon
openstack_dashboard/dashboards/project/instances/forms.py
9
3902
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Openstack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
wrouesnel/ansible
lib/ansible/modules/network/ios/ios_static_route.py
12
7396
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
t0mm0/youtube-dl
youtube_dl/extractor/teachertube.py
148
4651
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( qualities, determine_ext, ) class TeacherTubeIE(InfoExtractor): IE_NAME = 'teachertube' IE_DESC = 'teachertube.com videos' _VALID_URL = r'https?://(?:www\.)?teachert...
unlicense
hrh5775/LibraryManager
PythonTestClient/LibraryManagerTestClient/venv/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py
395
25647
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os...
gpl-3.0
cattleprod/samsung-kernel-gt-i9100
external/webkit/WebKitTools/BuildSlaveSupport/build.webkit.org-config/webkit/steps.py
3
10156
from webkit.basesteps import ShellCommand, SVN, Test, Compile, UploadCommand from buildbot.status.builder import SUCCESS, FAILURE, WARNINGS class CheckOutSource(SVN): baseURL = "http://svn.webkit.org/repository/webkit/" mode = "update" def __init__(self, *args, **kwargs): SVN.__init__(self, baseURL...
gpl-2.0
compiteing/flask-ponypermission
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py
678
9406
import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValue...
mit
augustynSybidlo/Legend-of-the-Eternal-Castle
end_game.py
1
1229
the_end = ''' _ __ ___ _ _____ __ ___ _ ___ (__ __) \ | | / \ ___) \ ___) | \ | | | \ | | | \_/ | | (__ | (__ | |\ \ | | | | | | | | _ | | __) |...
gpl-3.0
mdietrichc2c/OCB
addons/portal_project/tests/test_access_rights.py
65
15194
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
lordtangent/arsenalsuite
cpp/apps/freezer/afplugins/sent_email.py
11
1394
from blur.Stone import * from blur.Classes import * from blur.Freezer import * from PyQt4.QtCore import * from PyQt4.QtSql import * import traceback, os import subprocess class ToDeleteViewerPlugin(JobViewerPlugin): def __init__(self): JobViewerPlugin.__init__(self) def name(self): return QSt...
gpl-2.0
abimannans/scikit-learn
examples/linear_model/plot_logistic_path.py
349
1195
#!/usr/bin/env python """ ================================= Path with L1- Logistic Regression ================================= Computes path on IRIS dataset. """ print(__doc__) # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from datetime import datetime import numpy as np import...
bsd-3-clause
BIT-SYS/gem5-spm-module
src/cpu/kvm/KvmVM.py
57
2399
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
MatthewWilkes/django-oscar
src/oscar/apps/dashboard/users/forms.py
27
1400
from django import forms from django.utils.translation import ugettext_lazy as _, pgettext_lazy from oscar.core.loading import get_model from oscar.core.compat import get_user_model User = get_user_model() ProductAlert = get_model('customer', 'ProductAlert') class UserSearchForm(forms.Form): email = forms.CharF...
bsd-3-clause
SIFTeam/enigma2
lib/python/Components/Sources/FrontendInfo.py
35
1642
from enigma import iPlayableService from Source import Source from Components.PerServiceDisplay import PerServiceBase class FrontendInfo(Source, PerServiceBase): def __init__(self, service_source = None, frontend_source = None, navcore = None): self.navcore = None Source.__init__(self) if navcore: PerService...
gpl-2.0
bmockler/MOSFiT
mosfit/modules/arrays/diagonal.py
5
6962
"""Definitions for the `Diagonal` class.""" from math import isnan import numpy as np from mosfit.modules.arrays.array import Array from mosfit.utils import flux_density_unit # Important: Only define one ``Module`` class per file. class Diagonal(Array): """Calculate the diagonal/residuals for a model kernel."...
mit
shlomif/PySolFC
pysollib/games/mahjongg/mahjongg3.py
2
24825
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # ---------------------------------------------------------------------------## # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free softwa...
gpl-3.0
MPBAUnofficial/cmsplugin_image_gallery
cmsplugin_image_gallery/models.py
1
4086
import threading from cms.models import CMSPlugin from django.db import models from django.utils.translation import ugettext_lazy as _ from inline_ordering.models import Orderable from filer.fields.image import FilerImageField from django.core.exceptions import ValidationError import utils localdata = threading.loca...
bsd-2-clause
jswanljung/iris
tools/generate_std_names.py
12
4673
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
lgpl-3.0
Emotroid-Team/emotion_tw_caf_kernel
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
skg-net/ansible
test/runner/shippable.py
117
2708
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Verify the current Shippable run has the required number of jobs.""" from __future__ import absolute_import, print_function # noinspection PyCompatibility import argparse import errno import json import os import sys from lib.http import ( HttpClient, ) from lib....
gpl-3.0
WSDC-NITWarangal/django
tests/utils_tests/test_text.py
243
9471
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from django.test import SimpleTestCase from django.utils import six, text from django.utils.encoding import force_text from django.utils.functional import lazy from django.utils.translation import override lazystr = lazy(force_text, six.text...
bsd-3-clause
eyzhou123/python-games
tetris.py
1
10241
#tetris.py from Tkinter import * import random def tetrisMousePressed(canvas,event): tetrisRedrawAll(canvas) def tetrisKeyPressed(canvas,event): if event.keysym == "r": tetrisInit(canvas) if (canvas.data.isTetrisGameOver == False): if event.keysym == "Left": moveFallingPiece(c...
mit
KeserOner/where-artists-share
was/artists/models.py
1
1280
from django.contrib.auth.models import User from django.db import models from django.dispatch.dispatcher import receiver class Artists(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) artist_image = models.ImageField( verbose_name="Artist's profile image", null=True,...
mit
alex-quiterio/pychess
lib/pychess/Players/Engine.py
22
4571
from __future__ import absolute_import from gi.repository import GObject from threading import Thread from pychess.compat import urlopen, urlencode from pychess.System import fident from pychess.System.Log import log from pychess.Utils.Offer import Offer from pychess.Utils.const import ARTIFICIAL, CHAT_ACTION from ...
gpl-3.0
bashburn/openshift-ansible
bin/openshift_ansible/awsutil.py
2
6898
# vim: expandtab:tabstop=4:shiftwidth=4 """This module comprises Aws specific utility functions.""" import os import re # Buildbot does not have multi_inventory installed #pylint: disable=no-name-in-module from openshift_ansible import multi_inventory class ArgumentError(Exception): """This class is raised when...
apache-2.0
zeha/pdns
regression-tests.recursor-dnssec/test_API.py
4
1947
import os import requests from recursortests import RecursorTest class APIRecursorTest(RecursorTest): @classmethod def setUpClass(cls): # we don't need all the auth stuff cls.setUpSockets() cls.startResponders() confdir = os.path.join('configs', cls._confdir) cls.cre...
gpl-2.0
StefanRijnhart/odoo
addons/anonymization/__openerp__.py
52
2233
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
jamesblunt/edx-platform
pavelib/utils/test/bokchoy_utils.py
54
4800
""" Helper functions for bok_choy test tasks """ import sys import os import time import httplib import subprocess from paver.easy import sh from pavelib.utils.envs import Env from pavelib.utils.process import run_background_process try: from pygments.console import colorize except ImportError: colorize = lamb...
agpl-3.0
pwoodworth/intellij-community
python/lib/Lib/encodings/tis_620.py
593
12556
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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='st...
apache-2.0
zsoltdudas/lis-tempest
tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
5
5903
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
dennybaa/st2
st2common/st2common/rbac/migrations.py
3
2094
# 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
Memeo/samba-unovero
python/samba/tests/messaging.py
28
2313
# -*- coding: utf-8 -*- # # Unix SMB/CIFS implementation. # Copyright © Jelmer Vernooij <jelmer@samba.org> 2008 # # 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,...
gpl-3.0
ArthurGarnier/SickRage
lib/libpasteurize/fixes/fix_unpacking.py
60
5954
u""" Fixer for: (a,)* *b (,c)* [,] = s for (a,)* *b (,c)* [,] in d: ... """ from lib2to3 import fixer_base from itertools import count from lib2to3.fixer_util import (Assign, Comma, Call, Newline, Name, Number, token, syms, Node, Leaf) from libfuturize.fixer_util import indentation, sui...
gpl-3.0
vibhu0009/android_kernel_cyanogen_msm8916
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
peterbraden/tensorflow
tensorflow/contrib/learn/python/learn/datasets/text_datasets.py
7
1734
"""Text datasets.""" # Copyright 2015-present The Scikit Flow 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....
apache-2.0
sllong/googlemock
test/gmock_leak_test.py
779
4384
#!/usr/bin/env python # # Copyright 2009, 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...
bsd-3-clause
andyzsf/django-cms
cms/south_migrations/0030_limit_visibility_in_menu_step3of3.py
1680
20032
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
profxj/xastropy
xastropy/PH136/experiments/hrdiagram.py
7
19512
"""Python module for the HR diagram experiment of PH136 Run on 2014 Apr 30 data from the Nickel """ # Module for the HR Diagram experiment import numpy as np import pdb import glob from astropy.io import fits #import ds9 #################################### # CLASSES ########### class Landolt_data: """A simple cl...
bsd-3-clause
fieldhawker/upm
examples/python/using_carrays.py
18
1354
#!/usr/bin/env python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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, inc...
mit
subutai/nupic.research
nupic/research/frameworks/pytorch/lr_scheduler.py
3
7197
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, 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 program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/django/conf/locale/hu/formats.py
115
1117
# -*- 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 = 'Y. F j.' TIME_FORMAT = 'G.i' DATE...
mit
karan1276/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_genscript.py
194
1689
import pytest import sys @pytest.fixture(scope="module") def standalone(request): return Standalone(request) class Standalone: def __init__(self, request): self.testdir = request.getfuncargvalue("testdir") script = "mypytest" result = self.testdir.runpytest("--genscript=%s" % script) ...
mpl-2.0
manasapte/pants
src/python/pants/util/rwbuf.py
18
2259
# coding=utf-8 # Copyright 2014 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) import threading fr...
apache-2.0
ntonjeta/iidea-Docker
examples/sobel/src/boost_1_63_0/tools/build/test/link.py
26
10779
#!/usr/bin/python # Copyright 2014-2015 Steven Watanabe # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Tests the link-directory rule used to create the # common boost/ directory in the new git layout. import BoostBuild ...
agpl-3.0
silly-wacky-3-town-toon/SOURCE-COD
Panda3D-1.10.0/python/Lib/sndhdr.py
257
5973
"""Routines to help recognizing sound files. Function whathdr() recognizes various types of sound file headers. It understands almost all headers that SOX can decode. The return tuple contains the following items, in this order: - file type (as SOX understands it) - sampling rate (0 if unknown or hard to decode) - nu...
apache-2.0
SuYiling/chrome_depot_tools
git_cache.py
8
23656
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A git command for managing a local cache of git repositories.""" from __future__ import print_function import errno import logging ...
bsd-3-clause
thurt/arangodb
3rdParty/V8-4.3.61/test/webkit/testcfg.py
24
6502
# Copyright 2013 the V8 project authors. 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 conditi...
apache-2.0
alee156/clviz
prototype/connectivity.py
2
8155
#!/usr/bin/env python #-*- coding:utf-8 -*- import matplotlib from matplotlib import pyplot as plt import numpy as np from numpy import linalg as LA import cv2 import math import plotly from plotly.graph_objs import * from plotly.offline import download_plotlyjs, init_notebook_mode, iplot from plotly import tools i...
apache-2.0
ar7z1/ansible
test/units/vars/test_module_response_deepcopy.py
118
1473
# -*- coding: utf-8 -*- # (c) 2018 Matt Martz <matt@sivel.net> # 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 from ansible.vars.clean import module_response_deepcopy import pytest def...
gpl-3.0
sanketloke/scikit-learn
sklearn/linear_model/tests/test_omp.py
272
7752
# Author: Vlad Niculae # Licence: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equa...
bsd-3-clause
sushifant/namebench
tools/add_linkcount_and_version_to_csv.py
174
1351
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
dailab/RIOT
dist/tools/headerguards/headerguards.py
17
2289
#!/usr/bin/env python3 import os, sys import difflib #from string import maketrans from io import BytesIO, TextIOWrapper _in = "/-." _out = "___" transtab = str.maketrans(_in, _out) def path_to_guardname(filepath): res = filepath.upper().translate(transtab) if res.startswith("_"): res = "PRIV" + res...
lgpl-2.1
VirtueSecurity/aws-extender
BappModules/boto/services/sonofmmm.py
170
3498
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
tiagochiavericosta/edx-platform
common/test/acceptance/pages/lms/dashboard.py
41
6349
# -*- coding: utf-8 -*- """ Student dashboard page. """ from bok_choy.page_object import PageObject from . import BASE_URL class DashboardPage(PageObject): """ Student dashboard, where the student can view courses she/he has registered for. """ def __init__(self, browser): """Initialize t...
agpl-3.0
maartenq/ansible
lib/ansible/modules/network/cloudengine/ce_facts.py
65
11122
#!/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
zinid/mrim
src/protocol.py
1
19357
from mmptypes import * import utils import UserDict import cStringIO import socket import struct import email from email.Utils import parsedate wp_request = {} wp_request_reversed = {} for k,v in [(key, locals()[key]) for key in locals().keys() if key.startswith('MRIM_CS_WP_REQUEST_PARAM')]: wp_request[v] = k for ...
gpl-3.0
shubhdev/edx-platform
lms/djangoapps/courseware/features/lti.py
49
14242
# pylint: disable=missing-docstring import datetime import os import pytz from django.conf import settings from mock import patch from pytz import UTC from splinter.exceptions import ElementDoesNotExist from selenium.common.exceptions import NoAlertPresentException from nose.tools import assert_true, assert_equal, asse...
agpl-3.0
hughbe/swift
tools/SourceKit/bindings/python/sourcekitd/capi.py
60
17369
# capi.py - sourcekitd Python Bindings -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information...
apache-2.0
gw280/skia
tools/test_pictures.py
1
6084
''' Compares the rendererings of serialized SkPictures to expected images. Launch with --help to see more information. Copyright 2012 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' # common Python modules import os import optparse import sys import ...
bsd-3-clause
mammique/django
django/contrib/gis/geos/geometry.py
103
25896
""" This module contains the 'base' GEOSGeometry object -- all GEOS Geometries inherit from this object. """ from __future__ import unicode_literals # Python, ctypes and types dependencies. from ctypes import addressof, byref, c_double from django.contrib.gis import memoryview # super-class for mutable list behavio...
bsd-3-clause
cfhamlet/os-urlpattern
src/os_urlpattern/pattern_maker.py
1
4225
"""Pattern clustering procedure APIs. """ from .compat import itervalues from .config import get_default_config from .definition import BasePattern from .parse_utils import EMPTY_PARSED_PIECE, ParsedPiece from .parser import fuzzy_digest, parse from .pattern_cluster import cluster from .piece_pattern_node import PieceP...
mit
nosix/PyCraft
src/pycraft/service/composite/entity/monster.py
1
1206
# -*- coding: utf8 -*- from pycraft.service.const import EntityType from pycraft.service.primitive.geometry import Size from .base import MobEntity from .player import PlayerEntity class MonsterEntity(MobEntity): def has_hostile(self, entity): return isinstance(entity, PlayerEntity) class Zombie(M...
lgpl-3.0
home-assistant/home-assistant
homeassistant/components/homematic/const.py
5
6149
"""Constants for the homematic component.""" DOMAIN = "homematic" DISCOVER_SWITCHES = "homematic.switch" DISCOVER_LIGHTS = "homematic.light" DISCOVER_SENSORS = "homematic.sensor" DISCOVER_BINARY_SENSORS = "homematic.binary_sensor" DISCOVER_COVER = "homematic.cover" DISCOVER_CLIMATE = "homematic.climate" DISCOVER_LOCK...
apache-2.0
leilihh/novaha
nova/tests/api/openstack/compute/plugins/v3/test_migrations.py
11
3995
# 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
sun1991/lvsys
lvsys/env_lvsys/Lib/site-packages/click/termui.py
202
21008
import os import sys import struct from ._compat import raw_input, text_type, string_types, \ isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN from .utils import echo from .exceptions import Abort, UsageError from .types import convert_type from .globals import resolve_color_default # The prompt funct...
mit
chengdh/openerp-ktv
openerp/addons/mrp_repair/wizard/cancel_repair.py
9
3890
# -*- 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...
agpl-3.0
campagnola/acq4
acq4/pyqtgraph/widgets/DiffTreeWidget.py
7
5928
# -*- coding: utf-8 -*- from ..Qt import QtGui, QtCore from ..pgcollections import OrderedDict from .DataTreeWidget import DataTreeWidget from .. import functions as fn import types, traceback import numpy as np __all__ = ['DiffTreeWidget'] class DiffTreeWidget(QtGui.QWidget): """ Widget for displaying diffe...
mit
eharney/nova
nova/tests/fake_notifier.py
29
2433
# Copyright 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 agre...
apache-2.0
shtouff/django
tests/admin_docs/models.py
82
1592
""" Models for testing various aspects of the djang.contrib.admindocs app """ from django.db import models class Company(models.Model): name = models.CharField(max_length=200) class Group(models.Model): name = models.CharField(max_length=200) class Family(models.Model): last_name = models.CharField(m...
bsd-3-clause
atdaemon/pip
pip/download.py
2
32340
from __future__ import absolute_import import cgi import email.utils import getpass import json import logging import mimetypes import os import platform import re import shutil import sys import tempfile try: import ssl # noqa HAS_TLS = True except ImportError: HAS_TLS = False from pip._vendor.six.move...
mit
mhbu50/erpnext
erpnext/www/book_appointment/index.py
2
5813
import frappe import datetime import json import pytz from frappe import _ WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] no_cache = 1 def get_context(context): is_enabled = frappe.db.get_single_value('Appointment Booking Settings', 'enable_scheduling') if is_enabled: ...
gpl-3.0
lexus24/w16b_test
static/Brython3.1.3-20150514-095342/Lib/xml/sax/handler.py
925
13922
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id$ """ version ...
agpl-3.0
faux123/lge-FR-kernel
arch/ia64/scripts/unwcheck.py
916
1718
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
gpl-2.0
vpodzime/anaconda
tests/pyanaconda_tests/iutil_test.py
7
28119
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in ...
gpl-2.0
loulich/Couchpotato
libs/tornado/platform/select.py
79
2633
#!/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
dattatreya303/zulip
zerver/tests/test_i18n.py
14
4660
# -*- coding: utf-8 -*- from __future__ import absolute_import from typing import Any import django import mock from django.test import TestCase from django.conf import settings from django.http import HttpResponse from six.moves.http_cookies import SimpleCookie from zerver.lib.test_classes import ( ZulipTestCas...
apache-2.0
alephu5/Soundbyte
environment/lib/python3.3/site-packages/IPython/nbconvert/preprocessors/svg2pdf.py
8
3527
"""Module containing a preprocessor that converts outputs in the notebook from one format to another. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license ...
gpl-3.0
diofant/diofant
diofant/core/function.py
1
77992
""" There are three types of functions implemented in Diofant: 1) defined functions (in the sense that they can be evaluated) like exp or sin; they have a name and a body: f = exp 2) undefined function which have a name but no body. Undefined functions can be defined using a Function c...
bsd-3-clause
ramcn/demo3
venv/lib/python3.4/site-packages/django/template/loader.py
48
6396
import warnings from django.utils.deprecation import RemovedInDjango20Warning from . import engines from .backends.django import DjangoTemplates from .base import Origin, TemplateDoesNotExist from .engine import ( _context_instance_undefined, _dictionary_undefined, _dirs_undefined, ) from .loaders import base c...
mit
eshasharma/mase
src/old/lib.py
13
4501
from __future__ import print_function, unicode_literals from __future__ import absolute_import, division """ # Lib: Standard Utilities Standard imports: used everywhere. ## Code Standards Narrow code (52 chars, max); use ``i'', not ``self'', set indent to two characters, In a repo (or course). Markdown comments (...
unlicense
gangadhar-kadam/mic-erpnext
patches/december_2012/production_cleanup.py
6
1858
import webnotes def execute(): delete_doctypes() rename_module() cleanup_bom() rebuild_exploded_bom() def delete_doctypes(): from webnotes.model import delete_doc delete_doc("DocType", "Production Control") delete_doc("DocType", "BOM Control") def rename_module(): webnotes.reload_doc("core", "doctype", "...
agpl-3.0
zzicewind/nova
nova/virt/hyperv/snapshotops.py
25
5816
# Copyright 2012 Cloudbase Solutions Srl # 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 r...
apache-2.0
khkaminska/scikit-learn
sklearn/linear_model/tests/test_logistic.py
59
35368
import numpy as np import scipy.sparse as sp from scipy import linalg, optimize, sparse import scipy from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from...
bsd-3-clause
ishalyminov/memn2n
tf_config.py
1
1480
import tensorflow as tf def configure(in_config): tf.flags.DEFINE_float( 'learning_rate', in_config['learning_rate'], 'Learning rate for Adam Optimizer' ) tf.flags.DEFINE_float( 'epsilon', in_config['epsilon'], 'Epsilon value for Adam Optimizer' ) tf...
mit
hbrunn/OpenUpgrade
addons/website_event/models/event.py
44
5246
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
kaixinjxq/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_script-src_cross-origin_unsafe-inline.py
30
3230
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "script-src " + url1 +...
bsd-3-clause
Deepakkothandan/ansible
lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py
27
109137
#!/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
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/sklearn/metrics/tests/test_ranking.py
3
43099
from __future__ import division, print_function import numpy as np from itertools import product import warnings from scipy.sparse import csr_matrix from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.random_projection import sparse_random_mat...
mit
droundy/deft
papers/thesis-kirstie/figs/plot_LJ_Potential.py
1
1142
#!/usr/bin/python3 #RUN this program from the directory it is listed in #with command ./plot_LJ_Potential.py from scipy import special import numpy as np import matplotlib.pyplot as plt import math #Plot WCA Potential vs r #R=1/1.781797436 #for a sigma=1 DOESN'T WORK!! graph wrong shape! R=1/1.781797436 epsilo...
gpl-2.0
Stavitsky/neutron
neutron/plugins/sriovnicagent/common/config.py
48
3679
# Copyright 2014 Mellanox Technologies, Ltd # # 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 t...
apache-2.0