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
AlexanderFabisch/scikit-learn
sklearn/metrics/tests/test_score_objects.py
17
14051
import pickle import numpy as np from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.testing import assert_true from sklearn.utils.testing im...
bsd-3-clause
seaotterman/tensorflow
tensorflow/python/debug/cli/offline_analyzer.py
162
2565
# 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 applica...
apache-2.0
kamilkk/idapython
pywraps/py_custdata.py
16
9317
# ----------------------------------------------------------------------- # Standalone and testing code import sys try: import pywraps pywraps_there = True print "Using pywraps" except: pywraps_there = False print "Not using pywraps" try: import _idaapi except: print "Please t...
bsd-3-clause
juliusbierk/scikit-image
skimage/future/graph/setup.py
34
1093
#!/usr/bin/env python from skimage._build import cython import os.path base_path = os.path.abspath(os.path.dirname(__file__)) def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs config = Configuration('graph', parent_package, top_...
bsd-3-clause
alexmogavero/home-assistant
tests/components/emulated_hue/test_hue_api.py
7
14892
"""The tests for the emulated Hue component.""" import asyncio import json from unittest.mock import patch import pytest from homeassistant import setup, const, core import homeassistant.components as core_components from homeassistant.components import ( emulated_hue, http, light, script, media_player, fan ) fro...
apache-2.0
Pflanzgurke/glimpse_client
3rdparty/breakpad/src/tools/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py
180
1272
#!/usr/bin/env python # 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. """ Make sure paths are normalized with VS macros properly expanded on Windows. """ import TestGyp import sys if sys.platform == 'win32':...
bsd-3-clause
amburan/moose
framework/scripts/rm_outdated_deps.py
35
4538
#!/usr/bin/env python # A python script to remove outdated dependency files and associated objects. It operates from any # directory within the herd. It cleans out the moose directory and any herd animials included in the # Makefile. # # The script requires one input parameter, the root directory of MOOSE (e.g., ~/pro...
lgpl-2.1
Ssawa/Diamond
src/collectors/celerymon/celerymon.py
60
2506
# coding=utf-8 """ Collects simple task stats out of a running celerymon process #### Dependencies * celerymon connected to celery broker Example config file CelerymonCollector.conf ``` enabled=True host=celerymon.example.com port=16379 ``` """ import diamond.collector import urllib2 import time try: impor...
mit
yylangchen/Sample_CPP_Cocos2dx
tools/cocos2d-console/plugins/plugin_luacompile/__init__.py
11
10258
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos "luacompile" plugin # # Copyright 2013 (C) Intel # # License: MIT # ---------------------------------------------------------------------------- ''' "luacompile" plugin for cocos command line tool ''' __docformat_...
mit
amirgeva/coide
qutepart/rectangularselection.py
1
10665
from PyQt4.QtCore import Qt, QMimeData from PyQt4.QtGui import QApplication, QKeyEvent, QKeySequence, QPalette, QTextCursor, QTextEdit, QWidget class RectangularSelection: """This class does not represent any object, but is part of Qutepart It just groups together Qutepart rectangular selection methods and fi...
gpl-2.0
APerson241/EnterpriseyBot
article-history/lister.py
2
1418
import json import pywikibot import pywikibot.pagegenerators as generators import re from clint.textui import progress ARTICLE_HISTORY_COUNT = 37095 PRELOAD_SIZE = 100 REDUNDANT_TEMPLATES = ("on this day", "dyk talk", "itn talk") DUMP_FILE = "lister.json" site = pywikibot.Site("en", "wikipedia") site.login() articl...
mit
pombredanne/pyjs
examples/misc/djangoweb/settings.py
12
2950
# Django settings for pyjsDemo project. import os STATIC = str(os.path.join(os.path.dirname(__file__), 'media/output').replace('\\','/')) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'pos...
apache-2.0
spradeepv/dive-into-python
hackerrank/contests/indeed/the_ultimate_question.py
1
1574
""" Problem Statement 42 is the answer to "The Ultimate Question of Life, The Universe, and Everything". But what The Ultimate Question really is? We may never know! Given three integers, a, b, and c, insert two operators between them so that the following equation is true: a (operator1) b (operator2) c=42. You may ...
mit
jseabold/scipy
scipy/sparse/dia.py
53
8994
"""Sparse DIAgonal format""" from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['dia_matrix', 'isspmatrix_dia'] import numpy as np from .base import isspmatrix, _formats from .data import _data_matrix from .sputils import isshape, upcast_char, getdtype...
bsd-3-clause
bufferapp/buffer-django-nonrel
tests/modeltests/or_lookups/tests.py
92
7584
from datetime import datetime from operator import attrgetter from django.db.models import Q from django.test import TestCase from models import Article class OrLookupsTests(TestCase): def setUp(self): self.a1 = Article.objects.create( headline='Hello', pub_date=datetime(2005, 11, 27) ...
bsd-3-clause
littlstar/chromium.src
third_party/markdown/inlinepatterns.py
109
18559
# markdown is released under the BSD license # Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) # Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) # Copyright 2004 Manfred Stienstra (the original version) # # All rights reserved. # # Redistribution and use in source and binary forms, with or...
bsd-3-clause
gooddata/openstack-nova
nova/tests/unit/virt/hyperv/test_livemigrationops.py
3
11282
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
apache-2.0
ganemone/SublimeBart
lib/requests/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
mit
akashlevy/Lyff
lyff_lambda/boto/ec2/cloudwatch/datapoint.py
152
1668
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
zmlabe/IceVarFigs
Scripts/SeaIce/NSIDCseaice_quartiles.py
1
7079
""" Reads in current year's Arctic sea ice extent from Sea Ice Index 3 (NSIDC) Website : ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/north/daily/data/ Author : Zachary M. Labe Date : 5 September 2016 """ ### Import modules import numpy as np import urllib.request import urllib as UL import datetime impor...
mit
welex91/ansible-modules-core
cloud/google/gce_lb.py
20
12539
#!/usr/bin/python # Copyright 2013 Google Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
t0mk/ansible
lib/ansible/modules/monitoring/boundary_meter.py
4
8549
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add boundary meters. (c) 2013, curtis <curtis@serverascode.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 Foundati...
gpl-3.0
C-Codes/jupyterbar
jupyterbar/jupyterbar.py
1
4049
#!/usr/bin/env python from __future__ import print_function import os, sys import time, datetime import rumps import webbrowser from jupyter import Jupyter class JupyterStatusBarApp(rumps.App): #def __init__(self): # super(JupyterStatusBarApp, self).__init__("jupyter") # self.title="jupyter" #...
mit
lino-framework/welfare
lino_welfare/projects/gerd/tests/dumps/18.8.0/checkdata_problem.py
2
9388
# -*- coding: UTF-8 -*- logger.info("Loading 64 objects to table checkdata_problem...") # fields: id, user, owner_type, owner_id, checker, message loader.save(create_checkdata_problem(1,3,cal_Event,66,u'cal.ConflictingEventsChecker',u'Event conflicts with Beratung (29.05.2014 08:30) with INGELS Irene (135).')) loader.s...
agpl-3.0
gangadhar-kadam/laganerp
erpnext/manufacturing/doctype/bom/test_bom.py
38
1471
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import frappe test_records = frappe.get_test_records('Bom') class TestBOM(unittest.TestCase): def test_get_items(self): from er...
agpl-3.0
pbeeler/Linux-stable
tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
schettino72/nikola
nikola/plugins/template/mako.py
4
5040
# -*- coding: utf-8 -*- # Copyright © 2012-2015 Roberto Alsina and others. # 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 t...
mit
potatolondon/django-nonrel-1-4
django/contrib/gis/gdal/error.py
466
1517
""" This module houses the OGR & SRS Exception objects, and the check_err() routine which checks the status code returned by OGR methods. """ #### OGR & SRS Exceptions #### class GDALException(Exception): pass class OGRException(Exception): pass class SRSException(Exception): pass class OGRIndexError(OGRException, K...
bsd-3-clause
flv0/qutebrowser
tests/unit/misc/test_editor.py
4
5880
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
pquentin/django
django/contrib/postgres/operations.py
111
1298
from django.contrib.postgres.signals import register_hstore_handler from django.db.migrations.operations.base import Operation class CreateExtension(Operation): reversible = True def __init__(self, name): self.name = name def state_forwards(self, app_label, state): pass def database...
bsd-3-clause
crlang/sublime-text---front-end-config
Data/Packages/CodeFormatter/codeformatter/pybeautifier/PythonTidy/PythonTidyWrapper.py
9
15151
#!/usr/bin/python # -*- coding: utf-8 -*- # PythonTidyWrapper.py # 2007 Mar 06 . ccr # 2010 Sep 08 . ccr . Add JAVA_STYLE_LIST_DEDENT. # 2010 Mar 16 . ccr . Add KEEP_UNASSIGNED_CONSTANTS and PARENTHESIZE_TUPLE_DISPLAY. # 2007 May 25 . ccr . Changed MAX_SEPS. Add WRAP_DOC_STRINGS and DOC_TAB_REPLACEMENT. # 2007 May 0...
mit
Gregory-Howard/spaCy
spacy/tests/tokenizer/test_whitespace.py
7
1416
# coding: utf-8 """Test that tokens are created correctly for whitespace.""" from __future__ import unicode_literals import pytest @pytest.mark.parametrize('text', ["lorem ipsum"]) def test_tokenizer_splits_single_space(tokenizer, text): tokens = tokenizer(text) assert len(tokens) == 2 @pytest.mark.param...
mit
seibert/numba
numba/tests/test_serialize.py
3
7413
import contextlib import gc import pickle import subprocess import sys from numba.core.errors import TypingError from numba.tests.support import TestCase, tag from .serialize_usecases import * import unittest from numba.core import registry class TestDispatcherPickling(TestCase): def run_with_protocols(self, me...
bsd-2-clause
waytai/odoo
doc/_extensions/github_link.py
229
3484
import inspect import importlib import os.path from urlparse import urlunsplit """ * adds github_link(mode) context variable: provides URL (in relevant mode) of current document on github * if sphinx.ext.linkcode is enabled, automatically generates github linkcode links (by setting config.linkcode_resolve) Settin...
agpl-3.0
saisrisathya/whatsapps
yowsup/layers/protocol_notifications/protocolentities/notification_picture_set.py
70
1405
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .notification_picture import PictureNotificationProtocolEntity class SetPictureNotificationProtocolEntity(PictureNotificationProtocolEntity): ''' <notification offline="0" id="{{NOTIFICATION_ID}}" notify="{{NOTIFY_NAME}}" type="picture" ...
gpl-3.0
coreynicholson/youtube-dl
youtube_dl/extractor/streamango.py
22
2337
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, js_to_json, ) class StreamangoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?streamango\.com/(?:f|embed)/(?P<id>[^/?#&]+)' _TESTS = [{ ...
unlicense
incaser/server-tools
base_export_manager/__openerp__.py
12
1586
# -*- coding: utf-8 -*- # Python source code encoding : https://www.python.org/dev/peps/pep-0263/ ############################################################################## # # OpenERP, Odoo Source Management Solution # Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com) # ...
agpl-3.0
kkszysiu/amarok
supplementary_scripts/amarok_live/amarok_live.py
10
13923
#!/usr/bin/env python ############################################################################ # Python wrapper script for running the Amarok LiveCD remastering scripts # from within Amarok. Based on the Python-Qt template script for Amarok # (c) 2005 Mark Kretschmann <kretschmann@kde.org> # # (c) 2005 Leo Franc...
gpl-2.0
nicholasess/electron
tools/posix/generate_breakpad_symbols.py
185
8276
#!/usr/bin/env python # Copyright (c) 2013 GitHub, Inc. # 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. """A tool to generate symbols for a binary suitable for breakpad. Currently, the tool only suppo...
mit
gylian/sickrage
lib/unidecode/x078.py
252
4648
data = ( 'Dang ', # 0x00 'Ma ', # 0x01 'Sha ', # 0x02 'Dan ', # 0x03 'Jue ', # 0x04 'Li ', # 0x05 'Fu ', # 0x06 'Min ', # 0x07 'Nuo ', # 0x08 'Huo ', # 0x09 'Kang ', # 0x0a 'Zhi ', # 0x0b 'Qi ', # 0x0c 'Kan ', # 0x0d 'Jie ', # 0x0e 'Fen ', # 0x0f 'E ', # 0x10 'Ya ', ...
gpl-3.0
t-hey/QGIS-Original
tests/src/python/test_qgsvectorlayertools.py
24
2121
# -*- coding: utf-8 -*- """QGIS Unit test utils for provider tests. .. 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. "...
gpl-2.0
AOSP-S4-KK/platform_external_chromium_org
tools/telemetry/telemetry/value/value_unittest_.py
26
1464
# Copyright 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. import os import unittest from telemetry import value from telemetry.page import page_set class TestBase(unittest.TestCase): def setUp(self): self.pag...
bsd-3-clause
SteveHNH/ansible
lib/ansible/module_utils/univention_umc.py
62
8734
# -*- coding: UTF-8 -*- # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own lic...
gpl-3.0
kstilwell/tcex
tests/validators/test_not_in.py
2
1685
"""Test the not_in validator.""" # first-party from tcex.validators import ValidationError, not_in class TestNotIn: """Test the not_in validator.""" @staticmethod def tests_multi_values(): """Test handling of multiple invalid values.""" validator = not_in(['foo', None]) try: ...
apache-2.0
tbeadle/django
tests/expressions_case/tests.py
21
50774
from __future__ import unicode_literals import unittest from datetime import date, datetime, time, timedelta from decimal import Decimal from operator import attrgetter, itemgetter from uuid import UUID from django.core.exceptions import FieldError from django.db import connection, models from django.db.models import...
bsd-3-clause
davidftv/rk3x_kernel_3.0.36
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
pyfisch/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/base.py
14
5484
from __future__ import print_function import base64 import logging import os import pytest import unittest from six.moves.urllib.parse import urlencode, urlunsplit from six.moves.urllib.request import Request as BaseRequest from six.moves.urllib.request import urlopen from six import binary_type, iteritems, PY3 from...
mpl-2.0
regosen/gallery_get
gallery_plugins/plugin_shimmie.py
1
1738
# Plugin for gallery_get. import re from gallery_utils import * # Each definition can be one of the following: # - a string # - a regex string # - a function that takes source as a parameter and returns an array or a string. (You may assume that re and urllib are already imported.) # If you comment out a parameter, i...
mit
zchee/deoplete-jedi
rplugin/python3/deoplete/sources/deoplete_jedi.py
1
10772
import copy import logging import os import re from importlib.util import find_spec from deoplete.base.source import Base from deoplete.util import bytepos2charpos, getlines, load_external_module load_external_module(__file__, 'sources') from deoplete_jedi import profiler # isort:skip # noqa: E402 # Type mapping....
mit
kingvuplus/Test-OBH
lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py
51
8243
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.HelpMenu import HelpableScreen from Components.ActionMap import HelpableActionMap, ActionMap from Components.Sources.List import List from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Prog...
gpl-2.0
irregulator/ganetimgr
accounts/migrations/0009_auto__del_field_customregistrationprofile_admin_activated__del_field_c.py
1
7670
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'CustomRegistrationProfile.admin_activated' db.delete_co...
gpl-3.0
csyhuang/hn2016_falwa
hn2016_falwa/beta_version.py
1
20465
def input_jk_output_index(j,k,kmax): return j*(kmax) + k def extrap1d(interpolator): xs = interpolator.x ys = interpolator.y def pointwise(x): if x < xs[0]: return ys[0]+(x-xs[0])*(ys[1]-ys[0])/(xs[1]-xs[0]) elif x > xs[-1]: return ys[-1]+(x-xs[-1])*(ys[-1]-ys...
mit
jimklo/LRSignature
src/LRSignature/sign/Sign.py
1
6882
''' Copyright 2011 SRI International 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, softw...
apache-2.0
PeridexisErrant/python-lnp
core/keybinds.py
1
2131
#!/usr/bin/env python # -*- coding: utf-8 -*- """Keybinding management.""" from __future__ import print_function, unicode_literals, absolute_import import os, shutil from . import helpers, paths, log def read_keybinds(): """Returns a list of keybinding files.""" return tuple([ os.path.basename(o) for ...
isc
spetitjean/XMG-2
contributions/core/pylibs/compgen/brick_parser.py
1
3655
import xmg.compgen.Symbol import xmg.compgen.Grammar # Punctuation semicolon=xmg.compgen.Symbol.T(";") colon=xmg.compgen.Symbol.T(":") pipe=xmg.compgen.Symbol.T("|") quote=xmg.compgen.Symbol.T("'") arrow=xmg.compgen.Symbol.T("->") equal=xmg.compgen.Symbol.T("=") coma=xmg.compgen.Symbol.T(',') openpred=xmg.compgen.Symb...
gpl-3.0
SEL-Columbia/formhub
main/views.py
4
52283
from datetime import datetime from django.contrib.contenttypes.models import ContentType import os import json from django.db import IntegrityError from django.core.urlresolvers import reverse from django.core.files.storage import default_storage, get_storage_class from django.contrib.auth.decorators import login_requi...
bsd-2-clause
ajaali/django
django/contrib/admindocs/tests/test_fields.py
638
1172
from __future__ import unicode_literals import unittest from django.contrib.admindocs import views from django.db import models from django.db.models import fields from django.utils.translation import ugettext as _ class CustomField(models.Field): description = "A custom field type" class DescriptionLackingFi...
bsd-3-clause
heplesser/nest-simulator
pynest/nest/tests/test_spatial/test_rotated_rect_mask.py
20
16421
# -*- coding: utf-8 -*- # # test_rotated_rect_mask.py # # 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 ...
gpl-2.0
sdlBasic/sdlbrt
win32/mingw/opt/lib/python2.7/unittest/test/test_assertions.py
52
11961
import datetime import unittest class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, self.assertAlmostEqual, 1.0000001, 1.0...
lgpl-2.1
amjad-twalo/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/cluster/api.py
9
2032
# Natural Language Toolkit: Clusterer Interfaces # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Trevor Cohn <tacohn@cs.mu.oz.au> # Porting: Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT from nltk import DictionaryProbDist class ClusterI: ...
gpl-3.0
ptisserand/ansible
test/units/modules/network/f5/test_bigip_monitor_snmp_dca.py
24
5433
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip imp...
gpl-3.0
emijrp/youtube-dl
youtube_dl/extractor/brightcove.py
89
15403
# encoding: utf-8 from __future__ import unicode_literals import re import json import xml.etree.ElementTree from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_str, compat_urllib_parse, compat_urllib_parse_urlparse, compat_urllib_request, compat_urlparse, comp...
unlicense
isbadawi/maze-generation
io/canvas.py
1
1094
import Tkinter as tk import sys class Canvas(object): def __init__(self, width, height, size): self.width = width self.height = height self.size = size self.root = tk.Tk() self.root.title('Maze Generation Visualizer') self.canvas = tk.Canvas( self.root, ...
mit
torbjoernk/easybuild-framework
easybuild/toolchains/linalg/__init__.py
9
1340
## # Copyright 2012-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
park-bench/gpgmailer
src/usr/share/gpgmailer/gpgmailerd.py
1
25135
#!/usr/bin/python3 # Copyright 2015-2021 Joel Allen Luellwitz and Emily Frost # # 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 ...
gpl-3.0
Simran-B/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/cvsfiles.py
101
1787
#! /usr/bin/env python """Print a list of files that are mentioned in CVS directories. Usage: cvsfiles.py [-n file] [directory] ... If the '-n file' option is given, only files under CVS that are newer than the given file are printed; by default, all files under CVS are printed. As a special case, if a file does no...
apache-2.0
F5Networks/f5-ansible-modules
ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_snmp_community.py
2
9207
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
mit
sangwook236/SWDT
sw_dev/python/ext/test/interface/cython/cython_test.py
2
2336
#!/usr/bin/env python # REF [site] >> # http://docs.cython.org/en/latest/src/userguide/ # https://cython.readthedocs.io/en/latest/src/tutorial/ # REF [site] >> http://docs.cython.org/en/latest/src/tutorial/cython_tutorial.html def cython_tutorial(): import helloworld import primes_c, primes_cpp print('Primes (C...
gpl-3.0
sajuptpm/neutron-ipam
neutron/plugins/vmware/dbexts/networkgw_db.py
1
24050
# Copyright 2013 VMware, 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 a...
apache-2.0
nkgilley/home-assistant
tests/components/alexa/test_state_report.py
15
5602
"""Test report state.""" from homeassistant.components.alexa import state_report from . import DEFAULT_CONFIG, TEST_URL async def test_report_state(hass, aioclient_mock): """Test proactive state reports.""" aioclient_mock.post(TEST_URL, text="", status=202) hass.states.async_set( "binary_sensor....
apache-2.0
hogasa/normalizador-amba
usig_normalizador_amba/Direccion.py
1
3312
# coding: UTF-8 ''' Created on Apr 16, 2014 @author: hernan ''' from __future__ import absolute_import import re from usig_normalizador_amba.settings import CALLE_ALTURA, CALLE_Y_CALLE, INVALIDO from usig_normalizador_amba.Calle import Calle class Direccion: ''' @ivar calle: Calle de la direccion @type ...
mit
moylop260/odoo-dev
addons/resource/faces/observer.py
433
2328
#@+leo-ver=4 #@+node:@file observer.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # ...
agpl-3.0
GoelDeepak/dcos
gen/internals.py
9
34458
import copy import enum import inspect import logging from contextlib import contextmanager from functools import partial, partialmethod from typing import Any, Callable, Dict, List, Set, Tuple, Union from gen.exceptions import ValidationError from pkgpanda.util import hash_checkout log = logging.getLogger(__name__)...
apache-2.0
pandada8/mirrord
mirrord/daemon.py
1
1173
import yaml from task import RsyncTask import asyncio import logging import argparse class Application(): def __init__(self): self.tasks = {} def load_config(self, config): with open(config) as fp: data = yaml.safe_load(fp) for i, j in data["task"].items(): ...
mit
al45tair/mac_alias
mac_alias/__init__.py
17
1134
from .alias import * from .bookmark import * __all__ = [ 'ALIAS_KIND_FILE', 'ALIAS_KIND_FOLDER', 'ALIAS_HFS_VOLUME_SIGNATURE', 'ALIAS_FIXED_DISK', 'ALIAS_NETWORK_DISK', 'ALIAS_400KB_FLOPPY_DISK', 'ALIAS_800KB_FLOPPY_DISK', 'ALIAS_1_44MB_FLOPPY_DISK', 'ALIAS_EJECTABLE_DIS...
mit
rosudrag/Freemium-winner
VirtualEnvironment/Lib/site-packages/jinja2/loaders.py
1
17346
# -*- coding: utf-8 -*- """ jinja2.loaders ~~~~~~~~~~~~~~ Jinja loader classes. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import weakref from types import ModuleType from os import path from hashlib import sha1 from jinja2.excepti...
mit
bitesofcode/projexui
projexui/designer/build/xactiongroupwidgetplugin.py
2
2577
#!/usr/bin/python ''' Auto-generated ui widget plugin ''' from projexui.qt.QtDesigner import QPyDesignerCustomWidgetPlugin from projexui.qt.QtGui import QIcon import projex.resources from projexui.widgets.xactiongroupwidget import XActionGroupWidget as Base setattr(Base, '__designer_mode__', True) DEFAUL...
lgpl-3.0
jinankjain/zamboni
mkt/versions/tests/test_serializers.py
1
1791
from django.core.urlresolvers import reverse from nose.tools import eq_, ok_ from test_utils import RequestFactory from amo.tests import app_factory, TestCase from versions.models import Version from mkt.versions.serializers import VersionSerializer class TestVersionSerializer(TestCase): def setUp(self): ...
bsd-3-clause
omarayad1/cantkeepup
app/core/helpers.py
1
1103
from json import dumps # pragma: no cover from sqlalchemy.orm import class_mapper # pragma: no cover from app.models import User, Group # pragma: no cover def serialize(obj, columns): # then we return their values in a dict return dict((c, getattr(obj, c)) for c in columns) def queryAllToJson(model,conditions): # ...
mit
bayesimpact/bob-emploi
frontend/server/mail/jobbing.py
1
2417
"""Focus email module for finding jobbing ideas.""" import typing from typing import Any, Dict from bob_emploi.frontend.api import user_pb2 from bob_emploi.frontend.api import reorient_jobbing_pb2 from bob_emploi.frontend.server import i18n from bob_emploi.frontend.server import mongo from bob_emploi.frontend.server ...
gpl-3.0
chrislit/abydos
abydos/tokenizer/_c_or_v_cluster.py
1
5291
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
chrislit/abydos
tests/distance/test_distance_fleiss_levin_paik.py
1
4910
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
lbryio/lbrycrd
test/util/rpcauth-test.py
32
1748
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test share/rpcauth/rpcauth.py """ import base64 import configparser import hmac import importlib import...
mit
stormtrader/gw_trade
dysms_python/mns_python_sdk/mns/mns_client.py
1
37956
#coding=utf-8 # Copyright (C) 2015, Alibaba Cloud Computing #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, merg...
gpl-3.0
shaufi/odoo
openerp/tools/convert.py
205
41282
# -*- 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 GNU...
agpl-3.0
YeEmrick/learning
stanford-tensorflow/2017/examples/07_convnet_mnist_starter.py
1
6444
""" Using convolutional net on MNIST dataset of handwritten digit (http://yann.lecun.com/exdb/mnist/) Author: Chip Huyen Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research" cs20si.stanford.edu """ from __future__ import print_function from __future__ import division from __future__ import print_func...
apache-2.0
tiramiseb/abandoned_ospfm
ospfm/core/preference.py
1
2559
# Copyright 2012-2013 Sebastien Maccagnoni-Munch # # This file is part of OSPFM. # # OSPFM is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at you...
agpl-3.0
DataKind-SG/healthcare_ASEAN
src/data/download.py
1
1439
# Call download scripts #from download import * import download.SG_disease import download.SG_weather import download.MY_dengue import download.BN_disease import download.TH_disease import download.ID_malaria import download.wunderground import download.apps_who_int import os import sys import logging import logging.c...
mit
abloomston/sympy
sympy/physics/unitsystems/tests/test_quantities.py
92
1812
# -*- coding: utf-8 -*- from __future__ import division from sympy.physics.unitsystems.quantities import Quantity from sympy.physics.unitsystems.units import Unit from sympy.physics.unitsystems.prefixes import PREFIXES from sympy.physics.unitsystems.systems import mks from sympy.utilities.pytest import raises m, s, ...
bsd-3-clause
Chris1221/Bandwidth-Daemon
daemon/teksavvy_cron.py
1
2966
#!/opt/local/bin/python #you might have to change the above to point to your local python from __future__ import division import httplib, json, time #replace this with your API key APIKEY = "API_KEY" #pull from api headers = {"TekSavvy-APIKey": APIKEY} conn = httplib.HTTPSConnection("api.teksavvy.com") conn.req...
gpl-2.0
atopuzov/nitro-python
nssrc/com/citrix/netscaler/nitro/resource/config/cs/csvserver_tmtrafficpolicy_binding.py
3
14667
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
maxwu/cistat
test/test_circleci_request.py
1
4687
#!/usr/bin/env python # -*- coding: utf-8 -*- """Test CircleCI interfaces .. moduleauthor:: Max Wu <http://maxwu.me> """ import unittest import numbers import json from cistat import config from cistat.model import Xunitrpt from cistat.reqs import CircleCiReq class CircleCiReqTest(unittest.TestCase): def setU...
mit
lammps/lammps
python/lammps/numpy_wrapper.py
4
13588
# ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator # https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract # DE-A...
gpl-2.0
mavenlin/tensorflow
tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_benchmark_test.py
83
8976
# 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 applica...
apache-2.0
robcarver17/pysystemtrade
systems/accounts/pandl_calculators/pandl_generic_costs.py
1
3494
import pandas as pd from systems.accounts.pandl_calculators.pandl_calculation import pandlCalculation, apply_weighting curve_types = ['gross', 'net', 'costs'] GROSS_CURVE = 'gross' NET_CURVE = 'net' COSTS_CURVE = 'costs' class pandlCalculationWithGenericCosts(pandlCalculation): def weight(self, weight: pd.Seri...
gpl-3.0
dezynetechnologies/odoo
addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
337
3000
# -*- 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...
agpl-3.0
pabelanger/stackalytics
stackalytics/processor/launchpad_utils.py
4
2045
# Copyright (c) 2013 Mirantis 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 writi...
apache-2.0
hrh5775/LibraryManager
PythonTestClient/LibraryManagerTestClient/venv/Lib/encodings/cp720.py
417
13694
"""Python Character Mapping Codec cp720 generated on Windows: Vista 6.0.6002 SP2 Multiprocessor Free with the command: python Tools/unicode/genwincodec.py 720 """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,error...
gpl-3.0
andyzsf/django
tests/model_forms/tests.py
12
105737
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import FieldError, ImproperlyConfigured, NON_FIELD_ERRORS from django.core.files.uploadedfile import SimpleUploadedFile from django.core.va...
bsd-3-clause
Jgarcia-IAS/SITE
addons/l10n_uy/__openerp__.py
170
1887
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net> # Proyecto de Localización de OperERP para Uruguay # $Id$ # # This program i...
agpl-3.0