repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
admcrae/tensorflow | tensorflow/python/framework/device.py | 150 | 9078 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
cloudburst/libheap | libheap/pydbg/pygdbpython.py | 1 | 4894 | import sys
from functools import wraps
from libheap.frontend.printutils import print_error
try:
import gdb
except ImportError:
print("Not running inside of GDB, exiting...")
sys.exit()
def gdb_is_running(f):
"decorator to make sure gdb is running"
@wraps(f)
def _gdb_is_running(*args, **kwa... | mit |
youdonghai/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/us/us_states.py | 69 | 7577 | """
A mapping of state misspellings/abbreviations to normalized
abbreviations, and alphabetical lists of US states, territories,
military mail regions and non-US states to which the US provides
postal service.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
# The... | apache-2.0 |
Jusedawg/SickRage | lib/html5lib/treewalkers/__init__.py | 1229 | 2323 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | gpl-3.0 |
TalShafir/ansible | lib/ansible/modules/system/seboolean.py | 12 | 10109 | #!/usr/bin/python
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
# 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',
... | gpl-3.0 |
vmax-feihu/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geoip/libgeoip.py | 121 | 1103 | import os
from ctypes import CDLL
from ctypes.util import find_library
from django.conf import settings
# Creating the settings dictionary with any settings, if needed.
GEOIP_SETTINGS = dict((key, getattr(settings, key))
for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY... | apache-2.0 |
agaurav/ansible | lib/ansible/plugins/action/assemble.py | 9 | 6012 | # (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Stephen Fromm <sfromm@gmail.com>
# Brian Coca <briancoca+dev@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 publish... | gpl-3.0 |
endlessm/chromium-browser | third_party/angle/third_party/vulkan-headers/src/registry/generator.py | 3 | 37029 | #!/usr/bin/python3 -i
#
# Copyright (c) 2013-2020 The Khronos Group 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... | bsd-3-clause |
tchernomax/ansible | lib/ansible/module_utils/known_hosts.py | 73 | 6919 | # 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 their own license
# to the complete wo... | gpl-3.0 |
mlee92/Programming | Econ/supply_demand_elasticity/demand_elasticity.py | 2 | 1413 | # Elasticity of demand is a measure of how strongly consumers respond to a change in the price of a good
# Formally, % change in demand / % change in price
# Problem: Graph the histogram of average-elasticity for a linear-demand good with random coefficients (a, b)
import random
import matplotlib.pyplot as plt
import... | gpl-2.0 |
rajiteh/taiga-back | taiga/base/storage.py | 17 | 1413 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | agpl-3.0 |
jasonwee/asus-rt-n14uhp-mrtg | tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/django/contrib/gis/feeds.py | 336 | 5978 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C ... | apache-2.0 |
tdsimao/tt | django/db/models/fields/__init__.py | 33 | 43560 | import datetime
import decimal
import re
import time
import math
from itertools import tee
import django.utils.copycompat as copy
from django.db import connection
from django.db.models.fields.subclassing import LegacyConnection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
fro... | gpl-2.0 |
Panos512/inspire-next | inspirehep/modules/records/receivers.py | 1 | 12132 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015, 2016 CERN.
#
# INSPIRE 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 optio... | gpl-2.0 |
vitan/hue | desktop/core/src/desktop/lib/conf_test.py | 38 | 7692 | #!/usr/bin/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 may no... | apache-2.0 |
zoufishanmehdi/Uncharted | node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 426 | 56534 | # 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | mit |
matmutant/sl4a | python-build/python-libs/xmpppy/xmpp/commands.py | 200 | 16116 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... | apache-2.0 |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py | 119 | 18940 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
Shekharrajak/Django-facebook | setup.py | 22 | 5672 | #!/usr/bin/env python
from distutils.util import convert_path
from django_facebook import __version__, __maintainer__, __email__
from fnmatch import fnmatchcase
import os
import sys
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
standard_ex... | bsd-3-clause |
Daniel-CA/odoo-addons | account_invoice_attachment_download/wizard/wiz_save_invoice_attachment.py | 4 | 1771 | # -*- coding: utf-8 -*-
# (c) 2016 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api, _
from subprocess import Popen, PIPE
import base64
import os
class WizSaveInvoiceAttachment(models.TransientModel):
_name = 'wiz.save.invoice... | agpl-3.0 |
dharmabumstead/ansible | lib/ansible/utils/module_docs_fragments/ldap.py | 17 | 1334 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016, Peter Sagerson <psagers@ignorare.net>
# Copyright: (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
# Copyright: (c) 2017-2018 Keller Fuchs (@kellerfuchs) <kellerfuchs@hashbang.sh>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
cla... | gpl-3.0 |
liamgh/liamgreenhughes-sl4a-tf101 | python/src/Lib/encodings/euc_jp.py | 816 | 1027 | #
# euc_jp.py: Python Unicode Codec for EUC_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | apache-2.0 |
wgrose/leanto | google/appengine/api/urlfetch_stub.py | 2 | 7959 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | apache-2.0 |
so-sure/tagged-route53 | tagged-route53.py | 1 | 10149 | #!/usr/bin/python
import requests
import boto3
import argparse
class Dns(object):
# Default constructor of the class.
def __init__(self):
self.ec2_client = boto3.client('ec2')
self.dns_client = boto3.client('route53')
self.role = None
self.env = None
self.instance_id = ... | apache-2.0 |
El-Nath/bidji-find5 | scripts/gcc-wrapper.py | 234 | 4095 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
OpenBfS/dokpool-plone | Plone/src/docpool.config/docpool/config/local/elan_de.py | 1 | 8161 | # -*- coding: utf-8 -*-
from ..utils import set_local_roles
from datetime import datetime
from docpool.base.content.documentpool import APPLICATIONS_KEY
from docpool.config import _
from docpool.config.general.elan import connectTypesAndCategories
from docpool.config.local.base import CONTENT_AREA
from docpool.config.u... | gpl-3.0 |
RazorLove/cloaked-octo-spice | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
mycodeday/crm-platform | portal_gamification/__openerp__.py | 381 | 1571 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | gpl-3.0 |
thresholdsoftware/asylum-v2.0 | openerp/addons/portal/acquirer.py | 22 | 5378 | # -*- 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 ... | agpl-3.0 |
mdietrichc2c/OCB | addons/account/wizard/account_period_close.py | 341 | 2646 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
mayankcu/Django-social | venv/Lib/encodings/iso8859_2.py | 593 | 13660 | """ Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | bsd-3-clause |
hifly/OpenUpgrade | addons/hr_holidays/hr_holidays.py | 159 | 33482 | # -*- coding: utf-8 -*-
##################################################################################
#
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
# and 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# $Id: hr.py 4656 2006-11-24 09:58:42Z Cyp $
#
# This program is free software: you can redistri... | agpl-3.0 |
diegojromerolopez/djanban | src/djanban/apps/password_reseter/email_sender.py | 1 | 1645 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from crequest.middleware import CrequestMiddleware
from django.core.mail import send_mail
from django.template.loader import get_template
from django.conf import settings
from django.urls import reverse
def send_password_request_link(password_request, u... | mit |
southpawtech/TACTIC-DEV | src/context/client/create_set_asset.py | 6 | 2651 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
seanxwzhang/LeetCode | 148 Sort List/solution.py | 1 | 1263 | #! /usr/bin/env python
# Sort a linked list in O(n log n) time using constant space complexity.
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
# a merge sort implementation
class Solution(object):
def sortList(self, head... | mit |
xavfernandez/pip | src/pip/_vendor/distlib/_backport/tarfile.py | 422 | 92628 | #-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy ... | mit |
crazcalm/chat-server | server.py | 1 | 11418 | import help_text
import asyncio
import argparse
import logging
from random import randint
clients = []
class SimpleChatClientProtocol(asyncio.Protocol):
"""
This class is the heart of the Chat Server. For each client that
connects to the server, an instance of this class is created. These
instances ... | mit |
youprofit/NewsBlur | vendor/feedvalidator/content.py | 16 | 6021 | """$Id: content.py 699 2006-09-25 02:01:18Z rubys $"""
__author__ = "Sam Ruby <http://intertwingly.net/> and Mark Pilgrim <http://diveintomark.org/>"
__version__ = "$Revision: 699 $"
__date__ = "$Date: 2006-09-25 02:01:18 +0000 (Mon, 25 Sep 2006) $"
__copyright__ = "Copyright (c) 2002 Sam Ruby and Mark Pilgrim"
from ... | mit |
goddardl/cortex | test/IECore/ConfigLoaderTest.py | 2 | 5626 | ##########################################################################
#
# Copyright (c) 2011, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/django/template/context_processors.py | 55 | 2497 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the 'context_processors' option of the configuration
of a DjangoTemplates backend and use... | mit |
ptemplier/ansible | test/units/modules/network/f5/test_bigip_gtm_wide_ip.py | 51 | 8377 | # -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks 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) a... | gpl-3.0 |
clausqr/HTPC-Manager | libs/cherrypy/test/test_wsgi_ns.py | 22 | 2900 | import cherrypy
from cherrypy._cpcompat import ntob
from cherrypy.test import helper
class WSGI_Namespace_Test(helper.CPWebCase):
def setup_server():
class WSGIResponse(object):
def __init__(self, appresults):
self.appresults = appresults
self.iter = iter(app... | mit |
ImaginaryLandscape/django-filer | filer/admin/imageadmin.py | 35 | 1672 | #-*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext as _
from filer import settings as filer_settings, settings
from filer.admin.fileadmin import FileAdmin
from filer.models import Image
class ImageAdminForm(forms.ModelForm):
subject_location = forms.CharField(
... | bsd-3-clause |
LaoZhongGu/kbengine | kbe/src/lib/python/Lib/test/test_bufio.py | 64 | 2654 | import unittest
from test import support
import io # C implementation.
import _pyio as pyio # Python implementation.
# Simple test to ensure that optimizations in the IO library deliver the
# expected results. For best testing, run this under a debug-build Python too
# (to exercise asserts in the C code).
lengths =... | lgpl-3.0 |
jonwright/ImageD11 | ImageD11/sparseframe.py | 1 | 10124 |
from __future__ import print_function, division
import time, sys
import h5py, scipy.sparse, numpy as np, pylab as pl
from ImageD11 import cImageD11
# see also sandbox/harvest_pixels.py
NAMES = {
"filename" : "original filename used to create a sparse frame",
"intensity" : "corrected pixel values",
"nla... | gpl-2.0 |
eleonrk/SickRage | lib/hachoir_parser/file_system/iso9660.py | 85 | 4954 | """
ISO 9660 (cdrom) file system parser.
Documents:
- Standard ECMA-119 (december 1987)
http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf
Author: Victor Stinner
Creation: 11 july 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt32, UInt64, ... | gpl-3.0 |
uppalk1/RackHD | test/tests/api/v1_1/nodes_tests.py | 13 | 16534 | from config.api1_1_config import *
from config.amqp import *
from modules.logger import Log
from modules.amqp import AMQPWorker
from modules.worker import WorkerThread, WorkerTasks
from on_http_api1_1 import NodesApi as Nodes
from on_http_api1_1 import WorkflowApi as Workflows
from on_http_api1_1 import rest
from datet... | apache-2.0 |
nksheridan/elephantAI | test_Deter_as_Server_and_Play_Audio.py | 1 | 1414 | # DETER DEVICE
# this is test code for putting the deter device into server mode, and getting a message via bluetooth from the detection device, and
# then going ahead and playing scare sounds. You need to determine your MAC address. It is for the server in this case, so the MAC address
# of the deter device. You also ... | mit |
tyler-cromwell/Acid | client.py | 1 | 2439 | #!/usr/bin/python3
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The MIT License (MIT)
Copyright (c) 2016 Tyler Cromwell
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 th... | mit |
pothosware/gnuradio | gnuradio-runtime/python/gnuradio/gr/qa_hier_block2.py | 7 | 2901 | #
# Copyright 2014 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)
# any later version.
#
#... | gpl-3.0 |
glaubitz/fs-uae-debian | launcher/OpenGL/GL/KHR/debug.py | 9 | 9706 | '''OpenGL extension KHR.debug
This module customises the behaviour of the
OpenGL.raw.GL.KHR.debug to provide a more
Python-friendly API
Overview (from the spec)
This extension allows the GL to notify applications when various events
occur that may be useful during application development, debugging and
profi... | gpl-2.0 |
xenserver/auto-cert-kit | autocertkit/status.py | 1 | 3793 | #!/usr/bin/python
# Copyright (c) Citrix Systems 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 l... | bsd-2-clause |
mrquim/repository.mrquim | repo/plugin.video.poseidon/resources/lib/modules/dom_parser.py | 35 | 5326 | """
Based on Parsedom for XBMC plugins
Copyright (C) 2010-2011 Tobias Ussing And Henrik Mosgaard Jensen
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,... | gpl-2.0 |
ykaneko/neutron | neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_cfg.py | 4 | 10000 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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/... | apache-2.0 |
Plain-Devices/android_kernel_lge_msm8974 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
ApsOps/zulip | zerver/migrations/0002_django_1_8.py | 125 | 2229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name... | apache-2.0 |
4pr0n/rip | sites/site_instagrin.py | 2 | 2550 | #!/usr/bin/python
from basesite import basesite
from time import sleep
"""
Downloads instagram albums
"""
class instagram(basesite):
""" Parse/strip URL to acceptable format """
def sanitize_url(self, url):
if'instagram.com/' in url:
# Legit
pass
elif 'web.stagram.com/n/' in url:
# Convert to instag... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/Django/tests/regressiontests/views/tests/shortcuts.py | 44 | 2884 | from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
TEMPLATE_CONTEXT_PROCESSORS=('django.core.context_processors.static',),
STATIC_URL='/path/to/static/media/',
)
class ShortcutTests(TestCase):
urls = 'regressiontests.views.g... | agpl-3.0 |
thiagodasilva/swift | test/unit/common/test_constraints.py | 7 | 27217 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
metwit/django-fulmine | fulmine/forms.py | 1 | 2406 | from django import forms
from django.core.exceptions import ValidationError
from fulmine.models import parse_scope
class SeparatedValuesField(forms.CharField):
def __init__(self, *args, **kwargs):
self.separator = kwargs.pop('separator', ' ')
super(SeparatedValuesField, self).__init__(*args, **kwa... | bsd-3-clause |
roadmapper/ansible | lib/ansible/playbook/role_include.py | 37 | 6983 | #
# 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 tha... | gpl-3.0 |
tomviner/pyfakefs | fake_filesystem_unittest.py | 2 | 9078 | # Copyright 2014 Altera Corporation. All Rights Reserved.
# Copyright 2015 John McGehee
#
# 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
#
#... | apache-2.0 |
hamx0r/ibrest | app/ib/opt/message.py | 8 | 4798 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
# Defines message types for the Receiver class.
#
# This module inspects the EWrapper class to build a set of Message
# types. In creating the types, it also builds a registry of them
# that the Receiver class then uses to determine message types.
##
import sys
from a... | mit |
UCL-INGI/INGInious | inginious/agent/docker_agent/_timeout_watcher.py | 2 | 4597 | # -*- coding: utf-8 -*-
#
# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
# more information about the licensing of this file.
"""
Abstractions that provide zeromq-agents that talk with cgroups.
"""
import asyncio
import logging
from inginious.common.asyncio_utils import AsyncItera... | agpl-3.0 |
maftieu/CouchPotatoServer | libs/tornado/tcpserver.py | 18 | 10244 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | gpl-3.0 |
mk01/xbmc | lib/gtest/test/gtest_catch_exceptions_test.py | 403 | 9422 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | gpl-2.0 |
gitcoinco/web | app/marketing/management/commands/no_applicants_email.py | 1 | 1922 | '''
Copyright (C) 2021 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | agpl-3.0 |
kwikteam/klusta | klusta/kwik/tests/test_model.py | 1 | 12258 | # -*- coding: utf-8 -*-
"""Tests of Kwik file opening routines."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import os.path as op
import numpy as np
from numpy.testing import assert_array_... | bsd-3-clause |
MikeLing/treeherder | treeherder/log_parser/parsers.py | 1 | 19774 | import json
import logging
import re
from HTMLParser import HTMLParser
import jsonschema
from django.conf import settings
from treeherder.etl.buildbot import RESULT_DICT
logger = logging.getLogger(__name__)
class ParserBase(object):
"""
Base class for all parsers.
"""
def __init__(self, name):
... | mpl-2.0 |
karlwithak/nowradio | nowradio/stationInfoUpdater.py | 1 | 1896 | import requests
import ourUtils
from dbManager import Queries, get_connection
# This program goes through the list of stations in the db and updates information such as
# current listeners, max listeners, peak listeners, status(up or not)
def worker(id_url_list, connection):
cur = connection.cursor()
for ... | mit |
chouseknecht/ansible | test/units/modules/storage/netapp/test_netapp_e_volume.py | 21 | 59265 | # coding=utf-8
# (c) 2018, NetApp Inc.
# 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
try:
from unittest import mock
except ImportError:
import mock
from ansible.module_utils.net... | gpl-3.0 |
wfxiang08/django185 | django/core/mail/backends/smtp.py | 477 | 5239 | """SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.core.mail.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
"""
A... | bsd-3-clause |
oihane/server-tools | auth_dynamic_groups/model/res_groups.py | 23 | 2540 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
ArcherSys/ArcherSys | Lib/site-packages/pyasn1/type/tag.py | 162 | 4499 | # ASN.1 types tags
from operator import getitem
from pyasn1 import error
tagClassUniversal = 0x00
tagClassApplication = 0x40
tagClassContext = 0x80
tagClassPrivate = 0xC0
tagFormatSimple = 0x00
tagFormatConstructed = 0x20
tagCategoryImplicit = 0x01
tagCategoryExplicit = 0x02
tagCategoryUntagged = 0x04
class Tag:
... | mit |
dplepage/logbook | tests/test_logbook.py | 1 | 59981 | # -*- coding: utf-8 -*-
from .utils import (
LogbookTestCase,
activate_via_push_pop,
activate_via_with_statement,
capturing_stderr_context,
get_total_delta_seconds,
make_fake_mail_handler,
missing,
require_module,
require_py3,
)
from contextlib import closing, contextmanager
from dat... | bsd-3-clause |
ctxis/canape | CANAPE.Scripting/Lib/distutils/sysconfig.py | 41 | 21356 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... | gpl-3.0 |
groschovskiy/personfinder | app/pytz/zoneinfo/GB_minus_Eire.py | 9 | 9525 | '''tzinfo timezone information for GB_minus_Eire.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class GB_minus_Eire(DstTzInfo):
'''GB_minus_Eire timezone definition. See datetime.tzinfo for details'''
zone = 'GB_minus_Eire'
... | apache-2.0 |
berrange/nova | nova/scheduler/driver.py | 7 | 5070 | # Copyright (c) 2010 OpenStack Foundation
# 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 complianc... | apache-2.0 |
HyperBaton/ansible | lib/ansible/modules/network/fortios/fortios_system_alias.py | 7 | 9082 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
liamgh/liamgreenhughes-sl4a-tf101 | python/src/Lib/lib-tk/Tix.py | 50 | 74119 | # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: Tix.py 63487 2008-05-20 07:13:37Z georg.brandl $
#
# Tix.py -- Tix widget wrappers.
#
# For Tix, see http://tix.sourceforge.net
#
# - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995.
# based on an idea of Jean-Marc Lu... | apache-2.0 |
scavallero/mydomus | auth.py | 1 | 3792 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MyDomus - Polling Service
# Copyright (c) 2016 Salvatore Cavallero (salvatoe.cavallero@gmail.com)
# https://github.com/scavallero/mydomus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | gpl-3.0 |
ondra-novak/chromium.src | chrome/common/extensions/docs/server2/test_data/canned_data.py | 7 | 36855 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
from extensions_paths import CHROME_EXTENSIONS
from third_party.json_schema_compiler.json_parse import OrderedDict
from test_file_system import ... | bsd-3-clause |
arunkgupta/gramps | gramps/gui/merge/__init__.py | 1 | 1096 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eithe... | gpl-2.0 |
phelix/bitcoin | contrib/devtools/optimize-pngs.py | 63 | 3184 | #!/usr/bin/env python
'''
Run this scrip every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text).
#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text
'''
import os
import... | mit |
psav/cfme_tests | cfme/networks/floating_ips.py | 2 | 3074 | import attr
from navmazing import NavigateToAttribute
from cfme.common import Taggable
from cfme.exceptions import ItemNotFound
from cfme.modeling.base import BaseCollection, BaseEntity, parent_of_type
from cfme.networks.views import FloatingIpDetailsView, FloatingIpView
from cfme.utils import version
from cfme.utils.... | gpl-2.0 |
trusch/libbson | test/googletest/test/gtest_color_test.py | 3259 | 4911 | #!/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... | mit |
2ndQuadrant/ansible | lib/ansible/modules/remote_management/oneview/oneview_san_manager_facts.py | 120 | 3321 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# 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',
... | gpl-3.0 |
mirrax/OpenBazaar | node/multisig.py | 13 | 6390 | import logging
import random
import re
import urllib2
import obelisk
# Create new private key:
#
# $ sx newkey > key1
#
# Show private secret:
#
# $ cat key1 | sx wif-to-secret
#
# Show compressed public key:
#
# $ cat key1 | sx pubkey
#
# You will need 3 keys for buyer, seller and arbitrer
class Multisig(objec... | mit |
Stanford-Online/edx-analytics-data-api | analytics_data_api/v0/views/__init__.py | 1 | 10029 | from itertools import groupby
from django.db import models
from django.db.models import Q
from django.utils import timezone
from rest_framework import generics, serializers
from opaque_keys.edx.keys import CourseKey
from analytics_data_api.v0.exceptions import CourseNotSpecifiedError
from analytics_data_api.v0.view... | agpl-3.0 |
radez/tripleo-image-elements | elements/horizon/os-apply-config/etc/horizon/local_settings.py | 2 | 2751 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
Ayub-Khan/edx-platform | openedx/core/djangoapps/content/course_overviews/management/commands/tests/test_generate_course_overview.py | 14 | 3080 | # pylint: disable=missing-docstring
from django.core.management.base import CommandError
from mock import patch
from openedx.core.djangoapps.content.course_overviews.management.commands import generate_course_overview
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from xmodule.module... | agpl-3.0 |
arvinsingla/CouchPotatoServer | libs/apscheduler/jobstores/mongodb_store.py | 132 | 2903 | """
Stores jobs in a MongoDB database.
"""
import logging
from apscheduler.jobstores.base import JobStore
from apscheduler.job import Job
try:
import cPickle as pickle
except ImportError: # pragma: nocover
import pickle
try:
from bson.binary import Binary
from pymongo.connection import Connection
ex... | gpl-3.0 |
rupran/ansible | lib/ansible/modules/network/omapi_host.py | 19 | 12359 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to configure DHCPd hosts using OMAPI protocol
(c) 2016, Loic Blot <loic.blot@unix-experience.fr>
Sponsored by Infopro Digital. http://www.infopro-digital.com/
Sponsored by E.T.A.I. http://www.etai.fr/
This file is part of Ansible
Ansible is free software: ... | gpl-3.0 |
vvoZokk/dnn | dnn_project/generate_protos.py | 1 | 4557 | #!/usr/bin/env python
import os
import argparse
import re
from collections import defaultdict
import sys
KNOWN_TYPES = {
"double" : "double",
"int" : "int32",
"size_t" : "uint32",
"float" : "float",
"string" : "string",
"bool" : "bool",
"complex<double>" : "double",
... | mit |
akshaya9/fosswebsite | achievements/migrations/0001_initial.py | 8 | 5349 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-26 12:11
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | mit |
yasserglez/pytiger2c | packages/pytiger2c/dot.py | 1 | 2786 | # -*- coding: utf-8 -*-
"""
Clases utilizadas en la generación de un archivo Graphviz DOT con el
árbol de sintáxis abstracta creado a partir de un programa Tiger.
"""
class DotGenerator(object):
"""
Clase utilizada para la generación de grafos en formato Graphviz DOT.
"""
def __init__(self):
... | mit |
AdaptiveApplications/carnegie | tarc_bus_locator_client/quantities-0.10.1/build/lib/quantities/uncertainquantity.py | 2 | 7392 | # -*- coding: utf-8 -*-
"""
"""
from __future__ import absolute_import
import sys
import numpy as np
from . import markup
from .quantity import Quantity, scale_other_units
from .registry import unit_registry
from .decorators import with_doc
class UncertainQuantity(Quantity):
# TODO: what is an appropriate valu... | mit |
kaiweifan/neutron | neutron/plugins/brocade/db/models.py | 24 | 4645 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Brocade Communications System, 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
#
# ... | apache-2.0 |
bitcommoditiz/P2Pool | wstools/Utility.py | 292 | 50865 | # Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is ... | gpl-3.0 |
geopython/QGIS | python/plugins/processing/algs/qgis/Datasources2Vrt.py | 15 | 8905 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : May 2015
Copyright : (C) 2015 by Luigi Pirelli
Email : luipir at gmail dot com
*********************************... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.