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
inspyration/house_booking
booking.py
4
11851
# -*- coding: utf-8 -*- from openerp.osv import fields, osv from openerp.tools.translate import _ import operator class Booking(osv.Model): """Main model""" _name = "house_booking.booking" _description = "booking" _inherit = ['mail.thread'] _states = [ ('pending', "Pending"), ...
agpl-3.0
laumann/servo
tests/wpt/css-tests/tools/pywebsocket/src/example/echo_client.py
442
44484
#!/usr/bin/env python # # Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mpl-2.0
lucasb-eyer/pydensecrf
tests/issue26.py
2
2130
# coding: utf-8 # In[1]: # import sys # sys.path.insert(0,'/home/dlr16/Applications/anaconda2/envs/PyDenseCRF/lib/python2.7/site-packages') # In[2]: import numpy as np import matplotlib.pyplot as plt # get_ipython().magic(u'matplotlib inline') plt.rcParams['figure.figsize'] = (20, 20) plt.rcParams['image.interpol...
mit
MypaceEngine/ifttt-line
libs/requests/packages/urllib3/util/retry.py
198
9981
from __future__ import absolute_import import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. ...
apache-2.0
chepazzo/ansible-modules-extras
monitoring/datadog_event.py
76
5388
#!/usr/bin/python # -*- coding: utf-8 -*- # # Author: Artūras 'arturaz' Šlajus <x11@arturaz.net> # # This module is proudly sponsored by iGeolise (www.igeolise.com) and # Tiny Lab Productions (www.tinylabproductions.com). # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modi...
gpl-3.0
trevor/calendarserver
contrib/performance/benchlib.py
1
6872
## # Copyright (c) 2010-2014 Apple 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 applicab...
apache-2.0
Endika/odoomrp-wip
base_partner_references/__openerp__.py
27
1618
# -*- encoding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
mattstep/ansible
lib/ansible/inventory/host.py
15
3750
# (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
HackBulgaria/Odin
forum/migrations/0001_initial.py
1
1586
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.AutoField(ver...
agpl-3.0
ShingYang/pefile
peutils.py
4
18239
# -*- coding: Latin-1 -*- """peutils, Portable Executable utilities module Copyright (c) 2005-2013 Ero Carrera <ero.carrera@gmail.com> All rights reserved. For detailed copyright information see the file COPYING in the root of the distribution archive. """ from __future__ import division from future import standard...
mit
piffey/ansible
lib/ansible/modules/network/avi/avi_cloudconnectoruser.py
41
4186
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
gpl-3.0
JohanComparat/nbody-npt-functions
bin/bin_onePT/simulation_vs_data_plot.py
1
7351
import astropy.units as uu import astropy.cosmology as co aa = co.Planck13 import math as m from scipy.integrate import quad import os aah = co.FlatLambdaCDM(H0=100.0 *uu.km / (uu.Mpc *uu.s), Om0=0.307, Tcmb0=2.725 *uu.K, Neff=3.05, m_nu=[ 0. , 0. , 0.06]*uu.eV, Ob0=0.0483) rhom0 = aah.critical_density0.to(uu.solM...
cc0-1.0
hobbyjobs/photivo
scons-local-2.2.0/SCons/Tool/mslib.py
14
2255
"""SCons.Tool.mslib Tool-specific initialization for lib (MicroSoft library archiver). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, ...
gpl-3.0
xzzy/statdev
applications/management/commands/generate_test_users.py
4
6548
from django.contrib.auth.models import Group from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model from mixer.backend.django import mixer import logging logger = logging.getLogger('statdev') User = get_user_model() class Command(BaseCommand): help = 'Create Test users...
apache-2.0
tdjordan/tortoisegit
gitgtk/datamine.py
1
25938
# # Data Mining dialog for TortoiseHg and Mercurial # # Copyright (C) 2008 Steve Borho <steve@borho.org> import pygtk pygtk.require('2.0') import gtk import gobject import os import pango import Queue import re import threading, thread2 import time from mercurial import hg, ui, util, revlog from hglib import hgcmd_toq...
gpl-2.0
Giovanni21M/Text-Playing-Game
base.py
1
15226
from sys import exit from random import randint from time import sleep class Engine: def __init__(self, scene_map): self.scene_map = scene_map def play(self): current_scene = self.scene_map.opening_scene() last_scene = self.scene_map.next_scene('death') while current_scene !...
mit
iulian787/spack
lib/spack/spack/test/spec_syntax.py
2
29060
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import pytest import shlex import llnl.util.filesystem as fs import spack.hash_types as ht import spack.repo i...
lgpl-2.1
stratus-ss/python_scripts
archive/warfile_deployment/deploy_commands.py
1
7371
import os import time import subprocess class CurlWarfile: def __init__(self, server_name, warfile_location, **tomcat_information): self.predeployed_warfile_hashes = [] deployment_path = "path=/%s" % warfile_location.split("/")[-1].replace("#", "/").replace(".war", "") warfile_name = depl...
lgpl-3.0
bsmedberg/socorro
alembic/versions/3a5471a358bf_adding_a_migration_f.py
11
1623
"""Adding a migration for the exploitability report. Revision ID: 3a5471a358bf Revises: 191d0453cc07 Create Date: 2013-10-25 07:07:33.968691 """ # revision identifiers, used by Alembic. revision = '3a5471a358bf' down_revision = '4aacaea3eb48' from alembic import op from socorro.lib import citexttype, jsontype from ...
mpl-2.0
albertomurillo/ansible
lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py
75
6902
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
trenshy/repo
plugin.video.armagedomfilmes/mechanize/_mozillacookiejar.py
149
6321
"""Mozilla / Netscape cookie loading / saving. Copyright 2002-2006 John J Lee <jjl@pobox.com> Copyright 1997-1999 Gisle Aas (original libwww-perl code) This code is free software; you can redistribute it and/or modify it under the terms of the BSD or ZPL 2.1 licenses (see the file COPYING.txt included with the distri...
gpl-2.0
ProjectCalla/SomeCrawler
somecrawler/crawler/crawl/OsirisResults.py
1
1777
__author__ = 'j' from somecrawler.config import OsirisConfig, LinkConfig, XpathConfig as xpathConf from lxml import etree from somecrawler.crawler.crawl import Base class OsirisResultsProducer(Base.BaseProducer): name = OsirisConfig.PRODUCER_NAME user = None browser = None def __init__(self, user, se...
gpl-3.0
rzarzynski/tempest
tempest/api/volume/test_snapshot_metadata.py
1
4473
# Copyright 2013 Huawei Technologies Co.,LTD # 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 # # Unle...
apache-2.0
marcinn/midicontrol
midicontrol/controller.py
1
2888
import os from subprocess import Popen, PIPE from .events import ( EventsManager, Event, EV_KEYUP, EV_KEYDOWN, EV_SLIDE) from .utils import debug from . import x11 class Controller(object): def __init__(self, target_window_name=None): self.target_window_name = target_window_name d...
bsd-3-clause
Jobava/pootle
docs/server/apache-wsgi.py
7
1406
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import site import sys # You probably will need to change these paths to match your deployment, # most likely because of the Python version you are using. ALLDIRS = [ '/var/www/pootle/env/lib/python2.7/site-packages', '/var/www/pootle/env/lib/python2.7/...
gpl-3.0
SlimRemix/android_external_chromium_org
tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/smoke.py
34
2466
# Copyright 2014 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SmokePage(page_module.Page): def __init__(se...
bsd-3-clause
mikebrevard/UnixAdministration
vagrant/etc/data/genData/venv/lib/python3.4/site-packages/setuptools/command/upload_docs.py
390
6782
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError from distutils.command.upload import upload import os import s...
mit
Changaco/oh-mainline
vendor/packages/PyYaml/tests/lib3/test_resolver.py
62
3298
import yaml import pprint def test_implicit_resolver(data_filename, detect_filename, verbose=False): correct_tag = None node = None try: correct_tag = open(detect_filename, 'r').read().strip() node = yaml.compose(open(data_filename, 'rb')) assert isinstance(node, yaml.SequenceNode)...
agpl-3.0
rismalrv/edx-platform
common/lib/capa/capa/tests/__init__.py
129
2700
"""Tools for helping with testing capa.""" import gettext import os import os.path import fs.osfs from capa.capa_problem import LoncapaProblem, LoncapaSystem from capa.inputtypes import Status from mock import Mock, MagicMock import xml.sax.saxutils as saxutils TEST_DIR = os.path.dirname(os.path.realpath(__file__)...
agpl-3.0
nerdymcnerdyson/pythonPlay
converter/TweeUtilities/Nodes/LinkNode.py
1
1431
#from . import NodeBase #from . import NodeRegExes from TweeUtilities.Nodes import * import logging class LinkNode(NodeBase.SequenceNode): def __init__(self, target, delay, text): self.type = NodeBase.SequenceNodeType.link self.target = target self.delay = delay self.text = ...
apache-2.0
guaka/trust-metrics
examples/dataset_all_methods.py
1
3434
""" Create a network and call all its method on it. """ # make sure example can be run from examples/ directory # import sys # sys.path.append('../trustlet') from trustlet import * def call_all_methods(N): """Call a bunch of methods of the network.""" def call_methods(method_names): """Helper, ...
gpl-2.0
ssssam/rdflib
rdflib/plugins/parsers/pyRdfa/transform/__init__.py
23
4436
# -*- coding: utf-8 -*- """ Transformer sub-package for the pyRdfa package. It contains modules with transformer functions; each may be invoked by pyRdfa to transform the dom tree before the "real" RDfa processing. @summary: RDFa Transformer package @requires: U{RDFLib package<http://rdflib.net>} @organization: U{Worl...
bsd-3-clause
bcwaldon/changeling
changeling/storage.py
1
2662
import json import boto.s3.connection import changeling.exception class S3Storage(object): def __init__(self, access, secret, bucket): self.access_key = access self.secret_key = secret self.bucket_name = bucket self._connection = None def initialize(self): #NOTE(bcw...
apache-2.0
open-synergy/opnsynid-accounting-report
opnsynid_income_statement_aeroo_report/wizards/wizard_income_statement.py
1
2705
# -*- coding: utf-8 -*- # Copyright 2015 OpenSynergy Indonesia # Copyright 2020 PT. Simetri Sinergi Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api, osv from openerp.tools.translate import _ class WizardIncomeStatement(models.TransientModel): _name...
agpl-3.0
kived/py4a-updater
pyupdater/client.py
3
1455
from kivy.clock import Clock from kivy.event import EventDispatcher from kivy.lib import osc from kivy.properties import StringProperty, AliasProperty from pyupdater import CLIENT_PORT, SERVICE_PORT, MESSAGE_UPDATE_AVAILABLE, MESSAGE_DO_UPDATE, MESSAGE_CHECK_FOR_UPDATE, \ SERVICE_PATH from pyupdater.util import get_cu...
mit
Zanzibar82/streamondemand.test
channels/casacinema.py
1
4138
# -*- coding: utf-8 -*- #------------------------------------------------------------ # streamondemand.- XBMC Plugin # Canal para casacinema # http://blog.tvalacarta.info/plugin-xbmc/streamondemand. #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from core...
gpl-3.0
OpenCMISS/neon
src/opencmiss/neon/ui/problems/biomeng321lab1.py
3
2054
''' Copyright 2015 University of Auckland 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 agre...
apache-2.0
anirudhjayaraman/scikit-learn
sklearn/metrics/tests/test_score_objects.py
138
14048
import pickle import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.testing import assert_true from sklearn.utils.testing im...
bsd-3-clause
YYWen0o0/python-frame-django
tests/http_utils/tests.py
33
2235
from __future__ import unicode_literals import io import gzip from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.http.utils import conditional_content_removal from django.test import TestCase # based on Python 3.3's gzip.compress def gzip_compress(data): buf = io.BytesIO() ...
bsd-3-clause
joseguerrero/sembrando
src/presentacion/librerias/contenido.py
1
14608
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Este archivo contiene un diccionario de el contenido del recurso y un diccionario con las definiciones utilizadas por el glosario de términos """ cont = { "texto3_2":u"Las plantas como todos los seres vivos realizan funciones de crecimiento, alimentación, respir...
gpl-3.0
Kazade/NeHe-Website
google_appengine/lib/django-1.2/django/contrib/localflavor/id/forms.py
311
6834
""" ID-specific Form helpers """ import re import time from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, Select from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode postcode_re = re.compil...
bsd-3-clause
mconlon17/vivo-1.5-improvement
tools/test_find_person.py
2
1130
""" test_find_person.py -- from a ufid dictionary, find the ufid and return the URI of the person. Version 0.1 MC 2013-12-28 -- Initial version. Make a dictionary and make a dictionary with debug=True Version 0.2 MC 2014-08-30 -- PEP 8, support for vivopeople """ __author__ = "Micha...
bsd-3-clause
ToxicFrog/lancow
madcow/modules/djmemebot.py
3
4591
"""Watch URLs in channel, punish people for living under a rock""" import random import sys import re import os from madcow.conf import settings from madcow.util import Module from madcow.util.text import encode, decode DEFAULT_INSULTS = ['OLD MEME ALERT!', 'omg, SO OLD!', 'Welc...
gpl-3.0
fernandezcuesta/ansible
lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py
18
15963
#!/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
crossroadchurch/paul
tests/interfaces/openlp_core_ui/test_servicemanager.py
1
19346
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
foss-transportationmodeling/rettina-server
flask/lib/python2.7/ntpath.py
127
18457
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames """Common pathname manipulations, WindowsNT/95 version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import sys import stat import genericpath import warnings from genericpath import * __all__ ...
apache-2.0
jelly/calibre
src/calibre/utils/text2int.py
1
2235
#!/usr/bin/env python2 __author__ = "stackoverflow community" __docformat__ = 'restructuredtext en' """ Takes english numeric words and converts them to integers. Returns False if the word isn't a number. implementation courtesy of the stackoverflow community: http://stackoverflow.com/questions/493174/is-there-a-way-...
gpl-3.0
dirtycold/git-cola
extras/qtpy/qtpy/_patch/qcombobox.py
3
4140
# The code below, as well as the associated test were adapted from # qt-helpers, which was released under a 3-Clause BSD license: # # Copyright (c) 2015, Chris Beaumont and Thomas Robitaille # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
gpl-2.0
ganugapav/pipe
setup.py
4
1923
# -*- coding: utf-8 -*- import sys import re from os import path as p try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages def read(filename, parent=None): parent = (parent or __file__) try: with open(p.join(p.dirname(parent),...
gpl-2.0
linked67/p2pool-phicoin
SOAPpy/Config.py
289
7622
""" ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provid...
gpl-3.0
acuros/heking
jinja2/tests.py
638
3444
# -*- coding: utf-8 -*- """ jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, mappi...
apache-2.0
ekwoodrich/nirha
nirhalib/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
714
4741
# urllib3/contrib/ntlmpool.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
apache-2.0
qtekfun/htcDesire820Kernel
external/chromium_org/tools/deep_memory_profiler/dmprof.py
93
2471
# Copyright (c) 2012 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. """The Deep Memory Profiler analyzer script. See http://dev.chromium.org/developers/deep-memory-profiler for details. """ import logging import sys fr...
gpl-2.0
isyippee/nova
nova/api/openstack/compute/legacy_v2/servers.py
4
48830
# Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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.apach...
apache-2.0
kartikgupta0909/build-mozharness
scripts/sourcetool.py
11
7615
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # 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/. # ***** END LICENSE BLOCK ***** """sourcetool.py Port of tools/b...
mpl-2.0
feroda/odoo
addons/document/test_cindex.py
444
1553
#!/usr/bin/python import sys import os import glob import time import logging from optparse import OptionParser logging.basicConfig(level=logging.DEBUG) parser = OptionParser() parser.add_option("-q", "--quiet", action="store_false", dest="verbose", default=True, help="don't prin...
agpl-3.0
hryamzik/ansible
lib/ansible/plugins/lookup/redis.py
38
3102
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com> # (c) 2017 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 DOCUMENTATION = """ lookup: redis author: - Jan-P...
gpl-3.0
cloudcopy/seahub
seahub/forms.py
2
7725
# encoding: utf-8 from django.conf import settings from django import forms from django.utils.translation import ugettext_lazy as _ from seaserv import seafserv_threaded_rpc, is_valid_filename from pysearpc import SearpcError from seahub.base.accounts import User from seahub.constants import DEFAULT_USER, GUEST_USER ...
apache-2.0
n0trax/ansible
lib/ansible/modules/network/aci/aci_epg.py
22
6341
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
egustafson/sandbox
Python/grpc-basic/client.py
1
1047
#!/bin/env python from __future__ import print_function import logging import grpc from demo import demo_pb2 from demo import demo_pb2_grpc def run(): with grpc.insecure_channel('localhost:50051') as channel: stub = demo_pb2_grpc.DemoServiceStub(channel) for ii in range(2) : ## Req / ...
apache-2.0
jcsp/manila
manila/api/contrib/share_actions.py
4
7415
# Copyright 2013 NetApp. # # 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 w...
apache-2.0
tiagochiavericosta/edx-platform
lms/djangoapps/instructor_analytics/distributions.py
174
5760
""" Profile Distributions Aggregate sums for values of fields in students profiles. For example: The distribution in a course for gender might look like: 'gender': { 'type': 'EASY_CHOICE', 'data': { 'no_data': 1234, 'm': 5678, 'o': 2134, 'f': 5678 }, 'display_names': { ...
agpl-3.0
JoaoVasques/aws-devtool
eb/macosx/python3/lib/aws/requests/packages/chardet/gb2312freq.py
323
36001
######################## 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...
apache-2.0
jean/sentry
src/sentry/rules/conditions/event_attribute.py
2
7365
""" sentry.rules.conditions.tagged_event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import json from collections import OrderedDict from django import forms ...
bsd-3-clause
TheTimmy/spack
var/spack/repos/builtin/packages/namd/package.py
3
5455
############################################################################## # 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
ArvinPan/opencog
opencog/nlp/anaphora/agents/testingAgent.py
12
1525
from __future__ import print_function from pprint import pprint from pln.examples.deduction import deduction_agent from opencog.atomspace import types, AtomSpace, TruthValue from hobbs import HobbsAgent from dumpAgent import dumpAgent from opencog.scheme_wrapper import load_scm,scheme_eval_h, __init__ __author__ = 'H...
agpl-3.0
zhouzhenghui/python-for-android
python-modules/twisted/twisted/python/procutils.py
61
1380
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Utilities for dealing with processes. """ import os def which(name, flags=os.X_OK): """Search PATH for executable files with the given name. On newer versions of MS-Windows, the PATHEXT environment variable will be ...
apache-2.0
SeaFalcon/Musicool_Pr
lib/werkzeug/routing.py
72
61818
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
apache-2.0
toomoresuch/pysonengine
eggs/ipython-0.10.1-py2.6.egg/IPython/kernel/core/message_cache.py
7
2531
# encoding: utf-8 """Storage for the responses from the interpreter.""" __docformat__ = "restructuredtext en" #------------------------------------------------------------------------------- # Copyright (C) 2008 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is ...
mit
chris-chris/tensorflow
tensorflow/contrib/layers/python/layers/utils.py
71
10875
# Copyright 2015 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
Reat0ide/plugin.video.pelisalacarta
lib/elementtree/SgmlopXMLTreeBuilder.py
107
3209
# # ElementTree # $Id$ # # A simple XML tree builder, based on the sgmlop library. # # Note that this version does not support namespaces. This may be # changed in future versions. # # history: # 2004-03-28 fl created # # Copyright (c) 1999-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # ht...
gpl-3.0
maohongyuan/kbengine
kbe/res/scripts/common/Lib/os.py
83
33763
r"""OS routines for NT or Posix depending on what system we're on. This exports: - all functions from posix, nt or ce, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix', 'nt' or 'ce'. - os.curdir is a string representing the current directory ('.' or ':') - os.pardir...
lgpl-3.0
asen6/amartyasenguptadotcom
django/core/handlers/base.py
55
11479
import sys from django import http from django.core import signals from django.utils.encoding import force_unicode from django.utils.importlib import import_module from django.utils.log import getLogger logger = getLogger('django.request') class BaseHandler(object): # Changes that are always applied to a respon...
bsd-3-clause
sivel/ansible-modules-extras
cloud/amazon/ecs_task.py
23
11892
#!/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
glwu/python-for-android
python3-alpha/extra_modules/gdata/tlslite/utils/jython_compat.py
46
5352
"""Miscellaneous functions to mask Python/Jython differences.""" import os import sha if os.name != "java": BaseException = Exception from sets import Set import array import math def createByteArraySequence(seq): return array.array('B', seq) def createByteArrayZeros(howMany): ...
apache-2.0
PhenomanSolutions/formula1
node_modules/node-gyp/gyp/pylib/gyp/input.py
578
116086
# 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
mit
caktus/django-timepiece
timepiece/entries/admin.py
3
2057
from django.contrib import admin from timepiece.entries.models import ( Activity, ActivityGroup, Entry, Location, ProjectHours) class ActivityAdmin(admin.ModelAdmin): model = Activity list_display = ('code', 'name', 'billable') list_filter = ('billable',) class ActivityGroupAdmin(admin.ModelAdmin):...
mit
rsivapr/scikit-learn
examples/applications/plot_species_distribution_modeling.py
7
7404
""" ============================= Species distribution modeling ============================= Modeling species' geographic distributions is an important problem in conservation biology. In this example we model the geographic distribution of two south american mammals given past observations and 14 environmental varia...
bsd-3-clause
wuga214/Django-Wuga
env/lib/python2.7/site-packages/django/core/management/commands/loaddata.py
67
13922
from __future__ import unicode_literals import glob import gzip import os import warnings import zipfile from itertools import product from django.apps import apps from django.conf import settings from django.core import serializers from django.core.exceptions import ImproperlyConfigured from django.core.management.b...
apache-2.0
richardnpaul/FWL-Website
lib/python2.7/site-packages/psycopg2/tests/test_types_basic.py
30
16842
#!/usr/bin/env python # # types_basic.py - tests for basic types conversions # # Copyright (C) 2004-2010 Federico Di Gregorio <fog@debian.org> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundatio...
gpl-3.0
enng0227/masterfirefoxos
masterfirefoxos/base/helpers.py
2
1808
import os from datetime import datetime from django.conf import settings from django.contrib.staticfiles.templatetags.staticfiles import static as static_helper from django.utils.translation import activate as dj_activate, get_language from feincms.module.medialibrary.models import MediaFile from feincms.templatetags...
mpl-2.0
wfxiang08/green
green/test/test_suite.py
2
2328
from __future__ import unicode_literals from __future__ import print_function import copy import unittest try: from unittest.mock import MagicMock except: from mock import MagicMock from green.suite import GreenTestSuite from green.config import default_args class TestGreenTestSuite(unittest.TestCase): ...
mit
asnir/airflow
airflow/security/kerberos.py
22
4527
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
Netflix-Skunkworks/cloudaux
cloudaux/tests/cloudaux/test_cloudaux.py
1
1193
""" .. module: cloudaux.tests.cloudaux.test_cloudaux :platform: Unix :copyright: (c) 2019 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Patrick Kelley <patrickk@23andme.com> """ from cloudaux import CloudAux def test_cloudaux(): conn_one = { ...
apache-2.0
EvanK/ansible
lib/ansible/plugins/lookup/dnstxt.py
57
2685
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com> # (c) 2017 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 DOCUMENTATION = """ lookup: dnstxt author: Jan-Piet Men...
gpl-3.0
grlee77/pywt
pywt/_cwt.py
3
7713
from math import floor, ceil from ._extensions._pywt import (DiscreteContinuousWavelet, ContinuousWavelet, Wavelet, _check_dtype) from ._functions import integrate_wavelet, scale2frequency __all__ = ["cwt"] import numpy as np try: # Prefer scipy.fft (new in SciPy 1.4) impor...
mit
timokoola/finnkinotxt
docutils/readers/standalone.py
197
2340
# $Id: standalone.py 4802 2006-11-12 18:02:17Z goodger $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Standalone file Reader for the reStructuredText markup syntax. """ __docformat__ = 'reStructuredText' import sys from docutils import frontend, rea...
apache-2.0
Zac-HD/home-assistant
homeassistant/components/switch/__init__.py
3
5364
""" Component to interface with various switches that can be controlled remotely. For more details about this component, please refer to the documentation at https://home-assistant.io/components/switch/ """ import asyncio from datetime import timedelta import logging import os import voluptuous as vol from homeassis...
apache-2.0
IV-GII/SocialCookies
ENV1/lib/python2.7/site-packages/django/contrib/admin/templatetags/admin_list.py
105
16417
from __future__ import unicode_literals import datetime from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.util import (lookup_field, display_for_field, display_for_value, label_for_field) from django.contrib.admin.views.main import (ALL_VAR, EMPTY_CHANGELIST_...
gpl-2.0
lokirius/python-for-android
python3-alpha/extra_modules/pyxmpp2/mainloop/wait.py
46
2081
# # (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful...
apache-2.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/sympy/plotting/plot_axes.py
4
8243
from pyglet.gl import * from pyglet import font from plot_object import PlotObject from util import strided_range, billboard_matrix from util import get_direction_vectors from util import dot_product, vec_sub, vec_mag from sympy.core import S from sympy.core.compatibility import is_sequence class PlotAxes(PlotObject)...
agpl-3.0
uruz/django-rest-framework
tests/test_middleware.py
79
1134
from django.conf.urls import url from django.contrib.auth.models import User from rest_framework.authentication import TokenAuthentication from rest_framework.authtoken.models import Token from rest_framework.test import APITestCase from rest_framework.views import APIView urlpatterns = [ url(r'^$', APIView.as_v...
bsd-2-clause
z0by/django
tests/postgres_tests/test_json.py
284
7890
import datetime import unittest from django.core import exceptions, serializers from django.db import connection from django.test import TestCase from . import PostgreSQLTestCase from .models import JSONModel try: from django.contrib.postgres import forms from django.contrib.postgres.fields import JSONField ...
bsd-3-clause
RudolfCardinal/crate
crate_anon/crateweb/core/constants.py
1
2396
#!/usr/bin/env python """ crate_anon/crateweb/core/constants.py =============================================================================== Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of CRATE. CRATE is free software: you can redistribute it and/or modify it un...
gpl-3.0
casanovainformationservices/LazyLibrarian
cherrypy/tutorial/tut10_http_errors.py
7
2705
""" Tutorial: HTTP errors HTTPError is used to return an error response to the client. CherryPy has lots of options regarding how such errors are logged, displayed, and formatted. """ import os localDir = os.path.dirname(__file__) curpath = os.path.normpath(os.path.join(os.getcwd(), localDir)) import cherrypy cl...
gpl-3.0
ibyer/xhtml2pdf
xhtml2pdf/parser.py
3
25074
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
tudorvio/tempest
tempest/api/image/v2/test_images_tags_negative.py
17
1823
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software #...
apache-2.0
caisq/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/generator_io.py
39
5651
# 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
Hellowlol/plexpy
lib/unidecode/x0c4.py
253
5024
data = ( 'sswals', # 0x00 'sswalt', # 0x01 'sswalp', # 0x02 'sswalh', # 0x03 'sswam', # 0x04 'sswab', # 0x05 'sswabs', # 0x06 'sswas', # 0x07 'sswass', # 0x08 'sswang', # 0x09 'sswaj', # 0x0a 'sswac', # 0x0b 'sswak', # 0x0c 'sswat', # 0x0d 'sswap', # 0x0e 'sswah', # 0x0f ...
gpl-3.0
lepistone/stock-logistics-workflow
__unported__/stock_picking_invoice_link/stock.py
7
4287
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
agpl-3.0