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 |
|---|---|---|---|---|---|
raisinbit/RaisinLearning | node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | gpl-3.0 |
dcifuen/cloudbday | src/lib/mandrill.py | 1 | 197868 | import requests, os.path, logging, sys, time
try:
import ujson as json
except ImportError:
try:
import simplejson as json
except ImportError:
import json
class Error(Exception):
pass
class ValidationError(Error):
pass
class InvalidKeyError(Error):
pass
class PaymentRequiredError... | mit |
jw2100/beginning.github.io | MachineLearning/MachineLearningInAction/machinelearninginaction/Ch06/EXTRAS/notLinSeperable.py | 7 | 2336 | '''
Created on Oct 6, 2010
@author: Peter
'''
from numpy import *
import matplotlib
import matplotlib.pyplot as plt
xcord0 = []; ycord0 = []; xcord1 = []; ycord1 = []
markers =[]
colors =[]
fr = open('testSet.txt')#this file was generated by 2normalGen.py
for line in fr.readlines():
lineSplit = line... | gpl-3.0 |
guschmue/tensorflow | tensorflow/python/training/momentum_test.py | 5 | 25295 | # 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 |
fizista/django-repchan | repchan/signals.py | 1 | 2712 | # -*- encoding: utf-8
import types
from django.dispatch import Signal
def signal_id(instance, signal_object):
'returns the signal id'
return (id(instance), id(signal_object))
def signal_send_on(instance, signal_object):
'Enable sending a signal'
instance._signal_disable.remove(signal_id(instance, s... | bsd-3-clause |
idf/dotfiles | ipython/ipython_config.py | 1 | 23145 | # Configuration file for ipython.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# InteractiveSh... | mit |
ehirt/odoo | addons/account/wizard/account_open_closed_fiscalyear.py | 237 | 2537 | # -*- 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 |
sparkslabs/kamaelia_ | Code/Python/Apps/Whiteboard/App/Whiteboard.py | 3 | 24747 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
julianprabhakar/eden_car | modules/s3db/delphi.py | 2 | 22626 | # -*- coding: utf-8 -*-
""" Sahana Eden Delphi Decision Maker Model
@copyright: 2009-2014 (c) Sahana Software Foundation
@license: MIT
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 ... | mit |
slp/qemu-riscos | scripts/tracetool/backend/ust.py | 74 | 2419 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LTTng User Space Tracing backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajno... | gpl-2.0 |
alx-eu/django | tests/regressiontests/syndication/tests.py | 47 | 13086 | from __future__ import absolute_import, unicode_literals
from xml.dom import minidom
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.utils import tzinfo
from django.utils.feedgenerator import rfc2822_date, rfc3339_date
... | bsd-3-clause |
ffu/DSA-3.2.2 | gnuradio-examples/python/audio/mono_tone.py | 17 | 2188 | #!/usr/bin/env python
#
# Copyright 2004,2005,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 you... | gpl-3.0 |
maestro-hybrid-cloud/horizon | openstack_dashboard/api/network.py | 64 | 5098 | # Copyright 2013 NEC 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 applicable law or ag... | apache-2.0 |
jmcq89/megaman | megaman/geometry/utils.py | 4 | 1773 | # LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
__all__ = ["RegisterSubclasses"]
# From six.py
def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""
# Use a dummy metaclass that replaces itself with the actual metaclass.
class metaclass(type):
... | bsd-2-clause |
Antelox/mhn | server/collector.py | 12 | 2676 | import sys
import datetime
import json
import hpfeeds
import logging
root = logging.getLogger()
root.setLevel(logging.ERROR)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
root.addHandler... | lgpl-2.1 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/core/document_renderers/html_renderer.py | 4 | 9136 | # Copyright 2015 Google Inc. All Rights Reserved.
"""Cloud SDK markdown document HTML renderer."""
import re
from googlecloudsdk.core.document_renderers import renderer
class HTMLRenderer(renderer.Renderer):
"""Renders markdown to HTML.
Attributes:
_BULLET: A list of bullet type names indexed by list leve... | apache-2.0 |
sskirch/basewatch | basewatch_alert_service.py | 1 | 6399 | #!/usr/bin/env python
import time
import math
import sys
from twilio.rest import Client
from ConfigParser import SafeConfigParser
import smtplib
from smtplib import SMTPException
from datetime import datetime, timedelta
import sensors
import triggers
conn = None
count = 0
msg_time = {}
SMS_from = None
SMS_to = None... | apache-2.0 |
ShiYw/Sigil | 3rdparty/python/Lib/ctypes/test/test_find.py | 67 | 2605 | import unittest
import os
import sys
import test.support
from ctypes import *
from ctypes.util import find_library
# On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode.
class Test_OpenGL_libs(unittest.TestCase):
@classmethod
def setUpClass(cls):
lib_gl = lib_glu = lib_gle = None
... | gpl-3.0 |
soarpenguin/ansible | lib/ansible/modules/cloud/vmware/vmware_dvs_portgroup.py | 8 | 6693 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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.0',... | gpl-3.0 |
ajinabraham/Mobile-Security-Framework-MobSF | StaticAnalyzer/views/ios/binary_analysis.py | 1 | 16548 | # -*- coding: utf_8 -*-
"""Module for iOS IPA Binary Analysis."""
import re
import os
import platform
import subprocess
from django.conf import settings
from django.utils.html import escape
from django.utils.encoding import smart_text
from StaticAnalyzer.tools.strings import strings_util
from MobSF.utils import Prin... | gpl-3.0 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/transit_accessibility/household_x_parcel/travel_time_hbw_transit_from_work_to_home.py | 2 | 5225 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from numpy import array, int32, arange
from urbansim.functions import attribute_label
from opus_core.logger import logger
try:
import n... | gpl-2.0 |
ESS-LLP/erpnext-healthcare | erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py | 10 | 1532 | from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc('desk', 'doctype', 'auto_repeat')
doctypes_to_rename = {
'accounts': ['Journal Entry', 'Payment Entry', 'Purchase Invoice', 'Sales Invoice'],
'buying': ['Purchase Orde... | gpl-3.0 |
manazhao/tf_recsys | tensorflow/contrib/metrics/python/metrics/classification_test.py | 125 | 4623 | # 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 |
Chilledheart/chromium | third_party/libxml/src/check-relaxng-test-suite2.py | 343 | 10578 | #!/usr/bin/python
import sys
import time
import os
import string
import StringIO
sys.path.insert(0, "python")
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
debug = 0
quiet = 1
#
# the testsuite description
#
CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml")
LOG="check-relaxng-... | bsd-3-clause |
kisna72/django | django/contrib/admin/templatetags/admin_urls.py | 553 | 1812 | from django import template
from django.contrib.admin.utils import quote
from django.core.urlresolvers import Resolver404, get_script_prefix, resolve
from django.utils.http import urlencode
from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse
register = template.Library()
@register.filter
... | bsd-3-clause |
gonboy/sl4a | python/src/Lib/ctypes/test/test_arrays.py | 51 | 4378 | import unittest
from ctypes import *
formats = "bBhHiIlLqQfd"
formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
c_long, c_ulonglong, c_float, c_double, c_longdouble
class ArrayTestCase(unittest.TestCase):
def test_simple(self):
# create classes holding simple numeric types, and che... | apache-2.0 |
sacdar/Stino | stino/pyarduino/base/serial_port.py | 14 | 5246 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# 1. Copyright
# 2. Lisence
# 3. Author
"""
Documents
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import glob
import time
from . import pyserial
from . import sy... | mit |
factorlibre/server-tools | __unported__/users_ldap_groups/users_ldap_groups_operators.py | 23 | 1939 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
sumihai-tekindo/helpdesk_sicepat | helpdesk_report/wizard/helpdesk_ticket_xlsx_rpt_wiz.py | 1 | 1612 | # -*- coding: utf-8 -*-
from datetime import datetime
from dateutil.relativedelta import relativedelta
import pytz
from openerp import models, fields, api
from openerp.tools.misc import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT as DTF
class HelpdeskExportTicket(mode... | gpl-3.0 |
saleemjaveds/https-github.com-openstack-nova | nova/tests/network/test_api.py | 2 | 27952 | # Copyright 2012 Red Hat, 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 by... | apache-2.0 |
andela-ifageyinbo/django | tests/datatypes/tests.py | 305 | 4210 | from __future__ import unicode_literals
import datetime
from django.test import TestCase, skipIfDBFeature
from django.utils import six
from django.utils.timezone import utc
from .models import Donut, RumBaba
class DataTypesTestCase(TestCase):
def test_boolean_type(self):
d = Donut(name='Apple Fritter'... | bsd-3-clause |
roderickvd/nzbToMedia | nzbToMylar.py | 1 | 2978 | #!/usr/bin/env python2
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Post-Process to Mylar.
#
# This script sends the download to your automated media management servers.
#
# NOTE: This script requires P... | gpl-3.0 |
dpmatthews/rose | sphinx/conf.py | 3 | 6444 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under t... | gpl-3.0 |
matthiasdiener/spack | lib/spack/spack/compilers/cce.py | 5 | 2294 | ##############################################################################
# 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 |
fernandezcuesta/ansible | lib/ansible/modules/cloud/rackspace/rax_mon_alarm.py | 8 | 7373 | #!/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.0',
'status': ['preview'],
... | gpl-3.0 |
lidavidm/sympy | sympy/polys/tests/test_fields.py | 7 | 8062 | """Test sparse rational functions. """
from sympy.polys.fields import field, FracField
from sympy.polys.rings import ring
from sympy.polys.domains import ZZ, QQ, RR
from sympy.polys.orderings import lex, grlex
from sympy.utilities.pytest import raises, XFAIL
from sympy.core import Symbol, symbols
from sympy import sq... | bsd-3-clause |
rlewis1988/lean | script/demangle_cpptype.py | 21 | 1366 | #!/usr/bin/env python
#
# Copyright (c) 2013 Microsoft Corporation. All rights reserved.
# Released under Apache 2.0 license as described in the file LICENSE.
#
# Author: Soonho Kong
#
# What's this?
# ============
# It takes an input from stdin and demangle c++ type if the line
# matches the following patten:
#
# ... | apache-2.0 |
ryfeus/lambda-packs | Selenium_PhantomJS/source/docutils/parsers/rst/languages/lt.py | 120 | 3584 | # -*- coding: utf-8 -*-
# $Id: lt.py 7668 2013-06-04 12:46:30Z milde $
# Author: Dalius Dobravolskas <dalius.do...@gmail.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>.... | mit |
guilhermedallanol/dotfiles | vim/plugged/vial/vial/plugins/bufhist/plugin.py | 2 | 3812 | from time import time
from itertools import groupby
from vial import vfunc, vim, dref
from vial.utils import echon, redraw
from os.path import split
MAX_HISTORY_SIZE = 100
VHIST = 'vial_buf_hist'
VLAST = 'vial_last_buf'
def add_to_history(w, bufnr):
history = list(w.vars[VHIST])
history[:] = [r for r in his... | mit |
stelfrich/openmicroscopy | components/tools/OmeroPy/examples/createSession.py | 18 | 1155 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ----------------------------------------------------------------------------
# Copyright (C) 2006-2008 University of Dundee. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public... | gpl-2.0 |
jesseditson/rethinkdb | external/gtest_1.6.0/test/gtest_break_on_failure_unittest.py | 1050 | 7214 | #!/usr/bin/env python
#
# Copyright 2006, 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... | agpl-3.0 |
xwolf12/django | django/contrib/gis/gdal/raster/source.py | 297 | 13274 | import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... | bsd-3-clause |
django-nonrel/django-nonrel | django/contrib/localflavor/nl/forms.py | 311 | 2796 | """
NL-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
pc_re = re.compile('^\d{4}[A-Z]{2}$... | bsd-3-clause |
nharraud/b2share | invenio/legacy/bibcheck/plugins/mandatory.py | 17 | 1097 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
iw3hxn/LibrERP | base_address_contacts_google/__init__.py | 3 | 1072 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 - TODAY DeneroTeam. (<http://www.deneroteam.com>)
# Copyright (C) 2011 - TODAY Didotech Inc. (<http://www.didotech.com>)
# All Rights Reserved
#
# This program is free software: ... | agpl-3.0 |
ARG-TLQ/Red-DiscordBot | redbot/__init__.py | 1 | 7522 | import asyncio as _asyncio
import os as _os
import re as _re
import sys as _sys
import warnings as _warnings
from math import inf as _inf
from typing import (
ClassVar as _ClassVar,
Dict as _Dict,
List as _List,
Optional as _Optional,
Pattern as _Pattern,
Tuple as _Tuple,
Union as _Union,
)
... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/test/test_plistlib.py | 79 | 7403 | # Copyright (C) 2003 Python Software Foundation
import unittest
import plistlib
import os
import datetime
from test import test_support
# This test data was generated through Cocoa's NSDictionary class
TESTDATA = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" \
"http:/... | mit |
MycroftAI/mycroft-core | mycroft/configuration/locations.py | 2 | 1367 | # Copyright 2018 Mycroft AI 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 writin... | apache-2.0 |
huang4fstudio/django | tests/template_tests/filter_tests/test_truncatewords_html.py | 386 | 1607 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import truncatewords_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>... | bsd-3-clause |
tadhg-ohiggins/regulations-parser | regparser/web/settings/base.py | 3 | 3882 | """
Django settings for regparser.web project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import... | cc0-1.0 |
zaqwes8811/concurrency-tricks | extern/gmock-1.6.0/gtest/test/gtest_output_test.py | 1733 | 12005 | #!/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... | apache-2.0 |
srickardti/openthread | tests/scripts/thread-cert/Cert_9_2_12_Announce.py | 1 | 4823 | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
nnugumanov/yandex-tank | yandextank/stepper/load_plan.py | 1 | 6562 | '''
Load Plan generators
'''
import re
from itertools import chain, groupby
from builtins import range
from . import info
from .util import parse_duration, solve_quadratic, proper_round
class Const(object):
'''
Load plan with constant load
'''
def __init__(self, rps, duration):
self.rps = flo... | lgpl-2.1 |
gklyne/annalist | src/annalist_root/annalist/tests/test_image_url.py | 1 | 8852 | from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
Tests image URL display field.
(Unlike test_render_ref_image, this tests rendering from saved data)
(Unlike test_upload_file, this tests rendering of a field with a direct URI value,
not a reference to an up... | mit |
maartenbreddels/vaex | tests/copy_test.py | 1 | 1485 | from common import *
import pytest
def test_copy(df):
df = df
df['v'] = df.x + 1
df.add_variable('myvar', 2)
dfc = df.copy()
assert 'x' in dfc.get_column_names()
assert 'v' in dfc.get_column_names()
assert 'v' in dfc.virtual_columns
assert 'myvar' in dfc.variables
dfc.x.values
de... | mit |
fanjunwei/depot_tools | third_party/gsutil/gslib/plurality_checkable_iterator.py | 51 | 1760 | # Copyright 2012 Google 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 by applicable law or a... | bsd-3-clause |
gugahoi/maraschino | lib/jinja2/compiler.py | 121 | 61899 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from cStringIO import StringIO
from itertools import chain
from copy import deepcopy
from jinja2 import nodes
from j... | mit |
drpngx/tensorflow | tensorflow/python/training/checkpoint_utils.py | 6 | 14223 | # 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 |
40223136/2015cdag1man | static/Brython3.1.1-20150328-091302/Lib/types.py | 756 | 3167 | """
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys
# Iterators in Python aren't a matter of type but of protocol. A large
# and changing number of builtin types implement *some* flavor of
# iterator. Don't check the type! Use hasattr to check for both
# "__iter__" and "... | gpl-3.0 |
poornimakshirsagar/sos | sos/plugins/ssh.py | 12 | 1157 | # Copyright (C) 2007 Red Hat, Inc., Eugene Teo <eteo@redhat.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# Thi... | gpl-2.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/ptpython/ipython.py | 5 | 10570 | """
Adaptor for using the input system of `prompt_toolkit` with the IPython
backend.
This gives a powerful interactive shell that has a nice user interface, but
also the power of for instance all the %-magic functions that IPython has to
offer.
"""
from __future__ import unicode_literals, print_function
from prompt... | gpl-3.0 |
jpetto/olympia | src/olympia/zadmin/urls.py | 1 | 3947 | from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.core.exceptions import PermissionDenied
from django.shortcuts import redirect
from olympia.addons.urls import ADDON_ID
from olympia.amo.urlresolvers import reverse
from . import views
urlpatterns = patterns(
'',
... | bsd-3-clause |
galaxy4public/android_kernel_samsung_n7102 | tools/perf/scripts/python/call-graph-from-postgresql.py | 758 | 11125 | #!/usr/bin/python2
# call-graph-from-postgresql.py: create call-graph from postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free So... | gpl-2.0 |
amyvmiwei/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/exceptions.py | 341 | 1877 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.""... | lgpl-3.0 |
feroda/gasistafelice | gasistafelice/gas_admin/models/__init__.py | 3 | 2011 |
from django.contrib.admin.sites import AdminSite
from django.contrib import admin
from gasistafelice.base import models as base_models
from gasistafelice.supplier import models as supplier_models
from gasistafelice.gas import models as gas_models
from simple_accounting import models as accounting_models
from gasista... | agpl-3.0 |
solring/GT-I9300_JB_Kernel_alarmAlign | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
Vagab0nd/SiCKRAGE | lib3/twilio/rest/api/v2010/account/call/recording.py | 1 | 21240 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | gpl-3.0 |
VielSoft/odoo | addons/website_gengo/controllers/main.py | 350 | 1799 | # -*- coding: utf-8 -*-
import openerp
from openerp import http, SUPERUSER_ID
from openerp.http import request
import time
GENGO_DEFAULT_LIMIT = 20
class website_gengo(http.Controller):
@http.route('/website/get_translated_length', type='json', auth='user', website=True)
def get_translated_length(self, tran... | agpl-3.0 |
dancingdan/tensorflow | tensorflow/contrib/recurrent/python/kernel_tests/functional_rnn_test.py | 25 | 11777 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
jroivas/moose-mating | draw_world.py | 1 | 1790 | import Image, ImageDraw
class DrawWorld(object):
def __init__(self, world, scale=1.0):
self.world = world
self.img = None
self.scale = scale
self.food_scale = scale * 0.5
self.mooses = []
self.flip_mooses = []
self.food = None
self.load_images()
... | gpl-3.0 |
pv/pydocweb | scripts/upgrade-schema.py | 1 | 5118 | #!/usr/bin/env python
"""
upgrade-schema.py
Upgrades Pydocweb database schema to the current version.
"""
from optparse import OptionParser
import os, glob, re, sys, subprocess
BASEDIR = os.path.abspath(os.path.dirname(__file__))
def main():
p = OptionParser(__doc__)
options, args = p.parse_args()
if l... | bsd-3-clause |
Pakoach/Sick-Beard-Animes | lib/hachoir_metadata/setter.py | 90 | 5215 | from datetime import date, datetime
import re
from lib.hachoir_core.language import Language
from locale import setlocale, LC_ALL
from time import strptime
from lib.hachoir_metadata.timezone import createTimezone
from lib.hachoir_metadata import config
NORMALIZE_REGEX = re.compile("[-/.: ]+")
YEAR_REGEX1 = re.compile(... | gpl-3.0 |
mpurzynski/MozDef | alerts/ssh_bruteforce_bro.py | 3 | 1378 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
from lib.alerttask import AlertTask
from mozdef_util.qu... | mpl-2.0 |
rosskarchner/django-govdelivery | django_govdelivery/migrations/0001_initial.py | 1 | 1844 | # -*- coding: 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 model 'SubscriptionAttempt'
db.create_table(u'django_govdelivery_subscriptionattempt', (
... | unlicense |
mshafiq9/django | tests/urlpatterns_reverse/middleware.py | 386 | 1050 | from django.core.urlresolvers import reverse
from django.http import HttpResponse, StreamingHttpResponse
from . import urlconf_inner
class ChangeURLconfMiddleware(object):
def process_request(self, request):
request.urlconf = urlconf_inner.__name__
class NullChangeURLconfMiddleware(object):
def pro... | bsd-3-clause |
rhinstaller/anaconda | pyanaconda/localization.py | 3 | 24012 | # Localization classes and functions
#
# Copyright (C) 2012-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program i... | gpl-2.0 |
simod/geonode | geonode/geoserver/management/commands/updatelayers.py | 5 | 6141 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
0Chencc/CTFCrackTools | Lib/site-packages/chardet/latin1prober.py | 290 | 5370 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/share/glib-2.0/gdb/gobject.py | 85 | 9374 | import gdb
import glib
import gdb.backtrace
import gdb.command.backtrace
# This is not quite right, as local vars may override symname
def read_global_var (symname):
return gdb.selected_frame().read_var(symname)
def g_type_to_name (gtype):
def lookup_fundamental_type (typenode):
if typenode == 0:
... | gpl-2.0 |
aaannndddyyy/Replicating-DeepMind | src/main.py | 6 | 13047 | """
This is the main class where all thing are put together
"""
from ai.NeuralNet import NeuralNet
from memory.memoryd import MemoryD
from ale.ale import ALE
import random
import numpy as np
import time
import sys
from os import linesep as NL
import unittest
class Main:
# How many transitions to keep in memory?... | gpl-3.0 |
slohse/ansible | lib/ansible/plugins/action/include_vars.py | 26 | 10975 | # (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
#
# 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 l... | gpl-3.0 |
hobarrera/django | django/contrib/postgres/utils.py | 76 | 1219 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.utils.functional import SimpleLazyObject
from django.utils.translation import string_concat
def prefix_validation_error(error, prefix, code, params):
"""
Prefix a validation error message while maintaining ... | bsd-3-clause |
raphapr/openstack-neat | neat/locals/overload/otf.py | 3 | 3624 | # Copyright 2012 Anton Beloglazov
#
# 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 |
waseem18/oh-mainline | vendor/packages/PyYaml/lib3/yaml/parser.py | 210 | 25495 |
# The following YAML grammar is LL(1) and is parsed by a recursive descent
# parser.
#
# stream ::= STREAM-START implicit_document? explicit_document* STREAM-END
# implicit_document ::= block_node DOCUMENT-END*
# explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END*
# block_node_or_inden... | agpl-3.0 |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_itertools.py | 5 | 32943 | import unittest
from test import test_support
from itertools import *
from weakref import proxy
import sys
import operator
import random
def onearg(x):
'Test function of one argument'
return 2*x
def errfunc(*args):
'Test function that raises an error'
raise ValueError
def gen3():
'Non-restartable... | gpl-2.0 |
walshjon/openmc | setup.py | 1 | 2138 | #!/usr/bin/env python
import glob
import sys
import numpy as np
from setuptools import setup, find_packages
try:
from Cython.Build import cythonize
have_cython = True
except ImportError:
have_cython = False
# Determine shared library suffix
if sys.platform == 'darwin':
suffix = 'dylib'
else:
suf... | mit |
franekp/ankidict | ankidict/thirdparty/sqlalchemy/dialects/mssql/zxjdbc.py | 55 | 2282 | # mssql/zxjdbc.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mssql+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
:c... | agpl-3.0 |
RO-ny9/python-for-android | python-modules/twisted/twisted/words/test/test_service.py | 53 | 31961 | # Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.words.service}.
"""
import time
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.cred import portal, credentials, checkers
from twisted.words import ewords, service
from twisted... | apache-2.0 |
jneight/django-db-geventpool | django_db_geventpool/backends/postgresql_psycopg2/psycopg2_pool.py | 1 | 3901 | # coding=utf-8
# this file is a modified version of the psycopg2 used at gevent examples
# to be compatible with django, also checks if
# DB connection is closed and reopen it:
# https://github.com/surfly/gevent/blob/master/examples/psycopg2_pool.py
import logging
import sys
import weakref
logger = logging.getLogger('... | apache-2.0 |
crosswalk-project/blink-crosswalk | Source/build/scripts/in_file_unittest.py | 78 | 3166 | #!/usr/bin/env python
# Copyright (C) 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 ... | bsd-3-clause |
brclark-usgs/flopy | flopy/plot/map.py | 1 | 30643 | import copy
import numpy as np
try:
import matplotlib.pyplot as plt
import matplotlib.colors
except:
plt = None
from . import plotutil
from .plotutil import bc_color_dict
from ..utils import SpatialReference
class ModelMap(object):
"""
Class to create a map of the model.
Paramet... | bsd-3-clause |
wangscript/rigs-of-rods | tools/recursive_zipper.py | 5 | 2317 | #!/usr/bin/python
# This source file is part of Rigs of Rods
# Copyright 2015 Artem Vorotnikov
# For more information, see https://rigsofrods.github.io/
# Rigs of Rods is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free S... | gpl-3.0 |
github-account-because-they-want-it/django-extensions | django_extensions/management/commands/notes.py | 27 | 2360 | from __future__ import with_statement
import os
import re
from django.conf import settings
from django.core.management.base import BaseCommand
from django_extensions.management.utils import signalcommand
ANNOTATION_RE = re.compile("\{?#[\s]*?(TODO|FIXME|BUG|HACK|WARNING|NOTE|XXX)[\s:]?(.+)")
ANNOTATION_END_RE = re.... | mit |
joelagnel/trappy | tests/utils_tests.py | 1 | 1642 | # Copyright 2015-2017 ARM Limited
#
# 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 w... | apache-2.0 |
impowski/servo | tests/wpt/harness/wptrunner/wptmanifest/node.py | 190 | 4304 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
class NodeVisitor(object):
def visit(self, node):
# This is ugly as hell, but we don't have multimethods and... | mpl-2.0 |
jhawkesworth/ansible-modules-extras | network/f5/bigip_gtm_facts.py | 18 | 15949 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
geektophe/shinken | contrib/nsca/nsca_client.py | 21 | 7256 | # This is a very quick and dirty code for David so he can work on its
# sikuli agent and report as nsca the results.
#
# This need to be clean a lot, it's still a server and should be a
# client class :) I can do it after my "new baby holidays" are
# finished ;)
#
# J. Gabes
import time
import select
import socket
imp... | agpl-3.0 |
alvarolopez/nova | nova/api/openstack/compute/plugins/v3/extended_volumes.py | 36 | 3252 | # Copyright 2013 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
#
# Unless required by applicable law or a... | apache-2.0 |
madmouser1/beets | test/test_lyrics.py | 8 | 16527 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte.
#
# 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 |
pim89/youtube-dl | youtube_dl/extractor/heise.py | 176 | 2864 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_iso8601,
)
class HeiseIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?heise\.de/video/artikel/
.+?(?P<id>[0-9]+)\.html(?:$|[?#]... | unlicense |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.