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 |
|---|---|---|---|---|---|
EraYaN/xbmc | tools/EventClients/examples/python/example_simple.py | 228 | 1272 | #!/usr/bin/python
# This is a simple example showing how you can send a key press event
# to XBMC using the XBMCClient class
import sys
sys.path.append("../../lib/python")
import time
from xbmcclient import XBMCClient
def main():
host = "localhost"
port = 9777
# Create an XBMCClient object and con... | gpl-2.0 |
kmahyyg/learn_py3 | antiscanhttp.py | 1 | 2192 | #!/usr/bin/env python3
# -*- coding : utf-8 -*-
# http://speedtest.tele2.net/10GB.zip
# https://docs.python.org/3/library/http.server.html
# http://blog.csdn.net/cteng/article/details/51584766
"""
Anti-HTTP-Scanner : Redirect all requests to 10GB speedtest file
Patrick Young 2017/10/8
usage: "antiscanhttp.py" [-h] [-... | agpl-3.0 |
dylan-reeves/home_backup | backupclient-env/Lib/encodings/iso8859_8.py | 272 | 11036 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.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 decode(self,input,errors='... | gpl-3.0 |
foodszhang/kbengine | kbe/src/lib/python/Lib/unittest/test/test_assertions.py | 82 | 16470 | import datetime
import warnings
import weakref
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | lgpl-3.0 |
ayoubg/gem5-graphics | gem5/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/__init__.py | 91 | 2486 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
applephil/headlyne | venv/lib/python2.7/site-packages/pip/commands/uninstall.py | 395 | 2203 | from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is able to uninstall most installed packages. Known exceptions are:
- Pure distutil... | apache-2.0 |
mmauroy/SickRage | sickbeard/metadata/generic.py | 2 | 41369 | # 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 |
idegtiarov/ceilometer | ceilometer/tests/unit/network/statistics/test_table.py | 10 | 1641 | #
# Copyright 2014 NEC Corporation. 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... | apache-2.0 |
brendanlong/dash-ts-tools | dash_initialization_segmenter.py | 1 | 4159 | #!/usr/bin/env python3
import argparse
import os
from ts import *
def write_ts(file_name, packets, force):
logging.info("Writing %s", file_name)
if not force and os.path.exists(file_name):
choice = input(
"Output file {} already exists. Overwrite it? "
"[y/N] ".format(file_na... | bsd-2-clause |
bgris/ODL_bgris | lib/python3.5/site-packages/pip/pep425tags.py | 340 | 10980 | """Generate and work with PEP 425 Compatibility Tags."""
from __future__ import absolute_import
import re
import sys
import warnings
import platform
import logging
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
from... | gpl-3.0 |
MarcoVogt/basil | tests/test_RegisterHardwareLayer.py | 1 | 9389 | #
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
import unittest
from basil.dut import Dut
from basil.HL.RegisterHardwareLayer import Registe... | bsd-3-clause |
richardcs/ansible | lib/ansible/modules/cloud/ovirt/ovirt_storage_vm_facts.py | 39 | 4385 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 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
#... | gpl-3.0 |
trondhindenes/ansible | lib/ansible/modules/network/cloudengine/ce_snmp_target_host.py | 43 | 32039 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
Endika/sale-workflow | account_invoice_reorder_lines/__openerp__.py | 14 | 1359 | # -*- coding: utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero... | agpl-3.0 |
dendisuhubdy/tensorflow | tensorflow/contrib/linear_optimizer/python/sdca_estimator_test.py | 24 | 27377 | # 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 |
bwrsandman/OpenUpgrade | addons/l10n_lu/__init__.py | 376 | 1054 | # -*- 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... | agpl-3.0 |
the-metaverse/metaverse | test/test-rpc/TestCase/MultiSignature/test_multisig_boundary.py | 3 | 6920 | from TestCase.MVSTestCase import *
class TestMultiSig(MVSTestCaseBase):
need_mine = False
def test_0_getnew(self):
'''test getnew(_multisig'''
# account password match error
ec, message = mvs_rpc.getnew_multisig(Alice.name, Alice.password + '1', "test", Alice.mainaddress(), [Bob.mainadd... | agpl-3.0 |
cgar/servo | tests/wpt/css-tests/tools/html5lib/html5lib/serializer/htmlserializer.py | 423 | 12897 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import gettext
_ = gettext.gettext
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities,... | mpl-2.0 |
listyque/TACTIC-Handler | thlib/side/watchdog/utils/__init__.py | 13 | 4712 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 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
#
# ... | epl-1.0 |
goFrendiAsgard/kokoropy | kokoropy/packages/sqlalchemy/testing/exclusions.py | 23 | 11986 | # testing/exclusions.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator
from .plugin.plugin_base import SkipTest
from ..util import d... | mit |
anryko/ansible | lib/ansible/plugins/inventory/constructed.py | 42 | 5477 | # Copyright (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 = '''
name: constructed
plugin_type: inventory
version_added: "2.4"
sh... | gpl-3.0 |
sjlehtin/django | django/contrib/gis/serializers/geojson.py | 44 | 2716 | from django.contrib.gis.gdal import CoordTransform, SpatialReference
from django.core.serializers.base import SerializerDoesNotExist
from django.core.serializers.json import Serializer as JSONSerializer
class Serializer(JSONSerializer):
"""
Convert a queryset to GeoJSON, http://geojson.org/
"""
def _i... | bsd-3-clause |
farhaven/hy | hy/macros.py | 4 | 6737 | # Copyright (c) 2013 Paul Tagliamonte <paultag@debian.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modif... | mit |
lqch14102/lantern | install/linux_x86_32/pt/fteproxy/Crypto/Random/Fortuna/SHAd256.py | 127 | 3098 | # -*- coding: ascii -*-
#
# Random/Fortuna/SHAd256.py : SHA_d-256 hash function implementation
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that de... | apache-2.0 |
libvirt/libvirt-test-API | selftests/test_envparser.py | 1 | 5061 | import pytest
from unittest.mock import Mock, MagicMock, patch
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import os
from libvirttestapi.src import exception as exc
from libvirttestapi.src import env_parser
from libvirttestapi.utils import utils
class TestEnvParser():
... | gpl-2.0 |
40223222/40223222 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/pool.py | 694 | 23263 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | gpl-3.0 |
CopeX/odoo | addons/mrp_operations/mrp_operations.py | 193 | 27173 | # -*- 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 |
mars-knowsnothing/amos-bot | src/Lib/site-packages/setuptools/command/upload_docs.py | 110 | 7275 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import socket
import zipfile
import tempfile
import ... | gpl-3.0 |
mistercrunch/panoramix | superset/reports/api.py | 2 | 14710 | # 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 |
adieu/django-invitation | invitation/models.py | 1 | 6880 | import os
import random
import datetime
from django.db import models
from django.conf import settings
from django.utils.http import int_to_base36
from django.utils.hashcompat import sha_constructor
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.core.mail ... | bsd-3-clause |
drssoccer55/RLBot | src/main/python/rlbot/utils/structures/rigid_body_struct.py | 1 | 1072 | import ctypes
from rlbot.utils.structures.bot_input_struct import PlayerInput
from rlbot.utils.structures.game_data_struct import Vector3
from rlbot.utils.structures.start_match_structures import MAX_PLAYERS
class Quaternion(ctypes.Structure):
_fields_ = [("x", ctypes.c_float),
("y", ctypes.c_flo... | mit |
henridwyer/scikit-learn | sklearn/externals/six.py | 547 | 20588 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2013 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
teamotrinidad/plugin.video.chicovara | servers/firedrive.py | 40 | 7129 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para firedrive
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from cor... | gpl-2.0 |
blablack/deteriorate-lv2 | waflib/Tools/compiler_fc.py | 56 | 2162 | #!/usr/bin/env python
# encoding: utf-8
import re
from waflib import Utils, Logs
from waflib.Tools import fc
fc_compiler = {
'win32' : ['gfortran','ifort'],
'darwin' : ['gfortran', 'g95', 'ifort'],
'linux' : ['gfortran', 'g95', 'ifort'],
'java' : ['gfortran', 'g95', 'ifort'],
'default': ['gfortran'],
'aix' ... | gpl-3.0 |
raffaele-forte/climber | Exscript/protocols/drivers/junos_erx.py | 7 | 1624 | # Copyright (C) 2007-2010 Samuel Abels.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | gpl-3.0 |
40223250/2015cd_midterm- | static/Brython3.1.1-20150328-091302/Lib/platform.py | 620 | 51006 | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | gpl-3.0 |
jepler/linuxcnc-mirror | src/emc/usr_intf/pncconf/pncconf.py | 1 | 292409 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# This is pncconf, a graphical configuration editor for LinuxCNC
# Chris Morley copyright 2009
# This is based from stepconf, a graphical configuration editor for linuxcnc
# Copyright 2007 Jeff Epler <jepler@unpythonic.net>
#
# This program is free software... | lgpl-2.1 |
GoBelieveIO/voip_service | voip_client.py | 2 | 8420 | import struct
import socket
import threading
import time
import requests
import json
import sys
import os
import select
MSG_HEARTBEAT = 1
MSG_AUTH = 2
MSG_AUTH_STATUS = 3
MSG_IM = 4
MSG_ACK = 5
MSG_RST = 6
MSG_GROUP_NOTIFICATION = 7
MSG_GROUP_IM = 8
MSG_PEER_ACK = 9
MSG_INPUTING = 10
MSG_SUBSCRIBE_ONLINE_STATE = 11
MS... | gpl-2.0 |
jeffwidman/ansible-modules-core | windows/win_get_url.py | 37 | 3978 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, and others
#
# 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, eithe... | gpl-3.0 |
moijes12/oh-mainline | vendor/packages/Django/django/contrib/redirects/tests.py | 215 | 2436 | from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import six
from .middleware import RedirectFallbackMiddleware
from .models import Redi... | agpl-3.0 |
MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Lib/quopri.py | 424 | 6969 | #! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = '='
MAXLINESIZE = 76
HEX = '0123456789ABCDEF'
EMPTYSTRING = ''
try:
from binascii import a2b_qp, b2a_qp
except Impo... | gpl-2.0 |
fedorpatlin/ansible | lib/ansible/modules/cloud/amazon/elasticache_snapshot.py | 42 | 8055 | #!/usr/bin/python
# 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... | gpl-3.0 |
Sean3Don/ardupilot-raspilot | mk/PX4/Tools/genmsg/test/test_genmsg_srvs.py | 216 | 3233 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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... | gpl-3.0 |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/wheel/test/test_install.py | 455 | 1866 | # Test wheel.
# The file has the following contents:
# hello.pyd
# hello/hello.py
# hello/__init__.py
# test-1.0.data/data/hello.dat
# test-1.0.data/headers/hello.dat
# test-1.0.data/scripts/hello.sh
# test-1.0.dist-info/WHEEL
# test-1.0.dist-info/METADATA
# test-1.0.dist-info/RECORD
# The ... | mit |
pvittman/donkey-cm12 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
ivano666/tensorflow | tensorflow/python/ops/array_grad.py | 9 | 12564 | # Copyright 2015 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... | apache-2.0 |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/distutils/file_util.py | 171 | 7795 | """distutils.file_util
Utility functions for operating on single files.
"""
__revision__ = "$Id$"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose output in 'copy_file()'
_copy_action = {None: 'copying',
'hard': 'hard linking',
... | apache-2.0 |
HaebinShin/tensorflow | tensorflow/python/ops/nn_ops.py | 1 | 56530 | # 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 |
cobalys/django | tests/regressiontests/templates/custom.py | 9 | 23969 | from __future__ import absolute_import, unicode_literals
from django import template
from django.utils.unittest import TestCase
from .templatetags import custom
class CustomFilterTests(TestCase):
def test_filter(self):
t = template.Template("{% load custom %}{{ string|trim:5 }}")
self.assertEqua... | bsd-3-clause |
jxwufan/AssociativeRetrieval | FW_model.py | 1 | 3847 | import tensorflow as tf
from FastWeightsRNN import LayerNormFastWeightsBasicRNNCell
from tensorflow.python.ops import seq2seq
import utils
import numpy as np
class FW_model(object):
def __init__(self, config=None, mode=None):
self.config = config
self.mode = mode
self.build_graph()
self.load_validat... | apache-2.0 |
dagwieers/ansible | lib/ansible/modules/network/aci/mso_user.py | 2 | 7446 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.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_ve... | gpl-3.0 |
richardcs/ansible | lib/ansible/modules/cloud/azure/azure_rm_subnet.py | 4 | 14998 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANS... | gpl-3.0 |
Pretagonist/Flexget | tests/test_seen.py | 2 | 6312 | from __future__ import unicode_literals, division, absolute_import
class TestFilterSeen(object):
config = """
templates:
global:
accept_all: true
tasks:
test:
mock:
- {title: 'Seen title 1', url: 'http://localhost/seen1'}
test2:... | mit |
joseguerrero/sembrando | src/presentacion/paginas/pantalla9.py | 1 | 30062 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pygame
from librerias import pantalla
from librerias.boton import boton
from librerias.texto import texto
from librerias.popups import PopUp
from librerias.imagen import imagen
from librerias.contenido import cont
from librerias.imgfondo import fondo
from librerias.p... | gpl-3.0 |
barct/odoo-coop | infocoop_epec_consumos/tab_fact.py | 1 | 5194 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
from opene... | gpl-3.0 |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/numpy/polynomial/polyutils.py | 107 | 11167 | """
Utililty classes and functions for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
.. autosummary::
:toctree: generated/
PolyError base class fo... | gpl-2.0 |
frzdian/jaksafe-engine | jaksafe/jaksafe/jakservice/jaksafe.py | 1 | 3403 | import ConfigParser
import os
import sys
#### import postgresql and mysql package
import MySQLdb
import psycopg2
from sqlalchemy import create_engine
global_conf_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'global_conf.cfg')
def get_database_connection(ip_address,user,paswd,database):
con = ... | gpl-2.0 |
ufal/ker | server.py | 1 | 9594 | #!/usr/bin/env python
import flask
from flask import Flask
from flask import request
from werkzeug import secure_filename
import os, random, datetime, codecs
import sys, json, magic
import cPickle as pickle
import regex as re
import keywords
import argparse
import xml.etree.ElementTree
import zipfile
app = Flask(__na... | lgpl-3.0 |
Juanlu001/CBC.Solve | cbc/swing/fsinewton/solver/boundary_conditions.py | 1 | 4016 | """Module containing implementation of monolithic FSI boundary conditions"""
__author__ = "Gabriel Balaban"
__copyright__ = "Copyright (C) 2010 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from dolfin import *
class FSIBC(object):
"""
Boundary Conditi... | gpl-3.0 |
vsoch/expfactory-docker | expdj/settings.py | 2 | 5848 | """
Django settings for expdj project.
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import sys
import tempfile
from datetime import timedelta
import matplotlib
from celery import Celery
from kombu import Exchange, Queue
matplotlib.use('Agg')
BASE_DIR = os.path.dirname(os.pat... | mit |
yyd01245/libavg | src/utils/avg_jitterfilter.py | 2 | 4750 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# libavg - Media Playback Engine.
# Copyright (C) 2003-2014 Ulrich von Zadow
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# vers... | lgpl-2.1 |
LittleLama/Sick-Beard-BoxCar2 | sickbeard/providers/tvtorrents.py | 38 | 3011 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | gpl-3.0 |
gnieboer/tensorflow | tensorflow/tools/pip_package/simple_console.py | 605 | 1028 | # 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 |
dzbarsky/servo | tests/wpt/css-tests/tools/webdriver/webdriver/wait.py | 263 | 3563 | # Copyright 2011 Software Freedom Conservancy.
#
# 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 agre... | mpl-2.0 |
guewen/OpenUpgrade | addons/purchase_analytic_plans/__init__.py | 441 | 1220 | # -*- 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... | agpl-3.0 |
PHOTOX/fuase | ase/ase/data/gmtkn30.py | 9 | 11973 | import os
import pprint
import re
from urllib import urlretrieve
import zipfile
import shutil
import datetime
import numpy as np
from ase.units import Bohr
from ase.atom import Atom
from ase.atoms import Atoms
from ase.data import atomic_numbers, chemical_symbols
# databases from http://toc.uni-muenster.de/GMTKN/GM... | gpl-2.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/tpu/python/tpu/tpu_config.py | 15 | 11212 | # 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 |
hasi96/appinventor-sources | appinventor/misc/componentcreator/componentcreator.py | 77 | 6421 | from Tkinter import Tk, BOTH, END, IntVar, StringVar, LEFT
from ttk import Button, Checkbutton, Frame, Style, Combobox, Label, Entry
from tkFileDialog import askopenfilename
import tkMessageBox
from helpers import *
import os
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
clas... | apache-2.0 |
sri85/selenium | py/selenium/webdriver/support/select.py | 67 | 8536 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
timopulkkinen/BubbleFish | tools/telemetry/telemetry/core/chrome/win_platform_backend.py | 1 | 3723 | # Copyright (c) 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 ctypes
import subprocess
try:
import win32api # pylint: disable=F0401
import win32con # pylint: disable=F0401
import win32process # pylin... | bsd-3-clause |
Sveder/letsencrypt | letsencrypt/proof_of_possession.py | 37 | 3643 | """Proof of Possession Identifier Validation Challenge."""
import logging
import os
from cryptography import x509
from cryptography.hazmat.backends import default_backend
import zope.component
from acme import challenges
from acme import jose
from acme import other
from letsencrypt import interfaces
from letsencrypt... | apache-2.0 |
yjmade/odoo | addons/product_visible_discount/__init__.py | 433 | 1054 | ##############################################################################
#
# 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 |
Jajcus/pyxmpp2 | pyxmpp2/mainloop/wait.py | 1 | 2125 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | lgpl-2.1 |
Jun-Yuan/percona-server | mysql-test/suite/tokudb/t/fast_upsert_int.py | 73 | 1972 | #!/usr/bin/env python
import sys
def main():
print "# generated by tokudb_upsert_int.py"
print "source include/have_tokudb.inc;"
print "source include/have_innodb.inc;"
print "set default_storage_engine='tokudb';"
print "disable_warnings;"
print "drop table if exists tt, ti;"
print "enable... | gpl-2.0 |
40223236/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/dom/pulldom.py | 850 | 11761 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... | gpl-3.0 |
joshisa/taiga-back | taiga/projects/userstories/migrations/0001_initial.py | 27 | 5148 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import djorm_pgarray.fields
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('issues', '__first_... | agpl-3.0 |
georgenicolaou/nfi | AndroidAuxiliary/WhatsappMessages.py | 2 | 4147 | '''
NFI -- Silensec's Nyuki Forensics Investigator
Copyright (C) 2014 George Nicolaou (george[at]silensec[dot]com)
Silensec Ltd.
This file is part of Nyuki Forensics Investigator (NFI).
NFI is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Licen... | gpl-3.0 |
luser/socorro | alembic/versions/3e872b0759f0_bug_1025987_bigint_is_overkill.py | 2 | 1268 | """bug 1025987 - BIGINT is overkill
Revision ID: 3e872b0759f0
Revises: 1f235c84eaed
Create Date: 2014-06-17 09:52:29.095452
"""
# revision identifiers, used by Alembic.
revision = '3e872b0759f0'
down_revision = '1f235c84eaed'
from alembic import op
from socorrolib.lib import citexttype, jsontype, buildtype
from soc... | mpl-2.0 |
noironetworks/nova | nova/api/openstack/compute/schemas/rescue.py | 93 | 1087 | # Copyright 2014 NEC Corporation.
# 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... | apache-2.0 |
Weicong-Lin/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/lib2to3/fixes/fix_types.py | 304 | 1806 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
import type... | mit |
alexmandujano/django | tests/utils_tests/test_datastructures.py | 46 | 11075 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
import pickle
import warnings
from django.test import SimpleTestCase
from django.utils.datastructures import (DictWrapper, ImmutableList,
MultiValueDict, MultiValueDictKeyError, MergeDict, SortedDict)
from django.utils import six
class SortedDi... | bsd-3-clause |
freakboy3742/django | django/views/decorators/vary.py | 134 | 1084 | from functools import wraps
from django.utils.cache import patch_vary_headers
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-language')
def index(request):
...
... | bsd-3-clause |
sirex/Misago | misago/users/api/userendpoints/changepassword.py | 8 | 2192 | from django.contrib.auth import update_session_auth_hash
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from rest_framework import status
from rest_framework.response import Response
from misago.conf import settings
from misago.core.mail import mail_user
from mi... | gpl-2.0 |
The-Compiler/qutebrowser | tests/unit/utils/test_debug.py | 2 | 9606 | # Copyright 2014-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
nicky-ji/edx-nicky | cms/djangoapps/contentstore/views/public.py | 41 | 2264 | """
Public views
"""
from django_future.csrf import ensure_csrf_cookie
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.conf import settings
from edxmako.shortcuts import render_to_response
from external_auth.views import (s... | agpl-3.0 |
kamitchell/py2app | py2app/filters.py | 1 | 1048 | from pkg_resources import require
require("macholib")
import os
import sys
from macholib.util import has_filename_filter, in_system_path
def not_stdlib_filter(module, prefix=None):
"""
Return False if the module is located in the standard library
"""
if prefix is None:
prefix = sys.prefix
... | mit |
ryano144/intellij-community | python/helpers/pydev/tests_runfiles/test_pydevd_property.py | 56 | 4121 | '''
Created on Aug 22, 2011
@author: hussain.bohra
@author: fabioz
'''
import os
import sys
import unittest
#=======================================================================================================================
# Test
#================================================================================... | apache-2.0 |
larsimmisch/realms-wiki | realms/lib/hook.py | 2 | 2013 | from __future__ import absolute_import
from six import with_metaclass
from functools import wraps
from flask_sqlalchemy import DeclarativeMeta
def hook_func(name, fn):
@wraps(fn)
def wrapper(self, *args, **kwargs):
for hook, a, kw in self.__class__._pre_hooks.get(name) or []:
hook(self, ... | gpl-2.0 |
nevercast/home-assistant | script/get_entities.py | 30 | 3165 | #! /usr/bin/python
"""
Query the Home Assistant API for available entities then print them and any
desired attributes to the screen.
"""
import sys
import getpass
import argparse
try:
from urllib2 import urlopen
PYTHON = 2
except ImportError:
from urllib.request import urlopen
PYTHON = 3
import json
... | mit |
crosswalk-project/crosswalk-android-extensions | build/idl-generator/third_party/jinja2/defaults.py | 659 | 1068 | # -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import range_type
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
# defaults for ... | bsd-3-clause |
edx-solutions/edx-platform | lms/djangoapps/mobile_api/course_info/views.py | 4 | 3743 | """
Views for course info API
"""
from rest_framework import generics
from rest_framework.response import Response
from lms.djangoapps.courseware.courses import get_course_info_section_module
from openedx.core.lib.xblock_utils import get_course_update_items
from static_replace import make_static_urls_absolute
from ... | agpl-3.0 |
hnakamur/django | django/conf/locale/el/formats.py | 446 | 1477 | # -*- 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 = 'd/m/Y'
TIME_FORMAT = 'P'
DATETIME... | bsd-3-clause |
krismcfarlin/todo_angular_endpoints_sockets | bp_includes/external/requests/packages/urllib3/filepost.py | 147 | 2511 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... | lgpl-3.0 |
sestrella/ansible | lib/ansible/modules/cloud/azure/azure_rm_image.py | 26 | 14444 | #!/usr/bin/python
#
# Copyright (c) 2017 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Ateeq72/weekly-kernel | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
zhenzhai/edx-platform | lms/djangoapps/commerce/tests/mocks.py | 23 | 4813 | """ Commerce app tests package. """
import json
import httpretty
from commerce.tests import TEST_API_URL, factories
class mock_ecommerce_api_endpoint(object): # pylint: disable=invalid-name
"""
Base class for contextmanagers used to mock calls to api endpoints.
The contextmanager internally activates ... | agpl-3.0 |
yanheven/cinder | cinder/openstack/common/versionutils.py | 6 | 8987 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
JosephGoulden/PyBitmessageF2F | src/helper_sql.py | 15 | 1616 | import threading
import Queue
sqlSubmitQueue = Queue.Queue() #SQLITE3 is so thread-unsafe that they won't even let you call it from different threads using your own locks. SQL objects can only be called from one thread.
sqlReturnQueue = Queue.Queue()
sqlLock = threading.Lock()
def sqlQuery(sqlStatement, *args):
s... | mit |
meabsence/python-for-android | python-build/python-libs/gdata/samples/finance/test_finance.py | 128 | 10785 | #!/usr/bin/python
#
# Copyright (C) 2009 Tan Swee Heng
#
# 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 la... | apache-2.0 |
schieb/angr | tests/test_baseptr_save_simplifier.py | 1 | 2862 |
import os.path
import nose.tools
import angr
import ailment
from angr.analyses.decompiler.optimization_passes.base_ptr_save_simplifier import BasePointerSaveSimplifier
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
def _get_block(clinic, addr):
for ... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.