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 |
|---|---|---|---|---|---|
kbrebanov/ansible | lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py | 73 | 5430 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
Neil741/ryu-master | ryu/controller/mac_to_network.py | 53 | 1960 | # Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
ihydrogen/hydrogen-chat-bot-py | vk_auth/account_manager.py | 1 | 1237 | import json as j
from utils import config_file
from vk_api.api import Account
# Name for key of acc list
ACCOUNT_LIST = "account list"
class AccountManager:
def __init__(self, location=config_file.CONF_FILE):
self.location = location
# location of file with users
location = config_file.CONF_FI... | apache-2.0 |
brain-tec/stock-logistics-workflow | stock_scanner/demo/Tutorial/Sentinel/scanner_scenario_step_sentinel_scrolling.py | 7 | 1294 | # flake8: noqa
# Use <m> or <message> to retrieve the data transmitted by the scanner.
# Use <t> or <terminal> to retrieve the running terminal browse record.
# Put the returned action code in <act>, as a single character.
# Put the returned result or message in <res>, as a list of strings.
# Put the returned value in ... | agpl-3.0 |
mdrumond/tensorflow | tensorflow/contrib/eager/python/evaluator.py | 3 | 8094 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
gtko/CouchPotatoServer | libs/git/repository.py | 109 | 20401 | # Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com>
# 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 li... | gpl-3.0 |
ThiefMaster/sqlalchemy | examples/inheritance/concrete.py | 30 | 2146 | """Concrete (table-per-class) inheritance example."""
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, \
String
from sqlalchemy.orm import mapper, sessionmaker, polymorphic_union
metadata = MetaData()
managers_table = Table('managers', metadata,
Column('employee_id', Integer, primary_k... | mit |
Codlydodly/python-client | venv/lib/python2.7/site-packages/pyglet/gl/glx.py | 9 | 27168 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | mit |
dribnet/kerosene | examples/cifar100.py | 1 | 4023 | from __future__ import absolute_import
from __future__ import print_function
import os
import itertools
import numpy as np
np.random.seed(1337) # for reproducibility
from kerosene.datasets import cifar100
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.... | mit |
randynobx/ansible | lib/ansible/modules/cloud/docker/docker_login.py | 59 | 10937 | #!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.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 ... | gpl-3.0 |
nju520/flask | flask/wrappers.py | 142 | 7532 | # -*- coding: utf-8 -*-
"""
flask.wrappers
~~~~~~~~~~~~~~
Implements the WSGI wrappers (request and response).
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
from werkzeug.exce... | bsd-3-clause |
Andrey-Pavlov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committers_unittest.py | 121 | 20173 | # Copyright (C) 2009 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 |
vladryk/horizon | openstack_dashboard/dashboards/settings/password/views.py | 59 | 1226 | # Copyright 2013 Centrin Data Systems Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
gx1997/chrome-loongson | native_client_sdk/src/build_tools/nacl-mono-builder.py | 6 | 4294 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import sys
import tarfile
import buildbot_common
SDK_BUILD_DIR = buildbot_common.SCRIPT_DIR
MONO_BUILD_... | bsd-3-clause |
saleemjaveds/https-github.com-openstack-nova | nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/010_add_preserve_ephemeral.py | 13 | 1917 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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... | apache-2.0 |
hivesolutions/netius | src/netius/servers/mjpg.py | 1 | 4196 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... | apache-2.0 |
canassa/django-rest-framework | rest_framework/fields.py | 3 | 55583 | from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import inspect
import re
import uuid
from django.conf import settings
from django.core.exceptions import ValidationError as DjangoValidationError
from django.core.exceptions import ObjectDoesNotExist
from django.core... | bsd-2-clause |
Azure/azure-linux-extensions | VMBackup/main/fsfreezer.py | 1 | 14571 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft Corporation
#
# 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
#
# U... | apache-2.0 |
rghe/ansible | lib/ansible/plugins/action/fortios_config.py | 56 | 3105 | #
# (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... | gpl-3.0 |
photoninger/ansible | lib/ansible/plugins/connection/lxc.py | 44 | 8156 | # (c) 2015, Joerg Thalheim <joerg@higgsboson.tk>
# 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
DOCUMENTATION = """
author: Joerg Thalheim <joe... | gpl-3.0 |
gangadharkadam/office_frappe | frappe/patches/v4_0/file_manager_hooks.py | 37 | 1114 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os
from frappe.utils import get_files_path
from frappe.utils.file_manager import get_content_hash, get_file
def execute():
frappe.reload_doc('core', 'd... | mit |
andersonresende/django | tests/view_tests/tests/test_defaults.py | 23 | 3139 | from __future__ import unicode_literals
from django.test import TestCase
from django.test.utils import override_settings, override_with_test_loader
from ..models import UrlArticle
@override_settings(ROOT_URLCONF='view_tests.urls')
class DefaultsTests(TestCase):
"""Test django views in django/views/defaults.py""... | bsd-3-clause |
chrisseto/osf.io | website/routes.py | 1 | 50326 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import httplib as http
from flask import request
from flask import send_from_directory
from geoip import geolite2
from framework import status
from framework import sentry
from framework.auth import cas
from framework.routing import Rule
from f... | apache-2.0 |
xiaojunwu/crosswalk-test-suite | webapi/tct-2dtransforms-css3-tests/inst.wgt.py | 144 | 5918 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=u... | bsd-3-clause |
Batterfii/django | tests/template_tests/syntax_tests/test_url.py | 42 | 10811 | # coding: utf-8
from django.core.urlresolvers import NoReverseMatch, resolve
from django.template import RequestContext, TemplateSyntaxError
from django.test import RequestFactory, SimpleTestCase, override_settings
from ..utils import setup
@override_settings(ROOT_URLCONF='template_tests.urls')
class UrlTagTests(Sim... | bsd-3-clause |
216software/Profiles | communityprofiles/profiles/oldmigrations/0024_auto__add_field_indicator_data_type.py | 2 | 12944 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Indicator.data_type'
db.add_column('profiles_indicator', 'data_type', self.gf('django.db.m... | mit |
EvanK/ansible | lib/ansible/modules/cloud/cloudstack/cs_network_acl.py | 14 | 5606 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
maoxianfei/Crawer | Login/wolai66.py | 1 | 2953 | #!/usr/bin/env python
# encoding: utf-8
import re
import base64
import requests
from bs4 import BeautifulSoup
def decode(s1):
return base64.b64decode(s1)
def getpoints():
url='http://www.wolai66.com/sign_in'
headers={
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML,... | gpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/jinja2-2.6/docs/cache_extension.py | 54 | 2130 | from jinja2 import nodes
from jinja2.ext import Extension
class FragmentCacheExtension(Extension):
# a set of names that trigger the extension.
tags = set(['cache'])
def __init__(self, environment):
super(FragmentCacheExtension, self).__init__(environment)
# add the defaults to the envir... | mit |
likaiwalkman/bootstrap | test-infra/s3_cache.py | 2166 | 5734 | #!/usr/bin/env python2.7
# pylint: disable=C0301
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, chdir, remove as _delete_file
from os.path import dirname, basename, abspath, realpath, expandvars
from hashlib import sha256
from subpr... | mit |
mikepk/pybald-routes | tests/test_functional/profile_rec.py | 1 | 3114 | import profile
import pstats
import tempfile
import os
import time
from routes import Mapper
def get_mapper():
m = Mapper()
m.connect('', controller='articles', action='index')
m.connect('admin', controller='admin/general', action='index')
m.connect('admin/comments/article/:article_id/:action/:id',
... | bsd-3-clause |
Eksmo/calibre | src/calibre/gui2/catalog/catalog_bibtex.py | 6 | 3802 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2 import gprefs
from calibre.gui2.catalog.catalog_bibtex_ui import U... | gpl-3.0 |
souravbadami/oppia | core/domain/search_services.py | 1 | 9218 | # coding: utf-8
#
# Copyright 2017 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
unindented/streamcode | client/static/jsrepl/extern/python/closured/lib/python2.7/lib2to3/fixes/fix_throw.py | 327 | 1586 | """Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. im... | mit |
nic7aller/bip-switch | BipFlaskProject/BipFlaskProject/env/Lib/re.py | 131 | 13423 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | mit |
JasonCormie/ansible-modules-extras | network/f5/bigip_sys_db.py | 10 | 5825 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
adrienpacifico/openfisca-france | openfisca_france/scripts/reindent_xml_files.py | 3 | 1950 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Reindent XML files."""
import argparse
import logging
import os
import sys
import xml.etree.ElementTree as etree
from openfisca_france import decompositions, param
app_name = os.path.splitext(os.path.basename(__file__))[0]
log = logging.getLogger(app_name)
def i... | agpl-3.0 |
Duoxilian/home-assistant | homeassistant/helpers/aiohttp_client.py | 9 | 4716 | """Helper for aiohttp webclient stuff."""
import asyncio
import sys
import aiohttp
from aiohttp.hdrs import USER_AGENT, CONTENT_TYPE
from aiohttp import web
from aiohttp.web_exceptions import HTTPGatewayTimeout
import async_timeout
from homeassistant.core import callback
from homeassistant.const import EVENT_HOMEASSI... | mit |
zengenti/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_credential.py | 13 | 9427 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# 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... | gpl-3.0 |
bols-blue/ansible | lib/ansible/plugins/action/template.py | 10 | 7994 | # (c) 2015, 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... | gpl-3.0 |
gileno/curso-scrapy-aulas | modulo-02/olx/olx/middlewares.py | 2 | 1877 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class OlxSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts ... | gpl-3.0 |
Foxboron/stem | test/integ/connection/connect.py | 4 | 2228 | """
Integration tests for the connect_* convenience functions.
"""
import sys
import unittest
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import stem.connection
import test.runner
class TestConnect(unittest.TestCase):
def setUp(self):
# prevents the function from printi... | lgpl-3.0 |
akamel001/Sick-Beard | lib/hachoir_parser/misc/msoffice.py | 90 | 4405 | """
Parsers for the different streams and fragments found in an OLE2 file.
Documents:
- goffice source code
Author: Robert Xiao, Victor Stinner
Creation: 2006-04-23
"""
from lib.hachoir_parser import HachoirParser
from lib.hachoir_core.field import FieldSet, RootSeekableFieldSet, RawBytes
from lib.hachoir_core.endi... | gpl-3.0 |
olivierdalang/stdm | third_party/reportlab/pdfbase/_fontdata_enc_macroman.py | 5 | 2969 | MacRomanEncoding = (
None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, 'space', 'exclam',
'quotedbl', 'num... | gpl-2.0 |
okfde/froide-campaign | froide_campaign/apps.py | 1 | 2843 | import json
from django.apps import AppConfig
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class FroideCampaignConfig(AppConfig):
name = 'froide_campaign'
verbose_name = _("Froide Campaign App")
def ready(self):
from .listeners import connect_info_object... | mit |
openhatch/new-mini-tasks | vendor/packages/Django/django/utils/text.py | 59 | 14935 | from __future__ import unicode_literals
import re
import unicodedata
import warnings
from gzip import GzipFile
from io import BytesIO
from django.utils.encoding import force_text
from django.utils.functional import allow_lazy, SimpleLazyObject
from django.utils import six
from django.utils.six.moves import html_entit... | apache-2.0 |
chimkentec/KodiMODo_rep | plugin.video.tree.tv.dev/core/list.py | 1 | 17148 | # -*- coding: utf-8 -*-
import os, re, sys, json, urllib, hashlib, traceback
import xbmcup.app, xbmcup.db, xbmcup.system, xbmcup.net, xbmcup.parser, xbmcup.gui
import xbmc, cover, xbmcplugin, xbmcgui
from http import HttpData
from auth import Auth
from common import Render
from defines import *
try:
from sqlite3 ... | gpl-3.0 |
cloudviz/agentless-system-crawler | tests/functional/test_logs_no_volumes.py | 3 | 3183 | import logging
import unittest
import tempfile
import os
import shutil
import mock
import utils.dockerutils
import dockercontainer
# Tests dockercontainer._get_logfiles_list
# for the case when no volumes are mounted
def get_container_log_files(path, options):
pass
@mock.patch('dockerconta... | apache-2.0 |
EmadHelmi/chipsec_gui | chipsec/hal/io.py | 2 | 4217 | #!/usr/local/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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; Version 2.
#
#This program is... | gpl-2.0 |
yashaswi-reddy/icsisumm | icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/tokenize/regexp.py | 9 | 6060 | # Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# Trevor Cohn <tacohn@csse.unimelb.edu.au>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICE... | gpl-3.0 |
8u1a/plaso | tests/parsers/winreg_plugins/default.py | 2 | 3480 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the default Windows Registry plugin."""
import unittest
from plaso.dfwinreg import definitions as dfwinreg_definitions
from plaso.dfwinreg import fake as dfwinreg_fake
from plaso.formatters import winreg as _ # pylint: disable=unused-import
from plaso.lib import... | apache-2.0 |
annarev/tensorflow | tensorflow/python/grappler/model_analyzer_test.py | 30 | 2768 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
vipmike007/avocado-vt | selftests/unit/test_libvirt_xml.py | 1 | 46682 | #!/usr/bin/python
import unittest
import os
import shutil
import logging
import sys
from avocado.utils import process
# simple magic for using scripts within a source tree
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.isdir(os.path.join(basedir, 'virttest')):
sys.path.append(b... | gpl-2.0 |
dendisuhubdy/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/masked_matmul_ops_test.py | 111 | 3662 | # Copyright 2017 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 applic... | apache-2.0 |
subutai/htmresearch | projects/sequence_prediction/discrete_sequences/plotRepeatedPerturbExperiment.py | 6 | 14424 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
spisneha25/django | django/contrib/gis/db/backends/base/features.py | 93 | 4051 | import re
from functools import partial
from django.contrib.gis.db.models import aggregates
class BaseSpatialFeatures(object):
gis_enabled = True
# Does the database contain a SpatialRefSys model to store SRID information?
has_spatialrefsys_table = True
# Does the backend support the django.contrib... | bsd-3-clause |
OptiPop/external_chromium_org | chrome/PRESUBMIT.py | 44 | 2676 | # Copyright (c) 2011 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.
"""Presubmit script for changes affecting chrome/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... | bsd-3-clause |
40223243/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/tempfile.py | 728 | 22357 | """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... | agpl-3.0 |
vmarkovtsev/django | tests/get_object_or_404/tests.py | 296 | 3681 | from __future__ import unicode_literals
from django.http import Http404
from django.shortcuts import get_list_or_404, get_object_or_404
from django.test import TestCase
from .models import Article, Author
class GetObjectOr404Tests(TestCase):
def test_get_object_or_404(self):
a1 = Author.objects.create(n... | bsd-3-clause |
usersource/anno | anno_gec_server/lib/requests/structures.py | 1160 | 2977 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
class CaseInsensitiveDict(collections.MutableMapping):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of
``collections.MutableMapping... | mpl-2.0 |
josjevv/django-cms | cms/utils/helpers.py | 36 | 5826 | # -*- coding: utf-8 -*-
import re
from django.contrib.sites.models import SITE_CACHE, Site
from .compat.dj import is_installed
SITE_VAR = "site__exact"
# modify reversions to match our needs if required...
def reversion_register(model_class, fields=None, follow=(), format="json", exclude_fields=None):
"""CMS in... | bsd-3-clause |
hzlf/openbroadcast | website/cms/forms/widgets.py | 3 | 8919 | # -*- coding: utf-8 -*-
from cms.forms.utils import get_site_choices, get_page_choices
from cms.models import Page, PageUser, Placeholder
from cms.plugin_pool import plugin_pool
from cms.utils import get_language_from_request, cms_static_url
from django.conf import settings
from django.contrib.sites.models import Site
... | gpl-3.0 |
marwoodandrew/superdesk-core | superdesk/publish/formatters/__init__.py | 1 | 5236 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | agpl-3.0 |
LittleBun/My_Ardupilot | Tools/autotest/pysim/aircraft.py | 164 | 4001 | import math, util, rotmat, time
import random
from rotmat import Vector3, Matrix3
class Aircraft(object):
'''a basic aircraft class'''
def __init__(self):
self.home_latitude = 0
self.home_longitude = 0
self.home_altitude = 0
self.ground_level = 0
self.frame_height = 0.0
... | gpl-3.0 |
kylelwm/ponus | venv/build/django/django/utils/unittest/__init__.py | 571 | 3069 | """
unittest2
unittest2 is a backport of the new features added to the unittest testing
framework in Python 2.7. It is tested to run on Python 2.4 - 2.6.
To use unittest2 instead of unittest simply replace ``import unittest`` with
``import unittest2``.
Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 P... | mit |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/bq/ez_setup.py | 38 | 8357 | #!/usr/bin/env python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version ... | apache-2.0 |
EttusResearch/gnuradio | gr-trellis/python/trellis/fsm_utils.py | 45 | 7046 | #!/usr/bin/env python
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
multiplechoice/workplace | jobs/spiders/job.py | 1 | 1379 | import dateutil.parser
import scrapy
import scrapy.spiders
from jobs.common import clean_html
from jobs.items import JobsItem
class JobSpider(scrapy.spiders.XMLFeedSpider):
name = "job.is"
start_urls = ["https://atvinna.frettabladid.is/feeds/rss.xml"]
itertag = "item"
namespaces = [("atom", "http://w... | apache-2.0 |
Lokke/eden | modules/geopy/parsers/html.py | 79 | 5617 | import re
from BeautifulSoup import BeautifulSoup, SoupStrainer
from geopy import Point, Location
from geopy.parsers import Parser
from geopy.util import unescape
FLOAT_RE = re.compile(r'([+-]?\d*\.?\d+)$')
class ICBMMetaTag(Parser):
META_NAME = 'ICBM'
def __init__(self, ignore_invalid=True):
sel... | mit |
resmo/ansible | lib/ansible/module_utils/aws/waf.py | 16 | 8204 | # Copyright (c) 2017 Will Thames
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign the... | gpl-3.0 |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/json/tool.py | 11 | 1463 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m json.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m json.tool
Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
"""
import argparse
import json
import sys
... | apache-2.0 |
ddebrunner/streamsx.topology | samples/python/topology/tweepy/tweets.py | 4 | 1514 | # Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
import queue
import json
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import mykeys
def text(item):
"""
Get the text from the tweet
"""
if 'text' in item:
return item['text']
... | apache-2.0 |
thetaxman/git-multimail | setup.py | 3 | 1426 | #! /usr/bin/env python
import sys
import os
from setuptools import setup
assert 0x02040000 <= sys.hexversion, \
"Install Python, version 2.4 or greater"
def read_version():
sys.path.insert(0, os.path.join('git-multimail'))
import git_multimail
return git_multimail.__version__
def read_readme():
... | gpl-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/IPython/html/log.py | 12 | 1696 | #-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------... | mit |
smartscheduling/scikit-learn-categorical-tree | examples/bicluster/plot_spectral_coclustering.py | 276 | 1736 | """
==============================================
A demo of the Spectral Co-Clustering algorithm
==============================================
This example demonstrates how to generate a dataset and bicluster it
using the the Spectral Co-Clustering algorithm.
The dataset is generated using the ``make_biclusters`` f... | bsd-3-clause |
frank-tancf/scikit-learn | doc/conf.py | 15 | 8446 | # -*- coding: utf-8 -*-
#
# scikit-learn documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 8 09:13:42 2010.
#
# This file is execfile()d with the current directory set to its containing
# dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | bsd-3-clause |
prark/bitcoinxt | qa/rpc-tests/test_framework/test_framework.py | 111 | 6318 | #!/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.
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
import shut... | mit |
trevornelson/squeeklights | instagram/models.py | 2 | 5931 | from helper import timestamp_to_datetime
class ApiModel(object):
@classmethod
def object_from_dictionary(cls, entry):
# make dict keys all strings
if entry is None:
return ""
entry_str_dict = dict([(str(key), value) for key, value in entry.items()])
return cls(**en... | mit |
popazerty/enigma2cuberevo | lib/python/Plugins/Extensions/Modem/plugin.py | 28 | 8329 | def getDefaultGateway():
f = open("/proc/net/route", "r")
if f:
for line in f.readlines():
tokens = line.split('\t')
if tokens[1] == '00000000': #dest 0.0.0.0
return int(tokens[2], 16)
return None
def getTelephone():
f = open("/etc/ppp/options", "r")
if f:
for line in f.readlines():
if line.find(... | gpl-2.0 |
codenirvana/spoj-solutions | setup.py | 1 | 1121 | from setuptools import setup
setup(
name='spojsol',
version='0.1',
description='Download your spoj solutions',
author='Udit Vasu',
author_email='admin@codenirvana.in',
license='MIT',
url='https://github.com/codenirvana/spoj-solutions',
packages=['spojsol'],
install_requires=[
... | mit |
elyast/marathon-python | marathon/client.py | 6 | 21466 | import itertools
import time
import sys
try:
import json
except ImportError:
import simplejson as json
# Support Python 2 & 3
if sys.version_info[0] == 3:
import urllib.parse as urlparse
from urllib.error import HTTPError
else:
import urlparse
from urllib2 import HTTPError
import requests
im... | mit |
tempbottle/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_packageindex.py | 377 | 7625 | """Package Index Tests
"""
import sys
import os
import unittest
import pkg_resources
from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url
import distutils.errors
import setuptools.package_index
from setuptools.tests.server import IndexServer
class TestPackageIndex(unittest.TestCase):
d... | lgpl-3.0 |
skylian/XWorld | games/xworld3d/tasks/XWorld3DNavTargetDirection.py | 2 | 5882 | import random
import math
from xworld3d_task import XWorld3DTask
from maze2d import print_env
"""This file implements an xworld teaching task.
The task class contains several stage functions.
Each stage function must return three outputs:
next_stage - the name of the next stage function
reward - the reward of ... | apache-2.0 |
kritsadanshon/python_koans | python3/koans/about_deleting_objects.py | 98 | 3305 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutDeletingObjects(Koan):
def test_del_can_remove_slices(self):
lottery_nums = [4, 8, 15, 16, 23, 42]
del lottery_nums[1]
del lottery_nums[2:4]
self.assertEqual(___, lottery_nums)
def test_del_can... | mit |
zzhhui/PJSip-CSharp | tests/pjsua/scripts-sipp/transfer-attended.py | 27 | 1241 | # $Id: transfer-attended.py 4724 2014-01-31 08:52:09Z nanang $
#
import inc_const as const
PJSUA = ["--null-audio", # UA0
"--null-audio", # UA1
"--null-audio" # UA2
]
PJSUA_EXPECTS = [
# A calls B
[0, "", "m"],
[0, "", "$PJSUA_URI[1]"],
[0, const.STATE_CALLING, ""],
[1, const.EVENT_INCOM... | gpl-2.0 |
apyrgio/ganeti | lib/confd/__init__.py | 10 | 2434 | #
#
# Copyright (C) 2009, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condition... | bsd-2-clause |
zstyblik/infernal-twin | build/reportlab/src/reportlab/pdfbase/_fontdata_widths_timesbolditalic.py | 56 | 3668 | widths = {'A': 667,
'AE': 944,
'Aacute': 667,
'Acircumflex': 667,
'Adieresis': 667,
'Agrave': 667,
'Aring': 667,
'Atilde': 667,
'B': 667,
'C': 667,
'Ccedilla': 667,
'D': 722,
'E': 667,
'Eacute': 667,
'Ecircumflex': 667,
'Edieresis': 667,
'Egrave': 667,
'Eth': 722,
'Euro': 500,
'F': 667,
'G': 722,
'... | gpl-3.0 |
b0ttl3z/SickRage | lib/unidecode/x058.py | 252 | 4678 | data = (
'Ku ', # 0x00
'Ke ', # 0x01
'Tang ', # 0x02
'Kun ', # 0x03
'Ni ', # 0x04
'Jian ', # 0x05
'Dui ', # 0x06
'Jin ', # 0x07
'Gang ', # 0x08
'Yu ', # 0x09
'E ', # 0x0a
'Peng ', # 0x0b
'Gu ', # 0x0c
'Tu ', # 0x0d
'Leng ', # 0x0e
'[?] ', # 0x0f
'Ya ', # 0x10
'Qian ', ... | gpl-3.0 |
hyrole/scrapy | scrapy/extensions/closespider.py | 150 | 2462 | """CloseSpider is an extension that forces spiders to be closed after certain
conditions are met.
See documentation in docs/topics/extensions.rst
"""
from collections import defaultdict
from twisted.internet import reactor
from scrapy import signals
class CloseSpider(object):
def __init__(self, crawler):
... | bsd-3-clause |
leighpauls/k2cro4 | ppapi/generate_ppapi_include_tests.py | 177 | 6295 | #!/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.
"""This script should be run manually on occasion to make sure the gyp file and
the includes tests are up to date.
It does the fol... | bsd-3-clause |
joeisgood99/Z5C-Copyleft-Kernel | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
eneldoserrata/marcos_openerp | addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/contrib/sessions/backends/db.py | 24 | 2480 | import datetime
from django.contrib.sessions.models import Session
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation
from django.db import IntegrityError, transaction
from django.utils.encoding import force_unicode
class SessionStore(Sessi... | agpl-3.0 |
cloudera/hue | apps/filebrowser/src/filebrowser/lib/archives_test.py | 2 | 3445 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
damiansoriano/odoo | addons/l10n_be_coda/tests/test_import_bank_statement.py | 23 | 2216 | from openerp.tests.common import TransactionCase
from openerp.modules.module import get_module_resource
class TestCodaFile(TransactionCase):
"""Tests for import bank statement coda file format (account.bank.statement.import)
"""
def setUp(self):
super(TestCodaFile, self).setUp()
self.state... | agpl-3.0 |
shayneholmes/plover | plover/machine/test_stentura.py | 8 | 22187 | # Copyright (c) 2011 Hesky Fisher
# See LICENSE.txt for details.
"""Unit tests for stentura.py."""
import array
import struct
import threading
import unittest
import stentura
def make_response(seq, action, error=0, p1=0, p2=0, data=None,
length=None):
if not length:
length = 14
... | gpl-2.0 |
gqwest-erp/server | openerp/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py | 51 | 2829 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
DISKonnectd/phantom_apps | sharepoint/dependencies/lxml/html/formfill.py | 30 | 9689 | from lxml.etree import XPath, ElementBase
from lxml.html import fromstring, XHTML_NAMESPACE
from lxml.html import _forms_xpath, _options_xpath, _nons, _transform_result
from lxml.html import defs
import copy
try:
basestring
except NameError:
# Python 3
basestring = str
__all__ = ['FormNotFound', 'fill_for... | gpl-3.0 |
csrgxtu/Google-Slave | src/GAE-Slave/lib/bs4/diagnose.py | 431 | 6315 | """Diagnostic functions, mainly for use when doing tech support."""
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
import os
import pstats
import random
import tempfile
import time
import tra... | gpl-2.0 |
sebrandon1/nova | nova/compute/__init__.py | 83 | 2294 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
mxrrow/zaicoin | src/deps/boost/libs/python/pyste/tests/header_testUT.py | 54 | 1039 | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import unittest
from _header_test import *
class HeaderTest(unittest.TestCase):
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.