repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
blckshrk/Weboob
contrib/windows-install/ez_setup.py
1
11838
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
agpl-3.0
Juniper/contrail-dev-neutron
neutron/db/l3_gwmode_db.py
13
2919
# Copyright 2013 VMware, 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 a...
apache-2.0
HAYASAKA-Ryosuke/faker
faker/providers/person/en_US/__init__.py
2
45665
from __future__ import unicode_literals from .. import Provider as PersonProvider class Provider(PersonProvider): formats_female = { '{{first_name_female}} {{last_name}}': 0.97, '{{prefix_female}} {{first_name_female}} {{last_name}}': 0.015, '{{first_name_female}} {{last_name}} {{suffix_fe...
mit
CodingCat/mxnet
python/mxnet/__init__.py
15
2302
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
bblacey/FreeCAD-MacOS-CI
src/Mod/PartDesign/Scripts/Spring.py
38
1813
#! python # -*- coding: utf-8 -*- # (c) 2011 Adrian Przekwas LGPL from __future__ import division # allows floating point division from integers import FreeCAD, Part from FreeCAD import Base class MySpring: def __init__(self, obj): ''' Add the properties: Pitch, Diameter, Height, BarDiameter ''' ...
lgpl-2.1
ArcherSys/ArcherSys
Lib/site-packages/nbconvert/exporters/notebook.py
3
1078
"""NotebookExporter class""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from .exporter import Exporter import nbformat from traitlets import Enum class NotebookExporter(Exporter): """Exports to an IPython notebook.""" nbformat_version = Enum(list(nbf...
mit
eugene1g/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/queues.py
116
21137
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
KingxBanana/zulip
zproject/settings.py
1
41223
from __future__ import absolute_import # Django settings for zulip project. ######################################################################## # Here's how settings for the Zulip project work: # # * settings.py contains non-site-specific and settings configuration # for the Zulip Django app. # * settings.py impor...
apache-2.0
dbs/schemaorg
lib/rdflib/plugins/stores/sparqlstore.py
7
30545
# -*- coding: utf-8 -*- # """ This is an RDFLib store around Ivan Herman et al.'s SPARQL service wrapper. This was first done in layer-cake, and then ported to RDFLib """ # Defines some SPARQL keywords LIMIT = 'LIMIT' OFFSET = 'OFFSET' ORDERBY = 'ORDER BY' import re import collections import urllib2 # import warnin...
apache-2.0
paddyvishnubhatt/cryptocurrency
lib/flask/blueprints.py
169
16872
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
apache-2.0
yangchandle/FlaskTaskr
env/lib/python3.5/site-packages/werkzeug/script.py
30
11241
# -*- coding: utf-8 -*- r''' werkzeug.script ~~~~~~~~~~~~~~~ .. admonition:: Deprecated Functionality ``werkzeug.script`` is deprecated without replacement functionality. Python's command line support improved greatly with :mod:`argparse` and a bunch of alternative modules. Most ...
mit
Superjom/models-1
dssm/reader.py
4
4091
from utils import UNK, ModelType, TaskType, load_dic, \ sent2ids, logger, ModelType class Dataset(object): def __init__(self, train_path, test_path, source_dic_path, target_dic_path, model_type): self.train_path = train_path self.test_path = test_path self.source_d...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/iaas_vm_recovery_point.py
2
4613
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
odyaka341/pyglet
tools/genmpkg/bdist_mpkg_pyglet/tools.py
26
4101
import os import sys from itertools import chain from distutils.util import spawn from distutils.version import StrictVersion, LooseVersion from distutils.dir_util import mkpath import distutils.core try: set except NameError: from sets import Set as set def Version(s): try: return StrictVersion(s...
bsd-3-clause
FlaPer87/django-nonrel
django/contrib/localflavor/pl/pl_administrativeunits.py
433
13194
# -*- coding: utf-8 -*- """ Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski """ ADMINISTRATIVE_UNIT_CHOICES = ( ('wroclaw', u'Wrocław'), ('jeleniagora', u'Jelenia Góra'), ('legnica', u'Legnica'), ('boleslawiecki', u'bolesławiecki'), ('dzierzoniows...
bsd-3-clause
hachard/Cra-Magnet
flask/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/requirements.py
454
4355
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import string import re from pkg_resources.extern.pyparsing import string...
gpl-3.0
rdblue/Impala
tests/metadata/test_recover_partitions.py
13
15294
# Copyright (c) 2015 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
privateip/ansible
lib/ansible/modules/system/ping.py
50
2098
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016, Toshio Kuratomi <tkuratomi@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
michaelgallacher/intellij-community
plugins/hg4idea/testData/bin/mercurial/sshserver.py
93
4270
# sshserver.py - ssh protocol server support for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. import util, ...
apache-2.0
ulope/django
django/contrib/messages/tests/test_session.py
226
1898
from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTests from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage from django.utils.safestring import SafeData, mark_safe from django.test import TestCase de...
bsd-3-clause
wmbutler/courtlistener
alert/lib/magic.py
5
5797
""" magic is a wrapper around the libmagic file identification library. See README for more information. Usage: >>> import magic >>> magic.from_file("testdata/test.pdf") 'PDF document, version 1.2' >>> magic.from_file("testdata/test.pdf", mime=True) 'application/pdf' >>> magic.from_buffer(open("testdata/test.pdf").r...
agpl-3.0
BoltzmannBrain/nupic
src/nupic/research/temporal_memory.py
5
29929
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
borosnborea/SwordGO_app
example/kivymap/.buildozer/venv/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py
352
2776
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
gpl-3.0
mrjacobagilbert/gnuradio
gr-digital/python/digital/qa_lfsr.py
5
1405
#!/usr/bin/env python # # Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import math import numpy as np from gnuradio import gr, gr_unittest, digital from gnuradio.digital.utils import lfsr_args class test_lfsr(gr_unittest.TestCase):...
gpl-3.0
alexlovelltroy/namebench
libnamebench/better_webbrowser.py
175
4191
#!/usr/bin/env python # 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...
apache-2.0
TarasRudnyk/scrapy
scrapy/core/downloader/webclient.py
115
5048
from time import time from six.moves.urllib.parse import urlparse, urlunparse, urldefrag from twisted.web.client import HTTPClientFactory from twisted.web.http import HTTPClient from twisted.internet import defer from scrapy.http import Headers from scrapy.utils.httpobj import urlparse_cached from scrapy.responsetype...
bsd-3-clause
garthylou/pootle
pootle/core/utils/templates.py
7
1320
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.conf impor...
gpl-3.0
ecell/libmoleculizer
python-src/language_parser/moleculizer/moleculizerrules.py
1
21379
############################################################################### # Copyright (C) 2007, 2008, 2009 The Molecular Sciences Institute # Original Author: # Nathan Addy, Scientific Programmer Email: addy@molsci.org # The Molecular Sciences Institute # ##################################################...
gpl-2.0
mdunker/usergrid
utils/usergrid-util-python/usergrid_tools/queue/dlq-iterator-checker.py
2
4809
# */ # * Licensed to the Apache Software Foundation (ASF) under one # * or more contributor license agreements. See the NOTICE file # * distributed with this work for additional information # * regarding copyright ownership. The ASF licenses this file # * to you under the Apache License, Version 2.0 (the # * "License...
apache-2.0
LeslieZhu/tango_with_django_project
tango_with_django_project/rango/views.py
2
10530
from django.shortcuts import render from django.http import HttpResponse from rango.models import Category,Page from rango.forms import CategoryForm from django.contrib.auth.decorators import login_required from datetime import datetime def index(request): category_list = Category.objects.order_by('-likes')[:...
gpl-2.0
2014cdag2/w17x1
static/Brython3.1.3-20150514-095342/Lib/unittest/loader.py
739
13883
"""Loading unittests.""" import os import re import sys import traceback import types import functools from fnmatch import fnmatch from . import case, suite, util __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID...
agpl-3.0
numenta/nupic.geospatial
server.py
3
2729
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
agpl-3.0
Sean3Don/inkscape
share/extensions/dxf_templates.py
7
3541
#!/usr/bin/env python r14_header = ''' 0 SECTION 2 HEADER 9 $ACADVER 1 AC1014 9 $HANDSEED 5 FFFF 9 $MEASUREMENT 70 1 0 ENDSEC 0 SECTION 2 TABLES 0 TABLE 2 VPORT 5 8 330 0 100 AcDbSymbolTable 70 4 0 VPORT 5 2E 330 8 100 AcDbSymbolTableRecord 100 AcDbViewportTableRecord 2 *ACTIV...
gpl-2.0
wilebeast/FireFox-OS
B2G/gecko/testing/marionette/client/marionette/tests/unit/test_emulator.py
2
2495
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from marionette_test import MarionetteTestCase from errors import JavascriptException, MarionetteException class TestE...
apache-2.0
yujunglo/teletraan
deploy-agent/tests/unit/deploy/common/test_config.py
8
2099
# Copyright 2016 Pinterest, 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...
apache-2.0
gully/PyKE
pyke/kepfourier.py
2
1484
from .utils import PyKEArgumentHelpFormatter import numpy as np def ft(x, y, f1, f2, df, verbose): """ Compute the Fourier transform of a signal ``y`` with support ``x`` in the bandwidth between the frequencies ``f1`` to ``f2``. ``df`` is the frequency of resolution. Parameters ---------- ...
mit
fbradyirl/home-assistant
tests/components/zwave/test_workaround.py
4
2561
"""Test Z-Wave workarounds.""" from homeassistant.components.zwave import const, workaround from tests.mock.zwave import MockNode, MockValue def test_get_device_no_component_mapping(): """Test that None is returned.""" node = MockNode(manufacturer_id=" ") value = MockValue(data=0, node=node) assert wo...
apache-2.0
einarhuseby/arctic
arctic/_util.py
3
1846
from pandas import DataFrame from pandas.util.testing import assert_frame_equal from pymongo.errors import OperationFailure import string import logging logger = logging.getLogger(__name__) def indent(s, num_spaces): s = string.split(s, '\n') s = [(num_spaces * ' ') + line for line in s] s = string.join(...
lgpl-2.1
projectcalico/calico-nova
nova/api/openstack/compute/contrib/rescue.py
7
4012
# Copyright 2011 OpenStack Foundation # # 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
sarakha63/persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/playvid.py
41
2818
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) from ..utils import ( clean_html, ExtractorError, ) class PlayvidIE(InfoExtractor): _VALID_URL = r'https?://www\.playvid\.com/watch(\?v=|/)(?P<id>.+?)(?:#|$)' _TEST =...
gpl-3.0
pliu55/RSEM
pRSEM/Transcript.py
3
6028
__doc__=""" peng 20131009 Data structure copied from RSEM, made some name changes """ class Transcript: def __init__(self): self.transcript_id = None self.gene_id = None self.gene = None self.transcript_group = None self.chrom = None ## RSEM Transcript's string seqname self.stra...
gpl-3.0
nevermoreluo/privateoverseas
overseas/migrations/0001_initial.py
1
3314
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-05 02:47 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Create...
gpl-3.0
jaskaye17/nomadpad
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_luabuiltins.py
275
6863
# -*- coding: utf-8 -*- """ pygments.lexers._luabuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names and modules of lua functions It is able to re-generate itself, but for adding new functions you probably have to add some callbacks (see function module_callbacks). Do not edit th...
mit
basicthinker/THNVM
tests/configs/simple-timing-mp.py
69
2376
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
Jgarcia-IAS/localizacion
openerp/addons/website_event/models/event.py
89
5542
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
gitcoinco/web
app/dashboard/migrations/0123_auto_20200617_1549.py
1
4319
# Generated by Django 2.2.4 on 2020-06-17 15:49 import app.utils from django.db import migrations, models import django.db.models.deletion import economy.models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0122_auto_20200615_1510'), ] operations = [ migrations....
agpl-3.0
DeltaEpsilon-HackFMI2/FMICalendar-REST
venv/lib/python2.7/site-packages/django/db/models/fields/files.py
111
15938
import datetime import os from django import forms from django.db.models.fields import Field from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signals from django.utils.encoding import force_str, for...
mit
gigawhitlocks/zulip
zerver/templatetags/minified_js.py
118
1402
from __future__ import absolute_import from django.template import Node, Library, TemplateSyntaxError from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage register = Library() class MinifiedJSNode(Node): def __init__(self, sourcefile): self.sourcefile = sour...
apache-2.0
Plain-Andy-legacy/android_external_chromium_org
tools/perf/benchmarks/sunspider.py
27
5929
# 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 collections import json import os from metrics import power from telemetry import benchmark from telemetry.page import page_set from telemetry.page im...
bsd-3-clause
vFense/vFenseAgent-nix
agent/deps/mac/Python-2.7.5/lib/python2.7/_weakrefset.py
62
5607
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard(object): # This context manager registers itself in the current iterators of the # weak containe...
lgpl-3.0
0x414c/lastgraph
lastslice/slice.py
2
6976
#!/usr/bin/python import os import sys import web import time import random import datetime import threading from StringIO import StringIO FILEROOT = os.path.dirname(__file__) sys.path.insert(0, os.path.join(FILEROOT, "..")) sys.path.insert(1, os.path.join(FILEROOT, "..", "lib")) os.environ['DJANGO_SETTINGS_MODULE'] ...
bsd-3-clause
aashish24/VTK-old
Examples/Infovis/Python/Rcalculator_mst.py
9
2498
# Python examples script that uses the R calculator filter to find the # maxiumum spanning tree of a random input graph by inverting the edge # weights of the graph in R. The MST algorithm then finds the maximum # spanning tree instead of the minimum spanning tree. # VTK must be built with VTK_USE_GNU_R turned on fo...
bsd-3-clause
isabernardes/Heriga
Herigaenv/lib/python2.7/site-packages/django/conf/locale/az/formats.py
1059
1267
# -*- 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 = 'j E Y г.' TIME_FORMAT = 'G:i' DAT...
mit
zstackio/zstack-woodpecker
integrationtest/vm/mini/paths/path54.py
1
2373
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", path_list=[ [TestAction.add_image, 'image1', 'root', os.environ.get('isoForVmUrl')], [TestAction.create_vm_by_image, 'image1', 'iso', 'vm1'], [TestAction.create_v...
apache-2.0
albertomurillo/ansible
lib/ansible/modules/cloud/rackspace/rax_cdb_database.py
102
4470
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
StephenKing/summerschool-2015-ryu
ryu/contrib/ovs/process.py
56
1467
# Copyright (c) 2010, 2011 Nicira, 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 ...
apache-2.0
Aaron1992/v2ex
mail.py
20
2098
#!/usr/bin/env python # coding=utf-8 import logging import re from v2ex.babel import Member from google.appengine.ext import db from google.appengine.ext import webapp from google.appengine.ext.webapp.mail_handlers import InboundMailHandler from google.appengine.ext.webapp.util import run_wsgi_app from twitter.oaut...
bsd-3-clause
absoludity/servo
components/script/dom/bindings/codegen/ply/ply/yacc.py
319
128492
# ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2009, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
mpl-2.0
bryx-inc/boto
tests/integration/awslambda/__init__.py
586
1123
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
memo/tensorflow
tensorflow/python/kernel_tests/sparse_reshape_op_test.py
48
12887
# 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
wscullin/spack
var/spack/repos/builtin.mock/packages/multivalue_variant/package.py
3
2032
############################################################################## # Copyright (c) 2013-2017, 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
yangdongsheng/autotest
utils/build_externals.py
6
5474
#!/usr/bin/python # # Please keep this code python 2.4 compatible and stand alone. """ Fetch, build and install external Python library dependancies. This fetches external python libraries, builds them using your host's python and installs them under our own autotest/site-packages/ directory. Usage? Just run it. ...
gpl-2.0
maalmeida1837/deepdive
examples/spouse_example/postgres/plpy_extractor/udf/ext_has_spouse.py
15
3244
#! /usr/bin/env python #! /usr/bin/env python # Imports written in this area is useless, just for local debugging import ddext from ddext import SD import itertools import os from collections import defaultdict # input: sentences.id, p1.id, p1.text, p2.id, p2.text # output: has_spouse # returns: def init(): SD['AP...
apache-2.0
rynomster/django
tests/utils_tests/test_termcolors.py
337
6461
import unittest from django.utils.termcolors import ( DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES, colorize, parse_color_setting, ) class TermColorTests(unittest.TestCase): def test_empty_string(self): self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE...
bsd-3-clause
mikebsg01/Programming-Contests
ACM-ICPC/Training/20190427/B.py
3
1037
from sys import stdin from datetime import datetime as dt, timedelta def readLine(): return stdin.readline().strip() def readInt(): return int(readLine()) def readInts(): return list(map(int, readLine().split())) def daysBetween(d1, d2): y1 = '2018' if d1 > d2 else '2019' y2 = '2019' d1 = dt.strptime('%s-%s'...
gpl-3.0
lzw120/django
tests/regressiontests/test_client_regress/urls.py
65
2288
from __future__ import absolute_import from django.conf.urls import patterns, url from django.views.generic import RedirectView from . import views urlpatterns = patterns('', (r'^no_template_view/$', views.no_template_view), (r'^staff_only/$', views.staff_only_view), (r'^get_view/$', views.get_view), ...
bsd-3-clause
payeldillip/django
django/contrib/gis/gdal/prototypes/ds.py
349
4403
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
bsd-3-clause
mdsafwan/Deal-My-Stuff
Lib/site-packages/django/contrib/gis/utils/ogrinspect.py
82
9146
""" This module is for inspecting OGR data sources and generating either models for GeoDjango and/or mapping dictionaries for use with the `LayerMapping` utility. """ # Requires GDAL to use. from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, ...
apache-2.0
cournape/ensetuptools
setuptools/command/setopt.py
1
4977
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user co...
bsd-3-clause
airbnb/superset
superset/migrations/versions/46f444d8b9b7_remove_coordinator_from_druid_cluster_.py
5
1660
# 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
itdc/sublimetext-itdchelper
itdchelper/asanalib/requests/packages/charade/gb2312freq.py
3132
36011
######################## 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
pwmarcz/django
django/contrib/sessions/backends/cache.py
102
2499
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import caches from django.utils.six.moves import xrange KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
bsd-3-clause
v6ak/qubes-core-admin
core/storage/__init__.py
2
15124
#!/usr/bin/python2 # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2013 Marek Marczykowski <marmarek@invisiblethingslab.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...
gpl-2.0
sodafree/backend
build/lib.linux-i686-2.7/django/contrib/gis/gdal/feature.py
92
3941
# The GDAL C library, OGR exception, and the Field object from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException, OGRIndexError from django.contrib.gis.gdal.field import Field from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType # ctypes function pro...
bsd-3-clause
adieu/django-nonrel
tests/regressiontests/m2m_regress/models.py
92
1930
from django.db import models from django.contrib.auth import models as auth # No related name is needed here, since symmetrical relations are not # explicitly reversible. class SelfRefer(models.Model): name = models.CharField(max_length=10) references = models.ManyToManyField('self') related = models.ManyT...
bsd-3-clause
MonicaHsu/truvaluation
venv/lib/python2.7/popen2.py
304
8416
"""Spawn a command with pipes to its stdin, stdout, and optionally stderr. The normal os.popen(cmd, mode) call spawns a shell command and provides a file interface to just the input or output of the process depending on whether mode is 'r' or 'w'. This module provides the functions popen2(cmd) and popen3(cmd) which r...
mit
vrenaville/ngo-addons-backport
addons/stock/wizard/stock_inventory_merge.py
57
3815
# -*- 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...
agpl-3.0
PandaPayProject/PandaPay
qa/rpc-tests/invalidblockrequest.py
38
4237
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.comptool import TestManager, Te...
mit
joacub/zf-joacub-uploader-twb
vendor/jQuery-File-Upload/server/gae-python/main.py
168
5596
# -*- coding: utf-8 -*- # # jQuery File Upload Plugin GAE Python Example 2.1.0 # https://github.com/blueimp/jQuery-File-Upload # # Copyright 2011, Sebastian Tschan # https://blueimp.net # # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT # from __future__ import with_statement from google.appe...
bsd-3-clause
gabrielkrell/sendgrid-python
examples/campaigns/campaigns.py
2
4132
import sendgrid import json import os sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) ################################################## # Create a Campaign # # POST /campaigns # data = { "categories": [ "spring line" ], "custom_unsubscribe_url": "", "html_content": "<html><...
mit
LS80/script.module.livestreamer
lib/livestreamer/plugins/livestation.py
34
2666
import re from livestreamer.plugin import Plugin, PluginError, PluginOptions from livestreamer.plugin.api import http, validate from livestreamer.stream import HLSStream LOGIN_PAGE_URL = "http://www.livestation.com/en/users/new" LOGIN_POST_URL = "http://www.livestation.com/en/sessions.json" _csrf_token_re = re.compi...
bsd-2-clause
WenZhuang/pyspider
pyspider/database/base/taskdb.py
57
2609
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-08 10:28:48 # task schema { 'task': { 'taskid': str, # new, not change 'project': str, # new, not change 'url': str, ...
apache-2.0
kingvuplus/Gui3
lib/python/Plugins/SystemPlugins/FastScan/plugin.py
59
13191
# -*- coding: utf-8 -*- from os import path as os_path, walk as os_walk, unlink as os_unlink from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.config import config, ConfigSelection, ConfigYesNo, getConfigListEntry, ConfigSubsection,...
gpl-2.0
hkariti/ansible
lib/ansible/modules/network/nxos/nxos_linkagg.py
2
12721
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kosgroup/odoo
odoo/service/server.py
5
36250
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import random import select import signal import socket import subprocess ...
gpl-3.0
Jannes123/inasafe
safe/storage/layer.py
7
3762
"""**Class Layer** """ from safe.common.utilities import verify from projection import Projection class Layer(object): """Common class for geospatial layers """ def __init__(self, name=None, projection=None, keywords=None, style_info=None, sublayer=None): """Com...
gpl-3.0
eloquence/unisubs
apps/teams/models.py
1
128528
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 op...
agpl-3.0
jlspyaozhongkai/Uter
third_party_backup/Python-2.7.9/Lib/encodings/cp1026.py
593
13369
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
gpl-3.0
wiki05/youtube-dl
youtube_dl/extractor/nytimes.py
116
4325
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, parse_iso8601, ) class NYTimesBaseIE(InfoExtractor): def _extract_video_from_id(self, video_id): video_data = self._download_json( 'http://www.nytimes.com/sv...
unlicense
goldyliang/VLC_Subtitle_Navigation
extras/misc/stackhandler.py
99
9554
#!/usr/bin/python ##################################################################### # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # Version 2, December 2004 # # Copyright (C) 2011-2012 Ludovic Fauvet <etix@videolan.org> # Jean-Baptiste Kempf <jb@videolan.org> #...
gpl-2.0
apanju/odoo
addons/website_event_track/models/event.py
300
8344
# -*- 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
codedsk/hubcheck
hubcheck/pageobjects/po_time_overview_page.py
1
1349
from hubcheck.pageobjects.po_time_base_page import TimeBasePage from hubcheck.pageobjects.basepageelement import Link class TimeOverviewPage(TimeBasePage): """time overview page""" def __init__(self,browser,catalog,groupid=None): super(TimeOverviewPage,self).__init__(browser,catalog) self.path...
mit
madeso/prettygood
dotnet/Tagger/TagValidator.py
1
2567
using System; using System.Collections.Generic; using System.Linq; using System.Text; using MusicBrainz; using PrettyGood.Util; namespace Tagger { class TagValidator { public bool validate(IdTag tag) { Artist artist = null; if (string.IsNullOrEmpty(tag.Artist) == false)...
mit
gangadhar-kadam/sms-erpnext
patches/march_2013/p08_create_aii_accounts.py
5
4022
import webnotes def execute(): webnotes.reload_doc("setup", "doctype", "company") create_chart_of_accounts_if_not_exists() add_group_accounts() add_ledger_accounts() add_aii_cost_center() set_default_accounts() def set_default_accounts(): for company in webnotes.conn.sql_list("select name from `tabCompany`"): ...
agpl-3.0
CodeForAfrica/grano
grano/plugins.py
4
2079
import logging from stevedore.enabled import EnabledExtensionManager from grano.core import app log = logging.getLogger(__name__) NAMESPACES = [ 'grano.startup', 'grano.periodic', 'grano.entity.change', 'grano.relation.change', 'grano.schema.change', 'grano.project.change' ] PLUGINS = {'LOAD...
mit
40323210/bg6_cdw11
static/plugin/liquid_tags/test_notebook.py
311
3042
import re from pelican.tests.support import unittest from . import notebook class TestNotebookTagRegex(unittest.TestCase): def get_argdict(self, markup): match = notebook.FORMAT.search(markup) if match: argdict = match.groupdict() src = argdict['src'] star...
agpl-3.0
mne-tools/mne-tools.github.io
0.21/_downloads/4bd3132f565f8eeb8f92269a858f1f3f/plot_source_alignment.py
2
17152
# -*- coding: utf-8 -*- """ .. _plot_source_alignment: Source alignment and coordinate frames ====================================== This tutorial shows how to visually assess the spatial alignment of MEG sensor locations, digitized scalp landmark and sensor locations, and MRI volumes. This alignment process is cruci...
bsd-3-clause
chainer/chainer
tests/chainerx_tests/unit_tests/routines_tests/test_creation.py
3
46107
import io import sys import tempfile import chainer import numpy import pytest import chainerx import chainerx.testing from chainerx_tests import array_utils from chainerx_tests import dtype_utils from chainerx_tests import op_utils _array_params_list = [ -2, 1, -1.5, 2.3, True, False, ...
mit
clasnake/recommender
similarity.py
1
6369
from __future__ import division from math import sqrt def sim_distance(prefs, item1, item2): #get the list of shared items si = {}; for item in prefs[item1]: if item in prefs[item2]: si[item] = 1; #if they have no shared items,return 0; if len(si) == 0: return 0; #Add the s...
mit
Gagaro/django
tests/foreign_object/models/empty_join.py
97
3211
from django.db import models from django.db.models.fields.related import ( ForeignObjectRel, ReverseManyToOneDescriptor, ) from django.db.models.lookups import StartsWith from django.db.models.query_utils import PathInfo from django.utils.encoding import python_2_unicode_compatible class CustomForeignObjectRel(Fo...
bsd-3-clause