repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tyrchen/karp | refs/heads/master | apps/comparison/views.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.views.generic import FormView
from forms import ComparisonForm
from models import Comparison
from __init__ import __info__
__author__ = 'tchen'
logger = logging.getLogger(__name__)
class ComparisonView(FormView):
template_... |
denverfoundation/storybase | refs/heads/develop | apps/storybase_asset/utils.py | 1 | def img_el(attrs):
chunks = ["<img"]
for attr, value in attrs.iteritems():
chunks.append(' %s="%s"' % (attr, value))
chunks.append(" />")
return "".join(chunks)
def image_type_supported(file_or_path, close=False):
# Try to import PIL in either of the two ways it can end up installed.
tr... |
twz915/django | refs/heads/master | django/views/generic/detail.py | 2 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
class SingleObjectMixin(ContextMixin):
"""
Provides the abilit... |
lehinevych/cfme_tests | refs/heads/master | utils/db_queries.py | 4 | # -*- coding: utf-8 -*-
from utils.db import cfmedb, Db
def get_configuration_details(db=None, ip_address=None):
"""Return details that are necessary to navigate through Configuration accordions.
Args:
ip_address: IP address of the server to match. If None, uses hostname from
``conf.env[... |
craigderington/studentloan5 | refs/heads/master | studentloan5/Lib/imp.py | 97 | """This module provides the components needed to build your own __import__
function. Undocumented functions are obsolete.
In most cases it is preferred you consider using the importlib module's
functionality over this module.
"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lo... |
klassenjs/geomoose-js | refs/heads/master | util/compileCSS.py | 4 | #!/usr/bin/python
#
# Copyright (c) 2009-2012, Dan "Ducky" Little & GeoMOOSE.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, including without limitation the rights... |
jolene-esposito/osf.io | refs/heads/develop | api/base/pagination.py | 22 | from collections import OrderedDict
from rest_framework import pagination
from rest_framework.response import Response
from rest_framework.utils.urls import (
replace_query_param, remove_query_param
)
class JSONAPIPagination(pagination.PageNumberPagination):
"""Custom paginator that formats responses in a JSO... |
Airphrame/mapnik | refs/heads/master | scons/scons-local-2.3.4/SCons/Tool/tex.py | 9 | """SCons.Tool.tex
Tool-specific initialization for TeX.
Generates .dvi files from .tex files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission ... |
mycodeday/crm-platform | refs/heads/master | base/res/res_currency.py | 53 | # -*- 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... |
optimusThePrime/BackOffice | refs/heads/master | src/App/AdminBundle/Resources/public/css/assets/jquery-file-upload/server/gae-python/main_1.py | 223 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appeng... |
GoogleCloudPlatform/training-data-analyst | refs/heads/master | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/kfp-azure-databricks/databricks/_run_op.py | 3 | import json
from kfp.dsl import ResourceOp
class SubmitRunOp(ResourceOp):
"""Represents an Op which will be translated into a Databricks Run submission
resource template.
Examples:
import databricks
databricks.SubmitRunOp(
name="submitrun",
run_name="test-run",
... |
thopiekar/Cura | refs/heads/master | cura/Machines/MachineErrorChecker.py | 1 | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import time
from collections import deque
from PyQt5.QtCore import QObject, QTimer, pyqtSignal, pyqtProperty
from UM.Application import Application
from UM.Logger import Logger
from UM.Settings.SettingDefinition import S... |
pllim/astropy | refs/heads/placeholder | astropy/wcs/wcsapi/wrappers/sliced_wcs.py | 8 | import numbers
from collections import defaultdict
import numpy as np
from astropy.utils import isiterable
from astropy.utils.decorators import lazyproperty
from ..low_level_api import BaseLowLevelWCS
from .base import BaseWCSWrapper
__all__ = ['sanitize_slices', 'SlicedLowLevelWCS']
def sanitize_slices(slices, n... |
Permutatrix/servo | refs/heads/master | tests/wpt/web-platform-tests/common/large.py | 238 | def main(request, response):
"""Code for generating large responses where the actual response data
isn't very important.
Two request parameters:
size (required): An integer number of bytes (no suffix) or kilobytes
("kb" suffix) or megabytes ("Mb" suffix).
string (optional): The... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/input_boolean/reproduce_state.py | 16 | """Reproduce an input boolean state."""
import asyncio
import logging
from typing import Any, Dict, Iterable, Optional
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
)
from homeassistant.core import Context, State
from homeassistant.helpers... |
rakeshmi/cinder | refs/heads/master | cinder/openstack/common/loopingcall.py | 8 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
DaanHoogland/cloudstack | refs/heads/patch-2 | test/systemvm/test_hello_systemvm.py | 7 | # 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
# "License"); you may not u... |
AICP/external_chromium_org | refs/heads/lp5.0 | third_party/tlslite/tlslite/utils/pycrypto_rsakey.py | 55 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""PyCrypto RSA implementation."""
from .cryptomath import *
from .rsakey import *
from .python_rsakey import Python_RSAKey
if pycryptoLoaded:
from Crypto.PublicKey import RSA
class PyCrypto_RSAKey(RSAKey):
... |
gengue/django | refs/heads/master | tests/app_loading/tests.py | 288 | from __future__ import unicode_literals
import os
from django.apps import apps
from django.test import SimpleTestCase
from django.test.utils import extend_sys_path
from django.utils import six
from django.utils._os import upath
class EggLoadingTest(SimpleTestCase):
def setUp(self):
self.egg_dir = '%s/e... |
ericsnowcurrently/micropython | refs/heads/master | tests/basics/bytes_find.py | 58 | print(b"hello world".find(b"ll"))
print(b"hello world".find(b"ll", None))
print(b"hello world".find(b"ll", 1))
print(b"hello world".find(b"ll", 1, None))
print(b"hello world".find(b"ll", None, None))
print(b"hello world".find(b"ll", 1, -1))
print(b"hello world".find(b"ll", 1, 1))
print(b"hello world".find(b"ll", 1, 2))... |
wfxiang08/ansible | refs/heads/devel | v1/ansible/runner/poller.py | 132 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
veeti/vasara | refs/heads/master | vasara/item.py | 1 | import json
import re
# This regex pattern has been shamelessly lifted from Mynt, licensed under the
# BSD license. Mynt is available at https://github.com/Anomareh/mynt
MATCHER = re.compile(r"\A---\s+^(.+?)$\s+---\s*(.*)\Z", re.M | re.S)
class Item(object):
def __init__(self, filename, site, raw, route=None):
... |
antonve/s4-project-mooc | refs/heads/master | lms/djangoapps/debug/models.py | 4209 | # Create your models here.
|
ormnv/os_final_project | refs/heads/master | django/contrib/gis/tests/layermap/models.py | 230 | from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... |
VigTech/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/django/conf/app_template/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
tomwillfixit/shipitcon2017 | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py | 2479 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the xcode.py file. """
import gyp.generator.xcode as xcode
import unittest
import sys
class TestEscapeXcodeDefine(unit... |
ondra-novak/blink | refs/heads/nw | Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py | 15 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
mrkn/iTerm2 | refs/heads/master | tools/ply/ply-3.4/test/yacc_prec1.py | 164 | # -----------------------------------------------------------------------------
# yacc_prec1.py
#
# Tests case where precedence specifier doesn't match up to terminals
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.... |
sputnick-dev/weboob | refs/heads/master | modules/monster/browser.py | 6 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# 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 your opt... |
with-git/tensorflow | refs/heads/master | tensorflow/python/ops/nn_test.py | 5 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
VAMDC/NodeSoftware | refs/heads/master | nodes/vald/node_molec/urls.py | 4 | from django.conf.urls.defaults import *
from django.conf import settings
urlpatterns = patterns(settings.NODENAME+'.node.views',
(r'^$', 'index'),
)
|
QianBIG/odoo | refs/heads/8.0 | openerp/service/__init__.py | 380 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you c... |
luiseduardohdbackup/odoo | refs/heads/8.0 | addons/website_hr_recruitment/__init__.py | 3964 | import controllers
import models
|
squattingmonk/beginner-projects | refs/heads/master | fibonacci.py | 1 | '''
fibonacci.py: Prints the Fibonacci sequence to the limit specified by the user.
Uses a generator function for fun. Based on https://redd.it/19r3qg.
'''
def fib(n):
a, b = 0, 1
for i in range(n):
yield a
a, b = b, a + b
if __name__ == '__main__':
n = None
while n is None:
tr... |
srwalter/yap | refs/heads/master | yap/__init__.py | 1 | from yap import YapCore, YapError, ShellError
import yap
import util
|
selvakarthik21/newspaper | refs/heads/dev | newspaperdemo/source/mthreading.py | 5 | # -*- coding: utf-8 -*-
"""
Anything that has to do with threading in this library
must be abstracted in this file. If we decide to do gevent
also, it will deserve its own gevent file.
"""
__title__ = 'newspaper'
__author__ = 'Lucas Ou-Yang'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014, Lucas Ou-Yang'
import qu... |
jbuchbinder/youtube-dl | refs/heads/master | youtube_dl/extractor/__init__.py | 89 | from __future__ import unicode_literals
try:
from .lazy_extractors import *
from .lazy_extractors import _ALL_CLASSES
_LAZY_LOADER = True
except ImportError:
_LAZY_LOADER = False
from .extractors import *
_ALL_CLASSES = [
klass
for name, klass in globals().items()
if na... |
mujin/jhbuild | refs/heads/master | scripts/hg-update.py | 3 | #! /usr/bin/env python2
#
# hg-update - pull and update a mercurial repository
#
# Copyright (C) 2007 Marco Barisione <marco@barisione.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; eit... |
hashimmm/iiifoo | refs/heads/master | iiifoo_server/__init__.py | 1 | """This package contains the flask application that runs as the HTTP server.
A lot of view functions have two code paths: this is because originally the
two different 'source types' had different URIs, but then they were merged to
use the same URIs/APIs. This might be refactored sooner or later to be neater.
"""
impor... |
eldie1984/Scripts | refs/heads/master | pg/pruebas/para.py | 1 | import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
ssh.connect('127.0.0.1', username='e449806',
password='Die1984nuel')
stdin, stdout, stderr = ssh.exec_command("uptime")
type(stdin)
stdout.readlines()
|
codervince/flashingredlight | refs/heads/master | env/lib/python2.7/site-packages/pip/commands/completion.py | 435 | from __future__ import absolute_import
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
CO... |
CYBAI/servo | refs/heads/master | tests/wpt/web-platform-tests/workers/modules/resources/redirect.py | 19 | def main(request, response):
"""Simple handler that causes redirection.
This is placed here to stay within the same directory during redirects,
to avoid issues like https://crbug.com/1136775.
"""
response.status = 302
location = request.GET.first(b"location")
response.headers.set(b"Location"... |
wackou/guessit | refs/heads/master | guessit/api.py | 11 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
API functions that can be used by external software
"""
try:
from collections import OrderedDict
except ImportError: # pragma: no-cover
from ordereddict import OrderedDict # pylint:disable=import-error
import traceback
import six
from rebulk.introspector im... |
lovexiaov/SandwichApp | refs/heads/master | venv/lib/python2.7/site-packages/macholib/SymbolTable.py | 16 | """
Class to read the symbol table from a Mach-O header
"""
from macholib.mach_o import *
__all__ = ['SymbolTable']
# XXX: Does not support 64-bit, probably broken anyway
class SymbolTable(object):
def __init__(self, macho, openfile=None):
if openfile is None:
openfile = open
self.ma... |
rwl/muntjac | refs/heads/master | muntjac/demo/sampler/features/form/__init__.py | 1 |
from muntjac.demo.sampler.features.form.LoginForm import LoginForm
from muntjac.demo.sampler.features.form.FormBasic import FormBasic
from muntjac.demo.sampler.features.form.FormAdvancedLayout import FormAdvancedLayout
|
honahursey/pyFDA | refs/heads/master | pyfda/hdl_generation/__init__.py | 2268 | # |
shrimpboyho/git.js | refs/heads/master | emscript/emscripten/1.5.6/third_party/websockify/tests/echo.py | 18 | #!/usr/bin/env python
'''
A WebSocket server that echos back whatever it receives from the client.
Copyright 2010 Joel Martin
Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
You can make a cert/key with openssl using:
openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
as taken from http://... |
noroutine/ansible | refs/heads/devel | contrib/inventory/spacewalk.py | 117 | #!/usr/bin/env python
"""
Spacewalk external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use... |
codrut3/tensorflow | refs/heads/master | tensorflow/contrib/framework/python/ops/accumulate_n_v2_test.py | 9 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
specfem3d-zhang-ksu/specfem3d | refs/heads/master | CUBIT_GEOCUBIT/geocubitlib/dev/cmpl.py | 7 | #!/usr/bin/env python
#############################################################################
# cpml.py
# this file is part of GEOCUBIT #
# #
# ... |
VanirAOSP/kernel_htc_m7 | refs/heads/L5 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
xapi-project/sm | refs/heads/master | drivers/devscan.py | 1 | #!/usr/bin/env python
#
# Copyright (C) Citrix Systems Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will be... |
marckuz/django | refs/heads/master | tests/get_or_create/models.py | 276 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
birthday = models.DateFiel... |
Onirik79/aaritmud | refs/heads/master | data/proto_items/carrozzone-zingaro/carrozzone-zingaro_item_fili-penduli.py | 1 | # -*- coding: utf-8 -*-
#= DESCRIZIONE =================================================================
# Qui l'idea è che l'oggetto sia una numero elevato di matassine colorate
# il player ne prende una e si trova in mano una matassina con un colore più
# o meno casuale.
# l'oggetto vede diminuire il suo peso man m... |
alecmuffett/pymine | refs/heads/master | dev/views.py | 2 | #!/usr/bin/env python
##
## Copyright 2010 Adriana Lukas & Alec Muffett
##
## Licensed under the Apache License, Version 2.0 (the "License"); you
## may not use this file except in compliance with the License. You
## may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless requi... |
miguelgrinberg/oreilly-intro-to-flask-video | refs/heads/master | 8a/app/main/routes.py | 5 | from flask import render_template, redirect, url_for, request
from flask.ext.login import login_required, login_user, logout_user
from ..models import User
from . import main
from .forms import LoginForm
@main.route('/login', methods=['GET', 'POST'])
def login():
form = LoginForm()
if form.validate_on_submit(... |
leprikon-cz/leprikon | refs/heads/master | leprikon/admin/department.py | 1 | from django.contrib import admin
from ..models.department import Department
@admin.register(Department)
class DepartmentAdmin(admin.ModelAdmin):
list_display = ("name", "code")
|
hiway/micropython | refs/heads/master | tests/basics/fun_defargs2.py | 118 | # overriding default arguments
def foo(a, b=3):
print(a, b)
# override with positional
foo(1, 333)
# override with keyword
foo(1, b=333)
# override with keyword
foo(a=2, b=333)
def foo2(a=1, b=2):
print(a, b)
# default and keyword
foo2(b='two')
|
crowell/radare2-bindings | refs/heads/master | python/test-r2rc.py | 11 | #!/usr/bin/python
# -- pancake
import sys
from r_asm import *
from r_util import *
from r_bin import *
try:
program = sys.argv[1]
except:
print "Usage: test-r2rc [path-to-program]"
sys.exit (1)
a = RAsm ()
a.use ("x86.nasm")
b = RBin ()
off_printf = 0
b.load (program, None)
baddr = b.get_baddr ()
for i in b.get_... |
sunqb/oa_qian | refs/heads/master | flask/Lib/site.py | 784 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... |
LarsFronius/ansible | refs/heads/devel | lib/ansible/modules/network/netvisor/pn_vlan.py | 59 | #!/usr/bin/python
""" PN CLI vlan-create/vlan-delete """
#
# 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... |
patschwork/meta_grid | refs/heads/master | helper_tools/Python/installer/six.py | 59 | # Copyright (c) 2010-2020 Benjamin Peterson
#
# 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, including without limitation the rights
# to use, copy, modify, merge, publi... |
nischalsheth/contrail-controller | refs/heads/master | src/analytics/contrail-topology/contrail_topology/config.py | 1 | #
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
#
import argparse, os, ConfigParser, sys, re
from pysandesh.sandesh_base import *
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
from pysandesh.connection_info import ConnectionState
from pysandesh.gen_py.process_info.ttypes import ConnectionS... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection3K/DatetimeDateAttributesOutsideClass/a.py | 83 | from datetime import date
print(date.today)
print(date.max)
print(date.<warning descr="Unresolved attribute reference 'foo' for class 'date'">foo</warning>)
|
saurabh6790/med_new_app | refs/heads/develop | hr/doctype/attendance/__init__.py | 37694 | from __future__ import unicode_literals
|
jtg-gg/skia | refs/heads/dev12-m41 | tools/skp/page_sets/skia_pravda_nexus10.py | 33 | # 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=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... |
ancafarcas/superdesk-core | refs/heads/superdesk-master | superdesk/commands/schema.py | 5 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2016 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
#
"""Schema utils."""
import superdesk
from flask import current_app... |
raharjaliu/TheCodingGame | refs/heads/master | guessing_game_new/scripts/functions/predict_label.py | 1 | #!/usr/bin/env python
# coding: utf8
import subprocess
import sys
import os
import re
path_to_darknet = '/Users/rootmac/Documents/workspace/darknet/'
def predict_label(path):
# change working dir and run darknet
os.chdir(path_to_darknet)
command = './darknet classifier predict cfg/imagenet22k.dataset cfg/extract... |
wsqhubapp/learning_log | refs/heads/master | learning_logs/models.py | 1 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Topic(models.Model):
text = models.CharField(max_length=200)
date_added = models.DateTimeField(auto_now_add=True)
owner = models.ForeignKey(User)
def __str__(self):
return self.text
cla... |
ErickMurillo/plataforma_fadcanic | refs/heads/master | cambiaahora/historias/admin.py | 3 | from django.contrib import admin
from django import forms
from .models import Historias
from django.contrib.flatpages.models import FlatPage
# Note: we are renaming the original Admin and Form as we import them!
from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld
from django.contrib.flatpages.f... |
PurpleBooth/python-vm | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escsm.py | 2929 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
efiring/numpy-work | refs/heads/cfastma | doc/sphinxext/plot_directive.py | 1 | """
A special directive for generating a matplotlib plot.
.. warning::
This is a hacked version of plot_directive.py from Matplotlib.
It's very much subject to change!
Usage
-----
Can be used like this::
.. plot:: examples/example.py
.. plot::
import matplotlib.pyplot as plt
plt.plot(... |
mapposters/server | refs/heads/master | config/staging.py | 2 | DEBUG = False # Turns on debugging features in Flask |
itsjeyd/edx-platform | refs/heads/master | lms/djangoapps/verified_track_content/tests/test_views.py | 15 | """
Tests for verified track content views.
"""
import json
from nose.plugins.attrib import attr
from unittest import skipUnless
from django.http import Http404
from django.test.client import RequestFactory
from django.conf import settings
from student.tests.factories import UserFactory, AdminFactory
from xmodule.m... |
stuartarchibald/numba | refs/heads/master | numba/experimental/structref.py | 7 | """Utilities for defining a mutable struct.
A mutable struct is passed by reference;
hence, structref (a reference to a struct).
"""
from numba import njit
from numba.core import types, imputils, cgutils
from numba.core.datamodel import default_manager, models
from numba.core.extending import (
infer_getattr,
... |
rversteegen/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/plat-mac/Carbon/CoreFoundation.py | 81 | # Generated from 'CFBase.h'
def FOUR_CHAR_CODE(x): return x
kCFCompareLessThan = -1
kCFCompareEqualTo = 0
kCFCompareGreaterThan = 1
kCFNotFound = -1
kCFPropertyListImmutable = 0
kCFPropertyListMutableContainers = 1
kCFPropertyListMutableContainersAndLeaves = 2
# kCFStringEncodingInvalidId = (long)0xFFFFFFFF
kCFStringE... |
samuell/luigi | refs/heads/master | test/target_test.py | 12 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
jstoxrocky/statsmodels | refs/heads/master | docs/source/plots/graphics_plot_fit_ex.py | 35 | # -*- coding: utf-8 -*-
"""
Created on Monday April 1st 2013
Author: Padarn Wilson
"""
# Load the Statewide Crime data set and perform linear regression with
# 'poverty' and 'hs_grad' as variables and 'muder' as the response
import statsmodels.api as sm
import matplotlib.pyplot as plt
import numpy as np
data ... |
rajathkumarmp/numpy | refs/heads/master | numpy/compat/py3k.py | 105 | """
Python 3 compatibility tools.
"""
from __future__ import division, absolute_import, print_function
__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar',
'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested',
'asstr', 'open_latin1', 'long', 'basestring', 'sixu',
... |
bbc/kamaelia | refs/heads/master | Sketches/AB/Bookmarks-Dev/SocialBookmarks/__init__.py | 20578 | |
signed/intellij-community | refs/heads/master | python/testData/paramInfo/NestedArg.py | 83 | # py 2.x only
def foo(a, (b, c), d):
pass
foo(<arg1>1, (<arg2>2, <arg3>3), <arg4>4)
|
marcellodesales/svnedge-console | refs/heads/master | ext/linux/pkg-toolkit/pkg/vendor-packages/cherrypy/_cperror.py | 5 | """Error classes for CherryPy."""
from cgi import escape as _escape
from sys import exc_info as _exc_info
from traceback import format_exception as _format_exception
from urlparse import urljoin as _urljoin
from cherrypy.lib import http as _http
class CherryPyException(Exception):
pass
class TimeoutError(Cherr... |
xHeliotrope/injustice_dropper | refs/heads/master | env/lib/python3.4/site-packages/django/core/mail/backends/console.py | 696 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
from django.utils import six
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream',... |
ashhher3/invenio | refs/heads/master | modules/websubmit/lib/functions/Get_Recid.py | 27 | ## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 ... |
mdj2/django | refs/heads/master | django/contrib/admin/options.py | 2 | import copy
import operator
from functools import partial, reduce, update_wrapper
from django import forms
from django.conf import settings
from django.forms.formsets import all_valid, DELETION_FIELD_NAME
from django.forms.models import (modelform_factory, modelformset_factory,
inlineformset_factory, BaseInlineFor... |
ryfeus/lambda-packs | refs/heads/master | Tensorflow_OpenCV_Nightly/source/tensorflow/python/framework/errors_impl.py | 59 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
pupapaik/contrail-kubernetes | refs/heads/master | scripts/opencontrail-kubelet/setup.py | 3 | #
# Copyright (c) 2015 Juniper Networks, Inc.
#
import setuptools
def requirements(filename):
with open(filename) as f:
lines = f.read().splitlines()
return lines
setuptools.setup(
name='opencontrail-kubelet',
version='0.3.5',
packages=setuptools.find_packages(),
# metadata
auth... |
nicolargo/intellij-community | refs/heads/master | python/testData/editing/innerElif.py | 83 | if 1:
pass
elif 2:
pass
elif 3<caret>
else:
pass
|
electronic-structure/sirius | refs/heads/master | apps/upf/plot_uspp.py | 3 | import numpy as np
import matplotlib.pyplot as plt
import math
import sys
import json
import os
fin = open(sys.argv[1], "r")
jin = json.load(fin)
fin.close()
rgrid = jin['pseudo_potential']['radial_grid']
print("number of radial grid points: %i"%len(rgrid))
z = jin['pseudo_potential']['header']['z_valence']
#vloc ... |
jpshort/odoo | refs/heads/8.0 | addons/payment_adyen/models/__init__.py | 436 | # -*- coding: utf-8 -*-
import adyen
|
fjbatresv/odoo | refs/heads/8.0 | addons/stock/controllers/__init__.py | 2262 | import main |
amagdas/eve | refs/heads/develop | eve/tests/auth.py | 2 | # -*- coding: utf-8 -*-
from bson import ObjectId
import eve
import json
from eve import Eve
from eve.auth import BasicAuth, TokenAuth, HMACAuth
from eve.tests import TestBase
from eve.tests.test_settings import MONGO_DBNAME
class ValidBasicAuth(BasicAuth):
def __init__(self):
self.request_auth_value = '... |
JimmyDurandWesolowski/unionmount-testsuite | refs/heads/master | tests/symx-creat-trunc.py | 2 | from errno import *
###############################################################################
#
# Open through a broken symlink with O_CREAT|O_TRUNC
#
###############################################################################
# Open and truncate broken link read-only
def subtest_1(ctx):
"""Open(broken)... |
Balachan27/django | refs/heads/master | tests/m2m_and_m2o/tests.py | 383 | from django.db.models import Q
from django.test import TestCase
from .models import Issue, UnicodeReferenceModel, User
class RelatedObjectTests(TestCase):
def test_related_objects_have_name_attribute(self):
for field_name in ('test_issue_client', 'test_issue_cc'):
obj = User._meta.get_field(... |
JFriel/honours_project | refs/heads/master | venv/lib/python2.7/site-packages/pip/vendor/distlib/resources.py | 79 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import shutil
import sys
import zipimport
from . im... |
matmutant/sl4a | refs/heads/master | python/gdata/src/gdata/blogger/service.py | 264 | #!/usr/bin/python
#
# Copyright (C) 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 ... |
interlegis/sapl | refs/heads/3.1.x | sapl/norma/admin.py | 27 | from sapl.utils import register_all_models_in_admin
register_all_models_in_admin(__name__)
|
vitan/django | refs/heads/master | tests/admin_scripts/tests.py | 12 | # -*- coding: utf-8 -*-
"""
A series of tests to establish that the command-line management tools work as
advertised - especially with regards to the handling of the
DJANGO_SETTINGS_MODULE and default settings.py files.
"""
from __future__ import unicode_literals
import codecs
import os
import re
import shutil
import ... |
zingale/pyro2 | refs/heads/master | compressible/problems/kh.py | 2 | from __future__ import print_function
import numpy as np
import mesh.patch as patch
from util import msg
def init_data(my_data, rp):
""" initialize the Kelvin-Helmholtz problem """
msg.bold("initializing the Kelvin-Helmholtz problem...")
# make sure that we are passed a valid patch object
if not i... |
Daniel-CA/odoo | refs/heads/8.0 | addons/base_gengo/res_company.py | 321 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.