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
rueckstiess/dopamine
adapters/explorers/explorer.py
1
2647
from dopamine.adapters import Adapter import numpy as np class Explorer(Adapter): # define the conditions of the environment inConditions = {} # define the conditions of the environment outConditions = {} def __init__(self): Adapter.__init__(self) ...
gpl-3.0
szeged/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servo.py
5
2728
import os from .base import NullBrowser, ExecutorBrowser, require_arg from .base import get_timeout_multiplier # noqa: F401 from ..executors import executor_kwargs as base_executor_kwargs from ..executors.executorservo import ServoTestharnessExecutor, ServoRefTestExecutor, ServoWdspecExecutor # noqa: F401 here = o...
mpl-2.0
hujiajie/pa-chromium
base/android/jni_generator/jni_generator.py
20
38680
#!/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. """Extracts native methods from a Java file and generates the JNI bindings. If you change this, please run and update the tests."""...
bsd-3-clause
BhallaLab/moose-examples
symcomp/symcomp.py
4
3064
# symcompartment.py --- # # Filename: symcompartment.py # Description: # Author: # Maintainer: # Created: Thu Jun 20 17:47:10 2013 (+0530) # Version: # Last-Updated: Wed Jun 26 11:43:47 2013 (+0530) # By: subha # Update #: 90 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # ...
gpl-2.0
ojengwa/talk
venv/lib/python2.7/site-packages/django/db/models/__init__.py
82
2439
from functools import wraps import sys import warnings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured # NOQA from django.db.models.query import Q, QuerySet, Prefetch # NOQA from django.db.models.expressions import F # NOQA from django.db.models.manager import Manager # NOQA from django...
mit
sznekol/django-cms
cms/management/commands/subcommands/base.py
48
1618
# -*- coding: utf-8 -*- import sys from django.core.management.base import BaseCommand, CommandError class SubcommandsCommand(BaseCommand): subcommands = {} command_name = '' def __init__(self): super(SubcommandsCommand, self).__init__() for name, subcommand in self.subcommands.items(): ...
bsd-3-clause
henrykironde/weaverhenry
app/app.py
2
1395
import wx class Frame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(450, 350)) hbox = wx.BoxSizer(wx.HORIZONTAL) vbox = wx.BoxSizer(wx.VERTICAL) panel1 = wx.Panel(self, -1) panel2 = wx.Panel(self,...
mit
dhalperi/beam
sdks/python/apache_beam/transforms/window_test.py
2
11729
# # 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
827992983/yue
yue/urls.py
1
2674
"""yue URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based v...
gpl-3.0
dippatel1994/oppia
core/platform/transactions/gae_transaction_services.py
33
1124
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
FlorentChamault/My_sickbeard
lib/hachoir_parser/file_system/mbr.py
90
7784
""" Master Boot Record. """ # cfdisk uses the following algorithm to compute the geometry: # 0. Use the values given by the user. # 1. Try to guess the geometry from the partition table: # if all the used partitions end at the same head H and the # same sector S, then there are (H+1) heads and S sectors/cylind...
gpl-3.0
testmana2/test
ThirdParty/Pygments/pygments/lexers/erlang.py
72
18195
# -*- coding: utf-8 -*- """ pygments.lexers.erlang ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Erlang. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \ ...
gpl-3.0
Arcanemagus/SickRage
lib/six.py
172
30888
# Copyright (c) 2010-2017 Benjamin Peterson # # 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, modify, merge, publi...
gpl-3.0
LePastis/pyload
module/gui/MainWindow.py
41
30215
# -*- coding: utf-8 -*- """ 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 program is distributed in ...
gpl-3.0
dfalt974/SickRage
lib/sqlalchemy/orm/unitofwork.py
78
23204
# orm/unitofwork.py # Copyright (C) 2005-2014 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 """The internals for the unit of work system. The session's flush() process passes ...
gpl-3.0
sandeepgupta2k4/tensorflow
tensorflow/python/ops/parsing_ops.py
21
49286
# 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
abonil91/ncanda-data-integration
scripts/redcap/scoring/ctq/__init__.py
1
3092
#!/usr/bin/env python ## ## Copyright 2016 SRI International ## See COPYING file distributed along with the package for the copyright and license terms. ## import pandas import Rwrapper # # Variables from surveys needed for CTQ # # LimeSurvey field names lime_fields = [ "ctq_set1 [ctq1]", "ctq_set1 [ctq2]", "ct...
bsd-3-clause
Simran-B/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/security/account_rights.py
34
1472
import win32security,win32file,win32api,ntsecuritycon,win32con from security_enums import TRUSTEE_TYPE,TRUSTEE_FORM,ACE_FLAGS,ACCESS_MODE new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivilegeValue('',ntsecuritycon...
apache-2.0
deklungel/iRulez
src/dimmer/mqtt_sender.py
1
1164
import src.irulez.util as util import src.irulez.topic_factory as topic_factory import src.irulez.log as log import paho.mqtt.client as mqtt import uuid logger = log.get_logger('dimmer_mqtt_sender') class MqttSender: def __init__(self, client: mqtt.Client): self.__client = client def publish_dimming...
mit
dandan94/OpenGLTest
finalOpenGL/HelloGLFW/lib/boost_1_59_0/tools/build/test/clean.py
44
3076
#!/usr/bin/python # Copyright (C) Vladimir Prus 2006. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import BoostBuild t = BoostBuild.Tester(use_test_config=False) t.write("a.cpp", "int main() {}\n") t.writ...
gpl-3.0
master2be1/pychess
lib/pychess/widgets/preferencesDialog.py
20
23931
from __future__ import print_function import sys, os from os import listdir from os.path import isdir, isfile, splitext from xml.dom import minidom from gi.repository import Gtk, GdkPixbuf from gi.repository import Gdk from pychess.System.prefix import addDataPrefix, getDataPrefix from pychess.System.glock import glo...
gpl-3.0
telefonicaid/fiware-IoTAgent-Cplusplus
third_party/mosquitto-1.4.4/test/lib/03-publish-c2b-qos2.py
7
3223
#!/usr/bin/env python # Test whether a client sends a correct PUBLISH to a topic with QoS 2. # The client should connect to port 1888 with keepalive=60, clean session set, # and client id publish-qos2-test # The test will send a CONNACK message to the client with rc=0. Upon receiving # the CONNACK the client should v...
agpl-3.0
alsrgv/tensorflow
tensorflow/python/data/kernel_tests/interleave_test.py
2
10138
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Neurita/boyle
scripts/compare_id_sets.py
1
16843
#!/usr/bin/env python #TODO #Transform this into a CLI import re import os import logging import collections import numpy as np from tabulate import tabulate from dcm_anonymize import get_all_patient_mri_ids #logging config logging.basicConfig(level=logging.DEBUG, filename='idset_comparator.log', ...
bsd-3-clause
Balannen/LSMASOMM
atom3/Formalisms/LSMASOMM/canHaveRole.py
1
3395
""" __canHaveRole.py_____________________________________________________ Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY) Author: bogdan Modified: Sat Apr 14 23:09:41 2018 _____________________________________________________________________ """ from ASGNode import * from ATOM3Type import * f...
gpl-3.0
foursquare/pants
contrib/node/src/python/pants/contrib/node/subsystems/package_managers.py
2
9205
# coding=utf-8 # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import logging from builtins import object from pants.contrib.node.subsystems.command im...
apache-2.0
dictoon/blenderseed
docs/conf.py
2
8063
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup ------------------------------------------------------------...
mit
jimberlage/servo
components/script/dom/bindings/codegen/parser/tests/test_implements.py
264
5961
# Import the WebIDL module, so we can do isinstance checks and whatnot import WebIDL def WebIDLTest(parser, harness): # Basic functionality threw = False try: parser.parse(""" A implements B; interface B { attribute long x; }; interface ...
mpl-2.0
segwitcoin/SegwitCoin
contrib/linearize/linearize-hashes.py
27
4579
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ impo...
mit
triveous/LearnFlask
flask/lib/python2.7/site-packages/pip/_vendor/requests/exceptions.py
341
1877
# -*- coding: utf-8 -*- """ requests.exceptions ~~~~~~~~~~~~~~~~~~~ This module contains the set of Requests' exceptions. """ from .packages.urllib3.exceptions import HTTPError as BaseHTTPError class RequestException(IOError): """There was an ambiguous exception that occurred while handling your request.""...
apache-2.0
perryjrandall/arsenalsuite
cpp/apps/bach/web/bach/models/keyword.py
10
1381
# # Copyright (c) 2009 Dr. D Studios. (Please refer to license for details) # SVN_META_HEADURL = "$HeadURL: $" # SVN_META_ID = "$Id: keyword.py 9408 2010-03-03 22:35:49Z brobison $" # from sqlalchemy import Column, Table, types, ForeignKey, Index from sqlalchemy.orm import relation, backref from ..config import mapper...
gpl-2.0
liu602348184/django
tests/migrations/test_writer.py
65
22965
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import math import os import re import tokenize import unittest import custom_migration_operations.more_operations import custom_migration_operations.operations from django.conf import settings from django.core.validators import EmailVal...
bsd-3-clause
freyley/trello-traceability
rungui.py
1
12592
#!/usr/bin/env python import urwid from trello import TrelloClient import models import settings from models import Board, get_session, TrelloList from trellointerface import create_dbcard_and_ensure_checklist class RemoveOrgUser(object): def __init__(self, parent): self.items = [urwid.Text("foo"), urwi...
agpl-3.0
tsgit/invenio
modules/bibfield/lib/functions/is_type_isbn.py
17
1815
## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## Inv...
gpl-2.0
CiuffysHub/MITMf
mitmflib-0.18.4/build/lib.linux-i686-2.7/mitmflib/impacket/testcases/SMB_RPC/test_rrp.py
2
25098
############################################################################### # Tested so far: # # OpenClassesRoot # OpenCurrentUser # OpenLocalMachine # OpenPerformanceData # OpenUsers # BaseRegCloseKey # BaseRegCreateKey # BaseRegDeleteKey # BaseRegFlushKey # BaseRegGetKeySecurity # BaseRegOpenKey # BaseRegQueryI...
gpl-3.0
numerigraphe/odoo
addons/mrp_repair/__init__.py
380
1087
# -*- 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...
agpl-3.0
supergentle/migueltutorial
flask/lib/python2.7/site-packages/pbr/tests/test_core.py
86
5269
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
bsd-3-clause
wolverineav/neutron
neutron/pecan_wsgi/hooks/body_validation.py
4
2556
# Copyright (c) 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
Chilledheart/chromium
build/android/gyp/process_resources.py
1
15150
#!/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. """Process Android resources to generate R.java, and prepare for packaging. This will crunch images and generate v14 compatible ...
bsd-3-clause
eloquence/unisubs
apps/externalsites/migrations/0003_fix_thumb_options.py
4
27746
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): pass def backwards(self, orm): pass models = { 'accountlinker.thirdpartyacc...
agpl-3.0
rruebner/odoo
addons/point_of_sale/wizard/pos_confirm.py
343
2403
# -*- 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
open-synergy/sale-workflow
sale_allotment/__openerp__.py
9
1444
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 Odoo.com. # Copyright (C) 2015 Openies.com. # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
rdipietro/tensorflow
tensorflow/python/ops/split_benchmark.py
7
4025
# 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
byu-aml-lab/bzrflag
bzagents/bzrc.py
18
14582
#!/usr/bin/python -tt # Control BZFlag tanks remotely with synchronous communication. #################################################################### # NOTE TO STUDENTS: # You CAN and probably SHOULD modify this code. Just because it is # in a separate file does not mean that you can ignore it or that # you hav...
gpl-3.0
chaluemwut/fbserver
venv/lib/python2.7/site-packages/scipy/linalg/tests/test_basic.py
18
23525
#!/usr/bin/env python # # Created by: Pearu Peterson, March 2002 # """ Test functions for linalg.basic module """ from __future__ import division, print_function, absolute_import """ Bugs: 1) solve.check_random_sym_complex fails if a is complex and transpose(a) = conjugate(a) (a is Hermitian). """ __usage__ = """ ...
apache-2.0
leiferikb/bitpop
src/third_party/pyftpdlib/src/demo/tls_ftpd.py
4
2359
#!/usr/bin/env python # $Id: tls_ftpd.py 977 2012-01-22 23:05:09Z g.rodola $ # pyftpdlib is released under the MIT license, reproduced below: # ====================================================================== # Copyright (C) 2007-2012 Giampaolo Rodola' <g.rodola@gmail.com> # # All Righ...
gpl-3.0
mith1979/ansible_automation
applied_python/applied_python/lib/python2.7/site-packages/pylint/test/functional/bad_reversed_sequence.py
12
2132
""" Checks that reversed() receive proper argument """ # pylint: disable=missing-docstring # pylint: disable=too-few-public-methods,no-self-use,no-absolute-import from collections import deque __revision__ = 0 class GoodReversed(object): """ Implements __reversed__ """ def __reversed__(self): return [...
apache-2.0
intel-analytics/analytics-zoo
pyzoo/zoo/chronos/model/Seq2Seq_pytorch.py
1
5221
# # Copyright 2018 Analytics Zoo 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
yaoandw/joke
Pods/AVOSCloudCrashReporting/Breakpad/src/testing/test/gmock_output_test.py
986
5999
#!/usr/bin/env python # # Copyright 2008, 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...
mit
slarosa/QGIS
python/plugins/sextante/tests/SextanteToolsTest.py
3
3013
# -*- coding: utf-8 -*- """ *************************************************************************** SextanteToolsTest.py --------------------- Date : April 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
largelymfs/IRModel
src/models/Tfidf.py
1
2000
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: largelymfs # @Date: 2014-12-23 20:06:10 # @Last Modified by: largelymfs # @Last Modified time: 2014-12-23 23:18:08 import numpy as np import numpy.linalg as LA class TFIDF: def __init__(self, filename): #get the self.vocab self.vocab = {} id = 0 do...
mit
vprnet/traces
app/index.py
1
1098
#!/usr/local/bin/python2.7 from flask import Flask import sys from flask_frozen import Freezer from upload_s3 import set_metadata from config import AWS_DIRECTORY from query import get_slugs app = Flask(__name__) app.config.from_object('config') from views import * # Serving from s3 leads to some complications in h...
apache-2.0
jorik041/scikit-learn
sklearn/linear_model/randomized_l1.py
95
23365
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
psb-seclab/CTFStuff
hacknight/HN_Lab_1/python_101.py
2
6598
# -*- coding: utf-8 -*- #import my_math from my_math import factorial import os #import my_math def test_db(): return def test_network(): return def test_exception(): # opening file failed try: fi = open("testfile", 'r') fh = open("testfile", "w") fh.write("This is my test file for exception ha...
mit
canvasnetworks/canvas
common/boto/s3/acl.py
17
5397
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
dana-i2cat/felix
vt_manager/src/python/vt_manager/communication/XmlRpcClient.py
3
1276
import xmlrpclib, logging from urlparse import urlparse """ author: msune, CarolinaFernandez Server monitoring thread """ class XmlRpcClient(): """ Calling a remote method with variable number of parameters """ @staticmethod def callRPCMethodBasicAuth(url,userName,password,methodName,*params): result = None ...
apache-2.0
westinedu/newertrends
django/template/__init__.py
561
3247
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
bsd-3-clause
dhermes/project-euler
python/complete/no190.py
1
1063
#!/usr/bin/env python # Let S_m = (x_1, x_2, ... , x_m) be the m-tuple of positive real # numbers with x_1 + x_2 + ... + x_m = m for which # P_m = x_1 * x_2^2 * ... * x_m^m is maximised. # For example, it can be verified that [P_10] = 4112 # ([] is the integer part function). # Find SUM[P_m] for 2 <= m <= 15. # ---...
apache-2.0
gcblue/gcblue
bin/Lib/test/test_msilib.py
129
1468
""" Test suite for the code in msilib """ import unittest import os from test_support import run_unittest, import_module msilib = import_module('msilib') class Test_make_id(unittest.TestCase): #http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx """The Identifier data type is a text string. Identifi...
bsd-3-clause
mhugo/QGIS
tests/src/python/test_provider_ogr_gpkg.py
4
59492
# -*- coding: utf-8 -*- """QGIS Unit tests for the OGR/GPKG provider. .. 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
huanpc/lab_cloud_computing
docs/learning-by-doing/week09_10_connectDB_restApi/auto scaling system/constant.py
1
3300
__author__ = 'huanpc' CPU_THRESHOLD_UP = 0.1 CPU_THRESHOLD_DOWN = 0.001 MEM_THRESHOLD_UP = 15700000.0 MEM_THRESHOLD_DOWN = 2097152.0 HOST = '25.22.28.94' PORT = 8086 USER = 'root' PASS = 'root' DATABASE = 'cadvisor' SELECT_CPU = 'derivative(cpu_cumulative_usage)' SELECT_MEMORY = 'median(memory_usage)' SERIES = '"stats...
apache-2.0
martinohanlon/pelmetcam
GPSController.py
1
2913
from gps import * import time import datetime import threading import math class GpsUtils(): MPS_TO_MPH = 2.2369362920544 @staticmethod def latLongToXY(lat, lon): rMajor = 6378137 # Equatorial Radius, WGS84 shift = math.pi * rMajor x = lon * shift / 180 y = math.log(m...
mit
Symmetry-Innovations-Pty-Ltd/Python-2.7-for-QNX6.5.0-x86
usr/pkg/lib/python2.7/idlelib/IOBinding.py
16
20975
# changes by dscherer@cmu.edu # - IOBinding.open() replaces the current window with the opened file, # if the current window is both unmodified and unnamed # - IOBinding.loadfile() interprets Windows, UNIX, and Macintosh # end-of-line conventions, instead of relying on the standard library, # which will...
mit
bmispelon/csvkit
csvkit/sql.py
21
3016
#!/usr/bin/env python import datetime import six from sqlalchemy import Column, MetaData, Table, create_engine from sqlalchemy import BigInteger, Boolean, Date, DateTime, Float, Integer, String, Time from sqlalchemy.schema import CreateTable NoneType = type(None) DIALECTS = { 'access': 'access.base', 'fire...
mit
CloudServer/cinder
cinder/openstack/common/scheduler/filters/capabilities_filter.py
26
2792
# 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.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
Technocaveman/There-is-no-Third-Step
node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/fruity.py
364
1298
# -*- coding: utf-8 -*- """ pygments.styles.fruity ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "fruity" vim theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Token, Co...
mit
arizvisa/syringe
template/lnkfile.py
1
40522
import ptypes, ndk, office.propertyset from ptypes import * from ndk.datatypes import * class uint0(pint.uint_t): length = 0 class GUID(ndk.GUID): pass @pbinary.littleendian class LinkFlags(pbinary.flags): _fields_ = [ (1, 'HasLinkTargetIDList'), # The shell link is saved with an item ID ...
bsd-2-clause
chrisndodge/edx-platform
openedx/core/djangoapps/user_api/migrations/0001_initial.py
20
2731
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone from django.conf import settings import model_utils.fields import django.core.validators from openedx.core.djangoapps.xmodule_django.models import CourseKeyField class Migration(migra...
agpl-3.0
jingxiang-li/kaggle-yelp
model/level3_model_rf.py
1
5669
from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import f1_score import...
mit
jreback/pandas
pandas/io/formats/html.py
2
23192
""" Module for formatting output data in HTML. """ from textwrap import dedent from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast from pandas._config import get_option from pandas._libs import lib from pandas import MultiIndex, option_context from pandas.io.common import is_url fro...
bsd-3-clause
cobrab11/black1-bot
extensions/collect.py
3
6973
# BS mark.1-55 # /* coding: utf-8 */ # BlackSmith plugin # This should be rewritten! BLACK_LIST = 'dynamic/blacklist.txt' CHAT_CACHE = {} AMSGBL = [] DirtyChats = [] def handler_chat_cache(stanza, ltype, source, body): try: subject = stanza.getTag('subject') except: subject = False if ltype != 'public' o...
apache-2.0
systers/mailman
src/mailman/handlers/acknowledge.py
7
3436
# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
sciCloud/OLiMS
lims/browser/fields/datetimefield.py
2
2641
from time import strptime from dependencies.dependency import ClassSecurityInfo from dependencies.dependency import DateTime, safelocaltime from dependencies.dependency import DateTimeError from dependencies.dependency import registerField from dependencies.dependency import IDateTimeField from dependencies.dependenc...
agpl-3.0
gbiggs/rtcshell
rtcshell/rtmgr.py
1
6160
#!/usr/bin/env python # -*- Python -*- # -*- coding: utf-8 -*- '''rtcshell Copyright (C) 2009-2010 Geoffrey Biggs RT-Synthesis Research Group Intelligent Systems Research Institute, National Institute of Advanced Industrial Science and Technology (AIST), Japan All rights reserved. Licensed und...
epl-1.0
dhoffman34/django
tests/servers/tests.py
23
5966
# -*- encoding: utf-8 -*- """ Tests for django.core.servers. """ from __future__ import unicode_literals import os import socket from django.core.exceptions import ImproperlyConfigured from django.test import LiveServerTestCase from django.test import override_settings from django.utils.http import urlencode from dja...
bsd-3-clause
stone5495/NewsBlur
apps/profile/views.py
8
22968
import stripe import datetime from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.views.decorators.csrf import csrf_protect from django.contrib.auth import logout as logout_user from django.contrib.auth import login as login_user from django.db.mod...
mit
knewmanTE/FrameworkBenchmarks
toolset/benchmark/test_types/json_type.py
36
1216
from benchmark.test_types.framework_test_type import FrameworkTestType from benchmark.test_types.verifications import ( basic_body_verification, verify_headers, verify_helloworld_object ) import json class JsonTestType(FrameworkTestType): def __init__(self): kwargs = { 'name': 'j...
bsd-3-clause
Aaron1992/v2ex
mapreduce/handlers.py
20
27693
#!/usr/bin/env python # # Copyright 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 law o...
bsd-3-clause
duqiao/django
tests/migrations/test_writer.py
76
23489
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import functools import math import os import re import tokenize import unittest import custom_migration_operations.more_operations import custom_migration_operations.operations from django.conf import settings from django.core.validator...
bsd-3-clause
cnsoft/kbengine-cocos2dx
kbe/res/scripts/common/Lib/test/test_itertools.py
6
69610
import unittest from test import support from itertools import * from weakref import proxy from decimal import Decimal from fractions import Fraction import sys import operator import random import copy import pickle from functools import reduce maxsize = support.MAX_Py_ssize_t minsize = -maxsize-1 def lzip(*args): ...
lgpl-3.0
slozier/ironpython2
Tests/test_bytes.py
2
65335
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import sys import unittest from iptest import IronPythonTestCase, ip_supported_encodings, is_cli, is_mono, is_...
apache-2.0
tmshlvck/omnia-linux
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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. # # This program i...
gpl-2.0
offtools/linux-show-player
lisp/modules/gst_backend/elements/user_element.py
3
3423
# -*- coding: utf-8 -*- # # This file is part of Linux Show Player # # Copyright 2012-2016 Francesco Ceruti <ceppofrancy@gmail.com> # # Linux Show Player 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 ...
gpl-3.0
pigeonflight/strider-plone
docker/appengine/lib/django-1.5/tests/regressiontests/serializers_regress/models.py
45
8072
""" A test spanning all the capabilities of all the serializers. This class sets up a model for each model field type (except for image types, because of the PIL dependency). """ from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType # ...
mit
modelkayak/python_signal_examples
energy_fft.py
1
2685
import numpy as np import scipy from matplotlib import pyplot as plt from numpy import pi as pi # Plotting logic switches time_plot = True freq_plot = True # Oversample to make things look purty oversample = 100 # Frequencies to simulate f_min = 5 #[Hz] f_max = 10 #[Hz] f_list = np.arange(f_min,f_max) # Note: arange...
mit
moxon6/chemlab
build/lib/chemlab/graphics/qttrajectory.py
5
12898
from PyQt4.QtGui import QMainWindow, QApplication, QDockWidget from PyQt4 import QtGui, QtCore from PyQt4.QtCore import Qt import os from .qtviewer import app from .qchemlabwidget import QChemlabWidget from .. import resources import numpy as np resources_dir = os.path.dirname(resources.__file__) class PlayStopBu...
gpl-3.0
auto-mat/klub
apps/aklub/migrations/0019_auto_20160206_1208.py
1
7595
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-02-06 12:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('aklub', '0018_auto_20160131_1341'), ] operations = [ migrations.AddField( ...
gpl-3.0
gautam1858/tensorflow
tensorflow/python/kernel_tests/numerics_test.py
15
5145
# 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
SnappleCap/oh-mainline
vendor/packages/Django/tests/regressiontests/utils/crypto.py
108
4625
from __future__ import unicode_literals import binascii import math import timeit import hashlib from django.utils import unittest from django.utils.crypto import constant_time_compare, pbkdf2 class TestUtilsCryptoMisc(unittest.TestCase): def test_constant_time_compare(self): # It's hard to test for co...
agpl-3.0
jordanemedlock/psychtruths
temboo/core/Library/Basecamp/GetProject.py
5
3773
# -*- coding: utf-8 -*- ############################################################################### # # GetProject # Retrieves an individual project using a project id that you specify. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Licens...
apache-2.0
zzsza/TIL
python/crawling/advanced_link_crawler.py
1
1657
import re from urllib import robotparser from urllib.parse import urljoin from downloader import Downloader def get_robots_parser(robots_url): rp = robotparser.RobotFileParser() rp.set_url(robots_url) rp.read() return rp def get_links(html): webpage_regex = re.compile("""<a[^>]+href=["'](.*?)["'...
mit
openstack/manila
manila/scheduler/scheduler_options.py
2
3492
# Copyright (c) 2011 OpenStack, LLC. # 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 requi...
apache-2.0
rbalda/neural_ocr
env/lib/python2.7/site-packages/django/contrib/gis/geoip/base.py
334
11859
import os import re import warnings from ctypes import c_char_p from django.contrib.gis.geoip.libgeoip import GEOIP_SETTINGS from django.contrib.gis.geoip.prototypes import ( GeoIP_country_code_by_addr, GeoIP_country_code_by_name, GeoIP_country_name_by_addr, GeoIP_country_name_by_name, GeoIP_database_info,...
mit
zhanghenry/stocks
tests/utils_tests/test_http.py
220
8102
from __future__ import unicode_literals import sys import unittest from datetime import datetime from django.utils import http, six from django.utils.datastructures import MultiValueDict class TestUtilsHttp(unittest.TestCase): def test_same_origin_true(self): # Identical self.assertTrue(http.sa...
bsd-3-clause
vismartltd/edx-platform
common/djangoapps/track/tests/test_tracker.py
88
3481
from django.conf import settings from django.test import TestCase from django.test.utils import override_settings import track.tracker as tracker from track.backends import BaseBackend SIMPLE_SETTINGS = { 'default': { 'ENGINE': 'track.tests.test_tracker.DummyBackend', 'OPTIONS': { 'fl...
agpl-3.0
andela-bojengwa/talk
venv/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py
204
24273
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
mit
bala4901/odoo
addons/l10n_cn/__openerp__.py
91
1827
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2009 Gábor Dukai # # 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 Foun...
agpl-3.0
buzzer/pr2_imagination
race_simulation_run/tools/race_fluent_modification.py
2
6269
#! /usr/bin/env python import yaml import random import roslib class Fluent(yaml.YAMLObject): yaml_tag='!Fluent' def __setstate__(self, state): """ PyYaml does not call __init__. this is an init replacement. """ self.properties = [] self.Class_Instance = state['Class_I...
bsd-2-clause
nirmeshk/oh-mainline
vendor/packages/twisted/twisted/protocols/sip.py
20
41745
# -*- test-case-name: twisted.test.test_sip -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Session Initialization Protocol. Documented in RFC 2543. [Superceded by 3261] This module contains a deprecated implementation of HTTP Digest authentication. See L{twisted.cred.credentials} a...
agpl-3.0
Grarak/grakernel-msm8930
scripts/gcc-wrapper.py
364
3936
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0