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 |
|---|---|---|---|---|---|
CNS-OIST/STEPS_Example | publication_models/API_1/Anwar_J Neurosci_2013/extra/constants_hh.py | 1 | 2809 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Okinawa Institute of Science and Technology, Japan.
#
# This script runs on STEPS 2.x http://steps.sourceforge.net
#
# H Anwar, I Hepburn, H Nedelescu, W Chen and E De Schutter
# Stochastic calcium mechanisms cause dendritic calcium spike... | gpl-2.0 |
davidhax0r/Rocket | flask/lib/python2.7/site-packages/yaml/constructor.py | 391 | 25145 |
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {}
yaml_multi_constructors =... | mit |
krikru/tensorflow-opencl | tensorflow/python/kernel_tests/stack_ops_test.py | 64 | 5580 | # 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 |
LuckDragon82/demo | boilerplate/lib/basehandler.py | 8 | 12971 | # *-* coding: UTF-8 *-*
# standard library imports
import logging
import re
import traceback
import sys
# related third party imports
import webapp2
from google.appengine.api.users import NotAllowedError
from webapp2_extras import jinja2
from webapp2_extras import auth
from webapp2_extras import sessions
from google.a... | lgpl-3.0 |
sergiopasra/numina | numina/modeling/gaussbox.py | 3 | 1678 | #
# Copyright 2014-2017 Universidad Complutense de Madrid
#
# This file is part of Numina
#
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSE.txt
#
from __future__ import division
from scipy.stats import norm
import numpy as np
from astropy.modeling import Fittable1DModel, Parameter
import math
M_SQRT_... | gpl-3.0 |
mrquim/mrquimrepo | plugin.video.salts/js2py/legecy_translators/translator.py | 96 | 5676 | from flow import translate_flow
from constants import remove_constants, recover_constants
from objects import remove_objects, remove_arrays, translate_object, translate_array, set_func_translator
from functions import remove_functions, reset_inline_count
from jsparser import inject_before_lval, indent, dbg
TOP_GLOBAL ... | gpl-2.0 |
egaxegax/django-dbcartajs | django/contrib/contenttypes/models.py | 100 | 6942 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_text, force_text
from django.utils.encoding import python_2_unicode_compatible
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the plac... | gpl-2.0 |
ContinuumIO/ashiba | enaml/enaml/widgets/datetime_selector.py | 1 | 2100 | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | bsd-3-clause |
berrange/nova | nova/scheduler/filters/aggregate_image_properties_isolation.py | 20 | 2686 | # Copyright (c) 2013 Cloudwatt
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
BitCurator/bitcurator | externals/py3fpdf/attic/font/helveticai.py | 26 | 2589 | fpdf_charwidths['helveticaI']={
'\x00':278,'\x01':278,'\x02':278,'\x03':278,'\x04':278,'\x05':278,'\x06':278,'\x07':278,'\x08':278,'\t':278,'\n':278,'\x0b':278,'\x0c':278,'\r':278,'\x0e':278,'\x0f':278,'\x10':278,'\x11':278,'\x12':278,'\x13':278,'\x14':278,'\x15':278,
'\x16':278,'\x17':278,'\x18':278,'\x19':278,'\x1a... | gpl-3.0 |
mclois/iteexe | twisted/python/reflect.py | 16 | 22222 | # -*- test-case-name: twisted.test.test_reflect -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Standardized versions of various cool and/or strange things that you can do
with Python's reflection capabilities.
"""
from __future__ import nested_scopes
# System Imports
imp... | gpl-2.0 |
CuteLemon/Learn | NewsAPI_Scraper/db_operation.py | 1 | 1050 | import pymongo as Mongo
DB_NAME = 'localhost'
DB_PORT = 27017
TEST_JSON = {'url':'http://hello.com','content':'Lemon Tree'}
class DB():
def __init__(self,db,port):
self.client = Mongo.MongoClient(db,port)
self.db = self.client.test
self.collect = self.db.test_collect
def insert(sel... | gpl-3.0 |
40223117cda/2015_w11 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/sprite.py | 603 | 55779 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... | gpl-3.0 |
r39132/airflow | airflow/contrib/kubernetes/volume.py | 4 | 1343 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
surgebiswas/poker | PokerBots_2017/Johnny/setuptools/command/alias.py | 130 | 2408 | from distutils.errors import DistutilsOptionError
from six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
return repr(arg)... | mit |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/HardContact_NonLinHardSoftShear/Normal_Load/Sigma_n_1/compare_HDF5_ALL.py | 424 | 3382 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
bbondy/brianbondy.gae | libs/werkzeug/testsuite/contrib/cache.py | 1 | 5814 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.cache
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil
from werkzeug.testsuite import Werkzeug... | mit |
js0701/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/linux_based_platform_backend_unittest.py | 9 | 4228 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import unittest
from telemetry.core import util
from telemetry.internal.platform import linux_based_platform_backend
import mock
... | bsd-3-clause |
Dino0631/RedRain-Bot | cogs/lib/youtube_dl/extractor/shared.py | 41 | 2869 | from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
urlencode_postdata,
)
class SharedBaseIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
webpage, urlh = self._down... | gpl-3.0 |
jimgong92/allezViens | connect.py | 1 | 8842 | from models import *
from run import db
import sys
import math
import hashlib
import time
from communication import sendPickNotificationEmail
'''DATABASE INSERTION/UPDATE'''
#Adds driver to database
def addDriver(id, alias, oLat, oLon, dLat, dLon, date):
url = makeURL(id)
driver = Driver(id, alias, oLat, oLon, dLa... | mit |
aldebaran/qibuild | python/qibuild/test/projects/usefoopymodule/test.py | 1 | 1167 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
"""
This is an equivalent of a C++ program trying to load a
Python module using libqi, but written in Python.
"""
from __fu... | bsd-3-clause |
pan1cz/locust | locust/test/test_locust_class.py | 4 | 19425 | import six
from locust import InterruptTaskSet, ResponseError
from locust.core import HttpLocust, Locust, TaskSet, events, task
from locust.exception import (CatchResponseError, LocustError, RescheduleTask,
RescheduleTaskImmediately)
from .testcases import LocustTestCase, WebserverTestCa... | mit |
neumerance/deploy | horizon/browsers/breadcrumb.py | 7 | 1850 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
highweb-project/highweb-webcl-html5spec | chrome/common/extensions/docs/server2/permissions_data_source.py | 37 | 3654 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from itertools import ifilter
from operator import itemgetter
from data_source import DataSource
from extensions_paths import PRIVATE_TEMPLATES
from future ... | bsd-3-clause |
anpingli/openshift-ansible | roles/lib_openshift/src/class/oc_pvc.py | 38 | 5477 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class OCPVC(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'pvc'
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
config,
verbose=Fal... | apache-2.0 |
MikeDacre/fyrd | fyrd/job.py | 1 | 56470 | # -*- coding: utf-8 -*-
"""
Class and methods to handle Job submission.
This module only defines a single object: the Job class.
"""
import os as _os
import sys as _sys
from uuid import uuid4 as _uuid
from time import sleep as _sleep
from datetime import datetime as _dt
from traceback import print_tb as _tb
# Try to... | mit |
cloudviz/agentless-system-crawler | crawler/plugins/applications/apache/apache_container_crawler.py | 3 | 1888 | from utils.namespace import run_as_another_namespace
import logging
import json
import utils.misc
import dockercontainer
from icrawl_plugin import IContainerCrawler
from plugins.applications.apache import apache_crawler
from requests.exceptions import ConnectionError
logger = logging.getLogger('crawlutils')
class Ap... | apache-2.0 |
alx-eu/django | django/conf/locale/sk/formats.py | 108 | 1114 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i:s'
DAT... | bsd-3-clause |
malept/youtube-dl | youtube_dl/extractor/drbonanza.py | 27 | 5082 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
)
class DRBonanzaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dr\.dk/bonanza/(?:[^/]+/)+(?:[^/])+?(?:assetId=(?P<id>\d+))?(?:[#&]|$)'
_TESTS = [{... | unlicense |
elisamussumeci/InfoDenguePredict | infodenguepredict/models/VAR2.py | 2 | 1286 | """
Vector Autogregression using statsmodels
http://statsmodels.sourceforge.net/devel/vector_ar.html
"""
import numpy as np
import pandas as pd
from statsmodels.tsa.api import *
from statsmodels.tsa.vector_ar.var_model import VAR
from datetime import datetime
import matplotlib.pyplot as plt
from infodenguepredict.data... | gpl-3.0 |
apixandru/intellij-community | python/lib/Lib/pwd.py | 93 | 2552 | """
This module provides access to the Unix password database.
Password database entries are reported as 7-tuples containing the
following items from the password database (see `<pwd.h>'), in order:
pw_name, pw_passwd, pw_uid, pw_gid, pw_gecos, pw_dir, pw_shell. The
uid and gid items are integers, all others are stri... | apache-2.0 |
Christewart/bitcoin | test/functional/wallet_import_rescan.py | 5 | 8943 | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
impor... | mit |
akaariai/django | tests/get_or_create/tests.py | 44 | 13321 | from __future__ import unicode_literals
import traceback
from datetime import date
from django.db import DatabaseError, IntegrityError
from django.test import TestCase, TransactionTestCase, ignore_warnings
from django.utils.encoding import DjangoUnicodeDecodeError
from .models import (
Author, Book, DefaultPerso... | bsd-3-clause |
drufat/vispy | examples/basics/gloo/animate_images.py | 18 | 2964 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 2
"""
Example demonstrating showing a, image with a fixed ratio.
"""
import numpy as np
from vispy.util.transforms import ortho
from vispy import gloo
from vispy import app
# Image to be displayed
W, H = 64, 48
I = np.random.uniform(0, 1, (W, H)).astype... | bsd-3-clause |
sigma-random/scrapy | tests/test_selector.py | 14 | 24817 | import re
import warnings
import weakref
from twisted.trial import unittest
from scrapy.exceptions import ScrapyDeprecationWarning
from scrapy.http import TextResponse, HtmlResponse, XmlResponse
from scrapy.selector import Selector
from scrapy.selector.lxmlsel import XmlXPathSelector, HtmlXPathSelector, XPathSelector
... | bsd-3-clause |
chrrrles/ansible-modules-extras | monitoring/uptimerobot.py | 58 | 4159 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
mnahm5/django-estore | Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py | 322 | 4684 | from __future__ import absolute_import, division, unicode_literals
try:
from collections import OrderedDict
except ImportError:
try:
from ordereddict import OrderedDict
except ImportError:
OrderedDict = dict
import re
from pip._vendor.six import string_types
from . import base
from .._ut... | mit |
hagabbar/pycbc_copy | pycbc/io/hdf.py | 1 | 31952 | # convenience classes for accessing hdf5 trigger files
# the 'get_column()' method is implemented parallel to
# the existing pylal.SnglInspiralUtils functions
import h5py
import numpy as np
import logging
import inspect
from lal import LIGOTimeGPS, YRJUL_SI
from pycbc_glue.ligolw import ligolw
from pycbc_glue.ligol... | gpl-3.0 |
shuggiefisher/crowdstock | django/contrib/gis/geos/prototypes/__init__.py | 244 | 1319 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
# Coordinate sequence routines.
from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \
cs_clone, cs_getordinate, cs_setordinate, c... | bsd-3-clause |
jordiclariana/ansible | lib/ansible/modules/cloud/cloudstack/cs_domain.py | 48 | 7691 | #!/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 |
kritzware/PyBot | modules/modules/uptime.py | 2 | 1178 | import logging, coloredlogs
from datetime import datetime, timedelta, date, time
from pytz import timezone
from modules.config import *
from modules.api import API
streamOnlineCheck = API(1)
class Uptime:
CommandMain = 'uptime'
CommandMainOptions = []
CommandResponses = []
def __init__(self):
self.channel = ... | mit |
benthomasson/ansible | lib/ansible/modules/cloud/openstack/os_keystone_domain.py | 29 | 5736 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
RyanHope/AutobahnPython | examples/asyncio/websocket/echo/client_coroutines.py | 9 | 2587 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
Trust-Code/odoo-brazil-hr | l10n_br_hr_payroll/model/hr_contract.py | 2 | 6637 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Brazillian Human Resources Payroll module for OpenERP
# Copyright (C) 2014 KMEE (http://www.kmee.com.br)
# @author Matheus Felix <matheus.felix@kmee.com.br>
# Rafael da Silva Lima <rafael.lim... | agpl-3.0 |
mrquim/repository.mrquim | repo/script.module.liveresolver/lib/liveresolver/resolvers/vaughnlive.py | 10 | 1761 | # -*- coding: utf-8 -*-
import re,urlparse
from liveresolver.modules import client,constants
from liveresolver.modules.log_utils import log
def resolve(url):
try:
try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
except: referer = url
channel = urlparse.urlpa... | gpl-2.0 |
Jorge-Rodriguez/ansible | lib/ansible/plugins/lookup/vars.py | 55 | 3004 | # (c) 2017 Ansible Project
# 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
DOCUMENTATION = """
lookup: vars
author: Ansible Core
version_added: "2.5"
short_description: L... | gpl-3.0 |
yoer/hue | desktop/core/ext-py/Django-1.6.10/tests/runtests.py | 49 | 13187 | #!/usr/bin/env python
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
from django import contrib
from django.utils._os import upath
from django.utils import six
CONTRIB_MODULE_PATH = 'django.contrib'
TEST_TEMPLATE_DIR = 'templates'
RUNTESTS_DIR = os.path.abspath(o... | apache-2.0 |
zbyte64/django-dockitcms | dockitcms/widgetblock/fields.py | 1 | 1521 | from django import forms
from dockit import schema
from dockitcms.fields import BaseFieldEntry, ListFieldMixin
from dockitcms.widgetblock.models import Widget
class WidgetField(BaseFieldEntry):
field_class = schema.SchemaField
def get_field_kwargs(self):
kwargs = dict(super(WidgetField, self).... | bsd-3-clause |
mhuwiler/rootauto | main/python/rooteventselector.py | 11 | 3418 | #!/usr/bin/env @python@
# ROOT command line tools: rooteventselector
# Author: Julien Ripoche
# Mail: julien.ripoche@u-psud.fr
# Date: 20/08/15
# Additions
# Author: Lawrence Lee
# Mail: lawrence.lee.jr@cern.ch
# Date: 1/4/16
"""Command line to copy subsets of trees from source ROOT files to new trees on a destinati... | lgpl-2.1 |
vanloswang/linux | scripts/gdb/linux/symbols.py | 588 | 6302 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
import os
import re
from linux import module... | gpl-2.0 |
mhrivnak/pulp | client_lib/pulp/client/launcher.py | 1 | 8499 | """
Entry point for both the admin and consumer clients. The config file location
is passed in and its contents are used to drive the rest of the client execution.
"""
import errno
from gettext import gettext as _
import logging
import logging.handlers
from optparse import OptionParser
import os
import stat
import sys... | gpl-2.0 |
duanwujie/depot_tools | breakpad.py | 47 | 3941 | # 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.
"""Breakpad for Python.
Sends a notification when a process stops on an exception.
It is only enabled when all these conditions are met:
1. hostname ... | bsd-3-clause |
fernandog/Sick-Beard | lib/hachoir_parser/archive/rar.py | 90 | 13384 | """
RAR parser
Status: can only read higher-level attructures
Author: Christophe Gisquet
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (StaticFieldSet, FieldSet,
Bit, Bits, Enum,
UInt8, UInt16, UInt32, UInt64,
String, TimeDateMSDOS32,
NullBytes, NullBits, RawBytes)
from ... | gpl-3.0 |
sarthfrey/Texty | lib/werkzeug/wsgi.py | 80 | 37881 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import posixpath
import mimetypes
from itertools import... | apache-2.0 |
BackupTheBerlios/espressopp | examples/hadress/hadressFEC/hadressDensityFEC.py | 1 | 8414 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# relevant imports
import sys
import time
import espresso
import mpi4py.MPI as MPI
import Tetracryst # Preparation of tetrahedral crystal and constuctions of bonds in tetrahedral liquid
from espresso import Real3D, Int3D
from espresso.tools import decomp
from espresso.to... | gpl-3.0 |
Rudd-O/cloud-tool | cloudapis/cloud.py | 1 | 2976 | '''Implements the Cloud.com API'''
from cloudtool.utils import describe
import urllib
import urllib2
import os
import xml.dom.minidom
class CloudAPI:
@describe("server", "Management Server host name or address")
@describe("responseformat", "Response format: xml or json")
def __init__(self,
server="127.0.0... | gpl-3.0 |
99cloud/keystone_register | openstack_dashboard/api/nova.py | 1 | 18812 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Openstack, LLC
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eB... | apache-2.0 |
sanjeevtripurari/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/staticfiles/storage.py | 90 | 12464 | from __future__ import unicode_literals
import hashlib
import os
import posixpath
import re
from django.conf import settings
from django.core.cache import (get_cache, InvalidCacheBackendError,
cache as default_cache)
from django.core.exceptions import ImproperlyConfigured
from django.cor... | apache-2.0 |
dulems/hue | desktop/core/ext-py/guppy-0.1.10/guppy/etc/xterm.py | 37 | 2082 | #._cv_part xterm
# Run an xterm on current process or a forked process
# Adapted from pty.py in Python 1.5.2 distribution.
# The pty.fork() couldnt be used because it didn't return
# the pty name needed by xterm
# I couldnt import pty.py to use master_open because it didn't find termios.
import os, sys, FCNTL
# We... | apache-2.0 |
dagwieers/ansible | lib/ansible/modules/cloud/azure/azure_rm_postgresqlconfiguration.py | 14 | 8073 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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 |
rohitwaghchaure/vestasi-frappe | frappe/core/doctype/custom_field/custom_field.py | 21 | 3197 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
from frappe import _
from frappe.model.document import Document
class CustomField(Document):
def autoname(self):
self.set_field... | mit |
sandan/sqlalchemy | examples/large_collection/large_collection.py | 32 | 3291 |
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
create_engine)
from sqlalchemy.orm import (mapper, relationship, sessionmaker)
meta = MetaData()
org_table = Table('organizations', meta,
Column('org_id', Integer, primary_key=True),
Column('org_name', Stri... | mit |
VcamX/grpc | src/python/grpcio/tests/unit/framework/common/test_control.py | 1 | 3314 | # Copyright 2015-2016, 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 ... | bsd-3-clause |
fengmk2/node-gyp | gyp/pylib/gyp/generator/gypd.py | 912 | 3325 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | mit |
evansd/django | tests/proxy_models/tests.py | 44 | 15782 | from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, management
from django.db import DEFAULT_DB_ALIAS, models
from django.db.models import signals
from django.test import TestCase, override_se... | bsd-3-clause |
iansf/sky_engine | sky/tools/webkitpy/layout_tests/port/mock_drt.py | 10 | 11787 | # Copyright (c) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
pechatny/basic-flask-app | src/app/flask/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py | 167 | 6810 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll
if windll is not None:
winterm = WinTerm()
def is_a_tty(stream):
re... | mit |
juanyaw/PTVS | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp1255.py | 93 | 13029 | """ Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... | apache-2.0 |
hanselke/erpnext-1 | erpnext/stock/doctype/delivery_note/delivery_note.py | 11 | 12802 | # 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.utils import flt, cint
from frappe import msgprint, _
import frappe.defaults
from frappe.model.mapper import get_mapped_doc
... | agpl-3.0 |
hychen/boliau | boliau/plugins/lp_cli/actionlib.py | 1 | 6379 | #!/usr/bin/env python
# -*- coding: utf-8 -*
#
# File: lp_cli.py
#
# Copyright (C) 2012 Hsin-Yi Chen (hychen)
# Author(s): Hsin-Yi Chen (hychen) <ossug.hychen@gmail.com>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software... | mit |
sudheesh001/oh-mainline | vendor/packages/Django/django/contrib/formtools/wizard/legacy.py | 115 | 11275 | """
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
from django.forms import HiddenInput
from django.http import Http404
from django.shortcuts import render_to_response
from django.templa... | agpl-3.0 |
Curious72/sympy | sympy/ntheory/tests/test_bbp_pi.py | 45 | 9425 | from random import randint
from sympy.ntheory.bbp_pi import pi_hex_digits
from sympy.utilities.pytest import raises
# http://www.herongyang.com/Cryptography/Blowfish-First-8366-Hex-Digits-of-PI.html
# There are actually 8336 listed there; with the preppended 3 there are 8337
# below
dig=''.join('''
3243f6a8885a308d3... | bsd-3-clause |
hustcc/iOS-private-api-checker | utils/lib/xlsxwriter/styles.py | 13 | 20948 | ###############################################################################
#
# Styles - A class for writing the Excel XLSX Worksheet file.
#
# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org
#
# Package imports.
from . import xmlwriter
class Styles(xmlwriter.XMLwriter):
"""
A class for writing th... | gpl-2.0 |
abhattad4/Digi-Menu | digimenu2/django/core/management/commands/sqlmigrate.py | 463 | 2715 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.loader import AmbiguityError
class Command(BaseCo... | bsd-3-clause |
Glottotopia/aagd | moin/local/moin/MoinMoin/support/pygments/styles/manni.py | 3 | 2449 | # -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2010 by th... | mit |
ericlink/adms-server | playframework-dist/play-1.1/python/Lib/csv.py | 2 | 15523 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE,... | mit |
muffinresearch/olympia | apps/api/views.py | 13 | 18404 | """
API views
"""
import hashlib
import itertools
import json
import random
import urllib
from datetime import date, timedelta
from django.core.cache import cache
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import render
from django.template.context import get_standard_pro... | bsd-3-clause |
XiaosongWei/chromium-crosswalk | native_client_sdk/src/build_tools/sdk_tools/command/list.py | 152 | 1736 | # 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.
def List(remote_manifest, local_manifest, display_revisions):
any_bundles_need_update = False
print 'Bundles:'
print ' I: installed\n *: update ava... | bsd-3-clause |
JimCircadian/ansible | lib/ansible/modules/network/system/net_banner.py | 40 | 2076 | #!/usr/bin/python
# Copyright: Ansible Project
# 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',
'status': ['preview'],
... | gpl-3.0 |
naslanidis/ansible | lib/ansible/utils/module_docs_fragments/cloudengine.py | 28 | 2959 | #
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope t... | gpl-3.0 |
naokimiyasaka/sublime-text | Backup/20140106101521/ConvertToUTF8/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/rest_framework/filters.py | 6 | 13069 | """
Provides generic filtering backends that can be used to filter the results
returned by list views.
"""
from __future__ import unicode_literals
import operator
import warnings
from functools import reduce
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.con... | gpl-3.0 |
Glasgow2015/team-10 | env/lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/test_forms.py | 65 | 8956 | from __future__ import unicode_literals
from importlib import import_module
from django import forms, http
from django.conf import settings
from django.db import models
from django.test import TestCase
from django.template.response import TemplateResponse
from django.contrib.auth.models import User
from django.cont... | apache-2.0 |
JT5D/scikit-learn | examples/plot_multilabel.py | 9 | 4299 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
Spiderlover/Toontown | toontown/safezone/GolfKart.py | 4 | 7887 | from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.fsm import StateData
from toontown.toontown... | mit |
atiro/nikola | nikola/plugins/compile/ipynb.py | 1 | 6893 | # -*- coding: utf-8 -*-
# Copyright © 2013-2016 Damián Avila, Chris Warrick and others.
# 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
#... | mit |
rbarlow/pulp | server/pulp/server/webservices/views/plugins.py | 14 | 5901 | from django.views.generic import View
from pulp.server.auth import authorization
from pulp.server.exceptions import MissingResource
from pulp.server.managers import factory
from pulp.server.webservices.views.decorators import auth_required
from pulp.server.webservices.views.util import (generate_json_response,
... | gpl-2.0 |
joaquimrocha/Rancho | rancho/south/management/commands/startmigration.py | 2 | 43745 | """
Startmigration command, version 2.
"""
import sys
import os
import re
import string
import random
import inspect
import parser
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import models
from django.db.models.f... | agpl-3.0 |
rangertaha/salt-manager | salt-manager/webapp/apps/management/commands/bshell.py | 1 | 3463 | #!/usr/bin/env python
"""
"""
import os
from optparse import make_option
from django.core.management.base import NoArgsCommand
def starting_imports():
from django.db.models.loading import get_models
for m in get_models():
exec "from %s import %s" % (m.__module__, m.__name__)
from datetime import ... | mit |
tersmitten/ansible | lib/ansible/modules/cloud/vmware/vmware_host_ntp.py | 26 | 15749 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
# 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_f... | gpl-3.0 |
apawar2/php-buildpack | tests/test_rewrite.py | 15 | 5017 | import os
import os.path
import tempfile
import shutil
import subprocess
import imp
from nose.tools import eq_
class BaseRewriteScript(object):
def __init__(self):
info = imp.find_module('runner', ['lib/build_pack_utils'])
self.run = imp.load_module('runner', *info)
def setUp(self):
s... | apache-2.0 |
NodesForAll/live | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
nall/pythonista-tradervue | utils.py | 1 | 5565 | # vim: ft=python tabstop=2 shiftwidth=2 expandtab
# Copyright (c) 2015, Jon Nall
# 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 copyrig... | bsd-3-clause |
taknevski/tensorflow-xsmm | tensorflow/python/framework/device.py | 150 | 9078 | # 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 |
smcoll/stormpath-django | django_stormpath/social.py | 1 | 7183 | from django.contrib.auth import login as django_login
from django.shortcuts import resolve_url
from django.core.urlresolvers import reverse
from django.conf import settings
from stormpath.error import Error as StormpathError
from stormpath.resources.provider import Provider
from requests_oauthlib import OAuth2Session... | apache-2.0 |
naemono/pyrax | tests/unit/test_image.py | 12 | 20320 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
import unittest
from mock import patch
from mock import MagicMock as Mock
from collections import OrderedDict
import pyrax
from pyrax.manager import BaseManager
import pyrax.image
from pyrax.image import assure_image
from pyrax.image import Image... | apache-2.0 |
pweatherbee/HashletCoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
zdravi/jrnl | features/steps/core.py | 9 | 6720 | from behave import *
from jrnl import cli, Journal, util
from dateutil import parser as date_parser
import os
import codecs
import json
import keyring
keyring.set_keyring(keyring.backends.file.PlaintextKeyring())
try:
from io import StringIO
except ImportError:
from cStringIO import StringIO
import tzlocal
def... | mit |
sanjuro/RCJK | vendor/atom/url.py | 280 | 4277 | #!/usr/bin/python
#
# Copyright (C) 2008 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 |
jesramirez/odoo | addons/im_chat/im_chat.py | 268 | 21928 | # -*- coding: utf-8 -*-
import base64
import datetime
import logging
import time
import uuid
import random
import simplejson
import openerp
from openerp.http import request
from openerp.osv import osv, fields
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.addons.bus.bus import TIMEOUT
_lo... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.