repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
peteboyd/lammps_interface
lammps_interface/dreiding.py
1
2689
""" Parameters for DREIDING force field. """ DREIDING_DATA = { # Atom, R1, theta, R0, D0, phi, S "H_": (0.33, 180.0, 3.195, 0.0152, 0.0, 12.382), "H__HB": (0.33, 180.0, 3.195, 0.0001, 0.0, 12.0), "H__b": (0.510, 90.0, 3.195, 0.0152, 0.0, 12.382), "B_3": (0.880, 109.471, 4.02, 0.095, 0.0, 14.23), ...
mit
fjorba/invenio
modules/websession/lib/websession_config.py
7
3821
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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 ## ...
gpl-2.0
harisibrahimkv/django
tests/update_only_fields/tests.py
31
9560
from django.db.models.signals import post_save, pre_save from django.test import TestCase from .models import Account, Employee, Person, Profile, ProxyEmployee class UpdateOnlyFieldsTests(TestCase): def test_update_fields_basic(self): s = Person.objects.create(name='Sara', gender='F') self.assert...
bsd-3-clause
ogenstad/ansible
lib/ansible/modules/clustering/openshift/openshift_raw.py
18
5342
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Chris Houseknecht <@chouseknecht> # 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
MDPvis/rlpy
rlpy/Tools/ipshell.py
4
1472
"""ip-shell functions""" __copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann", "William Dabney", "Jonathan P. How"] __license__ = "BSD 3-Clause" _ip_shell = None def ipshell(): if _ip_shell is not None: retu...
bsd-3-clause
wtpayne/hiai
a3_src/h70_internal/da/check/pytype.py
1
3135
# -*- coding: utf-8 -*- """ Module containing mypy type checking coroutines. --- type: python_module validation_level: v00_minimum protection: k00_public copyright: "Copyright 2016 High Integrity Artificial Intelligence Systems" license: "Licensed under the Apache License, Version 2.0 (the Lice...
apache-2.0
nwjs/chromium.src
tools/grit/grit/tool/android2grd.py
4
19179
# 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. """The 'grit android2grd' tool.""" from __future__ import print_function import getopt import os.path import sys from xml.dom import Node import xml.do...
bsd-3-clause
DeviaVir/qtwebkit
Tools/Scripts/webkitpy/tool/bot/feeders.py
121
4477
# Copyright (c) 2010 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 ...
gpl-2.0
lucafavatella/intellij-community
python/lib/Lib/encodings/cp737.py
593
34937
""" Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.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_map) def decode(self,input,errors='strict...
apache-2.0
xinwu/horizon
openstack_dashboard/dashboards/identity/roles/views.py
63
3427
# Copyright 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 requir...
apache-2.0
cyanna/edx-platform
lms/djangoapps/courseware/features/lti.py
49
14242
# pylint: disable=missing-docstring import datetime import os import pytz from django.conf import settings from mock import patch from pytz import UTC from splinter.exceptions import ElementDoesNotExist from selenium.common.exceptions import NoAlertPresentException from nose.tools import assert_true, assert_equal, asse...
agpl-3.0
dcalacci/Interactive_estimation
game/control/models.py
1
1069
from django.db import models from django.conf import settings # from game.round.models import Round # Create your models here. class Control(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, unique=True) start_time = models.DateTimeField(auto_now_add=True, null=Tr...
mit
glogiotatidis/lumbergh
careers/base/tests/test_middleware.py
2
1311
from unittest.mock import Mock from django.http import HttpResponseRedirect from django.test import RequestFactory from careers.base.middleware import LocaleRedirectionMiddleware from careers.base.tests import TestCase class RedirectionTests(TestCase): def setUp(self): self.requestfactory = RequestFacto...
mpl-2.0
abisee/pointer-generator
data.py
1
11262
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
apache-2.0
lokirius/python-for-android
python-build/python-libs/gdata/build/lib/gdata/spreadsheet/service.py
143
16416
#!/usr/bin/python # # Copyright (C) 2007 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 ...
apache-2.0
Patola/patolascripts
.vim/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py
37
1027
#!/usr/bin/python # (c) 2005-2009 Divmod, Inc. See LICENSE file for details from distutils.core import setup setup( name="pyflakes", license="MIT", version="0.4.0", description="passive checker of Python programs", author="Phil Frost", maintainer="Moe Aboulkheir", maintainer_email="moe@di...
apache-2.0
zeroincombenze/tools
devel_tools/gen_addons_table.py
2
7184
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script replaces markers in the README.md files of an Odoo repository with the list of addons present in the repository. It preserves the marker so it can be run again. The script must be run from the root of the repository, where the README.md file can be found. B...
agpl-3.0
eliran-stratoscale/pyracktest
py/strato/racktest/infra/seed/backedfilecache.py
2
1036
from strato.racktest.infra.seed import memorycache from strato.racktest.infra.seed import filecache from strato.racktest.infra.seed import cacheregistry class FileBackedByMemory(filecache.FileCache): def __init__(self, cacheDir): filecache.FileCache.__init__(self, cacheDir) self._memoryCache = me...
apache-2.0
toastedcornflakes/scikit-learn
sklearn/utils/sparsetools/_graph_validation.py
364
2407
from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc from ._graph_tools import csgraph_to_dense, csgraph_from_dense,\ csgraph_masked_from_dense, csgraph_from_masked DTYPE = np.float64 def validate_graph(csgraph, direc...
bsd-3-clause
huiren/ece511
src/arch/x86/isa/insts/system/undefined_operation.py
50
2209
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
milinbhakta/flaskmaterialdesign
venv/Lib/encodings/cp857.py
272
33908
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.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_map) def decode(self,input,errors='strict'): ...
gpl-2.0
conferency/find-my-reviewers
core/helper/pdf2txt.py
7
4265
#!/usr/bin/env python import sys from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfparser import PDFParser from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfdevice import PDFDevice, TagExtractor from pdfminer.pdfpage import PDFPage from pdfminer.converter import XMLConve...
mit
meduz/scikit-learn
examples/linear_model/plot_ols_3d.py
350
2040
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Sparsity Example: Fitting only features 1 and 2 ========================================================= Features 1 and 2 of the diabetes-dataset are fitted and plotted below. It illustrates that although feature...
bsd-3-clause
dangemstar/mezzaninesource
mezzanine/accounts/urls.py
32
2545
from __future__ import unicode_literals from django.conf.urls import patterns, url from mezzanine.conf import settings ACCOUNT_URL = getattr(settings, "ACCOUNT_URL", "/accounts/") OLD_ACCOUNT_URL = "/account/" SIGNUP_URL = getattr(settings, "SIGNUP_URL", "/%s/signup/" % ACCOUNT_URL.strip("/")) ...
bsd-2-clause
duramato/CouchPotatoServer
libs/xmpp/jep0106.py
202
1488
# JID Escaping XEP-0106 for the xmpppy based transports written by Norman Rasmussen """This file is the XEP-0106 commands. Implemented commands as follows: 4.2 Encode : Encoding Transformation 4.3 Decode : Decoding Transformation """ xep0106mapping = [ [' ' ,'20'], ['"' ,'22'], ['&' ,'26'], ['\'','27'], ['/...
gpl-3.0
popazerty/beyonwiz-4.1
lib/python/Components/SwapCheck.py
66
2815
from Components.Console import Console import os swapdevice = None def bigStorage(minFree): mounts = open('/proc/mounts', 'rb').readlines() mountpoints = [x.split(' ', 2)[1] for x in mounts] for candidate in mountpoints: if not candidate.startswith('/media'): continue try: diskstat = os.statvfs(ca...
gpl-2.0
cherry-wb/viper
viper/common/network.py
1
1068
import socket import urllib2 import socks #import lib.socks as socks from viper.common.out import print_error def download(url, tor=False): def create_connection(address, timeout=None, source_address=None): sock = socks.socksocket() sock.connect(address) return sock import socket ...
bsd-3-clause
DBrianKimmel/PyHouse
Project/src/Modules/Core/Drivers/Serial/_test/test_Serial_driver.py
1
2989
""" @name: Modules/Core/Drivers/Serial/_test/test_Serial_driver.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2013_2019 by D. Brian Kimmel @license: MIT License @note: Created on May 4, 2013 @summary: This module is for testing local node data. Passed all 9 tests - DB...
mit
demarle/VTK
Web/Applications/PhylogeneticTree/server/vtk_web_phylogenetic_tree.py
9
5283
r""" This module is a VTK Web server application. The following command line illustrate how to use it:: $ vtkpython .../vtk_web_phylogenetic_tree.py --tree /.../data.phy --table /.../data.csv Set of expected arguments: --tree /file/path/to/anolis.phy --table /file/path/to/anolisDa...
bsd-3-clause
frossigneux/python-kwstandbyclient
kwstandbyclient/utils.py
1
5680
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
indictranstech/buyback-erp
erpnext/accounts/utils.py
7
15647
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import nowdate, cstr, flt, now, getdate, add_months from frappe import throw, _ from frappe.utils import formatdate ...
agpl-3.0
shashank971/edx-platform
common/djangoapps/external_auth/tests/test_shib.py
42
30355
# -*- coding: utf-8 -*- """ Tests for Shibboleth Authentication @jbau """ import unittest from ddt import ddt, data from django.conf import settings from django.http import HttpResponseRedirect from django.test import TestCase from django.test.client import RequestFactory, Client as DjangoTestClient from django.test.u...
agpl-3.0
nattee/cafe-grader-web
lib/assets/Lib/encodings/cp863.py
37
34950
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.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_map) def decode(self,input,errors=...
mit
jonhadfield/ansible-lookups
aws_subnet_ids_from_names.py
1
1411
# (c) 2017, Jon Hadfield <jon@lessknown.co.uk> """ Description: This lookup takes an AWS region and a list of one or more subnet names and returns a list of matching subnet ids. Example Usage: {{ lookup('aws_subnet_ids_from_names', ('eu-west-1', ['subnet1', 'subnet2'])) }} """ from __future__ import (absolute_import, ...
mit
sysid/kg
quora/Ensemble_CNN_TD_Quora.py
1
12948
# coding: utf-8 # In[1]: import pandas as pd import numpy as np import nltk from nltk.corpus import stopwords from nltk.stem import SnowballStemmer import re from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt # In[2]: train = pd.read_csv("../input/train.csv") test = pd.read_csv("../input/te...
mit
markrawlingson/SickRage
lib/sqlalchemy/event/base.py
79
7304
# event/base.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 """Base implementation classes. The public-facing ``Events`` serves as the base class f...
gpl-3.0
tsuna/tcollector
tcollector.py
1
58569
#!/usr/bin/env python # This file is part of tcollector. # Copyright (C) 2010 The tcollector Authors. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
gpl-3.0
mayblue9/scikit-learn
examples/linear_model/lasso_dense_vs_sparse_data.py
348
1862
""" ============================== Lasso on dense and sparse data ============================== We show that linear_model.Lasso provides the same results for dense and sparse data and that in the case of sparse data the speed is improved. """ print(__doc__) from time import time from scipy import sparse from scipy ...
bsd-3-clause
zdravi/jrnl
jrnl/Entry.py
7
3938
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals import re import textwrap from datetime import datetime class Entry: def __init__(self, journal, date=None, title="", body="", starred=False): self.journal = journal # Reference to journal mainly to access it's config ...
mit
ronbelson/ghost-proxy-hebrew
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/html.py
94
31067
# -*- coding: utf-8 -*- """ pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import sys import os.path import io from pygments.formatter import For...
mit
takis/django
tests/utils_tests/test_timesince.py
293
6089
from __future__ import unicode_literals import datetime import unittest from django.test.utils import requires_tz_support from django.utils import timezone from django.utils.timesince import timesince, timeuntil class TimesinceTests(unittest.TestCase): def setUp(self): self.t = datetime.datetime(2007, ...
bsd-3-clause
PeterWangIntel/chromium-crosswalk
third_party/protobuf/python/ez_setup.py
454
10334
#!python # This file was obtained from: # http://peak.telecommunity.com/dist/ez_setup.py # on 2011/1/21. """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup...
bsd-3-clause
louargantb/onectl
onectl-plugins/neighbors/communities.py
1
6515
#!/usr/bin/python -u # Name: fqn.plugin.name from includes import pluginClass from includes import regexp import os import sys import re import subprocess import inspect class PluginControl(pluginClass.Base): def setOptions(self): ''' Create additional argument parser options specific to the plugin ''' dic = ...
gpl-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/virtual_network_gateway_connection_list_entity_py3.py
1
7889
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
boa19861105/BOA_Eye_M6.0_Kernel
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
gooddata/openstack-nova
nova/api/openstack/placement/handlers/root.py
2
2406
# 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 # d...
apache-2.0
kvar/ansible
lib/ansible/modules/cloud/vmware/_vmware_host_feature_facts.py
21
4460
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_...
gpl-3.0
lcc755/WorkTerm1
3IfStatements/1Sounds/Code/playNote.py
1
1297
from nanpy import (ArduinoApi, SerialManager, Tone) from time import sleep #Connect to Arduino. Automatically finds serial port. connection = SerialManager() speaker = 14 #AO on Arduino tone = Tone(speakerpin, connection) #Setting "tone" to mean using the "speaker" pin on the "connection". See tone library in Na...
apache-2.0
YinongLong/scikit-learn
sklearn/manifold/isomap.py
50
7515
"""Isomap for manifold learning""" # Author: Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) 2011 import numpy as np from ..base import BaseEstimator, TransformerMixin from ..neighbors import NearestNeighbors, kneighbors_graph from ..utils import check_array from ..utils.graph import...
bsd-3-clause
cognitiveclass/edx-platform
common/lib/xmodule/xmodule/modulestore/split_mongo/mongo_connection.py
12
20185
""" Segregation of pymongo functions from the data modeling mechanisms for split modulestore. """ import datetime import cPickle as pickle import math import zlib import pymongo import pytz import re from contextlib import contextmanager from time import time # Import this just to export it from pymongo.errors import ...
agpl-3.0
tsabi/Odoo-tsabi-fixes
openerp/tools/test_reports.py
337
13520
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
Instanssi/Instanssi.org
Instanssi/store/utils/paytrail.py
1
1289
# -*- coding: utf-8 -*- import hashlib import requests class PaytrailException(Exception): pass def validate_failure(order_no, timestamp, authcode, secret): m = hashlib.md5() m.update('{}|{}|{}'.format(order_no, timestamp, secret).encode('UTF-8')) return authcode == m.hexdigest().upper() def vali...
mit
jgabriellima/yowsup
yowsup/layers/protocol_profiles/protocolentities/iq_status_set.py
45
1100
from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity from yowsup.structs import ProtocolTreeNode class SetStatusIqProtocolEntity(IqProtocolEntity): ''' <iq to="s.whatsapp.net" xmlns="status" type="set" id="{{IQ_ID}}"> <status>{{MSG}}</status> </notification> ''' XMLNS = "...
gpl-3.0
miracle2k/stgit
stgit/stack.py
1
40808
"""Basic quilt-like functionality """ __copyright__ = """ Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is d...
gpl-2.0
cancan101/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v2.py
69
26636
# 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...
apache-2.0
CasparLi/calibre
src/calibre/ebooks/conversion/plugins/epub_input.py
15
11081
from __future__ import with_statement __license__ = 'GPL 3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import os, re from itertools import cycle from calibre.customize.conversion import InputFormatPlugin, OptionRecommendation ADOBE_OBFUSCATION = 'http://ns.adobe...
gpl-3.0
crepererum/invenio-demosite
invenio_demosite/testsuite/regression/test_bibformat.py
7
28360
# -*- coding: utf-8 -*- # # This file is part of Invenio Demosite. # Copyright (C) 2007, 2008, 2010, 2011, 2012, 2013 CERN. # # Invenio Demosite 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...
gpl-2.0
ljgabc/lfs
usr/lib/python2.7/distutils/ccompiler.py
30
46533
"""distutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.""" __revision__ = "$Id$" import sys import os import re from distutils.errors import (CompileError, LinkError, UnknownFileError, DistutilsPlatformE...
gpl-2.0
hclhkbu/dlbench
post_record.py
2
2977
#!/usr/bin/env python import settings import argparse import time import requests import json def post_record(**args): """ Args: flag, network, batch_size, device_name, gpu_count, cpu_count, epoch_size, epoch, total_time, average_time, tool_name, avg_mem, epoch_info, log_file, cuda, ...
mit
savoirfairelinux/shinken
test/test_on_demand_event_handlers.py
18
2390
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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
emilhetty/home-assistant
homeassistant/components/tellduslive.py
5
7466
""" Support for Telldus Live. For more details about this component, please refer to the documentation at https://home-assistant.io/components/tellduslive/ """ import logging from datetime import timedelta from homeassistant.helpers import validate_config, discovery from homeassistant.util import Throttle DOMAIN = "...
mit
stackforge/blazar
blazar/tests/db/test_api.py
3
1144
# Copyright (c) 2013 Bull. # # 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, sof...
apache-2.0
betoesquivel/fil2014
filenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py
3133
82594
######################## 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...
mit
apostolosSotiropoulos/interQuepy
examples/freebase/freebase/tvshows.py
7
3001
# coding: utf-8 """ Tv Shows related regex. """ from dsl import * from refo import Plus, Question from quepy.dsl import HasKeyword from quepy.parsing import Lemma, Lemmas, Pos, QuestionTemplate, Particle nouns = Plus(Pos("NN") | Pos("NNS") | Pos("NNP") | Pos("NNPS")) class TvShow(Particle): regex = Plus(Questi...
bsd-3-clause
ActiveState/code
recipes/Python/212565_copickle__module_serialize_code/recipe-212565.py
1
1544
""" Create portable serialized representations of Python <code> Objects""" import new import pickle def co_dumps(s): """pickles a code object,arg s is the string with code returns the code object pickled as a string""" co = compile(s,'<string>','exec') co_tup=[co.co_argcount,co.co_nlocals, co.co_stac...
mit
jazzmes/ryu
ryu/app/ofctl_rest.py
4
24130
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
dmarteau/QGIS
python/plugins/processing/gui/RectangleMapTool.py
30
3872
# -*- coding: utf-8 -*- """ *************************************************************************** RectangleMapTool.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
gpl-2.0
Murlocks/Ngram-Tiling-QA
lib/pattern/web/imap/__init__.py
3
10519
#### PATTERN | WEB | IMAP ########################################################################## # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ####################################...
mit
wkschwartz/django
tests/update/tests.py
1
11045
import unittest from django.core.exceptions import FieldError from django.db import IntegrityError, connection, transaction from django.db.models import CharField, Count, F, IntegerField, Max from django.db.models.functions import Abs, Concat, Lower from django.test import TestCase from django.test.utils import regist...
bsd-3-clause
micmn/shogun
examples/undocumented/python/graphical/classifier_gaussian_process_binary_classification.py
5
3740
# # 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. # # Written (W) 2013 Roman Votyakov # from pylab import * from numpy im...
gpl-3.0
ConnorGBrewster/servo
tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/scroll_into_view.py
4
2764
from tests.support.asserts import assert_success from tests.support.fixtures import is_element_in_viewport from tests.support.inline import inline def element_send_keys(session, element, text): return session.transport.send( "POST", "/session/{session_id}/element/{element_id}/value".format( se...
mpl-2.0
Serag8/Bachelor
google_appengine/lib/django-1.5/django/contrib/localflavor/jp/jp_prefectures.py
543
2089
from django.utils.translation import ugettext_lazy JP_PREFECTURES = ( ('hokkaido', ugettext_lazy('Hokkaido'),), ('aomori', ugettext_lazy('Aomori'),), ('iwate', ugettext_lazy('Iwate'),), ('miyagi', ugettext_lazy('Miyagi'),), ('akita', ugettext_lazy('Akita'),), ('yamagata', ugettext_lazy('Yamagat...
mit
krafczyk/spack
var/spack/repos/builtin/packages/r-nnls/package.py
5
1729
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
cstipkovic/spidermonkey-research
js/src/build_OPT.OBJ/_virtualenv/lib/python2.7/site-packages/pip/utils/hashes.py
517
2866
from __future__ import absolute_import import hashlib from pip.exceptions import HashMismatch, HashMissing, InstallationError from pip.utils import read_chunks from pip._vendor.six import iteritems, iterkeys, itervalues # The recommended hash algo of the moment. Change this whenever the state of # the art changes; ...
mpl-2.0
GovReady/readthedocs.org
readthedocs/api/base.py
7
11365
import logging import json import redis from django.contrib.auth.models import User from django.conf import settings from django.conf.urls import url from django.shortcuts import get_object_or_404 from tastypie import fields from tastypie.authorization import DjangoAuthorization from tastypie.constants import ALL_WIT...
mit
xiaotdl/ansible
lib/ansible/plugins/shell/powershell.py
35
7595
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
mjumbewu/django-model-filters
example_project/pepulator_factory/migrations/0003_auto__add_field_knuckle_img_url.py
2
2557
# 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): # Adding field 'Knuckle.img_url' db.add_column('pepulator_factory_knuckle', 'img_url', self.gf('django.db....
bsd-3-clause
cackharot/fbeazt
src/foodbeazt/resources/store_order_report.py
1
2259
from datetime import datetime from dateutil import parser as dtparser, tz from bson import ObjectId, json_util from flask import g, request from flask_restful import Resource from service.StoreOrderService import StoreOrderService from service.StoreService import StoreService from foodbeazt.fapp import mongo, store_adm...
apache-2.0
zhiyu-he/algorithm-trip
growth/oj/leet_code/algorithms/122-best-time-to-buy-and-sell-stock-ii.py
1
1289
# -*- coding: utf-8 -*- ''' TIPS: 1. operation (buy, sell) 2. for each (buy, sell), we find the longest incr sequence 3. but the most important question why longest incr sequence is work? ''' class Solution(object): def maxProfit(self, prices): """ :type prices: List[int] :rtype...
gpl-2.0
ltucker/radarpost
radarpost/tests/test_feeds.py
1
6884
from helpers import * def test_feed_basic(): """ test_feed_basic create a mailbox subscribe to a feed update the subscription assert expected items are in the mailbox """ from radarpost.feed import FeedSubscription, update_feed_subscription, parse, AtomEntry from radarpost.mailbox ...
gpl-2.0
chromium/chromium
net/tools/testserver/minica.py
12
22789
# 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 asn1 import datetime import hashlib import itertools import os import time GENERALIZED_TIME_FORMAT = "%Y%m%d%H%M%SZ" OCSP_STATE_GOOD = 1 OCSP_ST...
bsd-3-clause
araczkowski/RPi-InfoScreen-Kivy
screens/wordclock/layouts/portuguese.py
2
2953
# -*- coding: utf-8 -*- '''This is a custom layout for the RPi InfoScreen wordclock screen. Custom layouts can be created for the screen by creating a new file in the "layouts" folder. Each layout must have the following variables: LAYOUT: The grid layout. Must be a single string. MAP: ...
gpl-3.0
nelsyeung/half-metals-analysis
lib/compounds/five_elements.py
1
2465
""" Class for generate 5 elements compounds """ import os import sys import inspect baseLibDir = os.path.join(os.path.realpath(os.path.dirname( inspect.getfile(inspect.currentframe()))), '..') sys.path.append(baseLibDir) import nmod from compound import Compound class FiveElements(Compound): """ Five...
mit
wangjiezhe/FetchNovels
novel/sources/tianna.py
1
1167
#!/usr/bin/env python # -*- coding: utf-8 -*- from urllib.parse import urljoin from pyquery import PyQuery from novel import serial, utils BASE_URL = 'http://www.tianna.la/tnw{}/' class Tianna(serial.SerialNovel): def __init__(self, tid): super().__init__(utils.base_to_url(BASE_URL, tid), '#content',...
gpl-3.0
tarasane/h2o-3
h2o-py/tests/h2o_pyunit.py
1
1766
import urllib2 import sys sys.path.insert(1, "..") import h2o from tests import utils """ Here is some testing infrastructure for running the pyunit tests in conjunction with run.py. run.py issues an ip and port as a string: "<ip>:<port>". The expected value of sys_args[1] is "<ip>:<port>" All tests MUST have the f...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pillow-2.9.0/PIL/ImageColor.py
73
7981
# # The Python Imaging Library # $Id$ # # map CSS3-style colour description strings to RGB # # History: # 2002-10-24 fl Added support for CSS-style color strings # 2002-12-15 fl Added RGBA support # 2004-03-27 fl Fixed remaining int() problems for Python 1.5.2 # 2004-07-19 fl Fixed gray/grey spelling issues # 2...
mit
mattcaldwell/boto
boto/sdb/db/property.py
20
24640
# Copyright (c) 2006,2007,2008 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,...
mit
tsl143/addons-server
src/olympia/api/tests/test_jwt_auth.py
1
6575
from datetime import datetime, timedelta from django.conf import settings import jwt from rest_framework.exceptions import AuthenticationFailed from rest_framework_jwt.settings import api_settings from olympia.amo.tests import TestCase from olympia.api import jwt_auth from olympia.api.models import APIKey, SYMMETRIC...
bsd-3-clause
badock/nova
nova/virt/xenapi/vmops.py
2
97290
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
apache-2.0
ecrespo/django_kanban-agile
kanban/lib/python2.7/site-packages/django/contrib/admin/actions.py
395
3316
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
mit
CivilNet/Gemfield
dockerfiles/py-faster-rcnn/files/gemfield/py-faster-rcnn/caffe-fast-rcnn/examples/web_demo/exifutil.py
58
1046
""" This script handles the skimage exif problem. """ from PIL import Image import numpy as np ORIENTATIONS = { # used in apply_orientation 2: (Image.FLIP_LEFT_RIGHT,), 3: (Image.ROTATE_180,), 4: (Image.FLIP_TOP_BOTTOM,), 5: (Image.FLIP_LEFT_RIGHT, Image.ROTATE_90), 6: (Image.ROTATE_270,), 7...
gpl-3.0
davicustodio/geonode
geonode/maps/management/commands/updatemaplayerip.py
35
1266
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
c4goldsw/shogun
examples/undocumented/python_modular/evaluation_contingencytableevaluation_modular.py
26
1989
#!/usr/bin/env python from tools.load import LoadMatrix from numpy import random lm=LoadMatrix() ground_truth = lm.load_labels('../data/label_train_twoclass.dat') random.seed(17) predicted = random.randn(len(ground_truth)) parameter_list = [[ground_truth,predicted]] def evaluation_contingencytableevaluation_modular ...
gpl-3.0
imsparsh/python-for-android
python-modules/twisted/twisted/words/im/ircsupport.py
49
9263
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ IRC support for Instance Messenger. """ import string from twisted.words.protocols import irc from twisted.words.im.locals import ONLINE from twisted.internet import defer, reactor, protocol from twisted.internet.defer import succe...
apache-2.0
EclecticIQ/OpenTAXII
tests/services/test_subscription_management.py
2
7942
import pytest from libtaxii.constants import ( RT_FULL, CB_STIX_XML_111, ACT_PAUSE, ACT_RESUME, ACT_UNSUBSCRIBE, ACT_SUBSCRIBE, SS_ACTIVE, SS_PAUSED, SS_UNSUBSCRIBED) from opentaxii.taxii import exceptions from utils import ( prepare_headers, as_tm, prepare_subscription_request as prepare_request) f...
bsd-3-clause
fritsvanveen/QGIS
python/ext-libs/owslib/waterml/wml11.py
22
1156
from __future__ import (absolute_import, division, print_function) from owslib.waterml.wml import SitesResponse, TimeSeriesResponse, VariablesResponse, namespaces from owslib.etree import etree, ElementType def ns(namespace): return namespaces.get(namespace) class WaterML_1_1(object): def __init__(self, elem...
gpl-2.0
kimkulling/osre
contrib/gmock-1.7.0/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
wrouesnel/ansible
lib/ansible/modules/cloud/openstack/os_image_facts.py
20
4352
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # 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
wangyou/XX-Net
code/default/python27/1.0/lib/noarch/encrypt.py
5
6066
#!/usr/bin/env python # Copyright (c) 2014 clowwindy # # 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, me...
bsd-2-clause
anthonysandrin/kafka-utils
kafka_utils/kafka_cluster_manager/cluster_info/topic.py
1
1887
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ...
apache-2.0