code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | Python |
#-*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.loader import get_template
from django.template import RequestContext
from google.appengine.ext import db
from django.conf import settings
from models.main import App_u... | Python |
#-*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from google.appengine.api import images
from google.appengine.ext import db
from models.main import App_user, Post, Comment, Tag
from common.view_decorator import role_required
from logics.main import get_user, set_user
import datetime
i... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | Python |
import logging, os, sys
# Google App Engine imports.
from google.appengine.ext.webapp import util
# Remove the standard version of Django.
for k in [k for k in sys.modules if k.startswith('django')]:
del sys.modules[k]
# Force sys.path to have our own directory first, in case we want to import
# from it.
#sys.pa... | Python |
#-*- coding: utf-8 -*-
import os, sys, tempfile
has_set = False
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
import logging
logging.basicConfig(format='%(asctime)s %(levelname)8s %(message)s', stream=sys.stdout)
#logging.basicConfig(format='%(asctime)s %(levelname)8s %(message)s',
# filenam... | Python |
#-*- coding: utf-8 -*-
import set_app_evn
from set_app_evn import BASE_DIR
import ai
import Image, ImageFilter, ImageEnhance
def register(opener):
reg_info = {
'user': 'aksdj990sddddf',
'passwd': 'wushiyito',
'passwdAgain': 'wushiyito',
'answer': 'asdfasdfa',
'question': '... | Python |
#-*- coding: utf-8 -*-
from threading import local
_thread_locals = local()
def get_user():
try:
return _thread_locals.user
except:
return None
def set_user(u):
_thread_locals.user = u | Python |
#-*- coding: utf-8 -*-
from google.appengine.ext import db
import datetime
import generalcounter
from logics.main import get_user, set_user
import re
class App_user(db.Model):
email = db.EmailProperty(required = True)
nickname = db.StringProperty(required = True)
link = db.StringProperty()
level = d... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | Python |
from django.conf.urls.defaults import *
urlpatterns = patterns('views.main',
('^$', 'index'),
('^(?P<page>\d+)/$', 'index'),
('^p/(?P<post_key>.+)/$', 'show_post'),
('^add_comment/$', 'add_comment'),
('^atom.xml$', 'atom'),
('^sitemap.xml$', 'sitemap'),
(r'^admin/', include... | Python |
#-*- coding: utf-8 -*-
import os, sys, os.path
VERSION = '0.001'
LOCAL = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
APPEND_SLASH = True
ROOT_PATH = os.path.dirname(__file__)
if LOCAL:
BASE_URL = 'http://localhost:8080'
DOMAIN = 'localhost'
else:
BASE_URL = 'http://www.3kkk.me'
DOMAIN = 'www.3kkk.me'... | Python |
from django.conf.urls.defaults import *
urlpatterns = patterns('admin.views',
('^$', 'index'),
('^left/$', 'left'),
('^post_list/$', 'post_list'),
('^add_post/', 'add_post'),
('^comment_list/$', 'comment_list'),
('^user_list/', 'user_list'),
('^add_post_post/', 'add_post_post')... | Python |
#-*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template.loader import get_template
from django.template import RequestContext
from google.appengine.ext import db
from common.view_decorator import role_required
from models.m... | Python |
'''
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
import Cookie
import os
from appengine_utilities import sessions
class SessionMiddleware(object):
TEST_COOKIE_NAME = 'testcookie'
TEST_COOKIE_VALUE = 'worked'
def process_request(self, request):
"""
Check to see if a valid session token exists, if not,
then use a cookie only sess... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
"""
Copyright (c) 2008, appengine-utilities project
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 ... | Python |
#-*- coding: utf-8 -*-
from google.appengine.api import users
from models.main import App_user
from django.http import HttpResponse, HttpResponseRedirect
import datetime
from logics.main import get_user, set_user
def logout(request):
url = request.GET.get('url', '/')
request.session['email'] = ''
return ... | Python |
from django.conf import settings
def bind_settings(request):
return {
'settings': settings
} | Python |
#-*- coding: utf-8 -*-
from django.http import HttpResponsePermanentRedirect
from django.conf import settings
class Domain_transMiddleware(object):
def process_request(self, request):
base_url = settings.BASE_URL
domain = settings.DOMAIN
if request.META['SERVER_NAME']!='localhost' and req... | Python |
#-*- coding: utf-8 -*-
from django import template
from models.main import App_user, Post, Comment, Tag, Sidebar
from django.template import Node, NodeList, Template, Context, Variable
register = template.Library()
class Sidebar_c(template.Node):
def __init__(self, nodelist_loop):
self.nodelist_... | Python |
#coding=utf-8
from django import template
from django.template.defaultfilters import stringfilter
import datetime
register = template.Library()
from common import time_utils
from common.utils import process_html
import hashlib
from google.appengine.api import users
def make_list(start, end):
"""
... | Python |
#-*- coding: utf-8 -*-
import traceback, sys, cStringIO
import datetime, time, cgi
import pytz
from django.conf import settings
def get_utc_time(dt = None):
if dt is None:
dt = datetime.datetime.utcnow()
if dt.tzinfo is None:
dt = dt.replace(tzinfo = pytz.utc)
if dt.tzname()!='UTC':
... | Python |
#-*- coding: utf-8 -*-
import traceback, sys, cStringIO
import datetime, time, cgi
import pytz, re
from django.conf import settings
from BeautifulSoup import BeautifulSoup
def get_err():
f = cStringIO.StringIO( )
traceback.print_exc(file=f)
return f.getvalue( )
def print_err():
sys.stderr.write('err ... | Python |
from google.appengine.api import users
from logics.main import get_user, set_user
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden
def role_required(role):
def wrapper(handler_method):
def check_login(request, *args, **kwargs):
user = get_user()
if n... | Python |
"""Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... | Python |
#!/usr/bin/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 or a... | Python |
#-*- encoding: utf-8 -*-
__all__ = ['fetch', 'get_opener', 'get_content_type']
"""
One fetch web page tool with cookie and encode.
History:
2008-05-20 16:00: ADD upload file provide
2008-06-04 17:12: add headers the fetch result
2008-06-06 14:17: add socks proxy provide
2009-04-29 15:58: remove common_refer
... | Python |
#-*- coding: utf-8 -*-
import socks_proxy as socks
import browser_agent as ai
import urllib2, os, threading, time
def get_one_proxy_opener(p):
#proxy=urllib2.ProxyHandler({'http':p[0]})
cookie=urllib2.HTTPCookieProcessor()
#opener=urllib2.build_opener(proxy, cookie)
opener=urllib2.build_op... | Python |
_CS_IDLE = 'Idle'
import urllib2, httplib
from urllib2 import URLError, addinfourl
import socket
import socks_proxy as socks
def _httplib_connect(self):
"""Connect to the host and port specified in __init__."""
msg = "getaddrinfo returns an empty list"
for res in socket.getaddrinfo(sel... | Python |
from browser_agent import * | Python |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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, ... | Python |
#! /usr/bin/env python
# coding=utf-8
#############################################################################
# #
# File: fetch.py #
# ... | Python |
'''Base classes and helpers for building zone specific tzinfo classes'''
from datetime import datetime, timedelta, tzinfo
from bisect import bisect_right
try:
set
except NameError:
from sets import Set as set
import pytz
__all__ = []
_timedelta_cache = {}
def memorized_timedelta(seconds):
'''Create only... | Python |
#!/usr/bin/env python
'''
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
'''
from cStringIO import StringIO
from datetime import datetime, timedelta
from struct import unpack, calcsize
from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo
from pytz.tzinfo import memorized_datetime, memorized_timede... | Python |
#!/usr/bin/env python
'''
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
'''
from cStringIO import StringIO
from datetime import datetime, timedelta
from struct import unpack, calcsize
from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo
from pytz.tzinfo import memorized_datetime, memorized_timede... | Python |
'''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... | Python |
'''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The Olson database has historically been updated about 4 times a year
OLSON_VERSI... | Python |
#!/usr/bin/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 or a... | Python |
#! /usr/bin/env python
# coding=utf-8
#############################################################################
# #
# File: fetch.py #
# ... | Python |
#-*- coding: utf-8 -*-
import math
class Pager(object):
def __init__(self, total, pageSize, page, page_list_num = 10):
pageCount = int(math.ceil((total+0.0)/pageSize))
if page < 1:
page = 1
if page > pageCount:
page = pageCount
offset = 2
... | Python |
# Copyright 2008 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 or agreed to in writing, ... | Python |
#!/usr/bin/env python
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Python |
#!/usr/bin/env python
import os
import re
import sys
def fail_with_usage():
sys.stderr.write("usage: java-layers.py DEPENDENCY_FILE SOURCE_DIRECTORIES...\n")
sys.stderr.write("\n")
sys.stderr.write("Enforces layering between java packages. Scans\n")
sys.stderr.write("DIRECTORY and prints errors when the pack... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
# This file uses the following encoding: utf-8
import sys
import re
if len(sys.argv) == 1:
print 'usage: ' + sys.argv[0] + ' <build.log>'
sys.exit()
# if you add another level, don't forget to give it a color below
class severity:
UNKNOWN=0
SKIP=100
FIXMENOW=1
HIGH=2
... | Python |
#!/usr/bin/env python
# vim: ts=2 sw=2
import optparse
import re
import sys
class Dependency:
def __init__(self, tgt):
self.tgt = tgt
self.pos = ""
self.prereqs = set()
self.visit = 0
def add(self, prereq):
self.prereqs.add(prereq)
class Dependencies:
def __init__(self):
self.lines =... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
# vim: ts=2 sw=2 nocindent
import re
import sys
def choose_regex(regs, line):
for func,reg in regs:
m = reg.match(line)
if m:
return (func,m)
return (None,None)
def gather(included, deps):
result = set()
for inc in included:
result.add(inc)
for d in deps:
if ... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/env python
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | Python |
#!/usr/bin/python -E
import sys, os, re
excludes = [r'.*?/\.obj.*?',
r'.*?~',
r'.*?\/.DS_Store',
r'.*?\/.gdb_history',
r'.*?\/buildspec.mk',
r'.*?/\..*?\.swp',
r'.*?/out/.*?',
r'.*?/install/.*?']
excludes_compiled = map(re.compile, e... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | Python |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
(r'^accounts/', 'amfgateway.gateway'),
# Uncomment the next line to enable admin documentation:
# (r'^admin/doc/', include('djan... | Python |
# Django settings for 3rdear project.
import os
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('zengsun', 'zengsun.gm@gmail.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'o... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django import newforms as forms
from django.utils.translation import gettext_lazy as _
from models import Profile
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
exclude = ('user', 'report_to',)
class UserForm(forms.Form):
l... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
# Create your models here.
GENDER_CHOICES = (
('M', _('Male')),
('F', _('Female')),
)
class Profile(models.Model):
"""Employee
... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
#from django.contrib import auth
from django.contrib.auth.models import User
from models import Profile
... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django import newforms as forms
from django.utils.translation import gettext_lazy as _
from models import Profile
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
exclude = ('user', 'report_to',)
class UserForm(forms.Form):
l... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
# Create your models here.
GENDER_CHOICES = (
('M', _('Male')),
('F', _('Female')),
)
class Profile(models.Model):
"""Employee
... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
#from django.contrib import auth
from django.contrib.auth.models import User
from models import Profile
... | Python |
from django.contrib.auth.models import User
from pyamf.remoting.gateway.django import DjangoGateway
def user_list(request):
return User.objects.all()
gateway = DjangoGateway({
'userlist': user_list,
})
| Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.