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
HydrelioxGitHub/PiDDL
ZTPAGE.py
1
2847
# coding: utf-8 from urllib2 import urlopen import urllib2 import bs4 as BeautifulSoup class ZTPage: def __init__(self, url): self.url = url self.update() def update(self): self.update_content() self.parse_type() self.parse_infos() self.parse_links() def ...
gpl-2.0
Deepomatic/DIGITS
examples/classification/use_archive.py
5
3009
#!/usr/bin/env python2 # Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. """ Classify an image using a model archive file """ import argparse import os import tarfile import tempfile import time import zipfile from example import classify def unzip_archive(archive): """ Unzips an archive...
bsd-3-clause
wbsavage/shinken
shinken/autoslots.py
2
2375
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can r...
agpl-3.0
kbrebanov/ansible-modules-extras
database/vertica/vertica_role.py
15
8414
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
jmptrader/dirigible-spreadsheet
dirigible/sheet/tests/test_importer.py
2
9144
# Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP # See LICENSE.md # from __future__ import with_statement try: import unittest2 as unittest except ImportError: import unittest from mock import Mock, patch from StringIO import StringIO import xlrd from dirigible.test_utils import ResolverTestCas...
mit
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/_abcoll.py
14
18415
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
gpl-2.0
darknao/piOClock
ssd1351.py
1
13500
#!/bin/env python # -*- coding: UTF-8 -*- # ---------------------------------------------------------------------- # ssd1351.py from https://github.com/guyc/py-gaugette # ported by Jason Porritt, # and reworked by darknao, # based on original work by Guy Carpenter for display.py # # This library works with # Adafruit...
gpl-3.0
austinvernsonger/metagoofil
hachoir_parser/video/asf.py
86
12869
""" Advanced Streaming Format (ASF) parser, format used by Windows Media Video (WMF) and Windows Media Audio (WMA). Informations: - http://www.microsoft.com/windows/windowsmedia/forpros/format/asfspec.aspx - http://swpat.ffii.org/pikta/xrani/asf/index.fr.html Author: Victor Stinner Creation: 5 august 2006 """ from h...
gpl-2.0
GbalsaC/bitnamiP
lms/djangoapps/teams/views.py
18
35363
"""HTTP endpoints for the Teams API.""" from django.shortcuts import render_to_response from courseware.courses import get_course_with_access, has_access from django.http import Http404 from django.conf import settings from django.core.paginator import Paginator from django.views.generic.base import View from rest_fr...
agpl-3.0
kumar303/olympia
src/olympia/devhub/tests/test_views_ownership.py
2
18767
"""Tests related to the ``devhub.addons.owner`` view.""" from django.core import mail import six from pyquery import PyQuery as pq from olympia import amo from olympia.activity.models import ActivityLog from olympia.addons.models import Addon, AddonUser from olympia.amo.tests import TestCase, formset from olympia.de...
bsd-3-clause
bnx05/pytest-selenium
test_parameters.py
1
2603
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import time from selenium import webdriver sample_email_address = "demo@engagespark.com" sample_password = "Password123" email_addresses = ["invalid_email", "another_invalid_email@", "not_another_invalid_email@blah"] passwords = ["weak_password", "generic_p...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/spyderplugins/widgets/condapackagesgui.py
2
69644
# -*- coding: utf-8 -*- # # Copyright © 2014 Gonzalo Peña (@goanpeca) # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """Conda Packager Manager Widget Maybe this package manager should be shipped as a different module in pipy? spyder_package_manager? so that spyder updates coul...
gpl-3.0
TangXT/edx-platform
lms/djangoapps/shoppingcart/migrations/0002_auto__add_field_paidcourseregistration_mode.py
182
8687
# -*- 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 'PaidCourseRegistration.mode' db.add_column('shoppingcart_paidcourseregistration', 'mode', ...
agpl-3.0
servo/servo
tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py
3
14627
import errno import os import shutil import socket import subprocess import sys import tempfile import time try: from urllib.request import urlopen from urllib.error import URLError except ImportError: from urllib2 import urlopen, URLError import pytest here = os.path.abspath(os.path.dirname(__file__)) f...
mpl-2.0
okfn/pdftables
test/test_linesegments.py
3
1793
import pdftables.line_segments as line_segments from nose.tools import assert_equals, raises from pdftables.line_segments import LineSegment def segments(segments): return [line_segments.LineSegment.make(a, b) for a, b in segments] def test_segments_generator(): seg1, seg2 = segs = segments([(1, 4), (2, 3...
bsd-2-clause
pyatil/jenkins-job-builder
tests/cmd/test_cmd.py
15
1229
import os from six.moves import configparser, StringIO import testtools from jenkins_jobs import cmd from tests.base import mock class CmdTestsBase(testtools.TestCase): fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures') parser = cmd.create_parser() def setUp(self): super(CmdTest...
apache-2.0
ThomasFeher/audacity
lib-src/lv2/sord/waflib/Tools/tex.py
177
8492
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re from waflib import Utils,Task,Errors,Logs from waflib.TaskGen import feature,before_method re_bibunit=re.compile(r'\\(?P<type>putbib)\[(?P<file>[^\[\]]*)\]',re.M)...
gpl-2.0
ToontownUprising/src
toontown/hood/GZHoodAI.py
2
2411
from pandac.PandaModules import * from toontown.dna.DNAParser import DNAGroup, DNAVisGroup from toontown.hood import HoodAI from toontown.hood import ZoneUtil from toontown.safezone.DistributedGolfKartAI import DistributedGolfKartAI from toontown.toonbase import ToontownGlobals class GZHoodAI(HoodAI.HoodAI): def ...
mit
iuliat/nova
nova/db/sqlalchemy/migrate_repo/versions/216_havana.py
44
64425
# Copyright 2012 OpenStack Foundation # # 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 ...
apache-2.0
DonaldTrumpHasTinyHands/tiny_hands_pac
documents_gallery/models.py
1
4091
from django.db import models from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailcore.models import Page from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel from wagtail.wagtaildocs.models import Docume...
mit
SomethingExplosive/android_external_chromium_org
tools/telemetry/telemetry/core/browser_finder.py
23
3817
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Finds browsers that can be controlled by telemetry.""" import logging from telemetry.core.chrome import android_browser_finder from telemetry.core.ch...
bsd-3-clause
SnabbCo/neutron
neutron/tests/unit/ml2/test_rpcapi.py
16
4775
# Copyright (c) 2013 OpenStack Foundation # 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 ...
apache-2.0
potatolondon/django-nonrel-1-4
tests/modeltests/many_to_many/tests.py
25
17889
from __future__ import absolute_import, with_statement from django.test import TestCase from .models import Article, Publication class ManyToManyTests(TestCase): def setUp(self): # Create a couple of Publications. self.p1 = Publication.objects.create(id=None, title='The Python Journal') ...
bsd-3-clause
tinchoss/Python_Android
python/src/Lib/SimpleXMLRPCServer.py
51
21906
"""Simple XML-RPC Server. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI environment using CGIXMLRPCRequestHandler. A list of possibl...
apache-2.0
c-amr/camr
stanfordnlp/unidecode/x0c0.py
253
4856
data = ( 'bbweok', # 0x00 'bbweot', # 0x01 'bbweop', # 0x02 'bbweoh', # 0x03 'bbwe', # 0x04 'bbweg', # 0x05 'bbwegg', # 0x06 'bbwegs', # 0x07 'bbwen', # 0x08 'bbwenj', # 0x09 'bbwenh', # 0x0a 'bbwed', # 0x0b 'bbwel', # 0x0c 'bbwelg', # 0x0d 'bbwelm', # 0x0e 'bbwelb', # 0x...
gpl-2.0
XueqingLin/tensorflow
tensorflow/tensorboard/lib/python/http_test.py
27
6269
# -*- coding: utf-8 -*- # 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 # # Un...
apache-2.0
sdpython/cvxpy
examples/branch_and_bound.py
8
1488
""" Branch and bound to solve minimum cardinality problem. minimize ||A*x - b||^2_2 subject to x in {0, 1}^n """ from cvxpy import * import numpy try: from Queue import PriorityQueue except: from queue import PriorityQueue # Problem data. m = 25 n = 20 numpy.random.seed(1) A = numpy.matrix(numpy.random.randn...
gpl-3.0
837468220/python-for-android
python3-alpha/python3-src/Lib/test/test_gettext.py
102
18333
import os import base64 import shutil import gettext import unittest from test import support # TODO: # - Add new tests, for example for "dgettext" # - Remove dummy tests, for example testing for single and double quotes # has no sense, it would have if we were testing a parser (i.e. pygettext) # - Tests shoul...
apache-2.0
Workday/OpenFrame
third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/common.py
203
3229
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
bsd-3-clause
kfwang/Glance-OVA-OVF
glance/tests/unit/test_domain_proxy.py
15
11529
# Copyright 2013 OpenStack Foundation. # Copyright 2013 IBM Corp. # 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/LI...
apache-2.0
papados/ordersys
Lib/site-packages/django/contrib/auth/models.py
49
18339
from __future__ import unicode_literals import re import warnings from django.core.exceptions import ImproperlyConfigured from django.core.mail import send_mail from django.core import validators from django.db import models from django.db.models.manager import EmptyManager from django.utils.crypto import get_random_s...
unlicense
harisibrahimkv/django
django/contrib/gis/db/backends/spatialite/schema.py
33
6791
from django.db.backends.sqlite3.schema import DatabaseSchemaEditor from django.db.utils import DatabaseError class SpatialiteSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_column = ( "SELECT AddGeometryColumn(%(table)s, %(column)s, %(srid)s, " "%(geom_type)s, %(dim)s, %(null)s)" ) sq...
bsd-3-clause
rustogi/yang-explorer
server/explorer/utils/yang.py
2
11173
""" Copyright 2015, Cisco 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 law or agreed t...
apache-2.0
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/encodings/cp1254.py
593
13758
""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.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...
mit
styxit/CouchPotatoServer
libs/git/remotes.py
110
2614
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
mrocklin/into
into/backends/sql_csv.py
1
2811
from ..regex import RegexDispatcher from ..append import append from .csv import CSV import os import datashape import sqlalchemy import subprocess copy_command = RegexDispatcher('copy_command') execute_copy = RegexDispatcher('execute_copy') @copy_command.register('.*sqlite') def copy_sqlite(dialect, tbl, csv): ...
bsd-3-clause
emidln/django_roa
env/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/predicates.py
623
1777
""" This module houses the GEOS ctypes prototype functions for the unary and binary predicate operations on geometries. """ from ctypes import c_char, c_char_p, c_double from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_predicate from django.contrib.gis...
bsd-3-clause
abdoosh00/edx-platform
common/djangoapps/student/tests/test_email.py
10
13509
import json import django.db import unittest from student.tests.factories import UserFactory, RegistrationFactory, PendingEmailChangeFactory from student.views import reactivation_email_for_user, change_email_request, confirm_email_change from student.models import UserProfile, PendingEmailChange from django.contrib.a...
agpl-3.0
qenter/vlc-android
toolchains/arm/lib/python2.7/lib-tk/FixTk.py
96
2938
import sys, os # Delay import _tkinter until we have set TCL_LIBRARY, # so that Tcl_FindExecutable has a chance to locate its # encoding directory. # Unfortunately, we cannot know the TCL_LIBRARY directory # if we don't know the tcl version, which we cannot find out # without import Tcl. Fortunately, Tcl will itself ...
gpl-2.0
BiznetGIO/horizon
openstack_dashboard/dashboards/admin/networks/ports/tests.py
2
27602
# Copyright 2012 NEC Corporation # Copyright 2015 Cisco 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 # # Un...
apache-2.0
Frenzie/youtube-dl
youtube_dl/extractor/youporn.py
3
6918
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_request from ..utils import ( int_or_none, str_to_int, unescapeHTML, unified_strdate, ) from ..aes import aes_decrypt_text class YouPornIE(InfoExtractor): _VALID_URL = r'https?:...
unlicense
blenderben/lolstatbot
lolstatbot.py
1
22559
# Leauge of Legends Statistics Chat Bot # A chat bot written in Python that provides match statistics right to your Twitch chat. # 2015 Benjamin Chu - https://github.com/blenderben import socket # imports module allowing connection to IRC import threading # imports module allowing timing functions import requests # im...
mit
massot/odoo
addons/base_gengo/__init__.py
377
1122
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
leppa/home-assistant
tests/components/izone/test_config_flow.py
3
2677
"""Tests for iZone.""" from unittest.mock import Mock, patch import pytest from homeassistant import config_entries, data_entry_flow from homeassistant.components.izone.const import DISPATCH_CONTROLLER_DISCOVERED, IZONE from tests.common import mock_coro @pytest.fixture def mock_disco(): """Mock discovery ser...
apache-2.0
FOSSRIT/PyCut
game/events/togglable.py
4
2030
import pygame from game.objects import STATE class Togglable(): """docstring for Clickable TODO: modify to handle clicked vs released """ def __init__(self): self.setState(STATE.NORMAL) self.location = (0,0) self.width = 0 self.height = 0 self.onSelect = None...
mpl-2.0
minhphung171093/GreenERP_V9
openerp/addons/base/module/wizard/base_export_language.py
43
2692
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import contextlib import cStringIO from openerp import tools from openerp.osv import fields,osv from openerp.tools.translate import _ from openerp.tools.misc import get_iso_codes NEW_LANG_KEY = '__new__' ...
gpl-3.0
pacpac1992/mymockup
src/widgets/tab.py
1
3754
#!/usr/bin/python # -*- coding: utf-8 -*- import wx import wx.lib.ogl as ogl class Tab_dialog(wx.Dialog): def __init__(self, parent, title): super(Tab_dialog, self).__init__(parent, title=title,size=(410,220)) self.parent = parent self.nombre = wx.TextCtrl(self,-1, pos=(10,10), size=(200,30),style=wx.TE_P...
mit
FedericoCeratto/debian-pymongo
test/version.py
16
2074
# Copyright 2009-2015 MongoDB, 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 writin...
apache-2.0
ronyfadel/iTerm2
tests/esctest/tests/sm_title.py
31
2670
from esc import NUL import escargs import esccmd from esccmd import SET_HEX, QUERY_HEX, SET_UTF8, QUERY_UTF8 import escio from esctypes import Point, Rect from escutil import AssertEQ, AssertScreenCharsInRectEqual, GetCursorPosition, GetIconTitle, GetScreenSize, GetWindowTitle, knownBug, optionRequired class SMTitleT...
gpl-2.0
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/operations/_vpn_site_link_connections_operations.py
1
5309
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
louietsai/python-for-android
python3-alpha/python3-src/Lib/test/test_dummy_thread.py
57
7159
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import _dummy_thread as _thread import time import queue import random import unittest from test imp...
apache-2.0
caesar2164/edx-platform
lms/djangoapps/lti_provider/tests/test_tasks.py
1
4437
""" Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py """ import unittest import ddt from django.test import TestCase from mock import patch, MagicMock from student.tests.factories import UserFactory from lti_provider.models import GradedAssignment, LtiConsumer, OutcomeService import lti...
agpl-3.0
vegeclic/django-regularcom
blog/migrations/0001_initial.py
1
14127
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TaggedItem' db.create_table('blog_taggeditem', ( ('id', self.gf('django.db.model...
agpl-3.0
roadmapper/ansible
test/units/modules/network/f5/test_bigip_firewall_dos_vector.py
22
3140
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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...
gpl-3.0
azunite/wireshark_clon
tools/make-tap-reg.py
42
5525
#!/usr/bin/env python # # Looks for registration routines in the taps, # and assembles C code to call all the routines. # # This is a Python version of the make-reg-dotc shell script. # Running the shell script on Win32 is very very slow because of # all the process-launching that goes on --- multiple greps and # seds ...
gpl-2.0
CiscoSystems/vespa
neutron/plugins/nec/ofc_driver_base.py
5
4998
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 NEC 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.or...
apache-2.0
aam-at/tensorflow
tensorflow/python/data/experimental/ops/threading_options.py
27
1868
# 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
haroldl/homeworklog
django/contrib/admin/models.py
228
2207
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.contrib.admin.util import quote from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode from django.utils.safestring import mark...
bsd-3-clause
neoz/zer0m0n
signatures/network_irc.py
6
1128
# Copyright (C) 2013 Claudio "nex" Guarnieri (@botherder) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pro...
gpl-3.0
maxwward/SCOPEBak
askbot/migrations/0059_auto__add_field_thread_view_count.py
2
26945
# encoding: 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 'Thread.view_count' db.add_column('askbot_thread', 'view_count', self.gf('django.db.models....
gpl-3.0
Ultimaker/Cura
cura/XRayPass.py
1
1577
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os.path from UM.Resources import Resources from UM.Application import Application from UM.PluginRegistry import PluginRegistry from UM.View.RenderPass import RenderPass from UM.View.RenderBatch import RenderBatch f...
lgpl-3.0
the-nick-of-time/DnD
DnD/modules/resourceModule.py
1
2471
import tkinter as tk from typing import Union import lib.components as gui import lib.resourceLib as res import lib.settingsLib as settings class ResourceDisplay(gui.Section): """Displays a resource like sorcery points or Hit Dice.""" def __init__(self, container: Union[tk.BaseWidget, tk.Tk], resource: res....
gpl-2.0
zacps/zulip
api/integrations/svn/zulip_svn_config.py
33
2345
# -*- coding: utf-8 -*- # # Copyright © 2014 Zulip, Inc. # # 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,...
apache-2.0
tiagofrepereira2012/tensorflow
tensorflow/tools/docs/generate_lib.py
20
17656
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
lptorres/noah-inasafe
web_api/third_party/simplejson/decoder.py
1
14670
"""Implementation of JSONDecoder """ from __future__ import absolute_import import re import sys import struct from .compat import fromhex, b, u, text_type, binary_type, PY3, unichr from .scanner import make_scanner, JSONDecodeError def _import_c_scanstring(): try: from ._speedups import scanstr...
gpl-3.0
miaoski/bsideslv-plc-home
hmi.py
1
1699
# -*- coding: utf8 -*- # This trivial HMI is decoupled from ModBus server import gevent from flask import Flask, render_template from flask_sockets import Sockets from pymodbus.client.sync import ModbusTcpClient from time import sleep import sys app = Flask(__name__) sockets = Sockets(app) try: myip = sys.argv[1...
gpl-2.0
vicky2135/lucious
lucious/lib/python2.7/site-packages/pip/_vendor/distlib/version.py
335
23711
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
bsd-3-clause
danialbehzadi/Nokia-RM-1013-2.0.0.11
webkit/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
15
22631
#!/usr/bin/env python # Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
gpl-3.0
dfunckt/django
tests/forms_tests/widget_tests/test_passwordinput.py
247
1052
from django.forms import PasswordInput from .base import WidgetTest class PasswordInputTest(WidgetTest): widget = PasswordInput() def test_render(self): self.check_html(self.widget, 'password', '', html='<input type="password" name="password" />') def test_render_ignore_value(self): sel...
bsd-3-clause
ning/collector
src/utils/py/thrift/TSCons.py
145
1266
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
tailorian/Sick-Beard
lib/unidecode/x09a.py
253
4623
data = ( 'E ', # 0x00 'Cheng ', # 0x01 'Xin ', # 0x02 'Ai ', # 0x03 'Lu ', # 0x04 'Zhui ', # 0x05 'Zhou ', # 0x06 'She ', # 0x07 'Pian ', # 0x08 'Kun ', # 0x09 'Tao ', # 0x0a 'Lai ', # 0x0b 'Zong ', # 0x0c 'Ke ', # 0x0d 'Qi ', # 0x0e 'Qi ', # 0x0f 'Yan ', # 0x10 'Fei '...
gpl-3.0
Rhombik/rhombik-object-repository
importer/thingiverse.py
2
6930
# -*- coding: utf-8 -*- import scrapy from scrapy.contrib.spiders import CrawlSpider, Rule from scraper.spider.items import ProjectItem, fileObjectItem from scrapy.contrib.linkextractors import LinkExtractor import re import urlparse from twisted.internet import reactor from scrapy.crawler import Crawler from scrapy i...
agpl-3.0
fafaman/django
django/contrib/sites/managers.py
472
2132
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.core import checks from django.core.exceptions import FieldDoesNotExist from django.db import models class CurrentSiteManager(models.Manager): "Use this to limit objects to those associated with the curre...
bsd-3-clause
adminneyk/codificacionproyectando
application/views/Generacion/Generacion/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/repr.py
417
4296
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr","repr"] import __builtin__ from itertools import islice class Repr: def __init__(self): self.maxlevel = 6 self.maxtuple = 6 self.maxlist = 6 self.maxarray = 5 self.maxdict = 4 ...
mit
cevaris/pants
src/python/pants/goal/goal.py
7
8981
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.goal.erro...
apache-2.0
etsinko/Pentaho-reports-for-OpenERP
openerp_addon/pentaho_report_selection_sets/report_selections.py
6
12597
# -*- encoding: utf-8 -*- from datetime import date, datetime from dateutil import parser import pytz import json from lxml import etree from openerp import models, fields, api, _ from openerp.exceptions import except_orm from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT from opene...
gpl-2.0
zhenzhai/edx-platform
lms/envs/test_static_optimized.py
26
2169
""" Settings used when generating static assets for use in tests. For example, Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running CMS and LMS Note: it isn't possible to have a single settings file, because Django doesn't support bo...
agpl-3.0
houshengbo/nova_vmware_compute_driver
nova/virt/hyperv/vmops.py
1
25971
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 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.ap...
apache-2.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/shortest_paths/dense.py
4
6750
# -*- coding: utf-8 -*- """Floyd-Warshall algorithm for shortest paths. """ # Copyright (C) 2004-2018 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Aric Hagberg <aric.hagberg@gmail.com> # ...
gpl-3.0
B-MOOC/edx-platform
common/lib/xmodule/xmodule/tests/test_content.py
62
7973
"""Tests for contents""" import os import unittest import ddt from path import path from xmodule.contentstore.content import StaticContent, StaticContentStream from xmodule.contentstore.content import ContentStore from opaque_keys.edx.locations import SlashSeparatedCourseKey, AssetLocation from xmodule.static_content ...
agpl-3.0
zhouzhenghui/python-for-android
python3-alpha/python3-src/Lib/plat-linux3/TYPES.py
171
3416
# Generated by h2py from /usr/include/sys/types.h _SYS_TYPES_H = 1 # Included from features.h _FEATURES_H = 1 __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 199506 _XOPEN_SOURCE = 600 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 _BSD_SOURCE = 1 _SVID_SOURCE = 1 _BSD_SOURCE ...
apache-2.0
edx/course-discovery
course_discovery/apps/course_metadata/tests/test_emails.py
1
14576
import datetime import re from django.conf import settings from django.contrib.auth.models import Group from django.core import mail from django.test import TestCase from opaque_keys.edx.keys import CourseKey from testfixtures import LogCapture, StringComparison from course_discovery.apps.core.tests.factories import ...
agpl-3.0
arnaud-morvan/QGIS
tests/src/python/test_qgsserver_response.py
23
2422
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServerResponse. From build dir, run: ctest -R PyQgsServerResponse -V .. 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 t...
gpl-2.0
muminoff/fabric-bolt
src/fabric_bolt/accounts/admin.py
3
1979
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.utils.translation import ugettext_lazy as _ from fabric_bolt.accounts.models import DeployUser from fabric_bolt.accounts.forms import UserChangeForm, UserCreation...
mit
ctrezzo/hadoop
hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/job_history_summary.py
323
3444
#!/usr/bin/env python # # 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 # "...
apache-2.0
jlspyaozhongkai/Uter
third_party_build/Python-2.7.9/lib/python2.7/test/test_cgi.py
43
15492
from test.test_support import run_unittest, check_warnings import cgi import os import sys import tempfile import unittest from collections import namedtuple class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi module argv = []...
gpl-3.0
mganeva/mantid
qt/applications/workbench/workbench/widgets/plotselector/presenter.py
1
15293
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + # This file is part of the mantid workbench....
gpl-3.0
dell-o/EFLS
src/mavProxyLink_pb2.py
2
10113
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: mavProxyLink.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _...
gpl-3.0
DailyActie/Surrogate-Model
surrogate/sampling/samLatinHypercube.py
1
8477
# MIT License # # Copyright (c) 2016 Daily Actie # # 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, ...
mit
pyannote/pyannote-parser
tests/test_repere.py
1
2075
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2014-2015 CNRS # 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 limita...
mit
turiphro/dockerfiles
devbox/etc/.vim/bundle/jedi-vim/conftest.py
4
1687
import os import urllib import zipfile import subprocess CACHE_FOLDER = '.cache' VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-master') VSPEC_RUNNER = os.path.join(VSPEC_FOLDER, 'bin/vspec') TEST_DIR = 'test' class IntegrationTestFile(object): def __init__(self, path): self.path = path def ru...
mit
Rdbaker/Mealbound
tests/models/test_transactions.py
1
4543
"""Test the Transaction models.""" from unittest.mock import patch import pytest from ceraon.models.transactions import Transaction @pytest.mark.usefixtures('db') class TestTransaction: """Transaction tests.""" def test_get_by_id(self, meal, host, guest): """Get Transaction by id.""" transa...
bsd-3-clause
JamieFBousfield/heekscnc
nc/num_reader.py
30
1811
import nc_read as nc import sys import math # a base class for hpgl parsers, and maybe others class NumReader(nc.Parser): def __init__(self, writer): nc.Parser.__init__(self, writer) def get_number(self): number = '' # skip spaces and commas at start of number ...
bsd-3-clause
xkmato/casepro
casepro/urls.py
1
1472
from __future__ import absolute_import, unicode_literals from django.conf import settings from django.conf.urls import include, url from django.views import static from casepro.backend import get_backend from casepro.utils.views import PartialTemplate urlpatterns = [ url(r'', include('casepro.cases.urls')), ...
bsd-3-clause
cblecker/test-infra
scenarios/kubernetes_build.py
11
6144
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # 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 appli...
apache-2.0
shabab12/edx-platform
openedx/core/djangoapps/course_groups/partition_scheme.py
105
4510
""" Provides a UserPartition driver for cohorts. """ import logging from courseware.masquerade import ( # pylint: disable=import-error get_course_masquerade, get_masquerading_group_info, is_masquerading_as_specific_student, ) from xmodule.partitions.partitions import NoSuchUserPartitionGroupError from .c...
agpl-3.0
wangkua1/sportvu
sportvu/detection_from_raw_pred.py
1
3391
"""detection_from_raw_pred.py * not super useful, a simple script that plots a) raw pred, b) gt pnr, c) detector output at 1 single setting Usage: detection_from_raw_pred.py <fold_index> <f_data_config> <f_model_config> <f_detect_config> --train Arguments: Example: """ from __future__ import absolute_import from ...
mit
ptisserand/ansible
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py
1
85955
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module...
gpl-3.0
akosel/incubator-airflow
airflow/contrib/kubernetes/volume.py
17
1345
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
mostafa-mahmoud/HyPRec
tests/collaborative_tests.py
2
2676
#!/usr/bin/env python import numpy import unittest from lib.abstract_recommender import AbstractRecommender from lib.collaborative_filtering import CollaborativeFiltering from lib.evaluator import Evaluator from util.data_parser import DataParser from util.model_initializer import ModelInitializer class TestcaseBase(...
apache-2.0