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 |
|---|---|---|---|---|---|
smaresca/libvmi | tools/windows-offset-finder/downloadPDB.py | 7 | 4535 | #!/usr/bin/env python
"""
The LibVMI Library is an introspection library that simplifies access to
memory in a target virtual machine or in a file containing a dump of
a system's physical memory. LibVMI is based on the XenAccess Library.
Copyright 2011 Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000... | lgpl-3.0 |
angelapper/odoo | addons/hw_escpos/escpos/printer.py | 101 | 6802 | #!/usr/bin/python
import usb.core
import usb.util
import serial
import socket
from escpos import *
from constants import *
from exceptions import *
from time import sleep
class Usb(Escpos):
""" Define USB printer """
def __init__(self, idVendor, idProduct, interface=0, in_ep=0x82, out_ep=0x01):
"""
... | agpl-3.0 |
gunan/tensorflow | tensorflow/python/keras/mixed_precision/experimental/device_compatibility_check.py | 1 | 7117 | # Copyright 2019 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 |
MOA-2011/enigma2-plugin-extensions-openwebif | plugin/controllers/views/ajax/config.py | 1 | 16871 | #!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | gpl-2.0 |
fxcqz/stackfuck | stackfuck/interpreter.py | 1 | 6344 | from copy import deepcopy
from stackfuck.parser import Parser
from stackfuck.stream import InputStream
from stackfuck.token import TokenStream
class StackfuckError(Exception):
""" Generic Stackfuck interpretation error """
class Interpreter(object):
def __init__(self, source_code):
# set up
... | mit |
farodin91/servo | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | 71218 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
Bitcoin-com/BUcash | qa/rpc-tests/nodehandling.py | 8 | 3499 | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test node handling
#
from test_framework.... | mit |
Pratik151/OWASP-ZSC | lib/encoder/linux_x86/xor_random.py | 4 | 34594 | #!/usr/bin/env python
'''
OWASP ZSC
https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project
https://github.com/zscproject/OWASP-ZSC
http://api.z3r0d4y.com/
https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ]
'''
import random, binascii, string
from core.compatible import version
_version = ... | gpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/integrals/quadrature.py | 25 | 14565 | from __future__ import print_function, division
from sympy.core import S, Dummy, pi
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.trigonometric import sin, cos
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.functions.special.gamma_functions import ... | mit |
sunze/py_flask | venv/lib/python3.4/site-packages/pip/vcs/subversion.py | 86 | 10632 | from __future__ import absolute_import
import logging
import os
import re
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.index import Link
from pip.utils import rmtree, display_path, call_subprocess
from pip.utils.logging import indent_log
from pip.vcs import vcs, VersionControl
_svn_xml_ur... | mit |
sergey104/rtbkit | jml/tsne/testing/tsne_python_test.py | 21 | 2253 | import numpy
import pylab as Plot
import sys
from os import getenv
# WARNING: security risk; don't do this for anything that might be installed
sys.path.append(getenv("BIN"))
import tsne
print "numpy version", numpy.version.version
try:
tsne.vectors_to_distances(None)
except:
pass
else:
assert ~"excepti... | apache-2.0 |
lavjain/incubator-hawq | tools/bin/pythonSrc/pexpect-4.2/tests/test_performance.py | 18 | 4173 | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... | apache-2.0 |
SUSE/azure-sdk-for-python | azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/catalog/models/usql_distribution_info.py | 3 | 1548 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
lewismc/climate | obs4MIPs/factory/formats.py | 10 | 18397 | # 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 |
sahat/bokeh | examples/plotting/file/hover.py | 1 | 1519 | from __future__ import division
import numpy as np
from six.moves import zip
from collections import OrderedDict
from bokeh.plotting import *
from bokeh.objects import HoverTool, Range1d
TOOLS="pan,wheel_zoom,box_zoom,reset,hover,previewsave"
xx, yy = np.meshgrid(range(0,101,4), range(0,101,4))
x = xx.flatten()
y = ... | bsd-3-clause |
ininex/geofire-python | resource/lib/python2.7/site-packages/pyasn1/type/tag.py | 5 | 4824 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
from operator import getitem
from pyasn1 import error
tagClassUniversal = 0x00
tagClassApplication = 0x40
tagClassContext = 0x80
tagClassPrivate = 0xC0
tagFormatSimple... | mit |
cgvarela/vitess | py/io/lockfile.py | 22 | 1859 | # Quick exclusive lock for ensuring two processes don't stomp each other.
#
# The only drawback here is that this leaves a lock turdfile that doesn't
# get cleaned up. Practically speaking this shouldn't be a problem, but it
# doesn't feel entirely satisfying.
#
# This lock has the handy property that if the process di... | bsd-3-clause |
PythonCharmers/bokeh | sphinx/source/docs/tutorials/exercises/les_mis.py | 23 | 2382 | import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
# EXERCISE: try out different sort orders for the names
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['... | bsd-3-clause |
moijes12/oh-mainline | vendor/packages/Django/django/contrib/auth/tests/tokens.py | 215 | 2652 | import sys
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.utils import unittest... | agpl-3.0 |
pdfminer/pdfminer.six | pdfminer/utils.py | 2 | 12544 | """
Miscellaneous Routines.
"""
import io
import pathlib
import struct
from html import escape
import chardet # For str encoding detection
# from sys import maxint as INF doesn't work anymore under Python3, but PDF
# still uses 32 bits ints
INF = (1 << 31) - 1
class open_filename(object):
"""
Context manag... | mit |
xfournet/intellij-community | python/helpers/py3only/docutils/statemachine.py | 44 | 57608 | # $Id: statemachine.py 7464 2012-06-25 13:16:03Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A finite state machine specialized for regular-expression-based text filters,
this module defines the following classes:
- `StateMachine`, a state m... | apache-2.0 |
qrkourier/ansible | test/units/modules/network/junos/test_junos_netconf.py | 43 | 3679 | # (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
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
krafczyk/spack | var/spack/repos/builtin/packages/py-pycodestyle/package.py | 5 | 2513 | ##############################################################################
# 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 |
bflaven/BlogArticlesExamples | python_playing_with_object_detection_opencv_yolo/using_yolo_4.py | 1 | 2436 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
[path]
cd /path-to/your/directory/
[file]
python using_yolo_4.py
"""
import cv2
import numpy as np
#Load YOLO Algorithm
net = cv2.dnn.readNet("config/yolov3.weights", "config/yolov3.cfg")
#To load all objects that have to be detected
classes=[]
with open("config/coco.n... | mit |
yungyuc/solvcon | solvcon/gendata.py | 2 | 7149 | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2008, Yung-Yu Chen <yyc@solvcon.net>
#
# 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 copyrigh... | bsd-3-clause |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/pip/utils/logging.py | 199 | 3326 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... | mit |
tchernomax/ansible | packaging/release/versionhelper/version_helper.py | 124 | 6838 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
import argparse
import os
import re
import sys
from packaging.version import Version, VERSION_PATTERN
class AnsibleVersionMunger(object):
tag_offsets = dict(
dev=0,
a=100,
b=200,
rc=1000
)
... | gpl-3.0 |
lxl1140989/6291-xl | package/mqtt/src/dmlibs/paho.mqtt.c-master/test/mqttsas.py | 1 | 3670 | """
*******************************************************************
Copyright (c) 2013, 2016 IBM Corp.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
and Eclipse Distribution License v1.0 which accompany this distribut... | gpl-2.0 |
neilisaac/luigi | luigi/event.py | 67 | 1298 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
agressiva/paparazzi | sw/lib/python/settings_tool.py | 14 | 2588 | #!/usr/bin/env python
from ivy.std_api import *
import os
import logging
import sys
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
from settings_xml_parse import PaparazziACSettings
_SHOW_IVY_MSGS_ = False
class IvySettingsInterface(PaparazziACSettings):
def __init__(self, ac_ids):
Papara... | gpl-2.0 |
johngian/remo | vendor-local/lib/python/chardet/jisfreq.py | 323 | 47307 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | bsd-3-clause |
LukasMosser/MontePetro | montepetro/properties.py | 2 | 2982 | import numpy as np
from montepetro.generators import RandomGenerator
class Property(object):
def __init__(self, name=None, desc=None):
self.name = name
self.desc = desc
self.values = None
def generate_values(self):
pass
def update_seed(self, *args, **kwargs):
pas... | gpl-2.0 |
keishi/chromium | chrome/test/functional/media/media_stat_perf.py | 10 | 3034 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""CPU, Memory, and FPS performance test for <video>.
Calculates decoded fps, dropped fps, CPU, and memory statistics while playin... | bsd-3-clause |
gangadharkadam/saloon_erp_install | erpnext/stock/doctype/stock_entry/test_stock_entry.py | 12 | 23012 | # 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, unittest
import frappe.defaults
from frappe.utils import flt, nowdate, nowtime
from erpnext.stock.doctype.serial_no.serial_no import *
fr... | agpl-3.0 |
nhenezi/kuma | vendor/packages/ipython/IPython/frontend/process/winprocess.py | 7 | 9831 | # A module to expose various thread/process/job related structures and
# methods from kernel32
#
# The MIT License
#
# Copyright (c) 2006 the Mozilla Foundation <http://www.mozilla.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentati... | mpl-2.0 |
andrew-a-dev/aws | vows/fixtures/storage_fixture.py | 1 | 1069 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path import join, abspath, dirname
from thumbor.context im... | mit |
kustodian/ansible | lib/ansible/modules/cloud/vmware/vmware_host_dns_info.py | 21 | 4111 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@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
ANSIBLE_METADATA = {
'metadat... | gpl-3.0 |
VyacheslavHashov/python-swiftclient | tests/unit/test_service.py | 2 | 79060 | # Copyright (c) 2014 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 agreed to ... | apache-2.0 |
Yadnyawalkya/integration_tests | cfme/automate/dialogs/service_dialogs.py | 2 | 4651 | import attr
from cached_property import cached_property
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from widgetastic.utils import Fillable
from widgetastic.widget import Text
from cfme.automate.dialogs import AddDialogView
from cfme.automate.dialogs import AutomateCustomizationVie... | gpl-2.0 |
toros-astro/corral | tests/pipeline.py | 1 | 1869 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017, Cabral, Juan; Sanchez, Bruno & Berois, Martín
# 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 sourc... | bsd-3-clause |
nguyenhongson03/scrapy | scrapy/commands/settings.py | 114 | 1503 | from __future__ import print_function
from scrapy.commands import ScrapyCommand
class Command(ScrapyCommand):
requires_project = False
default_settings = {'LOG_ENABLED': False}
def syntax(self):
return "[options]"
def short_desc(self):
return "Get settings values"
def add_option... | bsd-3-clause |
s20121035/rk3288_android5.1_repo | external/deqp/modules/gles3/scripts/gen-swizzles.py | 9 | 7969 | import sys
import random
import operator
import itertools
from genutil import *
random.seed(1234567)
indices = xrange(sys.maxint)
# Swizzles:
# - vector components
# * int, float, bool vectors
# * .xyzw, .rgba, .stpq
# * illegal to mix
# * not allowed for scalar types
# * legal to chain: vec4.rgba.xyzw.stp... | gpl-3.0 |
dezelin/kvm | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (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, sys
sys.path.append(os.env... | gpl-2.0 |
commonwealth-of-puerto-rico/lean | paart/apps/projects/migrations/0014_auto__add_field_benefit_enabled__add_field_topic_enabled__add_field_op.py | 2 | 11156 | # -*- 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 field 'Benefit.enabled'
db.add_column('projects_benefit', 'enabled',
self.gf(... | gpl-3.0 |
sejongoh/coreclr | tests/scripts/lst_creator.py | 27 | 7039 | #!/usr/bin/env python
#
## Licensed to the .NET Foundation under one or more agreements.
## The .NET Foundation licenses this file to you under the MIT license.
## See the LICENSE file in the project root for more information.
#
##
# Title :lst_creator.py
#
# Script to create a working list file from the ... | mit |
collex100/odoo | addons/purchase_analytic_plans/__openerp__.py | 260 | 1725 | # -*- 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 |
dinoperovic/djangoshop-shopit | shopit/admin/modifier.py | 1 | 4766 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from adminsortable2.admin import SortableAdminMixin, SortableInlineAdminMixin
from django.contrib import admin
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
from parler.admin import Tran... | bsd-3-clause |
dhermes/google-cloud-python | logging/noxfile.py | 2 | 4279 | # Copyright 2016 Google LLC
#
# 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, s... | apache-2.0 |
danilito19/django | django/conf/locale/de/formats.py | 504 | 1100 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
Jonekee/chromium.src | build/android/pylib/device/intent.py | 68 | 3309 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Manages intents and associated information.
This is generally intended to be used with functions that calls Android's
Am command.
"""
class Intent(objec... | bsd-3-clause |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/pygments/lexers/d.py | 31 | 9530 | # -*- coding: utf-8 -*-
"""
pygments.lexers.d
~~~~~~~~~~~~~~~~~
Lexers for D languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pygments.token import Text, Comment, Ke... | gpl-3.0 |
fieldhawker/upm | examples/python/sx6119.py | 16 | 1832 | #!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 limi... | mit |
etamminga/domoticz | scripts/python/googlepubsub.py | 34 | 1993 | import httplib2
import argparse
import base64
import csv
import datetime
import random
import sys
import time
import base64
import domoticz
# This script connects Domoticz with Google Cloud PubSub API
# To make it works :
# 1 - Install the Google API Client Python Library : pip install --upgrade google-api-python-clie... | gpl-3.0 |
Caleb-Ellis/CS50 | pset6/sentiments/application.py | 1 | 1388 | from flask import Flask, redirect, render_template, request, url_for
import os
import sys
import nltk
import helpers
from analyzer import Analyzer
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/search")
def search():
# validate screen_name
screen_na... | mit |
frankrousseau/weboob | modules/canaltp/test.py | 7 | 1044 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | agpl-3.0 |
bruderstein/PythonScript | PythonLib/min/tabnanny.py | 36 | 11408 | #! /usr/bin/env python3
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The... | gpl-2.0 |
DirtyPiece/dancestudio | Build/Tools/Python27/Lib/idlelib/aboutDialog.py | 20 | 6680 | """About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self, parent, title, _htest=False):
"""
_htest - bool, change box location when running htes... | mit |
tectronics/cortex-vfx | python/IECoreMaya/BoxParameterUI.py | 17 | 4601 | ##########################################################################
#
# Copyright (c) 2010, Image Engine Design 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:
#
# * Redistribu... | bsd-3-clause |
mujin/mujincontrollerclientpy | python/mujincontrollerclient/realtimerobotclient.py | 1 | 47747 | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 MUJIN Inc
from . import json
from . import planningclient
import logging
log = logging.getLogger(__name__)
class RealtimeRobotControllerClient(planningclient.PlanningControllerClient):
"""mujin controller client for realtimerobot task
"""
_robotname = Non... | apache-2.0 |
qiwsir/vincent | examples/scatter_chart_examples.py | 9 | 2130 | # -*- coding: utf-8 -*-
"""
Vincent Scatter Examples
"""
#Build a Line Chart from scratch
from vincent import *
import pandas as pd
import pandas.io.data as web
import datetime
all_data = {}
date_start = datetime.datetime(2010, 1, 1)
date_end = datetime.datetime(2014, 1, 1)
for ticker in ['AAPL', 'IBM', 'YHOO', 'MS... | mit |
thunder-project/thunder | thunder/writers.py | 3 | 5920 | import os
import shutil
# standard library reorganization between Python 2 and 3
try:
from urllib.parse import urlparse
from urllib.request import url2pathname
except ImportError:
from urlparse import urlparse
from urllib import url2pathname
from thunder.readers import BotoClient, get_by_scheme
class... | apache-2.0 |
jjkoletar/panda3d | direct/src/leveleditor/ObjectPalette.py | 11 | 5583 | """
This is just a sample code.
LevelEditor, ObjectHandler, ObjectPalette should be rewritten
to be game specific.
You can define object template class inheriting ObjectBase
to define properties shared by multiple object types.
When you are defining properties
you should specify their name, UI type, data type,
update... | bsd-3-clause |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/pygments/lexers/_csound_builtins.py | 23 | 21643 | # -*- coding: utf-8 -*-
"""
pygments.lexers._csound_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Opcodes in Csound 6.05 from
# csound --list-opcodes
# except
# cggoto <http://www.csounds.... | gpl-3.0 |
Fale/ansible | test/units/module_utils/urls/test_urls.py | 74 | 4040 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.module_utils import urls
from ansible.module_utils._text import... | gpl-3.0 |
dhcrzf/zulip | zerver/tests/test_push_notifications.py | 1 | 72941 |
from contextlib import contextmanager
import itertools
import requests
import mock
from mock import call
import time
from typing import Any, Dict, List, Optional, Union, SupportsInt
import base64
import gcm
import json
import os
import ujson
import uuid
from django.test import TestCase, override_settings
from django... | apache-2.0 |
justanr/flask-restful | tests/test_accept.py | 17 | 7002 | import unittest
from flask import Flask
import flask_restful
from werkzeug import exceptions
from nose.tools import assert_equals
class AcceptTestCase(unittest.TestCase):
def test_accept_default_application_json(self):
class Foo(flask_restful.Resource):
def get(self):
return ... | bsd-3-clause |
iModels/foyer | foyer/smarts.py | 1 | 2666 | import lark
from foyer.exceptions import FoyerError
GRAMMAR = r"""
start: _string
// Rules
_string: _chain _nonlastbranch* _lastbranch?
_chain: atom _chain | atom
_nonlastbranch: "(" branch ")"
_lastbranch: branch
branch: _string
atom: ("[" weak_and_expression "]" | atom_symbol) atom_... | mit |
vadimtk/chrome4sdp | chrome/common/extensions/docs/server2/manifest_features.py | 122 | 1683 | # 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.
'''
Provides a Manifest Feature abstraction, similar to but more strict than the
Feature schema (see feature_utility.py).
Each Manifest Feature has a 'level... | bsd-3-clause |
mm112287/2015cda-24 | static/Brython3.1.0-20150301-090019/Lib/formatter.py | 751 | 14930 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | gpl-3.0 |
aray/spark | examples/src/main/python/ml/n_gram_example.py | 123 | 1545 | #
# 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 us... | apache-2.0 |
evernym/plenum | storage/directory_store.py | 2 | 1777 | import os
from pathlib import Path
class DirectoryStore:
"""
A file based implementation of a key value store.
"""
def __init__(self, baseDir, dbName):
"""
:param dbDir: The directory where the file storing the data would be
present
:param dbName: The name of the file ... | apache-2.0 |
infoxchange/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/redirects/middleware.py | 447 | 1105 | from django.contrib.redirects.models import Redirect
from django import http
from django.conf import settings
class RedirectFallbackMiddleware(object):
def process_response(self, request, response):
if response.status_code != 404:
return response # No need to check for a redirect for non-404 re... | gpl-3.0 |
pdellaert/ansible | test/integration/targets/service/files/ansible_test_service.py | 48 | 1455 | #!/usr/bin/env python
# this is mostly based off of the code found here:
# http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
import os
import resource
import signal
import sys
import time
UMASK = 0
WORKDIR = "/"
MAXFD = 1024
if (hasattr(os, "devnull")):
REDIRECT_TO = os.devnull
else:
... | gpl-3.0 |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/nose-0.11.1-py2.7.egg/nose/inspector.py | 3 | 6918 | """Simple traceback introspection. Used to add additional information to
AssertionErrors in tests, so that failure messages may be more informative.
"""
import inspect
import logging
import re
import sys
import textwrap
import tokenize
try:
from cStringIO import StringIO
except ImportError:
from StringIO impor... | gpl-3.0 |
tinkhaven-organization/odoo | addons/mrp_repair/mrp_repair.py | 148 | 36935 | # -*- 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 |
tryexceptpass/sofi | sofi/ui/basicblock.py | 2 | 1097 | from .element import Element
class BasicBlock(Element):
"""Implements <pre> tag"""
def __init__(self, text=None, cl=None, ident=None, style=None, attrs=None):
super().__init__(cl=cl, ident=ident, style=style, attrs=attrs)
if text:
self._children.append(text)
def __repr__(sel... | mit |
aleksandra-tarkowska/openmicroscopy | components/tools/OmeroPy/src/omero/conversions.py | 15 | 3812 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# 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;... | gpl-2.0 |
apinsard/funtoo-overlay | sys-apps/portage/files/pygrade.py | 10 | 1424 | #!/usr/bin/python
import portage, os, sys
kw=portage.settings["ACCEPT_KEYWORDS"].split()
root=portage.settings["ROOT"]
outfile=os.path.join(root,"/etc/portage/make.profile/parent")
oldlink=os.path.join(root,"/etc/make.profile")
if not os.path.lexists(oldlink) and os.path.exists(outfile):
print("System appears upgraded... | gpl-2.0 |
BackupTheBerlios/freespeak | freespeak/translators/opentran.py | 1 | 5737 | # FreeSpeak - a GUI frontend to online translator engines
# freespeak/translators/opentran.py
#
## Copyright (C) 2005, 2006, 2007, 2008, 2009 Luca Bruno <lethalman88@gmail.com>
##
## This file is part of FreeSpeak.
##
## FreeSpeak is free software; you can redistribute it and/or modify
## it under the terms of the ... | gpl-2.0 |
Flexget/Flexget | flexget/plugins/clients/pyload.py | 1 | 9436 | from urllib.parse import quote
from loguru import logger
from requests.exceptions import RequestException
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.utils import json
from flexget.utils.template import RenderError
logger = logger.bind(name='p... | mit |
nickdex/cosmos | code/computer_graphics/src/diamond_square/diamond_square.py | 3 | 3544 | import numpy as np
def show_as_height_map(height, mat):
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
x, y = np.meshgrid(np.arange(height), np.arange(height))
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(x, y, mat)
plt.title("heig... | gpl-3.0 |
moritz9/redash | tests/models/test_permissions.py | 5 | 3590 | from tests import BaseTestCase
from redash.models import AccessPermission
from redash.permissions import ACCESS_TYPE_MODIFY, ACCESS_TYPE_VIEW
class TestAccessPermissionGrant(BaseTestCase):
def test_creates_correct_object(self):
q = self.factory.create_query()
permission = AccessPermission.grant(ob... | bsd-2-clause |
eaglexmw/seascope | src/view/filecontext/plugins/ctags_view/CtagsManager.py | 4 | 5242 | # Copyright (c) 2010 Anil Kumar
# All rights reserved.
#
# License: BSD
import subprocess
import re, os
def _eintr_retry_call(func, *args):
while True:
try:
return func(*args)
except OSError, e:
if e.errno == errno.EINTR:
continue
raise
def cmdForFile(f):
suffix_cmd_map = []
custom_map = os.gete... | bsd-3-clause |
marmida/s3pub | s3pub/progress.py | 1 | 2300 | '''
Progress bar customizations.
'''
import progressbar
# Notes about progressbar: each ProgressBar has only one maximum, but we
# ideally want two (files and bytes). Trying to animate two bars
# simultaneously just confuses progressbar. We can work around this by
# changing text widgets in the bar during each upda... | mit |
tiddlyweb/tiddlywebwiki | test/test_web_tiddlywiki_title.py | 1 | 2928 | import wsgi_intercept
import httplib2
from wsgi_intercept import httplib2_intercept
from tiddlyweb.model.tiddler import Tiddler
from fixtures import muchdata, reset_textstore, _teststore
def setup_module(module):
from tiddlyweb.web import serve
def app_fn():
return serve.load_app()
httplib2_i... | bsd-3-clause |
valentin-krasontovitsch/ansible | lib/ansible/module_utils/facts/system/platform.py | 93 | 3974 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
pubnative/redash | redash/handlers/destinations.py | 5 | 2986 | import json
from flask import make_response, request
from flask.ext.restful import abort
from funcy import project
from redash import models
from redash.permissions import require_admin
from redash.destinations import destinations, get_configuration_schema_for_destination_type
from redash.utils.configuration import C... | bsd-2-clause |
Saturn/livestreamer | src/livestreamer/plugins/beattv.py | 34 | 10334 | import re
from collections import namedtuple
from io import BytesIO
try:
from Crypto.Cipher import AES
CAN_DECRYPT = True
except ImportError:
CAN_DECRYPT = False
from livestreamer.compat import range
from livestreamer.exceptions import StreamError
from livestreamer.packages.flashmedia.tag import (
AAC... | bsd-2-clause |
openstack/trove | trove/instance/models.py | 1 | 83877 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2013-2014 Rackspace Hosting
# 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://... | apache-2.0 |
sk1tt1sh/python-docx | tests/opc/test_phys_pkg.py | 3 | 6544 | # encoding: utf-8
"""
Test suite for docx.opc.phys_pkg module
"""
from __future__ import absolute_import
try:
from io import BytesIO # Python 3
except ImportError:
from StringIO import StringIO as BytesIO
import hashlib
import pytest
from mock import Mock
from zipfile import ZIP_DEFLATED, ZipFile
from do... | mit |
allenlavoie/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear.py | 3 | 38940 | # 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 |
drmrd/ansible | lib/ansible/modules/network/ios/ios_banner.py | 23 | 5436 | #!/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 |
ubuntu-core/snapcraft | snapcraft/internal/build_providers/_multipass/_multipass_command.py | 1 | 15411 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program 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 Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
oudalab/fajita | pythonAPI/flask/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
alxgu/ansible | lib/ansible/modules/network/cloudengine/ce_mtu.py | 27 | 19856 | #!/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 |
Jionglun/622Q1 | static/Brython3.1.1-20150328-091302/Lib/xml/dom/__init__.py | 873 | 4019 | """W3C Document Object Model implementation for Python.
The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.
This package contains the following modules:
minidom -- A simple implementation of the Level 1 DOM with namespace
sup... | gpl-3.0 |
tupolev/plugin.video.mitele | lib/youtube_dl/extractor/coub.py | 20 | 4711 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_iso8601,
qualities,
)
class CoubIE(InfoExtractor):
_VALID_URL = r'(?:coub:|https?://(?:coub\.com/(?:view|embed|coubs)/|c-cdn\.coub\... | gpl-3.0 |
sensysnetworks/uClinux | user/python/Lib/test/test_struct.py | 8 | 4338 | from test_support import TestFailed, verbose
import struct
## import pdb
def simple_err(func, *args):
try:
apply(func, args)
except struct.error:
pass
else:
raise TestFailed, "%s%s did not raise struct.error" % (
func.__name__, args)
## pdb.set_trace()
simple_err(s... | gpl-2.0 |
lombritz/odoo | addons/purchase_requisition/wizard/bid_line_qty.py | 374 | 1711 | # -*- 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 |
aleida/django | tests/regressiontests/localflavor/tests.py | 21 | 1815 | from __future__ import absolute_import
from .ar.tests import ARLocalFlavorTests
from .at.tests import ATLocalFlavorTests
from .au.tests import AULocalflavorTests
from .be.tests import BELocalFlavorTests
from .br.tests import BRLocalFlavorTests
from .ca.tests import CALocalFlavorTests
from .ch.tests import CHLocalFlavo... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.