repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
westinedu/wrgroups
refs/heads/master
django/contrib/sitemaps/tests/urls.py
233
from datetime import datetime from django.conf.urls.defaults import * from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap from django.contrib.auth.models import User class SimpleSitemap(Sitemap): changefreq = "never" priority = 0.5 location = '/location/' lastmod = datetime.now...
guillermooo/dart-sublime-bundle
refs/heads/master
execute.py
3
# Copyright (c) 2014, Guillermo López-Anglada. Please see the AUTHORS file for details. # All rights reserved. Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file.) '''Our own ST `exec` command. Mostly lifted from Default.exec.py ''' import sublime import sublime_plugin...
saukrIppl/seahub
refs/heads/master
thirdpart/openpyxl-2.3.0-py2.7.egg/openpyxl/writer/etree_worksheet.py
13
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl from operator import itemgetter from openpyxl.compat import safe_string from openpyxl.xml.functions import xmlfile, Element, SubElement def get_rows_to_write(worksheet): """Return all rows, and any cells that they contain""" # order c...
mark-ignacio/phantomjs
refs/heads/master
src/breakpad/src/tools/gyp/test/copies/gyptest-all.py
137
#!/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. """ Verifies file copies using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies.gyp', ...
sergiohgz/incubator-airflow
refs/heads/master
airflow/migrations/versions/1b38cef5b76e_add_dagrun.py
9
# -*- coding: utf-8 -*- # # 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 #...
StrikeForceZero/PJSip-CSharp
refs/heads/master
tests/pjsua/scripts-sendto/301_srtp0_recv_savp.py
42
# $Id: 301_srtp0_recv_savp.py 3713 2011-08-18 18:11:08Z nanang $ import inc_sip as sip import inc_sdp as sdp sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=tester c=IN IP4 127.0.0.1 t=0 0 m=audio 4000 RTP/SAVP 0 101 a=rtpmap:0 PCMU/8000 a=sendrecv a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=crypto:1 AES_CM_128_HMA...
imply/chuu
refs/heads/master
third_party/pexpect/ANSI.py
171
"""This implements an ANSI (VT100) terminal emulator as a subclass of screen. PEXPECT LICENSE This license is approved by the OSI and FSF as GPL-compatible. http://opensource.org/licenses/isc-license.txt Copyright (c) 2012, Noah Spurrier <noah@noah.org> PERMISSION TO USE, COPY, MODIFY, AND/OR DIS...
gwu-libraries/sfm-flickr-harvester
refs/heads/master
flickr_exporter.py
1
from sfmutils.exporter import BaseExporter, BaseTable from flickr_warc_iter import FlickrWarcIter, TYPE_FLICKR_PHOTO import logging import time from dateutil.parser import parse as date_parse from dateutil.tz import tzutc log = logging.getLogger(__name__) QUEUE = "flickr_exporter" ROUTING_KEY = "export.start.flickr.f...
tonnosf/mondkalender
refs/heads/master
node_modules/protractor/node_modules/accessibility-developer-tools/scripts/parse_aria_schemas.py
381
import json import re import urllib import xml.etree.ElementTree as ET def parse_attributes(): schema = urllib.urlopen('http://www.w3.org/MarkUp/SCHEMA/aria-attributes-1.xsd') tree = ET.parse(schema) for node in tree.iter(): node.tag = re.sub(r'{.*}', r'', node.tag) type_map = { 'stat...
chokribr/invenio
refs/heads/master
invenio/legacy/bibrank/selfcites_task.py
4
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your optio...
nabilbendafi/script.module.pydevd
refs/heads/master
lib/pydevd_psyco_stub.py
64
''' Psyco stub: should implement all the external API from psyco. ''' def proxy(func, *args, **kwargs): return func def bind(func, *args, **kwargs): return func def unbind(func, *args, **kwargs): return func def unproxy(func, *args, **kwargs): return func def full(*args, **kwarg...
Starefossen/docker-tutorial
refs/heads/master
manage.py
43
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webapp.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Grogdor/CouchPotatoServer
refs/heads/master
libs/chardet/sbcharsetprober.py
2926
######################## 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...
javierder/dogestart.me
refs/heads/master
django/contrib/sitemaps/tests/test_http.py
109
from __future__ import unicode_literals import os from datetime import date from django.conf import settings from django.contrib.sitemaps import Sitemap, GenericSitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test.utils import override_settings ...
Peetz0r/micropython-esp32
refs/heads/dev-bluetooth-plus-deepsleep
tests/basics/dict_clear.py
118
d = {1: 2, 3: 4} print(len(d)) d.clear() print(d) d[2] = 42 print(d)
JeromeO/Pyromaths
refs/heads/master
src/pyromaths/ex/sixiemes/droites.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # # Pyromaths # Un programme en Python qui permet de créer des fiches d'exercices types de # mathématiques niveau collège ainsi que leur corrigé en LaTeX. # Copyright (C) 2006 -- Jérôme Ortais (jerome.ortais@pyromaths.org) # # This program is free software; you can redistribute...
undertherain/benchmarker
refs/heads/master
benchmarker/util/abstractprocess.py
1
import subprocess import tempfile class Process(object): def __init__(self, ptype="local", host="localhost", command=["hostname"]): self.proc = None self.type = ptype self.host = host self.command = command self.__start() def __start(self): self.out_file = temp...
moijes12/treeherder
refs/heads/master
tests/webapp/api/test_utils.py
13
from treeherder.webapp.api.utils import UrlQueryFilter def test_single_filter(): input = { "name": "john", "age__gte": 30, "weight__lt": 80, "gender__in": "male,female" } expected = { 'name': set([('=', 'john')]), 'age': set([('>=', 30)]), 'weight':...
Menooker/gem5_pcm
refs/heads/master
src/dev/mips/Malta.py
45
# 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 ...
KhronosGroup/COLLADA-CTS
refs/heads/master
StandardDataSets/1_5/collada/library_geometries/geometry/mesh/vertices/input/position_texcoord_color/position_texcoord_color.py
4
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ...
ckundo/nvda
refs/heads/master
source/baseObject.py
2
#baseObject.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2006-2007 NVDA Contributors <http://www.nvda-project.org/> #This file is covered by the GNU General Public License. #See the file COPYING for more details. """Contains the base classes that many of NVDA's classes such as NVDAObjects, virtua...
percy-g2/Novathor_xperia_u8500
refs/heads/master
6.2.A.1.100/external/webkit/Tools/Scripts/webkitpy/common/checkout/diff_parser.py
15
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
CodeforHawaii/froide
refs/heads/master
froide/publicbody/migrations/0002_auto_20151127_1754.py
3
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('publicbody', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='jurisdiction', op...
Honry/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_object-src_cross-origin_multi_allowed_two-manual.py
30
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "object-src " + url2 +...
dankilman/clue
refs/heads/master
clue/tests/test_install.py
1
######## # Copyright (c) 2016 GigaSpaces Technologies Ltd. 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...
drjeep/django
refs/heads/master
django/contrib/auth/migrations/0003_alter_user_email_max_length.py
586
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auth', '0002_alter_permission_name_max_length'), ] operations = [ migrations.AlterField( model_name='user', ...
gaziel/heekscnc
refs/heads/master
pycnc/wxPictureWindow.py
25
import wx class PictureWindow(wx.Window): def __init__(self, parent, size = None, bitmap = None):# use either size or bitmap if bitmap != None: wx.Window.__init__(self, parent, size = wx.Size(b2.GetWidth(), b2.GetHeight())) elif size != None: wx.Window.__init__(self, parent,...
yjmade/odoo
refs/heads/8.0
addons/base_vat/__openerp__.py
52
# -*- 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...
mairob/Trafficsign-classification-in-TensorFlow
refs/heads/master
Code/TrafficSign_TF_Network_4.py
1
import numpy as np import tensorflow as tf #Note: this one should give you around 99.1% on an augumented GTSRB image_size = 48 #width = height col_channels = 3 #RGB def initVariable(name, shape): """ Initialize weights and biases based on http://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf ...
jestapinski/oppia
refs/heads/develop
core/domain/collection_domain_test.py
6
# coding: utf-8 # # Copyright 2015 The Oppia 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 requi...
hgomersall/myhdl
refs/heads/master
myhdl/test/conversion/general/test_adapter.py
2
from __future__ import absolute_import import myhdl from myhdl import * @block def adapter(o_err, i_err, o_spec, i_spec): nomatch = Signal(bool(0)) other = Signal(bool(0)) o_err_bits = [] for s in o_spec: if s == 'other': o_err_bits.append(other) elif s == 'nomatch': ...
bencmbrook/home-assistant
refs/heads/master
tests/components/test_demo.py
7
""" tests.test_component_demo ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests demo component. """ import unittest import homeassistant.core as ha import homeassistant.components.demo as demo from tests.common import mock_http_component class TestDemo(unittest.TestCase): """ Test the demo module. """ def setUp(self): #...
keedio/hue
refs/heads/master
desktop/core/ext-py/PyYAML-3.09/tests/lib/test_structure.py
60
import yaml, canonical import pprint def _convert_structure(loader): if loader.check_event(yaml.ScalarEvent): event = loader.get_event() if event.tag or event.anchor or event.value: return True else: return None elif loader.check_event(yaml.SequenceStartEvent): ...
sammyshj/gci
refs/heads/master
modules/geopy/geocoders/bing.py
46
try: import json except ImportError: try: import simplejson as json except ImportError: from django.utils import simplejson as json from urllib import urlencode from urllib2 import urlopen from geopy.geocoders.base import Geocoder from geopy.util import logger, decode_page, join_filter cl...
kushalbhola/MyStuff
refs/heads/master
Practice/PythonApplication/env/Lib/site-packages/pandas/tests/indexing/multiindex/test_datetime.py
3
from datetime import datetime import numpy as np from pandas import Index, Period, Series, period_range def test_multiindex_period_datetime(): # GH4861, using datetime in period of multiindex raises exception idx1 = Index(["a", "a", "a", "b", "b"]) idx2 = period_range("2012-01", periods=len(idx1), freq...
QudevETH/PycQED_py3
refs/heads/qudev_master
examples/pulse_scheme_example.py
2
import matplotlib.pyplot as plt import pycqed.utilities.pulse_scheme as pls import numpy as np # Simple example of how to use the pulse_scheme module cm = 1 / 2.54 # inch to cm conversion fig, ax = pls.new_pulse_fig((7*cm, 3*cm)) # Plot pulses p1 = pls.mwPulse(ax, 0, width=1.5, label='$X_{\\pi/2}$') p2 = pls.ramZP...
ddsc/ddsc-core
refs/heads/master
ddsc_core/migrations/0017_auto__add_field_ipaddress_label2.py
1
# -*- 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 field 'IPAddress.label2' db.add_column(u'ddsc_core_ipaddress', 'label2', self...
Maspear/odoo
refs/heads/8.0
openerp/sql_db.py
168
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
rue89-tech/edx-platform
refs/heads/master
lms/djangoapps/course_structure_api/v0/__init__.py
175
""" Version 0 """
keith-gray-powereng/dnp-modbus-decoder
refs/heads/master
power_decoder/tests.py
1
import unittest from unittest import TestCase from Report import Report import bitstring import BitSlice import DataLinkTranslator import TypeLookup import parseInput class SimpleTest(TestCase): def setUp(self): #do stuff here to setup tests #POC does not require a standard setup pass ...
conan747/fallen-heaven
refs/heads/master
scripts/tactic_world.py
1
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2013 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
voxmedia/thumbor
refs/heads/master
thumbor/filters/strip_icc.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.filters import BaseFilter, filter_method class Filter...
harvard-dce/dce_lti_py
refs/heads/master
dce_lti_py/launch_params.py
2
import sys from collections import defaultdict, MutableMapping from dce_lti_py import DEFAULT_LTI_VERSION py = sys.version_info if py < (2, 6, 0): bytes=str def touni(s, enc='utf8', err='strict'): return s.decode(enc, err) if isinstance(s, bytes) else unicode(s) LAUNCH_PARAMS_REQUIRED = [ 'lti_message_t...
ruediger/gcc-python-plugin
refs/heads/cpp
tests/cpychecker/refcounts/attributes/returns-borrowed-ref/correct-usage/script.py
206
# -*- coding: utf-8 -*- # Copyright 2011 David Malcolm <dmalcolm@redhat.com> # Copyright 2011 Red Hat, Inc. # # This 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, o...
rholy/dnf
refs/heads/master
tests/cli/commands/test_clean.py
10
# Copyright (C) 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be u...
abhishekgahlot/or-tools
refs/heads/master
examples/python/sicherman_dice.py
34
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
gugarosa/app_h
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
1407
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
ralic/wireshark
refs/heads/master
tools/dftestlib/ipv4.py
40
# Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # Th...
bhanvadia/lge-mako-kernel
refs/heads/kitkat
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
ajduncan/granolacms
refs/heads/master
fckeditor/editor/filemanager/connectors/py/fckcommands.py
93
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2008 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http:...
amyvmiwei/kbengine
refs/heads/master
kbe/src/lib/python/Modules/_ctypes/libffi/generate-ios-source-and-headers.py
183
#!/usr/bin/env python import subprocess import re import os import errno import collections import sys class Platform(object): pass sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)') def sdkinfo(sdkname): ret = {} for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PI...
40223226/2015cd_midterm2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/importlib/__init__.py
610
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirectly). Since...
JaySon-Huang/misc
refs/heads/master
leetoj/171.py
1
# Excel Sheet Column Number # https://leetcode.com/problemset/algorithms/ class Solution(object): def titleToNumber(self, s): """ :type s: str :rtype: int """ front_char_ord = ord('A') -1 num = 0 for ch in s: num *= 26 num += ord(ch) -...
BlackSynder/SelfBot
refs/heads/master
Cogs/google.py
2
from urllib.parse import quote as uriquote import discord from discord.ext import commands from lxml import etree class Google: def __init__(self, bot): self.bot = bot def parse_google_card(self, node): e = discord.Embed(colour=discord.Colour.blurple()) # check if it's...
cuspaceflight/firefish
refs/heads/master
test/test_kinematics.py
1
import firefish.kinematics as kine import pytest @pytest.fixture def kilogram_point_mass(): return kine.KinematicBody(1, [1, 1, 1]) def test_kinematics_vert(): dur = 10 dt = 0.1 g = 10 F = [0,0,20] sim = kine.KinematicSimulation(kilogram_point_mass(), g, dur, dt) while sim.tIndex*dt <= du...
sam-tsai/django
refs/heads/master
tests/template_tests/filter_tests/test_make_list.py
345
from django.template.defaultfilters import make_list from django.test import SimpleTestCase from django.test.utils import str_prefix from django.utils.safestring import mark_safe from ..utils import setup class MakeListTests(SimpleTestCase): """ The make_list filter can destroy existing escaping, so the resu...
samuelcolvin/aiohttp-devtools
refs/heads/master
tests/test_runserver_logs.py
1
import json import logging import re import sys from unittest.mock import MagicMock import pytest from aiohttp_devtools.logs import AccessFormatter, DefaultFormatter from aiohttp_devtools.runserver.log_handlers import AccessLogger, AuxAccessLogger, parse_body def test_aiohttp_std(): info = MagicMock() logge...
dresden-weekly/ansible
refs/heads/release1.9.1-clean
plugins/inventory/consul_io.py
11
#!/usr/bin/env python # # (c) 2015, Steve Gargan <steve.gargan@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 # (a...
o5k/openerp-oemedical-v0.1
refs/heads/master
openerp/addons/hr_expense/report/hr_expense_report.py
52
# -*- 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...
staute/shinken-mod-livestatus
refs/heads/master
module/livestatus_query_error.py
3
class LiveStatusQueryError(Exception): messages = { 200: 'OK', 404: 'Invalid GET request, no such table \'%s\'', 450: 'Invalid GET request, no such column \'%s\'', 452: 'Completely invalid GET request \'%s\'', 500: 'Internal server error: %r', }
v0i0/lammps
refs/heads/master
tools/i-pi/ipi/tests/test_io.py
41
"""Deals with testing the io system. Copyright (C) 2013, Joshua More and Michele Ceriotti 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 lat...
Distrotech/scons
refs/heads/distrotech-scons
test/CC/SHCCCOMSTR.py
5
#!/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, ...
Juniper/python-neutronclient
refs/heads/master
neutronclient/tests/unit/test_cli20_rbac.py
4
# Copyright 2015 Huawei Technologies India Pvt Ltd. # 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 # # ...
robcarver17/pysystemtrade
refs/heads/master
sysdata/mongodb/mongo_generic.py
1
from copy import copy from datetime import date, time from syscore.objects import arg_not_supplied, missingData, existingData, missing_data from sysdata.mongodb.mongo_connection import ( mongoConnection, MONGO_ID_KEY, mongo_clean_ints, clean_mongo_host ) class mongoDataWithSingleKey(object): """ ...
osh/gnuradio
refs/heads/master
volk/gen/volk_kernel_defs.py
32
# # Copyright 2011-2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version...
havatv/QGIS
refs/heads/master
tests/src/python/test_provider_db2.py
45
# -*- coding: utf-8 -*- """QGIS Unit tests for the DB2 provider. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ ...
ztemt/V5s_N918St_KitKat_kernel
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
wathen/PhD
refs/heads/master
MHD/FEniCS/DGLaplacian/DGLaplacian.py
1
from dolfin import * import ipdb import numpy as np import matplotlib.pylab as plt m =9 err = np.zeros((m-1,1)) N = np.zeros((m-1,1)) errh1 = np.zeros((m-1,1)) nn = 2 for xx in xrange(1,m): # Create mesh and define function space n = 2**xx N[xx-1] = n mesh = UnitSquareMesh(n,n) tic() V = Func...
reinbach/django-machina
refs/heads/master
machina/apps/forum_search/app.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from haystack.views import search_view_factory from machina.core.app import Application from machina.core.loading import get_class class SearchApp(Application): name = 'forum_search' search_view = get_class('f...
raphaelrieuhelft/KPHP
refs/heads/master
src/scripts/remove-trace.py
4
#!/usr/bin/python import re import sys import os import shutil # arg 1: folder folder = sys.argv[1] # arg 2: extension for backup backup_extension = sys.argv[2] # list of files to be processed. files = os.listdir(folder) # iterate throught all the files in the directory for file in files: # we ignore directories for...
antar2801/namebench
refs/heads/master
nb_third_party/dns/rdtypes/ANY/HINFO.py
248
# Copyright (C) 2003-2007, 2009, 2010 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 ...
mrquim/mrquimrepo
refs/heads/master
script.module.youtube.dl/lib/youtube_dl/extractor/audimedia.py
67
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, sanitized_Request, ) class AudiMediaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?audi-mediacenter\.com/(?:en|de)/audimediatv/(?P<id>[^/?#]+)' _TEST =...
mosbasik/buzhug
refs/heads/master
javasrc/lib/Jython/Lib/encodings/cp1026.py
593
""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.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,inp...
proxysh/Safejumper-for-Mac
refs/heads/master
buildmac/Resources/env/lib/python2.7/site-packages/wheel/test/test_keys.py
565
import tempfile import os.path import unittest import json from wheel.signatures import keys wheel_json = """ { "verifiers": [ { "scope": "+", "vk": "bp-bjK2fFgtA-8DhKKAAPm9-eAZcX_u03oBv2RlKOBc" }, { "scope": "+", "vk": "KAHZBfyqFW3OcFDbLSG4nPCjXxUPy72phP9I4Rn9MAo" }, ...
agry/NGECore2
refs/heads/master
scripts/object/tangible/quest/gravestone_shmi.py
85615
import sys def setup(core, object): return
IKholopov/HackUPC2017
refs/heads/master
hackupc/env/lib/python3.5/site-packages/wheel/wininst2wheel.py
93
#!/usr/bin/env python import os.path import re import sys import tempfile import zipfile import wheel.bdist_wheel import distutils.dist from distutils.archive_util import make_archive from shutil import rmtree from wheel.archive import archive_wheelfile from argparse import ArgumentParser from glob import iglob egg_in...
tobikausk/nest-simulator
refs/heads/master
doc/copyright_header.py
52
# -*- coding: utf-8 -*- # # {{file_name}} # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
brianwoo/django-tutorial
refs/heads/master
ENV/lib/python2.7/site-packages/django/core/management/base.py
19
# -*- coding: utf-8 -*- """ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys import warnings from argparse import ArgumentParser from optparse import OptionParser import djan...
neerja28/Tempest
refs/heads/master
tempest/api/orchestration/stacks/test_volumes.py
11
# 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 in writing, software # d...
JY-Zhou/FreePSI
refs/heads/master
scripts/computePsiFromFreePSI.py
1
import json import math import numpy as np import scipy.spatial.distance as dis import scipy.cluster.hierarchy as hac import scipy.stats as stats import sys inFile = open(sys.argv[1], 'r') outFile = open(sys.argv[2], 'w') psi = json.load(inFile) newPsi = [[0.0 for e in range(len(psi[g]))] for g in range(len(psi))] kl...
mixman/djangodev
refs/heads/master
tests/modeltests/proxy_models/tests.py
1
from __future__ import absolute_import from django.contrib.contenttypes.models import ContentType from django.core import management from django.core.exceptions import FieldError from django.db import models, DEFAULT_DB_ALIAS from django.db.models import signals from django.test import TestCase from .models import (...
metabrainz/picard
refs/heads/master
picard/util/xml.py
3
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2007 Lukáš Lalinský # Copyright (C) 2009 Carlin Mangar # Copyright (C) 2017 Sambhav Kothari # Copyright (C) 2018, 2020 Laurent Monin # Copyright (C) 2019 Philipp Wolfer # # This program is free software; you can redistribute it...
atdt/gerrit
refs/heads/master
contrib/trivial_rebase.py
7
#!/usr/bin/env python2.6 # Copyright (c) 2010, Code Aurora Forum. 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 # not...
amounir86/amounir86-2011-elections
refs/heads/master
voter-info/shapes/dbfUtils.py
18
#!/usr/bin/env python # dbfUtils.py # By Raymond Hettinger # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715 import struct, datetime, decimal, itertools def dbfreader(f): """Returns an iterator over records in a Xbase DBF file. The first row returned contains the field names. The second row contai...
seem-sky/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/shelve.py
83
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
mitocw/edx-platform
refs/heads/master
common/djangoapps/third_party_auth/tests/specs/test_testshib.py
1
""" Third_party_auth integration tests using a mock version of the TestShib provider """ import datetime import json import logging import os import unittest from unittest import skip import ddt import httpretty from django.conf import settings from django.contrib import auth from freezegun import freeze_time from m...
bobobox/ansible
refs/heads/devel
lib/ansible/modules/packaging/language/npm.py
16
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chris Hoffman <christopher.hoffman@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 ...
beatrizChagas/scrm-solutions
refs/heads/master
extracao/processamentoEmoji/emoji-master/emoji/core.py
1
# -*- coding: UTF-8 -*- """ emoji.core ~~~~~~~~~~ Core components for emoji. """ import re import sys from emoji import unicode_codes __all__ = ['emojize', 'demojize', 'get_emoji_regexp'] PY2 = sys.version_info[0] is 2 _EMOJI_REGEXP = None def emojize(string, use_aliases=False): """Replace emoji name...
dannybrowne86/django-bootstrap-calendar
refs/heads/master
django_bootstrap_calendar/__init__.py
143
__version__ = '0.1.0'
grimoirelab/GrimoireELK
refs/heads/master
utils/gh2arthur.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 l...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/draft_schematic/space/weapon/missile/shared_countermeasure_confuser_launcher.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/space/weapon/missile/shared_countermeasure_confuser_launche...
willrogerpereira/willbuyer
refs/heads/master
willstores/willstores/errors/nocontent_error.py
1
from willstores.errors import Error class NoContentError(Error): def __init__(self, message): self.__message = message def __str__(self): return self.__message
cshallue/models
refs/heads/master
research/slim/nets/inception_v1.py
3
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
ApuliaSoftware/multi_carrier
refs/heads/master
account/account.py
1
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Andre@ (<a.gallina@cgsoftware.it>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
quinot/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_wait.py
23
#!/usr/bin/python # -*- 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
GitAngel/django
refs/heads/master
tests/migrations/test_migrations_run_before/0003_third.py
427
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): """ This is a wee bit crazy, but it's just to show that run_before works. """ dependencies = [ ("migrations", "0001_initial"), ] run_before...
djrobstep/schemainspect
refs/heads/master
schemainspect/pg/obj.py
1
from __future__ import absolute_import, division, print_function, unicode_literals import inspect import sys from collections import OrderedDict as od from itertools import groupby from sqlalchemy import text from ..inspected import ColumnInfo, Inspected from ..inspected import InspectedSelectable as BaseInspectedSe...
dwadler/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py
1
# -*- coding: utf-8 -*- """ *************************************************************************** Grass7AlgorithmProvider.py --------------------- Date : April 2014 Copyright : (C) 2014 by Victor Olaya Email : volayaf at gmail dot com ****************...
BaladiDogGames/baladidoggames.github.io
refs/heads/master
mingw/bin/lib/lib2to3/fixes/fix_operator.py
326
"""Fixer for operator functions. operator.isCallable(obj) -> hasattr(obj, '__call__') operator.sequenceIncludes(obj) -> operator.contains(obj) operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence) operator.isMappingType(obj) -> isinstance(obj, collections.Mapping) operator.isNumberType(obj) ...
ubiar/odoo
refs/heads/8.0
addons/website_forum_doc/controllers/__init__.py
4497
# -*- coding: utf-8 -*- import main