repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
rsvip/Django | refs/heads/master | tests/migrations/test_migrations_conflict/0001_initial.py | 2995 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name",... |
bl4ckdu5t/registron | refs/heads/master | PyInstaller/hooks/hook-wx.lib.activex.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, 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 softwa... |
xiaolihope/PerfKitBenchmarker-1.7.0 | refs/heads/master | perfkitbenchmarker/linux_packages/hbase.py | 2 | # Copyright 2015 PerfKitBenchmarker 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 appli... |
Shrhawk/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/social_facebook/preferences/urls.py | 128 | """
URLs for users sharing preferences
"""
from django.conf.urls import patterns, url
from .views import UserSharing
urlpatterns = patterns(
'mobile_api.social_facebook.preferences.views',
url(
r'^preferences/$',
UserSharing.as_view(),
name='preferences'
),
)
|
Lab603/PicEncyclopedias | refs/heads/master | jni-build/jni-build/jni/include/tensorflow/contrib/learn/python/learn/tests/io_test.py | 5 | # 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... |
landlab/landlab | refs/heads/master | tests/grid/test_radial_grid/test_nodes.py | 3 | from numpy.testing import assert_array_equal
from pytest import approx
from landlab import RadialModelGrid
def test_radius_at_node():
grid = RadialModelGrid(2, 8)
assert grid.radius_at_node == approx(
[
2.0,
2.0,
2.0,
2.0,
2.0,
1... |
amoldeshpande/googletest-vs2013 | refs/heads/master | test/gtest_env_var_test.py | 2408 | #!/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... |
dsiddharth/access-keys | refs/heads/master | keystone/openstack/common/db/sqlalchemy/utils.py | 2 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... |
sam-m888/gprime | refs/heads/master | gprime/datehandler/_date_de.py | 1 | # -*- coding: utf-8 -*-
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lice... |
orekyuu/intellij-community | refs/heads/master | python/testData/psi/BadDecoratorNotMethod.py | 80 | class Foo(object):
@staticmethod
def bad_method(): #test
pass |
sinkpoint/research-mri-db | refs/heads/master | patientdb/patientdb/settings-default.py | 1 | """
Django settings for patientdb project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... |
mdanielwork/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/lsprofcalltree.py | 100 | """
lsprofcalltree.py - lsprof output which is readable by kcachegrind
Authors:
* David Allouche <david <at> allouche.net>
* Jp Calderone & Itamar Shtull-Trauring
* Johan Dahlin
This software may be used and distributed according to the terms
of the GNU General Public License, incorporated herein by refer... |
skycucumber/Messaging-Gateway | refs/heads/master | src/Command/SetProfile.py | 1 | '''
Created on 2013-9-5
@author: E525649
'''
from BaseCommand import CBaseCommand
from sqlalchemy.exc import SQLAlchemyError
from DB import SBDB,SBDB_ORM
from Command import BaseCommand
import logging
class CSetProfile(CBaseCommand):
'''
classdocs
'''
command_id=0x00050001
def _... |
ujjvala-addsol/addsol_hr | refs/heads/master | openerp/addons/test_documentation_examples/delegation.py | 366 | # -*- coding: utf-8 -*-
from openerp import models, fields
class Child0(models.Model):
_name = 'delegation.child0'
field_0 = fields.Integer()
class Child1(models.Model):
_name = 'delegation.child1'
field_1 = fields.Integer()
class Delegating(models.Model):
_name = 'delegation.parent'
_inh... |
pathway27/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/filters/optionaltags.py | 1727 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2... |
ptitjes/quodlibet | refs/heads/master | dev-utils/win_installer/misc/gen_supported_types.py | 5 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... |
pintubigfoot/pinturun | refs/heads/master | printrun/GCodeAnalyzer.py | 1 | # This file is part of the Printrun suite.
#
# Copyright 2013 Francesco Santini francesco.santini@gmail.com
#
# Printrun 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
# (a... |
ryankurte/mbed-os | refs/heads/master | tools/misc/find_c_includes.py | 64 | #!/usr/bin/env python
import os
import re
def main(path='.', pattern=r'#include\s+"([^"]*\.(?:c|cpp))"'):
pattern = re.compile(pattern)
for root, dirs, files in os.walk(path, followlinks=True):
for file in files:
with open(os.path.join(root, file)) as f:
for line in f.read... |
Cinntax/home-assistant | refs/heads/dev | homeassistant/components/zha/device_tracker.py | 5 | """Support for the ZHA platform."""
import logging
import time
from homeassistant.components.device_tracker import DOMAIN, SOURCE_TYPE_ROUTER
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatc... |
ThomasDoylend/Zen | refs/heads/master | sys/boot/config/config2.py | 1 | #Zen
#
#Config manager 2
import pickle
class Config2:
name = 'Config Manager v2'
config_path = '{home}/sys/boot/config/config.pkl'
def __init__(self,kernel):
self.kernel = kernel
self.fs = self.kernel.get_service('fs')
self.data = pickle.load(self.fs.ope... |
RabadanLab/MITKats | refs/heads/master | Modules/Biophotonics/python/iMC/mc/test/test_sim.py | 6 | '''
Created on Sep 8, 2015
@author: wirkert
'''
import unittest
import filecmp
import os
from mc.sim import MciWrapper, SimWrapper, \
get_total_reflectance, get_diffuse_reflectance
path_to_gpumcml = "/home/wirkert/workspace/monteCarlo/gpumcml/" + \
"fast-gp... |
piotrpawlaczek/suds-jurko | refs/heads/master | suds/xsd/schema.py | 7 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will b... |
def-/commandergenius | refs/heads/sdl_android | project/jni/python/src/Demo/scripts/ftpstats.py | 32 | #! /usr/bin/env python
# Extract statistics from ftp daemon log.
# Usage:
# ftpstats [-m maxitems] [-s search] [file]
# -m maxitems: restrict number of items in "top-N" lists, default 25.
# -s string: restrict statistics to lines containing this string.
# Default file is /usr/adm/ftpd; a "-" means read standard in... |
reevejd/Teksavvy-Internet-Monitor | refs/heads/master | node_modules/utf8/tests/generate-test-data.py | 1788 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... |
DaneTheory/MozDef | refs/heads/master | alerts/lib/alerttask.py | 3 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
#
# Contributors:
# Anthony Verez averez@mozilla.com
# Je... |
felixfontein/ansible | refs/heads/devel | test/support/windows-integration/plugins/modules/win_certificate_store.py | 99 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... |
Jusedawg/SickRage | refs/heads/develop | lib/hachoir_parser/video/mov.py | 56 | """
Apple Quicktime Movie (file extension ".mov") parser.
Documents:
- Parsing and Writing QuickTime Files in Java (by Chris Adamson, 02/19/2003)
http://www.onjava.com/pub/a/onjava/2003/02/19/qt_file_format.html
- QuickTime File Format (official technical reference)
http://developer.apple.com/documentation/QuickTi... |
hMatoba/Piexif | refs/heads/master | piexif/_load.py | 1 | import struct
import sys
from ._common import *
from ._exceptions import InvalidImageDataError
from ._exif import *
from piexif import _webp
LITTLE_ENDIAN = b"\x49\x49"
def load(input_data, key_is_name=False):
"""
py:function:: piexif.load(filename)
Return exif data as dict. Keys(IFD name), be containe... |
ruansteve/neutron-dynamic-routing | refs/heads/master | neutron_dynamic_routing/services/bgp/agent/entry.py | 1 | # Copyright 2016 Huawei Technologies India Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
wweiradio/zulip | refs/heads/master | zilencer/models.py | 126 | from django.db import models
import zerver.models
def get_deployment_by_domain(domain):
return Deployment.objects.get(realms__domain=domain)
class Deployment(models.Model):
realms = models.ManyToManyField(zerver.models.Realm, related_name="_deployments")
is_active = models.BooleanField(default=True)
... |
zhakui/enjarify | refs/heads/master | enjarify/jvm/constants/genlookup.py | 30 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
ken-muturi/pombola | refs/heads/master | pombola/tasks/models.py | 5 | import datetime
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.db.models import signals
from django.dispatch import receiver
class TaskCategory(models.Model):
slug = models.SlugField(max_length=100, unique=T... |
mhbu50/erpnext | refs/heads/develop | erpnext/erpnext_integrations/doctype/gocardless_settings/test_gocardless_settings.py | 19 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
class TestGoCardlessSettings(unittest.TestCase):
pass
|
blossomica/airmozilla | refs/heads/master | airmozilla/manage/event_hit_stats.py | 15 | import logging
import datetime
from django.utils import timezone
from airmozilla.main.models import Event, EventHitStats
from . import vidly
# this is what the cron job fires every X minutes
def update(cap=10, swallow_errors=False):
count = 0
# first do those that have never been updated
_stats_ids_qs ... |
Manouchehri/metagoofil | refs/heads/master | hachoir_core/field/__init__.py | 94 | # Field classes
from hachoir_core.field.field import Field, FieldError, MissingField, joinPath
from hachoir_core.field.bit_field import Bit, Bits, RawBits
from hachoir_core.field.byte_field import Bytes, RawBytes
from hachoir_core.field.sub_file import SubFile, CompressedField
from hachoir_core.field.character import C... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/plugins/terminal/asa.py | 42 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
meshulam/chicago-justice | refs/heads/master | cjp/crimedata/views.py | 1 | from crimedata.models import CrimeReport, LookupCRCrimeDateMonth, LookupCRCode, LookupCRCrimeType, LookupCRSecondary, LookupCRBeat, LookupCRWard, LookupCRNibrs
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django import forms
from django.http import HttpResponse
from django.db.models import Q... |
mdanielwork/intellij-community | refs/heads/master | python/testData/inspections/PyMethodMayBeStaticInspection/notImplemented.py | 83 | __author__ = 'ktisha'
class A:
def pop(self):
raise NotImplementedError() |
ceph/autotest | refs/heads/master | client/common_lib/test_utils/mock_demo_MUT.py | 12 | from mock_demo import E
def do_create_stuff():
obj = E(val=7)
print obj.method1()
|
MasterFacilityList/mfl_api | refs/heads/develop | users/tasks.py | 1 | import pydoc
import logging
from django.core.mail import mail_admins
from celery.task.schedules import crontab
from celery.decorators import periodic_task
from common.models import ErrorQueue
from users.models import send_email_on_signup, MflUser
LOGGER = logging.getLogger(__name__)
@periodic_task(
run_every... |
deroneriksson/incubator-systemml | refs/heads/master | scripts/perftest/python/datagen.py | 13 | #!/usr/bin/env python3
# -------------------------------------------------------------
#
# 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 ... |
Tchanders/socorro | refs/heads/master | socorro/lib/task_manager.py | 9 | import time
import threading
import os
from configman import RequiredConfig, Namespace
from configman.converters import class_converter
#------------------------------------------------------------------------------
def default_task_func(a_param):
"""This default consumer function just doesn't do anything. It is... |
pythonprobr/pythonbirds-en | refs/heads/training | fases/escudo_espartano.py | 1 | # -*- coding: utf-8 -*-
from os import path
import sys
import math
project_dir = path.dirname(__file__)
project_dir = path.join('..')
sys.path.append(project_dir)
from actors import YellowBird, Obstacle, Pig
from phase import Phase
from graphics_tk import run_phase
from random import randint
if __name__ == '__main__... |
maxvogel/NetworKit-mirror2 | refs/heads/master | Doc/docs/python/source/ext/numpydoc/tests/test_plot_directive.py | 31 | from __future__ import division, absolute_import, print_function
import sys
from nose import SkipTest
def test_import():
if sys.version_info[0] >= 3:
raise SkipTest("plot_directive not ported to Python 3 (use the one from Matplotlib instead)")
import numpydoc.plot_directive
# No tests at the moment..... |
kennedyshead/home-assistant | refs/heads/dev | homeassistant/components/kira/__init__.py | 7 | """KIRA interface to receive UDP packets from an IR-IP bridge."""
import logging
import os
import pykira
import voluptuous as vol
from voluptuous.error import Error as VoluptuousError
import yaml
from homeassistant.const import (
CONF_CODE,
CONF_DEVICE,
CONF_HOST,
CONF_NAME,
CONF_PORT,
CONF_RE... |
da1z/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/convert/cvs.py | 94 | # cvs.py: CVS conversion code inspired by hg-cvs-import and git-cvsimport
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, re, socket, errno
from cString... |
throwable-one/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/utils/ogrinspect.py | 321 | """
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
Author: Travis Pinney, Dane Springmeyer, & Justin Bronn
"""
from itertools import izip
# Requires GDAL to use.
from django.contrib.gis.gdal import DataSourc... |
lanfker/vPRKS | refs/heads/master | src/mobility/bindings/modulegen__gcc_LP64.py | 28 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
fnordahl/nova | refs/heads/master | nova/scheduler/manager.py | 8 | # 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... |
neiudemo1/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex_multi_apps/app1/1_auto.py | 1155 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
mujiansu/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_ctypes.py | 50 | import unittest
from test.test_support import run_unittest
import ctypes.test
def test_main():
skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
suites = [unittest.makeSuite(t) for t in testcases]
run_unittest(unittest.TestSuite(suites))
if __name__ == "__main__":
test... |
rv816/wagtail | refs/heads/master | wagtail/wagtailadmin/views/generic.py | 14 | from django.core.urlresolvers import reverse
from django.shortcuts import render, redirect, get_object_or_404
from django.utils.translation import ugettext as _, ugettext_lazy as __
from django.views.generic.base import View
from wagtail.wagtailadmin import messages
from wagtail.wagtailadmin.utils import permission_de... |
yan12125/youtube-dl | refs/heads/master | youtube_dl/extractor/roxwel.py | 73 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate, determine_ext
class RoxwelIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
_TEST = {
'url': 'http://www.roxwel.com/player/passi... |
FlowFX/reggae-cdmx | refs/heads/master | config/urls.py | 1 | """Reggae CDMX URL Configuration."""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.http import HttpResponseNotFound
from django.urls import include, path
from app.events.views import HomePage
from django.views.generic import RedirectView, Temp... |
TshepangRas/tshilo-dikotla | refs/heads/develop | td_infant/apps.py | 2 | from django.apps import AppConfig
class TdInfantConfig(AppConfig):
name = 'td_infant'
verbose_name = 'td_infant'
|
houzhenggang/TcpRoute | refs/heads/master | win_inet_pton.py | 2 | # https://github.com/hickeroar/win_inet_pton/blob/master/win_inet_pton.py
# This software released into the public domain. Anyone is free to copy,
# modify, publish, use, compile, sell, or distribute this software,
# either in source code form or as a compiled binary, for any purpose,
# commercial or non-commercial, an... |
BlueBrain/Poppler | refs/heads/bbp | regtest/commands/run-tests.py | 15 | # run-tests.py
#
# Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later... |
ryanahall/django | refs/heads/master | django/views/decorators/cache.py | 586 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... |
runekaagaard/django-contrib-locking | refs/heads/master | django/contrib/auth/backends.py | 42 | from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
class ModelBackend(object):
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
def authenticate(self, username=None, password=None, **kwargs):
UserMode... |
skyduy/zfverify | refs/heads/master | Verify-Manual-python/train/split_imgs.py | 2 | # coding: utf-8
import os
from PIL import Image
def img2single(samples_folder, single_folder):
imgs = os.listdir(samples_folder)
for img in imgs:
image = Image.open('%s/%s' % (samples_folder, img)).convert("L")
x_size, y_size = image.size
y_size -= 5
# y from 1 to y_size-5
... |
jazzband/silk | refs/heads/master | silk/auth.py | 1 | from functools import wraps, WRAPPER_ASSIGNMENTS
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from silk.config import SilkyConfig
def login_possibly_required(function=None, **kwargs):
if SilkyConfig().SILKY_AUTHENTICATION:
return login_req... |
gsmartway/odoo | refs/heads/8.0 | addons/l10n_uk/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Smartmode LTD (<http://www.smartmode.co.uk>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as... |
keedio/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Random/Fortuna/SHAd256.py | 127 | # -*- coding: ascii -*-
#
# Random/Fortuna/SHAd256.py : SHA_d-256 hash function implementation
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that de... |
MortimerGoro/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/nosniff/resources/worker.py | 219 | def main(request, response):
type = request.GET.first("type", None)
content = "// nothing to see here"
content += "\n"
content += "this.postMessage('hi')"
response.add_required_headers = False
response.writer.write_status(200)
response.writer.write_header("x-content-type-options", "nosniff... |
Reagankm/KnockKnock | refs/heads/master | venv/lib/python3.4/site-packages/nltk/chunk/regexp.py | 10 | # Natural Language Toolkit: Regular Expression Chunkers
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com> (minor additions)
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function, unicode_... |
PyDev777/studentsdb | refs/heads/master | students/views/events_log.py | 1 | from django.views.generic import TemplateView
from django.core.urlresolvers import reverse
from ..models import LogEntry
from ..util import paginate
class EventLogView(TemplateView):
template_name = 'students/events_log.html'
def get_context_data(self, **kwargs):
context = super(EventLogView, self).g... |
gromez/Sick-Beard | refs/heads/development | sickbeard/searchBacklog.py | 47 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
bdaroz/the-blue-alliance | refs/heads/master | tests/test_team_manipulator.py | 8 | import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from helpers.team_manipulator import TeamManipulator
from models.team import Team
class TestTeamManipulator(unittest2.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
self.testbed.activate(... |
mcsosa121/cafa | refs/heads/master | cafaenv/lib/python2.7/site-packages/django/contrib/postgres/signals.py | 548 | from psycopg2 import ProgrammingError
from psycopg2.extras import register_hstore
from django.utils import six
def register_hstore_handler(connection, **kwargs):
if connection.vendor != 'postgresql':
return
try:
if six.PY2:
register_hstore(connection.connection, globally=True, un... |
xfournet/intellij-community | refs/heads/master | python/testData/completion/await.py | 54 | async def foo():
awa<caret> # comment
|
Skytim/nccuTEG | refs/heads/master | test/test_uploader/test_generic_uploader.py | 9 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa 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... |
ya7lelkom/googleads-python-lib | refs/heads/master | examples/dfp/v201505/placement_service/get_placements_by_statement.py | 3 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
alexanian/uwaterloo-igem-2015 | refs/heads/master | models/targeting/genome_classes.py | 4 | from probabilistic import prob_cut, nt_rand, indel
# Script to store principle simulation classes and their interactions
# Gene/genome de-activation defined by:
# - frameshift mutation in an ORF
# - deletion of a promoter
# - deletion of a significant portion of the gene
class Target(object):
def __init_... |
egbertbouman/tribler-g | refs/heads/master | Tribler/Main/Dialogs/GUITaskQueue.py | 1 | # Written by Arno Bakker
# see LICENSE.txt for license information
#
# GUITaskQueue is a server that executes tasks on behalf of the GUI that are too
# time consuming to be run by the actual GUI Thread (MainThread). Note that
# you still need to delegate the actual updating of the GUI to the MainThread via
# wx.C... |
Daniel-CA/odoo | refs/heads/8.0 | openerp/report/render/makohtml2html/makohtml2html.py | 443 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
zstackio/zstack-woodpecker | refs/heads/master | integrationtest/vm/multihosts/snapshots/paths/path15.py | 2 | import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template1", \
path_list=[[TestAction.stop_vm, "vm1"], \
[TestAction.reinit_vm, "vm1"], \
[TestAction.start_vm, "vm1"], \
... |
rdo-management/tuskar | refs/heads/mgt-master | tuskar/db/sqlalchemy/migrate_repo/manage.py | 1 | #
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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... |
rowhit/jasper-client | refs/heads/master | tests/test_modules.py | 32 | #!/usr/bin/env python2
# -*- coding: utf-8-*-
import unittest
from client import test_mic, diagnose, jasperpath
from client.modules import Life, Joke, Time, Gmail, HN, News, Weather
DEFAULT_PROFILE = {
'prefers_email': False,
'location': 'Cape Town',
'timezone': 'US/Eastern',
'phone_number': '012344321... |
linjoahow/w17g | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/xml/etree/__init__.py | 1200 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... |
leekchan/django_test | refs/heads/master | django/contrib/messages/storage/session.py | 288 | import json
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import MessageEncoder, MessageDecoder
from django.utils import six
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session... |
d40223223/2015cdbg6team0622 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/importlib/basehook.py | 608 | from javascript import JSObject
from browser import window
import urllib.request
class TempMod:
def __init__(self, name):
self.name=name
#define my custom import hook (just to see if it get called etc).
class BaseHook:
def __init__(self, fullname=None, path=None):
self._fullname=fullname
self._p... |
yajnab/android_kernel_sony_taoshan | refs/heads/jellybean | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
laperry1/android_external_chromium_org | refs/heads/cm-12.1 | build/android/pylib/perf/perf_control_unittest.py | 37 | # 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.
# pylint: disable=W0212
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
from pylib impo... |
ElOceanografo/EchoMetrics | refs/heads/master | build/lib/echometrics/__init__.py | 2 | # __init__.py
from echometrics import * |
HenrikSolver/micropython | refs/heads/master | drivers/onewire/ds18x20.py | 33 | # DS18x20 temperature sensor driver for MicroPython.
# MIT license; Copyright (c) 2016 Damien P. George
from micropython import const
_CONVERT = const(0x44)
_RD_SCRATCH = const(0xbe)
_WR_SCRATCH = const(0x4e)
class DS18X20:
def __init__(self, onewire):
self.ow = onewire
self.buf = bytearray(9)
... |
phisiart/tvm | refs/heads/opengl | topi/tests/python_cpp/test_topi_broadcast.py | 1 | """Test code for broadcasting operators."""
import os
import numpy as np
import tvm
import topi
def verify_broadcast_to_ele(in_shape, out_shape):
# Build the logic and compile the function
A = tvm.placeholder(shape=in_shape, name="A")
B = topi.cpp.broadcast_to(A, out_shape)
def check_device(device):
... |
kfoss/thrift | refs/heads/0.1.x | tutorial/php/runserver.py | 117 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... |
jimt/wikieducator-package | refs/heads/master | wikieducator_package_config_sample.py | 1 | # rename to wikieducator_package_config.py and edit to suit
# directory for ZIP files, needs to be web accessible
zips_directory = '/var/www/html/wikieducator'
# base download URL corresponding to that directory
# (no trailing slash)
download_url = 'http://example.com/wikieducator'
# directory containing templates ... |
Jenselme/OWSLib | refs/heads/master | owslib/swe/sensor/__init__.py | 144 |
from __future__ import (absolute_import, division, print_function)
|
eLBati/odoo | refs/heads/master | addons/mail/static/scripts/__init__.py | 58 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-2010 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... |
jledbetter/openhatch | refs/heads/master | mysite/profile/migrations/0079_smaller_thumbnail.py | 17 | # This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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 Licens... |
megaumi/django | refs/heads/master | tests/utils_tests/test_encoding.py | 288 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import unittest
from django.utils import six
from django.utils.encoding import (
escape_uri_path, filepath_to_uri, force_bytes, force_text, iri_to_uri,
smart_text, uri_to_iri,
)
from django.utils.functional import SimpleLazyObje... |
atiqueahmedziad/addons-server | refs/heads/master | src/olympia/ratings/tests/test_helpers.py | 5 | from django.template import engines
from pyquery import PyQuery as pq
from olympia.addons.models import Addon
from olympia.amo.tests import TestCase, addon_factory
from olympia.amo.urlresolvers import reverse
from olympia.ratings.forms import RatingForm
from olympia.ratings.models import RatingFlag
class HelpersTes... |
saraivaufc/PySpy | refs/heads/master | pysocket/__init__.py | 1 | from .pysocket import * |
pedro2d10/SickRage-FR | refs/heads/develop | lib/html5lib/treeadapters/sax.py | 1835 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... |
liurenqiu520/AutobahnPython | refs/heads/master | examples/twisted/websocket/echo_tls/server.py | 18 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... |
nickrobinson/VoicemailStress | refs/heads/master | call.py | 1 | import sys
import pjsua as pj
import time
# Logging callback
def log_cb(level, str, len):
print str,
# Callback to receive events from Call
class MyCallCallback(pj.CallCallback):
def __init__(self, call=None):
pj.CallCallback.__init__(self, call)
# Notification when call state has changed
def... |
jhunufernandes/ArduWatchRaspSerial | refs/heads/master | virtualenv/lib/python3.4/site-packages/pkg_resources/_vendor/packaging/__init__.py | 1178 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from .__about__ import (
__author__, __copyright__, __email__, __licen... |
ausarbluhd/EternalLLC | refs/heads/master | scripts/mallory/src/dns/e164.py | 248 | # Copyright (C) 2006, 2007, 2009 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 "AS I... |
EnTeQuAk/django-filer | refs/heads/develop | filer/utils/loader.py | 22 | #-*- coding: utf-8 -*-
"""
This function is snatched from
https://github.com/ojii/django-load/blob/3058ab9d9d4875589638cc45e84b59e7e1d7c9c3/django_load/core.py#L49
local changes:
* added check for basestring to allow values that are already an object
or method.
"""
from django.utils import six
from django.utils.imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.