repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
katiewsimon/JP-Morgan-Hackathon-Project
refs/heads/master
jp_server/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/sax.py
1835
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
iModels/mbuild
refs/heads/master
mbuild/utils/io.py
2
"""Module for working with external libraries. Portions of this code are adapted from MDTraj and are released under the following license. ############################################################################## # MDTraj is free software: you can redistribute it and/or modify # it under the terms of the GNU Les...
gmccance/pylsf
refs/heads/master
pylsf/__init__.py
1
from pylsf import *
DandyDev/slack-machine
refs/heads/master
machine/__init__.py
1
from .core import Machine from .__about__ import (__title__, __description__, __uri__, __version__, __author__, __email__, __license__, __copyright__) __all__ = [ '__title__', '__description__', '__uri__', '__version__', '__author__', '__email__', '__license__', '__copyright__', 'Machin...
andars/rust
refs/heads/master
src/etc/regex-match-tests.py
58
#!/usr/bin/env python2 # Copyright 2014 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license #...
otherness-space/myProject002
refs/heads/master
my_project_002/lib/python2.7/site-packages/django/contrib/localflavor/es/forms.py
108
# -*- coding: utf-8 -*- """ Spanish-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.es.es_provinces import PROVINCE_CHOICES from django.contrib.localflavor.es.es_regions import REGION_CHOICES from django.core.validators import EMPTY_VALUES ...
BT-csanchez/account-financial-reporting
refs/heads/8.0
__unported__/account_financial_report/__openerp__.py
24
# -*- encoding: utf-8 -*- ########################################################################### # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). # All Rights Reserved # Credits###################################################### # Coded by: Humberto Arocha humberto@openerp.com.ve # ...
brendandburns/tensorflow
refs/heads/master
tensorflow/models/embedding/word2vec_optimized_test.py
5
"""Tests for word2vec_optimized module.""" import os import tensorflow.python.platform import tensorflow as tf from tensorflow.models.embedding import word2vec_optimized as word2vec_optimized flags = tf.app.flags FLAGS = flags.FLAGS class Word2VecTest(tf.test.TestCase): def setUp(self): FLAGS.train_data =...
yceruto/django
refs/heads/master
tests/admin_inlines/admin.py
30
from django.contrib import admin from django import forms from .models import ( Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2, Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder, Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stacked, Inner4Tabular, NonAut...
Pquips/Portfolio
refs/heads/master
tk.py
1
from Tkinter import * import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(4,GPIO.OUT) GPIO.setup(17,GPIO.OUT) GPIO.setup(27,GPIO.OUT) GPIO.setup(22,GPIO.OUT) GPIO.setup(9,GPIO.OUT) GPIO.setup(20,GPIO.OUT) def keydownq(q): GPIO.output(20,GPIO.HIGH) ...
prestodb/presto-admin
refs/heads/master
tests/unit/standalone/test_help.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
waldocollective/swiftwind
refs/heads/master
swiftwind/settings/migrations/0002_settings_tellerio_enable.py
2
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-12-05 15:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('settings', '0001_initial'), ] operations = [ migrations.AddField( ...
thethythy/Mnemopwd
refs/heads/master
mnemopwd/server/clients/protocol/StateS2.py
1
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must reta...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Tools/scripts/eptags.py
102
#! /usr/bin/env python """Create a TAGS file for Python programs, usable with GNU Emacs. usage: eptags pyfiles... The output TAGS file is usable with Emacs version 18, 19, 20. Tagged are: - functions (even inside other defs or classes) - classes eptags warns about files it cannot open. eptags will not give warning...
modulexcite/blink
refs/heads/nw12
Source/devtools/scripts/generate_devtools_grd.py
15
#!/usr/bin/env python # # 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...
brockwhittaker/zulip
refs/heads/master
tools/lib/sanity_check.py
2
import os import pwd import sys def check_venv(filename): # type: (str) -> None try: import django import ujson import zulip except ImportError: print("You need to run %s inside a Zulip dev environment." % (filename,)) user_id = os.getuid() user_name = pwd.ge...
camagenta/youtube-dl
refs/heads/master
youtube_dl/extractor/jeuxvideo.py
85
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class JeuxVideoIE(InfoExtractor): _VALID_URL = r'http://.*?\.jeuxvideo\.com/.*/(.*?)\.htm' _TESTS = [{ 'url': 'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-vita...
kg-bot/SupyBot
refs/heads/master
plugins/Steps/steps/trad.py
1
name = 'Traditions' url = '' abbrevs = ['traditions','aatraditions','aatrad','trad'] steps = [ 'Our common welfare should come first; personal recovery depends upon A.A. unity.', 'For our group purpose there is but one ultimate authority - a loving God as He may express Himself in our group conscience. Our lead...
DaiYue/shadowsocks
refs/heads/master
shadowsocks/asyncdns.py
655
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-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 r...
citrix-openstack-build/cinder
refs/heads/master
cinder/volume/drivers/windows.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Pedro Navarro Perez # 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...
Timus1712/boto
refs/heads/master
boto/elastictranscoder/__init__.py
18
# Copyright (c) 2013 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 restriction, including # without limitation the rights...
cryptorinium/num2
refs/heads/master
src/vm-builder-0.12.4+bzr489/VMBuilder/tests/plugin_tests.py
2
import unittest import VMBuilder.plugins from VMBuilder.exception import VMBuilderException class TestPluginsSettings(unittest.TestCase): class VM(VMBuilder.plugins.Plugin): def __init__(self, *args, **kwargs): self._config = {} self.context = self class TestPlugin(VMBuilder...
shastikk/youtube-dl
refs/heads/master
youtube_dl/extractor/gdcvault.py
77
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( remove_end, HEADRequest, ) class GDCVaultIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\...
youfoh/webkit-efl
refs/heads/tizen
Tools/Scripts/webkitpy/tool/steps/update.py
4
# Copyright (C) 2010 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 th...
sriki18/scipy
refs/heads/master
scipy/linalg/setup.py
52
#!/usr/bin/env python from __future__ import division, print_function, absolute_import import os from os.path import join def configuration(parent_package='', top_path=None): from distutils.sysconfig import get_python_inc from numpy.distutils.system_info import get_info, NotFoundError, numpy_info from nu...
bsmrstu-warriors/Moytri--The-Drone-Aider
refs/heads/master
Lib/site-packages/numpy/testing/tests/test_utils.py
53
import warnings import sys import numpy as np from numpy.testing import * import unittest class _GenericTest(object): def _test_equal(self, a, b): self._assert_func(a, b) def _test_not_equal(self, a, b): try: self._assert_func(a, b) passed = True except Asserti...
sparkslabs/kamaelia_
refs/heads/master
Code/Python/Apps/Europython09/App/MiniAxon-2.py
3
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Ver...
arnaudsj/pybrain
refs/heads/master
pybrain/structure/connections/fullnotself.py
31
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from scipy import reshape, dot, outer, eye from pybrain.structure.connections import FullConnection class FullNotSelfConnection(FullConnection): """Connection which connects every element from the first module's output buffer to the second module's input ...
greenlin/tushare
refs/heads/master
tushare/futures/ctp/futures/ApiStruct.py
35
# -*- coding: utf-8 -*- from __future__ import absolute_import as _init T = {} T['TE_RESUME'] = 'int' #流重传方式 TERT_RESTART = 0 #从本交易日开始重传 TERT_RESUME = 1 #从上次收到的续传 TERT_QUICK = 2 #只传送登录后的流内容 T['TraderID'] = 'char[21]' #交易所交易员代码 T['InvestorID'] = 'char[13]' #投资者代码 T['BrokerID'] = 'char[11]' #经纪公司代码 T['BrokerAbbr'] = 'c...
dreamhost/akanda-rug
refs/heads/master
akanda/rug/test/unit/openvswitch/__init__.py
49
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, 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 applicabl...
terryyin/linkchecker
refs/heads/master
third_party/dnspython/dns/tsigkeyring.py
9
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
simpeg/simpeg
refs/heads/em1d
tests/em/fdem/muinverse/test_muinverse.py
1
import discretize from SimPEG import maps, utils, tests from SimPEG.electromagnetics import frequency_domain as fdem import numpy as np from scipy.constants import mu_0 import unittest MuMax = 50.0 TOL = 1e-8 EPS = 1e-10 np.random.seed(105) def setupMeshModel(): cs = 10.0 nc = 20.0 npad = 15.0 hx =...
wehkamp/ansible
refs/heads/devel
test/units/plugins/vars/__init__.py
7690
# (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...
rishikksh20/scikit-learn
refs/heads/master
sklearn/manifold/t_sne.py
14
# Author: Alexander Fabisch -- <afabisch@informatik.uni-bremen.de> # Author: Christopher Moody <chrisemoody@gmail.com> # Author: Nick Travers <nickt@squareup.com> # License: BSD 3 clause (C) 2014 # This is the exact and Barnes-Hut t-SNE implementation. There are other # modifications of the algorithm: # * Fast Optimi...
skerit/shotfactory
refs/heads/master
shotfactory04/image/hashmatch.py
4
# browsershots.org - Test your web design in different browsers # Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org> # # Browsershots 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 ...
davidrobles/mlnd-capstone-code
refs/heads/master
experiments/play_tic_tac_toe.py
1
from capstone.game.games import TicTacToe from capstone.game.players import RandPlayer from capstone.game.utils import play_match game = TicTacToe() players = [RandPlayer(), RandPlayer()] play_match(game, players)
xiroV/Algorithms_Example
refs/heads/master
Kadane's/Python/Kadane.py
11
def kadane(A): max_so_far = max_ending = 0 for x in A: max_ending = max(0, max_ending + x) max_so_far = max(max_so_far, max_ending) return max_so_far A = [-2, -3, 4, -1, -2, 1, 5, -3] print "Maximum contiguous sum is", kadane(A)
raptorjr/xbmc
refs/heads/master
lib/gtest/test/gtest_test_utils.py
1100
#!/usr/bin/env python # # Copyright 2006, 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...
bd339/servo
refs/heads/master
tests/wpt/web-platform-tests/mixed-content/generic/expect.py
95
import json, os, urllib, urlparse def redirect(url, response): response.add_required_headers = False response.writer.write_status(301) response.writer.write_header("access-control-allow-origin", "*") response.writer.write_header("location", url) response.writer.end_headers() response.writer.wri...
saydulk/django
refs/heads/master
django/conf/locale/el/formats.py
446
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd/m/Y' TIME_FORMAT = 'P' DATETIME...
sdispater/eloquent
refs/heads/master
tests/connections/__init__.py
803
# -*- coding: utf-8 -*-
joshuahoman/vivisect
refs/heads/master
envi/archs/z80/regs.py
27
''' Register definition for the z80 architecture ''' import envi.registers as e_reg z80regs = [ ('AF', 16), ('BC', 16), ('DE', 16), ('HL', 16), ('IX', 16), ('IY', 16), ('PC', 16), ('SP', 16), ('I', 8), ('R', 8), ] l = locals() e_reg.addLocalEnums(l, z80regs) z80meta = [ ...
Team-Huawei/android_kernel_huawei_msm8909
refs/heads/cm-14.1
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
infobip/infobip-api-python-client
refs/heads/master
infobip/api/model/sms/mt/send/Message.py
1
# -*- coding: utf-8 -*- """This is a generated class and is not intended for modification! """ from datetime import datetime from infobip.util.models import DefaultObject, serializable from infobip.api.model.Destination import Destination from infobip.api.model.sms.mt.send.Language import Language from infobip.api.mo...
IPMITMO/statan
refs/heads/master
coala-bears/tests/scss/SCSSLintBearTest.py
4
from bears.scss.SCSSLintBear import SCSSLintBear from coalib.testing.LocalBearTestHelper import verify_local_bear good_file = """ .btn-primary { &:hover { background-color: darken($btn-primary-bg, 3%); } } """ bad_file = """ .btn-primary { &:hover { background-color: darken($btn-primary-bg, 3%) } """ ...
msabramo/pip
refs/heads/develop
pip/_vendor/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
seanfisk/powerline
refs/heads/develop
tests/vim.py
15
# vim:fileencoding=utf-8:noet _log = [] vars = {} vvars = {'version': 703} _tabpage = 0 _mode = 'n' _buf_purge_events = set() options = { 'paste': 0, 'ambiwidth': 'single', 'columns': 80, 'encoding': 'utf-8', } _last_bufnr = 0 _highlights = {} from collections import defaultdict as _defaultdict _environ = _defaultd...
AlexMaskovyak/elasticsearch-py
refs/heads/master
test_elasticsearch/test_connection_pool.py
13
import time from elasticsearch.connection_pool import ConnectionPool, RoundRobinSelector, DummyConnectionPool from elasticsearch.exceptions import ImproperlyConfigured from .test_cases import TestCase class TestConnectionPool(TestCase): def test_dummy_cp_raises_exception_on_more_connections(self): self.a...
joshshadowfax/slask
refs/heads/master
plugins/hash.py
2
"""!md5 <phrase> return an md5 hash for <phrase>""" import md5 import re def on_message(msg, server): text = msg.get("text", "") match = re.findall(r"!md5 (.*)", text) if not match: return return md5.md5(match[0]).hexdigest()
mclaughlin6464/pylearn2
refs/heads/master
pylearn2/space/__init__.py
34
""" Classes that define how vector spaces are formatted Most of our models can be viewed as linearly transforming one vector space to another. These classes define how the vector spaces should be represented as theano/numpy variables. For example, the VectorSpace class just represents a vector space with a vector, an...
modlinltd/django-advanced-filters
refs/heads/develop
tests/reps/admin.py
3
from django.contrib import admin from .models import SalesRep admin.site.register(SalesRep)
joerocklin/gem5
refs/heads/master
src/python/m5/ticks.py
57
# Copyright (c) 2007 The Regents of The University of Michigan # 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 ...
adedayo/intellij-community
refs/heads/master
python/helpers/profiler/thrift/server/TServer.py
56
# # 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...
Therp/odoo
refs/heads/8.0
addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py
340
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
nfoti/StarCluster
refs/heads/develop
starcluster/commands/s3image.py
19
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 (at your option) any # later ...
edcast-inc/edx-platform-edcast
refs/heads/master
lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py
114
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Invoice' db.create_table('shoppingcart_invoice', ( ('id', self.gf('django.db.mod...
xuxiaoxin/micropython
refs/heads/master
tests/basics/self_type_check.py
104
# make sure type of first arg (self) to a builtin method is checked list.append try: list.append() except TypeError as e: print("TypeError") try: list.append(1) except TypeError as e: print("TypeError") try: list.append(1, 2) except TypeError as e: print("TypeError") l = [] list.append(l, 2...
sunjiawe/Stino
refs/heads/ST4ArduinoIDE
stino/pyarduino/base/zeroconf.py
14
from __future__ import absolute_import, division, print_function, unicode_literals """ Multicast DNS Service Discovery for Python, v0.14-wmcbrine Copyright 2003 Paul Scott-Murphy, 2014 William McBrine This module provides a framework for the use of DNS Service Discovery using IP multicast. This libra...
kylerbrown/spikechef
refs/heads/master
gen_klusta_command.py
1
from subprocess import call import os.path from math import ceil import argparse def subset(filebase, directory, shank_num, max_spikes): clu_filename = "{}.clu.{}".format(os.path.join(directory, filebase), shank_num) Nspikes = float(sum(1 for line in open(clu_filename)))...
tsl143/zamboni
refs/heads/master
mkt/receipts/utils.py
20
import calendar import time from urllib import urlencode from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse import jwt from nose.tools import nottest from receipts.receipts import Receipt from lib.crypto import receipt from lib.utils im...
tectronics/coot
refs/heads/master
rcrane/rotamerSeq.py
4
#!/usr/bin/env python """Determine the sequence of rotamers for a structure using a hidden Markov model""" # Copyright 2010 Kevin Keating # # Licensed under the Educational Community 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...
Passtechsoft/TPEAlpGen
refs/heads/master
blender/release/scripts/templates_py/operator_simple.py
9
import bpy def main(context): for ob in context.scene.objects: print(ob) class SimpleOperator(bpy.types.Operator): """Tooltip""" bl_idname = "object.simple_operator" bl_label = "Simple Object Operator" @classmethod def poll(cls, context): return context.active_object is not ...
sander76/home-assistant
refs/heads/dev
homeassistant/components/vallox/fan.py
5
"""Support for the Vallox ventilation unit fan.""" import logging from homeassistant.components.fan import FanEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from . import ( DOMAIN, METRIC_KEY_MODE, METRIC_KEY_PROFILE_FAN_SPEED_AWAY, ...
duducosmos/pgs4a
refs/heads/master
python-install/lib/python2.7/test/test_weakset.py
29
import unittest from test import test_support from weakref import proxy, ref, WeakSet import operator import copy import string import os from random import randrange, shuffle import sys import warnings import collections import gc import contextlib class Foo: pass class SomeClass(object): def __init__(self,...
Reflexe/doc_to_pdf
refs/heads/master
Windows/program/python-core-3.5.0/lib/nturl2path.py
19
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # and # ///C:/foo/bar/spam.foo # become # ...
ly0/xxadmin
refs/heads/master
xadmin/plugins/relate.py
1
# coding=UTF-8 from django.core.urlresolvers import reverse import sys if sys.version_info.major < 3: from django.utils.encoding import force_unicode as force_text from django.utils.encoding import smart_str as smart_text else: from django.utils.encoding import force_text from django.utils.encoding import s...
fo2rist/infra-strike
refs/heads/master
backend/venv/Lib/encodings/cp1250.py
272
""" Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.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,in...
spool/django-allauth
refs/heads/master
allauth/socialaccount/providers/weixin/views.py
6
import requests from allauth.account import app_settings from allauth.compat import reverse from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from allauth.utils import build_absolute_uri from .client import WeixinOAuth2Client from .provider im...
qu6d83fu/Python
refs/heads/master
test/threading/condition2.py
1
from threading import * import time class itemX: def __init__(self): self.cnt = 0 def produce (self,num=1): self.cnt += 1 def consume(self,num=1): if self.cnt: self.cnt -= 1 else: print 'WARNING******WARNING' def isEmpty(self): return n...
jmesteve/saas3
refs/heads/master
openerpcommand/main.py
16
import openerpcommand def run(): """ Main entry point for the openerp-command tool.""" parser = openerpcommand.main_parser() args = parser.parse_args() args.run(args)
koparasy/faultinjection-gem5
refs/heads/master
src/mem/slicc/ast/TransitionDeclAST.py
9
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
elena/django
refs/heads/master
tests/queries/test_q.py
5
from django.db.models import F, Q from django.test import SimpleTestCase class QTests(SimpleTestCase): def test_combine_and_empty(self): q = Q(x=1) self.assertEqual(q & Q(), q) self.assertEqual(Q() & q, q) q = Q(x__in={}.keys()) self.assertEqual(q & Q(), q) self.as...
leafclick/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/mercurial/dispatch.py
91
# dispatch.py - command dispatching for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import os, sys, atexit, signal, pdb, socket, errno, shlex,...
itucsdb1603/itucsdb1603
refs/heads/master
placesB.py
1
import os import json import re import psycopg2 as dbapi2 from flask import Blueprint, render_template from flask import redirect from flask.helpers import url_for from flask import current_app, request from place import Place from placelist import PlaceList from flask import current_app as app from _sqlite3 import Ro...
EdwardMoyse/django-indigorestwrapper
refs/heads/master
indigorestwrapper/apps.py
2
from __future__ import unicode_literals from django.apps import AppConfig class IndigorestwrapperConfig(AppConfig): name = 'indigorestwrapper'
kenshay/ImageScript
refs/heads/master
ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/raw/GLX/OML/sync_control.py
8
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GLX import _types as _cs # End users want this... from OpenGL.raw.GLX._types import * from OpenGL.raw.GLX import _errors from OpenGL.constant import Constant as _C import ctype...
basicthinker/THNVM
refs/heads/master
src/arch/x86/isa/insts/simd64/integer/data_transfer/__init__.py
91
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
nekulin/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/build/gyp/test/actions-subdir/src/make-file.py
489
#!/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 = 'Hello from make-file.py\n' open(sys.argv[1], 'wb').write(contents)
johngian/remo
refs/heads/master
remo/reports/api/serializers.py
3
from rest_framework import serializers from remo.base.helpers import absolutify from remo.events.api.serializers import EventSerializer from remo.profiles.api.serializers import (FunctionalAreaSerializer, UserSerializer) from remo.reports.models import NGReport class Activi...
dmoliveira/networkx
refs/heads/master
networkx/algorithms/connectivity/tests/test_kcutsets.py
43
# Jordi Torrents # Test for k-cutsets from operator import itemgetter from nose.tools import assert_equal, assert_false, assert_true, assert_raises import networkx as nx from networkx.algorithms.connectivity.kcutsets import _is_separating_set from networkx.algorithms.flow import ( edmonds_karp, shortest_augmen...
broferek/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_system_ips_urlfilter_dns.py
21
# Copyright 2019 Fortinet, Inc. # # 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 later version. # # This program is distributed in the...
datalogics-robb/scons
refs/heads/master
src/test_strings.py
2
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
darkwing/kuma
refs/heads/master
vendor/packages/translate/convert/po2xliff.py
25
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2005, 2006 Zuza Software Foundation # # This file is part of translate. # # translate 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 ...
zengenti/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/lambda_facts.py
21
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
ymcagodme/Norwalk-Judo
refs/heads/master
django/contrib/localflavor/no/forms.py
309
""" Norwegian-specific Form helpers """ import re, datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class NOZipCodeField(RegexField): default_error_mes...
gladsonvm/haystackdemo
refs/heads/master
lib/python2.7/site-packages/pip/vendor/distlib/scripts.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. # import logging import os import re import struct import sys from . import DistlibException from .compat import sysconfig, fsencode, detect_en...
jing-bao/pa-chromium
refs/heads/master
tools/json_schema_compiler/PRESUBMIT.py
127
# Copyright (c) 2012 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. """Presubmit script for changes affecting tools/json_schema_compiler/ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for mo...
tempbottle/restcommander
refs/heads/master
play-1.2.4/python/Lib/nntplib.py
156
"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last Group comp.lang.python has 51 articles, rang...
HiroIshikawa/21playground
refs/heads/master
visualizer/_app_boilerplate/venv/lib/python3.5/site-packages/requests/packages/chardet/universaldetector.py
1775
######################## 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...
ghchinoy/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py
25
# 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...
yloiseau/Watson
refs/heads/master
tests/test_watson.py
1
import sys import json import os import datetime try: from unittest import mock except ImportError: import mock try: from io import StringIO except ImportError: from StringIO import StringIO import py import pytest import requests import arrow from dateutil.tz.tz import tzutc from click import get_...
bak1an/django
refs/heads/master
django/contrib/auth/forms.py
15
import unicodedata from django import forms from django.contrib.auth import ( authenticate, get_user_model, password_validation, ) from django.contrib.auth.hashers import ( UNUSABLE_PASSWORD_PREFIX, identify_hasher, ) from django.contrib.auth.models import User from django.contrib.auth.tokens import default_to...
jrrembert/django
refs/heads/master
django/contrib/gis/gdal/srs.py
366
""" The Spatial Reference class, represents 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, AUTHORITY...
renegelinas/mi-instrument
refs/heads/master
mi/idk/platform/switch_driver.py
11
""" @file coi-services/mi/idk/platform/switch_driver.py @author Bill French @brief Main script class for running the switch_driver process """ from os.path import exists, join, isdir from os import listdir from mi.idk.metadata import Metadata from mi.idk.comm_config import CommConfig from mi.idk.config import Config ...
Adward-R/SwayMini
refs/heads/master
lib/python2.7/site-packages/pip/vcs/subversion.py
86
from __future__ import absolute_import import logging import os import re from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.index import Link from pip.utils import rmtree, display_path, call_subprocess from pip.utils.logging import indent_log from pip.vcs import vcs, VersionControl _svn_xml_ur...
MUNDO-platform/srccode
refs/heads/master
ckan-extensions/ckanext-dbstore/ckanext/dbstore/logic/__init__.py
1
__author__="Tomasz Janisiewicz <tomasz.janisiewicz@orange.com>" __date__ ="$2015-02-11 13:06:33$"
nopjmp/SickRage
refs/heads/master
sickbeard/properFinder.py
5
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # Git: https://github.com/SickRage/SickRage.git # # This file is part of SickRage. # # SickRage 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...
nfco/netforce
refs/heads/master
netforce_stock/netforce_stock/models/delivery_slot_capacity.py
4
from netforce.model import Model,fields,get_model class DeliverySlotCapacity(Model): _name="delivery.slot.capacity" _string="Delivery Slot Capacity" _fields={ "slot_id": fields.Many2One("delivery.slot","Delivery Slot",required=True,on_delete="cascade"), "weekday": fields.Selection([["0","Mo...
divyamodi128/django_comments
refs/heads/master
comment/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-06-19 21:02 from __future__ import unicode_literals import comment.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies ...
qrealka/skia-hc
refs/heads/master
tools/test_gpuveto.py
142
#!/usr/bin/env python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script to test out suitableForGpuRasterization (via gpuveto)""" import argparse import glob import os import re import subprocess import sys # Set the PYTHONP...