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 |
|---|---|---|---|---|---|
waterdotorg/power.Water | project/custom/migrations/0011_auto__add_friendjoinedemaillog__add_unique_friendjoinedemaillog_user_u.py | 1 | 13099 | # -*- 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 model 'FriendJoinedEmailLog'
db.create_table('custom_friendjoinedemaillog', (
('id', se... | gpl-3.0 |
indevgr/django | tests/model_formsets/models.py | 118 | 7878 | from __future__ import unicode_literals
import datetime
import uuid
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
class Meta:
or... | bsd-3-clause |
axinging/chromium-crosswalk | chrome/common/extensions/docs/server2/branch_utility.py | 29 | 8453 | # Copyright (c) 2012 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.
import json
import logging
import operator
from environment_wrappers import CreateUrlFetcher
import url_constants
class ChannelInfo(object):
'''Repr... | bsd-3-clause |
MyAOSP/external_chromium_org | tools/perf/metrics/speedindex.py | 23 | 12282 | # Copyright 2013 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.
import collections
import os
from metrics import Metric
class SpeedIndexMetric(Metric):
"""The speed index metric is one way of measuring page load spee... | bsd-3-clause |
Julian/home-assistant | homeassistant/helpers/config_validation.py | 2 | 11624 | """Helpers for config validation using voluptuous."""
from datetime import timedelta
import jinja2
import voluptuous as vol
from homeassistant.loader import get_platform
from homeassistant.const import (
CONF_PLATFORM, CONF_SCAN_INTERVAL, TEMP_CELSIUS, TEMP_FAHRENHEIT,
CONF_ALIAS, CONF_ENTITY_ID, CONF_VALUE_T... | mit |
liangazhou/django-rdp | packages/Django-1.8.6/tests/migrations/test_commands.py | 5 | 39966 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import importlib
import os
import shutil
from django.apps import apps
from django.core.management import CommandError, call_command
from django.db import DatabaseError, connection, models
from django.db.migrations import questioner
from dja... | apache-2.0 |
HugoDelval/ip-reputation-monitoring | reputation/db/postgres.py | 1 | 4686 | #
# Copyright (C) 2016, OVH SAS
#
# This file is part of ip-reputation-monitoring.
#
# ip-reputation-monitoring 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 op... | gpl-3.0 |
qqbot-pet-game/qqbot-pet-game | Notify.py | 11 | 1533 | # -*- coding: utf-8 -*-
# Code by Yinzo: https://github.com/Yinzo
# Origin repository: https://github.com/Yinzo/SmartQQBot
class Notify:
def __init__(self, json_input):
self.poll_type = json_input['poll_type']
class InputNotify(Notify):
def __init__(self, json_input):
Notify.__in... | gpl-3.0 |
dmnielsen/zSALT | zsalt/mosred.py | 1 | 3102 |
"""
mosred
Process MOS spectral reductions of the data and produce
the output spectra for each object
"""
import os, sys, glob, shutil
import numpy as np
import pyfits
from scipy.ndimage.filters import median_filter
from pyraf import iraf
from iraf import pysalt
from saltobslog import obslog
from specselfid im... | bsd-3-clause |
StephenWeber/ansible | lib/ansible/modules/network/cumulus/_cl_interface.py | 11 | 15158 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
anntzer/scipy | scipy/linalg/matfuncs.py | 21 | 19751 | #
# Author: Travis Oliphant, March 2002
#
__all__ = ['expm','cosm','sinm','tanm','coshm','sinhm',
'tanhm','logm','funm','signm','sqrtm',
'expm_frechet', 'expm_cond', 'fractional_matrix_power',
'khatri_rao']
from numpy import (Inf, dot, diag, prod, logical_not, ravel,
transpose... | bsd-3-clause |
renatogames2/namebench | nb_third_party/simplejson/scanner.py | 674 | 2560 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | apache-2.0 |
pocmo/focus-android | tools/l10n/locales.py | 2 | 1923 | #!/usr/bin/python
# 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/.
"""This file contains various locale lists consumed by other tools"""
# Sorted list of locales that... | mpl-2.0 |
tensorflow/probability | tensorflow_probability/python/distributions/poisson_test.py | 1 | 22478 | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
nanolearningllc/edx-platform-cypress | common/djangoapps/external_auth/tests/test_shib.py | 42 | 30355 | # -*- coding: utf-8 -*-
"""
Tests for Shibboleth Authentication
@jbau
"""
import unittest
from ddt import ddt, data
from django.conf import settings
from django.http import HttpResponseRedirect
from django.test import TestCase
from django.test.client import RequestFactory, Client as DjangoTestClient
from django.test.u... | agpl-3.0 |
petrkotas/twitter-feed | twitter_feed/mock/tweets.py | 1 | 19865 | HOME_TIMELINE = [
{
'coordinates': None,
'truncated': False,
'created_at': 'Tue Aug 28 21:16:23 +0000 2012',
'favorited': False,
'id_str': '240558470661799936',
'in_reply_to_user_id_str': None,
'entities': {
'urls': [
],
'h... | mit |
radicalbit/ambari | ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py | 1 | 5636 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | apache-2.0 |
kylerbrown/scikit-learn | sklearn/feature_selection/tests/test_rfe.py | 209 | 11733 | """
Testing Recursive feature elimination
"""
import warnings
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_equal, assert_true
from scipy import sparse
from sklearn.feature_selection.rfe import RFE, RFECV
from sklearn.datasets import load_iris,... | bsd-3-clause |
rlr/fjord | vendor/packages/translate-toolkit/translate/storage/xml_extract/test_xpath_breadcrumb.py | 28 | 1256 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | bsd-3-clause |
ShiYw/Sigil | 3rdparty/python/Lib/test/test_strptime.py | 84 | 26461 | """PyUnit testing against strptime"""
import unittest
import time
import locale
import re
import sys
from test import support
from datetime import date as datetime_date
import _strptime
class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
self.assertEqual(_strptime._getla... | gpl-3.0 |
neuroidss/nupic.rogue | avogadro/model_params.py | 2 | 4002 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | agpl-3.0 |
StefanRijnhart/purchase-workflow | __unported__/purchase_landed_costs/__init__.py | 27 | 1178 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2013 Camptocamp (<http://www.camptocamp.com>)
# Authors: Ferdinand Gasauer, Joel Grand-Guillaume
#
# This program is free software: you can... | agpl-3.0 |
ENjOyAbLE1991/scrapy | scrapy/http/headers.py | 132 | 2329 | import six
from w3lib.http import headers_dict_to_raw
from scrapy.utils.datatypes import CaselessDict
class Headers(CaselessDict):
"""Case insensitive http headers dictionary"""
def __init__(self, seq=None, encoding='utf-8'):
self.encoding = encoding
super(Headers, self).__init__(seq)
de... | bsd-3-clause |
dichenko/kpk2016 | Diff/111879.py | 1 | 1032 | #Дана возрастающая последовательность целых чисел 1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17, ...
# Она сформирована следующим образом: берется одно нечетное число, затем два четных,
# затем три нечетных и так далее. Выведите N-й элемент этой последовательности.
def next_chet(x):
if x % 2 == 0:
return x + 2
... | gpl-3.0 |
edcast-inc/edx-platform-edcast | lms/djangoapps/teams/tests/test_views.py | 18 | 31646 | # -*- coding: utf-8 -*-
"""Tests for the teams API at the HTTP request level."""
# pylint: disable=maybe-no-member
import json
import ddt
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from rest_framework.test import APITestCase, APIClient
from courseware.tests.factories import Sta... | agpl-3.0 |
nsinha17/incubator-metron | metron-sensors/pycapa/pycapa/pycapa_cli.py | 5 | 2898 | #
# 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 n... | apache-2.0 |
kapsiry/sikteeri | membership/billing/payments.py | 2 | 9093 | # encoding: utf-8
import csv
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
import logging
from membership.models import BillingCycle, Payment
from membership.utils import log_change
from decimal import Decimal
logger =... | mit |
achim1/HTCTools | htctools/batchfarming.py | 1 | 33073 | """
Management of Zeuthen Batch farmjobs
"""
import sys
#
#import shlex
#import sys
#import tarfile
#import time
#import logging
#import zmq
#import os
#import sqlite3
#import re
#
#from .. import CONFIG, Logger
#from .metascript import MetaScript
#from .utils import ListSlicer, RotatingFileNamer, GetEnvshells, ExitF... | gpl-3.0 |
larsmans/scipy | scipy/stats/_discrete_distns.py | 6 | 21338 | #
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
from __future__ import division, print_function, absolute_import
from scipy import special
from scipy.special import entr, gammaln as gamln
from scipy.misc import logsumexp
from numpy import floor, ceil, log, exp, ... | bsd-3-clause |
loafbaker/django_ecommerce1 | orders/migrations/0004_auto__chg_field_order_billing_address__chg_field_order_shipping_addres.py | 1 | 8620 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Order.billing_address'
db.alter_column(u'orders_order'... | mit |
SteadfastInnovation/libhpdf-AndroidLibrary | library/jni/libhpdf-2.3.0RC2/if/python/demo/jpfont_demo.py | 32 | 6168 | ###
## * << Haru Free PDF Library 2.0.0 >> -- jpfont_demo.c
## *
## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
## *
## * Permission to use, copy, modify, distribute and sell this software
## * and its documentation for any purpose is hereby granted without fee,
## * provided that the... | apache-2.0 |
theadviceio/executer | tests/utils/test_utils_errors.py | 1 | 2265 | import sys
import os
import unittest
import tempfile
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)) + "/../../"))
import utils.errors
# logname = "/tmp/test.log"
# print("-----------------------------")
# print((" current logs in %s" % logname))
# print("-----------------------------")
... | apache-2.0 |
holgerBerger/go_ludalo | top/top.py | 1 | 13095 | #!/usr/bin/env python
#
# indices used:
#
# use goludalo
# db.<fs>.createIndex({"ts":1, "nid":1})
#
# use ludalo
# db.jobs.createIndex({"start":1})
# db.jobs.createIndex({"end":1})
# db.jobs.createIndex({"jobid":1})
import time,sys
# CONFIG
DBHOST="localhost"
SNAP = 5
PERFDB="goludalo"
JOBDB="ludalo"
JOBCO... | gpl-2.0 |
wagnerand/addons-server | src/olympia/amo/pagination.py | 4 | 3755 | from math import ceil
from django.conf import settings
from django.core.paginator import (
EmptyPage,
InvalidPage,
Page,
PageNotAnInteger,
Paginator,
)
from django.utils.functional import cached_property
class ESPaginator(Paginator):
"""
A better paginator for search results
The norma... | bsd-3-clause |
jylaxp/django | tests/admin_utils/models.py | 217 | 1821 | from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Site(models.Model):
domain = models.CharField(max_length=100)
def __str__(self):
return self.domain
class Article(models.Model):
"""
A s... | bsd-3-clause |
ndebuhr/thermo-state-solver | thermo-env/lib/python3.5/site-packages/setuptools/monkey.py | 80 | 5255 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
import inspect
from .py26compat import import_module
import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need this functionality.
"""
... | mit |
smarkwell/asuswrt-merlin | release/src/router/libxml2/python/tests/reader.py | 87 | 12441 | #!/usr/bin/python -u
# -*- coding: ISO-8859-1 -*-
#
# this tests the basic APIs of the XmlTextReader interface
#
import libxml2
import StringIO
import sys
# Memory debug specific
libxml2.debugMemory(1)
f = StringIO.StringIO("""<a><b b1="b1"/><c>content of c</c></a>""")
input = libxml2.inputBuffer(f)
reader = input.ne... | gpl-2.0 |
garnachod/classification | src/Clasificadores/NodosPalabras/Nodo.py | 1 | 1286 | import random
class Nodo(object):
"""docstring for Nodo"""
def __init__(self, palabra):
super(Nodo, self).__init__()
self.nodosConectados = {}
self.palabra = palabra
def setConexo(self, nodo):
#peso = random.random() - 0.5
peso = 0.1
palabra = nodo.getPalabra()
self.nodosConectados[palabra] = peso
... | apache-2.0 |
zahodi/ansible | lib/ansible/modules/system/lvg.py | 25 | 9874 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
#
# 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 p... | gpl-3.0 |
hsaputra/tensorflow | tensorflow/compiler/tests/stateless_random_ops_test.py | 18 | 4817 | # 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 |
carlohamalainen/nipype | examples/fmri_fsl_reuse.py | 14 | 9833 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
=========================
fMRI: FSL reuse workflows
=========================
A workflow that uses fsl to perform a first level analysis on the nipype
tutorial data set::
pyt... | bsd-3-clause |
bdh1011/wau | venv/lib/python2.7/site-packages/twisted/mail/imap4.py | 10 | 214306 | # -*- test-case-name: twisted.mail.test.test_imap -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An IMAP4 protocol implementation
@author: Jp Calderone
To do::
Suspend idle timeout while server is processing
Use an async message parser instead of buffering in memory
Figure out ... | mit |
mpalmi/clip | packages/scap-security-guide/scap-security-guide-0.1.25/shared/modules/verify_cce_module.py | 4 | 1790 | #!/usr/bin/python
import sys
import platform
from lxml import etree
# This script checks the validity of assigned CCEs, lists granted and remaining
# available CCEs, and checks for duplicates.
release = '%.0f' % float(platform.linux_distribution()[1])
xccdf_ns = "http://checklists.nist.gov/xccdf/1.1"
tree = etree.p... | apache-2.0 |
yosshy/nova | nova/tests/unit/api/openstack/compute/test_extended_volumes.py | 21 | 6485 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v2_6_0/device_filter_set_broker.py | 14 | 51137 | from ..broker import Broker
class DeviceFilterSetBroker(Broker):
controller = "device_filter_sets"
def show(self, **kwargs):
"""Shows the details for the specified device filter set.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
... | apache-2.0 |
mbox/django | tests/admin_changelist/models.py | 96 | 2583 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(mo... | bsd-3-clause |
lukebarnard1/bokeh | bokeh/models/map_plots.py | 3 | 1834 | """ Models for displaying maps in Bokeh plots.
"""
from __future__ import absolute_import
from ..properties import HasProps
from ..properties import Int, Float, Enum, Instance
from ..enums import MapType
from .plots import Plot
class GMapOptions(HasProps):
""" Options for GMapPlot objects.
"""
lat = F... | bsd-3-clause |
Flexget/Flexget | flexget/tests/test_qualities.py | 3 | 11641 | import pytest
from jinja2 import Template
from flexget.components.parsing.parsers.parser_guessit import ParserGuessit
from flexget.components.parsing.parsers.parser_internal import ParserInternal
from flexget.utils.qualities import Quality
class TestQualityModule:
def test_get(self):
assert not Quality()... | mit |
ibyer/xhtml2pdf | test/witherror.py | 154 | 1128 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
tealover/nova | nova/safe_utils.py | 23 | 2343 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
rayNymous/nupic | src/nupic/regions/ImageSensorFilters/Tracking.py | 17 | 11228 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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 progra... | agpl-3.0 |
gustavovaliati/ci724-finalwork-ppginfufpr-2016 | util/google/retrain.py | 19 | 43141 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
Minhua722/NMF | egs/ar/local/ar_extract_nmf_feats.py | 1 | 3850 | #!/usr/bin/env python
import cv2
import numpy as np
import argparse
import math
import pickle
from sklearn.decomposition import PCA
from nmf_support import *
import sys, os
if __name__ == '__main__':
#------------------------------------------------------
# Args parser
#--------------------------------------... | apache-2.0 |
CubicERP/geraldo | site/newsite/site-geraldo/django/contrib/webdesign/lorem_ipsum.py | 439 | 4872 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... | lgpl-3.0 |
pombredanne/btnet | beautifulsoup4-4.3.2/bs4/builder/_htmlparser.py | 412 | 8839 | """Use the HTMLParser library to parse HTML files that aren't too bad."""
__all__ = [
'HTMLParserTreeBuilder',
]
from HTMLParser import (
HTMLParser,
HTMLParseError,
)
import sys
import warnings
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument, which we'd like to s... | gpl-2.0 |
programadorjc/django | tests/forms_tests/tests/test_regressions.py | 155 | 8024 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms import (
CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm,
ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select,
TextInput,
)
from django.test import TestCase, ignore_warnings
from django.utils... | bsd-3-clause |
kangfend/django | tests/introspection/tests.py | 207 | 8471 | from __future__ import unicode_literals
from unittest import skipUnless
from django.db import connection
from django.db.utils import DatabaseError
from django.test import TransactionTestCase, mock, skipUnlessDBFeature
from .models import Article, Reporter
class IntrospectionTests(TransactionTestCase):
availab... | bsd-3-clause |
qPCR4vir/orange | Orange/projection/mds.py | 6 | 14713 | """
.. index:: multidimensional scaling (mds)
.. index::
single: projection; multidimensional scaling (mds)
**********************************
Multidimensional scaling (``mds``)
**********************************
The functionality to perform multidimensional scaling
(http://en.wikipedia.org/wiki/Multidimensional_... | gpl-3.0 |
AMOboxTV/AMOBox.LegoBuild | script.module.unidecode/lib/unidecode/x0ce.py | 253 | 4708 | data = (
'cwik', # 0x00
'cwit', # 0x01
'cwip', # 0x02
'cwih', # 0x03
'cyu', # 0x04
'cyug', # 0x05
'cyugg', # 0x06
'cyugs', # 0x07
'cyun', # 0x08
'cyunj', # 0x09
'cyunh', # 0x0a
'cyud', # 0x0b
'cyul', # 0x0c
'cyulg', # 0x0d
'cyulm', # 0x0e
'cyulb', # 0x0f
'cyuls', # 0x1... | gpl-2.0 |
acrsilva/animated-zZz-machine | bundle_final_app/libs/pyqtgraph-develop/pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate_pyqt.py | 38 | 6134 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './pyqtgraph/graphicsItems/ViewBox/axisCtrlTemplate.ui'
#
# Created: Mon Dec 23 10:10:51 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from ...Qt import QtCore, QtGui
try:
_fromUtf... | lgpl-3.0 |
grantsewell/nzbToMedia | libs/requests/packages/urllib3/contrib/pyopenssl.py | 215 | 10101 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... | gpl-3.0 |
kkopachev/thumbor | integration_tests/__init__.py | 4 | 1410 | import os.path
from shutil import which
from tornado.testing import AsyncHTTPTestCase
from thumbor.app import ThumborServiceApp
from thumbor.config import Config
from thumbor.context import Context, ServerParameters
from thumbor.importer import Importer
class EngineCase(AsyncHTTPTestCase):
def get_app(self):
... | mit |
haocs/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/autorestswaggerbatfileservice/models/error.py | 211 | 1286 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Fastcode/NUClearExample | nuclear/b.py | 1 | 3760 | #!/usr/bin/env python3
import sys
import os
import argparse
import pkgutil
import re
# Don't make .pyc files
sys.dont_write_bytecode = True
# Go and get all the relevant directories and variables from cmake
nuclear_dir = os.path.dirname(os.path.realpath(__file__))
project_dir = os.path.dirname(nuclear_dir)
# Get the... | mit |
darkleons/BE | addons/sale_journal/__init__.py | 443 | 1067 | # -*- 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 |
drimer/NetControl | webconf/settings.py | 1 | 2783 | """
Django settings for NetControl project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build p... | gpl-2.0 |
yrobla/nova | nova/tests/test_libvirt.py | 1 | 220373 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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
#
# ... | apache-2.0 |
clovett/MissionPlanner | Lib/encodings/cp850.py | 93 | 35059 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.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_map)
def decode(self,input,errors=... | gpl-3.0 |
willhighland/azure-quickstart-templates | splunk-on-ubuntu/scripts/dobackup.py | 119 | 3256 | #!/usr/bin/env python3
# The MIT License (MIT)
#
# Copyright (c) 2016 Microsoft. All rights reserved.
#
# 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 restr... | mit |
alhashash/account-financial-tools | account_auto_fy_sequence/models/__init__.py | 38 | 1157 | # coding=utf-8
##############################################################################
#
# account_auto_fy_sequence module for Odoo
# Copyright (C) 2014 ACSONE SA/NV (<http://acsone.eu>)
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# account_auto_fy_sequence is free software:
# you can ... | agpl-3.0 |
nhicher/ansible | lib/ansible/modules/network/avi/avi_sslprofile.py | 20 | 8497 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
python-diamond/Diamond | src/diamond/test/testcollector.py | 9 | 3608 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from mock import patch
from test import unittest
import configobj
from diamond.collector import Collector
class BaseCollectorTest(unittest.TestCase):
def test_SetCustomHostname(self):
config = co... | mit |
rtrajano/sphinx_rtfd | docs/conf.py | 1 | 8478 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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
# ... | bsd-3-clause |
meteorcloudy/tensorflow | tensorflow/contrib/kafka/python/ops/kafka_dataset_ops.py | 19 | 2777 | # 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 |
xtmhm2000/scrapy-0.22 | scrapy/tests/test_contracts.py | 7 | 4126 | from unittest import TextTestRunner
from twisted.trial import unittest
from scrapy.spider import Spider
from scrapy.http import Request
from scrapy.item import Item, Field
from scrapy.contracts import ContractsManager
from scrapy.contracts.default import (
UrlContract,
ReturnsContract,
ScrapesContract,
)
... | bsd-3-clause |
AndreasMadsen/tensorflow | tensorflow/contrib/labeled_tensor/python/ops/core_test.py | 11 | 30549 | # 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 |
gunchleoc/django | tests/shortcuts/tests.py | 132 | 3291 | from django.test import SimpleTestCase, override_settings
from django.test.utils import require_jinja2
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(SimpleTestCase):
def test_render_to_response(self):
response = self.client.get('/render_to_response/')
self.assertEqu... | bsd-3-clause |
Kagee/youtube-dl | youtube_dl/extractor/nhl.py | 9 | 6949 | from __future__ import unicode_literals
import re
import json
import os
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_urllib_parse,
compat_urllib_parse_urlparse
)
from ..utils import (
unified_strdate,
)
class NHLBaseInfoExtractor(InfoExtractor):
@staticmethod
... | unlicense |
maryklayne/Funcao | examples/intermediate/mplot3d.py | 14 | 1261 | #!/usr/bin/env python
"""Matplotlib 3D plotting example
Demonstrates plotting with matplotlib.
"""
import sys
from sample import sample
from sympy import sin, Symbol
from sympy.external import import_module
def mplot3d(f, var1, var2, show=True):
"""
Plot a 3d function using matplotlib/Tk.
"""
im... | bsd-3-clause |
noba3/KoTos | addons/plugin.video.xstream/sites/gstream_in.py | 1 | 15009 | # -*- coding: utf-8 -*-
from resources.lib.util import cUtil
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.lib.config import cConfig
from resources.lib ... | gpl-2.0 |
shirtsgroup/InterMol | doc/conf.py | 3 | 8795 | # -*- coding: utf-8 -*-
#
# InterMol documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 23 13:01:05 2015.
#
# 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.
#
# ... | mit |
ForkedReposBak/mxnet | python/mxnet/symbol/numpy/linalg.py | 9 | 35356 | # 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 |
peguin40/zulip | zerver/templatetags/app_filters.py | 7 | 2706 | from django.conf import settings
from django.template import Library
from django.utils.safestring import mark_safe
from django.utils.lru_cache import lru_cache
from zerver.lib.utils import force_text
import zerver.lib.bugdown.fenced_code
import markdown
import markdown.extensions.codehilite
import markdown.extensions... | apache-2.0 |
basho-labs/riak-cxx-client | deps/boost-1.47.0/tools/build/v2/tools/common.py | 10 | 31622 | # Status: being ported by Steven Watanabe
# Base revision: 47174
#
# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, an... | apache-2.0 |
jtux270/translate | FreeIPA/freeipa-3.0.0/tests/test_xmlrpc/test_pwpolicy_plugin.py | 2 | 9060 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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
# th... | gpl-3.0 |
elainexmas/boto | tests/integration/ec2containerservice/__init__.py | 99 | 1122 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 t... | mit |
rokihi/ObjectDetector | YOLO_tiny_tf.py | 1 | 9863 | import numpy as np
import tensorflow as tf
import cv2
import time
import sys
class YOLO_TF:
fromfile = None
tofile_img = 'test/output.jpg'
tofile_txt = 'test/output.txt'
imshow = True
filewrite_img = False
filewrite_txt = False
disp_console = True
weights_file = 'weights/YOLO_tiny.ckpt'
alpha = 0.1
threshold... | lgpl-3.0 |
youprofit/godot | platform/osx/detect.py | 19 | 2873 |
import os
import sys
def is_active():
return True
def get_name():
return "OSX"
def can_build():
if (sys.platform != "darwin"):
return False
return True # osx enabled
def get_opts():
return [
('force_64_bits','Force 64 bits binary','no'),
]
def get_flags():
return [
('opengl', 'no'),
('lega... | mit |
foreni-packages/hachoir-core | hachoir_core/i18n.py | 86 | 6241 | # -*- coding: UTF-8 -*-
"""
Functions to manage internationalisation (i18n):
- initLocale(): setup locales and install Unicode compatible stdout and
stderr ;
- getTerminalCharset(): guess terminal charset ;
- gettext(text) translate a string to current language. The function always
returns Unicode string. You can a... | gpl-2.0 |
ace02000/pyload | module/plugins/accounts/FourSharedCom.py | 3 | 1164 | # -*- coding: utf-8 -*-
from module.plugins.internal.Account import Account
from module.plugins.internal.Plugin import set_cookie
class FourSharedCom(Account):
__name__ = "FourSharedCom"
__type__ = "account"
__version__ = "0.09"
__status__ = "testing"
__description__ = """FourShared.com a... | gpl-3.0 |
sspreitzer/tahoe-lafs | src/allmydata/immutable/encode.py | 6 | 30138 | # -*- test-case-name: allmydata.test.test_encode -*-
import time
from zope.interface import implements
from twisted.internet import defer
from foolscap.api import fireEventually
from allmydata import uri
from allmydata.storage.server import si_b2a
from allmydata.hashtree import HashTree
from allmydata.util import math... | gpl-2.0 |
ThiefMaster/indico | indico/modules/search/internal.py | 2 | 4309 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from sqlalchemy.orm import subqueryload, undefer
from indico.core.db.sqlalchemy.protection import Protect... | mit |
lyan6/genenetwork2 | wqflask/wqflask/views.py | 1 | 30443 | # -*- coding: utf-8 -*-
#
# Main routing table for GN2
from __future__ import absolute_import, division, print_function
import traceback # for error page
import os # for error gifs
import random # for random error gif
import datetime # for errors
import time # for errors
import sys
import csv
import x... | agpl-3.0 |
hmpf/nav | python/nav/topology/detector.py | 2 | 5910 | #
# Copyright (C) 2011, 2012 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV 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 th... | gpl-3.0 |
imarqs/ardupilot | Tools/LogAnalyzer/tests/TestEvents.py | 273 | 1798 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestEvents(Test):
'''test for erroneous events and failsafes'''
# TODO: need to check for vehicle-specific codes
def __init__(self):
Test.__init__(self)
self.name = "Event/Failsafe"
def run(self, logdata, verbose):
self.result = TestResult(... | gpl-3.0 |
Praetonus/Arc | src/arc/huffman.py | 1 | 5696 | #!/usr/bin/python3.4
#-*- coding: utf-8 -*-
########################################################################
# Copyright 2014 Benoît Vey #
# #
# This file is part of Arc. ... | gpl-3.0 |
edisongustavo/asv | test/test_results.py | 2 | 1849 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from os.path import join
import six
from asv import results, util
import pytest
def test_results(tmpdir):
... | bsd-3-clause |
avaris/aBibliophile | searchmodel.py | 1 | 1847 | #!/usr/bin/env python
# -.- coding: utf-8 -.-
# Author : Deniz Turgut
# Created : 05.11.2011
from PyQt4 import QtGui, QtCore
class SearchModel(QtGui.QSortFilterProxyModel):
def __init__(self, parent=None):
super(SearchModel, self).__init__(parent)
self.setSortCaseSensitivity(QtCore.Qt.CaseInsensi... | gpl-3.0 |
larsks/cobbler-larsks | apitests/system_test.py | 12 | 2041 | """
Copyright 2009, Red Hat, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that ... | gpl-2.0 |
piquadrat/django | tests/view_tests/generic_urls.py | 72 | 1313 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import RedirectView
from . import views
from .models import Article, DateArticle
date_based_info_dict = {
'queryset': Article.objects.all(),
'date_field': 'date_created',
'month_format': '%m',
}
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.