repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
ibinti/intellij-community
python/helpers/pycharm/_jb_runner_tools.py
2
14537
# coding=utf-8 """ Tools to implement runners (https://confluence.jetbrains.com/display/~link/PyCharm+test+runners+protocol) """ import atexit import _jb_utils import os import re import sys from teamcity import teamcity_presence_env_var, messages # Some runners need it to "detect" TC and start protocol if teamcity_p...
apache-2.0
imsparsh/python-for-android
python-modules/twisted/twisted/web/wsgi.py
52
14117
# Copyright (c) 2008-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ An implementation of U{Web Resource Gateway Interface<http://www.python.org/dev/peps/pep-0333/>}. """ __metaclass__ = type from sys import exc_info from zope.interface import implements from twisted.python.log import msg, err fro...
apache-2.0
vimagick/youtube-dl
youtube_dl/extractor/helsinki.py
165
1360
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .common import InfoExtractor from ..utils import js_to_json class HelsinkiIE(InfoExtractor): IE_DESC = 'helsinki.fi' _VALID_URL = r'https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)' _TEST = { 'url': 'http://video...
unlicense
mooflu/iTerm2
tests/esctest/tests/decrqm.py
31
13222
from esc import NUL import escargs import esccmd import escio import esclog from escutil import AssertEQ, AssertScreenCharsInRectEqual, GetScreenSize, knownBug, optionRequired, vtLevel from esctypes import Point, Rect class DECRQMTests(object): """DECANM is not tested because there doesn't seem to be any way to ex...
gpl-2.0
Philippe12/external_chromium_org
tools/valgrind/memcheck/PRESUBMIT.py
77
3224
# Copyright (c) 2011 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. """ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API built into gcl. """ import re def...
bsd-3-clause
hfp/tensorflow-xsmm
tensorflow/contrib/image/python/ops/interpolate_spline.py
19
11651
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
rob-smallshire/asq
asq/test/test_single.py
1
1353
import unittest from asq.queryables import Queryable __author__ = "Sixty North" class TestSingle(unittest.TestCase): def test_single(self): a = [5] b = Queryable(a).single() self.assertEqual(b, 5) def test_single_empty(self): a = [] self.assertRaises(ValueError, lambd...
mit
muratcansahin/itucsdb1626
foodle/controllers/post_comments_controller.py
1
3956
#!/usr/bin/env python3 import foodle import psycopg2 from psycopg2.extras import DictCursor from flask import Blueprint, render_template, current_app, request, redirect, make_response, g from foodle.utils.auth_hook import auth_hook_functor post_comments_controller = Blueprint('post_comments_controller', __name__) @po...
gpl-3.0
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_0_96/django/test/testcases.py
32
2036
import re, doctest, unittest from django.db import transaction from django.core import management from django.db.models import get_apps normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s) class OutputChecker(doctest.OutputChecker): def check_output(self, want, got, optionflags): ...
apache-2.0
chirilo/mozillians
vendor-local/lib/python/unidecode/x010.py
252
4110
data = ( 'k', # 0x00 'kh', # 0x01 'g', # 0x02 'gh', # 0x03 'ng', # 0x04 'c', # 0x05 'ch', # 0x06 'j', # 0x07 'jh', # 0x08 'ny', # 0x09 'nny', # 0x0a 'tt', # 0x0b 'tth', # 0x0c 'dd', # 0x0d 'ddh', # 0x0e 'nn', # 0x0f 'tt', # 0x10 'th', # 0x11 'd', # 0x12 'dh', ...
bsd-3-clause
StackStorm/python-mistralclient
mistralclient/tests/unit/v2/test_cli_actions.py
1
6033
# Copyright 2014 Mirantis, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
MAKOSCAFEE/oppia
core/domain/user_jobs_one_off_test.py
3
49652
# coding: utf-8 # # Copyright 2014 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...
apache-2.0
darkryder/django
django/contrib/contenttypes/fields.py
49
26120
from __future__ import unicode_literals from collections import defaultdict from django.contrib.contenttypes.models import ContentType from django.core import checks from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, models, router, transaction from django...
bsd-3-clause
lfblogs/aiopy
aiopy/required/aiohttp/protocol.py
1
27699
"""Http related parsers and protocol.""" import collections import functools import http.server import itertools import re import string import sys import zlib from wsgiref.handlers import format_date_time from aiopy.required import aiohttp from aiopy.required.aiohttp import hdrs, errors from .multidict import CIMul...
gpl-3.0
catmaid/catpy
tests/test_catmaid_client_application.py
1
1603
from __future__ import absolute_import try: import mock except ImportError: from unittest import mock import pytest from catpy.client import CatmaidClient from catpy.applications.base import CatmaidClientApplication PROJECT_ID = 10 BASE_URL = "http://not-catmaid.org" @pytest.fixture def catmaid_mock(): ...
mit
devsar/ae-people
apps/stats/views.py
1
1376
""" Stats views """ from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.shortcuts import render_to_response from django.template import RequestContext from django.utils import simplejson from django.utils.trans...
apache-2.0
BIT-SYS/gem5-spm-module
src/mem/cache/prefetch/Prefetcher.py
10
3558
# Copyright (c) 2012 ARM Limited # 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 implementation of the functionality ...
bsd-3-clause
ryanbauman/pybombs
app_store.py
6
6805
#!/usr/bin/env python2 # # Copyright 2013 Tim O'Shea # # This file is part of PyBOMBS # # PyBOMBS 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. # # ...
gpl-3.0
dc3-plaso/plaso
tests/engine/engine.py
1
4086
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests the engine.""" import unittest try: from guppy import hpy except ImportError: hpy = None from dfvfs.helpers import fake_file_system_builder from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.path import factory as path_spec_factory from dfvfs.path...
apache-2.0
svensaeger/Hatschi
wetterstation2.py
1
1364
from tkinter import * import serial import time def ausgeben(daten): datenEinzeln = daten.split() root = Tk() root.attributes("-fullscreen", True) root.config(bg = "light green") frameo = Frame(root) frameu = Frame(root, bg = "light green") temp = "0" luftfeu = "0" luftdruck = "0" gas = "0" regen = "0"...
gpl-3.0
MrHamdulay/daily-problems
yaseen/problem-3-binary-search.py
1
1162
class Node: def __init__(self, value): self.value = float(value) self.parent = None self.children = [] def addChild(self, child): self.children.append(child) def __repr__(self): return '<value: %s children: (%s)>' % (self.value, len(self.children)) @property def right(self): return...
mit
mozvip/CouchPotatoServer
libs/html5lib/treebuilders/simpletree.py
100
7480
import _base from html5lib.constants import voidElements, namespaces, prefixes from xml.sax.saxutils import escape # Really crappy basic implementation of a DOM-core like thing class Node(_base.Node): type = -1 def __init__(self, name): self.name = name self.parent = None self.value = N...
gpl-3.0
rogerscristo/BotFWD
env/lib/python3.6/site-packages/future/backports/urllib/parse.py
69
35794
""" Ported using Python-Future from the Python 3.3 standard library. Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6...
mit
dagnir/servo
tests/wpt/web-platform-tests/webdriver/base_test.py
58
1398
import ConfigParser import json import os import sys import unittest from network import get_lan_ip repo_root = os.path.abspath(os.path.join(__file__, "../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver")) sys.path.insert(1, os.path.join(repo_root, "tools", "wptserve")) from wptserve import serve...
mpl-2.0
TomHeatwole/osf.io
scripts/migrate_names_cleanup.py
54
3659
#!/usr/bin/env python # encoding: utf-8 """Migrate user name fields Run dry run: python -m scripts.migrate_names_cleanup dry Run migration: python -m scripts.migrate_names_cleanup Log: Run by sloria on 2015-02-17. A log was saved to /opt/data/migration-logs. """ import sys import logging from modularodm import Q fr...
apache-2.0
insiderr/insiderr-app
ios-patches/basemodules/twisted/protocols/wire.py
63
2359
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Implement standard (and unused) TCP protocols. These protocols are either provided by inetd, or are not provided at all. """ # system imports import time, struct from zope.interface import implements # twisted import from twisted.internet im...
gpl-3.0
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/keras/constraints.py
11
4002
from __future__ import absolute_import from . import backend as K class Constraint(object): def __call__(self, p): return p def get_config(self): return {'name': self.__class__.__name__} class MaxNorm(Constraint): '''Constrain the weights incident to each hidden unit to have a norm less...
mit
DroidThug/kernel_delta_msm8916
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
beihaiguaishou/HackRunningGo-SC
HaRunGo.py
1
10445
import fileinput import requests import json import base64 import random import datetime import re import time import hashlib from Phone import * import uuid import codecs # Globle Var file1 = open('route.data') routes = file1.readlines() file1.close() file2 = codecs.open('tp.data', 'r', 'utf-8') tps = file2.readline...
mit
insomnia-lab/calibre
src/calibre/ebooks/tweak.py
7
5025
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, os...
gpl-3.0
Bysmyyr/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/route53/test_zone.py
100
7729
# Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # 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 re...
bsd-3-clause
kstrauser/ansible
lib/ansible/utils/color.py
167
3134
# (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...
gpl-3.0
2ndQuadrant/ansible
lib/ansible/modules/windows/win_hostname.py
52
1319
#!/usr/bin/python # -*- coding: utf-8 -*- # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name # Copyright: (c) 2018, Ripon Banik (@riponbanik) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version'...
gpl-3.0
titasakgm/brc-stock
openerp/addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/contrib/auth/tokens.py
17
2371
from datetime import date from django.conf import settings from django.utils.http import int_to_base36, base36_to_int class PasswordResetTokenGenerator(object): """ Stratgy object used to generate and check tokens for the password reset mechanism. """ def make_token(self, user): """ ...
agpl-3.0
40123247/w17
static/Brython3.1.0-20150301-090019/Lib/ui/dialog.py
607
4994
from . import widget from browser import html, document class Dialog(widget.DraggableWidget): def __init__(self, id=None): self._div_shell=html.DIV( Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable", style={'position': 'absolute', 'height': 'auto',...
gpl-3.0
collinjackson/mojo
tools/valgrind/browser_wrapper_win.py
76
1632
# Copyright (c) 2011 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. import glob import os import re import sys import subprocess # TODO(timurrrr): we may use it on POSIX too to avoid code duplication once we # support la...
bsd-3-clause
medelin/bearcoin
contrib/testgen/base58.py
4
2833
''' Nautiluscoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return...
mit
wiltonlazary/arangodb
3rdParty/V8/V8-5.0.71.39/tools/clang/scripts/run_tool.py
10
11655
#!/usr/bin/env python # Copyright (c) 2013 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. """Wrapper script to help run clang tools across Chromium code. How to use this tool: If you want to run the tool across all Chromi...
apache-2.0
leeseuljeong/leeseulstack_neutron
neutron/tests/unit/test_api_v2_resource.py
2
14852
# Copyright (c) 2012 Intel Corporation. # 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 re...
apache-2.0
Joel-U/sparkle
sparkle/gui/main_control_form.py
2
53245
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'c:/Users/Joel/Documents/sparkle/sparkle/gui/main_control.ui' # # Created: Fri Aug 14 15:04:02 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: ...
gpl-3.0
wangjiaxi/django-dynamic-forms
dynamic_forms/models.py
2
8474
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json from collections import OrderedDict from django.core.urlresolvers import reverse from django.db import models from django.db.transaction import atomic from django.template.defaultfilters import slugify from django.utils.crypto import get_rand...
bsd-3-clause
raisul2010/samurai-kernel
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
nfvs/flask-security
flask_security/datastore.py
4
15322
# -*- coding: utf-8 -*- """ flask_security.datastore ~~~~~~~~~~~~~~~~~~~~~~~~ This module contains an user datastore classes. :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ from .utils import get_identity_attributes, string_types class Datastore(object): ...
mit
godfather1103/WeiboRobot
python27/1.0/lib/encodings/cp1256.py
593
13070
""" Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.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...
gpl-3.0
google/makani
config/m600/tether.py
1
1922
# Copyright 2020 Makani Technologies 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 agreed to...
apache-2.0
benbox69/pyload
module/plugins/hoster/SmoozedCom.py
12
2392
# -*- coding: utf-8 -*- from module.common.json_layer import json_loads from module.plugins.internal.MultiHoster import MultiHoster class SmoozedCom(MultiHoster): __name__ = "SmoozedCom" __type__ = "hoster" __version__ = "0.08" __status__ = "testing" __pattern__ = r'^unmatchable$' #: Sin...
gpl-3.0
fenceFoil/canopto
tween_test_pygame.py
1
4093
#!/usr/bin/python # M.E.Farmer 2013 # demo for tween library # showing integration with PyGame # moves text from random points using various tweens # changes from random color to random color using the same tween # Mouse click rotates through tweens and ESC closes demo import sys import pygame import random import twee...
bsd-3-clause
scottcunningham/ansible
test/units/parsing/test_splitter.py
204
4425
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o...
gpl-3.0
F4k/android_kernel_samsung_msm8930-common
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
crobby/sahara
sahara/tests/unit/utils/test_neutron.py
5
3171
# Copyright (c) 2013 Hortonworks, 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 or agreed to in ...
apache-2.0
haddocking/haddocking.github.io
_utilities/update-publications.py
5
3075
#!/usr/bin/env python """ Downloads Alexandre's pub list from his website. Converts the HTML to markdown. """ import urllib2 import re year_re = re.compile('\(\d\d\d\d\)') BOSS_URL = 'http://www.nmr.chem.uu.nl/~abonvin/publications.html' # boss_page = urllib2.urlopen(BOSS_URL) boss_page = open('bonvin-pubs.html') b...
mit
gangadharkadam/saloon_erp
erpnext/setup/doctype/company/company.py
3
9857
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, os from frappe import _ from frappe.utils import cint import frappe.defaults from frappe.model.document import Document class Company...
agpl-3.0
alexakarpov/python-practice
primes.py
1
1815
#!/usr/bin/env python3 from math import sqrt, ceil import unittest DEFAULT_NUM_OF_PRIMES = 10 def get_n_primes(n=DEFAULT_NUM_OF_PRIMES): def is_prime(num): if num == 1 or num == 2: return True for i in range(2, ceil(sqrt(num))+1): if num % i == 0: return ...
mit
ltilve/ChromiumGStreamerBackend
tools/telemetry/telemetry/web_perf/metrics/rendering_stats_unittest.py
9
21628
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import random import unittest from telemetry.timeline import async_slice from telemetry.timeline import bounds from telemetry.timeline import model from tel...
bsd-3-clause
bingosummer/azure-linux-extensions
CustomScript/azure/storage/sharedaccesssignature.py
46
8809
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apac...
apache-2.0
sanjeevtripurari/hue
desktop/core/ext-py/PyYAML-3.09/lib/yaml/nodes.py
985
1440
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
apache-2.0
LifeDJIK/S.H.I.V.A.
containers/shiva/hazelcast/protocol/codec/map_execute_with_predicate_codec.py
2
1578
from hazelcast.serialization.bits import * from hazelcast.protocol.client_message import ClientMessage from hazelcast.protocol.custom_codec import * from hazelcast.util import ImmutableLazyDataList from hazelcast.protocol.codec.map_message_type import * REQUEST_TYPE = MAP_EXECUTEWITHPREDICATE RESPONSE_TYPE = 117 RETRY...
mit
MerlinZhang/osf.io
framework/auth/exceptions.py
35
1985
from framework.exceptions import FrameworkError from website import language class AuthError(FrameworkError): """Base class for auth-related errors.""" pass class ChangePasswordError(AuthError): """Raised if a change password is called with invalid data. """ def __init__(self, message): ...
apache-2.0
mfazliazran/raft
widgets/MiniResponseRenderWidget.py
11
5721
# # Author: Gregory Fleischer (gfleischer@gmail.com) # Nathan Hamiel # # Copyright (c) 2011 RAFT Team # # This file is part of RAFT. # # RAFT 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 vers...
gpl-3.0
morelab/weblabdeusto
server/src/weblab/db/upgrade/regular/versions/4c23f9943036_first.py
3
2534
from __future__ import print_function, unicode_literals """First version Revision ID: 4c23f9943036 Revises: None Create Date: 2013-04-18 12:37:52.535777 Apply all the changes added since 3.9.0, if they were not already applied. """ # revision identifiers, used by Alembic. revision = '4c23f9943036' down_revision = No...
bsd-2-clause
pyqt/maya2015-qt4
PyQt4/uic/Compiler/qtproxies.py
11
15010
############################################################################# ## ## Copyright (C) 2012 Riverbank Computing Limited. ## Copyright (C) 2006 Thorsten Marek. ## All right reserved. ## ## This file is part of PyQt. ## ## You may use this file under the terms of the GPL v2 or the revised BSD ## license as fol...
gpl-3.0
tiborsimko/zenodo
zenodo/factory.py
2
4550
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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 v...
gpl-2.0
ianjuma/ubuntu-git-notify
app/github-notif.py
1
2513
#!/usr/bin/python import sys import pynotify capabilities = {'actions': False, 'body': False, 'body-hyperlinks': False, 'body-images': False, 'body-markup': False, 'icon-multi': False, 'icon-static': False, 'sound': False, 'image/svg+xml': False, ...
mit
blaiseli/p4-phylogenetics
p4/tree_optsim.py
1
19918
import sys import string import types import cStringIO import math import copy import os import func import time import glob from var import var from p4exceptions import P4Error from node import Node, NodeBranch, NodePart, NodeBranchPart import nexustoken from distancematrix import DistanceMatrix import numpy import p...
gpl-2.0
Distrotech/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/fr/forms.py
309
1747
""" FR-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re phone_digits_re = re.com...
apache-2.0
mihailignatenko/erp
openerp/report/print_fnc.py
458
1318
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
tracierenea/gnuradio
docs/sphinx/hieroglyph/hieroglyph.py
72
12634
from __future__ import print_function import re from errors import HieroglyphError from nodes import (Node, Raises, Except, Note, Warning, Returns, Arg, ensure_terminal_blank) __author__ = 'Robert Smallshire' def parse_hieroglyph_text(lines): '''Parse text in hieroglyph format and return a re...
gpl-3.0
jkettleb/iris
lib/iris/aux_factory.py
1
70417
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris 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 l...
lgpl-3.0
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/test/test_linecache.py
96
4079
""" Tests for the linecache module """ import linecache import unittest import os.path from test import test_support as support FILENAME = linecache.__file__ INVALID_NAME = '!@$)(!@#_1' EMPTY = '' TESTS = 'inspect_fodder inspect_fodder2 mapping_tests' TESTS = TESTS.split() TEST_PATH = os.path.dirname(support.__file_...
gpl-2.0
hirobert/svgwrite
svgwrite/utils.py
1
6106
#!/usr/bin/env python #coding:utf-8 # Author: mozman # Purpose: svg util functions and classes # Created: 08.09.2010 # Copyright (C) 2010, Manfred Moitzi # License: GPLv3 """ .. autofunction:: rgb .. autofunction:: iterflatlist .. autofunction:: strlist .. autofunction:: get_unit .. autofunction:...
gpl-3.0
AlvinPH/StockTool
StockTool/core.py
1
7480
from . import helpers import pandas as pd import numpy as np from pandas import DataFrame, Series from pandas_datareader import data from datetime import datetime, timedelta import re import os import requests import time class StockInfo(): def __init__(self, StockNumber): if isinstance(StockNumber, str)...
bsd-2-clause
dtroyer/python-openstacksdk
openstack/tests/unit/clustering/v1/test_event.py
1
2273
# 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 # distributed under t...
apache-2.0
HousekeepLtd/django
tests/test_client/tests.py
71
31030
# -*- coding: utf-8 -*- """ Testing using the Test Client The test client is a class that can act like a simple browser for testing purposes. It allows the user to compose GET and POST requests, and obtain the response that the server gave to those requests. The server Response objects are annotated with the details ...
bsd-3-clause
ephoning/heroku-buildpack-python
vendor/pip-1.3.1/pip/commands/__init__.py
63
2137
""" Package containing all pip commands """ from pip.commands.bundle import BundleCommand from pip.commands.completion import CompletionCommand from pip.commands.freeze import FreezeCommand from pip.commands.help import HelpCommand from pip.commands.list import ListCommand from pip.commands.search import SearchComman...
mit
rtrigoso/somepolymath
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/shell.py
287
15340
# -*- coding: utf-8 -*- """ pygments.lexers.shell ~~~~~~~~~~~~~~~~~~~~~ Lexers for various shells. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu...
mit
codeskyblue/AutomatorX
atx/ext/chromedriver.py
3
2585
#!/usr/bin/env python # -*- coding: utf-8 -*- # # extension for https://sites.google.com/a/chromium.org/chromedriver/ # Experimental, maybe change in the future # Created by <hzsunshx> 2017-01-20 from __future__ import absolute_import import atexit import six from selenium import webdriver if six.PY3:...
apache-2.0
pambot/SMSQuery
lib/jinja2/testsuite/lexnparse.py
402
22314
# -*- coding: utf-8 -*- """ jinja2.testsuite.lexnparse ~~~~~~~~~~~~~~~~~~~~~~~~~~ All the unittests regarding lexing, parsing and syntax. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja...
gpl-2.0
MoritzS/django
django/core/mail/backends/base.py
129
1660
"""Base email backend class.""" class BaseEmailBackend: """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). open() and close() can be called indirectly by using a backend object as a context manager: with backend as connection: ...
bsd-3-clause
CVML/scikit-learn
examples/linear_model/plot_sparse_recovery.py
243
7461
""" ============================================================ Sparse recovery: feature selection for sparse linear models ============================================================ Given a small number of observations, we want to recover which features of X are relevant to explain y. For this :ref:`sparse linear ...
bsd-3-clause
yavuzovski/playground
python/django/RESTTest/.venv/lib/python3.4/site-packages/django/contrib/gis/db/models/query.py
46
32490
import warnings from django.contrib.gis.db.models.fields import ( GeometryField, LineStringField, PointField, get_srid_info, ) from django.contrib.gis.db.models.lookups import GISLookup from django.contrib.gis.db.models.sql import ( AreaField, DistanceField, GeomField, GMLField, ) from django.contrib.gis.geome...
gpl-3.0
vaygr/ansible
lib/ansible/modules/windows/win_get_url.py
11
4502
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, and others # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_...
gpl-3.0
wendykan/Metrics
Python/ml_metrics/test/test_edit_distance.py
8
1809
#! /usr/bin/env python2.7 from __future__ import division import unittest import ml_metrics as metrics class TestEditDistance(unittest.TestCase): def test_levenshtein(self): self.assertEqual(metrics.levenshtein("intention", "execution"), 5) self.assertEqual(metrics.levenshtein("sitting", "kitten"...
bsd-2-clause
grycap/clues
cluesplugins/kubernetes.py
1
13204
#!/usr/bin/env python # # CLUES - Cluster Energy Saving System # Copyright (C) 2015 - GRyCAP - Universitat Politecnica de Valencia # # 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 versio...
gpl-3.0
ekalosak/boto
tests/unit/auth/test_sigv4.py
75
23443
# 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 restriction, including # without limitation the rights ...
mit
nesdis/djongo
tests/django_tests/tests/v21/tests/utils_tests/test_hashable.py
50
1177
from django.test import SimpleTestCase from django.utils.hashable import make_hashable class TestHashable(SimpleTestCase): def test_equal(self): tests = ( ([], ()), (['a', 1], ('a', 1)), ({}, ()), ({'a'}, ('a',)), (frozenset({'a'}), {'a'}), ...
agpl-3.0
helloweishi/ostinato
test/rpctest.py
20
18805
#! /usr/bin/env python # standard modules import logging import os import subprocess import sys import time sys.path.insert(1, '../binding') from core import ost_pb, DroneProxy from rpc import RpcError from protocols.mac_pb2 import mac from protocols.ip4_pb2 import ip4, Ip4 class Test: pass class TestSuite: ...
gpl-3.0
devs4v/devs4v-information-retrieval15
project/venv/lib/python2.7/site-packages/nltk/cluster/gaac.py
10
5812
# Natural Language Toolkit: Group Average Agglomerative Clusterer # # Copyright (C) 2001-2015 NLTK Project # Author: Trevor Cohn <tacohn@cs.mu.oz.au> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function, unicode_literals try: import numpy except ImportError: ...
mit
jni/networkx
networkx/algorithms/smetric.py
76
1206
import networkx as nx #from networkx.generators.smax import li_smax_graph def s_metric(G, normalized=True): """Return the s-metric of graph. The s-metric is defined as the sum of the products deg(u)*deg(v) for every edge (u,v) in G. If norm is provided construct the s-max graph and compute it's s_metr...
bsd-3-clause
beni55/django
tests/gis_tests/geo3d/tests.py
17
12625
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import HAS_GEOS from django.test import TestCase, ignore_warnings, skipUnlessDBFeature from django.utils._os import upath from django.utils.deprecation ...
bsd-3-clause
sysadminmatmoz/odoo-clearcorp
project_budget/__init__.py
3
1052
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
google/contentbox
third_party/django/core/management/commands/dumpdata.py
105
9939
from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core import serializers from django.db import router, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict from optparse import make_option class Command(BaseCommand): ...
apache-2.0
Cinntax/home-assistant
homeassistant/components/notion/config_flow.py
4
2056
"""Config flow to configure the Notion integration.""" import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.core import callback from homeassistant.helpers import aiohttp_client from .const import DOMAIN @callback def confi...
apache-2.0
kaushik94/tardis
tardis/io/tests/test_atomic.py
2
1654
import pytest from astropy.tests.helper import assert_quantity_allclose from astropy import units as u from tardis import constants as const @pytest.fixture def basic_atom_data(kurucz_atomic_data): return kurucz_atomic_data.atom_data @pytest.fixture def ionization_data(kurucz_atomic_data): return kurucz_at...
bsd-3-clause
MarcJoan/django
tests/test_client_regress/urls.py
352
2521
from django.conf.urls import include, url from django.views.generic import RedirectView from . import views urlpatterns = [ url(r'', include('test_client.urls')), url(r'^no_template_view/$', views.no_template_view), url(r'^staff_only/$', views.staff_only_view), url(r'^get_view/$', views.get_view), ...
bsd-3-clause
winhamwr/selenium
py/test/selenium/webdriver/firefox/ff_explicit_wait_tests.py
3
1182
#!/usr/bin/python # # Copyright 2011 WebDriver committers # # 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 ...
apache-2.0
MobinRanjbar/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/update_permissions.py
35
1239
from django.core.management.base import BaseCommand from django.contrib.auth.management import create_permissions as _create_permissions from django_extensions.management.utils import signalcommand try: from django.apps import apps as django_apps get_models = lambda: None get_app = django_apps.get_app_con...
apache-2.0
Dhole/miniBoy
helpers/gen.py
1
1027
regs = ["B", "C", "D", "E", "H", "L", "(HL)", "A"] d = 0x80 for i in range(0, 8): print('\tSET_OP(0x%02X, "ADD A,%s", op_add, A, %s, 4);' % (i+d, regs[i % 8], regs[i % 8])); for i in range(8, 16): print('\tSET_OP(0x%02X, "ADC A,%s", op_adc, A, %s, 4);' % (i+d, regs[i % 8], regs[i % 8])); d = 0x90 for i in range...
bsd-3-clause
iivic/BoiseStateX
openedx/core/djangoapps/user_api/preferences/views.py
9
10880
""" NOTE: this API is WIP and has not yet been approved. Do not use this API without talking to Christina or Andy. For more information, see: https://openedx.atlassian.net/wiki/display/TNL/User+API """ from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import stat...
agpl-3.0
isaacyeaton/pyadisi
pyadisi/pyqtgraph/widgets/LayoutWidget.py
49
3425
from ..Qt import QtGui, QtCore __all__ = ['LayoutWidget'] class LayoutWidget(QtGui.QWidget): """ Convenience class used for laying out QWidgets in a grid. (It's just a little less effort to use than QGridLayout) """ def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) ...
bsd-3-clause
Aasmi/scikit-learn
sklearn/cluster/tests/test_birch.py
342
5603
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from sklearn.cluster.tests.common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.l...
bsd-3-clause