repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
soulmachine/scikit-learn | refs/heads/master | examples/applications/plot_outlier_detection_housing.py | 21 | """
====================================
Outlier detection on a real data set
====================================
This example illustrates the need for robust covariance estimation
on a real data set. It is useful both for outlier detection and for
a better understanding of the data structure.
We selected two sets o... |
yhoogstrate/segmentation-fold | refs/heads/master | scripts/energy-estimation-utility/tests/test_add-read-counts.py | 1 | #!/usr/bin/env python
"""
segmentation-fold can predict RNA 2D structures including K-turns.
Copyright (C) 2012-2016 Youri Hoogstrate
This file is part of segmentation-fold.
segmentation-fold is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by ... |
ftomassetti/intellij-community | refs/heads/master | python/helpers/pycharm/pytest_teamcity.py | 22 | import os
import sys
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
sys.path.insert(0, helpers_dir)
from tcmessages import TeamcityServiceMessages
from pycharm_run_utils import adjust_sys_path
adjust_sys_path(False)
messages = TeamcityServiceMessages(prepend_linebreak=... |
tadashi-aikawa/gemini | refs/heads/master | tests/addons/dump/test_xml.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import datetime
import os
import pytest
from owlmixin.util import load_yaml
from jumeaux.addons.dump.xml import Executor
from jumeaux.models import Response, DumpAddOnPayload
NORMAL_BODY = """<?xml version="1.0"?>
<catalog>
<book id="bk001">
<author>Ichiro</au... |
bcb/qutebrowser | refs/heads/master | qutebrowser/mainwindow/statusbar/tabindex.py | 10 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
reviewboard/reviewboard | refs/heads/master | reviewboard/reviews/evolutions/status_update_timeout.py | 5 | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('StatusUpdate', 'timeout', models.IntegerField, null=True)
]
|
Kingdread/qutebrowser | refs/heads/master | tests/unit/misc/test_autoupdate.py | 5 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Alexander Cogneau (acogneau) <alexander.cogneau@gmail.com>:
#
# This file is part of qutebrowser.
#
# qutebrowser 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... |
heyavery/lopenr | refs/heads/master | venv/lib/python2.7/site-packages/requests/packages/chardet/mbcsgroupprober.py | 2768 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
letops/django-sendgrid-parse | refs/heads/master | django_sendgrid_parse/urls.py | 1 | from django.conf.urls import url
from . import views
app_name = 'django_sendgrid_parse'
urlpatterns = [
url(
r'^$',
views.sendgrid_email_receiver, name='webhook'
),
]
|
abs0/tapiriik | refs/heads/master | tapiriik/web/views/settings.py | 16 | from django.shortcuts import render, redirect
from tapiriik.auth import User
def settings(request):
available_settings = {
"allow_activity_flow_exception_bypass_via_self":
{"Title": "Route activities via",
"Description": "Allows activities to flow through this service to avoid a flo... |
shaufi/odoo | refs/heads/8.0 | addons/procurement/wizard/schedulers_all.py | 306 | # -*- 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... |
samthor/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/pager.py | 92 | # pager.py - display output using a pager
#
# Copyright 2008 David Soria Parra <dsp@php.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
#
# To load the extension, add it to your configuration file:
#
# [extension]
# pager ... |
vivianli32/TravelConnect | refs/heads/master | flask/lib/python3.4/site-packages/flask/_compat.py | 783 | # -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY... |
surajssd/kuma | refs/heads/master | vendor/packages/pygments/lexers/textedit.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.textedit
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for languages related to text processing.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer im... |
LaoZhongGu/kbengine | refs/heads/master | kbe/src/lib/python/Tools/demo/hanoi.py | 108 | #!/usr/bin/env python3
"""
Animated Towers of Hanoi using Tk with optional bitmap file in background.
Usage: hanoi.py [n [bitmapfile]]
n is the number of pieces to animate; default is 4, maximum 15.
The bitmap file can be any X11 bitmap file (look in /usr/include/X11/bitmaps for
samples); it is displayed as the bac... |
lilsweetcaligula/Online-Judges | refs/heads/master | leetcode/easy/intersection_of_two_arrays/py/solution.py | 1 | #
# Python provides for an elegant solution of the intersection problem.
# We simply convert both arrays to sets, thus eliminating any duplicates
# in the process, and then call the set.intersection method to have the
# highly optimized library do the job for us. Mission accomplished.
#
class Solution(object):
def... |
sreecha/grpc | refs/heads/master | examples/python/multiplex/helloworld_pb2_grpc.py | 148 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import helloworld_pb2 as helloworld__pb2
class GreeterStub(object):
"""The greeting service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SayHello = c... |
zubair-arbi/edx-platform | refs/heads/master | common/djangoapps/student/migrations/0009_auto__del_courseregistration__add_courseenrollment.py | 188 | # -*- coding: 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):
# Deleting model 'CourseRegistration'
db.delete_table('student_courseregistration')
# Adding model ... |
pshen/ansible | refs/heads/devel | lib/ansible/module_utils/vca.py | 36 | #
# 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... |
wtgme/labeldoc2vec | refs/heads/master | gensim/test/simspeed.py | 72 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s CORPUS_DENSE.mm CORPUS_SPARSE.mm [NUMDOCS]
Run speed test of similarity queries. Only use the first NUMDOCS d... |
peterfpeterson/mantid | refs/heads/master | Framework/PythonInterface/mantid/plots/_compatability.py | 3 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... |
ssanderson/interface | refs/heads/master | interface/typecheck.py | 1 | """
Utilities for typed interfaces.
"""
from itertools import starmap, takewhile
from .compat import Parameter, zip_longest
from .functional import complement, dzip, valfilter
def compatible(impl_sig, iface_sig):
"""
Check whether ``impl_sig`` is compatible with ``iface_sig``.
Parameters
----------
... |
pirate-coin/pirate | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
alexa-infra/negine | refs/heads/master | thirdparty/boost-python/libs/python/pyste/src/Pyste/SmartFile.py | 13 | # 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 os
import md5
#=========================================================... |
js0701/chromium-crosswalk | refs/heads/master | tools/md_browser/gitiles_ext_blocks.py | 37 | # Copyright 2015 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.
"""Implements Gitiles' notification, aside and promotion blocks.
This extention makes the Markdown parser recognize the Gitiles' extended
blocks notation. T... |
ChenglongChen/topical_word_embeddings | refs/heads/master | TWE-2/gensim/models/rpmodel.py | 70 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import logging
import itertools
import numpy
import scipy
from gensim import interfaces, matutils, utils
logger = logging.getLogger... |
beblount/Steer-Clear-Backend-Web | refs/heads/web | env/Lib/site-packages/jinja2/meta.py | 659 | # -*- coding: utf-8 -*-
"""
jinja2.meta
~~~~~~~~~~~
This module implements various functions that exposes information about
templates that might be interesting for various kinds of applications.
:copyright: (c) 2010 by the Jinja Team, see AUTHORS for more details.
:license: BSD, see LICENSE fo... |
prophile/diana-ch | refs/heads/master | diana_ch/__init__.py | 1 | VERSION = '0.0.1'
SHORT_DESCRIPTION = 'Artemis plus CH Products yoke'
|
danimajo/pineapple | refs/heads/master | flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.py | 629 | from flask import Blueprint, render_template
frontend = Blueprint('frontend', __name__, template_folder='templates')
@frontend.route('/')
def index():
return render_template('frontend/index.html')
|
trentinfrederick/name-panel | refs/heads/master | addon/interface/operator/copy.py | 3 |
# imports
import bpy
from bpy.types import Operator
from ...function import copy
# operator
class operator(Operator):
'''
Transfer names from some types of datablocks to others.
'''
bl_idname = 'view3d.transfer_name'
bl_label = 'Transfer Names'
bl_description = 'Transfer names from some ty... |
jyotikamboj/container | refs/heads/master | django/core/cache/backends/memcached.py | 18 | "Memcached cache backend"
import time
import pickle
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.utils import six
from django.utils.deprecation import RenameMethodsBase, RemovedInDjango19Warning
from django.utils.encoding import force_str
from django.utils.functional import cache... |
marcydoty/geraldo | refs/heads/master | site/newsite/site-geraldo/appengine_django/__init__.py | 9 | #!/usr/bin/python2.4
#
# 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... |
guidosarducci/xbmc | refs/heads/master | tools/EventClients/examples/python/example_button1.py | 192 | #!/usr/bin/python
# This is a simple example showing how you can send 2 button events
# to XBMC in a queued fashion to shut it down.
# Queued button events are not repeatable.
# The basic idea is to create single packets and shoot them to XBMC
# The provided library implements some of the support commands and
# take... |
CydarLtd/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_wait.py | 16 | #!/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 opti... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/weapon/wpn_sfs_imperial_blaster_3.py | 85615 | import sys
def setup(core, object):
return |
a455bcd9/tagger | refs/heads/master | model.py | 2 | import os
import re
import numpy as np
import scipy.io
import theano
import theano.tensor as T
import codecs
import cPickle
from utils import shared, set_values, get_name
from nn import HiddenLayer, EmbeddingLayer, DropoutLayer, LSTM, forward
from optimization import Optimization
class Model(object):
"""
Net... |
dantebarba/docker-media-server | refs/heads/master | plex/Sub-Zero.bundle/Contents/Libraries/Shared/dns/rdtypes/ANY/RP.py | 18 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
klmitch/humboldt | refs/heads/master | tools/hum_proto/tests/unit/test_ssl_utils.py | 1 | import ssl
import pytest
from six.moves import builtins
from hum_proto import ssl_utils
class ExceptionForTest(Exception):
pass
class TestStubSSLContext(object):
def test_init(self):
result = ssl_utils.StubSSLContext('protocol')
assert result.protocol == 'protocol'
assert result.c... |
ShawnSpooner/starcraft_agents | refs/heads/master | starcraft_agents/distributions.py | 1 | import torch
import torch.nn as nn
class Multinoulli(object):
def __init__(self):
super(Multinoulli, self).__init__()
self.neglogp = nn.CrossEntropyLoss()
def entropy(self, logits):
a0 = logits - torch.max(logits)
ea0 = torch.exp(a0)
z0 = ea0.sum(-1, keepdim=True)
... |
webuildcity/wbc | refs/heads/master | wbc/region/urls.py | 1 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from rest_framework import routers
from .views import *
router = routers.DefaultRouter()
router.register(r'muncipalities', MuncipalityViewSet, base_name='muncipality')
router.register(r'districts', DistrictViewSet, base_name='district')
router... |
YantaiGao/learn_Python_The-Hard-Way | refs/heads/master | projects/project1/setup.py | 1 | try
from setuptools import setup
except ImportError
from distutils.core import setup
config = [
"description":"My projects",
"author":"gyt",
"url":"url to get it at.",
"download_url":"where to download it",
"author_mail":"gaoyantai@gmail.com",
"version":"0.1",
"install_requires":['nose'],
"packages":['NAME'... |
manazhao/tf_recsys | refs/heads/r1.0 | tensorflow/tools/docs/py_guide_parser_test.py | 142 | # 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... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_models.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
aleksandra-tarkowska/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/integration/gatewaytest/test_search_objects.py | 15 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# 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 Found... |
googlearchive/big-rig | refs/heads/master | app/src/thirdparty/markdown/util.py | 102 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import sys
"""
Python 3 Stuff
=============================================================================
"""
PY3 = sys.version_info[0] == 3
if PY3: # pragma: no cover
string_type = str
text_type = str
int2str = chr
else: # pra... |
GroovyGregor/master_thesis | refs/heads/master | docs/source/get_scripts.py | 1 | '''Find all classes of MasterModule and write them to modules.rst for
the autosummary.
'''
# Python modules
import glob
import os
import re
# File that will be appended with scripts
script_file = 'rst/scripts.rst'
# Find scripts
scripts = glob.glob('../../python/scripts/*.py')
scripts = [os.path.basename(x) for x in... |
FighterLYL/elephas | refs/heads/master | elephas/spark_model.py | 5 | from __future__ import absolute_import
import numpy as np
import sys
from itertools import tee
from keras.models import Sequential, model_from_yaml
from pyspark.rdd import RDD
from .utils.functional_utils import add_params, get_neutral, divide_by
from .utils.rdd_utils import lp_to_simple_rdd
from .mllib.adapter impor... |
capoe/espressopp.soap | refs/heads/master | contrib/mpi4py/mpi4py-1.3/test/mpiunittest.py | 3 | import sys, os, glob
import unittest
class TestCase(unittest.TestCase):
def assertRaisesMPI(self, IErrClass, callableObj, *args, **kwargs):
from mpi4py.MPI import Exception as excClass, Get_version
try:
callableObj(*args, **kwargs)
except NotImplementedError:
if Get... |
yannrouillard/weboob | refs/heads/master | modules/citelis/backend.py | 2 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Laurent Bachelier
#
# This file is part of weboob.
#
# weboob 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 ... |
chengjf/database-interface-doc-management | refs/heads/master | flask-demo/flask/Lib/site-packages/wheel/signatures/djbec.py | 566 | # Ed25519 digital signatures
# Based on http://ed25519.cr.yp.to/python/ed25519.py
# See also http://ed25519.cr.yp.to/software.html
# Adapted by Ron Garret
# Sped up considerably using coordinate transforms found on:
# http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
# Specifically add-2008-hwcd-4 and d... |
coreyabshire/ptolemy | refs/heads/master | python/multilateration.py | 2 | # multilateration.py
# This file is part of the Ptolemy Layer for Google Earth project.
# It implements a method to compute unknown coordinates from known
# modern coordinates for locations given in Ptolemy. It is currently
# focused on book 7 (India region), but can and will be extended
# to other regions.
#
... |
speakerbug/Harold | refs/heads/master | Harold/harold.py | 1 | from __future__ import division
from __future__ import print_function
from get_user import read_ibutton, get_user_song
from alsaaudio import Mixer
import led_control as LED
import time
DING_SONG = "/harold/Harold/required/ding.mp3"
def quiet_hours():
' Returns True if the current time is within RIT quiet hours '... |
gquirozbogner/contentbox-master | refs/heads/master | third_party/django/conf/app_template/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
chitianhao/trafficserver | refs/heads/master | tests/gold_tests/tls_hooks/tls_hooks2.test.py | 4 | '''
Test single SNI hook
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.... |
2014c2g4/2015cda0623 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/image.py | 603 | #!/usr/bin/env python
'''Pygame module for image transfer.
The image module contains functions for loading and saving pictures, as
well as transferring Surfaces to formats usable by other packages.
Note that there is no Image class; an image is loaded as a
Surface object. The Surface class allows manipulation (drawi... |
glwu/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/heapq.py | 45 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
atheed/servo | refs/heads/master | tests/wpt/web-platform-tests/common/redirect.py | 259 | def main(request, response):
"""Simple handler that causes redirection.
The request should typically have two query parameters:
status - The status to use for the redirection. Defaults to 302.
location - The resource to redirect to.
"""
status = 302
if "status" in request.GET:
try:
... |
gordon-/yolo | refs/heads/master | student/views.py | 1 | from django.shortcuts import render
from learning.decorators import student
@student
def home(request):
promotion = request.user.groups.filter(promotion__isnull=False)\
.first().promotion
return render(request, 'student/home.html', {'promotion': promotion})
def example(request):
return render(re... |
etherkit/OpenBeacon2 | refs/heads/master | client/win/venv/Lib/site-packages/PyInstaller/loader/pyimod01_os_path.py | 2 | #-----------------------------------------------------------------------------
# Copyright (c) 2013-2019, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
TalShafir/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_snmp_target_host.py | 43 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
cginternals/gloperate | refs/heads/master | source/tests/googletest/googletest/scripts/release_docs.py | 1167 | #!/usr/bin/env python
#
# Copyright 2013 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... |
ride90/Booktype | refs/heads/master | lib/booktype/api/tokens.py | 7 | from django.contrib.auth.tokens import PasswordResetTokenGenerator
class SessionTokenGenerator(PasswordResetTokenGenerator):
"""
Simple strategy object that inherits from default PasswordResetTokenGenerator
used to generate and check tokens for the api authentication/session mechanism.
"""
key_sa... |
edx/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/gis/forms/__init__.py | 518 | from django.forms import *
from django.contrib.gis.forms.fields import GeometryField
|
morelab/labman_ud | refs/heads/master | labman_ud/entities/persons/views.py | 2 | # -*- encoding: utf-8 -*-
import threading
import weakref
from inflection import titleize
from django.shortcuts import get_object_or_404, get_list_or_404
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponse, Http404
from django.shortcu... |
iAMr00t/android_kernel_lge_ls840 | refs/heads/cm-10.1 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
coremind-oss/ttasm-web-server | refs/heads/development | allauth/socialaccount/providers/reddit/provider.py | 10 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class RedditAccount(ProviderAccount):
def to_str(self):
dflt = super(RedditAccount, self).to_str()
name = self.account.extra_data.get('name', dflt)
re... |
bunnyitvn/webptn | refs/heads/master | build/lib.linux-i686-2.7/django/contrib/messages/context_processors.py | 628 | from django.contrib.messages.api import get_messages
def messages(request):
"""
Returns a lazy 'messages' context variable.
"""
return {'messages': get_messages(request)}
|
Bulochkin/tensorflow_pack | refs/heads/master | tensorflow/contrib/factorization/python/ops/factorization_ops_test.py | 32 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
rhettg/Dynochemy | refs/heads/master | dynochemy/db.py | 1 | # -*- coding: utf-8 -*-
"""
This module contains the primary objects that powers Dynochemy.
:copyright: (c) 2012 by Rhett Garber.
:license: ISC, see LICENSE for more details.
"""
import copy
import json
import time
import logging
import pprint
import collections
from asyncdynamo import asyncdynamo
from .errors impor... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_key.py | 24 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
slightlymadphoenix/activityPointsApp | refs/heads/master | activitypoints/lib/python3.5/site-packages/django/contrib/auth/handlers/modwsgi.py | 54 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
UserModel = auth.get_user_model()
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on... |
kool79/intellij-community | refs/heads/master | python/testData/formatter/newLineAfterColonMultiClause_after.py | 83 | try:
pass
finally:
pass
|
FreeAgent/djangoappengine-starter | refs/heads/master | django/conf/locale/fi/formats.py | 316 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G.i.s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F... |
hectord/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/conf/locale/id/formats.py | 355 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, G.i.s"
TIME_FORMAT = 'G.i.s'
YEAR_MONTH_... |
ksmit799/Toontown-Source | refs/heads/master | toontown/parties/PartyGlobals.py | 1 | from pandac.PandaModules import BitMask32
from pandac.PandaModules import Point3, VBase4
from direct.showbase import PythonUtil
from toontown.toonbase import TTLocalizer
KICK_TO_PLAYGROUND_EVENT = 'parties_kickToPlayground'
MaxSetInvites = 1000
MaxSetPartiesInvitedTo = 100
MaxSetHostedParties = 50
MaxPlannedYear = 2030... |
mtnman38/Aggregate | refs/heads/master | Executables/Aggregate 0.8.7 for Macintosh.app/Contents/Resources/lib/python2.7/email/mime/base.py | 573 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME specializations."""
__all__ = ['MIMEBase']
from email import message
class MIMEBase(message.Message):
"""Base class for MIME specializations."""
def __init__(self, _maintype... |
gurneyalex/odoo | refs/heads/13.0-improve_sale_coupon_perf | addons/google_calendar/models/__init__.py | 36 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import res_config_settings
from . import calendar
from . import google_calendar
from . import res_users
|
spikelynch/neuralgae | refs/heads/master | src/classify.py | 1 | #!/usr/bin/env python2
# code to classify an input image and return the top n matching targets
from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
from google.protobuf import text_format
import argparse
import json
import re
import sys
import os, os.path, shutil, subprocess... |
plajjan/vrnetlab | refs/heads/master | vr-bgp/vr-bgp.py | 3 | #!/usr/bin/env python3
import ipaddress
import logging
import os
import signal
import subprocess
import sys
import time
import jinja2
def handle_SIGCHLD(signal, frame):
os.waitpid(-1, os.WNOHANG)
def handle_SIGTERM(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, handle_SIGTERM)
signal.signal(signa... |
collinprice/titanium_mobile | refs/heads/master | support/titanium.py | 34 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Titanium SDK script
#
import os, sys, subprocess, types, re, uuid, platform
from tiapp import *
from manifest import *
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
def die(msg):
print msg
sys.exit(1)
def validate_project_nam... |
blaze/partd | refs/heads/master | partd/file.py | 5 | from __future__ import absolute_import
import atexit
import os
import shutil
import string
import tempfile
from .core import Interface
import locket
from .utils import ignoring
class File(Interface):
def __init__(self, path=None, dir=None):
if not path:
path = tempfile.mkdtemp(suffix='.partd... |
PongPi/isl-odoo | refs/heads/8.0 | addons/pos_restaurant/restaurant.py | 325 | # -*- 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... |
dmccue/ansible | refs/heads/devel | v1/ansible/module_utils/ec2.py | 127 | # 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... |
danieldresser/cortex | refs/heads/master | test/IECore/ops/classVectorParameterTest/classVectorParameterTest-1.py | 12 | ##########################################################################
#
# Copyright (c) 2010, 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... |
PsyMar/FutbolRatings | refs/heads/master | src/CONCACAFandAFC.py | 1 | simulations = 1000000
import groups
from fetch_data import fetch_file_local
AFC_groups = {}
for line in fetch_file_local("data/AFC_groups.csv").splitlines():
commasplit = line.split(",")
groupname = commasplit[0]
group = commasplit[1:]
AFC_groups[groupname] = group
CONCACAF_groups = {}
for line in fet... |
napuzba/zagoload | refs/heads/master | samples/sample_02.py | 1 | import re
import zagoload
def queryBing(query,count):
def info(ss):
import sys ;sys.stdout.write(ss + u'\n')
def cleanTags(text):
return re.sub(u'<(.*?)>','',text)
# download url
params = {}
params['q'] = query
ff = zagoload.load('http://www.bing.com/',params=params)
if ff.valid:
info(u'{0} =... |
danakj/chromium | refs/heads/master | tools/perf/page_sets/mobile_memory.py | 22 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class MobileMemoryPage(page_module.P... |
bukepo/openthread | refs/heads/master | tools/harness-automation/cases/ed_6_5_3.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... |
newvem/pytz | refs/heads/master | pytz/zoneinfo/Asia/Beirut.py | 9 | '''tzinfo timezone information for Asia/Beirut.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Beirut(DstTzInfo):
'''Asia/Beirut timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Beirut'
_utc_tran... |
ClusterLabs/pcs | refs/heads/master | pcs_test/tier1/cib_resource/common.py | 3 | from unittest import TestCase
from lxml import etree
from pcs_test.tools.cib import get_assert_pcs_effect_mixin
from pcs_test.tools.misc import (
get_test_resource as rc,
get_tmp_file,
write_file_to_tmpfile,
)
from pcs_test.tools.pcs_runner import PcsRunner
def get_cib_resources(cib):
return etree.to... |
haukepetersen/RIOT | refs/heads/master | tests/pkg_micro-ecc-with-hwrng/tests/01-run.py | 6 | #!/usr/bin/env python3
import os
import sys
def testfunc(child):
child.expect_exact('micro-ecc compiled!')
child.expect_exact('Testing 16 random private key pairs and signature '
'using HWRNG')
child.expect_exact('................ done with 0 error(s)')
child.expect_exact('SUCC... |
sajeeshcs/nested_projects_keystone | refs/heads/master | keystone/contrib/oauth1/controllers.py | 1 | # Copyright 2013 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 agreed to in... |
HunterConnelly/firecares | refs/heads/master | firecares/urls.py | 1 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.defaults import page_not_found
from django.views.generic import TemplateView
from .firecares_core.forms import FirecaresPasswordResetForm
from .firecares_core.views import ForgotUserna... |
ehudmagal/robotqcapp | refs/heads/master | boto/manage/server.py | 63 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, incl... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/231_test_generators.py | 9 | tutorial_tests = """
Let's try a simple generator:
>>> def f():
... yield 1
... yield 2
>>> for i in f():
... print i
1
2
>>> g = f()
>>> g.next()
1
>>> g.next()
2
"Falling off the end" stops the generator:
>>> g.next()
Traceback (most recent call la... |
pcdocker/pcdocker | refs/heads/master | pcdocker/contrib/sites/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
axxx007xxxz/cm_kernel_motorola_msm8916 | refs/heads/test | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
ucoin-bot/cutecoin | refs/heads/master | src/cutecoin/gui/password_asker.py | 2 | '''
Created on 24 dec. 2014
@author: inso
'''
import logging
import re
from PyQt5.QtWidgets import QDialog, QMessageBox
from ..gen_resources.password_asker_uic import Ui_PasswordAskerDialog
class PasswordAskerDialog(QDialog, Ui_PasswordAskerDialog):
'''
A dialog to get password.
'''
def __init__... |
hmflash/Cura | refs/heads/master | plugins/USBPrinting/USBPrinterOutputDeviceManager.py | 1 | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Signal import Signal, signalemitter
from . import USBPrinterOutputDevice
from UM.Application import Application
from UM.Resources import Resources
from UM.Logger import Logger
from UM.PluginRegistry import PluginReg... |
vanhonit/xmario_center | refs/heads/master | softwarecenter/ui/gtk3/session/navhistory.py | 3 | # Copyright (C) 2010 Canonical
#
# Authors:
# Gary Lasker
#
# 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 3.
#
# This program is distributed in the hope that it will be useful, but WI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.