repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pitch-sands/i-MPI | refs/heads/master | flask/Lib/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py | 714 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... |
FlaPer87/django-nonrel | refs/heads/master | tests/regressiontests/bug639/models.py | 106 | import tempfile
from django.db import models
from django.core.files.storage import FileSystemStorage
from django.forms import ModelForm
temp_storage_dir = tempfile.mkdtemp()
temp_storage = FileSystemStorage(temp_storage_dir)
class Photo(models.Model):
title = models.CharField(max_length=30)
image = models.Fi... |
adobecs5/urp2015 | refs/heads/master | lib/python3.4/site-packages/pip/basecommand.py | 79 | """Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import os
import sys
import traceback
import optparse
import warnings
from pip._vendor.six import StringIO
from pip import cmdoptions
from pip.locations import running_under_virtualenv
from pip.download import PipSes... |
lebabouin/CouchPotatoServer-develop | refs/heads/master | libs/pyutil/scripts/unsort.py | 106 | #!/usr/bin/env python
# randomize the lines of stdin or a file
import random, sys
def main():
if len(sys.argv) > 1:
fname = sys.argv[1]
inf = open(fname, 'r')
else:
inf = sys.stdin
lines = inf.readlines()
random.shuffle(lines)
sys.stdout.writelines(lines)
if __name__ == ... |
JamesMGreene/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/CygwinDownloader/cygwin-downloader.py | 120 | #!/usr/bin/env python
import os, random, sys, time, urllib
#
# Options
#
dry_run = len(sys.argv) > 1 and "--dry-run" in set(sys.argv[1:])
quiet = len(sys.argv) > 1 and "--quiet" in set(sys.argv[1:])
#
# Functions and constants
#
def download_progress_hook(block_count, block_size, total_blocks):
if quiet or... |
jeroen92/reclass | refs/heads/master | setup.py | 3 | #
# -*- coding: utf-8 -*-
#
# This file is part of reclass (http://github.com/madduck/reclass)
#
# Copyright © 2007–13 martin f. krafft <[email protected]>
# Released under the terms of the Artistic Licence 2.0
#
from reclass.version import *
from setuptools import setup, find_packages
ADAPTERS = ['salt', 'ansible'... |
rkmaddox/mne-python | refs/heads/master | mne/io/ctf/tests/test_ctf.py | 4 | # Authors: Eric Larson <[email protected]>
#
# License: BSD (3-clause)
import copy
import os
from os import path as op
import shutil
import numpy as np
from numpy import array_equal
from numpy.testing import assert_allclose, assert_array_equal
import pytest
import mne
from mne import (pick_types, read_annotati... |
bixbydev/Bixby | refs/heads/master | google/gdata-2.0.18/samples/analytics/account_feed_demo.py | 41 | #!/usr/bin/python
#
# Copyright 2009 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... |
rruebner/odoo | refs/heads/master | addons/pad/__init__.py | 433 | # -*- coding: utf-8 -*-
import pad
import res_company
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
indictranstech/fbd_erpnext | refs/heads/develop | erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py | 52 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
from erpnext.accounts.utils import get_fiscal_year
from erpnext.controllers.tr... |
talhajaved/nyuadmarket | refs/heads/master | flask/lib/python2.7/site-packages/setuptools/tests/test_integration.py | 125 | """Run some integration tests.
Try to install a few packages.
"""
import glob
import os
import sys
import pytest
from setuptools.command.easy_install import easy_install
from setuptools.command import easy_install as easy_install_pkg
from setuptools.dist import Distribution
from setuptools.compat import urlopen
d... |
ShefaliGups11/Implementation-of-SFB-in-ns-3 | refs/heads/master | bindings/python/rad_util.py | 212 | # Copyright (c) 2007 RADLogic
#
# 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, publish, distribut... |
vidonme/xbmc | refs/heads/isengard.vidon | tools/EventClients/lib/python/ps3/sixaxis.py | 155 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# 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) ... |
ageron/tensorflow | refs/heads/master | tensorflow/python/compat/compat.py | 1 | # Copyright 2018 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... |
M4573R/BuildingMachineLearningSystemsWithPython | refs/heads/master | ch02/load.py | 25 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import numpy as np
def load_dataset(dataset_name):
'''
data,labels = load_dataset(dataset_nam... |
htzy/bigfour | refs/heads/master | common/lib/xmodule/xmodule/video_module/video_xfields.py | 16 | """
XFields for video module.
"""
import datetime
from xblock.fields import Scope, String, Float, Boolean, List, Dict, DateTime
from xmodule.fields import RelativeTime
from xmodule.mixin import LicenseMixin
# Make '_' a no-op so we can scrape strings
_ = lambda text: text
class VideoFields(object):
"""Fields f... |
rkmaddox/mne-python | refs/heads/master | mne/viz/backends/tests/test_renderer.py | 11 | # Authors: Alexandre Gramfort <[email protected]>
# Eric Larson <[email protected]>
# Joan Massich <[email protected]>
# Guillaume Favelier <[email protected]>
#
# License: Simplified BSD
import os
import pytest
import numpy as np
from mne.viz.backends.tests._uti... |
fanor79/BotTwitterRetweet | refs/heads/master | test.py | 1 | #!/usr/bin/env python
# coding: utf-8
import os
import json
import time
import os.path
import sqlite3
from twython import Twython
from pprint import pprint
from function import *
api = Twython(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET)
#Permet de crée le fichier database.db et de crée la table dedan... |
meghana1995/sympy | refs/heads/master | sympy/matrices/expressions/matmul.py | 7 | from __future__ import print_function, division
from sympy.core import Mul, Basic, sympify, Add
from sympy.core.compatibility import range
from sympy.functions import adjoint
from sympy.matrices.expressions.transpose import transpose
from sympy.strategies import (rm_id, unpack, typed, flatten, exhaust,
do_one,... |
h4de5ing/sees | refs/heads/master | lib/main.py | 9 |
try:
import sys
import argparse
import os
from config import Config_Parser
from exceptions import SeesExceptions
from common import *
except ImportError,e:
import sys
sys.stdout.write("%s\n" %e)
sys.exit(1)
def is_file_exists(file_list):
for file in file_list:
i... |
sodafree/backend | refs/heads/master | django/views/generic/__init__.py | 493 | from django.views.generic.base import View, TemplateView, RedirectView
from django.views.generic.dates import (ArchiveIndexView, YearArchiveView, MonthArchiveView,
WeekArchiveView, DayArchiveView, TodayArchiveView,
DateDetailView)
from django.vie... |
Maillol/cricri | refs/heads/master | test/inet/test_http_client.py | 2 | import unittest
from io import BytesIO
import http.client
from cricri.inet.http_client import (HTTPResponse,
NoResponseProvidedError)
class MockSocket:
LINES = (b'HTTP/1.1 200 OK\r\n'
b'Date: Tue, 21 Mar 2017 07:02:52 GMT\r\n'
b'Server: CherryPy/10.... |
cainiaocome/scikit-learn | refs/heads/master | sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py | 221 | """
Testing for the gradient boosting loss functions and initial estimators.
"""
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.utils import check_random_state
from ... |
javiergarridomellado/Empresa_django | refs/heads/master | devcodela/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/__init__.py | 128 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos')
try:
module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend')
except ImportError:
tr... |
alexallah/django | refs/heads/master | tests/contenttypes_tests/urls.py | 72 | from django.conf.urls import url
from django.contrib.contenttypes import views
urlpatterns = [
url(r'^shortcut/([0-9]+)/(.*)/$', views.shortcut),
]
|
UAVCAN/pyuavcan | refs/heads/master | pyuavcan/dsdl/_composite_object.py | 1 | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <[email protected]>
from __future__ import annotations
import abc
import gzip
import typing
import pickle
import base64
import logging
import importlib
import pydsdl
from . import _serial... |
Drooids/erpnext | refs/heads/develop | erpnext/setup/page/setup_wizard/test_setup_wizard.py | 45 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.setup.page.setup_wizard.test_setup_data import args
from erpnext.setup.page.setup_wizard.setup_wizard import setup_account
i... |
minhphung171093/GreenERP | refs/heads/master | openerp/addons/delivery/models/__init__.py | 41 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import delivery_carrier
import delivery_price_rule
import product_template
import sale_order
import partner
import stock_picking
import stock_move
|
flyher/pymo | refs/heads/master | symbian/PythonForS60_1.9.6/module-repo/standard-modules/BaseHTTPServer.py | 91 | """HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHandler: ... |
happyWilliam/qzb-api | refs/heads/master | sdk/Python/PhalApiClient/python2.x/PhalApiClient.py | 3 | #-*- coding:utf-8 -*-
#gaoyiping ([email protected]) 2017-02-18
import json, urllib, urllib2
def PhalApiClient(host, service = None, params = None, timeout = None):
url = host + ('' if service is None else ('?service=' + service))
if params is not None:
assert type(params) is dict, 'params type must be dict'
ass... |
alistairlow/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/bijectors/masked_autoregressive_test.py | 8 | # 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... |
haxwithaxe/supybot | refs/heads/master | plugins/Success/config.py | 15 | ###
# Copyright (c) 2005, Daniel DiPaolo
# 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 condition... |
Incoin/incoin | refs/heads/master | contrib/wallettools/walletunlock.py | 782 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:9332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
|
starrybeam/samba | refs/heads/master | third_party/pep8/testsuite/E21.py | 62 | #: E211
spam (1)
#: E211 E211
dict ['key'] = list [index]
#: E211
dict['key'] ['subkey'] = list[index]
#: Okay
spam(1)
dict['key'] = list[index]
# This is not prohibited by PEP8, but avoid it.
class Foo (Bar, Baz):
pass
|
pigeonflight/strider-plone | refs/heads/master | docker/appengine/lib/django-1.4/django/contrib/gis/gdal/tests/__init__.py | 332 | """
Module for executing all of the GDAL tests. None
of these tests require the use of the database.
"""
from django.utils.unittest import TestSuite, TextTestRunner
# Importing the GDAL test modules.
import test_driver, test_ds, test_envelope, test_geom, test_srs
test_suites = [test_driver.suite(),
te... |
tilacog/rows | refs/heads/develop | rows/fields.py | 1 | # coding: utf-8
# Copyright 2014-2015 Álvaro Justen <https://github.com/turicas/rows/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
dellis23/parsedatetime | refs/heads/master | parsedatetime/tests/TestSimpleOffsets.py | 6 |
"""
Test parsing of 'simple' offsets
"""
import time
import datetime
import calendar
import unittest
import parsedatetime as pdt
def _truncateResult(result, trunc_seconds=True, trunc_hours=False):
try:
dt, flag = result
except ValueError:
# wtf?!
return result
if trunc_seconds:
... |
malikcjm/qtcreator | refs/heads/work | tests/system/suite_general/tst_installed_languages/test.py | 3 | #############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... |
darouwan/shadowsocks | refs/heads/master | shadowsocks/tcprelay.py | 922 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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... |
don-github/edx-platform | refs/heads/master | common/djangoapps/cache_toolbox/core.py | 136 | """
Core methods
------------
.. autofunction:: cache_toolbox.core.get_instance
.. autofunction:: cache_toolbox.core.delete_instance
.. autofunction:: cache_toolbox.core.instance_key
"""
from django.core.cache import cache
from django.db import DEFAULT_DB_ALIAS
from opaque_keys import InvalidKeyError
from . import ... |
Neetuj/softlayer-python | refs/heads/master | SoftLayer/CLI/iscsi/list.py | 2 | """List iSCSI targets."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
@click.command()
@environment.pass_env
def cli(env):
"""List iSCSI targets."""
iscsi_mgr = SoftLayer.... |
JVillella/tensorflow | refs/heads/master | tensorflow/tools/common/public_api.py | 71 | # 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... |
blaggacao/odoo | refs/heads/master | addons/mail/__init__.py | 382 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
etingof/pyasn1 | refs/heads/master | pyasn1/type/char.py | 2 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2020, Ilya Etingof <[email protected]>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
from pyasn1 import error
from pyasn1.type import tag
from pyasn1.type import univ
__all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61... |
lesteve/sphinx-gallery | refs/heads/master | mayavi_examples/plot_3d.py | 4 | # -*- coding: utf-8 -*-
"""
Plotting simple 3D graph with Mayavi
====================================
A simple example of the plot of a 3D graph with Mayavi
in order to test the autonomy of the gallery.
"""
# Code source: Alex Gramfort
# License: BSD 3 clause
# This will show the mlab.test_mesh figure in the gallery... |
bq/bitbloq-offline | refs/heads/master | app/res/web2board/darwin/Web2Board.app/Contents/Resources/platformio/platforms/linux_arm.py | 5 | # Copyright 2014-2015 Ivan Kravets <[email protected]>
#
# 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... |
dbckz/ansible | refs/heads/devel | lib/ansible/modules/windows/win_acl.py | 72 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015, Phil Schwartz <[email protected]>
# Copyright 2015, Trond Hindenes
# Copyright 2015, Hans-Joachim Kliemeck <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
rhuitl/uClinux | refs/heads/master | user/samba/examples/scripts/shares/python/generate_parm_table.py | 52 | #!/usr/bin/env python
######################################################################
##
## Generate parameter dictionary from param/loadparm.c
##
## Copyright (C) Gerald Carter 2004.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General P... |
djangraw/PsychoPyParadigms | refs/heads/master | BasicExperiments/SingingTask_audio.py | 1 | #!/usr/bin/env python2
"""Display multi-page text with interspersed thought probes.
Then ask the subject comprehension questions at the end."""
# SingingTask_audio.py
#
# Created 4/12/17 by DJ based on SingingTask.py.
from psychopy import core, gui, data, event, sound, logging #, visual # visual causes a bug in the gu... |
jsteemann/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/ctypes/test/test_refcounts.py | 68 | import unittest
import ctypes
import gc
MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int)
OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong)
import _ctypes_test
dll = ctypes.CDLL(_ctypes_test.__file__)
class RefcountTestCase(unittest.TestCase):
def test_1(self):
fro... |
pythonization/reminder2standBy | refs/heads/master | reminder2standBy/common_qt_app/helpers.py | 1 | """Various helper functions."""
try:
import prctl
# to install run:
# sudo apt install build-essential libcap-dev
# pip3 install --user python-prctl
except ImportError:
prctl = None
def give_name2thread(name, thread_obj):
"""Give name to current thread.
if prctl installed, then also set ... |
heiko-r/paparazzi | refs/heads/master | sw/tools/px4/set_target.py | 19 | #!/usr/bin/env python
import os
import sys
import serial
import glob
import time
target = sys.argv[1]
firmware_file = sys.argv[2]
print "Target: " + target
print "Firmware file: " + firmware_file
# test if pprz cdm is connected
mode = -1
port = ""
try:
port = "/dev/serial/by-id/usb-Paparazzi_UAV_CDC_Serial_STM32... |
ademuk/django-oscar | refs/heads/master | sites/sandbox/apps/gateway/forms.py | 60 | from django import forms
from django.contrib.auth.models import User
from oscar.apps.customer.utils import normalise_email
class GatewayForm(forms.Form):
email = forms.EmailField()
def clean_email(self):
email = normalise_email(self.cleaned_data['email'])
if User.objects.filter(email__iexact... |
sgzsh269/django | refs/heads/master | tests/null_queries/tests.py | 55 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Inner, OuterA, OuterB, Poll
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.... |
fake-name/ReadableWebProxy | refs/heads/master | WebMirror/management/rss_parser_funcs/feed_parse_extractBoredtrans95440947WordpressCom.py | 1 |
def extractBoredtrans95440947WordpressCom(item):
'''
Parser for 'boredtrans95440947.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'trans... |
takeshineshiro/nova | refs/heads/master | nova/api/openstack/compute/floating_ips.py | 3 | # Copyright 2011 OpenStack Foundation
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... |
spradeepv/dive-into-python | refs/heads/master | hackerrank/domain/artificial_intelligence/alpha_beta_pruning/tic_tac_toe.py | 1 | """
Tic-tac-toe is a pencil-and-paper game for two players, X (ascii value 88)
and O (ascii value 79), who take turns marking the spaces in a 3*3 grid. The
player who succeeds in placing three respective marks in a horizontal,
vertical, or diagonal row wins the game. Empty space is represented by _ (
ascii value 95), a... |
christiantroy/xbmc | refs/heads/master | lib/libUPnP/Platinum/Build/Tools/Scripts/MakeAllVs.py | 262 | #! /usr/bin/env python
import os
import sys
import getopt
import subprocess
configs = ['Debug', 'Release']
solutions = ['../../../Build/Targets/x86-microsoft-win32-vs2008/Platinum.sln']
try:
opts, args = getopt.getopt(sys.argv[1:], "b:rc")
except getopt.GetoptError, (msg, opt):
print 'No build_config, defau... |
bratsche/Neutron-Drive | refs/heads/master | google_appengine/lib/django_0_96/django/utils/tzinfo.py | 34 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
self.__offset = timedelta(minutes=offset)
self.__name = "%+03d%02d" % (offset //... |
georgemarshall/django | refs/heads/master | django/template/loaders/app_directories.py | 635 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
from django.template.utils import get_app_template_dirs
from .filesystem import Loader as FilesystemLoader
class Loader(FilesystemLoader):
def get_dirs(self):
return get_app_template_dirs('templates')
|
NaturalSolutions/ecoReleve-Server | refs/heads/master | ecorelevesensor/models/monitored_site.py | 1 | """
Created on Mon Sep 1 14:38:09 2014
@author: Natural Solutions (Thomas)
"""
from sqlalchemy import (
Boolean,
Column,
DateTime,
func,
Index,
Integer,
Sequence,
String,
UniqueConstraint
)
from sqlalchemy.orm import relationship
from ..models import Base, dbConfig
dialect = dbC... |
StefanRijnhart/odoo | refs/heads/master | addons/hr/res_users.py | 27 | from openerp import api
from openerp.osv import fields, osv
class res_users(osv.Model):
""" Update of res.users class
- add field for the related employee of the user
- if adding groups to an user, check if base.group_user is in it (member of
'Employee'), create an employee form linked to it. ""... |
USC-ACTLab/crazyswarm | refs/heads/master | ros_ws/src/crazyswarm/scripts/figure8_csv.py | 1 | #!/usr/bin/env python
import numpy as np
from pycrazyswarm import *
import uav_trajectory
if __name__ == "__main__":
swarm = Crazyswarm()
timeHelper = swarm.timeHelper
allcfs = swarm.allcfs
traj1 = uav_trajectory.Trajectory()
traj1.loadcsv("figure8.csv")
TRIALS = 1
TIMESCALE = 1.0
f... |
mariianna/kodi | refs/heads/master | core/ClientCookie/_Opener.py | 17 | """Integration with Python standard library module urllib2: OpenerDirector
class.
Copyright 2004 John J Lee <[email protected]>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD License (see the file COPYING included with the
distribution).
"""
try: True
except NameError:
... |
xavierwu/scikit-learn | refs/heads/master | sklearn/tests/test_base.py | 216 | # Author: Gael Varoquaux
# License: BSD 3 clause
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing impo... |
rochacbruno/flasgger | refs/heads/master | examples/swagger_config_2.py | 1 | """
In this example `openapi` version is used instead of `swagger` version.
"""
from flask import Flask, jsonify
from flasgger import Swagger, swag_from
app = Flask(__name__)
swagger_config = {
"headers": [],
"specs": [
{
"endpoint": "swagger",
"route": "/characteristics/swagge... |
latendre/PythonCyc | refs/heads/master | setup.py | 1 | # Copyright (c) 2014, SRI International
#
# 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, publish,... |
xindus40223115/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/textwrap.py | 745 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <[email protected]>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... |
JetBrains/intellij-community | refs/heads/master | python/testData/quickFixes/PyUpdatePropertySignatureQuickFixTest/setter_after.py | 80 | class A(Aa):
@property
def x(self, r):
return r
@x.setter
def x(self, r):
self._x = ""
|
wilsonfreitas/pelican-plugins | refs/heads/master | i18n_subsites/__init__.py | 75 | from .i18n_subsites import *
|
meteorcloudy/bazel | refs/heads/master | src/test/py/bazel/bazel_windows_cpp_test.py | 3 | # Copyright 2017 The Bazel 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 applicable la... |
dexterx17/nodoSocket | refs/heads/master | clients/Python-2.7.6/Lib/encodings/punycode.py | 586 | # -*- coding: iso-8859-1 -*-
""" Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = []
extended = {}
for c in st... |
tdaylan/tdgu | refs/heads/master | sdss_glob.py | 1 |
# coding: utf-8
# In[ ]:
# numpy
import numpy as np
from numpy import *
from numpy.random import *
from numpy.random import choice
import matplotlib.pyplot as plt
# scipy
import scipy as sp
from scipy import ndimage
from scipy.interpolate import *
from scipy.special import erfinv, erf
from scipy.stats import poiss... |
crunchsec/fimap | refs/heads/master | src/xgoogle/search.py | 13 | #!/usr/bin/python
#
# Peteris Krumins ([email protected])
# http://www.catonmat.net -- good coders code, great reuse
#
# http://www.catonmat.net/blog/python-library-for-google-search/
#
# Code is licensed under MIT license.
#
import re
import urllib
from htmlentitydefs import name2codepoint
from BeautifulSoup impor... |
andyneff/voxel-globe | refs/heads/master | voxel_globe/clif/tools.py | 1 | import os
def split_clif(filename):
''' Return dir, camera_id, image_number, extention'''
dirname = os.path.dirname(filename)
filename = os.path.basename(filename)
(filename, extention) = os.path.splitext(filename)
(camera_id, image_number) = filename.split('-')
return (dirname, camera_id, image_number, ex... |
igorkramaric/resigner | refs/heads/master | test_project/resigner_tests/urls.py | 2 | from django.conf.urls import *
from .views import my_test_api_view
urlpatterns = [
url(r'^my_test_api_url/', my_test_api_view, name="my_test_api"),
]
|
ashutrix03/inteygrate_flaskapp-master | refs/heads/master | build/lib/yowsup/layers/protocol_privacy/protocolentities/privacylist_iq.py | 68 | from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity
from yowsup.structs import ProtocolTreeNode
class PrivacyListIqProtocolEntity(IqProtocolEntity):
def __init__(self, name = "default"):
super(PrivacyListIqProtocolEntity, self).__init__("jabber:iq:privacy", _type="get")
self.setL... |
List3nt0/CodeLibrary | refs/heads/master | qrcode-generator-master/src/pyqrgen/test.py | 4 | #!/usr/bin/env python
import cairo
import pyqrgen
SIZE = 220
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, SIZE, SIZE)
ctx = cairo.Context(surface)
#ctx.scale(WIDTH, HEIGHT)
ctx.rectangle(0, 0, SIZE, SIZE)
ctx.set_source_rgb(1, 1, 1)
ctx.fill()
# autoversion, mode Byte, ecl h
pyqrgen.generate("green pride... |
aehlke/epywing | refs/heads/master | src/epywing/tests/epwing.py | 1 | # -*- coding: utf-8 -*-
#
import unittest
#from epywing.bookmanager import BookManager
from epywing.bookmanager import BookManager
from epywing.epwing import EpwingBook
import os
#class TestEpwing(unittest.TestCase):
# def setUp(self):
# self.
def test_epwing_integrations():
search_path = os.path.s... |
jness/django-rest-framework | refs/heads/master | tests/browsable_api/auth_urls.py | 95 | from __future__ import unicode_literals
from django.conf.urls import include, url
from .views import MockView
urlpatterns = [
url(r'^$', MockView.as_view()),
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
]
|
StevenYCChou/android-kernel | refs/heads/master | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
ceramos/micropython | refs/heads/master | tests/basics/list_extend.py | 101 | # test list.__iadd__ and list.extend (they are equivalent)
l = [1, 2]
l.extend([])
print(l)
l.extend([3])
print(l)
l.extend([4, 5])
print(l)
l.extend(range(6, 10))
print(l)
l.extend("abc")
print(l)
l = [1, 2]
l += []
print(l)
l += [3]
print(l)
l += [4, 5]
print(l)
l += range(6, 10)
print(l)
l += "abc"
print(l... |
glaubitz/fs-uae-debian | refs/heads/master | launcher/OpenGL/raw/GLES1/_glgets.py | 33 | """glGet* auto-generation of output arrays (DO NOT EDIT, AUTOGENERATED)"""
try:
from OpenGL.raw.GL._lookupint import LookupInt as _L
except ImportError:
def _L(*args):
raise RuntimeError( "Need to define a lookupint for this api" )
_glget_size_mapping = _m = {}
# _m[0x8095] = TODO # GL_DETAIL_TEXTURE_2D... |
bobobox/ansible | refs/heads/devel | lib/ansible/modules/cloud/docker/docker_network.py | 22 | #!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
#
# 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 la... |
olea/PyConES-2016 | refs/heads/develop | pycones/sponsorship/admin.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from sponsorship.models import BenefitLevel, SponsorLevel, Sponsor, Benefit
from sponsorship.models import SponsorBenefit
class BenefitLevelInline(admin.TabularInline):
model = BenefitLevel
extra = 0
class Spon... |
aricchen/openHR | refs/heads/master | openerp/addons/board/board.py | 18 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
Ms2ger/servo | refs/heads/master | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-ruby-tests.py | 829 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... |
t794104/ansible | refs/heads/devel | lib/ansible/module_utils/facts/__init__.py | 172 | # 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... |
mezz64/home-assistant | refs/heads/dev | homeassistant/components/incomfort/binary_sensor.py | 16 | """Support for an Intergas heater via an InComfort/InTouch Lan2RF gateway."""
from typing import Any, Dict, Optional
from homeassistant.components.binary_sensor import (
DOMAIN as BINARY_SENSOR_DOMAIN,
BinarySensorEntity,
)
from . import DOMAIN, IncomfortChild
async def async_setup_platform(hass, config, as... |
NCIP/gdc-docs | refs/heads/develop | docs/API/Users_Guide/scripts/BAM_Slice.py | 1 | import requests
import json
'''
This script will not work until $TOKEN_FILE_PATH
is replaced with an actual path.
'''
token_file = "$TOKEN_FILE_PATH"
file_id = "11443f3c-9b8b-4e47-b5b7-529468fec098"
data_endpt = "https://api.gdc.cancer.gov/slicing/view/{}".format(file_id)
with open(token_file,"r") as token:
t... |
sugarlabs/sugar-toolkit | refs/heads/master | src/sugar/graphics/panel.py | 3 | # Copyright (C) 2007, Red Hat, Inc.
#
# This library 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; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distrib... |
xbmc/xbmc-antiquated | refs/heads/master | xbmc/lib/libPython/Python/Lib/idlelib/OutputWindow.py | 67 | from Tkinter import *
from EditorWindow import EditorWindow
import re
import tkMessageBox
import IOBinding
class OutputWindow(EditorWindow):
"""An editor window that can serve as an output file.
Also the future base class for the Python shell window.
This class has no input facilities.
"""
def _... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/extern/python/unclosured/lib/python2.7/smtpd.py | 76 | #! /usr/bin/env python
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
Options:
--nosetuid
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not run as root (in
... |
mpreisler/scap-security-guide-debian | refs/heads/master | scap-security-guide-0.1.21/OpenStack/utils/verify-references.py | 3 | #!/usr/bin/python
import sys
# always use shared/modules version
SHARED_MODULE_PATH = "../../shared/modules"
sys.path.insert(0, SHARED_MODULE_PATH)
import verify_references_module
if __name__ == "__main__":
verify_references_module.main()
|
passiweinberger/nupic | refs/heads/master | src/nupic/swarming/HypersearchV2.py | 31 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
matiasmenares/Shuffle | refs/heads/master | core/terminal.py | 1 | import sys
import os
import urllib
import json
import requests
from core.server import Server
class Terminal:
def __init__(self,url,password):
self.url = url
self.password = password
self.server = Server(url,password)
def terminal(self,send,cookie):
command = self.command(send)
if command == False:
... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/funnelarea/domain/_row.py | 1 | import _plotly_utils.basevalidators
class RowValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="row", parent_name="funnelarea.domain", **kwargs):
super(RowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
azaghal/ansible | refs/heads/devel | test/units/utils/test_shlex.py | 197 | # (c) 2015, Marius Gedminas <[email protected]>
#
# 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 vers... |
rfhk/awo-custom | refs/heads/8.0 | stock_transfer_lot_filter/__init__.py | 6 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) Rooms For (Hong Kong) Limited T/A OSCG (<http://www.openerp-asia.net>).
#
# This program is free software: you can redistribute it and/or modify
# ... |
RevelSystems/django | refs/heads/master | tests/sites_tests/tests.py | 27 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddleware
from django.contrib.sites.models import Site, c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.