repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
janvdb-eu/rpi-rgb-led-matrix-server
src/python/led_matrix_client/NetworkClient.py
1
1254
# Network client in Python import socket from crcmod.predefined import mkPredefinedCrcFun from . import Response from . import Util def sendData(sock, data): sock.sendall(data) def receiveData(sock, size): buf = bytearray(size) sock.recv_into(buf, size, socket.MSG_WAITALL) return buf def calculateCrc(data)...
apache-2.0
filipenf/ansible
lib/ansible/parsing/splitter.py
22
10710
# (c) 2014 James Cammarata, <jcammarata@ansible.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
alan-unravel/bokeh
bokeh/io.py
39
14856
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
bsd-3-clause
samueladam/worldgame
src/worldgame/data/world_borders.py
1
1247
#!/home/sam/code/worldgame/parts/pip/bin/python import sys sys.path[0:0] = [ '/home/sam/code/worldgame/parts/pip/lib/python2.5/site-packages', '/home/sam/code/worldgame/src', ] import os os.environ['DJANGO_SETTINGS_MODULE'] = 'worldgame.test_settings' from django.contrib.gis.gdal.datasource import DataSource...
bsd-3-clause
meletakis/collato
lib/python2.7/site-packages/django/contrib/gis/geos/base.py
225
1635
from ctypes import c_void_p from django.contrib.gis.geos.error import GEOSException # Trying to import GDAL libraries, if available. Have to place in # try/except since this package may be used outside GeoDjango. try: from django.contrib.gis import gdal except ImportError: # A 'dummy' gdal module. class ...
gpl-2.0
ldirer/scikit-learn
sklearn/isotonic.py
23
14061
# Authors: Fabian Pedregosa <fabian@fseoane.net> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Nelle Varoquaux <nelle.varoquaux@gmail.com> # License: BSD 3 clause import numpy as np from scipy import interpolate from scipy.stats import spearmanr from .base import BaseEstimator, TransformerMixi...
bsd-3-clause
ojii/sandlib
lib/lib-python/2.7/distutils/core.py
175
9093
"""distutils.core The only module that needs to be imported to use the Distutils; provides the 'setup' function (which is to be called from the setup script). Also indirectly provides the Distribution and Command classes, although they are really defined in distutils.dist and distutils.cmd. """ __revision__ = "$Id$"...
bsd-3-clause
kiibohd/kll
kll/common/file.py
1
3574
#!/usr/bin/env python3 ''' KLL File Container ''' # Copyright (C) 2016-2018 by Jacob Alexander # # This file 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 opti...
gpl-3.0
jart/tensorflow
tensorflow/contrib/lite/testing/generate_examples.py
1
102877
# 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
peastone/robobackup
logtools.py
1
4612
# -*- coding: utf-8 -*- """ This file is part of Robobackup. Copyright 2015 Siegfried Schoefer Robobackup 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
ShiYw/Sigil
3rdparty/python/Lib/encodings/hex_codec.py
202
1508
"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding. This codec de/encodes from bytes to bytes. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs import binascii ### Codec APIs def hex_encode(input, errors='strict'): assert errors == 'strict' return (binascii.b2a_hex(input)...
gpl-3.0
kasioumis/invenio
invenio/legacy/websubmit/functions/Print_Success_APP.py
13
5763
# 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 the # License, or (at your option)...
gpl-2.0
southpaw94/MachineLearning
HPTuning/SKPipeline.py
1
1446
import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.linear_model import LogisticRegression from sklearn.pipeline import Pipeline fro...
gpl-2.0
hkhamm/django_rest_tutorial_2
env/lib/python2.7/site-packages/django/core/servers/fastcgi.py
241
6638
""" FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol. Uses the flup python package: http://www.saddi.com/software/flup/ This is a adaptation of the flup package to add FastCGI server support to run Django apps from Web servers that support the FastCGI protocol. This module can be run standalo...
mit
hujiajie/chromium-crosswalk
tools/cr/cr/base/host.py
89
5957
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module for build host support.""" import os import pipes import signal import subprocess import cr # Controls what verbosity level turns on command tra...
bsd-3-clause
elijah513/tornado
maint/test/websocket/client.py
111
1387
#!/usr/bin/env python import logging from tornado import gen from tornado.ioloop import IOLoop from tornado.options import define, options, parse_command_line from tornado.websocket import websocket_connect define('url', default='ws://localhost:9001') define('name', default='Tornado') @gen.engine def run_tests(): ...
apache-2.0
jaimeMF/youtube-dl
youtube_dl/extractor/canalplus.py
15
5616
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, HEADRequest, unified_strdate, url_basename, qualities, int_or_none, ) class CanalplusIE(InfoExtractor): IE_DESC = 'canalplus.fr, piwiplus.fr and d8....
unlicense
Krossom/python-for-android
python-modules/twisted/twisted/words/protocols/irc.py
49
100168
# -*- test-case-name: twisted.words.test.test_irc -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Internet Relay Chat Protocol for client and server. Future Plans ============ The way the IRCClient class works here encourages people to implement IRC clients by subclassing th...
apache-2.0
aperigault/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_ssl_proxy_info.py
2
6552
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
mtconley/turntable
test/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py
1777
19348
######################## 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...
mit
catapult-project/catapult-csm
third_party/google-endpoints/requests/api.py
65
5987
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :para...
bsd-3-clause
hotpxl/mxnet
example/neural-style/end_to_end/gen_v3.py
15
2601
# coding: utf-8 # In[1]: import sys sys.path.insert(0, "../../mxnet/python") # In[2]: import mxnet as mx import numpy as np def Conv(data, num_filter, kernel=(5, 5), pad=(2, 2), stride=(2, 2)): sym = mx.sym.Convolution(data, num_filter=num_filter, kernel=kernel, stride=stride, pad=pad, no_bias=False) sy...
apache-2.0
LREN-CHUV/data-factory-airflow-dags
ehr_pipelines/ehr_to_i2b2.py
2
2207
""" Take EHR data located in a study folder and convert it to I2B2. Poll a base directory for incoming CSV files ready for processing. We assume that CSV files are already anonymised and organised with the following directory structure: 2016 _ 20160407 _ patients.csv _ diseases.csv _ ....
apache-2.0
MrCubanfrog/NorDB
nordb/core/nordic2sc3.py
1
1097
""" This module contains tools to convert a nordic file to a `SC3 file`_. This is done by converting the nordic first to a quakeml etree.XML object and then converting it to SC3 from there using the schema in the geofon website. .. _SC3 file: http://geofon.gfz-potsdam.de/schema/0.9/ Functions and Classes ------------...
mit
eresearchrmit/hpctardis
tardis/apps/hpctardis/urls.py
3
1997
from django.conf.urls.defaults import patterns from tardis.urls import urlpatterns as tardisurls from django.conf import settings # Create the hpcardis links urlpatterns = patterns('tardis.apps.hpctardis.views', (r'^rif_cs/$','rif_cs'), (r'^publishauth/$','auth_exp_publish'), (r'^apps/hpctardis/protocol/$'...
bsd-3-clause
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/transplant.py
1
25775
# Patch transplanting extension for Mercurial # # Copyright 2006, 2007 Brendan Cully <brendan@kublai.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to transplant changesets from another branch This extension allo...
gpl-3.0
googleapis/googleapis-gen
google/cloud/aiplatform/v1/aiplatform-v1-py/google/cloud/aiplatform_v1/services/model_service/transports/grpc_asyncio.py
1
23526
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
stwunsch/gnuradio
gr-blocks/python/blocks/qa_stream_mux.py
18
9577
#!/usr/bin/env python # # Copyright 2004,2005,2007,2010,2012,2013,2014 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 ver...
gpl-3.0
ionutbalutoiu/ironic
ironic/tests/unit/conductor/test_task_manager.py
2
33203
# coding=utf-8 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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/li...
apache-2.0
alexbrasetvik/Piped
piped/processors/web_processors.py
2
12588
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. import datetime import json from twisted.web import http from twisted.internet import defer from twisted.web import client from zope import interface from piped import util, exceptions, processing, yamlutil from piped.p...
mit
crafty78/ansible
lib/ansible/galaxy/token.py
68
2167
#!/usr/bin/env python ######################################################################## # # (C) 2015, Chris Houseknecht <chouse@ansible.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...
gpl-3.0
Esri/raster-functions
functions/deprecated/Arithmetic.py
1
2585
import numpy as np class Arithmetic(): def __init__(self): self.name = "Arithmetic Function" self.description = "Performs simple arithmetic operations on two rasters." self.op = None def getParameterInfo(self): return [ { 'name': 'r1', ...
apache-2.0
radlws/AWS-ElasticBeanstalk-CLI
eb/macosx/python2.7/lib/aws/requests/packages/charade/mbcharsetprober.py
8
3352
######################## 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....
apache-2.0
zsx/hotwire
hotwire/builtin.py
1
11082
# This file is part of the Hotwire Shell project API. # Copyright (C) 2007 Colin Walters <walters@verbum.org> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, includin...
gpl-2.0
girving/tensorflow
tensorflow/contrib/mixed_precision/python/loss_scale_manager_test.py
22
6362
# 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
Belxjander/Kirito
Python-3.5.0-main/Lib/idlelib/idle_test/test_parenmatch.py
79
3538
"""Test idlelib.ParenMatch.""" # This must currently be a gui test because ParenMatch methods use # several text methods not defined on idlelib.idle_test.mock_tk.Text. import unittest from unittest.mock import Mock from test.support import requires from tkinter import Tk, Text from idlelib.ParenMatch import ParenMatch...
gpl-3.0
vivianli32/TravelConnect
flask/lib/python3.4/site-packages/sqlalchemy/ext/instrumentation.py
56
14646
"""Extensible class instrumentation. The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate systems of class instrumentation within the ORM. Class instrumentation refers to how the ORM places attributes on the class which maintain data and track changes to that data, as well as event hooks installed...
mit
harisibrahimkv/django
django/contrib/gis/feeds.py
62
5733
from django.contrib.syndication.views import Feed as BaseFeed from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed class GeoFeedMixin: """ This mixin provides the necessary routines for SyndicationFeed subclasses to produce simple GeoRSS or W3C Geo elements. """ def georss_coords(self...
bsd-3-clause
uwdata/termite-data-server
web2py/gluon/contrib/pysimplesoap/transport.py
32
9849
#!/usr/bin/python # -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 3, or (at your option) any later # version. # # This program is distributed in the...
bsd-3-clause
ptrendx/mxnet
python/mxnet/gluon/trainer.py
1
22550
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
heidsoft/VirtualBox
src/VBox/Devices/EFI/Firmware/BaseTools/Tests/TestTools.py
11
5639
## @file # Utility functions and classes for BaseTools unit tests # # Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The...
gpl-2.0
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/test/test_tools.py
87
9569
"""Tests for scripts in the Tools directory. This file contains regression tests for some of the scripts found in the Tools directory of a Python checkout or tarball, such as reindent.py. """ import os import sys import unittest import shutil import subprocess import sysconfig import tempfile import textwrap from tes...
lgpl-3.0
hexa00/binutils-gdb
gdb/python/lib/gdb/command/explore.py
26
26824
# GDB 'explore' command. # Copyright (C) 2012-2016 Free Software Foundation, 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 License, or # (at your option) any late...
gpl-2.0
singingwolfboy/invoke
invoke/vendor/yaml3/composer.py
273
4881
__all__ = ['Composer', 'ComposerError'] from .error import MarkedYAMLError from .events import * from .nodes import * class ComposerError(MarkedYAMLError): pass class Composer: def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if self.ch...
bsd-2-clause
MERegistro/meregistro
meregistro/apps/postitulos/views/normativa_jurisdiccional.py
1
6315
# -*- coding: UTF-8 -*- from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from meregistro.shortcuts import my_render from apps.seguridad.decorators import login_required, credential_required from apps.postitulos.models import NormativaPostituloJurisdiccional, EstadoNormativaPost...
bsd-3-clause
belmer/nw.js
test/test.py
67
42771
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
mit
danielelinaro/dynclamp
python/lcg/entities.py
1
16580
# # This file contains definitions of all the entities, so that they can be used # with the class that writes configuration files. # # Author: Daniele Linaro - May 2013 # from config_writer import XMLEntry class Entity (XMLEntry): def __init__(self, name, id, connections): super(Entity,self).__init__('En...
gpl-3.0
habnabit/pip
pip/basecommand.py
1
11615
"""Base Command class, and related routines""" from __future__ import absolute_import import logging import os import sys import traceback import optparse import warnings from pip._vendor.six import StringIO from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.download import PipSes...
mit
blacktear23/django
django/db/backends/oracle/creation.py
153
11808
import sys, time from django.db.backends.creation import BaseDatabaseCreation TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated Oracle column # types, as strings. Column-type strings can contain fo...
bsd-3-clause
vbshah1992/microblog
flask/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/_vendor/html5lib/treebuilders/_base.py
915
13711
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent for...
bsd-3-clause
raonyguimaraes/pynnotator
pynnotator/helpers/vt.py
1
1780
import argparse import logging import os import subprocess from subprocess import check_output import common logging.basicConfig(filename='vt.log', level=logging.DEBUG) class VT(): def __init__(self, args): if args.install: self.install() self.vt = '{}/vt'.format(common.libs_dir) ...
bsd-3-clause
TeamTwisted/external_chromium_org
tools/telemetry/telemetry/core/gpu_device_unittest.py
33
1491
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.core import gpu_device class TestGPUDevice(unittest.TestCase): def testConstruction(self): device = gpu_device.GPUDevi...
bsd-3-clause
bruecksen/impacts-world
impacts_world/pages/migrations/0001_initial.py
1
56491
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-17 12:12 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import impacts_world.contrib.blocks import impacts_world.core.models import impacts_world.pages.blocks import modelcluster.fields im...
mit
lmacken/moksha
moksha/tests/models/test_entity.py
2
4314
# -*- coding: utf-8 -*- # This file is part of Moksha. # Copyright (C) 2008-2010 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...
apache-2.0
jhaux/tensorflow
tensorflow/contrib/learn/python/learn/basic_session_run_hooks.py
118
1403
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Deepakkothandan/ansible-modules-extras
monitoring/sensu_check.py
34
13494
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Anders Ingemann <aim@secoya.dk> # # 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 Licen...
gpl-3.0
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/gender_view_service/client.py
1
17754
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
benthomasson/ansible
lib/ansible/modules/cloud/amazon/ecs_ecr.py
51
11804
#!/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
chinmaygarde/depot_tools
third_party/boto/s3/user.py
104
1969
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
bsd-3-clause
gigawhitlocks/zulip
zerver/worker/queue_processors.py
115
13794
from __future__ import absolute_import from django.conf import settings from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.base import BaseHandler from zerver.models import get_user_profile_by_email, \ get_user_profile_by_id, get_prereg_user_by_email, get_client from zerver.lib.context_man...
apache-2.0
puttarajubr/commcare-hq
corehq/apps/hqadmin/management/commands/record_deploy_success.py
1
2175
import socket from django.core.management import call_command from django.template.loader import render_to_string from dimagi.utils import gitinfo from django.core.management.base import BaseCommand from corehq.apps.hqadmin.models import HqDeploy from datetime import datetime from optparse import make_option from djang...
bsd-3-clause
gagneurlab/concise
tests/utils/test_utils_pwm.py
2
2519
import pytest from concise.utils import PWM, pwm_list2pwm_array import numpy as np # PWM def test_pwm_basic(): pwm = np.array([[1, 2, 3, 4], [2, 4, 4, 5]]) p = PWM(pwm, name="mypwm") assert p.get_consensus() == "TT" def test_pwm_errors(): with pytest.raises(Exception): pwm = np.array([[-1,...
mit
kblin/supybot-gsoc
plugins/Status/plugin.py
6
8172
### # Copyright (c) 2002-2005, Jeremiah Fincher # 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 co...
bsd-3-clause
openmb/stb-gui
lib/python/Tools/GetEcmInfo.py
15
3795
import os import time ECM_INFO = '/tmp/ecm.info' EMPTY_ECM_INFO = '','0','0','0' old_ecm_time = time.time() info = {} ecm = '' data = EMPTY_ECM_INFO class GetEcmInfo: def pollEcmData(self): global data global old_ecm_time global info global ecm try: ecm_time = os.stat(ECM_INFO).st_mtime except: ec...
gpl-2.0
yjmade/odoo
addons/knowledge/__init__.py
436
1064
# -*- 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
havard024/prego
venv/lib/python2.7/site-packages/pygments/console.py
75
1850
# -*- coding: utf-8 -*- """ pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" cod...
mit
rsvip/Django
tests/null_fk_ordering/tests.py
381
2012
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Author, Comment, Forum, Post, SystemInfo class NullFkOrderingTests(TestCase): def test_ordering_across_null_fk(self): """ Regression test for #7512 ordering across nullable Foreign Key...
bsd-3-clause
ecederstrand/django
django/contrib/postgres/forms/ranges.py
393
3005
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
bsd-3-clause
minhphung171093/OpenERP_V7
openerp/addons/l10n_at/__openerp__.py
430
1785
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
caisq/tensorflow
tensorflow/contrib/linear_optimizer/python/sdca_estimator.py
39
21783
# 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
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/Django-1.6.10/extras/csrf_migration_helper.py
59
12998
#!/usr/bin/env python # This script aims to help developers locate forms and view code that needs to # use the new CSRF protection in Django 1.2. It tries to find all the code that # may need the steps described in the CSRF documentation. It does not modify # any code directly, it merely attempts to locate it. Deve...
apache-2.0
alimony/django
tests/null_fk_ordering/tests.py
133
1971
from django.test import TestCase from .models import Article, Author, Comment, Forum, Post, SystemInfo class NullFkOrderingTests(TestCase): def test_ordering_across_null_fk(self): """ Regression test for #7512 ordering across nullable Foreign Keys shouldn't exclude results """ ...
bsd-3-clause
pdellaert/ansible
test/units/modules/system/test_parted.py
68
8649
# (c) 2017 Red Hat Inc. # # 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 dis...
gpl-3.0
sarvex/django
tests/utils_tests/test_safestring.py
278
3677
from __future__ import unicode_literals from django.template import Context, Template from django.test import SimpleTestCase from django.utils import html, six, text from django.utils.encoding import force_bytes, force_text from django.utils.functional import lazy from django.utils.safestring import ( EscapeData, ...
bsd-3-clause
AndreasWilliams/BotGravindo
src/scons-local-2.0.1/SCons/Tool/aixcc.py
61
2387
"""SCons.Tool.aixcc Tool-specific initialization for IBM xlc / Visual Age C 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, 2009, 20...
gpl-2.0
octavioturra/aritial
google_appengine/lib/django/django/views/decorators/http.py
33
1216
""" Decorators for views based on HTTP headers. """ from django.utils.decorators import decorator_from_middleware from django.middleware.http import ConditionalGetMiddleware from django.http import HttpResponseNotAllowed conditional_page = decorator_from_middleware(ConditionalGetMiddleware) def require_http_methods(...
apache-2.0
n-west/pybombs
mod_pybombs/globals.py
8
4959
# # Copyright 2013 Tim O'Shea # # This file is part of PyBOMBS # # PyBOMBS 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. # # PyBOMBS is distributed ...
gpl-3.0
brokenjacobs/ansible
lib/ansible/modules/network/nxos/nxos_vpc.py
23
11723
#!/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
jenisys/behave
behave/userdata.py
3
7706
# -*- coding: UTF-8 -*- """ Functionality to support user-specific configuration data (userdata). """ from __future__ import absolute_import from behave._types import Unknown # ----------------------------------------------------------------------------- # FUNCTIONS: # -----------------------------------------------...
bsd-2-clause
gonboy/sl4a
python-build/python-libs/gdata/src/gdata/tlslite/integration/XMLRPCTransport.py
271
5812
"""TLS Lite + xmlrpclib.""" import xmlrpclib import httplib from gdata.tlslite.integration.HTTPTLSConnection import HTTPTLSConnection from gdata.tlslite.integration.ClientHelper import ClientHelper class XMLRPCTransport(xmlrpclib.Transport, ClientHelper): """Handles an HTTPS transaction to an XML-RPC server.""" ...
apache-2.0
ap--/cagraph-1.2-gtk3
cagraph/series/labels.py
5
2601
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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. # # This program is distr...
gpl-3.0
j-windsor/iRiot-WebApp
iriot/settings.py
1
4295
""" Django settings for iriot project on Heroku. Fore more info, see: https://github.com/heroku/heroku-django-template For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ "...
mit
anentropic/django-oscar
src/oscar/apps/order/utils.py
4
10088
from decimal import Decimal as D from django.conf import settings from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_class, get_model from . import exceptions Order = get_model('order', 'Order') Line = get_model('order', 'Line') Or...
bsd-3-clause
mikeireland/chronostar
unit_tests/test_overlap.py
1
6368
#! /usr/bin/env python """ Small unit test used to confirm two different derivations of the overlap integral of two multivariate gaussians are equivalent. Appears to be equivalent within 7-8 sig figs """ import logging import numpy as np import sys sys.path.insert(0, '..') import chronostar.compfitter...
mit
colemanja91/PyEloqua-Examples
venv/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
gpl-2.0
rainier-m/python-soccer
parseBBC.py
1
1877
''' Created on Jun 12, 2014 Modified on Jun 16, 2014 Version 0.03 @author: rainier.madruga@gmail.com A simple Python Program to scrape the BBC News website for content. ''' from bs4 import BeautifulSoup import os, sys, csv import urllib2 import datetime # Define current path for the Script currentPath = o...
gpl-2.0
naparuba/opsbro
data/global-configuration/packs/synology/hostingdrivers/hostingdriver_synology.py
2
2812
import os from opsbro.hostingdrivermanager import InterfaceHostingDriver, HOSTING_DRIVER_LAYER_PHYSICAL class DockerContainerHostingDriver(InterfaceHostingDriver): name = 'synology' layer = HOSTING_DRIVER_LAYER_PHYSICAL def __init__(self): super(DockerContainerHostingDriver, self).__ini...
mit
JMoravec/unkRadnet
zunzunCode/pythonequations/Examples/SimpleExamples/Spline2D.py
2
1472
#! /usr/bin/python # Version info: $Id: NonLinearFit2D.py 10 2008-06-28 01:32:52Z zunzun.com $ # the pythonequations base is located up one directory from the top-level examples # directory, go up one directory in the path from there for the import to work properly import sys, os if os.path.join(sys.path[0][:sys.pa...
bsd-3-clause
rrrene/django
django/db/backends/base/features.py
193
9883
from django.db.models.aggregates import StdDev from django.db.utils import ProgrammingError from django.utils.functional import cached_property class BaseDatabaseFeatures(object): gis_enabled = False allows_group_by_pk = False allows_group_by_selected_pks = False empty_fetchmany_value = [] update_...
bsd-3-clause
toddpalino/kafka-tools
tests/tools/models/test_group.py
1
2201
import unittest from kafka.tools.models.group import Group, GroupMember class GroupTests(unittest.TestCase): def test_group_create(self): group = Group('testgroup') assert group.name == 'testgroup' def test_updated_since(self): group = Group('testgroup') group._last_updated =...
apache-2.0
oostenveld/eegsynth-matlab
module/clockmultiplier/clockmultiplier.py
2
7698
#!/usr/bin/env python # This software is part of the EEGsynth project, see <https://github.com/eegsynth/eegsynth>. # # Copyright (C) 2018-2020 EEGsynth project # # 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 Soft...
gpl-2.0
mgedmin/scrapy
tests/test_logformatter.py
80
2131
import unittest import six from scrapy.spiders import Spider from scrapy.http import Request, Response from scrapy.item import Item, Field from scrapy.logformatter import LogFormatter class CustomItem(Item): name = Field() def __str__(self): return "name: %s" % self['name'] class LoggingContribTe...
bsd-3-clause
richardliaw/ray
python/ray/tune/schedulers/hb_bohb.py
2
6580
import logging from typing import Dict, Optional from ray.tune import trial_runner from ray.tune.schedulers.trial_scheduler import TrialScheduler from ray.tune.schedulers.hyperband import HyperBandScheduler, Bracket from ray.tune.trial import Trial logger = logging.getLogger(__name__) class HyperBandForBOHB(HyperBa...
apache-2.0
zvolsky/cgmconfig
languages/zh.py
152
10080
# coding: utf8 { '!langcode!': 'zh-tw', '!langname!': '中文', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"', '%s %%{row} deleted': '已刪除 %s 筆', '%s %%{row} updated': '已更新 %s 筆', '%s s...
agpl-3.0
andresmrm/brython-experiment
static/brython/Lib/configparser.py
692
50025
"""Configuration file parser. A configuration 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. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
agpl-3.0
erbridge/NQr
src/main.py
1
17702
"""Main NQr module. Run to start NQr.""" # TODO: Allow use of bpm for music queueing (from ID3)? # TODO: Allow import of directories with a score. # TODO: ORGANIZE CODE # TODO: Add track with tag retrieval? # TODO: Populate prefs window including customizable score range (with # database converter)? # TODO: Make...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_scope.py
84
20234
import unittest import weakref from test.support import check_syntax_error, cpython_only, run_unittest class ScopeTests(unittest.TestCase): def testSimpleNesting(self): def make_adder(x): def adder(y): return x + y return adder inc = make_adder(1) ...
gpl-2.0
itnihao/thriftpy
tests/storm.py
5
15255
# -*- coding: utf-8 -*- """ This file shows what dynamically generated """ from thriftpy.thrift import ( TPayload, TException, TType, ) class JavaObjectArg(TPayload): thrift_spec = {1: (TType.I32, 'int_arg', False), 2: (TType.I64, 'long_arg', False), 3: (TType.S...
mit
aayush2911/Fibonaccio
web2py/gluon/tests/test_tools.py
13
2558
#!/bin/python # -*- coding: utf-8 -*- """ Unit tests for gluon.tools """ import os import sys if sys.version < "2.7": import unittest2 as unittest else: import unittest from fix_path import fix_sys_path fix_sys_path(__file__) DEFAULT_URI = os.getenv('DB', 'sqlite:memory') from gluon.dal import DAL, Fie...
gpl-2.0
gnieboer/gnuradio
gr-uhd/examples/python/max_power.py
58
5106
#!/usr/bin/env python # # Copyright 2004,2007,2011,2012 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 ...
gpl-3.0