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
artnowo/elasticsearch
dev-tools/prepare_release_update_documentation.py
269
5009
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
Varriount/Colliberation
libs/twisted/conch/ssh/common.py
20
2781
# -*- test-case-name: twisted.conch.test.test_ssh -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Common functions for the SSH classes. Maintainer: Paul Swartz """ import struct, warnings try: from Crypto import Util except ImportError: warnings.warn("PyCrypto not installed,...
mit
blondegeek/pymatgen
pymatgen/io/abinit/events.py
2
28778
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module defines the events signaled by abinit during the execution. It also provides a parser to extract these events form the main output file and the log file. """ import sys import os.path import dat...
mit
haad/ansible
lib/ansible/modules/network/cloudengine/ce_bgp_neighbor.py
22
73471
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
hiphopsmurf/bitcoin-secured
online/build/tornado/tornado/test/escape_test.py
7
9269
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import tornado.escape from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode from tornado.util import u, unicode_type, bytes_type from tornado....
mit
deepak5/namebench
nb_third_party/jinja2/lexer.py
211
26042
# -*- coding: utf-8 -*- """ jinja2.lexer ~~~~~~~~~~~~ This module implements a Jinja / Python combination lexer. The `Lexer` class provided by this module is used to do some preprocessing for Jinja. On the one hand it filters out invalid operators like the bitshift operators we don't allow...
apache-2.0
cisco-openstack/neutron
neutron/tests/unit/api/test_api_common.py
68
2904
# Copyright (c) 2013 Intel Corporation. # 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 re...
apache-2.0
Azure/azure-sdk-for-python
scripts/devops_tasks/create_coverage.py
1
2653
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
mit
carlosp420/scrapy
scrapy/loader/__init__.py
63
7098
"""Item Loader See documentation in docs/topics/loaders.rst """ from collections import defaultdict import six from scrapy.item import Item from scrapy.selector import Selector from scrapy.utils.decorators import deprecated from scrapy.utils.deprecate import create_deprecated_class from scrapy.utils.misc import arg_...
bsd-3-clause
ericzolf/ansible
test/units/executor/test_task_executor.py
34
15879
# (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
aeischeid/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/no_wsh_at_the_end.py
499
1839
# Copyright 2009, 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 f...
mpl-2.0
jmerkow/VTK
Examples/Infovis/Python/gui.py
18
1605
#!/usr/bin/env python from PyQt4 import QtCore from PyQt4 import QtGui from PyQt4 import uic from vtk import * import sys # Create a PyQt window using a .ui file generated with Qt Designer ... application = QtGui.QApplication(sys.argv) window = uic.loadUi("gui.ui") vertex_slider = window.findChild(QtGui.QSlider, "ver...
bsd-3-clause
ryfeus/lambda-packs
LightGBM_sklearn_scipy_numpy/source/sklearn/neighbors/base.py
19
30908
"""Base and mixin classes for nearest neighbors""" # Authors: Jake Vanderplas <vanderplas@astro.washington.edu> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Sparseness support by Lars Buitinck # Multi-output support by Arnaud Jol...
mit
mohammed52/something.pk
node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
1835
1748
#!/usr/bin/env python # Copyright (c) 2011 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. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" ...
mit
hopeall/odoo
addons/event/__openerp__.py
261
2296
# -*- 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
AlanZatarain/pysal
pysal/contrib/viz/mapping.py
5
24991
""" Choropleth mapping using PySAL and Matplotlib """ __author__ = "Sergio Rey <sjsrey@gmail.com>", "Dani Arribas-Bel <daniel.arribas.bel@gmail.com" import pysal as ps import numpy as np import matplotlib.pyplot as plt from matplotlib import colors as clrs import matplotlib as mpl from matplotlib.pyplot import fi...
bsd-3-clause
mlperf/training_results_v0.6
Google/benchmarks/transformer/implementations/tpu-v3-32-transformer/transformer/google/data_generators/example_utils.py
6
1527
"""Utilties for genearting data from tf.Examples.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from contextlib import contextmanager import six import tensorflow as tf @contextmanager def managed_session(): """Yield a session that handles initializ...
apache-2.0
Ecpy/ecpy
exopy/measurement/workspace/workspace.py
1
22669
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ---------------...
bsd-3-clause
DarkMio/cobe
cobe/commands.py
2
8384
# Copyright (C) 2014 Peter Teichman import atexit import logging import os import re import readline import Stemmer import sys import time from .bot import Runner from .brain import Brain log = logging.getLogger("cobe") class InitCommand: @classmethod def add_subparser(cls, parser): subparser = par...
mit
aioue/ansible
lib/ansible/modules/cloud/amazon/_ec2_remote_facts.py
20
6726
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
gpl-3.0
chokribr/invenio
invenio/legacy/websubmit/functions/Send_APP_Mail.py
13
12240
# This file is part of Invenio. # Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your o...
gpl-2.0
shanemcd/ansible
lib/ansible/modules/cloud/centurylink/clc_server_snapshot.py
56
14120
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # 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': ['previe...
gpl-3.0
mckerrj/ansible
lib/ansible/plugins/connection/docker.py
8
11874
# Based on the chroot connection plugin by Maykel Moya # # Connection plugin for configuring docker containers # (c) 2014, Lorin Hochstein # (c) 2015, Leendert Brouwer # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # Maintainer: Leendert Brouwer (https://github.com/objectified) # # This file is part of Ansible #...
gpl-3.0
wetek-enigma/enigma2
lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py
42
13887
from boxbranding import getMachineBrand, getMachineName, getBoxType from os import system from enigma import eTimer from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from Screens.MessageBox import MessageBox from Screens.Screen import Screen from Components.Pixmap import Pixmap from Componen...
gpl-2.0
amozie/amozie
testzie/table_test.py
1
3048
import numpy as np import pandas as pd lt = 'f:/lt/' region = pd.read_csv(lt + 'region.csv',sep='\t', index_col=0) # 排除内蒙古和西藏 # prvs = ['北京', '天津', '河北', '山东', '辽宁', '江苏', '上海', '浙江', '福建', '广东', '海南', '吉林', # '黑龙江', '山西', '河南', '安徽', '江西', '湖北', '湖南', '广西', '重庆', '四川', '贵州', '云南', # '陕西', '甘肃', '青海', '...
apache-2.0
levkar/odoo-addons
partner_samples/partner.py
2
1102
# -*- coding: utf-8 -*- from openerp import models, fields import openerp.addons.decimal_precision as dp class res_partner_sample(models.Model): _name = "res.partner.sample" _description = "Partner Samples" _order = 'delivery_date desc' delivery_date = fields.Date( string='Delivery Date', ...
agpl-3.0
skarnproject/Blender-WMO-import-export-scripts
io_scene_wmo/wmo/ui/operators.py
2
49060
from .panels import * from ...m2 import import_m2 as m2 import bpy import subprocess import mathutils import math import os import sys import time import struct ############################### ## WMO operators ############################### class IMPORT_ADT_SCENE(bpy.types.Operator): bl_idname = "scene.wow_imp...
gpl-3.0
ckc6cz/osf.io
scripts/migration/migrate_profile_dates.py
64
4803
"""Changes existing profile education and employment dates from YYYY-MM-DD formatted dates to "Month Year" format Log: Run on production by SL on 2014-10-14 at 19:11 EST. 269 users were migrated. """ import logging from website.app import init_app from website import models from datetime import datetime from tes...
apache-2.0
paweljasinski/ironpython3
Tests/test_exceptions_generated.py
3
2015
##################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of th...
apache-2.0
naokimiyasaka/sublime-text
Backup/20130813102457/Package Control/package_control/package_installer.py
9
9168
import os import re import threading import sublime from .preferences_filename import preferences_filename from .thread_progress import ThreadProgress from .package_manager import PackageManager from .upgraders.git_upgrader import GitUpgrader from .upgraders.hg_upgrader import HgUpgrader from .versions import version...
mit
benfinke/ns_python
build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/network/vxlan_iptunnel_binding.py
3
6261
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
airbnb/superset
superset/migrations/versions/1296d28ec131_druid_exports.py
5
1260
# 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
BT-rmartin/odoo
openerp/tools/yaml_import.py
75
43470
# -*- coding: utf-8 -*- import threading import types import time # used to eval time.strftime expressions from datetime import datetime, timedelta import logging import openerp import openerp.sql_db as sql_db import openerp.workflow import misc from config import config import yaml_tag import yaml import re from lxml...
agpl-3.0
belmiromoreira/nova
nova/image/s3.py
38
17754
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
MicroTrustRepos/microkernel
src/l4/pkg/python/contrib/Misc/Vim/syntax_test.py
82
1457
"""Test file for syntax highlighting of editors. Meant to cover a wide range of different types of statements and expressions. Not necessarily sensical or comprehensive (assume that if one exception is highlighted that all are, for instance). Extraneous trailing whitespace can't be tested because of svn pre-commit ho...
gpl-2.0
simontakite/sysadmin
pythonscripts/programmingpython/Gui/Tour/canvasDraw.py
2
1763
""" draw elastic shapes on a canvas on drag, move on right click; see canvasDraw_tags*.py for extensions with tags and animation """ from tkinter import * trace = False class CanvasEventsDemo: def __init__(self, parent=None): canvas = Canvas(width=300, height=300, bg='beige') canvas.pac...
gpl-2.0
hdinsight/hue
apps/beeswax/src/beeswax/migrations/0007_auto__add_field_savedquery_is_trashed.py
39
7804
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'SavedQuery.is_trashed' db.add_column('beeswax_savedquery', 'is_trashed', self.gf('django.db.models...
apache-2.0
shellderp/sublime-robot-plugin
lib/robot/parsing/__init__.py
3
1770
# Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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
N03297857/2017Fall
node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
apache-2.0
AntaresOne/android_kernel_samsung_jf
build-all.py
37
10510
#! /usr/bin/env python # Copyright (c) 2009-2011, The Linux Foundation. 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 # ...
gpl-2.0
hoho/dosido
nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
Slezhuk/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_options.py
66
15099
#!/usr/bin/python # 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 in the hope that it will be use...
gpl-3.0
Distrotech/intellij-community
python/lib/Lib/xml/etree/ElementPath.py
189
6066
# # ElementTree # $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $ # # limited xpath support for element trees # # history: # 2003-05-23 fl created # 2003-05-28 fl added support for // etc # 2003-08-27 fl fixed parsing of periods in element names # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights re...
apache-2.0
tijptjik/thegodsproject
plugins/twitter_bootstrap_rst_directives/bootstrap_rst_directives.py
66
15171
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Twitter Bootstrap RST directives Plugin For Pelican =================================================== This plugin defines rst directives for different CSS and Javascript components from the twitter bootstrap framework. """ from uuid import uuid1 from cgi import ...
mit
smalls257/VRvisu
Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_dict.py
35
20218
import unittest from test import test_support import UserDict, random, string import gc, weakref class DictTest(unittest.TestCase): def test_constructor(self): # calling built-in types without argument must return empty self.assertEqual(dict(), {}) self.assertIsNot(dict(), {}) def te...
gpl-3.0
javier-ruiz-b/docker-rasppi-images
raspberry-google-home/env/lib/python3.7/site-packages/google/auth/transport/__init__.py
7
3438
# Copyright 2016 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
xbmc/xbmc-antiquated
xbmc/lib/libPython/Python/Lib/encodings/iso2022_jp_2004.py
12
1128
# # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # $CJKCodecs: iso2022_jp_2004.py,v 1.1 2004/07/07 16:18:25 perky Exp $ # import _codecs_iso2022, codecs codec = _codecs_iso2022.getcodec('iso2022_jp_2004') class Codec(codecs.Codec): encode = codec....
gpl-2.0
edx/lettuce
tests/integration/lib/Django-1.3/django/forms/forms.py
156
21754
""" Form classes """ from django.core.exceptions import ValidationError from django.utils.copycompat import deepcopy from django.utils.datastructures import SortedDict from django.utils.html import conditional_escape from django.utils.encoding import StrAndUnicode, smart_unicode, force_unicode from django.utils.safest...
gpl-3.0
EuroPython/djep
pyconde/settings.py
1
18813
import os from email.utils import parseaddr from configurations import Configuration, values ugettext = lambda s: s class Base(Configuration): """ The are correct settings that are primarily targeted at the production system but allow (where appriate) easy overrides either via subclassing or enviro...
bsd-3-clause
lxneng/incubator-airflow
tests/contrib/hooks/test_ssh_hook.py
8
6715
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
bkirui/odoo
addons/note_pad/note_pad.py
441
1301
# -*- 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
ngoix/OCRF
sklearn/utils/optimize.py
122
5674
""" Our own implementation of the Newton algorithm Unlike the scipy.optimize version, this version of the Newton conjugate gradient solver uses only one function call to retrieve the func value, the gradient value and a callable for the Hessian matvec product. If the function call is very expensive (e.g. for logistic ...
bsd-3-clause
eric-stanley/NewsBlur
apps/rss_feeds/views.py
1
17887
import datetime from urlparse import urlparse from utils import log as logging from django.shortcuts import get_object_or_404, render_to_response from django.views.decorators.http import condition from django.http import HttpResponseForbidden, HttpResponseRedirect, HttpResponse, Http404 from django.conf import settings...
mit
impowski/servo
tests/wpt/css-tests/tools/manifest/item.py
84
5794
import os import urlparse from abc import ABCMeta, abstractmethod, abstractproperty from utils import from_os_path, to_os_path item_types = ["testharness", "reftest", "manual", "stub", "wdspec"] def get_source_file(source_files, tests_root, manifest, path): def make_new(): from sourcefile import SourceF...
mpl-2.0
dragosbdi/bitcredit-2.0
contrib/linearize/linearize-data.py
1
8829
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcredit Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print_fu...
mit
hrh5775/LibraryManager
PythonTestClient/LibraryManagerTestClient/venv/Lib/site-packages/pip/_vendor/distro.py
330
38349
# Copyright 2015,2016 Nir Cohen # # 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, s...
gpl-3.0
elliptic-shiho/crypto_misc
FEAL/differential_cryptanalysis.py
1
4506
from collections import namedtuple, defaultdict from FEAL import FEAL, XOR, round_function from multiprocessing import Process, Queue import itertools import os DifferentialPair = namedtuple('DifferentialPair', ['m1', 'm2', 'c1', 'c2']) def gen_random_bytes(length): return map(ord, os.urandom(length)) def make_dif...
mit
lukejharmon/tangelohub
devops/ansible/GirderClient.py
1
10223
import json import requests import os class GirderClient(object): """ A class for interacting with the Girder RESTful api. Some simple examples of how to use this class follow: c = GirderClient('myhost', 9000) c.authenticate('myname', 'mypass') itemId = c.createitem(folderId, 'some item nam...
apache-2.0
metaplinius/confederation
cserver.py
1
5019
import socket import random #DONE: IP recognization #Copyright 2014 Antonius Frie # 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 opt...
gpl-3.0
grehx/spark-tk
regression-tests/sparktkregtests/testcases/performance/cox_ph_test.py
4
3480
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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
armooo/zulip
zerver/lib/migrate.py
115
3615
import re import time def timed_ddl(db, stmt): print print time.asctime() print stmt t = time.time() db.execute(stmt) delay = time.time() - t print 'Took %.2fs' % (delay,) def validate(sql_thingy): # Do basic validation that table/col name is safe. if not re.match('^[a-z][a-z\d_]+$...
apache-2.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/third_party/mojo/src/mojo/public/third_party/jinja2/nodes.py
623
28875
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
mit
lincolnloop/wagtaildemo
demo/models.py
4
16775
from datetime import date from django.db import models from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.shortcuts import render from django.http import HttpResponse from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagt...
bsd-3-clause
onceuponatimeforever/oh-mainline
vendor/packages/whoosh/tests/test_results.py
16
17393
from __future__ import with_statement from nose.tools import assert_equal, assert_not_equal, assert_raises #@UnresolvedImport from whoosh import analysis, fields, formats, highlight, qparser, query from whoosh.compat import u, xrange, text_type from whoosh.filedb.filestore import RamStorage from whoosh.util import p...
agpl-3.0
sodo13/openpli-gls
lib/python/Components/ScrollLabel.py
21
5642
import skin from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eLabel, eWidget, eSlider, fontRenderClass, ePoint, eSize class ScrollLabel(HTMLComponent, GUIComponent): def __init__(self, text=""): GUIComponent.__init__(self) self.message = text self.instance = None ...
gpl-2.0
jwi078/incubator-airflow
airflow/migrations/versions/e3a246e0dc1_current_schema.py
33
11577
"""current schema Revision ID: e3a246e0dc1 Revises: Create Date: 2015-08-18 16:35:00.883495 """ # revision identifiers, used by Alembic. revision = 'e3a246e0dc1' down_revision = None branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy import func from sqlalchemy.eng...
apache-2.0
olapaola/olapaola-android-scripting
python/src/Lib/ihooks.py
62
17452
"""Import hook support. Consistent use of this module will make it possible to change the different mechanisms involved in loading modules independently. While the built-in module imp exports interfaces to the built-in module searching and loading algorithm, and it is possible to replace the built-in function __impor...
apache-2.0
WoLpH/CouchPotatoServer
libs/suds/mx/encoded.py
211
4651
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 ...
gpl-3.0
naturalness/partycrasher
partycrasher/pc_exceptions.py
2
5536
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (C) 2016 Eddie Antonio Santos <easantos@ualberta.ca> # # 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 Licens...
gpl-3.0
cgstudiomap/cgstudiomap
main/parts/odoo/addons/l10n_de/__openerp__.py
260
7736
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
nextgenusfs/funannotate
docs/conf.py
1
5192
# -*- coding: utf-8 -*- # # Funannotate documentation build configuration file, created by # sphinx-quickstart on Sat Nov 18 22:41:39 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
bsd-2-clause
aaronsw/watchdog
utils/helpers.py
3
66974
import os import hmac import base64 import web from config import secret_key from settings import db def urlify(s): """ >>> urlify("What the !@#$%^ is going on here!?") 'what-the--is-going-on-here' """ s = s.lower() out = [] for k in s: if k == " ": out.append('-') elif k.i...
agpl-3.0
techtonik/readthedocs.org
readthedocs/search/lib.py
27
2982
from readthedocs.builds.constants import LATEST from .indexes import ProjectIndex, PageIndex from readthedocs.search.signals import before_project_search, before_file_search def search_project(request, query, language): body = { "query": { "bool": { "should": [ ...
mit
w1ll1am23/home-assistant
homeassistant/components/wake_on_lan/__init__.py
14
1691
"""Support for sending Wake-On-LAN magic packets.""" from functools import partial import logging import voluptuous as vol import wakeonlan from homeassistant.const import CONF_BROADCAST_ADDRESS, CONF_BROADCAST_PORT, CONF_MAC import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) ...
apache-2.0
roshan2806/chrome-app-samples
samples/appengine-channelapi/appengine/chatactoe.py
73
5106
#!/usr/bin/python2.4 # # Copyright 2010 Google Inc. All Rights Reserved. # pylint: disable-msg=C6310 """Channel Tic Tac Toe This module demonstrates the App Engine Channel API by implementing a simple tic-tac-toe game. """ import datetime import logging import os import random import re import uuid import sys from ...
apache-2.0
yask123/django
django/contrib/contenttypes/models.py
273
7798
from __future__ import unicode_literals import warnings from django.apps import apps from django.db import models from django.db.utils import IntegrityError, OperationalError, ProgrammingError from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text, python_2_unicode...
bsd-3-clause
EPFL-IC/sweng-management
swengmgmt/github.py
1
3301
#!/usr/bin/env python # # This file is part of the sweng-management tool. # # sweng-management 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 v...
gpl-3.0
qedsoftware/commcare-hq
corehq/apps/hqcase/tests/test_bugs.py
1
2087
import uuid from django.test import TestCase from casexml.apps.case.mock import CaseBlock from casexml.apps.case.util import post_case_blocks from casexml.apps.case.xml import V2 from casexml.apps.phone.restore import RestoreConfig, RestoreParams from corehq.apps.domain.shortcuts import create_domain from corehq.apps.u...
bsd-3-clause
khertan/PyQMLTalk
markdown/__main__.py
75
3349
""" COMMAND-LINE SPECIFIC STUFF ============================================================================= """ import markdown import sys import optparse import logging from logging import DEBUG, INFO, CRITICAL logger = logging.getLogger('MARKDOWN') def parse_options(): """ Define and parse `optparse` ...
gpl-3.0
tmtowtdi/MontyLacuna
lib/lacuna/test/test_excavs_report.py
1
2051
import os, re, sys, time, unittest ### __file__, not sys.argv[0]. When run using nose, sys.argv[0] will be nose ### itself, not this module. rootdir = os.path.join( os.path.abspath(os.path.dirname(__file__)), "..", "..", ".." ) libdir = os.path.join( rootdir, "lib" ) sys.path.append(libdir) import lacuna, lacuna....
mit
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/numpy/random/tests/test_regression.py
78
4513
from __future__ import division, absolute_import, print_function import sys from numpy.testing import (TestCase, run_module_suite, assert_, assert_array_equal, assert_raises) from numpy import random from numpy.compat import long import numpy as np class TestRegression(TestCase): def ...
gpl-2.0
ironexmaiden/csd_post_sw
plugins/werkzeug/setup.py
16
1443
#!/usr/bin/env python import sys import os from distutils.core import setup try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: from distutils.command.build_py import build_py # This ugly hack executes the first few lines of the module file to look up some # common varia...
mit
SerpentCS/odoo
setup/win32/win32_service.py
362
1825
# -*- coding: utf-8 -*- import servicemanager import win32api import win32process import win32service import win32serviceutil import subprocess import sys from os.path import dirname, join, split execfile(join(dirname(__file__), '..', 'server', 'openerp', 'release.py')) class OdooService(win32serviceutil.ServiceF...
agpl-3.0
afandria/mojo
build/linux/unbundle/remove_bundled_libraries.py
89
3223
#!/usr/bin/env python # 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. """ Removes bundled libraries to make sure they are not used. See README for more details. """ import optparse import os.path import...
bsd-3-clause
taiyuanfang/gyp
test/mac/gyptest-app-error.py
164
1172
#!/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. """ Verifies that invalid strings files cause the build to fail. """ import TestCmd import TestGyp import sys if sys.platform == 'darwin'...
bsd-3-clause
srickardti/openthread
tools/harness-automation/cases_R140/router_5_2_6.py
18
1878
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
andrewjrobinson/SportsReview
sportsreview/delayvideo/video/video.py
1
2910
# /******************************************************************************* # * (c) Andrew Robinson (andrewjrobinson@gmail.com) 2014 * # * * # * This file is part of SportsReview. ...
lgpl-3.0
defionscode/ansible
lib/ansible/modules/remote_management/hpilo/hpilo_facts.py
27
7754
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.com> # 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
fawadkhaliq/networking-plumgrid
networking_plumgrid/neutron/plugins/db/api.py
1
1381
# # 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, software # ...
apache-2.0
Juniper/nova
nova/api/openstack/compute/schemas/server_tags.py
12
1071
# 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, software # d...
apache-2.0
lmorchard/django
django/utils/archive.py
562
7070
""" Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/ Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors. 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 So...
bsd-3-clause
aio-libs/aioes
tests/test_snapshot.py
1
3846
import os import shutil import random import asyncio import tempfile import pytest from aioes import Elasticsearch from aioes.exception import NotFoundError INDEX = 'test_elasticsearch' @pytest.fixture def client(es_params, loop, repo_name, snapshot_name): client = Elasticsearch([{'host': es_params['host']}], ...
apache-2.0
effa/flocs
practice/services/test_statistics_service.py
3
1487
"""Unit test of statistics service """ from django.test import TestCase from django.contrib.auth.models import User from tasks.models import TaskModel from practice.models import StudentModel from practice.models import TaskInstanceModel from . import statistics_service class StatisticServiceTest(TestCase): de...
gpl-2.0
epiqc/ScaffCC
llvm/utils/update_cc_test_checks.py
1
11766
#!/usr/bin/env python '''A utility to update LLVM IR CHECK lines in C/C++ FileCheck test files. Example RUN lines in .c/.cc test files: // RUN: %clang -emit-llvm -S %s -o - -O2 | FileCheck %s // RUN: %clangxx -emit-llvm -S %s -o - -O2 | FileCheck -check-prefix=CHECK-A %s Usage: % utils/update_cc_test_checks.py --ll...
bsd-2-clause
TextusData/Mover
thirdparty/protobuf-2.2.0/python/google/protobuf/internal/decoder.py
9
8115
# 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: # # * Redistributions o...
gpl-3.0
andmos/ansible
lib/ansible/modules/network/ios/ios_static_route.py
14
9505
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
dvliman/jaikuengine
.google_appengine/google/appengine/api/lib_config.py
13
11808
#!/usr/bin/env python # # Copyright 2007 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 applicable law o...
apache-2.0
olituks/sentinella
frontend/library/web2py/applications/sentinella/controllers/default.py
9
2293
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
lgpl-2.1
cortext/crawtextV2
~/venvs/crawler/lib/python2.7/site-packages/requests/__init__.py
327
1856
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
mit
dwaynebailey/translate
translate/lang/zh.py
3
2423
# -*- coding: utf-8 -*- # # Copyright 2007 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at y...
gpl-2.0