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
bretttegart/treadmill
tests/services/network_service_test.py
1
25230
"""Unit test for network_service - Treadmill Network configuration service. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import shutil import tempfile import unittest # Disable W0611: Unused import i...
apache-2.0
windedge/odoomrp-wip
stock_lock_lot/wizard/wiz_lock_lot.py
18
1358
# -*- encoding: utf-8 -*- ############################################################################## # # This program 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...
agpl-3.0
anderspetersson/django-bigbrother
bigbrother/graphs.py
1
1117
from bigbrother.core import get_module_by_slug from bigbrother.models import ModuleStat from django.db.models import Avg from datetime import datetime, timedelta import qsstats class Graph(): stopdate = datetime.utcnow() showpoints = False def get_graph_data(self, slug, *args, **kwargs): module =...
mit
martinbuc/missionplanner
Lib/site-packages/numpy/f2py/tests/test_array_from_pyobj.py
59
20418
import unittest import os import sys import copy import nose from numpy.testing import * from numpy import array, alltrue, ndarray, asarray, can_cast,zeros, dtype from numpy.core.multiarray import typeinfo import util wrap = None def setup(): """ Build the required testing extension module """ glob...
gpl-3.0
openstack/python-designateclient
designateclient/tests/test_utils.py
1
2478
# Copyright (c) 2015 Thales Services SAS # 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 i...
apache-2.0
Peratham/tweater
py/nltk/compat.py
4
3139
# Natural Language Toolkit: Compatibility Functions # # Copyright (C) 2001-2011 NLTK Project # Author: Steven Bird <sb@csse.unimelb.edu.au> # Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Backwards compatibility with previous versions...
gpl-3.0
mathjazz/pontoon
pontoon/api/tests/test_schema.py
2
8648
import sys from itertools import product import pytest from pontoon.base.models import Project, ProjectLocale from pontoon.test.factories import ProjectFactory @pytest.fixture def setup_excepthook(): # graphql-core's ExecutionContext.report_error uses sys.excepthook to # print error stack traces. According ...
bsd-3-clause
pgmillon/ansible
lib/ansible/modules/network/fortios/fortios_wireless_controller_setting.py
19
14023
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 Lic...
gpl-3.0
lalanza808/lalanza808.github.io
vendor/bundle/ruby/2.0.0/gems/pygments.rb-0.6.3/vendor/pygments-main/pygments/lexers/rdf.py
52
3814
# -*- coding: utf-8 -*- """ pygments.lexers.rdf ~~~~~~~~~~~~~~~~~~~ Lexers for semantic web and RDF query languages and markup. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups...
mit
hvy/chainer
chainer/optimizers/ada_delta.py
3
3514
import numpy import chainer from chainer.backends import cuda from chainer import optimizer from chainer import types if types.TYPE_CHECKING: import typing_extensions as tpe class AdaDeltaHyperparameter(tpe.Protocol): """Protocol class for hyperparameter of Zeiler's ADADELTA. This is only f...
mit
erjohnso/ansible
lib/ansible/modules/network/cloudvision/cv_server_provision.py
49
24405
#!/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 distributed...
gpl-3.0
resamsel/dbmanagr
src/tests/model/test_table.py
2
1843
# -*- coding: utf-8 -*- # # Copyright © 2014 René Samselnig # # This file is part of Database Navigator. # # Database Navigator 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, ...
gpl-3.0
yangming85/lettuce
tests/integration/lib/Django-1.2.5/django/db/models/related.py
81
2269
class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def template_name(self): raise NotImplementedError def __repr__(self): return repr(self.__d...
gpl-3.0
broferek/ansible
lib/ansible/modules/cloud/google/gcp_spanner_instance.py
13
13293
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
fvincenzo/mbed-os
tools/settings.py
10
3231
""" mbed SDK Copyright (c) 2016 ARM Limited 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, so...
apache-2.0
mugwizaleon/PCRasterMapstacks
pcrastermapstackvisualisation.py
1
17920
# -*- coding: utf-8 -*- """ /*************************************************************************** PcrasterMapstackVisualisation A QGIS plugin PCRaster Mapstack visualisation ------------------- begin : 2014-06-28 copy...
apache-2.0
adamtiger/tensorflow
tensorflow/contrib/receptive_field/python/util/graph_compute_order.py
25
2454
# Copyright 2017 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
antmicro/linux-sunxi
tools/perf/util/setup.py
766
1540
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/__init__.py
105
1973
# -*- coding: utf-8 -*- # # SelfTest/Random/__init__.py: Self-test for random number generation modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the exten...
apache-2.0
frederickjoe/SEUTools-Alfred-Workflow
bs4/builder/_html5lib.py
423
10647
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableStr...
mit
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_profile.py
96
7796
"""Test suite for the profile module.""" import sys import pstats import unittest import os from difflib import unified_diff from io import StringIO from test.support import TESTFN, run_unittest, unlink from contextlib import contextmanager import profile from test.profilee import testfunc, timer class ProfileTest(...
gpl-2.0
randynobx/ansible
lib/ansible/plugins/action/normal.py
62
2115
# (c) 2012, 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) any lat...
gpl-3.0
blueboxgroup/ansible
lib/ansible/utils/module_docs_fragments/openstack.py
118
4021
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
gpl-3.0
guewen/odoo
addons/payment_paypal/controllers/main.py
66
3201
# -*- coding: utf-8 -*- try: import simplejson as json except ImportError: import json import logging import pprint import urllib2 import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request _logger = logging.getLogger(__name__) class PaypalController(http.Controller): _noti...
agpl-3.0
vityagi/azure-linux-extensions
RDMAUpdate/main/CommandExecuter.py
8
1689
#!/usr/bin/env python # # VMEncryption extension # # Copyright 2015 Microsoft Corporation # # 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 #...
apache-2.0
potatolondon/django-nonrel-1-4
django/contrib/gis/gdal/geomtype.py
404
2967
from django.contrib.gis.gdal.error import OGRException #### OGRGeomType #### class OGRGeomType(object): "Encapulates OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0 : 'Unknown', 1 : 'Point', 2 ...
bsd-3-clause
voussoir/praw
praw/const.py
1
10141
"""praw constants.""" import sys __version__ = '5.2.1.dev0' API_PATH = { 'about_edited': 'r/{subreddit}/about/edited/', 'about_log': 'r/{subreddit}/about/log/', 'about_modqueue': 'r/{subreddit}/about/modqueue/', 'about_reports': 'r/{subreddit}/about/reports/', ...
gpl-3.0
AlphaCluster/NewsBlur
vendor/paypal/pro/helpers.py
18
12548
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import logging import pprint import time from django.conf import settings from django.forms.models import fields_for_model from django.http import QueryDict from django.utils.functional import cached_property from django.utils.http import urlencode from si...
mit
jhaux/tensorflow
tensorflow/compiler/tests/nullary_ops_test.py
122
2094
# Copyright 2017 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
memsharded/conan
conans/test/unittests/client/tools/test_env.py
1
2363
# coding=utf-8 import os import unittest import mock from conans.client.tools import env class ToolsEnvTest(unittest.TestCase): def test_environment_append_variables(self): with mock.patch.dict('os.environ', {}),\ env.environment_append({'env_var1': 'value', ...
mit
fernandoacorreia/DjangoWAWSLogging
DjangoWAWSLogging/env/Lib/site-packages/pywin32-218-py2.7-win32.egg/scripts/killProcName.py
38
1766
# Kills a process by process name # # Uses the Performance Data Helper to locate the PID, then kills it. # Will only kill the process if there is only one process of that name # (eg, attempting to kill "Python.exe" will only work if there is only # one Python.exe running. (Note that the current process does not # coun...
mit
ruzette/project-euler-solutions
old/src/pythagoras.py
1
1204
''' Project Euler Problem 9 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a**2 + b**2 = c**2 For example, 3**2 + 4**2 = 9 + 16 = 25 = 5**2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. Link : https://projecteuler.net/problem=...
gpl-2.0
zhuwenping/python-for-android
python-modules/twisted/twisted/conch/test/test_transport.py
49
73648
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for ssh/transport.py and the classes therein. """ try: import pyasn1 except ImportError: pyasn1 = None try: import Crypto.Cipher.DES3 except ImportError: Crypto = None if pyasn1 is not None and Crypto is not ...
apache-2.0
chauhanhardik/populo
cms/djangoapps/contentstore/views/tabs.py
125
7890
""" Views related to course tabs """ from student.auth import has_course_author_access from util.json_request import expect_json, JsonResponse from django.http import HttpResponseNotFound from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.views.dec...
agpl-3.0
Jgarcia-IAS/ReporsitorioVacioOdoo
openerp/addons/sale_analytic_plans/__init__.py
443
1208
# -*- 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
Vagab0nd/SiCKRAGE
lib3/js2py/pyjs.py
9
2904
from .base import * from .constructors.jsmath import Math from .constructors.jsdate import Date from .constructors.jsobject import Object from .constructors.jsfunction import Function from .constructors.jsstring import String from .constructors.jsnumber import Number from .constructors.jsboolean import Boolean from .co...
gpl-3.0
agileblaze/OpenStackTwoFactorAuthentication
openstack_dashboard/dashboards/admin/defaults/workflows.py
51
4515
# Copyright 2013 Kylin, 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...
apache-2.0
hkchenhongyi/django
tests/lookup/models.py
235
2178
""" The lookup API This demonstrates features of the database API. """ from __future__ import unicode_literals from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class Alarm(models.Model): desc = models.CharField(max_length=100) time = mo...
bsd-3-clause
dangoldin/bots
database.py
1
1126
#!/usr/bin/python import sqlite3 class Database: def __init__(self): self.connect() def connect(self): self.conn = sqlite3.connect('lifebot.db') def get_cursor(self): # A bit weird for now but trying to figure out SQLite try: return self.conn.cursor() ...
mit
dmkent/cattrack
cattrack/settings.py
1
4095
""" Django settings for cattrack project. Generated by 'django-admin startproject' using Django 1.9.5. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import date...
mit
cloudera/hue
desktop/core/ext-py/boto-2.46.1/tests/integration/dynamodb/test_table.py
136
3553
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
apache-2.0
liuyi1112/rst2pdf
rst2pdf/tenjin.py
10
38176
# -*- coding: utf-8 -*- ## ## $Rev: 137 $ ## $Release: 0.6.2 $ ## copyright(c) 2007-2008 kuwata-lab.com all rights reserved. ## ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of this software and associated documentation files (the ## "Software"), to deal in the Software without rest...
mit
jellysheep/pyload
module/lib/beaker/cache.py
45
15814
"""Cache object The Cache object is used to manage a set of cache files and their associated backend. The backends can be rotated on the fly by specifying an alternate type when used. Advanced users can add new backends in beaker.backends """ import warnings import beaker.container as container import beaker.u...
gpl-3.0
sashs/Ropper
ropper/ropchain/arch/ropchainx86.py
1
45777
# coding=utf-8 # Copyright 2018 Sascha Schirra # # 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 the following di...
bsd-3-clause
chromium/chromium
tools/perf/page_sets/webgl_supported_shared_state.py
10
1431
# Copyright 2015 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 logging from telemetry.page import shared_page_state class WebGLSupportedSharedState(shared_page_state.SharedPageState): def CanRunOnBrowser(self, ...
bsd-3-clause
anbangleo/NlsdeWeb
Python-3.6.0/Lib/test/test_deque.py
2
34169
from collections import deque import unittest from test import support, seq_tests import gc import weakref import copy import pickle from io import StringIO import random import struct BIG = 100000 def fail(): raise SyntaxError yield 1 class BadCmp: def __eq__(self, other): raise RuntimeError cl...
mit
mewtaylor/django
tests/template_tests/filter_tests/test_pluralize.py
430
1200
from decimal import Decimal from django.template.defaultfilters import pluralize from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_integers(self): self.assertEqual(pluralize(1), '') self.assertEqual(pluralize(0), 's') self.assertEqual(pluralize(2), 's')...
bsd-3-clause
pinghe/ensime-sublime
rpc.py
2
19402
from __future__ import unicode_literals import inspect import functools from functools import partial as bind from . import sexp from .sexp import key, sym import collections # ############################# DATA STRUCTURES ############################## class ActiveRecord(object): @classmethod def parse_list...
mit
jazzTheJackRabbit/blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/__init__.py
194
7698
# -*- coding: utf-8 -*- """ pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEX...
mit
christian-oudard/htmltreediff
setup.py
1
1156
#! /usr/bin/env python # -*- coding: utf-8 -*- import codecs try: from setuptools import setup, find_packages, Command except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Command long_description = codecs.open("README.rst", "r", "utf-8...
bsd-3-clause
wonder-sk/QGIS
tests/src/python/test_offline_editing_wfs.py
3
4833
# -*- coding: utf-8 -*- """ Offline editing Tests. WFS-T tests need using QGIS Server through qgis_wrapped_server.py. This is an integration test for QGIS Desktop WFS-T provider and QGIS Server WFS-T that check if QGIS offline editing works with a WFS-T endpoint. The test uses testdata/wfs_transactional/wfs_transact...
gpl-2.0
wanderine/nipype
nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py
9
2534
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.freesurfer.model import Label2Vol def test_Label2Vol_inputs(): input_map = dict(annot_file=dict(argstr='--annot %s', copyfile=False, mandatory=True, requires=('subject_id', 'hemi'), ...
bsd-3-clause
gem/oq-hazardlib
openquake/hazardlib/source/multi.py
1
4887
# The Hazard Library # Copyright (C) 2012-2017 GEM Foundation # # This program 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 your option) any later version. #...
agpl-3.0
haiyangd/python-show-me-the-code-
Jimmy66/0017/0017.py
34
1660
#!/bin/env python # -*- coding: utf-8 -*- #要填json坑,前面写的代码,json部分是网上找的,还没有完全理解,尤其是相关的字符串编码没有实践 #抽空了解下从xls文件读取数据的库 #xls -> json -> xml 是我的思路,当然也可以尝试下直接xls -> xml #主要还是比较看重json的应用。有时候感觉看了别人的代码,不自己用另一种方式实现,(即使变得复杂啰嗦)还是别人的代码 #导入模块 import xlrd #这个是系统自带的,如果安装lxml遇到问题可以使用这个 import xml.etree.ElementTree as ET from xml.dom im...
mit
Sidney84/pa-chromium
third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_table.py
33
7098
#!/usr/bin/python2 # (C) Copyright IBM Corporation 2004 # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the ri...
bsd-3-clause
jreback/pandas
pandas/io/formats/latex.py
2
25201
""" Module for formatting output data in Latex. """ from abc import ABC, abstractmethod from typing import Iterator, List, Optional, Sequence, Tuple, Type, Union import numpy as np from pandas.core.dtypes.generic import ABCMultiIndex from pandas.io.formats.format import DataFrameFormatter def _split_into_full_shor...
bsd-3-clause
sander76/home-assistant
tests/components/profiler/test_init.py
6
4819
"""Test the Profiler config flow.""" from datetime import timedelta import os from unittest.mock import patch from homeassistant import setup from homeassistant.components.profiler import ( CONF_SCAN_INTERVAL, CONF_SECONDS, CONF_TYPE, SERVICE_DUMP_LOG_OBJECTS, SERVICE_MEMORY, SERVICE_START, ...
apache-2.0
catalan42/jna
native/libffi/generate-osx-source-and-headers.py
100
5200
#!/usr/bin/env python import subprocess import re import os import errno import collections import sys class Platform(object): pass sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)') def sdkinfo(sdkname): ret = {} for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIP...
lgpl-2.1
Aralicia/Tybalt-DiscordBot
cogs/streams.py
5
26330
from discord.ext import commands from .utils.dataIO import dataIO from .utils.chat_formatting import escape_mass_mentions from .utils import checks from collections import defaultdict from string import ascii_letters from random import choice import discord import os import re import aiohttp import asyncio import loggi...
gpl-3.0
saurabh6790/trufil_app
selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.py
9
1985
# 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 webnotes from webnotes.utils import cint def execute(filters=None): if not filters: filters ={} days_since_last_order = filters.get("days_...
agpl-3.0
ericawright/bedrock
tests/pages/home.py
5
1514
# 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 selenium.webdriver.common.by import By from pages.base import BasePage from pages.regions.download_button import D...
mpl-2.0
DelvarWorld/three.js
utils/exporters/blender/addons/io_three/exporter/material.py
70
3806
from .. import constants, logger from . import base_classes, utilities, api class Material(base_classes.BaseNode): """Class that wraps material nodes""" def __init__(self, node, parent): logger.debug("Material().__init__(%s)", node) base_classes.BaseNode.__init__(self, node, parent, ...
mit
kaktus018/ca_wizard_mechanical
cawm_classes.py
1
55264
# ca_wizard_mechanical, version 0.2 # Allows the generation of comm-files for simple 3D structural analyses in code_aster with an interactive GUI # # This work is licensed under the terms and conditions of the GNU General Public License version 3 # Copyright (C) 2017 Dominik Lechleitner # Contact: kakt...
gpl-3.0
patricmutwiri/pombola
pombola/south_africa/fallback_urls.py
4
2260
from django.conf.urls import patterns, include, url from pombola.south_africa.views import ( OldSectionRedirect, OldSpeechRedirect, SASpeechView, SASectionView, SAHansardIndex, SACommitteeIndex, SAQuestionIndex, SASpeakerRedirectView) # We add redirects for the old-style SayIt patterns, so that old # ...
agpl-3.0
RedHatSatellite/sat6_disconnected_tools
check_sync.py
1
5114
#!/usr/bin/python #title :check_sync.py #description :Checks Satellite 6 repository sync status #URL :https://github.com/RedHatSatellite/sat6_disconnected_tools #author :Geoff Gatward <ggatward@redhat.com> #notes :This script is NOT SUPPORTED by Red Hat Global Support Servic...
gpl-3.0
elim/django-rest-framework
rest_framework/negotiation.py
71
4244
""" Content negotiation deals with selecting an appropriate renderer given the incoming request. Typically this will be based on the request's Accept header. """ from __future__ import unicode_literals from django.http import Http404 from rest_framework import HTTP_HEADER_ENCODING, exceptions from rest_framework.set...
bsd-2-clause
crazyskateface/LC
chat/migrations/0002_auto__add_field_comments_datetime.py
1
4344
# -*- 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 field 'Comments.datetime' db.add_column(u'chat_comments', 'datet...
mit
timothsp/where2ate
venv/lib/python3.3/site-packages/pkg_resources/__init__.py
211
106670
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
cc0-1.0
lmazuel/azure-sdk-for-python
azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage.py
2
2114
# 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 ...
mit
vdhan/focus-booster
__main__.py
1
7987
import os from threading import Thread from tkinter import * from tkinter.ttk import * from pydub import AudioSegment from pydub.playback import play class Core(Tk): def get_w(self): return self._w class Application(Frame): def __init__(self, master=None, **kw): super().__init__(master, **k...
gpl-3.0
dushu1203/chromium.src
third_party/cython/src/Cython/Compiler/CmdLine.py
90
8191
# # Cython - Command Line Parsing # import os import sys import Options usage = """\ Cython (http://cython.org) is a compiler for code written in the Cython language. Cython is based on Pyrex by Greg Ewing. Usage: cython [options] sourcefile.{pyx,py} ... Options: -V, --version Display version ...
bsd-3-clause
ooici/coi-services
ion/agents/data/test/test_external_dataset_agent_slocum.py
1
19351
#!/usr/bin/env python """ @package ion.agents.data.test.test_external_dataset_agent_slocum @file ion/agents/data/test/test_external_dataset_agent_slocum.py @author Christopher Mueller @brief """ # Import pyon first for monkey patching. from pyon.public import log, IonObject from pyon.ion.resource import PRED, RT from...
bsd-2-clause
testvidya11/ejrf
questionnaire/views/questions.py
1
2642
from django.contrib import messages from django.core.urlresolvers import reverse, reverse_lazy from django.http import HttpResponseRedirect from django.views.generic import ListView, CreateView, DeleteView from questionnaire.forms.questions import QuestionForm from questionnaire.models import Question, Questionnaire ...
bsd-3-clause
c0hen/django-venv
lib/python3.4/site-packages/django/contrib/gis/gdal/prototypes/geom.py
48
4777
from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_envelope from django.contrib.gis.gdal.prototypes.generation import ( const_string_...
gpl-3.0
awangga/smsweb
bson/errors.py
77
1156
# 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...
agpl-3.0
gautam1858/tensorflow
tensorflow/contrib/graph_editor/util.py
39
17675
# 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
ekalosak/boto
boto/ec2/spotinstancerequest.py
170
7288
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, 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 # w...
mit
lllcho/CAPTCHA-breaking
keras-master/tests/auto/keras/test_activations.py
79
2185
import math import keras import theano import theano.tensor as T import numpy def list_assert_equal(a, b, round_to=7): ''' This will do a pairwise, rounded equality test across two lists of numbers. ''' pairs = zip(a, b) for i, j in pairs: assert round(i, round_to) == round(j, round_t...
mit
2014c2g12/c2g12
c2wp/wsgi/static/Brython2.1.0-20140419-113919/Lib/io.py
58
9385
import builtins open = builtins.open # for seek() SEEK_SET = 0 SEEK_CUR = 1 SEEK_END = 2 r"""File-like objects that read from or write to a string buffer. This implements (nearly) all stdio methods. f = StringIO() # ready for writing f = StringIO(buf) # ready for reading f.close() # explicitly rel...
gpl-2.0
stephan-hof/pyrocksdb
setup.py
1
1112
from setuptools import setup from setuptools import find_packages from distutils.extension import Extension try: from Cython.Build import cythonize except ImportError: def cythonize(extensions): return extensions sources = ['rocksdb/_rocksdb.cpp'] else: sources = ['rocksdb/_rocksdb.pyx'] mod1 = Extens...
bsd-3-clause
2013Commons/hue
desktop/core/ext-py/urllib2_kerberos-0.1.6/urllib2_kerberos.py
44
5663
#!/usr/bin/python # urllib2 with kerberos proof of concept # Copyright 2008 Lime Nest LLC # Copyright 2008 Lime Spot LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
apache-2.0
srajag/contrail-controller
src/config/utils/provision_database_node.py
10
5513
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import time import argparse import ConfigParser from vnc_api.vnc_api import * from cfgm_common.exceptions import * class DatabaseNodeProvisioner(object): def __init__(self, args_str=None): self._args = Non...
apache-2.0
saurabh6790/test_final_med_app
patches/1311/p06_fix_report_columns.py
30
1270
# 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 webnotes import json def execute(): doctypes_child_tables_map = {} # Get all saved report columns columns = webnotes.conn.sql("""select d...
agpl-3.0
hce/antlr4
runtime/Python2/src/antlr4/RuleContext.py
14
8627
# [The "BSD license"] # Copyright (c) 2013 Terence Parr # Copyright (c) 2013 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. Redistr...
bsd-3-clause
coblo/pyiscclib
src/iscclib/base.py
1
6592
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from future.builtins import int, object import re import six import unicodedata import random from abc import ABCMeta from bitstring import BitArray class Component(object): """Base class for all ISCC identifier components"""...
bsd-2-clause
rosshamish/classtime
classtime/brain/local_db/stdlocaldb.py
1
4950
from classtime.logging import logging logging = logging.getLogger(__name__) #pylint: disable=C0103 from classtime.core import db from classtime.models import Term, Schedule, Course, Section class StandardLocalDatabase(object): """A single institution's view of the local database Uses a stack-based accessor ...
mit
QinerTech/QinerApps
openerp/addons/pos_cache/models/pos_cache.py
13
3295
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from ast import literal_eval import cPickle from openerp import models, fields, api class pos_cache(models.Model): _name = 'pos.cache' cache = fields.Binary() product_domain = fields.Text(required=True) ...
gpl-3.0
jstammers/EDMSuite
NavPython/IronPython/Lib/distutils/command/build_ext.py
71
32327
"""distutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id$" import sys, os, string, re from types import * fr...
mit
umlfri/umlfri2
umlfri2/application/tablist.py
1
4454
from umlfri2.application.events.solution import CloseSolutionEvent from .events.model import DiagramDeletedEvent from .events.tabs import OpenTabEvent, ChangedCurrentTabEvent, ClosedTabEvent from .tab import Tab class TabList: def __init__(self, application): self.__tabs = [] self.__application = ...
gpl-3.0
epitron/youtube-dl
youtube_dl/extractor/fc2.py
24
5591
# coding: utf-8 from __future__ import unicode_literals import hashlib import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_request, compat_urlparse, ) from ..utils import ( ExtractorError, sanitized_Request, urlencode_postdata, ) class FC2IE(Info...
unlicense
byt3smith/CIRTKit
modules/reversing/viper/peepdf/ccitt.py
43
15515
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ccitt.py TODO http://tools.ietf.org/pdf/rfc804.pdf http://code.google.com/p/origami-pdf/source/browse/lib/origami/filters/ccitt.rb """ __author__ = 'Binjo' __version__ = '0.1' __date__ = '2012-04-08 14:30:05' class BitWriterException(Exception): pass class B...
mit
jhayworth/config
.emacs.d/elpy/rpc-venv/lib/python2.7/site-packages/pip/_internal/commands/uninstall.py
10
2983
# The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False from __future__ import absolute_import from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cli.base_command import Command from pip._internal.cli.req_command import SessionCommandMixin ...
gpl-3.0
jamesblunt/edx-platform
lms/djangoapps/commerce/api/v1/tests/test_models.py
127
1169
""" Tests for models. """ import ddt from django.test import TestCase from commerce.api.v1.models import Course from course_modes.models import CourseMode @ddt.ddt class CourseTests(TestCase): """ Tests for Course model. """ def setUp(self): super(CourseTests, self).setUp() self.course = Cour...
agpl-3.0
leighpauls/k2cro4
third_party/python_26/Lib/test/test_print.py
51
3867
"""Test correct operation of the print function. """ # In 2.6, this gives us the behavior we want. In 3.0, it has # no function, but it still must parse correctly. from __future__ import print_function import unittest from test import test_support import sys if sys.version_info[0] == 3: # 3.x from io impor...
bsd-3-clause
ozburo/youtube-dl
youtube_dl/extractor/usatoday.py
20
2703
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, get_element_by_attribute, parse_duration, try_get, update_url_query, ) from ..compat import compat_str class USATodayIE(InfoExtractor): _VALID_URL = r'https?://(?:ww...
unlicense
rockstor/rockstor-core
src/rockstor/smart_manager/views/samba_service.py
2
6882
""" Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
Loodoor/UrWorld-Alpha-3.x
src/compressor.py
1
2667
import pickle import re from itertools import groupby class RLECompress: def __init__(self, file): self.file = file def verifier(self, objet): if isinstance(objet, list): return all(map(lambda elt: isinstance(elt, list), objet)) return False def dump(self, objet): ...
gpl-2.0
agx/libvirt-sandbox-debian
libvirt-sandbox/image/cli.py
1
9075
#!/usr/bin/python -Es # -*- coding: utf-8 -*- # Authors: Daniel P. Berrange <berrange@redhat.com> # Eren Yagdiran <erenyagdiran@gmail.com> # # Copyright (C) 2013-2015 Red Hat, Inc. # Copyright (C) 2015 Universitat Politècnica de Catalunya. # # This program is free software; you can redistribute it and/or modif...
lgpl-2.1
OS2World/APP-INTERNET-torpak_2
Tools/scripts/md5sum.py
102
2386
#! /usr/bin/env python """Python utility to print MD5 checksums of argument files. """ bufsize = 8096 fnfilter = None rmode = 'rb' usage = """ usage: sum5 [-b] [-t] [-l] [-s bufsize] [file ...] -b : read files in binary mode (default) -t : read files in text mode (you almost certainly don't want this!...
mit
CTSRD-SOAAP/chromium-42.0.2311.135
third_party/mesa/src/src/gallium/auxiliary/util/u_format_parse.py
13
8935
#!/usr/bin/env python ''' /************************************************************************** * * Copyright 2009 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), ...
bsd-3-clause