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
kayak/pypika
pypika/tests/test_aggregate.py
1
3946
import unittest from pypika import ( Case, Field, Table, functions as fn, ) from pypika.terms import ( Negative, ValueWrapper, ) class IsAggregateTests(unittest.TestCase): def test__field_is_not_aggregate(self): v = Field("foo") self.assertFalse(v.is_aggregate) def te...
apache-2.0
jsteemann/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/toaiff.py
293
3142
"""Convert "arbitrary" sound files to AIFF (Apple and SGI's audio format). Input may be compressed. Uncompressed file type may be AIFF, WAV, VOC, 8SVX, NeXT/Sun, and others. An exception is raised if the file is not of a recognized type. Returned filename is either the input filename or a temporary filename; in the la...
apache-2.0
poffuomo/spark
examples/src/main/python/mllib/kernel_density_estimation_example.py
128
1525
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
ukanga/SickRage
lib/dogpile/cache/backends/memcached.py
47
10360
""" Memcached Backends ------------------ Provides backends for talking to `memcached <http://memcached.org>`_. """ from dogpile.cache.api import CacheBackend, NO_VALUE from dogpile.cache import compat from dogpile.cache import util import random import time __all__ = 'GenericMemcachedBackend', 'MemcachedBackend',\...
gpl-3.0
yamila-moreno/nikola
nikola/data/themes/base/messages/messages_ar.py
6
1534
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "", "(active)": "", "Also available in:": "أيضا متوفر في:", "Archive": "الأرشيف", "Categories": "فئات", "Comments": "التّعليقات", "LANGUAGE": "العربيّة", "Languages:": "اللغات", ...
mit
xuweiliang/Codelibrary
nova/virt/libvirt/config.py
1
88481
# Copyright (C) 2012-2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
schinke/solid-fortnight-ba
flask/venv/lib/python2.7/site-packages/alembic/ddl/oracle.py
43
2687
from sqlalchemy.ext.compiler import compiles from .impl import DefaultImpl from .base import alter_table, AddColumn, ColumnName, \ format_column_name, ColumnNullable, \ format_server_default, ColumnDefault, format_type, ColumnType class OracleImpl(DefaultImpl): __dialect__ = 'oracle' transactional_dd...
mit
TridevGuha/django
tests/custom_columns/tests.py
207
4090
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import Article, Author class CustomColumnsTests(TestCase): def setUp(self): self.a1 = Author.objects.create(first_name="John", last_name="Smit...
bsd-3-clause
zhuyue1314/SPF
spf/core/framework.py
1
39468
#import getopt import argparse import emails import sys import re import os import subprocess import time import signal from collections import defaultdict from emails import EmailTemplate from utils import Utils from display import Display from gather import Gather from mydns import Dns from webprofiler import profile...
bsd-3-clause
imcleod/anaconda-ec2
ozutil.py
1
22263
# Copyright (C) 2010,2011,2012 Chris Lalancette <clalance@redhat.com> # Copyright (C) 2012,2013 Chris Lalancette <clalancette@gmail.com> # 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;...
lgpl-2.1
devsarr/ONLYOFFICE-OnlineEditors
ActiveX/Common/DocxFormat/Source/XML/libxml2/XML/python/tests/relaxng.py
35
1203
#!/usr/bin/python -u import libxml2 import sys # Memory debug specific libxml2.debugMemory(1) schema="""<?xml version="1.0"?> <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/annotation/1.0" xmlns:ex1="http://www.example.com/n1" xmlns:e...
agpl-3.0
cydenix/OpenGLCffi
OpenGLCffi/GL/EXT/KHR/robustness.py
1
1324
from OpenGLCffi.GL import params @params(api='gl', prms=[]) def glGetGraphicsResetStatus(): pass @params(api='gl', prms=['x', 'y', 'width', 'height', 'format', 'type', 'bufSize', 'data']) def glReadnPixels(x, y, width, height, format, type, bufSize, data): pass @params(api='gl', prms=['program', 'location', 'bufS...
mit
Jefffffrey/smart-note
note/module/visitor.py
2
2557
from note.module.element import AllNoteHandleResults, OneNoteHandleResult from note.utils import Base class Visitor: def visit(self, results: AllNoteHandleResults): raise NotImplementedError class StatusResultVisitor(Visitor): def visit(self, results: AllNoteHandleResults): """返回HandleResult...
gpl-3.0
c0hen/django-venv
lib/python3.4/site-packages/django/db/migrations/recorder.py
478
2868
from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.db.utils import DatabaseError from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now from .exceptions import MigrationSchemaMissing class MigrationRecor...
gpl-3.0
cshallue/models
research/minigo/gtp_wrapper.py
2
4110
# 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
lsgunth/rapidsms
rapidsms/backends/base.py
1
3082
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from rapidsms.utils.modules import import_class class BackendBase(object): """Base class for outbound backend functionality.""" @classmethod def find(cls, module_name): """ Helper function to import backend classes. :param modul...
bsd-3-clause
broferek/ansible
lib/ansible/module_utils/network/nxos/facts/lag_interfaces/lag_interfaces.py
23
4484
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)#!/usr/bin/python """ The nxos lag_interfaces fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is ...
gpl-3.0
javilonas/NCam
cross/android-toolchain/lib/python2.7/bsddb/dbrecio.py
203
5308
""" File-like objects that read from or write to a bsddb record. This implements (nearly) all stdio methods. f = DBRecIO(db, key, txn=None) f.close() # explicitly release resources held flag = f.isatty() # always false pos = f.tell() # get current position f.seek(pos) # set current position ...
gpl-3.0
qmarlats/pyquizz
env/lib/python3.5/site-packages/pip/_vendor/html5lib/utils.py
436
3267
from __future__ import absolute_import, division, unicode_literals from types import ModuleType from pip._vendor.six import text_type try: import xml.etree.cElementTree as default_etree except ImportError: import xml.etree.ElementTree as default_etree __all__ = ["default_etree", "MethodDispatcher", "isSurr...
gpl-3.0
Arafatk/sympy
sympy/utilities/tests/test_decorator.py
84
1253
from sympy.utilities.decorator import threaded, xthreaded from sympy import Eq, Matrix from sympy.abc import x, y from sympy.core.decorators import wraps def test_threaded(): @threaded def function(expr, *args): return 2*expr + sum(args) assert function(Matrix([[x, y], [1, x]]), 1, 2) == \ ...
bsd-3-clause
Emilgardis/falloutsnip
Vendor/IronPython/Lib/encodings/punycode.py
586
6813
# -*- coding: iso-8859-1 -*- """ Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs ##################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = [] extended = {} for c in st...
gpl-3.0
LearnEra/LearnEraPlaftform
common/djangoapps/course_modes/migrations/0007_add_description.py
25
2269
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CourseMode.description' db.add_column('course_modes_coursemode', 'description', ...
agpl-3.0
yacomink/inyourface
inyourface/Animator.py
1
7109
import sys import logging import io import hashlib import pprint import io import os import pickle import inspect import traceback import requests from subprocess import call from PIL import Image, ImageDraw from tempfile import NamedTemporaryFile from inyourface.Face import Face from google.cloud import vision from g...
mit
preveyj/Udacity-FSWDND-Project-4
conference.py
1
34413
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime from dat...
apache-2.0
lumirayz/PyMATE
src/pminit.py
1
2642
# -------------------- # # PMInit.py # # Initializes PyMATE. # -> Parses command-line arguments. # -> Loads configuration. # -> Switches to PMGui. # -------------------- # # -------------------- # # Imports # -------------------- # from optparse import OptionParser import pmconfig import pmgui import os # -----------...
gpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/SocketServer.py
76
23342
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
agpl-3.0
vxsx/django-cms
cms/utils/placeholder.py
2
11943
# -*- coding: utf-8 -*- import operator import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models.query_utils import Q from django.template import TemplateSyntaxError, NodeList, Variable, Context, Template, engines from django.template.base import Va...
bsd-3-clause
markeTIC/OCB
addons/portal/__init__.py
382
1140
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
0todd0000/spm1d
spm1d/rft1d/examples/val_upx_3_T2_cluster.py
1
2122
from math import sqrt,log import numpy as np from matplotlib import pyplot from spm1d import rft1d eps = np.finfo(float).eps def here_hotellingsT2(y): N = y.shape[0] m = np.matrix( y.mean(axis=0) ) T2 = [] for ii,mm in enumerate(m): W = np.matrix( np.cov(y[:,ii,:].T, ddof=1) ) #e...
gpl-3.0
Nick-Hall/gramps
gramps/plugins/db/bsddb/bsddb.gpr.py
4
1287
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2015 Douglas Blank <doug.blank@gmail.com> # # 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...
gpl-2.0
okffi/booktype
lib/booki/editor/management/commands/createuser.py
2
2670
# This file is part of Booktype. # Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org> # # Booktype is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Li...
agpl-3.0
mycodeday/crm-platform
sale/__openerp__.py
38
3426
# -*- 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...
gpl-3.0
tarquasso/softroboticfish6
fish/pi/runMbedProgramWithLogging.py
1
1134
import sys import os import time import resetMbed import serialMonitor # Program the mbed, restart it, launch a serial monitor to record streaming logs def runMbedProgramWithLogging(argv): for arg in argv: if 'startup=1' in arg: time.sleep(10) # If a bin file was given as argument, program ...
mit
kurli/blink-crosswalk
Source/bindings/scripts/blink_idl_parser.py
41
19024
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
moijes12/oh-mainline
vendor/packages/Django/django/template/loaders/app_directories.py
114
2362
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.u...
agpl-3.0
adlnet-archive/edx-platform
cms/djangoapps/contentstore/views/tests/test_item.py
6
80996
"""Tests for items views.""" import json from datetime import datetime, timedelta import ddt from mock import patch from pytz import UTC from webob import Response from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from django.core.urlresolvers import revers...
agpl-3.0
zenoss/Community-Zenpacks
ZenPacks.community.IBM3584Mon/ZenPacks/community/IBM3584Mon/IBM3584Frame.py
3
4058
################################################################################ # # This program is part of the IBM3584Mon Zenpack # Copyright (C) 2009 Josh Baird # # This program can be used under the GNU General Public License version 2 # You can find full information here: http://www.zenoss.com/oss # ##############...
gpl-2.0
twbrooks101/cancer
object_detection_app/app.py
2
5987
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2017 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...
apache-2.0
pbaesse/Sissens
lib/python2.7/site-packages/werkzeug/debug/__init__.py
90
17266
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import re import sys import uuid import json import time import getpass...
gpl-3.0
flavour/ifrc_qa
static/scripts/tools/toposortmf.py
261
8594
# # According to <http://www.vrplumber.com/programming/> this file # is licensed under a BSD-style license. We only use the section # originally by Tim Peters. # # TODO: The use of this code needs to be okayed by someone. # class RecursionError( OverflowError, ValueError ): '''Unable to calculate result because of...
mit
pdellaert/ansible
lib/ansible/modules/cloud/cloudstack/cs_instance_password_reset.py
39
4074
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Gregor Riepl <onitake@gmail.com> # based on cs_sshkeypair (c) 2015, René Moser <mail@renemoser.net> # 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 __met...
gpl-3.0
SiCKRAGETV/SickRage
sickrage/libs/trakt/objects/season.py
7
3432
from __future__ import absolute_import, division, print_function from trakt.core.helpers import to_iso8601_datetime, from_iso8601_datetime, deprecated from trakt.objects.core.helpers import update_attributes from trakt.objects.media import Media class Season(Media): def __init__(self, client, keys=None, index=No...
gpl-3.0
apollo13/ansible
test/lib/ansible_test/_internal/csharp_import_analysis.py
31
3446
"""Analyze C# import statements.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re from .io import ( open_text_file, ) from .util import ( display, ) from .util_common import ( resolve_csharp_ps_util, ) from .data import ( data_context, )...
gpl-3.0
damdam-s/OCB
addons/sale/__openerp__.py
221
3467
# -*- 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
AwesomeTTS/awesometts-anki-addon
awesometts/service/collins.py
1
4996
# -*- coding: utf-8 -*- # AwesomeTTS text-to-speech add-on for Anki # Copyright (C) 2010-Present Anki AwesomeTTS Development Team # # 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 versi...
gpl-3.0
xiejianying/pjsip_trunk
tests/pjsua/scripts-sendto/252_multipart_ok_clutter.py
40
1058
# $Id$ import inc_sip as sip import inc_sdp as sdp body = \ """ This is the preamble. It is to be ignored, though it is a handy place for composition agents to include an explanatory note to non-MIME conformant readers. --123:45 Content-Type: text/plain The first part is definitely not SDP --123:45 This is implic...
gpl-2.0
menpo/menpo
menpo/io/test/test_io_export.py
2
15084
import os import sys import warnings from pathlib import Path, PosixPath, WindowsPath from unittest.mock import MagicMock, PropertyMock, patch import numpy as np from numpy.testing import assert_allclose from pytest import raises import menpo.io as mio from menpo.image import Image from menpo.io.output.pickle import ...
bsd-3-clause
mottosso/pyfakefs
fake_filesystem_test.py
1
110249
#!/usr/bin/python2.6 # # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/coverage/execfile.py
66
8504
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Execute files of Python code.""" import marshal import os import sys import types from coverage.backward import BUILTINS from coverage.backward import PYC_MAGI...
mit
mahmoudShaheen/PyMedox
packages/firebase/firebase.py
2
3508
# adapted from firebase/EventSource-Examples/python/chat.py by Shariq Hashme from sseclient import SSEClient import requests from Queue import Queue import json import threading import socket class ClosableSSEClient(SSEClient): def __init__(self, *args, **kwargs): self.should_connect = True sup...
mit
Nirvedh/CoarseCoherence
src/mem/slicc/ast/InPortDeclAST.py
29
5020
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
guiquanz/msaf
msaf/plotting.py
1
8535
"""This script contains methods to plot multiple aspects of the results of MSAF. """ import logging import mir_eval import numpy as np import os import pylab as plt # Local stuff import msaf from msaf import io from msaf import utils from msaf import jams2 translate_ids = { "2dfmc" : "2D-FMC", "cnmf3" : "C-N...
mit
lhaze/anires_www
anires/core/migrations/0001_initial.py
1
1200
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0001_squashed_0016_change_page_url_path_to_text_field'), ] operations = [ migratio...
mit
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/test/test_codecs.py
17
57616
from test import test_support import unittest import codecs import locale import sys, StringIO, _testcapi class Queue(object): """ queue: write bytes at one end, read bytes from the other end """ def __init__(self): self._buffer = "" def write(self, chars): self._buffer += chars ...
gpl-2.0
jsternberg/ansible-modules-core
cloud/amazon/ec2_vpc_net.py
13
9752
#!/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
sergshabal/p2pool
p2pool/util/logging.py
287
2995
import codecs import datetime import os import sys from twisted.python import log class EncodeReplacerPipe(object): def __init__(self, inner_file): self.inner_file = inner_file self.softspace = 0 def write(self, data): if isinstance(data, unicode): try: data...
gpl-3.0
dvklopfenstein/PrincetonAlgorithms
py/AlgsSedgewickWayne/DirectedEdge.py
1
1046
"""Immutable weighted directed edge.""" class DirectedEdge(object): """a directed edge from vertex v to vertex w with the given weight""" def __init__(self, v, w, weight): if v < 0: raise Exception("Vertex names must be nonnegative integers") if w < 0: raise Exception("Vertex names must be nonnegative in...
gpl-2.0
hbrunn/OCB
openerp/modules/migration.py
279
7522
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
xlcteam/pgu
pgu/hexvid.py
20
4156
"""Hexagonal tile engine. Note -- this engine is not finished. Sprites are not supported. It can still be useful for using the level editor, and for rendering hex terrains, however. If you are able to update it and use it in a real game, help would be greatly appreciated! Please note that this file is alpha, and i...
lgpl-2.1
eleme/thriftpy
thriftpy/transport/socket.py
1
7410
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import errno import os import socket import struct import sys from . import TTransportException class TSocket(object): """Socket implementation for client side.""" def __init__(self, host=None, port=None, unix_socket=None, ...
mit
lbjay/cds-invenio
modules/websubmit/lib/websubmitadmin_dblayer.py
1
188610
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 versio...
gpl-2.0
jusdng/odoo
addons/mrp/company.py
381
1383
# -*- 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
earshel/PokeyPySnipe
POGOProtos/Data/Player/EquippedBadge_pb2.py
16
3274
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Data/Player/EquippedBadge.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobu...
mit
gpersistence/tstop
scripts/scatter_anim_example.py
1
2888
#TSTOP # #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 distributed in the hope that it will be useful, ...
gpl-3.0
dmpetrov/dataversioncontrol
dvc/logger.py
1
5629
"""Manages logging configuration for DVC repo.""" import logging.config import logging.handlers import colorama from dvc.progress import Tqdm FOOTER = ( "\n{yellow}Having any troubles?{nc}" " Hit us up at {blue}https://dvc.org/support{nc}," " we are always happy to help!" ).format( blue=colorama.For...
apache-2.0
codeforamerica/skillcamp
ENV/lib/python2.7/site-packages/pip/log.py
344
9455
"""Logging """ import sys import os import logging from pip import backwardcompat from pip._vendor import colorama, pkg_resources def _color_wrap(*colors): def wrapped(inp): return "".join(list(colors) + [inp, colorama.Style.RESET_ALL]) return wrapped def should_color(consumer, environ, std=(sys.s...
mit
PLyczkowski/Sticky-Keymap
2.74/python/lib/site-packages/numpy/testing/noseclasses.py
76
14350
# These classes implement a doctest runner plugin for nose, a "known failure" # error class, and a customized TestProgram for NumPy. # Because this module imports nose directly, it should not # be used except by nosetester.py to avoid a general NumPy # dependency on nose. from __future__ import division, absolute_impo...
gpl-2.0
howethomas/synapse
synapse/storage/roommember.py
2
8249
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
firerszd/kbengine
kbe/src/lib/python/Lib/test/test_pty.py
84
11286
from test.support import verbose, run_unittest, import_module, reap_children #Skip these tests if either fcntl or termios is not available fcntl = import_module('fcntl') import_module('termios') import errno import pty import os import sys import select import signal import socket import unittest TEST_STRING_1 = b"I...
lgpl-3.0
specialkevin/ansible-modules-core
cloud/amazon/ec2_elb.py
104
13811
#!/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
ElliottMiller/python-azuread-sample
AzureAuthSample/wsgi.py
1
1152
""" WSGI config for AzureAuthSample project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLIC...
mit
PhonologicalCorpusTools/PyAnnotationGraph
polyglotdb/query/base/func.py
4
4958
class AggregateFunction(object): function = '' template = '{function}({property})' collection_templates = {'sum': 'reduce(count = 0, n in {property} | count + n)', 'avg': 'reduce(count = 0, n in {property} | count + n) / toFloat(size({property}))', 'c...
mit
qiqjiao/study
jsoncpp/tags/svn-release-0.6.0-rc2/devtools/tarball.py
7
2124
import os.path import gzip import tarfile TARGZ_DEFAULT_COMPRESSION_LEVEL = 9 def make_tarball(tarball_path, sources, base_dir, prefix_dir=''): """Parameters: tarball_path: output path of the .tar.gz file sources: list of sources to include in the tarball, relative to the current directory b...
lgpl-3.0
tijko/PyMaze
Python/maze.py
1
2522
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import pygame from solutions.A_star import AstarPathFinder as astar class Maze(object): def __init__(self): pygame.init() self.screen = pygame.display.set_mode((720, 720)) home = os.getcwd() self.wall = pygame.im...
mit
SnappleCap/oh-mainline
vendor/packages/Django/django/contrib/contenttypes/models.py
100
6942
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_text, force_text from django.utils.encoding import python_2_unicode_compatible class ContentTypeManager(models.Manager): # Cache to avoid re-looking up ContentType objects all over the plac...
agpl-3.0
duqiao/django
tests/template_tests/filter_tests/test_autoescape.py
513
1342
from django.test import SimpleTestCase from ..utils import SafeClass, UnsafeClass, setup class AutoescapeStringfilterTests(SimpleTestCase): """ Filters decorated with stringfilter still respect is_safe. """ @setup({'autoescape-stringfilter01': '{{ unsafe|capfirst }}'}) def test_autoescape_string...
bsd-3-clause
andrewklau/openshift-tools
openshift/installer/vendored/openshift-ansible-3.2.13/lookup_plugins/oo_option.py
28
3249
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 ''' oo_option lookup plugin for openshift-ansible Usage: - debug: msg: "{{ lookup('oo_option', '<key>') | default('<default_value>', True) }}" This returns, by order of priority: * if it exists, the `cli_<key>` ansible...
apache-2.0
rothadamg/UPSITE
Classifiers/SKLearnSVM.py
2
4214
import sys,os sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/..") from ExternalClassifier import ExternalClassifier import Utils.Connection.Connection as Connection import Utils.Parameters as Parameters from Evaluators.AveragingMultiClassEvaluator import AveragingMultiClassEvaluator class SKLearnSVM(Exte...
mit
ddcatgg/dglib
dglib/config/SortableConfigParser.py
1
3060
import ConfigParser class SortableConfigParser(ConfigParser.ConfigParser): def __init__(self, *args, **kwargs): ConfigParser.ConfigParser.__init__(self, *args, **kwargs) self.sortfunc_ofsection = {} self.sortfunc = None def getdef(self, section, option, default): if not self.has_option(section, o...
mit
Pluto-tv/chromium-crosswalk
content/test/gpu/gpu_tests/test_expectations_unittest.py
2
8308
# 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 import test_expectations from telemetry.page import page as page_module from telemetry.story import story_set class StubPlatform(object): ...
bsd-3-clause
androidarmv6/android_external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/vtune_profiler.py
25
3650
# 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 logging import subprocess import sys import tempfile from telemetry.core.platform import profiler class _SingleProcessVTuneProfiler(object): """A...
bsd-3-clause
pelya/commandergenius
project/jni/python/src/Lib/test/mapping_tests.py
56
22395
# tests common to dict and UserDict import unittest import UserDict class BasicTestMappingProtocol(unittest.TestCase): # This base class can be used to check that an object conforms to the # mapping protocol # Functions that can be useful to override to adapt to dictionary # semantics type2test =...
lgpl-2.1
Southpaw-TACTIC/Team
src/python/Lib/site-packages/Crypto/SelfTest/Random/OSRNG/test_nt.py
131
1764
# -*- coding: utf-8 -*- # # SelfTest/Util/test_generic.py: Self-test for the OSRNG.nt.new() function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent t...
epl-1.0
cgvarela/Impala
tests/hs2/test_hs2.py
14
13379
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
samuelhavron/heroku-buildpack-python
Python-3.4.3/Lib/xml/etree/__init__.py
1200
1604
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
mit
shaanlan/youtube-dl
youtube_dl/extractor/hark.py
167
1344
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor class HarkIE(InfoExtractor): _VALID_URL = r'https?://www\.hark\.com/clips/(?P<id>.+?)-.+' _TEST = { 'url': 'http://www.hark.com/clips/mmbzyhkgny-obama-beyond-the-afghan-theater-we-only-target-al-qaeda-on...
unlicense
reminisce/mxnet
python/mxnet/_ctypes/ndarray.py
1
5960
# 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
alexpap/exareme
exareme-tools/madis/src/functions/vtable/cache.py
4
9631
""" .. function:: cache(query:None) -> [the same schema as input query] Caches and indexes in memory the input query. Its output has exactly the same schema as the input query. Examples: .. doctest:: >>> table1(''' ... 1 2 ... 3 4 ... 5 6 ... 7 8 ... 10 1 ... ''') >>> sq...
mit
7u/pci
pci-code/chapter4/searchengine.py
1
8866
import re import urllib2 import sqlite3 from bs4 import BeautifulSoup from urlparse import urljoin from urlparse import urlparse ignoreWords=set(['the','of','to','and','a','in','is','it']) class crawler: # Initialize the crawler with the name of database def __init__(self,dbName): self.con=sqlite3.con...
bsd-3-clause
bioinformatics-ua/montra
emif/questionnaire/qprocessors/choice.py
2
13691
# -*- coding: utf-8 -*- # Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/ # # 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 vers...
gpl-3.0
YetAnotherNerd/beets
test/test_files.py
24
20509
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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, ...
mit
tellesnobrega/sahara
sahara/service/trusts.py
2
6694
# Copyright (c) 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.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
bob123bob/Sick-Beard
sickbeard/scene_exceptions.py
5
5219
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
jiangzhuo/kbengine
kbe/src/lib/python/Mac/Tools/plistlib_generate_testdata.py
47
3932
#!/usr/bin/env python3 from Cocoa import NSMutableDictionary, NSMutableArray, NSString, NSDate, NSNumber from Cocoa import NSPropertyListSerialization, NSPropertyListOpenStepFormat from Cocoa import NSPropertyListXMLFormat_v1_0, NSPropertyListBinaryFormat_v1_0 from Cocoa import CFUUIDCreateFromString, NSNull, NSUUID, ...
lgpl-3.0
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Foursquare/Lists/ListDetails.py
5
4429
# -*- coding: utf-8 -*- ############################################################################### # # ListDetails # Returns details about a given list. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fil...
apache-2.0
javierTerry/PyGithub
github/tests/Repository.py
9
38115
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
Gamebasis/3DGamebasisServer
GameData/blender-2.71-windows64/2.71/python/lib/xml/dom/minicompat.py
94
3340
"""Python version compatibility support for minidom. This module contains internal implementation details and should not be imported; use xml.dom.minidom instead. """ # This module should only be imported using "import *". # # The following names are defined: # # NodeList -- lightest possible NodeList implemen...
gpl-3.0
defionscode/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_facts.py
55
3673
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 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 #...
gpl-3.0
IljaGrebel/OpenWrt-SDK-imx6_HummingBoard
staging_dir/host/lib/scons-2.3.5/SCons/Tool/gettext.py
1
2058
"""gettext tool """ # Copyright (c) 2001 - 2015 The SCons Foundation # # 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...
gpl-2.0
zakuro9715/lettuce
lettuce/terrain.py
12
2199
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org> # # 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 Foundatio...
gpl-3.0