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
maxweisspoker/simplebitcoinfuncs
simplebitcoinfuncs/miscbitcoinfuncs.py
1
7265
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Misc functions related to Bitcoin, but which didn't feel right being in the main bitcoin funcs See _doctester.py for examples of most functions below. ''' import os import datetime from binascii import hexlify, unhexlify try: ModuleNotFoundError except: Mo...
mit
trenton3983/Data_Science_from_Scratch
code-python3/logistic_regression.py
12
6055
from collections import Counter from functools import partial, reduce from linear_algebra import dot, vector_add from gradient_descent import maximize_stochastic, maximize_batch from working_with_data import rescale from machine_learning import train_test_split from multiple_regression import estimate_beta, predict imp...
unlicense
andersk/zulip
zerver/migrations/0217_migrate_create_stream_policy.py
6
1270
# Generated by Django 1.11.20 on 2019-05-06 13:15 from django.db import migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps def upgrade_create_stream_policy(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: Realm = apps.ge...
apache-2.0
vauxoo-dev/vxtools-server
setup.py
1
1465
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') requirements = [ # TODO: put package requirements here ] test_requi...
bsd-3-clause
webnotes/wnframework
core/doctype/file_data/file_data.py
32
1734
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ record of files naming for same name files: file.gif, file-1.gif, file-2.gif etc """ import webnotes, webnotes.utils, os from webnotes import conf class DocType(): def...
mit
FrankBian/kuma
vendor/packages/pyparsing/examples/simpleSQL.py
16
4698
# simpleSQL.py # # simple demo of using the parsing library to do simple-minded SQL parsing # could be extended to include where clauses etc. # # Copyright (c) 2003, Paul McGuire # from pyparsing import Literal, CaselessLiteral, Word, Upcase, delimitedList, Optional, \ Combine, Group, alphas, nums, alphanum...
mpl-2.0
bootandy/sqlalchemy
test/engine/test_transaction.py
23
54427
from sqlalchemy.testing import eq_, assert_raises, \ assert_raises_message, ne_, expect_warnings import sys from sqlalchemy import event from sqlalchemy.testing.engines import testing_engine from sqlalchemy import create_engine, MetaData, INT, VARCHAR, Sequence, \ select, Integer, String, func, text, exc from s...
mit
JeanKossaifi/scikit-learn
sklearn/utils/tests/test_fixes.py
281
1829
# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Justin Vincent # Lars Buitinck # License: BSD 3 clause import numpy as np from nose.tools import assert_equal from nose.tools import assert_false from nose.tools import assert_true from numpy.testing import (assert_almost_equal, ...
bsd-3-clause
maestrano/openerp
openerp/addons/l10n_be_hr_payroll/__openerp__.py
118
1817
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
openstack/manila
manila/tests/share/drivers/glusterfs/test_layout.py
1
12982
# Copyright (c) 2015 Red Hat, 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 require...
apache-2.0
kartikgupta0909/gittest
configs/builds/releng_base_windows_32_builds.py
2
4098
import os import sys STAGE_USERNAME = 'ffxbld' STAGE_SSH_KEY = 'ffxbld_dsa' config = { ######################################################################### ######## WINDOWS GENERIC CONFIG KEYS/VAlUES # if you are updating this with custom 32 bit keys/values please add them # below under the '32 b...
mpl-2.0
Neural-Network/TicTacToe
pybrain/datasets/supervised.py
21
4400
from __future__ import print_function __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from numpy import random from random import sample from scipy import isscalar from pybrain.datasets.dataset import DataSet from pybrain.utilities import fListToString class SupervisedDataSet(DataSet): """SupervisedDataS...
bsd-3-clause
sakuraio/python-sakuraio
sakuraio/hardware/commands/operation.py
1
3230
import struct import datetime # Operation CMD_GET_PRODUCT_ID = 0xA0 CMD_GET_UNIQUE_ID = 0xA1 CMD_GET_FIRMWARE_VERSION = 0xA2 CMD_UNLOCK = 0xA8 CMD_UPDATE_FIRMWARE = 0xA9 CMD_GET_FIRMWARE_UPDATE_STATUS = 0xAA CMD_SOFTWARE_RESET = 0xAF CMD_SET_POWER_SAVE_MODE = 0xB0 CMD_GET_POWER_SAVE_MODE = 0xB1 UNLOCK_MAGIC_NUMBERS ...
mit
aviweit/libcloud
libcloud/common/brightbox.py
55
3413
# 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
growingio/phoenix
bin/end2endTest.py
31
1881
#!/usr/bin/env python ############################################################################ # # 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 A...
apache-2.0
torufuru/oolhackathon
ryu/lib/xflow/netflow.py
60
4009
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
bq-xiao/mongo-python-driver
test/test_replica_set_reconfig.py
18
5751
# Copyright 2013-2015 MongoDB, 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 writin...
apache-2.0
rbooth200/DiscEvolution
DiscEvolution/internal_photo.py
1
30463
# internal_photo.py # # Author: A. Sellek # Date: 12 - Aug - 2020 # # Implementation of Photoevaporation Models ################################################################################ import numpy as np import argparse import json import matplotlib.pyplot as plt from DiscEvolution.constants import * from DiscE...
gpl-3.0
puttarajubr/commcare-hq
corehq/apps/hqadmin/system_info/checks.py
2
3064
from django.core import cache from django.conf import settings from django.utils.safestring import mark_safe from restkit import Resource import json from corehq.apps.hqadmin.system_info.utils import human_bytes from soil import heartbeat def check_redis(): #redis status ret = {} redis_status = "" red...
bsd-3-clause
phalax4/CarnotKE
jyhton/lib-python/2.7/test/test_abc.py
119
7715
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for abc.py.""" import unittest, weakref from test import test_support import abc from inspect import isabstract class TestABC(unittest.TestCase): def test_abstractmethod_basics(self): @abc...
apache-2.0
ivanhorvath/openshift-tools
openshift/installer/vendored/openshift-ansible-3.5.127/roles/lib_openshift/library/oc_secret.py
12
57672
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
apache-2.0
CERNDocumentServer/invenio
modules/bibsword/lib/bibsword_webinterface.py
1
15249
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 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 the # Li...
gpl-2.0
omnirom/android_external_chromium-org
chrome/browser/PRESUBMIT.py
36
2691
# 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. """Presubmit script for Chromium browser code. This script currently only checks HTML/CSS/JS files in resources/. See http://dev.chromium.org/developers/ho...
bsd-3-clause
TarasRudnyk/scrapy
docs/utils/linkfix.py
141
1764
#!/usr/bin/python """ Linkfix - a companion to sphinx's linkcheck builder. Uses the linkcheck's output file to fix links in docs. Originally created for this issue: https://github.com/scrapy/scrapy/issues/606 Author: dufferzafar """ import re # Used for remembering the file (and its contents) # so we don't have ...
bsd-3-clause
MarsSnail/gyp_tools
test/rules/gyptest-default.py
25
1660
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple rules when using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('actions...
bsd-3-clause
patvarilly/DNACC
examples/competing_linkages/competing_linkages.py
1
10390
# Copyright 2012 Patrick Varilly, Stefano Angioletti-Uberti # # 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 option) any later version...
gpl-3.0
sebrandon1/neutron
neutron/plugins/ml2/drivers/l2pop/mech_driver.py
2
14284
# Copyright (c) 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...
apache-2.0
arenadata/ambari
ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0/package/scripts/interpreter_json_template.py
3
10516
#!/usr/bin/env python """ 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");...
apache-2.0
EnviroCentre/jython-upgrade
jython/lib/test/test_sha.py
136
1703
# Testing sha module (NIST's Secure Hash Algorithm) # use the three examples from Federal Information Processing Standards # Publication 180-1, Secure Hash Standard, 1995 April 17 # http://www.itl.nist.gov/div897/pubs/fip180-1.htm import warnings warnings.filterwarnings("ignore", "the sha module is deprecated.*", ...
mit
Hawaii-Smart-Energy-Project/Maui-Smart-Grid
src/filelock.py
1
4303
# Copyright (c) 2009, Evan Fosmark # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and th...
bsd-3-clause
hack4sec/ws-cli
classes/jobs/MongoJob.py
1
5376
# -*- coding: utf-8 -*- """ This is part of WebScout software Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en Docs RU: http://hack4sec.pro/wiki/index.php/WebScout License: MIT Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en) Common class for jobs works with MongoDB """ i...
mit
gannetson/django
django/contrib/flatpages/forms.py
357
2024
from django import forms from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext, ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text=_("E...
bsd-3-clause
fenginx/django
tests/admin_inlines/models.py
14
6885
""" Testing of admin inline formsets. """ import random from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models class Parent(models.Model): name = models.CharField(max_length=50) def __str__(self): retur...
bsd-3-clause
boompig/passzero
passzero/main_routes.py
1
12491
from functools import wraps from flask import (Blueprint, abort, current_app, escape, flash, make_response, redirect, render_template, request, session, url_for) from sqlalchemy.orm.exc import NoResultFound from passzero.api_utils import check_auth from passzero.backend import (activate_account, de...
gpl-3.0
LoHChina/nova
nova/api/openstack/compute/contrib/extended_virtual_interfaces_net.py
39
2104
# Copyright 2013 IBM Corp. # # 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
aferr/LatticeMemCtl
src/python/m5/util/attrdict.py
84
3421
# Copyright (c) 2006 The Regents of The University of Michigan # 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
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/distutils/dep_util.py
177
3509
"""distutils.dep_util Utility functions for simple, timestamp-based dependency of files and groups of files; also, function based entirely on such timestamp dependency analysis.""" __revision__ = "$Id$" import os from stat import ST_MTIME from distutils.errors import DistutilsFileError def newer(source, target): ...
gpl-2.0
shakamunyi/docker-registry
depends/docker-registry-core/docker_registry/testing/driver.py
30
13434
# -*- coding: utf-8 -*- # Copyright (c) 2014 Docker. # # 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...
apache-2.0
rastaman/ansible-modules-core
cloud/amazon/ec2_metric_alarm.py
61
10684
#!/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
wolverineav/neutron
neutron/db/common_db_mixin.py
3
14029
# Copyright (c) 2014 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...
apache-2.0
cgstudiomap/cgstudiomap
main/eggs/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/graphics/barcode/qrencoder.py
36
34126
# QRCode for Python # # Support for Kanji, Hanzi, ECI, FNC1 and Structurded append, # and optimizations by Anders Hammarquist <iko@openend.se> # # Copyright (c) 2014 Open End AB http://www.openend.se/ # # Ported from the Javascript library by Sam Curren # # QRCode for Javascript # http://d-project.googlecode.com/svn/tr...
agpl-3.0
ashwyn/eden-message_parser
private/templates/default/menus.py
8
4154
# -*- coding: utf-8 -*- from gluon import * from s3 import * from eden.layouts import * try: from .layouts import * except ImportError: pass import eden.menus as default # Below is an example which you can base your own template's menus.py on # - there are also other examples in the other templates folders #...
mit
kampanita/pelisalacarta
python/main-classic/platformcode/xbmc_info_window.py
1
21922
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta 4 # Copyright 2015 tvalacarta@gmail.com # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html # --...
gpl-3.0
luzheqi1987/nova-annotation
nova/tests/unit/test_hooks.py
22
6320
# Copyright (c) 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 ...
apache-2.0
dario61081/koalixcrm
koalixcrm/crm/migrations/0045_auto_20180805_2047.py
2
1557
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-08-05 20:47 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('crm', '0044_reportingperiod_status'), ] operations...
bsd-3-clause
odicraig/kodi2odi
addons/plugin.radio.disney/common.py
2
7722
############################################################################# ############################################################################# import os,xbmc,xbmcgui,xbmcaddon,sys,logging,re,urllib,urllib2 ############################################################################# #################...
gpl-3.0
rgabo/awsh
awsh/repl.py
1
3713
from __future__ import unicode_literals, print_function import shlex import sys import traceback from codeop import compile_command from pathlib import Path from shutil import which from awsh.commands import * from awsh.providers import Provider, PosixProvider from awsh.util import lazy_property from prompt_toolkit i...
bsd-3-clause
spallavolu/scikit-learn
sklearn/linear_model/ridge.py
60
44642
""" Ridge regression """ # Author: Mathieu Blondel <mathieu@mblondel.org> # Reuben Fletcher-Costin <reuben.fletchercostin@gmail.com> # Fabian Pedregosa <fabian@fseoane.net> # Michael Eickenberg <michael.eickenberg@nsup.org> # License: BSD 3 clause from abc import ABCMeta, abstractmethod impor...
bsd-3-clause
partofthething/home-assistant
tests/components/nest/test_events.py
3
9106
"""Test for Nest binary sensor platform for the Smart Device Management API. These tests fake out the subscriber/devicemanager, and are not using a real pubsub subscriber. """ from google_nest_sdm.device import Device from google_nest_sdm.event import EventMessage from homeassistant.util.dt import utcnow from .comm...
mit
RefugeeMatchmaking/HackZurich
GAE_Playground/libs/networkx/algorithms/bipartite/tests/test_cluster.py
85
2709
import networkx as nx from nose.tools import * from networkx.algorithms.bipartite.cluster import cc_dot,cc_min,cc_max import networkx.algorithms.bipartite as bipartite def test_pairwise_bipartite_cc_functions(): # Test functions for different kinds of bipartite clustering coefficients # between pairs of nodes ...
mit
StefanRijnhart/OpenUpgrade
openerp/addons/test_convert/tests/test_convert.py
382
2303
import collections import unittest2 from lxml import etree as ET from lxml.builder import E from openerp.tests import common from openerp.tools.convert import _eval_xml Field = E.field Value = E.value class TestEvalXML(common.TransactionCase): def eval_xml(self, node, obj=None, idref=None): return _eval_...
agpl-3.0
devekko/ansible-role-manager
arm/commands/install.py
1
5123
import os, shutil, re from . import Command, CommandException from arm.conf import settings from arm.odict import odict from arm.util import retrieve_role, retrieve_all_roles, get_playbook_root from arm import Role, Module class install(Command): help = "install playbook role" def __init__(self...
apache-2.0
ianyh/heroku-buildpack-python-nodejs
vendor/distribute-0.6.36/setuptools/tests/test_markerlib.py
71
2237
import os import unittest from setuptools.tests.py26compat import skipIf try: import ast except ImportError: pass class TestMarkerlib(unittest.TestCase): @skipIf('ast' not in globals(), "ast not available (Python < 2.6?)") def test_markers(self): from _markerlib import interpret, defa...
mit
houzhenggang/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/ctypes/test/test_prototypes.py
81
6738
from ctypes import * import unittest # IMPORTANT INFO: # # Consider this call: # func.restype = c_char_p # func(c_char_p("123")) # It returns # "123" # # WHY IS THIS SO? # # argument tuple (c_char_p("123"), ) is destroyed after the function # func is called, but NOT before the result is actually built. # # If...
gpl-2.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/ConfigParser.py
186
27746
"""Configuration file parser. A setup file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. The option values can contain format strings which refer to other values in the same section, or values in a special [DEFAULT] sect...
gpl-2.0
huntxu/fuel-web
nailgun/manage.py
2
11684
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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...
apache-2.0
petewarden/tensorflow
tensorflow/python/data/kernel_tests/as_numpy_iterator_test.py
9
3745
# Copyright 2019 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
gmnamra/python-image-utils
Tools/guimaker.py
1
6773
""" ############################################################################### An extended Frame that makes window menus and toolbars automatically. Use GuiMakerFrameMenu for embedded components (makes frame-based menus). Use GuiMakerWindowMenu for top-level windows (makes Tk8.0 window menus). See the self-te...
mit
int19h/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32comext/shell/demos/explorer_browser.py
10
4758
# A sample of using Vista's IExplorerBrowser interfaces... # Currently doesn't quite work: # * CPU sits at 100% while running. import sys import pythoncom from win32com.shell import shell, shellcon import win32gui, win32con, win32api from win32com.server.util import wrap, unwrap # event handler for the browser. IExpl...
apache-2.0
synopat/pyload
module/lib/thrift/transport/TTransport.py
74
8384
# # 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...
gpl-3.0
wwj718/edx-platform
common/djangoapps/track/views/tests/test_views.py
81
10225
# pylint: disable=missing-docstring,maybe-no-member from mock import patch, sentinel from django.contrib.auth.models import User from django.test.client import RequestFactory from django.test.utils import override_settings from track import views from track.middleware import TrackMiddleware from track.tests import E...
agpl-3.0
crichardson17/starburst_atlas
Low_resolution_sims/DustFree_LowRes/Padova_cont/padova_cont_4/Optical1.py
33
7366
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # --------------------------------------------------...
gpl-2.0
matthiask/django-chet
chet/views.py
1
1373
from django.shortcuts import get_object_or_404, render from django.views import generic from chet.models import Album, Photo def visible_albums(user): if user.is_staff: return Album.objects.active() else: return Album.objects.public() def visible_photos(user): if user.is_staff: ...
bsd-3-clause
nerzhul/ansible
lib/ansible/modules/files/acl.py
25
11472
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
ybellavance/python-for-android
python3-alpha/extra_modules/atom/mock_service.py
48
10344
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
niteoweb/libcloud
libcloud/container/drivers/dummy.py
24
1589
# 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
tedelhourani/ansible
lib/ansible/modules/cloud/amazon/ec2_vol.py
10
20561
#!/usr/bin/python # Copyright: Ansible Project # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterf...
gpl-3.0
HaydenFaulkner/phd
keras_code/cnns/model_defs/faulkner/c3d.py
1
3008
''' C3D CNN architecture Webpage for original: http://vlg.cs.dartmouth.edu/c3d/ Paper for original: D. Tran, L. Bourdev, R. Fergus, L. Torresani, and M. Paluri Learning Spatiotemporal Features with 3D Convolutional Networks ICCV 2015 http://vlg.cs.dartmouth.edu/c3d/c3d_video.pdf Designed for Sports-1M Dataset ''' f...
mit
mbernasocchi/QGIS
tests/src/python/test_qgsziputils.py
45
3763
# -*- coding: utf-8 -*- """QGIS Unit tests for zip functions. .. note:: 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. """ __a...
gpl-2.0
krez13/scikit-learn
sklearn/externals/joblib/_memory_helpers.py
303
3605
try: # Available in Python 3 from tokenize import open as open_py_source except ImportError: # Copied from python3 tokenize from codecs import lookup, BOM_UTF8 import re from io import TextIOWrapper, open cookie_re = re.compile("coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): ...
bsd-3-clause
prarthitm/edxplatform
openedx/core/lib/block_structure/factory.py
7
3851
""" Module for factory class for BlockStructure objects. """ from .block_structure import BlockStructureModulestoreData, BlockStructureBlockData class BlockStructureFactory(object): """ Factory class for BlockStructure objects. """ @classmethod def create_from_modulestore(cls, root_block_usage_key...
agpl-3.0
tal-nino/ansible
lib/ansible/plugins/lookup/ini.py
82
3304
# (c) 2015, Yannig Perre <yannig.perre(at)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 late...
gpl-3.0
davidsoncolin/IMS
UI/QActorWidget.py
1
2542
#!/usr/bin/env python from PySide import QtCore, QtGui class QActorWidget(QtGui.QWidget): def __init__(self, cb, parent=None): self.cb = cb self.parent = parent QtGui.QWidget.__init__(self, parent) self.groupLayout = QtGui.QVBoxLayout(self) self.groupTabs = QtGui.QTabWidget() self.groupLayout.addWidget(s...
mit
zemanel/ansible
lib/ansible/inventory/ini.py
25
7628
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
fbossy/SickRage
lib/hachoir_parser/common/win32.py
74
6210
from hachoir_core.field import (FieldSet, UInt16, UInt32, Enum, String, Bytes, Bits, TimestampUUID60) from hachoir_parser.video.fourcc import video_fourcc_name from hachoir_core.bits import str2hex from hachoir_core.text_handler import textHandler, hexadecimal from hachoir_parser.network.common import MAC48_Address...
gpl-3.0
p4datasystems/CarnotKEdist
dist/Lib/types.py
30
2149
"""Define names for all type symbols known in the standard interpreter. Types that are part of optional modules (e.g. array) are not listed. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check...
apache-2.0
rahuldhote/odoo
openerp/cli/start.py
240
2748
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import glob import os import sys from . import Command from .server import main from openerp.modules.module import get_module_root, MANIFEST from openerp.service.db import _create_empty_database, DatabaseExists class Start(Command): """Quick start the...
agpl-3.0
onitake/ansible
test/units/mock/yaml_helper.py
209
5267
import io import yaml from ansible.module_utils.six import PY3 from ansible.parsing.yaml.loader import AnsibleLoader from ansible.parsing.yaml.dumper import AnsibleDumper class YamlTestUtils(object): """Mixin class to combine with a unittest.TestCase subclass.""" def _loader(self, stream): """Vault r...
gpl-3.0
jclakkis/discus-inferno
flaskenv/lib/python2.7/site-packages/psycopg2/tests/test_bug_gc.py
62
1719
#!/usr/bin/env python # bug_gc.py - test for refcounting/GC bug # # Copyright (C) 2010-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 ve...
mit
wolfv/uberwriter
uberwriter/plugins/bibtex/fuzzywuzzy/process.py
11
8790
#!/usr/bin/env python # encoding: utf-8 """ process.py Copyright (c) 2011 Adam Cohen 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...
gpl-3.0
thopiekar/Cura
cura/Machines/Models/MultiBuildPlateModel.py
2
2526
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import QTimer, pyqtSignal, pyqtProperty from UM.Application import Application from UM.Scene.Camera import Camera from UM.Scene.Selection import Selection from UM.Qt.ListModel import ListModel # # This ...
lgpl-3.0
adhoc-dev/odoo-addons
product_pack/models/pack.py
5
3149
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import fields, models, api class product_p...
agpl-3.0
guiquanz/Dato-Core
src/unity/python/graphlab_util/lambda_closure_capture.py
13
9429
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (C) 2015 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the DATO-PYTHON-LICENSE file for details. ''' import sys import parser import symbol import token import ast import inspect import ...
agpl-3.0
visualputty/Landing-Lights
django/utils/datastructures.py
239
15522
from types import GeneratorType from django.utils.copycompat import copy, deepcopy class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed in the constructor. If a key appears in more than one of the given d...
bsd-3-clause
opendatadurban/scoda
scoda/templates/static/node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
1970
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
apache-2.0
nachandr/cfme_tests
cfme/tests/containers/test_static_custom_attributes.py
3
10129
import re from copy import deepcopy from os import path from random import choice from string import ascii_letters from string import digits import pytest from manageiq_client.api import APIException from cfme import test_requirements from cfme.containers.provider import ContainersProvider from cfme.containers.provid...
gpl-2.0
MaxTyutyunnikov/lino
lino/modlib/vocbook/base.py
1
33978
# -*- coding: UTF-8 -*- ## Copyright 2011-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 y...
gpl-3.0
tempbottle/Nuitka
nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/rpcgen.py
4
2827
"""SCons.Tool.rpcgen Tool-specific initialization for RPCGEN tools. Three normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of...
apache-2.0
jendap/tensorflow
tensorflow/contrib/tpu/python/tpu/datasets.py
5
7480
# 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
gnachman/iTerm2
tools/ply/ply-3.4/test/yacc_badprec2.py
174
1501
# ----------------------------------------------------------------------------- # yacc_badprec2.py # # Bad precedence # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # Parsin...
gpl-2.0
wayoda/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
lgpl-2.1
GeographicaGS/moocng
moocng/media_contents/handlers/prezi.py
1
1737
import re from django.template.loader import get_template from django.template import Context from django.templatetags.static import static from .base import MediaContentHandlerBase class PreziMediaContentHandler(MediaContentHandlerBase): def get_iframe_template(self, content_id, **kwargs): template = g...
apache-2.0
zero-ui/miniblink49
v8_7_5/tools/unittests/run_tests_test.py
3
23853
#!/usr/bin/env python # Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Global system tests for V8 test runners and fuzzers. This hooks up the framework under tools/testrunner testing high-level scena...
gpl-3.0
TE-ToshiakiTanaka/alize
alize/library/slack/module.py
1
1735
import os import sys from alize.log import Log from alize.exception import * try : from slacker import Slacker except Exception as e: print(str(e)) L = Log("Slack.Library.ALIZE") class Slack(object): def __init__(self, token): try: self.slack = Slacker(token) except Exception...
mit
ua-snap/downscale
snap_scripts/epscor_sc/downscale_cmip5_epscor_sc.py
1
6401
# downscale the prepped cmip5 data downloaded using SYNDA for EPSCoR SC project # author: Michael Lindgren -- June 09, 2016 (UPDATED: September 21, 2016 -- [ML]) if __name__ == '__main__': import glob, os, rasterio, itertools from functools import partial import downscale from downscale import preprocess, Mask, uti...
mit
kmspriyatham/symath
scipy/scipy/interpolate/benchmarks/bench_memusage.py
3
3412
# Posix-only benchmark from __future__ import division, absolute_import, print_function import os import sys import re import subprocess import time import textwrap from numpy.testing import dec from scipy.stats import spearmanr import numpy as np @dec.skipif(not sys.platform.startswith('linux'), "Memory benchmark...
apache-2.0
dand-oss/yaml-cpp
test/gtest-1.10.0/googlemock/scripts/generator/cpp/ast.py
69
62925
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
mit
SCSSoftware/BlenderTools
addon/io_scs_tools/utils/info.py
1
4434
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 ...
gpl-2.0
ameuret/mongrel2
examples/zcov/zcov/GCovGroup.py
96
6378
#!/usr/bin/python from __future__ import division from pprint import pprint import cPickle import os import warnings from zcov import GCovParser class GCovGroup: @staticmethod def fromfile(path): f = open(path) try: res = cPickle.load(f) header,version = res[0],res[1...
bsd-3-clause
yongshengwang/builthue
desktop/core/ext-py/PyYAML-3.09/tests/lib3/test_constructor.py
57
8744
import yaml import pprint import datetime import yaml.tokens def execute(code): global value exec(code) return value def _make_objects(): global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2, \ AnObject, AnInstance, AState, ACustomState, InitArgs...
apache-2.0