repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jack51706/FuzzLabs | refs/heads/master | requests/network_HTTP.py | 7 | # =============================================================================
# (Very) Basic HTTP Fuzzer
# - used only for testing, a better implementation is required. -
# This file is part of the FuzzLabs Fuzzing Framework
# Author: FuzzLabs
# ========================================================================... |
GaryKriebel/osf.io | refs/heads/develop | website/addons/wiki/tests/config.py | 6 | EXAMPLE_DOCS = [ # Collection stored as "docs"
{
"_data": "one two",
"_type": "http://sharejs.org/types/textv1",
"_v": 8,
"_m": {
"mtime": 1415654366808,
"ctime": 1415654358668
},
"_id": "26aabd89-541b-5c02-9e6a-ad332ba43118"
},
{
... |
PyCon/pycon | refs/heads/master | symposion/conference/views.py | 13 | from django.http import Http404
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
@login_required
def user_list(request):
if not request.user.is_staff:
raise Http404()
return render(request, "conference/... |
actmd/Diamond | refs/heads/master | src/collectors/kvm/kvm.py | 31 | # coding=utf-8
"""
Collects /sys/kernel/debug/kvm/*
#### Dependencies
* /sys/kernel/debug/kvm
"""
import diamond.collector
import os
class KVMCollector(diamond.collector.Collector):
PROC = '/sys/kernel/debug/kvm'
def get_default_config_help(self):
config_help = super(KVMCollector, self).get_de... |
insomnia-lab/calibre | refs/heads/master | src/cherrypy/process/plugins.py | 81 | """Site services for use with a Web Site Process Bus."""
import os
import re
import signal as _signal
import sys
import time
import threading
from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident, ntob, set
# _module__file__base is used by Autoreload to make
# absolute any filenames retrieved from ... |
Distrotech/qtwebkit | refs/heads/distrotech-qtwebkit | Tools/Scripts/webkitpy/common/config/urls_unittest.py | 124 | # Copyright (C) 2012 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... |
kjb085/cmdvninja-sublime | refs/heads/master | requests/packages/urllib3/packages/__init__.py | 2161 | from __future__ import absolute_import
from . import ssl_match_hostname
|
mpurzynski/MozDef | refs/heads/master | tests/cron/test_auth02mozdef.py | 2 | from cron.auth02mozdef import process_msg
import mozdef_client as mozdef
from mozdef_util.utilities.dot_dict import DotDict
class TestAuth0Messages():
def setup(self):
sample_event = {
'_id': '123456789101112131415',
'auth0_client': {
'name': 'auth0.js',
... |
drxaero/calibre | refs/heads/master | src/calibre/srv/routes.py | 9 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>'
import httplib, sys, inspect, re, time, numbers, json as jsonlib, textwrap
f... |
FiloSottile/youtube-dl | refs/heads/master | youtube_dl/extractor/googleplus.py | 129 | # coding: utf-8
from __future__ import unicode_literals
import re
import codecs
from .common import InfoExtractor
from ..utils import unified_strdate
class GooglePlusIE(InfoExtractor):
IE_DESC = 'Google Plus'
_VALID_URL = r'https://plus\.google\.com/(?:[^/]+/)*?posts/(?P<id>\w+)'
IE_NAME = 'plus.google'... |
msegado/edx-platform | refs/heads/master | scripts/hotfix.py | 154 | #!/usr/bin/env python
"""
Script to generate alton and git commands for executing hotfixes
Commands for:
- cutting amis
- creating hotfix tag
The script should be run with the hotfix's git hash as a command-line argument.
i.e. `python scripts/hotfix.py <hotfix hash>`
"""
from __future__ import print_function
from ... |
TuxEatPi/common | refs/heads/master | tuxeatpi_common/registry.py | 1 | """Module to handle registry in Etcd"""
import json
import logging
import os
import time
class RegistryHandler(object):
"""Registry handler class"""
def __init__(self, component_name, component_version, etcd_wrapper):
self.root_key = "/registry"
self.name = component_name
self.version... |
popazerty/dvbapp2-gui | refs/heads/master | lib/python/Screens/PiPSetup.py | 5 | from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap
from Components.Label import Label
# this is not so great.
MAX_X = 720
MAX_Y = 576
MAX_W = MAX_X * 3 / 4
MAX_H = MAX_Y * 3 / 4
MIN_W = MAX_X / 8
MIN_H = MAX_Y / 8
def clip(val, min, max):
if min <= val <= max:
return val
if min <= ... |
245967906/litchi | refs/heads/master | apps/asset/forms.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from logic.comm_def import AssetType, AssetStatusType
from logic.db.litchi.models import Asset, AssetGroup
class AssetGroupCreateForm(forms.Form):
name = forms.CharField(
required=True,
max_length=20,
... |
amplifylitco/asiaq | refs/heads/master | tests/unit/test_disco_deploy.py | 1 | """
Tests of disco_bake
"""
from __future__ import print_function
import random
from unittest import TestCase
from datetime import datetime, timedelta
import boto.ec2.instance
import requests
import requests_mock
from mock import MagicMock, create_autospec, call, patch, ANY
from disco_aws_automation import DiscoDepl... |
GasimGasimzada/django-ckeditor-filebrowser-filer | refs/heads/develop | ckeditor_filebrowser_filer/urls.py | 1 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
from .views import *
urlpatterns = patterns('',
url(r'version/$', filer_version, name='filer_version'),
url(r'setting/(?P<setting>\w+)/$', get_setting, name='get_setting'),
url(r'url_reverse/$', url_reverse, name='js_url_reverse'),
url(... |
dieterich-lab/FUCHS | refs/heads/master | FUCHS/get_coverage_profile.py | 1 | # python script to get coverage profile for circle
# include some checks to make sure input was provided correctly
# required packages
import os
import argparse
import pybedtools
import tempfile
class get_coverage_profile(object):
def __init__(self, exon_index, split_character, platform, bedfile, outfolder, samp... |
provaleks/o8 | refs/heads/8.0 | addons/account/report/account_general_journal.py | 381 | # -*- 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... |
mgedmin/ansible | refs/heads/devel | lib/ansible/modules/network/vyos/vyos_config.py | 29 | #!/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... |
ivar1234/babu.repo | refs/heads/devel | lib/ansible/plugins/lookup/random_choice.py | 253 | # (c) 2013, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
dcroc16/skunk_works | refs/heads/master | google_appengine/lib/django-1.5/django/contrib/sitemaps/tests/https.py | 219 | from __future__ import unicode_literals
from datetime import date
from django.test.utils import override_settings
from .base import SitemapTestsBase
class HTTPSSitemapTests(SitemapTestsBase):
protocol = 'https'
urls = 'django.contrib.sitemaps.tests.urls.https'
def test_secure_sitemap_index(self):
... |
tajkhan/pluto | refs/heads/master | orio-0.1.0/src/module/polysyn/syn_transformator.py | 5 | #
# A class used to perform syntactic transformation
#
import os, re, shlex, sys
#---------------------------------------------------------
class SynTransformator:
'''The syntactic transformator'''
def __init__(self, verbose, permut, unroll_factors, scalar_replace, vectorize):
'''To instantiate a sy... |
marcosleonefilho/hoop-pymongo | refs/heads/master | gridfs/errors.py | 5 | # Copyright 2009-2010 10gen, 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,... |
johngian/mozillians | refs/heads/master | mozillians/users/migrations/0034_idpprofile_username.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-29 15:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0033_auto_20180524_0710'),
]
operations = [
migrations.AddField(
... |
duk3luk3/client | refs/heads/develop | src/connectivity/turn.py | 2 | import logging
from abc import ABCMeta, abstractmethod
import struct
from enum import Enum
from connectivity.stun import STUNMessage, STUN_MAGIC_COOKIE
class TURNState(Enum):
INITIALIZING = 0
BOUND = 1
UNBOUND = 2
STOPPED = 3
class TURNSession(metaclass=ABCMeta):
"""
Abstract TURN session ... |
HydrelioxGitHub/home-assistant | refs/heads/dev | homeassistant/components/verisure/switch.py | 2 | """Support for Verisure Smartplugs."""
import logging
from time import time
from homeassistant.components.verisure import HUB as hub
from homeassistant.components.verisure import CONF_SMARTPLUGS
from homeassistant.components.switch import SwitchDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, c... |
pabloborrego93/edx-platform | refs/heads/master | lms/djangoapps/verify_student/tests/test_integration.py | 26 | """
Integration tests of the payment flow, including course mode selection.
"""
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from student.tests.factories import UserFactory
from student... |
mway08/thrift | refs/heads/master | contrib/fb303/py/fb303/FacebookBase.py | 173 | #!/usr/bin/env python
#
# 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
# "L... |
JonasWallin/logisticnormal | refs/heads/master | tests/test_scalingRegression.py | 1 | '''
Various simple test for the scaling regression
Created on Mar 31, 2016
@author: jonaswallin
'''
import unittest
import os
import numpy as np
import numpy.random as npr
from logisticnormal.distribution_cython import MultivariatenormalScalingCython as MultivariatenormalScaling # @UnresolvedImport
class Test_sca... |
atosatto/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vpc_route_table_facts.py | 62 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... |
smmribeiro/intellij-community | refs/heads/master | python/testData/property/Decorated.py | 83 | # Python 2.6+
class A(object):
@property
def w1(self):
return self._v
@w1.setter
def w1(self, v):
self._v = v
@w1.deleter
def w1(self):
pass
@property
def w2(self):
"doc of w2"
return self._v
@w2.setter # inefficient
def wXXX(self, v):
self._v = v
# deleter absent... |
ajeeth/fusecompress | refs/heads/master | test/dedup_attrs3.py | 6 | # make sure attributes from attr file are preserved when deduping
# This can happen if a file was a duplicate before but is now the only
# instance remaining, and then a new file with the same content is created.
# If this new file is found first, the old file will be dedup-linked to
# the new one. In this case, it is... |
qtekfun/htcDesire820Kernel | refs/heads/master | external/chromium_org/chrome/tools/build/win/syzygy_instrument.py | 71 | #!/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.
"""A utility script to help building Syzygy-instrumented Chrome binaries."""
import glob
import logging
import optparse
import os
... |
stephengroat/miasm | refs/heads/master | miasm2/arch/arm/ira.py | 2 | #-*- coding:utf-8 -*-
from miasm2.ir.analysis import ira
from miasm2.arch.arm.sem import ir_arml, ir_armtl, ir_armb, ir_armtb
class ir_a_arml_base(ir_arml, ira):
def __init__(self, symbol_pool=None):
ir_arml.__init__(self, symbol_pool)
self.ret_reg = self.arch.regs.R0
class ir_a_armb_base(ir_arm... |
oikoumene/eappi.map | refs/heads/master | eappi/map/interfaces.py | 1 | from zope.interface import Interface
from zope import schema
class IProductSpecific(Interface):
pass
class IEappiSettings(Interface):
openmapquest_api_key = schema.TextLine(
title=u'Open Map Quest API Key',
default=u''
)
|
janusnic/21v-python | refs/heads/master | unit_20/parallel_ml/notebooks/solutions/04B_more_categorical_variables.py | 1 | features = pd.concat([data.get(['Fare', 'Age']),
pd.get_dummies(data.Sex, prefix='Sex'),
pd.get_dummies(data.Pclass, prefix='Pclass'),
pd.get_dummies(data.Embarked, prefix='Embarked')],
axis=1)
features = features.drop('Sex_male', 1)... |
goodwillcoding/RIDE | refs/heads/master | rtest/test_runner.py | 3 | import inspect
from model import RIDE
import random
import shutil
import os
class Runner(object):
def __init__(self, seed, path, root):
self._path = path
self._root = root
self._seed = seed
self._model = None
self._random = random
def initialize(self):
shutil.... |
berquist/PyQuante | refs/heads/master | PyQuante/CachedIntindex.py | 3 | # Experiment to see if caching the two electron integral indices
# would speed things up. It didn't speed things up appreciably,
# if at all, but I'm keeping the code around for reference.
class CachedIntindex:
# Yuck! N4 storage
def __init__(self):
self.cache = {}
def initialize(self,nbf):
... |
o5k/openerp-oemedical-v0.1 | refs/heads/master | openerp/addons/fleet/__openerp__.py | 51 | # -*- 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... |
abstract-open-solutions/OCB | refs/heads/8.0 | addons/website_membership/models/product.py | 338 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
gluke77/rally | refs/heads/master | rally/deployment/serverprovider/providers/virsh.py | 6 | # Copyright 2013: Mirantis 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... |
pyblish/pyblish-magenta | refs/heads/master | pyblish_magenta/plugins/validate_units_angular.py | 2 | import pyblish.api
@pyblish.api.log
class ValidateUnitsAngular(pyblish.api.Validator):
"""Scene angular units must be in degrees"""
label = "Units (angular)"
families = ["rig", "model", "pointcache", "curves"]
def process(self, context):
units = context.data('angularUnits')
self.log.... |
grbd/GBD.Build.BlackJack | refs/heads/master | blackjack/cmake/__init__.py | 1 | # This represents the root of the Sections
# Typically this code pieces together CMakeLists.txt files using Class's that inherit from ScriptBase
# Class Imports
from .ScriptBase import ScriptBase
from .Solution import Solution
# TODO remove this
# Constants
src_dir = "${CMAKE_CURRENT_SOURCE_DIR}"
|
amarandon/pinax | refs/heads/master | pinax/projects/private_beta_project/manage.py | 32 | #!/usr/bin/env python
import sys
try:
import pinax
except ImportError:
sys.stderr.write("Error: Can't import Pinax. Make sure you are in a "
"virtual environment that has\nPinax installed.\n")
sys.exit(1)
else:
import pinax.env
from django.core.management import execute_from_command_line
pin... |
singhj/locality-sensitive-hashing | refs/heads/master | tweepy/__init__.py | 20 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
"""
Tweepy Twitter API library
"""
__version__ = '2.2'
__author__ = 'Joshua Roesslein'
__license__ = 'MIT'
from tweepy.models import Status, User, DirectMessage, Friendship, SavedSearch, SearchResults, ModelFactory, Category
from tweepy.error ... |
soutaro/nullarihyon | refs/heads/master | vendor/googletest/googletest/test/gtest_test_utils.py | 344 | #!/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... |
peixuan/GIMP-Mod | refs/heads/master | plug-ins/pygimp/plug-ins/shadow_bevel.py | 16 | #!/usr/bin/env python
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 1997 James Henstridge <james@daa.com.au>
#
# 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 Fou... |
privacyidea/privacyidea | refs/heads/master | tests/ldap3mock.py | 1 | # -*- coding: utf-8 -*-
"""
2020-09-07 Cornelius Kölbel <cornelius.koelbel@netknights.it>
Add exception
2017-04-26 Friedrich Weber <friedrich.weber@netknights.it>
Make it possible to check for correct LDAPS/STARTTLS settings
2017-01-08 Cornelius Kölbel <cornelius.koelbel@netknights.it>
... |
tmendoza/func | refs/heads/master | func/minion/modules/overlord.py | 5 | # Copyright 2008, Red Hat, Inc
# Steve Salevan <ssalevan@redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., ... |
Smile-SA/odoo_addons | refs/heads/12.0 | smile_script/models/__init__.py | 1 | # -*- coding: utf-8 -*-
# (C) 2019 Smile (<http://www.smile.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import script
from . import script_intervention
|
tiagoprn/experiments | refs/heads/master | micro/click_cli_arguments.py | 1 | # coding: utf-8
"""
Demonstrate the use of the click library for CLI arguments.
Must have the following installed through pip:
$ pip install click
Run examples:
$ python click_cli_arguments.py --help
$ touch /tmp/test.txt && python click_cli_arguments.py --file-name '/tmp/test.txt' --technique 'random... |
jylaxp/django | refs/heads/master | django/contrib/gis/db/models/functions.py | 54 | from decimal import Decimal
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import AreaField
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.measure import (
Area as AreaMeasure, Distance as DistanceMeasure,
)
from django.core.ex... |
ingwinlu/pelican-plugins | refs/heads/master | glossary/__init__.py | 26 | from .glossary import *
|
ojengwa/grr | refs/heads/master | gui/views.py | 2 | #!/usr/bin/env python
"""Main Django renderer."""
import importlib
import os
import pdb
import time
from django import http
from django import shortcuts
from django import template
from django.views.decorators import csrf
import psutil
import logging
from grr import gui
from grr.gui import api_call_renderers
from ... |
MFoster/breeze | refs/heads/master | django/conf/urls/static.py | 323 | import re
from django.conf import settings
from django.conf.urls import patterns, url
from django.core.exceptions import ImproperlyConfigured
def static(prefix, view='django.views.static.serve', **kwargs):
"""
Helper function to return a URL pattern for serving files in debug mode.
from django.conf import... |
fafaman/django | refs/heads/master | django/contrib/gis/db/backends/postgis/schema.py | 333 | from django.db.backends.postgresql.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
rast_index_wrapper = 'ST_ConvexHull(%s)'
sql_add_spatial_index = "CREATE INDEX %(index)s ON %(table)s USING %(inde... |
rlugojr/django | refs/heads/master | tests/view_tests/models.py | 106 | """
Regression tests for Django built-in views.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_url(self):
return '/authors/%s/' % self.id
class BaseArticle(models.Model):
"""... |
yrapop01/treecoreset | refs/heads/master | coreset.py | 1 | #!/usr/bin/python
import multiprocessing
import numpy as np
import mkcells
import ctypes
import time
def make_cells(data, axis):
doubleptr = ctypes.POINTER(ctypes.c_double)
usizeptr = ctypes.POINTER(ctypes.c_size_t)
d = data.ctypes.data_as(doubleptr)
n, dims = data.shape
mid = mkcells.make(dims, ... |
hopeall/odoo | refs/heads/8.0 | addons/mail/tests/__init__.py | 261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
jtakayama/ics691-setupbooster | refs/heads/master | makahiki/apps/widgets/help/models.py | 9 | """The model for help topics."""
from django.conf import settings
from django.db import models
HELP_CATEGORIES = (
("faq", "Frequently Asked Questions"),
("rules", "Rules of the competition"),
("widget", "Widget Help"),
)
"""Defines the available help categories."""
class HelpTopic(models.Model):
... |
fredericlepied/ansible | refs/heads/devel | contrib/inventory/zone.py | 196 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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
# ... |
ambitioninc/container-transform | refs/heads/master | container_transform/client.py | 3 | import click
from .converter import Converter
from .schema import InputTransformationTypes, OutputTransformationTypes
from .version import __version__
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.command(context_settings=CONTEXT_SETTINGS)
@click.argument(
'input_file',
envvar='CT_INPU... |
schristiaens/raft | refs/heads/master | thirdparty/pyamf/pyamf/adapters/_sets.py | 45 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Adapter for the stdlib C{sets} module.
@since: 0.4
"""
import sets
import pyamf
from pyamf.adapters import util
if hasattr(sets, 'ImmutableSet'):
pyamf.add_type(sets.ImmutableSet, util.to_tuple)
if hasattr(sets, 'Set'):
pyamf.add_type(... |
transformation/utatuav-interop | refs/heads/master | auvsi/server/auvsi_suas/models/waypoint_test.py | 2 | """Tests for the waypoint module."""
from auvsi_suas.models import AerialPosition
from auvsi_suas.models import GpsPosition
from auvsi_suas.models import Waypoint
from django.test import TestCase
class TestWaypointModel(TestCase):
"""Tests the Waypoint model."""
def test_unicode(self):
"""Tests the ... |
Mbarak-Mbigo/cp1_project | refs/heads/develop | run.py | 1 | #!/usr/bin/env python
"""
This example uses docopt with the built in cmd module to demonstrate an
interactive command application.
Usage:
amity create_room ( office | living ) <room_name>...
amity add_person < person_name > < FELLOW | STAFF > [ wants_accommodation ]
amity reallocate_person <person_identifi... |
EliotBerriot/mnm | refs/heads/master | mnm/users/tests/test_models.py | 184 | from test_plus.test import TestCase
class TestUser(TestCase):
def setUp(self):
self.user = self.make_user()
def test__str__(self):
self.assertEqual(
self.user.__str__(),
'testuser' # This is the default username for self.make_user()
)
def test_get_absolu... |
eahneahn/free | refs/heads/master | lib/python2.7/site-packages/django/contrib/gis/tests/geoapp/test_regress.py | 62 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
from django.contrib.gis.shortcuts import render_to_kmz
from django.contrib.gis.tests.utils im... |
BondAnthony/ansible | refs/heads/devel | lib/ansible/module_utils/facts/network/dragonfly.py | 232 | # 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 in the hope that ... |
151706061/three.js | refs/heads/master | utils/exporters/blender/2.66/scripts/addons/io_mesh_threejs/export_threejs.py | 2 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
cloudwork/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/latex.py | 61 | """SCons.Tool.latex
Tool-specific initialization for LaTeX.
Generates .dvi files from .latex or .ltx files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006... |
asacamano/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/sunar.py | 19 | """engine.SCons.Tool.sunar
Tool-specific initialization for Solaris (Forte) ar (library archive). If CC
exists, static libraries should be built with it, so that template
instantians can be resolved.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic S... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/enums/types/positive_geo_target_type.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
sameerparekh/pants | refs/heads/master | src/python/pants/backend/python/sdist_builder.py | 33 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pex.... |
Shetty4L/mnist-pytorch | refs/heads/master | tests.py | 1 | if __name__ == '__main__':
assert True == True
|
stonebig/bokeh | refs/heads/master | tests/integration/tools/test_pan_tool.py | 5 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... |
heracek/django-nonrel | refs/heads/master | tests/regressiontests/forms/localflavor/be.py | 52 | from django.contrib.localflavor.be.forms import (BEPostalCodeField,
BEPhoneNumberField, BERegionSelect, BEProvinceSelect)
from utils import LocalFlavorTestCase
class BELocalFlavorTests(LocalFlavorTestCase):
def test_BEPostalCodeField(self):
error_format = [u'Enter a valid postal code in the range and... |
chiviak/CouchPotatoServer | refs/heads/master | libs/tornado/gen.py | 64 | """``tornado.gen`` is a generator-based interface to make it easier to
work in an asynchronous environment. Code using the ``gen`` module
is technically asynchronous, but it is written as a single generator
instead of a collection of separate functions.
For example, the following asynchronous handler::
class Asy... |
clumsy/intellij-community | refs/heads/master | python/testData/completion/dictKeyPrefix2.py | 166 | s = { 'a': 'b', 'kkkappa': 'd', 'lambda': 'foo' }
s['k]kap''<caret>'] |
caranicas/3D-steering-behaviors | refs/heads/master | bower_components/threejs/utils/build/build.py | 24 | #!/usr/bin/env python
import sys
if sys.version_info < (2, 7):
print("This script requires at least Python 2.7.")
print("Please, update to a newer version: http://www.python.org/download/releases/")
exit()
import argparse
import json
import os
import shutil
import tempfile
def main(argv=None):
parser = argpar... |
brennentsmith/teletraan | refs/heads/master | deploy-board/deploy_board/webapp/build_views.py | 8 | # Copyright 2016 Pinterest, 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 writi... |
waseem18/bedrock | refs/heads/master | vendor-local/lib/python/south/management/commands/__init__.py | 153 |
# Common framework for syncdb actions
import copy
from django.core import management
from django.conf import settings
# Make sure the template loader cache is fixed _now_ (#448)
import django.template.loaders.app_directories
from south.hacks import hacks
from south.management.commands.syncdb import Command as Sync... |
ciprian-radu/unimap.ns-3noc | refs/heads/master | bindings/python/apidefs/gcc-LP64/ns3_module_nix_vector_routing.py | 10 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class]
module.add_class('Ipv4NixVectorRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
typ... |
barma1309/Kalista | refs/heads/master | .virtualenvs/Kalista/lib/python3.4/site-packages/pip/_vendor/requests/structures.py | 149 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
from .compat import OrderedDict
class CaseInsensitiveDict(collections.MutableMapping):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of... |
tgroh/incubator-beam | refs/heads/master | sdks/python/apache_beam/io/gcp/datastore/v1/adaptive_throttler_test.py | 9 | #
# 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... |
ak2703/edx-platform | refs/heads/master | common/djangoapps/student/tests/test_credit.py | 5 | """
Tests for credit courses on the student dashboard.
"""
import unittest
import datetime
from mock import patch
import pytz
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import ModuleStoreTes... |
szopu/django | refs/heads/master | django/conf/locale/te/formats.py | 619 | # -*- 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 = 'j F Y'
TIME_FORMAT = 'g:i A'
# DA... |
ovilab/lammps | refs/heads/master | examples/ASPHERE/line/line.viz.py | 49 | # Pizza.py viz of line output
d = dump("dump1.atom dump2.atom")
ld = ldump("dump1.line dump2.line")
ld.map(1,"id",2,"type",3,"end1x",4,"end1y",5,"end2x",6,"end2y")
d.extra(ld)
g = gl(d)
g.arad(1,0.2)
g.lrad(1,5)
g.lcol(1,"yellow")
v = vcr(g)
|
dpshelio/sunpy | refs/heads/master | sunpy/map/sources/tests/test_cor_source.py | 2 | """Test cases for STEREO Map subclasses.
This particular test file pertains to CORMap.
@Author: Pritish C. (VaticanCameos)
"""
import os
import glob
from sunpy.map.sources.stereo import CORMap
from sunpy.map import Map
import sunpy.data.test
path = sunpy.data.test.rootdir
fitspath = glob.glob(os.path.join(path, "cor... |
johnnyliu27/openmc | refs/heads/develop | openmc/capi/__init__.py | 1 | """
This module provides bindings to C functions defined by OpenMC shared library.
When the :mod:`openmc` package is imported, the OpenMC shared library is
automatically loaded. Calls to the OpenMC library can then be via functions or
objects in the :mod:`openmc.capi` subpackage, for example:
.. code-block:: python
... |
shsingh/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_host_info.py | 20 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... |
gebart/RIOT | refs/heads/master | tests/fmt_print/tests/01-run.py | 25 | #!/usr/bin/env python3
import sys
from testrunner import run
def testfunc(child):
child.expect_exact('If you can read this:')
child.expect_exact('Test successful.')
if __name__ == "__main__":
sys.exit(run(testfunc))
|
sonnyhu/werkzeug | refs/heads/master | tests/contrib/test_securecookie.py | 30 | # -*- coding: utf-8 -*-
"""
tests.securecookie
~~~~~~~~~~~~~~~~~~
Tests the secure cookie.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.utils import parse_cookie
from werkzeug.wrappers import Request, Response
from werkzeug.contrib.securec... |
SlicerRt/SlicerDebuggingTools | refs/heads/master | PyDevRemoteDebug/ptvsd-4.1.3/ptvsd/_vendored/pydevd/_pydev_imps/_pydev_SocketServer.py | 2 | """Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <s... |
mikey1234/script.module.urlresolver | refs/heads/master | lib/urlresolver/plugins/videotanker.py | 3 | '''
videotanker urlresolver plugin
Copyright (C) 2013 icharania
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 i... |
rven/odoo | refs/heads/14.0-fix-partner-merge-mail-activity | addons/gamification/wizard/__init__.py | 43 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import update_goal
from . import grant_badge
|
tarasane/h2o-3 | refs/heads/master | h2o-py/tests/testdir_demos/pyunit_gbm_demo.py | 6 | import sys
sys.path.insert(1, "../../")
import h2o, tests
def demo_gbm():
h2o.demo(func="gbm", interactive=False, test=True)
if __name__ == "__main__":
tests.run_test(sys.argv, demo_gbm)
|
mitchlloyd/training | refs/heads/master | client/node_modules/ember-cli/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 446 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... |
Workday/OpenFrame | refs/heads/master | tools/telemetry/telemetry/internal/app/__init__.py | 44 | # 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.
class App(object):
""" A running application instance that can be controlled in a limited way.
Be sure to clean up after yourself by calling Close() wh... |
beccannlittle/gateway | refs/heads/develop | gateway/controllers/minigame/survey.py | 1 | """
survey minigame.
this minigame shows user how to survey potential customers
"""
from django.contrib.auth import logout, authenticate, login
from django.shortcuts import render
from gateway.models.Survey import Survey_Form
from gateway.models.venture import Venture
from django.db import transaction
def survey_vie... |
moremorefor/Logpot | refs/heads/master | logpot/image/models.py | 1 | #-*- coding: utf-8 -*-
from logpot.ext import db
from logpot.models import TimestampMixin
from logpot.entry.models import Entry
from logpot.image.generate import createThumbnailImage
from flask import current_app
from sqlalchemy import event
import os
import os.path as op
import sys
class Image(db.Model, Timestamp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.