repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
imammedo/virt-test | refs/heads/master | virttest/virt_vm.py | 2 | import logging, time, glob, re
from autotest.client.shared import error
import utils_misc, utils_net, remote
class VMError(Exception):
pass
class VMCreateError(VMError):
def __init__(self, cmd, status, output):
VMError.__init__(self, cmd, status, output)
self.cmd = cmd
self.status = ... |
theboocock/NesiGridSelection | refs/heads/master | nesi/nesi_scripts/submit_job.py | 2 | #!~/NeSI_Tools/bin/grython
# FIXME: need an installer type thing to do ^^ correctly
#
# Author: Ed hills
# Date: 17/12/12
# Descr: This grython script will submit a job to the NeSI grid. This has not
# been made for batch jobs, only single jobs. Still early design. Is not
# complete.
# Arguments:
# argv... |
zsiciarz/django | refs/heads/master | django/forms/forms.py | 9 | """
Form classes
"""
import copy
from collections import OrderedDict
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
# BoundField is imported for backwards compatibility in Django 1.9
from django.forms.boundfield import BoundField # NOQA
from django.forms.fields import Field, FileField
# pretty_... |
kerr-huang/SL4A | refs/heads/master | python/src/Lib/idlelib/ObjectBrowser.py | 67 | # XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - more doc strings
# - tooltips
# object browser
# XXX TO DO:
# - for classes/modules, add "open source" to object browser
from TreeWidget import TreeItem, TreeNode, ScrolledCanvas
from repr import Repr
myrepr = Repr()
myrepr.maxstring = 100
myre... |
lukaspj/Torque6 | refs/heads/master | src/testing/googleTest/test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
hybrideagle/django | refs/heads/master | tests/template_tests/filter_tests/test_striptags.py | 324 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
def test_striptags01(self):
output ... |
GinnyN/Team-Fortress-RPG-Generators | refs/heads/master | build/lib/django/contrib/flatpages/tests/views.py | 77 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
class FlatpageViewTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
... |
dan1/horizon-x509 | refs/heads/master | openstack_dashboard/dashboards/admin/overview/urls.py | 66 | # 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
# not use this file except in compliance with the... |
codio-packs/symfony | refs/heads/master | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | #Copyright (c) 2010 Fabien Potencier
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distrib... |
jeremycline/pulp_puppet | refs/heads/master | pulp_puppet_plugins/pulp_puppet/plugins/importers/forge.py | 1 | from datetime import datetime
from gettext import gettext as _
import logging
import os
import shutil
import sys
from pulp.common.util import encode_unicode
from pulp.server.db.model.criteria import UnitAssociationCriteria
from pulp_puppet.common import constants
from pulp_puppet.common.constants import (STATE_FAILED... |
ehiller/mobilecsp-v18 | refs/heads/master | modules/oauth2/oauth2.py | 3 | # Copyright 2013 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 by applicable law or ... |
tjhei/burnman_old | refs/heads/master | geotherm.py | 1 | import numpy
import bisect
import matplotlib.pyplot as pyplot
import prem
from tools import *
# loads a simple geotherm from geotherm.txt
# geotherm from geotherm.txt, from Cayman
# pressure: in GPa
# return: temperature in K
def geotherm(pressure):
idx = bisect.bisect_left(table_p, pressure) - 1
if (idx < 0... |
waiyin21/test123 | refs/heads/master | pogom/pgoapi/protos/POGOProtos/Networking/Requests_pb2.py | 8 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos.Networking.Requests.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protob... |
pczerkas/devstack | refs/heads/master | setup.py | 463 | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... |
refola/piklisp.py | refs/heads/master | piklisp.py | 2 | #!/usr/bin/python3
'''
piklisp.py
Author: Mark Haferkamp
Last date modified: 2015-04-08
Interpret a Pythony dialect of Lisp.
Piklisp is a scripting language that uses a parentheses-light Lisp syntax and macro system to run Python functions.
It's essentially Pythonic syntax and features combined with Lisp semantics an... |
erickt/hue | refs/heads/master | desktop/core/ext-py/tablib-develop/tablib/packages/openpyxl/reader/excel.py | 61 | # file openpyxl/reader/excel.py
# Copyright (c) 2010 openpyxl
#
# 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, m... |
KevZho/buffbot | refs/heads/master | kol/request/CocktailcraftingRequest.py | 4 | import kol.Error as Error
from kol.database import ItemDatabase
from kol.manager import PatternManager
from kol.request.GenericRequest import GenericRequest
class CocktailcraftingRequest(GenericRequest):
def __init__(self, session, itemid1, itemid2, numDrinks=1, makeMax=False):
super(CocktailcraftingReque... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/testData/refactoring/introduceVariable/suggestStringConstantValue.py | 166 | "foo <caret>bar" |
heke123/chromium-crosswalk | refs/heads/master | tools/grit/grit_info.py | 31 | #!/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.
'''Tool to determine inputs and outputs of a grit file.
'''
import optparse
import os
import posixpath
import sys
from grit impor... |
endlessm/chromium-browser | refs/heads/master | third_party/llvm/lldb/test/API/functionalities/recursion/TestValueObjectRecursion.py | 6 | """
Test lldb data formatter subsystem.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class ValueObjectRecursionTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's set... |
junhuac/MQUIC | refs/heads/master | src/tools/grit/grit/node/include_unittest.py | 52 | #!/usr/bin/env python
# Copyright (c) 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.
'''Unit tests for include.IncludeNode'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.di... |
d3m3vilurr/node-gyp | refs/heads/master | legacy/tools/gyp/pylib/gyp/generator/ninja_test.py | 39 | #!/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 ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import TestCommon
class Tes... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/PyAMF/pyamf/tests/adapters/test_google.py | 26 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
PyAMF Google adapter tests.
@since: 0.3.1
"""
import unittest
import datetime
import struct
import os
import pyamf
from pyamf import amf3
from pyamf.tests import util
try:
from google.appengine.ext import db
except ImportError:
db = None... |
nopjmp/SickRage | refs/heads/master | lib/hachoir_metadata/timezone.py | 185 | from datetime import tzinfo, timedelta
class TimezoneUTC(tzinfo):
"""UTC timezone"""
ZERO = timedelta(0)
def utcoffset(self, dt):
return TimezoneUTC.ZERO
def tzname(self, dt):
return u"UTC"
def dst(self, dt):
return TimezoneUTC.ZERO
def __repr__(self):
return... |
phantasien/falkor | refs/heads/master | deps/bastian/deps/gtest/test/gtest_list_tests_unittest.py | 1898 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
coleifer/peewee | refs/heads/master | examples/twitter/app.py | 1 | import datetime
from flask import Flask
from flask import g
from flask import redirect
from flask import request
from flask import session
from flask import url_for, abort, render_template, flash
from functools import wraps
from hashlib import md5
from peewee import *
# config - aside from our database, the rest is f... |
gmist/fix-5studio | refs/heads/master | main/auth/auth.py | 4 | # coding: utf-8
from __future__ import absolute_import
import functools
import re
from flask_oauthlib import client as oauth
from google.appengine.ext import ndb
import flask
import flask_login
import flask_wtf
import unidecode
import wtforms
import cache
import config
import model
import task
import util
from mai... |
odoocn/odoomrp-wip | refs/heads/8.0 | sale_order_recalculate_prices_variants/__openerp__.py | 17 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... |
plotly/dash-table | refs/heads/dev | tests/selenium/test_filter.py | 1 | import dash
from dash_table import DataTable
import pytest
DATA_SIZE = 50
def get_table_defaults():
return dict(
id="table",
data=[
dict(a=1, b=11, c=111),
dict(a=2, b=12, c=113),
dict(a=3, b=14, c=116),
dict(a=4, b=17, c=120),
dict(a=... |
krismcfarlin/todo_angular_endpoints | refs/heads/master | bp_includes/external/requests/packages/chardet/hebrewprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... |
EIngram/GarageDoor | refs/heads/master | Lambda_Function/requests/packages/chardet/hebrewprober.py | 2928 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... |
kennethgillen/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_ironic_node.py | 49 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module 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 optio... |
Karaage-Cluster/karaage | refs/heads/master | karaage/people/views/persons.py | 2 | # Copyright 2010-2017, The University of Melbourne
# Copyright 2010-2017, Brian May
#
# This file is part of Karaage.
#
# Karaage 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... |
pcostell/apitools | refs/heads/master | samples/servicemanagement_sample/servicemanagement_v1/__init__.py | 415 | """Package marker file."""
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
|
python-diamond/Diamond | refs/heads/master | src/collectors/snmp/snmp.py | 3 | # coding=utf-8
"""
SNMPCollector is a special collector for collecting data by using SNMP
#### Dependencies
* pysnmp
"""
import socket
import warnings
# pysnmp packages on debian 6.0 use sha and md5 which are deprecated
# packages. there is nothing to be done about it until pysnmp
# updates to use new hashlib m... |
AnhellO/DAS_Sistemas | refs/heads/development | Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/django/conf/locale/nl/formats.py | 65 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 januari 2009'
TIME_FORMAT = 'H:i' # '15:23'
DATET... |
BuildingLink/sentry | refs/heads/master | tests/sentry/web/frontend/test_mailgun_inbound_webhook.py | 6 | from __future__ import absolute_import, print_function
import mock
from django.core.urlresolvers import reverse
from sentry.testutils import TestCase
from sentry.utils.email import group_id_to_email
body_plain = "foo bar"
class TestMailgunInboundWebhookView(TestCase):
def setUp(self):
super(TestMailgu... |
VirusTotal/msticpy | refs/heads/master | tests/test_nbdisplay.py | 1 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import uni... |
geopython/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/RasterCalculator.py | 2 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RasterLayerCalculator.py
---------------------
Date : November 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
***************... |
ouspg/ridac | refs/heads/master | open-simsim/generator.py | 1 | import time
import os
toInts = lambda l: [int(i) for i in l]
takeOne = lambda l,n: [i[n] for i in l]
heads = lambda l: [l[i:] for i in range(len(l))]
tails = lambda l: [l[:i+1] for i in range(len(l))]
concat = lambda l: [j for i in l for j in i]
toStr = lambda i: "".join(map(str,i))
"""the IEEE 802.5"""
standardMa... |
gboudreau/CouchPotato | refs/heads/master | library/transmissionrpc/torrent.py | 10 | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2010 Erik Svensson <[email protected]>
# Licensed under the MIT license.
import sys, datetime
from transmissionrpc.constants import STATUS, PRIORITY
from transmissionrpc.utils import format_timedelta
class Torrent(object):
"""
Torrent is a class holding the da... |
pablosuau/pyBacklogger | refs/heads/master | views/filter_dialog.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'filter_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_FilterDialog(object):
def setupUi(self, FilterDialog):
F... |
jmenglund/pandas-validation | refs/heads/master | docs/source/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pandas-validation documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 19 09:45:10 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... |
maxsocl/django | refs/heads/master | django/db/backends/oracle/schema.py | 118 | import binascii
import copy
import datetime
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
from django.utils import six
from django.utils.text import force_text
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALTER TABLE %... |
amol9/mutils | refs/heads/master | redlib/test/testlib/test_testorder.py | 2 | from unittest import TestCase, main as ut_main
from redlib.testlib.testorder import order
class TestTestOrder(TestCase):
reg = []
@order(0)
def test_zero(self):
self.assertEqual(len(self.reg), 0)
self.reg.append(0)
@order(1)
def test_one(self):
self.assertEqual(len(self.reg), 1)
self.assertEqual(self... |
andrewfu0325/gem5-aladdin | refs/heads/ruby | tests/quick/se/02.insttest/test.py | 56 | # Copyright (c) 2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... |
PJB3005/MoMMI | refs/heads/v2 | MoMMI/module.py | 1 | from typing import Dict, Any
class MModule(object):
def __init__(self, name: str) -> None:
from .handler import MHandler
self.name: str = name
self.handlers: Dict[str, MHandler] = {}
self.loaded: bool = False
# The actual module
self.module: Any = None
|
bdh1011/cupeye | refs/heads/master | venv/lib/python2.7/site-packages/whoosh/lang/dmetaphone.py | 96 | # coding= utf-8
# This script implements the Double Metaphone algorythm (c) 1998, 1999 by
# Lawrence Philips. It was translated to Python from the C source written by
# Kevin Atkinson (http://aspell.net/metaphone/) By Andrew Collins - January 12,
# 2007 who claims no rights to this work.
# http://atomboy.isa-geek.com:... |
eckucukoglu/arm-linux-gnueabihf | refs/heads/master | lib/python2.7/test/test_heapq.py | 42 | """Unittests for heapq."""
import sys
import random
from test import test_support
from unittest import TestCase, skipUnless
py_heapq = test_support.import_fresh_module('heapq', blocked=['_heapq'])
c_heapq = test_support.import_fresh_module('heapq', fresh=['_heapq'])
# _heapq.nlargest/nsmallest are saved in heapq._n... |
jianghuaw/nova | refs/heads/master | nova/tests/unit/virt/libvirt/volume/test_quobyte.py | 2 | # Copyright (c) 2015 Quobyte 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... |
flyfei/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/Crypto/PublicKey/__init__.py | 273 | """Public-key encryption and signature algorithms.
Public-key encryption uses two different keys, one for encryption and
one for decryption. The encryption key can be made public, and the
decryption key is kept private. Many public-key algorithms can also
be used to sign messages, and some can *only* be used for sig... |
TheAlgorithms/Python | refs/heads/master | project_euler/problem_301/sol1.py | 1 | """
Project Euler Problem 301: https://projecteuler.net/problem=301
Problem Statement:
Nim is a game played with heaps of stones, where two players take
it in turn to remove any number of stones from any heap until no stones remain.
We'll consider the three-heap normal-play version of
Nim, which works as follows:
- A... |
jgoclawski/django | refs/heads/master | tests/max_lengths/models.py | 438 | from django.db import models
class PersonWithDefaultMaxLengths(models.Model):
email = models.EmailField()
vcard = models.FileField(upload_to='/tmp')
homepage = models.URLField()
avatar = models.FilePathField()
class PersonWithCustomMaxLengths(models.Model):
email = models.EmailField(max_length=2... |
philgyford/django-spectator | refs/heads/main | spectator/events/migrations/0011_auto_20180125_1348.py | 1 | # Generated by Django 2.0 on 2018-01-25 13:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("spectator_events", "0010_auto_20180118_0906"),
]
operations = [
migrations.AlterModelOptions(
name="classicalwork",
options={"... |
laperry1/android_external_chromium_org | refs/heads/cm-12.1 | build/android/adb_logcat_printer.py | 44 | #!/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.
"""Shutdown adb_logcat_monitor and print accumulated logs.
To test, call './adb_logcat_printer.py <base_dir>' where
<base_dir> c... |
TheoRettisch/p2pool-giarcoin | refs/heads/master | wstools/tests/test_wstools.py | 308 | #!/usr/bin/env python
############################################################################
# Joshua R. Boverhof, David W. Robertson, LBNL
# See LBNLCopyright for copyright notice!
###########################################################################
import unittest, tarfile, os, ConfigParser
import test... |
tchernomax/ansible | refs/heads/devel | lib/ansible/modules/identity/ipa/ipa_sudocmd.py | 74 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
trmznt/plasmogen | refs/heads/master | setup.py | 1 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
with open(os.path.join(here, 'CHANGES.md')) as f:
CHANGES = f.read()
requires = [
'pyramid',
'pyramid_chameleon',
'pyramid_deb... |
kecheon/yablist | refs/heads/master | simpletext/views.py | 6027 | # Create your views here.
|
marcuskelly/recover | refs/heads/master | Lib/site-packages/sqlalchemy/dialects/oracle/zxjdbc.py | 33 | # oracle/zxjdbc.py
# Copyright (C) 2005-2017 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
"""
.. dialect:: oracle+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
... |
BlackDragonHunt/Mangle | refs/heads/master | book.py | 1 | # Copyright (C) 2010 Alex Yatskov
#
# 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 program is distributed in ... |
stahlnow/stahlnow | refs/heads/master | website/apps/projects/models.py | 1 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.utils.timezone import now
from django.conf import settings
from projects.managers import PublicManager
from taggit.managers import TaggableManager
from fileupload.models impor... |
chhao91/QGIS | refs/heads/master | python/plugins/processing/gui/ScriptEdit.py | 9 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptEdit.py
---------------------
Date : April 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
****************... |
mkieszek/odoo | refs/heads/master | addons/website_portal_sale/__init__.py | 1350 | import controllers
|
vlachoudis/sl4a | refs/heads/master | python-build/python-libs/gdata/tests/gdata_tests/docs_test.py | 89 | #!/usr/bin/python
#
# Copyright (C) 2006 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 ... |
joaquimrocha/Rancho | refs/heads/master | rancho/milestone/models.py | 1 | ########################################################################
# Rancho - Open Source Group/Project Management Tool
# Copyright (C) 2008 The Rancho Team
#
# 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 t... |
jessekl/flixr | refs/heads/master | venv/lib/python2.7/site-packages/flask/testsuite/test_apps/config_module_app.py | 1257 | import os
import flask
here = os.path.abspath(os.path.dirname(__file__))
app = flask.Flask(__name__)
|
manelvf/closure-linter | refs/heads/master | closure_linter/runner.py | 102 | #!/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
#
#... |
clokep/datadogpy | refs/heads/master | datadog/api/users.py | 5 | from datadog.api.base import ActionAPIResource
class User(ActionAPIResource):
"""
A wrapper around User HTTP API.
"""
@classmethod
def invite(cls, emails):
"""
Send an invite to join datadog to each of the email addresses in the
*emails* list. If *emails* is a string, it wi... |
louisLouL/pair_trading | refs/heads/master | hist_data/blp/blp_api.py | 1 | """
Python wrapper to download data through the Bloomberg Open API
Written by Alexandre Almosni [email protected]
(C) 2014-2017 Alexandre Almosni
Released under Apache 2.0 license. More info at http://www.apache.org/licenses/LICENSE-2.0
"""
from __future__ import print_function
from abc import ABCMeta, abs... |
ahwmrklas/warpWarp | refs/heads/master | test/XML2Py.py | 1 | '''
XML2Py - XML to Python de-serialization
This code transforms an XML document into a Python data structure
Usage:
deserializer = XML2Py()
python_object = deserializer.parse( xml_string )
print xml_string
print python_object
'''
from lxml import etree
class XML2Py():
def __init__( self ):
... |
sleepers-anonymous/zscore | refs/heads/master | sleep/middleware.py | 1 | from django.utils import timezone
from models import SleeperProfile, Sleeper
import pytz
class TimezoneMiddleware(object):
def process_request(self,request):
if request.user.is_authenticated():
tz = pytz.timezone(request.user.sleeperprofile.timezone)
timezone.activate(tz)
|
Cadene/keras | refs/heads/master | tests/auto/test_sequential_model.py | 33 | from __future__ import absolute_import
from __future__ import print_function
import unittest
import numpy as np
np.random.seed(1337)
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Merge
from keras.utils import np_utils
from keras.utils.test_utils import get_test_data
input_dim = ... |
vhazali/cs5331 | refs/heads/master | assignment2/scripts/exploit08/exploit08.py | 1 | import urllib, urllib2, webbrowser
url = 'http://www.wsb.com/Assignment2/case08.php'
values = dict(ip_url = '& cat /etc/passwd')
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
rsp = urllib2.urlopen(req)
with open('results.html', 'w') as f:
f.write(rsp.read())
new = 2
webbrowser.open('results.html... |
nclisg/ZenPacks.community.HuaweiWireless | refs/heads/master | ZenPacks/community/HuaweiWireless/modeler/plugins/community/snmp/HuaweiAccessControllerMap.py | 2 | from Products.DataCollector.plugins.CollectorPlugin import (SnmpPlugin, GetTableMap, GetMap)
from Products.DataCollector.plugins.DataMaps import ObjectMap, RelationshipMap, MultiArgs
#Lookup table for AP Status
STATUSNAME = {
1 : 'idle',
2 : 'autofind',
3 : 'typeNotMatch',
4 : 'fault',
5 : 'config'... |
unix-beard/newsbot | refs/heads/master | server/modules/feedpublish/feedpublish.py | 2 | #-*- coding: utf-8 -*-
__name__ = 'publisher'
import feedparser
import operator
import time
import datetime
import sys
import atexit
import hashlib
import sqlite3
import sqlitebck
import loggerfactory
import threading
import Queue
import multiprocessing
import os
import ConfigParser
from forumlogger import *
from mu... |
edxzw/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/imageannotation_module.py | 14 | """
Module for Image annotations using annotator.
"""
from lxml import etree
from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
from xmodule.annotator_mixin import get_instructions, html_to_text
from xmodule.... |
Parareru/shadowsocks | refs/heads/master | tests/graceful_cli.py | 977 | #!/usr/bin/python
import socks
import time
SERVER_IP = '127.0.0.1'
SERVER_PORT = 8001
if __name__ == '__main__':
s = socks.socksocket()
s.set_proxy(socks.SOCKS5, SERVER_IP, 1081)
s.connect((SERVER_IP, SERVER_PORT))
s.send(b'test')
time.sleep(30)
s.close()
|
fgiunta/data-science-from-scratch | refs/heads/master | code/clustering.py | 60 | from __future__ import division
from linear_algebra import squared_distance, vector_mean, distance
import math, random
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
class KMeans:
"""performs k-means clustering"""
def __init__(self, k):
self.k = k # number of clusters
... |
potzenheimer/xdash | refs/heads/master | src/xpose.sitetheme/xpose/sitetheme/__init__.py | 26 | # -*- extra stuff goes here -*-
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
|
hyperized/ansible | refs/heads/devel | test/units/modules/network/nxos/test_nxos_command.py | 51 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
cmdunkers/DeeperMind | refs/heads/master | PythonEnv/lib/python2.7/site-packages/numpy/distutils/tests/test_exec_command.py | 201 | from __future__ import division, absolute_import, print_function
import os
import sys
from tempfile import TemporaryFile
from numpy.distutils import exec_command
# In python 3 stdout, stderr are text (unicode compliant) devices, so to
# emulate them import StringIO from the io module.
if sys.version_info[0] >= 3:
... |
zxsted/scipy | refs/heads/master | scipy/weave/weave_version.py | 100 | from __future__ import absolute_import, print_function
major = 0
minor = 4
micro = 9
#release_level = 'alpha'
release_level = ''
if release_level:
weave_version = '%(major)d.%(minor)d.%(micro)d_%(release_level)s'\
% (locals())
else:
weave_version = '%(major)d.%(minor)d.%(micro)d'\
... |
kikocorreoso/brython | refs/heads/master | www/src/Lib/test/test_queue.py | 2 | # Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import itertools
import random
import threading
import time
import unittest
import weakref
from test import support
py_queue = support.import_fresh_module('queue', blocked=['_queue'])
c_queue = support.import_fres... |
natanielruiz/android-yolo | refs/heads/master | jni-build/jni/include/tensorflow/python/summary/impl/directory_watcher_test.py | 4 | # 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... |
marcoantoniooliveira/labweb | refs/heads/master | oscar/lib/python2.7/site-packages/jinja2/testsuite/__init__.py | 404 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite
~~~~~~~~~~~~~~~~
All the unittests of Jinja2. These tests can be executed by
either running run-tests.py using multiple Python versions at
the same time.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
i... |
drasko/codezero | refs/heads/master | scripts/baremetal/baremetal_add_container.py | 3 | #! /usr/bin/env python2.6
# -*- mode: python; coding: utf-8; -*-
#
# Script to add/remove project to baremetal
# menu of main screen
#
# This script should be called from project root directory
#
import os, sys, shutil, re
PROJRELROOT = '../../'
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), P... |
GhostThrone/django | refs/heads/master | django/utils/jslex.py | 335 | """JsLex: a lexer for Javascript"""
# Originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
import re
class Tok(object):
"""
A specification for a token class.
"""
num = 0
def __init__(self, name, regex, next=None):
self.id = Tok.num
Tok.num += 1... |
JustF0rWork/malware | refs/heads/master | trails/feeds/feodotrackerdns.py | 1 | #!/usr/bin/env python
"""
Copyright (c) 2014-2016 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
from core.common import retrieve_content
__url__ = "https://feodotracker.abuse.ch/blocklist/?download=domainblocklist"
__check__ = "Feodo"
__info__ = "feodo (malware)"
__reference__ = "abu... |
MattNolanLab/gridcells | refs/heads/master | gridcells/core/arena.py | 2 | '''
==============================================
:mod:`gridcells.core.arena` - Defining arenas
==============================================
The :mod:`~gridcells.core.arena` module provides class definitions of arenas. These
can subsequently be used as input to process spiking data and generate spatial
firing field... |
krishna-pandey-git/django | refs/heads/master | django/core/serializers/python.py | 140 | """
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from django.apps import apps
from django.conf impor... |
hkoof/urwid | refs/heads/master | examples/dialog.py | 4 | #!/usr/bin/python
#
# Urwid example similar to dialog(1) program
# Copyright (C) 2004-2009 Ian Ward
#
# This 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
# version 2.1 ... |
hmen89/odoo | refs/heads/master | addons/analytic_user_function/__init__.py | 441 | # -*- 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... |
drewandersonnz/openshift-tools | refs/heads/prod | ansible/roles/lib_gcloud/build/ansible/gcloud_compute_image.py | 13 | # pylint: skip-file
# vim: expandtab:tabstop=4:shiftwidth=4
#pylint: disable=too-many-branches
def main():
''' ansible module for gcloud compute images'''
module = AnsibleModule(
argument_spec=dict(
# credentials
state=dict(default='present', type='str',
c... |
nooperpudd/quantbube | refs/heads/master | quantbube/singals.py | 3 | # encoding:utf-8
|
drakeloud/louderdev | refs/heads/master | louderdev/bin/rst2man.py | 1 | #!/Users/Drake/dev/LouderDev/louderdev/bin/python3
# Author:
# Contact: [email protected]
# Copyright: This module has been placed in the public domain.
"""
man.py
======
This module provides a simple command line interface that uses the
man page writer to output from ReStructuredText source.
"""
import locale
... |
MalloyDelacroix/DownloaderForReddit | refs/heads/master | DownloaderForReddit/utils/importers/json_importer.py | 1 | """
Downloader for Reddit takes a list of reddit users and subreddits and downloads content posted to reddit either by the
users or on the subreddits.
Copyright (C) 2017, Kyle Hickey
This file is part of the Downloader for Reddit.
Downloader for Reddit is free software: you can redistribute it and/or modify
it und... |
litui/openparliament | refs/heads/master | parliament/accounts/migrations/0003_rename_data.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_add_name_and_bouncedata'),
]
operations = [
migrations.RemoveField(
mod... |
gunan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/decode_image_op_test.py | 22 | # 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... |
jordanemedlock/psychtruths | refs/heads/master | temboo/Library/Amazon/IAM/DeleteSigningCertificate.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# DeleteSigningCertificate
# Deletes the specified signing certificate associated with the specified user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, V... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.