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
azureplus/hue
desktop/core/ext-py/Django-1.6.10/docs/_ext/djangodocs.py
40
7686
""" Sphinx plugins for Django documentation. """ import json import os import re from sphinx import addnodes, __version__ as sphinx_ver from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.writers.html import SmartyPantsHTMLTranslator from sphinx.util.console import bold from sphinx.util.compat import Di...
apache-2.0
kantlove/flask-simple-page
Lib/site-packages/jinja2/meta.py
336
4198
# -*- coding: utf-8 -*- """ jinja2.meta ~~~~~~~~~~~ This module implements various functions that exposes information about templates that might be interesting for various kinds of applications. :copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
mit
shanot/imp
modules/pmi/benchmark/benchmark_loop_reconstruction.py
1
4020
import IMP import IMP.core import IMP.algebra import IMP.atom import IMP.container import IMP.benchmark import time import sys import os import IMP.pmi.restraints.stereochemistry import IMP.pmi.representation as representation import IMP.pmi.tools as tools import IMP.pmi.samplers as samplers import IMP.pmi.output as o...
gpl-3.0
tungvx/deploy
.google_appengine/lib/webapp2/tests/extras_appengine_users_test.py
24
2916
# -*- coding: utf-8 -*- import os import webapp2 from webapp2_extras import users import test_base def set_current_user(email, user_id, is_admin=False): os.environ['USER_EMAIL'] = email or '' os.environ['USER_ID'] = user_id or '' os.environ['USER_IS_ADMIN'] = '1' if is_admin else '0' class LoginRequir...
apache-2.0
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/openerp/workflow/instance.py
314
5594
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 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
dvliman/jaikuengine
.google_appengine/lib/django-1.5/django/contrib/gis/db/backends/mysql/operations.py
100
2417
from django.db.backends.mysql.base import DatabaseOperations from django.contrib.gis.db.backends.adapter import WKTAdapter from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.utils import six class MySQLOperations(DatabaseOperations, BaseSpatialOperations): compiler_module = 'djang...
apache-2.0
mkrupcale/ansible
lib/ansible/modules/cloud/amazon/ec2_asg_facts.py
11
11706
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
stevehof/CouchPotatoServer
couchpotato/core/media/_base/matcher/base.py
81
2320
from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import simplifyString from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin log = CPLog(__name__) class MatcherBase(Plugin): type = None def __init__(self): if self.type: ...
gpl-3.0
sisirkoppaka/articur8
articurate/nertagger/celery_tasks.py
1
4928
from __future__ import absolute_import #Because nertag.py imports below, but isn't available in context of workers import re import os from nltk.tag.stanford import NERTagger import time import pickle from itertools import izip from collections import defaultdict from celery import chord, group from articurate.celer...
mit
jkugler/ansible
contrib/inventory/abiquo.py
39
8967
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' External inventory script for Abiquo ==================================== Shamelessly copied from an existing inventory script. This script generates an inventory that Ansible can understand by making API requests to Abiquo API Requires some python libraries, ensure ...
gpl-3.0
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/IPython/core/magics/script.py
1
8823
"""Magic functions for running cells in various scripts.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import errno import os import sys import signal import time from subprocess import Popen, PIPE import atexit from IPython.core import magic_arguments from I...
apache-2.0
vipmunot/Data-Analysis-using-Python
Apis and Scraping/Intermediate APIs-118.py
1
2765
## 2. API Authentication ## # Create a dictionary of headers containing our Authorization header. headers = {"Authorization": "token 1f36137fbbe1602f779300dad26e4c1b7fbab631"} # Make a GET request to the GitHub API with our headers. # This API endpoint will give us details about Vik Paruchuri. response = requests.get...
mit
carolineLe/miasm
test/utils/test.py
7
1552
class Test(object): "Stand for a test to run" def __init__(self, command_line, base_dir="", depends=None, products=None, tags=None, executable=None): """Create a Test instance. @command_line: list of string standing for arguments to launch @base_dir: base directory for ...
gpl-2.0
kangbiao/tornado
tornado/test/iostream_test.py
14
41539
from __future__ import absolute_import, division, print_function, with_statement from tornado.concurrent import Future from tornado import gen from tornado import netutil from tornado.iostream import IOStream, SSLIOStream, PipeIOStream, StreamClosedError from tornado.httputil import HTTPHeaders from tornado.log import ...
apache-2.0
j831/zulip
analytics/migrations/0001_initial.py
40
5095
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import zerver.lib.str_utils class Migration(migrations.Migration): dependencies = [ ('zerver', '0030_realm_org_type'), migrations.swappable_dependency(setting...
apache-2.0
tobiasgehring/qudi
hardware/microwave/mw_source_anritsu.py
1
13860
# -*- coding: utf-8 -*- """ This file contains the Qudi hardware file to control Anritsu Microwave Device. Qudi 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...
gpl-3.0
CDSP/Marvin
marvinconfig.py
1
2505
# -*- coding: utf-8 -*- #rend la console tres bavarde DEBUG = False #les sorties CSV et texte peuvent être active en même temps CONFIG = { 'details_CSV' : True,#active ou non les details sous forme de fichier CSV 'details_text' : True,#active ou non les details sous forme de fichier text } IMAGE_NAMING_PATTERN = {...
gpl-3.0
hackultura/django-logincidadao-provider
runtests.py
1
1191
import sys try: from django.conf import settings from django.test.utils import get_runner settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ "default": { "ENGINE": "django.db.backends.sqlite3", } }, ROOT_URLCONF="loginci...
bsd-3-clause
OpenDroneMap/python-WebODM
webodm/models.py
1
2597
#!/usr/bin/env python # -*- coding: utf-8 -*- """Models classes for returning results.""" class Project(object): def __init__(self, id, tasks, created_at, name, description, permissions): self.id = id self.tasks = tasks self.created_at = created_at self.name = name self.d...
mit
fhe-odoo/odoo
addons/website_mail/models/mail_thread.py
338
1454
# -*- 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
datalogics-robb/scons
test/option/debug-objects.py
2
1873
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
mit
josrolgil/exjobbCalvin
calvin/utilities/attribute_resolver.py
1
16606
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson 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 ...
apache-2.0
dangeratio/scrum
projects/migrations/0001_initial.py
1
1883
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Item', fields=[ ('id', models.AutoField(verbose...
gpl-2.0
OSBI/oodt
agility/oodt/query.py
7
17979
# encoding: utf-8 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE.txt 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 # "Li...
apache-2.0
almeidapaulopt/frappe
frappe/desk/doctype/todo/todo.py
13
2986
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json from frappe.model.document import Document from frappe.utils import get_fullname subject_field = "description" sender_field = "sender" exclude_from_lin...
mit
sgerhart/ansible
test/runner/lib/cloud/opennebula.py
34
1609
"""OpenNebula plugin for integration tests.""" from lib.cloud import ( CloudProvider, CloudEnvironment ) from lib.util import ( display, ) class OpenNebulaCloudProvider(CloudProvider): """Checks if a configuration file has been passed or fixtures are going to be used for testing""" def filter(s...
mit
zhongyi-zhang/azure-quickstart-templates
splunk-on-ubuntu/scripts/dobackup.py
119
3256
#!/usr/bin/env python3 #      The MIT License (MIT) # #      Copyright (c) 2016 Microsoft. 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 restr...
mit
padipadou/CADL
session-5/libs/dataset_utils.py
5
14402
"""Utils for dataset creation. Creative Applications of Deep Learning w/ Tensorflow. Kadenze, Inc. Copyright Parag K. Mital, June 2016. """ import os import pickle import numpy as np import tensorflow as tf from . import dft from .utils import download_and_extract_tar def create_input_pipeline(files, batch_size, n_...
apache-2.0
shashi28/nuts
FireBolt/firewall.py
1
1979
import platform import pydivert from pydivert.windivert import * from pydivert.winutils import * from pydivert.enum import * from pydivert.models import * from pydivert.decorators import * from PyQt4.QtCore import * import impacket from impacket.ImpactDecoder import EthDecoder version = '1.0' class Bolt(QThread): ...
mit
emreg00/biana
biana/BianaObjects/output_utilities.py
2
2098
def get_html_table_header(columns, attributes): attributes_str = " ".join([ "%s=\"%s\"" %(x[0],x[1]) for x in attributes ]) th_str = "<tr>%s</tr>" %"".join([ "<th>%s</th>" %x for x in columns ]) return "<table %s>%s" %(attributes_str,th_str) #return "<table id=\"biana\" %s>%s" %(attributes_str,th_str)...
gpl-3.0
square/pants
tests/python/pants_test/tasks/test_scrooge_gen.py
2
4319
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os from textw...
apache-2.0
cloudwatt/contrail-controller
src/analytics/contrail-snmp-collector/contrail_snmp_collector/snmpcfg.py
2
8138
# # Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. # import argparse, os, ConfigParser, sys, re from pysandesh.sandesh_base import * from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from device_config import DeviceConfig import discoveryclient.client as client from sandesh_common.vns.ttypes impo...
apache-2.0
muffl0n/ansible
test/units/parsing/test_data_loader.py
58
3231
# (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
cherrygirl/micronaet7
price_quotation_history/wizard/__init__.py
1
1072
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
darrenbilby/grr
client/client_actions/windows/windows.py
6
15608
#!/usr/bin/env python """Windows specific actions. Most of these actions share an interface (in/out rdfvalues) with linux actions of the same name. Windows-only actions are registered with the server via libs/server_stubs.py """ import binascii import ctypes import exceptions import logging import os import tempfile...
apache-2.0
sevo/closure_decorator
decorator/tests.py
1
2736
import unittest import exercises as e from functools import reduce from operator import add class DecoratorTests(unittest.TestCase): def freeze(self, *args): return tuple(args) def print_output(self, index=0): return e.print.__closure__[1].cell_contents[index] def local_variable_value...
mit
sspickle/assessdb
webapp/assessdb/rest_services.py
1
3384
""" Cornice Services for REST API """ import json import traceback import sqlalchemy as sa from pyramid.response import Response from .models import ( Person, Instrument, InstrumentItems, Course, Item, Answer, ItemAnswers, ) from cornice import Service person = Service(name='person', p...
bsd-2-clause
gentledevil/ansible
test/units/module_utils/test_database.py
325
5737
import collections import mock import os import re from nose.tools import eq_ try: from nose.tools import assert_raises_regexp except ImportError: # Python < 2.7 def assert_raises_regexp(expected, regexp, callable, *a, **kw): try: callable(*a, **kw) except expected as e: ...
gpl-3.0
alanljj/connector-telephony
base_phone/wizard/number_not_found.py
12
5462
# -*- encoding: utf-8 -*- ############################################################################## # # Base Phone module for Odoo # Copyright (C) 2010-2015 Alexis de Lattre <alexis@via.ecp.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affe...
agpl-3.0
okwow123/djangol2
example/env/lib/python2.7/site-packages/requests/packages/urllib3/util/wait.py
226
1451
from .selectors import ( HAS_SELECT, DefaultSelector, EVENT_READ, EVENT_WRITE ) def _wait_for_io_events(socks, events, timeout=None): """ Waits for IO events to be available from a list of sockets or optionally a single socket if passed in. Returns a list of sockets that can be interacted ...
mit
loco-odoo/localizacion_co
openerp/netsvc.py
37
8976
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of...
agpl-3.0
r39132/airflow
airflow/contrib/operators/jenkins_job_trigger_operator.py
1
11097
# -*- 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
pratikmallya/hue
desktop/core/ext-py/lxml/doc/s5/ep2008/atom.py
50
18452
# ET is 80's! #import elementtree as etree # LXML is 00's! from lxml import etree from lxml.etree import tostring #from dateutil.parser import parse as parse_date from datetime import datetime import uuid import cgi import copy __all__ = [ 'ATOM', 'atom_ns', 'Element', 'tostring'] ATOM_NAMESPACE = atom_ns = 'http...
apache-2.0
pratikmallya/hue
desktop/core/ext-py/boto-2.38.0/boto/manage/propget.py
153
2502
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
MeshGeometry/dxfio
Test/googletest/test/gtest_catch_exceptions_test.py
2139
9901
#!/usr/bin/env python # # Copyright 2010 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 o...
mit
chrismattmann/tika-python
tika/translate.py
1
3248
#!/usr/bin/env python # encoding: 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...
apache-2.0
sumedhasingla/VTK
Imaging/Core/Testing/Python/ReslicePermuteSlab.py
20
3561
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # this script tests vtkImageReslice with different slab modes # Image pipeline reader = vtk.vtkImageReader() reader.ReleaseDataFlagOff() reader.SetDataByteOrderToLittleEndian() reader...
bsd-3-clause
mtyka/pd
examples/restraint/run.py
1
3081
# PD is a free, modular C++ library for biomolecular simulation with a # flexible and scriptable Python interface. # Copyright (C) 2003-2013 Mike Tyka and Jon Rea # # 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...
gpl-3.0
morreene/tradenews
venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py
490
4141
import calendar import time from email.utils import formatdate, parsedate, parsedate_tz from datetime import datetime, timedelta TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT" def expire_after(delta, date=None): date = date or datetime.now() return date + delta def datetime_to_header(dt): return formatdate(c...
bsd-3-clause
openstate/yournextrepresentative
candidates/tests/test_update_view.py
2
20073
from urlparse import urlsplit from mock import patch from django_webtest import WebTest from .auth import TestUserMixin from .helpers import equal_call_args from .fake_popit import ( FakePersonCollection, FakePostCollection, fake_mp_post_search_results ) example_timestamp = '2014-09-29T10:11:59.216159' example_...
agpl-3.0
brunogamacatao/portalsaladeaula
django/db/backends/sqlite3/introspection.py
88
5864
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict(object): # Maps SQL types t...
bsd-3-clause
talumbau/blaze
blaze/io/sql/tests/testutils.py
6
1040
from __future__ import print_function, division, absolute_import data = [ (4, "hello", 2.1), (8, "world", 4.2), (16, "!", 8.4), ] def create_sqlite_table(): import sqlite3 as db conn = db.connect(":memory:") c = conn.cursor() c.execute('''create table testtable (i INTEGER, msg ...
bsd-3-clause
276361270/sqlalchemy
test/orm/test_dynamic.py
25
29418
from sqlalchemy import testing, desc, select, func, exc, cast, Integer from sqlalchemy.orm import ( mapper, relationship, create_session, Query, attributes, exc as orm_exc, Session, backref, configure_mappers) from sqlalchemy.orm.dynamic import AppenderMixin from sqlalchemy.testing import ( AssertsCompiledS...
mit
einstein95/crunchy-xml-decoder
crunchy-xml-decoder/unidecode/x0b8.py
253
4714
data = ( 'reoss', # 0x00 'reong', # 0x01 'reoj', # 0x02 'reoc', # 0x03 'reok', # 0x04 'reot', # 0x05 'reop', # 0x06 'reoh', # 0x07 're', # 0x08 'reg', # 0x09 'regg', # 0x0a 'regs', # 0x0b 'ren', # 0x0c 'renj', # 0x0d 'renh', # 0x0e 'red', # 0x0f 'rel', # 0x10 'relg', ...
gpl-2.0
nnethercote/servo
components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py
170
1564
def WebIDLTest(parser, harness): threw = False try: parser.parse(""" interface VariadicConstraints1 { void foo(byte... arg1, byte arg2); }; """) results = parser.finish() except: threw = True harness.ok(threw, "Should...
mpl-2.0
tvalacarta/tvalacarta
python/main-classic/channels/dwspan.py
1
8418
# -*- coding: utf-8 -*- #------------------------------------------------------------------ # tvalacarta # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ #------------------------------------------------------------------ # Canal para "Deustche Welle en español", creado por rsantaella #---------------------------...
gpl-3.0
zarboz/Monarudo_M7_port
arm-cortex_a15-linux-gnueabi/share/gdb/python/gdb/printing.py
137
10191
# Pretty-printer utilities. # Copyright (C) 2010-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any l...
gpl-2.0
GeoCat/QGIS
python/plugins/processing/algs/qgis/DropMZValues.py
1
3225
# -*- coding: utf-8 -*- """ *************************************************************************** DropMZValues.py -------------- Date : July 2017 Copyright : (C) 2017 by Nyall Dawson Email : nyall dot dawson at gmail dot com **************************...
gpl-2.0
archen/django
django/contrib/gis/db/models/query.py
6
36358
from django.db import connections from django.db.models.query import QuerySet, ValuesQuerySet, ValuesListQuerySet from django.contrib.gis import memoryview from django.contrib.gis.db.models import aggregates from django.contrib.gis.db.models.fields import get_srid_info, PointField, LineStringField from django.contrib....
bsd-3-clause
hurricup/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/aggregates.py
309
1804
from django.db.models.sql.aggregates import * from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql.conversion import GeomField class GeoAggregate(Aggregate): # Default SQL template for spatial aggregates. sql_template = '%(function)s(%(field)s)' # Conversion ...
apache-2.0
Mauricio3000/maya_testing
lib/joints.py
1
1512
import pymel.core as pm import errors ''' Test methods for joints in Maya ''' def assertAimAxis(jnt=None, aim=None): '''Assert the given axis is the axis aiming at child nodes Attributes: jnt -- Joint in scene to check aim -- Character "x"|"y"|"z". Axis expected to aim at child ''' i...
gpl-3.0
caphrim007/ansible-modules-extras
cloud/google/gce_tag.py
53
6397
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
axiom-data-science/pyaxiom
pyaxiom/tests/dsg/profile/test_profile_im.py
1
1768
# -*- coding: utf-8 -*- import os import unittest from dateutil.parser import parse as dtparse import numpy as np from pyaxiom.netcdf.sensors.dsg import IncompleteMultidimensionalProfile import logging from pyaxiom import logger logger.level = logging.DEBUG logger.handlers = [logging.StreamHandler()] class TestInco...
mit
cmunk/protwis
alignment/functions.py
1
9498
""" A set of utility functions for alignment processing. """ import re from collections import OrderedDict from common import definitions from protein.models import Protein def strip_html_tags(text): """ Remove the html tags from a string. @param: text - string to clean up """ return re.sub('<.*?...
apache-2.0
Tokyo-Buffalo/tokyosouth
env/lib/python3.6/site-packages/twisted/plugins/twisted_reactors.py
1
1939
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import absolute_import, division from twisted.application.reactors import Reactor from twisted.python.compat import _PY3 default = Reactor( 'default', 'twisted.internet.default', 'A reasonable default: poll(2) if availabl...
mit
thefinn93/CouchPotatoServer
libs/werkzeug/security.py
75
4705
# -*- coding: utf-8 -*- """ werkzeug.security ~~~~~~~~~~~~~~~~~ Security related helpers such as secure password hashing tools. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import hmac import posixpath from iter...
gpl-3.0
openstack/horizon
horizon/__init__.py
7
2185
# Copyright 2012 Nebula, 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 agree...
apache-2.0
glwu/python-for-android
python-modules/twisted/twisted/words/test/test_msn.py
53
20437
# Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.words.protocols.msn}. """ # System imports import StringIO # Twisted imports # t.w.p.msn requires an HTTP client try: # So try to get one - do it directly instead of catching an ImportError # from ...
apache-2.0
ayoubg/gem5-graphics
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 ...
bsd-3-clause
r0qs/chubby
Fonte/Menu_example.py
1
1250
from Game import * from Menu import * def new_game_function(): game_main() def option_function(): main() def main(): width = 1024 height = 768 pygame.display.init menu_screen = pygame.display.set_mode((width,height)) # Background background = pygame.image.load(os.path.join('', 'images', 'menu_bg.jpg'...
gpl-3.0
prashantv/thrift
tutorial/py.tornado/PythonClient.py
68
3152
#!/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
zhujzhuo/Sahara
sahara/utils/openstack/heat.py
6
2155
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
nicky-ji/edx-nicky
lms/djangoapps/courseware/models.py
35
9221
""" WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py schemamigration courseware --auto description_of_your_change 3. Add the migration file created...
agpl-3.0
WangWenjun559/Weiss
summary/sumy/sklearn/metrics/pairwise.py
1
42672
# -*- coding: utf-8 -*- # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Robert Layton <robertlayton@gmail.com> # Andreas Mueller <amueller@ais.uni-bonn.de> # Philippe Gervais <philippe.gervais@inria.fr> # Lars Buitinck ...
apache-2.0
zottejos/merelcoin
qa/rpc-tests/bipdersig.py
136
3261
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test the BIP66 changeover logic # from test_framework import BitcoinTestFramework from bitcoinrpc.authpro...
mit
OpenRCE/sulley
sulley/sessions.py
1
48671
import os import re import sys import zlib import time import socket import httplib import cPickle import threading import BaseHTTPServer import httplib import logging import blocks import pedrpc import pgraph import sex import primitives ##############################################################################...
gpl-2.0
glorizen/nupic
nupic/regions/PictureSensorExplorers/inward.py
17
3835
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, 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
pdp10/sbpipe
tests/test_snake_copasi_pe.py
2
3261
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018 Piero Dalle Pezze # # 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 ...
mit
dsgouda/autorest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/Lro/fixtures/acceptancetestslro/models/resource.py
32
1506
# 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
bva24/smart
cartridge/shop/managers.py
5
7802
from __future__ import unicode_literals from future.builtins import str from future.builtins import zip from collections import defaultdict from datetime import datetime, timedelta from django.db.models import Manager, Q from django.utils.datastructures import SortedDict from django.utils.timezone import now from me...
bsd-2-clause
soarpenguin/ansible
lib/ansible/modules/web_infrastructure/ansible_tower/tower_project.py
9
7686
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017, Wayne Witzel III <wayne@riotousliving.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.0...
gpl-3.0
ctiller/grpc
tools/line_count/yaml2csv.py
8
1503
#!/usr/bin/env python # Copyright 2017 gRPC authors. # # 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
ZhaoCJ/django
django/db/migrations/graph.py
5
6308
from django.utils.datastructures import OrderedSet from django.db.migrations.state import ProjectState class MigrationGraph(object): """ Represents the digraph of all migrations in a project. Each migration is a node, and each dependency is an edge. There are no implicit dependencies between numbered...
bsd-3-clause
crazyyoung01/vv
vn.trader/vtServer.py
3
2942
# encoding: utf-8 import sys import os from datetime import datetime from time import sleep from threading import Thread import eventType from vnrpc import RpcServer from vtEngine import MainEngine ######################################################################## class VtServer(RpcServer): """vn.trader服...
mit
t3dev/odoo
addons/website_twitter/models/res_config_settings.py
13
4137
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import requests from odoo import api, fields, models, _ from odoo.exceptions import UserError _logger = logging.getLogger(__name__) TWITTER_EXCEPTION = { 304: _('There was no new data to return.'),...
gpl-3.0
ph1l/ocemr
ocemr/urls.py
1
10187
########################################################################## # # This file is part of OCEMR. # # OCEMR 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,...
gpl-3.0
aopp/android_kernel_asus_grouper
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
tfeagle/mitmproxy
examples/mitmproxywrapper.py
37
5810
#!/usr/bin/env python # # Helper tool to enable/disable OS X proxy and wrap mitmproxy # # Get usage information with: # # mitmproxywrapper.py -h # import subprocess import re import argparse import contextlib import os import sys class Wrapper(object): def __init__(self, port, extra_arguments=None): sel...
mit
fredkingham/blog-of-fred
django/contrib/gis/db/models/sql/query.py
379
5314
from django.db import connections from django.db.models.query import sql from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import aggregates as gis_aggregates from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField from django.contri...
bsd-3-clause
KohlsTechnology/ansible
lib/ansible/plugins/cache/mongodb.py
31
5534
# (c) 2018, Matt Martz <matt@sivel.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
xindus40223115/w17_test
static/Brython3.1.1-20150328-091302/Lib/xml/dom/pulldom.py
850
11761
import xml.sax import xml.sax.handler START_ELEMENT = "START_ELEMENT" END_ELEMENT = "END_ELEMENT" COMMENT = "COMMENT" START_DOCUMENT = "START_DOCUMENT" END_DOCUMENT = "END_DOCUMENT" PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION" IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE" CHARACTERS = "CHARACTERS" class PullDOM(...
gpl-3.0
cjaymes/pyscap
src/scap/model/oval_5/defs/windows/UserSidObjectElement.py
1
1032
# 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
alvaroaleman/ansible
lib/ansible/parsing/utils/addresses.py
123
8158
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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 ...
gpl-3.0
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/cloud/__init__.py
95
1145
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mit
uwdata/termite-stm
web2py/gluon/utf8.py
16
30039
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Created by Vladyslav Kozlovskyy (Ukraine) <dbdevelop©gmail.com> for Web2py project Utilities and cla...
bsd-3-clause
Cactuslegs/audacity-of-nope
lib-src/lv2/lv2/plugins/eg02-midigate.lv2/waflib/Tools/cs.py
133
4142
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib import Utils,Task,Options,Logs,Errors from waflib.TaskGen import before_method,after_method,feature from waflib.Tools import ccroot from waflib.Configure import co...
gpl-2.0
hakanozadam/bal
bal/umass_cluster/merge_bed_files.py
1
2886
#!/bin/env python3 # AUTHORS: # Hakan Ozadam # # Moore Laboratory # UMASS Medical School / HHMI # RNA Therapeutics Institute # Albert Sherman Center, ASC4-1009 # 368 Plantation Street # Worcester, MA 01605 # USA # #################################################...
gpl-2.0
slightperturbation/Cobalt
ext/emsdk_portable/emscripten/1.27.0/tools/settings_template_readonly.py
1
2171
# This file will be edited (the {{{ }}} things), and then ~/.emscripten created with the result, if ~/.emscripten doesn't exist. # Note: If you put paths relative to the home directory, do not forget os.path.expanduser import os # this helps projects using emscripten find it EMSCRIPTEN_ROOT = os.path.expanduser(os.g...
apache-2.0
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/celery/tests/test_concurrency/test_pool.py
14
2446
from __future__ import absolute_import import sys import time import logging import itertools from nose import SkipTest from celery.datastructures import ExceptionInfo from celery.tests.utils import Case def do_something(i): return i * i def long_something(): time.sleep(1) def raise_something(i): t...
mit
tralamazza/micropython
tests/float/float2int_fp30_intbig.py
30
2629
# check cases converting float to int, relying only on single precision float try: import ustruct as struct except: import struct import sys maxsize_bits = 0 maxsize = sys.maxsize while maxsize: maxsize >>= 1 maxsize_bits += 1 # work out configuration values is_64bit = maxsize_bits > 32 # 0 = none, 1...
mit