repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
woozzu/pylearn2
pylearn2/linear/linear_transform.py
49
1917
""" .. todo:: WRITEME """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" class LinearTransform(object): """ A generic class describ...
bsd-3-clause
jrief/django-websocket-redis
ws4redis/wsgi_server.py
2
8452
# -*- coding: utf-8 -*- import sys import logging import six from six.moves import http_client from redis import StrictRedis import django if django.VERSION[:2] >= (1, 7): django.setup() from django.conf import settings from django.contrib.auth import get_user from django.core.handlers.wsgi import WSGIRequest from...
mit
Ivoz/pipa
pipa/util.py
1
4565
import os import random import string from configparser import ConfigParser from hashlib import sha256 import cherrypy from cherrypy import Tool from cherrypy._cpcompat import ntob from cherrypy._cpreqbody import Part from cherrypy.lib import httputil defaults = """ [pipa] host = localhost port = 5351 key = server.k...
mit
ScholarTools/crossref_api_python
crossref/utils.py
1
3636
# -*- coding: utf-8 -*- """ #TODO: break out display utils to another module """ def display_class(class_instance,pv,method_pv=None): #TODO: Handle methods return ('%s:\n' % type(class_instance) + property_values_to_string(pv,extra_indentation=4)) def float_or_none_to_string(x): if ...
mit
deepsrijit1105/edx-platform
cms/lib/xblock/tagging/migrations/0001_initial.py
39
1187
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='TagAvailableValues', fields=[ ('id', models.Aut...
agpl-3.0
kr41/ggrc-core
src/ggrc_workflows/models/cycle_task_entry.py
7
1350
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """A module containing the workflow CycleTaskEntry model.""" from sqlalchemy.ext.hybrid import hybrid_property from ggrc import db from ggrc.models.mixins import Base, Described from ggrc.models.object_do...
apache-2.0
tensorflow/probability
tensorflow_probability/python/optimizer/convergence_criteria/convergence_criterion.py
1
6013
# Copyright 2019 The TensorFlow Probability 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
dpendl00/headphones
lib/unidecode/x0fe.py
252
3825
data = ( '[?]', # 0x00 '[?]', # 0x01 '[?]', # 0x02 '[?]', # 0x03 '[?]', # 0x04 '[?]', # 0x05 '[?]', # 0x06 '[?]', # 0x07 '[?]', # 0x08 '[?]', # 0x09 '[?]', # 0x0a '[?]', # 0x0b '[?]', # 0x0c '[?]', # 0x0d '[?]', # 0x0e '[?]', # 0x0f '[?]', # 0x10 '[?]', # 0x11 '[?]'...
gpl-3.0
sjohannes/exaile
xlgui/cover.py
2
39885
# Copyright (C) 2008-2010 Adam Olsen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that...
gpl-2.0
bigdatauniversity/edx-platform
lms/djangoapps/student_profile/test/test_views.py
113
3370
# -*- coding: utf-8 -*- """ Tests for student profile views. """ from django.conf import settings from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import RequestFactory from util.testing import UrlResetMixin from student.tests.factories import UserFactory from stu...
agpl-3.0
nathanial/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/auth/forms.py
44
8781
from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.template import Context, loader from django import forms from django.utils.translation import ugett...
gpl-3.0
hackerbot/DjangoDev
django/utils/cache.py
7
11184
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
bsd-3-clause
Snamint/tornado
tornado/log.py
45
10920
#!/usr/bin/env python # # Copyright 2012 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
xavierwu/scikit-learn
examples/cluster/plot_agglomerative_clustering.py
343
2931
""" Agglomerative clustering with and without structure =================================================== This example shows the effect of imposing a connectivity graph to capture local structure in the data. The graph is simply the graph of 20 nearest neighbors. Two consequences of imposing a connectivity can be s...
bsd-3-clause
mr-c/common-workflow-language
v1.0/salad/schema_salad/tests/test_errors.py
7
1436
from __future__ import absolute_import from __future__ import print_function from .util import get_data import unittest from schema_salad.schema import load_schema, load_and_validate from schema_salad.validate import ValidationException from avro.schema import Names import six class TestErrors(unittest.TestCase): ...
apache-2.0
bikong2/django
django/contrib/admin/sites.py
120
21146
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import NoRe...
bsd-3-clause
Bobeye/LinkMechanismStewartGouph
OFWTP/nxt/brick.py
21
6947
# nxt.brick module -- Classes to represent LEGO Mindstorms NXT bricks # Copyright (C) 2006 Douglas P Lau # Copyright (C) 2009 Marcus Wanner, rhn # Copyright (C) 2010 rhn, Marcus Wanner, zonedabone # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
gpl-3.0
AlexRobson/scikit-learn
sklearn/linear_model/coordinate_descent.py
37
74167
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Gael Varoquaux <gael.varoquaux@inria.fr> # # License: BSD 3 clause import sys import warnings from abc import ABCMeta, abstractmethod import n...
bsd-3-clause
wangjun/scrapy
tests/test_utils_deprecate.py
140
10526
# -*- coding: utf-8 -*- from __future__ import absolute_import import inspect import unittest import warnings from scrapy.exceptions import ScrapyDeprecationWarning from scrapy.utils.deprecate import create_deprecated_class, update_classpath from tests import mock class MyWarning(UserWarning): pass class SomeB...
bsd-3-clause
night-crawler/rfnumplan
admin.py
1
1304
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Operator, Region, NumberingPlan, NumberingPlanRange class OperatorAdmin(admin.ModelAdmin): list_display = ('id', 'name') search_fields = ('name',) admin.site.register(Operator, OperatorAdmin) class RegionAdmin(admin.ModelAdmin): ...
mit
krintoxi/NoobSec-Toolkit
NoobSecToolkit /scripts/sshbackdoors/backdoors/shell/pupy/pupy/packages/src/VideoCapture/src/mkdist.py
8
8852
version = '0.9-2' ############################################################################### print '- exportashtml' import os if os.name == 'nt': scite = r'C:\Programme\wscite\SciTE.exe' else: scite = '/iuehome/gritsch/bin/scite' file = 'VideoCapture.py' src = './' + file dest = '../html/' + file + '....
gpl-2.0
mferenca/HMS-ecommerce
ecommerce/extensions/api/v2/tests/views/test_courses.py
1
8632
from __future__ import unicode_literals import json import jwt import mock from django.conf import settings from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from oscar.core.loading import get_model, get_class from ecommerce.core.constants import ISO_8601_FORMAT from ecommer...
agpl-3.0
mihailignatenko/erp
addons/hw_escpos/escpos/escpos.py
65
31673
# -*- coding: utf-8 -*- import time import copy import io import base64 import math import md5 import re import traceback import xml.etree.ElementTree as ET import xml.dom.minidom as minidom from PIL import Image try: import jcconv except ImportError: jcconv = None try: import qrcode except ImportError...
agpl-3.0
molobrakos/home-assistant
homeassistant/components/homeassistant/scene.py
8
2923
"""Allow users to set and activate scenes.""" from collections import namedtuple import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_STATE, CONF_ENTITIES, CONF_NAME, CONF_PLATFORM, STATE_OFF, STATE_ON) from homeassistant.core import State import homeassistant.helpers.config_validat...
apache-2.0
jbornschein/y2k
show-layerwise.py
6
1957
#!/usr/bin/env python from __future__ import division import sys import logging from time import time import cPickle as pickle import numpy as np import h5py import pylab #import theano #import theano.tensor as T _logger = logging.getLogger() #===================================================================...
agpl-3.0
imgmix/django-avatar
avatar/south_migrations/0001_initial.py
4
4766
# -*- coding: utf-8 -*- from __future__ import unicode_literals from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Avatar' db.create_table('avatar_avatar', ( ...
bsd-3-clause
ellipsis14/dolfin-adjoint
timestepping/python/timestepping/fenics_overrides.py
1
8590
#!/usr/bin/env python2 # Copyright (C) 2011-2012 by Imperial College London # Copyright (C) 2013 University of Oxford # Copyright (C) 2014 University of Edinburgh # # This program 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...
lgpl-3.0
arne-cl/pattern
examples/05-vector/01-document.py
21
3205
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) import codecs from pattern.vector import Document, PORTER, LEMMA # A Document is a "bag-of-words" that splits a string into words and counts them. # A list of words or dictionary of (word, count)-items can also be given. # Words ...
bsd-3-clause
Huyuwei/tvm
topi/python/topi/testing/__init__.py
1
1285
"""TOPI Testing Util functions. Used to verify the correctness of operators in TOPI . """ from __future__ import absolute_import as _abs from .conv2d_hwcn_python import conv2d_hwcn_python from .conv2d_nchw_python import conv2d_nchw_python from .conv2d_nhwc_python import conv2d_nhwc_python from .conv2d_transpose_nchw_...
apache-2.0
Codophile1/exide
exide/beamer_parser.py
1
10947
#!/usr/bin/python #-*- coding: utf-8 -*- import re, os from datatypes.Section import Section from datatypes.Slide import Slide from datatypes.Presentation import Presentation from parser_utils import get_named_entities, get_urls, get_slide_type def parse_beamer(path): """ Transform a beamer tex file into a |...
lgpl-3.0
mwilliamson/mayo
mayo/git.py
1
1623
from .util import run class Git(object): name = "git" directory_name = ".git" default_branch = "origin/master" def clone(self, repository_uri, local_path): _git(["clone", repository_uri, local_path]) return GitRepository(local_path) def local_repo(self, working_direct...
bsd-2-clause
eestay/edx-platform
common/djangoapps/student/migrations/0036_access_roles_orgless.py
125
17964
# -*- coding: utf-8 -*- from south.v2 import DataMigration from xmodule.modulestore.django import modulestore import re from opaque_keys.edx.locations import SlashSeparatedCourseKey import logging from django.db.models.query_utils import Q from django.db.utils import IntegrityError from xmodule.modulestore import Modul...
agpl-3.0
Determinant/weaver
tests/static_partitioning/stream_partition.py
3
3924
#! /usr/bin/env python import sys import random import math from sets import Set # adds node attribute of which shard node should be placed on num_shards = 8 num_runs = 1 capacity = 84000/num_shards assignments = dict() shard_sizes = [0] * num_shards LDG = True G = {} def load(argv): assert(len(argv) == 2) p...
bsd-3-clause
wek32/strava-club-ytd
extract_group_members.py
1
1936
''' Strava club information is not publicly available. To get the club information the club owner needs to be logged in. This script takes the HTML file of the strava club page and extracts all the users/athletes. ''' from bs4 import BeautifulSoup import argparse def get_group_members_from_html(html_in): ...
mit
vinay-qa/vinayit-android-server-apk
py/test/selenium/webdriver/common/window_tests.py
7
1770
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 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 requir...
apache-2.0
rwakulszowa/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/etree.py
658
4613
from __future__ import absolute_import, division, unicode_literals try: from collections import OrderedDict except ImportError: try: from ordereddict import OrderedDict except ImportError: OrderedDict = dict import gettext _ = gettext.gettext import re from six import text_type from . im...
mpl-2.0
hieulq/pgscm
migrations/versions/5c3ebec69cdd_make_delete_modify_private.py
2
4999
"""make deleted_at and modify_info column to private property Revision ID: 5c3ebec69cdd Revises: ef552a46d4ff Create Date: 2017-07-26 21:28:30.229291 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = '5c3ebec69cdd' down_revisi...
apache-2.0
tunneln/CarnotKE
jyhton/out/production/jyhton/templates/java_lexer.py
19
9325
# copyright 2004-2005 Samuele Pedroni """ Java lexer """ import re import types class Token: def __init__(self,type,value=None): self.type = type self.value = value # self.infront_comments = [] self.attached_comments = [] def __repr__(self): return "%s(%r)" %...
apache-2.0
okwow123/djangol2
example/env/lib/python2.7/site-packages/allauth/socialaccount/providers/mailchimp/views.py
10
1132
"""Views for MailChimp API v3.""" import requests from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from .provider import MailChimpProvider class MailChimpOAuth2Adapter(OAuth2Adapter): """OAuth2Adapter for MailChimp API v3.""" prov...
mit
ej2/pixelpuncher
pixelpuncher/game/utils/skills.py
1
1870
from pixelpuncher.game.utils.message import add_game_message from pixelpuncher.game.utils.messages import learned_skill_message from pixelpuncher.player.models import PlayerSkill, Skill def add_starting_skills(player): skills = Skill.objects.filter(level=1) for skill in skills: create_player_skill(pl...
bsd-3-clause
virtualopensystems/neutron
neutron/api/v2/base.py
5
31187
# Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/django-0.96/django/core/handlers/wsgi.py
32
7022
from django.core.handlers.base import BaseHandler from django.core import signals from django.dispatch import dispatcher from django.utils import datastructures from django import http from pprint import pformat from shutil import copyfileobj try: from cStringIO import StringIO except ImportError: from StringIO...
lgpl-3.0
kalahbrown/HueBigSQL
desktop/core/ext-py/Django-1.6.10/tests/test_client/views.py
51
9661
from xml.dom.minidom import parseString from django.contrib.auth.decorators import login_required, permission_required from django.core import mail from django.forms import fields from django.forms.forms import Form, ValidationError from django.forms.formsets import formset_factory, BaseFormSet from django.http import...
apache-2.0
rven/odoo
addons/fleet/__manifest__.py
3
1513
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name' : 'Fleet', 'version' : '0.1', 'sequence': 185, 'category': 'Human Resources/Fleet', 'website' : 'https://www.odoo.com/page/fleet', 'summary' : 'Manage your fleet and track car costs', ...
agpl-3.0
odoo-turkiye/odoo
addons/procurement_jit_stock/procurement_jit_stock.py
44
1585
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2013 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
gautam1858/tensorflow
tensorflow/python/estimator/canned/linear.py
41
1278
# Copyright 2018 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
fjorba/invenio
modules/elmsubmit/lib/elmsubmit_config.py
35
4216
## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 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 option) any ...
gpl-2.0
cryptobanana/ansible
lib/ansible/modules/packaging/os/pkgin.py
13
11257
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com> # Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to> # Copyright (c) 2016 Jasper Lievisse Adriaanse <j at jasper.la> # # Written by Shaun Zinck # Based on pacman module written by Afterburn <http://github.com/...
gpl-3.0
gsutil-mirrors/pyasn1-modules
tools/snmpget.py
6
1444
#!/usr/bin/env python # # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # # Generate SNMPGET request, parse response # import socket import sys from pyasn1.codec.ber import decoder from pyasn1.codec.ber import en...
bsd-2-clause
neiljay/RIOT
tests/gnrc_sock_udp/tests/01-run.py
2
3192
#!/usr/bin/env python3 # Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys def testfunc(child): child.expect_exac...
lgpl-2.1
mahak/spark
examples/src/main/python/status_api_demo.py
26
2158
# # 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 us...
apache-2.0
nagyistoce/euca2ools
euca2ools/commands/autoscaling/updateautoscalinggroup.py
6
4140
# Copyright 2013 Eucalyptus Systems, Inc. # # Redistribution and use of this software 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 t...
bsd-2-clause
StealthMicro/OctoPi-Makerbot
env/Lib/site-packages/tornado/test/testing_test.py
7
2208
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import gen from tornado.testing import AsyncTestCase, gen_test from tornado.test.util import unittest class AsyncTestCaseTest(AsyncTestCase): def test_exception_in_callback(self): self.io_...
agpl-3.0
AlpacaDB/chainer
chainer/functions/math/batch_l2_norm_squared.py
4
1734
import numpy from chainer import cuda from chainer import function from chainer.utils import array from chainer.utils import type_check class BatchL2NormSquared(function.Function): def check_type_forward(self, in_types): type_check.expect(in_types.size() == 1) x_type, = in_types type_ch...
mit
andim27/magiccamp
build/lib/django/utils/tree.py
310
5778
""" A class for storing a tree graph. Primarily used for filter constructs in the ORM. """ from django.utils.copycompat import deepcopy class Node(object): """ A single internal node in the tree graph. A Node should be viewed as a connection (the root) with the children being either leaf nodes or other ...
bsd-3-clause
RichDijk/eXe
exe/webui/editorpane.py
1
19032
# =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # # 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...
gpl-2.0
sestrella/ansible
lib/ansible/modules/cloud/centurylink/clc_blueprint_package.py
21
10274
#!/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
veger/ansible
lib/ansible/modules/windows/win_pagefile.py
28
3980
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Liran Nisanov <lirannis@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata...
gpl-3.0
mathblogging/mathblogging
statsview.py
2
5717
from main import * class StatsViewBase(TemplatePage): def generateContent(self): output = [] output.append(""" <div class="tocbox"> <ul> <li><a href="/bystats" title="Recent stats">All</a> </li> <li><a href="/bystats-researchers" title="Recent stats for Researchers">Rese...
agpl-3.0
mloesch/tablib
tablib/packages/yaml3/constructor.py
83
25554
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor', 'ConstructorError'] from .error import * from .nodes import * import collections, datetime, base64, binascii, re, sys, types class ConstructorError(MarkedYAMLError): pass class BaseConstructor: yaml_constructors = {} yaml_multi_constr...
mit
DolphinDream/sverchok
nodes/curve/freecad_helix.py
2
3427
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE import bpy from bpy.props import F...
gpl-3.0
LatinuxSistemas/stock-logistics-warehouse
__unported__/stock_inventory_extended/__openerp__.py
10
1688
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
albertz/music-player
mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsxpcconnection.py
3
1584
from PyObjCTools.TestSupport import * import Foundation class XPCHelper (Foundation.NSObject): def remoteObjectProxyWithErrorHandler_(self, a): pass def listener_shouldAcceptNewConnection_(self, a, b): pass class TestNSXPCConnection (TestCase): @min_os_level('10.8') def testConstants10_8(self): ...
bsd-2-clause
akretion/odoo
addons/mrp/tests/test_stock.py
10
9525
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import common from odoo.exceptions import except_orm class TestWarehouse(common.TestMrpCommon): def setUp(self): super(TestWarehouse, self).setUp() self.stock_location = self.env.ref('stock....
agpl-3.0
infosec-au/CaptchaJackingPoC
failed_attempts/cjack_reddit_requests.py
3
4739
from random import choice import cherrypy import requests import re import os.path import cookielib import urllib import logging import mechanize from bs4 import BeautifulSoup import cStringIO ## Mechanize Approach! cj = cookielib.LWPCookieJar() br = mechanize.Browser() br.set_cookiejar(cj) br.set_handle_equiv(True) br...
mit
cpascal/af-cpp
apdos/exts/boost_1_53_0/tools/build/v2/test/library_chain.py
2
3602
#!/usr/bin/python # Copyright 2003, 2004, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test that a chain of libraries works ok, no matter if we use static or shared # linking. import ...
apache-2.0
gstarnberger/paasta
paasta_tools/am_i_mesos_leader.py
1
1039
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
apache-2.0
xcellerator/wifi_harvester
upload.py
1
1335
#!/usr/bin/python2.7 # Part of the WiFi Harvester project. # AUTHOR: Harvey Phillips # Project Home: https://github.com/xcellerator/wifi_harvester # Released under GPL v2 import csv import sys import requests if ( len(sys.argv) != 2 ): print ("Usage: " + str(sys.argv[0]) + " <kismet csv>") exit else: file = str(s...
gpl-2.0
couchbaselabs/couchbase-cli
collector.py
1
10474
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import traceback import copy import listservers import buckets import info import util_cli as util import cb_bin_client import stats_buffer class StatsCollector: def __init__(self, log): self.log = log def seg(self, k, v): # Parse ('some_...
apache-2.0
zmike/servo
tests/wpt/web-platform-tests/old-tests/webdriver/windows/window_manipulation.py
142
1556
# -*- mode: python; fill-column: 100; comment-column: 100; -*- import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions class WindowingTest(base_test.WebDriverBaseTest): def test_maximize(self): #sel...
mpl-2.0
Plexxi/st2
contrib/runners/orquesta_runner/setup.py
3
4346
# -*- coding: utf-8 -*- # Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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...
apache-2.0
jgliss/pyplis
pyplis/test/test_highlevel_examples.py
1
12011
# -*- coding: utf-8 -*- """Pyplis high level test module. This module contains some highlevel tests with the purpose to ensure basic functionality of the most important features for emission-rate analyses. Note ---- The module is based on the dataset "testdata_minimal" which can be found in the GitHub repo in the fol...
gpl-3.0
lepricon49/headphones
lib/unidecode/x0ad.py
253
4766
data = ( 'gwan', # 0x00 'gwanj', # 0x01 'gwanh', # 0x02 'gwad', # 0x03 'gwal', # 0x04 'gwalg', # 0x05 'gwalm', # 0x06 'gwalb', # 0x07 'gwals', # 0x08 'gwalt', # 0x09 'gwalp', # 0x0a 'gwalh', # 0x0b 'gwam', # 0x0c 'gwab', # 0x0d 'gwabs', # 0x0e 'gwas', # 0x0f 'gwass', #...
gpl-3.0
edevil/django
django/contrib/postgres/fields/hstore.py
14
4495
import json from django.contrib.postgres import forms from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, Lookup, Transform, TextField from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
bsd-3-clause
allenlavoie/tensorflow
tensorflow/contrib/specs/python/__init__.py
43
1255
# 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 applicable ...
apache-2.0
youprofit/django-cms
cms/models/placeholderpluginmodel.py
49
1244
# -*- coding: utf-8 -*- from cms.models import CMSPlugin from cms.models.fields import PlaceholderField from cms.utils.copy_plugins import copy_plugins_to from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class PlaceholderReference(CMSPlugin): ...
bsd-3-clause
webprogrammingunpas/pemogramanweb-theme
master/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/tools/pretty_sln.py
1831
5099
#!/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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
apache-2.0
Bysmyyr/chromium-crosswalk
third_party/closure_linter/closure_linter/javascriptstatetracker_test.py
127
7517
#!/usr/bin/env python # # Copyright 2012 The Closure Linter 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 # #...
bsd-3-clause
kohnle-lernmodule/KITexe201based
exe/engine/version.py
2
2041
#!/usr/bin/python # =========================================================================== # eXe # Copyright 2004-2006 University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General P...
gpl-2.0
ibushong/test-repo
flask_admin/contrib/pymongo/filters.py
7
2535
import re from flask.ext.admin.babel import gettext from flask.ext.admin.model import filters from .tools import parse_like_term class BasePyMongoFilter(filters.BaseFilter): """ Base pymongo filter. """ def __init__(self, column, name, options=None, data_type=None): """ Const...
bsd-3-clause
ariloulaleelay/wrflow
wrflow/model/dag.py
1
4111
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, DateTime, Integer, Boolean from sqlalchemy import orm from json import loads as json_loads from json import dumps as json_dumps from wrflow.common import hash_dict, hash_list Base = declarative_base() __all__ = [ 'Node...
gpl-2.0
ntts-clo/mld-ryu
ryu/services/protocols/bgp/bgp_sample_conf.py
3
3176
import os # ============================================================================= # BGP configuration. # ============================================================================= BGP = { # General BGP configuration. 'routing': { # ASN for this BGP instance. 'local_as': 64512, ...
apache-2.0
evensonbryan/yocto-autobuilder
lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/names/srvconnect.py
7
7383
# -*- test-case-name: twisted.names.test.test_srvconnect -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import random from zope.interface import implements from twisted.internet import error, interfaces from twisted.names import client, dns from twisted.names.error import DNSNameError f...
gpl-2.0
oihane/odoo
addons/pad/pad.py
84
4296
# -*- coding: utf-8 -*- from openerp.osv import fields, osv import random import re import string import urllib2 import logging from openerp import SUPERUSER_ID from openerp.tools.translate import _ from openerp.tools import html2plaintext from py_etherpad import EtherpadLiteClient _logger = logging.getLogger(__name__...
agpl-3.0
pcmoritz/arrow
cpp/src/arrow/dbi/hiveserver2/thrift/generate_error_codes.py
12
11132
#!/usr/bin/env python # Copyright 2015 Cloudera 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 ag...
apache-2.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/tools/json_schema_compiler/cpp_util_test.py
96
2096
#!/usr/bin/env python # 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. import unittest from cpp_util import ( Classname, CloseNamespace, GenerateIfndefName, OpenNamespace) class CppUtilTest(unitte...
mit
lebabouin/CouchPotatoServer-develop
libs/sqlalchemy/orm/persistence.py
18
30463
# orm/persistence.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """private module containing functions used to emit INSERT, UPDATE and DELETE state...
gpl-3.0
haripradhan/MissionPlanner
Lib/site-packages/numpy/oldnumeric/random_array.py
87
11454
# Backward compatible module for RandomArray __all__ = ['ArgumentError','F','beta','binomial','chi_square', 'exponential', 'gamma', 'get_seed', 'mean_var_test', 'multinomial', 'multivariate_normal', 'negative_binomial', 'noncentral_F', 'noncentral_chi_square', 'normal', 'permutation', ...
gpl-3.0
lmprice/ansible
lib/ansible/modules/network/aruba/aruba_command.py
102
6777
#!/usr/bin/python # # Copyright: Ansible Team # 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
CyanogenMod/android_kernel_htc_enrc2b
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
haxwithaxe/supybot
plugins/Karma/test.py
14
9913
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
bsd-3-clause
dancingdan/tensorflow
tensorflow/python/util/nest.py
6
30946
# 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
shantanu561993/volatility
volatility/plugins/overlays/windows/xp_sp2_x86_syscalls.py
58
34509
# Volatility # Copyright (c) 2008-2013 Volatility Foundation # Copyright (c) 2011 Michael Hale Ligh <michael.hale@gmail.com> # # This file is part of Volatility. # # Volatility 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 Softw...
gpl-2.0
dkodnik/Ant
openerp/addons/base_quality_interrogation.py
58
14692
#!/usr/bin/env python # -*- coding: 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 ...
agpl-3.0
FernanOrtega/DAT210x
Module3/notes/2Dscatter_example.py
1
1245
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Jul 11 21:14:57 2017 @author: fernando """ import pandas as pd import matplotlib import matplotlib.pyplot as plt plt.style.use('ggplot') df = pd.read_csv('concrete.csv') print df.describe() # Plot 1 df.plot.scatter(x='cement', y='strength') plt.s...
mit
sunu/oppia
extensions/interactions/InteractiveMap/InteractiveMap.py
5
2011
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
yati-sagade/RyDyrect
django/db/models/related.py
231
3157
from django.utils.encoding import smart_unicode from django.db.models.fields import BLANK_CHOICE_DASH class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def templ...
bsd-3-clause
Jionglun/-w16b_test
static/Brython3.1.3-20150514-095342/Lib/multiprocessing/util.py
696
9917
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
agpl-3.0
andrewz1/kernel.tf300tg
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
40223222/40223222
gear.py
204
19237
#@+leo-ver=5-thin #@+node:office.20150407074720.1: * @file gear.py #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:office.20150407074720.2: ** <<declarations>> (application) #@@language python import cherrypy import os import sys # 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite # 導入 pybean 模組與所要使用的 Store 及 S...
gpl-3.0