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 |
|---|---|---|---|---|---|
narfman0/challenges | codeeval/51/main.py | 1 | 1542 | #!/bin/python
""" Code challenge https://www.codeeval.com/open_challenges/51/
Description:
Credits: Programming Challenges by Steven S. Skiena and Miguel A. Revilla
You will be given the x/y co-ordinates of several locations. You will be laying
out 1 cable between two of these locations. In order to minimise the cost... | gpl-3.0 |
pytent/pytentd | tentd/tests/blueprints/test_posts.py | 1 | 3921 | """Tests for the entity blueprint"""
from flask import url_for, json, current_app
from py.test import mark, raises
from werkzeug.exceptions import NotFound
from tentd.documents.entity import Post
from tentd.lib.flask import jsonify
from tentd.tests import response_has_link_header
from tentd.tests.http import *
from t... | apache-2.0 |
cversek/python-FLI | src/FLI/camera.py | 1 | 10870 | """
FLI.camera.py
Object-oriented interface for handling FLI USB cameras
author: Craig Wm. Versek, Yankee Environmental Systems
author_email: cwv@yesinc.com
"""
__author__ = 'Craig Wm. Versek'
__date__ = '2012-08-08'
import sys, time, warnings, traceback
try:
from collections import OrderedDict
e... | mit |
Hellybean/android_kernel_samsung_jf | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
ytjiang/linux | scripts/rt-tester/rt-tester.py | 1106 | 5305 | #!/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 |
alisonjo2786/old-python-lessons-fork | section_05_(loops)/12days.py | 7 | 3104 |
# Twelve Days of Christmas, Python style
gifts = ["A partridge in a pear tree",
"Two turtle doves",
"Three french hens",
"Four colly birds",
"Five golden rings",
"Six geese-a-laying",
"Seven swans-a-swimming",
"Eight maids-a-milking",
"Nine ladie... | mit |
eLBati/server-tools | __unported__/fetchmail_attach_from_folder/match_algorithm/base.py | 9 | 1792 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
flacjacket/sympy | sympy/utilities/tests/test_codegen.py | 2 | 39069 | from StringIO import StringIO
from sympy.core import symbols, Eq, pi, Catalan, Lambda, Dummy
from sympy.utilities.codegen import CCodeGen, Routine, InputArgument, Result, \
CodeGenError, FCodeGen, codegen, CodeGenArgumentListError, OutputArgument, \
InOutArgument
from sympy.utilities.pytest import raises
from ... | bsd-3-clause |
franckverrot/live-note | waveapi/run_unit_tests.py | 9 | 1117 | #!/usr/bin/python
#
# Copyright (C) 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 required by applicable law ... | gpl-3.0 |
ifwe/wxpy | setup.py | 1 | 3061 | import os.path
import shutil
import sys
import genlisttypes
from wxpybuild.wxpyext import build_extension, WXWIN
wxpy_extra_sources = '''\
src/PythonUtils.cpp
'''.split()
wxpy_modules = [
('_wxcore', ['src/wx.sip'] + wxpy_extra_sources),
# TODO: use wxUSE_XXX flags
# ('_wxhtml', ['src/html.sip']... | mit |
arielmakestuff/loadlimit | test/unit/core/test_client.py | 1 | 4584 | # -*- coding: utf-8 -*-
# test/unit/core/test_client.py
# Copyright (C) 2016 authors and contributors (see AUTHORS file)
#
# This module is released under the MIT License.
"""Test client"""
# ============================================================================
# Imports
# =====================================... | mit |
proxysh/Safejumper-for-Mac | buildlinux/env32/lib/python2.7/site-packages/twisted/web/test/test_httpauth.py | 13 | 22702 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web._auth}.
"""
from __future__ import division, absolute_import
import base64
from zope.interface import implementer
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.pytho... | gpl-2.0 |
defance/edx-platform | common/test/acceptance/pages/lms/annotation_component.py | 159 | 3645 | """
Annotation Component Page.
"""
from bok_choy.page_object import PageObject
from selenium.webdriver import ActionChains
class AnnotationComponentPage(PageObject):
"""
View of annotation component page.
"""
url = None
active_problem = 0
def is_browser_on_page(self):
return self.q(c... | agpl-3.0 |
y12uc231/edx-platform | common/lib/xmodule/xmodule/discussion_module.py | 36 | 3231 | from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xmodule.editing_module import MetadataOnlyEditingDescriptor
from xblock.fields import String, Scope, UNIQUE_ID
from uuid import uuid4
# Make '_' a no-op so we can scrape strings
_ = lambda ... | agpl-3.0 |
rleigh-dundee/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/controller/__init__.py | 3 | 2074 | #!/usr/bin/env python
#
#
#
# Copyright (c) 2008-2011 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) an... | gpl-2.0 |
alirizakeles/zato | code/zato-common/src/zato/common/ipaddress_.py | 1 | 3762 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import itertools
from urlparse import urlparse
# ipaddress
from ipaddre... | gpl-3.0 |
kybriainfotech/iSocioCRM | addons/base_import_module/controllers/main.py | 354 | 1518 | # -*- coding: utf-8 -*-
import functools
import openerp
from openerp.http import Controller, route, request, Response
def webservice(f):
@functools.wraps(f)
def wrap(*args, **kw):
try:
return f(*args, **kw)
except Exception, e:
return Response(response=str(e), status=500... | agpl-3.0 |
hubsaysnuaa/odoo | doc/conf.py | 184 | 8222 | # -*- coding: utf-8 -*-
import sys, os
import sphinx
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
DIR = os.path.dirname(__file... | agpl-3.0 |
tedder/ansible | lib/ansible/modules/network/panos/panos_pg.py | 50 | 5869 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
JesseLivezey/plankton | pylearn2/packaged_dependencies/theano_linear/unshared_conv/localdot.py | 5 | 4839 | """
WRITEME
"""
import logging
from ..linear import LinearTransform
from .unshared_conv import FilterActs, ImgActs
from theano.compat.six.moves import xrange
from theano.sandbox import cuda
if cuda.cuda_available:
import gpu_unshared_conv # register optimizations
import numpy as np
try:
import matplotlib.pyp... | bsd-3-clause |
akalenuk/docadhoc | web/template.py | 66 | 49394 | """
simple, elegant templating
(part of web.py)
Template design:
Template string is split into tokens and the tokens are combined into nodes.
Parse tree is a nodelist. TextNode and ExpressionNode are simple nodes and
for-loop, if-loop etc are block nodes, which contain multiple child nodes.
Each node can emit som... | apache-2.0 |
dlazz/ansible | lib/ansible/modules/network/checkpoint/checkpoint_access_rule.py | 2 | 6809 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
52ai/django-ccsds | django/core/serializers/xml_serializer.py | 95 | 15035 | """
XML serializer.
"""
from __future__ import unicode_literals
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import base
from django.db import DEFAULT_DB_A... | bsd-3-clause |
vivekmishra1991/scikit-learn | sklearn/decomposition/dict_learning.py | 104 | 44632 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... | bsd-3-clause |
j-po/django-brambling | brambling/utils/payment.py | 1 | 10823 | import datetime
from decimal import Decimal, ROUND_DOWN
import urllib
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import timezone
from dwolla import constants, transactions, oauth, fundingsources
import stripe
TEST = 'test'
LIVE = 'live'
stripe.api_version = '2015-... | bsd-3-clause |
stackforge/cloudkitty | cloudkitty/rating/pyscripts/db/api.py | 1 | 2787 | # -*- coding: utf-8 -*-
# Copyright 2015 Objectif Libre
#
# 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 ... | apache-2.0 |
ofekd/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/echo_noext_wsh.py | 465 | 2404 | # Copyright 2013, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
Jhaefner/Cross-Flow-Pressure-Drop-Studies | TORCHE.py | 2 | 15932 | """
Date of last edit: August 13th, 2018
Author(s): Jonah Haefner* and Lane Carasik^
*Texas A&M University
*Thermal-hydraulics Research Group
^Ultra Safe Nuclear Corporation
^Advanced Systems Division
TOolbox for Reactor Cross-Flow Heat Exchangers:
Python Scripts for calculation of Pressure drop and Heat T... | mit |
comp-imaging/ProxImaL | proximal/algorithms/problem.py | 1 | 8584 | from . import admm
from . import pock_chambolle as pc
from . import half_quadratic_splitting as hqs
from . import linearized_admm as ladmm
from proximal.utils.utils import Impl, graph_visualize
from proximal.utils.cuda_codegen import PyCudaAdapter
from proximal.lin_ops import Variable, CompGraph, est_CompGraph_norm, vs... | mit |
rpedersen/GrovePi | Script/multi_grovepi_installer/grovepi5.py | 9 | 13286 | # grovepi.py
# v1.2.2
# This file provides the basic functions for using the GrovePi
#
# Karan Nayan
# Initial Date: 13 Feb 2014
# Last Updated: 22 Jan 2015
# http://www.dexterindustries.com/
#
# These files have been made available online through
# a Creative Commons Attribution-ShareAlike 3.0 license.
# (http://crea... | mit |
rbaindourov/v8-inspector | Source/chrome/tools/telemetry/telemetry/internal/actions/scroll_bounce.py | 19 | 4055 | # 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.
import os
from telemetry.internal.actions import page_action
class ScrollBounceAction(page_action.PageAction):
def __init__(self, selector=None, text=Non... | bsd-3-clause |
ABaldwinHunter/django-clone | django/db/backends/postgresql/operations.py | 149 | 10182 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... | bsd-3-clause |
WSDC-NITWarangal/django | django/contrib/postgres/forms/hstore.py | 313 | 1484 | import json
from django import forms
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStoreField']
class HStoreField(forms.CharField):
"""A field for HStore data which accepts JSON input."""
widget = forms.Te... | bsd-3-clause |
yildizberkay/MongoApp | libs/PIL/SgiImagePlugin.py | 42 | 2168 | #
# The Python Imaging Library.
# $Id$
#
# SGI image file handling
#
# See "The SGI Image File Format (Draft version 0.97)", Paul Haeberli.
# <ftp://ftp.sgi.com/graphics/SGIIMAGESPEC>
#
# History:
# 1995-09-10 fl Created
#
# Copyright (c) 2008 by Karsten Hiddemann.
# Copyright (c) 1997 by Secret Labs AB.
# Copyright ... | apache-2.0 |
zvolsky/muzika | languages/hi.py | 164 | 7445 | # coding: utf8
{
'!langcode!': 'hi-in',
'!langname!': 'हिन्दी',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%s %%{row} deleted': '%... | agpl-3.0 |
trabacus-softapps/docker-magicecommerce | additional_addons/attachment_large_object/ir_attachment.py | 3 | 5013 | # -*- coding: utf-8 -*-
import logging
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
logger = logging.getLogger(__name__)
LARGE_OBJECT_LOCATION = 'postgresql:lobject'
class IrAttachment(osv.Model):
"""Provide storage as PostgreSQL large objects of attachements with filestore location ``%r... | agpl-3.0 |
elena/django | django/db/backends/postgresql/creation.py | 27 | 3344 | import sys
from psycopg2 import errorcodes
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.backends.utils import strip_quotes
class DatabaseCreation(BaseDatabaseCreation):
def _quote_name(self, name):
return self.connection.ops.quote_name(name)
def _get_database_cr... | bsd-3-clause |
iemejia/incubator-beam | sdks/python/apache_beam/examples/wordcount_debugging_test.py | 3 | 2172 | #
# 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 |
cristiana214/cristianachavez214-cristianachavez | python-build/python-libs/gdata/src/gdata/tlslite/utils/Python_RSAKey.py | 239 | 7707 | """Pure-Python RSA implementation."""
from cryptomath import *
import xmltools
from ASN1Parser import ASN1Parser
from RSAKey import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0):
if (n and not e) or (e and not n):
raise AssertionError()
... | apache-2.0 |
DominoTree/servo | tests/wpt/web-platform-tests/tools/third_party/h2/test/test_head_request.py | 25 | 1727 | # -*- coding; utf-8 -*-
"""
test_head_request
~~~~~~~~~~~~~~~~~
"""
import h2.connection
import pytest
class TestHeadRequest(object):
example_request_headers = [
(b':authority', b'example.com'),
(b':path', b'/'),
(b':scheme', b'https'),
(b':method', b'HEAD'),
... | mpl-2.0 |
chasing0819/Sample_CPP_Cocos2dx | cocos2d/tools/gen-prebuilt/module_organize.py | 80 | 15591 | import os
import shutil
import json
import excopy
from argparse import ArgumentParser
class ModuleOrganizer(object):
CFG_FILE = "module_config.json"
KEY_MODULE_IS_COMPILED = "is_compiled"
KEY_MODULE_FROM_DIR = "from_dir"
KEY_MODULE_TARGET_DIR = "target_dir"
KEY_MODULE_INCLUDE = "include"
KEY... | mit |
beermix/letsencrypt | letsencrypt/tests/reverter_test.py | 23 | 18457 | """Test letsencrypt.reverter."""
import csv
import itertools
import logging
import os
import shutil
import tempfile
import unittest
import mock
from letsencrypt import errors
class ReverterCheckpointLocalTest(unittest.TestCase):
# pylint: disable=too-many-instance-attributes, too-many-public-methods
"""Test... | apache-2.0 |
mfx9/molaris-tools | MolarisTools/Scripts/PredictSimulationTime.py | 2 | 3171 | #-------------------------------------------------------------------------------
# . File : PredictSimulationTime.py
# . Program : MolarisTools
# . Copyright : USC, Mikolaj Feliks (2015-2018)
# . License : GNU GPL v3.0 (http://www.gnu.org/licenses/gpl-3.0.en.html)
#---------------------------------------... | gpl-3.0 |
seanbrady5535/jmagcoin2 | qa/rpc-tests/util.py | 27 | 4546 | #
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
from decimal import Decimal
import json
import shutil
import subprocess
import time
from bitcoinrpc.authprox... | mit |
inonit/wagtail | wagtail/wagtailadmin/views/pages.py | 1 | 30505 | from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.core.exceptions import PermissionDenied
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.t... | bsd-3-clause |
shub0/algorithm-data-structure | python/detec_cycle.py | 1 | 2155 | #! /usr/bin/python
'''
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
'''
from node_struct import ListNode
class Solution:
# @param head, a ListNode
# @return a boolean
def hasCycle(self, head):
"""
:type head: ListNode
:rtype: bool
... | bsd-3-clause |
ericmckean/jaikuengine | explore/tests.py | 30 | 2261 | # Copyright 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 required by applicable law or agreed to in writing, ... | apache-2.0 |
sugartom/tensorflow-alien | tensorflow/python/framework/graph_util.py | 133 | 1665 | # 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 |
sebrandon1/neutron | neutron/db/models/flavor.py | 3 | 2320 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
Pluto-tv/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/gpu_device_unittest.py | 26 | 1517 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.internal.platform import gpu_device
class TestGPUDevice(unittest.TestCase):
def testConstruction(self):
device = gpu_... | bsd-3-clause |
ovnicraft/edx-platform | lms/djangoapps/shoppingcart/processors/tests/test_CyberSource.py | 159 | 13163 | """
Tests for the CyberSource processor handler
"""
from collections import OrderedDict
from django.test import TestCase
from django.test.utils import override_settings
from django.conf import settings
from student.tests.factories import UserFactory
from shoppingcart.models import Order, OrderItem
from shoppingcart.pro... | agpl-3.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/google/cloud/resource_manager/client.py | 1 | 7106 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | mit |
haveal/googleads-python-lib | examples/dfp/v201505/activity_group_service/get_active_activity_groups.py | 4 | 2234 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
davislidaqing/Mcoderadius | toughradius/console/control/logquery.py | 5 | 1364 | #!/usr/bin/env python
# coding:utf-8
import sys, os
from twisted.internet import reactor
from bottle import Bottle
from bottle import request
from bottle import response
from bottle import redirect
from bottle import static_file
from bottle import abort
from hashlib import md5
from urlparse import urljoin
from toughrad... | agpl-3.0 |
andyaguiar/aiohttp | docs/conf.py | 15 | 10074 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# aiohttp documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 5 12:35:35 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | apache-2.0 |
virtualopensystems/nova | nova/virt/storage_users.py | 14 | 4609 | # Copyright 2012 Michael Still and Canonical 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 appl... | apache-2.0 |
creasyw/IMTAphy | documentation/doctools/converter/converter/util.py | 2 | 3086 | # -*- coding: utf-8 -*-
"""
Python documentation conversion utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007-2008 by Georg Brandl.
:license: BSD.
"""
import re
from docutils.nodes import make_id
from .docnodes import TextNode, EmptyNode, NodeList
def umlaut(cmd, c):
try:
if... | gpl-2.0 |
1flow/1flow | oneflow/core/stats.py | 2 | 19200 | # -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License... | agpl-3.0 |
daevaorn/sentry | src/sentry/migrations/0018_auto__chg_field_project_owner.py | 36 | 10398 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Project.owner'
db.alter_column('sentry_project', 'owner_id', self.gf('sentry.db.models.fields.Fl... | bsd-3-clause |
wattad169/sportbuddy_server | lib/django/db/backends/oracle/operations.py | 86 | 18396 | from __future__ import unicode_literals
import datetime
import re
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.backends.utils import truncate_name
from django.utils import six, timezone
from django.utils.encoding import force_bytes, ... | bsd-3-clause |
jacobmetrick/Flexget | flexget/plugins/modify/torrent.py | 4 | 4672 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import os
from flexget import plugin
from flexget.event import event
from flexget.utils.bittorrent import Torrent, is_torrent_file
log = logging.getLogger(... | mit |
mfraezz/osf.io | admin_tests/preprint_providers/test_views.py | 5 | 14271 | import pytest
import json
from io import StringIO
import mock
from nose import tools as nt
from django.test import RequestFactory
from django.core.files.uploadedfile import InMemoryUploadedFile
from scripts.update_taxonomies import update_taxonomies
from tests.base import AdminTestCase
from osf_tests.factories import... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/deployed_service_replica_info.py | 1 | 5136 | # 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 |
tectronics/open-ihm | src/openihm/data/report_settingsmanager.py | 1 | 13974 | #!/usr/bin/env python
"""
This file is part of open-ihm.
open-ihm 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.
open-ihm is di... | lgpl-3.0 |
snario/geopandas | geopandas/plotting.py | 2 | 9645 | from __future__ import print_function
import numpy as np
from six import next
from six.moves import xrange
def plot_polygon(ax, poly, facecolor='red', edgecolor='black', alpha=0.5):
""" Plot a single Polygon geometry """
from descartes.patch import PolygonPatch
a = np.asarray(poly.exterior)
# without... | bsd-3-clause |
berkeleydeeprlcourse/homework | hw4/half_cheetah_env.py | 1 | 2813 | import numpy as np
import tensorflow as tf
from gym import utils
from gym.envs.mujoco import mujoco_env
class HalfCheetahEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, 'half_cheetah.xml', 1)
utils.EzPickle.__init__(self)
def step(self, action... | mit |
lduarte1991/edx-platform | common/djangoapps/terrain/stubs/tests/test_xqueue_stub.py | 81 | 6098 | """
Unit tests for stub XQueue implementation.
"""
import mock
import unittest
import json
import requests
from ..xqueue import StubXQueueService
class FakeTimer(object):
"""
Fake timer implementation that executes immediately.
"""
def __init__(self, delay, func):
self.func = func
def st... | agpl-3.0 |
jerryyip/Smart_Decorative_Cloud | main.py | 1 | 1660 | #!/usr/bin/env python
import os
import signal
import time
from respeaker.bing_speech_api import BingSpeechAPI
from respeaker.microphone import Microphone
from respeaker.player import Player
from worker_weather import Worker
BING_KEY = '3560976f779d4095a7109bc55a3b0c79'
mic = Microphone()
bing = BingSpeechAPI(key=BI... | mit |
smartforceplus/SmartForceplus | openerp/addons/base/module/wizard/base_language_install.py | 447 | 2738 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
shirtsgroup/pygo | analysis/MBAR_foldingcurve_umbrella.py | 1 | 6397 | #!/usr/bin/python2.4
import sys
import numpy
import pymbar # for MBAR analysis
import timeseries # for timeseries analysis
import os
import os.path
import pdb # for debugging
from optparse import OptionParser
import MBAR_pmfQz
import wham
import MBAR_pmfQ
import cPickle
def parse_args():
parser=OptionParser()
... | gpl-2.0 |
oesteban/dipy | dipy/reconst/tests/test_dki.py | 3 | 4755 | """ Testing DKI """
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal
from dipy.sims.voxel import multi_tensor_dki
import dipy.reconst.dki as dki
from dipy.io.gradients import read_bvals_bvecs
from dipy.core.gradients import gr... | bsd-3-clause |
vbelakov/h2o | py/testdir_hosts/test_exec_import_hosts_bigfiles.py | 9 | 3605 | import unittest
import random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e
zeroList = [
'Result.hex = c(0)',
'Result0.hex = c(0)',
'Result1.hex = c(0)',
'Result2.hex = c(0)',
'Result3.hex = c(0)',
... | apache-2.0 |
rahul-c1/scikit-learn | benchmarks/bench_multilabel_metrics.py | 11 | 7258 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... | bsd-3-clause |
yourcelf/btb | scanblog/btb/tests/live/post_from_web_tests.py | 2 | 2026 | # -*- coding: utf-8 -*-
from .base import BtbLiveServerTestCase
class TestPostFromWeb(BtbLiveServerTestCase):
def _add_post(self, status):
self.selenium.get(self.url("/blogs/"))
self.selenium.find_element_by_link_text("✍ Compose").click()
self.css("#id_title").send_keys("My Title %s" % stat... | agpl-3.0 |
sestrella/ansible | lib/ansible/modules/network/check_point/cp_mgmt_service_tcp.py | 20 | 8737 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# 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 o... | gpl-3.0 |
pebble/pebble-tool | pebble_tool/commands/sdk/project/package.py | 2 | 2554 | # encoding: utf-8
from __future__ import absolute_import, print_function
import subprocess
from . import SDKProjectCommand
from pebble_tool.exceptions import ToolError
from pebble_tool.sdk.project import NpmProject
import pebble_tool.util.npm as npm
__author__ = "katharine"
class PackageManager(SDKProjectCommand):... | mit |
randynobx/ansible | lib/ansible/modules/cloud/amazon/lambda_alias.py | 77 | 12327 | #!/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 |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_internal/__init__.py | 5 | 2870 | #!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import warnings
import sys
# 2016-06-17 barry@debian.org: urllib3 1.14 added optional support for socks,
# but if invoked (i.e. imported), it will issue a warning to stderr if socks
# isn't available. requests uncond... | apache-2.0 |
llun/wordpress-authenticator | relay-bot/xrepeat.py | 1 | 2396 | import os,sys,xmpp
currentUser = None
xmppClient = None
nicks = {}
###### Bot Command
def commandNick():
pass
def commandHelp(client, user):
message = """
!help - See this menu.
!nick <new name> - Change nick name.
"""
client.send(xmpp.Message(user, message))
###### Bot Logic
def parseCommand(client, ... | mit |
miconof/headphones | lib/unidecode/x0fd.py | 252 | 3764 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... | gpl-3.0 |
exhibia/exhibia | include/addons/design_suite/js/html2image/node-v0.10.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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.
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | bsd-3-clause |
gerrive/horizon | openstack_dashboard/dashboards/project/volumes/backups/urls.py | 65 | 1043 | # 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
# distributed under t... | apache-2.0 |
Dennisparchkov/rumal | rumal/wsgi.py | 2 | 1156 | #!/usr/bin/env python
#
# wsgi.py
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; with... | gpl-2.0 |
freezmeinster/teh-manis | django/views/decorators/http.py | 151 | 7044 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from django.utils.decorators import decorator_from_middleware, available_attrs
... | bsd-3-clause |
bitesofcode/projexui | projexui/windows/xdkwindow/xdkitem.py | 2 | 12785 | #!/usr/bin/python
""" Creates reusable Qt window components. """
# define authorship information:
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software'
__license__ = 'LGPL'
# maintanence informati... | lgpl-3.0 |
ahb0327/intellij-community | python/helpers/pydev/pydev_monkey_qt.py | 47 | 5183 | from __future__ import nested_scopes
def set_trace_in_qt():
import pydevd_tracing
from pydevd_comm import GetGlobalDebugger
debugger = GetGlobalDebugger()
if debugger is not None:
pydevd_tracing.SetTrace(debugger.trace_dispatch)
_patched_qt = False
def patch_qt():
'''
... | apache-2.0 |
ubf/ubf | priv/python/pyubf.py | 3 | 1297 |
##
##
##
## UBF primitives:
##
## integer, float, atom, string, binary, tuple, record, list, proplist, term, void
##
def Integer(value):
assert isinstance(value, int) or isinstance(value, long)
return value
def Float(value):
assert isinstance(value, float)
return value
class Atom(str):
def __... | mit |
dntt1/youtube-dl | youtube_dl/extractor/r7.py | 19 | 4653 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import int_or_none
class R7IE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
(?:[a-zA-Z]+)\.r7\.com(?:/[^/]+)+/idmedia/|
... | unlicense |
gochist/horizon | openstack_dashboard/dashboards/admin/projects/panel.py | 19 | 1056 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
sathieu/samba | third_party/waf/wafadmin/Tools/gnome.py | 32 | 7744 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2008 (ita)
"Gnome support"
import os, re
import TaskGen, Utils, Runner, Task, Build, Options, Logs
import cc
from Logs import error
from TaskGen import taskgen, before, after, feature
n1_regexp = re.compile('<refentrytitle>(.*)</refentrytitle>', re.M)
n2_re... | gpl-3.0 |
baz1/PyDist | src/PyDist.py | 1 | 7286 | #!/usr/bin/env python
import modes
import GoogleMaps
import RATP
import time
import re
import sys
lastError = ""
unrecognizedAddresses = []
def getDist(mode, origins, destinations, timestamp = None, isArrivalTime = True,
googleApiKey = None, useSuggestions = True, optimistic = 0, avoidTolls = False,
useRATP ... | mit |
nitzmahone/ansible-modules-extras | network/citrix/netscaler.py | 143 | 5056 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage Citrix NetScaler entities
(c) 2013, Nandor Sivok <nandor@gawker.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 Softwa... | gpl-3.0 |
tsarnowski/hamster | src/hamster/external.py | 1 | 16420 | # - coding: utf-8 -
# Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org>
# Copyright (C) 2008, 2010 Toms Bauģis <toms.baugis at gmail.com>
# This file is part of Project Hamster.
# Project Hamster is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | gpl-3.0 |
ahmadiga/min_edx | cms/djangoapps/contentstore/course_info_model.py | 112 | 6790 | """
Views for viewing, adding, updating and deleting course updates.
Current db representation:
{
"_id" : locationjson,
"definition" : {
"data" : "<ol>[<li><h2>date</h2>content</li>]</ol>"},
"items" : [{"id": ID, "date": DATE, "content": CONTENT}]
"metadata" : ignored
}
}
"""
impor... | agpl-3.0 |
AngryBork/apex-sigma-plugins | games/fireemblemheroes/mech/scrappers/special_scrapper.py | 3 | 3231 | import json
class SpecialScrapper(object):
def __init__(self, scrapper_core):
self.scrapper = scrapper_core
self.specials = {}
async def scrap_data(self):
self.scrapper.log.info('Scrapping Specials...')
mega_query = [
'[[Category:Specials]]',
'|?name1',... | gpl-3.0 |
pombredanne/PyGithub | github/tests/AllTests.py | 2 | 3579 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
SmartInfrastructures/neutron | neutron/tests/functional/agent/linux/test_ovsdb_monitor.py | 4 | 4324 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
jcatw/deep_q_rl | deep_q_rl/launcher.py | 1 | 14655 | #! /usr/bin/env python
"""This script handles reading command line arguments and starting the
training process. It shouldn't be executed directly; it is used by
run_nips.py or run_nature.py.
"""
import os
import argparse
import logging
import ale_python_interface
import cPickle
import numpy as np
import theano
impor... | bsd-3-clause |
babble/babble | include/jython/Lib/test/Graph.py | 1 | 1996 | from java import awt
from math import *
from jarray import array
class Graph(awt.Canvas):
def __init__(self):
self.function = None
def paint(self, g):
if self.function is None:
return self.error(g)
sz = se... | apache-2.0 |
sergiohgz/incubator-airflow | airflow/lineage/__init__.py | 19 | 5067 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.