repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
juanifioren/django-oidc-provider
oidc_provider/tests/cases/test_claims.py
2
2911
from __future__ import unicode_literals from django.test import TestCase from django.utils.six import text_type from django.utils.translation import override as override_language from oidc_provider.lib.claims import ScopeClaims, StandardScopeClaims, STANDARD_CLAIMS from oidc_provider.tests.app.utils import create_fak...
mit
brijeshkesariya/odoo
addons/stock/stock.py
56
270177
# -*- 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
balint256/gnuradio
gr-analog/python/analog/qa_phase_modulator.py
10
1758
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
sfrenza/test-for-bot
venv/Lib/site-packages/nltk/tgrep.py
2
38859
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Natural Language Toolkit: TGrep search # # Copyright (C) 2001-2017 NLTK Project # Author: Will Roberts <wildwilhelm@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT ''' ============================================ TGrep search implementa...
mit
jreeder/avoplot
setup.py
3
8591
#Copyright (C) Nial Peters 2013 # #This file is part of AvoPlot. # #AvoPlot 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. # #AvoPlot is ...
gpl-3.0
ericgriffin/fflock
web2py/scripts/layout_make.py
34
3061
import glob import os import zipfile import sys import re from BeautifulSoup import BeautifulSoup as BS def head(styles): title = '<title>{{=response.title or request.application}}</title>' items = '\n'.join(["{{response.files.append(URL(request.application,'static','%s'))}}" % (style) for style in styles]) ...
apache-2.0
nschloe/maelstrom
maelstrom/stabilization.py
1
5232
# -*- coding: utf-8 -*- # """ Stabilization techniques for PDEs with dominating convection. The classical article about SUPG is :cite:`brooks`; for an overview of methods, see :cite:`sold1`, :cite:`sold2`, and :cite:`bgs2004`. """ from dolfin import CompiledExpression, compile_cpp_code def supg(mesh, convection, diff...
mit
lubosz/cerbero
cerbero/bootstrap/__init__.py
14
1055
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
brandon-rhodes/numpy
numpy/polynomial/tests/test_classes.py
122
17714
"""Test inter-conversion of different polynomial classes. This tests the convert and cast methods of all the polynomial classes. """ from __future__ import division, absolute_import, print_function import operator as op from numbers import Number import numpy as np from numpy.polynomial import ( Polynomial, Leg...
bsd-3-clause
roberthawdon/toonbot
lobby/admin_announce.py
1
1099
#!/usr/bin/env python from __main__ import * import time import MySQLdb import sys import json import urllib2 import re import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) from confload import To...
gpl-3.0
siggame/Joueur.py
games/anarchy/game_object.py
1
2541
# GameObject: An object in the game. The most basic class that all game classes should inherit from automatically. # DO NOT MODIFY THIS FILE # Never try to directly create an instance of this class, or modify its member variables. # Instead, you should only be reading its variables and calling its functions. from typ...
mit
elkingtowa/alphacoin
Bitcoin/ngcccbase-master/ngcccbase/address.py
1
2610
from pycoin.ecdsa.secp256k1 import generator_secp256k1 as BasePoint from pycoin.encoding import (b2a_hashed_base58, from_bytes_32, to_bytes_32, a2b_hashed_base58, public_pair_to_bitcoin_address, public_pair_to_hash160_sec) class InvalidAddressError(Exception)...
mit
Triv90/Nova
nova/scheduler/baremetal_host_manager.py
42
2490
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011 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.o...
apache-2.0
hoodie/libavg
src/utils/avg_checkspeed.py
4
7164
#!/usr/bin/env python # -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2003-2014 Ulrich von Zadow # # This library 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 # vers...
lgpl-2.1
emesene/emesene
windows/boot_common.py
2
3729
# Common py2exe boot script - executed for all target types. # When we are a windows_exe we have no console, and writing to # sys.stderr or sys.stdout will sooner or later raise an exception, # and tracebacks will be lost anyway (see explanation below). # # We assume that output to sys.stdout can go to the bitsi...
gpl-3.0
rivasd/djPsych
djstim/models/BasicStimuli.py
1
3065
''' Created on Feb 24, 2016 @author: dan_1_000 ''' from django.db import models from django.utils.translation import ugettext_lazy as l_ from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType import json class LinkedStimulus(model...
gpl-3.0
thaim/ansible
lib/ansible/plugins/terminal/nos.py
177
1962
# # (c) 2018 Extreme Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
mit
eahneahn/free
lib/python2.7/site-packages/PIL/Image.py
5
71385
# # The Python Imaging Library. # $Id$ # # the Image class wrapper # # partial release history: # 1995-09-09 fl Created # 1996-03-11 fl PIL release 0.0 (proof of concept) # 1996-04-30 fl PIL release 0.1b1 # 1999-07-28 fl PIL release 1.0 final # 2000-06-07 fl PIL release 1.1 # 2000-10-20 fl PIL release 1.1.1...
agpl-3.0
wolfg1969/my-wechat-app
wx_message_handler.py
1
1638
# coding=utf-8 from wechat_sdk.exceptions import ParseError import wx_bot __author__ = 'guoyong' __version__ = '0.1' def get_handler(request, wechat): signature = request.args.get('signature', '') timestamp = request.args.get('timestamp', '') nonce = request.args.get('nonce', '') echostr = request....
mit
openstack/sahara-tests
sahara_tests/utils/crypto.py
2
2330
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
madj4ck/ansible
v1/ansible/runner/action_plugins/fail.py
161
1472
# Copyright 2012, Dag Wieers <dag@wieers.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 later versi...
gpl-3.0
zakuro9715/lettuce
tests/integration/lib/Django-1.3/django/core/serializers/xml_serializer.py
293
11885
""" XML serializer. """ from django.conf import settings from django.core.serializers import base from django.db import models, DEFAULT_DB_ALIAS from django.utils.xmlutils import SimplerXMLGenerator from django.utils.encoding import smart_unicode from xml.dom import pulldom class Serializer(base.Serializer): """ ...
gpl-3.0
yury-s/v8-inspector
Source/chrome/tools/deep_memory_profiler/tests/dmprof_test.py
123
7106
#!/usr/bin/env python # 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. import cStringIO import logging import os import sys import textwrap import unittest BASE_PATH = os.path.dirname(os.path.dirname(o...
bsd-3-clause
kYc0o/RIOT
tests/test_tools/tests/01-run.py
14
2209
#!/usr/bin/env python3 """Test behaviour of the test running and the term program interaction.""" import sys import pexpect from testrunner import run def _shellping(child, timeout=1): """Issue a 'shellping' command. Raises a pexpect exception on failure. :param timeout: timeout for the answer """ ...
lgpl-2.1
neilLasrado/erpnext
erpnext/selling/doctype/customer/customer_dashboard.py
1
1141
from __future__ import unicode_literals from frappe import _ def get_data(): return { 'heatmap': True, 'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'), 'fieldname': 'customer', 'non_standard_fieldnames': { 'Payment Entry': 'party', 'Quotation...
gpl-3.0
jagguli/intellij-community
plugins/hg4idea/testData/bin/mercurial/config.py
93
6729
# config.py - configuration parsing for Mercurial # # Copyright 2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from i18n import _ import error, util import os, errno class sortdict...
apache-2.0
ChonchoFronto/sarah
lambda/numpy/distutils/fcompiler/intel.py
29
6626
# http://developer.intel.com/software/products/compilers/flin/ from __future__ import division, absolute_import, print_function import sys from numpy.distutils.ccompiler import simple_version_match from numpy.distutils.fcompiler import FCompiler, dummy_fortran_file compilers = ['IntelFCompiler', 'IntelVisualFCompile...
mit
10clouds/edx-platform
common/test/acceptance/tests/studio/test_studio_outline.py
13
81678
""" Acceptance tests for studio related to the outline page. """ import json from datetime import datetime, timedelta import itertools from pytz import UTC from bok_choy.promise import EmptyPromise from nose.plugins.attrib import attr from ...pages.studio.settings_advanced import AdvancedSettingsPage from ...pages.stu...
agpl-3.0
AloneRoad/Inforlearn
.google_appengine/lib/django/django/db/backends/sqlite3/base.py
32
6888
""" SQLite3 backend for django. Requires pysqlite2 (http://pysqlite.org/). """ from django.db.backends import util try: try: from sqlite3 import dbapi2 as Database except ImportError: from pysqlite2 import dbapi2 as Database except ImportError, e: import sys from django.core.exceptions...
apache-2.0
gdi2290/django
tests/template_tests/test_unicode.py
60
1342
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import TestCase from django.template import Template, TemplateEncodingError, Context from django.utils.safestring import SafeData from django.utils import six class UnicodeTests(TestCase): def test_template(self): # Templates ...
bsd-3-clause
wiki05/youtube-dl
youtube_dl/extractor/audiomack.py
114
5790
# coding: utf-8 from __future__ import unicode_literals import itertools import time from .common import InfoExtractor from .soundcloud import SoundcloudIE from ..utils import ( ExtractorError, url_basename, ) class AudiomackIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?audiomack\.com/song/(?P<id...
unlicense
philsch/ansible
lib/ansible/modules/cloud/misc/helm.py
15
5363
#!/usr/bin/python # (c) 2016, Flavio Percoco <flavio@redhat.com> # # This module 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. # # Th...
gpl-3.0
JelleZijlstra/cython
Cython/Compiler/Scanning.py
7
17304
# cython: infer_types=True, language_level=3, py2_import=True # # Cython Scanner # from __future__ import absolute_import import cython cython.declare(make_lexicon=object, lexicon=object, print_function=object, error=object, warning=object, os=object, platform=object) import os import...
apache-2.0
RO-ny9/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/spreadsheet/text_db_test.py
128
7522
#!/usr/bin/python # # Copyright Google 2007-2008, 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 ...
apache-2.0
wolverton-research-group/fitpot
fitpot/tests/run_ipr.py
1
1388
from ipr import * from numpy import linspace run = Optimizer() run.load_data('/home/sjk648/tmp/Al') genome = Genome genome.template = ''' species Al core 0.0 {eam}manybody {eam}Al core Al core 0 12 {lennard}lennard 6 12 {lennard}Al core Al core {eps} {sigma} 0.0 {scaled} {eam}eam_density power {power} {eam}Al cor...
mit
viveksh13/gymkhana
venv/lib/python2.7/site-packages/werkzeug/formparser.py
295
21205
# -*- coding: utf-8 -*- """ werkzeug.formparser ~~~~~~~~~~~~~~~~~~~ This module implements the form parsing. It supports url-encoded forms as well as non-nested multipart uploads. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more deta...
apache-2.0
derekross/HTC_DNA_Kernel
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
terrycain/razer_drivers
scripts/razer_mouse/driver/is_charging.py
5
1538
#!/usr/bin/python3 import argparse import glob import os import sys def parse_args(): parser = argparse.ArgumentParser(description="Get charging status") parser.add_argument('-d', '--device', type=str, help="Device string like \"0003:1532:0045.000C\"") args = parser.parse_args() return args def run...
gpl-2.0
edx/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/formwizard/tests.py
104
1813
import re from django import forms from django.test import TestCase class FormWizardWithNullBooleanField(TestCase): urls = 'regressiontests.formwizard.urls' input_re = re.compile('name="([^"]+)" value="([^"]+)"') wizard_url = '/wiz/' wizard_step_data = ( { '0-name': 'Pony', ...
gpl-3.0
avanzosc/avanzosc6.1
avanzosc_many2many_attachments/product_product_ext.py
1
1348
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2014 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
rg3/youtube-dl
youtube_dl/extractor/nfl.py
60
9148
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, ) from ..utils import ( ExtractorError, int_or_none, remove_end, ) class NFLIE(InfoExtractor): IE_NAME = 'nfl.com' _VALID_URL = r'''(?x) ...
unlicense
bousmalis/models
compression/decoder.py
18
4655
#!/usr/bin/python # # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
tumbl3w33d/ansible
lib/ansible/module_utils/network/netvisor/netvisor.py
38
1971
# Copyright: (c) 2018, Pluribus Networks # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) # from __future__ import absolute_import, division, print_function __metaclass__ = type import json from ansible.module_utils._text import to_text from ansible.module_uti...
gpl-3.0
bregman-arie/ansible
lib/ansible/modules/network/avi/avi_errorpageprofile.py
41
4468
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
gpl-3.0
hassoon3/odoo
addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
309
10685
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # Adapted by Noviat to # - enforce correct vat number # - support negative balance # - assign...
agpl-3.0
Wojtechnology/Muzit
StreetMuse/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
apache-2.0
abdullah2891/remo
vendor-local/lib/python/tablib/formats/_xlsx.py
6
2918
# -*- coding: utf-8 -*- """ Tablib - XLSX Support. """ import sys if sys.version_info[0] > 2: from io import BytesIO else: from cStringIO import StringIO as BytesIO from tablib.compat import openpyxl Workbook = openpyxl.workbook.Workbook ExcelWriter = openpyxl.writer.excel.ExcelWriter get_column_letter = ...
bsd-3-clause
rdmilligan/SaltwashAR
scripts/features/shapes/shapesfunctions.py
1
2737
# Copyright (C) 2016 Ross D Milligan # GNU GENERAL PUBLIC LICENSE Version 3 (full notice can be found at https://github.com/rdmilligan/SaltwashAR) from OpenGL.GL import * gl_list_pyramid = None gl_list_cube = None def draw_pyramid(rotation): global gl_list_pyramid glTranslatef(0.0,0.0,-8.0) glRotatef(ro...
gpl-3.0
mheiges/sshuttle
ssh.py
16
3425
import sys, os, re, socket, zlib import compat.ssubprocess as ssubprocess import helpers from helpers import * def readfile(name): basedir = os.path.dirname(os.path.abspath(sys.argv[0])) path = [basedir] + sys.path for d in path: fullname = os.path.join(d, name) if os.path.exists(fullname)...
lgpl-2.1
ATIX-AG/ansible
lib/ansible/modules/network/aci/aci_switch_policy_vpc_protection_group.py
25
8598
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com> # 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 ANSIBLE_METADATA = {'metadata_...
gpl-3.0
mbauskar/omnitech-erpnext
erpnext/hr/report/employee_birthday/employee_birthday.py
120
1328
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() dat...
agpl-3.0
LockScreen/Backend
venv/lib/python2.7/site-packages/requests/models.py
27
29196
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
mit
froyobin/horizon
openstack_dashboard/dashboards/admin/volumes/snapshots/tests.py
34
4219
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
ros2/launch
launch/launch/launch_service.py
1
17843
# Copyright 2018 Open Source Robotics Foundation, 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...
apache-2.0
vegitron/r-pass
r_pass/models.py
2
1102
from django.db import models from django_fields.fields import EncryptedTextField, EncryptedCharField import re class Host(models.Model): cname = models.CharField(max_length=250, unique=True) class Group(models.Model): source_id = models.CharField(max_length=250, unique=True) class Service(models.Model): ...
apache-2.0
jasonseminara/OpenSourceFinal
lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
1004
9544
# The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # urllib3 _Default = object() def current...
mit
VitalPet/odoo
addons/event/wizard/event_confirm.py
53
1442
# -*- 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
figure002/setlyze
setlyze/main.py
1
3656
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010-2015, GiMaRIS <info@gimaris.com> # # This file is part of SETLyze - A tool for analyzing the settlement # of species on SETL plates. # # SETLyze is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Li...
gpl-3.0
stonier/ecto
test/scripts/test_dual_line_plasm.py
4
2926
#!/usr/bin/env python # # Copyright (c) 2011, Willow Garage, 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 # n...
bsd-3-clause
KJin99/zulip
zerver/lib/debug.py
122
1113
from __future__ import absolute_import import code import traceback import signal # Interactive debugging code from # http://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application # (that link also points to code for an interactive remote debugger # setup, which we might want if ...
apache-2.0
CHL-WIS/WIS_PAC
python_codes/ww3_field.py
2
1044
def read_fields_ww3(self): import numpy as np import glob hsfile = sorted(glob.glob(fdir + 'ww3.*.' + fext)) input_file = open (hsfile[0],'r') line = input_fiel.readline().split() ilon = int(line[6]) jlon = int(line[9]) header = {'lonw':float(line[4]),'lone':float(line[5]),'ilon':int(...
gpl-2.0
djw8605/condor
src/condor_contrib/campus_factory/python-lib/campus_factory/OfflineAds/OfflineAds.py
7
9719
# I'm lazy MINUTE = 60 HOUR = MINUTE * 60 from campus_factory.util.ExternalCommands import RunExternal from campus_factory.OfflineAds.ClassAd import ClassAd, SortClassAdsByElement import time import random import logging from GlideinWMS.condorMonitor import CondorStatus class OfflineAds: def __init__(self,...
apache-2.0
oemof/examples
oemof_examples/oemof.solph/v0.2.x/generic_chp/mchp.py
2
2936
# -*- coding: utf-8 -*- """ General description: --------------------- Example that illustrates how to use custom component `GenericCHP` can be used. In this case it is used to model a motoric chp. Installation requirements: --------------------------- This example requires the latest version of oemof. Install by: ...
gpl-3.0
Kagami/kisa
lib/twisted/internet/_posixstdio.py
75
5599
# -*- test-case-name: twisted.test.test_stdio -*- """Standard input/out/err support. Future Plans:: support for stderr, perhaps Rewrite to use the reactor instead of an ad-hoc mechanism for connecting protocols to transport. Maintainer: James Y Knight """ import warnings, errno, os from zope.interf...
cc0-1.0
edx/edx-platform
lms/djangoapps/commerce/api/v1/permissions.py
5
1294
""" Custom API permissions. """ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from rest_framework.permissions import BasePermission, DjangoModelPermissions from openedx.core.lib.api.permissions import ApiKeyHeaderPermission from ...utils import is_account_activation...
agpl-3.0
arahuja/scikit-learn
sklearn/externals/joblib/func_inspect.py
50
11253
""" My own variation on function-specific inspect-like features. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. from itertools import islice import inspect import warnings import re import os from ._compat import _basestrin...
bsd-3-clause
kirca/OpenUpgrade
addons/l10n_vn/__init__.py
425
1067
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved. # # This program is free software: you can redistribute it and/or...
agpl-3.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/matplotlib/blocking_input.py
8
11792
""" This provides several classes used for blocking interaction with figure windows: :class:`BlockingInput` creates a callable object to retrieve events in a blocking way for interactive sessions :class:`BlockingKeyMouseInput` creates a callable object to retrieve key or mouse clicks in a blocking way...
mit
Lcarvajal/Lcarvajal.github.io
node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
9537
# Copyright (c) 2013 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 shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
mit
vaginessa/pyload
module/plugins/accounts/BitshareCom.py
6
1197
# -*- coding: utf-8 -*- from module.plugins.internal.Account import Account class BitshareCom(Account): __name__ = "BitshareCom" __type__ = "account" __version__ = "0.15" __status__ = "testing" __description__ = """Bitshare account plugin""" __license__ = "GPLv3" __authors__ ...
gpl-3.0
Duoxilian/home-assistant
tests/components/sensor/test_min_max.py
13
8489
"""The test for the min/max sensor platform.""" import unittest from homeassistant.bootstrap import setup_component from homeassistant.const import ( STATE_UNKNOWN, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS, TEMP_FAHRENHEIT) from tests.common import get_test_home_assistant class TestMinMaxSensor(unittest.TestCase):...
mit
turbokongen/home-assistant
homeassistant/components/xiaomi_aqara/binary_sensor.py
9
18504
"""Support for Xiaomi aqara binary sensors.""" import logging from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOISTURE, DEVICE_CLASS_OPENING, BinarySensorEntity, ) from homeassistant.core import callback from homeassistant.helpers.event import async_call_later from . import XiaomiDevice ...
apache-2.0
sergicollado/godot
platform/windows/detect.py
28
11986
# # tested on | Windows native | Linux cross-compilation # ------------------------+-------------------+--------------------------- # MSVS C++ 2010 Express | WORKS | n/a # Mingw-w64 | WORKS | WORKS # Mingw-w32 | WORKS | WORKS # M...
mit
jacky-young/crosswalk-test-suite
misc/webdriver-w3c-tests/client/wait.py
263
3563
# Copyright 2011 Software Freedom Conservancy. # # 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 agre...
bsd-3-clause
talkincode/txportal
txportal/packet/cmcc.py
1
22856
#!/usr/bin/env python #coding:utf-8 import struct import random import hashlib from txportal.packet import pktutils import binascii import six import copy import itertools md5_constructor = hashlib.md5 random_generator = random.SystemRandom() __CurrentSN = random_generator.randrange(1, 32767) """ REQ_CHALLENGE 0x01...
mit
tectronics/madcow
madcow/include/twisted/python/deprecate.py
9
3924
# -*- test-case-name: twisted.python.test.test_deprecate -*- # Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Deprecation framework for Twisted. To mark a method or function as being deprecated do this:: def badAPI(self, first, second): ''' Docstring for badAPI. ...
gpl-3.0
cedk/odoo
openerp/modules/loading.py
131
21198
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
zhaochl/python-utils
utils/db_util.py
1
6679
#!/usr/bin/env python # coding=utf-8 import MySQLdb CONST_DB_CONFIG ={ 'online_w':{ 'host':'localhost', 'port':3306, 'user':'root', 'passwd':'root', 'db':'mydb' }, } """ db_add('irweb','spy_config',data_dict) """ def db_add(server,table,data_dict,dbg=False): conn = N...
apache-2.0
robhudson/kuma
vendor/packages/setuptools/command/rotate.py
461
2038
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os from setuptools import Command from setuptools.compat import basestring class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N n...
mpl-2.0
spraints/for-example
tests/test-parseindex2.py
5
4941
from mercurial import parsers from mercurial.node import nullid, nullrev import struct # This unit test compares the return value of the original Python # implementation of parseindex and the new C implementation for # an index file with and without inlined data # original python implementation def gettype(q): re...
gpl-2.0
richardxdh/ml_algorithms
decisionTrees/cart.py
1
12048
# -*- coding: utf8 -*- import copy import numpy as np from sklearn import tree as SKTREE from sklearn.externals.six import StringIO from sklearn.datasets import load_iris import graphviz NODE = 'node' LEAF = 'leaf' CLF = "classifier" REG = "regression" DISCRETE = "discrete" CONTINUOUS = "continuous" COMPARATOR = {DIS...
gpl-3.0
mustafat/odoo-1
addons/website_partner/__openerp__.py
383
1498
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
timm/timmnix
pypy3-v5.5.0-linux64/lib-python/3/test/test_email/__init__.py
28
5528
import os import sys import unittest import test.support import email from email.message import Message from email._policybase import compat32 from test.test_email import __file__ as landmark # Run all tests in package for '-m unittest test.test_email' def load_tests(loader, standard_tests, pattern): this_dir = os...
mit
mgerola/OpenVirteX
utils/thrift/server/THttpServer.py
53
3147
# # 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...
mit
RandallDW/Aruba_plugin
plugins/org.python.pydev/pysrc/_pydev_runfiles/pydev_runfiles_pytest2.py
1
10669
from _pydev_runfiles import pydev_runfiles_xml_rpc import pickle import zlib import base64 import os import py from pydevd_file_utils import _NormFile import pytest import sys import time #========================================================================= # Load filters with tests we should skip #=============...
epl-1.0
ryfeus/lambda-packs
Tensorflow/source/tensorboard/plugins/image/metadata.py
7
2440
# 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...
mit
stuhood/buck
third-party/py/twitter-commons/src/python/twitter/common/python/platforms.py
23
3230
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
priseborough/ardupilot
Tools/LogAnalyzer/tests/TestOptFlow.py
32
14968
from LogAnalyzer import Test,TestResult import DataflashLog from math import sqrt import numpy as np import matplotlib.pyplot as plt class TestFlow(Test): '''test optical flow sensor scale factor calibration''' # # Use the following procedure to log the calibration data. is assumed that the optical flow ...
gpl-3.0
gengue/django-new-marana
{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/config/urls.py
1
1539
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.conf.urls import include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from django.views.generic import TemplateView from rest_framework.routers import Defaul...
bsd-3-clause
tuturto/pyherc
src/herculeum/ui/gui/eventdisplay.py
1
4491
# -*- coding: utf-8 -*- # Copyright (c) 2010-2017 Tuukka Turto # # 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,...
mit
sbalde/edx-platform
common/lib/xmodule/xmodule/capa_base.py
15
62153
"""Implements basics of Capa, including class CapaModule.""" import cgi import copy import datetime import hashlib import json import logging import os import traceback import struct import sys import re # We don't want to force a dependency on datadog, so make the import conditional try: import dogstats_wrapper a...
agpl-3.0
openhatch/new-mini-tasks
vendor/packages/Django/django/conf/locale/de_CH/formats.py
107
1389
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' DA...
apache-2.0
nortikin/sverchok
nodes/field/scalar_field_eval.py
1
2960
import numpy as np import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty, StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level, match_long_repeat from sverchok.utils.modules.eval_form...
gpl-3.0
danielharbor/openerp
addons/account_payment/__init__.py
436
1279
# -*- 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
lepistone/odoo
addons/report/models/report.py
22
23158
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
abdoosh00/edraak
common/test/acceptance/tests/test_discussion.py
3
21773
""" Tests for discussion pages """ from uuid import uuid4 from .helpers import UniqueCourseTest from ..pages.lms.auto_auth import AutoAuthPage from ..pages.lms.courseware import CoursewarePage from ..pages.lms.discussion import ( DiscussionTabSingleThreadPage, InlineDiscussionPage, InlineDiscussionThreadP...
agpl-3.0
jazkarta/edx-platform
cms/djangoapps/contentstore/management/commands/create_course.py
163
2188
""" Django management command to create a course in a specific modulestore """ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from xmodule.modulestore import ModuleStoreEnum from contentstore.views.course import create_new_course_in_store from contentstore....
agpl-3.0
TrinkCore/linux-core
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
The-Compiler/qutebrowser
tests/end2end/features/test_zoom_bdd.py
2
1151
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
gpl-3.0
funkring/fdoo
addons-funkring/sale_purchase_quotation/purchase.py
1
6337
# -*- coding: utf-8 -*- ############################################################################# # # Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
agpl-3.0