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 |
|---|---|---|---|---|---|
papouso/odoo | openerp/service/report.py | 324 | 5148 | # -*- coding: utf-8 -*-
import base64
import logging
import sys
import threading
import openerp
import openerp.report
from openerp import tools
import security
_logger = logging.getLogger(__name__)
# TODO: set a maximum report number per user to avoid DOS attacks
#
# Report state:
# False -> True
self_reports... | agpl-3.0 |
gef756/statsmodels | statsmodels/nonparametric/tests/test_kernel_regression.py | 27 | 13609 | import numpy as np
import numpy.testing as npt
import numpy.testing.decorators as dec
import statsmodels.api as sm
nparam = sm.nonparametric
class MyTest(object):
def setUp(self):
nobs = 60
np.random.seed(123456)
self.o = np.random.binomial(2, 0.7, size=(nobs, 1))
self.o2 = np.ran... | bsd-3-clause |
malaclypse2/seraphim | seraphim/characters/models.py | 1 | 1268 | from django.db import models
from django.core.urlresolvers import reverse
# Create your models here.
class CharacterIcon(models.Model):
url = models.CharField(max_length=200)
name = models.CharField(max_length=50)
sort_key = models.IntegerField(default=999)
def __str__(self):
return '[{self.sor... | mit |
wakiyamap/electrum-mona | electrum_mona/transaction.py | 1 | 87902 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | mit |
marziyeah/Medhacks_admin | starter/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
SlimRemix/android_external_chromium_org | tools/telemetry/telemetry/unittest/system_stub.py | 25 | 8257 | # Copyright 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.
"""Provides stubs for os, sys and subprocess for testing
This test allows one to test code that itself uses os, sys, and subprocess.
"""
import os
import r... | bsd-3-clause |
initNirvana/Easyphotos | env/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py | 1009 | 2281 | import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_boundary.
"""
return uuid4().hex... | mit |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/crcmod/python3/crcmod/test.py | 34 | 18433 | #-----------------------------------------------------------------------------
# Copyright (c) 2010 Raymond L. Buvel
# Copyright (c) 2010 Craig McQueen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in ... | bsd-3-clause |
idovear/odoo | addons/account_budget/report/analytic_account_budget_report.py | 360 | 7589 | # -*- 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 |
vericred/vericred-python | vericred_client/models/aca_plan_pre2018_search_result.py | 1 | 92329 | # coding: utf-8
"""
Vericred API
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.
## Getting Started
Visit our [Developer Portal](https://developers.vericred.com) to
create an account.
Once you have created an account, you can create one Application for
Production and an... | apache-2.0 |
tywtyw2002/CMPUT391 | trunk/wtforms/i18n.py | 52 | 2063 | import os
def messages_path():
"""
Determine the path to the 'messages' directory as best possible.
"""
module_path = os.path.abspath(__file__)
return os.path.join(os.path.dirname(module_path), 'locale')
def get_builtin_gnu_translations(languages=None):
"""
Get a gettext.GNUTranslations ... | apache-2.0 |
awemulya/fieldsight-kobocat | onadata/apps/fieldsight/mixins.py | 1 | 17259 | from functools import wraps
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse_lazy
from django.http import JsonResponse
from django.views.generic.edit import UpdateView as BaseUpdateView, CreateView as BaseCreateView, DeleteView as BaseDeleteView
from django.contrib import messag... | bsd-2-clause |
grueni75/GeoDiscoverer | Source/Platform/Target/Android/core/src/main/jni/gdal-3.2.1/scripts/fix_container_dot_size_zero.py | 1 | 5819 | #!/usr/bin/env python
###############################################################################
# $Id: fix_container_dot_size_zero.py 54587021942e38164ce1cd8009e74933fd328f38 2018-04-18 03:01:56 +1000 Ben Elliston $
#
# Project: GDAL samples
# Purpose: Replace container.size() by !container.empty(), and rever... | gpl-3.0 |
SaintDrage/eve-wspace | evewspace/SiteTracker/views.py | 13 | 8870 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | gpl-3.0 |
yannrouillard/weboob | modules/orange/browser.py | 4 | 2286 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Nicolas Duhamel
#
# This file is part of weboob.
#
# weboob 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 yo... | agpl-3.0 |
BillKeenan/lets-encrypt-preview | letsencrypt/tests/log_test.py | 23 | 1708 | """Tests for letsencrypt.log."""
import logging
import unittest
import mock
class DialogHandlerTest(unittest.TestCase):
def setUp(self):
self.d = mock.MagicMock()
from letsencrypt.log import DialogHandler
self.handler = DialogHandler(height=2, width=6, d=self.d)
self.handler.PAD... | apache-2.0 |
couchbasedeps/git-repo | subcmds/smartsync.py | 3 | 1050 | # -*- coding:utf-8 -*-
#
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | apache-2.0 |
pandeyadarsh/sympy | sympy/physics/optics/tests/test_waves.py | 76 | 1699 | from sympy import (symbols, Symbol, pi, sqrt, cos, sin, Derivative,
Function, simplify, I, atan2)
from sympy.abc import epsilon, mu
from sympy.functions.elementary.exponential import exp
from sympy.physics.units import c, m, s
from sympy.physics.optics import TWave
def test_twave():
A1, phi1, A2, phi2, f = sy... | bsd-3-clause |
alvin319/CarnotKE | jyhton/Lib/tempfile.py | 17 | 18817 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | apache-2.0 |
Distrotech/glibc | benchtests/scripts/import_bench.py | 5 | 4322 | #!/usr/bin/python
# Copyright (C) 2015-2016 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library 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 Foundation; either
# versio... | gpl-2.0 |
akhmadMizkat/odoo | addons/base_import/__openerp__.py | 7 | 1154 | {
'name': 'Base import',
'description': """
New extensible file import for Odoo
======================================
Re-implement openerp's file import system:
* Server side, the previous system forces most of the logic into the
client which duplicates the effort (between clients), makes the
import syst... | gpl-3.0 |
disko/modoboa-admin | modoboa_admin/forms/forward.py | 2 | 1580 | """Forms related to forwards management."""
from django import forms
from django.utils.translation import ugettext as _, ugettext_lazy
from modoboa.lib.email_utils import split_mailbox
from modoboa.lib.exceptions import BadRequest, PermDeniedException
from ..models import Domain
class ForwardForm(forms.Form):
... | mit |
sorenk/ansible | lib/ansible/plugins/cliconf/ios.py | 4 | 3144 | #
# (c) 2017 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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
FireCARES/firecares | firecares/firecares_core/migrations/0001_initial.py | 5 | 2028 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import django.contrib.gis.db.models.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Address'... | mit |
psa-lab/siteinterlock | scripts/proflex_bondviz.py | 1 | 2268 | # Sebastian Raschka 2016
#
# `siteinterlock` is a Python package for selecting near-native protein-ligand
# docking poses based upon the hypothesis that interfacial rigidification
# of both the protein and ligand prove to be important characteristics of
# the native binding mode and are sensitive to the spatial couplin... | gpl-3.0 |
bkahlert/seqan-research | raw/workshop13/workshop2013-data-20130926/trunk/misc/add_include.py | 14 | 3326 | #!/usr/bin/env python2.5
"""DDDoc Helper Script -- add includes.
Called the path to the SeqAn checkout, this tool will search for all
SeqAn header files. Within each file, it will look for all
Metafunction, Function, Tag, Class and Specialization dddoc
documentation. For each of documentation comment, it will add th... | mit |
denisff/python-for-android | python-build/python-libs/gdata/src/gdata/Crypto/Util/test.py | 228 | 18297 | #
# test.py : Functions used for testing the modules
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitn... | apache-2.0 |
dreamsxin/kbengine | kbe/src/lib/python/Lib/test/test_asyncio/test_windows_utils.py | 60 | 5801 | """Tests for window_utils"""
import socket
import sys
import test.support
import unittest
from test.support import IPV6_ENABLED
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _winapi
from asyncio import windows_utils
from asyncio import _overlapped
class W... | lgpl-3.0 |
Dino0631/RedRain-Bot | lib/pip/_vendor/requests/status_codes.py | 481 | 3316 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... | gpl-3.0 |
phihag/youtube-dl | youtube_dl/extractor/niconico.py | 6 | 18635 | # coding: utf-8
from __future__ import unicode_literals
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
from ..utils import (
determine_ext,
dict_get,
ExtractorError,
int_or_none,
float_or_none,
parse_duration,
... | unlicense |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/django/contrib/auth/middleware.py | 49 | 5868 | from django.conf import settings
from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.deprecation import MiddlewareMixin
from django.utils.functional import Simple... | bsd-2-clause |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/conch/ttymodes.py | 82 | 2239 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
import tty
# this module was autogenerated.
VINTR = 1
VQUIT = 2
VERASE = 3
VKILL = 4
VEOF = 5
VEOL = 6
VEOL2 = 7
VSTART = 8
VSTOP = 9
VSUSP = 10
VDSUSP = 11
VREPRINT = 12
VWERASE = 13
VLNEXT = 14
VFLUSH = 15
VSWTCH = 16
VSTATUS = 17
VDISCARD ... | gpl-2.0 |
moonlightly/kernel_htc_qsd8k | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
libcrosswind/libcrosswind | platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/curses/ascii.py | 396 | 2607 | """Constants and membership tests for ASCII characters"""
NUL = 0x00 # ^@
SOH = 0x01 # ^A
STX = 0x02 # ^B
ETX = 0x03 # ^C
EOT = 0x04 # ^D
ENQ = 0x05 # ^E
ACK = 0x06 # ^F
BEL = 0x07 # ^G
BS = 0x08 # ^H
TAB = 0x09 # ^I
HT = 0x09 # ^I
LF = 0x0a # ^J
NL =... | gpl-3.0 |
ichbestimmtnicht/NOOBS | config/sense-hat/Battleships/end_animation.py | 2 | 7183 | from sense_hat import SenseHat
import time
sh=SenseHat()
FRAMES = [
[[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [255, 128, 0], [0, 0, 0], [0, 0, 0], [0, 0... | gpl-2.0 |
mapeveri/django-endless-pagination-vue | endless_pagination/tests/templatetags/test_endless.py | 9 | 23968 | """Endless template tags tests."""
from __future__ import unicode_literals
import string
import sys
import xml.etree.ElementTree as etree
from django.template import (
Context,
Template,
TemplateSyntaxError,
)
from django.test import TestCase
from django.test.client import RequestFactory
from django.utils... | mit |
YuxuanLing/trunk | trunk/code/study/python/Fluent-Python-example-code/13-op-overloading/vector_v7.py | 1 | 9933 | """
A multi-dimensional ``Vector`` class, take 7: operator ``*``
A ``Vector`` is built from an iterable of numbers::
>>> Vector([3.1, 4.2])
Vector([3.1, 4.2])
>>> Vector((3, 4, 5))
Vector([3.0, 4.0, 5.0])
>>> Vector(range(10))
Vector([0.0, 1.0, 2.0, 3.0, 4.0, ...])
Tests with 2-... | gpl-3.0 |
ashcoding/titanium_mobile | apidoc/generators/jsca_generator.py | 31 | 13433 | #!/usr/bin/env python
#
# Copyright (c) 2010-2012 Appcelerator, Inc. All Rights Reserved.
# Licensed under the Apache Public License (version 2)
import os, sys, re
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.abspath(os.path.join(this_dir, "..")))
from common import dict_has_non_empt... | apache-2.0 |
ajgallegog/gem5_arm | src/python/m5/__init__.py | 52 | 2220 | # Copyright (c) 2005 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
hellais/PyRT | parse.py | 1 | 3749 | #! /usr/bin/env python
## PyRT: Python Routeing Toolkit
## Demonstrates how to use MRTd module to parse dumps.
## Copyright (C) 2001 Richard Mortier <mort@sprintlabs.com>, Sprint ATL
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General ... | gpl-2.0 |
ppokah0111/userinfuser | serverside/fantasm/config.py | 24 | 25625 | """ Fantasm: A taskqueue-based Finite State Machine for App Engine Python
Docs and examples: http://code.google.com/p/fantasm/
Copyright 2010 VendAsta Technologies 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 ob... | gpl-3.0 |
ormnv/os_final_project | django/contrib/auth/tests/views.py | 12 | 24891 | import os
import re
from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse, NoReverseMatch
fr... | bsd-3-clause |
hwroitzsch/BikersLifeSaver | lib/python3.5/site-packages/numpy/linalg/setup.py | 129 | 1892 | from __future__ import division, print_function
import os
import sys
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('linalg', parent_package, top_path)
config.add_data_dir(... | mit |
ardsu/bitcoin | qa/rpc-tests/keypool.py | 74 | 4117 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the wallet keypool, and interaction with wallet encryption/locking
# Add python-bitcoinrpc to modu... | mit |
robertbreker/xen-api | scripts/link-vms-by-sr.py | 29 | 2836 | #!/usr/bin/python
# Populate a directory of symlinks partitioning VMs by SR
# (c) Anil Madhavapeddy, Citrix Systems Inc, 2008
import atexit
import XenAPI
import os, sys
import getopt
def logout():
try:
session.xenapi.session.logout()
except:
pass
atexit.register(logout)
def usage():
print... | lgpl-2.1 |
lnielsen/invenio | invenio/modules/bulletin/format_elements/bfe_webjournal_archive.py | 4 | 6242 | # -*- coding: utf-8 -*-
## $Id: bfe_webjournal_CERN_Bulletin_Archive.py,v 1.8 2008/06/03 09:12:18 jerome Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## p... | gpl-2.0 |
fuzeman/PyUPnP | pyupnp/event.py | 1 | 4930 | # PyUPnP - Simple Python UPnP device library built in Twisted
# Copyright (C) 2013 Dean Gardiner <gardiner91@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | gpl-3.0 |
sfrenza/test-for-bot | venv/Lib/site-packages/setuptools/site-patch.py | 356 | 2307 | def __boot():
import sys
import os
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys, 'path_importer_cache', {})
stdpath = sys.pat... | mit |
developersociety/django-glitter | glitter/blocks/carousel/models.py | 2 | 1929 | from django.db import models
from glitter.assets.fields import AssetForeignKey
from glitter.fields import LinkField
from glitter.models import BaseBlock
class BaseCarousel(models.Model):
title = models.CharField(max_length=100, db_index=True)
class Meta:
abstract = True
ordering = ('title',)... | bsd-3-clause |
DanteOnline/free-art | venv/lib/python3.4/site-packages/django/contrib/postgres/forms/array.py | 84 | 6754 | import copy
from django import forms
from django.contrib.postgres.validators import (
ArrayMaxLengthValidator, ArrayMinLengthValidator,
)
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.safestring import mark_safe
from django.utils.translation import string_concat,... | gpl-3.0 |
abbeymiles/aima-python | submissions/Kinley/mygames.py | 13 | 7104 |
from collections import namedtuple
from games import (Game)
class GameState:
def __init__(self, to_move, board, label=None, depth=5):
self.to_move = to_move
self.board = board
self.label = label
self.maxDepth = depth
# self.validSpaces = ()
def __str__(self):
if... | mit |
anthropo-lab/XP | EPHEMER/agentisme_project/conf_exp_main/pages.py | 1 | 2806 | from otree.api import Currency as c, currency_range
from . import models
from ._builtin import Page, WaitPage
from .models import Constants, DebriefGroup
#################################################
#################################################
class ParticipantPage(Page):
form_model = 'player'
form_... | gpl-3.0 |
hwidmann/RDA-Training | mdmanager.py | 1 | 107083 | #!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
"""mdmanager.py
Management of metadata
Copyright (c) 2016 Heinrich Widmann (DKRZ) Licensed under AGPLv3.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS F... | apache-2.0 |
mayapurmedia/wagtail | wagtail/wagtailcore/blocks/stream_block.py | 4 | 12662 | from __future__ import absolute_import, unicode_literals
import collections
from django import forms
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from django.template.loader import render_to_string
from django.utils.encoding import python_2_unicode_compatible, force_text... | bsd-3-clause |
martinmcbride/pytexture | imagetests/test_color_module.py | 1 | 10325 | import unittest
from generativepy.color import Color
from generativepy.drawing import make_image
from image_test_helper import run_image_test
"""
Test each function of the color module
"""
class TestDrawingModule(unittest.TestCase):
def test_basic_colors(self):
"""
Test basic colors using pycai... | mit |
msegado/edx-platform | lms/djangoapps/commerce/tests/test_views.py | 85 | 4208 | """ Tests for commerce views. """
import json
from uuid import uuid4
from nose.plugins.attrib import attr
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
import mock
from student.tests.factories import UserFactory
class UserMixin(object):
... | agpl-3.0 |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/pip/vcs/bazaar.py | 514 | 3803 | from __future__ import absolute_import
import logging
import os
import tempfile
# TODO: Get this into six.moves.urllib.parse
try:
from urllib import parse as urllib_parse
except ImportError:
import urlparse as urllib_parse
from pip.utils import rmtree, display_path
from pip.vcs import vcs, VersionControl
fro... | mit |
flumotion-mirror/flumotion | flumotion/admin/command/manager.py | 3 | 3322 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | lgpl-2.1 |
gilir/awn-extras-debian | applets/maintained/calendar/googlecal.py | 1 | 4611 | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
#
# Copyright (c) 2007 Mike (mosburger) Desjardins <desjardinsmike@gmail.com>
# Please do not email the above person for support. The
# email address is only there for license/copyright purposes.
#
# This is an implementation of the google plugin for a calendar a... | gpl-3.0 |
bensternthal/bedrock | bedrock/mozorg/tests/test_forums.py | 35 | 1853 | # -*- coding: utf-8 -*-
# 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/.
from collections import OrderedDict
from bedrock.mozorg import forums
from bedrock.mozorg.tests... | mpl-2.0 |
camradal/ansible | lib/ansible/modules/monitoring/newrelic_deployment.py | 25 | 4796 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@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 ... | gpl-3.0 |
lenovor/lightfm | tests/utils.py | 11 | 2205 | import numpy as np
from sklearn.metrics import roc_auc_score
def precision_at_k(model, ground_truth, k, user_features=None, item_features=None):
"""
Measure precision at k for model and ground truth.
Arguments:
- lightFM instance model
- sparse matrix ground_truth (no_users, no_items)
- int ... | apache-2.0 |
mindbender-studio/setup | bin/windows/python36/Lib/asyncio/base_subprocess.py | 6 | 9096 | import collections
import subprocess
import warnings
from . import compat
from . import protocols
from . import transports
from .coroutines import coroutine
from .log import logger
class BaseSubprocessTransport(transports.SubprocessTransport):
def __init__(self, loop, protocol, args, shell,
std... | mit |
wanglongqi/sympy | sympy/integrals/quadrature.py | 69 | 14562 | from __future__ import print_function, division
from sympy.core import S, Dummy, pi
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.trigonometric import sin, cos
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.special.gamma_functions import ... | bsd-3-clause |
sjones4/eutester | testcases/cloud_admin/3-4/Euca5876.py | 5 | 2680 | '''
Created on = '10/28/13"
Author = 'mmunn'
Unit test : EUCA-5876 LDAP Sync: fails to look up and sync users
setUp : Install Credentials,
test : modify authentication.ldap_integration_configuration property and make sure that the users sync.
tearDown : Removes Credentials... | bsd-2-clause |
bckwltn/SickRage | lib/subliminal/utils.py | 167 | 2027 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 Foundation; either version 3 of... | gpl-3.0 |
Alwnikrotikz/pysal | pysal/spreg/tests/test_twosls_sp.py | 11 | 21986 | import unittest
import numpy as np
import pysal
import pysal.spreg.diagnostics as D
from pysal.spreg.twosls_sp import BaseGM_Lag, GM_Lag
class TestBaseGMLag(unittest.TestCase):
def setUp(self):
self.w = pysal.rook_from_shapefile(pysal.examples.get_path("columbus.shp"))
self.w.transform = 'r'
... | bsd-3-clause |
martinhoefling/fretutils | lib/FRETUtilsTests/RunTests.py | 1 | 19152 | '''
Created on 04.10.2012
@author: mhoefli
'''
import unittest
import shutil
import tempfile
import os
from RunTestsHelpers import FakeOptions, FakeOptionsRK, createConstantDummyRKTraj, createProbabilityClassFile, writeConfigFiles, writeRKConfigFiles, writeBurstFile, writeInvalidBurstFile, createStepFunctionDummyRKTr... | bsd-3-clause |
Bysmyyr/blink-crosswalk | Tools/Scripts/webkitpy/common/host_mock.py | 35 | 3517 | # Copyright (C) 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 of conditions and the f... | bsd-3-clause |
openhatch/oh-mainline | vendor/packages/mechanize/test-tools/twisted-localserver.py | 22 | 8639 | #!/usr/bin/env python
"""
%prog port
e.g. %prog 8000
Runs a local server to point the mechanize functional tests at. Example:
python test-tools/twisted-localserver.py 8042
python functional_tests.py --uri=http://localhost:8042/
You need twisted.web2 to run it. On ubuntu feisty, you can install it like so:
sudo a... | agpl-3.0 |
kingvuplus/boom | lib/python/ItalySat/ItalysatSwapManager.py | 2 | 15522 | # Embedded file name: /usr/lib/enigma2/python/ItalySat/ItalysatSwapManager.py
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Components.config import config, configfile, ConfigYesNo, ConfigSubsection
from Components.ActionMap import ActionMa... | gpl-2.0 |
fstudio/Phoenix | test/Experimental/libcxx/utils/sym_check/sym_match.py | 5 | 1331 | #!/usr/bin/env python
"""
sym_match - Match all symbols in a list against a list of regexes.
"""
from argparse import ArgumentParser
import sys
from sym_check import util, match, extract
def main():
parser = ArgumentParser(
description='Extract a list of symbols from a shared library.')
parser.add_arg... | mit |
ModdedPA/android_external_chromium_org | chrome/common/extensions/docs/server2/patched_file_system_test.py | 31 | 6616 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from copy import deepcopy
import unittest
from file_system import FileSystem, FileNotFoundError, StatInfo
from future import Future
fr... | bsd-3-clause |
jiocloudservices/jcsclient | src/jcsclient/config.py | 1 | 5178 | # Copyright (c) 2016 Jiocloud.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... | apache-2.0 |
Gussy/titanium_desktop | sdk/PyRTF/Elements.py | 6 | 26908 | from types import IntType, FloatType, LongType, StringTypes
from copy import deepcopy
from binascii import hexlify
from Constants import *
from Styles import *
class UnhandledParamError( Exception ) :
def __init__( self, param ) :
Exception.__init__( self, "Don't know what to do with param %s" % pa... | apache-2.0 |
vizual54/MissionPlanner | Lib/_LWPCookieJar.py | 63 | 6723 | """Load / save to libwww-perl (LWP) format files.
Actually, the format is slightly extended from that used by LWP's
(libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information
not recorded by LWP.
It uses the version string "2.0", though really there isn't an LWP Cookies
2.0 format. This indicate... | gpl-3.0 |
antoinechkaiban/cochlea | pycept/pycept/version.py | 7 | 1140 | # The MIT License (MIT)
#
# Copyright (c) 2013 Numenta, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | mit |
pjdietz/POSTMan-Chrome-Extension | tests/selenium/selenium_test.py | 11 | 1230 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import inspect
... | apache-2.0 |
rameshvs/nipype | nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py | 5 | 1239 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.preprocess import FitMSParams
def test_FitMSParams_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
flip_list=dict(),... | bsd-3-clause |
Tokyo-Buffalo/tokyosouth | env/lib/python3.6/site-packages/twisted/test/test_factories.py | 13 | 4637 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test code for basic Factory classes.
"""
from __future__ import division, absolute_import
import pickle
from twisted.trial.unittest import TestCase
from twisted.internet.task import Clock
from twisted.internet.protocol import ReconnectingC... | mit |
j2sol/ansible-modules-core | cloud/rackspace/rax_files.py | 60 | 11966 | #!/usr/bin/python
# (c) 2013, Paul Durivage <paul.durivage@rackspace.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
# (a... | gpl-3.0 |
streamlio/heron | heron/examples/src/python/spout/multi_stream_spout.py | 1 | 1502 | # Copyright 2016 Twitter. 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 agree... | apache-2.0 |
varunarya10/nova_test_latest | nova/tests/unit/api/openstack/compute/contrib/test_flavor_manage.py | 26 | 19117 | # Copyright 2011 Andrew Bogott for the Wikimedia 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-... | apache-2.0 |
shubhamdhama/zulip | zerver/webhooks/buildbot/view.py | 4 | 1601 | from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.mod... | apache-2.0 |
tarquasso/softroboticfish6 | fish/pi/serialMonitor.py | 1 | 2812 | """
Usage:
run "sudo python serialMonitor print=1 file=out.txt"
where the print and file arguments are optional
while running:
type p and then enter to toggle screen printing (will store in buffer though)
press enter to print just next line of buffer when not streaming to screen
type q and then enter ... | mit |
v-iam/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/effective_route.py | 2 | 2694 | # 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 |
clab/lstm-parser | cnn/pyexamples/util.py | 6 | 1072 | from collections import defaultdict
from itertools import count
class Vocab:
def __init__(self, w2i=None):
if w2i is None: w2i = defaultdict(count(0).next)
self.w2i = dict(w2i)
self.i2w = {i:w for w,i in w2i.iteritems()}
@classmethod
def from_corpus(cls, corpus):
w2i = defaul... | apache-2.0 |
neoz/zer0m0n | signatures/antivm_vbox_window.py | 6 | 1338 | # Copyright (C) 2012 Claudio "nex" Guarnieri (@botherder)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pro... | gpl-3.0 |
precedenceguo/mxnet | python/mxnet/libinfo.py | 5 | 3536 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
botswana-harvard/edc-rdb | bcpp_rdb/old/rdb/rdb.py | 1 | 15328 | from datetime import date, datetime
from decimal import Decimal, InvalidOperation
import hashlib
import pytz
import re
import requests
import sys
from dateutil import parser
from django.conf import settings
from django.core.exceptions import MultipleObjectsReturned
from django.db import IntegrityError
from django.db.... | gpl-2.0 |
dracidoupe/graveyard | ddcz/views/comments.py | 1 | 2006 | from django.contrib import messages
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views.decorators.http import require_http_methods
from ..forms.comments import PhorumCommentForm, DeletePhorumComm... | mit |
CloudServer/nova | nova/db/sqlalchemy/migrate_repo/versions/275_add_keypair_type.py | 79 | 1459 | # Copyright (c) 2015 Cloudbase Solutions SRL
# 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
#
# Unles... | apache-2.0 |
QianBIG/odoo | openerp/addons/base/tests/test_qweb.py | 289 | 4814 | # -*- coding: utf-8 -*-
import cgi
import json
import os.path
import glob
import re
import collections
from lxml import etree
import openerp.addons.base.ir.ir_qweb
import openerp.modules
from openerp.tests import common
from openerp.addons.base.ir import ir_qweb
class TestQWebTField(common.TransactionCase):
def ... | agpl-3.0 |
chand3040/sree_odoo | openerp/addons/account_check_writing/__init__.py | 446 | 1111 | # -*- 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 |
csignsandgraphics/csignsandgraphics.github.io | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
jeaf/scrabble | cgi-bin/scrabble.py | 1 | 3075 | # coding=latin-1
import collections
import itertools
import os.path
import sqlite3
import string
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
db_path = os.path.join(script_dir, 'dict.db')
dict_source = {'fr': 'liste.de.mots.francais.frgut.txt'}
for lang,f in dict_source.iteritems():
di... | mit |
Microsoft/vsminecraft | dependencies/protobuf-2.6.1/python/google/protobuf/text_encoding.py | 81 | 4696 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | mit |
mariosky/evo-drawings | venv/lib/python2.7/site-packages/django/conf/locale/hu/formats.py | 118 | 1118 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y. F j.'
TIME_FORMAT = 'G.i.s'
DA... | agpl-3.0 |
irwinlove/django | tests/template_backends/test_dummy.py | 306 | 3603 | # coding: utf-8
from __future__ import unicode_literals
from django.forms import CharField, Form, Media
from django.http import HttpRequest
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.template.backends.dummy import ... | bsd-3-clause |
fly19890211/edx-platform | lms/djangoapps/verify_student/services.py | 34 | 4224 | """
Implementation of "reverification" service to communicate with Reverification XBlock
"""
import logging
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from opaque_keys.edx.keys import CourseKey
from student.models import Us... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.