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 |
|---|---|---|---|---|---|
rusenask/stubo-app | stubo/cache/__init__.py | 1 | 24946 | """
stubo.cache
~~~~~~~~~~~
Redis Caching
:copyright: (c) 2015 by OpenCredo.
:license: GPLv3, see LICENSE for more details.
"""
import logging
import datetime
import time
from .queue import String, Hash, Queue, get_redis_master, get_redis_slave
from stubo.exceptions import exception_resp... | gpl-3.0 |
joannelynch92/pyyaml | lib/yaml/representer.py | 359 | 17642 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
d... | mit |
wreese/megacfs | vendor/github.com/google/certificate-transparency/python/ct/serialization/tls_message_test.py | 27 | 10987 | #!/usr/bin/env python
import unittest
from ct.proto import client_pb2
from ct.proto import test_message_pb2
from ct.serialization import tls_message
valid_test_message = test_message_pb2.TestMessage()
valid_test_message.uint_8 = 0
valid_test_message.uint_16 = 258
valid_test_message.uint_24 = 197637
valid_test_messa... | apache-2.0 |
souravsingh/sympy | sympy/utilities/tests/test_pickling.py | 21 | 20790 | import copy
import pickle
import warnings
from sympy.utilities.pytest import XFAIL
from sympy.core.basic import Atom, Basic
from sympy.core.core import BasicMeta
from sympy.core.singleton import SingletonRegistry
from sympy.core.symbol import Dummy, Symbol, Wild
from sympy.core.numbers import (E, I, pi, oo, zoo, nan, ... | bsd-3-clause |
insionng/p2pool | p2pool/bitcoin/stratum.py | 191 | 3756 | import random
import sys
from twisted.internet import protocol, reactor
from twisted.python import log
from p2pool.bitcoin import data as bitcoin_data, getwork
from p2pool.util import expiring_dict, jsonrpc, pack
class StratumRPCMiningProvider(object):
def __init__(self, wb, other, transport):
self.wb =... | gpl-3.0 |
aforalee/RRally | tests/unit/plugins/openstack/scenarios/sahara/test_clusters.py | 6 | 3984 | # Copyright 2014: 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 required b... | apache-2.0 |
vlachoudis/sl4a | python/src/Lib/CGIHTTPServer.py | 59 | 12687 | """CGI-savvy HTTP Server.
This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.
If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Py... | apache-2.0 |
adrienbrault/home-assistant | tests/components/vizio/conftest.py | 4 | 6930 | """Configure py.test."""
from unittest.mock import AsyncMock, patch
import pytest
from pyvizio.api.apps import AppConfig
from pyvizio.const import DEVICE_CLASS_SPEAKER, MAX_VOLUME
from .const import (
ACCESS_TOKEN,
APP_LIST,
CH_TYPE,
CURRENT_APP_CONFIG,
CURRENT_EQ,
CURRENT_INPUT,
EQ_LIST,
... | mit |
jennielees/full-stack | public/data/sweep_counts.py | 1 | 1405 | import csv
# The keys in days have to match the data in the file
# so we can use the value in the file when we read it
# to save ourselves typing out a bunch of if statements.
days = {
'Mon': 0,
'Tues': 0,
'Wed': 0,
'Thu': 0,
'Fri': 0,
'Sat': 0,
'Sun': 0,
'Holiday': 0
}
with open('sweep.csv') as f:
... | mit |
Outernet-Project/outernet-broadman | broadman/zips.py | 1 | 1216 | """
Functions for working with zipfiles
Copyright 2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
import os
import zipfile
from . import path
def zcid(p):
"... | gpl-3.0 |
gph82/mdtraj | mdtraj/scripts/mdconvert.py | 7 | 20690 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: ... | lgpl-2.1 |
louietsai/python-for-android | python3-alpha/python3-src/Lib/idlelib/StackViewer.py | 67 | 3567 | import os
import sys
import linecache
from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas
from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
def StackBrowser(root, flist=None, tb=None, top=None):
if top is None:
from tkinter import Toplevel
top = Toplevel(root)
... | apache-2.0 |
CloudComputingCourse/django-shibboleth-remoteuser | shibboleth/middleware.py | 1 | 5753 | from django.contrib.auth.middleware import RemoteUserMiddleware
from django.contrib.auth.models import Group
from django.contrib import auth
from django.core.exceptions import ImproperlyConfigured
from shibboleth.app_settings import SHIB_ATTRIBUTE_MAP, GROUP_ATTRIBUTES, LOGOUT_SESSION_KEY
from website.models import Pe... | mit |
mmnelemane/nova | nova/virt/images.py | 16 | 5134 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | apache-2.0 |
elkingtonmcb/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/dviread.py | 69 | 29920 | """
An experimental module for reading dvi files output by TeX. Several
limitations make this not (currently) useful as a general-purpose dvi
preprocessor.
Interface::
dvi = Dvi(filename, 72)
for page in dvi: # iterate over pages
w, h, d = page.width, page.height, page.descent
for x,y,font,gl... | agpl-3.0 |
ptisserand/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_cancel.py | 23 | 2728 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.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_version': '1.1... | gpl-3.0 |
ThiagoGarciaAlves/erpnext | erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.py | 56 | 5000 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
from erpnext.accounts.utils import get_fiscal_year
from erpnext.controllers.tr... | agpl-3.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/pygments/lexers/_lua_builtins.py | 6 | 8346 | # -*- coding: utf-8 -*-
"""
pygments.lexers._lua_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit ... | mit |
pkazzer/cdh-centos-azure | scripts/cmxDeployOnIbiza.py | 10 | 88043 | #!/usr/bin/env python
#
__version__ = '0.11.2803'
import socket
import re
import urllib
import urllib2
from optparse import OptionParser
import hashlib
import os
import sys
import random
import paramiko
from paramiko import SSHClient
from time import sleep
from cm_api.api_client import ApiResource, ApiException
fro... | apache-2.0 |
kenwang815/KodiPlugins | script.module.youtube.dl/lib/youtube_dl/extractor/svt.py | 7 | 4292 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
)
class SVTBaseIE(InfoExtractor):
def _extract_video(self, url, video_id):
info = self._download_json(url, video_id)
title = info['context']['title']
... | gpl-2.0 |
BorgERP/borg-erp-6of3 | addons/account/wizard/account_report_common_partner.py | 9 | 2023 | # -*- 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 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/views/static.py | 190 | 5142 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
from __future__ import unicode_literals
import mimetypes
import os
import posixpath
import re
import stat
from django.http import (
FileResponse, Http404, HttpRespons... | mit |
ctuning/ck-env | package/imagenet-2012-val-lmdb-299/custom.py | 5 | 5860 | #!/usr/bin/python
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def pre_path(i):
"""
Input: {
cfg - meta of th... | bsd-3-clause |
elventear/ansible | lib/ansible/plugins/action/win_copy.py | 185 | 1153 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an... | gpl-3.0 |
jgeewax/gcloud-python | vision/unit_tests/_fixtures.py | 3 | 56056 | # Copyright 2016 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 or agreed to in writing, ... | apache-2.0 |
hydrospanner/DForurm | DForurm/env/Lib/site-packages/django/contrib/gis/geos/linestring.py | 136 | 6019 | from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
from django.contrib.gis.geos.point import Point
from django.contrib.gis.... | mit |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/python/util/tf_decorator.py | 33 | 6211 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
petecummings/django | tests/multiple_database/models.py | 282 | 2472 | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
clas... | bsd-3-clause |
easonC/elasticsearch | dev-tools/build_release.py | 9 | 35976 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
alexanderturner/ansible | lib/ansible/modules/cloud/cloudstack/cs_template.py | 48 | 21811 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
liorvh/raspberry_pwn | src/pentest/grabber/xss.py | 8 | 4018 | #!/usr/bin/env python
"""
Cross-Site Scripting Module for Grabber v0.1
Copyright (C) 2006 - Romain Gaucher - http://rgaucher.info
"""
import sys
from grabber import getContent_POST, getContent_GET
from grabber import getContentDirectURL_GET, getContentDirectURL_POST
from grabber import single_urlencode, par... | gpl-3.0 |
Og192/Python | machine-learning-algorithms/mlalg/linearRegression/regression.py | 2 | 3767 | from numpy import *
def loadDataSet(fileName):
# drop the colum(last colum) of label.
numFeat = len(open(fileName).readline().split('\t')) - 1
dataMat = []
labelMat = []
fr = open(fileName)
for line in fr.readlines():
lineArr = []
curLine = line.strip().split('\t')
for i ... | gpl-2.0 |
jtk1rk/xsubedit | video.py | 1 | 5304 | import gi
gi.require_version('Gst', '1.0')
gi.require_version('GObject', '2.0')
gi.require_version('GdkX11', '3.0')
gi.require_version('GstVideo', '1.0')
from gi.repository import Gst, GdkX11, GstVideo, GObject
import platform
class Video(GObject.GObject):
__gsignals__ = { 'position-update': (GObject.SIGNAL_RUN_LA... | gpl-3.0 |
ronfung/incubator-airflow | tests/contrib/hooks/test_emr_hook.py | 58 | 1747 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
Stefanos19/prpy | src/prpy/controllers/rewd_controllers.py | 2 | 3373 | import logging
class OrController(object):
"""Dummy/empty OpenRAVE controller class"""
def GetControlDOFIndices(self):
raise NotImplementedError("GetControlDOFIndices not implemented")
def GetNamespace(self):
return self.namespace
def GetRobot(self):
return self.robot
d... | bsd-3-clause |
rhyolight/htmengine-traffic-tutorial | python-engine/send_cpu.py | 11 | 2085 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | gpl-3.0 |
bbriggs/docker-bukkit | configure.py | 1 | 4448 | #! /usr/bin/env python3
import os
import datetime
class Config:
def __init__(self):
self.properties = self._set_props()
return
@staticmethod
def _set_props():
props = {
"generator-settings": os.getenv("GENERATOR_SETTINGS"),
"os-permission-level": os.getenv("... | gpl-2.0 |
aek/solt_sftp | src/solt_sftp/server.py | 1 | 9404 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015 Axel Mendoza <aekroft@gmail.com>
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 limita... | mit |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/perf/benchmarks/benchmark_smoke_unittest.py | 1 | 6131 | # Copyright 2014 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.
"""Run the first page of one benchmark for every module.
Only benchmarks that have a composable measurement are included.
Ideally this test would be compreh... | mit |
savoirfairelinux/partner-addons | partner_tracking/models/res_partner.py | 1 | 5609 | # -*- coding: utf-8 -*-
# © 2017 Savoir-faire Linux
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import _, api, fields, models, SUPERUSER_ID
from odoo.exceptions import Warning
TRACKED_FIELDS = {
'name', 'date', 'title', 'parent_id', 'ref', 'lang',
'tz', 'user_id', 'vat', 'website... | lgpl-3.0 |
rbian/tp-libvirt | libvirt/tests/src/virsh_cmd/monitor/virsh_domblkinfo.py | 8 | 5391 | import os
from autotest.client.shared import error
from virttest import virsh
from virttest.libvirt_xml import vm_xml
def run(test, params, env):
"""
Test command: virsh domblkinfo.
1.Prepare test environment.
2.Get vm's driver.
3.According to driver perform virsh domblkinfo operation.
4.Recov... | gpl-2.0 |
sangwonl/audi | audi/external/babel/support.py | 137 | 21812 | # -*- coding: utf-8 -*-
"""
babel.support
~~~~~~~~~~~~~
Several classes and functions that help with integrating and using Babel
in applications.
.. note: the code in this module is not used by Babel itself
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more detail... | mit |
maohongyuan/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/locations.py | 390 | 6202 | """Locations where we look for configs, install stuff, etc"""
import sys
import site
import os
import tempfile
from distutils.command.install import install, SCHEME_KEYS
import getpass
from pip.backwardcompat import get_python_lib, get_path_uid, user_site
import pip.exceptions
DELETE_MARKER_MESSAGE = '''\
This file ... | lgpl-3.0 |
sanmugamk/django-filter | tests/test_views.py | 4 | 2816 | from __future__ import absolute_import
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.client import RequestFactory
from django_filters.views import FilterView
from django_filters.filterset import FilterSet, filterset_fa... | bsd-3-clause |
openhatch/oh-mainline | vendor/packages/python-social-auth/social/apps/django_app/views.py | 76 | 2181 | from django.conf import settings
from django.contrib.auth import login, REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt, csrf_protect
from django.views.decorators.http import require_POST
from django.views.decorators.cache import never_c... | agpl-3.0 |
ORTI3D/ORTI3D_code | iliblast/min3pWriter.py | 1 | 37968 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 19 12:54:49 2014
@author: olive
"""
from array import array as arr2
import os
from pylab import savetxt,loadtxt
#import min3pFlowKeywords as Fkey
#import min3pTransKeywords as Tkey
#import min3pChemKeywords as Ckey
from geometry import *
from timeperiod import *
class mi... | gpl-3.0 |
AsgerPetersen/QGIS | tests/testdata/test_plugin_path/PluginPathTest/__init__.py | 35 | 1878 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : July 2013
Copyright : (C) 2013 by Hugo Mercier
Email : hugo dot mercier at oslandia dot com
********************... | gpl-2.0 |
OCA/vertical-abbey | mass/wizard/select_mass_requests_to_transfer.py | 1 | 1118 | # -*- coding: utf-8 -*-
# © 2014-2017 Barroux Abbey (www.barroux.org)
# © 2014-2017 Akretion France (www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class MassRequestsToTransfer(models.Transien... | agpl-3.0 |
maciekcc/tensorflow | tensorflow/contrib/tpu/python/tpu/tpu_function.py | 72 | 3720 | # 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 |
catcosmo/froide | froide/publicbody/south_migrations/0011_auto__add_jurisdiction__del_field_publicbody_geography__del_field_foil.py | 6 | 10818 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from froide.helper.auth_migration_util import USER_DB_NAME
APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user'
class Migration(SchemaMigration):
def forwards(self, orm):
... | mit |
painterjd/stoplight | stoplight/__init__.py | 1 | 5133 | """Stoplight -- an input validation framework for Python
Every good programmer should know that input validation is the first and
best step at implementing application-level security for your product.
Unvalidated user input leads to issues such as SQL injection, javascript
injection and cross-site scripting attacks, e... | apache-2.0 |
tmylk/gensim | gensim/test/test_indirect_confirmation.py | 17 | 2059 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for indirect confirmation measures in the indirect_confirmation_measure module.
"""
import logging
import unittest
... | gpl-3.0 |
kutenai/django | tests/auth_tests/test_basic.py | 8 | 6765 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.test import TestCase, overr... | bsd-3-clause |
girving/tensorflow | tensorflow/contrib/nearest_neighbor/python/ops/nearest_neighbor_ops.py | 79 | 2852 | # 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 |
belmiromoreira/nova | nova/db/sqlalchemy/migrate_repo/versions/232_drop_dump_tables.py | 81 | 1048 | # Copyright 2014, Red Hat, 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 agr... | apache-2.0 |
mobo95/pyload | module/lib/thrift/transport/TSocket.py | 62 | 5094 | #
# 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... | gpl-3.0 |
jacobakkerboom/codecombat | scripts/analytics/parseMixpanelPayments.py | 97 | 7793 | # Parse subscription conversion rates via Mixpanel raw export API
import sys
from datetime import tzinfo, timedelta, datetime
from mixpanel import Mixpanel
try:
import json
except ImportError:
import simplejson as json
# NOTE: mixpanel dates are by day and inclusive
# E.g. '2014-12-08' is any date that day,... | mit |
termie/nova-migration-demo | doc/ext/nova_todo.py | 9 | 3313 | # -*- coding: utf-8 -*-
# This is a hack of the builtin todo extension, to make the todo_list more user friendly
from sphinx.ext.todo import *
from docutils.parsers.rst import directives
import re
def _(s):
return s
def process_todo_nodes(app, doctree, fromdocname):
if not app.config['todo_include_todos']:
... | apache-2.0 |
eeshangarg/oh-mainline | vendor/packages/Pygments/pygments/token.py | 365 | 5662 | # -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... | agpl-3.0 |
miguelpalacio/python-for-android | python-build/python-libs/gdata/build/lib/gdata/tlslite/errors.py | 333 | 5795 | """Exception classes.
@sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert,
TLSAuthenticationError, TLSNoAuthenticationError, TLSAuthenticationTypeError,
TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError
"""
from constants import AlertDescription, AlertLevel
class ... | apache-2.0 |
CuonDeveloper/cuon | cuon_client/Client/CUON/cuon/Addresses/printAddress.py | 3 | 1959 | # -*- coding: utf-8 -*-
##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne]
##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 versio... | gpl-3.0 |
pssguy/openaddresses | apply-us-data.py | 11 | 2756 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv, json
from glob import glob
from os.path import basename, join
with open(join('us-data', 'codes.txt')) as f:
rows = list(csv.DictReader(f, dialect='excel-tab'))
codes = dict([(row['Postal Code'].lower(), row['State']) for row in rows])
with open(join('... | bsd-3-clause |
jonyroda97/redbot-amigosprovaveis | lib/matplotlib/tri/triinterpolate.py | 2 | 65840 | """
Interpolation inside triangular grids.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import xrange
from matplotlib.tri import Triangulation
from matplotlib.tri.trifinder import TriFinder
from matplotlib.tri.tritools impor... | gpl-3.0 |
esheris/vmware-scripts | vm_builds.py | 1 | 17743 | import sys
import time
from pyVim.connect import SmartConnect
from pyVmomi import vim, vmodl
import random
class VmBuilds:
def connect_to_vmware(self):
si = SmartConnect(host=self.vmware_server, user=self.vmware_user, pwd=self.vmware_password,
port=self.vmware_port)
retur... | apache-2.0 |
stevenmizuno/QGIS | python/plugins/processing/algs/gdal/merge.py | 6 | 5743 | # -*- coding: utf-8 -*-
"""
***************************************************************************
merge.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | gpl-2.0 |
pablobesada/tw | sentiment/twitter-sentiment-classifier/tweet_pca.py | 3 | 1381 | """
@package tweet_pca
PCT for dimensionality reduction.
"""
import mdp, numpy
import tweet_features
import pdb
def tweet_pca_reduce( tweets_train, tweets_test, output_dim ):
# convert dictionary feature vecs to numpy array
print '--> Converting dictionaries to NumPy arrays'
train_arr = numpy.array( [... | apache-2.0 |
victos/busuu_anki | anki/hooks.py | 1 | 1826 | # -*- coding: utf-8 -*-
# Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
"""\
Hooks - hook management and tools for extending Anki
==============================================================================
To find available hooks, grep for r... | agpl-3.0 |
H1ghT0p/kitsune | kitsune/forums/tests/test_templates.py | 10 | 15788 | from django.contrib.contenttypes.models import ContentType
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.access.tests import permission
from kitsune.forums.models import Post
from kitsune.forums.tests import (
ForumTestCase, forum, thread, post as forum_post)
from kitsune.sumo.tests im... | bsd-3-clause |
AuyaJackie/odoo | addons/share/wizard/share_wizard.py | 182 | 51223 | # -*- 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 |
isyippee/nova | nova/console/websocketproxy.py | 27 | 7221 | # Copyright (c) 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 ... | apache-2.0 |
Lcaracol/ideasbox.lan | ideasbox/conf/base.py | 1 | 5307 | # -*- coding: utf-8 -*-
"""Django settings for ideasbox project.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import os
import subprocess
from django.utils.tra... | mit |
kalail/gutter | gutter/client/arguments/base.py | 3 | 1633 | from types import NoneType
class classproperty(object):
def __init__(self, getter):
self.getter = getter
def __get__(self, instance, owner):
return self.getter(owner)
class argument(object):
def __init__(self, variable, getter):
if issubclass(type(getter), basestring):
... | apache-2.0 |
cea-sec/miasm | test/arch/arm/arch.py | 2 | 18653 | from __future__ import print_function
import time
from miasm.core.utils import decode_hex, encode_hex
from miasm.arch.arm.arch import *
from miasm.core.locationdb import LocationDB
from pdb import pm
loc_db = LocationDB()
def h2i(s):
return decode_hex(s.replace(' ', ''))
def u16swap(i):
return struct.unpa... | gpl-2.0 |
stackforge/doc8 | doc8/utils.py | 3 | 2564 | # Copyright (C) 2014 Ivan Melnikov <iv at altlinux dot org>
#
# Author: Joshua Harlow <harlowja@yahoo-inc.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/l... | apache-2.0 |
cyril51/Sick-Beard | lib/imdb/parser/http/__init__.py | 50 | 37110 | """
parser.http package (imdb package).
This package provides the IMDbHTTPAccessSystem class used to access
IMDb's data through the web interface.
the imdb.IMDb function will return an instance of this class when
called with the 'accessSystem' argument set to "http" or "web"
or "html" (this is the default).
Copyright... | gpl-3.0 |
atsuyim/ZeroNet | src/Debug/DebugMedia.py | 4 | 4597 | import os
import subprocess
import re
import logging
import time
from Config import config
# Find files with extension in path
def findfiles(path, find_ext):
for root, dirs, files in os.walk(path, topdown=False):
for file in sorted(files):
file_path = root + "/" + file
file_ext = ... | gpl-2.0 |
muntasirsyed/intellij-community | python/helpers/pycharm/buildout_engulfer.py | 85 | 1225 | # Expects two env variables:
# PYCHARM_ENGULF_SCRIPT = which script should be engulfed.
# PYCHARM_PREPEND_SYSPATH = which entries should be added to the beginning of sys.path;
# items must be separated by path separator. May be unset.
#
# Given script is loaded and compiled, then sys.path is prepended as requested.... | apache-2.0 |
amontefusco/gnuradio-amontefusco | gnuradio-core/src/python/gnuradio/gr/qa_pn_correlator_cc.py | 6 | 1564 | #!/usr/bin/env python
#
# Copyright 2007 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)
... | gpl-3.0 |
marshall007/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/scripts/common.py | 1180 | 2919 | # Copyright 2013 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 foll... | agpl-3.0 |
piffey/ansible | lib/ansible/modules/network/cumulus/_cl_bridge.py | 33 | 5340 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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_versio... | gpl-3.0 |
NMGRL/pychron | pychron/hardware/lakeshore/model336.py | 2 | 2461 | # ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... | apache-2.0 |
jarshwah/django | tests/template_tests/filter_tests/test_striptags.py | 197 | 1632 | from django.template.defaultfilters import striptags
from django.test import SimpleTestCase
from django.utils.functional import lazystr
from django.utils.safestring import mark_safe
from ..utils import setup
class StriptagsTests(SimpleTestCase):
@setup({'striptags01': '{{ a|striptags }} {{ b|striptags }}'})
... | bsd-3-clause |
sentinelleader/limbo | test/test_plugins/test_image.py | 11 | 2335 | # -*- coding: UTF-8 -*-
import os
import sys
from nose.tools import eq_
import vcr
DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(DIR, '../../limbo/plugins'))
from image import on_message
# The set of valid images given the bananas fixture
bananas_images = [u'http://foodmatters.tv... | mit |
glewarne/S6-UniKernel | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.4/django/contrib/auth/tests/management.py | 83 | 2529 | from StringIO import StringIO
from django.contrib.auth import models, management
from django.contrib.auth.management.commands import changepassword
from django.test import TestCase
class GetDefaultUsernameTestCase(TestCase):
def setUp(self):
self._getpass_getuser = management.get_system_username
de... | bsd-3-clause |
dboonz/polymode | other/Nurbs/Crv.py | 5 | 10275 | import math
from _Bas import bspkntins, bspdegelev, bspbezdecom, bspeval # Lowlevel Nurbs functions
from Util import scale, translate, rotz
dependencies = '''This module requires:
Numeric Python
'''
try:
import numpy.oldnumeric as numerix
except ImportError, value:
print dependencies
raise
NURB... | gpl-3.0 |
dbarbier/ot-svn | lib/src/libOT-gdb.py | 3 | 3111 |
import gdb
import re
import sys
if sys.version > '3':
long = int
objfile = gdb.current_objfile() or gdb.objfiles()[0]
int_ptr = gdb.lookup_type('int').pointer()
ot_pretty_printers = []
def AddToPrettyPrinter(rx):
def class_wrapper(cls):
ot_pretty_printers.append( (re.compile(rx), cls) )
ret... | gpl-3.0 |
jiangwei1221/django-virtualenv-demo | env/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/egg_info.py | 66 | 15621 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
# This module should be kept compatible with Python 2.3
import os, re, sys
from setuptools import Command
from distutils.errors import *
from distutils import log
from setuptools.command.sdist import sdist
from distutils.util i... | unlicense |
Johnzero/OE7 | openerp/addons-modules/edi/models/edi.py | 7 | 32142 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/internet/pollreactor.py | 47 | 6019 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A poll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import pollreactor
pollreactor.install()
"""... | agpl-3.0 |
jrief/django-filer | filer/templatetags/filer_image_tags.py | 24 | 3120 | #-*- coding: utf-8 -*-
from django.template import Library
from django.utils import six
import re
register = Library()
RE_SIZE = re.compile(r'(\d+)x(\d+)$')
def _recalculate_size(size, index, divisor=0, padding=0,
keep_aspect_ratio=False):
new_one = size[index]
if divisor:
new_... | bsd-3-clause |
Qalthos/ansible | test/units/modules/storage/netapp/test_na_ontap_user.py | 16 | 11027 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests ONTAP Ansible module: na_ontap_user '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch
from ansibl... | gpl-3.0 |
windyuuy/opera | chromium/src/tools/gdb/gdb_chrome.py | 30 | 10090 | # Copyright (c) 2011 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.
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(0, "/path/to/tools... | bsd-3-clause |
woltage/ansible | v1/ansible/utils/plugins.py | 108 | 9866 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 |
nakagami/reportlab | src/reportlab/pdfbase/pdfpattern.py | 14 | 2452 | __doc__="""helper for importing pdf structures into a ReportLab generated document
"""
from reportlab.pdfbase.pdfdoc import format
import string
class PDFPattern:
__PDFObject__ = True
__RefOnly__ = 1
def __init__(self, pattern_sequence, **keywordargs):
"""
Description of a kind of PDF obje... | bsd-3-clause |
kuangtu/OpenMAMA | mama/jni/src/regression/scripts/regressionjava.py | 16 | 7251 | #!/usr/bin/python
import subprocess
import unittest
from common import (start_app, start_javaapp, call_wait4text, call_wait4text, check_env, kill_process,
call_comparelog, my_print )
class TestOpenmamajava(unittest.TestCase):
def setUp(self):
pass
def test_pubsubjava(self):
'''publish me... | lgpl-2.1 |
pombredanne/https-git.fedorahosted.org-git-kobo | examples/state/settings.py | 1 | 2823 | # Django settings for foo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'db' # Or path to database file... | lgpl-2.1 |
kevinkindom/chrome_depto_tools | bootstrap/virtualenv/virtualenv_embedded/distutils-init.py | 1211 | 3983 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... | bsd-3-clause |
h2oai/h2o-dev | h2o-py/tests/testdir_apis/Data_Manipulation/pyunit_h2oH2OFrame_mult.py | 2 | 1178 | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
import numpy as np
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
import random
def h2o_H2OFrame_mult():
"""
Python API test: h2o.frame.H2OFrame.mult(matrix)... | apache-2.0 |
UOMx/edx-platform | cms/djangoapps/contentstore/context_processors.py | 37 | 3491 |
import ConfigParser
from django.conf import settings
import logging
log = logging.getLogger(__name__)
# Open and parse the configuration file when the module is initialized
config_file = open(settings.REPO_ROOT / "docs" / "config.ini")
config = ConfigParser.ConfigParser()
config.readfp(config_file)
def doc_url(r... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.