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
pschmitt/home-assistant
homeassistant/components/solarlog/sensor.py
8
5803
"""Platform for solarlog sensors.""" import logging from urllib.parse import ParseResult, urlparse from requests.exceptions import HTTPError, Timeout from sunwatcher.solarlog.solarlog import SolarLog import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.config_entries...
apache-2.0
machinalis/iepy
iepy/webui/corpus/signals.py
2
1840
# -*- coding: utf-8 -*- from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_delete, pre_delete from django.dispatch import receiver from iepy.data import models @receiver(pre_delete, sender=models.EntityOccurrence) def pre_eo_delete(sender, instance, **kwargs): instanc...
bsd-3-clause
clovett/MissionPlanner
Lib/genericpath.py
77
3120
""" Path operations common to more than one OS Do not use directly. The OS specific modules import the appropriate functions from this module themselves. """ import os import stat __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', 'getsize', 'isdir', 'isfile'] # Does a p...
gpl-3.0
jimi-c/ansible
lib/ansible/plugins/callback/timer.py
143
1529
# (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callback: timer callback_type: aggregate requir...
gpl-3.0
egafford/sahara
sahara/tests/unit/service/validation/edp/test_job_binary_internal.py
2
2338
# Copyright (c) 2015 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
sserrot/champion_relationships
venv/Lib/site-packages/zmq/backend/cffi/context.py
1
1916
# coding: utf-8 """zmq Context class""" # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. from ._cffi import C, ffi from .constants import EINVAL, IO_THREADS, LINGER from zmq.error import ZMQError, InterruptedSystemCall, _check_rc class Context(object): _zmq_ctx = None...
mit
denny820909/builder
lib/python2.7/site-packages/zope.interface-3.6.4-py2.7-linux-x86_64.egg/zope/interface/adapter.py
22
22327
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
mit
twz915/django
tests/auth_tests/test_templates.py
6
3391
from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( PasswordChangeDoneView, PasswordChangeView, PasswordResetCompleteView, PasswordResetDoneView, PasswordResetView, ) f...
bsd-3-clause
realsaiko/odoo
openerp/workflow/instance.py
314
5594
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2014 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
andim27/magiccamp
build/lib/django/contrib/auth/tests/tokens.py
27
1244
TOKEN_GENERATOR_TESTS = """ >>> from django.contrib.auth.models import User, AnonymousUser >>> from django.contrib.auth.tokens import PasswordResetTokenGenerator >>> from django.conf import settings >>> u = User.objects.create_user('tokentestuser', 'test2@example.com', 'testpw') >>> p0 = PasswordResetTokenGenerator() >...
bsd-3-clause
temasek/android_external_chromium_org
media/tools/layout_tests/layouttest_analyzer_helpers_unittest.py
166
9247
#!/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 copy from datetime import datetime import os import pickle import time import unittest import layouttest_analyzer_helpers ...
bsd-3-clause
p4lang/behavioral-model
tools/cpplint.py
1
262071
#!/usr/bin/env python3 # # Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this lis...
apache-2.0
wodny/ncdu-export
find2flat.py
1
1653
#!/usr/bin/env python3 # Convert find output to flat JSON compatible with other tools. # # Copyright (C) 2018 Marcin Szewczyk, marcin.szewczyk[at]wodny.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...
gpl-3.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/dbm/dumb.py
11
12279
"""A dumb and slow but simple dbm clone. For database spam, spam.dir contains the index (a text file), spam.bak *may* contain a backup of the index (also a text file), while spam.dat contains the data (a binary file). XXX TO DO: - seems to contain a bug when updating... - reclaim free space (currently, space once o...
apache-2.0
andrewfu0325/gem5-aladdin
ext/ply/test/yacc_noerror.py
174
1473
# ----------------------------------------------------------------------------- # yacc_noerror.py # # No p_error() rule defined. # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import token...
bsd-3-clause
IronLanguages/ironpython3
Src/StdLib/Lib/test/test_ast.py
12
43999
import os import sys import unittest import ast import weakref from test import support def to_tuple(t): if t is None or isinstance(t, (str, int, complex)): return t elif isinstance(t, list): return [to_tuple(e) for e in t] result = [t.__class__.__name__] if hasattr(t, 'lineno') and ha...
apache-2.0
wenhuwang/awesome-webapp
www/pymonitor.py
1
1713
#!/usr/bin/env python # -*- coding:utf-8 -*- import os,sys,time,subprocess from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler def log(s): print '[Monitor] %s'%s class MyFileSystemEventHandler(FileSystemEventHandler): def __init__(self,fn): super(MyFileSystemEve...
gpl-3.0
kidaa/encoded
src/encoded/tests/test_access_key.py
1
5771
import pytest def basic_auth(username, password): from base64 import b64encode from pyramid.compat import ascii_native_ return 'Basic ' + ascii_native_(b64encode(('%s:%s' % (username, password)).encode('utf-8'))) def auth_header(access_key): return basic_auth(access_key['access_key_id'], access_key[...
mit
SimplyMinimal/Liberarsi
calendar-cmd-line-sample/apiclient/model.py
102
11708
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
davidhrbac/spacewalk
client/debian/packages-already-in-debian/rhnlib/test/08-leaking-fd.py
36
2671
#!/usr/bin/python # # tests leaking file descriptors # # # USAGE: $0 SERVER SYSTEMID import os import sys sys.path.append('..') from rhn.rpclib import Server, GETServer from threading import Thread import time SERVER = "xmlrpc.rhn.redhat.com" HANDLER = "/XMLRPC" PROXY=None system_id_file = '/etc/sysconfig/rhn/system...
gpl-2.0
bkahlert/seqan-research
raw/workshop13/workshop2013-data-20130926/trunk/extras/apps/breakpoint_calculator/tests/run_tests.py
7
4086
#!/usr/bin/env python """Execute the tests for breakpoint_calculator. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usag...
mit
rven/odoo
addons/mail/models/mail_channel.py
1
56928
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import logging import re from uuid import uuid4 from odoo import _, api, fields, models, modules, tools from odoo.exceptions import UserError, ValidationError from odoo.osv import expression from odoo.tool...
agpl-3.0
martinbuc/missionplanner
Lib/encodings/cp424.py
93
12618
""" 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,i...
gpl-3.0
agile-geoscience/welly
tests/test_quality.py
1
1282
# -*- coding: utf 8 -*- """ Define a suite a tests for the canstrat functions. """ import numpy as np from striplog import Striplog from welly import Well import welly.quality as q tests = { 'Each': [ q.no_flat, q.no_monotonic, q.no_gaps, ], 'Gamma': [ q.all_positive, ...
apache-2.0
raghavrv/scikit-learn
sklearn/cross_decomposition/cca_.py
151
3192
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
davidt/reviewboard
reviewboard/webapi/tests/test_session.py
7
2561
from __future__ import unicode_literals from django.http import SimpleCookie from django.utils import six from djblets.webapi.errors import NOT_LOGGED_IN from reviewboard.webapi.resources import resources from reviewboard.webapi.tests.base import BaseWebAPITestCase from reviewboard.webapi.tests.mimetypes import sess...
mit
nakagami/reportlab
demos/odyssey/fodyssey.py
1
4606
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__=''' $Id: fodyssey.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__='' #REPORTLAB_TEST_SCRIPT import sys, copy, os from reportlab.platypus import * from reportlab.lib.units import inch from reportlab.lib.styles import getSampleS...
bsd-3-clause
arnaudcordier/sejours
eedf/urls.py
1
2572
from django.conf.urls import patterns, include, url from django.views.generic import DetailView, ListView from sejours.models import * from django.contrib import admin from django.contrib.auth.forms import PasswordResetForm from userena import views as userena_views from userena import settings as userena_settings admi...
gpl-3.0
Pajinek/spacewalk
client/tools/rhncfg/config_management/rhncfg_diff_revisions.py
10
2765
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
cloudera/hue
desktop/core/ext-py/python-openid-2.2.5/openid/server/server.py
142
65667
# -*- test-case-name: openid.test.test_server -*- """OpenID server protocol and logic. Overview ======== An OpenID server must perform three tasks: 1. Examine the incoming request to determine its nature and validity. 2. Make a decision about how to respond to this request. 3. Format th...
apache-2.0
PalouseRobosub/robosub
src/ai/smach_roulette.py
1
2764
#!/usr/bin/python import rospy import smach import smach_ros from start_switch import start_switch from roulette_states import * from basic_states import * class RouletteTask(smach.StateMachine): """Main roulette state task.""" def __init__(self): """Initializes the roulette task.""" smach.Sta...
gpl-3.0
aequitas/home-assistant
homeassistant/components/clementine/media_player.py
7
6730
"""Support for Clementine Music Player as media player.""" from datetime import timedelta import logging import time import voluptuous as vol from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, SUPP...
apache-2.0
jotes/ansible-modules-core
cloud/openstack/os_keypair.py
102
4972
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # Copyright (c) 2013, John Dewey <john@dewey.ws> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
gpl-3.0
jmesteve/saas3
openerp/addons/mrp/wizard/mrp_workcenter_load.py
381
2222
# -*- 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
pnedunuri/scipy
scipy/sparse/csgraph/tests/test_connected_components.py
144
3265
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_equal, assert_array_almost_equal from scipy.sparse import csgraph def test_weak_connections(): Xde = np.array([[0, 1, 0], [0, 0, 0], [0, 0, 0]]) Xsp = ...
bsd-3-clause
jendap/tensorflow
tensorflow/contrib/opt/python/training/reg_adagrad_optimizer.py
39
3782
# 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
j717273419/librime
.ycm_extra_conf.py
8
6074
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
bsd-3-clause
Manojkumar91/odoo_inresto
openerp/addons/test_convert/tests/test_convert.py
14
2301
import collections import unittest2 from lxml import etree as ET from lxml.builder import E from openerp.tests import common from openerp.tools.convert import _eval_xml Field = E.field Value = E.value class TestEvalXML(common.TransactionCase): def eval_xml(self, node, obj=None, idref=None): return _eval_...
agpl-3.0
eirannejad/pyRevit
pyrevitlib/pyrevit/revit/serverutils.py
1
2041
"""Helper functions for working with revit server.""" from collections import namedtuple from pyrevit.framework import sqlite3 from pyrevit import DB MODEL_HISTORY_SQLDB = '/Data/Model.db3' SyncHistory = namedtuple('SyncHistory', ['index', 'userid', ...
gpl-3.0
ChenglongChen/SparseLSH
sparselsh/storage.py
2
5848
# lshash/storage.py # Copyright 2012 Kay Zhu (a.k.a He Zhu) and contributors (see CONTRIBUTORS.txt) # # This module is part of lshash and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import time import cPickle try: import redis except ImportError: redis = None try: ...
mit
lithint/odoo
hv_gst_report/__manifest__.py
1
1399
# -*- encoding: utf-8 -*- ############################################################################## # # odoo, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
hgrif/incubator-airflow
airflow/contrib/hooks/aws_dynamodb_hook.py
16
2057
# -*- 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
nemesisdesign/ansible-openwisp2
templates/openwisp2/settings.py
2
11306
import os import sys TESTING = 'test' in sys.argv from datetime import timedelta # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '{{ openwisp...
bsd-3-clause
jamespcole/home-assistant
tests/components/remember_the_milk/test_init.py
12
3463
"""Tests for the Remember The Milk component.""" import logging import json import unittest from unittest.mock import patch, mock_open, Mock import homeassistant.components.remember_the_milk as rtm from tests.common import get_test_home_assistant _LOGGER = logging.getLogger(__name__) class TestConfiguration(unitt...
apache-2.0
ChanduERP/odoo
addons/crm/report/crm_lead_report.py
309
5123
# -*- 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
ravibhure/ansible
lib/ansible/module_utils/vmware.py
6
37158
# -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 yo...
gpl-3.0
california-civic-data-coalition/django-calaccess-processed-data
calaccess_processed_elections/managers/opencivicdata/core/organizations.py
1
3914
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Custom manager for OCD organization models. """ from __future__ import unicode_literals from django.db.models import Count from calaccess_processed.managers import BulkLoadSQLManager # Logging import logging logger = logging.getLogger(__name__) class OCDOrganizationM...
mit
cs-au-dk/Artemis
WebKit/Tools/Scripts/webkitpy/style/checkers/python.py
3
2478
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
gpl-3.0
AALEKH/server
storage/tokudb/mysql-test/tokudb/t/change_column_int.py
56
1869
#!/usr/bin/env python import sys def gen_test(types, values): for a in range(len(types)): for b in range(len(types)): print print "CREATE TABLE t (a %s);" % (types[a]) if a > b: print "--replace_regex /MariaDB/XYZ/ /MySQL/XYZ/" print "--er...
gpl-2.0
damonkohler/sl4a
python/src/Lib/ctypes/test/test_arrays.py
51
4378
import unittest from ctypes import * formats = "bBhHiIlLqQfd" formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ c_long, c_ulonglong, c_float, c_double, c_longdouble class ArrayTestCase(unittest.TestCase): def test_simple(self): # create classes holding simple numeric types, and che...
apache-2.0
pkoutsias/SickRage
sickbeard/clients/rtorrent_client.py
3
5118
# coding=utf-8 # Author: jkaberg <joel.kaberg@gmail.com>, based on fuzemans work (https://github.com/RuudBurger/CouchPotatoServer/blob/develop/couchpotato/core/downloaders/rtorrent/main.py) # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute ...
gpl-3.0
yuanke/hadoop-hbase
src/contrib/hod/hodlib/GridServices/mapred.py
182
8167
#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 use thi...
apache-2.0
gioman/QGIS
tests/src/python/test_qgscomposerlegend.py
7
9226
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsComposerLegend. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """...
gpl-2.0
clouddocx/boto
boto/ec2/snapshot.py
60
6858
# 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
0hoo/web
earthreader/web/command.py
1
3666
from __future__ import print_function import argparse import hashlib import sys try: from urllib import parse as urlparse except ImportError: import urlparse from libearth.compat.parallel import cpu_count from libearth.crawler import crawl, CrawlError from libearth.repository import from_url from libearth.ses...
agpl-3.0
dablak/boto
boto/glacier/utils.py
32
5789
# 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 ...
mit
strahlex/machinekit
src/machinetalk/messagebus/python-mockup/rtactor.py
18
2240
# proxy for simple RT responder import os import time import zmq import halext from optparse import OptionParser parser = OptionParser() parser.add_option("-c", "--cmd", dest="cmduri", default="tcp://127.0.0.1:5571", help="command URI") parser.add_option("-r", "--response", dest="responseuri", ...
lgpl-2.1
MoRgUiJu/morguiju.repo
plugin.video.pelisalacarta/channels/verseriesynovelas.py
1
15288
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para verseriesynovelas # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re from core import config from core import lo...
gpl-2.0
anryko/ansible
lib/ansible/plugins/httpapi/ftd.py
37
15790
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
i-maravic/ns-3
examples/wireless/examples-to-run.py
99
1794
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
gpl-2.0
theguardian/LazyLibrarian_Old
cherrypy/test/test_httpauth.py
42
5844
import cherrypy from cherrypy._cpcompat import md5, sha, ntob from cherrypy.lib import httpauth from cherrypy.test import helper class HTTPAuthTest(helper.CPWebCase): def setup_server(): class Root: def index(self): return "This is public." index.exposed = True ...
gpl-3.0
okffi/decisions
web/decisions/ahjo/migrations/0001_initial.py
1
1758
# -*- coding: utf-8 -*- # Generated by Django 1.9.3 on 2016-03-02 12:26 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migra...
bsd-3-clause
jacenkow/inspire-next
inspirehep/modules/search/walkers/elasticsearch_no_keywords.py
3
2790
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 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...
gpl-2.0
nicolashainaux/mathmakerlib
tests/04_geometry/11_triangle_test.py
1
6535
# -*- coding: utf-8 -*- # Mathmaker Lib offers lualatex-printable mathematical objects. # Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com> # This file is part of Mathmaker Lib. # Mathmaker Lib is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
gpl-3.0
globocom/simple-virtuoso-migrate
tests/helpers_test.py
1
5649
# coding: utf-8 import unittest import os import sys from mock import patch from tests import create_file, delete_files from simple_virtuoso_migrate.helpers import Utils from rdflib import Literal class UtilsTest(unittest.TestCase): def setUp(self): config_file = ''' DATABASE_HOST = 'localhost' DATABASE...
apache-2.0
BaladiDogGames/baladidoggames.github.io
mingw/bin/lib/lib2to3/patcomp.py
304
7091
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Pattern compiler. The grammer is taken from PatternGrammar.txt. The compiler compiles a pattern to a pytree.*Pattern instance. """ __author__ = "Guido van Rossum <guido@python.org>" # Python imports import os imp...
mit
srh/rethinkdb
drivers/java/convert_tests.py
2
32760
#!/usr/bin/env python3 # -*- coding: utf-8 -*- '''Finds yaml tests, converts them to Java tests.''' from __future__ import print_function import sys import os import os.path import re import time import ast import argparse import metajava import process_polyglot import logging from process_polyglot import Unhandled, S...
apache-2.0
matkuki/ExCo
lexers/nim.py
1
17182
# -*- coding: utf-8 -*- """ Copyright (c) 2018 Matic Kukovec. """ import keyword import builtins import re import functions import data import time import lexers class Nim(data.QsciLexerCustom): """ Custom lexer for the Nim programming languages """ styles = { "Default" : 0, "Comme...
gpl-3.0
TheSimoms/Felleshoelet
spotifyconnector/venv/lib/python3.6/site-packages/chardet/charsetgroupprober.py
270
3787
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
popazerty/e2-gui
lib/python/Plugins/SystemPlugins/SoftwareManager/ImageWizard.py
5
4454
from os import access, W_OK, R_OK from enigma import eEnv from Screens.WizardLanguage import WizardLanguage from Screens.Wizard import wizardManager from Screens.Rc import Rc from Tools.Directories import fileExists, resolveFilename, SCOPE_PLUGINS from Components.Pixmap import Pixmap from Components.config import con...
gpl-2.0
ManiacalLabs/BiblioPixel
bibliopixel/util/color_list.py
2
2583
import copy, numpy from . limit import Limit def is_numpy(x): return isinstance(x, numpy.ndarray) def check_numpy(item, name=None): if not is_numpy(item.color_list): name = name or item.__class__.__name__ raise ValueError(_NEEDS_NUMPY_ERROR % name) class ListMath: @staticmethod def...
mit
jalonsob/Informes
build/lib.linux-x86_64-2.7/grimoirelib_alch/var.py
4
5394
#! /usr/bin/python # -*- coding: utf-8 -*- ## Copyright (C) 2014 Bitergia ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later...
gpl-3.0
debugger22/sympy
sympy/core/tests/test_eval.py
119
2118
from sympy import Symbol, Function, exp, sqrt, Rational, I, cos, tan from sympy.utilities.pytest import XFAIL def test_add_eval(): a = Symbol("a") b = Symbol("b") c = Rational(1) p = Rational(5) assert a*b + c + p == a*b + 6 assert c + a + p == a + 6 assert c + a - p == a + (-4) assert...
bsd-3-clause
lcgong/sqlblock
sqlblock/old/decorator.py
1
5417
# -*- coding: utf-8 -*- import logging import sys import functools import inspect from inspect import Signature _logger = logging.getLogger(__name__) class TransactionDecoratorFactory: def __init__(self, sqlblock_type): self._sqlblock_type = sqlblock_type self.dsn = None def __getattr__(sel...
mit
MjAbuz/foundation
foundation/redirects/management/commands/import_redirect_csv.py
2
2115
import csv import errno from optparse import make_option import sys from django.contrib.redirects.models import Redirect from django.contrib.sites.models import Site from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): ...
mit
torbjoernk/pySDC
examples/advection_2d_explicit/ProblemClass.py
1
4932
import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as LA from pySDC.Problem import ptype from pySDC.datatype_classes.mesh import mesh, rhs_imex_mesh # Sharpclaw imports from clawpack import pyclaw from clawpack import riemann class sharpclaw(ptype): """ Example implementing the forced 1D...
bsd-2-clause
yeming233/rally
rally/plugins/openstack/scenarios/quotas/quotas.py
1
5163
# Copyright 2014: Kylin Cloud # 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 ...
apache-2.0
3DP-Unlimited/3DP-Printrun
printrun/gl/libtatlin/actors.py
1
13242
# -*- coding: utf-8 -*- # Copyright (C) 2013 Guillaume Seguin # Copyright (C) 2011 Denis Kobozev # # 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 ...
gpl-3.0
MrCodeYu/spark
examples/src/main/python/mllib/word2vec_example.py
128
1365
# # 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 us...
apache-2.0
bravecollective/bravecollective-intel
data/jb-generation/jb-json.py
2
101650
#!/usr/bin/python import re import json from xml.dom import minidom systemdict = {30001820:'3-QNM4', 30004271:'Afrah', 30004279:'Ahraghen', 30004277:'Ajna', 30004301:'Anath', 30004291:'Anohel', 30004249:'Avada', 30004261:'Balas', 30004296:'Bapraya', 30004252:'Bazadod', 30004250:'Chibi', 30004284:'Defsunun', 30004256:...
mit
1suming/readthedocs.org
readthedocs/rtd_tests/tests/test_backend.py
3
4128
from os.path import exists from django.contrib.admin.models import User from projects.models import Project from rtd_tests.base import RTDTestCase from rtd_tests.utils import make_test_git, make_test_hg class TestGitBackend(RTDTestCase): fixtures = ['eric.json'] def setUp(self): git_repo = make_te...
mit
forcebold/adhesiontext-for-robofont
adhesiontext.roboFontExt/lib/adhesiontext.py
1
21197
__copyright__ = """ Copyright (c) 2012-2015, Miguel Sousa All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditi...
bsd-3-clause
wfxiang08/django178
tests/lookup/models.py
20
1971
""" 7. 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 Author(models.Model): name = models.CharField(max_length=100) clas...
bsd-3-clause
isaac-philip/loolu
common/django/dispatch/saferef.py
345
10495
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import weakref, traceback def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target -- th...
mit
msmolens/VTK
Examples/VisualizationAlgorithms/Python/imageWarp.py
23
1763
#!/usr/bin/env python # This example shows how to combine data from both the imaging and # graphics pipelines. The vtkMergeFilter is used to merge the data # from each together. import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Read in an image and compute a luminance value. The ...
bsd-3-clause
bspurlin/lx
node_modules/node-gyp/gyp/buildbot/buildbot_run.py
497
5998
#!/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. """Argument-less script to select what to run on the buildbots.""" import os import shutil import subprocess import sys if sys.platform ...
mit
kdart/clipsdemo
src/clipsdemo/shell.py
1
3503
#!/usr/bin/python2 # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab:fileencoding=utf-8 # from __future__ import absolute_import from __future__ import print_function from __future__ import division # shell.py # a simple CLIPS interactive shell environment to be run from Python import clips imp...
lgpl-2.1
ShaneHarvey/mongo-python-driver
pymongo/socket_checker.py
2
3954
# Copyright 2020-present 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 wri...
apache-2.0
actionless/oomox
plugins/icons_archdroid/oomox_plugin.py
1
1358
import os from oomox_gui.config import FALLBACK_COLOR from oomox_gui.export_common import FileBasedExportDialog from oomox_gui.plugin_api import OomoxIconsPlugin from oomox_gui.i18n import _ PLUGIN_DIR = os.path.dirname(os.path.realpath(__file__)) ARCHDROID_THEME_DIR = os.path.join(PLUGIN_DIR, "archdroid-icon-theme/...
gpl-3.0
10clouds/edx-platform
lms/djangoapps/instructor/management/commands/compute_grades.py
149
1949
#!/usr/bin/python """ django management command: dump grades to csv files for use by batch processes """ from instructor.offline_gradecalc import offline_grade_calculation from courseware.courses import get_course_by_id from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from opaque_keys....
agpl-3.0
pjaos/netplot
web/netplot_server.py
1
16165
#!/usr/bin/python3 #/***************************************************************************************** # * Copyright 2019 Paul Austen * # * * # * This program is dist...
lgpl-2.1
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/lib/blas/tests/test_blas.py
15
8223
#!/usr/bin/env python # # Created by: Pearu Peterson, April 2002 # from __future__ import division, print_function, absolute_import __usage__ = """ Build linalg: python setup.py build Run tests if scipy is installed: python -c 'import scipy;scipy.lib.blas.test()' """ import math import warnings from numpy impor...
mit
p0cisk/Quantum-GIS
python/plugins/processing/tests/GdalAlgorithmsTest.py
2
3347
# -*- coding: utf-8 -*- """ *************************************************************************** GdalAlgorithmTests.py --------------------- Date : January 2016 Copyright : (C) 2016 by Matthias Kuhn Email : matthias@opengis.ch ***********************...
gpl-2.0
resmo/ansible
lib/ansible/module_utils/acme.py
5
41580
# -*- coding: utf-8 -*- # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own lic...
gpl-3.0
lepistone/odoo
addons/hr_payroll_account/__init__.py
433
1116
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
whereismyjetpack/ansible
lib/ansible/utils/module_docs_fragments/openswitch.py
166
4001
# # (c) 2015, Peter Sprygada <psprygada@ansible.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 late...
gpl-3.0
mapzen/vector-datasource
integration-test/655-landuse-scree.py
2
1070
# -*- encoding: utf-8 -*- from shapely.wkt import loads as wkt_loads import dsl from . import FixtureTest class LanduseScree(FixtureTest): def test_scree(self): self.generate_fixtures(dsl.way(59621863, wkt_loads('POLYGON ((-122.422203271733 37.8256031759825, -122.422104546884 37.825699463513, -122.4219818...
mit
Jonekee/chromium.src
build/android/findbugs_diff.py
57
1391
#!/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. """Runs findbugs, and returns an error code if there are new warnings. This runs findbugs with an additional flag to exclude know...
bsd-3-clause
graphql-python/graphql-core
src/graphql/utilities/coerce_input_value.py
1
5581
from typing import Any, Callable, Dict, Iterable, List, Optional, Union, cast from ..error import GraphQLError from ..pyutils import ( Path, did_you_mean, inspect, print_path_list, suggestion_list, Undefined, ) from ..type import ( GraphQLInputObjectType, GraphQLInputType, GraphQLL...
mit
lixt/lily2-gem5
tests/configs/simple-atomic-mp.py
69
2376
# Copyright (c) 2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause