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
Phonemetra/TurboCoin
test/functional/test_framework/test_node.py
1
23598
#!/usr/bin/env python3 # Copyright (c) 2017-2019 TurboCoin # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Class for turbocoind node under test""" import contextlib import decimal import errno from enum import Enum import http....
mit
sclabs/sccms-nonrel
django/contrib/sites/managers.py
491
1985
from django.conf import settings from django.db import models from django.db.models.fields import FieldDoesNotExist class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the current site." def __init__(self, field_name=None): super(CurrentSiteManager, self).__ini...
bsd-3-clause
Cito/sqlalchemy
lib/sqlalchemy/util/langhelpers.py
3
36689
# util/langhelpers.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 """Routines to help with the creation, loading and introspection of modules, class...
mit
honggyukim/uftrace
tests/t247_graph_srcline.py
2
2622
#!/usr/bin/env python from runtest import TestBase class TestCase(TestBase): def __init__(self): TestBase.__init__(self, 'sort', result=""" # Function Call Graph for 'main' (session: de27777d0a966d5a) =============== BACKTRACE =============== backtrace #0: hit 1, time 13.120 ms [0] main (0x56366ebab7...
gpl-2.0
vincepandolfo/django
django/conf/__init__.py
84
6865
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import importlib import os import time from django.conf import...
bsd-3-clause
rcharp/toyota-flask
venv/lib/python2.7/site-packages/setuptools/command/rotate.py
461
2038
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os from setuptools import Command from setuptools.compat import basestring class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N n...
apache-2.0
mm112287/2015cda_g8_0421
static/Brython3.1.1-20150328-091302/Lib/tempfile.py
728
22357
"""Temporary files. This module provides generic, low- and high-level interfaces for creating temporary files and directories. The interfaces listed as "safe" just below can be used without fear of race conditions. Those listed as "unsafe" cannot, and are provided for backward compatibility only. This module also pr...
gpl-3.0
antepsis/anteplahmacun
sympy/matrices/expressions/tests/test_blockmatrix.py
94
6835
from sympy.matrices.expressions.blockmatrix import (block_collapse, bc_matmul, bc_block_plus_ident, BlockDiagMatrix, BlockMatrix, bc_dist, bc_matadd, bc_transpose, blockcut, reblock_2x2, deblock) from sympy.matrices.expressions import (MatrixSymbol, Identity, Inverse, trace, Transpose, det) from...
bsd-3-clause
juanyaw/python
cpython/Lib/encodings/ascii.py
858
1248
""" Python 'ascii' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
bsd-3-clause
orangeduck/PyAutoC
Python27/Lib/token.py
178
2944
#! /usr/bin/env python """Token constants (from "token.h").""" # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # python Lib/token.py #--start constants-- ENDM...
bsd-2-clause
EmreAtes/spack
var/spack/repos/builtin/packages/octave-struct/package.py
5
1581
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
bdoin/GCompris
src/lightsoff-activity/lightsoff.py
4
22329
# gcompris - lightsoff.py # # Copyright (C) 2010 Bruno and Clement Coudoin # # 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 l...
gpl-3.0
daikeren/opbeat_python
opbeat/utils/wrapt/importer.py
9
6636
"""This module implements a post import hook mechanism styled after what is described in PEP-369. Note that it doesn't cope with modules being reloaded. """ import sys import threading PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: import importlib from .decorators import synchronized ...
bsd-3-clause
dominjune/LintCode
Backpack.py
3
2464
""" Given n items with size A[i], an integer m denotes the size of a backpack. How full you can fill this backpack? """ __author__ = 'Danyang' class Solution_TLE: def backPack(self, m, A): """ search, brute force :param m: An integer m denotes the size of a backpack :param A: Given...
apache-2.0
ChrisYammine/ChrisYammine.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/functional.py
197
113704
# -*- coding: utf-8 -*- """ pygments.lexers.functional ~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for functional languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, incl...
mit
cjaymes/pyscap
src/scap/model/xccdf_1_2/CheckContentRefType.py
1
1395
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
gpl-3.0
nhenezi/kuma
vendor/lib/python/south/migration/utils.py
129
2417
import sys from collections import deque from django.utils.datastructures import SortedDict from django.db import models from south import exceptions class SortedSet(SortedDict): def __init__(self, data=tuple()): self.extend(data) def __str__(self): return "SortedSet(%s)" % list(self) ...
mpl-2.0
dakot/vilay-detect
vilay/detectors/DetectorWrapper.py
1
2000
from PyQt4 import QtGui from vilay.core.DescriptionScheme import DescriptionScheme class DetectorWrapper: def __init__(self, vd, detectorClass): self.vd = vd self.detector = detectorClass self.tgtRoot = self.vd.data.dsRoot self.mediaTimes = [] self.detector.in...
gpl-3.0
scylladb/scylla-cluster-tests
sdcm/cdclog_reader_thread.py
1
6943
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...
agpl-3.0
Halfnhav/node-gyp
gyp/pylib/gyp/mac_tool.py
377
19309
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
daxxi13/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/metacafe.py
40
10132
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse, compat_urllib_request, ) from ..utils import ( determine_ext, ExtractorError, int_or_none, ) class MetacafeIE(InfoExtractor): _VALID_URL = r'ht...
gpl-3.0
rhinstaller/blivet
tests/formats_test/init_test.py
6
1466
import copy import unittest import blivet.formats as formats class FormatsTestCase(unittest.TestCase): def test_formats_methods(self): ## # get_device_format_class ## format_pairs = { None: formats.DeviceFormat, "bogus": None, "biosboot": forma...
lgpl-2.1
OpenMined/PySyft
packages/syft/src/syft/proto/core/io/location_pb2.py
1
3450
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/core/io/location.proto """Generated protocol buffer code.""" # third party from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _r...
apache-2.0
Adenilson/servo
tests/wpt/web-platform-tests/cors/resources/cors-makeheader.py
79
2139
import json def main(request, response): origin = request.GET.first("origin", request.headers.get('origin')) if "check" in request.GET: token = request.GET.first("token") value = request.server.stash.take(token) if value is not None: if request.GET.first("check", None) == "...
mpl-2.0
four2five/0.19.2
src/contrib/hod/support/logcondense.py
10
7097
#!/bin/sh #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 ...
apache-2.0
andrew-aladev/samba-talloc-debug
python/samba/sites.py
41
4060
# python site manipulation code # Copyright Matthieu Patou <mat@matws.net> 2011 # # 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...
gpl-3.0
Kudo/mailchimp_manager
mailchimp_manager/tests/test_list_manager.py
1
1550
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_list_manager.py - Integration test for list management of mailchimp_manager """ try: from mailchimp_manager import MailChimpManager except: # Local module testing - assuming mailchimp_manager folder put in grandparent folder import sys, os.path ...
bsd-3-clause
afandria/mojo
third_party/protobuf/python/google/protobuf/internal/descriptor_test.py
261
24195
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
Blizzard/s2protocol
s2protocol/versions/protocol63454.py
6
31078
# Copyright (c) 2015-2017 Blizzard Entertainment # # 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, modify, merge, ...
mit
IPMITMO/statan
coala/coalib/results/ResultFilter.py
35
9630
import copy from difflib import SequenceMatcher from coalib.results.Diff import ConflictError, Diff from coalib.results.SourceRange import SourceRange def filter_results(original_file_dict, modified_file_dict, original_results, modified_results): """ F...
mit
flashycud/timestack
django/core/management/validation.py
103
19729
import sys from django.contrib.contenttypes.generic import GenericForeignKey, GenericRelation from django.core.management.color import color_style from django.utils.itercompat import is_iterable try: any except NameError: from django.utils.itercompat import any class ModelErrorCollection: def __init__(se...
mit
lpsinger/astropy
astropy/io/fits/tests/test_fitsheader.py
8
5967
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from . import FitsTestCase from astropy.io.fits.scripts import fitsheader from astropy import __version__ as version class TestFITSheader_script(FitsTestCase): def test_help(self): with pytest.raises(SystemExit) as e: ...
bsd-3-clause
goldsborough/.emacs
.emacs.d/.python-environments/default/lib/python3.5/site-packages/setuptools/command/install.py
529
4683
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://github.com/pypa/setuptools/issues/199/ _install = orig.in...
mit
rosshamish/classtime
tests/classtime/brain/remote_db/test_ldapdb.py
1
2787
from __future__ import absolute_import import os import json import classtime.brain.remote_db as remote_db from classtime.brain.institutions import CONFIG_FOLDER_PATH as institution_config_path class TestRemoteLDAPDatabase(object): # pylint: disable=R0904 @classmethod def setup_class(cls): cls.insti...
mit
mm112287/2015cda_g8_0421
static/Brython3.1.1-20150328-091302/Lib/test/regrtest.py
718
65317
#! /usr/bin/python3.3 """ Usage: python -m test [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] If no arguments or options are provided, finds all files matching the pattern "test_*" in the Lib/test subdirectory and runs them in alphabetical order ...
gpl-3.0
JoeCao/shadowsocks
shadowsocks/tcprelay.py
922
28870
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 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 required b...
apache-2.0
leeon/annotated-django
tests/migrations/test_optimizer.py
18
12842
# encoding: utf8 from django.test import TestCase from django.db.migrations.optimizer import MigrationOptimizer from django.db import migrations from django.db import models class OptimizerTests(TestCase): """ Tests the migration autodetector. """ def optimize(self, operations): """ ...
bsd-3-clause
takaaptech/sky_engine
build/android/pylib/utils/device_temp_file.py
51
1958
# 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. """A temp file that automatically gets pushed and deleted from a device.""" # pylint: disable=W0622 import random import time from pylib import cmd_helper...
bsd-3-clause
fnouama/intellij-community
python/lib/Lib/site-packages/django/utils/feedgenerator.py
131
14820
""" Syndication feed generation library -- used for generating RSS, etc. Sample usage: >>> from django.utils import feedgenerator >>> feed = feedgenerator.Rss201rev2Feed( ... title=u"Poynter E-Media Tidbits", ... link=u"http://www.poynter.org/column.asp?id=31", ... description=u"A group Weblog by the shar...
apache-2.0
arpitparmar5739/youtube-dl
youtube_dl/extractor/moevideo.py
112
3732
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, ) class MoeVideoIE(InfoExtractor): IE_DESC = 'LetitBit video ser...
unlicense
burstlam/pantech_kernel_A850
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
neilhan/tensorflow
tensorflow/python/kernel_tests/scan_ops_test.py
21
9061
# 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
mcltn/ansible
lib/ansible/plugins/action/pause.py
107
6444
# Copyright 2012, Tim Bielawa <tbielawa@redhat.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 later...
gpl-3.0
MaheshIBM/ursula
library/cinder_volume_type.py
9
7853
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013, Blue Box Group, Inc. # Copyright 2013, Craig Tracey <craigtracey@gmail.com> # # 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 # # ...
mit
wavii/dulwich
dulwich/tests/utils.py
3
10899
# utils.py -- Test utilities for Dulwich. # Copyright (C) 2010 Google, 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; version 2 # of the License or (at your option) any later version of ...
gpl-2.0
shaunwbell/FOCI_Analysis
ReanalysisRetreival_orig/GOA_Winds/NCEP_NARR_comp.py
1
8096
#!/usr/bin/env """ NCEP_NARR_comp.py NCEP vs NARR side by side comparisons of select fields Compare NARR Winds with NCEP V2 (with Mooring Winds) Using Anaconda packaged Python """ #System Stack import datetime #Science Stack import numpy as np # User Stack import general_utilities.date2doy as date2doy from...
mit
TBits/rolekit
src/rolekit/config/dbus.py
4
1221
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2014 Red Hat, Inc. # # Authors: # Thomas Woerner <twoerner@redhat.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 Li...
gpl-2.0
RitwikGupta/pattern
pattern/text/fr/__init__.py
21
9083
#### PATTERN | FR ################################################################################## # -*- coding: utf-8 -*- # Copyright (c) 2013 University of Antwerp, Belgium # Copyright (c) 2013 St. Lucas University College of Art & Design, Antwerp. # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICEN...
bsd-3-clause
surligas/gnuradio
docs/doxygen/doxyxml/generated/index.py
344
1871
#!/usr/bin/env python """ Generated Mon Feb 9 19:08:05 2009 by generateDS.py. """ from xml.dom import minidom import os import sys import compound import indexsuper as supermod class DoxygenTypeSub(supermod.DoxygenType): def __init__(self, version=None, compound=None): supermod.DoxygenType.__init__(se...
gpl-3.0
ishikawa/modipyd
tests/test_bytecode.py
1
6690
#!/usr/bin/env python import unittest from modipyd import bytecode as bc from modipyd import HAS_RELATIVE_IMPORTS from tests import TestCase class DisassemblerTestCase(TestCase): def compile(self, src, filename='<string>'): return compile(src, filename, 'exec') def compile_scan_imports(self, src, f...
mit
TuSimple/mxnet
tools/bandwidth/test_measure.py
46
1863
# 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
katstalk/android_external_chromium_org
tools/metrics/histograms/diffutil.py
57
1626
# 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. """Utility functions for prompting user if changes automatically applied to some user-managed files are correct. """ import logging import os import webbrow...
bsd-3-clause
skyline75489/shadowsocks
shadowsocks/server.py
652
4836
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 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 requir...
apache-2.0
Hellowlol/HTPC-Manager
libs/formencode/variabledecode.py
11
5386
""" Takes GET/POST variable dictionary, as might be returned by ``cgi``, and turns them into lists and dictionaries. Keys (variable names) can have subkeys, with a ``.`` and can be numbered with ``-``, like ``a.b-3=something`` means that the value ``a`` is a dictionary with a key ``b``, and ``b`` is a list, the third(...
mit
dirkcuys/save4life
ussd/transactions.py
1
2954
from django.utils import timezone from .models import Transaction from .tasks import issue_airtime from datetime import datetime class TransactionError(Exception): pass def award_joining_bonus(user): transaction = Transaction.objects.create( user=user, action=Transaction.REGISTRATION_BONUS, ...
bsd-3-clause
guschmue/tensorflow
tensorflow/contrib/distributions/python/ops/mixture.py
13
18780
# 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
dstufft/html5lib-python
html5lib/html5parser.py
60
117335
from __future__ import absolute_import, division, unicode_literals from six import with_metaclass import types from . import inputstream from . import tokenizer from . import treebuilders from .treebuilders._base import Marker from . import utils from . import constants from .constants import spaceCharacters, ascii...
mit
brianzelip/militarization
css/basscss/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/qbasic.py
48
6456
# -*- coding: utf-8 -*- """ pygments.lexers.qbasic ~~~~~~~~~~~~~~~~~~~~~~ Simple lexer for Microsoft QBasic source code. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygrou...
gpl-2.0
ArcEye/machinekit-testing
lib/python/gladevcp/hal_pyngcgui.py
26
8131
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright: 2013 # Author: Dewey Garrett <dgarrett@panix.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 F...
lgpl-2.1
haxsie/kobato
main.py
1
20973
# !/user/bin/env python # coding: utf-8 import pygame from pygame.locals import* import sys reload(sys) sys.setdefaultencoding("utf-8") import os import random import math import datetime from character import Character # About Character class: # Design with 4*4 grid layout. # Rightmost column is for spacing. fro...
mit
zionist/mon
mon/apps/cmp/migrations/0012_auto__chg_field_result_wc__chg_field_result_room__chg_field_result_hal.py
1
46568
# -*- 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): # Changing field 'Result.wc' db.alter_column(u'cmp_result', 'wc_id', self.gf('django.db.models.fields.relat...
bsd-3-clause
birsoyo/conan
conans/server/rest/controllers/users_controller.py
2
1305
from bottle import response from conans.errors import AuthenticationException from conans.server.rest.controllers.controller import Controller from conans.server.service.user_service import UserService class UsersController(Controller): """ Serve requests related with users """ def attach_to(self...
mit
tkzeng/molecular-design-toolkit
moldesign/viewer/common.py
1
3411
# Copyright 2016 Autodesk 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 writing...
apache-2.0
devops2014/djangosite
django/core/files/uploadedfile.py
471
4334
""" Classes representing uploaded files. """ import errno import os from io import BytesIO from django.conf import settings from django.core.files import temp as tempfile from django.core.files.base import File from django.utils.encoding import force_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU...
bsd-3-clause
palerdot/calibre
src/calibre/ebooks/pdf/reflow.py
10
24834
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, os from lxml import etree class Font(object): def __init__(self, s...
gpl-3.0
vallemrv/tpvB3
tpv/models/pedido.py
1
5745
# -*- coding: utf-8 -*- # @Author: Manuel Rodriguez <valle> # @Date: 04-Sep-2017 # @Email: valle.mrv@gmail.com # @Last modified by: valle # @Last modified time: 14-Feb-2018 # @License: Apache license vesion 2.0 from kivy.event import EventDispatcher from kivy.properties import NumericProperty, StringProperty from...
apache-2.0
timpalpant/calibre
src/calibre/gui2/viewer/gestures.py
14
14599
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import time, sys from functools import partial from PyQt5.Qt import ( QO...
gpl-3.0
tchernomax/ansible
test/units/playbook/test_block.py
119
2795
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
developerQuinnZ/this_will_work
student-work/quinn_zepeda/exercism/python/bob/bob_test.py
6
3337
import unittest import bob # test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0 class BobTests(unittest.TestCase): def test_stating_something(self): self.assertEqual(bob.hey("Tom-ay-to, tom-aaaah-to."), "Whatever.") def test_shouting(self): self.assertEqual(bob.hey("WA...
mit
belevtsoff/luigi
test/clone_test.py
53
1859
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
Kazade/NeHe-Website
google_appengine/lib/django-1.4/django/contrib/gis/maps/google/gmap.py
90
8964
from django.conf import settings from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker class GoogleMapException(Exception): pass # The default Google Maps URL (for the API javascript) # T...
bsd-3-clause
naslanidis/ansible
lib/ansible/modules/cloud/google/gce_pd.py
24
10645
#!/usr/bin/python # Copyright 2013 Google 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 vers...
gpl-3.0
Tejal011089/digitales_erpnext
erpnext/accounts/report/supplier_account_head/supplier_account_head.py
40
1123
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(filters=None): account_map = get_account_map() columns = get_columns(account_map) data = [] suppliers = frappe.db.sql(...
agpl-3.0
bcheung92/Paperproject
gem5/src/dev/Uart.py
66
1976
# Copyright (c) 2005-2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this ...
mit
fotinakis/sentry
src/sentry/south_migrations/0179_auto__add_field_release_date_released.py
34
36688
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Release.date_released' db.add_column('sentry_release', 'd...
bsd-3-clause
manojhirway/ExistingImagesOnNFS
cinder/tests/unit/api/contrib/test_availability_zones.py
32
2932
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
Changaco/oh-mainline
vendor/packages/celery/celery/tests/test_concurrency/test_concurrency_eventlet.py
18
1179
from __future__ import absolute_import import os import sys from nose import SkipTest from celery.tests.utils import unittest class EventletCase(unittest.TestCase): def setUp(self): if getattr(sys, "pypy_version_info", None): raise SkipTest("Does not work on PyPy") try: ...
agpl-3.0
shepdelacreme/ansible
lib/ansible/modules/network/radware/vdirect_commit.py
27
12999
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 Radware LTD. # # 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...
gpl-3.0
testalt/electrum-dgc
gui/gtk.py
1
49996
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 thomasv@gitorious # # 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...
gpl-3.0
NEricN/RobotCSimulator
Python/App/Lib/site-packages/pip/_vendor/html5lib/tokenizer.py
1710
76929
from __future__ import absolute_import, division, unicode_literals try: chr = unichr # flake8: noqa except NameError: pass from collections import deque from .constants import spaceCharacters from .constants import entities from .constants import asciiLetters, asciiUpper2Lower from .constants import digits, ...
apache-2.0
mhaessig/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/run_all.py
465
3259
#!/usr/bin/env python # # Copyright 2011, 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...
mpl-2.0
dikshyam/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier_tests/decisiontreetests.py
9
3668
# Natural Language Toolkit # # Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com> # # URL: <http://nltk.sf.net> # This software is distributed under GPL, for license information see LICENSE.TXT from nltk_contrib.classifier_tests import * from nltk_contrib.classifier import decisiontree, decisionstump as ds, in...
gpl-3.0
LUTAN/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/io_ops.py
172
6373
# 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
xrmx/django
tests/template_tests/filter_tests/test_linenumbers.py
331
1992
from django.template.defaultfilters import linenumbers from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinenumbersTests(SimpleTestCase): """ The contents of "linenumbers" is escaped according to the current autoescape setting. """ ...
bsd-3-clause
Balachan27/django
django/conf/locale/mk/formats.py
504
1742
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i' DATETI...
bsd-3-clause
numpy/datetime
numpy/f2py/tests/test_return_logical.py
59
4633
from numpy.testing import * from numpy import array import util class TestReturnLogical(util.F2PyTest): def check_function(self, t): assert t(True)==1,`t(True)` assert t(False)==0,`t(False)` assert t(0)==0 assert t(None)==0 assert t(0.0)==0 assert t(0j)==0 as...
bsd-3-clause
yawnosnorous/python-for-android
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_except.py
203
3344
"""Fixer for except statements with named exceptions. The following cases will be converted: - "except E, T:" where T is a name: except E as T: - "except E, T:" where T is not a name, tuple or list: except E as t: T = t This is done because the target of an "except" clause must be a ...
apache-2.0
callowayproject/Transmogrify
transmogrify/create_doc_imgs.py
1
3036
import os from transmogrify import Transmogrify square_img = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testdata', 'square_img.jpg')) vert_img = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testdata', 'vert_img.jpg')) horiz_img = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testda...
apache-2.0
nwjs/chromium.src
third_party/blink/web_tests/external/wpt/webdriver/tests/set_window_rect/user_prompts.py
42
4063
# META: timeout=long import pytest from tests.support.asserts import assert_dialog_handled, assert_error, assert_success def set_window_rect(session, rect): return session.transport.send( "POST", "session/{session_id}/window/rect".format(**vars(session)), rect) @pytest.fixture def check_user_p...
bsd-3-clause
mistercrunch/airflow
tests/providers/apache/kylin/hooks/test_kylin.py
7
2924
# # 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...
apache-2.0
wisonwang/django-lfs
lfs/core/models.py
4
9087
# django imports from django.conf import settings from django.core.cache import cache from django.db import models from django.utils.translation import ugettext_lazy as _ # lfs imports from lfs.checkout.settings import CHECKOUT_TYPES from lfs.checkout.settings import CHECKOUT_TYPE_SELECT from lfs.core.fields.thumbs im...
bsd-3-clause
nexdatas/writer
test/Converters_test.py
1
5954
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
gpl-3.0
40223112/2015cd_midterm
static/Brython3.1.0-20150301-090019/Lib/importlib/__init__.py
610
3472
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirectly). Since...
gpl-3.0
RyanYoung25/tensorflow
tensorflow/python/kernel_tests/random_crop_test.py
15
2626
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
jelugbo/hebs_repo
lms/djangoapps/courseware/tests/test_lti_integration.py
6
9266
"""LTI integration tests""" import oauthlib from collections import OrderedDict import mock import urllib import json from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.conf import settings from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore....
agpl-3.0
vyscond/pyfpdf
attic/font/times.py
26
2580
fpdf_charwidths['times']={ '\x00':250,'\x01':250,'\x02':250,'\x03':250,'\x04':250,'\x05':250,'\x06':250,'\x07':250,'\x08':250,'\t':250,'\n':250,'\x0b':250,'\x0c':250,'\r':250,'\x0e':250,'\x0f':250,'\x10':250,'\x11':250,'\x12':250,'\x13':250,'\x14':250,'\x15':250, '\x16':250,'\x17':250,'\x18':250,'\x19':250,'\x1a':250...
lgpl-3.0
mKeRix/home-assistant
homeassistant/components/upb/__init__.py
15
4196
"""Support the UPB PIM.""" import asyncio import upb_lib from homeassistant.const import CONF_FILE_PATH, CONF_HOST from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity import Entity from homeassistant.helpers.typing import ConfigType from .const import ( ATTR_ADDRESS, ATTR...
mit
ehabkost/busmap
python/busmap/urbsweb/negen_fetch.py
1
1885
import sys import urllib2 import string import re from busmap.urbsweb.mapa import DataDir import logging logger = logging.getLogger(__name__) dbg = logger.debug warn = logger.warning info = logger.info def main(argv): loglevel = logging.INFO args = [] i = 0 while i < len(sys.argv[1:]): arg = ...
mit
lodemo/CATANA
src/face_recognition/youtube_dl/extractor/izlesene.py
40
4263
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) class IzleseneIE(InfoExtractor...
mit
telamonian/saga-python
docs/concepts/decorators.py
5
2369
__author__ = "Andre Merzky" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" #!/usr/bin/python SYNC = 'Sync' ASYNC = 'Async' TASK = 'Task' # ------------------------------------ # exception class # class NotImplemented : pass def __str__ (self) : return "NotImplemented" ...
mit