repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
idrogeno/IdroMips
refs/heads/master
lib/python/Plugins/Extensions/MediaScanner/plugin.py
3
from Plugins.Plugin import PluginDescriptor from Components.Scanner import scanDevice from Screens.InfoBar import InfoBar import os def execute(option): print "execute", option if option is None: return (_, scanner, files, session) = option scanner.open(files, session) def mountpoint_choosen(option): if optio...
falkolab/titanium_mobile
refs/heads/master
node_modules/node-gyp/gyp/PRESUBMIT.py
1369
# Copyright (c) 2012 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
guardian/security_monkey
refs/heads/master
security_monkey/auditors/rds_security_group.py
2
# Copyright 2014 Netflix, 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...
yadavshubhanshu/tvAnalytics
refs/heads/master
imdbCrawler/run.py
1
import os,subprocess subprocess.check_call(['scrapy', 'crawl', 'imdb', '-a', 'category="breaking bad"', '-o', 'items.json', '-t', 'json'])
wasit7/cs426
refs/heads/master
lectures/week07_bokeh/enumerate.py
2
# -*- coding: utf-8 -*- """ Created on Wed Apr 22 14:19:46 2015 @author: Wasit """ import numpy as np x=np.array(['a','b','c']) for i, item in enumerate(x): print "i=%d,item=%s"%(i,item)
writefaruq/lionface-app
refs/heads/master
django/contrib/auth/tests/auth_backends.py
9
import warnings from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.test import TestCase class BackendTest(TestCase): backend = 'django.contrib.auth.backends.ModelBackend' ...
tarc/gyp
refs/heads/master
test/win/gyptest-link-target-machine.py
239
#!/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. """ Make sure TargetMachine setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.Tes...
pombredanne/srvup-rest-framework
refs/heads/master
src/videos/utils.py
6
def get_vid_for_direction(instance, direction): ''' get next video instance based on direction and current video instance''' category = instance.category video_qs = category.video_set.all() if direction == "next": new_qs = video_qs.filter(order__gt=instance.order) else: new_qs = video_qs.filter(order__lt=ins...
mttr/django
refs/heads/master
tests/view_tests/templatetags/debugtags.py
383
from django import template from ..views import BrokenException register = template.Library() @register.simple_tag def go_boom(arg): raise BrokenException(arg)
vigilo/vigiconf
refs/heads/master
src/vigilo/vigiconf/tests/ucd/Load.py
1
# -*- coding: utf-8 -*- # pylint: disable-msg=C0301,C0111,W0232,R0201,R0903,W0221 # Copyright (C) 2006-2020 CS GROUP - France # License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html> from __future__ import unicode_literals from vigilo.vigiconf.lib.confclasses.validators import arg, Float from vigilo.vigiconf....
mikr/RestartLessOften
refs/heads/master
scripts/rlo_newerfiles.py
2
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # # Copyright (c) 2010-2013 Michael Krause ( http://krause-software.com/ ). All rights reserved. # """Find source files from an Mach-O executable that are newer than the executable itself """ import sys import os import optparse import re import subprocess REBUILD_CO...
overtherain/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_2/django/contrib/contenttypes/management.py
315
from django.contrib.contenttypes.models import ContentType from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_unicode def update_contenttypes(app, created_models, verbosity=2, **kwargs): """ Creates content types for models in the given app, removing any model ...
smuzaffar/root
refs/heads/master
tutorials/pyroot/qtexample.py
28
import sys from PyQt4.QtGui import * from PyQt4.QtCore import * import ROOT import sip class window(QMainWindow): def __init__(self): # Init the main window. QMainWindow.__init__(self) self.resize(350, 350) # Create the central widget. self.CentralWidget = QWidget(self) ...
ismail-s/locust
refs/heads/master
locust/test/test_locust_class.py
32
import unittest from locust.core import HttpLocust, Locust, TaskSet, task, events from locust import ResponseError, InterruptTaskSet from locust.exception import CatchResponseError, RescheduleTask, RescheduleTaskImmediately, LocustError from testcases import LocustTestCase, WebserverTestCase class TestTaskSet(Locust...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/commands/combat/co_hw_dot_kinetic_5.py
4
import sys def setup(core, actor, target, command): command.setDotDuration(15) command.setDotType('kinetic') command.setDotIntensity(350) return def run(core, actor, target, commandString): return
credativUK/OCB
refs/heads/7.0-local
addons/purchase/wizard/purchase_line_invoice.py
48
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
Yukarumya/Yukarum-Redfoxes
refs/heads/master
toolkit/library/dependentlibs.py
1
# 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/. '''Given a library, dependentlibs.py prints the list of libraries it depends upon that are in the same directory, follow...
jptomo/rpython-lang-scheme
refs/heads/master
rpython/rtyper/test/test_rbool.py
2
from rpython.translator.translator import TranslationContext from rpython.rtyper.test import snippet from rpython.rtyper.test.tool import BaseRtypingTest class TestSnippet(object): def _test(self, func, types): t = TranslationContext() t.buildannotator().build_types(func, types) t.buildrty...
arunhotra/tensorflow
refs/heads/master
tensorflow/python/training/moving_averages_test.py
4
"""Functional test for moving_averages.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.python.platform from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.framework import test_util from tensorfl...
spaceone/gnotty
refs/heads/master
gnotty/example_project/urls.py
2
from django.conf.urls import patterns, include, url from django.conf import settings from django.contrib import admin from django.shortcuts import redirect admin.autodiscover() urlpatterns = patterns('', url('^admin/', include(admin.site.urls)), url('^irc/', include('gnotty.urls')), url('^' + settings.L...
fighterCui/L4ReFiascoOC
refs/heads/master
l4/pkg/python/contrib/Lib/plat-mac/lib-scriptpackages/Finder/Files.py
80
"""Suite Files: Classes representing files Level 1, version 1 Generated from /System/Library/CoreServices/Finder.app AETE/AEUT resource version 0/144, language 0, script 0 """ import aetools import MacOS _code = 'fndr' class Files_Events: pass class alias_file(aetools.ComponentItem): """alias file - An a...
kikocorreoso/brython
refs/heads/master
www/speed/benchmarks/create_class_with_init.py
2
for i in range(10000): class A: def __init__(self, x): self.x = x
Odingod/mne-python
refs/heads/master
mne/io/proj.py
3
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Denis Engemann <denis.engemann@gmail.com> # Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) from copy import deepcopy from math import sqrt import numpy as n...
Acidburn0zzz/servo
refs/heads/master
tests/dromaeo/run_dromaeo.py
15
#!/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 https://mozilla.org/MPL/2.0/. import os import subprocess import sys import BaseHTTPServer import SimpleHTTPServer import urlp...
shmup/miniboa
refs/heads/master
examples/chat_demo.py
1
# -*- coding: utf-8 -*- """ Chat Room Demo for Miniboa. """ import logging from miniboa import TelnetServer IDLE_TIMEOUT = 300 CLIENT_LIST = [] SERVER_RUN = True def on_connect(client): """ Sample on_connect function. Handles new connections. """ logging.info("Opened connection to {}".format(cli...
pulinagrawal/nupic
refs/heads/master
src/nupic/swarming/hypersearch/permutation_helpers.py
18
# ---------------------------------------------------------------------- # 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...
Barrog/C4-Datapack
refs/heads/master
data/jscript/quests/218_TestimonyOfLife/__init__.py
1
# Maked by Mr. Have fun! Version 0.2 # Quest: Testimony Of Life # Fixed by Artful (http://L2PLanet.ru Lineage2 C3 Server) print "importing quests: 218: Testimony Of Life" import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.m...
Kazade/NeHe-Website
refs/heads/master
google_appengine/lib/django_1_2/django/contrib/gis/gdal/tests/test_envelope.py
68
import unittest from django.contrib.gis.gdal import Envelope, OGRException class TestPoint(object): def __init__(self, x, y): self.x = x self.y = y class EnvelopeTest(unittest.TestCase): def setUp(self): self.e = Envelope(0, 0, 5, 5) def test01_init(self): "Testing Enve...
cchurch/ansible
refs/heads/devel
lib/ansible/modules/system/awall.py
50
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ted Trask <ttrask01@yahoo.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '...
dcpssc/chariot
refs/heads/master
Runtime/chariot_runtime_libs/chariot_helpers.py
2
__author__ = "Subhav Pradhan" import pymongo import socket import sys from logger import get_logger logger = get_logger("chariot_helpers") # Basic serialize class to convert a mongo document into a dictionary. class Serialize: def __init__(self, **entries): self.__dict__.update(entries) # Get node IP an...
darioml/farley-files
refs/heads/master
api/quickstart/serializers.py
1
from django.contrib.auth.models import User, Group from rest_framework import serializers from quickstart.models import Contact class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('url', 'username', 'email', 'groups') class GroupSerializer(serializers...
broxtronix/thunder
refs/heads/master
python/thunder/regression/regress.py
1
""" Classes for mass-unvariate regression """ from numpy import sum, outer, inner, mean, shape, dot, transpose, concatenate, ones, asarray from thunder.rdds.series import Series from thunder.utils.common import loadMatVar, pinv class RegressionModel(object): """ Base class for loading and fitting regression...
russel1237/scikit-learn
refs/heads/master
sklearn/externals/joblib/parallel.py
79
""" Helpers for embarrassingly parallel code. """ # Author: Gael Varoquaux < gael dot varoquaux at normalesup dot org > # Copyright: 2010, Gael Varoquaux # License: BSD 3 clause from __future__ import division import os import sys import gc import warnings from math import sqrt import functools import time import thr...
IvanYakimov/huntl
refs/heads/master
driver-gen/iosupport.py
1
def openFile(name, mode): try: result = open(name, mode) return result except IOError: print "IO error while opening the file", name, "in", mode, "mode" sys.exit(errno.EIO)
Simran-B/arangodb
refs/heads/docs_3.0
3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/iso8859_2.py
593
""" Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
azoft-dev-team/imagrium
refs/heads/win
env/Lib/httplib.py
2
r"""HTTP/1.1 client library <intro stuff goes here> <other stuff, too> HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPConnection(...
tedder/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_timer_policy.py
21
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
JustinWingChungHui/MyFamilyRoot
refs/heads/master
chinese_relation_name/views.py
2
from django.http import HttpResponse from django.http import JsonResponse from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import AllowAny from family_tree.models.relation import RAISED, PARTNERED, RAISED_BY from chinese_relation_name.relation_name_dictionary import g...
Weicong-Lin/pymo-global
refs/heads/master
android/pgs4a-0.9.6/python-install/lib/python2.7/ctypes/test/test_simplesubclasses.py
118
import unittest from ctypes import * class MyInt(c_int): def __cmp__(self, other): if type(other) != MyInt: return -1 return cmp(self.value, other.value) def __hash__(self): # Silence Py3k warning return hash(self.value) class Test(unittest.TestCase): def test_compare(...
manhhomienbienthuy/pythondotorg
refs/heads/master
pydotorg/settings/base.py
2
import os import dj_database_url from django.contrib.messages import constants ### Basic config BASE = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) DEBUG = True SITE_ID = 1 SECRET_KEY = 'its-a-secret-to-everybody' # Until Sentry works on Py3, do errors the old-fashioned way. ADMINS = [] # G...
stefrobb/namebench
refs/heads/master
nb_third_party/jinja2/constants.py
220
# -*- coding: utf-8 -*- """ jinja.constants ~~~~~~~~~~~~~~~ Various constants. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ #: list of lorem ipsum words used by the lipsum() helper function LOREM_IPSUM_WORDS = u'''\ a ac accumsan ad adipiscing aenean a...
karypun/change-of-address-prototype
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
# Copyright (c) 2012 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
andrewbates09/FERGUS
refs/heads/master
fergus/__init__.py
1
''' Library for doing fun things with computers. ''' __author__ = 'Andrew M Bates' __version__ = '0.001' import io, os, sys # the core imports go here # this should go in in the mods dir try: '''IF RASPBERRY PI & HAS A GPIO BOARD''' import RPi.GPIO as RPi except ImportError: pass
jmgilman/Omega-Python
refs/heads/master
lib/flask/sessions.py
348
# -*- coding: utf-8 -*- """ flask.sessions ~~~~~~~~~~~~~~ Implements cookie based sessions based on itsdangerous. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import uuid import hashlib from datetime import datetime from werkzeug.http import http_date, ...
robbymeals/scikit-learn
refs/heads/master
benchmarks/bench_sparsify.py
323
""" Benchmark SGD prediction time with dense/sparse coefficients. Invoke with ----------- $ kernprof.py -l sparsity_benchmark.py $ python -m line_profiler sparsity_benchmark.py.lprof Typical output -------------- input data sparsity: 0.050000 true coef sparsity: 0.000100 test data sparsity: 0.027400 model sparsity:...
syntheticpp/metashell
refs/heads/master
3rd/templight/llvm/utils/wciia.py
99
#!/usr/bin/env python """ wciia - Whose Code Is It Anyway Determines code owner of the file/folder relative to the llvm source root. Code owner is determined from the content of the CODE_OWNERS.TXT by parsing the D: field usage: utils/wciia.py path limitations: - must be run from llvm source root - very simplist...
donkirkby/django
refs/heads/master
tests/migrations/test_executor.py
80
from django.apps.registry import apps as global_apps from django.db import connection from django.db.migrations.exceptions import InvalidMigrationPlan from django.db.migrations.executor import MigrationExecutor from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationReco...
bjut-hz/whatswrong
refs/heads/master
CCG_Scripts/AnnotatePARG.py
7
# When run in the base directory of CCGBank, this script creates a new # directory of PARG files called ANNO which have been annotated with the # surface forms: <s> #parses word1|tag1|cat1 word2|tag2|cat2 .... # Author: Yonatan Bisk (bisk1@illinois.edu) import os,sys os.mkdir("ANNO") for root,dirs,files in os.walk(...
TE-ToshiakiTanaka/stve
refs/heads/master
test/data/testcase/picture/picture_02.py
2
import os import sys import time from stve.log import LOG as L from stve.script import StveTestCase class TestCase(StveTestCase): def __init__(self, *args, **kwargs): super(TestCase, self).__init__(*args, **kwargs) @classmethod def setUpClass(cls): L.info("*** Start TestCase : %s *** "...
mdblv2/joatu-django
refs/heads/master
application/site-packages/django/core/paginator.py
103
from math import ceil from django.utils import six class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): self.object_list = ...
magvugr/AT
refs/heads/master
AppAdiccionTic/migrations/0002_remove_evento_hora.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-15 22:16 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('AppAdiccionTic', '0001_initial'), ] operations = [ migrations.RemoveField( ...
kbdick/RecycleTracker
refs/heads/gh-pages
recyclecollector/scrap/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/X509.py
279
"""Class representing an X.509 certificate.""" from utils.ASN1Parser import ASN1Parser from utils.cryptomath import * from utils.keyfactory import _createPublicRSAKey class X509: """This class represents an X.509 certificate. @type bytes: L{array.array} of unsigned bytes @ivar bytes: The DER-encoded ASN...
svn2github/django
refs/heads/master
django/contrib/gis/tests/inspectapp/models.py
312
from django.contrib.gis.db import models class AllOGRFields(models.Model): f_decimal = models.FloatField() f_float = models.FloatField() f_int = models.IntegerField() f_char = models.CharField(max_length=10) f_date = models.DateField() f_datetime = models.DateTimeField() f_time = models.Tim...
eschleicher/flask_shopping_list
refs/heads/master
venv/lib/python3.4/site-packages/watchdog/__init__.py
35
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 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 # # ...
jjscarafia/odoo
refs/heads/master
addons/gamification/models/challenge.py
8
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
citibob/gisspp
refs/heads/master
slib/ibmisc/f90blitz_f.py
1
# IBMisc: Misc. Routines for IceBin (and other code) # Copyright (c) 2013-2016 by Elizabeth Fischer # # 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, either version 3 of the License, or ...
mrquim/repository.mrquim
refs/heads/master
repo/script.module.exodus/lib/resources/lib/sources/pl/szukajkatv.py
5
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2017 homik 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 your option) any la...
xadahiya/django
refs/heads/master
tests/file_uploads/models.py
691
from django.db import models class FileModel(models.Model): testfile = models.FileField(upload_to='test_upload')
jmagnusson/raven-python
refs/heads/master
raven/contrib/zerorpc/__init__.py
29
""" raven.contrib.zerorpc ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import inspect from raven.base import Client class SentryMiddleware(object): """Sentry/Raven middle...
briancoutinho0905/2dsampling
refs/heads/master
ext/ply/ply/__init__.py
838
# PLY package # Author: David Beazley (dave@dabeaz.com) __all__ = ['lex','yacc']
BartoszCichecki/onlinepython
refs/heads/master
onlinepython/pypy-2.4.0-win32/lib-python/2.7/sunaudio.py
286
"""Interpret sun audio headers.""" from warnings import warnpy3k warnpy3k("the sunaudio module has been removed in Python 3.0; " "use the sunau module instead", stacklevel=2) del warnpy3k MAGIC = '.snd' class error(Exception): pass def get_long_be(s): """Convert a 4-char value to integer.""" r...
scs/uclinux
refs/heads/master
lib/boost/boost_1_38_0/libs/python/pyste/dist/setup.py
54
# Copyright Bruno da Silva de Oliveira 2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from distutils.core import setup import py2exe import sys sys.path.append('../src') setup(name='pyste', scripts=['../src/p...
Immortalin/python-for-android
refs/heads/master
python-modules/twisted/twisted/names/test/__init__.py
139
"Tests for twisted.names"
aishmittal/Product-Info-Crawler
refs/heads/master
product_info_crawler/settings.py
1
# -*- coding: utf-8 -*- # Scrapy settings for product_info_crawler project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs....
chenc10/Spark-PAF
refs/heads/master
ec2/lib/boto-2.34.0/boto/cloudsearch/document.py
153
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
saradbowman/osf.io
refs/heads/develop
addons/owncloud/models.py
16
# -*- coding: utf-8 -*- import logging from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings, BaseStorageAddon) from django.db import models from framework.auth import Auth from osf.models.files import File, Folder, BaseFileNode from owncloud import Client as OwnC...
mattmakesmaps/pgsql2gist
refs/heads/master
pgsql2gist/tests/test_cli.py
1
__author__ = 'matt' __date__ = '11/22/13' import sys from nose.tools import raises from pgsql2gist import CLIInterface class TestKeyValues(object): def setup(self): self.args = ['/Users/matt/Projects/pgsql2gist/pgsql2gist.py', '-h', 'localhost', '-f', 'test.geojson', ...
Satvik2101/Clean-Folder
refs/heads/master
unpack.py
1
import os import shutil import sys if os.path.exists('clean_folder.txt') == False: print ("clean_folder.txt file has not been created or has been deleted.") sys.exit() else: txt_file= open('clean_folder.txt','r+') txt_data = txt_file.read() cur_dir= os.getcwd() folders_list=[ x for...
alexsmx/djangoAppengineSrcTemplate
refs/heads/master
django/contrib/gis/gdal/srs.py
291
""" The Spatial Reference class, represensents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print srs GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORI...
uwafsl/ardupilot
refs/heads/master
Tools/autotest/param_metadata/htmlemit.py
148
#!/usr/bin/env python import re from param import * from emit import Emit import cgi # Emit docs in a form acceptable to the APM wordpress docs site class HtmlEmit(Emit): def __init__(self): html_fname = 'Parameters.html' self.f = open(html_fname, mode='w') self.preamble = '''<!-- Dyn...
sterlingbaldwin/acme-web-fe
refs/heads/master
apps/cdat/admin.py
13848
from django.contrib import admin # Register your models here.
petewarden/tensorflow
refs/heads/master
tensorflow/lite/tools/optimize/python/modify_model_interface_constants.py
10
# Lint as: python3 # Copyright 2020 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 ...
GuessWhoSamFoo/pandas
refs/heads/master
pandas/tests/tslibs/test_normalize_date.py
2
# -*- coding: utf-8 -*- """Tests for functions from pandas._libs.tslibs""" from datetime import date, datetime import pytest from pandas._libs import tslibs @pytest.mark.parametrize("value,expected", [ (date(2012, 9, 7), datetime(2012, 9, 7)), (datetime(2012, 9, 7, 12), datetime(2012, 9, 7)), (datetime...
bob123bob/Sick-Beard
refs/heads/development
lib/requests/packages/chardet/latin1prober.py
191
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mattesno1/CouchPotatoServer
refs/heads/master
libs/tornado/platform/windows.py
387
# NOTE: win32 support is currently experimental, and not recommended # for production use. from __future__ import absolute_import, division, print_function, with_statement import ctypes import ctypes.wintypes # See: http://msdn.microsoft.com/en-us/library/ms724935(VS.85).aspx SetHandleInformation = ctypes.windll.ker...
googleapis/googleapis-gen
refs/heads/master
google/cloud/websecurityscanner/v1beta/websecurityscanner-v1beta-py/google/cloud/websecurityscanner_v1beta/types/finding.py
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
Maccimo/intellij-community
refs/heads/master
python/testData/intentions/PyInvertIfConditionIntentionTest/commentsTypeFollowup_after.py
10
def func(): value = "not-none" # type: ignore if value is not None: print(value) return print("None")
ammarkhann/FinalSeniorCode
refs/heads/master
lib/python2.7/site-packages/pexpect/async.py
17
import asyncio import errno from pexpect import EOF @asyncio.coroutine def expect_async(expecter, timeout=None): # First process data that was previously read - if it maches, we don't need # async stuff. previously_read = expecter.spawn.buffer expecter.spawn.buffer = expecter.spawn.string_type() i...
andyh616/mne-python
refs/heads/master
mne/channels/layout.py
5
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Eric Larson <larson.eric.d@gmail.com> # Marijn van Vliet <w.m.vanvliet@gmail.com> # Jona Sassenhagen <jona.sass...
samsungsds-rnd/deepspeech.mxnet
refs/heads/master
layer/lstm.py
1
# pylint:skip-file from collections import namedtuple import mxnet as mx from batchnorm import batchnorm LSTMState = namedtuple("LSTMState", ["c", "h"]) LSTMParam = namedtuple("LSTMParam", ["i2h_weight", "i2h_bias", "h2h_weight", "h2h_bias", "...
finoradin/moma-utils
refs/heads/master
pre-ingest-metrics/size.py
1
#!/usr/bin/env python import os import datetime import re import sqlite3 from hurry.filesize import size from sys import stdout i = datetime.datetime.now() now = i.isoformat() def get_size(start_path = '.'): total_size = 0 for dirpath, dirnames, filenames in os.walk(start_path): for f in filenames: ...
scotthartbti/android_external_chromium_org
refs/heads/kk44
third_party/jinja2/exceptions.py
977
# -*- coding: utf-8 -*- """ jinja2.exceptions ~~~~~~~~~~~~~~~~~ Jinja exceptions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2._compat import imap, text_type, PY2, implements_to_string class TemplateError(Exception): """Baseclass for al...
npmccallum/deo
refs/heads/master
tests/ca.py
2
#!/usr/bin/python # # Copyright (c) 2015 Red Hat, Inc. # Author: Nathaniel McCallum <npmccallum@redhat.com> # # 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 ...
pculture/mirovideoconverter3
refs/heads/master
mvc/widgets/gtk/widgets.py
2
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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; eithe...
ingydotnet/cdent-py
refs/heads/master
package/unittest.py
7
from __future__ import absolute_import import os import unittest class TestCase(unittest.TestCase): def tearDown(self): if os.path.exists('expected'): os.unlink('expected') if os.path.exists('got'): os.unlink('got') def assertTextEquals(self, got, expected, msg=None):...
dpendl00/headphones
refs/heads/master
lib/unidecode/x0ad.py
253
data = ( 'gwan', # 0x00 'gwanj', # 0x01 'gwanh', # 0x02 'gwad', # 0x03 'gwal', # 0x04 'gwalg', # 0x05 'gwalm', # 0x06 'gwalb', # 0x07 'gwals', # 0x08 'gwalt', # 0x09 'gwalp', # 0x0a 'gwalh', # 0x0b 'gwam', # 0x0c 'gwab', # 0x0d 'gwabs', # 0x0e 'gwas', # 0x0f 'gwass', #...
yelizariev/tkobr-addons
refs/heads/8.0
tko_product_filter_internal_reference/__openerp__.py
2
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
hsuchie4/TACTIC
refs/heads/master
src/pyasm/application/houdini/houdini_builder.py
6
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
dnozay/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/contrib/flatpages/middleware.py
641
from django.contrib.flatpages.views import flatpage from django.http import Http404 from django.conf import settings class FlatpageFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a flatpage for non...
Petrole/MaturePyRobots
refs/heads/master
WebPyRobot/backend/forms.py
1
from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User class SignUpForm(UserCreationForm, forms.Form): username = forms.CharField(label='Pseudo', max_length=150, required=True, widget=forms...
aimas/TuniErp-8.0
refs/heads/master
openerp/conf/deprecation.py
380
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
yjhjstz/gyp
refs/heads/master
test/rules/src/copy-file.py
600
#!/usr/bin/env python # Copyright (c) 2009 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. import sys contents = open(sys.argv[1], 'r').read() open(sys.argv[2], 'wb').write(contents) sys.exit(0)
sychen/python-einvoice-receipts
refs/heads/master
invoice_file.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import csv import datetime import collections import sys def indent(text): return '\n'.join([ ' ' + line for line in text.split('\n')]) class InvoiceFile(object): def __init__(self, file_name): self.file_name = f...
vrkansagara/YouCompleteMe
refs/heads/master
third_party/pythonfutures/concurrent/futures/__init__.py
247
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Execute computations asynchronously using threads or processes.""" __author__ = 'Brian Quinlan (brian@sweetapp.com)' from concurrent.futures._base import (FIRST_COMPLETED, FI...
Nikoala/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/azubu.py
143
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import float_or_none class AzubuIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?azubu\.tv/[^/]+#!/play/(?P<id>\d+)' _TESTS = [ { 'url': 'http://www.azubu.tv/GSL#!/play/15575/2014-hot6-...
abhi11/tanglu-dak
refs/heads/master
dak/dakdb/update103.py
6
#!/usr/bin/env python # coding=utf8 """ Drop unique .changes name requirement and allow ftpteam to forget seen files @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2014, Ansgar Burchardt <ansgar@debian.org> @license: GNU General Public License version 2 or later """ # This program is free software; y...
barykaed/Pelican-Test
refs/heads/gh-pages
fsp_env/Lib/site-packages/pip/_vendor/distlib/metadata.py
427
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). """ from __future__ import unicode_literals import codecs from email...
royosherove/bitcoinxt
refs/heads/master
qa/rpc-tests/merkle_blocks.py
133
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test merkleblock fetch/validation # from test_framework.test_framework import BitcoinTestFramework from t...
eighthave/keysync
refs/heads/master
setup.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- from setuptools import setup import os import sys def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() dependencies = [ 'BeautifulSoup4', 'psutil', 'python-potr', 'pyasn1', 'pycrypto', 'pyjava...
valtech-mooc/edx-platform
refs/heads/master
common/djangoapps/embargo/exceptions.py
194
"""Exceptions for the embargo app.""" class InvalidAccessPoint(Exception): """The requested access point is not supported. """ def __init__(self, access_point, *args, **kwargs): msg = ( u"Access point '{access_point}' should be either 'enrollment' or 'courseware'" ).format(access_...