repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
joaoandrepsilva/dota2py
setup.py
2
1121
#!/usr/bin/env python """ ========= dota2py ========= dota2py contains both a replay parser and a thin wrapper for the Dota 2 WebAPI. Installation ============ Install via pip:: $ pip install dota2py or, install via easy_install:: $ easy_install dota2py Documentation ============= ...
mit
Distrotech/antlr4
runtime/Python3/src/antlr4/atn/SemanticContext.py
11
12109
# # [The "BSD license"] # Copyright (c) 2012 Terence Parr # Copyright (c) 2012 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redis...
bsd-3-clause
hamiltont/CouchPotatoServer
libs/guessit/date.py
150
4095
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
bb111189/Arky2
boilerplate/external/babel/messages/tests/frontend.py
30
29828
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
lgpl-3.0
mattcongy/itshop
docker-images/taigav2/taiga-back/taiga/base/utils/functions.py
2
1069
# -*- coding: utf-8 -*- # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net> # Copyright (C) 2014-2016 Anler Hernández ...
mit
zaydhach/PyBotWarPro
libs/jython/Lib/email/message.py
92
30220
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Basic message object for the email package object model.""" __all__ = ['Message'] import re import uu import binascii import warnings from cStringIO import StringIO # Intrapackage imports import email.char...
gpl-2.0
EduPepperPDTesting/pepper2013-testing
cms/djangoapps/models/settings/course_metadata.py
4
3984
from xmodule.modulestore import Location from contentstore.utils import get_modulestore from xmodule.modulestore.inheritance import own_metadata from xblock.fields import Scope from xmodule.course_module import CourseDescriptor from cms.xmodule_namespace import CmsBlockMixin class CourseMetadata(object): ''' ...
agpl-3.0
Azulinho/ansible
lib/ansible/modules/network/cloudengine/ce_snmp_contact.py
22
6832
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
matthiasdiener/spack
var/spack/repos/builtin/packages/pocl/package.py
3
4855
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
chzhou/robotframework-selenium2library
src/Selenium2Library/keywords/_formelement.py
32
14530
import os from keywordgroup import KeywordGroup class _FormElementKeywords(KeywordGroup): # Public, form def submit_form(self, locator=None): """Submits a form identified by `locator`. If `locator` is empty, first form in the page will be submitted. Key attributes for forms are `id` ...
apache-2.0
ak2703/edx-platform
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
18
13252
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.core.urlresolvers import reverse from django.test.client import RequestFactory from mock import patch from nose.plugins.attrib import attr from capa.tests.response_xml_factory import StringResponseXMLFactory from coursewa...
agpl-3.0
pnakis/qgis_vector_transform
test/test_vector_transform_dialog.py
1
1563
# coding=utf-8 """Dialog test. .. 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. """ __author__ = 'pna...
gpl-3.0
fceller/arangodb
3rdParty/boost/1.62.0/tools/litre/litre.py
67
1906
from docutils import writers from docutils import nodes class LitreTranslator(nodes.GenericNodeVisitor): def __init__(self, document, config): nodes.GenericNodeVisitor.__init__(self,document) self._config = config def default_visit(self, node): pass # print '**visiting...
apache-2.0
justanr/django-rest-framework
tests/test_utils.py
68
4827
from __future__ import unicode_literals from django.conf.urls import url from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.utils import six import rest_framework.utils.model_meta from rest_framework.utils.breadcrumbs import get_breadcrumbs from rest_framework.utils.m...
bsd-2-clause
mesosphere/marathon-python
marathon/models/task.py
6
3375
from datetime import datetime from .base import MarathonResource, MarathonObject class MarathonTask(MarathonResource): """Marathon Task resource. :param str app_id: application id :param health_check_results: health check results :type health_check_results: list[:class:`marathon.models.MarathonHealt...
mit
jim-cooley/abletonremotescripts
remote-scripts/samples/Twister_Device_Control/consts.py
1
1670
#Embedded file name: /Users/versonator/Hudson/live/Projects/AppLive/Resources/MIDI Remote Scripts/LPD8/consts.py """ The following consts should be substituted with the Sys Ex messages for requesting a controller's ID response and that response to allow for automatic lookup""" ID_REQUEST = 0 ID_RESP = 0 GENERIC_STOP = ...
apache-2.0
linktlh/Toontown-journey
toontown/uberdog/DistributedDeliveryManagerAI.py
5
1707
from direct.directnotify import DirectNotifyGlobal from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedDeliveryManagerAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDeliveryManagerAI") def hello(self, todo0): pass def ...
apache-2.0
emfcamp/micropython
tests/basics/async_for2.py
49
1024
# test waiting within "async for" aiter/anext functions import sys if sys.implementation.name == 'micropython': # uPy allows normal generators to be awaitables coroutine = lambda f: f else: import types coroutine = types.coroutine @coroutine def f(x): print('f start:', x) yield x + 1 yield...
mit
nespinoza/flicker-noise
install.py
1
1839
import shutil,os,sys,subprocess,glob def getDirs(foldername): return os.walk(foldername).next()[1] os.chdir('WaveletCode') print "\n" print "\t ################ PyMC WAVELET CODE ################" print "\n " print "\t Author: Nestor Espinoza (nespino@astro.puc.cl)" print "\n" print "\t ----------------...
mit
0xwindows/shadowsocks
shadowsocks/local.py
1015
2248
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
yagimimi/miyalab_slide2
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
12751
#!/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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
mit
ahaym/eden
controllers/asset.py
8
7713
# -*- coding: utf-8 -*- """ Asset Management Functionality http://eden.sahanafoundation.org/wiki/BluePrint/Assets """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ----------------------------------...
mit
WeblateOrg/weblate
weblate/screenshots/tasks.py
2
1509
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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 Lice...
gpl-3.0
subutai/nupic.research
nupic/research/frameworks/pytorch/models/not_so_densenet.py
3
13799
# Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or modify # it unde...
agpl-3.0
haoxli/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_default-src_self_frame_allowed-manual.py
30
2474
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) response.headers.set("Content-Security-Policy", "default-src 'self'") response.headers.set("X...
bsd-3-clause
bigswitch/tempest
tempest/cmd/init.py
1
7173
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
AOSP-S4-KK/platform_external_chromium_org
third_party/protobuf/python/google/protobuf/internal/python_message.py
223
42601
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
kigawas/shadowsocks
shadowsocks/encrypt.py
22
6598
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
ndufresne/totem
src/plugins/pythonconsole/console.py
1
12303
# -*- coding: utf-8 -*- # console.py -- Console widget # # Copyright (C) 2006 - Steve Frécinaux # # 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, or (at your option) # any lat...
gpl-2.0
becm/meson
mesonbuild/environment.py
1
82245
# Copyright 2012-2016 The Meson development team # 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 agree...
apache-2.0
bealdav/OpenUpgrade
openerp/addons/base/tests/test_translate.py
460
1941
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
juvoinc/airflow
airflow/operators/bash_operator.py
12
3790
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
moberweger/deep-prior
src/trainer/optimizer.py
1
2621
"""Basis for different optimization algorithms. Optimizer provides interface for creating the update rules for gradient based optimization. It includes SGD, NAG, RMSProp, etc. Copyright 2015 Markus Oberweger, ICG, Graz University of Technology <oberweger@icg.tugraz.at> This file is part of DeepPrior. DeepPrior is f...
gpl-3.0
pianomania/scikit-learn
doc/sphinxext/sphinx_gallery/docs_resolv.py
23
16468
# -*- coding: utf-8 -*- # Author: Óscar Nájera # License: 3-clause BSD ############################################################################### # Documentation link resolver objects from __future__ import print_function import gzip import os import posixpath import re import shelve import sys # Try Python 2 fir...
bsd-3-clause
delving/nave
nave/void/utils/xml2json.py
1
5725
#!/usr/bin/env python """xml2json.py Convert XML to JSON Relies on ElementTree for the XML parsing. This is based on pesterfish.py but uses a different XML->JSON mapping. The XML->JSON mapping is described at http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html Rewritten to a command line utili...
gpl-2.0
cnsoft/kbengine-cocos2dx
kbe/res/scripts/common/Lib/test/test_dbm_ndbm.py
60
1176
from test import support support.import_module("dbm.ndbm") #skip if not supported import unittest import os import random import dbm.ndbm from dbm.ndbm import error class DbmTestCase(unittest.TestCase): def setUp(self): self.filename = support.TESTFN self.d = dbm.ndbm.open(self.filename, 'c') ...
lgpl-3.0
yochow/autotest
utils/reindent.py
17
10422
#! /usr/bin/env python # Released to the public domain, by Tim Peters, 03 October 2000. """reindent [-d][-r][-v] [ path ... ] -d (--dryrun) Dry run. Analyze, but don't make any changes to, files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -n (--nobackup) No backup. Does not make a...
gpl-2.0
ericfc/django
tests/httpwrappers/tests.py
63
27550
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import copy import json import os import pickle import unittest import uuid from django.core.exceptions import SuspiciousOperation from django.core.serializers.json import DjangoJSONEncoder from django.core.signals import request_finished from django.d...
bsd-3-clause
ioannistsanaktsidis/invenio
modules/websubmit/lib/functions/Create_Cplx_Approval.py
35
2589
## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later ...
gpl-2.0
SoftwareExperiment4/SungkyunWiki
testproject/testproject/wsgi.py
15
1421
""" WSGI config for testproject project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
gpl-3.0
dgzurita/odoo
addons/account_bank_statement_extensions/res_partner_bank.py
381
1582
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
acsone/bank-statement-reconcile
account_bank_statement_period_from_line_date/model/__init__.py
10
1258
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Therp BV - http://therp.nl. # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # cons...
agpl-3.0
DynamicGravitySystems/DGP
dgp/gui/widgets/workspace_widget.py
1
3811
# -*- coding: utf-8 -*- import PyQt5.QtWidgets as QtWidgets from PyQt5.QtGui import QContextMenuEvent, QKeySequence from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QAction from dgp.core.oid import OID from ..workspaces.base import WorkspaceTab class _WorkspaceTabBar(QtWidgets.QTabBar): """Custom Tab Bar ...
apache-2.0
heroku/salesforce-utils
setup.py
2
1500
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() packages = [ 'salesforce_utils', 'salesforce_utils.data', 'salesforce_utils...
mit
jenisys/behave
examples/fixture.no_background/behave_fixture_lib/no_background.py
3
2353
# -*- coding: UTF-8 -*- # RELATED-TO: #756 """ Example code how to provide a behave fixture to disable the background inheritance mechanism. .. code-block:: gherkin # -- FILE: features/example.feature Feature: Show how @fixture.behave.override_background is used Background: Given a backgrou...
bsd-2-clause
sergiobenrocha2/mgba
src/platform/python/mgba/image.py
4
1344
# Copyright (c) 2013-2016 Jeffrey Pfau # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from ._pylib import ffi, lib from . import png class Image: def __init__(self,...
mpl-2.0
bhansa/fireball
pyvenv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py
384
6309
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from . import base from .. import _ihatexml def ensure_str(s): if s is None: return None elif isinstance(s, text_type): ...
gpl-3.0
RockinRobin/seednetwork
seedlibrary/migrations/0005_GRIN_and_addtl_fields.py
1
1699
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2017-03-11 03:36 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('seedlibrary', '0004_fix_integernulls'), ] operations = [ migrations.RenameFi...
mit
kapteyn-astro/kapteyn
doc-org/conf.py
1
10347
# -*- coding: utf-8 -*- # # Kapteyn Package documentation build configuration file, created by # sphinx-quickstart on Wed Jun 3 10:34:58 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file....
bsd-3-clause
NoctuaNivalis/qutebrowser
tests/unit/completion/test_completer.py
2
12192
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2017 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # 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 Software...
gpl-3.0
kdwink/intellij-community
plugins/hg4idea/testData/bin/mercurial/scmwindows.py
94
1669
import os import osutil import util import _winreg def systemrcpath(): '''return default os-specific hgrc search path''' rcpath = [] filename = util.executablepath() # Use mercurial.ini found in directory with hg.exe progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini') if os.path.i...
apache-2.0
jolicloud/jolicloud-daemon
jolicloud_daemon/managers/info.py
2
1431
#!/usr/bin/env python __author__ = 'Jeremy Bethmont' import os import grp from twisted.python import log from twisted.plugin import getPlugins from jolicloud_daemon.plugins import LinuxSessionManager from jolicloud_daemon.enums import * from jolicloud_daemon import managers class InfoManager(LinuxSessionManager): ...
gpl-2.0
google/timesketch
api_client/python/timesketch_api_client/error.py
1
4019
# Copyright 2019 Google 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 applicable law or a...
apache-2.0
gptech/ansible
test/units/executor/test_playbook_executor.py
60
6304
# (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
janusnic/youtube-dl-GUI
youtube_dl/extractor/grooveshark.py
24
7179
# coding: utf-8 from __future__ import unicode_literals import time import math import os.path import re from .common import InfoExtractor from ..compat import ( compat_html_parser, compat_urllib_parse, compat_urllib_request, compat_urlparse, ) from ..utils import ExtractorError class GroovesharkHt...
mit
googleinterns/wss
third_party/slim/datasets/visualwakewords.py
3
4353
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
postlund/home-assistant
tests/components/cloud/test_binary_sensor.py
3
1481
"""Tests for the cloud binary sensor.""" from unittest.mock import Mock from homeassistant.components.cloud.const import DISPATCHER_REMOTE_UPDATE from homeassistant.setup import async_setup_component async def test_remote_connection_sensor(hass): """Test the remote connection sensor.""" from homeassistant.co...
apache-2.0
vmj/slacklog
test/ParserTests.py
1
4254
# coding=utf-8 # encoding: utf-8 import unittest from slacklog.scripts import read from slacklog.parsers import SlackLogParser from datetime import datetime from dateutil import tz class ParserTests (unittest.TestCase): def test_slackware_leet_release_entry(self): log = SlackLogParser().parse(read('./tes...
gpl-3.0
flingone/frameworks_base_cmds_remoted
libs/boost/libs/python/test/enum.py
12
1840
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from enum_ext import * >>> identity(color.red) # in case of duplicated enums it always take the last enum enum_ext.color...
apache-2.0
Jgarcia-IAS/SAT
openerp/addons/gamification/models/res_users.py
386
4010
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
ingwinlu/pelican-plugins
org_reader/org_reader.py
17
4004
""" Org Reader ========== Version 1.1. Relevant Pelican settings: - ORG_READER_EMACS_LOCATION: Required. Location of Emacs binary. - ORG_READER_EMACS_SETTINGS: Optional. An absolute path to an Elisp file, to run per invocation. Useful for initializing the `package` Emacs library if that's where your Org mode co...
agpl-3.0
petrutlucian94/nova_dev
nova/tests/pci/test_pci_stats.py
16
4341
# Copyright (c) 2012 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
anthgur/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/mockParser.py
452
1263
from __future__ import absolute_import, division, unicode_literals import sys import os if __name__ == '__main__': # Allow us to import from the src directory os.chdir(os.path.split(os.path.abspath(__file__))[0]) sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src"))) from html5lib.tokenizer ...
mpl-2.0
UDST/orca
orca/server/tests/test_server.py
2
10740
import json import orca import numpy as np import pandas as pd import pandas.testing as pdt import pytest from .. import server @pytest.fixture def tapp(): server.app.config['TESTING'] = True return server.app.test_client() @pytest.fixture(scope='module') def dfa(): return pd.DataFrame( {'a': ...
bsd-3-clause
opennode/nodeconductor-assembly-waldur
src/waldur_core/logging/admin.py
1
4388
import json from django import forms from django.contrib import admin from django.contrib.auth.models import Group from django.db import transaction from django.shortcuts import redirect from django.template.defaultfilters import filesizeformat from django.urls import reverse from django.utils.translation import ugett...
mit
vedujoshi/os_tempest
tempest/services/volume/xml/volumes_client.py
2
17196
# Copyright 2012 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/LICENSE-2.0 # # Unless required by app...
apache-2.0
ajdawson/iris
lib/iris/tests/test_analysis_calculus.py
6
27301
# (C) British Crown Copyright 2010 - 2016, 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...
gpl-3.0
onecloud/neutron
neutron/services/vpn/agent.py
4
4994
# Copyright 2013, Nachi Ueno, NTT I3, 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...
apache-2.0
tml/pyxer
src/pyxer/utils/__init__.py
2
7650
# -*- coding: UTF-8 -*- ############################################# ## (C)opyright by Dirk Holtwick, 2008 ## ## All rights reserved ## ############################################# # import pyxer.utils.jsonhelper import os import os.path import sys import types import logging log = logging.g...
mit
peteraquino/iLocatorBridge
iLocator.py
1
13825
#!/usr/bin/env python from pyicloud import PyiCloudService from math import radians, cos, sin, asin, sqrt from datetime import datetime from datetime import timedelta import ConfigParser import sys import os import time import requests import base64 import logging import argparse #DEFAULT_CONFIG = 'configuration.ini'...
mit
Aerotenna/Firmware
Tools/px_process_module_doc.py
3
4031
#!/usr/bin/env python ############################################################################ # # Copyright (C) 2017 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # ...
bsd-3-clause
vlachoudis/sl4a
python/src/Lib/encodings/cp424.py
593
12311
""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.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,input,errors='...
apache-2.0
happyleavesaoc/home-assistant
homeassistant/components/automation/event.py
8
1353
""" Offer event listening automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/docs/automation/trigger/#event-trigger """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const im...
apache-2.0
lcamacho/airmozilla
airmozilla/manage/views/related.py
5
3318
import datetime import pyelasticsearch from django.shortcuts import render, redirect from django.contrib import messages from django.conf import settings from airmozilla.main.models import Event from airmozilla.manage import related # tongue twister from airmozilla.manage import forms from .decorators import superu...
bsd-3-clause
arju88nair/projectCulminate
venv/lib/python3.5/site-packages/pylint/test/input/func_noerror_new_style_class_py_30.py
17
1247
"""check builtin data descriptors such as mode and name attributes on a file are correctly handled bug notified by Pierre Rouleau on 2005-04-24 """ from __future__ import print_function __revision__ = None class File(file): # pylint: disable=file-builtin """ Testing new-style class inheritance from file""" ...
apache-2.0
40223119/w16b_test
static/Brython3.1.0-20150301-090019/Lib/pydoc.py
637
102017
#!/usr/bin/env python3 """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydoc <name>" to show documentation ...
gpl-3.0
shanemcd/ansible
lib/ansible/modules/network/nxos/nxos_udld_interface.py
4
9047
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
40223234/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/test/regrtest.py
718
65317
#! /usr/bin/python3.3 """ Usage: python -m test [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] If no arguments or options are provided, finds all files matching the pattern "test_*" in the Lib/test subdirectory and runs them in alphabetical order ...
agpl-3.0
invisiblek/python-for-android
python-modules/twisted/twisted/conch/client/direct.py
60
3234
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.internet import defer, protocol, reactor from twisted.conch import error from twisted.conch.ssh import transport from twisted.python import log class SSHClientFactory(protocol.ClientFactory): def __init__(self, d, o...
apache-2.0
oleiade/etcaetera
tests/test_config.py
2
7653
import pytest import tempfile import json import os from etcaetera.config import Config from etcaetera.adapter import ( Adapter, Defaults, Overrides, File, Env ) class TestConfig: def test_init_with_defaults_provided(self): defaults_adapter = Defaults({"abc": "123"}) config = ...
mit
PaddlePaddle/Paddle
python/paddle/fluid/tests/unittests/mkldnn/test_reduce_bf16_mkldnn_op.py
1
8433
# Copyright (c) 2021 PaddlePaddle 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 app...
apache-2.0
fpieper/py2neo
py2neo/store.py
2
2727
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2014, Nigel Small # # 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 # # Unle...
apache-2.0
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/urllib2.py
33
51551
"""An extensible library for opening URLs using a variety of protocols The simplest way to use this module is to call the urlopen function, which accepts a string containing a URL or a Request object (described below). It opens the URL and returns the results as file-like object; the returned object has some extra me...
mit
jeezybrick/django
django/utils/translation/trans_real.py
115
28036
"""Translation helper functions.""" from __future__ import unicode_literals import gettext as gettext_module import os import re import sys import warnings from collections import OrderedDict from threading import local from django.apps import apps from django.conf import settings from django.conf.locale import LANG_...
bsd-3-clause
klebercode/modelpage
modelpage/event/migrations/0001_initial.py
1
5232
# -*- 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): # Adding model 'Calendar' db.create_table(u'event_calendar', ( ...
mit
krishna-pandey-git/django
django/contrib/flatpages/migrations/0001_initial.py
134
1604
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='FlatPage', fields=[ ...
bsd-3-clause
diametric/lightblue-0.4
build/lib/lightblue/_IOBluetoothUI.py
82
2076
# Copyright (c) 2009 Bea Lam. All rights reserved. # # This file is part of LightBlue. # # LightBlue is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
pouta/bitcoin
qa/rpc-tests/reindex.py
144
1063
#!/usr/bin/env python2 # Copyright (c) 2014 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 -reindex with CheckBlockIndex # from test_framework.test_framework import BitcoinTestFramework from t...
mit
rafaelmds/fatiando
cookbook/vis_myv_color.py
9
1152
""" Vis: Set the colors in figures, prisms, polygonal prisms and tesseroids. """ from fatiando.mesher import Prism, PolygonalPrism, Tesseroid from fatiando.vis import myv prism = Prism(1, 2, 1, 2, 0, 1, {'density': 1}) polyprism = PolygonalPrism([[3, 1], [4, 2], [5, 1]], -1, 2, {'density': 2}) tesseroid = Tesseroid(10...
bsd-3-clause
remind101/stacker_blueprints
stacker_blueprints/firehose/base.py
1
8298
from awacs.aws import ( Allow, Condition, Policy, Statement, StringEquals, StringLike, ) import awacs.logs import awacs.s3 import awacs.firehose import awacs.kms from awacs.helpers.trust import make_simple_assume_statement from stacker.blueprints.base import Blueprint from troposphere import ...
bsd-2-clause
rchatterjee/nocrack
newcode/pcfg/build_int_dawg.py
1
1983
import os import sys BASE_DIR = os.getcwd() sys.path.append(BASE_DIR) from dawg import IntDAWG from helper import open_ sum_freq = 0 def get_f_w_freq(line): """ <freq> <word> format """ x = line.strip().split() global sum_freq sum_freq += int(x[0]) return x[1], int(x[0]) def get_wi...
mit
jcftang/ansible
lib/ansible/modules/network/netvisor/pn_vrouterlbif.py
29
10126
#!/usr/bin/python """ PN CLI vrouter-loopback-interface-add/remove """ # # 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 yo...
gpl-3.0
optimsoc/gzll-binutils
gdb/testsuite/gdb.python/py-objfile-script-gdb.py
46
1961
# Copyright (C) 2011-2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
plxaye/chromium
src/tools/telemetry/telemetry/page/page_test_unittest.py
33
4010
# 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. import os import unittest from telemetry.page import page as page_module from telemetry.page import page_test from telemetry.page.actions import all_page...
apache-2.0
CTRoundTable/Encrypted.Cash
qa/rpc-tests/hardforkdetection.py
5
2234
#!/usr/bin/env python2 # # Test hard fork detection # from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import os import shutil class HardForkDetectionTest(BitcoinTestFramework): alert_filename = None # Set by setup_network def setup_network(self): se...
mit
Taranys/Sick-Beard
sickbeard/helpers.py
5
28455
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 Lice...
gpl-3.0
kubaszostak/gdal-dragndrop
osgeo/apps/Python27/Lib/site-packages/numpy/doc/byteswapping.py
25
5349
""" ============================= Byteswapping and byte order ============================= Introduction to byte ordering and ndarrays ========================================== The ``ndarray`` is an object that provide a python array interface to data in memory. It often happens that the memory that you want to v...
mit
quickresolve/accel.ai
flask-aws/lib/python2.7/site-packages/yaml/cyaml.py
537
3290
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
mit
adamfisk/littleshoot-client
server/appengine/littleshoot/authViews.py
1
9476
from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import AuthenticationForm from registration.forms import RegistrationForm from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm...
gpl-2.0
sorki/faf
src/pyfaf/storage/migrations/versions/7fa8b3134f0_probable_fix_by_opsy.py
2
1916
# Copyright (C) 2014 ABRT Team # Copyright (C) 2014 Red Hat, Inc. # # This file is part of faf. # # faf 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) ...
gpl-3.0