repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
saleemjaveds/https-github.com-openstack-nova
nova/tests/virt/vmwareapi/test_vim_util.py
4
4736
# Copyright (c) 2013 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 a...
apache-2.0
willhess/aima-python
submissions/Johnson/myNN.py
13
4766
import traceback from sklearn.neural_network import MLPClassifier from submissions.Johnson import education class DataFrame: data = [] feature_names = [] target = [] target_names = [] moneyvsthings = DataFrame() joint = {} educations = education.get_all_states() for each in educations: try: ...
mit
yordan-desta/QgisIns
python/plugins/processing/gui/CrsSelectionPanel.py
8
2559
# -*- coding: utf-8 -*- """ *************************************************************************** CrsSelectionPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************...
gpl-2.0
tszabo-ro/paparazzi
sw/airborne/test/stabilization/setup.py
83
2143
from distutils.core import setup, Extension from Cython.Build import cythonize from distutils.extension import Extension import numpy from os import path, getenv # if PAPARAZZI_SRC not set, then assume the tree containing this # file is a reasonable substitute pprz_src = getenv("PAPARAZZI_SRC", path.normpath(path.joi...
gpl-2.0
jiangzhixiao/odoo
openerp/tools/graph.py
441
26118
#!/usr/bin/env python # -*- 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 unde...
agpl-3.0
mgadi/naemonbox
sources/psdash/Werkzeug-0.7/werkzeug/utils.py
4
23011
# -*- coding: utf-8 -*- """ werkzeug.utils ~~~~~~~~~~~~~~ This module implements various utilities for WSGI applications. Most of them are used by the request and response wrappers but especially for middleware development it makes sense to use them without the wrappers. :copyright: (c) 2011 ...
gpl-2.0
drpaneas/linuxed.gr
lib/python2.7/site-packages/pelican/readers.py
4
21032
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import os import re import docutils import docutils.core import docutils.io from docutils.writers.html4css1 import HTMLTranslator import six # import the directives to have pygments support from pelican import rstdirective...
mit
raychorn/knowu
django/djangononrelsample2/users/templatetags/ifusergroup.py
1
1250
from django import template from django.template import resolve_variable from django.contrib.auth.models import Group register = template.Library() @register.tag() def ifusergroup(parser, token): """ Check to see if the currently logged in user belongs to a specific group. Requires the Django authent...
lgpl-3.0
joariasl/odoo
addons/hw_scale/__openerp__.py
220
1699
# -*- 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
rjdp/Easynginedemoplugin
ee/cli/plugins/info.py
1
9635
"""EEInfo Plugin for EasyEngine.""" from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from pynginxconfig import NginxConfig from ee.core.aptget import EEAptGet from ee.core.shellexec import EEShellExec from ee.core.logging import Log import os import configparser d...
mit
hairychris/django-feedreader
feedreader/simple_test_server.py
2
2263
"""Local Server to return RSS feed data for unit testing""" from __future__ import absolute_import import SimpleHTTPServer import SocketServer import threading PORT = 8081 TEST_RSS = """<?xml version="1.0" encoding="utf-8"?> <rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <channel> <title>tes...
bsd-3-clause
julen/translate
translate/convert/txt2po.py
25
3160
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-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...
gpl-2.0
hgoldwire/bikewatch
rasp_pi/bikewatch.py
1
3222
#!/usr/bin/env python import sys import logging import pubnub from pubnub.pnconfiguration import PNConfiguration from pubnub.pubnub import PubNub, SubscribeListener, PNReconnectionPolicy from pubnub.callbacks import SubscribeCallback from pubnub.enums import PNStatusCategory pubnub.set_stream_logger('pubnub', log...
mit
oew1v07/scikit-image
doc/examples/plot_rank_mean.py
17
1499
""" ============ Mean filters ============ This example compares the following mean filters of the rank filter package: * **local mean**: all pixels belonging to the structuring element to compute average gray level. * **percentile mean**: only use values between percentiles p0 and p1 (here 10% and 90%). * *...
bsd-3-clause
stasiek/robotframework
src/robot/tidy.py
6
11867
#!/usr/bin/env python # Copyright 2008-2015 Nokia Solutions and Networks # # 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
CentralLabFacilities/simple_robot_gaze_plugins
srgplugins/mekarobot/mekahead.py
1
2688
""" Copyright(c) <Florian Lier, Simon Schulz> http://opensource.cit-ec.de/fsmt This file may be licensed under the terms of the GNU Lesser General Public License Version 3 (the ``LGPL''), or (at your option) any later version. Software distributed under the License is distributed on an ``AS IS'' basis, WITHOUT WARRA...
gpl-3.0
Axiologue/AxiologueAPI
forum/serializers.py
1
2202
from rest_framework import serializers from django.contrib.auth import get_user_model from .models import Thread, Post, Category from common.serializers import LocalDateTimeField User = get_user_model() class CategoryListSerializer(serializers.ModelSerializer): id = serializers.ReadOnlyField() thread_count...
mit
guewen/OpenUpgrade
addons/l10n_si/__openerp__.py
430
1826
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright: (C) 2012 - Mentis d.o.o., Dravograd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affe...
agpl-3.0
michael-dev2rights/ansible
lib/ansible/modules/network/panos/panos_loadcfg.py
29
3560
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
highfei2011/spark
python/pyspark/streaming/tests/test_dstream.py
7
24164
# # 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
GRArmstrong/invenio-inspire-ops
modules/bibfield/lib/functions/get_number_of_copies.py
24
1192
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio 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 t...
gpl-2.0
negacy/TIMEXCCP-PYTHON
knowtator2crf_format.py
1
8922
''' takes input xml files which is output of knowtator and extracts features which fits mallet CRF format CRF format is: <feature1><feature2> ... <featureN><label> ''' import xml.etree.ElementTree as ET import os import nltk import codecs path = './tmp.in.xml.demo'#del' #parent directory of the xml files. All xml f...
lgpl-2.1
nRFMesh/mbed-os
tools/build_release.py
49
8381
#! /usr/bin/env python """ mbed SDK Copyright (c) 2011-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable...
apache-2.0
harshravi/mynew-django-project
products/migrations/0004_auto__del_field_product_image.py
3
1698
# -*- 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): # Deleting field 'Product.image' db.delete_column(u'products_product', 'i...
apache-2.0
lmorchard/django
tests/generic_inline_admin/models.py
281
1708
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Episode(models.Model): name = models.CharField(max_length=100) ...
bsd-3-clause
eloquence/unisubs
apps/teams/tests/test_cache.py
6
2005
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 (at your op...
agpl-3.0
generaltrung/GetLinkFshare
fshare.py
1
4955
import ctypes import json import os import signal import subprocess import requests libc = ctypes.CDLL("libc.so.6") def set_pdeathsig(sig=signal.SIGTERM): def call_able(): return libc.prctl(1, sig) return call_able def dump_token(file_path, token, session_id): with open(file_path, 'w') as cur...
gpl-3.0
FlorinPetriuc/linux-1-moved-to-OpenChannelSSD-linux-nba_target
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
radiasoft/radtrack
radtrack/util/RbMath.py
1
6556
import math # Round number x to sig significant figures def roundSigFig(x, sig): try: # find a, b such that x = a*10^b (1 <= a < 10) b = math.floor(math.log10(abs(x))) a = x/(10**b) return round(a, sig-1)*(10**b) except ValueError: return 0 rpnOp = dict() # Basic Math ...
apache-2.0
Argon-Zhou/django
tests/files/tests.py
277
11286
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import os import struct import tempfile import unittest from io import BytesIO, StringIO from django.core.files import File from django.core.files.base import ContentFile from django.core.files.move import file_move_safe from django.core.file...
bsd-3-clause
40223145c2g18/40223145
static/Brython3.1.0-20150301-090019/Lib/multiprocessing/__init__.py
693
6866
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
gpl-3.0
jasonwzhy/django
tests/admin_views/test_adminsite.py
247
2992
from __future__ import unicode_literals import datetime from django.conf.urls import url from django.contrib import admin from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase, override_settings from django.test.client import RequestFactory from .mo...
bsd-3-clause
boyuegame/kbengine
kbe/res/scripts/common/Lib/test/test_re.py
60
68082
from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ cpython_only, captured_stdout import io import re from re import Scanner import sre_compile import sre_constants import sys import string import traceback import unittest from weakref import proxy # Misc tests from Tim Peters' re.do...
lgpl-3.0
randynobx/ansible
lib/ansible/modules/notification/mqtt.py
70
6870
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, 2014, Jan-Piet Mens <jpmens () gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
leedm777/ansible-modules-core
cloud/rackspace/rax_keypair.py
157
4957
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
TEAM-Gummy/platform_external_chromium_org
tools/json_schema_compiler/dart_generator_test.py
25
2388
#!/usr/bin/env python # 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 os import sys import unittest from compiler import GenerateSchema # If --rebase is passed to this test, this is set to Tru...
bsd-3-clause
rosemead/namebench
nb_third_party/dns/namedict.py
248
2107
# Copyright (C) 2003-2007, 2009, 2010 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 ...
apache-2.0
NoelMacwan/android_Kernel_sony_msm8974
scripts/gcc-wrapper.py
1276
3382
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain th...
gpl-2.0
sasmita/upm
examples/python/grovetemp.py
7
1892
from __future__ import print_function # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Contributions: Sarah Knepper <sarah.knepper@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 fi...
mit
SmartPeople/zulip
zerver/lib/message.py
1
14475
from __future__ import absolute_import import datetime import ujson import zlib from django.utils.translation import ugettext as _ from six import binary_type from typing import Set, Text from zerver.lib.avatar import get_avatar_url from zerver.lib.avatar_hash import gravatar_hash import zerver.lib.bugdown as bugdo...
apache-2.0
zofuthan/edx-platform
common/djangoapps/student/management/commands/transfer_students.py
108
6066
""" Transfer Student Management Command """ from django.db import transaction from opaque_keys.edx.keys import CourseKey from optparse import make_option from django.contrib.auth.models import User from student.models import CourseEnrollment from shoppingcart.models import CertificateItem from track.management.tracked_...
agpl-3.0
damiansoriano/odoo
openerp/addons/base/ir/ir_ui_menu.py
316
20548
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can ...
agpl-3.0
SEJeff/aurproxy
tellapart/aurproxy/register/route53.py
6
10176
# Copyright 2015 TellApart, 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 writi...
apache-2.0
chrismeyersfsu/ansible-modules-core
network/nxos/nxos_ping.py
8
13265
#!/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
KaiSforza/pywer
libaur/__init__.py
1
1346
# -*- coding: utf-8 -*- __full_license__ = ''' MIT/X Consortium License © 2013-13 William Giokas <1007380@gmail.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, includin...
mit
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/test/test_cgi.py
43
15492
from test.test_support import run_unittest, check_warnings import cgi import os import sys import tempfile import unittest from collections import namedtuple class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi module argv = []...
gpl-3.0
Ormod/Diamond
src/collectors/ntpd/ntpd.py
35
3775
# coding=utf-8 """ Collect stats from ntpd #### Dependencies * subprocess """ import subprocess import diamond.collector from diamond.collector import str_to_bool class NtpdCollector(diamond.collector.Collector): def get_default_config_help(self): config_help = super(NtpdCollector, self).get_de...
mit
P0cL4bs/WiFi-Pumpkin
plugins/external/Responder/tools/FindSMB2UPTime.py
5
2160
#!/usr/bin/env python # This file is part of Responder # Original work by Laurent Gaffie - Trustwave Holdings # # 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, o...
gpl-3.0
tu-rbo/differentiable-particle-filters
experiments/evaluation_kitti.py
1
9895
import tensorflow as tf from methods.dpf_kitti import DPF from methods.odom import OdometryBaseline from utils.data_utils_kitti import load_data, noisyfy_data, make_batch_iterator, remove_state, split_data, load_kitti_sequences, make_batch_iterator_for_evaluation, wrap_angle, plot_video from utils.exp_utils_kitti impo...
mit
piquadrat/django
django/contrib/sessions/backends/cached_db.py
27
2686
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone KEY_PREFIX = "django.contrib....
bsd-3-clause
datawrestler/after-hours
afterhours/utils.py
1
3958
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Jason Lewris" __license__ = "MIT" __version__ = "0.2.1" __maintainer__ = "Jason Lewris" __email__ = "datawrestler@gmail.com" __status__ = "Beta" import re from datetime import datetime class Settings(object): """ Convenience class to store main cal...
mit
igemsoftware/HFUT-China_2015
utils/successRate(1).py
2
2881
import json import urllib2 def test_markov_successRate(testData): data_length = len(testData) successfulCount = 0 for part in range(data_length - 1): current_id = testData[part] req = urllib2.Request('http://localhost:8000/home/seqRecommend?part=%s' % current_id) response = urllib2.urlopen(req) resStr = ...
apache-2.0
compulab/cm-qs600-kernel
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
tedder/ansible
lib/ansible/modules/network/fortios/fortios_authentication_setting.py
24
8962
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
neumerance/deploy
.venv/lib/python2.7/site-packages/docutils/parsers/rst/languages/fr.py
128
3709
# $Id: fr.py 7119 2011-09-02 13:00:23Z milde $ # Authors: David Goodger <goodger@python.org>; William Dode # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be...
apache-2.0
gitaarik/django
tests/generic_relations/tests.py
8
29649
from __future__ import unicode_literals from django import forms from django.contrib.contenttypes.forms import generic_inlineformset_factory from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError from django.db import IntegrityError from django.db.models import Q from ...
bsd-3-clause
alphagov/stagecraft
one_off_migrate_to_transactions_by_channel.py
1
2432
#!/usr/bin/env python # encoding: utf-8 from stagecraft.libs.mass_update import migrate_data_set from stagecraft.apps.datasets.models import DataGroup, DataSet, DataType import sys transaction_by_channel_data_set_mappings = [ { 'old_data_set': { 'data_group': "carers-allowance", 'da...
mit
djkonro/client-python
kubernetes/client/models/v1beta1_certificate_signing_request_condition.py
2
5809
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
zhouyuan/ceph-deploy
ceph_deploy/tests/unit/test_conf.py
11
6171
from cStringIO import StringIO from textwrap import dedent import pytest from mock import Mock, patch from ceph_deploy import conf from ceph_deploy.tests import fakes class TestLocateOrCreate(object): def setup(self): self.fake_write = Mock(name='fake_write') self.fake_file = fakes.mock_open(data...
mit
Vespa314/bilibili-api
Alfred/Bangumi/Source/bangumi.py
4
3403
# -*- coding: utf-8 -*- """ Created on Mon May 26 23:42:03 2014 @author: Administrator """ from support import * from Feedback import * import hashlib import datetime def GetSign(params,appkey,AppSecret=None): """ 获取新版API的签名,不然会返回-3错误 待添加:【重要!】 需要做URL编码并保证字母都是大写,如 %2F """ params['appkey']=appke...
mit
when30/namebench
libnamebench/charts_test.py
175
5898
#!/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
RabadanLab/Pandora
helpers/assembly_helpers.py
1
5524
#!/usr/bin/env python """ Helper functions for the assembly step ~~~~~~ """ import sys import numpy as np from scipy.stats import entropy # ------------------------------------- def norm_entropy(count_list): """compute entropy from coverage""" count_vector = np.array(count_list) prob_vector = c...
mit
rafaeltomesouza/frontend-class1
aula2/a13/linkedin/client/.gradle/yarn/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit
dims/nova
nova/db/sqlalchemy/migrate_repo/versions/232_drop_dump_tables.py
81
1048
# Copyright 2014, 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 agr...
apache-2.0
sti-lyneos/shop
tests/test_origin.py
3
1102
import apt import os import unittest from tests.utils import ( DATA_DIR, setup_test_env, url_accessable, ) setup_test_env() class TestOrigins(unittest.TestCase): """ tests the origin code """ @unittest.skipUnless( url_accessable("http://de.archive.ubuntu.com/ubuntu", "dists/"), "...
lgpl-3.0
c0ntribut0r/django-clean-urls
example/gallery/migrations/0003_category.py
1
1196
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-11-07 10:33 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): dependencies = [ ('gallery', '0002_photographer_image'), ...
mit
tectronics/smap-data
python/smap/loader.py
4
10882
""" Copyright (c) 2011, 2012, Regents of the University of California 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 l...
bsd-2-clause
nicain/dipde_dev
dipde/internals/network.py
1
10013
# Copyright 2013 Allen Institute # This file is part of dipde # dipde 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. # # dipde is dis...
gpl-3.0
jaggu303619/asylum
openerp/tests/test_mail.py
37
20377
#!/usr/bin/env python # -*- coding: utf-8 -*- # This test can be run stand-alone with something like: # > PYTHONPATH=. python2 openerp/tests/test_misc.py ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP...
agpl-3.0
guewen/OpenUpgrade
addons/crm_partner_assign/report/crm_lead_report.py
40
5264
# -*- 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
mehdidc/scikit-learn
sklearn/metrics/metrics.py
233
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
samuelhavron/heroku-buildpack-python
Python-3.4.3/Lib/datetime.py
147
75376
"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ import time as _time import math as _math def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max.toordinal()...
mit
dgjustice/ansible
lib/ansible/plugins/action/template.py
26
8270
# (c) 2015, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
adobe/chromium
third_party/tlslite/tlslite/utils/OpenSSL_AES.py
359
1822
"""OpenSSL/M2Crypto AES implementation.""" from cryptomath import * from AES import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_AES(key, mode, IV) class OpenSSL_AES(AES): def __init__(self, key, mode, IV): AES.__init__(self, key, mode, IV, "openssl") ...
bsd-3-clause
mdworks2016/work_development
Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/chardet/sbcsgroupprober.py
273
3546
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
apache-2.0
ray-project/ray
python/ray/autoscaler/_private/commands.py
1
51429
import copy from concurrent.futures import ThreadPoolExecutor import datetime import hashlib import json import logging import os import random import shutil import sys import subprocess import tempfile import time from types import ModuleType from typing import Any, Dict, List, Optional, Tuple, Union import click imp...
apache-2.0
ravchandra/uploader
demo/demo/urls.py
1
1994
from django.conf.urls import include, url from django.contrib.auth import views as auth_views from demo import views as demo_views import settings from django.contrib import admin admin.autodiscover() urlpatterns = [url(r'^admin/', include(admin.site.urls)), url(r'^accounts/', include('registration.backends.simpl...
mit
nsteinme/phy
phy/traces/detect.py
2
13117
# -*- coding: utf-8 -*- """Spike detection.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import numpy as np from six import string_types from six.moves import range, zip from ..utils.array...
bsd-3-clause
asser/django
django/contrib/gis/db/backends/postgis/introspection.py
330
5441
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.postgresql.introspection import DatabaseIntrospection class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until # introspectio...
bsd-3-clause
C00kiie/Youtube-Mp3-telegram-bot
youtube_dl/extractor/slideshare.py
39
2132
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, get_element_by_id, ) class SlideshareIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?slideshare\.net/[^/]+?/(?P<title>....
mit
jonathon-love/snapcraft
snapcraft/internal/deltas/_deltas.py
5
7838
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
gpl-3.0
bsipocz/astropy
astropy/timeseries/periodograms/lombscargle/implementations/scipy_impl.py
2
2474
import numpy as np def lombscargle_scipy(t, y, frequency, normalization='standard', center_data=True): """Lomb-Scargle Periodogram This is a wrapper of ``scipy.signal.lombscargle`` for computation of the Lomb-Scargle periodogram. This is a relatively fast version of the naive O...
bsd-3-clause
objmagic/heron
heron/pyheron/tests/python/topology_unittest.py
8
9841
# Copyright 2016 Twitter. 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 agree...
apache-2.0
pombredanne/bokeh
examples/models/buttons_server.py
5
2393
from __future__ import print_function from bokeh.client import push_session from bokeh.document import Document from bokeh.models.layouts import VBox from bokeh.models.widgets import ( Icon, Button, Toggle, Dropdown, CheckboxGroup, RadioGroup, CheckboxButtonGroup, RadioButtonGroup, ) def button_handler(): ...
bsd-3-clause
xdevelsistemas/taiga-back-community
tests/unit/test_deferred.py
2
2088
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # This program is free software: you can r...
agpl-3.0
dhruv13J/scikit-learn
examples/covariance/plot_lw_vs_oas.py
248
2903
""" ============================= Ledoit-Wolf vs OAS estimation ============================= The usual covariance maximum likelihood estimate can be regularized using shrinkage. Ledoit and Wolf proposed a close formula to compute the asymptotically optimal shrinkage parameter (minimizing a MSE criterion), yielding th...
bsd-3-clause
mzhaom/grpc
src/python/interop/interop/client.py
5
3507
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
pbrook/charliecube
util/gen-board-map.py
1
1678
#! /usr/bin/env python3 import sys import optparse def fn(c): return ord(c.lower()) - ord('a') def file_line(f): while True: l = f.readline() if l == "": raise EOFError(); l = l.strip() if l == "": sys.stdout.write("\n") continue if l...
gpl-3.0
bacaldwell/ironic
ironic/tests/unit/drivers/third_party_driver_mock_specs.py
2
2854
# Copyright 2015 Intel Corporation # 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 require...
apache-2.0
q1ang/scikit-learn
sklearn/linear_model/least_angle.py
61
54324
""" Least Angle Regression algorithm. See the documentation on the Generalized Linear Model for a complete discussion. """ from __future__ import print_function # Author: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux # # License: BSD 3 ...
bsd-3-clause
Distrotech/gcc
contrib/dg-extract-results.py
70
23573
#!/usr/bin/python # # Copyright (C) 2014 Free Software Foundation, Inc. # # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. import sys im...
gpl-2.0
zhenv5/scikit-learn
sklearn/externals/joblib/parallel.py
79
35628
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
bsd-3-clause
galaxy001/libtorrent
BitTorrent-4.4.0/launchmany-curses.py
4
10226
#!/usr/bin/env python # The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/li...
mit
bjamesv/pymoldmaker
vector.py
1
1855
#!/usr/bin/python3 """ this file is a part of pymoldmaker Copyright (C) 2015 Brandon J. Van Vaerenbergh This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your o...
gpl-3.0
suvayu/rplot
utils.py
1
9071
# coding=utf-8 """Utilities""" def is_type(key, rtype): """Is key the ROOT type `rtype''?""" from ROOT import TClass return TClass.GetClass(key.GetClassName()).InheritsFrom(rtype.Class()) def is_dir(key): """Is it a directory key?""" from ROOT import TDirectoryFile return is_type(key, TDirec...
gpl-2.0
knallio/kettler-tcx
kettler.py
1
7600
#!/usr/bin/env python import serial from time import time,sleep class kettler(): commands={ #ALIAS:('COMMANDCODE',"description",'example response') 'RESET':('RS',"reset device",'ACK'), 'ID': ('ID',"Get device ID",'SDFB3026'), 'FIRMWARE':('VE',"Get device firmware",'130'), 'MODEL':('KI','get model name','S...
gpl-3.0
ShiYw/Sigil
3rdparty/python/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
87
6613
#!/usr/bin/env python import subprocess import os import errno import collections import glob import argparse class Platform(object): pass class simulator_platform(Platform): directory = 'darwin_ios' sdk = 'iphonesimulator' arch = 'i386' triple = 'i386-apple-darwin11' version_min = '-miphoneos...
gpl-3.0
avimeir/djstripe_dev
tests/engine.py
1
5417
from subprocess import call from os import path import hitchpostgres import hitchselenium import hitchpython import hitchserve import hitchredis import hitchtest import hitchsmtp # Get directory above this file PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..')) class ExecutionEngine(hitchtest...
bsd-3-clause
nburn42/tensorflow
tensorflow/python/util/serialization_test.py
3
2930
# Copyright 2018 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
Scalr/libcloud
libcloud/storage/drivers/s3.py
1
43190
# 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 ...
apache-2.0