repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
uber/pyro | tests/contrib/funsor/test_tmc.py | 1 | 6347 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import logging
import math
import pytest
import torch
from torch.autograd import grad
from torch.distributions import constraints
from tests.common import assert_equal
# put all funsor-related imports here, so test collection works ... | apache-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/notebook/terminal/api_handlers.py | 6 | 1298 | import json
from tornado import web, gen
from ..base.handlers import APIHandler, json_errors
from ..utils import url_path_join
class TerminalRootHandler(APIHandler):
@web.authenticated
@json_errors
def get(self):
tm = self.terminal_manager
terms = [{'name': name} for name in tm.terminals]
... | mit |
emmanuj/numi | numi.py | 1 | 1737 | #!/usr/bin/env python
import timeit
import subprocess
import os
import StringIO
import json
import urllib
import time
import sys, daemon #python daemon is an external library and needs to be installed
class ChangDir:
def __init__(self, path):
self.currentPath = os.getcwd() #returns current working directory
os.... | gpl-2.0 |
Kazade/NeHe-Website | google_appengine/lib/jinja2-2.6/examples/bench.py | 75 | 10922 | """\
This benchmark compares some python templating engines with Jinja 2 so
that we get a picture of how fast Jinja 2 is for a semi real world
template. If a template engine is not installed the test is skipped.\
"""
import sys
import cgi
from timeit import Timer
from jinja2 import Environment as JinjaEnvi... | bsd-3-clause |
OshynSong/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
mrosenstihl/PulsePrograms | autoHahnEcho/fit_T2.py | 1 | 1457 | #!/usr/bin/env python
import numpy as N
import pylab as P
import sys
import time
import scipy.odr
runs = 10000
def T2(p,x):
amplitude, T2, beta = p
return amplitude * N.exp(-(2*x/T2)**beta)
def InvRec(p,x):
amplitude, b, T1, beta = p
return amplitude *( 1 - b * N.exp(-(x/T1)**beta))
def func(p,x,y):
return T2... | bsd-2-clause |
ingadhoc/odoo | addons/base_iban/base_iban.py | 278 | 8657 | # -*- 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 |
scorphus/django | django/contrib/contenttypes/fields.py | 26 | 23881 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, connection, models, router, transaction... | bsd-3-clause |
JoeriHermans/ml-scripts | scripts/adverserial-variational-optimization/avo.py | 2 | 11733 |
# Adverserial Variational Optimization
import math
import numpy as np
import random
import sys
import torch
import torch.nn.functional as F
from sklearn.utils import check_random_state
from torch.autograd import Variable
def main():
# Assume there exists some true parameterization.
# Beam Energy = 43 Gev, ... | gpl-3.0 |
rbbratta/virt-test | libvirt/tests/src/virsh_cmd/domain/virsh_setvcpus.py | 1 | 6257 | import re, os, logging, commands
from autotest.client.shared import error
from virttest import remote, libvirt_vm, virsh, libvirt_xml
from xml.dom.minidom import parse
def run_virsh_setvcpus(test, params, env):
"""
Test command: virsh setvcpus.
The conmand can change the number of virtual CPUs in the gues... | gpl-2.0 |
pjg101/SickRage | lib/hachoir_parser/container/action_script.py | 84 | 24565 | """
SWF (Macromedia/Adobe Flash) file parser.
Documentation:
- Alexis' SWF Reference:
http://www.m2osw.com/swf_alexref.html
- Tamarin ABC format:
http://www.m2osw.com/abc_format.html
Authors: Sebastien Ponce, Robert Xiao
Creation date: 26 April 2008
"""
from hachoir_parser import Parser
from hachoir_core.fi... | gpl-3.0 |
scs/uclinux | user/python/python-2.4.4/Lib/test/test_multibytecodec.py | 5 | 4296 | #!/usr/bin/env python
#
# test_multibytecodec.py
# Unit test for multibytecodec itself
#
# $CJKCodecs: test_multibytecodec.py,v 1.8 2004/06/19 06:09:55 perky Exp $
from test import test_support
from test import test_multibytecodec_support
import unittest, StringIO, codecs, sys
class Test_StreamWriter(unittest.TestC... | gpl-2.0 |
pas256/ansible | lib/ansible/plugins/lookup/hashi_vault.py | 44 | 2701 | # (c) 2015, Jonathan Davila <jdavila(at)ansible.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 late... | gpl-3.0 |
ParadropLabs/Paradrop | tests/pdinstall/test_main.py | 1 | 2416 | import os
from mock import MagicMock, Mock, patch
def test_getArgs():
"""
Test pdinstall.main.getArgs
"""
from pdinstall.main import getArgs
argv = ["install", "--source", "paradrop_0.1.0_all.snap"]
args = getArgs(argv)
assert args.sources == [argv[2]]
@patch("os.remove")
@patch("os.li... | apache-2.0 |
n3wb13/OpenNfrGui-5.0-1 | lib/python/Screens/ServiceInfo.py | 1 | 10815 | from Components.HTMLComponent import HTMLComponent
from Components.GUIComponent import GUIComponent
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from ServiceReference import ServiceReference
from enigma import eListboxPythonMultiContent, eListbox, gFont... | gpl-2.0 |
truthcoin/blocksize-market | contrib/fedpeg/rotating_consensus.py | 10 | 4908 | #!/usr/bin/env python2
from time import sleep, time
import socket
import threading
import zmq
import traceback
# For error printing
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../python-bitcoinrpc"))
from bitcoinrpc.authproxy import JSONRPCException
zmq_context = z... | mit |
atombrella/django-rest-framework | tests/utils.py | 5 | 1646 | from django.core.exceptions import ObjectDoesNotExist
from rest_framework.compat import NoReverseMatch
class MockObject(object):
def __init__(self, **kwargs):
self._kwargs = kwargs
for key, val in kwargs.items():
setattr(self, key, val)
def __str__(self):
kwargs_str = ', '... | bsd-2-clause |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/setuptools/tests/test_easy_install.py | 135 | 15441 | """Easy install Tests
"""
import sys
import os
import shutil
import tempfile
import unittest
import site
import contextlib
import textwrap
import tarfile
import logging
import distutils.core
from setuptools.compat import StringIO, BytesIO, next, urlparse
from setuptools.sandbox import run_setup, SandboxViolation
from ... | mit |
nyalldawson/QGIS | python/plugins/processing/algs/gdal/ClipRasterByExtent.py | 15 | 6970 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ClipRasterByExtent.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander bruy at gmail dot com
********... | gpl-2.0 |
AlessandroZ/LaZagne | Mac/lazagne/config/crypto/pyDes.py | 1 | 32333 | #############################################################################
# Documentation #
#############################################################################
# Author: Todd Whiteman
# Date: 28th April, 2010
# Version: 2.0.1
# License: MIT
# Homepage: http://twhit... | lgpl-3.0 |
Intel-Corporation/tensorflow | tensorflow/python/autograph/pyct/qual_names.py | 24 | 8125 | # 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 |
skoslowski/gnuradio | gr-blocks/python/blocks/qa_vco.py | 3 | 1851 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import division
from gnuradio import gr, gr_unittest, blocks
import math
def sig_source_f(samp_rate, freq, amp, N):
t = [float(x) / samp_rat... | gpl-3.0 |
VitalPet/c2c-rd-addons | chricar_sale_internal_shippment/__openerp__.py | 4 | 1728 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>)
#
# Thi... | agpl-3.0 |
hefen1/chromium | build/android/buildbot/bb_utils.py | 124 | 3235 | # 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 json
import optparse
import os
import pipes
import subprocess
import sys
import bb_annotations
sys.path.append(os.path.join(os.path.dirname(__file__... | bsd-3-clause |
CristianBB/SickRage | sickbeard/search_queue.py | 6 | 11064 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | gpl-3.0 |
gladk/woodem | py/_monkey/aliases.py | 1 | 6327 | '''Define various convenience attributes, such as ``Node.dem`` for accessing DEM data of a node (equivalent to ``node->getData<DemData>()`` in c++).'''
from woo import core
from woo.core import Master
import sys, warnings
core.Field.nod=core.Field.nodes
## proxy for attribute-like access to Scene.labels
## http://sta... | gpl-2.0 |
rjw57/trafficdb | migrations/versions/7dc1a66bb8_initial_db.py | 1 | 1114 | """Initial database migration
Revision ID: 7dc1a66bb8
Revises: None
Create Date: 2014-09-24 15:36:35.984051
"""
# revision identifiers, used by Alembic.
revision = '7dc1a66bb8'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please ad... | mit |
yuvipanda/paws | images/nbserve/nginx.py | 1 | 6626 | #!/usr/bin/python3
import os
CONFIG = r"""
# Let nginx automatically determine the number of worker processes
# to run. This defaults to number of cores on the host.
worker_processes auto;
# Do not daemonize - we'll either run this under a supervisor
# ourselves, or jupyterhub will manage the process, restarting
# i... | mit |
kskalski/grpc | src/python/grpcio/grpc/framework/foundation/stream.py | 48 | 1389 | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
barisdinc/QB50 | 9600rx.py | 1 | 4886 | #!/usr/bin/env python
from gnuradio import gr,usrp,blks,packetradio
from gnuradio.eng_option import eng_option
import gnuradio.gr.gr_threading as _threading
from math import pi
from optparse import OptionParser
from gnuradio.eng_option import eng_option
import time
from ax25 import *
#
# 64e6 (250) 256000 (3/5) 153... | gpl-3.0 |
HaebinShin/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator.py | 1 | 33804 | # 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 |
MichaelDoyle/Diamond | src/collectors/onewire/test/testonewire.py | 68 | 1389 | #!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from diamond.collector import Collector
from onewire import OneWireCollector
####... | mit |
chosen1/namebench | nb_third_party/dns/rdtypes/IN/A.py | 248 | 2055 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
huanqi/leetcode-python | unique_paths_ii/solution2.py | 3 | 1435 | """
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths
would there be?
An obstacle and empty space is marked as 1 and 0 respectively in the grid.
For example,
There is one obstacle in the middle of a 3x3 grid as illustrated below.
[
[0,0,0],
[0,1,0],
[0,... | bsd-2-clause |
pedrosino/tnoodle | git-tools/requests/auth.py | 294 | 6173 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import pars... | gpl-3.0 |
ChrisCinelli/pgessays | env/lib/python2.7/site-packages/genshi/template/tests/interpolation.py | 30 | 7537 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | bsd-2-clause |
FRidh/scipy | scipy/io/tests/test_fortran.py | 95 | 2591 | ''' Tests for fortran sequential files '''
import tempfile
import shutil
from os import path
from glob import iglob
import re
from numpy.testing import assert_equal, assert_allclose, run_module_suite
import numpy as np
from scipy.io import FortranFile
DATA_PATH = path.join(path.dirname(__file__), 'data')
def tes... | bsd-3-clause |
zobe123/Plex-CS | lib/mako/parsetree.py | 60 | 20434 | # mako/parsetree.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""defines the parse tree components for Mako templates."""
from mako import exceptions, ast, u... | gpl-3.0 |
javilonas/NCam | cross/Toolchain-SamsungTV/arm-v7a8v3r1-linux-gnueabi/lib/libstdc++.so.6.0.16-gdb.py | 1 | 2352 | # -*- python -*-
# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
# 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 versi... | gpl-3.0 |
alexmojaki/blaze | blaze/compute/tests/test_numpy_compute.py | 6 | 16540 | from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
import pandas as pd
from datetime import datetime, date
from blaze.compute.core import compute, compute_up
from blaze.expr import symbol, by, exp, summary, Broadcast, join, concat
from blaze import sin
from odo import i... | bsd-3-clause |
mrniranjan/sssd | src/sbus/codegen/sbus_Template.py | 6 | 9834 | #
# Authors:
# Pavel Brezina <pbrezina@redhat.com>
#
# Copyright (C) 2017 Red Hat
#
# 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 yo... | gpl-3.0 |
thinker0/aurora | src/test/python/apache/aurora/config/test_base.py | 4 | 7904 | #
# 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
# distributed under ... | apache-2.0 |
nicky-ji/edx-nicky | cms/djangoapps/contentstore/views/tests/test_import_export.py | 10 | 11686 | """
Unit tests for course import and export
"""
import copy
import json
import logging
import os
import shutil
import tarfile
import tempfile
from path import path
from uuid import uuid4
from django.test.utils import override_settings
from django.conf import settings
from contentstore.utils import reverse_course_url
... | agpl-3.0 |
subramani95/neutron | neutron/tests/unit/hyperv/test_hyperv_security_groups_driver.py | 12 | 7796 | # Copyright 2014 Cloudbase Solutions SRL
# 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 r... | apache-2.0 |
timsnyder/bokeh | bokeh/core/property/auto.py | 2 | 2646 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
google/containerregistry | client/v1/save_.py | 2 | 3111 | # Copyright 2017 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 ag... | apache-2.0 |
ahkscript/sjBot | commands/#ahkscript,#ahk,#Sjc_Bot/ahk.py | 1 | 1245 | #!/usr/bin/env python3
import re
import urllib.parse
import json
import difflib
owner = False
aliases = ['ahksearch', 'search', 'a']
def ahk(con, sjBot, commands, trigger, host, channel, *query):
"""Searches the AHK docs for something. If its not found it will
then search the forum."""
with open('com... | gpl-3.0 |
jetskijoe/SickGear | lib/sqlalchemy/sql/ddl.py | 78 | 28858 | # sql/ddl.py
# Copyright (C) 2009-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them f... | gpl-3.0 |
bjoshua/ansible-modules-extras | packaging/language/npm.py | 73 | 8566 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chris Hoffman <christopher.hoffman@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 ... | gpl-3.0 |
nycbjr/kernel_sony_sgp3xx | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
elba7r/system | erpnext/stock/doctype/delivery_note/delivery_note.py | 8 | 15561 | # 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
... | gpl-3.0 |
TaDaa/.vim | dependencies/windows/ycm/ycm/python/ycm/completers/completer_utils.py | 1 | 2054 | #!/usr/bin/env python
#
# Copyright (C) 2013 Strahinja Val Markovic <val@markovic.io>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 ... | mit |
paoloach/cc2530sim | googletest/googlemock/test/gmock_output_test.py | 986 | 5999 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
jhawkesworth/ansible | lib/ansible/galaxy/login.py | 27 | 4573 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.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 Fo... | gpl-3.0 |
cloudbau/nova | nova/tests/compute/test_compute_api.py | 2 | 64148 | #
# 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 |
knz/slcore | slc/tools/slc/mt/common/regmagic.py | 2 | 13418 | from ...msg import die, warn
import re
class RegMagic:
def __init__(self, rd):
self._regs = {
'i' : { 'l' : [None]*32, 'g' : [None]*32, 's' : [None]*32, 'd' : [None]*32 },
'f' : { 'l' : [None]*32, 'g' : [None]*32, 's' : [None]*32, 'd' : [None]*32 },
}
self._reg_inv = map... | gpl-3.0 |
CristianBB/SickRage | lib/unidecode/x0cc.py | 253 | 4749 | data = (
'jjyim', # 0x00
'jjyib', # 0x01
'jjyibs', # 0x02
'jjyis', # 0x03
'jjyiss', # 0x04
'jjying', # 0x05
'jjyij', # 0x06
'jjyic', # 0x07
'jjyik', # 0x08
'jjyit', # 0x09
'jjyip', # 0x0a
'jjyih', # 0x0b
'jji', # 0x0c
'jjig', # 0x0d
'jjigg', # 0x0e
'jjigs', # 0x0f
'jjin',... | gpl-3.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/python/ops/rnn_cell.py | 71 | 1461 | # 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... | mit |
Metaswitch/calico-nova | nova/tests/unit/scheduler/filters/test_image_props_filters.py | 66 | 10627 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
scs/uclinux | user/python/python-2.4.4/Mac/Modules/launch/launchscan.py | 5 | 2914 | # Scan an Apple header file, generating a Python file of generator calls.
import sys
import os
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
LONG = "LaunchServices"
SHORT = "launch"
OBJECT = "NOTUSED"
def main():
input = LONG + ".h"
output = SHORT + "gen... | gpl-2.0 |
youssef-poisson/angular | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 289 | 21425 | #!/usr/bin/env python
# Copyright (c) 2012 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.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | gpl-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/chardet/sbcsgroupprober.py | 273 | 3546 | ######################## 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 |
phenoxim/nova | nova/tests/unit/conductor/tasks/test_base.py | 54 | 1604 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
mrquim/repository.mrquim | script.module.youtube.dl/lib/youtube_dl/extractor/videopress.py | 48 | 3010 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
float_or_none,
parse_age_limit,
qualities,
random_birthday,
try_get,
unified_timestamp,
urljoin,
)
class VideoPress... | gpl-2.0 |
ltilve/ChromiumGStreamerBackend | third_party/pycoverage/coverage/templite.py | 160 | 6868 | """A simple Python template renderer, for a nano-subset of Django syntax."""
# Coincidentally named the same as http://code.activestate.com/recipes/496702/
import re
from coverage.backward import set # pylint: disable=W0622
class CodeBuilder(object):
"""Build source code conveniently."""
... | bsd-3-clause |
chokribr/inveniotest | modules/bibrank/lib/bibrank.py | 13 | 11592 | ## -*- mode: python; coding: utf-8; -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the... | gpl-2.0 |
philipn/sycamore | Sycamore/support/pytz/zoneinfo/America/Cuiaba.py | 2 | 5648 | '''tzinfo timezone information for America/Cuiaba.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Cuiaba(DstTzInfo):
'''America/Cuiaba timezone definition. See datetime.tzinfo for details'''
zone = 'America/Cuiaba'
... | gpl-2.0 |
dllsf/odootest | addons/product_expiry/__openerp__.py | 61 | 1831 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
pombredanne/grr | lib/flows/general/webhistory_test.py | 6 | 7815 | #!/usr/bin/env python
"""Test the webhistory flows."""
import os
from grr.client import client_utils_linux
from grr.client import client_utils_osx
from grr.client.client_actions import standard
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import artifact_test
from grr.lib import flags
from g... | apache-2.0 |
emilydolson/forestcat | pyrobot/aima/logic.py | 2 | 33894 | """Representations and Inference for Logic (Chapters 7-10)
Covers both Propositional and First-Order Logic. First we have four
important data types:
KB Abstract class holds a knowledge base of logical expressions
KB_Agent Abstract class subclasses agents.Agent
Expr A logical expre... | agpl-3.0 |
foss-transportationmodeling/rettina-server | flask/local/lib/python2.7/site-packages/whoosh/legacy.py | 95 | 3459 | # Copyright 2012 Matt Chaput. 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 notice,
# this list of conditions and the... | apache-2.0 |
macobo/TurtleSnap | TurtleSnap.py | 1 | 2381 | import turtle
import os
import time
import random
import subprocess
CURRENT_FOLDER = os.path.dirname(os.path.abspath(__file__))
CREATE_GIF_SH = os.path.join(CURRENT_FOLDER, "creategif.sh")
def take_picture(canvas, filename):
canvas.postscript(file=filename)
def execute_file(file):
exec(file.read() + "\nimpor... | mit |
ChawalitK/odoo | addons/website_portal_sale/controllers/main.py | 11 | 2109 | # -*- coding: utf-8 -*-
import datetime
from openerp import http
from openerp.exceptions import AccessError
from openerp.http import request
from openerp.addons.website_portal.controllers.main import website_account
class website_account(website_account):
@http.route(['/my/home'], type='http', auth="user", webs... | gpl-3.0 |
PySide/Tools | pysideuic/port_v3/load_plugin.py | 8 | 1414 | # This file is part of the PySide project.
#
# Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
# Copyright (C) 2010 Riverbank Computing Limited.
# Copyright (C) 2009 Torsten Marek
#
# Contact: PySide team <pyside@openbossa.org>
#
# This program is free software; you can redistribute it and/or
# m... | gpl-2.0 |
sam-m888/gramps | gramps/plugins/lib/librecords.py | 5 | 24107 | # encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program - Records plugin
#
# Copyright (C) 2008-2011 Reinhard Müller
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2013-2016 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General ... | gpl-2.0 |
ULHPC/easybuild-easyblocks | easybuild/easyblocks/a/anaconda.py | 1 | 2886 | ##
# Copyright 2009-2017 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
ioannistsanaktsidis/invenio | modules/bibformat/web/admin/bibformatadmin.py | 18 | 49800 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 ... | gpl-2.0 |
hkawasaki/kawasaki-aio8-2 | lms/djangoapps/licenses/views.py | 22 | 2712 | import logging
import json
import re
from urlparse import urlparse
from collections import namedtuple, defaultdict
from edxmako.shortcuts import render_to_string
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse, Http404
from dj... | agpl-3.0 |
avlach/univbris-ocf | vt_manager/src/python/vt_manager/communication/sfa/methods/GetCredential.py | 4 | 1747 | from vt_manager.communication.sfa.util.xrn import urn_to_hrn
from vt_manager.communication.sfa.util.method import Method
from vt_manager.communication.sfa.trust.credential import Credential
from vt_manager.communication.sfa.util.parameter import Parameter, Mixed
class GetCredential(Method):
"""
Retrive a cre... | bsd-3-clause |
slackhappy/graphite-web | webapp/graphite/graphlot/views.py | 15 | 7389 | import re
from django.shortcuts import render_to_response
from django.http import HttpResponse, Http404, HttpResponseBadRequest
from django.conf import settings
from graphite.util import json
from graphite.render.views import parseOptions
from graphite.render.evaluator import evaluateTarget
from graphite.storage impo... | apache-2.0 |
Chatmetaleux/MissionPlanner | ExtLibs/Mavlink/pymavlink/generator/mavtemplate.py | 68 | 5597 | #!/usr/bin/env python
'''
simple templating system for mavlink generator
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
from .mavparse import MAVParseError
class MAVTemplate(object):
'''simple templating system'''
def __init__(self,
start_var_token="${",
... | gpl-3.0 |
NeCTAR-RC/ceilometer | ceilometer/tests/storage/test_get_engine.py | 3 | 1387 | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.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
#
# ... | apache-2.0 |
jayme-github/CouchPotatoServer | libs/sqlalchemy/orm/scoping.py | 17 | 4600 | # orm/scoping.py
# Copyright (C) 2005-2012 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
from sqlalchemy import exc as sa_exc
from sqlalchemy.util import ScopedRegistry, Thread... | gpl-3.0 |
rev2004/android2cloud.app-engine | google_appengine/lib/django/django/templatetags/i18n.py | 33 | 8474 | from django.template import Node, resolve_variable
from django.template import TemplateSyntaxError, TokenParser, Library
from django.template import TOKEN_TEXT, TOKEN_VAR
from django.utils import translation
register = Library()
class GetAvailableLanguagesNode(Node):
def __init__(self, variable):
self.var... | mit |
mspark93/VTK | Common/ComputationalGeometry/Testing/Python/CSpline.py | 20 | 3768 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Now create the RenderWindow, Renderer and Interactor
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.S... | bsd-3-clause |
diogommartins/pox | pox/forwarding/l2_pairs.py | 47 | 2882 | # Copyright 2012 James McCauley
#
# 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 writi... | apache-2.0 |
danielchalef/Arduino | arduino-core/src/processing/app/i18n/python/transifex.py | 75 | 2038 | #!/usr/bin/env python
#vim:set fileencoding=utf-8 sw=2 expandtab
import update
import requests
import json
class Transifex(object):
def __init__(self, user, passwd):
self.auth_ = (user, passwd)
r = requests.get(
'http://www.transifex.com/api/2/project/'
'arduino-ide-15/resource/ide-15/?deta... | lgpl-2.1 |
neoz/zer0m0n | signatures/network_tor.py | 6 | 1719 | # Copyright (C) 2012 Claudio "nex" Guarnieri (@botherder)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pro... | gpl-3.0 |
rainwoodman/pmesh | pmesh/abopt.py | 3 | 12379 | from __future__ import absolute_import
from warnings import warn
warn("This module is deprecated and likely no longer maintained; a maintained version is moved to cosmo4d to minimize changes in pmesh.", DeprecationWarning)
import numpy
from abopt.vmad2 import ZERO, Engine, statement, programme, CodeSegment, Literal
... | gpl-3.0 |
divio/django-shop | email_auth/models.py | 1 | 2957 | """
Alternative implementation of Django's authentication User model, which allows to authenticate
against the email field in addition to the username fields.
This alternative implementation is activated by setting ``AUTH_USER_MODEL = 'shop.User'`` in
settings.py, otherwise the default Django or another customized impl... | bsd-3-clause |
skottler/packstack | packstack/installer/validators.py | 1 | 7154 | # -*- coding: utf-8 -*-
"""
Contains all core validation functions.
"""
import os
import re
import socket
import logging
import tempfile
import traceback
import basedefs
import common_utils as utils
from .setup_controller import Controller
from .exceptions import ParamValidationError
__all__ = ('ParamValidationEr... | apache-2.0 |
ASCrookes/django | django/contrib/postgres/fields/ranges.py | 172 | 5636 | import json
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange, Range
from django.contrib.postgres import forms, lookups
from django.db import models
from django.utils import six
from .utils import AttributeSetter
__all__ = [
'RangeField', 'IntegerRangeField', 'BigIntegerRangeField',
'Floa... | bsd-3-clause |
idatux/idatuxft | engine/xml/dom/html/HTMLDOMImplementation.py | 10 | 1047 | ########################################################################
#
# File Name: implementation.py
#
#
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.com/COPYRIGHT for license and copyright informa... | gpl-3.0 |
jerome-nexedi/dream | dream/simulation/OrderComponent.py | 5 | 4092 | # ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Founda... | gpl-3.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/test/test_poll.py | 91 | 6552 | # Test case for the os.poll() function
import os
import subprocess
import random
import select
try:
import threading
except ImportError:
threading = None
import time
import unittest
from test.support import TESTFN, run_unittest, reap_threads, cpython_only
try:
select.poll
except AttributeError:
raise ... | lgpl-3.0 |
jjmachan/activityPointsApp | activitypoints/lib/python3.5/site-packages/django/contrib/gis/db/models/fields.py | 45 | 17598 | from collections import defaultdict
from django.contrib.gis import forms, gdal
from django.contrib.gis.db.models.lookups import (
RasterBandTransform, gis_lookups,
)
from django.contrib.gis.db.models.proxy import SpatialProxy
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.geometry.... | mit |
Alwnikrotikz/marinemap | lingcod/user_profile/migrations/0001_initial.py | 3 | 4214 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserProfile'
db.create_table('user_profile_userprofile', (
('about', self.... | bsd-3-clause |
amenonsen/ansible | lib/ansible/plugins/action/netconf.py | 32 | 3577 | #
# Copyright 2018 Red Hat 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
# (at your option) any later version.
#
# Ansibl... | gpl-3.0 |
ghchinoy/tensorflow | tensorflow/python/ops/distributions/distribution.py | 21 | 46676 | # 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 |
mihu/redis-rdb-tools | tests/parser_tests.py | 1 | 15247 | import unittest
import os
import math
from rdbtools import RdbCallback, RdbParser
class RedisParserTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_empty_rdb(self):
r = load_rdb('empty_database.rdb')
self.assert_('start_rdb' in r... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.