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
WillBrennan/DigitClassifier
DeepConv.py
1
8479
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Will Brennan' # Built-in Module import os import time import logging import warnings import cPickle as pickle from datetime import datetime # Standard Modules import numpy import sklearn import theano import theano.tensor as T # Custom Modules import Scripts...
bsd-2-clause
ilri/genebank-gg_server
db_scripts/model_generator/grin/Copy of models.py
2
60010
# NOTE: this was autogenerated from django, but already edited to rearrange the models. # DO NOT OVERWRITE USING OUTPUT FROM manage.py inspectdb !!!! # Fill in code as appropriate by hand... from django.db import models #""" class MainSite(models.Model): id = models.IntegerField(primary_key=True...
gpl-3.0
jdaigneau/geoq
geoq/accounts/views.py
2
2442
# -*- coding: utf-8 -*- # This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and # is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012) import requests from django.contrib.auth.decorators import login_required from django.co...
mit
jelugbo/hebs_master
cms/envs/test.py
7
7585
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
agpl-3.0
Arafatk/sympy
doc/ext/docscrape.py
38
18071
""" Extract reference documentation from the NumPy source tree. """ from __future__ import division, absolute_import, print_function import inspect import textwrap import re import pydoc import collections import sys class Reader(object): """ A line-based string reader. """ def __init__(self, data): ...
bsd-3-clause
srluge/SickRage
lib/mako/_ast_util.py
39
25690
# mako/_ast_util.py # Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ ast ~~~ The `ast` module helps Python applications to process trees of the Pyth...
gpl-3.0
MortimerGoro/servo
tests/wpt/css-tests/tools/py/testing/io_/test_capture.py
163
14781
from __future__ import with_statement import os, sys import py needsdup = py.test.mark.skipif("not hasattr(os, 'dup')") from py.builtin import print_ if sys.version_info >= (3,0): def tobytes(obj): if isinstance(obj, str): obj = obj.encode('UTF-8') assert isinstance(obj, bytes) ...
mpl-2.0
fredericlepied/ansible
lib/ansible/modules/network/netvisor/pn_ospfarea.py
59
6377
#!/usr/bin/python """ PN-CLI vrouter-ospf-add/remove """ # # 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...
gpl-3.0
jbzdak/edx-platform
common/djangoapps/third_party_auth/tests/specs/test_google.py
67
1132
"""Integration tests for Google providers.""" from third_party_auth.tests.specs import base class GoogleOauth2IntegrationTest(base.Oauth2IntegrationTest): """Integration tests for provider.GoogleOauth2.""" def setUp(self): super(GoogleOauth2IntegrationTest, self).setUp() self.provider = self...
agpl-3.0
inveniosoftware/invenio-workflows
invenio_workflows/version.py
3
1201
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 # License, or (at your option) any later...
gpl-2.0
jswope00/GAI
common/djangoapps/service_status/views.py
188
1296
""" Django Views for service status app """ import json import time from django.http import HttpResponse from dogapi import dog_stats_api from service_status import tasks from djcelery import celery from celery.exceptions import TimeoutError def index(_): """ An empty view """ return HttpResponse(...
agpl-3.0
kevintaw/django
django/forms/utils.py
20
5868
from __future__ import unicode_literals import json import sys from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import six, timezone from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html import e...
bsd-3-clause
bjornlevi/5thpower
kosningakerfi/env/lib/python3.6/site-packages/pip/utils/logging.py
516
3327
from __future__ import absolute_import import contextlib import logging import logging.handlers import os try: import threading except ImportError: import dummy_threading as threading from pip.compat import WINDOWS from pip.utils import ensure_dir try: from pip._vendor import colorama # Lots of differen...
mit
Floobits/floobits-neovim-old
plugin/floo/editor.py
1
2900
import sys from collections import defaultdict import time import vim try: from .common import shared as G from .common import msg except (ImportError, ValueError): import common.shared as G from common import msg timeouts = defaultdict(list) top_timeout_id = 0 cancelled_timeouts = set() calling_tim...
apache-2.0
miquelramirez/aptk
toolkit/tools/lama-adl-compiler/translate.py
4
16428
#! /usr/bin/env python2.5 # -*- coding: latin-1 -*- ####################################################################### # # Author: Malte Helmert (helmert@informatik.uni-freiburg.de) # (C) Copyright 2003-2004 Malte Helmert # Modified by: Silvia Richter (silvia.richter@nicta.com.au) # (C) Copyright 2008: NICTA # # ...
lgpl-3.0
saghul/aiohttp
aiohttp/websocket.py
1
8733
"""WebSocket protocol versions 13 and 8.""" __all__ = ['WebSocketParser', 'WebSocketWriter', 'do_handshake', 'Message', 'WebSocketError', 'MSG_TEXT', 'MSG_BINARY', 'MSG_CLOSE', 'MSG_PING', 'MSG_PONG'] import base64 import binascii import collections import hashlib import struct from aiohttp impo...
apache-2.0
fluxw42/youtube-dl
youtube_dl/extractor/videofyme.py
111
1750
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class VideofyMeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)' IE_NAME = 'videofy.me' _TEST = { 'url': 'h...
unlicense
alexlo03/ansible
setup.py
34
11028
from __future__ import print_function import json import os import os.path import re import sys import warnings from collections import defaultdict from distutils.command.build_scripts import build_scripts as BuildScripts from distutils.command.sdist import sdist as SDist try: from setuptools import setup, find...
gpl-3.0
ksachs/invenio
modules/webstyle/lib/webdoc_info_webinterface.py
18
12410
## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 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 the ## License, or (at your option) any ...
gpl-2.0
adobe/chromium
native_client_sdk/src/build_tools/tests/apply_patch_test.py
7
8366
#!/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. """Unit tests for apply_patch.py.""" import os import sys import unittest import tempfile from build_tools import apply_patch c...
bsd-3-clause
looker/sentry
src/sentry/south_migrations/0032_auto__add_eventmeta.py
5
19345
# encoding: 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 'GroupMeta' db.create_table( 'sentry_groupmeta', ( ( ...
bsd-3-clause
perlygatekeeper/glowing-robot
Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/chardet/big5freq.py
342
31254
######################## 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 R...
artistic-2.0
seiferteric/bmaptools
tests/helpers.py
1
10844
# Copyright (c) 2012-2013 Intel, Inc. # License: GPLv2 # Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # This progra...
gpl-2.0
eoconsulting/django-zoook
django_zoook/account/models.py
13
1074
# -*- coding: utf-8 -*- ############################################################################################ # # Zoook. OpenERP e-sale, e-commerce Open Source Management Solution # Copyright (C) 2011 Zikzakmedia S.L. (<http://www.zikzakmedia.com>). All Rights Reserved # $Id$ # # This program is free...
agpl-3.0
dsavransky/EXOSIMS
EXOSIMS/StarCatalog/SIMBAD300Catalog.py
1
1291
# -*- coding: utf-8 -*- from EXOSIMS.StarCatalog.SIMBADCatalog import SIMBADCatalog from EXOSIMS.util.get_dirs import get_cache_dir import os, inspect class SIMBAD300Catalog(SIMBADCatalog): """SIMBAD300 Catalog class This class populates the star catalog used in EXOSIMS from the SIMBAD300 ca...
bsd-3-clause
thedanotto/google-maps-urlerator
google_maps_urlerator/settings/local_mini.py
1
4841
import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'google_maps_urlerator.sqlite3', ...
mit
robertinant/ArduinoUpstream
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/exceptions.py
245
2258
# urllib3/exceptions.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php ## Base Exceptions class HTTPError(Exception): "Base exception used by this module." ...
lgpl-2.1
Buckmarble/elite_kernelAOSP
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
wencongyang/qemu-upstream-unstable
scripts/tracetool/transform.py
78
4238
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Type-transformation rules. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnocz...
gpl-2.0
CodyKochmann/pi-cluster
software/src/cherrypy/lib/caching.py
57
17149
""" CherryPy implements a simple caching system as a pluggable Tool. This tool tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but it's probably good enough for most sites. In general, GET responses are cached (along with selecting headers) and, if another request arrives for the same r...
mit
magumagu/dolphin
Tools/find-includes-cycles.py
157
2630
#! /usr/bin/env python ''' Run this script from Source/Core/ to find all the #include cycles. ''' import subprocess def get_local_includes_for(path): lines = open(path).read().split('\n') includes = [l.strip() for l in lines if l.strip().startswith('#include')] return [i.split()[1][1:-1] for i in include...
gpl-2.0
XXMrHyde/android_external_chromium_org
chrome/test/pyautolib/policy_posix_util.py
71
1070
#!/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. """Helper script to copy policy files into the correct location the machine.""" import os import shutil import sys def main(): ...
bsd-3-clause
ipcamit/ipcamit.github.io
node_modules/pygmentize-bundled/vendor/pygments/pygments/cmdline.py
269
13470
# -*- coding: utf-8 -*- """ pygments.cmdline ~~~~~~~~~~~~~~~~ Command line interface. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import getopt from textwrap import dedent from pygments import __version__, highlight fro...
mit
virantha/photokeeper
photokeeper/filecopy.py
1
2553
# Copyright 2016 Virantha Ekanayake 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 la...
apache-2.0
rwillmer/django
django/contrib/sites/management.py
467
1564
""" Creates the default Site object. """ from django.apps import apps from django.conf import settings from django.core.management.color import no_style from django.db import DEFAULT_DB_ALIAS, connections, router def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs): ...
bsd-3-clause
kaichogami/scikit-learn
sklearn/decomposition/fastica_.py
54
18240
""" Python implementation of the fast ICA algorithms. Reference: Tables 8.3 and 8.4 page 196 in the book: Independent Component Analysis, by Hyvarinen et al. """ # Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux, # Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann # License: BS...
bsd-3-clause
arrabito/DIRAC
Core/Security/CS.py
15
1402
# $HeadURL$ __RCSID__ = "$Id$" from DIRAC.ConfigurationSystem.Client.Config import gConfig from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getDefaultUserGroup from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getDefaultVOMSAttribute, getDefaultVOMSVO, findDefaultGr...
gpl-3.0
breeezzz/local-bitcoins-api
LocalBitcoins/market_depth.py
1
6253
''' Created on 7 Jun 2013 @author: Jamie ''' import urllib2 import math import re import itertools import argparse from bs4 import BeautifulSoup import matplotlib.pyplot as plt markets = {'UK': {'url': 'gb/united%20kingdom/', 'curr': 'GBP'}, 'USA': {'url': 'us/united%20states/', 'curr': 'USD'}, ...
mit
kaiweifan/horizon
openstack_dashboard/dashboards/project/network_topology/ports/tables.py
10
1101
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NTT Innovation Institute 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...
apache-2.0
40223236/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/constants.py
603
15297
#!/usr/bin/env python '''Constants defined by SDL, and needed in pygame. Note that many of the flags for SDL are not needed in pygame, and are not included here. These constants are generally accessed from the `pygame.locals` module. This module is automatically placed in the pygame namespace, but you will usually ...
gpl-3.0
Soya93/Extract-Refactoring
python/lib/Lib/chunk.py
386
5372
"""Simple class to read IFF chunks. An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File Format)) has the following structure: +----------------+ | ID (4 bytes) | +----------------+ | size (4 bytes) | +----------------+ | data | | ... | +----------------+ The ID is a 4-byte s...
apache-2.0
marcellodesales/svnedge-console
ext/solaris/pkg-toolkit/pkg/vendor-packages/pkg/flavor/elf.py
4
7453
#!/usr/bin/python2.4 # # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://w...
agpl-3.0
jumitche/libstoragemgmt
python_binding/lsm/__init__.py
5
1330
# Copyright (C) 2011-2016 Red Hat, Inc. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or any later version. # # This library is distributed in the h...
lgpl-2.1
EugeneLiang/django-filer
filer/migrations/0010_folderpermissions.py
49
11223
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): ALLOW = 1 DENY = 0 def forwards(self, orm): for permission in orm.FolderPermission.objects.all(): permission.can_edit_new = se...
bsd-3-clause
kaiweifan/neutron
neutron/plugins/bigswitch/extensions/routerrule.py
20
4663
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Big Switch Networks, 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.a...
apache-2.0
jhseu/tensorflow
tensorflow/python/keras/saving/hdf5_format_test.py
1
46964
# 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
nwalters512/the-blue-alliance
tests/test_notification_update_subscriptions.py
7
1581
import unittest2 import json from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.client_type import ClientType from consts.notification_type import NotificationType from notifications.update_subscriptions import UpdateSubscriptionsNotification class TestUpdateFavoritesNotificat...
mit
openthread/openthread
tools/harness-automation/cases_R140/router_9_2_6.py
18
1877
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
felixjimenez/django
tests/forms_tests/models.py
105
3173
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import datetime import tempfile from django.core.files.storage import FileSystemStorage from django.db import models from django.utils.encoding import python_2_unicode_compatible temp_storage_location = tempfile.mkdtemp(dir=os.environ['DJANGO...
bsd-3-clause
dougfelt/nototools
nototools/merge_fonts.py
1
6510
#!/usr/bin/env python # # Copyright 2017 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 require...
apache-2.0
subailong/ns3-wireless-planning.ns-3
bindings/python/apidefs/gcc-ILP32/ns3_module_radvd.py
8
21115
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers def register_types(module): root_module = module.get_root() ## simple-ref-count.h: ns3::SimpleRefCount<ns3::RadvdInterface, ns3::empty, ns3::DefaultDeleter<ns3::RadvdInterface> > [class] module.add_class('SimpleRefCount'...
gpl-2.0
pinkavaj/gnuradio
gr-utils/python/modtool/modtool_base.py
51
9386
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
VishvajitP/Django-facebook
docs/docs_env/Lib/encodings/cp037.py
593
13377
""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input...
bsd-3-clause
sdeepanshu02/microblog
flask/Lib/site-packages/pip/_vendor/html5lib/trie/py.py
1323
1775
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
bsd-3-clause
thombashi/pytablewriter
test/writer/text/sourcecode/test_numpy_writer.py
1
6388
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import pytest import pytablewriter as ptw from ...._common import print_test_result from ....data import ( Data, headers, mix_header_list, mix_value_matrix, null_test_data_list, value_matrix, value_matrix_iter, va...
mit
mateusz880/mtasa-blue
vendor/google-breakpad/src/tools/gyp/test/configurations/target_platform/gyptest-target_platform.py
351
1112
#!/usr/bin/env python # Copyright (c) 2009 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. """ Tests the msvs specific msvs_target_platform option. """ import TestGyp import TestCommon def RunX64(exe, stdout): try: test.ru...
gpl-3.0
prasanna08/oppia
scripts/check_e2e_tests_are_captured_in_ci.py
1
8956
# Copyright 2020 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
Clarifai/kubernetes
hack/boilerplate/boilerplate.py
58
4960
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
G33KS44n/mysql-5.6
xtrabackup/test/kewpie/lib/test_mgmt/test_execution.py
20
16776
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2010 Patrick Crews # # 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 ...
gpl-2.0
applexiaohao/three.js
utils/converters/msgpack/msgpack/fallback.py
641
26403
"""Fallback pure Python implementation of msgpack""" import sys import array import struct if sys.version_info[0] == 3: PY3 = True int_types = int Unicode = str xrange = range def dict_iteritems(d): return d.items() else: PY3 = False int_types = (int, long) Unicode = unicode ...
mit
oliverhr/odoo
openerp/addons/base/ir/ir_translation.py
46
23771
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
planetarymike/IDL-Colorbars
IDL_py_test/027_Eos_B.py
1
5942
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf cm_data = [[1., 1., 1.], [1., 1., 1.], [0.498039, 0.498039, 0.498039], [0., 0., 0.513725], [0., 0., 0.533333], [0., 0., 0.54902], [0., 0., 0.564706], [0., 0., 0.580392], [0., 0., 0.6], [0., 0., 0.615686], [0., 0., 0.568627], [0., 0., 0.584...
gpl-2.0
adminneyk/codificacionproyectando
application/views/Generacion/Generacion/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/cgitb.py
57
12125
"""More comprehensive traceback formatting for Python scripts. To enable this module, do: import cgitb; cgitb.enable() at the top of your script. The optional arguments to enable() are: display - if true, tracebacks are displayed in the web browser logdir - if set, tracebacks are written to fi...
mit
balloob/home-assistant
homeassistant/components/blackbird/media_player.py
21
6569
"""Support for interfacing with Monoprice Blackbird 4k 8x8 HDBaseT Matrix.""" import logging import socket from pyblackbird import get_blackbird from serial import SerialException import voluptuous as vol from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity from homeassistant.component...
apache-2.0
AirsickPayload/DPRI_Engineering_Project_related_stuff
CLI_WIP.py
2
7214
#import RPi.GPIO as GPIO # -*- coding: utf-8 -*- import sys,tty,termios, curses, argparse from subprocess import call class Wartosci: def __init__(self): self.throttle = 0 self.yaw = 0 self.pitch = 0 self.roll = 0 class Procentowe(Wartosci): def setDefaultStates(self): ...
mit
purpleidea/macaronic-net
django/contrib/sessions/backends/db.py
232
2756
import datetime from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation from django.db import IntegrityError, transaction, router from django.utils.encoding import force_unicode class SessionStore(SessionBase): ...
agpl-3.0
williamleif/histwords
statutils/plothelper.py
2
5401
import matplotlib.pyplot as plt import numpy as np import scipy as sp def trendline(xd, yd, order=1, c='r', alpha=1, plot_r=False, text_pos=None): """Make a line of best fit""" #Calculate trendline coeffs = np.polyfit(xd, yd, order) intercept = coeffs[-1] slope = coeffs[-2] if order == 2: pow...
apache-2.0
shaistaansari/django
django/middleware/http.py
247
2129
from django.utils.http import http_date, parse_http_date_safe class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has an ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpNotModified. ...
bsd-3-clause
jroltgen/aqua-gesture-framework
samples/SampleEvent/scons-local-1.3.0/SCons/Tool/sunf90.py
5
2177
"""SCons.Tool.sunf90 Tool-specific initialization for sunf90, the Sun Studio F90 compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 20...
gpl-3.0
sdague/home-assistant
homeassistant/components/asuswrt/sensor.py
10
5092
"""Asuswrt status sensors.""" import logging from aioasuswrt.asuswrt import AsusWrt from homeassistant.const import DATA_GIGABYTES, DATA_RATE_MEGABITS_PER_SECOND from homeassistant.helpers.entity import Entity from . import DATA_ASUSWRT _LOGGER = logging.getLogger(__name__) UPLOAD_ICON = "mdi:upload-network" DOWNL...
apache-2.0
maestrano/openerp
openerp/addons/crm/wizard/crm_lead_to_opportunity.py
6
8522
# -*- 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
jab/bidict
bidict/_delegating.py
1
1313
# -*- coding: utf-8 -*- # Copyright 2009-2021 Joshua Bronson. All Rights Reserved. # # 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/. """Provide :class:`_DelegatingBidi...
mpl-2.0
vorwerkc/pymatgen
pymatgen/analysis/chemenv/utils/scripts_utils.py
5
17342
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module contains some script utils that are used in the chemenv package. """ import re from collections import OrderedDict import numpy as np from pymatgen.ext.matproj import MPRester from pymatgen....
mit
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/django/forms/formsets.py
47
18252
from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.forms import Form from django.forms.fields import BooleanField, IntegerField from django.forms.utils import ErrorList from django.forms.widgets import HiddenInput from django.utils import six from django.utils.encodi...
mit
zhiying8710/shadowsocks
shadowsocks/asyncdns.py
655
17416
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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
frederica07/Dragon_Programming_Process
PyOpenGL-3.0.2/OpenGL/GL/VERSION/GL_1_3.py
1
1829
'''OpenGL extension VERSION.GL_1_3 This module customises the behaviour of the OpenGL.raw.GL.VERSION.GL_1_3 to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/VERSION/GL_1_3.txt ''' from OpenGL import platform, constants, constant,...
bsd-2-clause
goFrendiAsgard/kokoropy
kokoropy/packages/sqlalchemy/ext/associationproxy.py
33
32975
# ext/associationproxy.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Contain the ``AssociationProxy`` class. The ``AssociationProxy`` is a Py...
mit
chadversary/chromiumos.chromite
lib/timeout_util_unittest.py
2
4371
#!/usr/bin/python # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test suite for timeout_util.py""" import datetime import os import sys import time sys.path.insert(0, os.path.dirname(os.path.d...
bsd-3-clause
GFibrizo/TPS_7529
TP1/Estadistico de orden K/fuerza_bruta.py
1
1235
def es_estadistico_orden_k(conjunto, candidato, k): menores = 0 for elem in conjunto: if elem < candidato: menores += 1 return menores == k ################################################################################ ##########################################################...
apache-2.0
google-research/google-research
nigt_optimizer/nigt_test.py
1
1295
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
zaxtax/scikit-learn
sklearn/mixture/dpgmm.py
9
32075
"""Bayesian Gaussian Mixture Models and Dirichlet Process Gaussian Mixture Models""" from __future__ import print_function # Author: Alexandre Passos (alexandre.tp@gmail.com) # Bertrand Thirion <bertrand.thirion@inria.fr> # # Based on mixture.py by: # Ron Weiss <ronweiss@gmail.com> # Fabian Ped...
bsd-3-clause
daniircosta/daniircosta.github.io
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
1284
100329
# Copyright (c) 2013 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. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
mit
baslr/ArangoDB
3rdParty/V8/V8-5.0.71.39/build/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
apache-2.0
kiok46/Code-Mentor-Tutorials
Navigation-tutotial/main.py
2
1621
from kivy.app import App from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty from kivymd.theming import ThemeManager # from kivymd.navigationdrawer import NavigationDrawer from navigationdrawer import NavigationDrawer main_widget_kv = ''' #:import Toolbar kivymd.toolbar.Toolbar B...
mit
mmoiozo/pprz_vg
sw/ext/bebop.py
21
20652
#!/usr/bin/env python from __future__ import print_function import re import argparse import socket import telnetlib import os from time import sleep from ftplib import FTP # Check if IP is valid def is_ip(address): try: socket.inet_aton(address) ip = True except socket.error: ip = Fa...
gpl-2.0
ifengkou/python_splider
history/smzdm_splider_re.py
1
4876
# -*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding( "utf-8" ) import string import urllib2 import re import json class HTML_Tool: # 用 非贪婪模式 匹配 \t 或者\n 或者 空格超链接 和图片 BgnCharToNoneRex = re.compile("(\t|\n|\r| |<a.*?>|<img.*?>)") #用 非贪婪模式 陪 任意 <> EndCharToNoneRex = re.compile("<.*?>") ...
mit
follow99/django
tests/m2o_recursive/models.py
282
1047
""" Relating an object to itself, many-to-one To define a many-to-one relationship between a model and itself, use ``ForeignKey('self', ...)``. In this example, a ``Category`` is related to itself. That is, each ``Category`` has a parent ``Category``. Set ``related_name`` to designate what the reverse relationship i...
bsd-3-clause
Ali-aqrabawi/ezclinic
lib/PIL/ImageOps.py
7
14633
# # The Python Imaging Library. # $Id$ # # standard image operations # # History: # 2001-10-20 fl Created # 2001-10-23 fl Added autocontrast operator # 2001-12-18 fl Added Kevin's fit operator # 2004-03-14 fl Fixed potential division by zero in equalize # 2005-05-05 fl Fixed equalize for low number of values ...
mit
ebilionis/variational-reformulation-of-inverse-problems
unittests/test_cached_function.py
1
1091
""" Tests the vuq.CachedFunction decorator. Author: Ilias Bilionis Date: 6/6/2014 """ import numpy as np import time from vuq import * # Test the evaluation of a cached and of an un-cached function # An expensive function def f(x): for i in xrange(1000): x += i x /= 1000000 return 2....
gpl-2.0
Shouqun/node-gn
tools/depot_tools/third_party/pylint/checkers/raw_metrics.py
86
4459
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
mit
otherness-space/myProject002
my_project_002/lib/python2.7/site-packages/setuptools/command/install.py
496
4685
from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://bitbucket.org/pypa/setuptools/issue/199/ _install = orig....
mit
trankmichael/numpy
doc/cdoc/numpyfilter.py
108
2978
#!/usr/bin/env python """ numpyfilter.py INPUTFILE Interpret C comments as ReStructuredText, and replace them by the HTML output. Also, add Doxygen /** and /**< syntax automatically where appropriate. """ from __future__ import division, absolute_import, print_function import sys import re import os import textwrap ...
bsd-3-clause
johnbachman/indra
indra/databases/hgnc_client.py
3
12380
import os import re import logging import requests import xml.etree.ElementTree as ET from functools import lru_cache from indra.util import read_unicode_csv, UnicodeXMLTreeBuilder as UTB logger = logging.getLogger(__name__) hgnc_url = 'http://rest.genenames.org/fetch/' def get_uniprot_id(hgnc_id): """Return ...
bsd-2-clause
wjzhang/pyOCD
test/gdb_server_json_test.py
5
5600
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2015 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
egabancho/invenio
invenio/legacy/dbquery_postgresql.py
2
11739
## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 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 ## License, or (at your ...
gpl-2.0
CourseTalk/edx-platform
lms/djangoapps/shoppingcart/processors/CyberSource2.py
37
28163
""" Implementation of the CyberSource credit card processor using the newer "Secure Acceptance API". The previous Hosted Order Page API is being deprecated as of 9/14. For now, we're keeping the older implementation in the code-base so we can quickly roll-back by updating the configuration. Eventually, we should repl...
agpl-3.0
tensorflow/tensorflow
tensorflow/python/keras/layers/normalization/layer_normalization.py
6
13322
# 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
kgiusti/gofer
src/gofer/messaging/consumer.py
1
4280
# Copyright (c) 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied, # including the impl...
lgpl-2.1
nicobustillos/odoo
addons/mail/mail_followers.py
62
12004
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
KellyChan/Python
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/auth/tests/decorators.py
251
1562
from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.tests.views import AuthViewsTestCase class LoginRequiredTestCase(AuthViewsTestCase): """ Tests the login_required decorators """ urls = 'django.contrib.auth.tests.urls' def testCalla...
mit