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
henzk/ape
ape/container_mode/tasks.py
1
12347
from __future__ import unicode_literals, print_function import os import sys import subprocess import json from ape import feaquencer from ape import tasks from .exceptions import ContainerError, ContainerNotFound, ProductNotFound class Config(object): APE_ROOT = os.environ['APE_ROOT_DIR'] SOURCE_HEADER = '#...
mit
bclau/nova
nova/tests/api/openstack/compute/test_limits.py
7
36000
# Copyright 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.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
cmichal/python-social-auth
social/backends/strava.py
70
1850
""" Strava OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/strava.html """ from social.backends.oauth import BaseOAuth2 class StravaOAuth(BaseOAuth2): name = 'strava' AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize' ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token...
bsd-3-clause
Voskrese/archlive.archldr
src/pypack/altgraph/Graph.py
9
19562
""" Base Graph class #--Version 2.1 #--Bob Ippolito October, 2004 #--Version 2.0 #--Istvan Albert June, 2004 #--Version 1.0 #--Nathan Denny, May 27, 1999 """ from altgraph import GraphError from compat import * class Graph(object): """ The Graph class represents a directed graph with C{N} nodes and C{E} ...
gpl-2.0
smcantab/pele
pele/potentials/gminpotential.py
5
1703
from pele.potentials import BasePotential import numpy as np __all__ = ["GMINPotential"] class GMINPotential(BasePotential): # pragma: no cover """ Interface to fortran GMIN potential Potentials implemented in GMIN can be called from python if GMIN is compiled with the flag WITH_PYTHON enabled. This cr...
gpl-3.0
Lilywei123/tempest
tempest/api/compute/admin/test_flavors_extra_specs.py
3
5162
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
openstack/python-muranoclient
doc/source/conf.py
1
2827
# -*- 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, s...
apache-2.0
betoesquivel/fil2014
build/django/build/lib.linux-x86_64-2.7/django/templatetags/future.py
130
1640
from django.template import Library from django.template import defaulttags register = Library() @register.tag def ssi(parser, token): # Used for deprecation path during 1.3/1.4, will be removed in 2.0 return defaulttags.ssi(parser, token) @register.tag def url(parser, token): # Used for deprecation pa...
mit
joopert/home-assistant
homeassistant/components/brunt/cover.py
4
5263
"""Support for Brunt Blind Engine covers.""" import logging from brunt import BruntAPI import voluptuous as vol from homeassistant.components.cover import ( ATTR_POSITION, PLATFORM_SCHEMA, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, CoverDevice, ) from homeassistant.const import ATTR_A...
apache-2.0
StamusNetworks/scirius
setup.py
1
1133
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='scirius', version='2.0', packa...
gpl-3.0
cfriedt/gnuradio
gr-digital/python/digital/ofdm_txrx.py
27
20975
# # Copyright 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 option) # any later version. # #...
gpl-3.0
nspierbundel/amlm3-3.x
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
wooyek/nuntio
web/plebe/template.py
1
3070
# -*- coding: utf-8 -*- # Copyright 2008 Janusz Skonieczny # # 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 a...
mit
zmarvel/playground
sound/testplay.py
1
3152
import alsaaudio from math import pi, sin, pow import getch SAMPLE_RATE = 44100 FORMAT = alsaaudio.PCM_FORMAT_U8 PERIOD_SIZE = 512 N_SAMPLES = 1024 notes = "abcdefg" frequencies = {} for i, note in enumerate(notes): frequencies[note] = 440 * pow(pow(2, 1/2), i) # Generate the sine wave, centered at y=128 with 10...
mit
imageboards/Orphereus
Orphereus/controllers/Orphie_Public.py
1
12982
# -*- coding: utf-8 -*- ################################################################################ # Copyright (C) 2009 Johan Liebert, Mantycore, Hedger, Rusanon # # < anoma.team@gmail.com ; http://orphereus.anoma.ch > # # ...
gpl-2.0
Teamxrtc/webrtc-streaming-node
third_party/webrtc/src/chromium/src/build/android/pylib/instrumentation/test_package.py
7
1335
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Class representing instrumentation test apk and jar.""" import os from devil.android import apk_helper from pylib.instrumentation import test_jar ...
mit
jamestwebber/scipy
scipy/linalg/tests/test_solvers.py
2
31084
from __future__ import division, print_function, absolute_import import os import numpy as np from numpy.testing import assert_array_almost_equal import pytest from pytest import raises as assert_raises from scipy.linalg import solve_sylvester from scipy.linalg import solve_continuous_lyapunov, solve_discrete_lyapun...
bsd-3-clause
shikhardb/scikit-learn
examples/covariance/plot_mahalanobis_distances.py
348
6232
r""" ================================================================ Robust covariance estimation and Mahalanobis distances relevance ================================================================ An example to show covariance estimation with the Mahalanobis distances on Gaussian distributed data. For Gaussian dis...
bsd-3-clause
5y/kivy
kivy/tools/report.py
17
3660
''' Report tool =========== This tool is a helper for users. It can be used to dump information for help during the debugging process. ''' import os import sys import time from time import ctime from configparser import ConfigParser from io import StringIO from xmlrpc.client import ServerProxy import kivy report =...
mit
SchoolIdolTomodachi/CinderellaProducers
cpro/filters.py
1
10802
from django.db.models import Q from django.core.exceptions import PermissionDenied from cpro import models ############################################################ # Cards def filterCards(queryset, parameters, request): if request.user.is_authenticated(): request.user.all_accounts = request.user.accou...
apache-2.0
virajs/selenium-1
py/test/selenium/webdriver/common/cookie_tests.py
28
3282
import calendar import time import unittest import random import pytest from selenium.test.selenium.webdriver.common import utils class CookieTest(unittest.TestCase): def setUp(self): self._loadPage("simpleTest") # Set the cookie to expire in 30 minutes timestamp = calendar.timegm(time.gm...
apache-2.0
theju/safebrowsing-python
safebrowsing/backend.py
2
5534
import conf from base import BaseDbObj class SqliteDbObj(BaseDbObj): def __init__(self): try: import sqlite3 as sqlite except ImportError: from pysqlite2 import dbapi2 as sqlite self.connection = sqlite.connect(self.db_name) self.cursor = self.connection.cur...
mit
Changaco/oh-mainline
vendor/packages/mechanize/test/test_pickle.py
22
1042
import cPickle import cStringIO as StringIO import pickle import mechanize import mechanize._response import mechanize._testcase def pickle_and_unpickle(obj, implementation): return implementation.loads(implementation.dumps(obj)) def test_pickling(obj, check=lambda unpickled: None): check(pickle_and_unpick...
agpl-3.0
lmorchard/django
tests/null_queries/tests.py
290
2928
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Inner, OuterA, OuterB, Poll class NullQueriesTests(TestCase): def test_none_as_null(self): """ Regression test for the use of None as a query value....
bsd-3-clause
michael-yin/scrapy
scrapy/core/scraper.py
6
8972
"""This module implements the Scraper component which parses responses and extracts information from them""" from collections import deque from twisted.python.failure import Failure from twisted.internet import defer from scrapy.utils.defer import defer_result, defer_succeed, parallel, iter_errback from scrapy.utils...
bsd-3-clause
jeremyh/agdc
contrib/agdc_workshop_exercises/ndvi_analysis_stacker-finished.py
5
7285
''' Created on 21/02/2013 @author: u76345 ''' import os import sys import logging import re import numpy from datetime import datetime, time from osgeo import gdal from agdc.stacker import Stacker from EOtools.utils import log_multiline from EOtools.stats import temporal_stats SCALE_FACTOR = 10000 # Set top level s...
bsd-3-clause
ehazlett/sensu-py
examples/mail.py
1
2439
#!/usr/bin/env python import sys import smtplib from optparse import OptionParser from email.mime.text import MIMEText import json from datetime import datetime try: from sensu import Handler except ImportError: print('You must have the sensu Python module i.e.: pip install sensu') sys.exit(1) class MailHa...
mit
stingaci/heat-tutorial
partVI/lib/elements/heat-config-salt/install.d/hook-salt.py
4
3759
#!/usr/bin/env python # # 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 ...
apache-2.0
veger/ansible
lib/ansible/modules/network/f5/bigip_wait.py
21
11508
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
creative-workflow/pi-setup
services/webiopi/src/python/webiopi/__init__.py
5
1082
# Copyright 2012-2013 Eric Ptak - trouch.com # # 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...
mit
candrews/portage
pym/portage/tests/dep/test_get_required_use_flags.py
18
1431
# Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage.tests import TestCase from portage.dep import get_required_use_flags from portage.exception import InvalidDependString class TestCheckRequiredUse(TestCase): def testCheckRequiredUse(self): test_...
gpl-2.0
jtakayama/makahiki-draft
makahiki/apps/widgets/bonus_points/admin.py
7
3615
"""Admin definition for Bonus Points widget.""" from django.shortcuts import render_to_response from django.template import RequestContext from apps.admin.admin import challenge_designer_site, challenge_manager_site, developer_site ''' Created on Aug 5, 2012 @author: Cam Moore ''' from django.contrib import admin f...
mit
matthijsvk/multimodalSR
code/Experiments/neon-master/neon/backends/cuda_batchnorm.py
3
14722
from pycuda.tools import context_dependent_memoize # from neon.backends.cuda_templates import (_ew_template, # _stage_template, # _fin_template, # _init_rand_func, # ...
mit
Dklotz-Circle/security_monkey
security_monkey/views/user_settings.py
7
6398
# Copyright 2014 Netflix, 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
NoahFlowa/glowing-spoon
venv/lib/python2.7/site-packages/psycopg2/tests/test_transaction.py
7
9235
#!/usr/bin/env python # test_transaction - unit test on transaction behaviour # # Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 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 Foundat...
apache-2.0
alhashash/odoo
addons/mrp/__init__.py
8
1098
# -*- 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
digimarc/django
tests/m2m_through_regress/tests.py
25
9146
from __future__ import unicode_literals from django.contrib.auth.models import User from django.core import management from django.test import TestCase from django.utils.six import StringIO from .models import ( Car, CarDriver, Driver, Group, Membership, Person, UserMembership, ) class M2MThroughTestCase(TestCa...
bsd-3-clause
spyridonf/ardupilot
Tools/scripts/frame_sizes.py
351
1117
#!/usr/bin/env python import re, sys, operator, os code_line = re.compile("^\s*\d+:/") frame_line = re.compile("^\s*\d+\s+/\* frame size = (\d+) \*/") class frame(object): def __init__(self, code, frame_size): self.code = code self.frame_size = int(frame_size) frames = [] def process_lst(filena...
gpl-3.0
cstipkovic/spidermonkey-research
testing/web-platform/tests/tools/pywebsocket/src/example/abort_handshake_wsh.py
465
1781
# Copyright 2012, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
christophlsa/odoo
addons/website_mail_group/controllers/main.py
306
7883
# -*- coding: utf-8 -*- import datetime from dateutil import relativedelta from openerp import tools, SUPERUSER_ID from openerp.addons.web import http from openerp.addons.website.models.website import slug from openerp.addons.web.http import request class MailGroup(http.Controller): _thread_per_page = 20 _r...
agpl-3.0
smartdevice475/sdl_core
tools/InterfaceGenerator/test/generator/parsers/test_SDLRPCV2.py
14
17475
"""SDLRPCV2 XML parser unit test.""" import os import unittest import generator.Model import generator.parsers.SDLRPCV2 class TestSDLRPCV2Parser(unittest.TestCase): """Test for SDLRPCV2 xml parser.""" class _Issue: def __init__(self, creator, value): self.creator = creator s...
bsd-3-clause
BenTheElder/test-infra
gubernator/filters.py
14
8242
# Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
jsoref/django
django/db/backends/oracle/base.py
20
24998
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import os import platform import sys import warnings from django.conf import settings from django.db import utils from django.db.backends.base.base ...
bsd-3-clause
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/predictor/saved_model_predictor.py
55
6579
# 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 required by applica...
mit
lucc/alot
alot/widgets/search.py
1
7118
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file """ Widgets specific to search mode """ import urwid from ..settings.const import settings from ..helper import shorten_author_string ...
gpl-3.0
rahku/coreclr
src/ToolBox/SOS/tests/t_cmd_bpmd_methoddesc.py
43
1308
import lldb import re import testutils as test # bpmd -md <MethodDesc pointer> def runScenario(assembly, debugger, target): process = target.GetProcess() res = lldb.SBCommandReturnObject() ci = debugger.GetCommandInterpreter() # Run debugger, wait until libcoreclr is loaded, # set breakpoint at ...
mit
kkozarev/mwacme
synchrotron_fitting/GS_kappa_function.py
1
2634
import Get_MW import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import numpy as np N=10 #number of frequencies #These values are starting positions for coronal CME radio observations ParmIn=29*[0] # input array ParmIn[0] =8e19 # Area, cm^2 ParmIn[1] =5e9 # Depth, cm ParmIn[2] =3...
gpl-2.0
eenchev/idea-note-taking-app
env/lib/python2.7/site-packages/werkzeug/posixemulation.py
364
3519
# -*- coding: utf-8 -*- r""" werkzeug.posixemulation ~~~~~~~~~~~~~~~~~~~~~~~ Provides a POSIX emulation for some features that are relevant to web applications. The main purpose is to simplify support for systems such as Windows NT that are not 100% POSIX compatible. Currently this only imple...
mit
jcftang/ansible
lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels.py
12
6828
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, 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 #...
gpl-3.0
Gateworks/platform-external-chromium_org
tools/telemetry/telemetry/core/discover_unittest.py
25
1836
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import unittest from telemetry.core import discover from telemetry.core import util class DiscoverTest(unittest.TestCase): def setUp(self): ...
bsd-3-clause
andersk/zulip
zerver/lib/cache.py
2
28356
# See https://zulip.readthedocs.io/en/latest/subsystems/caching.html for docs import hashlib import logging import os import re import secrets import sys import time import traceback from functools import lru_cache, wraps from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, ...
apache-2.0
leoliujie/odoo
addons/l10n_hn/__openerp__.py
343
2260
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009-2010 Salvatore Josué Trimarchi Pinto <salvatore@trigluu.com> # (http://trigluu.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
agpl-3.0
jonfoster/pyxb-upstream-mirror
doc/conf.py
3
6355
# -*- coding: utf-8 -*- # # PyXB documentation build configuration file, created by # sphinx-quickstart on Tue May 19 03:28:52 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
apache-2.0
Moriadry/tensorflow
tensorflow/python/lib/io/python_io.py
112
1273
# 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
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/django/conf/locale/cs/formats.py
504
1702
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G:i' DATET...
gpl-3.0
akash1808/glance
glance/tests/unit/v2/test_image_tags_resource.py
18
4136
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
grdlok/UStar-dl
src/youtube_dl/extractor/screencast.py
12
4228
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, compat_parse_qs, compat_urllib_request, ) class ScreencastIE(InfoExtractor): _VALID_URL = r'https?://www\.screencast\.com/t/(?P<id>[a-zA-Z0-9]+)' _TES...
unlicense
willingc/oh-mainline
vendor/packages/python-social-auth/social/backends/rdio.py
79
2468
""" Rdio OAuth1 and OAuth2 backends, docs at: http://psa.matiasaguirre.net/docs/backends/rdio.html """ from social.backends.oauth import BaseOAuth1, BaseOAuth2, OAuthAuth RDIO_API = 'https://www.rdio.com/api/1/' class BaseRdio(OAuthAuth): ID_KEY = 'key' def get_user_details(self, response): ful...
agpl-3.0
roshan/thrift
lib/py/src/protocol/TProtocolDecorator.py
145
1540
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
hgijeon/the_PLAY
test_gameapi.py
1
2612
import pygame as gameapi import pygame.midi as piano import sys, random import pygame.locals as apiVar gameapi.init() fpsClock = gameapi.time.Clock() windowSurfaceObj = gameapi.display.set_mode((640, 480)) gameapi.display.set_caption('set_caption') redColor = gameapi.Color(255,0,0) greenColor = gameapi.Color(0,255,0...
mit
amwelch/a10sdk-python
a10sdk/core/logging/logging_host.py
2
2576
from a10sdk.common.A10BaseClass import A10BaseClass class Host(A10BaseClass): """Class Description:: Set remote syslog host DNS name or ip address. Class host supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param ipv6ad...
apache-2.0
lshabc1231/noring-kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
xujun10110/MITMf
core/sslstrip/ServerConnectionFactory.py
26
1930
# Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This...
gpl-3.0
Kvle/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/command_line.py
217
1887
# Software License Agreement (BSD License) # # 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 ...
gpl-3.0
daniel198730/reposdmgv
proyectofinal/app/personaMain.py
1
1667
''' Created on 19/2/2015 @author: PC29 ''' from app import app from ec.edu.itsae.dao import PersonaDAO from flask import render_template, request, redirect, url_for @app.route("/mainPersona") def personamain(): objR=PersonaDAO.PersonaDAO().reportarPersona() return render_template("prueba.html"...
lgpl-2.1
venicegeo/eventkit-cloud
eventkit_cloud/utils/stats/geomutils.py
1
3906
from mapproxy import grid as mapproxy_grid from eventkit_cloud.tasks.models import ExportRun import logging import json import math logger = logging.getLogger(__name__) _dbg_geom_cache_misses = 0 def _create_cache_geom_entry(job): """ Constructs a geometry cache entry :param job: job contains the geomet...
bsd-3-clause
jmarshallnz/xbmc
tools/EventClients/lib/python/ps3/keymaps.py
245
2329
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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
WeblateOrg/weblate
weblate/trans/stats.py
2
1465
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
ravi-sharma/python-api-library
src/kayako/tests/test_api.py
3
6831
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2011, Evan Leis # # Distributed under the terms of the Lesser GNU General Public License (LGPL) #----------------------------------------------------------------------------- ''' Created on May 5, 2011...
bsd-2-clause
kylepjohnson/cltk
tests/test_morphology.py
4
28253
"""Test cltk.morphology.""" import unittest from cltk.core.exceptions import CLTKException from cltk.morphology.lat import CollatinusDecliner class TestMorphology(unittest.TestCase): def test_collatinus_decline(self): """ Ensure lemmatization works well """ decliner = CollatinusDeclin...
mit
SuperTango/TangoLogger
Uploader/requests/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
gpl-3.0
nilqed/root
tutorials/pyroot/first.py
28
1524
from ROOT import TCanvas, TF1, TPaveLabel, TPad, TText from ROOT import gROOT nut = TCanvas( 'nut', 'FirstSession', 100, 10, 700, 900 ) nut.Range( 0, 0, 20, 24 ) nut.SetFillColor( 10 ) nut.SetBorderSize( 2 ) pl = TPaveLabel( 3, 22, 17, 23.7, 'My first PyROOT interactive session', 'br' ) pl.SetFillColor( 18 ) pl.Draw...
lgpl-2.1
auready/django
django/contrib/auth/context_processors.py
3
1824
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict: def __init__(self, user, app_label): self.user, self.app_label = user, app_label def __repr__(self): return str(self.user.get_all_permissions()) def...
bsd-3-clause
ZhangXinNan/tensorflow
tensorflow/contrib/tpu/python/tpu/tpu_system_metadata.py
13
5734
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
samueldotj/TeeRISC-Simulator
tests/configs/realview-switcheroo-full.py
6
2411
# Copyright (c) 2012 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
YihaoLu/statsmodels
statsmodels/tools/grouputils.py
25
22518
# -*- coding: utf-8 -*- """Tools for working with groups This provides several functions to work with groups and a Group class that keeps track of the different representations and has methods to work more easily with groups. Author: Josef Perktold, Author: Nathaniel Smith, recipe for sparse_dummies on scipy user ma...
bsd-3-clause
mgrygoriev/CloudFerry
tests/cloudferrylib/os/actions/test_keypair_migration.py
1
6887
# Copyright 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 writing, so...
apache-2.0
AstroPrint/AstroBox
src/ext/sockjs/tornado/transports/jsonp.py
9
3642
# -*- coding: utf-8 -*- """ sockjs.tornado.transports.jsonp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JSONP transport implementation. """ import logging from tornado.web import asynchronous from sockjs.tornado import proto from sockjs.tornado.transports import pollingbase from sockjs.tornado.util import bytes_to_s...
agpl-3.0
EvgeneOskin/taiga-back
taiga/projects/userstories/apps.py
14
5623
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
agpl-3.0
endlessm/chromium-browser
third_party/angle/src/libANGLE/gen_overlay_fonts.py
5
10022
#!/usr/bin/env vpython # # [VPYTHON:BEGIN] # wheel: < # name: "infra/python/wheels/freetype-py/${vpython_platform}" # version: "version:2.1.0.post1" # > # [VPYTHON:END] # Copyright 2019 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found ...
bsd-3-clause
lucasmiqueias/speakerfight-1
deck/migrations/0001_initial.py
20
3687
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('jury', '__first__'), migrations.swappable_dependency(settings.AUT...
mit
sonnyhu/scikit-learn
sklearn/externals/joblib/numpy_pickle.py
37
23222
"""Utilities for fast persistence of big data, with optional compression.""" # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import pickle import os import sys import warnings try: from pathlib import Path except ImportError:...
bsd-3-clause
jonyroda97/redbot-amigosprovaveis
lib/youtube_dl/extractor/dispeak.py
23
4368
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_duration, remove_end, xpath_element, xpath_text, ) class DigitallySpeakingIE(InfoExtractor): _VALID_URL = r'https?://(?:s?evt\.dispeak|events\.digitallyspeaking)\.com/...
gpl-3.0
damianam/easybuild-framework
easybuild/toolchains/craypgi.py
5
1596
## # Copyright 2014-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # the Hercules foundation (http:...
gpl-2.0
quamilek/django
tests/admin_inlines/tests.py
118
44045
from __future__ import unicode_literals import datetime import warnings from django.contrib.admin import ModelAdmin, TabularInline from django.contrib.admin.helpers import InlineAdminForm from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.auth.models import Permission, User from...
bsd-3-clause
dbkaynor/PyCopyMoveTk
auxfiles/Send2Trash/Send2Trash-1.3.0/send2trash/plat_win.py
2
1655
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_license from __future__ import unicode_literals ...
gpl-2.0
timonwong/foo_uie_wsh_panel_mod.scintilla
test/simpleTests.py
4
74073
# -*- coding: utf-8 -*- # Requires Python 2.7 or later from __future__ import with_statement from __future__ import unicode_literals import codecs, ctypes, os, sys, unittest if sys.platform == "win32": import XiteWin as Xite else: import XiteQt as Xite class TestSimple(unittest.TestCase): def setUp(self): sel...
isc
qedsoftware/commcare-hq
corehq/apps/app_manager/tests/test_translations.py
1
2099
# coding=utf-8 import os from lxml import etree from django.test import TestCase from corehq.apps.app_manager.models import Application from corehq.apps.app_manager.tests.util import SuiteMixin from corehq.apps.app_manager.translations import escape_output_value import commcare_translations class AppManagerTransla...
bsd-3-clause
uannight/reposan
plugin.video.tvalacarta/lib/youtube_dl/extractor/swrmediathek.py
64
4375
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( parse_duration, int_or_none, determine_protocol, ) class SWRMediathekIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?swrmediathek\.de/(?:content/)?player\.htm\?show=(?P<id>[\da-f]{8}-[...
gpl-2.0
HydrelioxGitHub/home-assistant
tests/components/sensor/test_rest.py
2
12631
"""The tests for the REST sensor platform.""" import unittest from pytest import raises from unittest.mock import patch, Mock import requests from requests.exceptions import Timeout, MissingSchema, RequestException import requests_mock from homeassistant.exceptions import PlatformNotReady from homeassistant.setup imp...
apache-2.0
MaxTyutyunnikov/lino
lino/modlib/cal/__init__.py
1
1851
# -*- coding: UTF-8 -*- ## Copyright 2011-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 y...
gpl-3.0
josephsnyder/VistA
Scripts/DefaultKIDSBuildInstaller.py
1
30883
#--------------------------------------------------------------------------- # Copyright 2012-2019 The Open Source Electronic Health Record Alliance # # 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 Licen...
apache-2.0
jxta/cc
vendor/Twisted-10.0.0/twisted/web/test/test_domhelpers.py
53
11063
# -*- test-case-name: twisted.web.test.test_domhelpers -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Specific tests for (some of) the methods in L{twisted.web.domhelpers}. """ from xml.dom import minidom from twisted.trial.unittest import TestCase from twisted.web import ...
apache-2.0
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/closured/lib/python2.7/json/encoder.py
103
16014
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x...
apache-2.0
halfcrazy/sqlalchemy
lib/sqlalchemy/dialects/mysql/mysqlconnector.py
59
5323
# mysql/mysqlconnector.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+mysqlconnector :name: MySQL Connector/Python ...
mit
ApplauseOSS/djangoevents
djangoevents/__init__.py
1
1816
import warnings from eventsourcing.domain.model.entity import EventSourcedEntity from eventsourcing.domain.model.entity import entity_mutator from eventsourcing.domain.model.entity import singledispatch from eventsourcing.domain.model.decorators import subscribe_to from eventsourcing.domain.model.events import publish...
mit
4ON91/KnickKnacks
Boolean Algebra Notes/LogicGates.py
1
10004
import copy import csv import os class Gate: def __init__(self, Sockets): self.Sockets = Sockets self.Inputs = [] self.UniqueInputs = "" def canPass(self): return(True) def getInput(self, I): if( (type(I) == Input) & (I.sym().casefold() not ...
mit
PrashntS/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
Ophiuchus1312/enigma2-master
lib/python/Tools/Downloader.py
3
1714
from twisted.web import client from twisted.internet import reactor, defer from twisted.python import failure class HTTPProgressDownloader(client.HTTPDownloader): def __init__(self, url, outfile, headers=None): client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="STB_BOX HTTP Downloader") se...
gpl-2.0
pbaesse/Sissens
lib/python2.7/site-packages/eventlet/support/dns/query.py
2
22949
# Copyright (C) 2003-2017 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ...
gpl-3.0